% ' 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 '====== '====== These values will ALWAYS need to be set for each customer '====== ' Please set the SECRET of your account ADMINPWORD = "secret" ' Please set the AuthentiX GROUP NAME, that your wish to add users to DEFAULT_GROUP_NAME = "Group1" ' set this to the appropriate AuthentiX group ' Set up email notification ' set mailserver = "" to turn off email messages mailserver = "" 'mailserver = "your.mailserver.com" webmaster = "you@mailserver.com" okToAddUserIfAlreadyThere = false enableLogging = true '====== '====== The above values will ALWAYS need to be set for each customer '====== ' 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 '--- These values set on a per provider basis ADD_ACTION_CODE = "add" ' input converted to uppercase DELETE_ACTION_CODE = "delete" ' input converted to uppercase MODIFY_ACTION_CODE = "modify" ' input converted to uppercase EXISTS_ACTION_CODE = "EXISTS" LIST_ACTION_CODE = "LIST" VERSION_ACTION_CODE = "VERSION" SUCCESS_MESSAGE = "done" ERROR_PREFIX = "error: " Set VERCODE = Request.QueryString("VERCODE") ' VERZA format: ' http://www.mysite.com/cgi-bin/verzarum.asp?vercode=usercode:passcode:secret:word:amount Dim parsedString parsedString = Split(VERCODE, ":") if (UBound(parsedString) < 4) Then Response.Write("
*failed*Not enough parameters!")
response.End
End if
for counter = 0 To UBound(parsedString)
response.Write(parsedString(counter) & counter & "
")
Next
username = parsedString(0)
password = parsedString(1)
systemPassword = parsedString(2)
action = parsedString(3)
notes = parsedString(4)
expireDays = 0
groupname = ""
response.Write("Action is:" & action & "
")
if (ADMINPWORD <> systemPassword) Then
errorMessage = ERROR_PREFIX & " security"
errorOut(errorMessage)
response.End
End if
' you can also check the incoming remote address with Request.ServerVariables("REMOTE_ADDR")
if (isnull(groupname) or (groupname = "")) then
Set groupname = Request.Form("sitename")
end if
if (isnull(groupname) or (groupname = "")) then
Set groupname = Request.Form("siteid")
end if
if (isnull(groupname) or (groupname = "")) then
groupname = DEFAULT_GROUP_NAME
end if
if (isnull(expireDays) or (0 = expireDays)) then
expireDate = 0 ' never
else
expireDate = now + expireDays
end if
if (not isnull(action)) then action = trim(lcase(action))
if (action = ADD_ACTION_CODE) then
if (isnull(username) or (username = "")) Then
errorMessage = ERROR_PREFIX & " empty username"
errorOut(errorMessage)
response.End
End if
errorCode = auth.UserAdd(username, password, notes, expireDate)
if (errorCode <> 0) then
if ((errorCode = 3) and (okToAddUserIfAlreadyThere)) then
'nothing - continue and add to group anyway
else
errorMessage = ERROR_PREFIX & " User could not be added, username: *" & username & "* password: *" & password & "*, code is " & errorCode
errorOut(errorMessage)
response.End
End if
End if
errorCode = auth.GroupAddUser(groupname, username)
if (errorCode <> 0) then
errorMessage = ERROR_PREFIX & " User could not be added to group: " & groupname & ", username: *" & username & "* password: *" & password & "*, code is " & errorCode
errorOut(errorMessage)
response.End
End if
Response.Write(SUCCESS_MESSAGE)
Response.End
end if
if (action = DELETE_ACTION_CODE) then
Dim userList
userList = Split(username, ",")
for counter = 0 To UBound(userList)
' response.Write("
" & counter & ": " & userList(counter))
' just attempt to delete them all
singleUsername = userList(counter)
if (isnull(singleUsername) or (singleUsername = "")) Then
' ignore
else
errorCode = auth.UserDelete(singleUsername)
end if
Next
' errorCode = auth.UserDelete(username)
' if (errorCode <> 0) then
' errorMessage = ERROR_PREFIX & " User could not be deleted, username: *" & username & "*, code is " & errorCode
' errorOut(errorMessage)
' else
' Response.Write(SUCCESS_MESSAGE)
' End if
Response.Write(SUCCESS_MESSAGE)
Response.End
End if
if (action = MODIFY_ACTION_CODE) then
auth.UserPassword(username) = password
auth.UserNotes(username) = notes
Response.Write(SUCCESS_MESSAGE)
Response.End
End if
if (action = EXISTS_ACTION_CODE) then
if (auth.UserLookup(username) = 0) then
Response.Write(SUCCESS_MESSAGE)
else
errorMessage = ERROR_PREFIX & " does not exist"
response.Write(errorMessage)
end if
Response.End
End if
if (action = LIST_ACTION_CODE) then
i = 0
Response.Write("