configguide-ldap_server.jsp 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <%@ page import="password.pwm.http.bean.ConfigGuideBean" %>
  2. <%@ page import="password.pwm.http.servlet.ConfigGuideServlet" %>
  3. <%@ page import="java.util.Map" %>
  4. <%--
  5. ~ Password Management Servlets (PWM)
  6. ~ http://code.google.com/p/pwm/
  7. ~
  8. ~ Copyright (c) 2006-2009 Novell, Inc.
  9. ~ Copyright (c) 2009-2015 The PWM Project
  10. ~
  11. ~ This program is free software; you can redistribute it and/or modify
  12. ~ it under the terms of the GNU General Public License as published by
  13. ~ the Free Software Foundation; either version 2 of the License, or
  14. ~ (at your option) any later version.
  15. ~
  16. ~ This program is distributed in the hope that it will be useful,
  17. ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ~ GNU General Public License for more details.
  20. ~
  21. ~ You should have received a copy of the GNU General Public License
  22. ~ along with this program; if not, write to the Free Software
  23. ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  24. --%>
  25. <% JspUtility.setFlag(pageContext, PwmRequest.Flag.HIDE_LOCALE); %>
  26. <% JspUtility.setFlag(pageContext, PwmRequest.Flag.HIDE_THEME); %>
  27. <!DOCTYPE html>
  28. <%@ page language="java" session="true" isThreadSafe="true" contentType="text/html" %>
  29. <% ConfigGuideBean configGuideBean = (ConfigGuideBean) JspUtility.getPwmSession(pageContext).getSessionBean(ConfigGuideBean.class);%>
  30. <% Map<String,String> DEFAULT_FORM = ConfigGuideServlet.defaultForm(configGuideBean.getStoredConfiguration().getTemplate()); %>
  31. <%@ taglib uri="pwm" prefix="pwm" %>
  32. <html dir="<pwm:LocaleOrientation/>">
  33. <%@ include file="fragment/header.jsp" %>
  34. <body class="nihilo">
  35. <link href="<pwm:context/><pwm:url url='/public/resources/configStyle.css'/>" rel="stylesheet" type="text/css"/>
  36. <div id="wrapper">
  37. <div id="header">
  38. <div id="header-center">
  39. <div id="header-page">
  40. <pwm:display key="Title_ConfigGuide" bundle="Config"/>
  41. </div>
  42. <div id="header-title">
  43. <pwm:display key="Title_ConfigGuide_ldap" bundle="Config"/>
  44. </div>
  45. </div>
  46. </div>
  47. <div id="centerbody">
  48. <form id="configForm" name="configForm">
  49. <%@ include file="/WEB-INF/jsp/fragment/message.jsp" %>
  50. <div id="outline_ldap-server" class="setting_outline">
  51. <div id="titlePaneHeader-ldap-server" class="setting_title">
  52. LDAP Server
  53. </div>
  54. <div class="setting_body">
  55. Enter the connection information for your ldap server. After the configuration wizard is completed you can enter additional servers. Enter the actual address of your LDAP server; do not use a virtual address or proxy server address.
  56. <br/>
  57. <br/>
  58. <table class="noborder" style="border-spacing: 0; padding: 0; margin: 0">
  59. <tr>
  60. <td colspan="2">
  61. <b>LDAP Server Hostname</b>
  62. </td>
  63. </tr>
  64. <tr>
  65. <td colspan="2">
  66. <input class="configStringInput" id="<%=ConfigGuideServlet.PARAM_LDAP_HOST%>" name="<%=ConfigGuideServlet.PARAM_LDAP_HOST%>" value="<%=configGuideBean.getFormData().get(ConfigGuideServlet.PARAM_LDAP_HOST)%>" <pwm:autofocus/> />
  67. </td>
  68. </tr>
  69. <tr><td>&nbsp;</td></tr>
  70. <tr>
  71. <td style="width: 30%">
  72. <b>LDAP Port</b>
  73. </td>
  74. <td style="">
  75. <b>Secure (SSL) Connection</b>
  76. </td>
  77. </tr>
  78. <tr>
  79. <td>
  80. <input class="configNumericInput" type="number" id="<%=ConfigGuideServlet.PARAM_LDAP_PORT%>" name="<%=ConfigGuideServlet.PARAM_LDAP_PORT%>" value="<%=configGuideBean.getFormData().get(ConfigGuideServlet.PARAM_LDAP_PORT)%>"/>
  81. </td>
  82. <td>
  83. <% boolean secureChecked = "true".equalsIgnoreCase(configGuideBean.getFormData().get(ConfigGuideServlet.PARAM_LDAP_SECURE));%>
  84. <label class="checkboxWrapper">
  85. <input type="checkbox" id="widget_<%=ConfigGuideServlet.PARAM_LDAP_SECURE%>" name="nope" <%=secureChecked ? "checked" : ""%>/> Secure
  86. <input type="hidden" id="<%=ConfigGuideServlet.PARAM_LDAP_SECURE%>" name="<%=ConfigGuideServlet.PARAM_LDAP_SECURE%>" value="uninitialized"/>
  87. </label>
  88. </td>
  89. </tr>
  90. </table>
  91. </div>
  92. </div>
  93. </form>
  94. <br/>
  95. <div id="healthBody" style="border:0; margin:0; padding:0; cursor: pointer">
  96. <div style="text-align: center">
  97. <button class="menubutton" style="margin-left: auto; margin-right: auto">
  98. <pwm:if test="showIcons"><span class="btn-icon fa fa-check"></span></pwm:if>
  99. <pwm:display key="Button_CheckSettings" bundle="Config"/>
  100. </button>
  101. </div>
  102. </div>
  103. <div class="buttonbar">
  104. <button class="btn" id="button_previous">
  105. <pwm:if test="showIcons"><span class="btn-icon fa fa-backward"></span></pwm:if>
  106. <pwm:display key="Button_Previous" bundle="Config"/>
  107. </button>
  108. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  109. <button class="btn" id="button_next">
  110. <pwm:if test="showIcons"><span class="btn-icon fa fa-forward"></span></pwm:if>
  111. <pwm:display key="Button_Next" bundle="Config"/>
  112. </button>
  113. </div>
  114. </div>
  115. <div class="push"></div>
  116. </div>
  117. <pwm:script>
  118. <script type="text/javascript">
  119. function handleFormActivity() {
  120. PWM_MAIN.getObject('<%=ConfigGuideServlet.PARAM_LDAP_SECURE%>').value =
  121. PWM_MAIN.getObject('widget_<%=ConfigGuideServlet.PARAM_LDAP_SECURE%>').checked ? "true" : "false";
  122. PWM_GUIDE.updateForm();
  123. clearHealthDiv();
  124. }
  125. function clearHealthDiv() {
  126. PWM_MAIN.getObject('healthBody').innerHTML = PWM_VAR['originalHealthBody'];
  127. }
  128. PWM_GLOBAL['startupFunctions'].push(function(){
  129. PWM_VAR['originalHealthBody'] = PWM_MAIN.getObject('healthBody').innerHTML;
  130. clearHealthDiv();
  131. checkIfNextEnabled();
  132. PWM_MAIN.addEventHandler('configForm','input',function(){
  133. handleFormActivity();
  134. });
  135. PWM_MAIN.addEventHandler('widget_<%=ConfigGuideServlet.PARAM_LDAP_SECURE%>','change',function() {
  136. if (!PWM_MAIN.getObject('widget_<%=ConfigGuideServlet.PARAM_LDAP_SECURE%>').checked) {
  137. PWM_MAIN.showConfirmDialog({
  138. text: PWM_CONFIG.showString('Confirm_SSLDisable'), cancelAction: function () {
  139. PWM_MAIN.getObject('widget_<%=ConfigGuideServlet.PARAM_LDAP_SECURE%>').checked=true;
  140. PWM_MAIN.closeWaitDialog();
  141. handleFormActivity();
  142. }
  143. });
  144. }
  145. handleFormActivity();
  146. });
  147. PWM_MAIN.addEventHandler('button_next','click',function(){PWM_GUIDE.gotoStep('NEXT')});
  148. PWM_MAIN.addEventHandler('button_previous','click',function(){PWM_GUIDE.gotoStep('PREVIOUS')});
  149. PWM_MAIN.addEventHandler('healthBody','click',function(){loadHealth()});
  150. });
  151. function checkIfNextEnabled() {
  152. PWM_MAIN.getObject('button_next').disabled = PWM_GLOBAL['pwm-health'] !== 'GOOD';
  153. }
  154. function loadHealth() {
  155. console.log('loadHealth()');
  156. var options = {};
  157. options['sourceUrl'] = 'ConfigGuide?processAction=ldapHealth';
  158. options['showRefresh'] = false;
  159. options['refreshTime'] = -1;
  160. options['finishFunction'] = function(){
  161. PWM_MAIN.closeWaitDialog();
  162. checkIfNextEnabled();
  163. };
  164. PWM_MAIN.showWaitDialog({loadFunction:function(){
  165. PWM_ADMIN.showAppHealth('healthBody', options);
  166. }});
  167. }
  168. </script>
  169. </pwm:script>
  170. <pwm:script-ref url="/public/resources/js/configguide.js"/>
  171. <pwm:script-ref url="/public/resources/js/configmanager.js"/>
  172. <pwm:script-ref url="/public/resources/js/admin.js"/>
  173. <%@ include file="fragment/footer.jsp" %>
  174. </body>
  175. </html>