Add autoconfirmation by edit count. Users must have existed for more than wgAutoConfi...
authorAndrew Garrett <werdna@users.mediawiki.org>
Wed, 17 Jan 2007 10:43:04 +0000 (10:43 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Wed, 17 Jan 2007 10:43:04 +0000 (10:43 +0000)
includes/DefaultSettings.php
includes/User.php

index 55b0b33..02568a4 100644 (file)
@@ -1054,6 +1054,11 @@ $wgAutoConfirmAge = 0;
 //$wgAutoConfirmAge = 600;     // ten minutes
 //$wgAutoConfirmAge = 3600*24; // one day
 
+# Number of edits an account requires before it is autoconfirmed
+# Passing both this AND the time requirement is needed
+$wgAutoConfirmCount = 0;
+//$wgAutoConfirmCount = 50;
+
 
 
 # Proxy scanner settings
@@ -1679,7 +1684,7 @@ $wgDefaultSkin = 'monobook';
  * Settings added to this array will override the default globals for the user
  * preferences used by anonymous visitors and newly created accounts.
  * For instance, to disable section editing links:
- *  $wgDefaultUserOptions ['editsection'] = 0;
+ * $wgDefaultUserOptions ['editsection'] = 0;
  *
  */
 $wgDefaultUserOptions = array( 
index 28460de..ad4e618 100644 (file)
@@ -1567,9 +1567,11 @@ class User {
                        if( $this->mId ) {
                                $this->mEffectiveGroups[] = 'user';
                                
-                               global $wgAutoConfirmAge;
+                               global $wgAutoConfirmAge, $wgAutoConfirmCount;
+
                                $accountAge = time() - wfTimestampOrNull( TS_UNIX, $this->mRegistration );
-                               if( $accountAge >= $wgAutoConfirmAge ) {
+                               $accountEditCount = User::edits( $this->mId );
+                               if( $accountAge >= $wgAutoConfirmAge && $accountEditCount >= $wgAutoConfirmCount ) {
                                        $this->mEffectiveGroups[] = 'autoconfirmed';
                                }