Index: unk/htdocs/admin.html
===================================================================
--- /trunk/htdocs/admin.html	(revision 231)
+++ 	(revision )
@@ -1,193 +1,0 @@
-<?php	session_start(); ?>
-<?php
-	// admin.html
-	// Albert Teoh 15.11.2005
-	// 
-	// The login page for administrators
-?>
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-
-<!-- Thanks to: -->
-<!--  http://www.brainjar.com/css/tabs/ -->
-
-
-<head>
-<link rel="stylesheet" type="text/css" href="styles/style.css" />
-<link rel="stylesheet" type="text/css" href="styles/query.css" />
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8759-1" />
-<meta name="DC.Creator" lang="en" content="personalName=Teoh,Albert" />
-<meta name="ATNF.Maintainer" content="contactName=Webmaster,the" />
-<meta name="DC.Title.alt" lang="en" content="" />
-<meta name="DC.Subject" lang="en" content="pulsar" />
-<meta name="DC.Description" lang="en" content="Searches the data archives at the ATNF" />
-<meta name="DC.Date.created" scheme="ISO8601" content="2002-12-12" />
-<meta name="ATNF.Site" content="Marsfield" />
-<meta name="ATNF.AccessPermission" content="Public" />
-<meta name="ATNF.MetaVersion" content="1.0" />
-<script type="text/javascript">
-//<![CDATA[
-
-//*****************************************************************************
-// Do not remove this notice.
-//
-// Copyright 2002 by Mike Hall.
-// See http://www.brainjar.com for terms of use.
-//*****************************************************************************
-
-function synchTab(frameName) {
-
-  var elList, i;
-
-  // Exit if no frame name was given.
-
-  if (frameName == null)
-    return;
-
-  // Check all links.
-
-  elList = document.getElementsByTagName("A");
-  for (i = 0; i < elList.length; i++)
-
-    // Check if the link's target matches the frame being loaded.
-
-    if (elList[i].target == frameName) {
-
-      // If the link's URL matches the page being loaded, activate it.
-      // Otherwise, make sure the tab is deactivated.
-
-      if (elList[i].href == window.frames[frameName].location.href) {
-        elList[i].className += " activeTab";
-        elList[i].blur();
-      }
-      else
-        removeName(elList[i], "activeTab");
-    }
-}
-
-function removeName(el, name) {
-
-  var i, curList, newList;
-
-  if (el.className == null)
-    return;
-
-  // Remove the given class name from the element's className property.
-
-  newList = new Array();
-  curList = el.className.split(" ");
-  for (i = 0; i < curList.length; i++)
-    if (curList[i] != name)
-      newList.push(curList[i]);
-  el.className = newList.join(" ");
-}
-
-//]]>
-</script>
-
-</head>
-<title>ATNF Pulsar Data Archive Home</title>
-
-<!-- Start Content -->
-<?php
-	
-	include_once("admin_functions.php");
-	include_once("database.php");
-	include_once("date.php");
-	
-	$now_day = date("j");
-	$now_month = date("n");
-	$now_year = date("Y");
-	
-	$all_params_id = "all_params";
-	$all_others_id = "all_others";
-	
-	$link = db_connect();
-	
-	// Clear any old form inputs in session cache
-	init($link);
-
-	
-// If the user clicked on the logout button
-if (isset($HTTP_GET_VARS['command'])) {
-	$command = $HTTP_GET_VARS['command'];
-	if ($command == 'logout') {
-		$_SESSION = array();
-	}
-}
-
-// If the user hasn't logged in before or if the previous
-// session's authentication wasn't successful
-// Then use the submitted username and password
-if (!isset($_SESSION['auth_code']) || $_SESSION['auth_code'] != OK) {
-	$username = $HTTP_POST_VARS["username"];
-	$password = $HTTP_POST_VARS["password"];
-	$auth_code = authenticate_admin($username, $password);
-}
-else {
-	include_once("header.html");
-	$auth_code = $_SESSION['auth_code'];
-	$username = $_SESSION['username'];
-}
-
-// Bad login
-if ($auth_code != OK) { ?>
-	<body class="front_page">
-
-
-	<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
-	
-  <img class="front_page" src="images/front_page01.png"></img>
-	<table class="login">
-	<?php if ( $auth_code == BAD_LOGIN){ ?>
-		<tr><td class="form_field" colspan="2"><font color="red">Incorrect administrator username and/or password</font></td></tr>
-	<?php }?>
-		<tr><td class="form_field"><font color="white">Admin username: </font></td><td><input type="text" name="username"></td></tr>
-		<tr><td class="form_field"><font color="white">Admin password: </font></td><td><input type="password" name="password"></td></tr>
-		<tr><td align="right" colspan="2"><input type="submit" value="Log in"></td></tr>
-	</table>
-	</form>
-<?php } else { 
-	$_SESSION['username'] = $username;
-	$_SESSION['auth_code'] = $auth_code;
-
-	$actions          = $HTTP_GET_VARS['actions'];
-	
-	if ($actions == "new_query") {
-		init();
-	}
-?>
-<body class="atoa">
-<?php //title_bar("pulsar"); ?>
-
-<table align="top">
-<tr><td><a class="top_menu" href="<?php echo $PHP_SELF; ?>?command=logout">Logout</a></td>
-</tr>
-</table>
-<br>
-<div>
-	<div class="tabArea">
-  	<a class="tab activeTab" href="unregisteredUsers.html" target="adminIFrame">Unregistered Users</a>
-  	<a class="tab" href="registeredUsers.html" target="adminIFrame">Registered Users</a>
-  	<a class="tab" href="stats.html" target="adminIFrame">Traffic Stats</a>
-	</div>
-
-	<div class="tabMain">
-  	<div class="tabIframeWrapper">
-    	<iframe class="tabContent" src="unregisteredUsers.html" name="adminIFrame"
-    	 marginheight="8" marginwidth="8" frameborder="0"></iframe>
-  	</div>
-	</div>
-</div>
-
-<?php } ?>
-
-</body>
-
-</html>
-
-
-<?php
-mysql_close($link);
-?>
Index: unk/htdocs/registeredUsers.html
===================================================================
--- /trunk/htdocs/registeredUsers.html	(revision 231)
+++ 	(revision )
@@ -1,179 +1,0 @@
-<?php	session_start(); ?>
-<html>
-
-<head>
-<script type="text/javascript" src="scripts/tabbed.js"></script>
-<link rel="stylesheet" type="text/css" href="styles/style.css" />
-<link rel="stylesheet" type="text/css" href="styles/query.css" />
-
-<script type="text/javascript" language="javascript1.2"><!--
-
-function checkAll(objName, FormName, FieldName ) {
-
-	var obj = document.getElementsByName(objName);
-	var CheckValue = obj[0].checked;
-
-	if(!document.forms[FormName])
-		return;
-	var objCheckBoxes = document.forms[FormName].elements[FieldName];
-	if(!objCheckBoxes)
-		return;
-	var countCheckBoxes = objCheckBoxes.length;
-	if(!countCheckBoxes)
-		objCheckBoxes.checked = CheckValue;
-	else
-		// set the check value for all check boxes
-		for(var i = 0; i < countCheckBoxes; i++)
-			objCheckBoxes[i].checked = CheckValue;
-}
-
-function updateSelectAll(objId, allId) {
-	var obj = document.getElementById(objId);
-	var allCheckbox = document.getElementById(allId);	
-	
-	if (!objId.checked && allCheckbox.checked) {
-		allCheckbox.checked = false;
-	}
-		
-		
-}
-//--></script>
-
-</head>
-
-<h1>Registered Users</h1>
-
-
-<?php
-	
-	include_once("admin_functions.php");
-	include_once("database.php");
-	include_once("utils.php");
-	
-	$all_params_id = "all_params";
-	$link = db_connect_admin();
-	
-	unset($_SESSION['users']);
-	
-	
-	// Delete registered users on request
-	$users_to_delete = get_param('users', $HTTP_GET_VARS);
-	
-	//print_r($users_to_delete);
-	
-	if (count($users_to_delete) > 0) {
-		foreach ($users_to_delete as $user) {
-			$query = "DELETE FROM ".USERS_TABLE." WHERE username='$user'";
-			//echo "query = $query <br>\n";
-			mysql_query($query);
-			
-			
-			if (mysql_affected_rows() > 0) {
-				echo "Successfully deleted user <code>$user</code><br>\n";
-			}
-			else {
-				echo "Failed to delete user <code>$user</code><br>\n";
-			}
-		}
-	}
-	
-	// Update the users database. Delete any pending deleted users
-	updateUsersTable($link);
-
-
-	$result = getRegisteredUsers($link);
-	
-
-?>
-
-<form name="unregistered_form" action="<?php echo $PHP_SELF; ?>" method="GET">
-
-The following users are currently registered to use this service:<br>
-
-<table border="0">
-
-	<tr>
-	
-	<td valign="top" class="form_field" >
-	
-	<fieldset>
-		<legend>Registered Users</legend>
-		<table cellpadding="5">
-		<thead class="file-headings">
-		<tr>
-			<th><input type="checkbox" name="<?php echo $all_params_id; ?>" id="<?php echo $all_params_id; ?>"
-			onClick="checkAll('<?php echo $all_params_id; ?>', 'unregistered_form', 'users[]')"></th>
-			<th>First</th>
-			<th>Last</th>
-			<th>Username</th>
-			<th>Institution</th>
-			<th>Country</th>
-		</tr>
-		</thead>
-				
-<?php
-	while ($row = mysql_fetch_assoc($result)) {
-		$fname = "&nbsp;";
-		$lname = "&nbsp;";
-		$username = "&nbsp;";		
-		$institution = "&nbsp;";		
-		$country = "&nbsp;";
-		
-		if ( trim($row['fname']) != "") {
-			$fname = $row['fname'];
-		}
-		
-		if (trim($row['lname']) != "") {
-			$lname = $row['lname'];
-		}
-		
-		if (trim($row['username']) != "") {
-			$username = $row['username'];
-		}
-		
-		if (trim($row['institution']) != "") {
-			$institution = $row['institution'];
-		}
-		
-		if (trim($row['country']) != "") {
-			$country = $row['country'];
-		}
-		
-		// If the person has just requested for an account,
-		// show allow/deny links. Otherwise, show status
-		// information
-		
-		
-		echo "<tr>";
-		echo "<td class=\"result_row\"><input type=\"checkbox\" name=\"users[]\" value=\"$username\"></td>";
-		echo "<td class=\"result_row\">".$fname."</td>";
-		echo "<td class=\"result_row\">".$lname."</td>";
-		echo "<td class=\"result_row\">".$username."</td>";
-		echo "<td class=\"result_row\">".$institution."</td>";
-		echo "<td class=\"result_row\">".$country."</td>";
-		echo "</tr>\n";
-		
-	}
-?>
-	</table>
-	</fieldset>
-	<br>
-	<input type="submit" name="delete" value="Delete User">
-
-	</td>
-	</tr>
-</table>
-
-
-</form>
-	
-</html>
-
-
-
-<?php 
-
-
-mysql_close($link);
-
-?>
Index: unk/htdocs/unregisteredUsers.html
===================================================================
--- /trunk/htdocs/unregisteredUsers.html	(revision 231)
+++ 	(revision )
@@ -1,203 +1,0 @@
-<?php	session_start(); ?>
-<html>
-
-<head>
-<script type="text/javascript" src="scripts/tabbed.js"></script>
-<link rel="stylesheet" type="text/css" href="styles/style.css" />
-<link rel="stylesheet" type="text/css" href="styles/query.css" />
-
-<script type="text/javascript" language="javascript1.2"><!--
-
-function checkAll(objName, FormName, FieldName ) {
-
-	var obj = document.getElementsByName(objName);
-	var CheckValue = obj[0].checked;
-
-	if(!document.forms[FormName])
-		return;
-	var objCheckBoxes = document.forms[FormName].elements[FieldName];
-	if(!objCheckBoxes)
-		return;
-	var countCheckBoxes = objCheckBoxes.length;
-	if(!countCheckBoxes)
-		objCheckBoxes.checked = CheckValue;
-	else
-		// set the check value for all check boxes
-		for(var i = 0; i < countCheckBoxes; i++)
-			objCheckBoxes[i].checked = CheckValue;
-}
-
-function updateSelectAll(objId, allId) {
-	var obj = document.getElementById(objId);
-	var allCheckbox = document.getElementById(allId);	
-	
-	if (!objId.checked && allCheckbox.checked) {
-		allCheckbox.checked = false;
-	}
-		
-		
-}
-//--></script>
-
-</head>
-
-<h1>Unregistered Users</h1>
-
-<?php
-	
-	include_once("admin_functions.php");
-	include_once("database.php");
-	include_once("utils.php");
-	include_once("constants.php");
-	
-	$all_params_id = "all_params";
-	$link = db_connect_admin();
-	
-	unset($_SESSION['users']);
-	
-	
-	// Register any pending users
-	$users_to_register = get_param('users', $HTTP_GET_VARS);
-	
-	//print_r($users_to_register);
-	
-	if (count($users_to_register) > 0) {
-		foreach ($users_to_register as $user) {
-			$query = "UPDATE ".USERS_TABLE." SET registered=1 where username='$user'";
-			//echo "query = $query <br>\n";
-			mysql_query($query);
-			
-			if (mysql_affected_rows() > 0) {
-				echo "Successfully registered " . mysql_affected_rows(). " user/s<br>\n";
-				
-				// Email the user
-				$query = "SELECT * FROM " . USERS_TABLE . " WHERE username='$user'";
-				$result = mysql_query($query) or die ('Query failed: ' . mysql_error());
-				$row = mysql_fetch_assoc($result);
-				$email = $row['email'];
-				$fname = $row['fname'];
-				$username = $row['username'];
-				$password = $row['password'];
-				if (!mail($email, "ATNF Data Archive Registration Successful", "Dear $fname,\n
-Congratulations! You have been successfully registered onto the ATNF Pulsar Data Archive system. 
-To use our service, please go to ".DATA_ARCHIVE_URL." and use the following details:\n
-Username: $username
-Password: $password
-
-Regards,\n
-ATNF Pulsar Group\n")) 
-				{
-					echo "Failed to send mail to the following recipient: $email<br>\n";
-				}
-			}
-		}
-	}
-	
-	// Update the users database. Delete any pending deleted users
-	updateUsersTable($link);
-	
-	$result = getUnregisteredUsers($link);
-	
-
-?>
-
-<form name="unregistered_form" action="<?php echo $PHP_SELF; ?>" method="GET">
-
-The following people have requested for an account:<br>
-
-<table border="0">
-
-	<tr>
-	
-	<td valign="top" class="form_field" >
-	
-	<fieldset>
-		<legend>Unregistered Users</legend>
-		<table cellpadding="5">
-		<thead class="file-headings">
-		<tr>
-			<th><input type="checkbox" name="<?php echo $all_params_id; ?>" id="<?php echo $all_params_id; ?>"
-			onClick="checkAll('<?php echo $all_params_id; ?>', 'unregistered_form', 'users[]')"></th>
-			<th>First</th>
-			<th>Last</th>
-			<th>Username</th>
-			<th>Email</th>
-			<th>Institution</th>
-			<th>Country</th>
-			<th>Status</th>
-		</tr>
-		</thead>
-				
-<?php
-	while ($row = mysql_fetch_assoc($result)) {
-		$fname = "&nbsp;";
-		$lname = "&nbsp;";
-		$username = "&nbsp;";		
-		$email = "&nbsp;";		
-		$institution = "&nbsp;";		
-		$country = "&nbsp;";
-		
-		if ( trim($row['fname']) != "") {
-			$fname = $row['fname'];
-		}
-		
-		if (trim($row['lname']) != "") {
-			$lname = $row['lname'];
-		}
-		
-		if (trim($row['username']) != "") {
-			$username = $row['username'];
-		}
-		
-		if (trim($row['email']) != "") {
-			$email = $row['email'];
-		}
-		
-		if (trim($row['institution']) != "") {
-			$institution = $row['institution'];
-		}
-		
-		if (trim($row['country']) != "") {
-			$country = $row['country'];
-		}
-		
-		// If the person has just requested for an account,
-		// show allow/deny links. Otherwise, show status
-		// information
-		
-		
-		echo "<tr>";
-		echo "<td class=\"result_row\"><input type=\"checkbox\" name=\"users[]\" value=\"$username\"></td>";
-		echo "<td class=\"result_row\">".$fname."</td>";
-		echo "<td class=\"result_row\">".$lname."</td>";
-		echo "<td class=\"result_row\">".$username."</td>";
-		echo "<td class=\"result_row\">".$email."</td>";
-		echo "<td class=\"result_row\">".$institution."</td>";
-		echo "<td class=\"result_row\">".$country."</td>";
-		echo "<td class=\"result_row\">Pending</td>";
-		echo "</tr>\n";
-		
-	}
-?>
-	</table>
-	</fieldset>
-	<br>
-	<input type="submit" name="register" value="Register">
-
-	</td>
-	</tr>
-</table>
-
-
-</form>
-	
-</html>
-
-
-
-<?php 
-
-
-mysql_close($link);
-
-?>
