Fix LDAP login
This commit is contained in:
19
login.php
19
login.php
@@ -22,6 +22,25 @@ if (empty($user)) {
|
||||
}
|
||||
|
||||
if (!empty($_REQUEST['username']) && !empty($_REQUEST['password'])) {
|
||||
|
||||
if($_REQUEST['username'] != "admin") {
|
||||
if (\Classes\SettingsManager::getInstance()->getSetting("LDAP: Enabled") == "1") {
|
||||
$ldapResp = \Classes\LDAPManager::getInstance()->checkLDAPLogin($_REQUEST['username'], $_REQUEST['password']);
|
||||
if ($ldapResp->getStatus() == \Classes\IceResponse::ERROR) {
|
||||
header("Location:" . CLIENT_BASE_URL . "login.php?f=1");
|
||||
exit();
|
||||
} else {
|
||||
$suser = new \Users\Common\Model\User();
|
||||
$suser->Load("username = ?", array($_REQUEST['username']));
|
||||
if (empty($suser)) {
|
||||
header("Location:" . CLIENT_BASE_URL . "login.php?f=1");
|
||||
exit();
|
||||
}
|
||||
$ssoUserLoaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($_REQUEST['hashedPwd'])) {
|
||||
$_REQUEST['hashedPwd'] = md5($_REQUEST['password']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user