X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=WEB-INF%2Flib%2Fauth%2FAuth_ldap.class.php;h=625c47828df7a0b1c13f3151d6fa06d79c3af787;hb=db2ca21db73a2ea52155510e1e0300541d6b9ef6;hp=25d375bc992379c6570e20d9396dbafdc08e1390;hpb=806dde3c7931d1a0d13c4f0469013a79e6198dcc;p=timetracker.git diff --git a/WEB-INF/lib/auth/Auth_ldap.class.php b/WEB-INF/lib/auth/Auth_ldap.class.php index 25d375bc..625c4782 100644 --- a/WEB-INF/lib/auth/Auth_ldap.class.php +++ b/WEB-INF/lib/auth/Auth_ldap.class.php @@ -51,7 +51,7 @@ class Auth_ldap extends Auth { var $params; - function Auth_ldap($params) + function __construct($params) { $this->params = $params; if (isset($GLOBALS['smarty'])) { @@ -78,6 +78,13 @@ class Auth_ldap extends Auth { */ function authenticate($login, $password) { + // Special handling for admin@localhost - authenticate against db, not ldap. + // It is a fallback mechanism when admin account in LDAP directory does not exist or is misconfigured. + if ($login == 'admin@localhost') { + import('auth.Auth_db'); + return Auth_db::authenticate($login, $password); + } + if (!function_exists('ldap_bind')) { die ('php_ldap extension not loaded!'); }