MediaWiki r19376 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r19375‎ | r19376 (on ViewVC)‎ | r19377 >
Date:10:43, 17 January 2007
Author:werdna
Status:old
Tags:
Comment:
Add autoconfirmation by edit count. Users must have existed for more than wgAutoConfirmAge seconds, and have wgAutoConfirmCount edits in order to be considered autoconfirmed.
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/User.php
===================================================================
--- trunk/phase3/includes/User.php	(revision 19375)
+++ trunk/phase3/includes/User.php	(revision 19376)
@@ -1567,9 +1567,11 @@
 			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';
 				}
 				
Index: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php	(revision 19375)
+++ trunk/phase3/includes/DefaultSettings.php	(revision 19376)
@@ -1054,8 +1054,13 @@
 //$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 @@
  * 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( 
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox