r48001 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48000‎ | r48001 | r48002 >
Date:23:47, 3 March 2009
Author:aaron
Status:ok
Tags:
Comment:
* Only show private logs on specific request
* Tweak suppress log header to be more like oversight
Modified paths:
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LogEventsList.php
@@ -447,15 +447,16 @@
448448 /**
449449 * SQL clause to skip forbidden log types for this user
450450 * @param $db Database
 451+ * @param $audience string, public/user
451452 * @return mixed (string or false)
452453 */
453 - public static function getExcludeClause( $db ) {
 454+ public static function getExcludeClause( $db, $audience = 'public' ) {
454455 global $wgLogRestrictions, $wgUser;
455456 // Reset the array, clears extra "where" clauses when $par is used
456457 $hiddenLogs = array();
457458 // Don't show private logs to unprivileged users
458459 foreach( $wgLogRestrictions as $logType => $right ) {
459 - if( !$wgUser->isAllowed($right) ) {
 460+ if( $audience == 'public' || !$wgUser->isAllowed($right) ) {
460461 $safeType = $db->strencode( $logType );
461462 $hiddenLogs[] = $safeType;
462463 }
@@ -540,16 +541,17 @@
541542 if( isset($wgLogRestrictions[$type]) && !$wgUser->isAllowed($wgLogRestrictions[$type]) ) {
542543 $type = '';
543544 }
544 - // Don't show private logs to unpriviledged users
545 - $hideLogs = LogEventsList::getExcludeClause( $this->mDb );
 545+ // Don't show private logs to unpriviledged users.
 546+ // Also, only show them upon specific request to avoid suprises.
 547+ $audience = $type ? 'user' : 'public';
 548+ $hideLogs = LogEventsList::getExcludeClause( $this->mDb, $audience );
546549 if( $hideLogs !== false ) {
547550 $this->mConds[] = $hideLogs;
548551 }
549 - if( !$type ) {
550 - return false;
 552+ if( $type ) {
 553+ $this->type = $type;
 554+ $this->mConds['log_type'] = $type;
551555 }
552 - $this->type = $type;
553 - $this->mConds['log_type'] = $type;
554556 }
555557
556558 /**
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1346,7 +1346,8 @@
13471347 # Suppression log
13481348 'suppressionlog' => 'Suppression log',
13491349 'suppressionlogtext' => 'Below is a list of deletions and blocks involving content hidden from administrators.
1350 -See the [[Special:IPBlockList|IP block list]] for the list of currently operational bans and blocks.',
 1350+See the [[Special:IPBlockList|IP block list]] for the list of currently operational bans and blocks.
 1351+Releasing this information can result in \'\'permanent\'\' loss of Suppression privileges. ',
13511352
13521353 # History merging
13531354 'mergehistory' => 'Merge page histories',
@@ -2202,7 +2203,7 @@
22032204 'specialloguserlabel' => 'User:',
22042205 'speciallogtitlelabel' => 'Title:',
22052206 'log' => 'Logs',
2206 -'all-logs-page' => 'All logs',
 2207+'all-logs-page' => 'All public logs',
22072208 'alllogstext' => 'Combined display of all available logs of {{SITENAME}}.
22082209 You can narrow down the view by selecting a log type, the user name (case-sensitive), or the affected page (also case-sensitive).',
22092210 'logempty' => 'No matching items in log.',

Follow-up revisions

RevisionCommit summaryAuthorDate
r48014Revert change in 'suppressionlogtext' from r48001. Let's not hard code policy.siebrand06:50, 4 March 2009

Status & tagging log