annotate core/modules/ban/ban.module @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents af1871eacc83
children
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@18 8 use Drupal\Core\Url;
Chris@0 9 use Drupal\Core\Routing\RouteMatchInterface;
Chris@0 10
Chris@0 11 /**
Chris@0 12 * Implements hook_help().
Chris@0 13 */
Chris@0 14 function ban_help($route_name, RouteMatchInterface $route_match) {
Chris@0 15 switch ($route_name) {
Chris@0 16 case 'help.page.ban':
Chris@0 17 $output = '';
Chris@0 18 $output .= '<h3>' . t('About') . '</h3>';
Chris@0 19 $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 20 $output .= '<h3>' . t('Uses') . '</h3>';
Chris@0 21 $output .= '<dl>';
Chris@0 22 $output .= '<dt>' . t('Banning IP addresses') . '</dt>';
Chris@18 23 $output .= '<dd>' . t('Administrators can enter IP addresses to ban on the <a href=":bans">IP address bans</a> page.', [':bans' => Url::fromRoute('ban.admin_page')->toString()]) . '</dd>';
Chris@0 24 $output .= '</dl>';
Chris@0 25 return $output;
Chris@0 26
Chris@0 27 case 'ban.admin_page':
Chris@0 28 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 29 }
Chris@0 30 }