$join_conds = array();
$tables = array( 'revision', 'page', 'user' );
if ( $this->contribs == 'newbie' ) {
- $tables[] = 'user_groups';
$max = $this->mDb->selectField( 'user', 'max(user_id)', false, __METHOD__ );
$condition[] = 'rev_user >' . (int)( $max - $max / 100 );
- $condition[] = 'ug_group IS NULL';
$index = 'user_timestamp';
- # @todo FIXME: Other groups may have 'bot' rights
- $join_conds['user_groups'] = array( 'LEFT JOIN', "ug_user = rev_user AND ug_group = 'bot'" );
+ # ignore local groups with the bot right
+ # @todo FIXME: Global groups may have 'bot' rights
+ $groupsWithBotPermission = User::getGroupsWithPermission( 'bot' );
+ if( count( $groupsWithBotPermission ) ) {
+ $tables[] = 'user_groups';
+ $condition[] = 'ug_group IS NULL';
+ $join_conds['user_groups'] = array(
+ 'LEFT JOIN', array(
+ 'ug_user = rev_user',
+ 'ug_group' => $groupsWithBotPermission
+ )
+ );
+ }
} else {
$uid = User::idFromName( $this->target );
if ( $uid ) {
);
# Mark current revisions
$topmarktext = '';
+ $user = $this->getUser();
if ( $row->rev_id == $row->page_latest ) {
$topmarktext .= '<span class="mw-uctop">' . $this->messages['uctop'] . '</span>';
# Add rollback link
- if ( !$row->page_is_new && $page->quickUserCan( 'rollback' )
- && $page->quickUserCan( 'edit' ) )
+ if ( !$row->page_is_new && $page->quickUserCan( 'rollback', $user )
+ && $page->quickUserCan( 'edit', $user ) )
{
$this->preventClickjacking();
- $topmarktext .= ' ' . Linker::generateRollback( $rev );
+ $topmarktext .= ' ' . Linker::generateRollback( $rev, $this->getContext() );
}
}
- $user = $this->getUser();
# Is there a visible previous revision?
if ( $rev->userCan( Revision::DELETED_TEXT, $user ) && $rev->getParentId() !== 0 ) {
$difftext = Linker::linkKnown(
} else {
$parentLen = isset( $this->mParentLens[$row->rev_parent_id] ) ? $this->mParentLens[$row->rev_parent_id] : 0;
$chardiff = ' . . ' . ChangesList::showCharacterDifference(
- $parentLen, $row->rev_len ) . ' . . ';
+ $parentLen, $row->rev_len, $this->getContext() ) . ' . . ';
}
$lang = $this->getLanguage();