index.php 786 B

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