Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. if($output)
  2. {
  3. $in_redirect_endpoint = false;
  4. $redirect_endpoints = ['preregister', 'banned', 'account/terms', 'account/settings', 'account/login', 'account/logout'];
  5.  
  6. foreach ($redirect_endpoints as $endpoint)
  7. {
  8. if(strpos($_SERVER['REQUEST_URI'], $endpoint) !== false)
  9. {
  10. $in_redirect_endpoint = true;
  11. }
  12. }
  13.  
  14. $this->logger->log($_SERVER['REQUEST_URI'], 'DEBUG');
  15.  
  16. if($this->config->get('mode') == 'preregistration' && !$in_redirect_endpoint) {
  17. $this->output->redirect('/preregister');
  18. }
  19. if($this->user->isLoggedIn() && $this->user->isRank('Banned') && !$in_redirect_endpoint)
  20. {
  21. $this->output->redirect('/banned');
  22. }
  23. elseif($this->user->isLoggedIn() and $this->user->tos_agree == 0 && !$in_redirect_endpoint)
  24. {
  25. $this->output->redirect('/account/terms');
  26. }
  27. elseif($this->user->isLoggedIn() && empty($this->user->trade_url) && !$in_redirect_endpoint)
  28. {
  29. $this->output->redirect('/account/settings');
  30. }
  31.  
  32. $this->router->resolve();
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement