当前位置: 首页>>代码示例>>PHP>>正文


PHP Utility::CaptchaCheck方法代码示例

本文整理汇总了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();
     }
 }
开发者ID:Germey,项目名称:yinxingpm,代码行数:36,代码来源:LoginAction.class.php

示例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");
     }
 }
开发者ID:caijinlin,项目名称:hackathon,代码行数:37,代码来源:CommonAction.class.php

示例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");
     }
 }
开发者ID:Germey,项目名称:yinxingapply,代码行数:29,代码来源:RegisterAction.class.php

示例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');
开发者ID:yunsite,项目名称:hhzuitu,代码行数:31,代码来源:sms.php

示例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;
}
开发者ID:norain2050,项目名称:zuituware,代码行数:11,代码来源:common.php


注:本文中的Utility::CaptchaCheck方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。