diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/LoginForm.java b/Kitodo/src/main/java/org/kitodo/production/forms/LoginForm.java index 7d7b5fadb10..bd4aee318e2 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/LoginForm.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/LoginForm.java @@ -20,6 +20,9 @@ import javax.faces.context.FacesContext; import javax.inject.Named; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.kitodo.data.database.beans.Client; import org.kitodo.data.database.beans.User; import org.kitodo.data.database.exceptions.DAOException; import org.kitodo.data.exceptions.DataException; @@ -32,9 +35,9 @@ @Named("LoginForm") @SessionScoped public class LoginForm implements Serializable { + private static final Logger logger = LogManager.getLogger(LoginForm.class); private User loggedUser; private boolean firstVisit = true; - private static final String INDEXING_PAGE = "system.jsf?tabIndex="; private static final String DESKTOP_VIEW = "desktop.jsf"; private final SecurityAccessService securityAccessService = ServiceManager.getSecurityAccessService(); @@ -100,20 +103,13 @@ public void performPostLoginChecks() throws DataException, DAOException, IOExcep ExternalContext context = FacesContext.getCurrentInstance().getExternalContext(); SessionClientController controller = new SessionClientController(); - if (ServiceManager.getSecurityAccessService().hasAuthorityToEditIndex()) { - if (controller.getAvailableClientsOfCurrentUser().size() > 1 - && Objects.isNull(controller.getCurrentSessionClient())) { - controller.showClientSelectDialog(); - } else { - redirect(context); - } + int availableClients = controller.getAvailableClientsOfCurrentUser().size(); + Client currentClient = controller.getCurrentSessionClient(); + logger.debug("availableClients:" + availableClients + ", currentClient: " + currentClient); + if (availableClients > 1 && Objects.isNull(currentClient)) { + controller.showClientSelectDialog(); } else { - if (controller.getAvailableClientsOfCurrentUser().size() > 1 - && Objects.isNull(controller.getCurrentSessionClient())) { - controller.showClientSelectDialog(); - } else { - redirect(context); - } + redirect(context); } }