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 |