r48981 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48980‎ | r48981 | r48982 >
Date:04:29, 29 March 2009
Author:mrzman
Status:ok
Tags:
Comment:
add option to see IP addresses in list=abuselog if user has 'abusefilter-private' right
Modified paths:
  • /trunk/extensions/AbuseFilter/ApiQueryAbuseLog.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/ApiQueryAbuseLog.php
@@ -47,6 +47,9 @@
4848 $fld_ids = isset($prop['ids']);
4949 $fld_filter = isset($prop['filter']);
5050 $fld_user = isset($prop['user']);
 51+ $fld_ip = isset($prop['ip']);
 52+ if($fld_ip && !$wgUser->isAllowed('abusefilter-private'))
 53+ $this->dieUsage('You don\'t have permission to view IP addresses', 'permissiondenied');
5154 $fld_title = isset($prop['title']);
5255 $fld_action = isset($prop['action']);
5356 $fld_details = isset($prop['details']);
@@ -68,6 +71,7 @@
6972 }
7073 $this->addFieldsIf(array('afl_id', 'afl_filter'), $fld_ids);
7174 $this->addFieldsIf('afl_user_text', $fld_user);
 75+ $this->addFieldsIf('afl_ip', $fld_ip);
7276 $this->addFieldsIf(array('afl_namespace', 'afl_title'), $fld_title);
7377 $this->addFieldsIf('afl_action', $fld_action);
7478 $this->addFieldsIf('afl_var_dump', $fld_details);
@@ -109,6 +113,8 @@
110114 $entry['filter'] = $row->af_public_comments;
111115 if($fld_user)
112116 $entry['user'] = $row->afl_user_text;
 117+ if($fld_ip)
 118+ $entry['ip'] = $row->afl_ip;
113119 if($fld_title) {
114120 $title = Title::makeTitle($row->afl_namespace, $row->afl_title);
115121 ApiQueryBase::addTitleInfo($entry, $title);
@@ -165,6 +171,7 @@
166172 'ids',
167173 'filter',
168174 'user',
 175+ 'ip',
169176 'title',
170177 'action',
171178 'details',

Status & tagging log