Minor tweaks.

This commit is contained in:
Jeff Teunissen 2001-06-06 07:40:03 +00:00
parent 2e96c8bf85
commit c8a8e73ea7
3 changed files with 169 additions and 165 deletions

View file

@ -4,9 +4,9 @@
require("parts/preamble.php"); // Load most of document require("parts/preamble.php"); // Load most of document
?> ?>
<!--SEARCHME--> <!--SEARCHME-->
<P>Website Copyright &copy; 1999,2000 contributors of the QuakeForge Project. <P>Web site Copyright &copy; 1999-<? echo date("Y"); ?> the QuakeForge Project.
<P>QuakeForge is Copyright &copy; 1999,2000 contributors of the QuakeForge project.<BR> <P>QuakeForge is Copyright &copy; 1999-<? echo date("Y"); ?> the QuakeForge project.<BR>
Portions Copyright &copy; 1996-1997 id Software, Inc. Portions Copyright &copy; 1996-1997 id Software, Inc.
<P>Quake&reg; and QuakeWorld&reg; are registered trademarks of id Software, Inc. <P>Quake&reg; and QuakeWorld&reg; are registered trademarks of id Software, Inc.

View file

@ -1,161 +1,165 @@
<? // Preamble <? // Preamble
$pageName = "Admin - Add User"; $pageName = "Admin - Add User";
$focused = "home"; // Dock icon name to gets a border $focused = "home"; // Dock icon name to gets a border
$need = 'auth'; $need = 'auth';
require("../parts/preamble.php"); // Load most of document require "../parts/preamble.php"; // Load most of document
?> ?>
<? <?
if ($u_username) { if ($userInfo[u_admin] == 'Y' && $u_username) {
need('sql'); need('sql');
$u_username = AddSlashes($u_username); $u_username = AddSlashes ($u_username);
$u_fullname = AddSlashes($u_fullname); $u_fullname = AddSlashes ($u_fullname);
$u_email = AddSlashes($u_email); $u_email = AddSlashes ($u_email);
$u_password = AddSlashes($u_password); $u_password = AddSlashes ($u_password);
$u_addr1 = AddSlashes($u_addr1); $u_addr1 = AddSlashes ($u_addr1);
$u_phone = AddSlashes($u_phone); $u_phone = AddSlashes ($u_phone);
$u_addr2 = AddSlashes($u_addr2); $u_addr2 = AddSlashes ($u_addr2);
$u_country = AddSlashes($u_country); $u_country = AddSlashes ($u_country);
$u_admin = ($u_admin) ? 'Y' : 'N'; $u_admin = ($u_admin) ? 'Y' : 'N';
$conn = mysql_connect (sqlHost, sqlUser, sqlPass); $conn = mysql_connect (sqlHost, sqlUser, sqlPass);
if ($conn) { if ($conn) {
$query1 = 'INSERT into members (u_username, u_fullname, u_email, u_password, u_addr1, u_phone, u_addr2, u_country, u_admin) VALUES (' . $query1 = 'INSERT into members (u_username, u_fullname, u_email, u_password, u_addr1, u_phone, u_addr2, u_country, u_admin) VALUES (' .
" '$u_username', '$u_fullname', '$u_email', ENCRYPT('$u_password', '$u_username'), '$u_addr1', '$u_phone', '$u_addr2', '$u_country', '$u_admin')"; " '$u_username', '$u_fullname', '$u_email', ENCRYPT('$u_password', '$u_username'), '$u_addr1', '$u_phone', '$u_addr2', '$u_country', '$u_admin')";
$result = mysql_db_query (sqlDB, $query1, $conn); $result = mysql_db_query (sqlDB, $query1, $conn);
if ($result) { if ($result) {
$numRows = mysql_affected_rows ($conn); $numRows = mysql_affected_rows ($conn);
if ($numRows) { if ($numRows) {
echo '<P>User added to members dbase successfully.'; echo "<P>User &quot;$u_username&quot; added to members database successfully.";
} else { } else {
echo '<P>There was an error in your input. The error was ' . mysql_error ($conn); echo '<P>There was an error in your input. The error was ' . mysql_error ($conn);
} }
} else { } else {
echo '<P>There was an error in your input. The error was ' . mysql_error ($conn); echo '<P>There was an error in your input. The error was ' . mysql_error ($conn);
} }
$query2 = 'INSERT into devel_plans (p_user, p_date, p_plan) VALUES (' .
"'$u_username', NOW(), 'None')"; $query2 = "INSERT into devel_plans (p_user, p_date, p_plan) VALUES ('$u_username', NOW(), 'None')";
$result2 = mysql_db_query (sqlDB, $query2, $conn); $result2 = mysql_db_query (sqlDB, $query2, $conn);
if ($result2) { if ($result2) {
$numRows2 = mysql_affected_rows ($conn); $numRows2 = mysql_affected_rows ($conn);
if ($numRows2) { if ($numRows2) {
echo '<P>User added to plan dbase successfully.'; echo "<P>User &quot;$u_username&quot; added to plan dbase successfully.";
} else { } else {
echo '<P>There was an error in your input. The error was ' . mysql_error ($conn); echo '<P>There was an error in your input. The error was ' . mysql_error ($conn);
} }
} else { } else {
echo '<P>There was an error in your input. The error was ' . mysql_error ($conn); echo '<P>There was an error in your input. The error was ' . mysql_error ($conn);
} }
mysql_close ($conn); mysql_close ($conn);
} else { } else {
echo 'You suck, butthead.'; echo 'You suck, butthead. (the SQL server could not be contacted)';
} }
} else { } else {
?> if ($userInfo[u_admin] == 'Y') {
<FORM action="adduser.php" method="post"> ?>
<? <FORM action="adduser.php" method="post">
tableBoxHeader (featureBgColor, tableHeadColor); <?
tableTitle ("Required Information", 1, tableHeadColor); tableBoxHeader (featureBgColor, tableHeadColor);
?> tableTitle ("Required Information", 1, tableHeadColor);
<TR> ?>
<TD> <TR>
<? tableHeader ('100%', featureBgColor); ?> <TD>
<TR vAlign="center"> <? tableHeader ('100%', featureBgColor); ?>
<TD align="right" noWrap> <TR vAlign="center">
Username: <TD align="right" noWrap>
</TD> Username:
<TD align="left"> </TD>
<INPUT type="text" name="u_username" size="12"></INPUT> <TD align="left">
</TD> <INPUT type="text" name="u_username" size="12"></INPUT>
<TD align="right" noWrap> </TD>
Real Name: <TD align="right" noWrap>
</TD> Real Name:
<TD align="left"> </TD>
<INPUT type="text" name="u_fullname" size="24"></INPUT> <TD align="left">
</TD> <INPUT type="text" name="u_fullname" size="24"></INPUT>
</TR> </TD>
<TR vAlign="center"> </TR>
<TD align="right" noWrap> <TR vAlign="center">
Email: <TD align="right" noWrap>
</TD> Email:
<TD align="left"> </TD>
<INPUT type="text" name="u_email" size="12"></INPUT> <TD align="left">
</TD> <INPUT type="text" name="u_email" size="12"></INPUT>
<TD align="right" noWrap> </TD>
Password: <TD align="right" noWrap>
</TD> Password:
<TD align="left"> </TD>
<INPUT type="password" name="u_password" size="12"></INPUT> <TD align="left">
</TD> <INPUT type="password" name="u_password" size="12"></INPUT>
</TR> </TD>
<? tableFooter (); ?> </TR>
</TD> <? tableFooter (); ?>
</TR> </TD>
<? </TR>
tableTitle ("Requested Information", 1, tableHeadColor); <?
?> tableTitle ("Requested Information", 1, tableHeadColor);
<TR> ?>
<TD> <TR>
<? tableHeader ('100%', featureBgColor); ?> <TD>
<TR vAlign="center"> <? tableHeader ('100%', featureBgColor); ?>
<TD align="right" noWrap> <TR vAlign="center">
Street: <TD align="right" noWrap>
</TD> Street:
<TD align="left"> </TD>
<INPUT type="text" name="u_addr1" size="18"></INPUT> <TD align="left">
</TD> <INPUT type="text" name="u_addr1" size="18"></INPUT>
<TD align="right" noWrap> </TD>
Phone #: <TD align="right" noWrap>
</TD> Phone #:
<TD align="left"> </TD>
<INPUT type="text" name="u_phone" size="18"></INPUT> <TD align="left">
</TD> <INPUT type="text" name="u_phone" size="18"></INPUT>
</TR> </TD>
<TR vAlign="center"> </TR>
<TD align="right" noWrap> <TR vAlign="center">
C/S/ZIP: <TD align="right" noWrap>
</TD> C/S/ZIP:
<TD align="left"> </TD>
<INPUT type="text" name="u_addr2" size="18"></INPUT> <TD align="left">
</TD> <INPUT type="text" name="u_addr2" size="18"></INPUT>
<TD align="right" noWrap> </TD>
Country: <TD align="right" noWrap>
</TD> Country:
<TD align="left"> </TD>
<INPUT type="text" name="u_country" size="12"></INPUT> <TD align="left">
</TD> <INPUT type="text" name="u_country" size="12"></INPUT>
</TR> </TD>
<? tableFooter (); ?> </TR>
</TD> <? tableFooter (); ?>
</TR> </TD>
<? </TR>
tableTitle ("Special Information", 1, tableHeadColor); <?
?> tableTitle ("Special Information", 1, tableHeadColor);
<TR> ?>
<TD> <TR>
<? tableHeader ('100%', featureBgColor); ?> <TD>
<TR vAlign="center"> <? tableHeader ('100%', featureBgColor); ?>
<TD align="right" noWrap> <TR vAlign="center">
Admin status? <TD align="right" noWrap>
</TD> Admin status?
<TD align="left"> </TD>
<INPUT type="checkbox" name="u_admin"></INPUT> <TD align="left">
</TD> <INPUT type="checkbox" name="u_admin"></INPUT>
<TD align="center"> </TD>
<INPUT type="submit" value="Add User"></INPUT> <TD align="center">
</TD> <INPUT type="submit" value="Add User"></INPUT>
</TR> </TD>
<? tableFooter (); ?> </TR>
</TD> <? tableFooter (); ?>
</TR> </TD>
<? </TR>
tableBoxFooter (); <?
?> tableBoxFooter ();
</FORM> ?>
<? </FORM>
} <?
?> } else {
<? echo '<P>You are not authorized to view this page. Now go away or I shall taunt you a second time!';
require (siteHome ."/parts/postamble.php"); // Finish this sucker up }
?> }
?>
<?
require siteHome . "/parts/postamble.php"; // Finish this sucker up
?>

View file

@ -14,8 +14,8 @@
<TR> <TR>
<TD align="center"> <TD align="center">
<SPAN class="titleBar"> <SPAN class="titleBar">
Copyright &copy; 1999,2000 contributors of the QuakeForge Project.<BR> Copyright &copy; 1999-<? echo date("Y"); ?> the QuakeForge Project.<BR>
<A class="mainTitleBar" href="copyright.php">Additional Copyright and Trademark Acknowledgements</A> <A class="mainTitleBar" href="/copyright.php">Additional Copyright and Trademark Acknowledgements</A>
</SPAN> </SPAN>
</TD> </TD>
</TR> </TR>