Commit 9563a861 authored by guus's avatar guus

Allow LDAP quotation to be disabled during setup (OF-383).

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@11785 b35dd754-fafc-0310-a699-88a17e54d16e
parent 3e2be230
......@@ -462,7 +462,7 @@
## Added key: 'prelogin.setup.error.clearspace.connection'
## Added key: 'ssl.settings.client.label_self-signed'
##
## 3.6.5
## 3.6.0
## Added key: 'groupchat.service.properties.error_already_exists'
## Added key: 'sidebar.muc-defaultsettings'
## Added key: 'sidebar.muc-defaultsettings.descr'
......@@ -500,7 +500,8 @@
## Added key: 'client.connections.settings.ping.footnote'
## Added key: 'client.connections.settings.ping.enable'
## Added key: 'client.connections.settings.ping.disable'
## Added key: 'setup.ldap.server.alias_enclose_dns'
## Added key: 'setup.ldap.server.alias_enclose_dns_help'
......@@ -1943,6 +1944,8 @@ setup.ldap.server.referral=Follow Referrals
setup.ldap.server.referral_help=Automatically follow LDAP referrals when found
setup.ldap.server.alias_dereference=Deference Aliases
setup.ldap.server.alias_dereference_help=Automatically deference LDAP aliases when found
setup.ldap.server.alias_enclose_dns=Enclose DNs
setup.ldap.server.alias_enclose_dns_help=Enclose DNs with quotes
setup.ldap.server.test.error-auth=Error authenticating with the LDAP server. Check supplied credentials.
setup.ldap.server.test.error-connection=Error connecting to the LDAP server. Ensure that the directory \
......
......@@ -1782,6 +1782,22 @@ public class LdapManager {
this.groupSearchFilter = groupSearchFilter;
properties.put("ldap.groupSearchFilter", groupSearchFilter);
}
public boolean isEnclosingDNs() {
String encloseStr = properties.get("ldap.encloseDNs");
if (encloseStr != null) {
encloseDNs = Boolean.valueOf(encloseStr);
} else {
encloseDNs = true;
}
return encloseDNs;
}
public void setIsEnclosingDNs(boolean enable) {
this.encloseDNs = enable;
properties.put("ldap.encloseDNs", Boolean.toString(enable));
}
/**
* Generic routine for retrieving a list of results from the LDAP server. It's meant to be very
......
......@@ -16,6 +16,7 @@
boolean debugEnabled = false;
boolean referralsEnabled = false;
boolean aliasReferralsEnabled = true;
boolean encloseDNs = true;
@SuppressWarnings("unchecked")
Map<String,String> xmppSettings = (Map<String,String>)session.getAttribute("xmppSettings");
......@@ -48,7 +49,8 @@
debugEnabled = ParamUtils.getBooleanParameter(request, "debug", debugEnabled);
referralsEnabled = ParamUtils.getBooleanParameter(request, "referrals", referralsEnabled);
aliasReferralsEnabled = ParamUtils.getBooleanParameter(request, "aliasreferrals", aliasReferralsEnabled);
encloseDNs = ParamUtils.getBooleanParameter(request, "enclosedns", encloseDNs);
if (errors.isEmpty()) {
// Store settings in a map and keep it in the session
Map<String, String> settings = new HashMap<String, String>();
......@@ -68,6 +70,8 @@
settings.put("ldap.debugEnabled", Boolean.toString(debugEnabled));
settings.put("ldap.autoFollowReferrals", Boolean.toString(referralsEnabled));
settings.put("ldap.autoFollowAliasReferrals", Boolean.toString(aliasReferralsEnabled));
settings.put("ldap.encloseDNs", Boolean.toString(encloseDNs));
// Always disable connection pooling so that connections aren't left hanging open.
settings.put("ldap.connectionPoolEnabled", "false");
session.setAttribute("ldapSettings", settings);
......@@ -89,7 +93,8 @@
manager.setDebugEnabled(debugEnabled);
manager.setFollowReferralsEnabled(referralsEnabled);
manager.setFollowAliasReferralsEnabled(aliasReferralsEnabled);
manager.setIsEnclosingDNs(encloseDNs);
// Save the settings for later, if we're in setup
if (xmppSettings != null) {
xmppSettings.put("ldap.host", host);
......@@ -102,6 +107,8 @@
xmppSettings.put("ldap.debugEnabled", Boolean.toString(debugEnabled));
xmppSettings.put("ldap.autoFollowReferrals", Boolean.toString(referralsEnabled));
xmppSettings.put("ldap.autoFollowAliasReferrals", Boolean.toString(aliasReferralsEnabled));
xmppSettings.put("ldap.encloseDNs", Boolean.toString(encloseDNs));
session.setAttribute("xmppSettings", xmppSettings);
}
......@@ -129,6 +136,7 @@
debugEnabled = manager.isDebugEnabled();
referralsEnabled = manager.isFollowReferralsEnabled();
aliasReferralsEnabled = manager.isFollowAliasReferralsEnabled();
encloseDNs = manager.isEnclosingDNs();
}
%>
<html>
......@@ -334,6 +342,20 @@
<input type="radio" name="aliasreferrals" value="false" <% if (!aliasReferralsEnabled) { %>checked <% } %>>
</td>
</tr>
<tr>
<td class="jive-advancedLabel" nowrap>
<fmt:message key="setup.ldap.server.enclose_dns" />:
</td>
<td class="jive-advancedDesc jive-advancedBorderBottom jive-advancedBorderRight">
<fmt:message key="setup.ldap.server.enclose_dns_help" />
</td>
<td class="jive-advancedBorderBottom jive-advancedBorderRight" align="center">
<input type="radio" name="enclosedns" value="true" <% if (encloseDNs) { %>checked <% } %>>
</td>
<td class="jive-advancedBorderBottom" align="center">
<input type="radio" name="enclosedns" value="false" <% if (!encloseDNs) { %>checked <% } %>>
</td>
</tr>
</tbody>
</table>
</div>
......
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