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.

Generating a custom index page

Discussion in 'General Discussion' started by newera, Mar 19, 2002.

  1. newera

    newera Member

    Joined:
    Feb 28, 2002
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Is it possible to use any of the field tags used when an account
    is created by wwwacct in order to make a custom index.html page from
    the skel? In other words, we would like to insert the username into the
    index page automatically when we create an account.
     
  2. newera

    newera Member

    Joined:
    Feb 28, 2002
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Use for cgi scripts also?

    The same idea should also be available to create custom cgi scripts
    for the cgi-bin in the skel. Inserting the clients paths, etc.
     
  3. hostbet

    hostbet Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    80
    Likes Received:
    0
    Trophy Points:
    6
    I will love to do that...
     
  4. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    Try this

    When the wwwacct script runs call another script to parse /var/cpanel/users/user_name In that file is the following;
    DNS=demo.domain.com
    IP=xxx.xxx.xxx.xxx
    LANG=english
    MAXADDON=10
    MAXPARK=10
    OWNER=reseller id
    PLAN=planname
    RS=iconic
    STARTDATE=1032627111

    By using the IP and DNS you maybe able to customize the index a bit. The other option which I don't know if is allowed is to modify the wwwacct script to open another file and populate it with CPANEL info to pass to index.html.
     
  5. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    script

    This script will read the /var/cpanel/users/**** file and list out the variables change line 15 to point to correct file and run script in browser. Called account.php or something.

    &!DOCTYPE HTML PUBLIC &-//W3C//DTD HTML 4.01 Transitional//EN& &http://www.w3.org/TR/html4/loose.dtd&&
    &?php

    function table_top(){
    echo&&p&&table style=\&font-family: Arial; font-size: 10pt; color: #000080\& width=\&400\& cellpadding=\&4\& cellspacing=\&0\& borderColorDark=\&#EEEEEE\& borderColorLight=\&#AAAAAA\& border=\&1\& bgcolor=\&#f5f5f5\& align=\&center\&&
    &tr&
    &td&&;
    }

    function table_bottom(){
    echo&&/tr&
    &/td&&/table&&/p&&;
    }

    $FILEPATH = &/var/cpanel/users/&;
    $FILE = fopen($FILEPATH, &r&);
    $a = fgets($FILE, 300); // 300 is the amount of characters per line max
    $b = fgets($FILE, 300);
    $c = fgets($FILE, 300);
    $d = fgets($FILE, 300);
    $e = fgets($FILE, 300);
    $f = fgets($FILE, 300);
    $g = fgets($FILE, 300);
    $i = fgets($FILE, 300);
    $j = fgets($FILE, 300);
    $k = fgets($FILE, 300);
    $l = fgets($FILE, 300);
    $m = fgets($FILE, 300);
    $n = fgets($FILE, 300);
    fclose($FILE);

    echo&&html&&head&&;
    echo&&title&Viewing record&/title&&;
    echo&&/head&&body style=\&font-family: Arial; font-size: 10pt; color: #000080\&&&;

    table_top();

    echo&&p align=\&center\&&&font size=\&4\&&Account info Parsed&/font&&/p&&;

    echo &&b&$a&/b&&br&&;
    echo &&b&$b&/b&&br&&;
    echo &&b&$c&/b&&br&&;
    echo &&b&$d&/b&&br&&;
    echo &&b&$e&/b&&br&&;
    echo &&b&$f&/b&&br&&;
    echo &&b&$g&/b&&br&&;
    echo &&b&$i&/b&&br&&;
    echo &&b&$j&/b&&br&&;
    echo &&b&$k&/b&&br&&;
    echo &&b&$l&/b&&br&&;
    echo &&b&$m&/b&&br&&;
    echo &&b&$n&/b&&br&&;

    table_bottom();

    ?&
    &/body&&/html&
     
Loading...

Share This Page