mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUAC-586: Ensure parent is properly set on LDAP connections.
This commit is contained in:
@@ -42,6 +42,11 @@ import org.glyptodon.guacamole.net.auth.UserContext;
|
||||
*/
|
||||
public class LDAPAuthenticationProvider implements AuthenticationProvider {
|
||||
|
||||
/**
|
||||
* The identifier reserved for the root connection group.
|
||||
*/
|
||||
public static final String ROOT_CONNECTION_GROUP = "ROOT";
|
||||
|
||||
/**
|
||||
* Injector which will manage the object graph of this authentication
|
||||
* provider.
|
||||
|
@@ -31,6 +31,7 @@ import com.novell.ldap.LDAPSearchResults;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import net.sourceforge.guacamole.net.auth.ldap.LDAPAuthenticationProvider;
|
||||
import org.glyptodon.guacamole.auth.ldap.ConfigurationService;
|
||||
import org.glyptodon.guacamole.auth.ldap.EscapingService;
|
||||
import org.glyptodon.guacamole.GuacamoleException;
|
||||
@@ -153,7 +154,9 @@ public class ConnectionService {
|
||||
|
||||
// Store connection using cn for both identifier and name
|
||||
String name = cn.getStringValue();
|
||||
connections.put(name, new SimpleConnection(name, name, config));
|
||||
Connection connection = new SimpleConnection(name, name, config);
|
||||
connection.setParentIdentifier(LDAPAuthenticationProvider.ROOT_CONNECTION_GROUP);
|
||||
connections.put(name, connection);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -26,6 +26,7 @@ import com.google.inject.Inject;
|
||||
import com.novell.ldap.LDAPConnection;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import net.sourceforge.guacamole.net.auth.ldap.LDAPAuthenticationProvider;
|
||||
import org.glyptodon.guacamole.auth.ldap.connection.ConnectionService;
|
||||
import org.glyptodon.guacamole.GuacamoleException;
|
||||
import org.glyptodon.guacamole.form.Form;
|
||||
@@ -56,11 +57,6 @@ public class UserContext implements org.glyptodon.guacamole.net.auth.UserContext
|
||||
*/
|
||||
private final Logger logger = LoggerFactory.getLogger(UserContext.class);
|
||||
|
||||
/**
|
||||
* The identifier reserved for the root connection group.
|
||||
*/
|
||||
private static final String ROOT_CONNECTION_GROUP = "ROOT";
|
||||
|
||||
/**
|
||||
* Service for retrieving Guacamole connections from the LDAP server.
|
||||
*/
|
||||
@@ -141,7 +137,8 @@ public class UserContext implements org.glyptodon.guacamole.net.auth.UserContext
|
||||
|
||||
// Root group contains only connections
|
||||
rootGroup = new SimpleConnectionGroup(
|
||||
ROOT_CONNECTION_GROUP, ROOT_CONNECTION_GROUP,
|
||||
LDAPAuthenticationProvider.ROOT_CONNECTION_GROUP,
|
||||
LDAPAuthenticationProvider.ROOT_CONNECTION_GROUP,
|
||||
connectionDirectory.getIdentifiers(),
|
||||
Collections.<String>emptyList()
|
||||
);
|
||||
|
Reference in New Issue
Block a user