index.php 601 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. ob_start();
  3. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  4. // Check token
  5. verify_csrf($_GET);
  6. if (($_SESSION['userContext'] === 'admin') && (!empty($_GET['user']))) {
  7. $user = $_GET['user'];
  8. }
  9. if (!empty($_GET['key'])) {
  10. $v_key = escapeshellarg(trim($_GET['key']));
  11. $v_user = escapeshellarg(trim($user));
  12. exec(HESTIA_CMD."v-delete-user-ssh-key ".$v_user." ".$v_key);
  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;