index.php 739 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. // Init
  3. error_reporting(NULL);
  4. ob_start();
  5. session_start();
  6. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  7. $ip = $_POST['ip'];
  8. $action = $_POST['action'];
  9. if ($_SESSION['user'] == 'admin') {
  10. switch ($action) {
  11. case 'reread IP': exec(VESTA_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 = escapeshellarg($value);
  25. exec (VESTA_CMD.$cmd." ".$value, $output, $return_var);
  26. }
  27. header("Location: /list/ip/");