index.php 738 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. ob_start();
  3. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  4. // Check token
  5. verify_csrf($_POST);
  6. $ip = $_POST['ip'];
  7. $action = $_POST['action'];
  8. if ($_SESSION['userContext'] === 'admin') {
  9. switch ($action) {
  10. case 'reread IP': exec(HESTIA_CMD."v-update-sys-ip", $output, $return_var);
  11. header("Location: /list/ip/");
  12. exit;
  13. break;
  14. case 'delete': $cmd='v-delete-sys-ip';
  15. break;
  16. default: header("Location: /list/ip/"); exit;
  17. }
  18. } else {
  19. header("Location: /list/ip/");
  20. exit;
  21. }
  22. foreach ($ip as $value) {
  23. $value = escapeshellarg($value);
  24. exec(HESTIA_CMD.$cmd." ".$value, $output, $return_var);
  25. }
  26. header("Location: /list/ip/");