summaryrefslogtreecommitdiff
path: root/app/Controllers/configureController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-28 13:54:52 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-28 13:54:52 +0100
commit9ac1496d63da32524a33696187342ce061e9ef28 (patch)
treefc45025f1055c9a4fa2eee26240617badecef969 /app/Controllers/configureController.php
parent45b2decce03e218fe7ad66479491123ce398ab1f (diff)
Bouge anon_access dans config.php
L'accès anonyme n'est pas au niveau utilisateur mais au niveau global. Bouge FreshRSS_Configuration::conf->anonAccess() qui était stocké dans *_user.php vers Minz_Configuration::allowAnonymous() stocké dans config.php Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126 + autres optimisations Contribue à https://github.com/marienfressinaud/FreshRSS/issues/260
Diffstat (limited to 'app/Controllers/configureController.php')
-rwxr-xr-xapp/Controllers/configureController.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php
index 487f6e4ad..dd9674588 100755
--- a/app/Controllers/configureController.php
+++ b/app/Controllers/configureController.php
@@ -398,15 +398,13 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
$current_token = $this->view->conf->token();
$mail = Minz_Request::param('mail_login', false);
- $anon = Minz_Request::param('anon_access', 'no');
$token = Minz_Request::param('token', $current_token);
+
$this->view->conf->_mailLogin($mail);
- $this->view->conf->_anonAccess($anon);
$this->view->conf->_token($token);
$values = array(
'mail_login' => $this->view->conf->mailLogin(),
- 'anon_access' => $this->view->conf->anonAccess(),
'token' => $this->view->conf->token(),
);
@@ -415,7 +413,12 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
Minz_Session::_param('conf', $this->view->conf);
Minz_Session::_param('mail', $this->view->conf->mailLogin());
- // notif
+ $anon = (bool)(Minz_Request::param('anon_access', false));
+ if ($anon != Minz_Configuration::allowAnonymous()) {
+ Minz_Configuration::_allowAnonymous($anon);
+ Minz_Configuration::writeFile();
+ }
+
$notif = array(
'type' => 'good',
'content' => Minz_Translate::t('configuration_updated')