X-Git-Url: https://git.toastfreeware.priv.at/toast/cookiecaptcha.git/blobdiff_plain/c112c24f54cce653e9089fdaff2bf7e691a8a248..729d787d685458b761d8661be8be96c952f3ecfd:/ConfirmEdit.php diff --git a/ConfirmEdit.php b/ConfirmEdit.php index 2faac7f..9de3da6 100644 --- a/ConfirmEdit.php +++ b/ConfirmEdit.php @@ -35,6 +35,7 @@ global $wgExtensionFunctions, $wgGroupPermissions; $wgExtensionFunctions[] = 'confirmEditSetup'; $wgExtensionCredits['other'][] = array( + 'path' => __FILE__, 'name' => 'ConfirmEdit', 'author' => 'Brion Vibber', 'url' => 'http://www.mediawiki.org/wiki/Extension:ConfirmEdit', @@ -55,6 +56,7 @@ $wgGroupPermissions['user' ]['skipcaptcha'] = false; $wgGroupPermissions['autoconfirmed']['skipcaptcha'] = false; $wgGroupPermissions['bot' ]['skipcaptcha'] = true; // registered bots $wgGroupPermissions['sysop' ]['skipcaptcha'] = true; +$wgAvailableRights[] = 'skipcaptcha'; /** * List of IP ranges to allow to skip the captcha, similar to the group setting: @@ -93,7 +95,7 @@ $wgCaptchaTriggers['badlogin'] = true; // Special:Userlogin after failure /** * You may wish to apply special rules for captcha triggering on some namespaces. - * $wgCaptchaTriggersOnNamespace[][] forces an always on / + * $wgCaptchaTriggersOnNamespace[][] forces an always on / * always off configuration with that trigger for the given namespace. * Leave unset to use the global options ($wgCaptchaTriggers). * @@ -101,9 +103,9 @@ $wgCaptchaTriggers['badlogin'] = true; // Special:Userlogin after failure */ $wgCaptchaTriggersOnNamespace = array(); -#Example: -#$wgCaptchaTriggersOnNamespace[NS_TALK]['create'] = false; //Allow creation of talk pages without captchas. -#$wgCaptchaTriggersOnNamespace[NS_PROJECT]['edit'] = true; //Show captcha whenever editing Project pages. +# Example: +# $wgCaptchaTriggersOnNamespace[NS_TALK]['create'] = false; //Allow creation of talk pages without captchas. +# $wgCaptchaTriggersOnNamespace[NS_PROJECT]['edit'] = true; //Show captcha whenever editing Project pages. /** * Indicate how to store per-session data required to match up the @@ -146,6 +148,13 @@ $wgCaptchaBadLoginExpiration = 5 * 60; 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; + /** * Regex to whitelist URLs to known-good sites... * For instance: @@ -170,6 +179,7 @@ $wgSpecialPages['Captcha'] = array( /*class*/'CaptchaSpecialPage', /*name*/'Capt $wgConfirmEditIP = dirname( __FILE__ ); $wgExtensionMessagesFiles['ConfirmEdit'] = "$wgConfirmEditIP/ConfirmEdit.i18n.php"; +$wgExtensionAliasesFiles['ConfirmEdit'] = "$wgConfirmEditIP/ConfirmEdit.alias.php"; if ( defined( 'MW_SUPPORTS_EDITFILTERMERGED' ) ) { $wgHooks['EditFilterMerged'][] = 'ConfirmEditHooks::confirmEditMerged'; @@ -184,8 +194,8 @@ $wgHooks['AbortLogin'][] = 'ConfirmEditHooks::confirmUserLogin'; # Register API hook $wgHooks['APIEditBeforeSave'][] = 'ConfirmEditHooks::confirmEditAPI'; -$wgAutoloadClasses['ConfirmEditHooks'] - = $wgAutoloadClasses['SimpleCaptcha'] +$wgAutoloadClasses['ConfirmEditHooks'] + = $wgAutoloadClasses['SimpleCaptcha'] = $wgAutoloadClasses['CaptchaSessionStore'] = $wgAutoloadClasses['CaptchaCacheStore'] = $wgAutoloadClasses['CaptchaSpecialPage'] @@ -196,7 +206,7 @@ $wgAutoloadClasses['ConfirmEditHooks'] */ function confirmEditSetup() { global $wgGroupPermissions, $wgCaptchaTriggers; - if( !$wgGroupPermissions['*']['read'] && $wgCaptchaTriggers['badlogin'] ) { + if ( !$wgGroupPermissions['*']['read'] && $wgCaptchaTriggers['badlogin'] ) { // We need to ensure that the captcha interface is accessible // so that unauthenticated users can actually get in after a // mistaken password typing. @@ -207,5 +217,3 @@ function confirmEditSetup() { $wgWhitelistRead[] = $help->getPrefixedText(); } } - -