PageRenderTime 47ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/src/web/html/vpn_ssl_config.php

http://windowsfw.googlecode.com/
PHP | 320 lines | 302 code | 11 blank | 7 comment | 49 complexity | fe860a9542b485a0d87e5dac5d0feb61 MD5 | raw file
  1. <?php
  2. session_start();
  3. include_once("function_right.php");
  4. if(!JudgeUserRight()) return FALSE;
  5. ?>
  6. <html>
  7. <head>
  8. <title></title>
  9. <link href="../css/index.css" rel="stylesheet" type="text/css" />
  10. <script src="js/common.js"></script>
  11. <script language='javascript'>
  12. function CheckSubmit() {
  13. /*if ( document.IG_snmp.elements["server"].value != "" && !CheckDevname(document.IG_snmp.elements["server"].value)) {
  14. window.alert("????????????????????1-16??????????");
  15. document.IG_snmp.elements["server"].focus();
  16. return false;
  17. } */
  18. if (document.IG_snmp.elements["local"].value != "" && !CheckDevname(document.IG_snmp.elements["local"].value)) {
  19. window.alert("????????????????????1-16??????????");
  20. document.IG_snmp.elements["local"].focus();
  21. return false;
  22. }
  23. if (document.IG_snmp.elements["connect"].value != "" && !CheckDevname(document.IG_snmp.elements["connect"].value)) {
  24. window.alert("????????????????????1-16??????????");
  25. document.IG_snmp.elements["connect"].focus();
  26. return false;
  27. }
  28. if (document.IG_snmp.elements["community"].value == "" ){
  29. window.alert("Community ?????");
  30. document.ig_snmp.elements["community"].focus();
  31. return false;
  32. }
  33. if (!CheckDevname(document.IG_snmp.elements["community"].value)) {
  34. window.alert("????????????????????1-16??????????");
  35. document.ig_snmp.elements["community"].focus();
  36. return false;
  37. }
  38. document.IG_snmp.submit();
  39. }
  40. </script>
  41. </head>
  42. <?php
  43. include_once "function_net_snmp.php";
  44. $list = GetXmlSnmp();
  45. $sl = $list['SecLevel'];
  46. ?>
  47. <body class=bianju onload="changeShowVersion('priv'),changeShowNoObj('<?php echo $sl ?>')">
  48. <table width=460 border=0 cellpadding=0 cellspacing=0 >
  49. <tr>
  50. <td colspan=8>?????????? --> SSL VPN --> ???? <br>
  51. <br></td>
  52. </tr>
  53. </table>
  54. <table height="23" border=0 cellpadding=0 cellspacing=0 >
  55. <tr>
  56. <td width=80 class=ttitle01><div align="center"><a href="vpn_ssl_config.php">????</a></div></td>
  57. <td width=10 ></td>
  58. <td width=80 class=ttitle><div align="center"><a href="vpn_ssl_server_config.php">????</a></div></td>
  59. <td width=10 ></td>
  60. <td width=80 class=ttitle><div align="center"><a href="vpn_ssl_client_config.php">????</a></div></td>
  61. <td width=10 ></td>
  62. <td width=80 class=ttitle><div align="center"><a href="vpn_ssl_client_list.php">????</a></div></td>
  63. </tr>
  64. </table>
  65. <table width=98% cellpadding=0 cellspacing=0 border=0>
  66. <tr><td colspan=8 height=3 class=in07></td></tr>
  67. </table>
  68. <table width=98% cellpadding=0 cellspacing=0 class=tborder>
  69. <FORM NAME=IG_snmp METHOD=post ACTION="net_snmp_service_set.php">
  70. <tr>
  71. <td height=10 align=right class=ttext01><div align="left">
  72. <table width=100% border=0 align="right" cellpadding=2 cellspacing=1>
  73. <tr>
  74. <?php
  75. //print_r($list);
  76. if ($list['Enabled'] == "1")
  77. $Enabled = "checked";
  78. if ($list['Version'] == "SNMPv1"){
  79. $v1 = "selected";
  80. $v2 = "";
  81. $v3 = "";
  82. }
  83. if ($list['Version'] == "SNMPv2c"){
  84. $v1 = "";
  85. $v2 = "selected";
  86. $v3 = "";
  87. }
  88. if ($list['Version'] == "SNMPv3"){
  89. $v1 = "";
  90. $v2 = "";
  91. $v3 = "selected";
  92. }
  93. ?>
  94. <td><input type="checkbox" name="status" value="1" <?php echo $Enabled ?> >&nbsp;
  95. ??SNMP??</td>
  96. </tr>
  97. <tr>
  98. <td>??&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?
  99. <SELECT name=IG_version class=p id="IG_version" onChange="changeShowVersion('priv')">
  100. <option value="SNMPv1" <?php echo $v1?> >SNMPv1</option>
  101. <option value="SNMPv2c"<?php echo $v2?> >SNMPv2c</option>
  102. <!-- <option value="SNMPv3" <?php echo $v3?> >SNMPv3</op1tion> -->
  103. </SELECT>
  104. </td>
  105. </tr>
  106. <tr>
  107. <td>Trap??????
  108. <input name="server" type="text" id="server" value=<?php echo $list['TrapAddr'] ?>> </td>
  109. </tr>
  110. <tr id="version12">
  111. <td>??&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?
  112. <input name="username" type="text" id="username" value=<?php echo $list['User']?>> </td>
  113. </tr>
  114. <tr>
  115. <td>????&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?
  116. <input name="local" type="text" id="local" value="<?php echo $list["Local"]?>"> </td>
  117. </tr>
  118. <tr>
  119. <td>?????&nbsp;&nbsp;&nbsp;&nbsp;?
  120. <input name="connect" type="text" id="connect" value="<?php echo $list["Contract"]?>" > </td>
  121. </tr>
  122. <tr id="community"><td>
  123. Community&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?
  124. <input type="text" name="community" value="<?php echo $list["Community"]?>">
  125. </td>
  126. </tr>
  127. <div id="AttestationClass">
  128. <tr id="Attclass">
  129. <td>????&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?
  130. <SELECT name=Attestation class=p id="Attestation" onChange="changeShow(this)">
  131. <?php
  132. if ($list["SecLevel"] == "priv"){
  133. $p = "selected";
  134. $a = "";
  135. $n = "";
  136. }
  137. if ($list["SecLevel"] == "auth"){
  138. $p = "";
  139. $a = "selected";
  140. $n = "";
  141. }
  142. if ($list["SecLevel"] == "noauth"){
  143. $p = "";
  144. $a = "";
  145. $n = "selected";
  146. }
  147. ?>
  148. <option value="priv" <?php echo $p?> >?????</option>
  149. <option value="auth" <?php echo $a?> >??????</option>
  150. <option value="noauth" <?php echo $n?>>???????</option>
  151. </SELECT>
  152. </td>
  153. </tr>
  154. <tr name="Att_protocol" id="Att_protocol" style="display:block">
  155. <td>????&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?
  156. <select name="Att_protocol_type" >
  157. <?php
  158. if ($list['AuthProtocol'] == "MD5"){
  159. $m = "selected";
  160. $s = "";
  161. }
  162. if ($list['AuthProtocol'] == "SHA1"){
  163. $m = "";
  164. $s = "selected";
  165. }
  166. if ($list['CryProtocol'] == "DES"){
  167. $des = "selected";
  168. $aes = "";
  169. }
  170. if ($list['CryProtocol'] == "AES"){
  171. $des = "";
  172. $aes = "selected";
  173. }
  174. ?>
  175. <option value="MD5" <?php echo $m ?>>MD5</option>
  176. <option value="SHA1" <?php echo $s ?>>SHA1</option>
  177. </SELECT>
  178. </td>
  179. </tr>
  180. <tr name="encrypt_protocol" id="encrypt_protocol" style="display:block">
  181. <td>????&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?
  182. <select name="encrypt_protocol_type" >
  183. <option value="DES" <?php echo $des?>>DES</option>
  184. <option value="AES" <?php echo $aes?>>AES</option>
  185. </SELECT>
  186. </td>
  187. </tr>
  188. <tr>
  189. <td id="showpawd1" style="display:block">????&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?
  190. <input name="authpass" type="password" id="authpass" value="<?php echo $list["AuthPass"]?>" > </td>
  191. </tr>
  192. <tr id="showpawd2" style="display:block">
  193. <td>????&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;?
  194. <input name="secpass" type="password" id="secpass" value="<?php echo $list["CryPass"]?>" > </td>
  195. </tr>
  196. </div>
  197. </table>
  198. </td></tr>
  199. <tr><td height=1 class=in06></td></tr>
  200. <td class="in06">
  201. <tr>
  202. <td class=in05 height=36>
  203. <table cellpadding=2 cellspacing=6 border=0>
  204. <tr>
  205. <td width=70></td>
  206. <td><input name="save" onclick="CheckSubmit()" type=button class=save id="save" value=?&nbsp;&nbsp;&nbsp;?></td>
  207. <td>&nbsp;&nbsp;</td>
  208. </tr>
  209. </table></td>
  210. </tr>
  211. <input type=hidden name=usern value= >
  212. </FORM>
  213. </table>
  214. <br>
  215. </body>
  216. </html>
  217. <script language="JavaScript" type="text/JavaScript">
  218. function changeShowNoObj(obj_value)
  219. {
  220. if(obj_value == "priv")
  221. {
  222. Att_protocol.style.display = "block";
  223. encrypt_protocol.style.display = "block";
  224. showpawd1.style.display = "block";
  225. showpawd2.style.display = "block";
  226. }
  227. else if(obj_value == "auth")
  228. {
  229. Att_protocol.style.display = "block";
  230. encrypt_protocol.style.display = "none";
  231. showpawd1.style.display = "block";
  232. showpawd2.style.display = "none";
  233. }
  234. else
  235. {
  236. Att_protocol.style.display = "none";
  237. encrypt_protocol.style.display = "none";
  238. showpawd1.style.display = "none";
  239. showpawd2.style.display = "none";
  240. }
  241. }
  242. function changeShow(obj)
  243. {
  244. var obj_value = obj.value;
  245. if(obj_value == "priv")
  246. {
  247. Att_protocol.style.display = "block";
  248. encrypt_protocol.style.display = "block";
  249. showpawd1.style.display = "block";
  250. showpawd2.style.display = "block";
  251. }
  252. else if(obj_value == "auth")
  253. {
  254. Att_protocol.style.display = "block";
  255. encrypt_protocol.style.display = "none";
  256. showpawd1.style.display = "block";
  257. showpawd2.style.display = "none";
  258. }
  259. else
  260. {
  261. Att_protocol.style.display = "none";
  262. encrypt_protocol.style.display = "none";
  263. showpawd1.style.display = "none";
  264. showpawd2.style.display = "none";
  265. }
  266. }
  267. function changeShowVersion(Attestation)
  268. {
  269. var version = document.IG_snmp.IG_version.value;
  270. if(version == "SNMPv3")
  271. {
  272. Attclass.style.display = "block";
  273. if(Attestation == "priv")
  274. {
  275. Att_protocol.style.display = "block";
  276. encrypt_protocol.style.display = "block";
  277. showpawd1.style.display = "block";
  278. showpawd2.style.display = "block";
  279. }
  280. else if(Attestation == "auth")
  281. {
  282. Att_protocol.style.display = "block";
  283. encrypt_protocol.style.display = "none";
  284. showpawd1.style.display = "block";
  285. showpawd2.style.display = "none";
  286. }
  287. else
  288. {
  289. Att_protocol.style.display = "none";
  290. encrypt_protocol.style.display = "none";
  291. showpawd1.style.display = "none";
  292. showpawd2.style.display = "none";
  293. }
  294. version12.style.display = "block";
  295. community.style.display = "none";
  296. }
  297. else
  298. {
  299. version12.style.display = "none";
  300. community.style.display = "block";
  301. Attclass.style.display = "none";
  302. Att_protocol.style.display = "none";
  303. encrypt_protocol.style.display = "none";
  304. showpawd1.style.display = "none";
  305. showpawd2.style.display = "none";
  306. }
  307. }
  308. //-->
  309. </script>