<%@ LANGUAGE="VBSCRIPT" %>
<%
Dim auth
Dim refer
auth = 0
If Request("logoff") = "true" and Session("auth") = 1 and IsObject(Session("SessionMan")) Then
'Session("SessionMan").LogoffUser CStr(Session("Operator")), CStr(Session("userid"))
Set Session("ResAuth") = nothing
Set Session("SessionMan") = nothing
End If
Session("auth") = 0
if Request.Form("Username")<>"" Then
'Authenticate user
Set ResAuth = Server.CreateObject("DbComp.Authenticate")
If ResAuth.LogonUser(Request.Form("Username"),Request.Form("Password"),"local") Then auth = 1 Else auth = -1
End IF
if auth > 0 then
'Authentication OK
'Set SessionMan = Server.CreateObject("VoIPAcct.SessionMan")
'SessionMan.LogonUser CStr(Request.Form("Username")),"", userid
'Session("userid") = userid
Set Session("ResAuth") = ResAuth
'Set Session("SessionMan") = SessionMan
Session("auth") = 1
Session("Operator") = Request.Form("Username")
url = Request.QueryString("url")
If url="" Then url="default.asp"
Response.Redirect url
End If
%>
<%If auth < 0 Then %>
Authentication failed, Please retype your username and password
<%End If%>
<%If Request("purchase") = "ok" Then %>
Thank you for your purchase, Please login to continue...