mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +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
|
|
@ -35,6 +35,7 @@
|
|||
<action name="getMemberMenu" type="model" standalone="true" />
|
||||
<action name="getMemberAdminColorset" type="model" standalone="true" />
|
||||
<action name="getMemberAdminInsertJoinForm" type="model" />
|
||||
<action name="getMemberAdminIPCheck" type="model" standalone="true" />
|
||||
|
||||
<action name="procMemberLogin" type="controller" standalone="true" ruleset="@login" />
|
||||
<action name="procMemberOpenIDLogin" type="controller" standalone="true" ruleset="openidLogin" />
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1478,8 +1478,8 @@
|
|||
if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, time()+60*60*24*365, '/');
|
||||
}
|
||||
if($this->memberInfo->is_admin == 'Y') {
|
||||
$oModuleAdminModel = &getAdminModel('module');
|
||||
if(!$oModuleAdminModel->getModuleAdminIPCheck()) {
|
||||
$oMemberAdminModel = &getAdminModel('member');
|
||||
if(!$oMemberAdminModel->getMemberAdminIPCheck()) {
|
||||
$_SESSION['denied_admin'] = 'Y';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue