From 269c6b88c4486a0ae1a92df65578ee6ab6f0bbca Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 22 Aug 2015 09:33:58 -0400 Subject: Add a system configuration page It allows to modify system configuration from the interface. At the moment, only limits are modifiable. The user limit was removed from the user page and added here along with categories and feeds limits. --- app/Controllers/configureController.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'app/Controllers/configureController.php') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 248a3edcc..7a4d0ecd7 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -293,4 +293,37 @@ 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->save(); + + invalidateHttpCache(); + + Minz_Session::_param('notification', array( + 'type' => 'good', + 'content' => _t('feedback.conf.updated') + )); + } + } } -- cgit v1.2.3 From d396dd71524694766bde852834be15f477ceaf3e Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Mon, 24 Aug 2015 18:41:57 -0400 Subject: Add instance name in system configuration page --- app/Controllers/configureController.php | 1 + app/i18n/cz/admin.php | 1 + app/i18n/de/admin.php | 1 + app/i18n/en/admin.php | 1 + app/i18n/fr/admin.php | 1 + app/views/configure/system.phtml | 7 +++++++ 6 files changed, 12 insertions(+) (limited to 'app/Controllers/configureController.php') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 7a4d0ecd7..0dc7ceab2 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -316,6 +316,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $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(); diff --git a/app/i18n/cz/admin.php b/app/i18n/cz/admin.php index 6c9156335..e1fa5d141 100644 --- a/app/i18n/cz/admin.php +++ b/app/i18n/cz/admin.php @@ -148,6 +148,7 @@ return array( ), 'system' => array( '_' => 'System configuration', // @todo translate + 'instance-name' => 'Instance name', // @todo translate 'max-categories' => 'Categories per user limit', // @todo translate 'max-feeds' => 'Feeds per user limit', // @todo translate 'registration' => array( diff --git a/app/i18n/de/admin.php b/app/i18n/de/admin.php index 26d0bcd36..395b51acf 100644 --- a/app/i18n/de/admin.php +++ b/app/i18n/de/admin.php @@ -148,6 +148,7 @@ return array( ), 'system' => array( '_' => 'System configuration', // @todo translate + 'instance-name' => 'Instance name', // @todo translate 'max-categories' => 'Categories per user limit', // @todo translate 'max-feeds' => 'Feeds per user limit', // @todo translate 'registration' => array( diff --git a/app/i18n/en/admin.php b/app/i18n/en/admin.php index ad9038203..6edb38cf0 100644 --- a/app/i18n/en/admin.php +++ b/app/i18n/en/admin.php @@ -148,6 +148,7 @@ return array( ), 'system' => array( '_' => 'System configuration', + 'instance-name' => 'Instance name', 'max-categories' => 'Categories per user limit', 'max-feeds' => 'Feeds per user limit', 'registration' => array( diff --git a/app/i18n/fr/admin.php b/app/i18n/fr/admin.php index 44e013c2f..e73622577 100644 --- a/app/i18n/fr/admin.php +++ b/app/i18n/fr/admin.php @@ -148,6 +148,7 @@ return array( ), 'system' => array( '_' => 'Configuration du système', + 'instance-name' => 'Nom de l’instance', 'max-categories' => 'Limite de catégories par utilisateur', 'max-feeds' => 'Limite de flux par utilisateur', 'registration' => array( diff --git a/app/views/configure/system.phtml b/app/views/configure/system.phtml index 9c9813729..9406c34d6 100644 --- a/app/views/configure/system.phtml +++ b/app/views/configure/system.phtml @@ -6,6 +6,13 @@
+
+ +
+ +
+
+
-- cgit v1.2.3