Merge pull request #15709 from hregis/fix_add_hook_for_security

NEW add hook "loginCheckSecurityAccess" (eg for external captcha)
This commit is contained in:
Laurent Destailleur 2020-12-08 23:08:17 +01:00 committed by GitHub
commit a92ad1484a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -562,6 +562,13 @@ if (!defined('NOLOGIN'))
}
}
// Hooks for security access
$action = '';
$hookmanager->initHooks(array('login'));
$parameters = array('dol_authmode'=>$dol_authmode);
$reshook = $hookmanager->executeHooks('loginCheckSecurityAccess', $parameters, $user, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) $error++;
// Verification security graphic code
if (GETPOST("username", "alpha", 2) && !empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA) && !isset($_SESSION['dol_bypass_antispam']))
{