index.php 788 B

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