Closed (fixed)
Project:
Login Security
Version:
2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
26 Nov 2020 at 09:18 UTC
Updated:
4 Mar 2026 at 22:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
anybodyComment #3
pearls commentedIs there any plan to support advban module?
Thanks
Comment #4
anybodyI totally agree. Now that ban is also contrib, there should be only one ban module combining both. That would also fix the logical issues... guess it would make sense to discuss in the ban and advban module to join forces now!
Nothing good we can do about here, I think.
Comment #5
orkutmuratyilmazComment #6
anybodyOkay let's do it. Anyone willing to implement a MR?
https://www.drupal.org/project/crowdsec did similar and already supports both: #3553801: Remove dependency on ban module
I guess the implementation there can be used as template!
Comment #7
anybodyComment #8
anybodyComment #11
jiskra commentedI updated the new Ban service with check Protected IP addresses for AdvBan module
Comment #12
jiskra commentedComment #13
anybodyThanks @jiskra That doesn't look bad, please see my comment.
Could we add some information to the README.md of the module to let users know one of both modules is needed?
Furthermore we should add a hook_requirements() check to ensure one of both dependencies is present?
Comment #14
klemendev commentedAny updates on this since 11.3 is out and marks core Ban module as deprecated?
Comment #16
lrwebks commentedFixed your two comments and added the README section, @anybody. Unfortunately, I cannot resolve the threads as I am not maintainer of this module.
Comment #17
anybodyI left a comment. Please test accordingly with only one of the modules present.
Comment #18
anybodyComment #19
lrwebks commentedI have tested the ban functionality with all combinations of modules:
getBanIpManager(), which is why I have surrounded all calls to it with a try blockSo, it should be in a fully working condition now!
Comment #20
anybodyComment #21
klemendev commentedI agree that both modules should be optional
Comment #22
anybodyMy point is: The end-user sees the exception, not the admin... that's the problem.
Then we need a setting to opt-in, which we could set to enabled by default using an update hook, but FALSE for new installations. On hook_install() we could then detect the setting.
Comment #23
lrwebks commented@anybody and I have come to a conclusion about how we want to handle this going forward. We will employ the use of
hook_requirementsto both prevent the module from installing if neither the Ban nor AdvBan modules are present, as well as showing a site status error when the Ban/AdvBan module is uninstalled later.Comment #24
lrwebks commentedImplemented the hook and works as expected now. I will attach screenshots of the installation and status messages, respectively. The messages themselves are still a bit crudely formulated, though. If anyone has a better suggestion for the wording, go ahead!
The rest of the code (including the try blocks) is still necessary, of course, to cover the “uninstall AdvBan while keeping login security” case and not throw any errors in that situation but rather do nothing.
Comment #25
anybody@LRwebks: Some final points.
Re #21 and #23: Correct. Previously ban was a hard dependency and we'll keep the requirement of a ban module. Without that it makes things a lot more complicated and it's the core functionality. Not worth further edge-cases. If anyone REALLY needs it optional, a follow-up can be made by the person. But I don't see really good reasons.
Comment #26
lrwebks commentedComment #27
anybodyThanks @lrwebks let's do it!
Comment #28
anybodyComment #30
anybodyPlease note that RequirementSeverity was introduced in Drupal Core 11.2 so I had to revert that part of the change. See https://www.drupal.org/node/3410939
Comment #31
amjad1233Hi Could this be a solution for site-installs ?