本文整理汇总了PHP中user_get函数的典型用法代码示例。如果您正苦于以下问题:PHP user_get函数的具体用法?PHP user_get怎么用?PHP user_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_get函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getposteddata
function _getposteddata()
{
$arr['version'] = system_ver();
$arr['subject'] = $_POST['subject'];
$arr['content'] = $_POST['content'];
$author = user_get();
$arr['author'] = $author['userid'];
$arr['date'] = !empty($_POST['timestamp']) ? $_POST['timestamp'] : date_time();
$cats = !empty($_POST['cats']) ? $_POST['cats'] : array();
$flags = !empty($_POST['flags']) ? $_POST['flags'] : array();
//$arr['categories'] = array_merge(array_keys($flags), array_keys($cats));
return $arr;
}
示例2: save
function save()
{
$username = $_POST['email'];
$password = MD5(trim($_POST['password']));
include 'model/user.php';
$results = user_get(array('email' => $username, 'password' => $password));
if ($results) {
$_SESSION["username"] = $username;
header("Location: home.php");
exit;
}
echo "Login failed. Please try again";
}
示例3: save
function save()
{
$params = array();
$params['comment'] = $_POST['comment'];
$params['create_date'] = date('Y-m-d H:i:s');
$params['discussion_id'] = $_GET['id'];
include 'model/user.php';
$arrUser = user_get(array('email' => $_SESSION['username']));
$params['user_id'] = $arrUser[0]['user_id'];
comment_post($params);
$url = $_SERVER['REQUEST_URI'];
header("Location: " . $url);
exit;
}
示例4: save
function save()
{
$params = array();
$params['message'] = $_POST['message'];
$params['title'] = $_POST['title'];
$params['create_date'] = date('Y-m-d H:i:s');
include 'model/user.php';
$arrUser = user_get(array('email' => $_SESSION['username']));
$params['user_id'] = $arrUser[0]['user_id'];
include 'model/discussion.php';
$id = discussion_post($params);
header("Location: discussion.php?id=" . $id);
exit;
}
示例5: shared_entry_form_onsubmit
function shared_entry_form_onsubmit()
{
$arr['version'] = system_ver();
$arr['subject'] = stripslashes($_POST['subject']);
$arr['content'] = stripslashes($_POST['content']);
$author = user_get();
$arr['author'] = $author['NAME'];
$arr['date'] = !empty($_POST['timestamp']) ? $_POST['timestamp'] : time();
$cats = !empty($_POST['cats']) ? $_POST['cats'] : array();
$flags = !empty($_POST['flags']) ? $_POST['flags'] : array();
$arr['categories'] = array_merge(array_keys($flags), array_keys($cats));
//sess_add('entry', $arr);
return $arr;
}
示例6: reg_save
function reg_save()
{
global $smarty;
$email = @$_POST['email'];
$pass = @$_POST['loginpass'];
$pass2 = @$_POST['loginpass2'];
if ($pass == '' || $email == '') {
reg_main(_('Please enter email and password'));
return false;
}
if (strpos($email, '@') == false || strpos($email, '.') == false) {
reg_main(_('Invalid email address'));
return false;
}
if ($pass != $pass2) {
reg_main(_('Password does not match'));
return false;
}
if (recaptcha_verify() !== true) {
reg_main(_('The CAPTCHA you enter is not correct'));
return false;
}
if (INVITECODE_ENABLED == 1 && reg_checkinvite(@$_POST['invitecode']) == false) {
reg_main(_('The invite code is invalid or have been used'));
return false;
}
$ret = user_add($email, $pass);
if ($ret !== true) {
reg_main("<p>{$ret}</p>" . _('<p>Register fail, please contact us for help if you need.</p>'));
return false;
}
$user = user_get($email);
if (INVITECODE_ENABLED == 1) {
invite_use($_POST['invitecode'], $user['id']);
}
user_online($email);
$smarty->assign('tip_title', _('Register successed'));
$smarty->assign('tip_msg', _('You have registerd successfully'));
$smarty->assign('redirect_url', 'account.php');
$smarty->display('tip.html');
}
示例7: user_loggedin
function user_loggedin()
{
global $loggedin, $fp_user;
if ($loggedin) {
return $fp_user;
}
if (empty($_COOKIE[USER_COOKIE]) || empty($_COOKIE[PASS_COOKIE])) {
$fp_user = null;
return $loggedin = false;
}
$fp_user = user_get($_COOKIE[USER_COOKIE]);
if (!$fp_user) {
return false;
}
if ($_COOKIE[PASS_COOKIE] == $fp_user['password']) {
$loggedin = true;
return $fp_user;
}
$fp_user = null;
$loggedin = false;
return false;
}
示例8: header_redirect
}
if ($valid) {
if ($admin_edit === true) {
header_redirect("admin_user.php?webtag={$webtag}&uid={$profile_uid}&profile_updated=true");
exit;
} else {
header_redirect("edit_profile.php?webtag={$webtag}&uid={$profile_uid}&profile_updated=true");
exit;
}
}
}
}
}
if (is_array($profile_items_array) && sizeof($profile_items_array) > 0) {
if ($admin_edit === true) {
$user = user_get($profile_uid);
html_draw_top(array('title' => sprintf(gettext('Admin - Edit Profile - %s'), format_user_name($user['LOGON'], $user['NICKNAME'])), 'class' => 'window_title', 'js' => array('js/prefs.js')));
echo "<h1>", gettext("Admin"), html_style_image('separator'), gettext("Manage User"), html_style_image('separator'), format_user_name($user['LOGON'], $user['NICKNAME']), "</h1>\n";
} else {
html_draw_top(array('title' => gettext("My Controls - Edit Profile"), 'class' => 'window_title'));
echo "<h1>", gettext("Edit Profile"), "</h1>\n";
}
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
html_display_error_array($error_msg_array, '700', $admin_edit ? 'center' : 'left');
} else {
if (isset($_GET['profile_updated'])) {
html_display_success_msg(gettext("Profile updated."), '700', $admin_edit ? 'center' : 'left');
}
}
if ($admin_edit === true) {
echo "<div align=\"center\">\n";
示例9: remindme
function remindme($lang)
{
$with_name = true;
$with_captcha = true;
$action = 'init';
if (isset($_POST['remindme_send'])) {
$action = 'remindme';
}
$login = $confirmed = $code = $token = false;
if (!empty($_SESSION['login'])) {
$login = $_SESSION['login'];
} else {
if (!empty($_SESSION['user']['name'])) {
$login = $_SESSION['user']['name'];
} else {
if (!empty($_SESSION['user']['mail'])) {
$login = $_SESSION['user']['mail'];
}
}
}
switch ($action) {
case 'remindme':
if (isset($_POST['remindme_login'])) {
$login = strtolower(strflat(readarg($_POST['remindme_login'])));
}
if (isset($_POST['remindme_confirmed'])) {
$confirmed = readarg($_POST['remindme_confirmed']) == 'on' ? true : false;
}
if (isset($_POST['remindme_code'])) {
$code = readarg($_POST['remindme_code']);
}
if (isset($_POST['remindme_token'])) {
$token = readarg($_POST['remindme_token']);
}
break;
default:
break;
}
$missing_code = false;
$bad_code = false;
$bad_token = false;
$missing_login = false;
$bad_login = false;
$missing_confirmation = false;
$email_sent = false;
$user_page = false;
$internal_error = false;
$contact_page = false;
switch ($action) {
case 'remindme':
if (!isset($_SESSION['remindme_token']) or $token != $_SESSION['remindme_token']) {
$bad_token = true;
}
if ($with_captcha) {
if (!$code) {
$missing_code = true;
break;
}
$captcha = isset($_SESSION['captcha']['remindme']) ? $_SESSION['captcha']['remindme'] : false;
if (!$captcha or $captcha != strtoupper($code)) {
$bad_code = true;
break;
}
}
if (!$login) {
$missing_login = true;
} else {
if ((!validate_user_name($login) or !is_user_name_allowed($login)) and (!validate_mail($login) or !is_mail_allowed($login))) {
$bad_login = true;
}
}
if (!$confirmed) {
$missing_confirmation = true;
}
break;
default:
break;
}
switch ($action) {
case 'remindme':
if ($bad_token or $missing_code or $bad_code or $missing_login or $bad_login or $missing_confirmation) {
break;
}
require_once 'models/user.inc';
$user_id = user_find($login);
if (!$user_id) {
$bad_login = true;
require_once 'log.php';
write_log('password.err', substr($login, 0, 40));
break;
}
$user = user_get($user_id);
if (!$user) {
$internal_error = true;
break;
}
if (!$user['user_active'] or $user['user_banned']) {
$bad_login = true;
break;
}
//.........这里部分代码省略.........
示例10: format_user_name
$peer_user_display = format_user_name($user_peer['LOGON'], $user_peer['NICKNAME']);
html_draw_top(array('title' => sprintf(gettext('User Relationship - %s'), $peer_user_display), 'class' => 'window_title'));
$peer_relationship = user_get_relationship($_SESSION['UID'], $peer_uid);
$peer_nickname = user_get_peer_nickname($_SESSION['UID'], $peer_uid);
echo "<h1>", gettext("User Relationship"), html_style_image('separator'), "<a href=\"user_profile.php?webtag={$webtag}&uid={$peer_uid}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags($peer_user_display, true), "</a></h1>\n";
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
html_display_error_array($error_msg_array, '600', 'left');
} else {
if ($peer_perms & USER_PERM_FOLDER_MODERATE && !session::check_perm(USER_PERM_CAN_IGNORE_ADMIN, 0)) {
html_display_warning_msg(gettext("You cannot ignore this user, as they are a moderator."), '600', 'left');
}
}
if (isset($_POST['preview_signature'])) {
if (($t_sig_content = user_get_sig($peer_uid)) !== false) {
$preview_message['RECIPIENTS'] = array();
$preview_from_user = user_get($peer_uid);
$preview_message['FROM_LOGON'] = $preview_from_user['LOGON'];
$preview_message['FROM_NICKNAME'] = $preview_from_user['NICKNAME'];
$preview_message['FROM_UID'] = $preview_from_user['UID'];
$preview_message['CONTENT'] = gettext("Signature Preview");
$preview_message['CONTENT'] .= "<div class=\"sig\">" . fix_html($t_sig_content) . "</div>";
$preview_message['CREATED'] = time();
echo " <br />\n";
echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"600\">\n";
echo " <tr>\n";
echo " <td align=\"left\">\n";
echo " <table class=\"box\" width=\"100%\">\n";
echo " <tr>\n";
echo " <td align=\"left\" class=\"posthead\">\n";
echo " <table class=\"posthead\" width=\"100%\">\n";
echo " <tr>\n";
示例11: die
die($json->encode($res));
} elseif ($_REQUEST['act'] == 'getQqGroup') {
$account_qq = qq_get();
$qq = intval($_GET['qq']);
$qqgroup = qqGroup_get($qq);
//指定qq下的Q群
$account_qq = qq_get();
$smarty->assign('account_qq', $account_qq);
$smarty->assign('qq_group', $qqgroup);
$res['main'] = $smarty->fetch('account_qqgroup.htm');
die($json->encode($res));
} elseif ($_REQUEST['act'] == 'add_qqgroup') {
$account_qq = qq_get();
$department = department_get();
//获取部门
$user_name = user_get();
//Q群使用者
$smarty->assign('account_qq', $account_qq);
$smarty->assign('department', $department);
$res['main'] = $smarty->fetch('add_qqqroup.htm');
die($json->encode($res));
} elseif ($_REQUEST['act'] == 'insert_qqgroup') {
$qq = mysql_real_escape_string($_REQUEST['qq']);
//所属QQ
$qqgroup = mysql_real_escape_string($_REQUEST['qqgroup']);
//Q群帐号
$subject = mysql_real_escape_string($_REQUEST['subject']);
//主题
$strAdmin = mysql_real_escape_string($_REQUEST['strAdmin']);
//Q管理员列表
$department_id = intval($_REQUEST['departmentID']);
示例12: light_html_draw_top
} else {
$back = "lthread_list.php?webtag={$webtag}";
}
}
light_html_draw_top(array('title' => gettext('Post message'), 'js' => array('js/fineuploader.min.js', 'js/attachments.js')));
light_navigation_bar(array('back' => $back));
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
light_html_display_error_array($error_msg_array);
}
if (!$new_thread && isset($thread_data['CLOSED']) && $thread_data['CLOSED'] > 0 && session::check_perm(USER_PERM_FOLDER_MODERATE, $fid)) {
light_html_display_warning_msg(gettext("Warning: this thread is closed for posting to normal users."));
}
if ($valid && isset($_POST['preview'])) {
echo "<h3>", gettext("Message Preview"), "</h3>";
$preview_message['RECIPIENTS'] = $to_logon_array;
$preview_fuser = user_get($_SESSION['UID']);
$preview_message['FROM_LOGON'] = $preview_fuser['LOGON'];
$preview_message['FROM_NICKNAME'] = $preview_fuser['NICKNAME'];
$preview_message['FROM_UID'] = $preview_fuser['UID'];
$preview_message['CONTENT'] = $content;
if ($allow_sig == true && strlen(trim($sig)) > 0) {
$preview_message['CONTENT'] = $preview_message['CONTENT'] . "<div class=\"sig\">" . $sig . "</div>";
}
$preview_message['CREATED'] = time();
$preview_message['ATTACHMENTS'] = $attachments;
light_message_display(0, $preview_message, 0, 0, 0, false, false, false, false, true);
}
if (!$new_thread) {
if (isset($thread_data['CLOSED']) && $thread_data['CLOSED'] > 0 && !session::check_perm(USER_PERM_FOLDER_MODERATE, $fid)) {
light_html_display_warning_msg(gettext("This thread is closed, you cannot post in it!"));
}
示例13: header_redirect
}
if ($valid) {
if ($admin_edit === true) {
header_redirect("admin_user.php?webtag={$webtag}&uid={$uid}&profile_updated=true", gettext("Profile updated."));
exit;
} else {
header_redirect("edit_profile.php?webtag={$webtag}&uid={$uid}&profile_updated=true", gettext("Profile updated."));
exit;
}
}
}
}
}
if (is_array($profile_items_array) && sizeof($profile_items_array) > 0) {
if ($admin_edit === true) {
$user = user_get($uid);
html_draw_top(sprintf('title=%s', sprintf(gettext("Admin - Edit Profile - %s"), format_user_name($user['LOGON'], $user['NICKNAME']))), 'class=window_title');
echo "<h1>", gettext("Admin"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", gettext("Edit Profile"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", format_user_name($user['LOGON'], $user['NICKNAME']), "</h1>\n";
} else {
html_draw_top(sprintf('title=%s', gettext("My Controls - Edit Profile")), 'class=window_title');
echo "<h1>", gettext("Edit Profile"), "</h1>\n";
}
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
html_display_error_array($error_msg_array, '600', $admin_edit ? 'center' : 'left');
} else {
if (isset($_GET['profile_updated'])) {
html_display_success_msg(gettext("Profile updated."), '600', $admin_edit ? 'center' : 'left');
}
}
if ($admin_edit === true) {
echo "<div align=\"center\">\n";
示例14: array
<?php
require_once 'includes/db.php';
require_once 'includes/users.php';
$errors = array();
$username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);
$password = filter_input(INPUT_POST, 'password', FILTER_UNSAFE_RAW);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (empty($username)) {
$errors['username'] = true;
}
if (empty($password)) {
$errors['password'] = true;
}
if (empty($errors)) {
$user_id = user_get($db, $username, $password);
if ($user_id) {
user_sign_in($user_id);
// redirect back to the page they came from
header('location: ' . $_SESSION['referrer']);
exit;
} else {
$errors['no-user'] = true;
}
}
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
示例15: gettext
exit;
} else {
$error_msg_array[] = gettext("Could not save message. Make sure you have enough available free space.");
$valid = false;
}
}
}
}
light_html_draw_top(sprintf("title=%s", gettext("Send New PM")), "robots=noindex,nofollow");
// preview message
if ($valid && isset($_POST['preview'])) {
echo "<h3>", gettext("Message Preview"), "</h3>\n";
$pm_preview_array['TLOGON'] = $t_new_recipient_array['LOGON'];
$pm_preview_array['TNICK'] = $t_new_recipient_array['NICK'];
$pm_preview_array['TO_UID'] = $t_new_recipient_array['TO_UID'];
$preview_fuser = user_get($uid);
$pm_preview_array['FLOGON'] = $preview_fuser['LOGON'];
$pm_preview_array['FNICK'] = $preview_fuser['NICKNAME'];
$pm_preview_array['FROM_UID'] = $preview_fuser['UID'];
$pm_preview_array['SUBJECT'] = $t_subject;
$pm_preview_array['CREATED'] = time();
$pm_preview_array['AID'] = $aid;
$pm_preview_array['CONTENT'] = $t_content;
light_pm_display($pm_preview_array, PM_FOLDER_OUTBOX, true);
}
echo "<form accept-charset=\"utf-8\" name=\"f_post\" action=\"lpm_write.php\" method=\"post\" target=\"_self\">\n";
echo " ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
echo " ", form_input_hidden('folder', htmlentities_array($folder)), "\n";
echo " ", form_input_hidden("t_dedupe", htmlentities_array($t_dedupe));
echo "<div class=\"post\">\n";
echo "<h3>", gettext("Send New PM"), "</h3>\n";