Skip to content

Commit 69ec3f2

Browse files
author
Kristan Kenney
committed
Ensure all admins can search content
1 parent 584505b commit 69ec3f2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

web/search/index.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@
2222

2323
// Data
2424
$q = escapeshellarg($q);
25-
$command = $_SESSION['user'] == 'admin'
26-
? "v-search-object $q json"
27-
: "v-search-user-object $user $q json";
2825

29-
exec (HESTIA_CMD . $command, $output, $return_var);
26+
if ($_SESSION['userContext'] === 'admin') {
27+
exec (HESTIA_CMD . "v-search-object " .$q. " json", $output, $return_var);
28+
} else {
29+
exec (HESTIA_CMD . "v-search-user-object " .$user. " " .$q. " json", $output, $return_var);
30+
}
31+
3032
$data = json_decode(implode('', $output), true);
3133

3234
// Render page

0 commit comments

Comments
 (0)