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

#!/usr/local/cpanel/3rdparty/bin/perl

#WHMADDON:ardcluster:ardCluster PowerDNS plugin

use lib '/usr/local/cpanel' , '/usr/local/cpanel/whostmgr/docroot/cgi' ;

use strict   ;
use Whostmgr::ACLS          ();

Whostmgr::ACLS::init_acls();

require 'parseform.pl';

our $VERSION = "6.1";


print "Content-Type: text/html\n\n";
my %ACL = %Whostmgr::ACLS::default ;

if ( 'root' eq $ENV{'REMOTE_USER'}  or 'wh' eq $ENV{'REMOTE_USER'} )
{
    $ACL{'all'} = 1 ;
}
elsif ( $ENV{'REMOTE_USER'} )
{
    if ( -r '/var/cpanel/resellers' )
    {
        if ( open my $Handle , '<' , 'c' )
        {
            while ( <$Handle> )
            {
                if ( m{ \A $ENV{'REMOTE_USER'} [:] (\S+) }xms )
                {
                    my $Names = $1 ;
                    my @ACLS = split ( m{ [,] }xms , $Names ) ;
                    foreach my $Name ( @ACLS )
                    {
                        $ACL{$Name} = 1 ;
                    }
                    last ;
                }
                else
                {
                }
            }
            close $Handle ;
        }
        else
        {
        }
    }
    else
    {
    }
}


if ( !$ACL{'all'} )
{
    exit ;
}
else
{
    print "<meta http-equiv=\"refresh\" content=\"0;url=$ENV{'cp_security_token'}/cgi/ardcluster/index.cgi\"/>" ;

}

Back to Directory File Manager