summaryrefslogtreecommitdiff
path: root/extensions/FunnyQuestion/FunnyQuestion.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-09-18 13:57:31 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-09-18 13:57:31 +0200
commit1af011759fbfe2003273e859440e0d3bc211e528 (patch)
tree6b3afea29f336e33bc236257f8a902e0c55d87e9 /extensions/FunnyQuestion/FunnyQuestion.php
parent91da036ca57d692fba4faad573aa4bca1435eda7 (diff)
Update FunnyQuestion extension
* use MediaWiki hooks to add custom form entries on user creation * make extension translatable
Diffstat (limited to 'extensions/FunnyQuestion/FunnyQuestion.php')
-rw-r--r--extensions/FunnyQuestion/FunnyQuestion.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/extensions/FunnyQuestion/FunnyQuestion.php b/extensions/FunnyQuestion/FunnyQuestion.php
new file mode 100644
index 00000000..5dcc367c
--- /dev/null
+++ b/extensions/FunnyQuestion/FunnyQuestion.php
@@ -0,0 +1,33 @@
+<?php
+
+$wgExtensionCredits['other'][] = array(
+ 'name' => 'FunnyQuestion',
+ 'version' => '2.0',
+ 'description' => 'Challenge-response authentication',
+ 'author' => 'Pierre Schmitz',
+ 'url' => 'https://www.archlinux.de'
+);
+
+$wgFunnyQuestions = array(
+ 'en' => array("What is the Ultimate Answer to the Ultimate Question of Life, The Universe, and Everything?" => "42"),
+ 'de' => array("Was ist die ultimaative Antwort nach dem Leben, dem Universum und dem ganzen Rest?" => "42")
+);
+$wgFunnyQuestionHash = '';
+$wgFunnyQuestionTimeout = 3600;
+$wgFunnyQuestionWait = 2;
+
+$wgAutoloadClasses['FunnyQuestion'] = dirname(__FILE__) . '/FunnyQuestion.body.php';
+$wgExtensionMessagesFiles['FunnyQuestion'] = dirname( __FILE__ ) . '/FunnyQuestion.i18n.php';
+
+if ($wgGroupPermissions['*']['edit']) {
+ $wgHooks['EditPage::showEditForm:fields'][] = 'FunnyQuestion::addFunnyQuestionToEditPage';
+ $wgHooks['EditFilter'][] = 'FunnyQuestion::checkFunnyQuestionOnEditPage';
+}
+
+if ($wgGroupPermissions['*']['createaccount'] && (empty($wgAuth) || $wgAuth->canCreateAccounts())) {
+ $wgHooks['UserCreateForm'][] = 'FunnyQuestion::addFunnyQuestionToUserCreateForm';
+ $wgHooks['AbortNewAccount'][] = 'FunnyQuestion::checkFunnyQuestionOnAbortNewAccount';
+}
+
+?>
+