pass config to get_session_ip, so it knows what mask to use

This commit is contained in:
Shish 2009-01-04 08:17:41 -08:00
parent 93b7467fdd
commit 7f90fdbf97
2 changed files with 2 additions and 5 deletions

View file

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

View file

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