aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/authController.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-06 18:53:36 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-06 18:53:36 +0100
commitd3a93ea2905ae50a2365d293f9f3ef3e51bf5f30 (patch)
treefbf240e82b244fc19907529750dd8be912d97b4b /app/Controllers/authController.php
parentd27efeec04c7c41cf0f52bc7f89879e66f2e44a9 (diff)
BREAKING FEATURE: Remove general in config
General attribute has been removed from system config. Now subattributes (e.g. environment, salt, title, etc.) are directly accessible. YOU HAVE TO FIX YOUR ./data/config.php file! - Remove the general array - Values inside this array must be kept - To see what it must look like, please have a look to ./data/config.default.php (but keep your values!!). See https://github.com/FreshRSS/FreshRSS/issues/730
Diffstat (limited to 'app/Controllers/authController.php')
-rw-r--r--app/Controllers/authController.php28
1 files changed, 13 insertions, 15 deletions
diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php
index 3a1ad4605..4ae9ff7fb 100644
--- a/app/Controllers/authController.php
+++ b/app/Controllers/authController.php
@@ -27,7 +27,6 @@ class FreshRSS_auth_Controller extends Minz_ActionController {
if (Minz_Request::isPost()) {
$ok = true;
- $general = FreshRSS_Context::$system_conf->general;
$current_token = FreshRSS_Context::$user_conf->token;
$token = Minz_Request::param('token', $current_token);
FreshRSS_Context::$user_conf->_token($token);
@@ -40,20 +39,19 @@ class FreshRSS_auth_Controller extends Minz_ActionController {
$auth_type = Minz_Request::param('auth_type', 'none');
$unsafe_autologin = Minz_Request::param('unsafe_autologin', false);
$api_enabled = Minz_Request::param('api_enabled', false);
- if ($anon != $general['allow_anonymous'] ||
- $auth_type != $general['auth_type'] ||
- $anon_refresh != $general['allow_anonymous_refresh'] ||
- $unsafe_autologin != $general['unsafe_autologin_enabled'] ||
- $api_enabled != $general['api_enabled']) {
+ if ($anon != FreshRSS_Context::$system_conf->allow_anonymous ||
+ $auth_type != FreshRSS_Context::$system_conf->auth_type ||
+ $anon_refresh != FreshRSS_Context::$system_conf->allow_anonymous_refresh ||
+ $unsafe_autologin != FreshRSS_Context::$system_conf->unsafe_autologin_enabled ||
+ $api_enabled != FreshRSS_Context::$system_conf->api_enabled) {
// TODO: test values from form
- $general['auth_type'] = $auth_type;
- $general['allow_anonymous'] = $anon;
- $general['allow_anonymous_refresh'] = $anon_refresh;
- $general['unsafe_autologin_enabled'] = $unsafe_autologin;
- $general['api_enabled'] = $api_enabled;
+ FreshRSS_Context::$system_conf->auth_type = $auth_type;
+ FreshRSS_Context::$system_conf->allow_anonymous = $anon;
+ FreshRSS_Context::$system_conf->allow_anonymous_refresh = $anon_refresh;
+ FreshRSS_Context::$system_conf->unsafe_autologin_enabled = $unsafe_autologin;
+ FreshRSS_Context::$system_conf->api_enabled = $api_enabled;
- $system_conf->general = $general;
$ok &= $system_conf->save();
}
@@ -80,7 +78,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController {
Minz_Request::forward(array('c' => 'index', 'a' => 'index'), true);
}
- $auth_type = FreshRSS_Context::$system_conf->general['auth_type'];
+ $auth_type = FreshRSS_Context::$system_conf->auth_type;
switch ($auth_type) {
case 'form':
Minz_Request::forward(array('c' => 'auth', 'a' => 'formLogin'));
@@ -160,7 +158,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController {
Minz_Request::bad(_t('feedback.auth.login.invalid'),
array('c' => 'auth', 'a' => 'login'));
}
- } elseif (FreshRSS_Context::$system_conf->general['unsafe_autologin_enabled']) {
+ } elseif (FreshRSS_Context::$system_conf->unsafe_autologin_enabled) {
$username = Minz_Request::param('u', '');
$password = Minz_Request::param('p', '');
Minz_Request::_param('p');
@@ -301,7 +299,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController {
$this->view->no_form = false;
// Enable changement of auth only if Persona!
- if (FreshRSS_Context::$system_conf->general['auth_type'] != 'persona') {
+ if (FreshRSS_Context::$system_conf->auth_type != 'persona') {
$this->view->message = array(
'status' => 'bad',
'title' => _t('gen.short.damn'),