Support server-side autolock IPs

This commit is contained in:
Guangcong Luo 2019-02-25 22:36:32 -05:00
parent a612743d74
commit fdad94ba7f

View File

@ -126,12 +126,13 @@ class NTBBSession {
$username = 'Guest';
$userid = 'guest';
}
return array(
return [
'username' => $username,
'userid' => $userid,
'group' => 0,
'loggedin' => false
);
'loggedin' => false,
'ip' => $this->getIp(),
];
}
function qsid() { return $this->scookie ? '?sid='.$this->scookie : ''; }
@ -461,6 +462,7 @@ class NTBBSession {
}
$ip = $this->getIp();
$forceUsertype = false;
if (in_array($ip, $psconfig['autolock_ip']) || in_array($user['ip'], $psconfig['autolock_ip'])) $forceUsertype = '5';
if (($user['userid'] === $userid) && !empty($user['loggedin'])) {
// already logged in