summaryrefslogtreecommitdiff
path: root/extensions/FunnyQuestion/FunnyQuestion.php
blob: 578955a9c08339825d4cf3f938c7c95076f9805c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php

$wgExtensionCredits['other'][] = array(
	'name' => 'FunnyQuestion',
	'version' => '2.3',
	'description' => 'Challenge-response authentication',
	'author' => 'Pierre Schmitz',
	'url' => 'https://pierre-schmitz.com/'
);

global $wgFunnyQuestions;
$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;
$wgFunnyQuestionRemember = 3600*24;

$wgAutoloadClasses['FunnyQuestion'] = __DIR__ . '/FunnyQuestion.body.php';
$wgExtensionMessagesFiles['FunnyQuestion'] = __DIR__ . '/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';
}

?>