NEW : redirect after connection in login page

This commit is contained in:
Nicolas Domenech 2021-11-05 16:02:24 +01:00
parent 257fe444af
commit 61d97ccd22
2 changed files with 6 additions and 1 deletions

View File

@ -224,6 +224,11 @@ if (!function_exists('dol_loginfunction')) {
$reshook = $hookmanager->executeHooks('getLoginPageExtraOptions', $parameters); // Note that $action and $object may have been modified by some hooks.
$moreloginextracontent = $hookmanager->resPrint;
//Redirect after connection
$parameters = array('entity' => GETPOST('entity', 'int'));
$reshook = $hookmanager->executeHooks('redirectAfterConnection', $parameters); // Note that $action and $object may have been modified by some hooks.
$php_self = $hookmanager->resPrint;
// Login
$login = (!empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username", "alpha") ? GETPOST("username", "alpha") : $demologin));
$password = $demopassword;

View File

@ -57,7 +57,7 @@ if (!empty($conf->dol_use_jmobile)) {
$conf->use_javascript_ajax = 1;
}
$php_self = dol_escape_htmltag($_SERVER['PHP_SELF']);
$php_self = empty($php_self) ? dol_escape_htmltag($_SERVER['PHP_SELF']) : $php_self;
$php_self .= dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]) : '';
if (!preg_match('/mainmenu=/', $php_self)) {
$php_self .= (preg_match('/\?/', $php_self) ? '&' : '?').'mainmenu=home';