Fix syntax error
'enabled' status of a user was not consistently checked for all auth schemes
Check for IP address validity and prevent duplicate addresses.