本文整理汇总了PHP中is_user函数的典型用法代码示例。如果您正苦于以下问题:PHP is_user函数的具体用法?PHP is_user怎么用?PHP is_user使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_user函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_order
public function add_order()
{
//调用checkComputer函数,判断是否注册电脑,如果没有则跳转到注册页面注册
if (!checkComputer($_GET['user_id'])) {
$this->error('该用户尚未添加电脑!', '/Home/StaffPage/add?access_token=' . $_GET['access_token']);
}
if (!is_user($_GET['user_id'], 'user_id')) {
$this->error('没有该用户', '/Home/StaffPage/add?access_token=' . $_GET['access_token']);
}
if (!isset($_GET['user_id'])) {
exit;
}
//查找用户信息
$a = M('userextend');
$map['user_id'] = $_GET['user_id'];
$userextend = $a->where($map)->find();
//用户电脑信息
$b = M('computer');
$computer = $b->where($map)->order('time desc')->select();
//用户类型 type
$c = M('user');
$user = $c->where($map)->find();
$this->assign('user', $userextend);
//赋值输出 userextend表 中的用户扩展信息
$this->assign('computer_list', $computer);
$this->assign('type', $user);
$this->display();
}
示例2: event_delete
function event_delete()
{
global $config;
if (!is_user() && $config['anon_permission'] < 2) {
soft_error(_('You do not have permission to delete events.'));
}
$del_array = explode('&', $_SERVER['QUERY_STRING']);
$html = tag('div', attributes('class="box"', 'style="width: 50%"'));
$ids = 0;
foreach ($del_array as $del_value) {
list($drop, $id) = explode("=", $del_value);
if (preg_match('/^id$/', $drop) == 0) {
continue;
}
$ids++;
$event = get_event_by_id($id);
if (!check_user($event['uid']) && $config['anon_permission'] < 2) {
$html->add(tag('p', _('You do not have permission to remove item') . ": {$id}"));
continue;
}
if (remove_event($id)) {
$html->add(tag('p', _('Removed item') . ": {$id}"));
} else {
$html->add(tag('p', _('Could not remove item') . ": {$id}"));
}
}
if ($ids == 0) {
$html->add(tag('p', _('No items selected.')));
}
return $html;
}
示例3: startjournal
function startjournal($sitename, $user)
{
global $module_name;
$user = filter($user, "nohtml");
$sitename = filter($sitename, "nohtml");
if (is_user($user)) {
$j_user1 = "<center>[ <a href=\"modules.php?name={$module_name}\">" . _JOURNALDIR . "</a> | <a href=\"modules.php?name={$module_name}&file=edit\">" . _YOURJOURNAL . "</a> ]</center>";
$j_user2 = "";
} else {
$j_user1 = "<center>[ <a href=\"modules.php?name={$module_name}\">" . _JOURNALDIR . "</a> | <a href=\"modules.php?name=Your_Account&op=new_user\">" . _CREATEACCOUNT . "</a> ]</center>";
$j_user2 = "<br><center><font class=\"tiny\">" . _MEMBERSCAN . "</font></center>";
}
title("{$sitename}: " . _USERSJOURNAL . "");
if (is_user($user)) {
include "modules/Your_Account/navbar.php";
OpenTable();
nav();
CloseTable();
echo "<br>";
}
OpenTable();
echo "<center><img src=modules/{$module_name}/images/bgimage.gif><br><font class=title><b>" . _USERSJOURNAL . "</b></font></center>";
echo "{$j_user1}";
echo "{$j_user2}";
CloseTable();
}
示例4: password_submit
function password_submit()
{
global $vars, $phpcdb, $phpc_user;
if (!is_user()) {
return tag('div', __('You must be logged in.'));
}
verify_token();
if (!$phpc_user->is_password_editable()) {
soft_error(__('You do not have permission to change your password.'));
}
if (!isset($vars['old_password'])) {
return tag('div', __('You must specify your old password.'));
} else {
$old_password = $vars['old_password'];
}
if ($phpc_user->password != md5($old_password)) {
return tag('div', __('The password you entered did not match your old password.'));
}
if (empty($vars['password1'])) {
return tag('div', __('You must specify a password'));
}
if (empty($vars['password2']) || $vars['password1'] != $vars['password2']) {
return tag('div', __('Your passwords did not match'));
}
$passwd = md5($vars['password1']);
$phpcdb->set_password($phpc_user->get_uid(), $passwd);
return tag('div', __('Password updated.'));
}
示例5: themeheader
function themeheader()
{
global $prefix, $db, $user, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $banners, $sitename, $anonymous, $user;
echo "<body bgcolor=\"{$bgcolor1}\">";
ads(0);
if (is_user($user)) {
cookiedecode($user);
$username = $cookie[1];
$bienvenida = "Hello {$username}! [ <a href=\"modules.php?name=Your_Account&op=logout\"><b>Logout</b></a> ]";
} else {
$bienvenida = "<a href=\"modules.php?name=Your_Account&op=new_user\">Create an Account</a>";
}
$topics_list = "<select name=\"topic\" onChange='submit()'>\n";
$topics_list .= "<option value=\"\">All Topics</option>\n";
$toplist = $db->sql_query("select topicid, topictext from {$prefix}" . _topics . " order by topictext");
while (list($topicid, $topics) = $toplist->fetch_row()) {
$topicid = intval($topicid);
if ($topicid == $topic) {
$sel = "selected ";
}
$topics_list .= "<option {$sel} value=\"{$topicid}\">{$topics}</option>\n";
$sel = "";
}
echo "<center><a href=\"index.php\"><img src=\"themes/Sand_Journey/images/LogoLeft.gif\" alt=\"Welcome to {$sitename}\" title=\"Welcome to {$sitename}\" border=\"0\"></a><br><br></center>" . "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\" align=\"center\" bgcolor=\"{$bgcolor1}\"><tr><td align=\"center\">" . "<form action=\"modules.php?name=Search\" method=\"post\">" . "<font class=\"content\"><b>Search</b> <input type=\"text\" size=\"15\" name=\"query\"> <b>in</b> {$topics_list}</font>" . "</select>" . "</form>" . "</td></tr></table>" . "<br>" . "<table border=\"0 cellpadding=\"4\" cellspacing=\"0\" width=\"100%\" align=\"center\">\n" . "<tr><td bgcolor=\"{$bgcolor2}\" align=\"left\" width=\"20%\"> {$bienvenida}</td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"center\" width=\"60%\"><a href=\"index.php\">Home</a> | <a href=\"modules.php?name=Submit_News\">Submit News</a> | <a href=\"modules.php?name=Your_Account\">Your Account</a> | <a href=\"modules.php?name=Content\">Content</a> | <a href=\"modules.php?name=Topics\">Topics</a> | <a href=\"modules.php?name=Top\">Top 10</a></td>\n" . "<td bgcolor=\"{$bgcolor2}\" align=\"right\" width=\"20%\">" . "<b><script type=\"text/javascript\">\n\n" . "<!-- // Array ofmonth Names\n" . "var monthNames = new Array( \"" . _JANUARY . "\",\"" . _FEBRUARY . "\",\"" . _MARCH . "\",\"" . _APRIL . "\",\"" . _MAY . "\",\"" . _JUNE . "\",\"" . _JULY . "\",\"" . _AUGUST . "\",\"" . _SEPTEMBER . "\",\"" . _OCTOBER . "\",\"" . _NOVEMBER . "\",\"" . _DECEMBER . "\");\n" . "var now = new Date();\n" . "thisYear = now.getYear();\n" . "if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n" . "document.write(monthNames[now.getMonth()] + \" \" + now.getDate() + \", \" + thisYear);\n" . "// -->\n\n" . "</script></b> \n" . "</td></tr>\n" . "<tr><td valign=\"top\" width=\"100%\" colspan=3>\n";
$public_msg = public_message();
echo "{$public_msg}<br>";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"100%\"><tr><td valign=\"top\" width=\"150\" bgcolor={$bgcolor1}>";
blocks("left");
echo "<img src=\"images/pix.gif\" border=\"0\" width=\"150\" height=\"1\"></td><td> </td><td width=\"100%\" valign=\"top\">";
}
示例6: user_settings_submit
function user_settings_submit()
{
global $phpcid, $vars, $phpcdb, $phpc_user_tz, $phpc_user_lang, $phpc_prefix, $phpc_user, $phpc_script;
verify_token();
// If we have a timezone, make sure it's valid
if (!empty($vars["timezone"]) && !in_array($vars['timezone'], timezone_identifiers_list())) {
soft_error(__("Invalid timezone."));
}
// Expire 20 years in the future, give or take.
$expiration_time = time() + 20 * 365 * 24 * 60 * 60;
// One hour in the past
$past_time = time() - 3600;
if (!empty($vars["timezone"])) {
setcookie("{$phpc_prefix}tz", $vars['timezone'], $expiration_time);
} else {
setcookie("{$phpc_prefix}tz", '', $past_time);
}
if (!empty($vars["language"])) {
setcookie("{$phpc_prefix}lang", $vars['language'], $expiration_time);
} else {
setcookie("{$phpc_prefix}lang", '', $past_time);
}
if (is_user()) {
$uid = $phpc_user->get_uid();
$phpcdb->set_user_default_cid($uid, $vars['default_cid']);
$phpcdb->set_timezone($uid, $vars['timezone']);
$phpcdb->set_language($uid, $vars['language']);
$phpc_user_tz = $vars["timezone"];
$phpc_user_lang = $vars["language"];
}
return message_redirect(__('Settings updated.'), "{$phpc_script}?action=user_settings&phpcid={$phpcid}");
}
示例7: themeheader
function themeheader()
{
global $slogan, $sitename, $banners, $mainindex, $adminindex, $cpgtpl, $db, $prefix, $site_logo, $MAIN_CFG, $CPG_SESS, $Blocks;
if ($MAIN_CFG['global']['admingraphic'] & 4) {
include 'includes/cssmainmenu.php';
}
$imgr = $imgl = '';
// left blocks ?
if ($Blocks->l && $Blocks->showblocks & 1) {
$img = $Blocks->hideblock('600') ? 'plus.gif' : 'minus.gif';
$imgl = '<img alt="' . _TOGGLE . '" title="' . _TOGGLE . '" id="pic600" src="themes/' . $CPG_SESS['theme'] . '/images/' . $img . '" onclick="blockswitch(\'600\');" style="cursor:pointer; float:left; padding-top:3px;" />';
}
// right blocks ?
if ($Blocks->r && $Blocks->showblocks & 2) {
$img = $Blocks->hideblock('601') ? 'plus.gif' : 'minus.gif';
$imgr = '<img alt="' . _TOGGLE . '" title="' . _TOGGLE . '" id="pic601" src="themes/' . $CPG_SESS['theme'] . '/images/' . $img . '" onclick="blockswitch(\'601\');" style="cursor:pointer; float:right; padding-top:3px;" />';
}
$result = $db->sql_uquery("SELECT topicid, topictext FROM " . $prefix . "_topics ORDER BY topictext");
while ($row = $db->sql_fetchrow($result, SQL_NUM)) {
$toplist[$row[0]] = $row[1];
}
$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
$css_ie = ereg('MSIE 7.0', $user_agent) ? 'ie7' : (ereg('MSIE ([0-6].[0-9]{1,2})', $user_agent) ? 'ie6' : (isset($_SESSION['SECURITY']['UA']) && $_SESSION['SECURITY']['UA'] == 'Safari' ? 'safari' : (isset($_SESSION['SECURITY']['UA']) && $_SESSION['SECURITY']['UA'] == 'Opera' ? 'opera' : '')));
$cpgtpl->assign_vars(array('CSS_IE' => $css_ie ? '<link rel="stylesheet" type="text/css" href="themes/' . $CPG_SESS['theme'] . '/style/' . $css_ie . '.css" />' : '', 'PUBLIC_HEADER' => !defined('ADMIN_PAGES'), 'B_L_VISIBLE' => $Blocks->hideblock('600') ? 'style="display: none"' : '', 'BLOG_ENABLED' => is_active('Blogs'), 'G_LEFTIMAGE' => $imgl, 'G_RIGHTIMAGE' => $imgr, 'S_TOGGLE' => _TOGGLE, 'S_SEARCH' => _SEARCH, 'S_IS_ADMIN' => is_admin(), 'S_CAN_ADMIN' => can_admin(), 'S_IS_USER' => is_user(), 'S_LOGO' => $site_logo, 'S_SITENAME' => $sitename, 'S_WELCOME' => _WELCOMETO, 'S_HOME' => _HOME, 'S_BLOG' => _BlogsLANG, 'S_DOWNLOADS' => _DownloadsLANG, 'S_GALLERY' => _coppermineLANG, 'S_FORUMS' => _ForumsLANG, 'S_MY_ACCOUNT' => _Your_AccountLANG, 'S_NEWS' => _NewsLANG, 'S_ADMIN' => _ADMINISTRATION, 'S_BANNER' => $banners ? viewbanner() : '', 'U_MAININDEX' => $mainindex, 'U_NEWS' => getlink('News'), 'U_SEARCH' => getlink('Search'), 'U_DOWNLOADS' => getlink('Downloads'), 'U_FORUMS' => getlink('Forums'), 'U_GALLERY' => getlink('coppermine'), 'U_BLOG' => getlink('Blogs'), 'U_MY_ACCOUNT' => getlink('Your_Account'), 'U_ADMININDEX' => $adminindex, 'S_MAIN_MENU' => isset($mmcontent) ? $mmcontent : false));
$Blocks->display('l');
}
示例8: settings_submit
function settings_submit()
{
global $phpcid, $vars, $phpcdb, $phpc_user_tz, $phpc_user_lang, $phpc_prefix, $phpc_user;
verify_token();
// Expire 20 years in the future, give or take.
$expiration_time = time() + 20 * 365 * 24 * 60 * 60;
// One hour in the past
$past_time = time() - 3600;
if (!empty($vars["timezone"])) {
setcookie("{$phpc_prefix}tz", $vars['timezone'], $expiration_time);
} else {
setcookie("{$phpc_prefix}tz", '', $past_time);
}
if (!empty($vars["language"])) {
setcookie("{$phpc_prefix}lang", $vars['language'], $expiration_time);
} else {
setcookie("{$phpc_prefix}lang", '', $past_time);
}
if (is_user()) {
$uid = $phpc_user->get_uid();
$phpcdb->set_timezone($uid, $vars['timezone']);
$phpcdb->set_language($uid, $vars['language']);
$phpc_user_tz = $vars["timezone"];
$phpc_user_lang = $vars["language"];
}
return message(__('Settings updated.'));
}
示例9: check_user
function check_user()
{
if (!is_user()) {
forward('login.php');
exit;
}
}
示例10: FriendSend
function FriendSend($sid)
{
global $user, $cookie, $prefix, $db, $user_prefix, $module_name;
$sid = intval($sid);
if (!isset($sid)) {
fdie();
}
include "header.php";
$row = $db->sql_fetchrow($db->sql_query("SELECT title FROM " . $prefix . "_stories WHERE sid='{$sid}'"));
$title = filter($row['title'], "nohtml");
title("" . _FRIEND . "");
OpenTable();
echo "<center><font class=\"content\"><b>" . _FRIEND . "</b></font></center><br><br>" . "" . _YOUSENDSTORY . " <b>{$title}</b> " . _TOAFRIEND . "<br><br>" . "<form action=\"modules.php?name={$module_name}&file=friend\" method=\"post\">" . "<input type=\"hidden\" name=\"sid\" value=\"{$sid}\">";
if (is_user($user)) {
$row2 = $db->sql_fetchrow($db->sql_query("SELECT name, username, user_email FROM " . $user_prefix . "_users WHERE user_id = '" . intval($cookie[0]) . "'"));
if (empty($row['name'])) {
$yn = filter($row2['username'], "nohtml");
} else {
$yn = filter($row2['name'], "nohtml");
}
$ye = filter($row2['user_email'], "nohtml");
}
echo "<b>" . _FYOURNAME . " </b> {$yn} <input type=\"hidden\" name=\"yname\" value=\"{$yn}\"><br><br>\n" . "<b>" . _FYOUREMAIL . " </b> {$ye} <input type=\"hidden\" name=\"ymail\" value=\"{$ye}\"><br><br><br>\n" . "<b>" . _FFRIENDNAME . " </b> <input type=\"text\" name=\"fname\"><br><br>\n" . "<b>" . _FFRIENDEMAIL . " </b> <input type=\"text\" name=\"fmail\"><br><br>\n" . "<input type=\"hidden\" name=\"op\" value=\"SendStory\">\n" . "<input type=\"submit\" value=" . _SEND . ">\n" . "</form>\n";
CloseTable();
include 'footer.php';
}
示例11: atIsLoggedIn
function atIsLoggedIn()
{
if (is_user($GLOBALS['user'])) {
return true;
} else {
return false;
}
}
示例12: downl_infomenu_tpl
function downl_infomenu_tpl($lid)
{
echo "<br /><font class=\"content\">[ " . "<a href=\"" . getlink("&d_op=viewdownloadcomments&lid={$lid}") . "\">" . _DOWNLOADCOMMENTS . "</a>" . " | <a href=\"" . getlink("&d_op=viewdownloaddetails&lid={$lid}") . "\">" . _ADDITIONALDET . "</a>" . " | <a href=\"" . getlink("&d_op=viewdownloadeditorial&lid={$lid}") . "\">" . _EDITORREVIEW . "</a>" . " | <a href=\"" . getlink("&d_op=modifydownloadrequest&lid={$lid}") . "\">" . _MODIFY . "</a>";
if (is_user()) {
echo " | <a href=\"" . getlink("&d_op=brokendownload&lid={$lid}") . "\">" . _REPORTBROKEN . "</a>";
}
echo " ]</font>";
}
示例13: message_box
function message_box()
{
global $prefix, $MAIN_CFG, $currentlang, $db, $userinfo;
require_once CORE_PATH . 'nbbcode.php';
$query = $MAIN_CFG['global']['multilingual'] ? "AND (mlanguage='{$currentlang}' OR mlanguage='')" : '';
if (!is_admin()) {
if (is_user()) {
$query .= ' AND view!=2 AND view!=3';
} else {
$query .= ' AND (view=0 OR view=3)';
}
}
$result = $db->sql_query('SELECT mid, title, content, date, expire, view FROM ' . $prefix . "_message WHERE active='1' {$query} ORDER BY date DESC");
while (list($mid, $title, $content, $date, $expire, $view) = $db->sql_fetchrow($result)) {
$content = decode_bb_all($content, 1, true);
if (!empty($title) && !empty($content)) {
$output = '';
if ($view == 0) {
$output = _MVIEWALL;
} elseif ($view == 1) {
$output = _MVIEWUSERS;
} elseif ($view == 2) {
$output = _MVIEWADMIN;
} elseif ($view == 3) {
$output = _MVIEWANON;
} elseif ($view > 3 && (in_group($view - 3) || is_admin())) {
// <= phpBB User Groups Integration
$view = $view - 3;
if (!in_group($view)) {
list($output) = $db->sql_ufetchrow("SELECT group_name FROM " . $prefix . "_bbgroups WHERE group_id='{$view}'", SQL_NUM);
} else {
$output = in_group($view);
}
}
if ($output != '') {
$remain = '';
if (can_admin()) {
if ($expire == 0) {
$remain = _UNLIMITED;
} else {
$etime = ($date + $expire - time()) / 3600;
$etime = intval($etime);
$remain = $etime < 1 ? _EXPIRELESSHOUR : _EXPIREIN . " {$etime} " . _HOURS;
}
}
global $cpgtpl;
$cpgtpl->assign_block_vars('messageblock', array('S_TITLE' => $title, 'S_CONTENT' => $content, 'S_OUTPUT' => $output, 'S_DATE' => _POSTEDON . ' ' . formatDateTime($date, _DATESTRING2), 'S_REMAIN' => $remain, 'S_EDIT' => _EDIT, 'U_EDITMSG' => URL::admin('messages&edit=' . $mid)));
}
if ($expire != 0) {
if ($date + $expire < time()) {
$db->sql_query("UPDATE " . $prefix . "_message SET active='0' WHERE mid='{$mid}'");
}
}
}
}
$db->sql_freeresult($result);
}
示例14: check_user_hash
function check_user_hash($name, $hash)
{
$name_md5 = strtolower(md5(strtolower($name)));
if (is_user($name)) {
$user = load_serialize('db/users/' . $name_md5 . '.php');
return md5($user['pass']) == $hash;
} else {
return FALSE;
}
}
示例15: SERVICE_CMSOPEN_cpgnuke
function SERVICE_CMSOPEN_cpgnuke($authenticate_only)
{
global $this_site, $web_root, $path_to_zip, $root_dir, $media_dir, $audio_types, $video_types, $ext_graphic, $cms_user_access, $default_access, $CLASS, $include_path;
$userinfo =& $CLASS['member']->members[is_user()];
$username = $userinfo['username'];
userAuthenticate($username);
// Now let's see if we only wanted the user access
if ($authenticate_only == true) {
return;
}
include_once "header.php";
OpenTable();
}