本文整理汇总了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;
}
示例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();
}
}
示例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;
}