Changeset 3047:b6338d32a3eb
- Timestamp:
- 07/10/15 17:39:03 (10 years ago)
- Branch:
- default
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/actions/class.dcactioncomments.php
r2821 r3047 140 140 ); 141 141 } 142 143 $ip_filter_active = true; 144 if ($core->blog->settings->antispam->antispam_filters !== null) { 145 $filters_opt = @unserialize($core->blog->settings->antispam->antispam_filters); 146 if (is_array($filters_opt)) { 147 $ip_filter_active = isset($filters_opt['dcFilterIP']) && is_array($filters_opt['dcFilterIP']) && $filters_opt['dcFilterIP'][0]==1; 148 } 149 } 150 151 if ($ip_filter_active) { 152 $blacklist_actions = array(__('Blacklist IP') => 'blacklist'); 153 if ($core->auth->isSuperAdmin()) { 154 $blacklist_actions[__('Blacklist IP (global)')] = 'blacklist_global'; 155 } 156 157 $ap->addAction( 158 array(__('IP address') => $blacklist_actions), 159 array('dcDefaultCommentActions','doBlacklistIP') 160 ); 161 } 142 162 } 143 163 … … 180 200 $ap->redirect(false); 181 201 } 202 203 public static function doBlacklistIP($core, dcCommentsActionsPage $ap, $post) { 204 $action = $ap->getAction(); 205 $co_ids = $ap->getIDs(); 206 if (empty($co_ids)) { 207 throw new Exception(__('No comment selected')); 208 } 209 210 $global = !empty($action) && $action == 'blacklist_global' && $core->auth->isSuperAdmin(); 211 212 $ip_filter = new dcFilterIP($core); 213 $rs = $ap->getRS(); 214 while ($rs->fetch()) { 215 $ip_filter->addIP('black',$rs->comment_ip,$global); 216 } 217 218 dcPage::addSuccessNotice(__('IP addresses for selected comments have been blacklisted.')); 219 $ap->redirect(true); 220 } 182 221 } -
locales/fr/main.po
r3044 r3047 885 885 msgstr "Les commentaires indésirables ont été supprimés." 886 886 887 msgid "IP addresses for selected comments have been blacklisted." 888 msgstr "Les adresses IP des commentaires sélectionnés ont été ajoutées en liste noire." 889 890 msgid "Blacklist IP" 891 msgstr "Ajouter en liste noire" 892 893 msgid "Blacklist IP (global)" 894 msgstr "Ajouter en liste noire (pour tous les blogs)" 895 887 896 msgid "You have one spam comment." 888 897 msgstr "Vous avez un commentaire indésirable." -
plugins/antispam/filters/class.dc.filter.ip.php
r2566 r3047 222 222 } 223 223 224 p rivatefunction addIP($type,$pattern,$global)224 public function addIP($type,$pattern,$global) 225 225 { 226 226 $this->ipmask($pattern,$ip,$mask);
Note: See TracChangeset
for help on using the changeset viewer.