index.php 649 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. if (($_SESSION['userContext'] === 'admin') && (!empty($_GET['user']))) {
  10. $user = $_GET['user'];
  11. }
  12. if (!empty($_GET['key'])) {
  13. $v_key = escapeshellarg(trim($_GET['key']));
  14. $v_user = escapeshellarg(trim($user));
  15. exec(HESTIA_CMD."v-delete-user-ssh-key ".$v_user." ".$v_key);
  16. check_return_code($return_var, $output);
  17. }
  18. unset($output);
  19. //die();
  20. $back = $_SESSION['back'];
  21. if (!empty($back)) {
  22. header("Location: ".$back);
  23. exit;
  24. }
  25. header("Location: /list/key/");
  26. exit;