* Blocked users can no longer roll back, change the protection of, or delete/undelete pages
* Protect against spoofing of X-Forwarded-For header
* XSS issue : now sanitize search query input (fixed in 1.5rc3)
+* Remove deprecated $wgOnlySysopsCanPatrol references; use User::isAllowed( 'patrol' )
+ per bug 5282. Patch by Alan Harder.
Special Pages:
* Rearranged Special:Movepage form to reduce confusion between destination
* the given title.
*/
function view() {
- global $wgUser, $wgOut, $wgRequest, $wgOnlySysopsCanPatrol, $wgContLang;
+ global $wgUser, $wgOut, $wgRequest, $wgContLang;
global $wgEnableParserCache, $wgStylePath, $wgUseRCPatrol, $wgParser;
global $wgUseTrackbacks;
$sk = $wgUser->getSkin();
# If we have been passed an &rcid= parameter, we want to give the user a
# chance to mark this new article as patrolled.
- if ( $wgUseRCPatrol
- && !is_null($rcid)
- && $rcid != 0
- && $wgUser->isLoggedIn()
- && ( $wgUser->isAllowed('patrol') || !$wgOnlySysopsCanPatrol ) )
- {
+ if ( $wgUseRCPatrol && !is_null( $rcid ) && $rcid != 0 && $wgUser->isAllowed( 'patrol' ) ) {
$wgOut->addHTML(
"<div class='patrollink'>" .
wfMsg ( 'markaspatrolledlink',
* Mark this particular edit as patrolled
*/
function markpatrolled() {
- global $wgOut, $wgRequest, $wgOnlySysopsCanPatrol, $wgUseRCPatrol, $wgUser;
+ global $wgOut, $wgRequest, $wgUseRCPatrol, $wgUser;
$wgOut->setRobotpolicy( 'noindex,follow' );
# Check RC patrol config. option
}
# Check permissions
- if( $wgUser->isLoggedIn() ) {
- if( !$wgUser->isAllowed( 'patrol' ) ) {
- $wgOut->permissionRequired( 'patrol' );
- return;
- }
- } else {
- $wgOut->loginToUse();
+ if( !$wgUser->isAllowed( 'patrol' ) ) {
+ $wgOut->permissionRequired( 'patrol' );
return;
}
$rcid = $wgRequest->getVal( 'rcid' );
- if ( !is_null ( $rcid ) )
- {
- if( wfRunHooks( 'MarkPatrolled', array( &$rcid, &$wgUser, $wgOnlySysopsCanPatrol ) ) ) {
+ if ( !is_null ( $rcid ) ) {
+ if( wfRunHooks( 'MarkPatrolled', array( &$rcid, &$wgUser, false ) ) ) {
require_once( 'RecentChange.php' );
RecentChange::markPatrolled( $rcid );
- wfRunHooks( 'MarkPatrolledComplete', array( &$rcid, &$wgUser, $wgOnlySysopsCanPatrol ) );
+ wfRunHooks( 'MarkPatrolledComplete', array( &$rcid, &$wgUser, false ) );
$wgOut->setPagetitle( wfMsg( 'markedaspatrolled' ) );
$wgOut->addWikiText( wfMsg( 'markedaspatrolledtext' ) );
}
$rcTitle = Title::makeTitle( NS_SPECIAL, 'Recentchanges' );
$wgOut->returnToMain( false, $rcTitle->getPrefixedText() );
}
- else
- {
+ else {
$wgOut->errorpage( 'markedaspatrollederror', 'markedaspatrollederrortext' );
}
}
}
/**
- * Check whether to enable RC-Patrol features
+ * Check whether to enable recent changes patrol features
* @return bool
*/
function usePatrol() {
- global $wgUseRCPatrol, $wgOnlySysopsCanPatrol, $wgUser;
- return $wgUseRCPatrol && $wgUser->isLoggedIn() &&
- ( !$wgOnlySysopsCanPatrol || $wgUser->isAllowed( 'patrol' ) );
+ global $wgUseRCPatrol, $wgUser;
+ return( $wgUseRCPatrol && $wgUser->isAllowed( 'patrol' ) );
}
}
function showDiffPage() {
- global $wgUser, $wgOut, $wgContLang, $wgOnlySysopsCanPatrol;
- global $wgUseExternalEditor, $wgUseRCPatrol;
+ global $wgUser, $wgOut, $wgContLang, $wgUseExternalEditor, $wgUseRCPatrol;
$fname = 'DifferenceEngine::showDiffPage';
wfProfileIn( $fname );
} else {
$rollback = '';
}
- if ( $wgUseRCPatrol && $this->mRcidMarkPatrolled != 0 && $wgUser->isLoggedIn() &&
- ( $wgUser->isAllowed('rollback') || !$wgOnlySysopsCanPatrol ) )
- {
- $patrol = ' [' . $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'markaspatrolleddiff' ),
- "action=markpatrolled&rcid={$this->mRcidMarkPatrolled}" ) . ']';
+ if( $wgUseRCPatrol && $this->mRcidMarkPatrolled != 0 && $wgUser->isAllowed( 'patrol' ) ) {
+ $patrol = ' [' . $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'markaspatrolleddiff' ), "action=markpatrolled&rcid={$this->mRcidMarkPatrolled}" ) . ']';
} else {
$patrol = '';
}
}
function getSQL() {
- global $wgUser, $wgOnlySysopsCanPatrol, $wgUseRCPatrol;
- $usepatrol = ( $wgUseRCPatrol && $wgUser->isLoggedIn() &&
- ( $wgUser->isAllowed('patrol') || !$wgOnlySysopsCanPatrol ) ) ? 1 : 0;
+ global $wgUser, $wgUseRCPatrol;
+ $usepatrol = ( $wgUseRCPatrol && $wgUser->isAllowed( 'patrol' ) ) ? 1 : 0;
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'recentchanges', 'page', 'text' ) );
}
function formatResult( $skin, $result ) {
- global $wgLang, $wgContLang, $wgUser, $wgOnlySysopsCanPatrol, $wgUseRCPatrol;
+ global $wgLang, $wgContLang, $wgUser, $wgUseRCPatrol;
$u = $result->user;
$ut = $result->user_text;
# Since there is no diff link, we need to give users a way to
# mark the article as patrolled if it isn't already
$ns = $wgContLang->getNsText( $result->namespace );
- if ( $wgUseRCPatrol && !is_null ( $result->usepatrol ) && $result->usepatrol &&
- $result->patrolled == 0 && $wgUser->isLoggedIn() &&
- ( $wgUser->isAllowed('patrol') || !$wgOnlySysopsCanPatrol ) )
+ if( $wgUseRCPatrol && !is_null( $result->usepatrol ) && $result->usepatrol && $result->patrolled == 0 && $wgUser->isAllowed( 'patrol' ) ) {
$link = $skin->makeKnownLink( $ns . ':' . $result->title, '', "rcid={$result->rcid}" );
- else
+ } else {
$link = $skin->makeKnownLink( $ns . ':' . $result->title, '' );
+ }
$s = "{$d} {$link} ({$length}) . . {$ul}";
-
$s .= $skin->commentBlock( $result->comment );
-
return $s;
}