Commit 288f1986 authored by Kjartan's avatar Kjartan
Browse files

- use $HTTP_SERVER_VARS instead of $GLOBAL[REMOTE_ADDR] to be

  less reliant on php config.
parent 75982edb
...@@ -20,15 +20,15 @@ function sess_read($key) { ...@@ -20,15 +20,15 @@ function sess_read($key) {
} }
function sess_write($key, $value) { function sess_write($key, $value) {
global $REMOTE_ADDR; global $HTTP_SERVER_VARS;
db_query("UPDATE user SET hostname = '". check_input($REMOTE_ADDR) ."', timestamp = '". time() ."' WHERE session = '$key'"); db_query("UPDATE user SET hostname = '". check_input($HTTP_SERVER_VARS[REMOTE_ADDR]) ."', timestamp = '". time() ."' WHERE session = '$key'");
} }
function sess_destroy($key) { function sess_destroy($key) {
global $REMOTE_ADDR; global $HTTP_SERVER_VARS;
db_query("UPDATE user SET hostname = '". check_input($REMOTE_ADDR) ."', timestamp = '". time() ."', session = '' WHERE session = '$key'"); db_query("UPDATE user SET hostname = '". check_input($HTTP_SERVER_VARS[REMOTE_ADDR]) ."', timestamp = '". time() ."', session = '' WHERE session = '$key'");
} }
function sess_gc($lifetime) { function sess_gc($lifetime) {
......
...@@ -20,15 +20,15 @@ function sess_read($key) { ...@@ -20,15 +20,15 @@ function sess_read($key) {
} }
function sess_write($key, $value) { function sess_write($key, $value) {
global $REMOTE_ADDR; global $HTTP_SERVER_VARS;
db_query("UPDATE user SET hostname = '". check_input($REMOTE_ADDR) ."', timestamp = '". time() ."' WHERE session = '$key'"); db_query("UPDATE user SET hostname = '". check_input($HTTP_SERVER_VARS[REMOTE_ADDR]) ."', timestamp = '". time() ."' WHERE session = '$key'");
} }
function sess_destroy($key) { function sess_destroy($key) {
global $REMOTE_ADDR; global $HTTP_SERVER_VARS;
db_query("UPDATE user SET hostname = '". check_input($REMOTE_ADDR) ."', timestamp = '". time() ."', session = '' WHERE session = '$key'"); db_query("UPDATE user SET hostname = '". check_input($HTTP_SERVER_VARS[REMOTE_ADDR]) ."', timestamp = '". time() ."', session = '' WHERE session = '$key'");
} }
function sess_gc($lifetime) { function sess_gc($lifetime) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment