Commit daac12bd authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Changed to use properties from the XML file.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@231 b35dd754-fafc-0310-a699-88a17e54d16e
parent 92b74a72
...@@ -90,8 +90,8 @@ public class LdapManager { ...@@ -90,8 +90,8 @@ public class LdapManager {
* constructor is private. * constructor is private.
*/ */
private LdapManager() { private LdapManager() {
this.host = JiveGlobals.getProperty("ldap.host"); this.host = JiveGlobals.getXMLProperty("ldap.host");
String portStr = JiveGlobals.getProperty("ldap.port"); String portStr = JiveGlobals.getXMLProperty("ldap.port");
if (portStr != null) { if (portStr != null) {
try { try {
this.port = Integer.parseInt(portStr); this.port = Integer.parseInt(portStr);
...@@ -99,23 +99,23 @@ public class LdapManager { ...@@ -99,23 +99,23 @@ public class LdapManager {
catch (NumberFormatException nfe) { catch (NumberFormatException nfe) {
} }
} }
if (JiveGlobals.getProperty("ldap.usernameField") != null) { if (JiveGlobals.getXMLProperty("ldap.usernameField") != null) {
this.usernameField = JiveGlobals.getProperty("ldap.usernameField"); this.usernameField = JiveGlobals.getXMLProperty("ldap.usernameField");
} }
if (JiveGlobals.getProperty("ldap.baseDN") != null) { if (JiveGlobals.getXMLProperty("ldap.baseDN") != null) {
this.baseDN = JiveGlobals.getProperty("ldap.baseDN"); this.baseDN = JiveGlobals.getXMLProperty("ldap.baseDN");
} }
if (JiveGlobals.getProperty("ldap.nameField") != null) { if (JiveGlobals.getXMLProperty("ldap.nameField") != null) {
this.nameField = JiveGlobals.getProperty("ldap.nameField"); this.nameField = JiveGlobals.getXMLProperty("ldap.nameField");
} }
if (JiveGlobals.getProperty("ldap.emailField") != null) { if (JiveGlobals.getXMLProperty("ldap.emailField") != null) {
this.emailField = JiveGlobals.getProperty("ldap.emailField"); this.emailField = JiveGlobals.getXMLProperty("ldap.emailField");
} }
this.adminDN = JiveGlobals.getProperty("ldap.adminDN"); this.adminDN = JiveGlobals.getXMLProperty("ldap.adminDN");
this.adminPassword = JiveGlobals.getProperty("ldap.adminPassword"); this.adminPassword = JiveGlobals.getXMLProperty("ldap.adminPassword");
this.debugEnabled = "true".equals(JiveGlobals.getProperty("ldap.debugEnabled")); this.debugEnabled = "true".equals(JiveGlobals.getXMLProperty("ldap.debugEnabled"));
this.sslEnabled = "true".equals(JiveGlobals.getProperty("ldap.sslEnabled")); this.sslEnabled = "true".equals(JiveGlobals.getXMLProperty("ldap.sslEnabled"));
String modeStr = JiveGlobals.getProperty("ldap.mode"); String modeStr = JiveGlobals.getXMLProperty("ldap.mode");
if (modeStr != null) { if (modeStr != null) {
try { try {
this.mode = Integer.parseInt(modeStr); this.mode = Integer.parseInt(modeStr);
...@@ -283,7 +283,7 @@ public class LdapManager { ...@@ -283,7 +283,7 @@ public class LdapManager {
*/ */
public void setHost(String host) { public void setHost(String host) {
this.host = host; this.host = host;
JiveGlobals.setProperty("ldap.host", host); JiveGlobals.setXMLProperty("ldap.host", host);
} }
/** /**
...@@ -304,7 +304,7 @@ public class LdapManager { ...@@ -304,7 +304,7 @@ public class LdapManager {
*/ */
public void setPort(int port) { public void setPort(int port) {
this.port = port; this.port = port;
JiveGlobals.setProperty("ldap.port", "" + port); JiveGlobals.setXMLProperty("ldap.port", "" + port);
} }
/** /**
...@@ -327,7 +327,7 @@ public class LdapManager { ...@@ -327,7 +327,7 @@ public class LdapManager {
*/ */
public void setDebugEnabled(boolean debugEnabled) { public void setDebugEnabled(boolean debugEnabled) {
this.debugEnabled = debugEnabled; this.debugEnabled = debugEnabled;
JiveGlobals.setProperty("ldap.debuggingEnabled", "" + debugEnabled); JiveGlobals.setXMLProperty("ldap.debuggingEnabled", "" + debugEnabled);
} }
/** /**
...@@ -368,10 +368,10 @@ public class LdapManager { ...@@ -368,10 +368,10 @@ public class LdapManager {
public void setUsernameField(String usernameField) { public void setUsernameField(String usernameField) {
this.usernameField = usernameField; this.usernameField = usernameField;
if (usernameField == null) { if (usernameField == null) {
JiveGlobals.deleteProperty("ldap.usernameField"); JiveGlobals.deleteXMLProperty("ldap.usernameField");
} }
else { else {
JiveGlobals.setProperty("ldap.usernameField", usernameField); JiveGlobals.setXMLProperty("ldap.usernameField", usernameField);
} }
} }
...@@ -394,10 +394,10 @@ public class LdapManager { ...@@ -394,10 +394,10 @@ public class LdapManager {
public void setNameField(String nameField) { public void setNameField(String nameField) {
this.nameField = nameField; this.nameField = nameField;
if (nameField == null) { if (nameField == null) {
JiveGlobals.deleteProperty("ldap.nameField"); JiveGlobals.deleteXMLProperty("ldap.nameField");
} }
else { else {
JiveGlobals.setProperty("ldap.nameField", nameField); JiveGlobals.setXMLProperty("ldap.nameField", nameField);
} }
} }
...@@ -422,10 +422,10 @@ public class LdapManager { ...@@ -422,10 +422,10 @@ public class LdapManager {
public void setEmailField(String emailField) { public void setEmailField(String emailField) {
this.emailField = emailField; this.emailField = emailField;
if (emailField == null) { if (emailField == null) {
JiveGlobals.deleteProperty("ldap.emailField"); JiveGlobals.deleteXMLProperty("ldap.emailField");
} }
else { else {
JiveGlobals.setProperty("ldap.emailField", emailField); JiveGlobals.setXMLProperty("ldap.emailField", emailField);
} }
} }
...@@ -447,7 +447,7 @@ public class LdapManager { ...@@ -447,7 +447,7 @@ public class LdapManager {
*/ */
public void setBaseDN(String baseDN) { public void setBaseDN(String baseDN) {
this.baseDN = baseDN; this.baseDN = baseDN;
JiveGlobals.setProperty("ldap.baseDN", baseDN); JiveGlobals.setXMLProperty("ldap.baseDN", baseDN);
} }
/** /**
...@@ -468,7 +468,7 @@ public class LdapManager { ...@@ -468,7 +468,7 @@ public class LdapManager {
*/ */
public void setAdminDN(String adminDN) { public void setAdminDN(String adminDN) {
this.adminDN = adminDN; this.adminDN = adminDN;
JiveGlobals.setProperty("ldap.adminDN", adminDN); JiveGlobals.setXMLProperty("ldap.adminDN", adminDN);
} }
/** /**
...@@ -489,7 +489,7 @@ public class LdapManager { ...@@ -489,7 +489,7 @@ public class LdapManager {
*/ */
public void setAdminPassword(String adminPassword) { public void setAdminPassword(String adminPassword) {
this.adminPassword = adminPassword; this.adminPassword = adminPassword;
JiveGlobals.setProperty("ldap.adminPassword", adminPassword); JiveGlobals.setXMLProperty("ldap.adminPassword", adminPassword);
} }
/** /**
...@@ -514,6 +514,6 @@ public class LdapManager { ...@@ -514,6 +514,6 @@ public class LdapManager {
*/ */
public void setMode(int mode) { public void setMode(int mode) {
this.mode = mode; this.mode = mode;
JiveGlobals.setProperty("ldap.mode", "" + mode); JiveGlobals.setXMLProperty("ldap.mode", "" + mode);
} }
} }
\ No newline at end of file
...@@ -106,7 +106,7 @@ public class UserProviderFactory { ...@@ -106,7 +106,7 @@ public class UserProviderFactory {
for (int i = 0; i < classNames.length; i++) { for (int i = 0; i < classNames.length; i++) {
String className = classNames[i]; String className = classNames[i];
//See if the classname has been set as a Jive property. //See if the classname has been set as a Jive property.
String classNameProp = JiveGlobals.getProperty(propNames[i]); String classNameProp = JiveGlobals.getXMLProperty(propNames[i]);
if (classNameProp != null) { if (classNameProp != null) {
className = classNameProp; className = classNameProp;
} }
......
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