Index: trunk/phase3/includes/LogEventsList.php |
— | — | @@ -253,7 +253,7 @@ |
254 | 254 | // Add review links and such... |
255 | 255 | if( ($this->flags & self::NO_ACTION_LINK) || ($row->log_deleted & LogPage::DELETED_ACTION) ) { |
256 | 256 | // Action text is suppressed... |
257 | | - } else if( self::typeAction($row,'move','move') && !empty($paramArray[0]) && $wgUser->isAllowed( 'move' ) ) { |
| 257 | + } else if( self::typeAction($row,'move','move','move') && !empty($paramArray[0]) ) { |
258 | 258 | $destTitle = Title::newFromText( $paramArray[0] ); |
259 | 259 | if( $destTitle ) { |
260 | 260 | $revert = '(' . $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ), |
— | — | @@ -264,11 +264,11 @@ |
265 | 265 | '&wpMovetalk=0' ) . ')'; |
266 | 266 | } |
267 | 267 | // Show undelete link |
268 | | - } else if( self::typeAction($row,array('delete','suppress'),'delete') && $wgUser->isAllowed( 'delete' ) ) { |
| 268 | + } else if( self::typeAction($row,array('delete','suppress'),'delete','delete') ) { |
269 | 269 | $revert = '(' . $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Undelete' ), |
270 | 270 | $this->message['undeletelink'], 'target='. urlencode( $title->getPrefixedDBkey() ) ) . ')'; |
271 | 271 | // Show unblock/change block link |
272 | | - } else if( self::typeAction( $row, array( 'block', 'suppress' ), 'block' ) && $wgUser->isAllowed( 'block' ) ) { |
| 272 | + } else if( self::typeAction($row,array('block','suppress'),array('block','reblock'),'block') ) { |
273 | 273 | $revert = '(' . |
274 | 274 | $this->skin->link( SpecialPage::getTitleFor( 'Ipblocklist' ), |
275 | 275 | $this->message['unblocklink'], |
— | — | @@ -289,13 +289,13 @@ |
290 | 290 | 'action=unprotect' ) . ')'; |
291 | 291 | } |
292 | 292 | // Show unmerge link |
293 | | - } else if ( self::typeAction($row,'merge','merge') ) { |
| 293 | + } else if( self::typeAction($row,'merge','merge','mergehistory') ) { |
294 | 294 | $merge = SpecialPage::getTitleFor( 'Mergehistory' ); |
295 | 295 | $revert = '(' . $this->skin->makeKnownLinkObj( $merge, $this->message['revertmerge'], |
296 | 296 | wfArrayToCGI( array('target' => $paramArray[0], 'dest' => $title->getPrefixedDBkey(), |
297 | 297 | 'mergepoint' => $paramArray[1] ) ) ) . ')'; |
298 | 298 | // If an edit was hidden from a page give a review link to the history |
299 | | - } else if( self::typeAction($row,array('delete','suppress'),'revision') && $wgUser->isAllowed( 'deleterevision' ) ) { |
| 299 | + } else if( self::typeAction($row,array('delete','suppress'),'revision','deleterevision') ) { |
300 | 300 | if( count($paramArray) == 2 ) { |
301 | 301 | $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); |
302 | 302 | // Different revision types use different URL params... |
— | — | @@ -310,7 +310,7 @@ |
311 | 311 | 'target=' . $title->getPrefixedUrl() . $revParams ) . ')'; |
312 | 312 | } |
313 | 313 | // Hidden log items, give review link |
314 | | - } else if( self::typeAction($row,array('delete','suppress'),'event') && $wgUser->isAllowed( 'deleterevision' ) ) { |
| 314 | + } else if( self::typeAction($row,array('delete','suppress'),'event','deleterevision') ) { |
315 | 315 | if( count($paramArray) == 1 ) { |
316 | 316 | $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); |
317 | 317 | $Ids = explode( ',', $paramArray[0] ); |
— | — | @@ -376,12 +376,18 @@ |
377 | 377 | * @param $row Row |
378 | 378 | * @param $type Mixed: string/array |
379 | 379 | * @param $action Mixed: string/array |
| 380 | + * @param $right string |
380 | 381 | * @return bool |
381 | 382 | */ |
382 | | - public static function typeAction( $row, $type, $action ) { |
| 383 | + public static function typeAction( $row, $type, $action, $right='' ) { |
383 | 384 | $match = is_array($type) ? in_array($row->log_type,$type) : $row->log_type == $type; |
384 | 385 | if( $match ) { |
385 | | - $match = is_array($action) ? in_array($row->log_action,$action) : $row->log_action == $action; |
| 386 | + $match = is_array($action) ? |
| 387 | + in_array($row->log_action,$action) : $row->log_action == $action; |
| 388 | + if( $match && $right ) { |
| 389 | + global $wgUser; |
| 390 | + $match = $wgUser->isAllowed( $right ); |
| 391 | + } |
386 | 392 | } |
387 | 393 | return $match; |
388 | 394 | } |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2902,6 +2902,7 @@ |
2903 | 2903 | 'suppress/event' => 'logdelete-logentry', |
2904 | 2904 | 'suppress/delete' => 'suppressedarticle', |
2905 | 2905 | 'suppress/block' => 'blocklogentry', |
| 2906 | + 'suppress/reblock' => 'reblock-logentry', |
2906 | 2907 | ); |
2907 | 2908 | |
2908 | 2909 | /** |