%@ LANGUAGE="VBScript" %>
<%
'*******************************************************************************
'* PRORAM: Webrunner API -- Free Trial Activation Program *
'* AUTHOR: STEPHEN K. COOK (email: cooks@ccp.com) *
'* COMPANY: COOK'S COMPUTER PROGRAMMING/CCP ONLINE (http://www.ccp.com/) *
'* *
'* URL: http://www.ccp.com/ver1/webinterface/red/about/CCP_Online/ *
'* dialup/Web_Accelerator/demo.asp *
'* SITE HOSTED: CCP Online *
'* *
'* VERSION: 1.0 *
'* LAST MODIFIED: 18 June 2004 *
'* *
'* DESCRIPTION: *
'* *
'* (C)Copyright 2001 Cook's Computer Programming/CCP Online *
'* All rights reserved. *
'*******************************************************************************
%>
<%
sub Print_Header
%>
|
DIALUP ACCESS : WEB
ACCELERATOR : FREE TRIAL |
|
|
| |
|
<%
end sub
%>
<%
sub Print_Footer
%>
|
| |
|
(C)1995-2004 Copyright CCP Systems All Rights
Reserved.
This page is powered by CCP Online Servers |
<%
end sub
%>
<%
sub Print_Form
%>
<%
end sub
call Print_Header
response.Write("Welcome to the Trial Period of WebRunner
")
'http://api.cisp.com/webrunner/doc
if ( request("accept") = "YES" ) then
Dim objXML, objXSL
Dim cn, rst
Dim UIDPWD, DataSource
Dim Total_Records
Const adOpenStatic = 3
Const adLockReadOnly = 1
Const adCmdText = &H0001
const DEBUGCODE = 0
Provider = "Driver={SQL Server}"
UIDPWD = "UID=platuser;PWD=xmen30;"
DataSource = "Driver={SQL Server};Server=super.ccp.com;Database=plat;"
' On Error GoTo GetDataError
set cn = Server.Createobject("ADODB.Connection")
cn.CursorLocation = 3
cn.open DataSource & UIDPWD
if ( Instr(request("username"),"@ccp.com") > 0 ) then
SQLSTMT = "select * from customer where active = 'Y' and username = '" & _
left(request("username"),Instr(request("username"),"@ccp.com")-1) & "'"
else
SQLSTMT = "select * from customer where active = 'Y' and username = '" & _
request("username") & "'"
end if
set rst = Server.Createobject("ADODB.Recordset")
rst.Open SQLSTMT, cn, adOpenStatic, _
adLockReadOnly, adCmdText
if ( request("username") = "CCPDEMO" ) then
Total_Records = 1
else
Total_Records = rst.RecordCount
end if
if ( Total_Records = 0 ) then
Response.Write("")
Response.Write("No Username Found!")
Response.Write("
")
call Print_Form
else
if ( Total_Records > 1 ) then
Response.Write("")
Response.Write("There are too man choices to choice from the ")
Response.Write("username: " & request("username"))
Response.Write("
")
else
strURL = "http://api.cisp.cc/webrunner/addProxyUser.XML.asp?ClientID=CCP1"
if ( Instr(request("username"),"@") > 0 ) then
strURL = strURL & "&APIPass=CCP1" & _
"&username=" & request("username")
else
strURL = strURL & "&APIPass=CCP1" & _
"&username=" & request("username") & "@ccp.com"
end if
if ( request("username") <> "CCPDEMO" ) then
strURL = strURL & "&password=" & rst.fields("password")
else
strURL = strURL & "&password=DEMO"
end if
strURL = strURL & "&contactEmail=" & request("email")
if ( DEBUGCODE = 1 ) then
response.Write("Name: " & request("realname") & "
")
response.Write("email: " & request("email") & "
")
response.Write("username: " & request("username") & "
")
response.Write("accept: " & request("accept") & "
")
response.Write("password: " & rst.fields("password") & "
")
response.Write("id: " & rst.fields("id") & "
")
response.Write("name: " & rst.fields("name") & "
")
response.Write("email: " & rst.fields("email") & "
")
response.Write("strUrl " & strURL & "
")
end if
if ( request("username") <> "CCPDEMO" ) then
Response.Write("")
response.Write("Activate WebRunner")
Response.Write("
")
Response.Write("Webrunner Information
")
if ( Instr(request("username"),"@") > 0 ) then
Response.Write("Username:" & request("username") & "
")
else
Response.Write("Username:" & request("username") & "@ccp.com
")
end if
Response.Write("Password: It will be your Dialup Password.
")
Response.Write("")
if ( DEBUGCODE = 0 ) then
' Create the MSXML DOMDocument object for the xml document output of the API
Set objXML = Server.CreateObject("MSXML2.DOMDocument")
objXML.async = False
objXML.setProperty "ServerHTTPRequest", True
objXML.load strURL
auth = true
' Traverse the XML
For Each objNode in objXML.documentElement.selectNodes("error")
auth=false
error = objXML.documentElement.selectSingleNode("error").getAttribute("errortext")
next
' Output the results
if auth then
success = objXML.documentElement.selectSingleNode("success").getAttribute("successtext")
Response.Write(success)
else
Response.Write("" & error & "")
end if
end if
else
response.Write("Name: " & request("realname") & "
")
response.Write("email: " & request("email") & "
")
response.Write("username: " & request("username") & "
")
response.Write("accept: " & request("accept") & "
")
response.Write("strUrl " & strURL & "
")
end if
end if
end if
rst.Close
If Not rst Is Nothing Then
set rst = Nothing
end if
cn.Close
If Not rst Is Nothing Then
set cn = Nothing
end if
else
response.Write("You did not Accept the Agreement.
")
call Print_Form
end if
call Print_Footer
'GetDataError:
' if Err.Number > 0 then
' Response.Write("ADO (OLE) ERROR IN " & sSource)
' Response.Write("Error: " & Err.Number)
' Response.Write("Description: " & Err.Description)
' Response.Write("Source: " & Err.Source)
' end if
%>