diff options
Diffstat (limited to 'app/Controllers')
| -rwxr-xr-x | app/Controllers/configureController.php | 34 | ||||
| -rw-r--r-- | app/Controllers/userController.php | 24 |
2 files changed, 34 insertions, 24 deletions
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 248a3edcc..0dc7ceab2 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -293,4 +293,38 @@ class FreshRSS_configure_Controller extends Minz_ActionController { Minz_Request::good(_t('feedback.conf.query_created', $query['name']), array('c' => 'configure', 'a' => 'queries')); } + + /** + * This action handles the system configuration page. + * + * It displays the system configuration page. + * If this action is reach through a POST request, it stores all new + * configuration values then sends a notification to the user. + * + * The options available on the page are: + * - user limit (default: 1) + * - user category limit (default: 16384) + * - user feed limit (default: 16384) + */ + public function systemAction() { + if (!FreshRSS_Auth::hasAccess('admin')) { + Minz_Error::error(403); + } + if (Minz_Request::isPost()) { + $limits = FreshRSS_Context::$system_conf->limits; + $limits['max_registrations'] = Minz_Request::param('max-registrations', 1); + $limits['max_feeds'] = Minz_Request::param('max-feeds', 16384); + $limits['max_categories'] = Minz_Request::param('max-categories', 16384); + FreshRSS_Context::$system_conf->limits = $limits; + FreshRSS_Context::$system_conf->title = Minz_Request::param('instance-name', 'FreshRSS'); + FreshRSS_Context::$system_conf->save(); + + invalidateHttpCache(); + + Minz_Session::_param('notification', array( + 'type' => 'good', + 'content' => _t('feedback.conf.updated') + )); + } + } } diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 428cd145d..1c7d621f1 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -272,28 +272,4 @@ class FreshRSS_user_Controller extends Minz_ActionController { Minz_Request::forward($redirect_url, true); } - - /** - * This action updates the max number of registrations. - * - * Request parameter is: - * - max-registrations (int >= 0) - */ - public function setRegistrationAction() { - if (Minz_Request::isPost() && FreshRSS_Auth::hasAccess('admin')) { - $limits = FreshRSS_Context::$system_conf->limits; - $limits['max_registrations'] = Minz_Request::param('max-registrations', 1); - FreshRSS_Context::$system_conf->limits = $limits; - FreshRSS_Context::$system_conf->save(); - - invalidateHttpCache(); - - Minz_Session::_param('notification', array( - 'type' => 'good', - 'content' => _t('feedback.user.set_registration') - )); - } - - Minz_Request::forward(array('c' => 'user', 'a' => 'manage'), true); - } } |
