當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。