login as guest will prevent any other authentication

This commit is contained in:
Uwe Steinmann 2019-01-31 11:22:21 +01:00
parent 8e5e3ec4ea
commit a03288ccf3

View File

@ -71,11 +71,13 @@ class SeedDMS_Controller_Login extends SeedDMS_Controller_Common {
* valid user, if the authentication succeeded. If it fails, it must
* return false and if the hook doesn't care at all, if must return null.
*/
$user = $this->callHook('authenticate');
if(false === $user) {
if(empty($this->errormsg))
$this->setErrorMsg("authentication_failed");
return false;
if(!$user) {
$user = $this->callHook('authenticate');
if(false === $user) {
if(empty($this->errormsg))
$this->setErrorMsg("authentication_failed");
return false;
}
}
/* Deprecated: Run any additional authentication implemented in a hook */
@ -112,6 +114,9 @@ class SeedDMS_Controller_Login extends SeedDMS_Controller_Common {
/* Check for other restrictions which prevent the user from login, though
* the authentication was successfull.
* Checking for a guest login the second time, makes only sense if there are
* more guest users and the login was done with a password and a user name
* unequal to 'guest'.
*/
$userid = $user->getID();
if (($userid == $settings->_guestID) && (!$settings->_enableGuestLogin)) {