pass config to get_session_ip, so it knows what mask to use
This commit is contained in:
parent
93b7467fdd
commit
7f90fdbf97
2 changed files with 2 additions and 5 deletions
|
@ -183,13 +183,10 @@ function get_memory_limit() {
|
||||||
return $memory;
|
return $memory;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_session_ip() {
|
function get_session_ip($config) {
|
||||||
global $config;
|
|
||||||
|
|
||||||
$mask = $config->get_string("session_hash_mask", "255.255.0.0");
|
$mask = $config->get_string("session_hash_mask", "255.255.0.0");
|
||||||
$addr = $_SERVER['REMOTE_ADDR'];
|
$addr = $_SERVER['REMOTE_ADDR'];
|
||||||
$addr = inet_ntop(inet_pton($addr) & inet_pton($mask));
|
$addr = inet_ntop(inet_pton($addr) & inet_pton($mask));
|
||||||
|
|
||||||
return $addr;
|
return $addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ class UserPage implements Extension {
|
||||||
private function set_login_cookie($name, $pass) {
|
private function set_login_cookie($name, $pass) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$addr = get_session_ip();
|
$addr = get_session_ip($config);
|
||||||
$hash = md5(strtolower($name) . $pass);
|
$hash = md5(strtolower($name) . $pass);
|
||||||
|
|
||||||
setcookie("shm_user", $name,
|
setcookie("shm_user", $name,
|
||||||
|
|
Reference in a new issue