public function execute(&$value, &$error)
 {
     if (chk_crypt($value)) {
         return true;
     } else {
         $error = $this->getParameter('code_error');
         return false;
     }
 }
Пример #2
0
function WECaptchaCheck($code, $IdElem, $OEVersion)
{
    if (strlen($OEVersion) > 10) {
        die('Invalid version string');
    }
    if (!$IdElem) {
        $IdElem = 0;
    }
    if (!isset($_SESSION['WECaptchaPage']) || !isset($_SESSION['WECaptchaConfigfile'])) {
        return true;
    }
    // default to positive if captcha info not written in session
    $cryptinstall = "WECaptcha/WECaptcha.fct-v" . $OEVersion . ".php";
    include_once $cryptinstall;
    $reslt = chk_crypt(strip_tags($code), $IdElem);
    if ($reslt) {
        return true;
    } else {
        return false;
    }
}
Пример #3
0
    if (mb_strlen($subject) > 100) {
        $error[] = '件名は100文字以内でお願い致します';
    }
}
if ($body == '') {
    $error[] = '内容は必須項目です';
} else {
    if (mb_strlen($body) > 500) {
        $error[] = '内容は500文字以内でお願い致します';
    }
}
// 画像認証をチェック
if (mb_strlen($code) != 4) {
    $error[] = '確認キーワードは4文字以内で入力してください';
} else {
    if (!chk_crypt($code)) {
        $error[] = '確認キーワードが誤っています';
    }
}
if (count($error) > 0) {
    // エラーがある場合は入力フォームを表示
    $data = array();
    $data['error'] = $error;
    $data['name'] = $name;
    $data['email'] = $email;
    $data['subject'] = $subject;
    $data['body'] = $body;
    $data['ticket'] = $ticket;
    display('form_view.php', $data);
} else {
    // エラーが0の場合
Пример #4
0
<?php

//appel la session
session_start();
//variable de session a false
$loginOK = false;
$projectRoot = $_SERVER['DOCUMENT_ROOT'] . '/Cubbyhole';
require $projectRoot . '/controller/functions.php';
require $projectRoot . '/required.php';
$cryptinstall = $projectRoot . '/controller/crypt/cryptographp.fct.php';
include $cryptinstall;
//On check si loginForm est bien defini
//S'il est defini alors on entre dans la condition
if (isset($_POST['loginForm'])) {
    if (chk_crypt($_POST['code'])) {
        $email = $_POST['email'];
        $password = $_POST['password'];
        //Avant de se logger on verifie bien que les champs mail et password ne sont pas vide
        if (!empty($email) && !empty($password)) {
            $userPdoManager = new UserPdoManager();
            $user = $userPdoManager->authenticate($email, $password);
            //http://www.php.net/manual/en/function.array-key-exists.php
            if (!array_key_exists('error', $user)) {
                $loginOK = TRUE;
                $_SESSION['user'] = serialize($user);
                //redirection vers index
                header('Location:../index.php');
            } else {
                $_SESSION['errorMessageLogin'] = $user['error'];
                header('Location:../view/login.php');
                die;
 /**
  * Check
  */
 public static function check($answer)
 {
     return chk_crypt($answer);
 }
Пример #6
0
					<div class="bg-tr"></div>
					<div class='clear'></div>
					<div class="bg-cl">
						<div class="content">
    <h2>Востановление пароля</h2>
<?php 
$err = null;
if ($_POST['submit'] == 'Отправить') {
    if (!$_POST['login'] || !$_POST['email']) {
        $err = "Не все поля заполнены.";
    } elseif (ereg("[^0-9a-zA-Z_-]", $_POST['login'], $Txt)) {
        $err = "Логин введен не корректно.";
    } elseif (!validatemail($_POST['email'])) {
        $err = "E-mail введен не корректно.";
    } else {
        if (!chk_crypt($_POST['captcha'])) {
            $err = "Каптча введена не верно!";
        } else {
            $login = $_POST['login'];
            $email = $_POST['email'];
            include "connect.php";
            $result = mysql_query("SELECT * FROM {$db_table} WHERE {$db_columnUser}='{$login}'") or die("Запрос к базе завершился ощибкой.");
            $myrow = mysql_fetch_array($result);
            if (empty($myrow[$db_columnId]) or $myrow[$db_columnId] == '') {
                $err = "Акаунт <b>" . $login . "</b> не существует или введен неправильный e-mail.";
            } else {
                if (empty($myrow[$db_columnEmail]) or $myrow[$db_columnEmail] == '') {
                    $err = "У акаунта <b>" . $login . "</b> не установлен e-mail для востановления пароля.";
                } else {
                    if ($myrow[$db_columnEmail] == $email) {
                        $datenow = date('YmdHis');
Пример #7
0
<?php

require_once "../includes/config.inc.php";
require_once "../includes/functions.php";
// Create database class instance and connect to db
require_once "../classes/class.Database.php";
$db = new DB($db_name, $db_host, $db_user, $db_password);
// Pull captcha functions
$cryptinstall = "../crypt/cryptographp.fct.php";
require_once $cryptinstall;
$email_listing_id = mysql_real_escape_string($_REQUEST['email_listing_id']);
$from = $_REQUEST['y_email'];
$email = $_REQUEST['d_email'];
if (isset_or($_REQUEST['share_listing']) && $email_listing_id != "" && $from != "" && $email != "" && isset_or($_REQUEST['captcha']) != "") {
    $listing_title = $db->queryUniqueValue("SELECT headline FROM listings WHERE id='{$email_listing_id}'");
    if (chk_crypt($_REQUEST['captcha'])) {
        $subject = 'BusinessFieds: ' . $listing_title;
        $body = '
		<html>
		<head>
		  <title>BusinessFieds Shared Listing</title>
		</head>
		<body>
		  <p>' . $_REQUEST['y_email'] . ' has forwarded you this <a href="http://www.businessfieds.com" target="_blank">BusinessFieds.com</a> listing.</p>
		  <p>Please see below for more information</p>
		  <p>Visit the posting at <a href="http://www.businessfieds.com/listing/' . $_REQUEST['email_listing_id'] . '" target="_blank">http://www.businessfieds.com/listing/' . $_REQUEST['email_listing_id'] . '</a>
		  to contact the seller</p>
		  <p>Thank you,<br>BusinessFieds</p>
		</body>
		</html>
		';