login: check for stale session in login handler, instead of authenticate_user()
This commit is contained in:
parent
f730d7bb0a
commit
f8fc1ac543
|
@ -465,6 +465,14 @@ class Handler_Public extends Handler {
|
||||||
|
|
||||||
function login() {
|
function login() {
|
||||||
if (!SINGLE_USER_MODE) {
|
if (!SINGLE_USER_MODE) {
|
||||||
|
/* if a session is started here there's a stale login cookie we need to clean */
|
||||||
|
|
||||||
|
if (session_status() != PHP_SESSION_NONE) {
|
||||||
|
$_SESSION["login_error_msg"] = __("Stale session cookie found, try logging in again");
|
||||||
|
|
||||||
|
header("Location: " . get_self_url_prefix());
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$login = clean($_POST["login"]);
|
$login = clean($_POST["login"]);
|
||||||
$password = clean($_POST["password"]);
|
$password = clean($_POST["password"]);
|
||||||
|
|
|
@ -714,13 +714,6 @@
|
||||||
|
|
||||||
if ($user_id && !$check_only) {
|
if ($user_id && !$check_only) {
|
||||||
|
|
||||||
/* if a session is started here there's a stale login cookie we need to clean */
|
|
||||||
|
|
||||||
if (session_status() != PHP_SESSION_NONE) {
|
|
||||||
$_SESSION["login_error_msg"] = __("Stale session cookie found, try logging in again");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
session_regenerate_id(true);
|
session_regenerate_id(true);
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue