summaryrefslogtreecommitdiff
path: root/app/Controllers/usersController.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-07 17:28:56 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-07 17:28:56 +0200
commit99cdd2a0ad7d0c0bf8965ddac2661cfa4c57809d (patch)
treef8cd10a71e2def0c61934e8751012829e4349b1f /app/Controllers/usersController.php
parent530a1d4b6b043f6b6976bb7ad25b380c29d5b5a4 (diff)
parentdbf57266b297c3f831602ec4f451c27a5ad71e6b (diff)
Merge branch 'refactor-authentication' into dev
Diffstat (limited to 'app/Controllers/usersController.php')
-rw-r--r--app/Controllers/usersController.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/Controllers/usersController.php b/app/Controllers/usersController.php
index 7d0171bc7..11862ce27 100644
--- a/app/Controllers/usersController.php
+++ b/app/Controllers/usersController.php
@@ -5,7 +5,7 @@ class FreshRSS_users_Controller extends Minz_ActionController {
const BCRYPT_COST = 9; //Will also have to be computed client side on mobile devices, so do not use a too high cost
public function firstAction() {
- if (!$this->view->loginOk) {
+ if (!FreshRSS_Auth::hasAccess()) {
Minz_Error::error(
403,
array('error' => array(_t('access_denied')))
@@ -51,7 +51,7 @@ class FreshRSS_users_Controller extends Minz_ActionController {
$this->view->conf->_apiPasswordHash($passwordHash);
}
- if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) {
+ if (FreshRSS_Auth::hasAccess('admin')) {
$this->view->conf->_mail_login(Minz_Request::param('mail_login', '', true));
}
$email = $this->view->conf->mail_login;
@@ -65,7 +65,7 @@ class FreshRSS_users_Controller extends Minz_ActionController {
$ok &= (file_put_contents($personaFile, Minz_Session::param('currentUser', '_')) !== false);
}
- if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) {
+ if (FreshRSS_Auth::hasAccess('admin')) {
$current_token = $this->view->conf->token;
$token = Minz_Request::param('token', $current_token);
$this->view->conf->_token($token);
@@ -105,7 +105,7 @@ class FreshRSS_users_Controller extends Minz_ActionController {
}
public function createAction() {
- if (Minz_Request::isPost() && Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) {
+ if (Minz_Request::isPost() && FreshRSS_Auth::hasAccess('admin')) {
$db = Minz_Configuration::dataBase();
require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php');
@@ -177,7 +177,7 @@ class FreshRSS_users_Controller extends Minz_ActionController {
}
public function deleteAction() {
- if (Minz_Request::isPost() && Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) {
+ if (Minz_Request::isPost() && FreshRSS_Auth::hasAccess('admin')) {
$db = Minz_Configuration::dataBase();
require_once(APP_PATH . '/SQL/install.sql.' . $db['type'] . '.php');