obsolete ip_address field in ttrss_sessions
This commit is contained in:
parent
657770a09c
commit
a2e9b45759
|
@ -873,7 +873,7 @@
|
|||
}
|
||||
|
||||
function validate_session($link) {
|
||||
if (SESSION_CHECK_ADDRESS && !DATABASE_BACKED_SESSIONS && $_SESSION["uid"]) {
|
||||
if (SESSION_CHECK_ADDRESS && $_SESSION["uid"]) {
|
||||
if ($_SESSION["ip_address"]) {
|
||||
if ($_SESSION["ip_address"] != $_SERVER["REMOTE_ADDR"]) {
|
||||
return false;
|
||||
|
|
|
@ -263,7 +263,6 @@ create table ttrss_scheduled_updates (id integer not null primary key auto_incre
|
|||
create table ttrss_sessions (id varchar(250) unique not null primary key,
|
||||
data text,
|
||||
expire integer not null,
|
||||
ip_address varchar(15) not null default '',
|
||||
index (id),
|
||||
index (expire)) TYPE=InnoDB;
|
||||
|
||||
|
|
|
@ -239,8 +239,7 @@ create table ttrss_scheduled_updates (id serial not null primary key,
|
|||
|
||||
create table ttrss_sessions (id varchar(250) unique not null primary key,
|
||||
data text,
|
||||
expire integer not null,
|
||||
ip_address varchar(15) not null default '');
|
||||
expire integer not null);
|
||||
|
||||
create index ttrss_sessions_expire_index on ttrss_sessions(expire);
|
||||
|
||||
|
|
22
sessions.php
22
sessions.php
|
@ -23,12 +23,6 @@
|
|||
|
||||
global $session_connection,$session_read;
|
||||
|
||||
$ip_address = $_SERVER["REMOTE_ADDR"];
|
||||
|
||||
if (SESSION_CHECK_ADDRESS) {
|
||||
$address_check_qpart = " AND ip_address = '$ip_address'";
|
||||
}
|
||||
|
||||
$query = "SELECT data FROM ttrss_sessions WHERE id='$id' $address_check_qpart";
|
||||
|
||||
$res = db_query($session_connection, $query);
|
||||
|
@ -54,18 +48,12 @@
|
|||
|
||||
$data = db_escape_string(base64_encode($data), $session_connection);
|
||||
|
||||
$ip_address = $_SERVER["REMOTE_ADDR"];
|
||||
|
||||
if (SESSION_CHECK_ADDRESS) {
|
||||
$address_check_qpart = " AND ip_address = '$ip_address'";
|
||||
}
|
||||
|
||||
if ($session_read) {
|
||||
$query = "UPDATE ttrss_sessions SET data='$data',
|
||||
expire='$expire' WHERE id='$id' $address_check_qpart";
|
||||
} else {
|
||||
$query = "INSERT INTO ttrss_sessions (id, data, expire, ip_address)
|
||||
VALUES ('$id', '$data', '$expire', '$ip_address')";
|
||||
$query = "INSERT INTO ttrss_sessions (id, data, expire)
|
||||
VALUES ('$id', '$data', '$expire')";
|
||||
}
|
||||
|
||||
db_query($session_connection, $query);
|
||||
|
@ -85,12 +73,6 @@
|
|||
|
||||
global $session_connection;
|
||||
|
||||
$ip_address = $_SERVER["REMOTE_ADDR"];
|
||||
|
||||
if (SESSION_CHECK_ADDRESS) {
|
||||
$address_check_qpart = " AND ip_address = '$ip_address'";
|
||||
}
|
||||
|
||||
$query = "DELETE FROM ttrss_sessions WHERE id = '$id' $address_check_qpart";
|
||||
|
||||
db_query($session_connection, $query);
|
||||
|
|
Loading…
Reference in New Issue