Description

This function checks whether ModSecurity™ is installed on a server.

Examples 




https://hostname.example.com:2083/cpsess##########/execute/ModSecurity/has_modsecurity_installed



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Return ModSecurity's installation status.
$modsec_installation_status = $cpanel->uapi(
    'ModSecurity', 'has_modsecurity_installed'
);

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List ModSecurity's installation status.
my $modsec_installation_status = $cpliveapi->uapi(
    'ModSecurity', 'has_modsecurity_installed',
);

 



<!-- Get modsecurity's installation status. -->
[% execute('ModSecurity', 'has_modsecurity_installed' ) %]

 



uapi --user=username ModSecurity has_modsecurity_installed



 {
    "messages": null,
    "errors": null,
    "status": 1,
    "metadata": {},
    "data": {
        "installed": 1
    }
}



Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
installedBoolean

Whether ModSecurity is installed on the server.

  • 1 — Installed.

  • 0 — Not installed.

1