本文整理汇总了PHP中checkuser函数的典型用法代码示例。如果您正苦于以下问题:PHP checkuser函数的具体用法?PHP checkuser怎么用?PHP checkuser使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checkuser函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: levelup
function levelup($id)
{
$con = mysqli_connect("localhost", "u242089643_jucy", "gksdid1!");
if (!$con) {
die('연결 안됨: ' . mysqli_error());
} else {
mysqli_select_db($con, "u242089643_tdc");
}
$check = checkuser($id, $con);
if ($check != "empty") {
$resultset = mysqli_query($con, "update user_info set user_level = 10 where id = '{$id}'");
mysqli_close($con);
return array(array("success"));
}
mysqli_close($con);
return array(array("empty"));
}
示例2: checkmailvalid
function checkmailvalid($to, $title, $body)
{
$a = checkuser();
$username = $a[0];
if ($username == "") {
echo '-15';
exit;
}
$time = time();
date_default_timezone_set('Asia/Shanghai');
writelog("[" . date("r", $time) . "][E-mail send to {$to} from {$username}] [Title: {$title}] {$body}\n");
}
示例3: checksmsvalid
function checksmsvalid($phone, $text)
{
$a = checkuser();
$username = $a[0];
if ($username == "") {
echo '-15';
exit;
}
dbconnect();
$time = time();
$statement = "select number from capubbs.sms where username='{$username}' && {$time}-timestamp<1800";
$results = mysql_query($statement);
if (mysql_num_rows($results) >= 2) {
echo '-22';
exit;
}
$ip = @$_SERVER['REMOTE_ADDR'];
$statement = "insert into capubbs.sms values (null,'{$username}','{$phone}','{$text}','{$ip}',{$time})";
mysql_query($statement);
writelog("[SMS send to {$phone}] {$text}\n");
}
示例4: mysql_connect
$db_database = "printinginfo";
$db_username = "riteshvaryani";
$db_password = "chelseafc100";
$db_server = mysql_connect($db_hostname, $db_username, $db_password);
if (!$db_server) {
die("unable to connect to MySQL : " . mysql_error());
}
mysql_select_db($db_database) or die("Unable to select database:" . mysql_error());
if ($_POST['l_username']) {
$username = $_POST['l_username'];
$pass = $_POST['l_pass'];
if ($username == "admin" && $pass == "admin") {
session_start();
header("Location: http://www.riteshvaryani.uphero.com/admin.php?username={$username}");
} else {
if (!checkuser($username, $db_server) && $username != null && $pass != null) {
$query = "SELECT password FROM userinfo where username='{$username}'";
$result = mysql_query($query, $db_server);
while ($row = mysql_fetch_array($result)) {
$ans = $row['password'];
}
if ($ans == $pass) {
session_start();
header("Location: http://www.riteshvaryani.uphero.com/12.php?username={$username}");
} else {
echo "Wrong username or password.";
}
} else {
echo "Wrong username or password.";
}
}
示例5: check_user
function check_user($username, $password)
{
$username = safe_convert(addslashes($username));
//2007-1-20 Security Fix
$password = safe_convert(addslashes($password));
//2007-1-20 Security Fix
$userdetail = checkuser($username, $password);
if (!$userdetail) {
xml_error("Authentification failed by the conbination of provided username ({$username}) and password.");
} else {
return $userdetail;
}
}
示例6: loaduser
$u = $post['user'];
$users[$u] = loaduser($u, 1);
if ($post['thread'] == $id) {
$quotemsg = "[quote={$users[$u]['name']}]{$post['text']}[/quote]\r\n";
}
}
print "\n\t\t\t<body>\n\t\t\t{$tccellh} width=150> </td>{$tccellh} colspan=2> <tr>\n\t\t\t{$tccell1}><b>{$passhint}</td> {$tccell2l} colspan=2>\n\t\t\t{$altloginjs}\n\t\t\t<b>Username:</b> {$inpt}=username VALUE=\"" . htmlspecialchars($username) . "\" SIZE=25 MAXLENGTH=25 autocomplete=\"off\">\n\n\t\t\t<!-- Hack around autocomplete, fake inputs (don't use these in the file) -->\n\t\t\t<input style=\"display:none;\" type=\"text\" name=\"__f__usernm__\">\n\t\t\t<input style=\"display:none;\" type=\"password\" name=\"__f__passwd__\">\n\n\t\t\t<b>Password:</b> {$inpp}=password SIZE=13 MAXLENGTH=64 autocomplete=\"off\">\n\t\t\t</span><tr>\n\t\t\t{$tccell1}><b>Reply:</td>\n\t\t\t{$tccell2l} width=800px valign=top>\n\t\t\t{$txta}=message ROWS=21 COLS={$numcols} style=\"width: 100%; max-width: 800px; resize:vertical;\">" . htmlspecialchars($quotemsg, ENT_QUOTES) . "</TEXTAREA></td>\n\t\t{$tccell2l} width=*>" . moodlist(filter_int($moodid)) . "</td><tr>\n\t\t<tr>\n\t\t\t{$tccell1}> </td>{$tccell2l} colspan=2>\n\t\t\t{$inph}=action VALUE=postreply>\n\t\t\t{$inph}=id VALUE={$id}>\n\t\t\t{$inph}=valid value=\"" . md5($_SERVER['REMOTE_ADDR'] . $id . "sillysaltstring") . "\">\n\t\t\t{$inps}=submit VALUE=\"Submit reply\">\n\t\t\t{$inps}=preview VALUE=\"Preview reply\"></td>\n\t\t<tr>{$tccell1}><b>Options:</b></td>{$tccell2l} colspan=2>\n\t\t\t{$inpc}=\"nosmilies\" id=\"nosmilies\" value=\"1\"><label for=\"nosmilies\">Disable Smilies</label> -\n\t\t\t{$inpc}=\"nolayout\" id=\"nolayout\" value=\"1\"><label for=\"nolayout\">Disable Layout</label> -\n\t\t\t{$inpc}=\"nohtml\" id=\"nohtml\" value=\"1\"><label for=\"nohtml\">Disable HTML</label></td></tr>\n\t\t\t{$modoptions}\n\t\t\t{$tblend}\n\t\t\t<br>\n\t\t\t{$tblstart}{$postlist}{$tblend}\n\t\t</table>\n\t\t\t</form>\n\t\t{$fonttag}<a href=index.php>{$boardname}</a> - <a href=forum.php?id={$forumid}>{$forum['title']}</a> - {$thread['title']}";
} elseif (!$_POST['action']) {
print $header;
print "{$tccell1}>You are not allowed to post in this thread.\n\t\t<br>" . redirect("index.php", 'return to the index page', 0) . "</table>";
}
if ($_POST['action'] == 'postreply' && !($banned && $log) && $id > 0) {
if ($log && !$password) {
$userid = $loguserid;
} else {
$userid = checkuser($username, $password);
}
$error = '';
if ($userid == -1) {
$error = "Either you didn't enter an existing username, or you haven't entered the right password for the username.";
} else {
$user = @$sql->fetchq("SELECT * FROM users WHERE id='{$userid}'");
if ($thread['closed']) {
$error = 'The thread is closed and no more replies can be posted.';
}
if ($user['powerlevel'] < $forum['minpowerreply']) {
$error = 'Replying in this forum is restricted, and you are not allowed to post in this forum.';
}
if (!$message) {
$error = "You didn't enter anything in the post.";
}
示例7: checkuser
function checkuser($username, $name)
{
global $dbm;
$sqlstr = "select * from " . TB_PREFIX . "user_list where uname='{$username}'";
$user = $dbm->scalar($sqlstr);
if (count($user) > 0 && $user['uid'] != "") {
$name .= "_" . rand(1000, 9999);
return checkuser($name, $username);
} else {
return $username;
}
}
示例8: mysql_connect
return 1;
}
}
$db_hostname = "localhost";
$db_database = "printdoc";
$db_username = "root";
$db_password = "";
$db_server = mysql_connect($db_hostname, $db_username, $db_password);
if (!$db_server) {
die("unable to connect to MySQL : " . mysql_error());
}
mysql_select_db($db_database) or die("Unable to select database:" . mysql_error());
if ($_POST['l_username']) {
$username = $_POST['l_username'];
$pass = $_POST['l_pass'];
if (!checkuser($username, $db_server) && $username != "" && $pass != "") {
$query = "SELECT password FROM userinfo where username='{$username}'";
$result = mysql_query($query, $db_server);
while ($row = mysql_fetch_array($result)) {
$ans = $row['password'];
}
if ($ans === MD5($pass)) {
session_start();
header("Location: http://localhost/project/1.php");
} else {
echo "Wrong username or password.";
}
} else {
echo "Wrong username or password.";
}
}
示例9: elseif
// PREPARE
///////////////////////////////////
if (!$loginform) {
if ($loginsession) {
$loginform[username] = $loginsession[user_login];
$loginform[userpassword] = $loginsession[user_password];
} elseif ($cookie_user_id && $cookie_user_password) {
$user = getuser($cookie_user_id);
$loginform[username] = $user[user_login];
$loginform[userpassword] = $cookie_user_password;
}
}
///////////////////////////////////
// CHECK
///////////////////////////////////
$login = checkuser($logout);
///////////////////////////////////
// LOGIN SUCCESSFULL ??????
///////////////////////////////////
if (!is_array($login)) {
#######LOGIN FAILED#######
if ($login == "1") {
eval("\$inc[action] = \"" . gettemplate("fail.login.noexistinguser") . "\";");
} elseif ($login == "2") {
eval("\$inc[action] = \"" . gettemplate("fail.login.blockeduser") . "\";");
} elseif ($login == "3") {
eval("\$inc[action] = \"" . gettemplate("fail.login.wrongpassword") . "\";");
} elseif ($login == "4") {
eval("\$inc[action] = \"" . gettemplate("fail.login.usernotactiv") . "\";");
} elseif ($login == "5") {
eval("\$inc[action] = \"" . gettemplate("logout") . "\";");
示例10: testcheckuser
function testcheckuser()
{
$id = "123";
return checkuser($id);
}
示例11: explode
//验证是否受保护、创始人、有站点设置权限的人禁止找回密码方式修改密码
$founderarr = explode(',', $_SC['founder']);
if ($space['flag'] || in_array($space['uid'], $founderarr) || checkperm('admin')) {
showmessage('reset_passwd_account_invalid');
}
if (!@(include_once S_ROOT . './uc_client/client.php')) {
showmessage('system_error');
}
if (uc_user_edit(addslashes($space['username']), $_POST['newpasswd1'], $_POST['newpasswd1'], $space['email'], 1) > 0) {
updatetable('spacefield', array('authstr' => ''), array('uid' => $uid));
}
showmessage('修改密码成功,请用新密码登录,谢谢!', 'space.php?do=home', 2);
}
if ($op == 'reset') {
$query = $_SGLOBAL['db']->query('SELECT s.username, sf.email, sf.authstr FROM ' . tname('space') . ' s, ' . tname('spacefield') . " sf WHERE s.uid='{$_GET['uid']}' AND sf.uid=s.uid");
$space = $_SGLOBAL['db']->fetch_array($query);
checkuser($_GET['id'], $space);
}
include template('do_lostpasswd');
//验证地址地否有效
function checkuser($id, $space)
{
global $_SGLOBAL;
if (empty($space)) {
showmessage('user_does_not_exist');
}
list($dateline, $operation, $idstring) = explode("\t", $space['authstr']);
if ($dateline < $_SGLOBAL['timestamp'] - 86400 * 3 || $operation != 1 || $idstring != $id) {
showmessage('getpasswd_illegal');
}
}
示例12: Facebook
$facebook = new Facebook(array('appId' => '366885740127144', 'secret' => 'c4c08662da673dbb6af4538b6481ead3', 'cookie' => true));
$user = $facebook->getUser();
if ($user) {
try {
$user_profile = $facebook->api('/me');
$fbid = $user_profile['id'];
// To Get Facebook ID
$fbuname = $user_profile['username'];
// To Get Facebook Username
$fbfullname = $user_profile['name'];
// To Get Facebook full name
$femail = $user_profile['email'];
// To Get Facebook email ID
/* ---- Session Variables -----*/
$_SESSION['FBID'] = $fbid;
$_SESSION['USERNAME'] = $fbuname;
$_SESSION['FULLNAME'] = $fbfullname;
$_SESSION['EMAIL'] = $femail;
checkuser($fbid, $fbuname, $fbfullname, $femail);
// To update local DB
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
if ($user) {
header("Location: home5.php");
} else {
$loginUrl = $facebook->getLoginUrl(array('scope' => 'email', 'user_about_me'));
header("Location: " . $loginUrl);
}
示例13: setup
** This file is part of the nuBuilder source package and is licensed under the
** GPLv3. For support on developing in nuBuilder, please visit the nuBuilder
** wiki and forums. For details on contributing a patch for nuBuilder, please
** visit the `Project Contributions' forum.
**
** Website: http://www.nubuilder.com
** Wiki: http://wiki.nubuilder.com
** Forums: http://forums.nubuilder.com
*/
include $GLOBALS['StartingDirectory'] . "/database.php";
include "general.php";
include "editlibrary.php";
$setup = setup();
$uniq = uniqid(1);
//------------ validate user
$ck = checkuser($access);
if ($ck == '') {
return;
}
$GLOBALS['ArrayName'][] = '';
jinclude("general");
$t = RunQuery("SELECT * FROM sysscreen WHERE ssQuery = 'SCANYREPORT'");
$r = mysql_fetch_object($t);
$PHPjavascript = $r->ssJavaScript;
if ($PHPjavascript != '') {
print "<script type='text/javascript' language='javascript'>\n\n\n";
print $PHPjavascript;
print "\n\n\n</script>\n\n";
}
//-----get information for this report
$table = RunQuery("SELECT * FROM sysreport WHERE sysreportID = '{$id}'");
示例14: catch
$session = $helper->getSessionFromRedirect();
} catch (FacebookRequestException $ex) {
// When Facebook returns an error
} catch (Exception $ex) {
// When validation fails or other local issues
}
// see if we have a session
if (isset($session)) {
// graph api request for user data
$request = new FacebookRequest($session, 'GET', '/me');
$response = $request->execute();
// get response
$graphObject = $response->getGraphObject();
$fbid = $graphObject->getProperty('id');
// To Get Facebook ID
$fbfullname = $graphObject->getProperty('name');
// To Get Facebook full name
$femail = $graphObject->getProperty('email');
// To Get Facebook email ID
/* ---- Session Variables -----*/
$_SESSION['FBID'] = $fbid;
$_SESSION['FULLNAME'] = $fbfullname;
$_SESSION['EMAIL'] = $femail;
$_SESSION['loged_user_name'] = $_SESSION['FULLNAME'];
checkuser($fbid, $fbfullname, $_SESSION['EMAIL']);
/* ---- header location after session ----*/
header("Location: http://www.maverickgame.com/maverick-user-profile");
} else {
$loginUrl = $helper->getLoginUrl();
header("Location: " . $loginUrl);
}
示例15: deldownload
function deldownload()
{
$res = checkuser();
$rights = intval($res[1]);
if ($rights == 0) {
echo '-18';
exit;
}
$id = @$_POST['id'];
dbconnect();
$statement = "delete from capubbs.downloads where id={$id}";
mysql_query($statement);
echo mysql_errno();
exit;
}