本文整理汇总了PHP中isUser函数的典型用法代码示例。如果您正苦于以下问题:PHP isUser函数的具体用法?PHP isUser怎么用?PHP isUser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isUser函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:nigohiroki,项目名称:webichi,代码行数:26,代码来源:item.php
示例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;
}
开发者ID:ynarwal,项目名称:scavhunt,代码行数:27,代码来源:login.php
示例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);
}
}
开发者ID:briancline,项目名称:googlecode-ircplanet,代码行数:8,代码来源:db_whitelistentry.php
示例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);
}
}
开发者ID:guruSathsih,项目名称:TentInternalProject-Camfox,代码行数:55,代码来源:api.php
示例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;
}
开发者ID:hscale,项目名称:SiteZilla,代码行数:54,代码来源:preview_functions.php
示例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";
}
}
开发者ID:joshheinrichs,项目名称:geosource-cmpt371,代码行数:14,代码来源:add-banned.php
示例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";
}
}
开发者ID:joshheinrichs,项目名称:geosource-cmpt371,代码行数:14,代码来源:add-viewer.php
示例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";
}
}
开发者ID:joshheinrichs,项目名称:geosource-cmpt371,代码行数:14,代码来源:add-moderator.php
示例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;
}
开发者ID:briancline,项目名称:googlecode-ircplanet,代码行数:17,代码来源:ss.php
示例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;
}
开发者ID:Peaso,项目名称:CER,代码行数:51,代码来源:profile_functions.php
示例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) {
开发者ID:adamjdev,项目名称:Town-Village-Yoville-Style-Game,代码行数:31,代码来源:register.php
示例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">
开发者ID:nigohiroki,项目名称:20120927_LightningTalk,代码行数:31,代码来源:recommend.php
示例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()) {
?>
开发者ID:gogolB,项目名称:pinkies2,代码行数:31,代码来源:viewpinkie.php
示例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.
开发者ID:ratclier,项目名称:cs361_projectb,代码行数:31,代码来源:auth.php
示例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);
}
}
开发者ID:briancline,项目名称:ircplanet,代码行数:8,代码来源:mute.php
示例16: ob_start
<?php
ob_start();
require_once 'ustawienia/ustawienia.php';
require_once 'funkcje/podstawowe.php';
isUser($config);
$player = getUser($config);
if (empty($_GET['type'])) {
$_GET['type'] = 0;
}
if (empty($_GET['subtype'])) {
$_GET['subtype'] = 0;
}
if (empty($_GET['mid'])) {
$_GET['mid'] = 0;
}
$_GET['mid'] = intV($_GET['mid']);
$_GET['type'] = intV($_GET['type']);
$_GET['subtype'] = intV($_GET['subtype']);
$object = get_one("select m_id from arena_map inner join arena_monsters on mo_id = m_subtype where m_type = 5 and m_subtype = " . $_GET['subtype'] . " and m_id = " . $_GET['mid'] . " limit 1");
if (!empty($object)) {
switch ($_GET['subtype']) {
case 1:
$items = get_all("select * from arena_items_param ");
echo "\n\t\t\t\t\t\t\t<div class='highslide-header'><b>Meglash</b> [esc - wyjście]\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t<li class='highslide-move'>\n\t\t\t\t\t\t\t\t\t\t<a style='color:#000000' href='#' title='przesuń' onclick='return false'>\n\t\t\t\t\t\t\t\t\t\t\t<span><></span>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t<li class='highslide-close'>\n\t\t\t\t\t\t\t\t\t\t<a style='color:#000000' href='#' title='zamknij' onclick='hs.height = 120; hs.width = 220; return hs.close(this)'>\n\t\t\t\t\t\t\t\t\t\t\t<span>zamknij</span>\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t";
$echo = '';
if (is_array($items)) {
foreach ($items as $item) {
$options = '';
if ($item->ip_gold <= $player->gold) {
$options .= "<a style='color:#000000' href='?action=map&item_buy=" . $item->ip_id . "' >[ kup ]</a>";
开发者ID:WlasnaGra,项目名称:Arena,代码行数:31,代码来源:market.php
示例17: explode
$arr = explode("\n", $d);
if ($m == 'checkin') {
foreach ($arr as $line) {
$line = trim($line);
if ($line != '') {
if (isObject($line)) {
$_CheckOuts->checkin($line);
} else {
echo 'Invalid barcode: "' . $line . '"<br />';
}
}
}
} else {
if ($m == 'checkout') {
$user = trim(array_shift($arr));
if (isUser($user)) {
foreach ($arr as $line) {
$line = trim($line);
if ($line != '') {
if (isObject($line)) {
$_CheckOuts->checkout($user, $line);
} else {
echo 'Invalid barcode: "' . $line . '"<br />';
}
}
}
} else {
echo 'Invalid user: ' . $user . '<br />';
}
}
}
开发者ID:robbat2,项目名称:rats,代码行数:31,代码来源:kiosk.php
示例18: array
$valoriEng = array($_GET['item'], L_eng);
$valoriRus = array($_GET['item'], L_rus);
$qry_art = $funzioni->getValoreCampo(t_articolo, array('id', 'codice', 'categoria', 'sezione', 'decoro', 'width_img', "DATE_FORMAT(data,'%d-%m-%Y') as data"), array('id'), array($_GET['item']));
$qry_des_ita = $funzioni->getValoreCampo(t_descrizione, array('descrizione'), $campiRicerca, $valoriIta);
$qry_des_eng = $funzioni->getValoreCampo(t_descrizione, array('descrizione'), $campiRicerca, $valoriEng);
$qry_des_rus = $funzioni->getValoreCampo(t_descrizione, array('descrizione'), $campiRicerca, $valoriRus);
$sql = "SELECT D.id, D.nome FROM " . t_decoro . " D JOIN " . t_sort . " S ON D.id = S.decoro WHERE S.categoria = " . $qry_art->fields['categoria'] . " ORDER BY S.sort";
$qryDecori = $funzioni->getDB()->Execute($sql);
$codiceConArt = stripslashes($qry_art->fields['codice']);
$strCodice = substr($codiceConArt, 4, strlen($codiceConArt));
$flagCategoria = $qry_art->fields['categoria'];
$flagDecoro = $qry_art->fields['decoro'];
$flagSezione = $qry_art->fields['sezione'];
$strData = $qry_art->fields['data'];
// controllo permessi di editazione campi
if (!isAdmin() && !isUser() && $flagSezione != SEZ_GENERAL) {
$atr_disabled = "disabled";
}
//============ PARTE RIGUARDANTE LA GRANDEZZA DELL'IMMAGINE PRINCIPALE =========
$sql2 = "SELECT id, nome FROM " . t_img . " WHERE articolo=" . $_GET['item'];
$qryImg2 = $funzioni->getDB()->Execute($sql2);
if (!$qryImg2->EOF) {
$sql3 = "SELECT MIN(id), nome FROM " . t_img . " WHERE articolo=" . $_GET['item'];
$qryImg = $funzioni->getDB()->Execute($sql3);
$im = PATH_IMG . $qryImg->fields['nome'] . "_thumb.jpg";
list($w, $h) = getimagesize($im);
$strVarJS .= "setWidth(" . $w . ");\n";
$strVarJS .= "setHeight(" . $h . ");\n";
$strWidthImg = $qry_art->fields['width_img'];
if ($strWidthImg == 0) {
$strWidthImg = 180;
开发者ID:gambric,项目名称:ceramichesofia,代码行数:31,代码来源:varAddArticolo.inc.php
示例19: reportEvent
function reportEvent($event_name, $source, $arg1 = "", $arg2 = "", $arg3 = "", $arg4 = "", $arg5 = "", $is_command = false)
{
if (!$is_command && !REPORT_EVENTS || $is_command && !REPORT_COMMANDS) {
return;
}
if ($is_command) {
$channel = COMMAND_CHANNEL;
} else {
$channel = EVENT_CHANNEL;
}
$bot = $this->default_bot;
if (isServer($source)) {
$source = BOLD_START . $source->getNameAbbrev(NICK_LEN) . BOLD_END;
} elseif (isUser($source)) {
$source = $source->getNick();
}
for ($i = 1; $i <= 5; $i++) {
eval('$arg = $arg' . $i . ';');
if (!is_object($arg)) {
continue;
}
if (isServer($arg) || isChannel($arg)) {
$arg = $arg->getName();
} elseif (isUser($arg)) {
$arg = $arg->getNick();
}
eval('$arg' . $i . ' = $arg;');
}
if (strlen($source) > NICK_LEN) {
$source = substr($source, 0, NICK_LEN);
}
$margin = substr_count($source, BOLD_START);
$misc = $arg1 . ' ' . $arg2 . ' ' . $arg3 . ' ' . $arg4 . ' ' . $arg5;
$misc = trim($misc);
if (!$this->finished_burst) {
$this->pending_events[] = array('chan_name' => $channel, 'margin' => $margin, 'source' => $source, 'event_name' => $event_name, 'misc' => $misc);
}
$bot->messagef($channel, '[%' . (NICK_LEN + $margin) . 's] %s %s', $source, $event_name, $misc);
/*
if ($this->finished_burst)
$bot->messagef($channel, "[%". (NICK_LEN + $margin) ."s] %s %s", $source, $event_name, $misc);
*/
return true;
}
开发者ID:briancline,项目名称:ircplanet,代码行数:44,代码来源:os.php
示例20: header
Output::success($data);
} else {
header('HTTP/1.1 405 Method Not Allowed');
header('Allow: GET, POST');
Output::error('Method not exist');
}
}
}
break;
case 'login':
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$post = json_decode(file_get_contents("php://input"), true);
// die(var_dump($post));
// TODO:: Validate post
if (isset($post['email']) && !empty($post['email']) && isset($post['password']) && !empty($post['password'])) {
$data = isUser($post['email'], $post['password']);
if ($data != 0) {
header('HTTP/1.1 200 OK');
Output::success($data);
} else {
$data = 'Kullanıcı bilgilerinizi kontrol ediniz!';
header('HTTP/1.1 203 Non-Authoritative Information');
Output::error($data);
}
} else {
$data = 'Kullanıcı bilgilerinizi gönderiniz!';
header('HTTP/1.1 405 Method Not Allowed');
header('Allow: POST');
Output::error($data);
}
} else {
开发者ID:ademaras,项目名称:basic-web-service,代码行数:31,代码来源:api.php
注:本文中的isUser函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论