Skip to content
Snippets Groups Projects
Commit 4bfec6d9 authored by Joshua Sedler's avatar Joshua Sedler :cartwheel_tone2:
Browse files

Fix phpcs issues

parent c156cb69
No related branches found
No related tags found
1 merge request!19Fix phpcs issues
Pipeline #74843 passed
...@@ -33,8 +33,8 @@ This module requires no modules outside of Drupal core. ...@@ -33,8 +33,8 @@ This module requires no modules outside of Drupal core.
## Installation ## Installation
Install as you would normally install a contributed Drupal module. For further information, see Install as you would normally install a contributed Drupal module. For further
[Installing Drupal Modules](https://www.drupal.org/docs/extending-drupal/installing-drupal-modules). information, see [Installing Drupal Modules](https://www.drupal.org/docs/extending-drupal/installing-drupal-modules).
## Configuration ## Configuration
......
<?php <?php
use Drupal\Core\Database\Database;
/**
* @file
* The perimeter module file.
*/
use Drupal\ban\BanIpManager; use Drupal\ban\BanIpManager;
use Drupal\Component\Utility\Xss; use Drupal\Component\Utility\Xss;
use Drupal\Core\Database\Database;
use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Routing\RouteMatchInterface;
/** /**
...@@ -22,10 +28,13 @@ function perimeter_help($route_name, RouteMatchInterface $route_match) { ...@@ -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. // Honeypot might remove the uid param at some point later.
$uid = \Drupal::currentUser()->id(); $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(); $ip = \Drupal::request()->getClientIp();
$connection = Database::getConnection(); $connection = Database::getConnection();
$banManager = new BanIpManager($connection); $banManager = new BanIpManager($connection);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment