index.php 615 B

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