Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 51c2fa5

Browse files
committed
Add an option to disable the bruteForce test (and thus the Captcha)
1 parent f3f8f7a commit 51c2fa5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

core/src/core/classes/class.AuthService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ public static function checkBruteForceLogin(&$loginArray)
191191
} else $login = array("count"=>1, "time"=>time());
192192
$loginArray[$serverAddress] = $login;
193193
if ($login["count"] > 3) {
194-
if (AJXP_SERVER_DEBUG) {
195-
AJXP_Logger::debug("DEBUG : IGNORING BRUTE FORCE ATTEMPTS!");
194+
if (AJXP_SERVER_DEBUG || ConfService::getCoreConf("DISABLE_BRUTE_FORCE_CHECK", "auth") === true) {
195+
AJXP_Logger::debug("Warning: failed login 3 time for $login from address $serverAddress! Captcha is disabled.");
196196
return true;
197197
}
198198
return FALSE;

core/src/plugins/core.auth/manifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<global_param name="SECURE_LOGIN_FORM" group="CONF_MESSAGE[Login Form]" type="boolean" label="CONF_MESSAGE[Secure Login Form]" description="CONF_MESSAGE[Raise the security of the login form by disabling autocompletion and remember me feature]" mandatory="true" default="false" expose="true"/>
1616
<global_param name="ENABLE_FORGOT_PASSWORD" group="CONF_MESSAGE[Login Form]" type="boolean" label="CONF_MESSAGE[Enable Forgot Password]" description="CONF_MESSAGE[Add a Forgot Password link at the bottom of the login form]" mandatory="true" default="false" expose="true"/>
1717
<global_param name="FORGOT_PASSWORD_ACTION" group="CONF_MESSAGE[Login Form]" type="string" label="CONF_MESSAGE[Forgot Password Action]" description="CONF_MESSAGE[Action to trigger when clicking on Forgot Password]" mandatory="true" default="reset-password-ask" expose="true"/>
18+
<global_param name="DISABLE_BRUTE_FORCE_CHECK" group="CONF_MESSAGE[Login Form]" type="boolean" label="CONF_MESSAGE[Disable Brute Force Check (Captcha)]" description="CONF_MESSAGE[Disable the check of failed login attempts, will disable the Captcha display]" default="false"/>
1819
<global_param type="plugin_instance:auth" name="MASTER_INSTANCE_CONFIG" group="CONF_MESSAGE[Main Instance]" label="CONF_MESSAGE[Instance Type]" description="CONF_MESSAGE[Choose the configuration plugin]" mandatory="true" default="auth.serial"/>
1920

2021
<global_param group="CONF_MESSAGE[Secondary Instance (optional)]" name="MULTI_MODE" type="group_switch:multimode" label="CONF_MESSAGE[Mode]" description="CONF_MESSAGE[Master/slave will assume that the master is read-only, and the slave is a local alternative to allow sharing features. User Choice will allow the user to manually choose its authentification method at startup.]" mandatory="true" default="MASTER_SLAVE"/>

0 commit comments

Comments
 (0)