obsolete ip_address field in ttrss_sessions

This commit is contained in:
Andrew Dolgov 2006-03-27 17:23:50 +01:00
parent 657770a09c
commit a2e9b45759
4 changed files with 4 additions and 24 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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);