1
0
mirror of https://github.com/serghey-rodin/vesta.git synced 2025-03-12 04:36:25 -07:00

40 lines
835 B
PHP
Raw Normal View History

2012-06-21 12:55:22 +03:00
<?php
// Init
error_reporting(NULL);
ob_start();
session_start();
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
2015-06-03 02:31:03 +03:00
// Check token
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
header('location: /login/');
exit();
2015-06-03 02:31:03 +03:00
}
2014-10-05 14:40:30 +03:00
// Check user
if ($_SESSION['user'] != 'admin') {
header("Location: /list/user");
exit;
}
if (!empty($_GET['user'])) {
$user=$_GET['user'];
2014-10-05 14:40:30 +03:00
}
if (!empty($_GET['database'])) {
$v_username = escapeshellarg($user);
$v_database = escapeshellarg($_GET['database']);
exec (VESTA_CMD."v-unsuspend-database ".$v_username." ".$v_database, $output, $return_var);
check_return_code($return_var,$output);
unset($output);
2012-06-21 12:55:22 +03:00
}
$back=getenv("HTTP_REFERER");
2012-09-29 01:55:51 +03:00
if (!empty($back)) {
header("Location: ".$back);
2012-09-29 01:55:51 +03:00
exit;
}
2014-10-05 14:40:30 +03:00
2012-06-21 12:55:22 +03:00
header("Location: /list/db/");
2012-09-29 01:55:51 +03:00
exit;