Index: trunk/extensions/CheckUser/CheckUser_body.php |
— | — | @@ -262,21 +262,25 @@ |
263 | 263 | 0, // suppress name? |
264 | 264 | 0 // block from sending email? |
265 | 265 | ); |
| 266 | + $oldblock = Block::newFromDB( $u->getName() ); |
| 267 | + /* |
266 | 268 | // Kill old blocks, but leave range blocks |
267 | | - $oldblock = Block::newFromDB( $u->getName() ); |
268 | 269 | if( $oldblock && $oldblock->mAddress == $u->getName() && $block->mRangeStart == $block->mRangeEnd ) { |
269 | 270 | $oldblock->delete(); |
270 | 271 | } |
271 | | - $block->insert(); |
272 | | - # Prepare log parameters |
273 | | - $logParams = array(); |
274 | | - $logParams[] = $expirestr; |
275 | | - if( $anonOnly ) { |
276 | | - $logParams[] = 'anononly'; |
| 272 | + */ |
| 273 | + if( !$oldblock ) { |
| 274 | + $block->insert(); |
| 275 | + # Prepare log parameters |
| 276 | + $logParams = array(); |
| 277 | + $logParams[] = $expirestr; |
| 278 | + if( $anonOnly ) { |
| 279 | + $logParams[] = 'anononly'; |
| 280 | + } |
| 281 | + $logParams[] = 'nocreate'; |
| 282 | + # Add log entry |
| 283 | + $log->addEntry( 'block', $usertitle, $reason, $logParams ); |
277 | 284 | } |
278 | | - $logParams[] = 'nocreate'; |
279 | | - # Add log entry |
280 | | - $log->addEntry( 'block', $usertitle, $reason, $logParams ); |
281 | 285 | # Tag userpage! (check length to avoid mistakes) |
282 | 286 | if( strlen($tag) > 2 ) { |
283 | 287 | $userpage->doEdit( $tag, $reason, EDIT_MINOR ); |