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


PHP AWS_APP::user方法代码示例

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


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

示例1: user

 /**
  * 获取用户信息类
  *
  * 调用 core/user.php
  *
  * @access	public
  * @return	object
  */
 public static function user()
 {
     if (!self::$user) {
         self::$user = load_class('core_user');
     }
     return self::$user;
 }
开发者ID:Gradven,项目名称:what3.1.7,代码行数:15,代码来源:aws_app.inc.php

示例2: __construct

 public function __construct($process_setup = true)
 {
     // 获取当前用户 User ID
     $this->user_id = AWS_APP::user()->get_info('uid');
     if ($this->user_info = $this->model('account')->get_user_info_by_uid($this->user_id, TRUE)) {
         $user_group = $this->model('account')->get_user_group($this->user_info['group_id'], $this->user_info['reputation_group']);
         if ($this->user_info['default_timezone']) {
             date_default_timezone_set($this->user_info['default_timezone']);
         }
         $this->model('online')->online_active($this->user_id, $this->user_info['last_active']);
     } else {
         if ($this->user_id) {
             $this->model('account')->logout();
         } else {
             $user_group = $this->model('account')->get_user_group_by_id(99);
             if ($_GET['fromuid']) {
                 HTTP::set_cookie('fromuid', $_GET['fromuid']);
             }
         }
     }
     $this->user_info['group_name'] = $user_group['group_name'];
     $this->user_info['permission'] = $user_group['permission'];
     AWS_APP::session()->permission = $this->user_info['permission'];
     if ($this->user_info['forbidden'] == 1) {
         $this->model('account')->logout();
         H::redirect_msg(AWS_APP::lang()->_t('抱歉, 你的账号已经被禁止登录'), '/');
     } else {
         TPL::assign('user_id', $this->user_id);
         TPL::assign('user_info', $this->user_info);
     }
     if ($this->user_id and !$this->user_info['permission']['human_valid']) {
         unset(AWS_APP::session()->human_valid);
     } else {
         if ($this->user_info['permission']['human_valid'] and !is_array(AWS_APP::session()->human_valid)) {
             AWS_APP::session()->human_valid = array();
         }
     }
     // 引入系统 CSS 文件
     TPL::import_css(array('css/common.css', 'css/link.css', 'js/plug_module/style.css'));
     if (defined('SYSTEM_LANG')) {
         TPL::import_js(base_url() . '/language/' . SYSTEM_LANG . '.js');
     }
     if (HTTP::is_browser('ie', 8)) {
         TPL::import_js(array('js/jquery.js', 'js/respond.js'));
     } else {
         TPL::import_js('js/jquery.2.js');
     }
     // 引入系统 JS 文件
     TPL::import_js(array('js/jquery.form.js', 'js/plug_module/plug-in_module.js', 'js/aws.js', 'js/aw_template.js', 'js/app.js'));
     // 产生面包屑导航数据
     $this->crumb(get_setting('site_name'), base_url());
     // 载入插件
     if ($plugins = AWS_APP::plugins()->parse($_GET['app'], $_GET['c'], 'setup')) {
         foreach ($plugins as $plugin_file) {
             include $plugin_file;
         }
     }
     if (get_setting('site_close') == 'Y' and $this->user_info['group_id'] != 1 and !in_array($_GET['app'], array('admin', 'account', 'upgrade'))) {
         $this->model('account')->logout();
         H::redirect_msg(get_setting('close_notice'), '/account/login/');
     }
     if ($_GET['ignore_ua_check'] == 'TRUE') {
         HTTP::set_cookie('_ignore_ua_check', 'TRUE', time() + 3600 * 24 * 7);
     }
     // 执行控制器 Setup 动作
     if ($process_setup) {
         $this->setup();
     }
 }
开发者ID:lincoln2015,项目名称:18duchengxuyuan_server,代码行数:69,代码来源:aws_controller.inc.php

示例3: get_users_list

 public function get_users_list($where, $limit = 10, $attrib = false, $exclude_self = true, $orderby = 'uid DESC')
 {
     if ($where) {
         $where = '(' . $where . ') AND forbidden = 0 AND group_id <> 3';
     } else {
         $where = 'forbidden = 0 AND group_id <> 3';
     }
     if ($exclude_self) {
         if ($where) {
             $where = '(' . $where . ') AND uid <> ' . AWS_APP::user()->get_info('uid');
         } else {
             $where = 'uid <> ' . AWS_APP::user()->get_info('uid');
         }
     }
     $result = $this->fetch_all('users', $where, $orderby, $limit);
     if ($result) {
         foreach ($result as $key => $val) {
             unset($val['password'], $val['salt']);
             $data[$val['uid']] = $val;
             if (!$val['url_token'] and $val['user_name']) {
                 $data[$val['uid']]['url_token'] = urlencode($val['user_name']);
             }
             if ($val['email_settings']) {
                 $data[$val['uid']]['email_settings'] = unserialize($val['email_settings']);
             }
             if ($val['weixin_settings']) {
                 $data[$val['uid']]['weixin_settings'] = unserialize($val['weixin_settings']);
             }
             $uids[] = $val['uid'];
         }
         if ($attrib and $uids) {
             if ($users_attrib = $this->fetch_all('users_attrib', 'uid IN(' . implode(',', $uids) . ')')) {
                 foreach ($users_attrib as $key => $val) {
                     unset($val['id']);
                     foreach ($val as $attrib_key => $attrib_val) {
                         $data[$val['uid']][$attrib_key] = $attrib_val;
                     }
                 }
             }
         }
     }
     return $data;
 }
开发者ID:actcms,项目名称:houziquan,代码行数:43,代码来源:account.php


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