Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($output)
- {
- $in_redirect_endpoint = false;
- $redirect_endpoints = ['preregister', 'banned', 'account/terms', 'account/settings', 'account/login', 'account/logout'];
- foreach ($redirect_endpoints as $endpoint)
- {
- if(strpos($_SERVER['REQUEST_URI'], $endpoint) !== false)
- {
- $in_redirect_endpoint = true;
- }
- }
- $this->logger->log($_SERVER['REQUEST_URI'], 'DEBUG');
- if($this->config->get('mode') == 'preregistration' && !$in_redirect_endpoint) {
- $this->output->redirect('/preregister');
- }
- if($this->user->isLoggedIn() && $this->user->isRank('Banned') && !$in_redirect_endpoint)
- {
- $this->output->redirect('/banned');
- }
- elseif($this->user->isLoggedIn() and $this->user->tos_agree == 0 && !$in_redirect_endpoint)
- {
- $this->output->redirect('/account/terms');
- }
- elseif($this->user->isLoggedIn() && empty($this->user->trade_url) && !$in_redirect_endpoint)
- {
- $this->output->redirect('/account/settings');
- }
- $this->router->resolve();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement