From fa432755cc9d0cc71be54d463bdfb7558d62c5f1 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 12 Jul 2015 12:16:56 +0200 Subject: Implement cURL options https://github.com/FreshRSS/FreshRSS/issues/897 Requires that https://github.com/FreshRSS/FreshRSS/pull/898 is merged first. --- data/config.default.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'data') diff --git a/data/config.default.php b/data/config.default.php index 97085df29..6a8300872 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -1,7 +1,7 @@ array( + # Options to disable SSL/TLS certificate check (e.g. for self-signed HTTPS) + //CURLOPT_SSL_VERIFYHOST => 0, + //CURLOPT_SSL_VERIFYPEER => false, + + # Options to use a proxy for retrieving feeds. + //CURLOPT_PROXYTYPE = CURLPROXY_HTTP, + //CURLOPT_PROXYAUTH = CURLAUTH_BASIC, + //CURLOPT_PROXY => '127.0.0.1', + //CURLOPT_PROXYPORT => 8080, + //CURLOPT_PROXYUSERPWD => 'user:password', + ), + 'db' => array( # Type of database: `sqlite` or `mysql`. -- cgit v1.2.3 From 26ed0e5c9571dfdaac22f147bda793cc25c9e661 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 12 Jul 2015 12:52:18 +0200 Subject: Syntax error for curl optiona array https://github.com/FreshRSS/FreshRSS/issues/897 --- data/config.default.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'data') diff --git a/data/config.default.php b/data/config.default.php index 6a8300872..9a3ec87d7 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -87,10 +87,10 @@ return array( //CURLOPT_SSL_VERIFYPEER => false, # Options to use a proxy for retrieving feeds. - //CURLOPT_PROXYTYPE = CURLPROXY_HTTP, - //CURLOPT_PROXYAUTH = CURLAUTH_BASIC, + //CURLOPT_PROXYTYPE => CURLPROXY_HTTP, //CURLOPT_PROXY => '127.0.0.1', //CURLOPT_PROXYPORT => 8080, + //CURLOPT_PROXYAUTH => CURLAUTH_BASIC, //CURLOPT_PROXYUSERPWD => 'user:password', ), -- cgit v1.2.3 From d3a20cac129e63d57da27c16d5a11cc5db2a4db8 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 17 Jul 2015 18:16:00 +0200 Subject: Change default value for db['host'] and ['prefix'] See https://github.com/FreshRSS/FreshRSS/issues/890 --- data/config.default.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'data') diff --git a/data/config.default.php b/data/config.default.php index 9a3ec87d7..6013b13b8 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -100,7 +100,7 @@ return array( 'type' => 'sqlite', # MySQL host. - 'host' => '', + 'host' => 'localhost', # MySQL user. 'user' => '', @@ -112,7 +112,7 @@ return array( 'base' => '', # MySQL table prefix. - 'prefix' => '', + 'prefix' => 'freshrss_', 'pdo_options' => array( //PDO::MYSQL_ATTR_SSL_KEY => '/path/to/client-key.pem', -- cgit v1.2.3 From ac8bd3d2512dd1bfca43d71ea10202ba9e6a82a6 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 21 Jul 2015 15:31:23 +0200 Subject: Add a max_registrations limit - Allow user to create accounts (not implemented) - Admin only can set this limit See https://github.com/FreshRSS/FreshRSS/issues/679 --- app/Controllers/userController.php | 24 ++++++++++++++++++++++++ app/Models/ConfigurationSetter.php | 3 +++ app/views/user/manage.phtml | 19 +++++++++++++++++++ data/config.default.php | 4 ++++ 4 files changed, 50 insertions(+) (limited to 'data') diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index ed01b83c5..1c7745753 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -211,4 +211,28 @@ class FreshRSS_user_Controller extends Minz_ActionController { Minz_Request::forward(array('c' => 'user', 'a' => 'manage'), 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); + } } diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.php index 4bd29ecb0..236bf5b0b 100644 --- a/app/Models/ConfigurationSetter.php +++ b/app/Models/ConfigurationSetter.php @@ -352,6 +352,9 @@ class FreshRSS_ConfigurationSetter { 'min' => 0, 'max' => $max_small_int, ), + 'max_registrations' => array( + 'min' => 0, + ), ); foreach ($values as $key => $value) { diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml index fe1b6618b..a7cbf0795 100644 --- a/app/views/user/manage.phtml +++ b/app/views/user/manage.phtml @@ -3,6 +3,25 @@
+
+ + +
+ +
+ + +
+
+ +
+
+ + +
+
+
+
diff --git a/data/config.default.php b/data/config.default.php index 6013b13b8..5db933ff8 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -77,6 +77,10 @@ return array( # Max number of categories for a user. 'max_categories' => 16384, + # Max number of accounts that anonymous users can create + # 0 for an unlimited number of accounts + # 1 is to not allow user registrations (1 is corresponding to the admin account) + 'max_registrations' => 1, ), # Options used by cURL when making HTTP requests, e.g. when the SimplePie library retrieves feeds. -- cgit v1.2.3