THIS IS THE SCRIPT in scritps/
Code:
================================================START OF MY wwwacct ==============================
#!/usr/bin/perl
# cpanel12 - wwwacct Copyright(c) 1997-2008 cPanel, Inc.
# All Rights Reserved.
# copyright@cpanel.net http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited
BEGIN {
open( my $ver_fh, '<', '/usr/local/cpanel/version' );
my $ver = readline($ver_fh);
close($ver_fh);
if ( $ver =~ /^(8|9|10)\./ ) {
die "cPanel 11.x $0 running on a ${1}.x machine!!! /scripts were updated without cPanel! Please run /scripts/upcp --force to force synchronization.";
}
if ( -e '/usr/local/cpanel/FastImport.pm' ) {
require '/usr/local/cpanel/FastImport.pm';
FastImport::_fast_import('/usr/local/cpanel', '/scripts');
}
elsif ( -e '/scripts/FastImport.pm' ) {
require '/scripts/FastImport.pm';
FastImport::_fast_import('/usr/local/cpanel', '/scripts');
}
else {
unshift @INC, '/usr/local/cpanel', '/scripts';
}
}
use cPScript::Errors ();
use Whostmgr::Accounts::Create ();
use strict;
$| = 1;
my $customip;
if ( $ARGV[0] =~ s/^\-\-with\-customip\=// ) {
$customip = shift(@ARGV);
}
my $forcedns = 0;
if ( $ARGV[0] =~ s/^\-\-forcedns// ) {
$forcedns = 1;
shift(@ARGV);
}
my $domain = $ARGV[0];
my $user = $ARGV[1];
my $pass = $ARGV[2];
if ( $pass =~ /^fd:/ ) {
chomp($pass);
$SIG{'ALRM'} = sub {
die "Timeout while getting password from FD";
};
my ( $passwdfd, $passwdlength );
( undef, $passwdfd, $passwdlength ) = split( /:/, $pass );
$passwdfd =~ s/[\s\n\t]*//g;
$passwdlength =~ s/[\s\n\t]*//g;
alarm(30);
open( FH, "<&=${passwdfd}" ) || die "$0: Error while reading from password FD $!";
$pass = <FH>;
close(FH);
chomp($pass);
alarm(0);
}
my $sqto;
if ( $ARGV[3] ne '' ) {
$sqto = $ARGV[3];
}
else {
$sqto = '0';
}
my $cpmo = ($ARGV[4] || 'x3');
my $useip;
if ( $ARGV[5] eq 'n' ) {
$useip = 'n';
}
else {
$useip = 'y';
}
my $hascgi;
if ( $ARGV[6] eq 'n' ) {
$hascgi = 'n';
}
else {
$hascgi = 'y';
}
my $installfp;
if ( $ARGV[7] eq 'n' ) {
$installfp = 'n';
}
else {
$installfp = 'y';
}
my $maxftp;
if ( $ARGV[8] eq 'n' || $ARGV[8] eq '' || $ARGV[8] =~ m/unlimited/i ) {
$maxftp = 'n';
}
else {
$maxftp = int( $ARGV[8] );
}
my $maxsql;
if ( $ARGV[9] eq 'n' || $ARGV[9] eq '' || $ARGV[9] =~ m/unlimited/i ) {
$maxsql = 'n';
}
else {
$maxsql = int( $ARGV[9] );
}
my $maxpop;
if ( $ARGV[10] eq 'n' || $ARGV[10] eq '' || $ARGV[10] =~ m/unlimited/i ) {
$maxpop = 'n';
}
else {
$maxpop = int( $ARGV[10] );
}
my $maxlst;
if ( $ARGV[11] eq 'n' || $ARGV[11] eq '' || $ARGV[11] =~ m/unlimited/i ) {
$maxlst = 'n';
}
else {
$maxlst = int( $ARGV[11] );
}
my $maxsub;
if ( $ARGV[12] eq 'n' || $ARGV[12] eq '' || $ARGV[12] =~ m/unlimited/i ) {
$maxsub = 'n';
}
else {
$maxsub = int( $ARGV[12] );
}
my $bwlimit;
if ( $ARGV[13] eq 'n' || $ARGV[13] eq '' || $ARGV[13] =~ m/unlimited/i ) {
$bwlimit = 0;
}
else {
$bwlimit = int( $ARGV[13] );
}
my $hasshell;
if ( $ARGV[14] eq 'n' ) {
$hasshell = 'n';
}
else {
$hasshell = 'y';
}
my $owner = $ARGV[15];
if ( $owner eq '' ) {
$owner = $ENV{'REMOTE_USER'} || $ENV{'USER'} || 'root';
}
my $plan = $ARGV[16];
if ( $plan eq '' ) {
$plan = 'default';
}
my $maxpark;
if ( $ARGV[17] eq 'n' || $ARGV[17] eq '' ) {
$maxpark = 0;
}
else {
if ( $ARGV[17] !~ /unlimited/i ) {
$maxpark = int( $ARGV[17] );
}
else {
$maxpark = 'unlimited';
}
}
my $maxaddon;
if ( $ARGV[18] eq 'n' || $ARGV[18] eq '' ) {
$maxaddon = 0;
}
else {
if ( $ARGV[18] !~ /unlimited/i ) {
$maxaddon = int( $ARGV[18] );
}
else {
$maxaddon = 'unlimited';
}
}
my $featurelist;
if ( $ARGV[19] eq '' ) {
$featurelist = 'default';
}
else {
$featurelist = $ARGV[19];
$featurelist =~ s/[\r\n]*//g;
$featurelist =~ s/\.\.//g;
}
my $ceml;
if ( $ARGV[20] eq '' ) {
$ceml = '';
}
else {
$ceml = $ARGV[20];
}
my $useregns;
if ( $ARGV[21] eq '' ) {
$useregns = '';
}
else {
$useregns = $ARGV[21];
}
my $language;
if ($ARGV[22]) {
$language=$ARGV[22];
}
if ($ARGV[0] =~ m/:/ || $ARGV[0] =~ m/--help/ || !$domain || !$user || !$pass ) {
my $syntax = "Please use the this syntax\n";
$syntax .=
"wwwacct \e[1m<domain> <user> <pass>\e[0m <quota> <cpmod[advanced/?]> <ip[y/n]> <cgi[y/n]> <frontpage[y/n]> <maxftp> <maxsql> <maxpop> <maxlst> <maxsub> <bwlimit> <hasshell[y]/[n]> <owner> <plan> <maxpark> <maxaddon> <featurelist> <contactemail> <use_registered_nameservers> <language>\n\n";
print $syntax;
exit(1);
}
my $acctout = <<"EOM";
+===================================+
| New Account Info |
+===================================+
| Domain: $domain
| UserName: $user
| PassWord: $pass
+===================================+
EOM
print $acctout;
if ( -t STDIN && $ENV{'PKGRESTORE'} ne "1" ) {
print "This ok? ";
my $isok;
while ( $isok = <STDIN> ) {
$isok =~ s/\n//g;
$isok =~ tr/[A-Z]/[a-z]/;
if ( $isok ne "" ) {
last if $isok =~ /^y/;
if ( $isok =~ /^n/ ) {
cPScript::Errors::deaderror "Ok Guess NOT\n";
}
}
}
}
if ( !$ENV{'REMOTE_USER'} || $ENV{'REMOTE_USER'} eq '' ) { $ENV{'REMOTE_USER'} = 'root'; }
my %WWWACCTCFG = (
domain => $domain,
username => $user,
password => $pass,
quota => $sqto,
cpmod => $cpmo,
useip => $useip,
cgi => $hascgi,
frontpage => $installfp,
maxftp => $maxftp,
maxsql => $maxsql,
maxpop => $maxpop,
maxlst => $maxlst,
maxsub => $maxsub,
bwlimit => abs $bwlimit,
hasshell => $hasshell,
owner => $owner,
plan => $plan,
maxpark => $maxpark,
maxaddon => $maxaddon,
featurelist => $featurelist,
contactemail => $ceml,
forcedns => $forcedns,
useregns => $useregns,
language => $language,
customip => $customip,
);
Whostmgr::ACLS::init_acls();
my ( $status, $result, $output ) = Whostmgr::Accounts::Create::_createaccount(%WWWACCTCFG);
print $result;
print "\n";
print $output;
print "\n";
================================================END OF MY postwwwacct ==========================
AND THIS IS THE EMAIL TO ROOT
Code:
================================================START OF MY wwwacct OUTPUT =======================
(THIS IS THE COPY SENT TO ROOT)
New account on archie.westonehosting.com (simon5.westonecms.com)
+===================================+
| New Account Info |
+===================================+
| Domain: simon5.westonecms.com
| Ip: 67.225.245.129 (n)
| HasCgi: y
| UserName: simon5w
| PassWord: ***HIDDEN***
| CpanelMod: x3
| HomeRoot: /home
| Quota: 500 Meg
| NameServer1: ns1.westonehosting.com
| NameServer2: ns4.westonehosting.com
| NameServer3:
| NameServer4:
| Contact Email: forums@westonehosting.com
| Package: Standard Plan
| Feature List: default
| Language: english
+===================================+
Account was setup by: root (root)
================================================END OF MY wwwacct OUTPUT =======================
My WHM is
WHM 11.23.2 cPanel 11.23.6-S27698
CENTOS Enterprise 4.7 i686 on virtuozzo - WHM X v3.1.0