index.php 633 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. use function Hestiacp\quoteshellarg\quoteshellarg;
  3. // Init
  4. ob_start();
  5. $TAB = "USER";
  6. include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
  7. // Check token
  8. verify_csrf($_GET);
  9. // Check user
  10. if ($_SESSION["userContext"] != "admin") {
  11. header("Location: /list/user");
  12. exit();
  13. }
  14. if (!empty($_GET["user"])) {
  15. $v_username = quoteshellarg($_GET["user"]);
  16. exec(HESTIA_CMD . "v-unsuspend-user " . $v_username, $output, $return_var);
  17. }
  18. check_return_code($return_var, $output);
  19. unset($output);
  20. $back = getenv("HTTP_REFERER");
  21. if (!empty($back)) {
  22. header("Location: " . $back);
  23. exit();
  24. }
  25. header("Location: /list/user/");
  26. exit();