Commit af7dc63e authored by Matt Tucker's avatar Matt Tucker Committed by matt

i18n and other work.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5553 b35dd754-fafc-0310-a699-88a17e54d16e
parent b1b92178
<%@ page import="org.jivesoftware.util.*, <%@ page import="org.jivesoftware.util.*,
java.util.HashMap,
java.util.Map,
java.util.Date,
org.jivesoftware.wildfire.user.User,
org.jivesoftware.wildfire.user.UserManager,
org.jivesoftware.util.JiveGlobals" %> org.jivesoftware.util.JiveGlobals" %>
<%@ page import="org.jivesoftware.wildfire.XMPPServer"%> <%@ page import="org.jivesoftware.wildfire.XMPPServer"%>
<%@ page import="org.jivesoftware.wildfire.auth.AuthFactory"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<% <%
// Redirect if we've already run setup: // Redirect if we've already run setup:
if (!XMPPServer.getInstance().isSetupMode()) { if (!XMPPServer.getInstance().isSetupMode()) {
response.sendRedirect("setup-completed.jsp"); response.sendRedirect("setup-completed.jsp");
return; return;
...@@ -22,39 +16,125 @@ ...@@ -22,39 +16,125 @@
<% <%
// Get parameters // Get parameters
boolean next = request.getParameter("continue") != null; String serverType = ParamUtils.getParameter(request, "serverType");
if (next) { // Server type should never be null, but if it is, assume "other"
if (serverType == null) {
serverType = "other";
}
// Determine the right default values based on the the server type.
String defaultGroupNameField = JiveGlobals.getXMLProperty("ldap.groupNameField");
String defaultGroupMemberField = JiveGlobals.getXMLProperty("ldap.groupMemberField");
String defaultGroupDescriptionField = JiveGlobals.getXMLProperty("ldap.groupDescriptionField");
String posixModeString = JiveGlobals.getXMLProperty("ldap.posixMode");
boolean defaultPosixMode = Boolean.parseBoolean(posixModeString);
String defaultGroupSearchFilter = JiveGlobals.getXMLProperty("ldap.groupSearchFilter");
if (serverType.equals("activedirectory")) {
if (defaultGroupNameField == null) {
defaultGroupNameField = "cn";
}
if (defaultGroupMemberField == null) {
defaultGroupMemberField = "member";
}
if (defaultGroupDescriptionField == null) {
defaultGroupDescriptionField = "description";
}
if (posixModeString == null) {
defaultPosixMode = false;
}
if (defaultGroupSearchFilter == null) {
defaultGroupSearchFilter = "(objectClass=group)";
}
}
else {
if (defaultGroupNameField == null) {
defaultGroupNameField = "cn";
}
if (defaultGroupMemberField == null) {
defaultGroupMemberField = "member";
}
if (defaultGroupDescriptionField == null) {
defaultGroupDescriptionField = "description";
}
if (posixModeString == null) {
defaultPosixMode = false;
}
}
String groupNameField = ParamUtils.getParameter(request, "groupNameField");
if (groupNameField == null) {
groupNameField = defaultGroupNameField;
}
String groupMemberField = ParamUtils.getParameter(request, "groupMemberField");
if (groupMemberField == null) {
groupMemberField = defaultGroupMemberField;
}
String groupDescriptionField = ParamUtils.getParameter(request, "groupDescriptionField");
if (groupDescriptionField == null) {
groupDescriptionField = defaultGroupDescriptionField;
}
String posixModeParam = ParamUtils.getParameter(request, "posixMode");
boolean posixMode;
if (posixModeParam == null) {
posixMode = defaultPosixMode;
}
else {
posixMode = Boolean.parseBoolean(posixModeParam);
}
String groupSearchFilter = ParamUtils.getParameter(request, "groupSearchFilter");
if (groupSearchFilter == null) {
groupSearchFilter = defaultGroupSearchFilter;
}
boolean save = request.getParameter("save") != null;
if (save) {
if (groupNameField != null) {
JiveGlobals.setXMLProperty("ldap.groupNameField", groupNameField);
}
if (groupMemberField != null) {
JiveGlobals.setXMLProperty("ldap.groupMemberField", groupMemberField);
}
if (groupDescriptionField != null) {
JiveGlobals.setXMLProperty("ldap.groupDescriptionField", groupDescriptionField);
}
JiveGlobals.setXMLProperty("ldap.posixMode", Boolean.toString(posixMode));
if (groupSearchFilter != null) {
JiveGlobals.setXMLProperty("ldap.groupSearchFilter", groupSearchFilter);
}
// Enable the LDAP auth provider. The LDAP user provider will be enabled on the next step.
JiveGlobals.setXMLProperty("provider.group.className",
"org.jivesoftware.wildfire.ldap.LdapGroupProvider");
// Redirect // Redirect
response.sendRedirect("setup-admin-settings.jsp"); response.sendRedirect("setup-admin-settings.jsp?ldap=true");
return; return;
} }
%> %>
<html> <html>
<head> <head>
<title>Profile Settings - Directory Server</title> <title><fmt:message key="setup.ldap.title" /></title>
<meta name="currentStep" content="3"/> <meta name="currentStep" content="3"/>
</head> </head>
<body> <body>
<h1>Profile Settings <span>- Group Mapping</span></h1> <h1><fmt:message key="setup.ldap.profile" /> <span><fmt:message key="setup.ldap.group_mapping" /></h1>
<p>Configure group mapping and finish the directory server profile integration setup.</p>
<!-- BEGIN jive-contentBox_stepbar --> <!-- BEGIN jive-contentBox_stepbar -->
<div id="jive-contentBox_stepbar"> <div id="jive-contentBox_stepbar">
<span class="jive-stepbar_step">1. Connection Settings</span> <span class="jive-stepbar_step"><em>1. <fmt:message key="setup.ldap.connection_settings" /></em></span>
<span class="jive-stepbar_step">2. User Mapping</span> <span class="jive-stepbar_step"><em>2. <fmt:message key="setup.ldap.user_mapping" /></em></span>
<span class="jive-stepbar_step"><strong>3. Group Mapping</strong></span> <span class="jive-stepbar_step"><strong>3. <fmt:message key="setup.ldap.group_mapping" /></strong></span>
</div> </div>
<!-- END jive-contentBox-stepbar --> <!-- END jive-contentBox-stepbar -->
<!-- BEGIN jive-contentBox --> <!-- BEGIN jive-contentBox -->
<div class="jive-contentBox jive-contentBox_for-stepbar"> <div class="jive-contentBox jive-contentBox_for-stepbar">
<h2>Step 3 of 3: <span>Group Mapping</span></h2> <h2><fmt:message key="setup.ldap.step_three" />: <span><fmt:message key="setup.ldap.group_mapping" /></span></h2>
<p>A sentance detailing the setup options below. Also, noting that all fields are <strong>optional</strong>. Lorem ipsum dolor siet amet. Also mention the help tooltip rollovers.</p> <p><fmt:message key="setup.ldap.group.description" /></p>
<form action="" method="get"> <form action="" method="get">
<!-- BEGIN jive-contentBox_bluebox --> <!-- BEGIN jive-contentBox_bluebox -->
...@@ -62,25 +142,25 @@ ...@@ -62,25 +142,25 @@
<table border="0" cellpadding="0" cellspacing="2"> <table border="0" cellpadding="0" cellspacing="2">
<tr> <tr>
<td colspan="2"><strong>Group Mapping</strong></td> <td colspan="2"><strong><fmt:message key="setup.ldap.group_mapping" /></strong></td>
</tr> </tr>
<tr> <tr>
<td align="right">Name:</td> <td align="right"><fmt:message key="setup.ldap.group.name_field" />:</td>
<td><input type="text" name="groupname" value="cn" id="jiveLDAPgroupname" size="22" maxlength="30"><span class="jive-setup-helpicon"><a href="" onmouseover="domTT_activate(this, event, 'content', 'The field name that the groupname lookups will be performed on. If this property is not set, the default value is <b>cn</b>.', 'styleClass', 'jiveTooltip', 'trail', true, 'delay', 300, 'lifetime', 8000);"></a></span></td> <td><input type="text" name="groupNameField" id="jiveLDAPgroupname" size="22" maxlength="30" value="<%= groupNameField!=null?groupNameField:""%>"><span class="jive-setup-helpicon"><a href="" onmouseover="domTT_activate(this, event, 'content', '<fmt:message key="setup.ldap.group.name_field_description" />', 'styleClass', 'jiveTooltip', 'trail', true, 'delay', 300, 'lifetime', -1);"></a></span></td>
</tr> </tr>
<tr> <tr>
<td align="right">Member:</td> <td align="right"><fmt:message key="setup.ldap.group.member_field" />:</td>
<td><input type="text" name="groupmember" value="member" id="jiveLDAPgroupmember" size="22" maxlength="30"><span class="jive-setup-helpicon"><a href="" onmouseover="domTT_activate(this, event, 'content', 'The field name that holds the members in a group. If this property is not set, the default value is <b>member</b>.', 'styleClass', 'jiveTooltip', 'trail', true, 'delay', 300, 'lifetime', 8000);"></a></span></td> <td><input type="text" name="groupMemberField" id="jiveLDAPgroupmember" size="22" maxlength="30" value="<%= groupMemberField!=null?groupMemberField:""%>"><span class="jive-setup-helpicon"><a href="" onmouseover="domTT_activate(this, event, 'content', '<fmt:message key="setup.ldap.group.member_field_description" />', 'styleClass', 'jiveTooltip', 'trail', true, 'delay', 300, 'lifetime', -1);"></a></span></td>
</tr> </tr>
<tr> <tr>
<td align="right">Description:</td> <td align="right"><fmt:message key="setup.ldap.group.description_field" />:</td>
<td><input type="text" name="groupdesc" value="description" id="jiveLDAPgroupdesc" size="22" maxlength="30"><span class="jive-setup-helpicon"><a href="" onmouseover="domTT_activate(this, event, 'content', 'The field name that holds the description a group. If this property is not set, the default value is <b>description</b>.', 'styleClass', 'jiveTooltip', 'trail', true, 'delay', 300, 'lifetime', 8000);"></a></span></td> <td><input type="text" name="groupDescriptionField" id="jiveLDAPgroupdesc" size="22" maxlength="30" value="<%= groupDescriptionField!=null?groupDescriptionField:""%>"><span class="jive-setup-helpicon"><a href="" onmouseover="domTT_activate(this, event, 'content', '<fmt:message key="setup.ldap.group.description_field_description" />', 'styleClass', 'jiveTooltip', 'trail', true, 'delay', 300, 'lifetime', -1);"></a></span></td>
</tr> </tr>
</table> </table>
<!-- BEGIN jiveAdvancedButton --> <!-- BEGIN jiveAdvancedButton -->
<div class="jiveAdvancedButton jiveAdvancedButtonTopPad"> <div class="jiveAdvancedButton jiveAdvancedButtonTopPad">
<a href="#" onclick="togglePanel(jiveAdvanced); return false;" id="jiveAdvancedLink">Advanced Settings</a> <a href="#" onclick="togglePanel(jiveAdvanced); return false;" id="jiveAdvancedLink"><fmt:message key="setup.ldap.advanced" /></a>
</div> </div>
<!-- END jiveAdvancedButton --> <!-- END jiveAdvancedButton -->
...@@ -89,16 +169,16 @@ ...@@ -89,16 +169,16 @@
<div> <div>
<table border="0" cellpadding="0" cellspacing="2"> <table border="0" cellpadding="0" cellspacing="2">
<tr> <tr>
<td align="right">Posix Mode:</td> <td align="right"><fmt:message key="setup.ldap.group.posix" />:</td>
<td><span style="float: left;"> <td><span style="float: left;">
<label for="posix1"><input type="radio" name="posix" value="yes" style="float: none;" id="posix1"> Yes </label> <input type="radio" name="posixMode" value="true" style="float: none;" id="posix1" <% if(posixMode) {%>checked<% } %>><label for="posix1"> <fmt:message key="global.yes" /> </label>
<label for="posix2"><input type="radio" name="posix" value="no" style="float: none;" id="posix2" checked> No </label> <input type="radio" name="posixMode" value="false" style="float: none;" id="posix2" <% if(!posixMode) {%>checked<% } %>><label for="posix2"> <fmt:message key="global.no" /> </label>
</span> </span>
<span class="jive-setup-helpicon"><a href="" onmouseover="domTT_activate(this, event, 'content', 'A value of &quot;true&quot; means that users are stored within the group by their user name alone. A value of &quot;false&quot; means that users are stored by their entire DN within the group. If this property is not set, the default value is <b>false</b>. The posix mode must be set correctly for your server in order for group integration to work.', 'styleClass', 'jiveTooltip', 'trail', true, 'delay', 300, 'lifetime', 10000);"></a></span></td> <span class="jive-setup-helpicon"><a href="" onmouseover="domTT_activate(this, event, 'content', '<fmt:message key="setup.ldap.group.posix_description" />', 'styleClass', 'jiveTooltip', 'trail', true, 'delay', 300, 'lifetime', -1);"></a></span></td>
</tr> </tr>
<tr> <tr>
<td align="right">Search Filter:</td> <td align="right">'<fmt:message key="setup.ldap.group.filter" /></td>
<td><input type="text" name="gropusearchfilter" value="ldap.groupNameField={0}" id="jiveLDAPgroupsearchfilter" size="22" maxlength="30"><span class="jive-setup-helpicon"><a href="" onmouseover="domTT_activate(this, event, 'content', 'An optional search filter to append to the default filter when loading groups. The default group search filter is created using the attribute specified by ldap.groupNameField. For example, if the group name field is &quot;cn&quot;, then the default group search filter would be &quot;(cn={0})&quot; where {0} is dynamically replaced with the group name being searched for.', 'styleClass', 'jiveTooltip', 'trail', true, 'delay', 300, 'lifetime', 10000);"></a></span></td> <td><input type="text" name="groupSearchFilter" value="<%= groupSearchFilter!=null?groupSearchFilter:""%>" id="jiveLDAPgroupsearchfilter" size="22" maxlength="30"><span class="jive-setup-helpicon"><a href="" onmouseover="domTT_activate(this, event, 'content', '<fmt:message key="setup.ldap.group.filter_description" />', 'styleClass', 'jiveTooltip', 'trail', true, 'delay', 300, 'lifetime', -1);"></a></span></td>
</tr> </tr>
</table> </table>
</div> </div>
...@@ -113,20 +193,14 @@ ...@@ -113,20 +193,14 @@
<!-- BEGIN jive-buttons --> <!-- BEGIN jive-buttons -->
<div class="jive-buttons"> <div class="jive-buttons">
<!-- BEGIN left-aligned buttons -->
<div align="left" style="float: left;">
<input type="Submit" name="back" value="Back" id="jive-setup-back" border="0">
</div>
<!-- END left-aligned buttons -->
<!-- BEGIN right-aligned buttons --> <!-- BEGIN right-aligned buttons -->
<div align="right"> <div align="right">
<a href="setup-ldap-group_test.jsp" class="lbOn" id="jive-setup-test2"> <a href="setup-ldap-group_test.jsp" class="lbOn" id="jive-setup-test2">
<img src="../images/setup_btn_gearplay.gif" alt="" width="14" height="14" border="0"> <img src="../images/setup_btn_gearplay.gif" alt="" width="14" height="14" border="0">
Test Settings <fmt:message key="setup.ldap.test" />
</a> </a>
<input type="Submit" name="save" value="Save & Continue" id="jive-setup-save" border="0"> <input type="Submit" name="save" value="<fmt:message key="setup.ldap.continue" />" id="jive-setup-save" border="0">
</div> </div>
<!-- END right-aligned buttons --> <!-- END right-aligned buttons -->
......
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