diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-08-26 21:27:30 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-08-26 21:27:30 -0400 |
commit | a24840a5332d717d2afa8516d1df0b4e4b958dd1 (patch) | |
tree | 2350ee0a92fd7a6fccb8fdc76b1a3e34581c75c1 /app/Controller/UserCredentialController.php | |
parent | 793eb1074f6df9f5dfa5ffece0219228a2cddfad (diff) |
Add the possibility to unlock users from the user interface
Diffstat (limited to 'app/Controller/UserCredentialController.php')
-rw-r--r-- | app/Controller/UserCredentialController.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/Controller/UserCredentialController.php b/app/Controller/UserCredentialController.php index 4021dc37..98fe967d 100644 --- a/app/Controller/UserCredentialController.php +++ b/app/Controller/UserCredentialController.php @@ -106,4 +106,21 @@ class UserCredentialController extends BaseController return $this->changeAuthentication($values, $errors); } + + /** + * Unlock user + */ + public function unlock() + { + $user = $this->getUser(); + $this->checkCSRFParam(); + + if ($this->userLockingModel->resetFailedLogin($user['username'])) { + $this->flash->success(t('User unlocked successfully.')); + } else { + $this->flash->failure(t('Unable to unlock the user.')); + } + + $this->response->redirect($this->helper->url->to('UserViewController', 'show', array('user_id' => $user['id']))); + } } |