index.php 700 B

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