Give the rest of the conf a place to be changed
A third of the settings had no control anywhere, so the answer to "where do I change this" was to open a file over SSH.
This commit is contained in:
@@ -105,11 +105,19 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
//
|
||||
// preg_quote first: the needle arrives from a query string, so it is matched as a literal
|
||||
// with boundaries around it rather than as a pattern a caller could widen to everything.
|
||||
$re = '/\b' . preg_quote($match, '/') . '\b/i';
|
||||
// "*" is every section this host has. Deliberately not the same as an empty needle, which
|
||||
// would match everything by accident rather than on purpose.
|
||||
$all = ($match === '*');
|
||||
$re = $all ? '' : '/\b' . preg_quote($match, '/') . '\b/i';
|
||||
$out = [];
|
||||
foreach (vv_get_conf_files() as $f) {
|
||||
foreach (vv_conf_all_groups($f) as $g) {
|
||||
if (preg_match($re, (string) ($g['subsection'] ?? ''))) $out[] = $g;
|
||||
$name = (string) ($g['subsection'] ?? '');
|
||||
// Excluded everywhere, not only from the catch-all. A section kept out of forms
|
||||
// because a text box is the wrong control for it does not become the right
|
||||
// control because a different page asked.
|
||||
if (isset(VV_UI_SECTION_EXCLUDE[$name])) continue;
|
||||
if ($all || preg_match($re, $name)) $out[] = $g;
|
||||
}
|
||||
}
|
||||
echo json_encode(['ok' => true, 'groups' => $out]);
|
||||
|
||||
Reference in New Issue
Block a user