index.php 722 B

1234567891011121314151617181920212223242526272829303132
  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. verify_csrf($_GET);
  9. // Delete as someone else?
  10. if (($_SESSION['userContext'] === 'admin') && (!empty($_GET['user']))) {
  11. $user = $_GET['user'];
  12. }
  13. if (!empty($_GET['domain'])) {
  14. $v_username = escapeshellarg($user);
  15. $v_domain = escapeshellarg($_GET['domain']);
  16. exec(HESTIA_CMD . 'v-delete-web-domain ' . $v_username . ' ' . $v_domain . " 'yes'", $output, $return_var);
  17. check_return_code($return_var, $output);
  18. unset($output);
  19. }
  20. $back = $_SESSION['back'];
  21. if (!empty($back)) {
  22. header('Location: ' . $back);
  23. exit;
  24. }
  25. header('Location: /list/web/');
  26. exit;