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


PHP User::isLogged方法代码示例

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


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

示例1: actionActivation

 /**
  * Activate user account.
  *
  * @access     public
  * @return     View
  * @since      1.0.0
  * @version    1.1.0, 2015-02-12
  */
 public function actionActivation()
 {
     // if user is logged, redirect to main page
     if (UserModel::isLogged()) {
         Route::factory('home')->redirectTo();
     }
     // set page title
     $this->setTitle(__('Activate your new account'));
     // get code from URL
     $sCode = Router::getParam('code');
     $bActivated = FALSE;
     // get activation code from DB
     $oResult = DB::query("SELECT c FROM \\Model\\User\\ActivationCode c WHERE c.code = :code")->param('code', $sCode)->single();
     /* @var $oResult ActivationCodeModel */
     // activate user
     if ($oResult instanceof ActivationCodeModel) {
         // Set user as activated
         $bActivated = TRUE;
         $oUser = $oResult->getUser();
         $oUser->setActivation(TRUE);
         DB::flush();
         // Remove activation code from DB
         DB::remove($oResult);
         DB::flush();
     }
     // view
     return View::factory("user/frontend/register/activation")->bind('bActivated', $bActivated);
 }
开发者ID:ktrzos,项目名称:plethora,代码行数:36,代码来源:Registration.php

示例2: __construct

 /**
  * Controller constructor.
  *
  * @access   public
  * @since    1.0.0, 2015-02-17
  * @version  2.1.0-dev
  */
 public function __construct()
 {
     parent::__construct();
     // fill up breadcrumbs title and other
     $this->addBreadCrumb(__('Password recovery'), Route::factory('password_recovery')->url());
     $this->addToTitle(' - ' . __('Password recovery'));
     // check if particular user is logged
     if (User::isLogged()) {
         $sRedirectURL = Route::factory('home')->url();
         $sRedirectMsg = __('Cannot use password recovery system while being logged in!');
         Session::flash($sRedirectURL, $sRedirectMsg, 'warning');
     }
 }
开发者ID:ktrzos,项目名称:plethora,代码行数:20,代码来源:PasswordRecovery.php

示例3: __construct

 /**
  * Constructor.
  *
  * @access   public
  * @since    1.0.0-alpha
  * @version  1.0.0-alpha
  */
 public function __construct()
 {
     # initialize theme
     Theme::initBackend();
     # call parent
     parent::__construct();
     if ($this->sModel !== NULL) {
         $this->setModel(new $this->sModel());
     }
     if (!User::isLogged() || !\UserPermissions::hasPerm(static::PERM_ADMIN_ACCESS)) {
         Route::factory('home')->redirectTo();
     }
     // set body classes
     $this->addBodyClass('skin-red');
     // add main breadcrumbs and title
     $this->alterBreadcrumbsTitleMain();
     // reset JavaScripts and CSS
     $this->resetCss();
     $this->resetJs();
     // add CSS and JavaScript files
     $this->addCss('https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700&subset=latin,latin-ext');
     $this->addCss('https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css');
     $this->addCss('https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css');
     $this->addCssByTheme('/bootstrap/css/bootstrap.min.css');
     $this->addCssByTheme('/css/backend.css');
     $this->addJsByTheme('/plugins/jQuery/jQuery-2.1.4.min.js');
     $this->addJsByTheme('/plugins/jQueryUI/jquery-ui.min.js');
     $this->addJsByTheme('/bootstrap/js/bootstrap.min.js');
     $this->addJsByTheme('/js/backend.js');
     $this->addJsByTheme('/js/jquery.mjs.nestedSortable.js');
     $this->addJsByTheme('/js/app.min.js');
     $this->addJsByTheme('/js/backend_after_theme_load.js');
     # add viewport
     $this->addMetaTagRegular('viewport', 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no');
     // generate menu
     $menuView = $this->generateMenu();
     $this->oViewBody->bind('menu', $menuView);
 }
开发者ID:ktrzos,项目名称:plethora,代码行数:45,代码来源:BackendAdminLte.php

示例4: __

use Plethora\Route;
$loginLink = Helper\Link::factory();
$loginLink->getAttributes()->addToAttribute('class', 'btn btn-primary btn-lg');
?>

<div class="jumbotron">
    <p style="font-size: 70px;"><?php 
echo __('Hello!');
?>
</p>
    <p><?php 
echo __('Welcome on your new website!');
?>
</p>
    <?php 
if (\Model\User::isLogged()) {
    ?>
        <p><?php 
    echo __('You are logged! Go and see whats in your management panel ;).');
    ?>
</p>
        <p>
            <?php 
    $backend = Helper\Link::factory();
    $backend->getAttributes()->addToAttribute('class', 'btn btn-danger btn-lg');
    echo $backend->code(__('go to management panel'), Route::factory('backend')->url());
    ?>
            <?php 
    echo $loginLink->code(__('logout'), Route::factory('logout')->url());
    ?>
        </p>
开发者ID:ktrzos,项目名称:plethora,代码行数:31,代码来源:front_page.php

示例5: __construct

 /**
  * Constructor.
  *
  * @access   public
  * @since    1.0.0-alpha
  * @version  1.0.0-alpha
  */
 public function __construct()
 {
     // initialize theme
     Theme::initBackend();
     parent::__construct();
     if ($this->sModel !== NULL) {
         $this->setModel(new $this->sModel());
     }
     if (!User::isLogged() || !\UserPermissions::hasPerm(static::PERM_ADMIN_ACCESS)) {
         Route::factory('home')->redirectTo();
     }
     //
     //        // add main breadcrumbs and title
     //        $this->alterBreadcrumbsTitleMain();
     //
     //        // add CSS and JavaScript files
     //        $this->addCss('/themes/_common/packages/bootstrap/css/bootstrap.min.css');
     //        $this->addCss('/themes/_common/packages/bootstrap/css/bootstrap-sticky-footer-navbar.css');
     //        $this->addJs('/themes/_common/js/jquery-2.1.3.min.js');
     //        $this->addJs('/themes/_common/js/jquery-ui.min.js');
     //        $this->addJs('/themes/_common/packages/bootstrap/js/bootstrap.min.js');
     //        $this->addJs('/themes/_common/js/global/framework.js');
     //
     //        $this->addCssByTheme('/css/backend.css');
     //        $this->addJsByTheme('/js/jquery.mjs.nestedSortable.js');
     //        $this->addJsByTheme('/js/backend.js');
 }
开发者ID:ktrzos,项目名称:plethora,代码行数:34,代码来源:Backend.php

示例6: actionChangePassword

 /**
  * ACTION - Change user password.
  *
  * @access   public
  * @return   View
  * @since    1.3.0, 2015-01-27
  * @version  1.0.2-dev, 2015-03-02
  */
 public function actionChangePassword()
 {
     if (!Model\User::isLogged()) {
         Router::relocateToRoute('home');
     }
     // get user
     $oUser = Model\User::getLoggedUser();
     /* create form instance */
     $oModelFormConfig = ModelFormConfig::factory()->setFieldsRestriction(['password'])->setMessage(__('Password changed successfully.'));
     $oModelForm = $oUser->form('user_profile', $oModelFormConfig);
     $oForm = $oModelForm->generate();
     // add local actions
     Router\LocalActions::addLocalAction(__('View profile'), 'user_password_change', 'user_profile')->setParameters(['id' => $oUser->getId()]);
     Router\LocalActions::addLocalAction(__('Edit profile'), 'user_password_change', 'user_profile_edit');
     // return profile modification form
     return View::factory('base/form')->bind('oForm', $oForm);
 }
开发者ID:ktrzos,项目名称:plethora,代码行数:25,代码来源:User.php


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