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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Reference in a new issue