Mercurial > prosody-hg
comparison plugins/mod_auth_internal.lua @ 3335:f13306ce3417
mod_auth_internal, mod_auth_internal_hashed: Remove checking for nil or empty password and pretending it means the user doesn't exist. Hopefully with more success than Custer.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 08 Jul 2010 20:59:53 +0100 |
| parents | e425e27c12be |
| children |
comparison
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 |
