當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CWebUser::data方法代碼示例

本文整理匯總了PHP中CWebUser::data方法的典型用法代碼示例。如果您正苦於以下問題:PHP CWebUser::data方法的具體用法?PHP CWebUser::data怎麽用?PHP CWebUser::data使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CWebUser的用法示例。


在下文中一共展示了CWebUser::data方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setDefault

 public static function setDefault()
 {
     self::$data = array('alias' => ZBX_GUEST_USER, 'userid' => 0, 'lang' => 'en_gb', 'type' => '0', 'node' => array('name' => '- unknown -', 'nodeid' => 0));
 }
開發者ID:itnihao,項目名稱:zatree-2.2,代碼行數:4,代碼來源:class.cwebuser.php

示例2: setDefault

 public static function setDefault()
 {
     self::$data = array('alias' => ZBX_GUEST_USER, 'userid' => 0, 'lang' => 'en_gb', 'type' => '0', 'debug_mode' => false);
 }
開發者ID:TonywalkerCN,項目名稱:Zabbix,代碼行數:4,代碼來源:CWebUser.php

示例3: checkAuthentication

 /**
  * Check if session id is authenticated.
  *
  * @param string $sessionid		session id
  *
  * @return array				an array of user data
  */
 public function checkAuthentication($sessionid)
 {
     global $ZBX_LOCALNODEID;
     // access DB only once per page load
     if (!is_null(self::$userData)) {
         return self::$userData;
     }
     $time = time();
     $userInfo = DBfetch(DBselect('SELECT u.userid,u.autologout,s.lastaccess' . ' FROM sessions s,users u' . ' WHERE s.sessionid=' . zbx_dbstr($sessionid) . ' AND s.status=' . ZBX_SESSION_ACTIVE . ' AND s.userid=u.userid' . ' AND (s.lastaccess+u.autologout>' . $time . ' OR u.autologout=0)' . andDbNode('u.userid', $ZBX_LOCALNODEID)));
     if (!$userInfo) {
         self::exception(ZBX_API_ERROR_PARAMETERS, _('Session terminated, re-login, please.'));
     }
     // don't check permissions on the same second
     if ($time != $userInfo['lastaccess']) {
         if (!check_perm2system($userInfo['userid'])) {
             self::exception(ZBX_API_ERROR_PARAMETERS, _('No permissions for system access.'));
         }
         if ($userInfo['autologout'] > 0) {
             DBexecute('DELETE FROM sessions WHERE userid=' . $userInfo['userid'] . ' AND lastaccess<' . (time() - $userInfo['autologout']));
         }
         DBexecute('UPDATE sessions SET lastaccess=' . time() . ' WHERE userid=' . $userInfo['userid'] . ' AND sessionid=' . zbx_dbstr($sessionid));
     }
     $dbAccess = DBfetch(DBselect('SELECT MAX(g.gui_access) AS gui_access' . ' FROM usrgrp g,users_groups ug' . ' WHERE ug.userid=' . $userInfo['userid'] . ' AND g.usrgrpid=ug.usrgrpid'));
     if (!zbx_empty($dbAccess['gui_access'])) {
         $guiAccess = $dbAccess['gui_access'];
     } else {
         $guiAccess = GROUP_GUI_ACCESS_SYSTEM;
     }
     $userData = $this->_getUserData($userInfo['userid']);
     $userData['sessionid'] = $sessionid;
     $userData['gui_access'] = $guiAccess;
     CWebUser::$data = self::$userData = $userData;
     return $userData;
 }
開發者ID:itnihao,項目名稱:zatree-2.2,代碼行數:41,代碼來源:CUser.php


注:本文中的CWebUser::data方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。