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


PHP captcha::validate_captcha方法代码示例

本文整理汇总了PHP中captcha::validate_captcha方法的典型用法代码示例。如果您正苦于以下问题:PHP captcha::validate_captcha方法的具体用法?PHP captcha::validate_captcha怎么用?PHP captcha::validate_captcha使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在captcha的用法示例。


在下文中一共展示了captcha::validate_captcha方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: captcha

 /**
  * @return bool
  */
 function verify_captcha()
 {
     global $db, $mybb;
     $user =& $this->data;
     if ($user['imagestring'] || $mybb->settings['captchaimage'] != 1) {
         // Check their current captcha input - if correct, hide the captcha input area
         require_once MYBB_ROOT . 'inc/class_captcha.php';
         $this->captcha = new captcha();
         if ($this->captcha->validate_captcha() == false) {
             // CAPTCHA validation failed
             foreach ($this->captcha->get_errors() as $error) {
                 $this->set_error($error);
             }
             return false;
         } else {
             $this->captcha_verified = true;
             return true;
         }
     } else {
         if ($mybb->input['quick_login'] == 1 && $mybb->input['quick_password'] && $mybb->input['quick_username']) {
             $this->set_error('regimagerequired');
             return false;
         } else {
             $this->set_error('regimageinvalid');
             return false;
         }
     }
 }
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:login.php

示例2: captcha

 if (!validate_email_format($mybb->input['fromemail'])) {
     $errors[] = $lang->error_invalidfromemail;
 }
 if (empty($mybb->input['fromname'])) {
     $errors[] = $lang->error_noname;
 }
 if (empty($mybb->input['subject'])) {
     $errors[] = $lang->error_no_email_subject;
 }
 if (empty($mybb->input['message'])) {
     $errors[] = $lang->error_no_email_message;
 }
 if ($mybb->settings['captchaimage'] && $mybb->user['uid'] == 0) {
     require_once MYBB_ROOT . 'inc/class_captcha.php';
     $captcha = new captcha();
     if ($captcha->validate_captcha() == false) {
         // CAPTCHA validation failed
         foreach ($captcha->get_errors() as $error) {
             $errors[] = $error;
         }
     }
 }
 if (count($errors) == 0) {
     if ($mybb->settings['mail_handler'] == 'smtp') {
         $from = $mybb->input['fromemail'];
     } else {
         $from = "{$mybb->input['fromname']} <{$mybb->input['fromemail']}>";
     }
     $message = $lang->sprintf($lang->email_emailuser, $to_user['username'], $mybb->input['fromname'], $mybb->settings['bbname'], $mybb->settings['bburl'], $mybb->get_input('message'));
     my_mail($to_user['email'], $mybb->get_input('subject'), $message, $from, "", "", false, "text", "", $mybb->input['fromemail']);
     if ($mybb->settings['mail_logging'] > 0) {
开发者ID:nicopinto,项目名称:fantasitura.com,代码行数:31,代码来源:member.php

示例3: eval

     eval("\$attachbox = \"" . $templates->get("post_attachments") . "\";");
 }
 // If the user is logged in, provide a save draft button.
 if ($mybb->user['uid']) {
     eval("\$savedraftbutton = \"" . $templates->get("post_savedraftbutton", 1, 0) . "\";");
 }
 // Show captcha image for guests if enabled
 $captcha = '';
 if ($mybb->settings['captchaimage'] && !$mybb->user['uid']) {
     $correct = false;
     require_once MYBB_ROOT . 'inc/class_captcha.php';
     $post_captcha = new captcha(false, "post_captcha");
     if ((!empty($mybb->input['previewpost']) || $hide_captcha == true) && $post_captcha->type == 1) {
         // If previewing a post - check their current captcha input - if correct, hide the captcha input area
         // ... but only if it's a default one, reCAPTCHA and Are You a Human must be filled in every time due to draconian limits
         if ($post_captcha->validate_captcha() == true) {
             $correct = true;
             // Generate a hidden list of items for our captcha
             $captcha = $post_captcha->build_hidden_captcha();
         }
     }
     if (!$correct) {
         if ($post_captcha->type == 1) {
             $post_captcha->build_captcha();
         } elseif ($post_captcha->type == 2 || $post_captcha->type == 4) {
             $post_captcha->build_recaptcha();
         } elseif ($post_captcha->type == 3) {
             $post_captcha->build_ayah();
         }
         if ($post_captcha->html) {
             $captcha = $post_captcha->html;
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:newreply.php

示例4: htmlentities

 // Checks to make sure the user can login; they haven't had too many tries at logging in.
 // Is a fatal call if user has had too many tries
 login_attempt_check();
 // Redirect to the page where the user came from, but not if that was the login page.
 $redirect_url = '';
 if ($_SERVER['HTTP_REFERER'] && strpos($_SERVER['HTTP_REFERER'], "action=login") === false) {
     $redirect_url = htmlentities($_SERVER['HTTP_REFERER']);
 }
 $captcha = '';
 // Show captcha image for guests if enabled and only if we have to do
 if ($mybb->settings['captchaimage'] && isset($do_captcha)) {
     $correct = false;
     require_once MYBB_ROOT . 'inc/class_captcha.php';
     $login_captcha = new captcha(false, "post_captcha");
     if ($do_captcha == false && $login_captcha->type == 1) {
         if ($login_captcha->validate_captcha() == true) {
             $correct = true;
             $captcha = $login_captcha->build_hidden_captcha();
         }
     }
     if (!$correct) {
         if ($login_captcha->type == 1) {
             $login_captcha->build_captcha();
         } elseif ($login_captcha->type == 2) {
             $login_captcha->build_recaptcha();
         }
         if ($login_captcha->html) {
             $captcha = $login_captcha->html;
         }
     } elseif ($correct && $login_captcha->type == 2) {
         $login_captcha->build_recaptcha();
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:31,代码来源:member.php


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