properly save auth_module after logging in

master
Andrew Dolgov 6 years ago
parent 77aebd7e4a
commit 9dadbdbb21

@ -700,13 +700,14 @@
if (!SINGLE_USER_MODE) { if (!SINGLE_USER_MODE) {
$user_id = false; $user_id = false;
$auth_module = false;
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_AUTH_USER) as $plugin) { foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_AUTH_USER) as $plugin) {
$user_id = (int) $plugin->authenticate($login, $password); $user_id = (int) $plugin->authenticate($login, $password);
if ($user_id) { if ($user_id) {
$_SESSION["auth_module"] = strtolower(get_class($plugin)); $auth_module = strtolower(get_class($plugin));
break; break;
} }
} }
@ -723,6 +724,7 @@
$_SESSION["uid"] = $user_id; $_SESSION["uid"] = $user_id;
$_SESSION["version"] = VERSION_STATIC; $_SESSION["version"] = VERSION_STATIC;
$_SESSION["auth_module"] = $auth_module;
$pdo = DB::pdo(); $pdo = DB::pdo();
$sth = $pdo->prepare("SELECT login,access_level,pwd_hash FROM ttrss_users $sth = $pdo->prepare("SELECT login,access_level,pwd_hash FROM ttrss_users

Loading…
Cancel
Save