index.php 569 B

1234567891011121314151617181920212223242526272829
  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 'delete': $cmd='v-delete-sys-ip';
  12. break;
  13. default: header("Location: /list/ip/"); exit;
  14. }
  15. } else {
  16. header("Location: /list/ip/");
  17. exit;
  18. }
  19. foreach ($ip as $value) {
  20. $value = escapeshellarg($value);
  21. exec (VESTA_CMD.$cmd." ".$value, $output, $return_var);
  22. }
  23. header("Location: /list/ip/");