mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 11:44:10 +09:00
issue 160, code arrange on genaral config
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9373 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
a4ab618883
commit
e6c4a3bd2a
7 changed files with 26 additions and 47 deletions
|
|
@ -206,5 +206,27 @@
|
|||
|
||||
$this->add('tpl', str_replace("\n"," ",$tpl));
|
||||
}
|
||||
function getMemberAdminIPCheck() {
|
||||
|
||||
$db_info = Context::getDBInfo();
|
||||
$admin_ip_list = $db_info->admin_ip_list;
|
||||
$admin_ip_list = explode(",",$admin_ip_list);
|
||||
$oMemberModel = &getModel('member');
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$falg = false;
|
||||
foreach($admin_ip_list as $admin_ip_list_key => $admin_ip_value) {
|
||||
if(preg_match('/^\d{1,3}(?:.(\d{1,3}|\*)){3}\s*$/', $admin_ip_value, $matches) && $ip) {
|
||||
$admin_ip = $matches[0];
|
||||
$admin_ip = str_replace('*','',$admin_ip);
|
||||
$admin_ip_patterns[] = preg_quote($admin_ip);
|
||||
$admin_ip_pattern = '/^('.implode($admin_ip_patterns,'|').')/';
|
||||
if(preg_match($admin_ip_pattern, $ip, $matches)) return true;
|
||||
$flag = true;
|
||||
}
|
||||
|
||||
}
|
||||
if(!$flag) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue