* (bug 14154) Captcha domain whitelist regexes now anchored, fixing spammable hole
[toast/cookiecaptcha.git] / ConfirmEdit.php
index 722a3c7ed5ddb6f7e1fbcd79f72533c90afce9ee..d632fb869988234a10ff817c7b74556630e0d245 100644 (file)
@@ -55,6 +55,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:
@@ -166,7 +167,6 @@ $wgCaptchaWhitelist = false;
 $wgCaptchaRegexes = array();
 
 /** Register special page */
-global $wgSpecialPages;
 $wgSpecialPages['Captcha'] = array( /*class*/'CaptchaSpecialPage', /*name*/'Captcha' );
 
 $wgConfirmEditIP = dirname( __FILE__ );
@@ -182,6 +182,8 @@ $wgHooks['AbortNewAccount'][] = 'ConfirmEditHooks::confirmUserCreate';
 $wgHooks['LoginAuthenticateAudit'][] = 'ConfirmEditHooks::triggerUserLogin';
 $wgHooks['UserLoginForm'][] = 'ConfirmEditHooks::injectUserLogin';
 $wgHooks['AbortLogin'][] = 'ConfirmEditHooks::confirmUserLogin';
+# Register API hook
+$wgHooks['APIEditBeforeSave'][] = 'ConfirmEditHooks::confirmEditAPI';
 
 $wgAutoloadClasses['ConfirmEditHooks'] 
        = $wgAutoloadClasses['SimpleCaptcha']