Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

%domain% -> domain in skeleton

Discussion in 'General Discussion' started by Domenico, Jul 11, 2007.

  1. Domenico

    Domenico Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    371
    Likes Received:
    1
    Trophy Points:
    318
    Hi,

    When creating an account the index.php is taken from the skel dir and copied to the public_html dir from the new account.

    In this index.php we use %domain% and before cPanel 11 the new domain name was written on that spot before copied to the new account (I believe /scripts/postwwwacct did this).

    How can we fix this?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
  3. Shrek

    Shrek Active Member

    Joined:
    Sep 6, 2004
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    Arkansas, USA
    So what would one change on this code?

    # Checks domain name

    if (!@ARGV || $ARGV[0] eq "" || $ARGV[0] !~ /(\S+)/) {
    deaderror("Missing or wrong argument (domain) in /scripts/postwwwacct\n");
    } else {
    $domain = validatedomain($1);
    print "Setting \%domain\% = $domain\n";

    $ip = "";
    if (-r "/var/cpanel/accounting.log") {
    my $lastline = `tail -1 /var/cpanel/accounting.log`;
    if ($lastline =~ /CREATE:(?:[^:]+:){3}([^:]+)/) {
    $ip = $1;
    }
    }
    if ($ip eq "") {
    print "Warning, could not determine IP number from accounting.log\n";
    $ip = $default_ip;
    }
    print "Setting \%ip\% = $ip\n";
    }

    # Creates the index.html file

    $infile = "/$homedir/public_html/$index";
    $outfile = "/$homedir/public_html/$index.postwwwacct";

    open(IN, "<$infile") or deaderror("Cannot read index.html");
    open(OUT, ">$outfile") or deaderror("Cannot open temp file");
    while (<IN>) {
    s/\%domain\%/$domain/g;
    s/\%ip\%/$ip/g;
    print OUT;
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice