Viewing File: /usr/local/cpanel/whostmgr/docroot/cgi/addon_cwaf.cgi

#!/bin/sh
eval 'if [ -x /usr/local/cpanel/3rdparty/bin/perl ]; then exec /usr/local/cpanel/3rdparty/bin/perl -x -- $0 ${1+"$@"}; else exec /usr/bin/perl -x $0 ${1+"$@"}; fi;' 
  if 0;
  
#!/usr/bin/perl
# start main
use CGI qw/:standard/;

use lib '/usr/local/cpanel', '/usr/local/cpanel/whostmgr/docroot/cgi';
use Cpanel::HttpUtils  ();
use Cpanel::MysqlUtils ();
use Whostmgr::ACLS          ();
use Whostmgr::HTMLInterface ();
use SafeFile;

use warnings;
use strict;
no warnings "once";
no warnings "redefine";

BEGIN { require '/etc/cwaf/use_lib.pl' if -f '/etc/cwaf/use_lib.pl'; }
use Comodo::CWAF::Main;
use Comodo::CWAF::ClientAPI;
use Comodo::CWAF::ModSecurity;
use Comodo::CWAF::Platform;

require "/usr/local/cpanel/whostmgr/cgi/cwaf_sharedlib.pl";

## define variables
# global HASH for configuration data
our (%conf,%msconf,$pr_name);

$pr_name = get_name();

#redefine log function
local *do_log = \&do_log_stderr;

# BEGIN
$| = 1;

Whostmgr::ACLS::init_acls();

if (!Whostmgr::ACLS::hasroot()) {
	print "You do not have access to Comodo Web Application Firewall Control.\n";
	exit();
}

# try to load Cpanel::Rlimit
eval ('use Cpanel::Rlimit			();');
unless ($@) {
	Cpanel::Rlimit::set_rlimit_to_infinity();
	}

print "Content-type: text/html\n\n";

$Cpanel::App::appname = "whostmgr";

# set header in CPANEL web interface
Whostmgr::HTMLInterface::defheader("Web Application Firewall | Free ModSecurity Rules from Comodo",'','/cgi/addon_cwaf.cgi');

##################################### BEGIN ##################################

&print_main_interface();

# end main
###############################################################################
1;
Back to Directory File Manager