diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-09-09 01:33:51 +1000 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-09-09 01:33:51 +1000 |
| commit | eea4e42609e319b38f14bca9f31cc3327ffaf175 (patch) | |
| tree | 50eff229bcb7314e6f22837f1046a151adf3ddf7 /inc/mod/config-editor.php | |
| parent | 9a846d5ad5838d4db824623d9916d6b4e34c29ee (diff) | |
Add ability to create custom user/permissions groups
Diffstat (limited to 'inc/mod/config-editor.php')
| -rw-r--r-- | inc/mod/config-editor.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/inc/mod/config-editor.php b/inc/mod/config-editor.php index 3f15ebe5..4493fd2b 100644 --- a/inc/mod/config-editor.php +++ b/inc/mod/config-editor.php @@ -3,7 +3,7 @@ function permission_to_edit_config_var($varname) { global $config, $mod; - if (is_array($config['mod']['config'][DISABLED])) { + if (isset($config['mod']['config'][DISABLED])) { foreach ($config['mod']['config'][DISABLED] as $disabled_var_name) { $disabled_var_name = explode('>', $disabled_var_name); if (count($disabled_var_name) == 1) @@ -14,10 +14,11 @@ function permission_to_edit_config_var($varname) { } $allow_only = false; - // for ($perm = (int)$mod['type']; $perm >= JANITOR; $perm --) { - for ($perm = JANITOR; $perm <= (int)$mod['type']; $perm ++) { + foreach ($config['mod']['groups'] as $perm => $perm_name) { + if ($perm > $mod['type']) + break; $allow_only = false; - if (is_array($config['mod']['config'][$perm])) { + if (isset($config['mod']['config'][$perm]) && is_array($config['mod']['config'][$perm])) { foreach ($config['mod']['config'][$perm] as $perm_var_name) { if ($perm_var_name == '!') { $allow_only = true; @@ -92,7 +93,7 @@ function config_vars() { continue; // This is just an alias. if (!preg_match('/^array|\[\]|function/', $var['default']) && !preg_match('/^Example: /', trim(implode(' ', $var['comment'])))) { $syntax_error = true; - $temp = eval('$syntax_error = false;return ' . $var['default'] . ';'); + $temp = eval('$syntax_error = false;return @' . $var['default'] . ';'); if ($syntax_error && $temp === false) { error('Error parsing config.php (line ' . $line_no . ')!', null, $var); } elseif (!isset($temp)) { |
