home *** CD-ROM | disk | FTP | other *** search
/ 221.214.14.186 / 221.214.14.186.tar / 221.214.14.186 / zb / Notepad-zb / userModify.asp < prev   
Text File  |  2005-12-26  |  8KB  |  258 lines

  1. <!--#include file=conn.asp-->
  2. <!--#include file=const.asp -->
  3. <!--#include file=md5.asp -->
  4. <% dim rs , exec %>
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  8. <title><%=sitetitle%></title>
  9. <link rel="stylesheet" href="style/<%=skin%>.css" type="text/css">
  10. </head>
  11.  
  12. <body>
  13. <!--#include file="head.asp"-->
  14. <br>
  15. <table border="0" width="400" cellspacing="0" cellpadding="10" bordercolorlight="#000000" bordercolordark="#FFFFFF" align="center" class="table004">
  16.  <tr> 
  17.   <td class=table003 align=center>╫ó▓ß╙├╗º╫╩┴╧╨▐╕─
  18.   </td>
  19.   </tr>
  20.   <tr>
  21.   
  22.   <td class="table001" align="center"> 
  23. <%
  24. main()
  25. connclose()
  26.  
  27. sub main()
  28.     dim backInput, homeInput
  29.  
  30.     backInput= "<br><br><input type=button value=╖╡╗╪╟░╥│ onClick=history.back() class=input2 name=button ><br>"
  31.     homeInput="<br><br><input type=button value=╜°╚δ┴⌠╤╘▒╛╩╫╥│ onClick=""location.href='index.asp' "" class=input2><br>"
  32.  
  33.     if request.form="" then
  34. %>
  35.  
  36.    <form name="form1" method="post">
  37.     <table width="80%" border="0">
  38.      <tr> 
  39.       <td width="30%">╙├ ╗º ├√ú║</td>
  40.       <td width="70%"> 
  41.        <input type="text" name="name" size="20" class="input1" value="<%=theUser.name%>" <%if not theUser.admin then response.write "readonly" end if%> maxlength="20">
  42.       </td>
  43.     </tr>
  44.      <tr> 
  45.       <td>╛╔ ├▄ ┬δú║</td>
  46.       <td> 
  47.        <input type="password" name="pass" size="20" class="input1" value="" maxlength="20" >
  48.       </td>
  49.      </tr>
  50.     <tr> 
  51.      <td>╨┬ ├▄ ┬δú║</td>
  52.      <td>
  53.        <input type="password" name="npass1" size="20" class="input1" maxlength="20" >
  54.       </td>
  55.     </tr>
  56.     <tr> 
  57.      <td>├▄┬δ╚╖╚╧ú║</td>
  58.      <td>
  59.        <input type="password" name="npass2" size="20" class="input1" maxlength="20" >
  60.       </td>
  61.     </tr>
  62.     <tr>
  63.       <td>╨╘íííí▒≡ú║</td>
  64.       <td >
  65.        <input type="radio" name="male" value="1" <% if theUser.male then response.write "checked" %>>─╨
  66.        <input type="radio" name="male" value="0" <% if not theUser.male then response.write "checked" %> >┼«
  67.      ú¿╥╤╫ó▓ß╙├╗º▓╗╙├╠εú⌐
  68.       </td>
  69.      </tr>
  70.      <tr> 
  71.       <td>═╖íííí╧±ú║</td>
  72.       <td >
  73.        <a href=### onclick=window.open("face.asp","face","width=400,height=400,resizable=1,scrollbars=1") title=╡π╗≈╤í╘±═╖╧±>
  74.        <img src="<%if theUser.face<>"" then response.write theUser.face else response.write "face/m01.gif"%>" border=0 id="faceImg"></a>
  75.        <input class="input1" <%if theUser.master then response.write "type=text onchange=document.all.faceImg.src=this.value" else response.write "type=hidden"%> name="face" value="<%if theUser.face<>"" then response.write theUser.face else response.write "face/m01.gif"%>">
  76.       </td>
  77.      </tr>
  78.      <tr> 
  79.       <td>╡τ╫╙╙╩╝■ú║</td>
  80.       <td> 
  81.        <input type="text" name="email" size="20" class="input1" value="<%=theUser.email%>">
  82.       </td>
  83.      </tr>
  84.      <tr> 
  85.       <td>íí QQ ííú║</td>
  86.       <td>
  87.        <input type="text" name="qq" size="20" class="input1" value="<%=theUser.qq%>">
  88.       </td>
  89.      </tr>
  90.      <tr> 
  91.       <td>íí ICQ  ú║</td>
  92.       <td>
  93.        <input type="text" name="icq" size="20" class="input1" value="<%=theUser.icq%>">
  94.       </td>
  95.      </tr>
  96.      <tr> 
  97.       <td>íí MSN  ú║</td>
  98.       <td>
  99.        <input type="text" name="msn" size="20" class="input1" value="<%=theUser.msn%>">
  100.       </td>
  101.      </tr>
  102.      <tr> 
  103.       <td>╓≈╥│╡╪╓╖ú║</td>
  104.       <td> 
  105.        <input type="text" name="url" size="30" value="<% if theUser.url="" then response.write "http://" else response.write theUser.url%>" class="input1">
  106.       </td>
  107.      </tr>
  108.      <tr align="center"> 
  109.       <td colspan="2" height="40"> 
  110.        <input type="submit" value=" ╕ⁿ ╕─ " class="input2" name="Submit" >
  111.       </td>
  112.     </tr>
  113.    </table>
  114.    </form>
  115. <%
  116.     else
  117.         dim name, pass, npass1, npass2,male,face,email,qq,url,icq,msn
  118.         name=Encodestr(request.form("name"))
  119.         pass=Encodestr(request.form("pass"))
  120.         npass1=Encodestr(request.form("npass1"))
  121.         npass2=Encodestr(request.form("npass2"))
  122.         male=Encodestr(request.form("male"))
  123.         face=Encodestr(request.form("face"))
  124.         email=Encodestr(request.form("email"))
  125.         qq=Encodestr(request.form("qq"))
  126.         url=Encodestr(request.form("url"))
  127.         icq=Encodestr(request.form("icq"))
  128.         msn=Encodestr(request.form("msn"))
  129.         
  130.         if not theUser.reged then
  131.             response.write "<font color=red>╖ó╔·┤φ╬≤</font><br><br>─π╗╣├╗╙╨╡╟┬╜ú¼▓╗─▄╨▐╕─╫╩┴╧úí"
  132.             response.write backinput
  133.             exit sub    
  134.         end if
  135.         
  136.         if name="" or pass="" then
  137.             response.write "<font color=red>╖ó╔·┤φ╬≤</font><br><br>╟δ╩Σ╚δ╙├╗º├√║═├▄┬δúíúíúí"
  138.             response.write backInput
  139.             exit sub
  140.         end if
  141.         if npass1<>npass2 then
  142.             response.write "<font color=red>╖ó╔·┤φ╬≤</font><br><br>╨┬├▄┬δ║═╚╖╚╧├▄┬δ╥¬╧α═¼úíúíúí"
  143.             response.write backInput
  144.             exit sub
  145.         end if
  146.         
  147.         pass=MD5(pass)
  148.         set rs=server.createobject("adodb.recordset")
  149.         
  150.         if theUser.admin and theUser.name<>name then
  151.             exec="select userid from [user] where username='"& replace(name,"'","") &"' and userid<>"& theUser.id
  152.             rs.open exec,conn,1,1
  153.             if not rs.eof then
  154.                 response.write "<font color=red>╖ó╔·┤φ╬≤</font><br><br>╨┬╙├╗º├√╥╤╛¡╙╨╚╦╩╣╙├úíúíúí"
  155.                 response.write backInput
  156.                 exit sub
  157.             end if
  158.             rs.close
  159.         end if
  160.         
  161.         exec="select * from [user] where userid="&theUser.id
  162.         rs.open exec,conn,1,3
  163.         if rs.eof then
  164.             rsclose()
  165.             response.write "<font color=red>╖ó╔·┤φ╬≤</font><br><br>╙├╗º├√▓╗┤µ╘┌╗≥├▄┬δ┤φ╬≤úíúíúí"
  166.             response.write backInput
  167.             exit sub
  168.         end if
  169.         if name<>theUser.name then
  170.             rs("username")=name
  171.         end if
  172.         if npass1<>"" then
  173.             pass=MD5(npass1)
  174.             rs("userpassword")=pass
  175.         end if
  176.         if rs("sex")="1" and male="0" or rs("sex")<>"1" and male="1" then
  177.             rs("sex")=male
  178.             exec="update ly set male='"&male&"' where bl=1 and name='"&name&"'"
  179.             conn.execute(exec)
  180.         end if
  181.         if rs("GBface")="" or rs("GBface")<>face then
  182.             rs("GBface")=face
  183.             exec="update ly set face='"&face&"' where bl=1 and name='"&name&"'"
  184.             conn.execute(exec)
  185.         end if
  186.         if isNull(rs("useremail")) or rs("useremail")<>email then
  187.             if email="" then
  188.                 rs("useremail")=null
  189.                 exec="update ly set email=null where bl=1 and name='"&name&"'"
  190.             else
  191.                 rs("useremail")=email
  192.                 exec="update ly set email='"&email&"' where bl=1 and name='"&name&"'"
  193.             end if
  194.             conn.execute(exec)
  195.         end if
  196.         if isNull(rs("oicq")) or rs("oicq")<>qq then
  197.             if qq="" then
  198.                 rs("oicq")=null
  199.                 exec="update ly set qq=null where bl=1 and name='"&name&"'"
  200.             else
  201.                 rs("oicq")=qq
  202.                 exec="update ly set qq='"&qq&"' where bl=1 and name='"&name&"'"
  203.             end if
  204.             conn.execute(exec)
  205.         end if
  206.         if isNull(rs("homepage")) or rs("homepage")<>url then
  207.             if url="" then
  208.                 rs("homepage")=null
  209.                 exec="update ly set url=null where bl=1 and name='"&name&"'"
  210.             else
  211.                 rs("homepage")=url
  212.                 exec="update ly set url='"&url&"' where bl=1 and name='"&name&"'"
  213.             end if
  214.             conn.execute(exec)
  215.         end if
  216.         if isNull(rs("icq")) or rs("icq")<>icq then
  217.             if icq="" then
  218.                 rs("icq")=null
  219.                 exec="update ly set icq=null where bl=1 and name='"&name&"'"
  220.             else
  221.                 rs("icq")=icq
  222.                 exec="update ly set icq='"&icq&"' where bl=1 and name='"&name&"'"
  223.             end if
  224.             conn.execute(exec)
  225.         end if
  226.         if isNull(rs("msn")) or rs("msn")<>msn then
  227.             if msn="" then
  228.                 rs("msn")=null
  229.                 exec="update ly set msn=null where bl=1 and name='"&name&"'"
  230.             else
  231.                 rs("msn")=msn
  232.                 exec="update ly set msn='"&msn&"' where bl=1 and name='"&name&"'"
  233.             end if
  234.             conn.execute(exec)
  235.         end if
  236.         
  237.         rs.update
  238.         rsclose()
  239.         response.write "<font color=red>╨▐╕─│╔╣ªúíúíúí</font>"
  240.         response.write homeInput
  241.  
  242.         if cookiePath<>"" then
  243.             response.cookies("gbook").Path=cookiePath
  244.         end if
  245.         response.cookies("gbook")("username")=vbescape(name)
  246.         response.cookies("gbook")("password")=pass
  247.  
  248.     end if
  249. end sub %>
  250.    </td>
  251.  </tr>
  252. </table>
  253. <!--#include file="foot.asp"-->
  254.  
  255. </body>
  256.  
  257. </html>
  258.