%@ LANGUAGE="VBSCRIPT"%>
<%Response.Expires = 0%>
Set Static Ip Page
<%
Dim strStatus
Dim strIp
Dim strMask
Dim strGateway
Dim objSaHelper
Dim objLocMgr
Dim varReplacementStrings
Dim strIpAddressInvalidText
Const IPADDRESS_ERROR_TEXT = "&H4002000A"
On Error Resume Next
Err.Clear
Set objLocMgr = Server.CreateObject("ServerAppliance.LocalizationManager")
If Err.number = 0 Then
strIpAddressInvalidText = objLocMgr.GetString("salocaluimsg.dll",IPADDRESS_ERROR_TEXT,varReplacementStrings)
Set objLocMgr = Nothing
End If
If strIpAddressInvalidText = "" Then
strIpAddressInvalidText = "IP address entered is invalid."
End If
Err.Clear
strIp = Request.QueryString("Ip")
strMask = Request.QueryString("Mask")
strGateway = Request.QueryString("Gateway")
If strIp = "" or strMask = "" Then
strStatus = strIpAddressInvalidText
Else
Set objSaHelper = Server.CreateObject("ServerAppliance.SAHelper")
On Error Resume Next
objSaHelper.SetStaticIp strIp,strMask,strGateway
If Err.Number <> 0 Then
Session("Static_CurrentIp") = strIp
Session("Static_CurrentMask") = strMask
Session("Static_CurrentGateway") = strGateway
strStatus = strIpAddressInvalidText
Else
Response.Redirect "localui_network.asp"
End If
Set objSaHelper = Nothing
End If
%>
<%=strStatus%>