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


PHP LuLu::getIdentity方法代码示例

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


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

示例1: getMessagePrefix

 public function getMessagePrefix($message)
 {
     if ($this->prefix !== null) {
         return call_user_func($this->prefix, $message);
     }
     $ip = Utility::getIp();
     $userID = LuLu::getIdentity()->username;
     if (empty($userID)) {
         return "[{$ip}]";
     } else {
         return "[{$ip}]<br/>[{$userID}]";
     }
 }
开发者ID:sym660,项目名称:lulucms2,代码行数:13,代码来源:DbTarget.php

示例2: actionCreate

 public function actionCreate()
 {
     $model = new Content();
     $model->user_id = LuLu::getIdentity()->id;
     $model->user_name = LuLu::getIdentity()->username;
     $model->content_type = $this->content_type;
     $model->loadDefaultValues();
     $bodyModel = $this->findBodyModel();
     $bodyModel->loadDefaultValues();
     if ($this->saveContent($model, $bodyModel)) {
         return $this->redirect(['index']);
     }
     return $this->render('create', ['model' => $model, 'bodyModel' => $bodyModel]);
 }
开发者ID:martin20140408,项目名称:lulucms2,代码行数:14,代码来源:BaseContentController.php

示例3: beforeValidate

 public function beforeValidate()
 {
     if (!$this->userValidate) {
         return parent::beforeValidate();
     }
     if (parent::beforeValidate()) {
         if ($this->hasAttribute('sort_num')) {
             if ($this->sort_num === null || $this->sort_num === '') {
                 $this->sort_num = Constants::getSortNum();
             }
         }
         if ($this->hasAttribute('created_at')) {
             if (empty($this->created_at)) {
                 $this->created_at = time();
             }
         }
         if ($this->hasAttribute('updated_at')) {
             $this->updated_at = time();
         }
         if ($this->hasAttribute('created_by')) {
             if (empty($this->created_by)) {
                 $this->created_by = LuLu::getIdentity()->username;
             }
         }
         if ($this->hasAttribute('updated_by')) {
             if (empty($this->updated_by)) {
                 $this->updated_by = LuLu::getIdentity()->username;
             }
         }
         return true;
     }
     return false;
 }
开发者ID:sym660,项目名称:lulucms2,代码行数:33,代码来源:BaseActiveRecord.php

示例4: checkHomePermission

 public function checkHomePermission($permission = null, $params = [], $user = null)
 {
     if ($user === null) {
         $user = LuLu::getIdentity()->username;
     }
     if ($permission === null) {
         $permission = LuLu::getApp()->controller->uniqueId;
     }
     $permission = 'home_' . $permission;
     $rows = $this->getPermissionsByUser($user);
     if (!isset($rows[$permission])) {
         return false;
     }
     return $this->executeRule($rows[$permission], $params, $user);
 }
开发者ID:hucongyang,项目名称:lulucms2,代码行数:15,代码来源:RbacService.php

示例5: checkPermission

 public function checkPermission($role = null, $permission = null, $params = [])
 {
     if ($role === null) {
         $role = LuLu::getIdentity()->role;
     }
     if ($permission === null) {
         $m = LuLu::getApp()->controller->module->id;
         $c = LuLu::getApp()->controller->id;
         $permission = empty($m) ? $c : $m . '/' . $c;
     }
     $rows = $this->getPermissionsByRole($role);
     if (!isset($rows[$permission])) {
         return false;
     }
     return $this->executeRule($role, $rows[$permission], $params);
 }
开发者ID:ruzuojun,项目名称:lulucms2,代码行数:16,代码来源:RbacService.php


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