index.php 667 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. use function Hestiacp\quoteshellarg\quoteshellarg;
  3. ob_start();
  4. // Main include
  5. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  6. // Check token
  7. verify_csrf($_POST);
  8. // Check user
  9. if ($_SESSION['userContext'] != 'admin') {
  10. header("Location: /list/user");
  11. exit;
  12. }
  13. $setname = $_POST['setname'];
  14. $action = $_POST['action'];
  15. switch ($action) {
  16. case 'delete': $cmd='v-delete-firewall-ipset';
  17. break;
  18. default: header("Location: /list/firewall/ipset/"); exit;
  19. }
  20. foreach ($setname as $value) {
  21. $v_name = quoteshellarg($value);
  22. exec(HESTIA_CMD.$cmd." ".$v_name, $output, $return_var);
  23. }
  24. header("Location: /list/firewall/ipset/");