diff options
| author | 2014-10-27 21:45:30 +0100 | |
|---|---|---|
| committer | 2014-10-27 21:45:30 +0100 | |
| commit | c6f35ef51c2c536efb4f8e73603ae46b8512cc24 (patch) | |
| tree | c5698ae0abd10e19730f44c287689746153d9345 /app/Controllers/categoryController.php | |
| parent | 299495d0820dd6a8c26842264a3b15b95884b9fb (diff) | |
Global limits for number of feeds and categories
New 'limits' sub-array in config.php with 'max_feeds' and
'max_categories'. If the values are < 0, then it is the default value
(16384).
https://github.com/marienfressinaud/FreshRSS/issues/680
Diffstat (limited to 'app/Controllers/categoryController.php')
| -rw-r--r-- | app/Controllers/categoryController.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/Controllers/categoryController.php b/app/Controllers/categoryController.php index 977ce51be..ef8af7ed6 100644 --- a/app/Controllers/categoryController.php +++ b/app/Controllers/categoryController.php @@ -33,6 +33,13 @@ class FreshRSS_category_Controller extends Minz_ActionController { $catDAO = new FreshRSS_CategoryDAO(); $url_redirect = array('c' => 'subscription', 'a' => 'index'); + $limits = Minz_Configuration::limits(); + $this->view->categories = $catDAO->listCategories(false); + if (count($this->view->categories) >= $limits['max_categories']) { + Minz_Request::bad(_t('over_max_categories', $limits['max_categories']), $url_redirect); + return; + } + if (Minz_Request::isPost()) { invalidateHttpCache(); |
