diff options
Diffstat (limited to 'app/Controller/UserApiAccessController.php')
-rw-r--r-- | app/Controller/UserApiAccessController.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/Controller/UserApiAccessController.php b/app/Controller/UserApiAccessController.php index e03514d5..0f1c891e 100644 --- a/app/Controller/UserApiAccessController.php +++ b/app/Controller/UserApiAccessController.php @@ -32,7 +32,7 @@ class UserApiAccessController extends BaseController 'api_access_token' => Token::getToken(), )); - $this->response->redirect($this->helper->url->to('UserApiAccessController', 'show', array('user_id' => $user['id']))); + $this->renderResponse(); } public function remove() @@ -45,6 +45,15 @@ class UserApiAccessController extends BaseController 'api_access_token' => null, )); - $this->response->redirect($this->helper->url->to('UserApiAccessController', 'show', array('user_id' => $user['id']))); + $this->renderResponse(); + } + + protected function renderResponse() + { + if ($this->request->isAjax()) { + $this->show(); + } else { + $this->response->redirect($this->helper->url->to('UserApiAccessController', 'show', array('user_id' => $user['id']))); + } } }
\ No newline at end of file |