summaryrefslogtreecommitdiff
path: root/extensions/ConfirmEdit/ConfirmEdit.php
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/ConfirmEdit/ConfirmEdit.php')
-rw-r--r--extensions/ConfirmEdit/ConfirmEdit.php35
1 files changed, 12 insertions, 23 deletions
diff --git a/extensions/ConfirmEdit/ConfirmEdit.php b/extensions/ConfirmEdit/ConfirmEdit.php
index 0255a3ab..79bbd59f 100644
--- a/extensions/ConfirmEdit/ConfirmEdit.php
+++ b/extensions/ConfirmEdit/ConfirmEdit.php
@@ -34,15 +34,13 @@ if ( !defined( 'MEDIAWIKI' ) ) {
exit;
}
-global $wgExtensionFunctions, $wgGroupPermissions;
-
$wgExtensionFunctions[] = 'confirmEditSetup';
$wgExtensionCredits['other'][] = array(
'path' => __FILE__,
'name' => 'ConfirmEdit',
'author' => array( 'Brion Vibber', '...' ),
- 'url' => 'http://www.mediawiki.org/wiki/Extension:ConfirmEdit',
- 'version' => '1.0',
+ 'url' => 'https://www.mediawiki.org/wiki/Extension:ConfirmEdit',
+ 'version' => '1.1',
'descriptionmsg' => 'captcha-desc',
);
@@ -71,7 +69,6 @@ $wgAvailableRights[] = 'skipcaptcha';
*/
$wgCaptchaWhitelistIP = false;
-global $wgCaptcha, $wgCaptchaClass, $wgCaptchaTriggers;
$wgCaptcha = null;
$wgCaptchaClass = 'SimpleCaptcha';
@@ -91,7 +88,7 @@ $wgCaptchaClass = 'SimpleCaptcha';
*/
$wgCaptchaTriggers = array();
$wgCaptchaTriggers['edit'] = false; // Would check on every edit
-$wgCaptchaTriggers['create'] = false; // Check on page creation.
+$wgCaptchaTriggers['create'] = false; // Check on page creation.
$wgCaptchaTriggers['sendemail'] = false; // Special:Emailuser
$wgCaptchaTriggers['addurl'] = true; // Check on edits that add URLs
$wgCaptchaTriggers['createaccount'] = true; // Special:Userlogin&type=signup
@@ -121,7 +118,6 @@ $wgCaptchaTriggersOnNamespace = array();
* 'CaptchaCacheStore' uses $wgMemc, which avoids the cookie dependency
* but may be fragile depending on cache configuration.
*/
-global $wgCaptchaStorageClass;
$wgCaptchaStorageClass = 'CaptchaSessionStore';
/**
@@ -130,7 +126,6 @@ $wgCaptchaStorageClass = 'CaptchaSessionStore';
*
* Default is a half hour.
*/
-global $wgCaptchaSessionExpiration;
$wgCaptchaSessionExpiration = 30 * 60;
/**
@@ -142,21 +137,18 @@ $wgCaptchaSessionExpiration = 30 * 60;
*
* Default is five minutes.
*/
-global $wgCaptchaBadLoginExpiration;
$wgCaptchaBadLoginExpiration = 5 * 60;
/**
* Allow users who have confirmed their e-mail addresses to post
* URL links without being harassed by the captcha.
*/
-global $ceAllowConfirmedEmail;
$ceAllowConfirmedEmail = false;
/**
* Number of bad login attempts before triggering the captcha. 0 means the
* captcha is presented on the first login.
*/
-global $wgCaptchaBadLoginAttempts;
$wgCaptchaBadLoginAttempts = 3;
/**
@@ -183,13 +175,9 @@ $wgSpecialPages['Captcha'] = 'CaptchaSpecialPage';
$wgConfirmEditIP = dirname( __FILE__ );
$wgExtensionMessagesFiles['ConfirmEdit'] = "$wgConfirmEditIP/ConfirmEdit.i18n.php";
-$wgExtensionAliasesFiles['ConfirmEdit'] = "$wgConfirmEditIP/ConfirmEdit.alias.php";
+$wgExtensionMessagesFiles['ConfirmEditAlias'] = "$wgConfirmEditIP/ConfirmEdit.alias.php";
-if ( defined( 'MW_SUPPORTS_EDITFILTERMERGED' ) ) {
- $wgHooks['EditFilterMerged'][] = 'ConfirmEditHooks::confirmEditMerged';
-} else {
- $wgHooks['EditFilter'][] = 'ConfirmEditHooks::confirmEdit';
-}
+$wgHooks['EditFilterMerged'][] = 'ConfirmEditHooks::confirmEditMerged';
$wgHooks['UserCreateForm'][] = 'ConfirmEditHooks::injectUserCreate';
$wgHooks['AbortNewAccount'][] = 'ConfirmEditHooks::confirmUserCreate';
$wgHooks['LoginAuthenticateAudit'][] = 'ConfirmEditHooks::triggerUserLogin';
@@ -199,15 +187,16 @@ $wgHooks['EmailUserForm'][] = 'ConfirmEditHooks::injectEmailUser';
$wgHooks['EmailUser'][] = 'ConfirmEditHooks::confirmEmailUser';
# Register API hook
$wgHooks['APIEditBeforeSave'][] = 'ConfirmEditHooks::confirmEditAPI';
+$wgHooks['APIGetAllowedParams'][] = 'ConfirmEditHooks::APIGetAllowedParams';
+$wgHooks['APIGetParamDescription'][] = 'ConfirmEditHooks::APIGetParamDescription';
$wgAutoloadClasses['ConfirmEditHooks'] = "$wgConfirmEditIP/ConfirmEditHooks.php";
-$wgAutoloadClasses['Captcha']= "$wgConfirmEditIP/Captcha.php";
-$wgAutoloadClasses['SimpleCaptcha']= "$wgConfirmEditIP/Captcha.php";
-$wgAutoloadClasses['CaptchaStore']= "$wgConfirmEditIP/CaptchaStore.php";
-$wgAutoloadClasses['CaptchaSessionStore']= "$wgConfirmEditIP/CaptchaStore.php";
-$wgAutoloadClasses['CaptchaCacheStore']= "$wgConfirmEditIP/CaptchaStore.php";
+$wgAutoloadClasses['SimpleCaptcha'] = "$wgConfirmEditIP/Captcha.php";
+$wgAutoloadClasses['CaptchaStore'] = "$wgConfirmEditIP/CaptchaStore.php";
+$wgAutoloadClasses['CaptchaSessionStore'] = "$wgConfirmEditIP/CaptchaStore.php";
+$wgAutoloadClasses['CaptchaCacheStore'] = "$wgConfirmEditIP/CaptchaStore.php";
$wgAutoloadClasses['CaptchaSpecialPage'] = "$wgConfirmEditIP/ConfirmEditHooks.php";
-$wgAutoloadClasses['HTMLCaptchaField']= "$wgConfirmEditIP/HTMLCaptchaField.php";
+$wgAutoloadClasses['HTMLCaptchaField'] = "$wgConfirmEditIP/HTMLCaptchaField.php";
/**
* Set up $wgWhitelistRead