Description
This function checks whether ModSecurity™ is installed on a server.
Examples
cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/ModSecurity/has_modsecurity_installed
LiveAPI PHP Class
$cpanel
=
new
CPANEL();
$modsec_installation_status
=
$cpanel
->uapi(
'ModSecurity'
,
'has_modsecurity_installed'
);
LiveAPI Perl Module
my
$cpliveapi
= Cpanel::LiveAPI->new();
my
$modsec_installation_status
=
$cpliveapi
->uapi(
'ModSecurity'
,
'has_modsecurity_installed'
,
);
cPanel Template Toolkit
[% execute('ModSecurity', 'has_modsecurity_installed' ) %]
Command Line
uapi --user=username ModSecurity has_modsecurity_installed
|
Output (JSON)
{
"messages": null,
"errors": null,
"status": 1,
"metadata": {},
"data": {
"installed": 1
}
}
Parameters
This function does not accept parameters.
Returns
Return
|
Type
|
Description
|
Possible values
|
Example
|
installed
|
Boolean
|
Whether ModSecurity is installed on the server.
|
- 1 — Installed.
- 0 — Not installed.
|
1
|