Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3174996
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
drupal-3174996
Commits
36e4c77f
Commit
36e4c77f
authored
12 years ago
by
catch
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#1161486
by sun: Follow-up for move IP blocking into its own module.
parent
1f86ba60
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/modules/ban/ban.module
+2
-2
2 additions, 2 deletions
core/modules/ban/ban.module
sites/default/default.settings.php
+4
-8
4 additions, 8 deletions
sites/default/default.settings.php
with
6 additions
and
10 deletions
core/modules/ban/ban.module
+
2
−
2
View file @
36e4c77f
...
...
@@ -83,7 +83,7 @@ function ban_is_denied($ip) {
// Because this function is called on every page request, we first check
// for an array of IP addresses in settings.php before querying the
// database.
$blocked_ips
=
variable_get
(
'b
locked
_ips'
);
$blocked_ips
=
variable_get
(
'b
an
_ips'
);
if
(
isset
(
$blocked_ips
)
&&
is_array
(
$blocked_ips
))
{
$denied
=
in_array
(
$ip
,
$blocked_ips
);
}
...
...
@@ -148,7 +148,7 @@ function ban_action_info() {
*/
function
ban_ip_action
()
{
$ip
=
ip_address
();
db_insert
(
'b
locked
_ip
s
'
)
db_insert
(
'b
an
_ip'
)
->
fields
(
array
(
'ip'
=>
$ip
))
->
execute
();
watchdog
(
'action'
,
'Banned IP address %ip'
,
array
(
'%ip'
=>
$ip
));
...
...
This diff is collapsed.
Click to expand it.
sites/default/default.settings.php
+
4
−
8
View file @
36e4c77f
...
...
@@ -476,11 +476,10 @@
# );
/**
*
* IP blocking:
* IP blocking (Ban module).
*
* To bypass database queries for denied IP addresses, use this setting.
*
Drupal
queries the {b
locked
_ip
s
} table by default on every page request
*
Ban module
queries the {b
an
_ip} table by default on every page request
* for both authenticated and anonymous users. This allows the system to
* block IP addresses from within the administrative interface and before any
* modules are loaded. However on high traffic websites you may want to avoid
...
...
@@ -489,14 +488,11 @@
*
* If using this setting, you will need to add back any IP addresses which
* you may have blocked via the administrative interface. Each element of this
* array represents a blocked IP address. Uncommenting the array and leaving it
* empty will have the effect of disabling IP blocking on your site.
* array represents a blocked IP address.
*
* Remove the leading hash signs to enable.
*/
# $conf['blocked_ips'] = array(
# 'a.b.c.d',
# );
# $conf['ban_ips'][] = 'a.b.c.d';
/**
* Fast 404 pages:
...
...
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