diff options
| author | 2013-12-29 02:12:46 +0100 | |
|---|---|---|
| committer | 2013-12-29 02:12:46 +0100 | |
| commit | 220341b40642771f9b5db97296edfb1913182464 (patch) | |
| tree | b773f9cdbc58df963a024639da5a89673147188c /lib/Minz/Configuration.php | |
| parent | 96bdbafceac44af2159e6b80d3d403e0608991d9 (diff) | |
Implémente sélecteur de méthode d’authentification
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126
Diffstat (limited to 'lib/Minz/Configuration.php')
| -rw-r--r-- | lib/Minz/Configuration.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php index 3864a9335..d0c530ef7 100644 --- a/lib/Minz/Configuration.php +++ b/lib/Minz/Configuration.php @@ -53,6 +53,7 @@ class Minz_Configuration { private static $default_user = ''; private static $current_user = ''; private static $allow_anonymous = false; + private static $auth_type = 'none'; private static $db = array ( 'host' => false, @@ -103,9 +104,23 @@ class Minz_Configuration { public static function allowAnonymous() { return self::$allow_anonymous; } + public static function authType() { + return self::$auth_type; + } + public static function _allowAnonymous($allow = false) { self::$allow_anonymous = (bool)$allow; } + public static function _authType($value) { + $value = strtolower($value); + switch ($value) { + case 'none': + case 'http_auth': + case 'persona': + self::$auth_type = $value; + break; + } + } /** * Initialise les variables de configuration @@ -133,6 +148,7 @@ class Minz_Configuration { 'title' => self::$title, 'default_user' => self::$default_user, 'allow_anonymous' => self::$allow_anonymous, + 'auth_type' => self::$auth_type, ), 'db' => self::$db, ); @@ -234,6 +250,9 @@ class Minz_Configuration { if (isset ($general['allow_anonymous'])) { self::$allow_anonymous = ((bool)($general['allow_anonymous'])) && ($general['allow_anonymous'] !== 'no'); } + if (isset ($general['auth_type'])) { + self::_authType($general['auth_type']); + } // Base de données $db = false; |
