예제 #1
0
 protected function _updateUserSession()
 {
     if (IS_MOBILE) {
         exit('Mobile devices are not yet supported');
     }
     // we want to update the user session on every page hit
     $WeTransfer_Users = new WeTransfer_Users();
     $WeTransfer_Users->updateUserSession();
     if (@$_SESSION['user']['logged_in']) {
         if (empty($_SESSION['site']['permissions'])) {
             $this->noPerms();
         }
     }
     $siteStatus = @$_SESSION['user']['site_status'];
     switch ($siteStatus) {
         case 'banned':
             $html = file_get_contents(VIEWS_DIR . '/error/static/error.phtml');
             $html = str_replace('__SITE_NAME__', SITE_NAME, $html);
             $html = str_replace('__ERROR_MESSAGE__', 'Your user account is banned', $html);
             $html = str_replace('__THEME_PATH__', PROTOCOL_RELATIVE_URL . '/' . SITE_LOCAL_THEME_URL_ROOT . '/' . SITE_DEFAULT_TEMPLATE, $html);
             $html = str_replace('__JS_PATH__', PROTOCOL_RELATIVE_URL . '/js', $html);
             exit($html);
             break;
         case 'pending':
             $html = file_get_contents(VIEWS_DIR . '/error/static/error.phtml');
             $html = str_replace('__SITE_NAME__', SITE_NAME, $html);
             $html = str_replace('__ERROR_MESSAGE__', 'Please check your e-mail for information on how to activate your account', $html);
             $html = str_replace('__THEME_PATH__', PROTOCOL_RELATIVE_URL . '/' . SITE_LOCAL_THEME_URL_ROOT . '/' . SITE_DEFAULT_TEMPLATE, $html);
             $html = str_replace('__JS_PATH__', PROTOCOL_RELATIVE_URL . '/js', $html);
             exit($html);
             break;
     }
 }