index.php 680 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. // Init
  3. error_reporting(NULL);
  4. ob_start();
  5. session_start();
  6. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  7. if ($_SESSION['user'] == 'admin') {
  8. if (!empty($_GET['user'])) {
  9. $v_username = escapeshellarg($_GET['user']);
  10. exec (VESTA_CMD."v_delete_user ".$v_username, $output, $return_var);
  11. }
  12. if ($return_var != 0) {
  13. $error = implode('<br>', $output);
  14. if (empty($error)) $error = 'Error: vesta did not return any output.';
  15. $_SESSION['error_msg'] = $error;
  16. }
  17. unset($output);
  18. }
  19. $back = $_SESSION['back'];
  20. if (!empty($back)) {
  21. header("Location: ".$back);
  22. exit;
  23. }
  24. header("Location: /list/user/");
  25. exit;