Commit 1b48b48d authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[JM-1292] Fixed issue with security auditor not being initialized properly. ...

[JM-1292] Fixed issue with security auditor not being initialized properly.  Also fixed related LockOutManager issue.
Group parsing is more robust.  (doesn't lose the entire rest of the group if it can't resolve a user in a group)

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10042 b35dd754-fafc-0310-a699-88a17e54d16e
parent 63031c25
......@@ -279,7 +279,7 @@ public class LdapGroupProvider implements GroupProvider {
private Group processGroup(LdapContext ctx, Attributes a) throws NamingException {
XMPPServer server = XMPPServer.getInstance();
String serverName = server.getServerInfo().getXMPPDomain();
// Build 3 groups.
// Build `3 groups.
// group 1: uid=
// group 2: rest of the text until first comma
// group 3: rest of the text
......@@ -338,9 +338,10 @@ public class LdapGroupProvider implements GroupProvider {
NamingEnumeration usrAnswer = ctx.search("",
userDNPart, searchControls);
if (usrAnswer != null && usrAnswer.hasMoreElements()) {
username = (String) ((SearchResult) usrAnswer.next())
.getAttributes().get(
manager.getUsernameField()).get();
Attribute usernameAttr = ((SearchResult)usrAnswer.next()).getAttributes().get(manager.getUsernameField());
if (usernameAttr != null) {
username = (String)usernameAttr.get();
}
}
// Close the enumeration.
usrAnswer.close();
......
......@@ -35,8 +35,8 @@ import java.util.Date;
public class LockOutManager {
// Wrap this guy up so we can mock out the LockOutManager class.
private static final class LockOutManagerContainer {
private static final LockOutManager instance = new LockOutManager();
private static class LockOutManagerContainer {
private static LockOutManager instance = new LockOutManager();
}
/**
......@@ -48,7 +48,7 @@ public class LockOutManager {
* @return the current LockOutProvider.
*/
public static LockOutProvider getLockOutProvider() {
return provider;
return LockOutManagerContainer.instance.provider;
}
/**
......@@ -62,7 +62,7 @@ public class LockOutManager {
/* Cache of locked out accounts */
private Cache<String,LockOutFlag> lockOutCache;
private static LockOutProvider provider = null;
private LockOutProvider provider;
/**
* Constructs a LockOutManager, setting up it's cache, propery listener, and setting up the provider.
......@@ -101,7 +101,7 @@ public class LockOutManager {
* Initializes the server's lock out provider, based on configuration and defaults to
* DefaultLockOutProvider if the specified provider is not valid or not specified.
*/
private static void initProvider() {
private void initProvider() {
String className = JiveGlobals.getXMLProperty("provider.lockout.className",
"org.jivesoftware.openfire.lockout.DefaultLockOutProvider");
// Check if we need to reset the provider class
......
......@@ -34,8 +34,8 @@ import java.util.Date;
public class SecurityAuditManager {
// Wrap this guy up so we can mock out the SecurityAuditManager class.
private static final class SecurityAuditManagerContainer {
private static final SecurityAuditManager instance = new SecurityAuditManager();
private static class SecurityAuditManagerContainer {
private static SecurityAuditManager instance = new SecurityAuditManager();
}
/**
......@@ -47,7 +47,7 @@ public class SecurityAuditManager {
* @return the current SecurityAuditProvider.
*/
public static SecurityAuditProvider getSecurityAuditProvider() {
return provider;
return SecurityAuditManagerContainer.instance.provider;
}
/**
......@@ -59,7 +59,7 @@ public class SecurityAuditManager {
return SecurityAuditManagerContainer.instance;
}
private static SecurityAuditProvider provider = null;
private SecurityAuditProvider provider;
/**
* Constructs a SecurityAuditManager, setting up the provider, and a listener.
......@@ -95,7 +95,7 @@ public class SecurityAuditManager {
* Initializes the server's security audit provider, based on configuration and defaults to
* DefaultSecurityAuditProvider if the specified provider is not valid or not specified.
*/
private static void initProvider() {
private void initProvider() {
String className = JiveGlobals.getXMLProperty("provider.securityAudit.className",
"org.jivesoftware.openfire.security.DefaultSecurityAuditProvider");
// Check if we need to reset the provider class
......
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