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:
Gmer4Lfe
2026-08-12 19:41:01 -04:00
parent ec3084db12
commit 8ca52c64b9
5 changed files with 889 additions and 128 deletions
+10 -2
View File
@@ -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]);