index.php 665 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 token
  9. verify_csrf($_POST);
  10. // Check user
  11. if ($_SESSION['userContext'] != 'admin') {
  12. header("Location: /list/user");
  13. exit;
  14. }
  15. $setname = $_POST['setname'];
  16. $action = $_POST['action'];
  17. switch ($action) {
  18. case 'delete': $cmd='v-delete-firewall-ipset';
  19. break;
  20. default: header("Location: /list/firewall/ipset/"); exit;
  21. }
  22. foreach ($setname as $value) {
  23. $v_name = escapeshellarg($value);
  24. exec(HESTIA_CMD.$cmd." ".$v_name, $output, $return_var);
  25. }
  26. header("Location: /list/firewall/ipset/");