aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-02-13 21:45:25 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-02-13 21:45:25 +0100
commit4dd673157b05fea5fe3643f16e22d01bbf005fe9 (patch)
treef380194b02b8127d813aed61252e8210ec5861db /lib
parentb77d9c60ac0cc6614ccc2711ab647d5e0a5037ed (diff)
Add possibility to anonymous to refresh feeds
Obviously, it's optional! (and deactivate by default) Need some more tests? See #351
Diffstat (limited to 'lib')
-rw-r--r--lib/Minz/Configuration.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php
index 572b9984d..b3de9e39e 100644
--- a/lib/Minz/Configuration.php
+++ b/lib/Minz/Configuration.php
@@ -52,6 +52,7 @@ class Minz_Configuration {
private static $delay_cache = 3600;
private static $default_user = '';
private static $allow_anonymous = false;
+ private static $allow_anonymous_refresh = false;
private static $auth_type = 'none';
private static $db = array (
@@ -118,6 +119,9 @@ class Minz_Configuration {
public static function allowAnonymous() {
return self::$allow_anonymous;
}
+ public static function allowAnonymousRefresh() {
+ return self::$allow_anonymous_refresh;
+ }
public static function authType() {
return self::$auth_type;
}
@@ -131,6 +135,9 @@ class Minz_Configuration {
public static function _allowAnonymous($allow = false) {
self::$allow_anonymous = ((bool)$allow) && self::canLogIn();
}
+ public static function _allowAnonymousRefresh($allow = false) {
+ self::$allow_anonymous_refresh = ((bool)$allow) && self::allowAnonymous();
+ }
public static function _authType($value) {
$value = strtolower($value);
switch ($value) {
@@ -170,6 +177,7 @@ class Minz_Configuration {
'title' => self::$title,
'default_user' => self::$default_user,
'allow_anonymous' => self::$allow_anonymous,
+ 'allow_anonymous_refresh' => self::$allow_anonymous_refresh,
'auth_type' => self::$auth_type,
),
'db' => self::$db,
@@ -276,7 +284,16 @@ class Minz_Configuration {
self::_authType($general['auth_type']);
}
if (isset ($general['allow_anonymous'])) {
- self::$allow_anonymous = ((bool)($general['allow_anonymous'])) && ($general['allow_anonymous'] !== 'no');
+ self::$allow_anonymous = (
+ ((bool)($general['allow_anonymous'])) &&
+ ($general['allow_anonymous'] !== 'no')
+ );
+ }
+ if (isset ($general['allow_anonymous_refresh'])) {
+ self::$allow_anonymous_refresh = (
+ ((bool)($general['allow_anonymous_refresh'])) &&
+ ($general['allow_anonymous_refresh'] !== 'no')
+ );
}
// Base de données