Software /
code /
prosody
Comparison
util/sasl/plain.lua @ 3164:db9def53fe9c
Check in mod_hashpassauth -- works!
author | Jeff Mitchell <jeff@jefferai.org> |
---|---|
date | Wed, 26 May 2010 18:16:58 -0400 |
parent | 3080:8e842989ced2 |
child | 3173:bb4286962d69 |
comparison
equal
deleted
inserted
replaced
3163:a23168cc4af5 | 3164:db9def53fe9c |
---|---|
27 function(username, realm) | 27 function(username, realm) |
28 return password, state; | 28 return password, state; |
29 end | 29 end |
30 | 30 |
31 plain_test: | 31 plain_test: |
32 function(username, realm, password) | 32 function(username, password, realm) |
33 return true or false, state; | 33 return true or false, state; |
34 end | 34 end |
35 ]] | 35 ]] |
36 | 36 |
37 local function plain(self, message) | 37 local function plain(self, message) |
58 if self.profile.plain then | 58 if self.profile.plain then |
59 local correct_password; | 59 local correct_password; |
60 correct_password, state = self.profile.plain(authentication, self.realm); | 60 correct_password, state = self.profile.plain(authentication, self.realm); |
61 if correct_password == password then correct = true; else correct = false; end | 61 if correct_password == password then correct = true; else correct = false; end |
62 elseif self.profile.plain_test then | 62 elseif self.profile.plain_test then |
63 correct, state = self.profile.plain_test(authentication, self.realm, password); | 63 correct, state = self.profile.plain_test(authentication, password, self.realm); |
64 end | 64 end |
65 | 65 |
66 self.username = authentication | 66 self.username = authentication |
67 if not state then | 67 if not state then |
68 return "failure", "account-disabled"; | 68 return "failure", "account-disabled"; |