Mercurial > prosody-modules
comparison mod_auth_joomla/mod_auth_joomla.lua @ 814:881ec9919144
mod_auth_*: Use module:provides(), and don't explicitly specify provider.name.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Thu, 13 Sep 2012 00:08:29 +0500 |
| parents | 97f6d7c4aaed |
| children | 7dbde05b48a9 |
comparison
equal
deleted
inserted
replaced
| 813:2469f779b3f7 | 814:881ec9919144 |
|---|---|
| 102 local crypt = getCryptedPassword(password, salt); | 102 local crypt = getCryptedPassword(password, salt); |
| 103 return crypt..':'..salt; | 103 return crypt..':'..salt; |
| 104 end | 104 end |
| 105 | 105 |
| 106 | 106 |
| 107 provider = { name = "joomla" }; | 107 provider = {}; |
| 108 | 108 |
| 109 function provider.test_password(username, password) | 109 function provider.test_password(username, password) |
| 110 local hash = get_password(username); | 110 local hash = get_password(username); |
| 111 return hash and joomlaCheckHash(password, hash); | 111 return hash and joomlaCheckHash(password, hash); |
| 112 end | 112 end |
| 176 return "failure", "not-authorized", "Unable to authorize you with the authentication credentials you've sent."; | 176 return "failure", "not-authorized", "Unable to authorize you with the authentication credentials you've sent."; |
| 177 end | 177 end |
| 178 return sasl; | 178 return sasl; |
| 179 end | 179 end |
| 180 | 180 |
| 181 module:add_item("auth-provider", provider); | 181 module:provides("auth", provider); |
| 182 | 182 |
