aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-09-12 18:15:46 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-09-12 18:15:46 +0200
commit133e369afff02e5984fe4ce5109e33fd2fbccfc7 (patch)
tree445feb4bf7631f7f10d1d715dab297afca3cc65c /app/Controllers
parentf148e3938cc8daaaef1c71853594fbe142a1329e (diff)
parent0204e8ff08ba9ae103c46d08484cf30aedfb9148 (diff)
Version 1.1.3-beta1.1.3-beta
Diffstat (limited to 'app/Controllers')
-rwxr-xr-xapp/Controllers/configureController.php34
-rw-r--r--app/Controllers/userController.php24
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);
- }
}