index.php 636 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. use function Hestiacp\quoteshellarg\quoteshellarg;
  3. ob_start();
  4. include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
  5. // Check token
  6. verify_csrf($_GET);
  7. if ($_SESSION["userContext"] === "admin" && !empty($_GET["user"])) {
  8. $user = quoteshellarg($_GET["user"]);
  9. }
  10. if (!empty($_GET["key"])) {
  11. $v_key = quoteshellarg(trim($_GET["key"]));
  12. exec(HESTIA_CMD . "v-delete-user-ssh-key " . $user . " " . $v_key, $output, $return_var);
  13. check_return_code($return_var, $output);
  14. }
  15. unset($output);
  16. //die();
  17. $back = $_SESSION["back"];
  18. if (!empty($back)) {
  19. header("Location: " . $back);
  20. exit();
  21. }
  22. header("Location: /list/key/");
  23. exit();