HEX
Server: Apache
System: Linux viper.innovativeinternet.net 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64
User: thetradingroom (1095)
PHP: 8.3.25
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //ibin/newdom.6-30-11
#!/usr/bin/perl

  require("/ibin/functions/webtrends.func");
  require("/ibin/functions/coming_soon_page.func");
  require("/ibin/functions/redirected_page.func");
  require("/ibin/functions/vhosts.func");
  
  $debug = "off";
# $debug = "on";

#----------< Email Notification Defaults >------------------------------------------------------------------------------
$mail_from = "Hosting Server<SystemMonitor\@InnovativeInternet.com>";
$mail_prog = '/usr/sbin/sendmail';
$host_name = `hostname`;
chomp($host_name);
($host_name, $domain, $extension) = (split /\./, $host_name);




  # -----[ Init  Variables ]-----------
  $plan_name = "Chad-Default";
  $color_red    =  "\033[37;41m ";
  $color_blue    =  "\033[37;44m";
  $color_green    =  "\033[30;46m ";
  $color_yellow    = "\033[1;33m";
  $color_clear  = "\033[0m";
  $color_none   = "";

  system("clear");
  print $color_yellow . "              I n n o v a t i v e   I n t e r n e t   S o l u t i o n s\n";
  print                 "                       Domain Management Utility Version 2.0\n";
  print $color_red . "========================================================================" . $color_clear . "\n";
  print "  Remember when entering the domain name to include the extension(.com)\n";
  print "\n";
#  print $color_green . "Creating configuration for: " . $domain_name;


# -----[ Linux Configuration Variables ]-----------
# $hosts_file 	   	   = "/etc/hosts";
  $passwd_file	  	   = "/etc/passwd";
  $zone_file_path  	   = "/var/named";
  $ifcfg_file_path  	   = "/etc/sysconfig/network-scripts";
  $virtusertable_file_path = "/ibin/domaininfo/config/dns";
  $apache_path	   	   = "/etc/httpd/conf";
  $vhosts_path		   = "/ibin/conf/httpd";
  $frontpage_path	   = "/usr/local/frontpage";
  $frontpage_ver	   = "version5\.0";
  $config_db_path	   = "/ibin/domaininfo/config";
  $webtrends_file_path     = "/var/log/httpd/webtrends";
  $home_path   		   = "/home";
  $default_mail_server     = "mail.innovativeinternet.net";
# $stats_path		   = "/var/log/httpd/stats";  
  $stats_path		   = "/home/stats/stats";  
  $base_web		   = "/home/base/baseweb";
  $server_name		   = "master";
  $vhost_path		   = "/ibin/conf/hosting/";
  $frontpage_vhost_path	   = "/usr/local/frontpage/conf";


#----------< Collect Information >------------------------------------------------------------------------------------

	print "$color_blue     Domain Name:\033[0m "; $domain_name 	= <STDIN>; chomp($domain_name);
	$domain_name = lc($domain_name);


  print "$color_blue    Company Name:\033[0m "; $company_name 	= <STDIN>; chomp($company_name);
  print "$color_blue        Reseller:\033[0m "; $reseller     	= <STDIN>; chomp($reseller);
# print "$color_blue     Server Name:\033[0m "; $server_name    = <STDIN>; chomp($server_name);

  print "\n";
  print $color_red . "Virtual Host (y/n):$color_clear "; $virt_host		= <STDIN>; chomp($virt_host);
  if ($virt_host eq "y" or $virt_host eq "Y") {

     $ip_class = "164";
     $ip       = "19";

  } else {

     print "        IP Class (164/165): "; $ip_class     	= <STDIN>; chomp($ip_class);
     print "          IP Address (xxx): "; $ip          	= <STDIN>; chomp($ip);

  }

  print $color_red . "Redirected Host (y/n):$color_clear "; $redir_host		= <STDIN>; chomp($redir_host);
  if ($redir_host eq "y" or $redir_host eq "Y") {
  	print $color_red . "Domain to Redirect:$color_clear "; $redir_host_name		= <STDIN>; chomp($redir_host_name);
  }


#  print "\n";
  print $color_red . "External MailIP (y/n):$color_clear "; $ext_mail		= <STDIN>; chomp($ext_mail);
  if ($ext_mail eq "y" or $ext_mail eq "Y") {
    print "External IP info: "; $ext_mail_ip	= <STDIN>; chomp($ext_mail_ip);
  }


  print "\n";
  print $color_yellow . "  * PLAN TYPES:::: 0=DNS Only - 1=Starter - 2=Bronze - 3=Silver - 4=Gold - 5 301 ReDirect\n" . $color_clear;
  print "$color_red       Plan Type:$color_clear "; $plan_type   	= <STDIN>; chomp($plan_type);

  if($plan_type != 0 && $plan_type != 1 && $plan_type !=5) {

     print "\n";
     print $color_red . "Frontpage (y/n): ". $color_clear; $frontpage    	= <STDIN>; chomp($frontpage);
     print "\n";
     print $color_red . "FTP: ". $color_clear; $ftp_yes    	= <STDIN>; chomp($ftp_yes);


   #-----[ Get UID & Pass ]-------------------------------------------------------------------------------------------------------
   if ($frontpage eq "y" or $frontpage eq "Y" or $ftp_yes eq "y" or $ftp_yes eq "Y") {
#   if ($frontpage eq "y" or $frontpage eq "Y") {
        print "$color_blue   Domain MGR ID: \033[0m"; $user_id     	= <STDIN>; chomp($user_id);
        print "$color_blue    MGR Password: \033[0m"; $mgrpasswd    	= <STDIN>; chomp($mgrpasswd); 
   }



  }


#  print "* * *  Plan Type is ->" . $plan_type."<---\n";
  print "$color_blue Default Email:$color_clear "; $fwd_email   	= <STDIN>; chomp($fwd_id);

#-----[ Working ]--------------------------------------------------------------------------------------------------------------

  $server_name = "\L$server_name";
  $domain_name = "\L$domain_name";
  $user_id     = "\L$user_id";
  ($domain_name2 = $domain_name) =~ s/\./_/g;

  if ($plan_type != 0) {
    &make_dirs;

  if($plan_type != 0 && $plan_type != 1 && $plan_type != 5 ) {
    &add_user;
    print "User ID $user_id has password $mgrpasswd\n";
  } else {
#    print "=====< SKIP Adding User         >===============" . $color_clear . "\n";
     print $color_green . "........................  SKIP Adding User  ........................" . $color_clear . "\n";

  }

    &name_service;
    &httpd_service;		
    &send_mail;

#JACK
   $mail_to = "accounting\@innovativeinternet.com";
	$message = "Billing Notification -> Domain: " . $domain_name . " Plan: " . $plan_name; 
   email_message();                 



    if ($virt_host eq "y" or $virt_host eq "Y") {
       print "=====< SKIP Network Interface    >===============" . $color_clear . "\n";
     print $color_green . "........................  SKIP Network Interface  ........................" . $color_clear . "\n";
    } else {
       &network_interface;
    }

    if ($frontpage eq "y" or $frontpage eq "Y") {
      &frontpage_vhost;
      &frontpage;
    }
  
    if ($redir_host eq "y" or $redir_host eq "Y") {
	&redirected_page;
    } else {
    	&coming_page;
    }

    &secure_dirs;

    if($plan_type != 0 && $plan_type != 1 && $plan_type != 5) {
       &set_ownership;
    } else {

#       print "=====< SKIP Ownership Settings   >===============" . $color_clear . "\n";
     print $color_green . "........................  SKIP Ownership Settings  ........................" . $color_clear . "\n";
    }

    &domain_list;
    &dbstore;
    &webtrends;

  } else {

    print "DNS Domain\n";
    &name_service;
    &send_mail;
    &domain_list;
    &dbstore;
  }

#  &restart;


# =====[ Sub Routines ]=============================================

# -----[DB Store - Database containing All Data about domains]----------
sub dbstore {

print $color_green . "........................  Storing DB Information  ........................" . $color_clear . "\n";

  if($debug eq "off") {

   open(DBSTORE,">>$config_db_path/config.db") or die($!);
	#  print DBSTORE "$domain_name:$company_name:$reseller:$ip_class:$ip:$plan_type:$frontpage:$user_id:$mgrpasswd\n";

	$plan_name = "DNS"      if ($plan_type == 0);
	$plan_name = "Starter"  if ($plan_type == 1);
	$plan_name = "Bronze"   if ($plan_type == 2);
	$plan_name = "Silver"   if ($plan_type == 3);
	$plan_name = "Gold"     if ($plan_type == 4);
	$plan_name = "301" 		if ($plan_type == 5);

  	print DBSTORE "$domain_name|$company_name|$reseller|$ip_class|$ip|$plan_name|$frontpage|$user_id|$mgrpasswd|$ext_mail|$ext_mail_ip\n";

  	close(DBSTORE);

  } else {

   &debug_header($sub_name = (caller(0))[3]);
   print "$domain_name|$company_name|$reseller|$ip_class|$ip|$plan_name|$frontpage|$user_id|$mgrpasswd|$ext_mail|$ext_mail_ip\n";
   print "\n\n";

  }
}


# -----[ Make Sub Directories for New Domains ]----------
sub make_dirs {

	print $color_green . "........................  Making Directories  ........................" . $color_clear . "\n";

	if($debug eq "off") {

   	#  system("mkdir $home_path/$domain_name");
   	#  system("mkdir $home_path/$domain_name/bin");
   	#  system("mkdir $home_path/$domain_name/lib");
   	#  system("mkdir $home_path/$domain_name/mail");
		#  system("mkdir $home_path/$domain_name/www/cp");

   	system("mkdir -p $home_path/$domain_name/www");
   	system("mkdir $home_path/$domain_name/www/cgi-bin");
 
	if ($plan_type !=5 or $plan_type !=0) {

	   system("mkdir $stats_path/$domain_name");
	   system("/bin/ln -s /$stats_path/$domain_name /$home_path/$domain_name/www/stats");
	   #  system("cp -ra /home/base/bin/. $home_path/$domain_name/bin");
	   #  system("cp -ra /home/base/lib/. $home_path/$domain_name/lib");
	}
  
 } else {

   &debug_header($sub_name = (caller(0))[3]);
   print "\n\n";
 }
}




# -----[ Create User Entries in passwd file ]----------
sub add_user {

print $color_red . "=====< Adding User >===========================================================" . $color_clear . "\n";

#($adduser_result) = system("/usr/sbin/adduser $f[1] -c $f[2] -p $crypt -d /home/mail/$f[2]/$f[1] -s /bin/false");

$crypt = encrypt($mgrpasswd);

system("/usr/sbin/adduser $user_id -p $crypt -d $home_path/$domain_name/www/./ -s /sbin/nologin -g nobody");

}


# -----[ Set Ownership of the Domain Directory ]----------
sub set_ownership {

#print $color_red . "=====< Update Ownership          >===============" . $color_clear . "\n";
     print $color_green . "........................  Update Ownership  ........................" . $color_clear . "\n";


 if($debug eq "off") {

  print "Setting permissions\n";
  system("chown -R $user_id:nobody $home_path/$domain_name/www");

 } else {

  &debug_header($sub_name = (caller(0))[3]);
  print "Setting permissions\n";
  print "chown -R $user_id:nobody $home_path/$domain_name/www";
  print "\n\n";

 }
}



# -----[ Create DNS Entries ]----------

sub name_service {

#print $color_red . "=====< Creating DNS Entires     >===============" . $color_clear . "\n";
     print $color_green . "........................  Creating DNS Entires  ........................" . $color_clear . "\n";

 if($debug eq "off") {

  # Append to /etc/hosts
  ######################
  #open(HOSTS,">>$hosts_file") or die "$!\n";
  #print HOSTS "208.244.$ip_class.$ip\t$domain_name\n";
  #close(HOSTS);

  # Append /etc/named.boot & /etc/named.conf
  ########################
  #open(BOOT,">>/etc/named.boot")  or die "$!\n";
  #print BOOT "primary\t\t$domain_name\t\tdb.$domain_name\t\; 208.244.$ip_class.$ip\n";
  #close(BOOT);
 
  # Original Modify Named.conf Directly
  #  open(BOOT2,">>/etc/named.conf")  or die "$!\n";
  #  print BOOT2 "\n";
  #  print BOOT2 "// 208.244.$ip_class.$ip\n";
  #  print BOOT2 "\t\zone \"$domain_name\" {\n";
  #  print BOOT2 "\ttype master;\n";
  #  print BOOT2 "\tfile \"db.$domain_name\";\n";
  #  print BOOT2 "};\n";
  #  close(BOOT2);

  open(BOOT2,">>/ibin/domaininfo/config/dns/dnsmasterfile")  or die "$!\n";
  #  print BOOT2 "$server_name:$domain_name:208.244.$ip_class.$ip\n";


	$plan_name = "DNS"     if ($plan_type == 0);
	$plan_name = "Starter" if ($plan_type == 1);
	$plan_name = "Bronze"  if ($plan_type == 2);
	$plan_name = "Silver"  if ($plan_type == 3);
	$plan_name = "Gold"    if ($plan_type == 4);
	$plan_name = "301" 		if ($plan_type == 5);

  #   print DBSTORE "$domain_name|$company_name|$reseller|$ip_class|$ip|$plan_name|$frontpage|$user_id|$mgrpasswd|$ext_mail|$ext_mail_ip\n";

  print BOOT2 "$server_name:$domain_name:208.244.$ip_class.$ip:$company_name:$reseller:$plan_name:$frontpage:$user_id:$mgrpasswd:$ext_mail:$ext_mail_ip\n";
  close(BOOT2);


  # Append $zone_file_path/db.208.244.164 or 165
  #############################

  open(REV,"$zone_file_path/db.208.244.$ip_class");
  @file=<REV>;
  close(REV);

  open(REV,">$zone_file_path/db.208.244.$ip_class");
  foreach $line (@file) {

    chomp($line);
    if($line =~ /serial number/) {

      ($count)   = split(/\;/,$line);
      $count     =~ s/^[ \t]+//;
      $new_count = $count + 1;

      print REV "                              $new_count\; serial number\n";

    } else {
      print REV "$line\n";
    }
  }
  close(REV);


  open(REV,">>$zone_file_path/TEMP.db.208.244.$ip_class") or die "$!\n";
  print REV "$ip\tIN\tPTR\t$domain_name.\n";
  close(REV);

  # Create zone file
  ##################

  &make_zone;


 } else {

   &debug_header($sub_name = (caller(0))[3]);
   print "Adding Forward & Reverse Files\n";
   print "$server_name:$domain_name:208.244.$ip_class.$ip:$company_name:$reseller:$plan_name:$frontpage:$user_id:$mgrpasswd:$ext_mail:$ext_mail_ip\n";
   print "Reverse IP\n";
   print "$ip\tIN\tPTR\t$domain_name.\n";


 }
}


# -----[ Create Encrypted Password ]----------

sub get_passwd {

  srand;

  $passwd = "";

  @char = ("A".."Z","a".."z","0".."9");

  for($i=0;$i<=7;$i++) {
    $rand    = int(rand(61));
    $passwd .= $char[$rand];
  }

  @range=('0'..'9','a'..'z','A'..'Z');
  srand($$|time);
  $seed=$range[rand(int($#range)+1)] . $range[rand(int($#range)+1)];

  $crypt = crypt($passwd,$seed);

  return($password,$crypt);
}


# -----[ Create Sendmail Entries for the Domain ]----------
sub send_mail {
}


sub HOLDsend_mail {
 if($debug eq "off") {

  if($fwd_email) {

    print "Appending to $virtusertable_file_path/sendmail.cf\n";

    #    open(SENDMAILCW,">>$virtusertable_file_path/local-host-names") or die;
    #    print SENDMAILCW "$domain_name\n";
    #    close(SENDMAILCW);

    print "Appending to $virtusertable_file_path/vir...\n";

    # VIRTUAL USER
    ##############
    #    open(VIRTUAL,">>$virtusertable_file_path/virtusertable");
    open(VIRTUAL,">>$virtusertable_file_path/virtual");

    if ($fwd_email eq "") {
       $fwd_email = "error:nouser IISG:No Such Mailbox";
    }

    print VIRTUAL "\@$domain_name\t\t\t$fwd_email";
    close(VIRTUAL);

    # DB
    ############
   
    #    print "builddb\n";  
    #    system("/usr/sbin/builddb");
  }

 } else {

   &debug_header($sub_name = (caller(0))[3]);
   print "Adding Email information";
   print "\@$domain_name\t\t\t$fwd_email";
   print "\n\n";

 }
}


# -----[ Create ifcfg configuration file for Domain ]---------
sub network_interface {


#print $color_red . "=====< Creating Network Interface >===============================================================" . $color_clear . "\n";
     print $color_green . "........................  Creating Network Interface  ........................" . $color_clear . "\n";

 if($debug eq "off") {

  if ($ip_class eq "164") {
     open(NETWORK,">$ifcfg_file_path/ifcfg-eth0:$ip") or die;
     print NETWORK "DEVICE=eth0:$ip\n";
     print NETWORK "IPADDR=208.244.164.$ip\n";
     print NETWORK "NETMASK=255.255.254.0\n";
     print NETWORK "NETWORK=208.244.164.0\n";
     print NETWORK "BROADCAST=208.244.165.255\n";
     print NETWORK "ONBOOT=yes\n";
     close(NETWORK);

     system("$ifcfg_file_path/ifup $ifcfg_file_path/ifcfg-eth0:$ip");
  }

  if ($ip_class eq "165") {
        open (NETWORK, (">$ifcfg_file_path/ifcfg-eth0:" . ($ip + 300 ) ) );
        print NETWORK "DEVICE=eth0:" . ($ip + 300) . "\n";
        print NETWORK "IPADDR=208.244.165.$ip\n";
        print NETWORK "NETMASK=255.255.254.0\n";
        print NETWORK "NETWORK=208.244.164.0\n";
        print NETWORK "BROADCAST=208.244.165.255\n";
        print NETWORK "ONBOOT=yes\n";
        close(NETWORK);

     system(("$ifcfg_file_path/ifup $ifcfg_file_path/ifcfg-eth0:" . ($ip + 300)));
  }

 } else {
   
   &debug_header($sub_name = (caller(0))[3]);
   print "Creating Network Interface for " . $ip;
   print "\n\n";

 }
}



# -----[ ReStart Name and Apache Services ]----------
sub restart {

 if($debug eq "off") {
      
     system("/ibin/dnsreb");
     system("/ibin/apareb");

     print "Live Mode - Restarting Name & Apache Services";

  } else {

     &debug_header($sub_name = (caller(0))[3]);
     print "Debug Mode - Not Restarting Name & Apache Services";
     print "\n\n";

  }

}

# -----[ Create Apache Entries for Domain ]----------

sub httpd_service {
  if($debug eq "off") {

#print $color_red . "=====< Creating Apache Entries   >===============" . $color_clear . "\n";
     print $color_green . "........................  Creating Apache Configuration  ........................" . $color_clear . "\n";

    open(HTTPD,">$vhost_path/$domain_name") or die;
#    print HTTPD "\n";

  if ($virt_host eq "y" or $virt_host eq "Y") {
    print HTTPD "<VirtualHost 208.244.164.19:80>\n";
    
  } else {
    print HTTPD "<VirtualHost www.$domain_name:80>\n";

  }

    print HTTPD "   ServerAdmin admin\@innovativeinternet.com\n";
    print HTTPD "   DocumentRoot $home_path/$domain_name/www\n";
  if ($virt_host eq "y" or $virt_host eq "Y") {
    print HTTPD "   ServerName   www.$domain_name\n";
    print HTTPD "   ServerAlias  $domain_name\n";
  } else {
    print HTTPD "   ServerName   www.$domain_name\n";
  }
    print HTTPD "   ScriptAlias  /cgi-bin/ $home_path/$domain_name/www/cgi-bin/\n";
    print HTTPD "</VirtualHost>\n";
    print HTTPD "\n";
    close(HTTPD);


  } else {

   &debug_header($sub_name = (caller(0))[3]);
    print "Debug Mode - Apache Configuration Update";
    print "\n";

  if ($virt_host eq "y" or $virt_host eq "Y") {
    print "<VirtualHost 208.244.164.8>\n";
    
  } else {
    print "<VirtualHost www.$domain_name>\n";

  }

    print "   ServerAdmin admin\@innovativeinternet.com\n";
    print "   DocumentRoot $home_path/$domain_name/www\n";

  if ($virt_host eq "y" or $virt_host eq "Y") {
    print "   ServerName www.$domain_name\n";
    print "   ServerAlias $domain_name\n";
  } else {
    print "   ServerName www.$domain_name\n";
  }

    print "   ScriptAlias /cgi-bin/ $home_path/$domain_name/www/cgi-bin/\n";
    print "</VirtualHost>\n";
    print "\n";
    print "\n\n";

  }
}


# --------------------------------------------------------------------------------------------------------------------------
# -----[ Create Zone file for Domain ]----------
sub make_zone {

  if($debug eq "off") { $zone = "ZONE"; } else { $zone = "STDERR"; }



if ($ext_mail eq "y" or $ext_mail eq "Y") {
   #-----< Customer Mailserver >--------------------------------------------------------------------------------------------
   $mail_address_record = "mail.$domain_name.\t\tIN\tA\t\t$ext_mail_ip";
   $mail_mx_record = "$domain_name.\t\tIN\tMX\t\t10\t\tmail.$domain_name.";
   $mail_mx_record2 = ";$domain_name.\t\tIN\tMX\t\t20\t\tmail3.innovativeinternet.net.";
   $mail_mx_record3 = ";$domain_name.\t\tIN\tMX\t\t30\t\tmail2.innovativeinternet.net.";
   $mail_mx_record4 = "$domain_name.\t\tIN\t\tMX\t90\t\ttarbaby.junkemailfilter.com.";
   $mail_cname_record = ";mail\t\t\tIN\tCNAME\t$default_mail_server.";
   $spf_record = "$domain_name.\t\tIN TXT \"v=spf1 ip4:$ext_mail_ip ip4:208.244.164.0/24 ip4:208.244.165.0/24 mx include:innovativeinternet.net ~all\"";


} else {
   #-----< Innovative Mailserver >--------------------------------------------------------------------------------------------
   $mail_cname_record = "mail\t\t\tIN\tCNAME\t$default_mail_server.";
   $mail_mx_record = "$domain_name.\t\tIN\t\tMX\t10\t\t$default_mail_server.";
   $mail_mx_record2 = ";$domain_name.\t\tIN\t\tMX\t20\t\tmail3.innovativeinternet.net.";
   $mail_mx_record3 = ";$domain_name.\t\tIN\t\tMX\t30\t\tmail2.innovativeinternet.net.";
   $mail_mx_record4 = "$domain_name.\t\tIN\t\tMX\t90\t\ttarbaby.junkemailfilter.com.";
   $spf_record = "$domain_name.\t\tIN TXT \"v=spf1 ip4:208.244.164.0/24 ip4:208.244.165.0/24 mx include:innovativeinternet.net ~all\"";

}


open(ZONE,">$zone_file_path/db.$domain_name");
print $zone <<"EOF";
;-------------------------------------------------------------------------
; Innovative Internet Solutions Group, Inc. 
; START_OF_AUTHORITY RECORD for db.$domain_name
;-------------------------------------------------------------------------
;
\$TTL    3600
@ IN SOA ns1.innovativeinternet.net. support.innovativeinternet.com. (
                        1  	;serial number
			3h	;refresh (8 hours) 
			1h	;retry   (1 hour) 
			30d     ;expire  (30 Days) 
			1d  )   ;TTL     (1 day)


; -----[ Nameserver Records ]-------------------------------------
$domain_name.\t\tIN\t\tNS\t\tns1.innovativeinternet.net.
$domain_name.\t\tIN\t\tNS\t\tns2.innovativeinternet.net.
$domain_name.\t\tIN\t\tNS\t\tns3.innovativeinternet.net.

\$ORIGIN $domain_name.
;-----[ Address Records ]-----------------------------------------
localhost\t\tIN\t\tA\t\t127.0.0.1
$domain_name.\t\tIN\t\tA\t208.244.$ip_class.$ip
$mail_address_record


;-----[ SPF Record ]-----------------------------------------
$spf_record


;-----[ MX Mail Records ]-----------------------------------------
$mail_mx_record
$mail_mx_record2
$mail_mx_record3
$mail_mx_record4

;-----[ CNAME Records / Aliases ]---------------------------------
ftp\t\t\tIN\tCNAME\t$domain_name.
www\t\t\tIN\tCNAME\t$domain_name.
$mail_cname_record

EOF

}

# --------------------------------------------------------------------------------------------------------------------------




#-----[ Secure Control Panel & Stats Directories ]----------
sub secure_dirs {

  if($debug eq "off" and $plan_type !=0 or $plan_type !=5) {

   #-----[ Stats Directory Access ]----------
    open(SECUREA,">$home_path/$domain_name/www/stats/.htaccess") or die($!);
    print SECUREA "AuthUserFile $home_path/$domain_name/www/stats/.htpasswd\n";
    print SECUREA "AuthGroupFile /dev/null\n";
    print SECUREA "AuthName \"StatCenter for $domain_name\"\n";
    print SECUREA "AuthType Basic\n\n";
    print SECUREA "<Limit GET POST PUT>\n";
    print SECUREA "require valid-user\n";
    print SECUREA "</Limit>\n";
    close(SECUREA);
    
    open(SECUREP,">$home_path/$domain_name/www/stats/.htpasswd") or die"$!";
    $after_crypt  = &encrypt($mgrpasswd);
    print SECUREP "$user_id:$after_crypt\n";
    print SECUREP "admin:M88Mp6DvR6Ofw\n";
    close(SECUREP);

   #-----[ Control Panel Directory Access ]----------
    open(SECUREA,">$home_path/$domain_name/www/cp/.htaccess") or die($!);
    print SECUREA "AuthUserFile $home_path/$domain_name/www/cp/.htpasswd\n";
    print SECUREA "AuthGroupFile /dev/null\n";
    print SECUREA "AuthName User ID\n";
    print SECUREA "AuthType Basic\n\n";

    print SECUREA "<Limit GET POST PUT>\n";
    print SECUREA "require valid-user\n";
    print SECUREA "</Limit>\n";
    close(SECUREA);
    
    open(SECUREP,">$home_path/$domain_name/www/cp/.htpasswd") or die"$!";
    print SECUREP "$user_id:$after_crypt\n";
    print SECUREP "admin:M88Mp6DvR6Ofw\n";
    close(SECUREP);


  } else {

    &debug_header($sub_name = (caller(0))[3]);
    print "Creating .htaccess & .htpasswd";
    print "\n\n";

  }
}




#-----[ Quick Home Page for the Site ]----------
sub OLDcoming_page {


  if($debug eq "off") {

      if ($reseller eq "y") {
 	open(WEBPAGE,">$home_path/$domain_name/www/index.html") or die;

    	print WEBPAGE <<"EOF";

	<html>
        <head>
                <title>Welcome to the $company_name web site.</title>
        </head>


        <font size=+4><CENTER>$company_name</CENTER>
       <CENTER><img src="cs.gif" alt=""></CENTER>

        </body>
	</html>
EOF

	system("cp -ra $base_web/. $home_path/$domain_name/www/.");

      } else {


        open(WEBPAGE,">$home_path/$domain_name/www/index.html") or die;

        print WEBPAGE <<"EOF";

	<html>

	<head>
	<title>Welcome to $company_name's coming soon page.</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	</head>

	<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0">

	<table border="0" width="100%" cellspacing="0" cellpadding="0">
  	<tr>
    	<td width="100%">
      	<div align="center">
        <center>
        <table border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td colspan="4"><img border="0" src="http://innovativeinternet.com/images/newdomain/1pix-transparent.gif" width="3" height="3"></td>
          </tr>
          <tr>
            <td><img src="http://innovativeinternet.com/images/newdomain/index_01.gif" width="95" height="187"></td>
            <td background="http://innovativeinternet.com/images/newdomain/index_02.jpg" valign="top"><font face="Arial" color="#FFFFFF" size="2"><b><img border="0" src="http://innovativeinternet.com/images/newdomain/1pix-transparent.gif" width="5" height="14"><br>
              $company_name</b></font></td>
            <td background="http://innovativeinternet.com/images/newdomain/index_03.jpg" valign="top" align="right"><font face="Arial" color="#FFFFFF" size="2"><b><img border="0" src="http://innovativeinternet.com/images/newdomain/1pix-transparent.gif" width="5" height="14"><br>
              $domain_name</b></font></td>
            <td><img src="http://innovativeinternet.com/images/newdomain/index_04.gif" width="55" height="187"></td>
          </tr>
          <tr>
            <td><img src="http://innovativeinternet.com/images/newdomain/index_05.gif" width="95" height="206"></td>
            <td><img src="http://innovativeinternet.com/images/newdomain/index_06.jpg" width="219" height="206"></td>
            <td><a href="http://www.innovativeinternet.com"><img src="http://innovativeinternet.com/images/newdomain/index_07.jpg" border="0" width="231" height="206"></a></td>
            <td><img src="http://innovativeinternet.com/images/newdomain/index_08.gif" width="55" height="206"></td>
          </tr>
        </table>
        </center>
      	</div>
      	<p>&nbsp;</td>
  	</tr>
	</table>

	</body>

	</html>

EOF
  
	system("cp -ra $base_web/. $home_path/$domain_name/www");
      }

   } else {

     &debug_header($sub_name = (caller(0))[3]);

print $color_red . "=====< Creating Coming Soon Page >====================================" . $color_clear . "\n";


   }
}


sub domain_list {

#    open(VIRTUAL, ">>/home/jack/bin/clientlist.html");
#    print VIRTUAL "$compan_name\t\t\twww.$domain_name\n\n";
#    close(VIRTUAL);

}


sub encrypt {
print "\n\n-----[ Info: Executing Module Sub_Encrypt ]----------\n";

  @range=('0'..'9','a'..'z','A'..'Z');
  srand($$|time);
  $seed=$range[rand(int($#range)+1)] . $range[rand(int($#range)+1)];
  return( crypt($_[0],$seed));

}



sub frontpage {
print "\n\n-----[ Info: Executing Frontpage ]----------\n";
# system("fpinst $domain_name")

  if($debug eq "off") {

#    system("$frontpage_path\/$frontpage_ver/bin/owsadm.exe -p 80 -o install -type apache-fp -s $apache_path/httpd.conf -u $user_id -pw $mgrpasswd -m www.$domain_name -xu $user_id -xg nobody");
# cPANEL INSTALL OF fp NEXT 2 LINES
#/usr/local/frontpage/version5.0/bin/owsadm.exe -o install -t apache-fp -m www.screenhacker.com -p 80 -xuser screen -xgroup screen -u screen 
#-pw x -servconf /usr/local/apache/conf/sites/screenhacker.com.conf

    open(FPCONFIG, ">$frontpage_path/www.$domain_name:80.cnf");
    
    print FPCONFIG "vti_logging:1\n";
    print FPCONFIG "sendmailcommand:/usr/sbin/sendmail\n";
    print FPCONFIG "serverconfig:$frontpage_vhost_path/$domain_name\n";
    print FPCONFIG "serverconfig:$frontpage_path/www.$domain_name.fp.80.cnf\n";

    close(FPCONFIG);

system("$frontpage_path\/$frontpage_ver/bin/owsadm.exe -p 80 -o install -t apache-2.0 -s $apache_path/httpd.conf -u $user_id -pw $mgrpasswd -m www.$domain_name -xu $user_id -xg nobody");

  } else {

   &debug_header($sub_name = (caller(0))[3]);
    print "$frontpage_path/$frontpage_ver/bin/owsadm.exe -p 80 -o install -s $apache_path/httpd.conf -u $user_id -pw $mgrpasswd -m www.$domain_name -xu $user_id -xg nobody";

  }
}



sub debug_header {
print "\n\n-----[ Info: Executing Module Debug_Header ]----------\n";

#    $sub_name = (caller(0))[3];

    print "\n\n-----[ Debug Mode: Executing Module $sub_name ]----------\n";

}


sub screen_message {
 $message_display;

 print "\n\n-----[ $message_display ]----------\n";


}


sub email_message() {

#    open(MAIL,"|$mail_prog -f $mail_from -t $mail_to");
    open(MAIL,"| $mail_prog -t -f '$mail_from'");
    print MAIL "To: $mail_to\n";
    print MAIL "Bcc: $bcc_email\n";
    print MAIL "From: $mail_from\n";
    print MAIL "Subject: $message\n";
    print MAIL "\n";
    print MAIL $message . "\n\n";   
    print MAIL "This Message Was Generated By on Server ID: $host_name\n";
  close(MAIL);

return();
}