index.php 835 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. // Init
  3. error_reporting(NULL);
  4. ob_start();
  5. session_start();
  6. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  7. // Check token
  8. if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
  9. header('location: /login/');
  10. exit();
  11. }
  12. // Check user
  13. if ($_SESSION['user'] != 'admin') {
  14. header("Location: /list/user");
  15. exit;
  16. }
  17. if (!empty($_GET['user'])) {
  18. $user=$_GET['user'];
  19. }
  20. if (!empty($_GET['database'])) {
  21. $v_username = escapeshellarg($user);
  22. $v_database = escapeshellarg($_GET['database']);
  23. exec (VESTA_CMD."v-unsuspend-database ".$v_username." ".$v_database, $output, $return_var);
  24. check_return_code($return_var,$output);
  25. unset($output);
  26. }
  27. $back=getenv("HTTP_REFERER");
  28. if (!empty($back)) {
  29. header("Location: ".$back);
  30. exit;
  31. }
  32. header("Location: /list/db/");
  33. exit;