ban.module 1.2 KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * @file
  4. * Allows to ban individual IP addresses.
  5. */
  6. use Drupal\Core\Routing\RouteMatchInterface;
  7. /**
  8. * Implements hook_help().
  9. */
  10. function ban_help($route_name, RouteMatchInterface $route_match) {
  11. switch ($route_name) {
  12. case 'help.page.ban':
  13. $output = '';
  14. $output .= '<h3>' . t('About') . '</h3>';
  15. $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>';
  16. $output .= '<h3>' . t('Uses') . '</h3>';
  17. $output .= '<dl>';
  18. $output .= '<dt>' . t('Banning IP addresses') . '</dt>';
  19. $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>';
  20. $output .= '</dl>';
  21. return $output;
  22. case 'ban.admin_page':
  23. 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>';
  24. }
  25. }