|
|
@ -1192,49 +1192,17 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* if ($_COOKIE[get_session_cookie_name()]) {
|
|
|
|
|
|
|
|
require_once "sessions.php";
|
|
|
|
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$login_action = $_POST["login_action"];
|
|
|
|
$login_action = $_POST["login_action"];
|
|
|
|
|
|
|
|
|
|
|
|
/* if (!validate_session($link) && $login_action != "do_login") {
|
|
|
|
|
|
|
|
logout_user();
|
|
|
|
|
|
|
|
render_login_form($link);
|
|
|
|
|
|
|
|
exit;
|
|
|
|
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$session_started = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# try to authenticate user if called from login form
|
|
|
|
# try to authenticate user if called from login form
|
|
|
|
if ($login_action == "do_login") {
|
|
|
|
if ($login_action == "do_login") {
|
|
|
|
$login = $_POST["login"];
|
|
|
|
$login = $_POST["login"];
|
|
|
|
$password = $_POST["password"];
|
|
|
|
$password = $_POST["password"];
|
|
|
|
$remember_me = $_POST["remember_me"];
|
|
|
|
$remember_me = $_POST["remember_me"];
|
|
|
|
|
|
|
|
|
|
|
|
if ($remember_me) {
|
|
|
|
|
|
|
|
session_set_cookie_params(SESSION_COOKIE_LIFETIME_REMEMBER);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
session_set_cookie_params(SESSION_COOKIE_LIFETIME);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require_once "sessions.php";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$session_started = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (authenticate_user($link, $login, $password)) {
|
|
|
|
if (authenticate_user($link, $login, $password)) {
|
|
|
|
$_POST["password"] = "";
|
|
|
|
$_POST["password"] = "";
|
|
|
|
|
|
|
|
|
|
|
|
if ($remember_me) {
|
|
|
|
|
|
|
|
$_SESSION["cookie_lifetime"] = time() +
|
|
|
|
|
|
|
|
SESSION_COOKIE_LIFETIME_REMEMBER;
|
|
|
|
|
|
|
|
} else if (SESSION_COOKIE_LIFETIME) {
|
|
|
|
|
|
|
|
$_SESSION["cookie_lifetime"] = time() + SESSION_COOKIE_LIFETIME;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setcookie("ttrss_cltime", $_SESSION["cookie_lifetime"],
|
|
|
|
|
|
|
|
$_SESSION["cookie_lifetime"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
header("Location: " . $_SERVER["REQUEST_URI"]);
|
|
|
|
header("Location: " . $_SERVER["REQUEST_URI"]);
|
|
|
|
exit;
|
|
|
|
exit;
|
|
|
|
|
|
|
|
|
|
|
@ -1244,17 +1212,16 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!$session_started) {
|
|
|
|
// print session_id();
|
|
|
|
require_once "sessions.php";
|
|
|
|
// print_r($_SESSION);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!$_SESSION["uid"] || !validate_session($link)) {
|
|
|
|
if (!$_SESSION["uid"] || !validate_session($link)) {
|
|
|
|
render_login_form($link);
|
|
|
|
render_login_form($link);
|
|
|
|
exit;
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
require_once "sessions.php";
|
|
|
|
|
|
|
|
return authenticate_user($link, "admin", null);
|
|
|
|
return authenticate_user($link, "admin", null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|