Index: trunk/phase3/includes/RecentChange.php |
— | — | @@ -336,7 +336,7 @@ |
337 | 337 | // Actually set the 'patrolled' flag in RC |
338 | 338 | $this->reallyMarkPatrolled(); |
339 | 339 | // Log this patrol event |
340 | | - PatrolLog::record( $this, $auto ); |
| 340 | + PatrolLog::record( $this, $auto, $user ); |
341 | 341 | wfRunHooks( 'MarkPatrolledComplete', array($this->getAttribute('rc_id'), &$user, false) ); |
342 | 342 | return array(); |
343 | 343 | } |
Index: trunk/phase3/includes/logging/PatrolLog.php |
— | — | @@ -14,10 +14,11 @@ |
15 | 15 | * |
16 | 16 | * @param $rc Mixed: change identifier or RecentChange object |
17 | 17 | * @param $auto Boolean: was this patrol event automatic? |
| 18 | + * @param $performer User: user performing the action or null to use $wgUser |
18 | 19 | * |
19 | 20 | * @return bool |
20 | 21 | */ |
21 | | - public static function record( $rc, $auto = false ) { |
| 22 | + public static function record( $rc, $auto = false, User $user = null ) { |
22 | 23 | if ( !$rc instanceof RecentChange ) { |
23 | 24 | $rc = RecentChange::newFromId( $rc ); |
24 | 25 | if ( !is_object( $rc ) ) { |
— | — | @@ -27,12 +28,15 @@ |
28 | 29 | |
29 | 30 | $title = Title::makeTitleSafe( $rc->getAttribute( 'rc_namespace' ), $rc->getAttribute( 'rc_title' ) ); |
30 | 31 | if( $title ) { |
31 | | - global $wgUser; |
| 32 | + if ( !$user ) { |
| 33 | + global $wgUser; |
| 34 | + $user = $wgUser; |
| 35 | + } |
32 | 36 | |
33 | 37 | $entry = new ManualLogEntry( 'patrol', 'patrol' ); |
34 | 38 | $entry->setTarget( $title ); |
35 | 39 | $entry->setParameters( self::buildParams( $rc, $auto ) ); |
36 | | - $entry->setPerformer( $wgUser ); |
| 40 | + $entry->setPerformer( $user ); |
37 | 41 | $logid = $entry->insert(); |
38 | 42 | if ( !$auto ) { |
39 | 43 | $entry->publish( $logid, 'udp' ); |
Index: trunk/phase3/includes/WikiPage.php |
— | — | @@ -1368,7 +1368,7 @@ |
1369 | 1369 | |
1370 | 1370 | # Log auto-patrolled edits |
1371 | 1371 | if ( $patrolled ) { |
1372 | | - PatrolLog::record( $rc, true ); |
| 1372 | + PatrolLog::record( $rc, true, $user ); |
1373 | 1373 | } |
1374 | 1374 | } |
1375 | 1375 | $user->incEditCount(); |
— | — | @@ -1449,7 +1449,7 @@ |
1450 | 1450 | |
1451 | 1451 | # Log auto-patrolled edits |
1452 | 1452 | if ( $patrolled ) { |
1453 | | - PatrolLog::record( $rc, true ); |
| 1453 | + PatrolLog::record( $rc, true, $user ); |
1454 | 1454 | } |
1455 | 1455 | } |
1456 | 1456 | $user->incEditCount(); |