Call '\KixLib\IsInSubnet.udf'
; define the subnets at each site
$aSiteSubnets = '192.168.0.0/22','192.168.4.0/23','192.168.6.0/23'
; Define each of the URL strings
$aURLs = 'URL1', 'URL2', 'URL3'
; Define which URLs are assigned to each site. In this example, site 0 gets URL0, Site 1 gets URL 0 and 1, etc..
$aSiteURLs = '0', '0,1', '2'
; Eliminate spaces in the IP macro
$MyIP = Join(Split(@IPADDRESS0, ' '), '')
; Use a UDF to determine which subnet the current IP resides in.
$aMySite = isinsubnet($MyIP,$aSiteSubnets)
; If no error, get the Site ID
If Not @ERROR
'My IP: ' $MyIP ? ; debug message
$Site = AScan($aMySite, 1)
'My Site ID: ' $Site ? ; debug message
'URLs: ' $aSiteURLs[$Site] ? ; debug message
$URL_List = Split($aSiteURLs[$Site], ',')
For Each $Url in $URL_List
$aURLs[$Url] ' is being defined' ?
; Use a UDF to create the shortcut to the URL
Next
Else
'IP is not in any Site network!' ?
EndIf