The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Denie access on new account web page, how?

Discussion in 'General Discussion' started by Jemrada, Oct 6, 2005.

  1. Jemrada

    Jemrada Member

    Joined:
    Jun 30, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    I was wondering if there is a way to have a default setting to where when an accoutn is created via Reseller or standard that it will no allow you to see the folders or information that is there on default install.


    Maybe on my accounts, not the resellers that are through me. A page that say this is the default index until updated. I have been having starnge attacks on sites that are default.


    Any ideas on what or how I can do this?
     
  2. Host4u2

    Host4u2 Well-Known Member

    Joined:
    Mar 24, 2002
    Messages:
    248
    Likes Received:
    0
    Trophy Points:
    16
    Are you using your /root/cpanel3-skel

    The only reason I can imagine anyone seeing the folders and info is the lack of an index.html file in the new account's public_html directory. You can view ours at http://o6z.com

    Your resellers also have a cpanel3-skel directory above their public_html directory that they can ftp their default index.html for new accounts to.
     
  3. Jemrada

    Jemrada Member

    Joined:
    Jun 30, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Thanks, it looks like that will do it. How did you get it to pull the domain on the page?
     
  4. Host4u2

    Host4u2 Well-Known Member

    Joined:
    Mar 24, 2002
    Messages:
    248
    Likes Received:
    0
    Trophy Points:
    16
    Code:
    #!/usr/bin/perl
    # You may need to change this path to /usr/local/bin/perl
    
    #**************************************************************
    #
    # Script to modify skeleton files upon account creation: PWSpostwwwacct3 V2.0
    #
    # Written by:
    #  Premier Website Solutions - [url]http://www.premierwebsitesolutions.com[/url]
    #  Created - in 2003 (V1.0)
    #  Last Modified - October 6, 2004 (V2.0)
    #      - altered to be more usable by others
    #      - added instructions for other users
    #
    # To use this script, just list the pages you want modified below, provide markers on
    #  those pages as explained shortly, and upload this file to the /scripts directory on
    #  your server, renamed to postwwwacct and made executable.
    # 
    # Every time an account is created in WHM, this script is automatically called to
    #  do it's job. Variables are passed to it from WHM's wwwacct script and some of
    #  those variable are used in place of the markers on the skeleton file pages.
    #
    # Here are the variables that are passed to this script:
    #  $ARGV[0] = domain
    #  $ARGV[1] = username
    #  $ARGV[2] = password
    #  $ARGV[3] = space (MB)
    #  $ARGV[4] = theme
    #  $ARGV[5] = ded IP (y/n)
    #  $ARGV[6] = cgi (y/n)
    #  $ARGV[7] = FP (y/n)
    #  $ARGV[8] = max ftp (n or #)
    #  $ARGV[9] = max sql (n or #)
    #  $ARGV[10] = max POP (n or #)
    #  $ARGV[11] = max lists (n or #)
    #  $ARGV[12] = max subs (n or #)
    #  $ARGV[13] = bandwidth (# or 0) in MB's
    #  $ARGV[14] = shell (y/n)
    #  $ARGV[15] = owner
    #  $ARGV[16] = plan
    #  $ARGV[17] = max park (# or unlimited)
    #  $ARGV[18] = max addon  (# or unlimited)
    #  $ARGV[19] = feature list (default)
    #  $ARGV[20] = contact email
    #
    #
    # PROVIDING MARKERS ON PAGES TO BE MODIFIED
    # -----------------------------------------
    #
    #  What this script does is substitute markers on your cpanel3_skel pages with the
    #  variables just listed. The markers are in the format
    #  **ARGV0**
    #  **ARGV1**
    #  **ARGV2**
    #  and so on.
    #
    #  Anywhere you place **ARGV0** in your skeleton pages, that will be replaced with the domain.
    #  Anywhere you place **ARGV1** in your skeleton pages, that will be replaced with the username.
    #  Anywhere you place **ARGV2** in your skeleton pages, that will be replaced with the password.
    #
    #  Obviously, you DO NOT want to put the password on the default pages. That's just
    #  explaining how it works. The ones you may want to use are:
    #  **ARGV0** is replaced with the domain (i.e. domain.com)
    #  **ARGV1** is replaced with the username (we use it for our custom formmail script)
    #  **ARGV3** is replaced with the space in MB's
    #  **ARGV13** is replaced with the bandwidth in MB's
    #
    #  Here is an example of a skeleton index.html page:
    #
    #  <html>
    #  <head>
    #  <title>**ARGV0** temporary front page</title>
    #  </head>
    #  
    #  <body bgcolor="#ffffff" link="#0000ff" alink="#ff00ff" vlink="#ff0000">
    #  
    #  <p align="center">
    #  <b>Welcome to **ARGV0**</b>
    #  
    #  <p align="left">
    #  This is a newly created account. Please bookmark this site and check back later.
    #  
    #  <p align="left">
    #  You can contact the site owner at <a href="mailto:**ARGV20**">**ARGV20**</a>.
    #  
    #  <p align="left">
    #  <u>Website Owner:</u>
    #  
    #  <p align="left">
    #  Your new account is ready. You have **ARGV3**MB's of space and **ARGV13**MB's of bandwidth.<br>
    #  If you have any questions, please contact us at <a href="mailto:email@host.com">email@host.com</a>.
    #  
    #  </body>
    #  </html>
    #
    #
    # Registered users of this script will be notified of any future updates.
    # If you registered this copy with us, put your email here for future reference.
    # This copy is registered to: 
    # 
    #**************************************************************
    
    
    @pages = ("public_html/index.html",
              "public_html/404.shtml",
              "public_html/500.shtml"
    );
    
    
    
    
    #-------------------------------------------------------------------
    #-------------------------------------------------------------------
    # UNLESS YOU KNOW CGI, DO NOT EDIT ANYTHING BELOW HERE
    # Feel free to study the code, but alterations are at your own risk
    #-------------------------------------------------------------------
    #-------------------------------------------------------------------
    
    
    print "\nRunning postwwwacct to alter skeleton files ...\n";
    
    &editsite;
    
    print "\nAlterations completed\n";
    
    
    if (-e "/scripts/postwwwacct2") {
        print "\nSending variables to postwwwacct2.\n";
    	system("/scripts/postwwwacct2",@ARGV);
    }
    
    exit;
    
    
    
    sub editsite {
    foreach $page (@pages) {
    if (-e "/home/$ARGV[1]/$page") {
      print "editing $page\n";
    
      open (FILE,"/home/$ARGV[1]/$page");
      @LINES=<FILE>;
      close(FILE);
      $size=@LINES;
    
      open(FILE2,">/home/$ARGV[1]/$page");
      for ($i=0;$i<=$size;$i++) {
        for ($a=0;$a<="21";$a++) {
          $LINES[$i] =~ s/\*\*ARGV$a\*\*/$ARGV[$a]/g;
        }
        chomp($LINES[$i]);
        print FILE2 "$LINES[$i]\n";
      }
      close(FILE2);
      }
      else {
      print "$page doesn't exist\n";
    }
    }
    
    }
     
Loading...

Share This Page