|
Prev: how to create a new vpn connection using script o batch
Next: AMAZING JOBS AND SALARIES IN US,UK,CHICAGO........
From: Chas Della Silva on 19 Jun 2008 18:43 Okay, I have a script the returns only the internal address from IIS. Why does it do this it is to be returning the remote address of the user.... HELP I am running SBS2003 ISA 2000 and IIS 6. here is the script <% ' ' 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(a)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<BR> ' 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("<html><body>*failed*<p>Not enough parameters! 050102</body></html>") ' response.End ' End if ' action = parsedString(0) ' groupname = parsedString(1) ' username = parsedString(2) remoteAddress = Request.ServerVariables("REMOTE_ADDR") Set RegularExpressionObject = New RegExp With RegularExpressionObject .Pattern = "^((208.236.105.)|(63.81.1.)|(63.84.23.))" .IgnoreCase = True .Global = True End With expressionmatch = RegularExpressionObject.Test(remoteAddress) if ( expressionmatch = FALSE ) then response.Write("<html><body>*failed*<p>bad IP " & remoteAddress ) response.End end if action = Request.Form("command") groupname = Request.Form("ht_file") username = Request.Form("username") password = Request.Form("password") response.Write("<P>action is " & action & " groupname is " & groupname & " username is " & username & " password is " & password & " <P>" ) expires = 0 if (isnull(groupname) or (groupname = "")) then response.Write("<html><body>*failed*<p>no groupname") response.End end if if (not isnull(action)) then action = trim(ucase(action)) if (username = "") Then Response.Write("<html><body>*failed*<p>empty username</body></html>") elseif (action="ADD" and (password = "" or password="null")) Then Response.Write("<html><body>*failed*<p>empty password for ADD</body></html>") elseif (action = "ADD") Then result = auth.UserAdd(username, password, notes, expires) if ( result <> 0) then %> <html><body> *failed*<p> User could not be inserted <br> username: <%= username %><br> password: <%= password %><br> result: <%= result %><br> </body></html> <% else if (auth.GroupAddUser(groupname, username) <> 0) then %> <html><body> *failed*<p> User could not be inserted to group <%= groupname %><br> username: <%= username %><br> password: <%= password %><br> </body></html> <% else Response.Write("<html><body>*success*<P>ADDED<P></body></html>") end if end if elseif (action = "CHECK") then if (auth.UserLookup(username) = 0) then Response.Write("<html><body>*success*<P>FOUND<P></body></html>") else Response.Write("<html><body>*failed*<P>NOT_FOUND<P></body></html>") end if elseif (action = "DELETE") then if (auth.UserDelete(username) = 0) then Response.Write("<html><body>*success*<P>DELETED<P></body></html>") else Response.Write("<html><body>*DELETED*</body></html>") end if elseif (action = "LIST") then i = 0 s = "" Response.Write("<html><body><plaintext>" + chr(13) + chr(10)) for i = 0 to (auth.UserGetCount - 1) s = auth.UserGetAt(i) Response.Write(s) Response.Write(chr(13) + chr(10)) next elseif (action = "VERSION") then Response.Write("<html><body>AuthentiX ASP interface v1.00</body></html>") else Response.Write("<html><body>*failed*<p>no command</body></html>") end if %> *** Sent via Developersdex http://www.developersdex.com ***
From: Anthony Jones on 20 Jun 2008 02:58 "Chas Della Silva" <freerunner11(a)yahoo.com> wrote in message news:%23XT1h3l0IHA.904(a)TK2MSFTNGP05.phx.gbl... > Okay, I have a script the returns only the internal address from IIS. > Why does it do this it is to be returning the remote address of the > user.... > HELP > I am running SBS2003 ISA 2000 and IIS 6. > > here is the script > This gets the local address of the server:- Request.ServerVariables("LOCAL_ADDR") this gets the remote address of the client (from the servers point of view) :- Request.ServerVariables("REMOTE_ADDR") Note that if you have reverse-proxy between your clients and your server all clients will appear to have the same address (that of the proxy server). Also if you have multiple clients on a single site sharing a NATing router they will all appear to have the same public address. -- Anthony Jones - MVP ASP/ASP.NET
From: Anthony Jones on 20 Jun 2008 03:04
"Anthony Jones" <Ant(a)yadayadayada.com> wrote in message news:%23TPgwLq0IHA.3884(a)TK2MSFTNGP05.phx.gbl... > "Chas Della Silva" <freerunner11(a)yahoo.com> wrote in message > news:%23XT1h3l0IHA.904(a)TK2MSFTNGP05.phx.gbl... > > Okay, I have a script the returns only the internal address from IIS. > > Why does it do this it is to be returning the remote address of the > > user.... > > HELP > > I am running SBS2003 ISA 2000 and IIS 6. > > > > here is the script > > > > This gets the local address of the server:- > > Request.ServerVariables("LOCAL_ADDR") > > > this gets the remote address of the client (from the servers point of view) > :- > > Request.ServerVariables("REMOTE_ADDR") > > Note that if you have reverse-proxy between your clients and your server all > clients will appear to have the same address (that of the proxy server). > > Also if you have multiple clients on a single site sharing a NATing router > they will all appear to have the same public address. > > Oops, forgot to mention that an ISA server can act as a reverse proxy. Hence it is most likely that clients connecting to the server are being handled by the reverse proxy on the box before the request is made on the web server. Therefore the REMOTE_ADDR appears would be the Servers IP address. -- Anthony Jones - MVP ASP/ASP.NET |