Hi,
i have phprunner 10.5 enterprise build 37251.
I enable Two-factor authentication and it works fine with local users, but i have some users ldap autenticated with code in
before login:
global $conn;
$strSQLExists = "select * from utenti where username='" . $username . "'";
$rsExists = db_query($strSQLExists, $conn);
$data = db_fetch_array($rsExists);
if (!$data) {
$message = "account not exist.";
return false;
}
$_SESSION["ld"] = $data["ldap"];
$_SESSION["ldap"] = $data["ldap"];
if ($data["ldap"] == 'S') { //verify if ldap="S" <<<<<-------- (0)
if ($password != null && trim($password) != '') {
$ad = new adLDAPAuthentication(
array(
'account_suffix' => "MYDOMAIN.IT",
'base_dn' => "dc=MYDOMAIN,dc=IT",
'domaincontrollers' => array(
"192.168.1.xx", "192.168.1.xy"
)
)
);
$authenticated = $ad->authenticate($username, $password);
if ($authenticated) {
Security::loginAs($username, true); <<<<<<<-------------- (1)
header("Location: menu.php"); <<<<<<<---------------(2)
} else {
$message = "Login not valid.";
return false;
}
} else {
$message = "Login not valid/password wrong.";
return false;
}
} else { //ldap
return true;
}// end if field ldap
i have a fleld ldap (0) with "S" for ldap authentication and "N" for local authentication
with ldap authentication the authcode is not required, i think because (1) make login true and (2) redirect to menu.php !
may someone help me to request the authcode even in the case of ldap = "S" ?
Thanks
Fabio