Index: trunk/extensions/AbuseFilter/ApiQueryAbuseLog.php |
— | — | @@ -47,6 +47,9 @@ |
48 | 48 | $fld_ids = isset($prop['ids']); |
49 | 49 | $fld_filter = isset($prop['filter']); |
50 | 50 | $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'); |
51 | 54 | $fld_title = isset($prop['title']); |
52 | 55 | $fld_action = isset($prop['action']); |
53 | 56 | $fld_details = isset($prop['details']); |
— | — | @@ -68,6 +71,7 @@ |
69 | 72 | } |
70 | 73 | $this->addFieldsIf(array('afl_id', 'afl_filter'), $fld_ids); |
71 | 74 | $this->addFieldsIf('afl_user_text', $fld_user); |
| 75 | + $this->addFieldsIf('afl_ip', $fld_ip); |
72 | 76 | $this->addFieldsIf(array('afl_namespace', 'afl_title'), $fld_title); |
73 | 77 | $this->addFieldsIf('afl_action', $fld_action); |
74 | 78 | $this->addFieldsIf('afl_var_dump', $fld_details); |
— | — | @@ -109,6 +113,8 @@ |
110 | 114 | $entry['filter'] = $row->af_public_comments; |
111 | 115 | if($fld_user) |
112 | 116 | $entry['user'] = $row->afl_user_text; |
| 117 | + if($fld_ip) |
| 118 | + $entry['ip'] = $row->afl_ip; |
113 | 119 | if($fld_title) { |
114 | 120 | $title = Title::makeTitle($row->afl_namespace, $row->afl_title); |
115 | 121 | ApiQueryBase::addTitleInfo($entry, $title); |
— | — | @@ -165,6 +171,7 @@ |
166 | 172 | 'ids', |
167 | 173 | 'filter', |
168 | 174 | 'user', |
| 175 | + 'ip', |
169 | 176 | 'title', |
170 | 177 | 'action', |
171 | 178 | 'details', |