New module part webportallogin to allow login method definition by external modules in Dolibarr webportal (#36037)

* New module part webportallogin to allow login method definition by external modules in Dolibarr webportal

* Update webportal.main.inc.php

add WEBPORTAL_LOGIN_BY_MODULE to enable disable login by modules

* Fix condition check for web portal login module

---------

Co-authored-by: abb <contact@ab1consult.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Bahfir Abbes 2025-11-01 02:46:52 +01:00 committed by GitHub
parent a2c1bc77c2
commit f2b0873e26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -133,7 +133,13 @@ if (!defined('WEBPORTAL_NOREQUIRETRAN') || (!defined('WEBPORTAL_NOLOGIN') && !em
/*
* Phase authentication / login
*/
if (!defined('WEBPORTAL_NOLOGIN') && !empty($context->controllerInstance->accessNeedLoggedUser)) {
if (getDolGlobalInt('WEBPORTAL_LOGIN_BY_MODULE') && !empty($conf->modules_parts['webportallogin']) && is_array($conf->modules_parts['webportallogin'])) {
foreach ($conf->modules_parts['webportallogin'] as $module => $file) {
$path=dol_buildpath("/$module/$file");
include_once $path;
break;
}
} elseif (!defined('WEBPORTAL_NOLOGIN') && !empty($context->controllerInstance->accessNeedLoggedUser)) {
$error = 0;
// Hooks for security access