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


PHP securimage::check方法代码示例

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


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

示例1: IsCorrect

 public function IsCorrect($captchaValue)
 {
     require_once ROOT_DIR . 'lib/external/securimage/securimage.php';
     $img = new securimage();
     $isValid = $img->check($captchaValue);
     Log::Debug('Checking captcha value. Value entered: %s. IsValid: %s', $captchaValue, $isValid);
     return $isValid;
 }
开发者ID:JoseTfg,项目名称:Booked,代码行数:8,代码来源:CaptchaService.php

示例2: array

$secure = false;
// проверяем, включена ли регистрация
if (CONF_USER_REGISTER) {
    // если пользователь уже вошел на сайт, не пускаем его в форму авторизации
    if ($user->getAuthorized()) {
        messages::error404();
    } else {
        $return_data = array('email' => false);
        // сохраняем в сесиию рефер-ссылку
        !isset($_SESSION['referer']) && secure::checkServerCalls() && isset($_GET['do']) && !strpos($_SERVER['HTTP_REFERER'], $_GET['do']) ? $_SESSION['referer'] = $_SERVER['HTTP_REFERER'] : null;
        if (!empty($_POST['email']) && !empty($_POST['password'])) {
            if (validate::postDataNotEmpty()) {
                // проверяем капчу
                if (isset($_POST['keystring'])) {
                    $securimage = new securimage();
                    !$securimage->check($_POST['keystring']) ? $arrErrors[] = ERROR_CAPTCHA : null;
                }
                $_POST['remember'] = isset($_POST['remember']) ? true : false;
                if ($user->issetUser("email IN (" . secure::escQuoteData($_POST['email']) . ") AND password IN ('" . md5($_POST['password']) . "') AND token IN ('active', 'new')")) {
                    if ($user->authorizeUser($_POST['email'], $_POST['password'], $_POST['remember'])) {
                        unset($_SESSION['user_fail_auth']);
                        if (isset($_SESSION['referer']) && !strstr($_SESSION['referer'], 'do=payments')) {
                            $referer = $_SESSION['referer'];
                            unset($_SESSION['referer']);
                            die('<script type="text/javascript">window.location="' . $referer . '";</script>');
                        } else {
                            die('<script type="text/javascript">window.location="' . chpu::createChpuUrl(CONF_SCRIPT_URL . 'index.php?do=user.data') . '";</script>');
                        }
                    } else {
                        $arrErrors[] = ERROR_AUTHORIZE_ACCOUNT_NOT_ACTIVATE;
                    }
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:authorize.php

示例3: articles

 $articles = new articles();
 $aComments = new articlesComments();
 $_POST['addCommentA'] = strings::htmlEncode($_POST['addCommentA']);
 // проверяем наличие новости
 if (!$articles->getPublishedArticle("id=" . secure::escQuoteData($_POST['articleId']))) {
     echo ajax::sdgJSONencode(array('error' => ERROR_COMMENT_ARTICLE_NOT_FOUND));
 } else {
     $securimage = new securimage();
     // если добавление комментариев доступно только для зарегистрированных пользователей
     // и пользователь не авторизован, выдаем ошибку
     if (CONF_ARTICLES_COMMENTS_REGISTER && empty($_SESSION['sd_user']['data']['id'])) {
         echo ajax::sdgJSONencode(array('error' => MESSAGE_COMMENTS_REGISTER));
     } else {
         // проверяем капчу, если она включена
         if (SECURE_CAPTCHA) {
             if (empty($_POST['keystring']) || !$securimage->check($_POST['keystring'])) {
                 die(ajax::sdgJSONencode(array('error' => ERROR_CAPTCHA)));
             }
         }
         // массив сервисных полей
         $sFields = array('id_article' => $_POST['articleId'], 'id_user' => !empty($_SESSION['sd_user']['data']['id']) ? $_SESSION['sd_user']['data']['id'] : 0);
         !empty($_POST['userName']) ? $_POST['userName'] = htmlspecialchars(htmlentities(trim($_POST['userName']), ENT_QUOTES, CONF_DEFAULT_CHARSET), ENT_QUOTES, CONF_DEFAULT_CHARSET) : null;
         $user = new user();
         // пользователь
         // если пользователь авторизован и если не заполнен псевдоним польз.,
         // выдаем ошибку
         if (!empty($_SESSION['sd_user']['data']['id']) && empty($_SESSION['sd_user']['data']['alias'])) {
             echo ajax::sdgJSONencode(array('error' => ERROR_USER_ALIAS_IS_EMPTY));
         } elseif (!$aComments->setServiceFields($sFields)) {
             echo ajax::sdgJSONencode(array('error' => ERROR_COMMENT_UNABLE_FILL_SERVICE_FIELDS));
         } elseif (!empty($_POST['userName']) && $user->issetUser("token IN ('active') AND alias=" . strtolower(secure::escQuoteData($_POST['userName'])))) {
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:ajax.php

示例4: securimage

 *  02111-1307, USA.                                                  
 *  
 *  Copia da licenca no diretorio licenca/licenca_en.txt 
 *                                licenca/licenca_pt.txt 
 */
session_start();
include 'securimage.php';
$img = new securimage();
$get = $img->getCode();
$chek = $img->checkCode();
if (!isset($_GET["code"])) {
    exit;
}
if (!session_is_registered("DB_processacaptcha")) {
    $processa = true;
} else {
    if ($_SESSION["DB_processacaptcha"] == true) {
        $processa = true;
    } else {
        $processa = false;
        $_SESSION["DB_processacaptcha"] = true;
    }
}
//checa se o código digitado é igual ao do captcha
if ($processa == true) {
    if ($img->check($code)) {
        echo "true";
    } else {
        echo "false";
    }
}
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:31,代码来源:pesquisa_captcha.php

示例5: ucheck

 function ucheck()
 {
     $username = $this->input->post('username');
     $email = $this->input->post('email');
     $code = $this->input->post('security_code');
     $fullname = $this->input->post('fullname');
     $exitUser = -1;
     $exitEmail = -1;
     $checkCode = -1;
     $error = 0;
     $msgSuccess = '';
     if ($username) {
         $exitUser = $this->user_group_model->userExists($username) ? 1 : 0;
     }
     if ($email) {
         $exitEmail = $this->user_group_model->emailExists($email) ? 1 : 0;
     }
     //check seccurity imgage
     include_once dirname(BASEPATH) . DIRECTORY_SEPARATOR . 'securimage' . DIRECTORY_SEPARATOR . 'securimage.php';
     $img = new securimage();
     if ($code) {
         $checkCode = $img->check($code) ? 0 : 1;
     }
     if ($exitUser || $exitEmail || $checkCode) {
         $error = 1;
     }
     $aryJson = array('username' => $exitUser, 'email' => $exitEmail, 'code' => $checkCode);
     if (!$error) {
         //process create user
         $data = $this->_get_user_form_values();
         $status = $this->user_group_model->addUser($data);
         if ($status == 1) {
             //login cho user
             $sessdata = array();
             $sessdata = $this->user_group_model->getUserInfo($username);
             $sessdata['loggedin'] = TRUE;
             // Set the session
             $this->session->set_userdata($sessdata);
             $_SESSION['userdata'] = $sessdata;
             $msgSuccess = 'Quá trình đăng ký thành công, chào mừng bạn "' . $username . '"';
         }
     }
     exit(json_encode(array('error' => $error, 'aryError' => $aryJson, 'msg' => $msgSuccess, 'url' => site_url())));
 }
开发者ID:Chitu10993610,项目名称:azx111,代码行数:44,代码来源:user.php

示例6: securimage

 }
 if (empty($_POST['subject'])) {
     $error = 1;
     $errstr[] = "Please enter a subject";
 }
 if (empty($_POST['message']) || preg_match("/^enter your message here\$/i", $_POST['message'])) {
     $error = 1;
     $errstr[] = "Please enter a message";
 }
 if (empty($_POST['imagetext'])) {
     $error = 1;
     $errstr[] = "Please validate the image code";
 } else {
     include "securimage.php";
     $img = new securimage();
     $valid = $img->check($_POST['imagetext']);
     if (!$valid) {
         $error = 1;
         $errstr[] = "The code you entered was incorrect";
     }
 }
 if ($error == 1) {
     echo "<center>\n<font style=\"color: #FF0000\">\n";
     foreach ($errstr as $err) {
         echo "<li> " . $err . "</li>\n";
     }
     echo "</font>\n</center>\n<br />\n\n";
     showForm();
 } else {
     @mail($to, "Site Contact - " . $_POST['subject'], "Drew,\nOn " . date("r") . ", " . $_POST['name'] . " " . $_POST['email'] . " sent the following message.\nReason " . $_POST['reason'] . "\n\n" . stripslashes($_POST['message']), "From: " . $_POST['email']);
     echo "<center>\nThanks for contacting me.  I'll try to get back to you as soon as I can.  Thanks for \n          visiting my website.  If I don't get back to you within one week, please fill out the form again.<br /><br />" . "Click <a href=\"#\" onclick=\"self.close()\">here</a> to close this window.";
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:31,代码来源:advanced_form.php

示例7: filter

 /**
  * 评论过滤器
  * 
  * @access public
  * @param array $comment 评论结构
  * @param Typecho_Widget $post 被评论的文章
  * @param array $result 返回的结果上下文
  * @param string $api api地址
  * @return void
  */
 public static function filter($comment, $post, $result)
 {
     $captchaCode = Typecho_Request::getInstance()->captcha_code;
     if (empty($captchaCode)) {
         throw new Typecho_Widget_Exception(_t('请输入验证码'));
     }
     require_once 'Captcha/securimage/securimage.php';
     $img = new securimage();
     if (!$img->check($captchaCode)) {
         throw new Typecho_Widget_Exception(_t('验证码错误, 请重新输入'));
     }
     return $comment;
 }
开发者ID:sdgdsffdsfff,项目名称:Typecho-Captcha,代码行数:23,代码来源:Plugin.php

示例8: check

 static function check($code_entered)
 {
     require_once LAFC_HELPER_PATH . '/captcha/securimage.php';
     $s_img = new securimage();
     $s_img->namespace = LAFC_COMPONENT;
     $ret = $s_img->check($code_entered);
     return $ret;
 }
开发者ID:vstorm83,项目名称:propertease,代码行数:8,代码来源:secure_captcha.php

示例9: isset

             }
         }
     }
     // обработка чеккера "Старт карьеры"
     if (!empty($_POST['career_launch'])) {
         $_POST['arrFieldsXmlData']['expires'] = false;
         $smarty->assignByRef('career_launch', $_POST['career_launch']);
     }
     // обработка чеккера "Не владею иностранными языками"
     isset($_POST['noforeign_lang']) ? $noforeign_lang =& $_POST['noforeign_lang'] : ($noforeign_lang = '');
     $smarty->assignByRef('noforeign_lang', $noforeign_lang);
 }
 // проверка капчи
 if (!isset($_POST['save']) && SECURE_CAPTCHA) {
     $securimage = new securimage();
     !$securimage->check($_POST['keystring']) ? $arrWarnings[] = $errFields['captcha'] = ERROR_CAPTCHA : null;
 }
 // обработка и проверка чеккера пользовательского соглашения
 !isset($_POST['agreement']) ? $_POST['agreement'] = false : null;
 $smarty->assignByRef('agreement', $_POST['agreement']);
 if (CONF_ANNOUNCE_USER_AGREEMENT_NOMEMBERS_REQUIRED && empty($_POST['agreement']) && !$user->getAuthorized()) {
     $arrWarnings[] = $errFields['agreement'] = ERROR_AGREEMENT;
 }
 // END Блок валидации данных переданных из формы
 // очищаем предупреждение о платности услуги
 if (isset($arrWarnings['payment'])) {
     unset($arrWarnings['payment']);
 }
 // проверяем есть ли ошибки
 if (!empty($arrWarnings)) {
     // инициируем необходимые данные для отображения формы анкеты (исправление ошибок)
开发者ID:innova-market,项目名称:JobExpert,代码行数:31,代码来源:resume.php

示例10:

    ?>
		<form method="POST">
		Username:<br />
		<input type="text" name="username" /><br />
		Password:<br />
		<input type="text" name="password" /><br />
		
		<img src="securimage_show.php"><br />
		<input type="text" name="code" /><br />
		
		<input type="submit" value="Submit Form" />
		</form>
		
		<?php 
} else {
    //form is posted
    $valid = $img->check($_POST['code']);
    if ($valid == TRUE) {
        echo "<center>Thanks, you entered the correct code.</center>";
    } else {
        echo "<center>Sorry, the code you entered was invalid.  <a href=\"javascript:history.go(-1)\">Go back</a> to try again.</center>";
    }
}
echo '<pre>';
print_r($_SESSION);
?>

</body>
</html>

开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:29,代码来源:form.php


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