diff options
author | Arne Heizmann <timwi@users.mediawiki.org> | 2004-08-09 23:30:02 +0000 |
---|---|---|
committer | Arne Heizmann <timwi@users.mediawiki.org> | 2004-08-09 23:30:02 +0000 |
commit | 52bb460dc45f1593b20a77e9e20ebdfb89943ad0 (patch) | |
tree | 8b8f11da7c63d0cf2f669ee1a2e3c721e40f208a /includes/SpecialNewpages.php | |
parent | 29dacdd9f60737a75899d13307ac22a7ac489d4d (diff) | |
download | mediawikicore-52bb460dc45f1593b20a77e9e20ebdfb89943ad0.tar.gz mediawikicore-52bb460dc45f1593b20a77e9e20ebdfb89943ad0.zip |
If you really must have a useless $wgUseRCPatrol option, might as well use it
consistently everywhere to ensure that setting it to 0 actually does disable the
feature. Also, tell the user that it is disabled if they happen to follow a link
with &action=markpatrolled in it. Additionally, make &action=markpatrolled say
"log in required" if the user is not logged in.
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/4634
Diffstat (limited to 'includes/SpecialNewpages.php')
-rw-r--r-- | includes/SpecialNewpages.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/includes/SpecialNewpages.php b/includes/SpecialNewpages.php index d9f85fe145d8..2d9a47a6509a 100644 --- a/includes/SpecialNewpages.php +++ b/includes/SpecialNewpages.php @@ -15,8 +15,9 @@ class NewPagesPage extends QueryPage { } function getSQL() { - global $wgUser, $wgOnlySysopsCanPatrol; - $usepatrol = ( $wgUser->getID() != 0 && ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) ) ? 1 : 0; + global $wgUser, $wgOnlySysopsCanPatrol, $wgUseRCPatrol; + $usepatrol = ( $wgUseRCPatrol && $wgUser->getID() != 0 && + ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) ) ? 1 : 0; $dbr =& wfGetDB( DB_SLAVE ); extract( $dbr->tableNames( 'recentchanges', 'cur' ) ); @@ -40,14 +41,14 @@ class NewPagesPage extends QueryPage { } function formatResult( $skin, $result ) { - global $wgLang, $wgUser, $wgOnlySysopsCanPatrol; + global $wgLang, $wgUser, $wgOnlySysopsCanPatrol, $wgUseRCPatrol; $u = $result->user; $ut = $result->user_text; $length = wfMsg( "nbytes", $wgLang->formatNum( $result->length ) ); $c = $skin->formatComment($result->comment ); - if ( 0 == $u ) { # not by a logged-in user + if ( $u == 0 ) { # not by a logged-in user $ul = $ut; } else { @@ -58,8 +59,8 @@ class NewPagesPage extends QueryPage { # Since there is no diff link, we need to give users a way to # mark the article as patrolled if it isn't already - if ( $result->usepatrol && $result->patrolled == 0 && $wgUser->getID() != 0 && - ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) ) + if ( $wgUseRCPatrol && $result->usepatrol && $result->patrolled == 0 && + $wgUser->getID() != 0 && ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) ) $link = $skin->makeKnownLink( $result->title, '', "rcid={$result->rcid}" ); else $link = $skin->makeKnownLink( $result->title, '' ); |