$wgExtensionFunctions[] = 'confirmEditSetup';
$wgExtensionCredits['other'][] = array(
+ 'path' => __FILE__,
'name' => 'ConfirmEdit',
'author' => 'Brion Vibber',
'url' => 'http://www.mediawiki.org/wiki/Extension:ConfirmEdit',
$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:
/**
* You may wish to apply special rules for captcha triggering on some namespaces.
- * $wgCaptchaTriggersOnNamespace[<namespace id>][<trigger>] forces an always on /
+ * $wgCaptchaTriggersOnNamespace[<namespace id>][<trigger>] forces an always on /
* always off configuration with that trigger for the given namespace.
* Leave unset to use the global options ($wgCaptchaTriggers).
*
*/
$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
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:
$wgCaptchaRegexes = array();
/** Register special page */
-global $wgSpecialPages;
$wgSpecialPages['Captcha'] = array( /*class*/'CaptchaSpecialPage', /*name*/'Captcha' );
$wgConfirmEditIP = dirname( __FILE__ );
$wgExtensionMessagesFiles['ConfirmEdit'] = "$wgConfirmEditIP/ConfirmEdit.i18n.php";
+$wgExtensionAliasesFiles['ConfirmEdit'] = "$wgConfirmEditIP/ConfirmEdit.alias.php";
if ( defined( 'MW_SUPPORTS_EDITFILTERMERGED' ) ) {
$wgHooks['EditFilterMerged'][] = 'ConfirmEditHooks::confirmEditMerged';
$wgHooks['LoginAuthenticateAudit'][] = 'ConfirmEditHooks::triggerUserLogin';
$wgHooks['UserLoginForm'][] = 'ConfirmEditHooks::injectUserLogin';
$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']
*/
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.
$wgWhitelistRead[] = $help->getPrefixedText();
}
}
-
-