return strtolower( $answer ) == strtolower( $info['answer'] );
}
- function addCaptchaAPI(&$resultArr) {
+ function addCaptchaAPI( &$resultArr ) {
$captcha = $this->getCaptcha();
$index = $this->storeCaptcha( $captcha );
$resultArr['captcha']['type'] = 'question';
$resultArr['captcha']['id'] = $index;
$resultArr['captcha']['question'] = $captcha['question'];
}
-
+
function getCaptcha() {
global $wgCaptchaQuestions;
- return $wgCaptchaQuestions[mt_rand( 0, count( $wgCaptchaQuestions )-1 )]; //pick a question, any question
+ return $wgCaptchaQuestions[mt_rand( 0, count( $wgCaptchaQuestions ) - 1 )]; // pick a question, any question
}
-
+
function getForm() {
$captcha = $this->getCaptcha();
- if(!$captcha) {
+ if ( !$captcha ) {
die( "No questions found; set some in LocalSettings.php using the format from QuestyCaptcha.php." );
}
$index = $this->storeCaptcha( $captcha );
'id' => 'wpCaptchaId',
'value' => $index ) );
}
-
+
function getMessage( $action ) {
$name = 'questycaptcha-' . $action;
$text = wfMsg( $name );
# the default for edits
return wfEmptyMsg( $name, $text ) ? wfMsg( 'questycaptcha-edit' ) : $text;
}
-
+
function showHelp() {
global $wgOut, $ceAllowConfirmedEmail;
$wgOut->setPageTitle( wfMsg( 'captchahelp-title' ) );
$wgOut->addWikiText( wfMsg( 'captchahelp-cookies-needed' ) );
}
}
-
-}
\ No newline at end of file
+}