New Extension for Plesk. Antivirus Protection to enhance your server security. Why choose Flex Antivirus?
Integrates IP unblocking functionality directly into your web application. Compatible with classic ASP and PHP via the extension's COM object.
UnlockIP(IP,Rulename)From your web page — in your index.asp, index.php, or any section of your application — you can call this function to programmatically unblock an IP address that has been blocked by Firewall Manager. It requires valid credentials for a domain in Plesk.
| Parameter | Type | Required | Description |
|---|---|---|---|
| Username | String | Required | Plesk domain user with access to the extension. |
| Password | String | Required | Password for the Plesk domain user. |
| FormatOutput | String | Optional | Response format: xml (default) or json. |
| IP | String | Required | IPv4 or IPv6 address to be unblocked. |
| Rulename | String | Optional | Name of the rule containing the IP |
Important: Use this function on pages protected with your own authentication. Exposing the call without protection allows any user to unblock arbitrary IPs.
Instantiate the FlexFirewallManager.Admin COM object, set the credentials, and call UnlockIP(). The response is parsed as XML.
' Create COM object instance
Set App = CreateObject("FlexFirewallManager.Admin")
App.FormatOutput = "xml"
App.Username = "Plesk Domain User"
App.Password = "Plesk Domain Password"
' IP to unblock
Dim strIP : strIP = "123.123.123.123"
Dim returnstring : returnstring = App.UnlockIP(strIP)
' Parse XML response
Set objxml = CreateObject("Msxml2.DOMDocument")
objxml.LoadXml(returnstring)
If LCase(objxml.SelectSingleNode("/output/result").text) = "true" Then
Response.Write "IP Unblocked " & strIP
Else
Response.Write "Unable to unblock IP " & strIP
End If
You can use FormatOutput = "json" if you prefer to parse the response with JSON.parse instead of XML. JSON format is recommended for modern applications.
In PHP, instantiate the COM object with new COM(). Use json format to parse the response directly with json_decode().
// Create COM object instance
$app = new COM("FlexFirewallManager.Admin");
$app->FormatOutput = "json";
$app->Username = "Plesk Domain User";
$app->Password = "Plesk Domain Password";
// IP to unblock
$strIP = "123.123.123.123";
$returnstring = $app->UnlockIP($strIP);
// Parse JSON response
$appjson = json_decode($returnstring);
if ($appjson->result) {
echo "IP Unblocked " . $strIP;
} else {
echo "Unable to unblock IP " . $strIP;
}
Tip: You can combine this function with an internal administration form so your users can self-manage unblocking their own IP without needing access to the Plesk panel.
Keep the following in mind when integrating this function into your application:
UnlockIP() with an authenticated user session.
FlexFirewallManager.Admin COM object requires Windows Server with the extension installed.