]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
move authentication modules to plugins/
[tt-rss.git] / include / functions.php
index d03fcfb15f0c4efaead5e3a33be17300919894e0..f6ef7c2b370ca02ac9cf302f9824d968c36d305c 100644 (file)
                if (!SINGLE_USER_MODE) {
 
                        $user_id = false;
-                       $modules = explode(",", AUTH_MODULES);
+                       /* $modules = explode(",", AUTH_MODULES);
 
                        foreach ($modules as $module) {
                                $module_class = "auth_$module";
                                        print T_sprintf("Fatal: authentication module %s not found.", $module);
                                        die;
                                }
+                       } */
+
+                       global $pluginhost;
+                       foreach ($pluginhost->get_hooks($pluginhost::HOOK_AUTH_USER) as $plugin) {
+
+                               $user_id = (int) $plugin->authenticate($login, $password);
+
+                               if ($user_id) {
+                                       $_SESSION["auth_module"] = strtolower(get_class($plugin));
+                                       break;
+                               }
                        }
 
                        if ($user_id && !$check_only) {