Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -260,6 +260,14 @@ |
261 | 261 | if ( !$this->isValidStatus( $status ) ) { |
262 | 262 | throw new MWException( "Tried to save invalid code revision status" ); |
263 | 263 | } |
| 264 | + |
| 265 | + // Don't allow the user account tied to the committer account mark their own revisions as ok |
| 266 | + // Obviously only works if user accounts are tied! |
| 267 | + $wikiUser = $this->getWikiUser(); |
| 268 | + if ( $status == 'ok' && $wikiUser && $user->getName() == $wikiUser->getName() ) { |
| 269 | + return false; |
| 270 | + } |
| 271 | + |
264 | 272 | // Get the old status from the master |
265 | 273 | $dbw = wfGetDB( DB_MASTER ); |
266 | 274 | $this->oldStatus = $dbw->selectField( 'code_rev', |
Index: trunk/extensions/CodeReview/backend/CodeRepository.php |
— | — | @@ -469,8 +469,9 @@ |
470 | 470 | * @return User|bool |
471 | 471 | */ |
472 | 472 | public function authorWikiUser( $author ) { |
473 | | - if ( isset( self::$userLinks[$author] ) ) |
| 473 | + if ( isset( self::$userLinks[$author] ) ) { |
474 | 474 | return self::$userLinks[$author]; |
| 475 | + } |
475 | 476 | |
476 | 477 | $dbr = wfGetDB( DB_SLAVE ); |
477 | 478 | $wikiUser = $dbr->selectField( |