Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Jun 2005
    Posts
    13

    Post Denie access on new account web page, how?

    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. #2
    Member Host4u2's Avatar
    Join Date
    Mar 2002
    Posts
    245

    Default

    Are you using your /root/cpanel3-skel

    /root/cpanel3-skel
    This directory is what will be used as a skeleton for new accounts. For example if you place an index.html file in /root/cpanel3-skel/public_html, and then setup a new account, that account will have a copy of your index.html in their public_html directory.
    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. #3
    Member
    Join Date
    Jun 2005
    Posts
    13

    Default

    Thanks, it looks like that will do it. How did you get it to pull the domain on the page?

  4. #4
    Member Host4u2's Avatar
    Join Date
    Mar 2002
    Posts
    245

    Default

    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 - http://www.premierwebsitesolutions.com
    #  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";
    }
    }
    
    }

Similar Threads & Tags
Similar threads

  1. Domain redirect to default web page after account termination?
    By jamesbond in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 11-03-2010, 09:04 AM
  2. Cant access an account via web... rights??
    By absolutenetwork in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-27-2007, 09:00 PM
  3. Replies: 4
    Last Post: 10-15-2005, 08:43 AM
  4. web page access through ssl
    By dragonengineer in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 03-02-2005, 06:20 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube