]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/auth/Auth_ldap.class.php
Added special auth handling for admin@localhost.
[timetracker.git] / WEB-INF / lib / auth / Auth_ldap.class.php
index 25d375bc992379c6570e20d9396dbafdc08e1390..b3f5d52a2fc619c58efb8f3e21ca205abe89aaae 100644 (file)
@@ -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!');
     }