Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
perimeter
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
perimeter
Commits
4bfec6d9
Commit
4bfec6d9
authored
1 year ago
by
Joshua Sedler
Browse files
Options
Downloads
Patches
Plain Diff
Fix phpcs issues
parent
c156cb69
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!19
Fix phpcs issues
Pipeline
#74843
passed
1 year ago
Stage: build
Stage: validate
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+2
-2
2 additions, 2 deletions
README.md
perimeter.module
+12
-3
12 additions, 3 deletions
perimeter.module
with
14 additions
and
5 deletions
README.md
+
2
−
2
View file @
4bfec6d9
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
perimeter.module
+
12
−
3
View file @
4bfec6d9
<?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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment