mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -07:00
added admin search
This commit is contained in:
parent
ac2aa3c1ce
commit
f685d8d333
76 changed files with 871 additions and 114 deletions
|
@ -1,16 +1,39 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
$TAB = 'SEARCH';
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
$back=getenv("HTTP_REFERER");
|
||||
if (!empty($back)) {
|
||||
header("Location: ".$back);
|
||||
// Check query
|
||||
$q = $_GET['q'];
|
||||
if (empty($q)) {
|
||||
$back=getenv("HTTP_REFERER");
|
||||
if (!empty($back)) {
|
||||
header("Location: ".$back);
|
||||
exit;
|
||||
}
|
||||
header("Location: /");
|
||||
exit;
|
||||
}
|
||||
|
||||
header("Location: /");
|
||||
// Header
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
|
||||
|
||||
exit;
|
||||
// Panel
|
||||
top_panel($user,$TAB);
|
||||
|
||||
// Data
|
||||
if ($_SESSION['user'] == 'admin') {
|
||||
$q = escapeshellarg($q);
|
||||
exec (VESTA_CMD."v_search_object ".$q." json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_search.html');
|
||||
} else {
|
||||
exec (VESTA_CMD."v_list_web_domains $user json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_web.html');
|
||||
}
|
||||
|
||||
// Footer
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue