本文整理汇总了PHP中user_read函数的典型用法代码示例。如果您正苦于以下问题:PHP user_read函数的具体用法?PHP user_read怎么用?PHP user_read使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_read函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: exit
<?php
// 创建新帖
!defined('DEBUG') and exit('Access Denied.');
include './xiunophp/xn_html_safe.func.php';
include './xiunophp/image.func.php';
$action = param(1);
$user = user_read($uid);
empty($user) and $user = user_guest();
if ($action == 'create') {
$tid = param(2);
$quick = param(3);
$thread = thread_read($tid);
empty($thread) and message(3, '主题不存在:' . $tid);
$fid = $thread['fid'];
$forum = forum_read($fid);
empty($forum) and message(3, '板块不存在:' . $fid);
$r = forum_access_user($fid, $gid, 'allowpost');
if (!$r) {
if ($gid == 0) {
$r = forum_access_user($fid, 101, 'allowpost');
$r and user_login_check($user);
}
message(10, '您(' . $user['groupname'] . ')无权限在此版块发帖');
}
$conf['ipaccess_on'] and !ipaccess_check($longip, 'posts') and message(-1, '您的 IP 今日回帖数达到上限,请明天再来。');
if ($method == 'GET') {
check_standard_browser();
include './flarum/view/post_create.htm';
} else {
$agree = param('agree', 0);
开发者ID:jarryyen,项目名称:xiuno-theme-flarum,代码行数:31,代码来源:post.php
示例2: user_create
$state = user_create(array('username' => $username, 'password' => md5($password . $salt), 'salt' => $salt, 'gid' => $gid, 'email' => $email, 'mobile' => $mobile, 'create_ip' => ip2long(ip()), 'create_date' => $time));
$state !== FALSE ? message(0, '创建成功') : message(11, '创建失败');
}
} elseif ($action == 'update') {
$uid = param(2, 0);
if ($method == 'GET') {
$header['title'] = '用户更新';
$user = user_read($uid);
include "./admin/view/user_update.htm";
} elseif ($method == 'POST') {
$mobile = param('mobile');
$email = param('email');
$username = param('username');
$password = param('password');
$gid = param('gid');
$old = user_read($uid);
$email and !is_email($email, $err) and message(2, $err);
if ($email and $old['email'] != $email) {
$user = user_read_by_email($email);
$user and message(2, '用户 EMAIL 已经存在');
}
$arr = array();
$arr['email'] = $email;
// 非管理员(gid = 1),不允许修改其他用户的手机号、用户名、用户组、密码
if ($user['gid'] == 1) {
$mobile and !is_mobile($mobile, $err) and message(1, $err);
//$username AND !is_username($username, $err) AND message(3, $err);
if ($mobile and $old['mobile'] != $mobile) {
$user = user_read_by_mobile($mobile);
$user and message(1, '用户手机已经存在');
}
开发者ID:zhangjmy,项目名称:xibbs,代码行数:31,代码来源:user.php
示例3: forum_filter_moduid
function forum_filter_moduid($moduids)
{
$moduids = trim($moduids);
if (empty($moduids)) {
return '';
}
$arr = explode(',', $moduids);
$r = array();
foreach ($arr as $_uid) {
$_uid = intval($_uid);
$_user = user_read($_uid);
if (empty($_user)) {
continue;
}
if ($_user['gid'] > 4) {
continue;
}
$r[] = $_uid;
}
return implode(',', $r);
}
开发者ID:994724435,项目名称:Ride,代码行数:21,代码来源:forum.php
示例4: thread_update
$fid = $thread['fid'];
$tid = $thread['tid'];
if (forum_access_mod($fid, $gid, 'allowmove')) {
thread_update($tid, array('fid' => $newfid));
$arr = array('uid' => $uid, 'tid' => $thread['tid'], 'pid' => $thread['firstpid'], 'subject' => $thread['subject'], 'comment' => '', 'create_date' => $time, 'action' => 'move');
modlog_create($arr);
}
}
message(0, '移动完成');
}
}
} elseif ($action == 'deleteuser') {
$_uid = param(2, 0);
$method != 'POST' and message(-1, 'Method error');
empty($group['allowdeleteuser']) and message(-1, '您无权删除用户');
$u = user_read($_uid);
empty($u) and message(-1, '用户不存在或者已经被删除。');
$u['gid'] < 6 and message(-1, '不允许删除管理组,请先调整用户用户组。');
$r = user_delete($_uid);
$r === FALSE ? message(-1, '删除失败') : message(0, '删除成功');
} elseif ($action == 'banip') {
$method != 'POST' and message(-1, 'Method error');
$_ip = xn_urldecode(param(2));
empty($_ip) and message(-1, 'IP 为空');
$_ip = long2ip(ip2long($_ip));
// 安全过滤
$day = intval(xn_urldecode(param(3)));
empty($group['allowbanuser']) and message(-1, '您无权禁止 IP');
$arr = explode('.', $_ip);
$arr[0] == '0' and message(-1, 'IP 地址不能以 0 开头。');
$banip = banip_read_by_ip($_ip);
开发者ID:xianyuxmu,项目名称:alinkagarden-xiuno,代码行数:31,代码来源:mod.php
示例5: exit
<?php
!defined('DEBUG') and exit('Access Denied.');
include './xiunophp/xn_html_safe.func.php';
$action = param(1);
$uid and $user = user_read($uid);
empty($user) and $user = user_guest();
// 发表主题帖
if ($action == 'create') {
$conf['ipaccess_on'] and !ipaccess_check($longip, 'threads') and message(-1, '您的 IP 今日发表主题数达到上限,请明天再来。');
if ($method == 'GET') {
check_standard_browser();
$fid = param(2, 0);
$forumlist_allowthread = forum_list_access_filter($forumlist, $gid, 'allowthread');
$forumarr = xn_json_encode(arrlist_key_values($forumlist_allowthread, 'fid', 'name'));
if (empty($forumlist_allowthread)) {
message(-1, '您所在的用户组没有权限发主题');
// header("Location:user-login.htm");
exit;
}
$header['title'] = '发帖' . ($uid == 0 ? ' [匿名模式]' : '');
include './pc/view/thread_create.htm';
} else {
$fid = param('fid', 0);
$forum = forum_read($fid);
empty($forum) and message(3, '板块不存在' . $fid);
$r = forum_access_user($fid, $gid, 'allowthread');
if (!$r) {
if ($gid == 0) {
$r = forum_access_user($fid, 101, 'allowthread');
$r and user_login_check($user);
开发者ID:xiuno,项目名称:xiunobbs,代码行数:31,代码来源:thread.php
示例6: user_login_check
function user_login_check($user)
{
$user['uid'] == 0 and message(10001, jump('请登录', 'user-login.htm'));
$dbuser = user_read($user['uid']);
$dbuser['password'] != $user['password'] and message(10002, jump('密码已经修改,请重新登录', 'user-login.htm'));
return $user;
}
开发者ID:994724435,项目名称:Ride,代码行数:7,代码来源:user.func.php
示例7: user_auth_check
function user_auth_check($token)
{
global $time;
$auth = param(2);
$s = decrypt($auth);
empty($s) and message(-1, '解密失败');
$arr = explode('-', $s);
count($arr) != 3 and message(-1, '数据解密失败');
list($_ip, $_time, $_uid) = $arr;
$_user = user_read($_uid);
empty($_user) and message(-1, '用户不存在');
$time - $_time > 3600 and message(-1, '链接已经过期');
return $_user;
}
开发者ID:jarryyen,项目名称:xiuno-theme-flarum,代码行数:14,代码来源:user.php
示例8: param
$header['title'] = '重置密码';
include './mobile/view/user_resetpw.htm';
}
} else {
$_uid = param(1, 0);
$pid = param(2, 0);
// 接受 pid,通过 pid 查询 userip
if ($_uid == 0) {
$post = post_read($pid);
$_ip = long2ip($post['userip']);
$_ip_url = xn_urlencode($_ip);
$banip = banip_read_by_ip($_ip);
$_user = user_guest();
} else {
$banip = array();
$_user = user_read($_uid);
$_ip = long2ip($_user['create_ip']);
$_ip_url = xn_urlencode($_ip);
}
$header['title'] = $_user['username'];
include './mobile/view/user_profile.htm';
}
// 获取用户来路
function user_http_referer()
{
$referer = param('referer');
// 优先从参数获取
empty($referer) and $referer = array_value($_SERVER, 'HTTP_REFERER', '');
$referer = str_replace(array('\\"', '"', '<', '>', ' ', '*', "\t", "\r", "\n"), '', $referer);
// 干掉特殊字符
if (!preg_match('#^(http|https)://[\\w\\-=/\\.]+/[\\w\\-=.%\\#?]*$#is', $referer) || strpos($referer, 'user-login.htm') !== FALSE || strpos($referer, 'user-logout.htm') !== FALSE || strpos($referer, 'user-create.htm') !== FALSE) {
开发者ID:xianyuxmu,项目名称:alinkagarden-xiuno,代码行数:31,代码来源:user.php
示例9: qq_login_create_user
function qq_login_create_user($username, $avatar_url_2, $openid)
{
global $conf, $time, $longip;
$arr = qq_login_read_user_by_openid($openid);
if ($arr) {
return xn_error(-2, '已经注册');
}
// 自动产生一个用户名
$r = user_read_by_username($username);
if ($r) {
$username = $username . '_' . $time;
$r = user_read_by_username($username);
if ($r) {
return xn_error(-1, '用户名被占用。');
}
}
// 自动产生一个 Email
$email = "qq_{$time}@qq.com";
$r = user_read_by_email($email);
if ($r) {
return xn_error(-1, 'Email 被占用');
}
// 随机密码
$password = md5(rand(1000000000, 9999999999) . $time);
$user = array('username' => $username, 'email' => $email, 'password' => $password, 'gid' => 101, 'salt' => rand(100000, 999999), 'create_date' => $time, 'create_ip' => $longip, 'avatar' => 0, 'logins' => 1, 'login_date' => $time, 'login_ip' => $longip);
$uid = user_create($user);
if (empty($uid)) {
return xn_error(-1, '注册失败');
}
$user = user_read($uid);
$r = db_exec("INSERT INTO bbs_user_open_plat SET uid='{$uid}', platid='1', openid='{$openid}'");
if (empty($uid)) {
return xn_error(-1, '注册失败');
}
runtime_set('users+', '1');
runtime_set('todayusers+', '1');
// 头像不重要,忽略错误。
if ($avatar_url_2) {
$filename = "{$uid}.png";
$dir = substr(sprintf("%09d", $uid), 0, 3) . '/';
$path = $conf['upload_path'] . 'avatar/' . $dir;
!is_dir($path) and mkdir($path, 0777, TRUE);
$data = file_get_contents($avatar_url_2);
file_put_contents($path . $filename, $data);
user_update($uid, array('avatar' => $time));
}
return $user;
}
开发者ID:xianyuxmu,项目名称:alinkagarden-xiuno,代码行数:48,代码来源:qq_login.func.php
注:本文中的user_read函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论