Fix Bug 33390 - Examine page is visible for hidden log entries

Fix Bug 24186 - "Examine" page is visible to users without abusefilter-log-detail right
Author: Nikola Kovacs

There was a more complex patch on Bug 24186, but I think he makes a
good argument why his is better.

Beware: I'm not set up to test AbuseFilter, but I didn't see anyone
else in core MW who regularly works on it.
This commit is contained in:
Mark A. Hershberger 2011-12-27 23:35:24 +00:00
parent 66cbb546b6
commit a4858a5109
Notes: Raimond Spekking 2012-03-12 20:46:25 +00:00
2 changed files with 12 additions and 0 deletions

View file

@ -104,6 +104,7 @@ Filter description: $7 ($8)',
'abusefilter-log-linkoncontribs-text' => 'Abuse log for this user',
'abusefilter-log-hidden' => '(entry hidden)',
'abusefilter-log-hide' => 'hide or unhide', // @todo FIXME: Message unused?
'abusefilter-log-cannot-see-details' => 'You do not have permission to see details of any entries.',
'abusefilter-log-details-hidden' => 'You cannot view the details for this entry because it is hidden from public view.',
// Hiding log entries
@ -580,6 +581,7 @@ $messages['qqq'] = array(
'abusefilter-log-linkoncontribs-text' => 'Title for link added on [[Special:Contributions]] and other relevant special pages.',
'abusefilter-log-hidden' => 'Text for a hidden log entry.',
'abusefilter-log-hide' => 'This message may be unused.',
'abusefilter-log-cannot-see-details' => 'Message show instead of the log row for users without permissions to see any details.',
'abusefilter-log-details-hidden' => 'Message shown instead of log row details when those are hidden.',
'abusefilter-log-hide-legend' => 'Legend for form to hide a log entry.',
'abusefilter-log-hide-id' => 'Field label in form to hide a log entry.',

View file

@ -106,6 +106,16 @@ class AbuseFilterViewExamine extends AbuseFilterView {
self::$examineType = 'log';
self::$examineId = $logid;
if ( !SpecialAbuseLog::canSeeDetails() ) {
$this->getOutput()->addWikiMsg( 'abusefilter-log-cannot-see-details' );
return;
}
if ( $row->afl_deleted && !SpecialAbuseLog::canSeeHidden() ) {
$this->getOutput()->addWikiMsg( 'abusefilter-log-details-hidden' );
return;
}
$vars = AbuseFilter::loadVarDump( $row->afl_var_dump );
$this->showExaminer( $vars );