def login_locked_out(self, login): users = find_users(self.context) user = users and users.get(login=login) if not user: return False mng = LockoutManager(self.context, login) return mng.maxed_number_of_attempts()
def login_failed(event): # we are only going to log attempts for valid users users = find_users(event.site) user = users and users.get(login=event.login) if not user: return mng = LockoutManager(event.site, event.login) mng.add_attempt()
def login_success(event): mng = LockoutManager(event.site, event.login) mng.clear()