From f2a8e239c8f0c4e5fbc27951045fb6adb728a1da Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Wed, 17 Jan 2007 10:43:04 +0000 Subject: [PATCH] Add autoconfirmation by edit count. Users must have existed for more than wgAutoConfirmAge seconds, and have wgAutoConfirmCount edits in order to be considered autoconfirmed. --- includes/DefaultSettings.php | 7 ++++++- includes/User.php | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 55b0b339a8..02568a4f38 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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( diff --git a/includes/User.php b/includes/User.php index 28460def99..ad4e61815c 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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'; } -- 2.20.1