本文整理汇总了PHP中Utility::CaptchaCheck方法的典型用法代码示例。如果您正苦于以下问题:PHP Utility::CaptchaCheck方法的具体用法?PHP Utility::CaptchaCheck怎么用?PHP Utility::CaptchaCheck使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utility
的用法示例。
在下文中一共展示了Utility::CaptchaCheck方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
if ($_POST) {
if (!Utility::CaptchaCheck($this->_post('verifycode'))) {
Session::Set("error", "验证码有误,请重新输入");
redirect("/login");
}
$email = $this->_get("email");
$password = $this->_get("password");
$users = D('Users');
$login_user = $users->getLogin($_POST['email'], $_POST['password']);
if (!$login_user) {
Session::Set('error', '用户名或密码错误');
$this->redirect("/frontend/login/index");
} else {
if ($login_user['is_enabled'] == 'N' && $login_user['secret']) {
Session::Set('error', '登录失败');
$this->redirect("/frontend/login/index");
} else {
if (abs(intval($_POST['auto_login']))) {
Login::Logon($login_user, true);
} else {
Login::Logon($login_user);
}
Session::set("success", "登录成功");
if ($_REQUEST['ref']) {
redirect($_REQUEST['ref']);
} else {
redirect("/");
}
}
}
} else {
$this->display();
}
}
示例2: submit_contact
public function submit_contact()
{
$captcha = $this->_param("captcha");
$subscribe = $this->_param("subscribe");
if (!Utility::CaptchaCheck($captcha, true)) {
Session::Set("error", L("captcha_error"));
$this->display("error");
return;
}
$subscriberModel = M("Subscribers");
if ($subscriberModel->create()) {
$intrest = $this->_param("intrest");
if ($intrest) {
$subscriberModel->intrest = implode(",", $intrest);
}
$subscriberModel->create_time = time();
$id = $subscriberModel->add();
//send email
$contact = $this->_param("contact");
if ($contact) {
// $name = $this->_param("name");
//如果联系方式是邮箱,就给对方发一封邮件
if (is_email($contact)) {
$email_content = D("Options")->getOption("reply_email_content" . $this->lang);
$email_title = D("Options")->getOption("reply_email_title" . $this->lang);
Mailer::SmtpMail(null, array($contact), $email_title, $email_content);
}
}
if ($subscribe) {
$title = L('subscribe_success');
} else {
$title = L('submit_success');
}
$this->assign('title', $title);
$this->display("subscribe_success");
}
}
示例3: submit_forget_password
public function submit_forget_password()
{
$email = $this->_param("email");
if (!Utility::CaptchaCheck($this->_post('verifycode'))) {
Session::Set("error", "验证码有误,请重新输入");
redirect("/register/forget_password");
}
if ($email) {
$user = D("CmsUsers")->where(array("email" => $email))->find();
if ($user) {
$subject = D("Options")->getOption("verify_email_subject");
$repasscode = md5(generate_password());
D("CmsUsers")->where(array('id' => $user['id']))->setField("repasscode", $repasscode);
$link = D("Options")->getOption("webroot_apply") . "/register/verify_repass?id=" . Crypt::en($user['id']) . "&repasscode={$repasscode}";
$link = "<a href='{$link}'>" . $link . "</a>";
$subject = D("Options")->getOption("repass_email_subject");
$content = D("Options")->getOption("repass_email_content");
$content = str_replace("[#link#]", $link, $content);
Mailer::SmtpMail(null, $email, $subject, $content);
redirect("/register/submit_forget_password_result?token=" . Crypt::en($email));
} else {
Session::Set("error", "无此邮箱");
redirect("/register/forget_password");
}
} else {
Session::Set("error", "无此邮箱");
redirect("/register/forget_password");
}
}
示例4: json
}
}
json($html, 'dialog');
} else {
json('captcha_again();', 'eval');
}
} else {
if ('subscribe' == $action) {
$html = render('ajax_dialog_smssub');
json($html, 'dialog');
} elseif ('subscribecheck' == $action) {
$mobile = trim(strval($_GET['mobile']));
$verifycode = trim(strval($_GET['verifycode']));
$city_id = abs(intval($_GET['city_id']));
$secret = Utility::VerifyCode();
if (Utility::CaptchaCheck($verifycode)) {
if (ZSMSSubscribe::Create($mobile, $city_id, $secret) === true) {
$html = render('ajax_dialog_smssuc');
} else {
$html = render('ajax_dialog_smscode');
sms_secret($mobile, $secret, true);
}
json($html, 'dialog');
} else {
json('captcha_again();', 'eval');
}
} else {
if ('codeyes' == $action) {
$mobile = trim(strval($_GET['mobile']));
$secretcode = trim(strval($_GET['secretcode']));
$sms = Table::Fetch('smssubscribe', $mobile, 'mobile');
示例5: verify_captcha
function verify_captcha($reason = 'none', $rurl = null)
{
if (option_yes($reason, false)) {
$v = strval($_REQUEST['vcaptcha']);
if (!$v || !Utility::CaptchaCheck($v)) {
Session::Set('error', '验证码不匹配,请重新输入');
redirect($rurl);
}
}
return true;
}