summaryrefslogtreecommitdiff
path: root/app/Controller/TwoFactorController.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-03-11 15:24:34 -0500
committerFrederic Guillot <fred@kanboard.net>2017-03-11 15:24:34 -0500
commita22b8f3dc73555800caf55768f04a7a2ce4af7f2 (patch)
tree60257cb9b508da83be5a9477c434fb53cc3c6f6d /app/Controller/TwoFactorController.php
parent469112918d0cfa6a43a7fdb829cd19bdf85cfcbe (diff)
Make user actions available from contextual menu
Diffstat (limited to 'app/Controller/TwoFactorController.php')
-rw-r--r--app/Controller/TwoFactorController.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/app/Controller/TwoFactorController.php b/app/Controller/TwoFactorController.php
index 73060c44..80f89fbd 100644
--- a/app/Controller/TwoFactorController.php
+++ b/app/Controller/TwoFactorController.php
@@ -100,10 +100,15 @@ class TwoFactorController extends UserViewController
unset($this->sessionStorage->twoFactorSecret);
$this->userSession->disablePostAuthentication();
- $this->response->redirect($this->helper->url->to('TwoFactorController', 'index', array('user_id' => $user['id'])));
+ $this->response->redirect($this->helper->url->to('TwoFactorController', 'index', array('user_id' => $user['id'])), true);
} else {
$this->flash->failure(t('The two factor authentication code is not valid.'));
- $this->response->redirect($this->helper->url->to('TwoFactorController', 'show', array('user_id' => $user['id'])));
+
+ if ($this->request->isAjax()) {
+ $this->show();
+ } else {
+ $this->response->redirect($this->helper->url->to('TwoFactorController', 'show', array('user_id' => $user['id'])));
+ }
}
}
@@ -127,7 +132,7 @@ class TwoFactorController extends UserViewController
$this->userSession->disablePostAuthentication();
$this->flash->success(t('User updated successfully.'));
- $this->response->redirect($this->helper->url->to('TwoFactorController', 'index', array('user_id' => $user['id'])));
+ $this->response->redirect($this->helper->url->to('TwoFactorController', 'index', array('user_id' => $user['id'])), true);
}
/**
@@ -192,7 +197,7 @@ class TwoFactorController extends UserViewController
'twofactor_secret' => '',
));
- $this->response->redirect($this->helper->url->to('UserViewController', 'show', array('user_id' => $user['id'])));
+ $this->response->redirect($this->helper->url->to('UserViewController', 'show', array('user_id' => $user['id'])), true);
} else {
$this->response->html($this->helper->layout->user('twofactor/disable', array(
'user' => $user,