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


PHP UserUtils::getUserIdByAccess方法代码示例

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


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

示例1: _initUser

 protected function _initUser()
 {
     if ($this->init_user) {
         $discuz_uid = isset($_GET['hacker_uid']) && MOBCENT_HACKER_UID ? $_GET['hacker_uid'] : UserUtils::getUserIdByAccess();
         if ($discuz_uid) {
             $user = getuserbyuid($discuz_uid, 1);
         }
         if (!empty($user)) {
             $this->var['member'] = $user;
         } else {
             $user = array();
             $this->_initGuest();
         }
         if ($user && $user['groupexpiry'] > 0 && $user['groupexpiry'] < TIMESTAMP && getgpc('mod') != 'spacecp' && getgpc('do') != 'expiry' && CURSCRIPT != 'home') {
             dheader('location: home.php?mod=spacecp&ac=usergroup&do=expiry');
         }
         $this->cachelist[] = 'usergroup_' . $this->var['member']['groupid'];
         if ($user && $user['adminid'] > 0 && $user['groupid'] != $user['adminid']) {
             $this->cachelist[] = 'admingroup_' . $this->var['member']['adminid'];
         }
     } else {
         $this->_initGuest();
     }
     if (empty($this->var['cookie']['lastvisit'])) {
         $this->var['member']['lastvisit'] = TIMESTAMP - 3600;
         dsetcookie('lastvisit', TIMESTAMP - 3600, 86400 * 30);
     } else {
         $this->var['member']['lastvisit'] = $this->var['cookie']['lastvisit'];
     }
     setglobal('uid', getglobal('uid', 'member'));
     setglobal('username', addslashes(getglobal('username', 'member')));
     setglobal('adminid', getglobal('adminid', 'member'));
     setglobal('groupid', getglobal('groupid', 'member'));
 }
开发者ID:caidongyun,项目名称:CS,代码行数:34,代码来源:discuz_core_x20.php

示例2: _initUser

 protected function _initUser()
 {
     if ($this->init_user) {
         $discuz_uid = isset($_GET['hacker_uid']) && MOBCENT_HACKER_UID ? $_GET['hacker_uid'] : UserUtils::getUserIdByAccess();
         if ($discuz_uid) {
             $user = getuserbyuid($discuz_uid, 1);
         }
         if (!empty($user)) {
             if (isset($user['_inarchive'])) {
                 C::t('common_member_archive')->move_to_master($discuz_uid);
             }
             $this->var['member'] = $user;
         } else {
             $user = array();
             $this->_initGuest();
         }
         if ($user && $user['groupexpiry'] > 0 && $user['groupexpiry'] < TIMESTAMP && (getgpc('mod') != 'spacecp' || CURSCRIPT != 'home')) {
             dheader('location: home.php?mod=spacecp&ac=usergroup&do=expiry');
         }
         $this->cachelist[] = 'usergroup_' . $this->var['member']['groupid'];
         if ($user && $user['adminid'] > 0 && $user['groupid'] != $user['adminid']) {
             $this->cachelist[] = 'admingroup_' . $this->var['member']['adminid'];
         }
     } else {
         $this->_initGuest();
     }
     setglobal('groupid', getglobal('groupid', 'member'));
     !empty($this->cachelist) && loadcache($this->cachelist);
     if ($this->var['member'] && $this->var['group']['radminid'] == 0 && $this->var['member']['adminid'] > 0 && $this->var['member']['groupid'] != $this->var['member']['adminid'] && !empty($this->var['cache']['admingroup_' . $this->var['member']['adminid']])) {
         $this->var['group'] = array_merge($this->var['group'], $this->var['cache']['admingroup_' . $this->var['member']['adminid']]);
     }
     if ($this->var['group']['allowmakehtml'] && isset($_GET['_makehtml'])) {
         $this->var['makehtml'] = 1;
         $this->_initGuest();
         loadcache(array('usergroup_7'));
         $this->var['group'] = $this->var['cache']['usergroup_7'];
         unset($this->var['inajax']);
     }
     if (empty($this->var['cookie']['lastvisit'])) {
         $this->var['member']['lastvisit'] = TIMESTAMP - 3600;
         dsetcookie('lastvisit', TIMESTAMP - 3600, 86400 * 30);
     } else {
         $this->var['member']['lastvisit'] = $this->var['cookie']['lastvisit'];
     }
     setglobal('uid', getglobal('uid', 'member'));
     setglobal('username', getglobal('username', 'member'));
     setglobal('adminid', getglobal('adminid', 'member'));
     setglobal('groupid', getglobal('groupid', 'member'));
     if ($this->var['member']['newprompt']) {
         $this->var['member']['newprompt_num'] = C::t('common_member_newprompt')->fetch($this->var['member']['uid']);
         $this->var['member']['newprompt_num'] = unserialize($this->var['member']['newprompt_num']['data']);
         $this->var['member']['category_num'] = helper_notification::get_categorynum($this->var['member']['newprompt_num']);
     }
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:54,代码来源:discuz_core_x30.php


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