Child pages
  • cPanel API 1 Functions - StatManager::doForm
Skip to end of metadata
Go to start of metadata

Description

This function display returns HTML for a table of the cPanel account's domains and their statistics programs.

Warning:

cPanel API 1 is deprecated. We strongly recommend that you do not use cPanel API 1. However, no equivalent function exists in our newer APIs.

Important:

In cPanel & WHM version 76 and later, when you disable the WebServer role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples 


 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$doform_statmanager = $cpanel->api1('StatManager','doForm') ); // Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $doform_statmanager = $cpliveapi->api1('StatManager','doForm'); # Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Tag System (deprecated)


Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We provide this example to help developers move from the old cPanel tag system to our LiveAPI system. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

<cpanel Module="StatManager::doForm()">
 Command Line
cpapi1 --user=username StatManager doForm


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (HTML)
{
  "apiversion": "1",
  "type": "event",
  "module": "StatManager",
  "func": "doForm",
  "source": "module",
  "data": {
    "result": "<style>\n.tdshadered {\n   background-color: #FFAAAA;\n   border-top: 1px #374646 solid;\n   border-left: 1px #374646 solid;\n   border-right: 1px #374646 solid;\n   border-bottom: 1px #374646 solid;\n   font-family: verdana, arial, helvetica, sans-serif;\n   font-size: 11px;\n   font-weight: normal;\n   -moz-border-radius: 10px;\n   -moz-background-clip: padding;\n}\n\n.tdshadegreen {\n   background-color: #AAFFAA;\n   border-top: 1px #374646 solid;\n   border-left: 1px #374646 solid;\n   border-right: 1px #374646 solid;\n   border-bottom: 1px #374646 solid;\n   font-family: verdana, arial, helvetica, sans-serif;\n   font-size: 11px;\n   font-weight: normal;\n   -moz-border-radius: 10px;\n   -moz-background-clip: padding;\n}\n\n.botcellline {\n   border-bottom: 2px #999999 solid;\n}\n\n.sortable {\n    width:0;\n}\n<\/style>\n<script>\n function showStatsMsg(domain,log,status) {\n\n    try {\n        handleStatsMsg(domain,log,status);\n    } catch (e) {\n\n    }\n }\n<\/script>\n<Br><table id=\"statcfgtbl\" width=\"97%\" align=\"center\"><tr><td><table id=\"statsmgrtbl\" class=\"sortable\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\"><tr bgcolor=\"#EEEEEE\" class=\"statstblheader\"><th width=\"40%\">Domain<\/th><th align=\"center\" nonsortable=\"true\" class=\"nonsortable\" width=\"12%\">analog<\/th><th align=\"center\" nonsortable=\"true\" class=\"nonsortable\" width=\"12%\">awstats<\/th><th align=\"center\" nonsortable=\"true\" class=\"nonsortable\" width=\"12%\">webalizer<\/th><\/tr><tr class=\"info-odd\"><td wrap align=\"center\">testsimon.com<\/td><td align=\"center\"  onClick=\"showStatsMsg('example.com','analog','disabled');\" class=\"statsdisabled\"><img src=\"..\/images\/stats-disabled.gif\" align=\"absmiddle\"><\/td>\n<td align=\"center\"  onClick=\"showStatsMsg('example.com','awstats','disabled');\" class=\"statsdisabled\"><img src=\"..\/images\/stats-disabled.gif\" align=\"absmiddle\"><\/td>\n<td align=\"center\"  onClick=\"showStatsMsg('example.com','webalizer','disabled');\" class=\"statsdisabled\"><img src=\"..\/images\/stats-disabled.gif\" align=\"absmiddle\"><\/td>\n<\/tr>\n<tr class=\"info-even\"><td wrap align=\"center\">testsimon2.com<\/td><td align=\"center\"  onClick=\"showStatsMsg('example2.com','analog','disabled');\" class=\"statsdisabled\"><img src=\"..\/images\/stats-disabled.gif\" align=\"absmiddle\"><\/td>\n<td align=\"center\"  onClick=\"showStatsMsg('example2.com','awstats','disabled');\" class=\"statsdisabled\"><img src=\"..\/images\/stats-disabled.gif\" align=\"absmiddle\"><\/td>\n<td align=\"center\"  onClick=\"showStatsMsg('example2.com','webalizer','disabled');\" class=\"statsdisabled\"><img src=\"..\/images\/stats-disabled.gif\" align=\"absmiddle\"><\/td>\n<\/tr>\n<tr class=\"info-odd\"><td wrap align=\"center\">example2.example<WBR>.com<\/td><td align=\"center\"  onClick=\"showStatsMsg('example2.example<WBR>.com','analog','disabled');\" class=\"statsdisabled\"><img src=\"..\/images\/stats-disabled.gif\" align=\"absmiddle\"><\/td>\n<td align=\"center\"  onClick=\"showStatsMsg('example2.example<WBR>.com','awstats','disabled');\" class=\"statsdisabled\"><img src=\"..\/images\/stats-disabled.gif\" align=\"absmiddle\"><\/td>\n<td align=\"center\"  onClick=\"showStatsMsg('example2.example<WBR>.com','webalizer','disabled');\" class=\"statsdisabled\"><img src=\"..\/images\/stats-disabled.gif\" align=\"absmiddle\"><\/td>\n<\/tr>\n<\/table><\/td><\/tr><\/table><br>"
  },
  "event": {
    "result": 1
  }
} 

Parameters

This function does not accept parameters.

Returns

This function returns HTML that contains a table of the cPanel account's domains and their statistics programs.