Diff

core/usermanager.lua @ 3113:30896751dd43

usermanager: Take datamanager errors into account when determining account existance.
author Waqas Hussain <waqas20@gmail.com>
date Mon, 24 May 2010 00:49:12 +0500
parent 3064:596303990c7c
child 3116:90a98a6b52ac
line wrap: on
line diff
--- a/core/usermanager.lua	Mon May 24 00:37:15 2010 +0500
+++ b/core/usermanager.lua	Mon May 24 00:49:12 2010 +0500
@@ -69,7 +69,8 @@
 
 function user_exists(username, host)
 	if not(require_provisioning) and is_cyrus(host) then return true; end
-	return datamanager.load(username, host, "accounts") ~= nil; -- FIXME also check for empty credentials
+	local account, err = datamanager.load(username, host, "accounts");
+	return (account or err) ~= nil; -- FIXME also check for empty credentials
 end
 
 function create_user(username, password, host)