Commit 49628cb9 authored by Dave Cridland's avatar Dave Cridland Committed by GitHub

Merge pull request #848 from GregDThomas/hybrid-ldap-admin

Ensure that LDAP configuration options are appropriately displayed
parents 99033b18 5d9f2052
......@@ -131,6 +131,17 @@ public class AuthFactory {
return c.isInstance(authProvider);
}
/**
* Indicates if the currently-installed AuthProvider is the HybridAuthProvider supporting a specific class.
*
* @param clazz the class to check
* @return {@code true} if the currently-installed AuthProvider is a HybridAuthProvider that supports an instance of clazz, otherwise {@code false}.
*/
public static boolean isProviderHybridInstanceOf(Class<? extends AuthProvider> clazz) {
return authProvider instanceof HybridAuthProvider &&
((HybridAuthProvider) authProvider).isProvider(clazz);
}
/**
* Returns true if the currently installed {@link AuthProvider} supports password
* retrieval. Certain implementation utilize password hashes and other authentication
......@@ -301,4 +312,4 @@ public class AuthFactory {
public static String getStoredKey(String username) throws UnsupportedOperationException, UserNotFoundException {
return authProvider.getStoredKey(username);
}
}
\ No newline at end of file
}
......@@ -249,4 +249,10 @@ public class HybridAuthProvider implements AuthProvider {
public String getStoredKey(String username) throws UnsupportedOperationException, UserNotFoundException {
throw new UnsupportedOperationException();
}
}
\ No newline at end of file
boolean isProvider(final Class<? extends AuthProvider> clazz) {
return (primaryProvider != null && clazz.isAssignableFrom(primaryProvider.getClass()))
|| (secondaryProvider != null && clazz.isAssignableFrom(secondaryProvider.getClass()))
||(tertiaryProvider != null && clazz.isAssignableFrom(tertiaryProvider.getClass()));
}
}
<%@ page import="org.jivesoftware.util.JiveGlobals" %>
<%@ page import="org.jivesoftware.openfire.ldap.LdapManager" %>
<%@ page import="org.jivesoftware.openfire.auth.AuthFactory" %>
<%@ page import="org.jivesoftware.openfire.ldap.LdapAuthProvider" %>
<%--
-
- Copyright (C) 2005-2008 Jive Software. All rights reserved.
......@@ -36,8 +38,8 @@
</head>
<body>
<%
boolean isLDAP = "org.jivesoftware.openfire.ldap.LdapAuthProvider".equals(
JiveGlobals.getProperty("provider.auth.className"));
boolean isLDAP = "org.jivesoftware.openfire.ldap.LdapAuthProvider".equals(JiveGlobals.getProperty("provider.auth.className"))
|| AuthFactory.isProviderHybridInstanceOf(LdapAuthProvider.class);
%>
<p>
<fmt:message key="profile-settings.info"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment