本文整理匯總了PHP中CheckUserID函數的典型用法代碼示例。如果您正苦於以下問題:PHP CheckUserID函數的具體用法?PHP CheckUserID怎麽用?PHP CheckUserID使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了CheckUserID函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ShowMsg
ShowMsg('驗證碼錯誤!', '-1');
exit;
}
}
$faqkey = isset($faqkey) && is_numeric($faqkey) ? $faqkey : 0;
if ($safe_faq_msg == 1) {
if ($safefaqs[$faqkey]['answer'] != $safeanswer || $safeanswer == '') {
ShowMsg('驗證問題答案錯誤', '-1');
exit;
}
}
if ($subject == '') {
ShowMsg("請填寫信息標題!", "-1");
exit;
}
$msg = CheckUserID($msgtoid, "用戶名", false);
if ($msg != 'ok') {
ShowMsg($msg, "-1");
exit;
}
$row = $dsql->GetOne("SELECT * FROM `#@__member` WHERE userid LIKE '{$msgtoid}' ");
if (!is_array($row)) {
ShowMsg("你指定的用戶不存在,不能發送信息!", "-1");
exit;
}
$subject = cn_substrR(HtmlReplace($subject, 1), 60);
$message = cn_substrR(HtmlReplace($message, 0), 1024);
$sendtime = $writetime = time();
//發給收件人(收件人可管理)
$inquery1 = "INSERT INTO `#@__member_pms` (`floginid`,`fromid`,`toid`,`tologinid`,`folder`,`subject`,`sendtime`,`writetime`,`hasview`,`isadmin`,`message`)\r\n VALUES ('{$cfg_ml->M_LoginID}','{$cfg_ml->M_ID}','{$row['mid']}','{$row['userid']}','inbox','{$subject}','{$sendtime}','{$writetime}','0','0','{$message}'); ";
//保留到自己的發件箱(自己可管理)
示例2: GetCkVdValue
$vdcode = '';
}
$svali = GetCkVdValue();
if (strtolower($vdcode) != $svali || $svali == '') {
ResetVdValue();
ShowMsg("對不起,驗證碼輸入錯誤!", "-1");
exit;
}
//驗證郵箱,用戶名
if (empty($mail) && empty($userid)) {
showmsg('對不起,請輸入用戶名或郵箱', '-1');
exit;
} elseif (!ereg("(.*)@(.*)\\.(.*)", $mail)) {
showmsg('對不起,請輸入正確的郵箱格式', '-1');
exit;
} elseif (CheckUserID($userid, '', false) != 'ok') {
ShowMsg("你輸入的用戶名 {$userid} 不合法!", "-1");
exit;
}
$member = member($mail, $userid);
//以郵件方式取回密碼;
if ($type == 1) {
//判斷係統郵件服務是否開啟
if ($cfg_sendmail_bysmtp == "Y") {
sn($member['mid'], $userid, $member['email']);
} else {
showmsg('對不起郵件服務暫未開啟,請聯係管理員', 'login.php');
exit;
}
//以安全問題取回密碼;
} elseif ($type == 2) {
示例3: ResetVdValue
ResetVdValue();
ShowMsg('驗證碼錯誤!', '-1');
exit;
}
}
$faqkey = isset($faqkey) && is_numeric($faqkey) ? $faqkey : 0;
if ($safe_faq_reg == '1') {
if ($safefaqs[$faqkey]['answer'] != $rsafeanswer || $rsafeanswer == '') {
ShowMsg('驗證問題答案錯誤', '-1');
exit;
}
}
$userid = trim($userid);
$pwd = trim($userpwd);
$pwdc = trim($userpwdok);
$rs = CheckUserID($userid, '用戶名');
if ($rs != 'ok') {
ShowMsg($rs, '-1');
exit;
}
if (strlen($userid) > 20 || strlen($uname) > 36) {
ShowMsg('你的用戶名或用戶筆名過長,不允許注冊!', '-1');
exit;
}
if (strlen($userid) < $cfg_mb_idmin || strlen($pwd) < $cfg_mb_pwdmin) {
ShowMsg("你的用戶名或密碼過短,不允許注冊!", "-1");
exit;
}
if ($pwdc != $pwd) {
ShowMsg('你兩次輸入的密碼不一致!', '-1');
exit;
示例4: ShowMsg
$addupquery .= ",email='{$email}'";
}
}
//修改安全問題
if ($newsafequestion != 0 && $newsafeanswer != '') {
if (strlen($newsafeanswer) > 30) {
ShowMsg('你的新安全問題的答案太長了,請保持在30字節以內!', '-1');
exit;
} else {
$addupquery .= ",safequestion='{$newsafequestion}',safeanswer='{$newsafeanswer}'";
}
}
}
//修改uname
if ($uname != $row['uname']) {
$rs = CheckUserID($uname, '昵稱或公司名稱', false);
if ($rs != 'ok') {
ShowMsg($rs, '-1');
exit;
}
$addupquery .= ",uname='{$uname}'";
}
//性別
if (!in_array($sex, array('男', '女', '保密'))) {
ShowMsg('請選擇正常的性別!', '-1');
exit;
}
$query1 = "Update `#@__member` set pwd='{$pwd}',sex='{$sex}'{$addupquery} where mid='" . $cfg_ml->M_ID . "' ";
$dsql->ExecuteNoneQuery($query1);
//如果是管理員,修改其後台密碼
if ($cfg_ml->fields['matt'] == 10 && $pwd2 != "") {
示例5: CheckUser
/**
* 檢查用戶是否合法
*
* @access public
* @param string $loginuser 登錄用戶名
* @param string $loginpwd 用戶密碼
* @return string
*/
function CheckUser(&$loginuser, $loginpwd)
{
global $dsql;
//檢測用戶名的合法性
$rs = CheckUserID($loginuser, '用戶名', FALSE);
//用戶名不正確時返回驗證錯誤,原登錄名通過引用返回錯誤提示信息
if ($rs != 'ok') {
$loginuser = $rs;
return '0';
}
//matt=10 是管理員關連的前台帳號,為了安全起見,這個帳號隻能從後台登錄,不能直接從前台登錄
$row = $dsql->GetOne("SELECT mid,matt,pwd,logintime FROM `#@__member` WHERE userid LIKE '{$loginuser}' ");
if (is_array($row)) {
if ($this->GetShortPwd($row['pwd']) != $this->GetEncodePwd($loginpwd)) {
return -1;
} else {
//管理員帳號不允許從前台登錄
if ($row['matt'] == 10) {
return -2;
} else {
$this->PutLoginInfo($row['mid'], $row['logintime']);
return 1;
}
}
} else {
return 0;
}
}
示例6: ShowMsg
}*/
//修改安全問題
if ($newsafequestion != 0 && $newsafeanswer != '') {
if (strlen($newsafeanswer) > 30) {
ShowMsg('你的新安全問題的答案太長了,請保持在30字節以內!', '-1');
exit;
} else {
$newsafequestion = HtmlReplace($newsafequestion, 1);
$newsafeanswer = HtmlReplace($newsafeanswer, 1);
$addupquery .= ",safequestion='{$newsafequestion}',safeanswer='{$newsafeanswer}'";
}
}
}
//修改uname
if ($uname != $row['uname']) {
$rs = CheckUserID($uname, '昵稱或公司名稱', FALSE);
if ($rs != 'ok') {
ShowMsg($rs, '-1');
exit;
}
$addupquery .= ",uname='{$uname}'";
}
//性別
if (!in_array($sex, array('男', '女', '保密'))) {
ShowMsg('請選擇正常的性別!', '-1');
exit;
}
$query1 = "UPDATE `#@__member` SET pwd='{$pwd}',sex='{$sex}'{$addupquery} where mid='" . $cfg_ml->M_ID . "' ";
$dsql->ExecuteNoneQuery($query1);
//如果是管理員,修改其後台密碼
if ($cfg_ml->fields['matt'] == 10 && $pwd2 != "") {