当前位置: 首页>>代码示例>>PHP>>正文


PHP TBGContext::_redirect_login方法代码示例

本文整理汇总了PHP中TBGContext::_redirect_login方法的典型用法代码示例。如果您正苦于以下问题:PHP TBGContext::_redirect_login方法的具体用法?PHP TBGContext::_redirect_login怎么用?PHP TBGContext::_redirect_login使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TBGContext的用法示例。


在下文中一共展示了TBGContext::_redirect_login方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initializeUser

 protected static function initializeUser()
 {
     TBGLogging::log('Loading user');
     try {
         TBGLogging::log('is this logout?');
         if (self::getRequest()->getParameter('logout')) {
             TBGLogging::log('yes');
             self::logout();
         } else {
             TBGLogging::log('no');
             TBGLogging::log('sets up user object');
             $event = TBGEvent::createNew('core', 'pre_login');
             $event->trigger();
             if ($event->isProcessed()) {
                 self::loadUser($event->getReturnValue());
             } else {
                 self::loadUser();
             }
             TBGEvent::createNew('core', 'post_login', self::getUser())->trigger();
             TBGLogging::log('loaded');
             self::cacheAllPermissions();
         }
     } catch (Exception $e) {
         TBGLogging::log("Something happened while setting up user: " . $e->getMessage(), 'main', TBGLogging::LEVEL_WARNING);
         if (!self::isCLI() && (self::getRouting()->getCurrentRouteModule() != 'main' || self::getRouting()->getCurrentRouteAction() != 'register1' && self::getRouting()->getCurrentRouteAction() != 'register2' && self::getRouting()->getCurrentRouteAction() != 'activate' && self::getRouting()->getCurrentRouteAction() != 'reset_password' && self::getRouting()->getCurrentRouteAction() != 'captcha' && self::getRouting()->getCurrentRouteAction() != 'login' && self::getRouting()->getCurrentRouteAction() != 'getBackdropPartial' && self::getRouting()->getCurrentRouteAction() != 'serve')) {
             self::$_redirect_login = true;
         } else {
             self::$_user = self::factory()->TBGUser(TBGSettings::getDefaultUserID());
         }
     }
     TBGLogging::log('...done');
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:32,代码来源:TBGContext.class.php

示例2: initializeUser

 protected static function initializeUser()
 {
     TBGLogging::log('Loading user');
     try {
         TBGLogging::log('is this logout?');
         if (self::getRequest()->getParameter('logout')) {
             TBGLogging::log('yes');
             self::logout();
         } else {
             TBGLogging::log('no');
             TBGLogging::log('sets up user object');
             $event = TBGEvent::createNew('core', 'pre_login');
             $event->trigger();
             if ($event->isProcessed()) {
                 self::loadUser($event->getReturnValue());
             } elseif (!self::isCLI()) {
                 self::loadUser();
             } else {
                 self::$_user = new TBGUser();
             }
             TBGEvent::createNew('core', 'post_login', self::getUser())->trigger();
             TBGLogging::log('loaded');
             TBGLogging::log('caching permissions');
             self::cacheAllPermissions();
             TBGLogging::log('done (caching permissions)');
         }
     } catch (TBGElevatedLoginException $e) {
         TBGLogging::log("Could not reauthenticate elevated permissions: " . $e->getMessage(), 'main', TBGLogging::LEVEL_INFO);
         TBGContext::setMessage('elevated_login_message_err', $e->getMessage());
         self::$_redirect_login = 'elevated_login';
     } catch (Exception $e) {
         TBGLogging::log("Something happened while setting up user: " . $e->getMessage(), 'main', TBGLogging::LEVEL_WARNING);
         $allow_anonymous_routes = array('register', 'register_check_username', 'register1', 'register2', 'activate', 'reset_password', 'captcha', 'login', 'login_page', 'getBackdropPartial', 'serve', 'doLogin');
         if (!self::isCLI() && (!in_array(self::getRouting()->getCurrentRouteModule(), array('main', 'remote')) || !in_array(self::getRouting()->getCurrentRouteName(), $allow_anonymous_routes))) {
             TBGContext::setMessage('login_message_err', $e->getMessage());
             self::$_redirect_login = 'login';
         } else {
             self::$_user = self::factory()->TBGUser(TBGSettings::getDefaultUserID());
         }
     }
     TBGLogging::log('...done');
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:42,代码来源:TBGContext.class.php


注:本文中的TBGContext::_redirect_login方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。