aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/usersController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-01-01 13:48:32 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-01-01 13:48:32 +0100
commit50c41d9bb2b1766feac984685bb2a954ab4799f3 (patch)
treedf15fd8557896511563928fe414073baf5c27751 /app/Controllers/usersController.php
parent8beb15460a3c55c37264fdf414e7dcf9ff4e2a62 (diff)
Détails multi-utilisateur
https://github.com/marienfressinaud/FreshRSS/issues/126
Diffstat (limited to 'app/Controllers/usersController.php')
-rw-r--r--app/Controllers/usersController.php47
1 files changed, 18 insertions, 29 deletions
diff --git a/app/Controllers/usersController.php b/app/Controllers/usersController.php
index 0ce3b3447..482e35c3e 100644
--- a/app/Controllers/usersController.php
+++ b/app/Controllers/usersController.php
@@ -10,9 +10,10 @@ class FreshRSS_users_Controller extends Minz_ActionController {
}
}
- public function idAction() {
+ public function authAction() {
if (Minz_Request::isPost()) {
$ok = true;
+
$mail = Minz_Request::param('mail_login', false);
$this->view->conf->_mail_login($mail);
$ok &= $this->view->conf->save();
@@ -25,36 +26,24 @@ class FreshRSS_users_Controller extends Minz_ActionController {
@unlink($personaFile);
$ok &= (file_put_contents($personaFile, Minz_Session::param('currentUser', '_')) !== false);
}
- invalidateHttpCache();
- //TODO: use $ok
- $notif = array(
- 'type' => 'good',
- 'content' => Minz_Translate::t('configuration_updated')
- );
- Minz_Session::_param('notification', $notif);
-
- Minz_Request::forward(array('c' => 'configure', 'a' => 'users'), true);
- }
- }
-
- public function authAction() {
- if (Minz_Request::isPost() && Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) {
- $ok = true;
- $current_token = $this->view->conf->token;
- $token = Minz_Request::param('token', $current_token);
- $this->view->conf->_token($token);
- $ok &= $this->view->conf->save();
-
- $anon = Minz_Request::param('anon_access', false);
- $anon = ((bool)$anon) && ($anon !== 'no');
- $auth_type = Minz_Request::param('auth_type', 'none');
- if ($anon != Minz_Configuration::allowAnonymous() ||
- $auth_type != Minz_Configuration::authType()) {
- Minz_Configuration::_allowAnonymous($anon);
- Minz_Configuration::_authType($auth_type);
- $ok &= Minz_Configuration::writeFile();
+ if (Minz_Configuration::isAdmin(Minz_Session::param('currentUser', '_'))) {
+ $current_token = $this->view->conf->token;
+ $token = Minz_Request::param('token', $current_token);
+ $this->view->conf->_token($token);
+ $ok &= $this->view->conf->save();
+
+ $anon = Minz_Request::param('anon_access', false);
+ $anon = ((bool)$anon) && ($anon !== 'no');
+ $auth_type = Minz_Request::param('auth_type', 'none');
+ if ($anon != Minz_Configuration::allowAnonymous() ||
+ $auth_type != Minz_Configuration::authType()) {
+ Minz_Configuration::_allowAnonymous($anon);
+ Minz_Configuration::_authType($auth_type);
+ $ok &= Minz_Configuration::writeFile();
+ }
}
+
invalidateHttpCache();
$notif = array(