aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/Configuration.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-29 02:12:46 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-29 02:12:46 +0100
commit220341b40642771f9b5db97296edfb1913182464 (patch)
treeb773f9cdbc58df963a024639da5a89673147188c /lib/Minz/Configuration.php
parent96bdbafceac44af2159e6b80d3d403e0608991d9 (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.php19
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;