mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-21 05:44:07 -07:00
🔒 ♻️ Implement secure exec
wrapper functions.
This commit is contained in:
parent
6e13036780
commit
8e951ac72e
115 changed files with 1345 additions and 1986 deletions
|
@ -9,9 +9,9 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
|||
// Check query
|
||||
$q = $_GET['q'];
|
||||
if (empty($q)) {
|
||||
$back=getenv("HTTP_REFERER");
|
||||
$back = getenv('HTTP_REFERER');
|
||||
if (!empty($back)) {
|
||||
header("Location: ".$back);
|
||||
header("Location: $back");
|
||||
exit;
|
||||
}
|
||||
header("Location: /");
|
||||
|
@ -28,14 +28,13 @@ $lang = 'ru_RU.utf8';
|
|||
//setlocale(LC_ALL, $lang);
|
||||
|
||||
// Data
|
||||
$q = escapeshellarg($q);
|
||||
if ($_SESSION['user'] == 'admin') {
|
||||
exec (VESTA_CMD."v-search-object ".$q." json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
v_exec('v-search-object', [$q, 'json'], false, $output);
|
||||
$data = json_decode($output, true);
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_search.html');
|
||||
} else {
|
||||
exec (VESTA_CMD."v-search-user-object ".$user." ".$q." json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
v_exec('v-search-user-object', [$user, $q, 'json'], false, $output);
|
||||
$data = json_decode($output, true);
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_search.html');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue