mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-12-05 13:53:34 +00:00
Merge branch 'seeddms-6.0.x' into seeddms-6.1.x
This commit is contained in:
commit
bc03ccaeea
|
|
@ -35,7 +35,7 @@ class SeedDMS_Controller_Login extends SeedDMS_Controller_Common {
|
|||
$dms = $this->params['dms'];
|
||||
$settings = $this->params['settings'];
|
||||
$session = $this->params['session'];
|
||||
$authenticator = $this->params['authenticator'];
|
||||
$sesstheme = $this->params['sesstheme'];
|
||||
$source = isset($this->params['source']) ? $this->params['source'] : '';
|
||||
$sesstheme = $this->getParam('sesstheme');
|
||||
$referuri = $this->getParam('referuri');
|
||||
|
|
@ -245,17 +245,15 @@ class SeedDMS_Controller_Login extends SeedDMS_Controller_Common {
|
|||
*/
|
||||
if(!$user && $settings->_enableGuestLogin && (int) $settings->_guestID) {
|
||||
$guestUser = $dms->getUser((int) $settings->_guestID);
|
||||
if(!$guestUser) {
|
||||
$this->setErrorMsg("login_error_text");
|
||||
return false;
|
||||
}
|
||||
if(($login != $guestUser->getLogin())) {
|
||||
if ((!isset($pwd) || strlen($pwd)==0)) {
|
||||
$this->setErrorMsg("login_error_text");
|
||||
return false;
|
||||
if($guestUser) {
|
||||
if(($login != $guestUser->getLogin())) {
|
||||
if ((!isset($pwd) || strlen($pwd)==0)) {
|
||||
$this->setErrorMsg("login_error_text");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$user = $guestUser;
|
||||
}
|
||||
} else {
|
||||
$user = $guestUser;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -264,7 +262,7 @@ class SeedDMS_Controller_Login extends SeedDMS_Controller_Common {
|
|||
* return false and if the hook doesn't care at all, if must return null.
|
||||
*/
|
||||
if(!$user) {
|
||||
$user = $this->callHook('authenticate');
|
||||
$user = $this->callHook('authenticate', $source);
|
||||
if(false === $user) {
|
||||
if(empty($this->errormsg))
|
||||
$this->setErrorMsg("authentication_failed");
|
||||
|
|
@ -294,6 +292,9 @@ class SeedDMS_Controller_Login extends SeedDMS_Controller_Common {
|
|||
require_once("../inc/inc.ClassLdapAuthentication.php");
|
||||
$authobj = new SeedDMS_LdapAuthentication($dms, $settings);
|
||||
$user = $authobj->authenticate($login, $pwd);
|
||||
if(!$user) {
|
||||
add_log_line('Authentication against LDAP failed for user '.$login);
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
/* Authenticate against SeedDMS database {{{ */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user