
PK 
<?
/**
* initial_setup.php
*
* USE ONCE AND DELETE!
* Set the system master admin login info ...
*
* Copyright (C) 2009, www.wonderwebware.com.
* Last Updated: December 1, 2009
*/
include("include/session.php");
/**
* User not an administrator, redirect to main page
* automatically.
*/
/**
* Administrator is viewing page, so display all
* forms.
*/
?>
<?php include("_header.html"); ?>
<?
/**
* The user has submitted the registration form and the
* results have been processed.
*/
if(isset($_SESSION['regsuccess'])){
/* Registration was successful */
if($_SESSION['regsuccess']){
echo "<h1>The main admin account has been created!</h1>";
echo "<p>The admin username is: <b>".$_SESSION['reguname']."</b>, and you can login, "
."<a href=\"main.php\">here</a>.</p>";
echo "<h1>Please, delete the script <b>initial_setup.php</b> from server as soon as possible!!!</h1>";
}
/* Registration failed */
else{
echo "<h1>Registration failed!</h1>";
echo "<p>Cannot register username <b>".$_SESSION['reguname']."</b>. "
."<br>Contact your technical support team.</p>";
}
unset($_SESSION['regsuccess']);
unset($_SESSION['reguname']);
}
/**
* The user has not filled out the registration form yet.
* Below is the page with the sign-up form, the names
* of the input fields are important and should not
* be changed.
*/
else{
?>
<h1>Registering the master administrator</h1>
<?
global $database;
if($database->usernameTaken(ADMIN_NAME)){
echo "Master admin account has already been created! Delete this file (<b>initial_setup.php</b>) from your server! <br><br> [<a href='main.php'>Home</a>]";
exit;
}
if($form->num_errors > 0){
echo "<td><font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font></td>";
}
?>
<form action="process.php" method="POST">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr>
<td align="right">Username:</td><td><input name="user" type="text" value="<? echo ADMIN_NAME; ?>" maxlength="30" readonly="readonly"></td><td><? echo $form->error("user"); ?></td></tr>
<tr>
<td align="right">Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr>
<tr><td align="right">Email:</td><td><input type="text" name="email" maxlength="50" value="<? echo $form->value("email"); ?>"></td><td><? echo $form->error("email"); ?></td></tr>
<tr>
<td align="right">Name:</td>
<td align="right"><input type="text" name="name" maxlength="50" value="<? echo $form->value("name"); ?>"></td><td><? echo $form->error("name"); ?></td>
</tr>
<tr><td colspan="2" align="right">
<input type="hidden" name="subjoin" value="1">
<input type="submit" value="Submit"></td></tr>
<tr>
<td colspan="2" align="left"></td></tr>
</table>
</form>
<?
}
?>
<?php include("_footer.html"); ?>


PK 99