if user is blocked with an expiry date, do not add autoblock expiry date
authorErik Moeller <erik@users.mediawiki.org>
Tue, 6 Apr 2004 23:08:57 +0000 (23:08 +0000)
committerErik Moeller <erik@users.mediawiki.org>
Tue, 6 Apr 2004 23:08:57 +0000 (23:08 +0000)
on top of that but instead reuse it

includes/User.php

index 772672e..35d5526 100644 (file)
@@ -622,7 +622,13 @@ class User {
                $ipblock->mReason = wfMsg( "autoblocker", $this->getName(), $userblock->mReason );
                $ipblock->mTimestamp = wfTimestampNow();
                $ipblock->mAuto = 1;
-               $ipblock->mExpiry = Block::getAutoblockExpiry( $ipblock->mTimestamp );
+               # If the user is already blocked with an expiry date, we don't 
+               # want to pile on top of that!
+               if($userblock->mExpiry) {
+                       $ipblock->mExpiry = $userblock->mExpiry;
+               } else {
+                       $ipblock->mExpiry = Block::getAutoblockExpiry( $ipblock->mTimestamp );
+               }
 
                # Insert it
                $ipblock->insert();