55 end |
55 end |
56 |
56 |
57 local correct, state = false, false; |
57 local correct, state = false, false; |
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(self, authentication, self.realm); |
61 correct = (correct_password == password); |
61 correct = (correct_password == password); |
62 elseif self.profile.plain_test then |
62 elseif self.profile.plain_test then |
63 correct, state = self.profile.plain_test(authentication, password, self.realm); |
63 correct, state = self.profile.plain_test(self, 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"; |