本文整理汇总了PHP中isUser函数的典型用法代码示例。如果您正苦于以下问题:PHP isUser函数的具体用法?PHP isUser怎么用?PHP isUser使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isUser函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calcNearUser
public function calcNearUser()
{
$this->load->model('item_model', 'items');
$newUserId = $this->items->newUserId();
$point = array(5, 3);
$j = 0;
for ($i = 1; $i < 11; $i++) {
if (isset($_POST[$i])) {
$this->items->newLikeCheck($newUserId, $_POST[$i], $point[$j]);
$j++;
}
}
$max = 0.0;
for ($i = 1; $i < $newUserId; $i++) {
if (isUser($i)) {
$num = distanceUsers(evalUsers($i, $newUserId));
if ($num > $max) {
$max = $num;
$nearUserId = $i;
}
}
}
$data['newUserId'] = $newUserId;
$data['recommendItem'] = $this->items->getRecommendItem($nearUserId, $newUserId);
$this->load->view('items/recommend', $data);
}
示例2: userLogin
function userLogin()
{
global $user, $dataDir;
session_start();
if (isset($_REQUEST['schoolId'])) {
$schoolId = $_REQUEST['schoolId'];
$password = $_REQUEST['password'];
$_SESSION['schoolId'] = $schoolId;
$_SESSION['password'] = $password;
} else {
$schoolId = $_SESSION['schoolId'];
$password = $_SESSION['password'];
}
if (!isUser($schoolId)) {
$user = false;
return false;
}
$userFile = $dataDir . '/users/' . $schoolId . '.dat';
$account = unserialize(file_get_contents($userFile));
if ($account['password'] == md5($password)) {
$studentInfo = array_merge($account, getStudentInfo($schoolId));
$user = $studentInfo;
} else {
$user = false;
}
return $user;
}
示例3: matches
public function matches($host)
{
if (isUser($host)) {
return fnmatch($this->mask, $host->getFullMask()) || fnmatch($this->mask, $host->getFullIpMask());
} else {
return fnmatch($this->mask, $host);
}
}
示例4: login
public function login()
{
require 'camfoxconfig.php';
$username = $_REQUEST['username'];
$password = $_REQUEST['userpassword'];
$id = isUser($username, $password);
if ($id > 0) {
$last_login = get_last_login($id);
$_SESSION['user_id'] = $id;
//$_SESSION['last_login'] = $last_login;
update_last_login_date($id);
$user = checkUserAvailableEvents($_SESSION['user_id']);
if ($user == 0) {
insertUserintoEvents($_SESSION['user_id']);
} else {
updateUserinEvents($_SESSION['user_id']);
}
$_SESSION['new_event_count'] = $user[3];
$_SESSION['last_login'] = $user[2];
/* $email_id=getUserEmailById($id);
//echo $email_id;
$_SESSION['email_id'] = $email_id;
$_SESSION['user_id'] = $id;
$username = $_SESSION['email_id'];
/* if(in_array($email_id,$hr_email))
header("Location:hr_panel.php");
else
header("Location:home.php"); */
/* $pending_requests=get_my_pending_requests($_SESSION['email_id']);
if((isset($_SESSION['first_time']) && $_SESSION['first_time'] =='yes') || $pending_requests == null || !is_approver($_SESSION['email_id']))
{
$status=0;
}
else
{
$status=1;
$_SESSION['first_time']='yes';
}
if(in_array($email_id,$hr_email))
$this->http_response(2,200);
else
$this->http_response(1,200);
*/
$this->http_response($id, 200);
} else {
$message = "Incorrect Credentials";
$username = $_POST['username'];
$password = $_POST['password'];
// header("Location:index.php?error=$message&username=$username&password=$password");
$this->http_response(0, 200);
}
}
示例5: replaceTemplateValues
function replaceTemplateValues($string, $siteid, $page_title)
{
$db = Database::obtain();
$sql = "SELECT * FROM " . TABLE_WEBSITES . "\n\t\t\t\t\tWHERE `id` =" . $siteid . "";
$websitedata = $db->query_first($sql);
$website_template = $websitedata['website_template'];
$website_protect_value = $websitedata['website_protect'];
$website_name = $websitedata['website_name'];
$meta_description = $websitedata['website_description'];
$meta_keywords = $websitedata['website_keywords'];
$creator_name = $websitedata['creator_name'];
$creator_website = $websitedata['creator_website'];
$website_template = $websitedata['website_template'];
$default_file_extension = '.html';
if (isUser($_SESSION['userid']) or isActive($_SESSION['userid']) == false) {
$website_footer = MSG00010 . ' <a href ="' . szUrl() . '" >' . szName() . '</a> - ' . MSG00082 . ' ' . szYear() . ' ' . $website_name . '. ' . MSG00057 . ' ';
} else {
$website_footer = MSG00009 . ' <a href="http://' . $creator_website . '" target="_blank" alt="' . $creator_name . '" title="' . $creator_name . '">' . $creator_name . '</a> - ' . MSG00082 . ' ' . szYear() . ' ' . $website_name . '. ' . MSG00057 . ' ';
}
$meta_generator_name = szName();
$meta_language = szLanguage();
if ($website_protect_value == '1') {
$website_protect = protectSite();
} else {
$website_protect = '';
}
$website_header = '
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>' . $page_title . ' - ' . $website_name . '</title>
<meta name="description" content="' . $meta_description . '">
<meta name="keywords" content="' . $meta_keywords . '">
<meta http-equiv="Copyright" content="' . $website_name . '" />
<meta name="generator" content="' . $meta_generator_name . '" />
<meta http-equiv="content-language" content="' . $meta_language . '" />
<meta name="robots" content="index, follow" />
<link rel="shortcut icon" href="favicon.ico"/>
<link href="sitezilla.css" rel="stylesheet" type="text/css">
<link href="templates/' . $website_template . '/style.css" rel="stylesheet" type="text/css">
' . ie6Css($website_template) . ie7Css($website_template) . $website_protect . '';
$webauthor = getAuthor($website_template);
if ($webauthor == MSG00007) {
$author = '';
} else {
if (strlen(stristr($webauthor, szCompany())) > 0) {
$author = '';
} else {
$author = ' ' . MSG00008 . ' ' . $webauthor;
}
}
$placeholders = array('WEBSITE_HEADER', 'WEBSITE_NAME', 'WEBSITE_FOOTER', 'TEMPLATE_AUTHOR');
$new_vals = array($website_header, '<a href="index' . $default_file_extension . '" alt="' . $website_name . '" title="' . $website_name . '">' . $website_name . '</a>', $website_footer, $author);
$newString = str_replace($placeholders, $new_vals, $string);
return $newString;
}
示例6: addBanned
function addBanned($conn, $banned, $channelname, $channelowner)
{
global $error, $error_message;
if (isUser($conn, $banned)) {
$sql = "INSERT INTO channel_banned (cb_username, cb_chname, cb_chowner) \n VALUES (\"" . $banned . "\", \"" . $channelname . "\", \"" . $channelowner . "\");";
if (!$conn->query($sql)) {
$error = true;
$error_message = "User is already banned";
}
} else {
$error = true;
$error_message = "User does not exist";
}
}
示例7: addViewer
function addViewer($conn, $viewer, $channelname, $channelowner)
{
global $error, $error_message;
if (isUser($conn, $viewer)) {
$sql = "INSERT INTO private_view_channels (prv_username, prv_chname, prv_chowner) \n VALUES (\"" . $viewer . "\", \"" . $channelname . "\", \"" . $channelowner . "\");";
if (!$conn->query($sql)) {
$error = true;
$error_message = "User is already a viewer";
}
} else {
$error = true;
$error_message = "User does not exist";
}
}
示例8: addModerator
function addModerator($conn, $moderator, $channelname, $channelowner)
{
global $error, $error_message;
if (isUser($conn, $moderator)) {
$sql = "INSERT INTO channelmods (cm_username, cm_chname, cm_chowner) \n\t\t\t\tVALUES (\"" . $moderator . "\", \"" . $channelname . "\", \"" . $channelowner . "\");";
if (!$conn->query($sql)) {
$error = true;
$error_message = "User is already a moderator";
}
} else {
$error = true;
$error_message = "User does not exist";
}
}
示例9: getUserLevel
function getUserLevel($user_obj)
{
$acct_id = $user_obj;
if (is_object($user_obj) && isUser($user_obj)) {
if (!$user_obj->isLoggedIn()) {
return 0;
}
$acct_id = $user_obj->getAccountId();
}
$res = db_query("select `level` from `ss_admins` where user_id = " . $acct_id);
if ($res && mysql_num_rows($res) > 0) {
$level = mysql_result($res, 0);
mysql_free_result($res);
return $level;
}
return 0;
}
示例10: deleteCandidate
function deleteCandidate($user = NULL, $type = 'all')
{
/**
* SERVICE for deleting the information of the $user stored into the CER database
* If $type != "all", it deletes just the requested type
* @author Germán Sánchez (GREC-ESADE), Collage
* @version june 2014
*/
global $debugar, $token;
//$output = 'User to delete: '.$user.'.';
$userToDelete = null;
// Check if the authenticated user is the same as the one to be deleted or
// if the user has admin privileges.
$credentials = checkTokenESB($token);
if (isUser($credentials)) {
$username = $credentials['username'];
if ($debugar) {
echo 'deleteCandidate: username <strong>"' . $username . '"</strong> (role "' . $credentials['role'] . '") wants to delete profile of candidate "<strong>' . $user . '</strong>"!<br />' . "\n";
}
if ($user == $username) {
$userToDelete = $user;
} else {
if ($debugar) {
echo 'deleteCandidate: WARNING, usernames do not match.<br />' . "\n";
}
if (isAdmin($credentials)) {
$userToDelete = $user;
}
}
}
if ($userToDelete != null) {
// Check the existence of the user
if (!isCandidate($userToDelete)) {
if ($debugar) {
echo 'deleteCandidate: KO, although the user has permision, the candidate "' . $userToDelete . '" does not exist! Response:' . "\n";
}
$output[] = array('errorNumber' => 3, 'errorText' => 'Candidate to delete does not exist.');
echo json_encode($output);
}
$txtType = '';
if ($type != 'all') {
$txtType = '(part ' . $type . ') ';
}
if ($debugar) {
echo 'deleteCandidate: OK, profile of candidate "' . $userToDelete . '" would be deleted.<br />' . "\n";
}
$output[] = array('infoNumber' => 2, 'infoText' => 'Profile ' . $txtType . 'of candidate ' . $userToDelete . ' would be deleted (username ' . $username . ').');
$output = json_encode($output);
}
return $output;
}
示例11: header
<?php
$rq = true;
require './system/system_config.php';
if (isUser($config_db_accounts) === true) {
header("Location: {$config_domain}");
}
$msg = '';
if (isset($_POST['submit'])) {
if (!isset($_POST['username'])) {
$msg = 'No username entered!';
} elseif (!isset($_POST['email'])) {
$msg = 'No email entered!';
} elseif (!isset($_POST['password'])) {
$msg = 'No password entered!';
} elseif (!isset($_POST['repeat'])) {
$msg = 'Password not repeated!';
} else {
$username = security($_POST['username']);
$email = security($_POST['email']);
$password = encrypy(security($_POST['password']));
$repeat = encrypy(security($_POST['repeat']));
$Function_Query1 = mysql_query("SELECT email FROM {$config_db_accounts} WHERE email='{$email}'");
$Function_Query2 = mysql_query("SELECT username FROM {$config_db_accounts} WHERE username='{$username}'");
if ($password !== $repeat) {
$msg = 'Passwords did not match!';
} elseif ($config_registrations !== true) {
$msg = 'Registration is disabled.';
} elseif (validate_email($email) !== true) {
$msg = 'Invalid email entered!';
} elseif (validate_username($username) !== true) {
示例12: session_start
<?php
require_once 'DBaccess.php';
require_once 'functions.php';
session_start();
$recommendee_id = $_SESSION['user_id'];
unset($_SESSION);
$max = 0.0;
for ($i = 1; $i < $recommendee_id; $i++) {
if (isUser($i)) {
$num = distanceUsers(evalUsers($i, $recommendee_id));
if ($num > $max) {
$max = $num;
$nearUserId = $i;
}
}
}
$sql = sprintf('SELECT item_id FROM likes WHERE user_id=%d', r($recommendee_id));
$recordRecommendeeLikes = mysql_query($sql) or die(mysql_error());
$recommendeeLikesArray = array();
$i = 0;
while ($recommendeeLikes = f($recordRecommendeeLikes)) {
$recommendeeLikesArray[$i] = $recommendeeLikes['item_id'];
$i++;
}
$sql = sprintf('SELECT i.* FROM likes l, items i WHERE l.user_id=%d AND l.item_id=i.id AND i.id != %d AND i.id != %d', r($nearUserId), r($recommendeeLikesArray[0]), r($recommendeeLikesArray[1]));
$recordRecommendItem = mysql_query($sql) or die(mysql_error());
$RecommendItem = f($recordRecommendItem);
?>
<!DOCTYPE html>
<html lang="ja">
示例13: getName
<div class="container no-print">
<div class="well">
<H2>
Welcome <?php
echo getName();
?>
to ePinkies2.
</H2>
<H4>Here you will be able view a pinkie object. Then if it is submitted to you, you can approve it and send it to the next person. If you reject it, it will go back to the previous person from you.</H4>
<!-- Back to Home button. -->
<a href="./home.php" class="btn btn-success" role="button"><span class="glyphicon glyphicon-home"></span> Back to Home</a>
</div>
</div>
<?php
if (isUser()) {
?>
<form class="form-horizontal" role="form" action="onUserSubmit.php" method="POST" name="viewPinkieForm" id="viewPinkieForm" >
<?php
}
?>
<?php
if (isSuper()) {
?>
<form class="form-horizontal" role="form" action="onSuperSubmit.php" method="POST" name="viewPinkieForm" id="viewPinkieForm" >
<?php
}
?>
<?php
if (isAdmin()) {
?>
示例14: htmlspecialchars
// Start out expecting good info, then be proven wrong about that.
$status = TRUE;
// Set up a message string to send back to the calling page.
$msg = NULL;
// If we got a uname (required), continue validating and building
// up the variables that will hold the user info.
if (isset($_POST['uname']) && $_POST['uname'] != NULL) {
$inName = htmlspecialchars($_POST['uname']);
// Did we get a password? If so, use it.
if (isset($_POST['pword']) && $_POST['pword'] != NULL) {
// I can't imagine why this would need htmlspecialchars()...
$inPword = $_POST['pword'];
// Connect to the database (dbConnect() is in functions.php).
$db = dbConnect();
// A valid user? (isUser() is in functions.php)
if (isUser($inName, $inPword, $db) == 0) {
$msg = "Invalid username or password. Try again.";
$status = FALSE;
}
} else {
$msg = "Missing password. ";
$status = FALSE;
}
} else {
$msg = "Missing username. ";
$status = FALSE;
}
// If we got through all that without errors, start a session.
if ($status == TRUE) {
// Start a session. session_start() and not sessionInit() because this
// is a file users should not access directly.
示例15: matches
public function matches($host)
{
if (isUser($host) || isBot($host)) {
return fnmatch($this->mask, $host->getGlineHost()) || fnmatch($this->mask, $host->getGlineIp());
} else {
return fnmatch($this->mask, $host);
}
}