Advertisement
Guest User

TYPO3 page not found sample

a guest
Dec 13th, 2012
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.06 KB | None | 0 0
  1.         /**
  2.          * check, if user is logged in and if
  3.          * page exist and set the right jump-page-uid
  4.          */
  5.         if(!isset($this->page->rootLine[0]) || count($this->page->rootLine[0]) == 0 || $this->isPageHidden()) {
  6.             // requested page doesn't exist
  7.             $redirectId = $this->noPageFoundId;
  8.         }elseif(!(is_array($GLOBALS['TSFE']->fe_user->user) && isset($GLOBALS['TSFE']->fe_user->user['usergroup']) && count($GLOBALS['TSFE']->fe_user->user['usergroup']) > 0)){
  9.             // requested page exists, but user is not logged in
  10.             $redirectId = $this->loginId;
  11.         } else {
  12.             // user is logged in, requested page exist
  13.             $redirectId = $this->accessDeniedId;
  14.         }
  15.  
  16.         $url = $_SERVER['SCRIPT_NAME'].'?id='.$redirectId;
  17.  
  18.         $redirectUrl = $this->getRedirectFromRequestUri();
  19.         $appendChar = $this->getAppendChar($url);
  20.  
  21.         if($redirectId != $this->noPageFoundId
  22.         && $redirectUrl != $redirectId
  23.         && $redirectUrl != '/'
  24.         && $redirectUrl != ''){
  25.                 $url .= $appendChar . $this->redirectUrlParam . '=' . urlencode($redirectUrl);
  26.         }
  27.  
  28.         // relocate to new url
  29.         header('location:'.$url);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement