dsconfig.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <!-- --- BEGIN COPYRIGHT BLOCK ---
  2. This Program is free software; you can redistribute it and/or modify it under
  3. the terms of the GNU General Public License as published by the Free Software
  4. Foundation; version 2 of the License.
  5. This Program is distributed in the hope that it will be useful, but WITHOUT
  6. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  7. FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  8. You should have received a copy of the GNU General Public License along with
  9. this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  10. Place, Suite 330, Boston, MA 02111-1307 USA.
  11. In addition, as a special exception, Red Hat, Inc. gives You the additional
  12. right to link the code of this Program with code not covered under the GNU
  13. General Public License ("Non-GPL Code") and to distribute linked combinations
  14. including the two, subject to the limitations in this paragraph. Non-GPL Code
  15. permitted under this exception must only link to the code of this Program
  16. through those well defined interfaces identified in the file named EXCEPTION
  17. found in the source code files (the "Approved Interfaces"). The files of
  18. Non-GPL Code may instantiate templates or use macros or inline functions from
  19. the Approved Interfaces without causing the resulting work to be covered by
  20. the GNU General Public License. Only Red Hat, Inc. may make changes or
  21. additions to the list of Approved Interfaces. You must obey the GNU General
  22. Public License in all respects for all of the Program code and other code used
  23. in conjunction with the Program except the Non-GPL Code covered by this
  24. exception. If you modify this file, you may extend this exception to your
  25. version of the file, but you are not obligated to do so. If you do not wish to
  26. provide this exception without modification, you must delete this exception
  27. statement from your version and license this file solely under the GPL without
  28. exception.
  29. Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  30. Copyright (C) 2005 Red Hat, Inc.
  31. All rights reserved.
  32. --- END COPYRIGHT BLOCK --- -->
  33. <HEAD><TITLE>User Management</TITLE>
  34. <SCRIPT language=JavaScript>
  35. var didSetDefaults = 0;
  36. function resetForm()
  37. {
  38. if (document.modForm.dirsvctype[1].checked) {
  39. document.configuredForRemote = 1;
  40. document.modForm.host.focus();
  41. if (document.modForm.port.value == '') {
  42. document.modForm.port.value = '389';
  43. }
  44. } else {
  45. document.configuredForRemote = 0;
  46. }
  47. }
  48. function submitModify()
  49. {
  50. var theForm = document.modForm;
  51. // verify form fields
  52. if ( theForm.dirsvctype[1].checked ) { // remote directory server
  53. if ( theForm.host.value.length == 0 ) {
  54. alert( 'Please provide the host name of the LDAP server.' );
  55. return false;
  56. }
  57. if ( theForm.port.value.length == 0 ) {
  58. alert( 'Please provide the port number of the LDAP server.' );
  59. return false;
  60. }
  61. if ( theForm.port.value < 1 || theForm.port.value > 65535 ) {
  62. alert( 'The port number must be between 1 and 65535.' );
  63. return false;
  64. }
  65. if ( theForm.basedn.value.length == 0 ) {
  66. alert( 'Please provide a base DN.' );
  67. return false;
  68. }
  69. if ( theForm.bindpw.value.length > 0 &&
  70. theForm.binddn.value.length == 0 ) {
  71. alert( 'Please provide the Bind DN.' );
  72. return false;
  73. }
  74. }
  75. theForm.submit();
  76. return false;
  77. }
  78. function selectedSSL( doSSL )
  79. {
  80. var theForm = document.modForm;
  81. var onWrongPort, portDesc;
  82. // SSL On or SSL Off radio button was clicked on: offer to set the
  83. // port to the standard SSL or non-SSL one as appropriate.
  84. if ( doSSL ) {
  85. onWrongPort = ( theForm.port.value == 389 );
  86. portDesc = 'LDAP over SSL';
  87. stdPort = 636;
  88. } else {
  89. onWrongPort = ( theForm.port.value == 636 );
  90. portDesc = 'LDAP';
  91. stdPort = 389;
  92. }
  93. if ( onWrongPort && confirm( 'The standard port for ' + portDesc + ' is ' +
  94. stdPort + '.\nWould you like to switch to the standard port?' )) {
  95. theForm.port.value = stdPort;
  96. }
  97. }
  98. function checkForChange()
  99. {
  100. cTLMsg = 'If you switch to local database mode,\n' +
  101. 'any configuration data about directory servers\n' +
  102. 'will be lost. Go ahead and change to\n' +
  103. 'local database mode?';
  104. cTRMsg = 'To use a directory server, you must\n' +
  105. 'provide the host name, port, and base DN for\n' +
  106. 'an LDAP directory server. Go ahead and\n' +
  107. 'change to directory server mode?';
  108. if (document.modForm.dirsvctype[0].checked &&
  109. document.configuredForRemote) {
  110. if (confirm(cTLMsg)) {
  111. var tmp = document.location.href;
  112. if (document.location.search == "?CHANGE") {
  113. document.location.search = "";
  114. } else {
  115. document.location.href = tmp + "?CHANGE";
  116. }
  117. } else {
  118. document.modForm.dirsvctype[1].checked = true;
  119. }
  120. } else if (document.modForm.dirsvctype[1].checked &&
  121. !document.configuredForRemote) {
  122. if (confirm(cTRMsg)) {
  123. var tmp = document.location.href;
  124. if (document.location.search == "?CHANGE") {
  125. document.location.search = "";
  126. } else {
  127. document.location.href = tmp + "?CHANGE";
  128. }
  129. } else {
  130. document.modForm.dirsvctype[0].checked = true;
  131. }
  132. }
  133. }
  134. </SCRIPT>
  135. </HEAD>
  136. <!-- BODY "onLoad='resetForm()'" -->
  137. <CENTER><TABLE BORDER="2" CELLPADDING="10" WIDTH="100%">
  138. <TR><TD ALIGN="center" WIDTH="100%">
  139. <FONT SIZE="+2"><B>Configure Directory Service</B></FONT>
  140. </TD></TR></TABLE></CENTER>
  141. <!-- DS_INLINE_POST_RESULTS -->
  142. <FORM METHOD="POST" ACTION="dsconfig" NAME="modForm">
  143. <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%>
  144. <TR>
  145. <TD ALIGN="right" NOWRAP><B>Obtain Directory Service From:</B></TD>
  146. <TD>
  147. <INPUT TYPE="radio" NAME="dirsvctype"
  148. VALUE="local"
  149. <!-- DS_CHECKED_IF_LOCAL -->
  150. onClick="checkForChange(this);">Local Database
  151. <BR>
  152. <INPUT TYPE="radio" NAME="dirsvctype"
  153. VALUE="remote"
  154. <!-- DS_CHECKED_IF_REMOTE -->
  155. onClick="checkForChange(this);">LDAP Directory Server
  156. </TD>
  157. </TR>
  158. </TABLE>
  159. <HR>
  160. <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%>
  161. <TR><TD COLSPAN="2" ALIGN="center">
  162. <!-- DS_CONFIG_INFO -->
  163. <BR>
  164. </B></TD></TR>
  165. <!-- DS_HOSTNAME_VALUE -->
  166. <!-- DS_PORT_VALUE -->
  167. <!-- DS_SSL_CONFIG_VALUE -->
  168. <!-- DS_BASEDN_VALUE -->
  169. <!-- DS_BINDDN_VALUE -->
  170. <!-- DS_BINDPASSWD_VALUE -->
  171. </TABLE>
  172. <P>
  173. <CENTER><TABLE BORDER="2" WIDTH="100%">
  174. <TR>
  175. <TD WIDTH="33%" ALIGN="center"><INPUT TYPE="button" VALUE=" Save Changes "
  176. onClick="submitModify()"></TD>
  177. <TD WIDTH=34% ALIGN=center><INPUT TYPE="reset" VALUE=" Reset "
  178. onClick="resetForm()"></TD>
  179. <TD WIDTH=33% ALIGN=center>
  180. <!-- HELPBUTTON "DSCONFIG" -->
  181. </TD>
  182. </TR></TABLE></CENTER>
  183. </FORM>
  184. <!-- DS_NOCERTFILE_WARNING "<SCRIPT language=JavaScript>alert('For the Users and Groups forms to work over SSL, you need to activate SSL for this Administration Server.\nChoose Encryption|On/Off to do so.');</SCRIPT>" -->
  185. <!-- ENDHTML -->