* @param array $info
* @return bool
*/
- /*
function keyMatch( $answer, $info ) {
- global $wgCaptchaSecret;
-
- $digest = $wgCaptchaSecret . $info['salt'] . $answer . $wgCaptchaSecret . $info['salt'];
- $answerHash = substr( md5( $digest ), 0, 16 );
-
- if ( $answerHash == $info['hash'] ) {
- wfDebug( "FancyCaptcha: answer hash matches expected {$info['hash']}\n" );
+ if (isset($_COOKIE['cookiecaptcha'])) {
+ wfDebug( "CookieCaptcha: Found cookie\n" );
return true;
} else {
- wfDebug( "FancyCaptcha: answer hashes to $answerHash, expected {$info['hash']}\n" );
+ wfDebug( "CookieCaptcha: Didn't find cookie...\n" );
return false;
}
}
- */
+
+ function retrieveCaptcha() {
+ return true;
+ }
/*
function addCaptchaAPI( &$resultArr ) {
/**
* Insert the captcha prompt into the edit form.
*/
- /*
function getForm() {
- $info = $this->pickImage();
- if ( !$info ) {
- throw new MWException( "Ran out of captcha images" );
- }
-
- // Generate a random key for use of this captcha image in this session.
- // This is needed so multiple edits in separate tabs or windows can
- // go through without extra pain.
- $index = $this->storeCaptcha( $info );
-
- wfDebug( "Captcha id $index using hash ${info['hash']}, salt ${info['salt']}.\n" );
-
- $title = SpecialPage::getTitleFor( 'Captcha', 'image' );
-
+ global $wgLogo;
return "<p>" .
Html::element( 'img', array(
- 'src' => $title->getLocalUrl( 'wpCaptchaId=' . urlencode( $index ) ),
- 'width' => $info['width'],
- 'height' => $info['height'],
+ 'src' => $wgLogo,
'alt' => '' ) ) .
- "</p>\n" .
- Html::element( 'input', array(
- 'type' => 'hidden',
- 'name' => 'wpCaptchaId',
- 'id' => 'wpCaptchaId',
- 'value' => $index ) ) .
- '<p>' .
- Html::element( 'label', array(
- 'for' => 'wpCaptchaWord',
- ), parent::getMessage( 'label' ) . wfMessage( 'colon-separator' )->text() ) .
- Html::element( 'input', array(
- 'name' => 'wpCaptchaWord',
- 'id' => 'wpCaptchaWord',
- 'type' => 'text',
- 'autocorrect' => 'off',
- 'autocapitalize' => 'off',
- 'required' => 'required',
- 'tabindex' => 1 ) ) . // tab in before the edit textarea
"</p>\n";
}
- */
/**
* Show a message asking the user to enter a captcha on edit