diff --git a/README.md b/README.md index 3a3e51019ca7b0f7af1b738a48e2603127cfba4c..207013f1835e6e31a86c56217e7224a52142a748 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,8 @@ This module requires no modules outside of Drupal core. ## Installation -Install as you would normally install a contributed Drupal module. For further information, see -[Installing Drupal Modules](https://www.drupal.org/docs/extending-drupal/installing-drupal-modules). +Install as you would normally install a contributed Drupal module. For further +information, see [Installing Drupal Modules](https://www.drupal.org/docs/extending-drupal/installing-drupal-modules). ## Configuration diff --git a/perimeter.module b/perimeter.module index 14310de4e75cd0f5e50b7025954514ea6a865abc..8f8db1f3da670242fb99e2a24268ef1a02ce747c 100644 --- a/perimeter.module +++ b/perimeter.module @@ -1,7 +1,13 @@ <?php -use Drupal\Core\Database\Database; + +/** + * @file + * The perimeter module file. + */ + use Drupal\ban\BanIpManager; use Drupal\Component\Utility\Xss; +use Drupal\Core\Database\Database; use Drupal\Core\Routing\RouteMatchInterface; /** @@ -22,10 +28,13 @@ function perimeter_help($route_name, RouteMatchInterface $route_match) { } } -function perimeter_honeypot_reject($form_id, $uid, $type){ +/** + * Implements hook_honeypot_reject(). + */ +function perimeter_honeypot_reject($form_id, $uid, $type) { // Honeypot might remove the uid param at some point later. $uid = \Drupal::currentUser()->id(); - if($uid != 1 && ($type=='honeypot_time' && $form_id != 'user_login_form')){ + if ($uid != 1 && ($type == 'honeypot_time' && $form_id != 'user_login_form')) { $ip = \Drupal::request()->getClientIp(); $connection = Database::getConnection(); $banManager = new BanIpManager($connection);