Merge branch 'whitelist' into 'master'
whitelist for submodules See merge request composer/PHP_Library!4
This commit is contained in:
commit
55a6560634
1 changed files with 16 additions and 15 deletions
|
|
@ -166,9 +166,11 @@ class Filter_Login extends Filter_Filter
|
||||||
$module = $request->get('module');
|
$module = $request->get('module');
|
||||||
$action = $request->get('action');
|
$action = $request->get('action');
|
||||||
|
|
||||||
$file = Path::join(CMS_PATH, 'modules', $module, 'filters', 'white.json');
|
$moduleDir = explode('_',$module)[0];
|
||||||
|
$file = Path::join(CMS_PATH, 'modules', $moduleDir, 'filters', 'white.json');
|
||||||
if (file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
$whiteList = json_decode(file_get_contents($file), true);
|
$whiteList = json_decode(file_get_contents($file), true);
|
||||||
|
|
||||||
if (in_array($action, $whiteList)) {
|
if (in_array($action, $whiteList)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -177,4 +179,3 @@ class Filter_Login extends Filter_Filter
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue