plugins/mod_auth_internal.lua

changeset 3335
f13306ce3417
parent 3287
e425e27c12be
equal deleted inserted replaced
3334:73f078caf99d 3335:f13306ce3417
61 local account = datamanager.load(username, host, "accounts"); 61 local account = datamanager.load(username, host, "accounts");
62 if not account then 62 if not account then
63 log("debug", "account not found for username '%s' at host '%s'", username, module.host); 63 log("debug", "account not found for username '%s' at host '%s'", username, module.host);
64 return nil, "Auth failed. Invalid username"; 64 return nil, "Auth failed. Invalid username";
65 end 65 end
66 if account.password == nil or string.len(account.password) == 0 then
67 log("debug", "account password not set or zero-length for username '%s' at host '%s'", username, module.host);
68 return nil, "Auth failed. Password invalid.";
69 end
70 return true; 66 return true;
71 end 67 end
72 68
73 function provider.create_user(username, password) 69 function provider.create_user(username, password)
74 if is_cyrus(host) then return nil, "Account creation/modification not available with Cyrus SASL."; end 70 if is_cyrus(host) then return nil, "Account creation/modification not available with Cyrus SASL."; end

mercurial