#44 fixed login issue

# Conflicts:
#	lam/HISTORY
This commit is contained in:
Roland Gruber 2018-01-16 18:31:52 +01:00
parent 24dfcd1f4a
commit 93a409babd
1 changed files with 7 additions and 7 deletions

View File

@ -170,12 +170,12 @@ $_SESSION['header'] .= "<meta http-equiv=\"pragma\" content=\"no-cache\">\n <me
/** /**
* Displays the login window. * Displays the login window.
* *
* @param LAMConfig $config_object current active configuration
* @param LAMCfgMain $cfgMain main configuration
* @param \LAM\ENV\LAMLicenseValidator $licenseValidator license validator * @param \LAM\ENV\LAMLicenseValidator $licenseValidator license validator
* @param string $error_message error message to display * @param string $error_message error message to display
*/ */
function display_LoginPage(LAMConfig $config_object, LAMCfgMain $cfgMain, $licenseValidator, $error_message) { function display_LoginPage($licenseValidator, $error_message) {
$config_object = $_SESSION['config'];
$cfgMain = $_SESSION["cfgMain"];
logNewMessage(LOG_DEBUG, "Display login page"); logNewMessage(LOG_DEBUG, "Display login page");
// generate 256 bit key and initialization vector for user/passwd-encryption // generate 256 bit key and initialization vector for user/passwd-encryption
if(function_exists('openssl_random_pseudo_bytes') && ($cfgMain->encryptSession == 'true')) { if(function_exists('openssl_random_pseudo_bytes') && ($cfgMain->encryptSession == 'true')) {
@ -489,7 +489,7 @@ if(isset($_POST['checklogin'])) {
if($_POST['passwd'] == "") { if($_POST['passwd'] == "") {
logNewMessage(LOG_DEBUG, "Empty password for login"); logNewMessage(LOG_DEBUG, "Empty password for login");
$error_message = _("Empty password submitted. Please try again."); $error_message = _("Empty password submitted. Please try again.");
display_LoginPage($_SESSION['config'], $_SESSION["cfgMain"], $licenseValidator, $error_message); // Empty password submitted. Return to login page. display_LoginPage($licenseValidator, $error_message); // Empty password submitted. Return to login page.
exit(); exit();
} }
$username = $_POST['username']; $username = $_POST['username'];
@ -547,7 +547,7 @@ if(isset($_POST['checklogin'])) {
$error_message = $searchError; $error_message = $searchError;
logNewMessage(LOG_ERR, 'User ' . $username . ' (' . $clientSource . ') failed to log in. ' . $searchError . ''); logNewMessage(LOG_ERR, 'User ' . $username . ' (' . $clientSource . ') failed to log in. ' . $searchError . '');
$searchLDAP->close(); $searchLDAP->close();
display_LoginPage($_SESSION['config'], $_SESSION["cfgMain"], $licenseValidator, $error_message); display_LoginPage($licenseValidator, $error_message);
exit(); exit();
} }
$searchLDAP->close(); $searchLDAP->close();
@ -600,11 +600,11 @@ if(isset($_POST['checklogin'])) {
$error_message = _("LDAP error, server says:") . "\n<br>($result) " . ldap_err2str($result); $error_message = _("LDAP error, server says:") . "\n<br>($result) " . ldap_err2str($result);
logNewMessage(LOG_ERR, 'User ' . $username . ' (' . $clientSource . ') failed to log in (LDAP error: ' . ldap_err2str($result) . ').'); logNewMessage(LOG_ERR, 'User ' . $username . ' (' . $clientSource . ') failed to log in (LDAP error: ' . ldap_err2str($result) . ').');
} }
display_LoginPage($_SESSION['config'], $_SESSION["cfgMain"], $licenseValidator, $error_message); display_LoginPage($licenseValidator, $error_message);
exit(); exit();
} }
} }
//displays the login window //displays the login window
display_LoginPage($_SESSION["config"], $_SESSION["cfgMain"], $licenseValidator, $error_message); display_LoginPage($licenseValidator, $error_message);
?> ?>