From 7f90fdbf97ccd03450283f171ed587c342886432 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 4 Jan 2009 08:17:41 -0800 Subject: [PATCH] pass config to get_session_ip, so it knows what mask to use --- core/util.inc.php | 5 +---- ext/user/main.php | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/core/util.inc.php b/core/util.inc.php index b126d543..3542b91f 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -183,13 +183,10 @@ function get_memory_limit() { return $memory; } -function get_session_ip() { - global $config; - +function get_session_ip($config) { $mask = $config->get_string("session_hash_mask", "255.255.0.0"); $addr = $_SERVER['REMOTE_ADDR']; $addr = inet_ntop(inet_pton($addr) & inet_pton($mask)); - return $addr; } diff --git a/ext/user/main.php b/ext/user/main.php index d259a499..d7051ba8 100644 --- a/ext/user/main.php +++ b/ext/user/main.php @@ -238,7 +238,7 @@ class UserPage implements Extension { private function set_login_cookie($name, $pass) { global $config; - $addr = get_session_ip(); + $addr = get_session_ip($config); $hash = md5(strtolower($name) . $pass); setcookie("shm_user", $name,