mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Clean up admin IP whitelist and block at login time
This commit is contained in:
parent
a499aa0d1f
commit
9e9b09464f
17 changed files with 92 additions and 38 deletions
|
|
@ -294,12 +294,33 @@ class memberAdminModel extends member
|
|||
*
|
||||
* @return boolean (true : allowed, false : refuse)
|
||||
*/
|
||||
function getMemberAdminIPCheck()
|
||||
function getMemberAdminIPCheck($allow_list = null, $deny_list = null)
|
||||
{
|
||||
$admin_ip_list = config('admin.allow');
|
||||
if(!$admin_ip_list) return true;
|
||||
if(!count($admin_ip_list) || IpFilter::filter($admin_ip_list)) return true;
|
||||
else return false;
|
||||
if ($allow_list = ($allow_list === null) ? config('admin.allow') : $allow_list)
|
||||
{
|
||||
foreach ($allow_list as $range)
|
||||
{
|
||||
if (Rhymix\Framework\IpFilter::inRange(RX_CLIENT_IP, $range))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($deny_list = ($deny_list === null) ? config('admin.deny') : $deny_list)
|
||||
{
|
||||
foreach ($deny_list as $range)
|
||||
{
|
||||
if (Rhymix\Framework\IpFilter::inRange(RX_CLIENT_IP, $range))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/* End of file member.admin.model.php */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue