validate_session: check for user agent
This commit is contained in:
parent
5203901036
commit
837ec70e3e
|
@ -621,6 +621,7 @@
|
||||||
$_SESSION["uid"]);
|
$_SESSION["uid"]);
|
||||||
|
|
||||||
$_SESSION["ip_address"] = $_SERVER["REMOTE_ADDR"];
|
$_SESSION["ip_address"] = $_SERVER["REMOTE_ADDR"];
|
||||||
|
$_SESSION["user_agent"] = sha1($_SERVER['HTTP_USER_AGENT']);
|
||||||
$_SESSION["pwd_hash"] = db_fetch_result($result, 0, "pwd_hash");
|
$_SESSION["pwd_hash"] = db_fetch_result($result, 0, "pwd_hash");
|
||||||
|
|
||||||
$_SESSION["last_version_check"] = time();
|
$_SESSION["last_version_check"] = time();
|
||||||
|
|
|
@ -57,6 +57,9 @@
|
||||||
if ($_SESSION["ref_schema_version"] != session_get_schema_version($link, true))
|
if ($_SESSION["ref_schema_version"] != session_get_schema_version($link, true))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (sha1($_SERVER['HTTP_USER_AGENT']) != $_SESSION["user_agent"])
|
||||||
|
return false;
|
||||||
|
|
||||||
if ($_SESSION["uid"]) {
|
if ($_SESSION["uid"]) {
|
||||||
$result = db_query($link,
|
$result = db_query($link,
|
||||||
"SELECT pwd_hash FROM ttrss_users WHERE id = '".$_SESSION["uid"]."'");
|
"SELECT pwd_hash FROM ttrss_users WHERE id = '".$_SESSION["uid"]."'");
|
||||||
|
|
Loading…
Reference in New Issue