mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
fixed check module grant
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9624 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
28efdf9307
commit
289f077588
3 changed files with 9 additions and 6 deletions
|
|
@ -516,7 +516,6 @@
|
|||
$type = Mobile::isFromMobilePhone() ? 'mobile' : 'view';
|
||||
$oMessageObject = &ModuleHandler::getModuleInstance('message',$type);
|
||||
$oMessageObject->setError(-1);
|
||||
debugPrint($this->error);
|
||||
$oMessageObject->setMessage($this->error);
|
||||
$oMessageObject->dispMessage();
|
||||
|
||||
|
|
|
|||
|
|
@ -135,11 +135,10 @@
|
|||
$grant = $oModuleModel->getGrant($request_module, $logged_info);
|
||||
}
|
||||
} else {
|
||||
$grant = $oModuleModel->getGrant($module_info, $logged_info, $xml_info);
|
||||
// have at least access grant
|
||||
if ($module_info->module == 'admin' || $this->module == $module_info->module)
|
||||
$grant = $oModuleModel->getGrant($module_info, $logged_info, $xml_info);
|
||||
else
|
||||
$grant->access = 1;
|
||||
if( substr_count($this->act, 'Member') || substr_count($this->act, 'Communication'))
|
||||
$grant->access = 1;
|
||||
}
|
||||
// display no permission if the current module doesn't have an access privilege
|
||||
//if(!$grant->access) return $this->stop("msg_not_permitted");
|
||||
|
|
|
|||
|
|
@ -159,6 +159,9 @@ class Validator
|
|||
$names = array();
|
||||
if($key{0} == '^') {
|
||||
$names = preg_grep('/^'.preg_quote(substr($key,1)).'/', $field_names);
|
||||
}elseif(substr($key,-2) == '[]'){
|
||||
$filters[substr($key,0,-2)] = $filter;
|
||||
unset($filters[$key]);
|
||||
}
|
||||
|
||||
if(!count($names)) continue;
|
||||
|
|
@ -171,11 +174,13 @@ class Validator
|
|||
}
|
||||
|
||||
foreach($filters as $key=>$filter) {
|
||||
$fname = $key;
|
||||
$fname = preg_replace('/\[\]$/', '', $key);
|
||||
$exists = array_key_exists($key, $fields);
|
||||
$filter = array_merge($filter_default, $filter);
|
||||
$value = $exists ? $fields[$fname] : null;
|
||||
|
||||
if(is_array($value)) $value = implode('', $value);
|
||||
|
||||
// conditional statement
|
||||
foreach($filter['if'] as $cond) {
|
||||
if(!isset($cond['test']) || !isset($cond['attr'])) continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue