%
'
' Contact your provider for support, NOT flicks software
' http://www.flicks.com/support/
' http://www.flicks.com/authentix/intro.htm
' You may use this program freely so long as it is in
'conjuction with a product from Flicks Software
'
' Place this file as epoch.asp in a script enabled directory,
' and let Epoch know the URL for this file.
' Make sure that you enable an AuthentiX group for the
' membership directory you want, and make sure this group is the
' same group that Epoch knows about.
' ----------------------------------------------------------------------
' AuthentiX ASP interface for Epoch
'
' clay@epochsystems.com
'
' When you have installed this script,
' Make sure epoch knows the URL where you have installed it
' Make sure that the group matches the group you have setup in AuthentiX/WebQuota
' Make sure the group -is a permitted group- for your membership directory
'
' Epoch posts the data in the form in a fairly raw format:
' FORM = ADD+KEVIN_GROUP+joel_test+what+test_from_epoch
' So we just get Request.Form
' split it up with Split
'
' 0 arg is command can be
'ADD Command
'CHECK -exists
'DELETED
'
' 1 arg is group
'
' 2 arg is username
'
' 3 arg is password
'
' 4 arg is optional/not used
'
' ----------------------------------------------------------------------
' change this value if you are using AuthentiX ISP
usingAuthentiXStandard = true
if (usingAuthentiXStandard) then
Set auth = Server.CreateObject("AUTHXOCX.AuthXOCXCtrl.1")
else
Set auth = Server.CreateObject("AUTHXISP.AuthXOCXCtrl.1")
' use this line to automatically set the domain to be the requesting IP
protectedDomain = Request.ServerVariables("LOCAL_ADDR")
' use this alternative if you are protecting by host header,
' set protectedDomain to be -your- host header
'protectedDomain = "hostheader.com"
auth.SetVirtualDomain protectedDomain, Request.ServerVariables("SCRIPT_NAME")
' check with your isp for your password, initially it is empty
auth.SetVirtualDomainPassword("")
end if
' stringToParse = ""
' stringToParse = Request.Form
' stringToParse = "DELETED+12408+joel_test111+what+test_from_epoch"
' stringToParse = "ADD+12408+joel_test111+what+test_from_epoch"
' you can check the incoming remote address with Request.ServerVariables("REMOTE_ADDR")
' Dim parsedString
' parsedString = Split(stringToParse, "+")
' for counter = 0 To UBound(parsedString)
' response.Write(parsedString(counter) & counter)
' Next
' if (2 > UBound(parsedString)) Then
' Response.Write("
Not enough parameters! 050102") ' response.End ' End if ' action = parsedString(0) ' groupname = parsedString(1) ' username = parsedString(2) action = Request.Form("command") groupname = Request.Form("htfile") username = Request.Form("username") password = "" if (Request.Form("password")) Then password = Request.Form("password") End if response.Write("
action is " & action & " groupname is " & groupname & " username is " & username & " password is " & password & "
" ) expires = 0 if (isnull(groupname) or (groupname = "")) then response.Write("
*failed*no groupname") response.End end if if (not isnull(action)) then action = trim(ucase(action)) if (username = "") Then Response.Write("
*failed*empty username") elseif (action="ADD" and password = "") Then Response.Write("
*failed*empty password for ADD") elseif (action = "ADD") then result = auth.UserAdd(username, password, notes, expires) if ( result <> 0) then %>
*failed*
User could not be inserted
username: <%= username %>
password: <%= password %>
result: <%= result %>
<%
else
if (auth.GroupAddUser(groupname, username) <> 0) then
%>
User could not be inserted to group <%= groupname %>
username: <%= username %>
password: <%= password %>
<%
else
Response.Write("
ADDED
") end if end if elseif (action = "CHECK") then if (auth.UserLookup(username) = 0) then Response.Write("
*success*FOUND
") else Response.Write("
*failed*NOT_FOUND
") end if elseif (action = "DELETE") then if (auth.UserDelete(username) = 0) then Response.Write("
*success*DELETED
") else Response.Write("
*DELETED*") end if elseif (action = "LIST") then i = 0 s = "" Response.Write("no command") end if %>