'InputCaptcha', ':html' => " ", ':args' => array('value'), 'size' => 5, 'autocomplete' => 'off', 'name' => $CaptchaName, )); array_unshift($EditFunctions, 'RequireCaptcha'); SDV($HandleActions['captchaimage'], 'HandleCaptchaImage'); SDV($HandleAuth['captchaimage'], 'read'); function RequireCaptcha($pagename, $page, $new) { global $EnablePostCaptchaRequired, $MessagesFmt, $CaptchaRequiredFmt, $EnablePost; if (!IsEnabled($EnablePostCaptchaRequired, 0)) return; if (IsCaptcha()) return; SDV($CaptchaRequiredFmt, "
"); $MessagesFmt[] = $CaptchaRequiredFmt; $EnablePost = 0; } function IsCaptcha() { global $IsCaptcha, $CaptchaName, $EnableCaptchaSession; if (isset($IsCaptcha)) return $IsCaptcha; $key = @$_POST['captchakey']; $resp = @$_POST[$CaptchaName]; $sid = session_id(); @session_start(); if ($key && $resp && @$_SESSION['captcha-challenges'][$key] == $resp) $IsCaptcha = 1; if (IsEnabled($EnableCaptchaSession, 0)) { $IsCaptcha |= @$_SESSION['iscaptcha']; @$_SESSION['iscaptcha'] = $IsCaptcha; } $IsCaptcha = (int)@$IsCaptcha; if (!$sid) session_write_close(); return $IsCaptcha; } function InputCaptcha($pagename, $type, $args) { CaptchaValue(); return Keep(InputToHTML($pagename, $type, $args, $opt)); } function CaptchaValue() { global $CaptchaKey, $CaptchaValue; if ($CaptchaKey > '' && @$_SESSION['captcha-challenges'][$CaptchaKey] == $CaptchaValue) return $CaptchaValue; $sid = session_id(); @session_start(); if ($CaptchaKey == '') $CaptchaKey = count(@$_SESSION['captcha-challenges']); $_SESSION['captcha-challenges'][$CaptchaKey] = $CaptchaValue; if (!$sid) session_write_close(); return $CaptchaValue; } function CaptchaFn($pagename) { global $CaptchaChallenge, $EnableCaptchaImage; if (@$CaptchaChallenge) return $CaptchaChallenge; if ($EnableCaptchaImage) return CaptchaImageTag($pagename); return CaptchaValue(); } function CaptchaImageTag($pagename) { global $CaptchaKey,$CaptchaImageFmt, $EnableEmbeddedCaptcha; CaptchaValue(); $key = @$CaptchaKey; if ($key == '') return ''; @session_start(); $value = @$_SESSION['captcha-challenges'][$key]; if (!$value) return ''; if($EnableEmbeddedCaptcha == 1){ $jpgimg = CaptchaImage($pagename,"$key","$value"); $base64img = base64_encode($jpgimg); $imgstr = "data:image/jpg;base64,".$base64img; SDV($CaptchaImageFmt, "