Viewing File: /usr/local/cpanel/whostmgr/docroot/cgi/addon_shake_up_ips.cgi
#!/usr/local/cpanel/3rdparty/bin/perl
##!/usr/local/bin/perl
#WHMADDON:shake_up_ips:Shake up IP of accounts
use lib '/usr/local/cpanel' , '/usr/local/cpanel/whostmgr/docroot/cgi';
use strict ;
use Whostmgr::ACLS ();
use Whostmgr::HTMLInterface ();
Whostmgr::ACLS::init_acls ();
require 'parseform.pl';
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\" target=\"_self\" content=\"0;url=$ENV{'cp_security_token'}/cgi/shake_up_ips/index.cgi\"/>" ;
}
Back to Directory
File Manager