index.php 739 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. // Init
  3. error_reporting(NULL);
  4. ob_start();
  5. session_start();
  6. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  7. if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
  8. $user=$_GET['user'];;
  9. }
  10. // Check token
  11. if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
  12. header('location: /login/');
  13. exit();
  14. }
  15. if (!empty($_GET['key'])) {
  16. $v_key = escapeshellarg(trim($_GET['key']));
  17. $v_key = str_replace('/','\\/', $v_key);
  18. exec (HESTIA_CMD."v-delete-user-ssh-key ".$user." ".$v_key);
  19. check_return_code($return_var,$output);
  20. }
  21. unset($output);
  22. //die();
  23. $back = $_SESSION['back'];
  24. if (!empty($back)) {
  25. header("Location: ".$back);
  26. exit;
  27. }
  28. header("Location: /list/key/");
  29. exit;