fix doLogin function, which uses the wrong user variable

This commit is contained in:
Uwe Steinmann 2017-12-30 12:39:49 +01:00
parent d1ea639431
commit 4f95d58c4b

View File

@ -152,24 +152,24 @@ function doLogin() { /* {{{ */
$username = $app->request()->post('user'); $username = $app->request()->post('user');
$password = $app->request()->post('pass'); $password = $app->request()->post('pass');
$userobj = $dms->getUserByLogin($username); // $userobj = $dms->getUserByLogin($username);
$user = null; $userobj = null;
/* Authenticate against LDAP server {{{ */ /* Authenticate against LDAP server {{{ */
if (!$user && isset($settings->_ldapHost) && strlen($settings->_ldapHost)>0) { if (!$userobj && isset($settings->_ldapHost) && strlen($settings->_ldapHost)>0) {
require_once("../inc/inc.ClassLdapAuthentication.php"); require_once("../inc/inc.ClassLdapAuthentication.php");
$authobj = new SeedDMS_LdapAuthentication($dms, $settings); $authobj = new SeedDMS_LdapAuthentication($dms, $settings);
$user = $authobj->authenticate($username, $password); $userobj = $authobj->authenticate($username, $password);
} /* }}} */ } /* }}} */
/* Authenticate against SeedDMS database {{{ */ /* Authenticate against SeedDMS database {{{ */
if(!$user) { if(!$userobj) {
require_once("../inc/inc.ClassDbAuthentication.php"); require_once("../inc/inc.ClassDbAuthentication.php");
$authobj = new SeedDMS_DbAuthentication($dms, $settings); $authobj = new SeedDMS_DbAuthentication($dms, $settings);
$user = $authobj->authenticate($username, $password); $userobj = $authobj->authenticate($username, $password);
} /* }}} */ } /* }}} */
if(!$user) { if(!$userobj) {
if(USE_PHP_SESSION) { if(USE_PHP_SESSION) {
unset($_SESSION['userid']); unset($_SESSION['userid']);
} else { } else {