Skip to content
Snippets Groups Projects
Commit 24fde58d authored by srosse's avatar srosse
Browse files

OO-3447: filter the permanent user in the delete process of the LDAP administration

parent f6f5409e
No related branches found
No related tags found
No related merge requests found
......@@ -432,6 +432,11 @@ public class LDAPLoginManagerImpl implements LDAPLoginManager, GenericEventListe
SecurityGroup secGroup = securityManager.findSecurityGroupByName(LDAPConstants.SECURITY_GROUP_LDAP);
for (Identity identity: identityList) {
if(Identity.STATUS_PERMANENT.equals(identity.getStatus())) {
log.audit(identity.getKey() + " was not deleted because is status is permanent.");
continue;
}
securityManager.removeIdentityFromSecurityGroup(identity, secGroup);
userDeletionManager.deleteIdentity(identity);
dbInstance.intermediateCommit();
......
......@@ -21,6 +21,7 @@ package org.olat.ldap.ui;
import java.text.DateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import javax.naming.NamingException;
......@@ -174,6 +175,15 @@ public class LDAPAdminController extends BasicController implements GenericEvent
showError("delete.error.connection.close");
logError("Could not close LDAP connection on manual delete sync", e);
}
if (identitiesToDelete != null) {
for(Iterator<Identity> it=identitiesToDelete.iterator(); it.hasNext(); ) {
if(Identity.STATUS_PERMANENT.equals(it.next().getStatus())) {
it.remove();
}
}
}
if (identitiesToDelete != null && identitiesToDelete.size() != 0) {
hasIdentitiesToDelete = true;
/*
......@@ -184,6 +194,7 @@ public class LDAPAdminController extends BasicController implements GenericEvent
* wizard finish callback called after "finish" is called
*/
StepRunnerCallback finishCallback = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl control, StepsRunContext runContext) {
hasIdentitiesToDeleteAfterRun = ((Boolean) runContext.get("hasIdentitiesToDelete")).booleanValue();
if (hasIdentitiesToDeleteAfterRun) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment