Skip to content

Commit 0c02127

Browse files
committed
v.1.0.12
1 parent 6cf7e3e commit 0c02127

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

ip_blocking.admin.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,20 +164,20 @@ function ip_blocking_settings_form() {
164164
$form = array();
165165

166166
$form['info'] = array(
167-
'#markup' => '<p>' . t('Additional settings for module') . '</p>',
167+
'#markup' => '<p>' . t('Additional settings') . ':</p>',
168168
);
169169

170170
$form['log_enabled'] = array(
171171
'#type' => 'checkbox',
172172
'#title' => t('Enable logging'),
173173
'#default_value' => config_get('ip_blocking.settings', 'log_enabled'),
174-
'#description' => t('Enable logging for access attempts from blocked IPs'),
174+
'#description' => t('Enable logging of access attempts from blocked IPs and actions of this module.'),
175175
);
176176
$form['return_404'] = array(
177177
'#type' => 'checkbox',
178178
'#title' => t('Return code 404'),
179179
'#default_value' => config_get('ip_blocking.settings', 'return_404'),
180-
'#description' => t('Return 404 (Not Found) status code for visitors from blocked IP instead of default 403 (Access Denied)'),
180+
'#description' => t('Return 404 (Not Found) status code for visitors from blocked IP instead of default 403 (Access Denied).'),
181181
);
182182

183183

ip_blocking.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ package = Spam control
44
backdrop = 1.x
55
type = module
66
configure = admin/config/people/ip-blocking
7-
version = 1.0.11
7+
version = 1.0.12

ip_blocking.module

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ function ip_blocking_get_action_link($ip, $message) {
213213
$action_link = '';
214214
// If the IP is already blocked, display an unblock link or vice versa.
215215
if (ip_is_denied($ip)) {
216-
$action_link .= t('IP blocked') . ' - ';
216+
$action_link .= '<b>' . t('IP @ip blocked', array('@ip' => $ip)) . '</b> - ';
217217
$action = 'unblock';
218218
}
219219
else {
@@ -273,7 +273,13 @@ function ip_blocking_block_ip($ip, $reason) {
273273
$uid = $user->uid;
274274
$config = config('ip_blocking.settings');
275275
$log_enabled = $config->get('log_enabled');
276-
$reason_dec = 'Request: ' . urldecode($reason);
276+
277+
if (backdrop_strlen($reason) > 250) {
278+
$reason_dec = 'Request: ' . urldecode(substr($reason, 0, 250)) . ' ... ';
279+
}
280+
else {
281+
$reason_dec = 'Request: ' . urldecode($reason);
282+
}
277283

278284
// Insert the record to DB.
279285
db_insert('blocked_ips')

0 commit comments

Comments
 (0)