in phpmaker 2025 if i use LDAP authentication as if the event function User_LoggingIn(string $userName, string &$password): bool
does not work.
i have a table with all the users who can access. i want to verify before logging in that the user is actually enabled otherwise the message is returned that informs the user that he is not enabled. i tried to assign the username to a session and then print it but the session, after the login, remains null while in the previous version it is populated with what is written in the username.
You can reproduce the problem using ldap authentication, you will notice that the values are not passed to the User_LoggingIn function
function User_LoggingIn(string $userName, string &$password): bool
{
// Enter your code here
// To cancel, set return value to false
$userName = trim(strtolower($userName));
$a = $userName;
$_SESSION["prova"] = $a;
if ($a == "administrator") {
return true;
} else {
$_SESSION["mess"] = "unauthorized user";
$myCount2 = ExecuteScalar(
"SELECT COUNT(*) FROM autorizzazioneutente WHERE utenza='$a' and disabilita=false"
);
if ($myCount2 > 0) {
$_SESSION["user"] = $userName;
$_SESSION["pass"] = $password;
$_SESSION["OK"] = 0;
$_SESSION["OKPEC"] = 0;
$_SESSION["annorapp"] = 0;
return true;
} else {
$this->setFailureMessage($_SESSION["mess"]);
return false;
}
}
}