PluginProbe
wpForo Forum / 1.4.1
wpForo Forum v1.4.1
3.1.7 3.1.6 3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.9 3.0.8 3.0.7 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 All 139 releases
wpforo / wpf-admin / tools-tabs / antispam.php

antispam.php in wpForo Forum 1.4.1, at wpf-admin/tools-tabs/antispam.php

183 lines 14.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Exit if accessed directly
3 if( !defined( 'ABSPATH' ) ) exit;
4 if( !current_user_can('administrator') ) exit;
5 ?>
6
7 <?php if( !isset( $_GET['action'] ) ): ?>
8
9 <?php if (!class_exists('Akismet')): ?>
10 <div style="width:94%; clear:both; margin:0px 0 15px 0; text-align:center; line-height:22px; font-size:14px; color:#D35206; border:1px dotted #ccc; padding:10px 20px 10px 20px;; background:#F7F5F5;">
11 <a href="https://wordpress.org/plugins/akismet/" target="_blank">Akismet</a> <?php _e('is not installed! For an advanced Spam Control please install Akismet antispam plugin, it works well with wpForo Spam Control system. Akismet is already integrated with wpForo. It\'ll help to filter posts and protect forum against spam attacks.', 'wpforo'); ?>
12 </div>
13 <?php else: ?>
14
15 <?php endif; ?>
16
17 <form action="" method="POST" class="validate">
18 <?php wp_nonce_field( 'wpforo-tools-antispam' ); ?>
19 <div class="wpf-tool-box wpf-spam-attach right-box">
20 <h3>
21 <?php _e('Spam Control', 'wpforo'); ?>
22 <p class="wpf-info"><?php _e('Some useful options to limit just registered users and minimize spam. This control don\'t affect users whose Usergroup has "Can edit member" and "Can pass moderation" permissions.', 'wpforo'); ?></p>
23 </h3>
24 <div style="margin-top:10px; clear:both;">
25 <table style="width:100%;">
26 <tbody>
27 <tr>
28 <th><label><?php _e('Enable wpForo Spam Control','wpforo'); ?>:</label></th>
29 <td>
30 <div class="wpf-switch-field">
31 <input id="spam_filter_yes" type="radio" name="wpforo_tools_antispam[spam_filter]" value="1" <?php wpfo_check($wpforo->tools_antispam['spam_filter'], 1); ?>/><label for="spam_filter_yes"><?php _e('Yes','wpforo'); ?></label> &nbsp;
32 <input id="spam_filter_no" type="radio" name="wpforo_tools_antispam[spam_filter]" value="0" <?php wpfo_check($wpforo->tools_antispam['spam_filter'], 0); ?>/><label for="spam_filter_no"><?php _e('No','wpforo'); ?></label>
33 </div>
34 </td>
35 </tr>
36 <tr>
37 <th><label><?php _e('Ban user when spam is suspicted','wpforo'); ?>:</label></th>
38 <td>
39 <div class="wpf-switch-field">
40 <input id="spam_user_ban_yes" type="radio" name="wpforo_tools_antispam[spam_user_ban]" value="1" <?php wpfo_check($wpforo->tools_antispam['spam_user_ban'], 1); ?>/><label for="spam_user_ban_yes"><?php _e('Yes','wpforo'); ?></label> &nbsp;
41 <input id="spam_user_ban_no" type="radio" name="wpforo_tools_antispam[spam_user_ban]" value="0" <?php wpfo_check($wpforo->tools_antispam['spam_user_ban'], 0); ?>/><label for="spam_user_ban_no"><?php _e('No','wpforo'); ?></label>
42 </div>
43 </td>
44 </tr>
45 <tr style="visibility:hidden;">
46 <th><label><?php _e('Notify via email when new user is banned','wpforo'); ?>:</label></th>
47 <td>
48 <div class="wpf-switch-field">
49 <input id="spam_user_ban_notification_yes" type="radio" name="wpforo_tools_antispam[spam_user_ban_notification]" value="1" <?php wpfo_check($wpforo->tools_antispam['spam_user_ban_notification'], 1); ?>/><label for="spam_user_ban_notification_yes"><?php _e('Yes','wpforo'); ?></label> &nbsp;
50 <input id="spam_user_ban_notification_no" type="radio" name="wpforo_tools_antispam[spam_user_ban_notification]" value="0" <?php wpfo_check($wpforo->tools_antispam['spam_user_ban_notification'], 0); ?>/><label for="spam_user_ban_notification_no"><?php _e('No','wpforo'); ?></label>
51 </div>
52 </td>
53 </tr>
54 <tr>
55 <th><label ><?php _e('Spam Suspicion Level for Topics', 'wpforo'); ?></label></th>
56 <td><input type="number" min="0" max="100" name="wpforo_tools_antispam[spam_filter_level_topic]" value="<?php wpfo($wpforo->tools_antispam['spam_filter_level_topic']) ?>" class="wpf-field" /></td>
57 </tr>
58 <tr>
59 <th><label ><?php _e('Spam Suspicion Level for Posts', 'wpforo'); ?></label></th>
60 <td><input type="number" min="0" max="100" name="wpforo_tools_antispam[spam_filter_level_post]" value="<?php wpfo($wpforo->tools_antispam['spam_filter_level_post']) ?>" class="wpf-field" /></td>
61 </tr>
62 <?php if (class_exists('Akismet')): ?>
63 <tr>
64 <td colspan="2" style="color:#fff; background:#7C9B2E; font-size:20px; padding:10px 10px; text-align:center; font-family:'Lucida Grande', 'Lucida Sans Unicode'"><strong>A&middot;kis&middot;met</strong> <?php _e(' is enabled','wpforo'); ?></td>
65 </tr>
66 <?php endif; ?>
67 </tbody>
68 </table>
69 </div>
70 </div>
71 <div class="wpf-tool-box wpf-spam-attach left-box">
72 <h3>
73 <?php _e('New Registered User', 'wpforo'); ?>
74 <p class="wpf-info"><?php _e('Some useful options to limit just registered users and minimize spam. These options don\'t affect users whose Usergroup has "Can edit member" and "Can pass moderation" permissions.', 'wpforo'); ?></p>
75 </h3>
76 <div style="margin-top:10px; clear:both;">
77 <table style="width:100%;">
78 <tbody>
79 <tr>
80 <th style="width:65%;">
81 <label ><?php _e('User is New (under hard spam control) during', 'wpforo'); ?></label>
82 </th>
83 <td><?php _e('first', 'wpforo'); ?> <input type="number" min="0" name="wpforo_tools_antispam[new_user_max_posts]" value="<?php wpfo($wpforo->tools_antispam['new_user_max_posts']) ?>" class="wpf-field" style="width:50px;" /> <?php _e('posts', 'wpforo'); ?></td>
84 </tr>
85 <tr>
86 <th style="width:65%;"><label ><?php _e('Min number of posts to be able attach files', 'wpforo'); ?></label></th>
87 <td><input type="number" min="0" name="wpforo_tools_antispam[min_number_post_to_attach]" value="<?php wpfo($wpforo->tools_antispam['min_number_post_to_attach']) ?>" class="wpf-field" style="max-width:80px;" /></td>
88 </tr>
89 <tr>
90 <th><label><?php _e('Min number of posts to be able post links', 'wpforo'); ?></label></th>
91 <td><input type="number" min="0" name="wpforo_tools_antispam[min_number_post_to_link]" value="<?php wpfo($wpforo->tools_antispam['min_number_post_to_link']) ?>" class="wpf-field" style="max-width:80px;" /></td>
92 </tr>
93 <tr>
94 <th colspan="2">
95 <label><?php _e('Do not allow to attach files with following extensions:', 'wpforo'); ?></label>
96 <textarea name="wpforo_tools_antispam[limited_file_ext]" style="width:100%; height:60px; margin-top:10px; color:#666666; background:#fdfdfd;"><?php echo esc_textarea(stripslashes($wpforo->tools_antispam['limited_file_ext'])); ?></textarea></td>
97 </tr>
98 </tbody>
99 </table>
100 </div>
101 </div>
102 <div class="wpf-tool-box wpf-spam-attach right-box" id="spam-files">
103 <?php
104 $site = get_bloginfo('url');
105 $upload_dir = wp_upload_dir();
106 $default_attachments_dir = $upload_dir['basedir'] . '/wpforo/default_attachments/';
107 ?>
108 <h3>
109 <?php _e('Possible Spam Attachments', 'wpforo'); ?>
110 <p class="wpf-info"><?php _e('This tool is designed to find attachment which have been uploaded by spammers. The tool checks most common spammer filenames and suggest to delete but you should check one by one and make sure those are spam files before deleting.', 'wpforo'); ?></p>
111 </h3>
112 <div class="wpf-spam-attach-dir"><?php _e('Directory', 'wpforo'); ?>: <?php echo str_replace($site, '', $upload_dir['baseurl']); ?>/wpforo/default_attachments/&nbsp;</div>
113 <div style="margin-top:10px; clear:both;">
114 <table width="100%" border="0" cellspacing="0" cellpadding="0">
115 <tbody>
116 <?php
117 if(is_dir($default_attachments_dir)):
118 if ($handle = opendir($default_attachments_dir)):
119 while (false !== ($filename = readdir($handle))):
120 if( $filename == '.' || $filename == '..') continue;
121
122 $level = 0; $color ='';
123 $file = $default_attachments_dir . '/' . $filename;
124 $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
125 if( !$level = $wpforo->moderation->spam_file($filename) ) continue;
126 if( $level == 2 ) $color = 'style="color:#EE9900;"';
127 if( $level == 3 ) $color = 'style="color:#FF0000;"';
128 if( $level == 4 ) $color = 'style="color:#BB0000;"';
129 ?>
130 <tr>
131 <td class="wpf-spam-item" <?php echo $color; ?> title="<?php echo $upload_dir['baseurl'] .'/wpforo/default_attachments/'. $filename ?>">
132 <?php if( $wpforo->moderation->spam_file($filename, 'file-open') ): ?>
133 <a href="<?php echo $upload_dir['baseurl'] .'/wpforo/default_attachments/'. $filename ?>" target="_blank" <?php echo $color ?>><?php echo wpforo_text($filename, 50, false); ?></a>
134 <?php else: ?>
135 <?php echo $filename; ?>
136 <?php endif; ?>
137 <?php echo ' (' . strtoupper($extension) . ' | ' . wpforo_human_filesize(filesize($file), 1) . ')'; ?>
138 </td>
139 <td class="wpf-actions"><a href="<?php echo wp_nonce_url( admin_url( 'admin.php?page=wpforo-tools&tab=antispam&action=delete-spam-file&sfname=' . urlencode($filename) ), 'wpforo_tools_antispam_files' ); ?>" title="<?php _e('Delete this file', 'wpforo'); ?>" onclick="return confirm('<?php _e('Are you sure you want to permanently delete this file?', 'wpforo'); ?>');"><?php _e('Delete', 'wpforo'); ?></a></td>
140 </tr>
141 <?php
142 endwhile;
143 closedir($handle);
144 endif;
145 endif;
146 ?>
147 <tr style="background:#fff;">
148 <td colspan="2" class="wpf-actions" style="padding-top:20px; text-align:right;">
149 <a href="<?php echo wp_nonce_url( admin_url( 'admin.php?page=wpforo-tools&tab=antispam&action=delete-all&level=1' ), 'wpforo_tools_antispam_files' ); ?>"
150 title="<?php _e('Click to delete Blue marked files', 'wpforo'); ?>"
151 onclick="return confirm('<?php _e('Are you sure you want to delete all BLUE marked files listed here. Please download Wordpress /wp-content/uploads/wpforo/ folder to your local computer before deleting files, this is not undoable.', 'wpforo'); ?>');">
152 <?php _e('Delete All', 'wpforo'); ?>
153 </a> |
154 <a href="<?php echo wp_nonce_url( admin_url( 'admin.php?page=wpforo-tools&tab=antispam&action=delete-all&level=2' ), 'wpforo_tools_antispam_files' ); ?>"
155 title="<?php _e('Click to delete Orange marked files', 'wpforo'); ?>"
156 style="color:#EE9900;"
157 onclick="return confirm('<?php _e('Are you sure you want to delete all ORANGE marked files listed here. Please download Wordpress /wp-content/uploads/wpforo/ folder to your local computer before deleting files, this is not undoable.', 'wpforo'); ?>');">
158 <?php _e('Delete All', 'wpforo'); ?>
159 </a> |
160 <a href="<?php echo wp_nonce_url( admin_url( 'admin.php?page=wpforo-tools&tab=antispam&action=delete-all&level=3' ), 'wpforo_tools_antispam_files' ); ?>"
161 title="<?php _e('Click to delete Red marked files', 'wpforo'); ?>"
162 style="color:#FF0000;"
163 onclick="return confirm('<?php _e('Are you sure you want to delete all RED marked files listed here. Please download Wordpress /wp-content/uploads/wpforo/ folder to your local computer before deleting files, this is not undoable.', 'wpforo'); ?>');">
164 <?php _e('Delete All', 'wpforo'); ?>
165 </a> |
166 <a href="<?php echo wp_nonce_url( admin_url( 'admin.php?page=wpforo-tools&tab=antispam&action=delete-all&level=4' ), 'wpforo_tools_antispam_files' ); ?>"
167 title="<?php _e('Click to delete Dark Red marked files', 'wpforo'); ?>"
168 style="color:#BB0000;"
169 onclick="return confirm('<?php _e('Are you sure you want to delete all DARK RED marked files listed here. Please download Wordpress /wp-content/uploads/wpforo/ folder to your local computer before deleting files, this is not undoable.', 'wpforo'); ?>');">
170 <?php _e('Delete All', 'wpforo'); ?>
171 </a>
172 </td>
173 </tr>
174 </tbody>
175 </table>
176 </div>
177 </div>
178 <div style="clear:both;"></div>
179 <div class="wpforo_settings_foot" style="clear:both; margin-top:20px;">
180 <input type="submit" class="button button-primary" value="<?php _e('Update Options', 'wpforo'); ?>" />
181 </div>
182 </form>
183 <?php endif ?>