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"; |