summaryrefslogtreecommitdiff
path: root/extensions/ConfirmEdit/Asirra.class.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2014-11-27 06:08:05 +0100
committerPierre Schmitz <pierre@archlinux.de>2014-11-27 06:08:05 +0100
commit888eab1a076a287bddd84fdf9dd9c57154c91e3f (patch)
tree7264d1dfeb20d833187007cac80a7f7ef6038845 /extensions/ConfirmEdit/Asirra.class.php
parent45b4484864b492a40570e99a9f5c87d2512cc6ad (diff)
Update to MediaWiki 1.22.14
Diffstat (limited to 'extensions/ConfirmEdit/Asirra.class.php')
-rw-r--r--extensions/ConfirmEdit/Asirra.class.php55
1 files changed, 0 insertions, 55 deletions
diff --git a/extensions/ConfirmEdit/Asirra.class.php b/extensions/ConfirmEdit/Asirra.class.php
deleted file mode 100644
index ae1178a1..00000000
--- a/extensions/ConfirmEdit/Asirra.class.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-/**
- * @author Bachsau
- * @author Niklas Laxström
- */
-
-class Asirra extends SimpleCaptcha {
- public $asirra_clientscript = '//challenge.asirra.com/js/AsirraClientSide.js';
-
- // As we don't have to store anything but some other things to do,
- // we're going to replace that constructor completely.
- function __construct() {
- global $wgExtensionAssetsPath;
- $this->asirra_localpath = "$wgExtensionAssetsPath/ConfirmEdit";
- }
-
- function getForm() {
- global $wgOut;
-
- $wgOut->addModules( 'ext.confirmEdit.asirra' );
- $js = Html::linkedScript( $this->asirra_clientscript );
-
- $message = Xml::encodeJsVar( wfMessage( 'asirra-createaccount-fail' )->plain() );
- $js .= Html::inlineScript( <<<JAVASCRIPT
-var asirra_js_failed = '$message';
-JAVASCRIPT
- );
- $js .= '<noscript>' . wfMessage( 'asirra-nojs' )->parse() . '</noscript>';
- return $js;
- }
-
- function getMessage( $action ) {
- $name = 'asirra-' . $action;
- $text = wfMessage( $name )->text();
- # Obtain a more tailored message, if possible, otherwise, fall
- # back to the default for edits
- return wfMessage( $name, $text )->isDisabled() ? wfMessage( 'asirra-edit' )->text() : $text;
- }
-
- function passCaptcha() {
- global $wgRequest;
-
- $ticket = $wgRequest->getVal( 'Asirra_Ticket' );
- $api = 'http://challenge.asirra.com/cgi/Asirra?';
- $params = array(
- 'action' => 'ValidateTicket',
- 'ticket' => $ticket,
- );
-
- $response = Http::get( $api . wfArrayToCgi( $params ) );
- $xml = simplexml_load_string( $response );
- $result = $xml->xpath( '/AsirraValidation/Result' );
- return strval( $result[0] ) === 'Pass';
- }
-}