diff --git a/src/main/java/org/olat/admin/user/delete/service/UserDeletionManager.java b/src/main/java/org/olat/admin/user/delete/service/UserDeletionManager.java index ab1556375430f790f2146240a4b696990c2c7d51..5e999f2a4ff05cbc9bd03cbd1a56a780fd9ff7e9 100644 --- a/src/main/java/org/olat/admin/user/delete/service/UserDeletionManager.java +++ b/src/main/java/org/olat/admin/user/delete/service/UserDeletionManager.java @@ -63,12 +63,12 @@ import org.olat.core.util.mail.MailBundle; import org.olat.core.util.mail.MailManager; import org.olat.core.util.mail.MailTemplate; import org.olat.core.util.mail.MailerResult; +import org.olat.core.util.session.UserSessionManager; import org.olat.properties.Property; import org.olat.properties.PropertyManager; import org.olat.registration.RegistrationManager; import org.olat.registration.TemporaryKey; import org.olat.repository.RepositoryDeletionModule; -import org.olat.resource.accesscontrol.provider.auto.AutoAccessManager; import org.olat.user.UserDataDeletable; import org.olat.user.UserManager; import org.olat.user.propertyhandlers.UserPropertyHandler; @@ -111,7 +111,7 @@ public class UserDeletionManager extends BasicManager { @Autowired private MailManager mailManager; @Autowired - private AutoAccessManager autoAccessManager; + private UserSessionManager userSessionManager; @Autowired private AuthenticationHistoryDAO suthenticationHistoryDao; @Autowired @@ -269,6 +269,9 @@ public class UserDeletionManager extends BasicManager { */ public void deleteIdentity(Identity identity) { logInfo("Start deleteIdentity for identity=" + identity); + + //logout + userSessionManager.signOffAndClearAll(identity); String newName = getBackupStringWithDate(identity.getName()); diff --git a/src/main/java/org/olat/core/util/session/UserSessionManager.java b/src/main/java/org/olat/core/util/session/UserSessionManager.java index 4305cb088c79dd4d6d675566b5c770756f5124e6..9ae2d4fa8da66ebaed441d17d036692aee402b66 100644 --- a/src/main/java/org/olat/core/util/session/UserSessionManager.java +++ b/src/main/java/org/olat/core/util/session/UserSessionManager.java @@ -28,11 +28,13 @@ import java.util.Set; import java.util.TreeSet; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; import javax.annotation.PostConstruct; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; +import org.olat.basesecurity.IdentityRef; import org.olat.core.commons.persistence.DB; import org.olat.core.gui.control.Disposable; import org.olat.core.gui.control.Event; @@ -328,6 +330,21 @@ public class UserSessionManager implements GenericEventListener { } } + /** + * The method will logout the specified user from all of its + * session, UI, WebDAV, REST... + * @param identity + */ + public void signOffAndClearAll(IdentityRef identity) { + List<UserSession> userSessions = authUserSessions.stream() + .filter(userSession -> userSession.getIdentity() != null && userSession.getIdentity().getKey().equals(identity.getKey())) + .collect(Collectors.toList()); + for(UserSession userSession:userSessions) { + internSignOffAndClear(userSession); + dbInstance.commit(); + } + } + /** * called to make sure the current authenticated user (if there is one at all) * is cleared and signed off. This method is firing the SignOnOffEvent Multiuserevent. diff --git a/src/main/java/org/olat/modules/portfolio/ui/shared/SharedItemsOverviewController.java b/src/main/java/org/olat/modules/portfolio/ui/shared/SharedItemsOverviewController.java index 8ca7bd72c8f75aee8e57036e2b30018546692cd8..bde008b48e7f90f9556f4e880338bcfe5b9f93ca 100644 --- a/src/main/java/org/olat/modules/portfolio/ui/shared/SharedItemsOverviewController.java +++ b/src/main/java/org/olat/modules/portfolio/ui/shared/SharedItemsOverviewController.java @@ -107,6 +107,11 @@ public class SharedItemsOverviewController extends BasicController implements Ac List<ContextEntry> subEntries = entries.subList(1, entries.size()); doOpenBinders(ureq).activate(ureq, subEntries, entries.get(0).getTransientState()); segmentView.select(bindersLink); + } else if("Binder".equalsIgnoreCase(name)) { + doOpenBinders(ureq).activate(ureq, entries, state); + segmentView.select(bindersLink); + } else { + activateCold(ureq); } } }