Browse Source

Ensure all admins can search content

Kristan Kenney 5 years ago
parent
commit
69ec3f21ef
1 changed files with 6 additions and 4 deletions
  1. 6 4
      web/search/index.php

+ 6 - 4
web/search/index.php

@@ -22,11 +22,13 @@ if (empty($q)) {
 
 // Data
 $q = escapeshellarg($q);
-$command = $_SESSION['user'] == 'admin'
-           ? "v-search-object $q json"
-           : "v-search-user-object $user $q json";
 
-exec (HESTIA_CMD . $command, $output, $return_var);
+if ($_SESSION['userContext'] === 'admin') {
+    exec (HESTIA_CMD . "v-search-object " .$q. " json", $output, $return_var);
+} else {
+    exec (HESTIA_CMD . "v-search-user-object " .$user. " " .$q. " json", $output, $return_var);
+}
+
 $data = json_decode(implode('', $output), true);
 
 // Render page