Example #1
0
 public function CheckCodeCrypt($userCode, $codeCrypt, $password = "", $bUpperCode = True)
 {
     if (!defined("CAPTCHA_COMPATIBILITY")) {
         return CCaptcha::CheckCaptchaCode($userCode, $codeCrypt, $bUpperCode);
     }
     if (strlen($codeCrypt) <= 0) {
         return False;
     }
     if (!array_key_exists("CAPTCHA_PASSWORD", $_SESSION) || strlen($_SESSION["CAPTCHA_PASSWORD"]) <= 0) {
         return False;
     }
     if ($bUpperCode) {
         $userCode = strtoupper($userCode);
     }
     $code = $this->CryptData($codeCrypt, "D", $_SESSION["CAPTCHA_PASSWORD"]);
     if ($code != $userCode) {
         return False;
     }
     return True;
 }