MDL-59409 admin: check access to every setting in category
This commit is contained in:
committed by
Jake Dallimore
parent
6d0649e537
commit
033429a51c
+8
-4
@@ -7397,21 +7397,25 @@ function admin_find_write_settings($node, $data) {
|
||||
}
|
||||
|
||||
if ($node instanceof admin_category) {
|
||||
$entries = array_keys($node->children);
|
||||
foreach ($entries as $entry) {
|
||||
$return = array_merge($return, admin_find_write_settings($node->children[$entry], $data));
|
||||
if ($node->check_access()) {
|
||||
$entries = array_keys($node->children);
|
||||
foreach ($entries as $entry) {
|
||||
$return = array_merge($return, admin_find_write_settings($node->children[$entry], $data));
|
||||
}
|
||||
}
|
||||
|
||||
} else if ($node instanceof admin_settingpage) {
|
||||
if ($node->check_access()) {
|
||||
foreach ($node->settings as $setting) {
|
||||
$fullname = $setting->get_full_name();
|
||||
if (array_key_exists($fullname, $data)) {
|
||||
$return[$fullname] = $setting;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user