Commit 26da5404 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Fixed setting posixMode property (JM-578).

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3491 b35dd754-fafc-0310-a699-88a17e54d16e
parent e9da992c
...@@ -104,7 +104,9 @@ public class LdapManager { ...@@ -104,7 +104,9 @@ public class LdapManager {
try { try {
this.port = Integer.parseInt(portStr); this.port = Integer.parseInt(portStr);
} }
catch (NumberFormatException nfe) { } catch (NumberFormatException nfe) {
// Ignore.
}
} }
if (JiveGlobals.getXMLProperty("ldap.usernameField") != null) { if (JiveGlobals.getXMLProperty("ldap.usernameField") != null) {
this.usernameField = JiveGlobals.getXMLProperty("ldap.usernameField"); this.usernameField = JiveGlobals.getXMLProperty("ldap.usernameField");
...@@ -123,7 +125,7 @@ public class LdapManager { ...@@ -123,7 +125,7 @@ public class LdapManager {
} }
if (JiveGlobals.getXMLProperty("ldap.connectionPoolEnabled") != null) { if (JiveGlobals.getXMLProperty("ldap.connectionPoolEnabled") != null) {
this.connectionPoolEnabled = Boolean.valueOf( this.connectionPoolEnabled = Boolean.valueOf(
JiveGlobals.getXMLProperty("ldap.connectionPoolEnabled")).booleanValue(); JiveGlobals.getXMLProperty("ldap.connectionPoolEnabled"));
} }
if (JiveGlobals.getXMLProperty("ldap.searchFilter") != null) { if (JiveGlobals.getXMLProperty("ldap.searchFilter") != null) {
this.searchFilter = JiveGlobals.getXMLProperty("ldap.searchFilter"); this.searchFilter = JiveGlobals.getXMLProperty("ldap.searchFilter");
...@@ -158,11 +160,11 @@ public class LdapManager { ...@@ -158,11 +160,11 @@ public class LdapManager {
} }
this.adminPassword = JiveGlobals.getXMLProperty("ldap.adminPassword"); this.adminPassword = JiveGlobals.getXMLProperty("ldap.adminPassword");
this.ldapDebugEnabled = Boolean.valueOf(JiveGlobals.getXMLProperty( this.ldapDebugEnabled = Boolean.valueOf(JiveGlobals.getXMLProperty(
"ldap.debugEnabled")).booleanValue(); "ldap.debugEnabled"));
this.sslEnabled = Boolean.valueOf(JiveGlobals.getXMLProperty( this.sslEnabled = Boolean.valueOf(JiveGlobals.getXMLProperty(
"ldap.sslEnabled")).booleanValue(); "ldap.sslEnabled"));
this.followReferrals = Boolean.valueOf(JiveGlobals.getXMLProperty( this.followReferrals = Boolean.valueOf(JiveGlobals.getXMLProperty(
"ldap.autoFollowReferrals")).booleanValue(); "ldap.autoFollowReferrals"));
this.initialContextFactory = JiveGlobals.getXMLProperty("ldap.initialContextFactory"); this.initialContextFactory = JiveGlobals.getXMLProperty("ldap.initialContextFactory");
if (initialContextFactory != null) { if (initialContextFactory != null) {
try { try {
...@@ -323,7 +325,9 @@ public class LdapManager { ...@@ -323,7 +325,9 @@ public class LdapManager {
// If an alt baseDN is defined, attempt a lookup there. // If an alt baseDN is defined, attempt a lookup there.
if (alternateBaseDN != null) { if (alternateBaseDN != null) {
try { ctx.close(); } try { ctx.close(); }
catch (Exception ignored) { } catch (Exception ignored) {
// Ignore.
}
try { try {
// See if the user authenticates. // See if the user authenticates.
Hashtable<String, Object> env = new Hashtable<String, Object>(); Hashtable<String, Object> env = new Hashtable<String, Object>();
...@@ -366,7 +370,9 @@ public class LdapManager { ...@@ -366,7 +370,9 @@ public class LdapManager {
} }
finally { finally {
try { ctx.close(); } try { ctx.close(); }
catch (Exception ignored) { } catch (Exception ignored) {
// Ignore.
}
} }
return true; return true;
} }
...@@ -488,7 +494,9 @@ public class LdapManager { ...@@ -488,7 +494,9 @@ public class LdapManager {
} }
finally { finally {
try { ctx.close(); } try { ctx.close(); }
catch (Exception ignored) { } catch (Exception ignored) {
// Ignore.
}
} }
} }
...@@ -500,7 +508,7 @@ public class LdapManager { ...@@ -500,7 +508,7 @@ public class LdapManager {
* @return the properly encoded URL for use in as PROVIDER_URL. * @return the properly encoded URL for use in as PROVIDER_URL.
*/ */
private String getProviderURL(String baseDN) { private String getProviderURL(String baseDN) {
String ldapURL = ""; String ldapURL;
try { try {
// Create a correctly-encoded ldap URL for the PROVIDER_URL // Create a correctly-encoded ldap URL for the PROVIDER_URL
ldapURL = "ldap://" + host + ":" + port + "/" + ldapURL = "ldap://" + host + ":" + port + "/" +
...@@ -886,7 +894,7 @@ public class LdapManager { ...@@ -886,7 +894,7 @@ public class LdapManager {
*/ */
public void setPosixMode(boolean posixMode) { public void setPosixMode(boolean posixMode) {
this.posixMode = posixMode; this.posixMode = posixMode;
JiveGlobals.setXMLProperty("ldap.posixEnabled", String.valueOf(posixMode)); JiveGlobals.setXMLProperty("ldap.posixMode", String.valueOf(posixMode));
} }
/** /**
......
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