@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | // check if user has access permission, except admins |
| 15 | -if($_SESSION['mgrRole']!=1){ |
|
| 15 | +if($_SESSION['mgrRole']!=1) { |
|
| 16 | 16 | $rs = $modx->db->select( |
| 17 | 17 | 'sma.usergroup,mg.member', |
| 18 | 18 | $modx->getFullTableName("site_module_access")." sma |
@@ -70,7 +70,8 @@ discard block |
||
| 70 | 70 | * @param array $params |
| 71 | 71 | * @return string |
| 72 | 72 | */ |
| 73 | -function evalModule($moduleCode,$params){ |
|
| 73 | +function evalModule($moduleCode,$params) |
|
| 74 | +{ |
|
| 74 | 75 | global $modx; |
| 75 | 76 | $modx->event->params = &$params; // store params inside event object |
| 76 | 77 | if(is_array($params)) { |
@@ -80,11 +81,9 @@ discard block |
||
| 80 | 81 | $mod = eval($moduleCode); |
| 81 | 82 | $msg = ob_get_contents(); |
| 82 | 83 | ob_end_clean(); |
| 83 | - if (isset($php_errormsg)) |
|
| 84 | - { |
|
| 84 | + if (isset($php_errormsg)) { |
|
| 85 | 85 | $error_info = error_get_last(); |
| 86 | - switch($error_info['type']) |
|
| 87 | - { |
|
| 86 | + switch($error_info['type']) { |
|
| 88 | 87 | case E_NOTICE : |
| 89 | 88 | $error_level = 1; |
| 90 | 89 | case E_USER_NOTICE : |
@@ -97,8 +96,7 @@ discard block |
||
| 97 | 96 | default: |
| 98 | 97 | $error_level = 99; |
| 99 | 98 | } |
| 100 | - if($modx->config['error_reporting']==='99' || 2<$error_level) |
|
| 101 | - { |
|
| 99 | + if($modx->config['error_reporting']==='99' || 2<$error_level) { |
|
| 102 | 100 | $modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'] . ' - Module', $error_info['message'], $error_info['line'], $msg); |
| 103 | 101 | $modx->event->alert("An error occurred while loading. Please see the event log for more information<p>{$msg}</p>"); |
| 104 | 102 | } |