annotate core/modules/ban/ban.module @ 0:c75dbcec494b
Initial commit from drush-created site
author |
Chris Cannam |
date |
Thu, 05 Jul 2018 14:24:15 +0000 |
parents |
|
children |
12f9dff5fda9 |
rev |
line source |
Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 /**
|
Chris@0
|
4 * @file
|
Chris@0
|
5 * Allows to ban individual IP addresses.
|
Chris@0
|
6 */
|
Chris@0
|
7
|
Chris@0
|
8 use Drupal\Core\Routing\RouteMatchInterface;
|
Chris@0
|
9
|
Chris@0
|
10 /**
|
Chris@0
|
11 * Implements hook_help().
|
Chris@0
|
12 */
|
Chris@0
|
13 function ban_help($route_name, RouteMatchInterface $route_match) {
|
Chris@0
|
14 switch ($route_name) {
|
Chris@0
|
15 case 'help.page.ban':
|
Chris@0
|
16 $output = '';
|
Chris@0
|
17 $output .= '<h3>' . t('About') . '</h3>';
|
Chris@0
|
18 $output .= '<p>' . t('The Ban module allows administrators to ban visits to their site from individual IP addresses. For more information, see the <a href=":url">online documentation for the Ban module</a>.', [':url' => 'https://www.drupal.org/documentation/modules/ban']) . '</p>';
|
Chris@0
|
19 $output .= '<h3>' . t('Uses') . '</h3>';
|
Chris@0
|
20 $output .= '<dl>';
|
Chris@0
|
21 $output .= '<dt>' . t('Banning IP addresses') . '</dt>';
|
Chris@0
|
22 $output .= '<dd>' . t('Administrators can enter IP addresses to ban on the <a href=":bans">IP address bans</a> page.', [':bans' => \Drupal::url('ban.admin_page')]) . '</dd>';
|
Chris@0
|
23 $output .= '</dl>';
|
Chris@0
|
24 return $output;
|
Chris@0
|
25
|
Chris@0
|
26 case 'ban.admin_page':
|
Chris@0
|
27 return '<p>' . t('IP addresses listed here are banned from your site. Banned addresses are completely forbidden from accessing the site and instead see a brief message explaining the situation.') . '</p>';
|
Chris@0
|
28 }
|
Chris@0
|
29 }
|