Blame contrib/monitor/default.asp

Packit 667938
<% @LANGUAGE="VBSCRIPT"        %>
Packit 667938
<% Response.Expires = 0        %>
Packit 667938
<% Server.ScriptTimeout = 1200 %>
Packit 667938
<% On Error Resume Next        %>
Packit 667938
Packit 667938
<%
Packit 667938
  ' Check if we have to log out... 
Packit 667938
  If Request.QueryString("mode") = "logout" Then
Packit 667938
    ' Update the circuit access date
Packit 667938
    ' Get the record ID to update
Packit 667938
    LineID = Session("DBID")
Packit 667938
Packit 667938
    If LineID = "" Then      ' The Session Expired
Packit 667938
      Response.Redirect(LogOutURL)
Packit 667938
    End If
Packit 667938
    
Packit 667938
    Set rsAuthenticate = DBConn.Execute("UPDATE Monitor_Authenticate SET LastVisit='" &_
Packit 667938
                                           Month(Date()) & "/" & Day(Date()) & "/" &_
Packit 667938
                                           Year(Date()) & " " & Time &"' WHERE (ID=" & LineID & ")")
Packit 667938
    Session.Abandon
Packit 667938
    Response.Redirect(LogOutURL)
Packit 667938
  End If
Packit 667938
Packit 667938
' Status is a universal indicator implemented to show us which part of the authentication process is
Packit 667938
'  failing.
Packit 667938
' For now, Status has the following values.
Packit 667938
'  0)  No errors, everything was successfull.
Packit 667938
'  1)  Circuit number not found in the database.
Packit 667938
'  2)  The given password did not match for the circuit number.
Packit 667938
'  3)  We are logged out and should redirect back to SunnyLine
Packit 667938
Packit 667938
' We only execute this code if the user actually submitted the login form from the page.
Packit 667938
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Packit 667938
  
Packit 667938
  ' Get the values that he or she entered at the login page.
Packit 667938
  Number = Request.Form("Number")
Packit 667938
  Password = Request.Form("Password")
Packit 667938
Packit 667938
  ' Setup a default error code.  We use a incorrect circuit number here.
Packit 667938
  Status = 1
Packit 667938
Packit 667938
  ' Did The User Enter a circuit number & password?
Packit 667938
  If Number = "" Then
Packit 667938
    Status = 1  ' No circuit number
Packit 667938
  Elseif Password = "" Then
Packit 667938
    Status = 2  ' No password
Packit 667938
  Else
Packit 667938
    Status = 0  ' We have a circuit number & password, lets continue.
Packit 667938
  End If
Packit 667938
  
Packit 667938
  ' If we have both circuit number and password, compare it to the database.
Packit 667938
  If Status = 0 Then
Packit 667938
		
Packit 667938
    ' Pull the circuit number from the database.
Packit 667938
    Set rsAuthenticate = DBConn.Execute("SELECT * FROM Monitor_Authenticate WHERE LineNumber=" & Number)
Packit 667938
 
Packit 667938
    Do While not rsAuthenticate.EOF
Packit 667938
Packit 667938
      ' We need to give DBPassword an initial value.  If for instance, a client enteres a circuit 
Packit 667938
      '  number which is not located in the database, the lookup will fail and DBPassword won't have a 
Packit 667938
      '  value for us to compare to.  The Rnd Function should be secure enough?
Packit 667938
      DBPassword = Rnd(10)
Packit 667938
      DBID = rsAuthenticate("ID")
Packit 667938
      DBLine = rsAuthenticate("LineNumber")
Packit 667938
      DBPassword = rsAuthenticate("LinePassword")
Packit 667938
      DBSpeed = rsAuthenticate("LineSpeed")
Packit 667938
      DBEMail = rsAuthenticate("EMail_Address")
Packit 667938
      DBG_Day = rsAuthenticate("Graph_Day")
Packit 667938
      DBG_Week = rsAuthenticate("Graph_Week")
Packit 667938
      DBG_Month = rsAuthenticate("Graph_Month")
Packit 667938
      DBG_Year = rsAuthenticate("Graph_Year")
Packit 667938
      DBG_EMail = rsAuthenticate("Graph_EMail")
Packit 667938
      DBDate = rsAuthenticate("LastVisit")
Packit 667938
Packit 667938
      If DBPassword = Password Then
Packit 667938
Packit 667938
        ' We got what we wanted, close the database connection...  Just for incase.
Packit 667938
        rsAuthenticate.close
Packit 667938
        Set rsAuthenticate = nothing
Packit 667938
Packit 667938
        ' We setup the values inside the session before or after we move into monitor.
Packit 667938
        ' This is just so that we don't have to do the entire lookup process again at displaying the graps to the user, if
Packit 667938
        ' we save the values now, we are able to reference any setting in the DataBase that we would need at any given time.
Packit 667938
        Session("DBID") = DBID
Packit 667938
        Session("DBLineNumber") = DBLine
Packit 667938
        Session("DBLinePassword") = DBPassword
Packit 667938
        Session("DBLineSpeed") = DBSpeed
Packit 667938
        Session("DBEMail_Address") = DBEMail
Packit 667938
        Session("DBGraph_Day") = DBG_Day
Packit 667938
        Session("DBGraph_Week") = DBG_Week
Packit 667938
        Session("DBGraph_Month") = DBG_Month
Packit 667938
        Session("DBGraph_Year") = DBG_Year
Packit 667938
        Session("DBGraph_EMail") = DBG_EMail
Packit 667938
        Session("DBLastVisit") = DBDate
Packit 667938
Packit 667938
        ' And we redirect !!
Packit 667938
        Response.Redirect(MonitorURL)
Packit 667938
Packit 667938
      Else
Packit 667938
Packit 667938
        ' Passwords didnt match.  We are not going to worry about incorrect circuit numbers, that
Packit 667938
        '  will just make it easier for someone to maybe guess a line number if he or she has 
Packit 667938
        '  nothing better to do!
Packit 667938
        Status = 2
Packit 667938
      End If
Packit 667938
      
Packit 667938
      rsAuthenticate.MoveNext
Packit 667938
Packit 667938
    Loop
Packit 667938
     
Packit 667938
    '  If we are here, there was serious error.  This means perhaps a incorrect curciut number and or
Packit 667938
    '   incorrect password.  In any case, the lookup did fail, and we have no reference what so ever to the given value for 
Packit 667938
    '   the circuit number or password.  Close the database and send the user back to the login section.
Packit 667938
    rsAuthenticate.close
Packit 667938
    Set rsAuthenticate = nothing
Packit 667938
  End If   
Packit 667938
Packit 667938
End If
Packit 667938
%>
Packit 667938
<html>
Packit 667938
<head>
Packit 667938
<meta http-equiv="Content-Language" content="en-za">
Packit 667938
<meta http-equiv="Cache-Control" content="No Cache">
Packit 667938
<meta http-equiv="Pragma" content="No Cache">
Packit 667938
<meta http-equiv="Expires" content="0">
Packit 667938
<title>Welcome To Monitor!!</title>
Packit 667938
<link rel="StyleSheet" href="global/default.css" type="text/css">
Packit 667938
<link rel="StyleSheet" href="global/additional.css" type="text/css">
Packit 667938
</head>
Packit 667938
Packit 667938
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" onload="Clock()">
Packit 667938
Packit 667938
Packit 667938
Packit 667938
 
Packit 667938
  <font size="1"></font>
Packit 667938
  
Packit 667938
  

<font face="Verdana,Arial,Helvetica" size="1">Welcome to Monitor.SunnyLine.co.za</font>

Packit 667938
  
Packit 667938
 
Packit 667938
Packit 667938
Packit 667938

<font size="1">Congratulations on the purchase of your high-speed permanent connections to the Internet.  Please take a moment and log on to our monitoring system

Packit 667938
to see you bandwidth usage.</font>

Packit 667938
Packit 667938

<font size="1">Your Circuit number will be the number printed on your Data Unit installed by Telkom (The small black box where your NTU or Modem plugs into).  If

Packit 667938
you have any problems locating your Circuit number, or have problems authenticating with this service, please contact us for immediate assistance at support@sunnyline.co.za</font>

Packit 667938
Packit 667938

<font size="1">Wondering what is Monitor! Well, don't worry, read up all about monitor by clicking here.

Packit 667938
<form method="POST" action="default.asp">
Packit 667938
 
Packit 667938
  <center>
Packit 667938
  
Packit 667938
   
Packit 667938
    
Packit 667938
    
Packit 667938
     

<font size="1">Circuit Number:</font>

Packit 667938
    
Packit 667938
    
Packit 667938
    <font size="1"><input type="text" name="Number" size="20" value="<%= Number %>"></font>
Packit 667938
    
Packit 667938
    
Packit 667938
     

<font color="#FF0000" size="1"><% If Status = 1 Then

Packit 667938
                                             Response.Write ("Invalid Circuit Number!!!")
Packit 667938
                                           End If %></font>
Packit 667938
    
Packit 667938
    
Packit 667938
   
Packit 667938
   
Packit 667938
    
Packit 667938
    
Packit 667938
     

<font size="1">Your Password:</font>

Packit 667938
    
Packit 667938
    
Packit 667938
    <font size="1"><input type="password" name="Password" size="20" maxlength="8"></font>
Packit 667938
    
Packit 667938
    
Packit 667938
Packit 667938
     

<font color="#FF0000" size="1"><% If Status = 2 Then

Packit 667938
                                             Response.Write ("Invalid Password!!!")
Packit 667938
                                           End If %></font>
Packit 667938
    
Packit 667938
    
Packit 667938
   
Packit 667938
   
Packit 667938
    <font size="1"><input type="submit" value="Submit" class="BUTTON"></font>
Packit 667938
    
Packit 667938
   
Packit 667938
  
Packit 667938
  </center>
Packit 667938
 
Packit 667938
</form>
Packit 667938
Packit 667938
 
Packit 667938
Packit 667938
 <center>
Packit 667938
 
Packit 667938
  
Packit 667938
   
Packit 667938
   

<font size="1">Guest Users:</font>

Packit 667938
  
Packit 667938
  
Packit 667938
   <font size="1">Please log in with Circuit Number: </font>
Packit 667938
   <font size="1">1234567890</font>
Packit 667938
  
Packit 667938
  
Packit 667938
   <font size="1">and Password: </font>
Packit 667938
   <font size="1">12345678</font>
Packit 667938
  
Packit 667938
  
Packit 667938
   
Packit 667938
   

<font size="1">to see a demo of this service right now.</font>

Packit 667938
  
Packit 667938
 
Packit 667938
 </center>
Packit 667938
Packit 667938
 </font>
Packit 667938
Packit 667938
Packit 667938
Packit 667938
Packit 667938
Packit 667938
  
Packit 667938
    
Packit 667938
      
Packit 667938
        

<font size="1">©2000 SunnyLine Internet Services.  All Rights Reserved.</font>

Packit 667938
    
Packit 667938
    
Packit 667938
      
Packit 667938
        
Packit 667938
       
Packit 667938
        
Packit 667938
          
Packit 667938
            
Packit 667938
            MRTG
Packit 667938
            
Packit 667938
          
Packit 667938
        
Packit 667938
        <SPACER TYPE=VERTICAL SIZE=4>
Packit 667938
        
Packit 667938
          
Packit 667938
            <font face="Arial,Helvetica" size="2">Tobias Oetiker <oetiker@ee.ethz.ch>
Packit 667938
              and Dave Rand <dlr@bungi.com></font>
Packit 667938
          
Packit 667938
        
Packit 667938
        

 

Packit 667938
    
Packit 667938
  
Packit 667938
Packit 667938
Packit 667938
Packit 667938
</body>
Packit 667938
Packit 667938
</html>