Validating a user's location?

I’m trying to validate, within the Notes client, whether a user is behind our firewall or not. On a page, I want to determine this because if they are I will send them to a website using the internal naming convention of that site (ourweb/page.htm), but if not I will send them using the external naming convention (www.ourweb/page.htm). Don’t ask why, long story.

I am using that web page to launch (using the onload event) another website’s page - in this way I can use the window.open function and all its parameters the way I want to).

Convoluted? Yes. But it works the way I want it if I can only figure out how to tell if they’re behind the firewall or not.

Any ideas?

Thanks

Subject: Validating a user’s location?

I have no idea how good this is or not, but could you look at their IP address. If they are the corporate domain wouldn’t they have a certain range of IP addresses?

Subject: RE: Validating a user’s location?

Hmmm, you may have something. I just have to figure how I can check their IP address within their client.

Subject: RE: Validating a user’s location?

Not sure where I got this from cuz it doesn’t look like my coding format so I cannot take the credit for it but this code will retrieve the worstation IP:

Sub Click(Source As Button)

' create a scripting object, find out the environ, then 

'either run winipcfg Or ipconfig

’ put result in a text file, read it, delete it

On Error Goto eh

Dim ws As Variant

Dim fso As Variant

Dim tmpFile As String

Dim thisLine As String

Dim ip As String

Set ws = CreateObject("WScript.Shell")

Set fso = CreateObject("Scripting.FileSystemObject")

Dim folderStr As String



TmpFile = "C:\Temp\ip.txt"



If ws.Environment("SYSTEM")("OS") = "" Then

’ attempt to establish whether win9x or nt based o/s

	ws.run "winipcfg /batch " & TmpFile, 0, True

Else

	ws.run "%comspec% /c ipconfig > " & TmpFile, 0, True

End If

Dim fileNum As Integer

fileNum = Freefile()

Open TmpFile For Input As fileNum

Do While Not Eof(fileNum)

	Line Input #fileNum, ThisLine

	If Instr(ThisLine, "Address") <> 0 Then

		IP = Mid(ThisLine, Instr(ThisLine, ":") + 2)

		Exit Do

	End If

Loop

tmp$ = Inputbox$("", "IP Address ...", Cstr(IP))

Close fileNum

Kill TmpFile

'WinXP (NT? 2K?) leaves a carriage return at the end of line

If IP <> "" Then

	If Asc(Right(IP, 1)) = 13 Then IP = Left(IP, Len(IP) - 1)

End If

Get_IP = IP

eh:

’ if there was a problem here it’s best to bail out completely

End

End Sub