newera

Member
Feb 28, 2002
8
0
301
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.
 

newera

Member
Feb 28, 2002
8
0
301
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.
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
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.
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
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&