Integrate custom plugin with WHM default theme?

Dharmik Soni

Registered
Apr 24, 2019
1
0
1
Pune
cPanel Access Level
Root Administrator
Question: How can i integrate default whm theme (x) with custom whm plugin UI. I have tried following the guidance on

1)whm plugin - interface
2)create a new whm interface in template toolkit
When i run script index.cgi it gives me
"
Internal Server Error
500

No response from subprocess (/usr/local/cpanel/whostmgr/docroot/cgi/watch7/index.cgi): The subprocess reported error number 72,057,594,037,927,935 when it ended. The process dumped a core file.


cpsrvd Server at vps235171.example.com"


->main.tmpl
is using default script provided on Tutorial - Create a New WHM Interface in Template Toolkit - Developer Documentation - cPanel Documentation

->Below is my index.cgi script code
----------------------------------------------
Code:
 #!/bin/sh
eval 'if [ -x /usr/local/cpanel/3rdparty/bin/perl ]; then exec /usr/local/cpanel/3rdparty/bin/perl -x -- $0 ${1+"[email protected]"}; else exec /usr/bin/perl -x $0 ${1+"[email protected]"}; fi;'
  if 0;
#!/usr/bin/perl
#WHMADDON:watch7:Watch7 - Instant Installs
use strict;
BEGIN { unshift @INC, '/usr/local/cpanel/whostmgr/docroot/cgi/watch7'}
use warnings;
use Whostmgr::ACLS          ();
use Whostmgr::HTMLInterface ();
use Cpanel::Form ();
use Cpanel::Template ();
Whostmgr::ACLS::init_acls();
if (!Whostmgr::ACLS::hasroot())
{
        print "Content-type: text/html\r\n\r\n";
        print "You do not have access to LogView, Please contact your Server Adminitator.\n";
        exit();
}
else
    {
        _headers("text/html");
        my $template_file = '/usr/local/cpanel/whostmgr/docroot/templates/main.tmpl';
        Cpanel::Template::process_template(
            'whostmgr',
            {
                'template_file'            => $template_file
            },
        );
    }
# my $URL;
# if ( 'root' eq $ENV{'REMOTE_USER'} ){
#     $URL = "../cgi/watch7/index.php";
# }else{
#     $URL = "../cgi/watch7/index.cgi";
# }
# print "Location: $URL\n\n";
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
Hello @Dharmik Soni,

Can you open a support ticket so we can take a closer look to make sure you are correctly performing the steps referenced in our documentation? You can post the ticket number here and we'll link this thread to it.

Thank you.