admin_user.asp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. <!--#include file="common.asp"-->
  2. <!--#include file="Inc/MD5.asp"-->
  3. <!--#include file="Inc/Function.asp"-->
  4. <%
  5. Dim uid, rsRole, isAdmin
  6. uid = trim(request("uid"))
  7. if trim(Lcase(AdminName)) = "admin" then
  8. isAdmin = true
  9. else
  10. isAdmin = false
  11. end if
  12. %>
  13. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  14. <html xmlns="http://www.w3.org/1999/xhtml">
  15. <head>
  16. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  17. <title><%=systemPageTitle%></title>
  18. <link href="bs2010.css" rel="stylesheet" type="text/css" />
  19. <script type="text/javascript" src="js/share.js"></script>
  20. <script type="text/javascript" src="js/prototype.js"></script>
  21. <script language="javascript">
  22. function GetData()
  23. {
  24. url="alarm.asp";//调用页面
  25. var xmlhttp=null;
  26. if(window.XMLHttpRequest)
  27. {
  28. xmlhttp=new XMLHttpRequest();
  29. }
  30. if(!xmlhttp&&window.ActiveXObject)
  31. {
  32. try
  33. {
  34. xmlhttp=new ActiveXObject("Msxml2.XMLHTTP.5.0")
  35. }
  36. catch(e)
  37. {
  38. try
  39. {
  40. xmlhttp=new ActiveXObject("Msxml2.XMLHTTP.4.0")
  41. }
  42. catch(e){
  43. try
  44. {
  45. new ActiveXObject("Msxml2.XMLHTTP")
  46. }
  47. catch(e)
  48. {
  49. try{
  50. new ActiveXObject("Microsoft.XMLHTTP")
  51. }catch(e)
  52. {
  53. }
  54. }
  55. }
  56. }
  57. }
  58. if(!xmlhttp){alert("XMLHTTP不可用,请升级安装。");location="support/msxml.msi"}
  59. xmlhttp.open("GET",url,false);
  60. xmlhttp.send();
  61. var str = xmlhttp.responseText;
  62. document.getElementById("loadcontent").innerHTML=str;
  63. setTimeout("GetData()",<%=refreshRate%>);
  64. }
  65. </script>
  66. </head>
  67. <body onLoad="javascript:GetData();">
  68. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  69. <tr>
  70. <td class="mainbg"><table width="760" border="0" cellspacing="0" cellpadding="0">
  71. <tr>
  72. <td valign="top">
  73. <div id="loadcontent">
  74. <p></p>
  75. 数据载入中……</div>
  76. <p>
  77. <%
  78. Dim arrInvalidDir
  79. Dim pNum, pNum2, OpenTyClass, iOrderID, StructureType, HtmlDir
  80. Dim ClassLink
  81. arrInvalidDir = "HTML,JS,Special,List,Images,UploadFiles,UploadSoft,UploadSoftPic,UploadThumbs,UploadPhotos,UploadFlash,UploadVideo,UploadMusic"
  82. %>
  83. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  84. <tr>
  85. <td width="20" height="40"><span class="deviceName"><img src="images/arr1.gif" width="14" height="18" /></span></td>
  86. <td><span class="deviceName">用户管理</span></td>
  87. </tr>
  88. </table>
  89. <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>
  90. <tr class='tdbg'>
  91. <td width='70' height='30'><strong>管理导航:</strong></td>
  92. <td height='30'><a href='Admin_user.asp'><%=ChannelShortName%>用户管理首页</a>&nbsp;|&nbsp; <a href="admin_user.asp?Action=Add">添加用户</a></td>
  93. </tr></table>
  94. <%
  95. Select Case Action
  96. Case "Add"
  97. Call AddUser
  98. Case "SaveAdd"
  99. Call SaveAdd
  100. Case "Modify"
  101. Call Modify
  102. Case "SaveModify"
  103. Call SaveModify
  104. Case "ModifyPurview"
  105. Call ModifyPurview
  106. Case "SavePurview"
  107. Call SavePurview
  108. Case "Del"
  109. Call Del
  110. Case Else
  111. Call main
  112. End Select
  113. Sub main()
  114. Dim arrShowLine(20), i
  115. For i = 0 To UBound(arrShowLine)
  116. arrShowLine(i) = False
  117. Next
  118. Dim sqlu, rsu, iDepth, ClassDir, ClassItemDir
  119. sqlu = "select * from t_user_info order by id"
  120. Set rsu = Conn.Execute(sqlu)
  121. %>
  122. <br>
  123. <table width='100%' border='0' align='center' cellpadding='0' cellspacing='1' bgcolor="#CCCCCC" class='border'>
  124. <tr class='title' height='22'>
  125. <td width='30' align='center' class="deviceTdTitle"><strong>ID</strong></td>
  126. <td align='center' class="deviceTdTitle"><strong>用户名</strong></td>
  127. <td width='100' align='center' class="deviceTdTitle">状态</td>
  128. <td width='300' align='center' class="deviceTdTitle"><strong>操作选项</strong></td>
  129. </tr>
  130. <%
  131. If rsu.BOF And rsu.EOF Then
  132. Response.Write "<tr><td colspan='10' height='50' align='center'>没有任何用户</td></tr>"
  133. Else
  134. Do While Not rsu.EOF
  135. if rsu("id") = 1 then
  136. else
  137. %>
  138. <tr class='deviceTd'>
  139. <td width='30' align='center'><%=rsu("id")%></td>
  140. <td><%
  141. Response.Write "<a href='admin_user.asp?Action=Modify&uid=" & rsu("uid") & "'>" & rsu("uid") & "</a>"
  142. 'Response.Write "&nbsp;&nbsp;" & rsu("t_classid") & "," & rsu("PrevID") & "," & rsu("NextID") & "," & rsu("ParentID") & "," & rsu("RootID")
  143. %> </td>
  144. <td align='center'><%if rsu("status") = 0 then response.write "<span style='color:green'>正常</span>" else response.write "<span style='color:red'>禁用</span>"%></td>
  145. <%
  146. if lcase(trim(AdminName)) <> "admin" and lcase(trim(rsu("uid"))) = "admin" then
  147. response.write "<td align='center'></td>"
  148. else
  149. %>
  150. <td align='center'>&nbsp;<a href='admin_user.asp?ChannelID=<%=ChannelID%>&Action=Modify&uid=<%=rsu("uid")%>'>修改信息</a>
  151. <%if trim(lcase(AdminName)) <> trim(lcase(rsu("uid"))) then%>
  152. |&nbsp;<a href='admin_user.asp?Action=Del&uid=<%=rsu("uid")%>' onClick='return ConfirmDel();'>删除</a>
  153. <%end if%> </td>
  154. <%end if%>
  155. </tr>
  156. <%
  157. end if
  158. rsu.MoveNext
  159. Loop
  160. End If
  161. rsu.Close
  162. Set rsu = Nothing
  163. %>
  164. </table>
  165. <table width='100%'><tr><form name='form1' action='admin_user.asp' method='post'><td align='center'></td></form></tr></table>
  166. <script language='JavaScript' type='text/JavaScript'>
  167. function ConfirmDel(){
  168. alert('确实要删除此用户吗?');}
  169. </script>
  170. <br>
  171. <%
  172. End Sub
  173. Sub AddUser()
  174. %>
  175. <br><table width='100%'><tr><td align='left'>您现在的位置:<a href='admin_user.asp?ChannelID=<%=ChannelID%>'>用户管理</a>&nbsp;&gt;&gt;&nbsp;添加用户</td></tr></table>
  176. <form name='form1' method='post' action='admin_user.asp' onsubmit='return check()'>
  177. <table width='100%' border='0' align='center' cellpadding='5' cellspacing='1' class='border'><tr class='tdbg'><td height='100' valign='top'>
  178. <table width='95%' align='center' cellpadding='2' cellspacing='1' bgcolor='#CCCCCC'>
  179. <tr class='deviceTd'>
  180. <td width='106' class='tdbg5'><strong>用户名称:</strong></td>
  181. <td width="601" colspan="3"><input name='UserName' type='text' size='20' maxlength='80'> <font color=red>*</font></td>
  182. </tr>
  183. <tr class='deviceTd'>
  184. <td class='tdbg5'><strong>用户密码:</strong></td>
  185. <td colspan="3"><input name='pwd' type='password' id="pwd" size='20' maxlength='80' />
  186. <font color="red">*</font></td>
  187. </tr>
  188. <tr class='deviceTd'>
  189. <td class='tdbg5'><strong>确认密码:</strong></td>
  190. <td colspan="3"><input name='cpwd' type='password' id="cpwd" size='20' maxlength='80' />
  191. <font color="red">*</font></td>
  192. </tr>
  193. <tr class='deviceTd'>
  194. <td valign="top" class='tdbg5'><strong>状态:</strong></td>
  195. <td colspan="3"><label>
  196. <input type="checkbox" name="status" id="status" />
  197. 禁用</label></td>
  198. </tr>
  199. <tr class='deviceTd'>
  200. <td valign="top" class='tdbg5'><strong>电话:</strong></td>
  201. <td><input name='tel' type='text' id="tel" size='20' maxlength='80' /></td>
  202. <td><strong>手机:</strong></td>
  203. <td><input name='mobiletel' type='text' id="mobiletel" size='20' maxlength='80' /></td>
  204. </tr>
  205. <tr class='deviceTd'>
  206. <td valign="top" class='tdbg5'><strong>传真:</strong></td>
  207. <td><input name='fax' type='text' id="fax" size='20' maxlength='80' /></td>
  208. <td><strong>Email:</strong></td>
  209. <td><input name='email' type='text' id="email" size='20' maxlength='80' /></td>
  210. </tr>
  211. <tr class='deviceTd'>
  212. <td width='106' valign="top" class='tdbg5'><strong>设备权限:</strong></td>
  213. <td colspan="3">
  214. <%
  215. dim rsequiplist, sql, i, rc
  216. i = 1
  217. sql = "select uid, devicename from t_dev_property order by id"
  218. set rsequiplist = server.CreateObject("adodb.recordset")
  219. rsequiplist.open sql, conn, 1, 1
  220. if rsequiplist.bof and rsequiplist.eof then
  221. response.write "没有设备"
  222. else
  223. %>
  224. <table width="300" border="0" cellspacing="0" cellpadding="0" id="purview">
  225. <%do while not rsequiplist.eof%>
  226. <tr>
  227. <td width="26">&nbsp;</td>
  228. <td>
  229. <label style="cursor:pointer">
  230. <input type="checkbox" name="e<%=i%>" id="e<%=i%>" value="<%=rsequiplist("uid")%>" />
  231. <%=rsequiplist("devicename")%></label> </td>
  232. </tr>
  233. <%
  234. i = i + 1
  235. rsequiplist.movenext
  236. loop
  237. end if
  238. rc = rsequiplist.recordcount
  239. rsequiplist.close
  240. set rsequiplist = nothing
  241. %>
  242. </table></td>
  243. </tr>
  244. </table>
  245. </td></tr></table>
  246. <table width='100%' border='0' align='center'>
  247. <tr class='tdbg'>
  248. <td height='40' colspan='2' align='center'>
  249. <input name='Action' type='hidden' id='Action' value='SaveAdd'>
  250. <input name='rc' type="hidden" id="rc" value="<%=rc%>" />
  251. <input name='Add' type='submit' value=' 添 加 ' style='cursor:hand;'>&nbsp;&nbsp;<input name='Cancel' type='button' id='Cancel' value=' 取 消 ' onClick="window.location.href='admin_user.asp?ChannelID=<%=ChannelID%>'" style='cursor:hand;'> </td>
  252. </tr>
  253. </table>
  254. </form>
  255. <%
  256. Call WriteJS
  257. End Sub
  258. Sub WriteJS()
  259. %>
  260. <script language='JavaScript' type='text/JavaScript'>
  261. function check(){
  262. if (document.form1.UserName.value==''){
  263. alert('用户名称不能为空!');
  264. document.form1.UserName.focus();
  265. return false;}
  266. if(document.form1.pwd.value == ''){
  267. alert('密码不能为空!');
  268. document.form1.pwd.focus();
  269. return false;}
  270. if(document.form1.cpwd.value == ''){
  271. alert('确认密码不能为空!');
  272. document.form1.cpwd.focus();
  273. return false;}
  274. if(document.form1.pwd.value != document.form1.cpwd.value){
  275. alert('两次输入的密码不同!');
  276. document.form1.pwd.focus();
  277. return false;}
  278. }
  279. function showPurview(v){
  280. if (v == 1){
  281. document.getElementById("purview").style.display = 'none';
  282. }else if (v == 18){
  283. document.getElementById("purview").style.display = '';
  284. }else{
  285. document.getElementById("purview").style.display = 'none';
  286. }
  287. }
  288. </script>
  289. <%
  290. End Sub
  291. Sub SaveAdd()
  292. dim uid, pwd, cpwd, tel, mobiletel, fax, email, rc, i, arr_str, arr, e, statu
  293. dim rs1,rs2,sql, max1, max2
  294. uid = trim(request("UserName"))
  295. pwd = MD5(trim(request("pwd")),32)
  296. cpwd = MD5(trim(request("cpwd")),32)
  297. tel = trim(request("tel"))
  298. mobiletel = trim(request("mobiletel"))
  299. fax = trim(request("fax"))
  300. email = trim(request("email"))
  301. rc = trim(request("rc"))
  302. statu = trim(request("status"))
  303. if statu = "on" then
  304. statu = true
  305. else
  306. statu = false
  307. end if
  308. if uid = "" then
  309. ErrMsg = "用户名不能为空!"
  310. FoundErr = True
  311. end if
  312. if trim(request("pwd")) = "" then
  313. ErrMsg = "密码不能为空!"
  314. FoundErr = True
  315. end if
  316. if trim(request("cpwd")) = "" then
  317. ErrMsg = "确认密码不能为空!"
  318. FoundErr = True
  319. end if
  320. if pwd <> cpwd then
  321. ErrMsg = "两次输入的密码不同!"
  322. FoundErr = True
  323. end if
  324. isExist = conn.execute("select count(uid) from t_user_info where uid = '" & uid & "'")
  325. if isExist(0) > 0 then
  326. ErrMsg = "用户名已存在!"
  327. FoundErr = True
  328. end if
  329. If FoundErr = True Then
  330. Call WriteErrMsg(ErrMsg, ComeUrl)
  331. exit sub
  332. End If
  333. for i = 1 to rc
  334. e = trim(request("e"&i))
  335. if e <> "" then
  336. if arr_str = "" then
  337. arr_str = "'"&e&"'"
  338. else
  339. arr_str = arr_str & "," & "'"&e&"'"
  340. end if
  341. end if
  342. next
  343. set rs1 = conn.execute("select id from t_user_info order by id desc limit 1")
  344. if rs1.bof and rs1.eof then max1 = 1 else max1 = rs1(0)+1
  345. conn.execute("insert into t_user_info (uid,pwd,username,tel,mobiletel,fax,email,id,status) values ('"&uid&"','"&pwd&"','"&uid&"','"&tel&"','"&mobiletel&"','"&fax&"','"&email&"',"&max1&","&statu&")")
  346. 'conn.execute("delete from t_role_equip where userid = " & uid)
  347. arr = split(arr_str, ",")
  348. for i = lbound(arr) to ubound(arr)
  349. conn.execute("insert into t_role_equip (userid,uid) values ('"&uid&"','"&replace(arr(i),"'","")&"')")
  350. next
  351. rs1.close
  352. set rs1 = nothing
  353. response.Redirect("admin_user.asp")
  354. End Sub
  355. Sub Modify()
  356. dim rs, rs2, rs3, uid, userType, isChecked
  357. uid = trim(request("uid"))
  358. if uid = "" then
  359. ErrMsg = "参数错误!"
  360. FoundErr = True
  361. end if
  362. set rs = conn.execute("select * from t_user_info where uid = '"&uid&"'")
  363. if rs.bof and rs.eof then
  364. ErrMsg = "不存在此用户!"
  365. FoundErr = True
  366. end if
  367. %>
  368. <br><table width='100%'><tr><td align='left'>您现在的位置:<a href='admin_user.asp?ChannelID=<%=ChannelID%>'>用户管理</a>&nbsp;&gt;&gt;&nbsp;修改用户信息</td></tr></table>
  369. <form name='form1' method='post' action='admin_user.asp' onsubmit='return check()'>
  370. <table width='100%' border='0' align='center' cellpadding='5' cellspacing='1' class='border'><tr class='tdbg'><td height='100' valign='top'>
  371. <table width='95%' align='center' cellpadding='2' cellspacing='1' bgcolor='#CCCCCC'>
  372. <tr class='deviceTd'>
  373. <td width='106' class='tdbg5'><strong>用户名称:</strong></td>
  374. <td width="601" colspan="3"><%=rs("uid")%></td>
  375. </tr>
  376. <tr class='deviceTd'>
  377. <td class='tdbg5'><strong>用户密码:</strong></td>
  378. <td colspan="3"><input name='pwd' type='password' id="pwd" size='20' maxlength='80' /></td>
  379. </tr>
  380. <tr class='deviceTd'>
  381. <td class='tdbg5'><strong>确认密码:</strong></td>
  382. <td colspan="3"><input name='cpwd' type='password' id="cpwd" size='20' maxlength='80' /></td>
  383. </tr>
  384. <tr class='deviceTd'>
  385. <td valign="top" class='tdbg5'>&nbsp;</td>
  386. <td colspan="3"><label>
  387. <input name="mpwd" type="checkbox" id="mpwd" value="yes" />
  388. <span style="color:red">修改密码(如需修改密码请勾选此项)</span></label></td>
  389. </tr>
  390. <tr class='deviceTd'>
  391. <td valign="top" class='tdbg5'><strong>状态:</strong></td>
  392. <td colspan="3"><label>
  393. <input type="checkbox" name="status" id="status" <%if rs("status") = 1 then response.write "checked"%> />
  394. 禁用</label></td>
  395. </tr>
  396. <tr class='deviceTd'>
  397. <td valign="top" class='tdbg5'><strong>电话:</strong></td>
  398. <td><input name='tel' type='text' id="tel" size='20' maxlength='80' value="<%=rs("tel")%>" /></td>
  399. <td><strong>手机:</strong></td>
  400. <td><input name='mobiletel' type='text' id="mobiletel" size='20' maxlength='80' value="<%=rs("mobiletel")%>" /></td>
  401. </tr>
  402. <tr class='deviceTd'>
  403. <td valign="top" class='tdbg5'><strong>传真:</strong></td>
  404. <td><input name='fax' type='text' id="fax" size='20' maxlength='80' value="<%=rs("fax")%>" /></td>
  405. <td><strong>Email:</strong></td>
  406. <td><input name='email' type='text' id="email" size='20' maxlength='80' value="<%=rs("email")%>" /></td>
  407. </tr>
  408. <tr class='deviceTd' style='display:<%if trim(Lcase(uid)) = "admin" then response.write "none"%>;'>
  409. <td width='106' valign="top" class='tdbg5'><strong>设备权限:</strong></td>
  410. <td colspan="3">
  411. <%
  412. dim rsequiplist, sql, i, rc
  413. i = 1
  414. sql = "select uid, devicename from t_dev_property order by id"
  415. set rsequiplist = server.CreateObject("adodb.recordset")
  416. rsequiplist.open sql, conn, 1, 1
  417. if rsequiplist.bof and rsequiplist.eof then
  418. response.write "没有设备"
  419. else
  420. %>
  421. <table width="300" border="0" cellspacing="0" cellpadding="0" id="purview">
  422. <%do while not rsequiplist.eof%>
  423. <tr>
  424. <td width="26">&nbsp;</td>
  425. <td>
  426. <%
  427. set rs3 = conn.execute("select * from t_role_equip where uid = '"&rsequiplist("uid")&"' and userid = '"&uid&"'")
  428. if rs3.bof and rs3.eof then isChecked = "" else isChecked = "checked"
  429. %>
  430. <label style="cursor:pointer">
  431. <input type="checkbox" name="e<%=i%>" id="e<%=i%>" value="<%=rsequiplist("uid")%>" <%=isChecked%> />
  432. <%=rsequiplist("devicename")%></label> </td>
  433. </tr>
  434. <%
  435. i = i + 1
  436. rsequiplist.movenext
  437. loop
  438. end if
  439. rc = rsequiplist.recordcount
  440. rsequiplist.close
  441. set rsequiplist = nothing
  442. %>
  443. </table></td>
  444. </tr>
  445. </table>
  446. </td></tr></table>
  447. <table width='100%' border='0' align='center'>
  448. <tr class='tdbg'>
  449. <td height='40' colspan='2' align='center'>
  450. <input name='Action' type='hidden' id='Action' value='SaveModify'>
  451. <input name='rc' type='hidden' id='rc' value='<%=rc%>'>
  452. <input name='UserName' id='UserName' type='hidden' value='<%=uid%>' />
  453. <input name='Add' type='submit' value=' 修 改 ' style='cursor:hand;'>&nbsp;&nbsp;<input name='Cancel' type='button' id='Cancel' value=' 取 消 ' onClick="window.location.href='admin_user.asp'" style='cursor:hand;'> </td>
  454. </tr>
  455. </table>
  456. </form>
  457. <%
  458. Call WriteJS2
  459. End Sub
  460. Sub WriteJS2()
  461. %>
  462. <script language='JavaScript' type='text/JavaScript'>
  463. function check(){
  464. if (document.form1.UserName.value==''){
  465. alert('用户名称不能为空!');
  466. document.form1.UserName.focus();
  467. return false;}
  468. if(document.form1.pwd.value != document.form1.cpwd.value){
  469. alert('两次输入的密码不同!');
  470. document.form1.pwd.focus();
  471. return false;}
  472. }
  473. function showPurview(v){
  474. if (v == 1){
  475. document.getElementById("purview").style.display = 'none';
  476. }else if (v == 18){
  477. document.getElementById("purview").style.display = '';
  478. }else{
  479. document.getElementById("purview").style.display = 'none';
  480. }
  481. }
  482. </script>
  483. <%
  484. End Sub
  485. Sub SaveModify()
  486. dim uid, pwd, cpwd, tel, mobiletel, fax, email, rc, i, arr_str, arr, e, mpwd, statu
  487. dim rs1,rs2,sql, max1, max2
  488. uid = trim(request("UserName"))
  489. pwd = MD5(trim(request("pwd")),32)
  490. cpwd = MD5(trim(request("cpwd")),32)
  491. mpwd = trim(request("mpwd"))
  492. tel = trim(request("tel"))
  493. mobiletel = trim(request("mobiletel"))
  494. fax = trim(request("fax"))
  495. email = trim(request("email"))
  496. rc = trim(request("rc"))
  497. statu = trim(request("status"))
  498. if statu = "on" then
  499. statu = true
  500. else
  501. statu = false
  502. end if
  503. if uid = "" then
  504. ErrMsg = "用户名不能为空!"
  505. FoundErr = True
  506. end if
  507. if mpwd = "yes" then
  508. if trim(request("pwd")) = "" then
  509. ErrMsg = "密码不能为空!"
  510. FoundErr = True
  511. end if
  512. if trim(request("cpwd")) = "" then
  513. ErrMsg = "确认密码不能为空!"
  514. FoundErr = True
  515. end if
  516. if trim(request("pwd")) <> trim(request("cpwd")) then
  517. ErrMsg = "两次输入的密码不同!"
  518. FoundErr = True
  519. end if
  520. end if
  521. If FoundErr = True Then
  522. Call WriteErrMsg(ErrMsg, ComeUrl)
  523. exit sub
  524. End If
  525. for i = 1 to rc
  526. e = trim(request("e"&i))
  527. if e <> "" then
  528. if arr_str = "" then
  529. arr_str = "'"&e&"'"
  530. else
  531. arr_str = arr_str & "," & "'"&e&"'"
  532. end if
  533. end if
  534. next
  535. if mpwd = "yes" then
  536. conn.execute("update t_user_info set pwd='"&pwd&"',tel='"&tel&"',mobiletel='"&mobiletel&"',fax='"&fax&"',email='"&email&"',status="&statu&" where uid='"&uid&"'")
  537. else
  538. conn.execute("update t_user_info set tel='"&tel&"',mobiletel='"&mobiletel&"',fax='"&fax&"',email='"&email&"',status="&statu&" where uid='"&uid&"'")
  539. end if
  540. if uid <> "admin" then
  541. conn.execute("delete from t_role_equip where userid = '" & uid & "'")
  542. arr = split(arr_str, ",")
  543. for i = lbound(arr) to ubound(arr)
  544. conn.execute("insert into t_role_equip (userid,uid) values ('"&uid&"','"&replace(arr(i),"'","")&"')")
  545. next
  546. end if
  547. response.Redirect("admin_user.asp")
  548. End Sub
  549. Sub Del()
  550. dim uid, rs, userType
  551. uid = trim(request("uid"))
  552. 'set rs = conn.execute("select group_id from t_role_user where userid = '" & uid & "'")
  553. 'if rs.bof and rs.eof then userType = 18 else userType = rs(0)
  554. conn.execute("delete from t_user_info where uid = '" & uid & "'")
  555. conn.execute("delete from t_role_equip where userid = '"&uid&"'")
  556. response.Redirect "admin_user.asp"
  557. End Sub
  558. %>
  559. </p>
  560. <p>&nbsp; </p> </td>
  561. </tr>
  562. </table></td>
  563. </tr>
  564. <tr>
  565. <td>&nbsp;</td>
  566. </tr>
  567. </table>
  568. </body>
  569. </html>
  570. <%
  571. Call CloseConn
  572. %>