index.php 735 B

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