config.asp
上传用户:shbosideng
上传日期:2013-05-04
资源大小:1555k
文件大小:13k
源码类别:

SNMP编程

开发平台:

C/C++

  1. <% @LANGUAGE="VBSCRIPT"        %>
  2. <% Response.Expires = 0        %>
  3. <% Server.ScriptTimeout = 1200 %>
  4. <!-- #INCLUDE FILE="monitor.inc" -->
  5. <%
  6.   If ID = "" Then
  7.     Response.Redirect(NoAuthURL)
  8.   End If
  9.   ' We only execute this code if the user actually submitted the configuration form from the page.
  10.   If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
  11.   
  12.     ' Get the values that he or she entered at the configuration page.
  13.     Password = Request.Form("Password")                    ' The circuit password.
  14.     NewPassword = Request.Form("NewPassword")              ' Change password.
  15.     NewConfirmedPassword = Request.Form("ConfirmPassword") ' Change password confirmation.
  16.     EMail = Request.Form("TechEMail")                      ' Technical E-Mail address.
  17.     Graph_Daily = Request.Form("Daily_Graph")              ' Display Daily Graphs.
  18.     Graph_Weekly = Request.Form("Weekly_Graph")            ' Display Weekly Grahps.
  19.     Graph_Monthly = Request.Form("Monthly_Graph")          ' Dispaly Monthly Graphs.
  20.     Graph_Yearly =  Request.Form("Yearly_Graph")           ' Display Yearly Graphs.
  21.     ' Check Graph_Daily
  22.     If Graph_Daily = "" Then
  23.       Graph_Daily = 0
  24.     Else
  25.       Graph_Daily = 1
  26.     End If
  27.     
  28.     ' Check Graph_Weekly
  29.     If Graph_Weekly = "" Then
  30.       Graph_Weekly = 0
  31.     Else
  32.       Graph_Weekly = 1
  33.     End If
  34.     
  35.     ' Check Graph_Monthly
  36.     If Graph_Monthly = "" Then
  37.       Graph_Monthly = 0
  38.     Else
  39.       Graph_Monthly = 1
  40.     End If
  41.     
  42.     ' Check Graph_Yearly
  43.     If Graph_Yearly = "" Then
  44.       Graph_Yearly = 0
  45.     Else
  46.       Graph_Yearly = 1
  47.     End If
  48.     
  49.     ' Did the user enter his or her password?
  50.     If Password = "" Then                                  ' We dont have a password!
  51.       Error = "Please Enter Your Password"
  52.     End If
  53.     ' Now that we have the password, compare in in the database...
  54.     set rsPassword = DBConn.Execute("SELECT LinePassword FROM Monitor_Authenticate WHERE ID=" & ID)
  55.     
  56.     TempPass = rsPassword("LinePassword")                  ' Get the password in the database.
  57.     rsPassword.close                                       ' Close the lookup record.
  58.     Set rsPassword = Nothing
  59.         
  60.     If Password <> TempPass Then                           ' The password did not match the database.
  61.       Error = "Invalid Password"
  62.     End If
  63.     If NewPassword <> "" Then                              ' Compare the NewPassword with the 
  64.                                                            ' ConfirmedPassword...
  65.       If NewPassword <> NewConfirmedPassword Then          ' The two password do not match.
  66.         Error="Your Passwords Did Not Match"
  67.       Else
  68.         Password = NewPassword                             ' Set the new password to be updated in the
  69.                                                            ' database.
  70.       End If
  71.     End If
  72.     If Error = "" Then                                     ' If we do not have a error, everything is
  73.                                                            ' well, lets update the records.
  74.       If ID <> 1 Then                                      ' ID 1 is the guest account, dont update the
  75.                                                            ' database.
  76.         set rsUpdate = DBConn.Execute("UPDATE Monitor_Authenticate SET LinePassword='" & Password & "', " &_
  77.                                                                        "EMail_Address='" & EMail & "', " &_
  78.                                                                        "Graph_Day=" & Graph_Daily & ", " &_
  79.                                                                        "Graph_Week=" & Graph_Weekly & ", " &_
  80.                                                                        "Graph_Month=" & Graph_Monthly & ", " &_
  81.                                                                        "Graph_Year=" & Graph_Yearly &_
  82.                                                                        " WHERE (ID=" & ID & ")")
  83.         Set rsUpdate = nothing                               ' Database update successfull.
  84.       End If    
  85.       ' Update Session information...
  86.       Session("DBLinePassword") = Password                 ' Update the password for the session.
  87.       Session("DBEMail_Address") = EMail                   ' Update the E-Mail for the session.
  88.       If Graph_Daily = 1 Then                              ' Daily Graph
  89.         Session("DBGraph_Day") = True
  90.       Else
  91.         Session("DBGraph_Day") = False
  92.       End If
  93.       If Graph_Weekly = 1 Then                             ' Weekly Graph
  94.         Session("DBGraph_Week") = True
  95.       Else
  96.         Session("DBGraph_Week") = False
  97.       End If
  98.       If Graph_Monthly = 1 Then                            ' Monthly Graph
  99.         Session("DBGraph_Month") = True
  100.       Else
  101.         Session("DBGraph_Month") = False
  102.       End If
  103.       If Graph_Yearly = 1 Then                             ' Yearly Graph
  104.         Session("DBGraph_Year") = True
  105.       Else
  106.         Session("DBGraph_Year") = False
  107.       End If
  108.       
  109.       Response.Redirect(MonitorURL)                        ' Everything is updated, go back to
  110.                                                            ' monitor.
  111.     End If
  112.     
  113.   End If   
  114. %>
  115. <html>
  116. <head>
  117. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  118. <meta http-equiv="Cache-Control" content="No Cache">
  119. <meta http-equiv="Pragma" content="No Cache">
  120. <meta http-equiv="Expires" content="0">
  121. <link rel="StyleSheet" href="global/main.css" type="text/css">
  122. <style type="text/css">
  123. <!--
  124. a:link       { color: #003399 }
  125. a:visited    { color: #003399 }
  126. a:hover      { color: red }
  127. -->
  128. </style>
  129. </head>
  130. <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" onload="Clock()">
  131. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  132.  <tr>
  133.   <td valign="top">
  134.   <table border="0" cellpadding="0" cellspacing="0" width="100%">
  135.    <tr>
  136.     <td valign="top" align="left"><font size="1"><img src="/images/spacer.gif" width="53" height="22" alt></font></td>
  137.     <td valign="top" align="left" width="100%">
  138.     <p class="HEADING"><span class="HEADING">Monitor Configuration For Circuit Number: <%= LineNumber %></span></td>
  139.    </tr>
  140.    <tr>
  141.     <td valign="middle" align="left" colspan="2"><font size="1"><img border="0" src="/images/spacer.gif" width="110" height="19"><a href="default.asp?mode=logout">Logout
  142.     of Monitor</a><img border="0" src="/images/spacer.gif" width="25" height="19"><a href="login.asp">Bandwidth Details</a></font></td>
  143.    </tr>
  144.   </table>
  145.   <hr>
  146.   <div align="left">
  147.    <table border="0" cellpadding="2" cellspacing="0">
  148.     <tr>
  149.      <td valign="top" align="left"><font size="1">Circuit Number:</font></td>
  150.      <td valign="top" align="left"><font size="1"><%= LineNumber %></font></td>
  151.      <td valign="top" align="left"><font size="1"><img border="0" src="/images/spacer.gif" width="10" height="10"></font></td>
  152.      <td valign="top" align="left"><font size="1">Circuit Speed:</font></td>
  153.      <td valign="top" align="left"><font size="1"><%= LineSpeed %> <i>bps</i></font></td>
  154.      <td valign="top" align="left"><font size="1"><img border="0" src="/images/spacer.gif" width="10" height="10"></font></td>
  155.      <td valign="top" align="left"><font size="1">Technical Contact:</font></td>
  156.      <td><a href="mailto:<%= EMail_Address %>"><font size="1"><%= EMail_Address %></font></a></td>
  157.     </tr>
  158.     <tr>
  159.      <td colspan="8" valign="top" align="left"><font size="1">You Last Visited Monitor On: <%= LastVisit %></font></td>
  160.     </tr>
  161.    </table>
  162.   </div>
  163.   <hr>
  164.   <%' Do we have a error that the user needs to know about?
  165.   If Error <> "" Then %>
  166.   <p class="COLUMNRED"><font size="1"><%= Error %></font></p>
  167.   <% End If %>
  168.   <p><font size="1">Please take note, for your changes to take affect, you must enter your password in the first password field.&nbsp; If you wish to change your
  169.   password, you may then also complete the &quot;New Password&quot; and &quot;Confirm Password&quot; fields.</p>
  170.   <form action="/config.asp" method="POST">
  171.    <div align="left">
  172.     <table border="0" cellpadding="2" cellspacing="1" width="822">
  173.      <tr>
  174.       <td align="right" valign="top" width="210"><font size="1">Your Password:</font></td>
  175.       <td valign="top" width="106"><font size="1"><input type="password" name="Password" size="20" class="INPUT"></font></td>
  176.      </font>
  177.      <td valign="middle">
  178.      <p class="COLUMNRED">Required For <b>ANY</b> changes to be made</td>
  179.     </tr>
  180.     <font size="1">
  181.     <tr>
  182.      <td align="right" valign="top" width="210"><font size="1">Change Your Password:</font></td>
  183.      <td valign="top" width="106"><font size="1"><input type="password" name="NewPassword" size="20" class="INPUT"></font></td>
  184.      <td valign="middle"><font size="1">New Password</font></td>
  185.     </tr>
  186.     <tr>
  187.      <td align="right" valign="top" width="210"><font size="1">&nbsp;</font></td>
  188.      <td valign="top" width="106"><font size="1"><input type="password" name="ConfirmPassword" size="20" class="INPUT"></font></td>
  189.      <td valign="middle"><font size="1">Confirm Password</font></td>
  190.     </tr>
  191.     <tr>
  192.      <td align="right" valign="top" width="210"><font size="1">Technical Contact E-Mail Address:</font></td>
  193.      <td valign="top" width="106"><font size="1"><input type="text" name="TechEMail" size="20" value="<%= EMail_Address %>" class="INPUT"></font></td>
  194.     </tr>
  195.     <tr>
  196.      <td align="right" valign="top" width="210"><font size="1">Show The Daily Graph:</font></td>
  197.      <td valign="top" width="106"><font size="1"><input type="checkbox" name="Daily_Graph" value="1" <% if graph_day = true then%>checked <% end if%>></font></td>
  198.      <td valign="top"></td>
  199.     </tr>
  200.     <tr>
  201.      <td align="right" valign="top" width="210"><font size="1">Show The Weekly Graph:</font></td>
  202.      <td valign="top" width="106"><font size="1"><input type="checkbox" name="Weekly_Graph" value="1" <% if graph_week = true then %>checked<% end if %>></font></td>
  203.      <td valign="top"></td>
  204.     </tr>
  205.     <tr>
  206.      <td align="right" valign="top" width="210"><font size="1">Show The Monthly Graph:</font></td>
  207.      <td valign="top" width="106"><font size="1"><input type="checkbox" name="Monthly_Graph" value="1" <% if graph_month = true then %>checked<% end if %>></font></td>
  208.      <td valign="top"></td>
  209.     </tr>
  210.     <tr>
  211.      <td align="right" valign="top" width="210"><font size="1">Show The Yearly Graph:</font></td>
  212.      <td valign="top" width="106"><font size="1"><input type="checkbox" name="Yearly_Graph" value="1" <% if graph_year = true then %>checked<% end if %>></font></td>
  213.      <td valign="top"></td>
  214.     </tr>
  215.     <tr>
  216.      <td align="center" valign="top" colspan="2" width="322">
  217.      <p align="center"><input type="submit" value="Update Configuration" name="UPDATE" class="BUTTON"></td>
  218.      <td valign="top"></td>
  219.     </tr>
  220.       </form>
  221.     </table>
  222.    </div>
  223.    <hr>
  224.   </font></td>
  225.   </tr>
  226.  </table>
  227.  <table border="0" cellpadding="0" cellspacing="0" width="100%">
  228.   <tr>
  229.    <td>
  230.    <div align="left">
  231.     <table border="0" cellpadding="0" cellspacing="0" width="100%">
  232.      <tr>
  233.       <td colspan="2" valign="top" align="center">
  234.       <p align="center"><font size="1"><b>