Commit 4ee5b322 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Initial work for testing settings.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5604 b35dd754-fafc-0310-a699-88a17e54d16e
parent d6bbf22b
<!-- BEGIN connection settings test panel -->
<%@ page import="org.jivesoftware.wildfire.ldap.LdapManager" %>
<%@ page import="javax.naming.AuthenticationException" %>
<%@ page import="javax.naming.CommunicationException" %>
<%@ page import="javax.naming.InvalidNameException" %>
<%@ page import="javax.naming.NamingException" %>
<%@ page import="java.util.Map" %>
<%
boolean success = false;
String errorDetail = "";
Map<String, String> settings = (Map<String, String>) session.getAttribute("ldapSettings");
if (settings != null) {
LdapManager manager = new LdapManager(settings);
try {
manager.getContext();
// We were able to successfully connect to the LDAP server
success = true;
}
catch (NamingException e) {
if (e instanceof AuthenticationException) {
errorDetail = "Error authenticating with the LDAP server. Check supplied credentials";
}
else if (e instanceof CommunicationException) {
errorDetail = "Error connecting to the LDAP server";
}
else if (e instanceof InvalidNameException) {
errorDetail = "Invalid DN syntax or Naming violation";
}
else {
errorDetail = e.getExplanation();
}
e.printStackTrace();
}
}
%>
<!-- BEGIN connection settings test panel -->
<div class="jive-testPanel">
<div class="jive-testPanel-content">
......@@ -9,13 +42,16 @@
<h2>Test: <span>Connection Settings</span></h2>
<h4 class="jive-testSuccess">Success!</h4>
<!-- <h4 class="jive-testError">Error</h4> -->
<p>A connection was successfully established to the LDAP server using the settings above.
<% if (success) { %>
<h4 class="jive-testSuccess">Status: Success!</h4>
<p>A connection was successfully established to the LDAP server using the settings above.
Close this test panel and continue to the next step.</p>
</div>
<% } else { %>
<h4 class="jive-testError">Status: Error</h4>
<p><%= errorDetail %>.</p>
<% } %>
</div>
</div>
<!-- END connection settings test panel -->
\ No newline at end of file
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