% ' 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 ' 0 arg is command can be 'ADD Command 'CHECK -exists 'DELETE ' ' 1 arg is htaccessfile - not used here - could use as groupname if you want ' ' 2 arg is username ' ' 3 arg is password ' '====== '====== These values will ALWAYS need to be set for each customer '====== DEFAULT_GROUP_NAME = "group1" ' set this to the appropriate AuthentiX group, if not passed in via form ' 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 ADMINPWORD = "set password here" ADD_ACTION_CODE = "ADD" ' input converted to uppercase DELETE_ACTION_CODE = "DELETE" ' input converted to uppercase EXISTS_ACTION_CODE = "CHECK" LIST_ACTION_CODE = "LIST" VERSION_ACTION_CODE = "VERSION" stringToParse = Request.QueryString Dim parsedString parsedString = Split(stringToParse, "+") for counter = 0 To UBound(parsedString) 'response.Write(parsedString(counter) & counter) Next if (3 > UBound(parsedString)) Then Response.Write("
*failed*Not enough parameters!")
response.End
End if
action = parsedString(0)
' groupname = parsedString(1) ' uncomment this, if Jettis passes in the group instead of the file
groupname = DEFAULT_GROUP_NAME
username = parsedString(2)
password = ""
if (3 <= UBound(parsedString)) Then
password = parsedString(3)
End if
ERROR_PREFIX = "ERROR "
' Jettis uses
' CHECK+/usr/local/site1/.htaccess+Bob+1234 to see if a name is available
' return FOUND, NOT_FOUND or ERROR
'
if (action = EXISTS_ACTION_CODE) then
if (auth.UserLookup(username) = 0) then
Response.Write("FOUND")
else
response.Write("NOT_FOUND")
end if
Response.End
End if
' Jettis uses
' ADD+/usr/local/site1/.htaccess+Bob+1234
' return ADDED or ERROR
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("ADDED")
Response.End
end if
' Jettis uses
' DELETE+/usr/local/site1/.htaccess+Bob+1234
' return DELETED or ERROR
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
Response.Write("DELETED")
' 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.End
End if
if (action = LIST_ACTION_CODE) then
i = 0
Response.Write("