當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。