Make user actions available from contextual menu

This commit is contained in:
Frederic Guillot
2017-03-11 15:24:34 -05:00
parent 469112918d
commit a22b8f3dc7
45 changed files with 161 additions and 86 deletions

View File

@@ -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'])));
}
}
}