Index: unk/htdocs/change_password.html
===================================================================
--- /trunk/htdocs/change_password.html	(revision 230)
+++ 	(revision )
@@ -1,136 +1,0 @@
-<?php	session_start();
-	// Albert Teoh 15.11.2005
-	// 
-	// The password change form
-	
-	include_once("constants.php");
-	include_once("database.php");
-	include_once("security.php");
-?>
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-
-<head>
-<link rel="stylesheet" type="text/css" href="styles/style.css" />
-<link rel="stylesheet" type="text/css" href="styles/results.css" />
-<link rel="stylesheet" type="text/css" href="styles/query.css" />
-<link rel="stylesheet" type="text/css" href="styles/atnf.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" />
-<?php //include("base.inc"); ?>
-<?php //standard_head(); ?>
-<?php include_once("header.html"); ?>
-</head>
-
-<title>ATNF Pulsar Data Archive Registration</title>
-<?php //title_bar("pulsar"); ?>
-
-<body>
-<h1>User Registration Form</h1>
-
-
-<?php
-$prev_page = $HTTP_GET_VARS['prev_page'];
-
-echo "<a href=\"$prev_page\">Back to previous page</a><br><br>\n";
-
-$password_match = true;
-$email_address_valid = true;
-
-if ($HTTP_GET_VARS['submit'] == "Submit") {
-
-	$old_password = $HTTP_GET_VARS['old_password'];
-	$password = $HTTP_GET_VARS['password'];
-	$confirm_password = $HTTP_GET_VARS['confirm_password'];
-
-	if ($password != $confirm_password) {
-		$password_match = false;
-	}
-	
-	if ($password != "" && $confirm_password != "" && $password_match) {
-		$link = db_connect_admin();
-		
-		/*
-		// Check that the old password is correct
-		$query = "SELECT password FROM ". USERS_TABLE . " WHERE username = '". $_SESSION['username'] . "'";
-		$result = mysql_query($query);
-		
-		$row = mysql_fetch_row($result);
-		if ($row[0] != $old_password) {
-			echo "Old password is incorrect\n";
-		}
-		*/
-		
-		// Need to insert some SQL here to add the person's details
-		$sql_update = "UPDATE ".USERS_TABLE." SET password = '$password' where username = '" . $_SESSION['username'] . "'";
-		
-		
-		//echo "query = $sql_update<br>\n";
-		mysql_query($sql_update);
-		//echo "Records added = " . mysql_affected_rows() . "<br>\n";
-
-		if (mysql_affected_rows() > 0) {
-			echo "Successfully updated your password<br>\n";
-		}
-		mysql_close($link);	
-	}
-	else {
-?>
-<form action="<?php $_SERVER['PHP_SELF']; ?>" method="GET">
-
-<table align="top" class="registration">
-
-	<tr>
-	<td valign="top" class="form_field">
-
-		<fieldset>
-			<legend>Password Change</legend>
-			<table class="registration" cellpadding="3" cellspacing="3">
-				
-				
-				<tr>
-				<td class="form_field"><font color="red" size="-1">* </font>Password: </td><td><input type="password" name="password" <?php if ($password == "") { echo "></input> <font size=\"-1\" color=\"red\">Required</font>"; }?></td>
-				</tr>
-				<tr>
-				<td class="form_field"><font color="red" size="-1">* </font>Confirm Password: </td><td><input type="password" name="confirm_password"></input>
-				<?php if (!$password_match) { echo "<font color=\"red\" size=\"-1\">Passwords don't match</font>\n"; } ?> </td>
-				</tr>
-			</table>
-		</fieldset>
-	</td>
-	</tr>
-	
-	<tr>
-	<td class="form_field" colspan="2">
-	<input type="submit" name="submit" value="Submit">
-	</td>
-	</tr>
-
-</table>
-
-</form>
-
-<?php
-	}
-	include "footer.html";
-}
-else {
-	include("change_password_form.html");
-	include "footer.html";
-}
-?>
-
-
-</body>
-
-
-</html>
Index: unk/htdocs/change_password.php
===================================================================
--- /trunk/htdocs/change_password.php	(revision 230)
+++ 	(revision )
@@ -1,197 +1,0 @@
-<?php
-
-session_start();
-
-
-
-// Albert Teoh 15.11.2005
-// Refactored by David Smith 20.02.08 (nopeer@gmail.com)
-// The password change form
-
-
-
-require_once 'constants.php';
-require_once 'security.php';
-require_once 'PulsarArchiveDB.php';
-require_once 'logger.php';
-
-
-
-
-function OutputHead()
-{
-  echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
-  echo '<html>';
-  echo '<head>';
-  echo '<link rel="stylesheet" type="text/css" href="styles/style.css" />';
-  echo '<link rel="stylesheet" type="text/css" href="styles/results.css" />';
-  echo '<link rel="stylesheet" type="text/css" href="styles/query.css" />';
-  echo '<link rel="stylesheet" type="text/css" href="styles/atnf.css" />';
-  echo '<meta http-equiv="Content-Type" content="text/html; charset=iso-8759-1" />';
-  echo '<meta name="DC.Creator" lang="en" content="personalName=Teoh,Albert" />';
-  echo '<meta name="ATNF.Maintainer" content="contactName=Webmaster,the" />';
-  echo '<meta name="DC.Title.alt" lang="en" content="" />';
-  echo '<meta name="DC.Subject" lang="en" content="pulsar" />';
-  echo '<meta name="DC.Description" lang="en" content="Searches the data archives at the ATNF" />';
-  echo '<meta name="DC.Date.created" scheme="ISO8601" content="2002-12-12" />';
-  echo '<meta name="ATNF.Site" content="Marsfield" />';
-  echo '<meta name="ATNF.AccessPermission" content="Public" />';
-  echo '<meta name="ATNF.MetaVersion" content="1.0" />';
-
-  include 'header.html';
-
-  echo '</head>';
-  echo '<title>ATNF Pulsar Data Archive Registration</title>';
-  echo '<body>';
-  echo '<h1>User Registration Form</h1>';
-}
-
-
-
-function OutputPwdForm()
-{
-  global $password;
-  global $password_match;
-  global $HTTP_GET_VARS;
-  global $_SERVER;
-  global $password_changed;
-  global $exception;
-
-  $prev_page = $HTTP_GET_VARS['prev_page'];
-  echo '<a href=' . $prev_page . '>Back to previous page</a><br><br>';
-
-  if( $exception )
-  {
-    echo '<div class=exception>';
-    echo 'An error occured while processing this form. The error has been logged.';
-    echo 'Please contact the system administrator for further assistance';
-    echo '</div>';
-  }
-  else if( $password_changed )
-  {
-    echo 'You\'re password has been successfully updated';
-  }
-  else
-  {
-    echo '<form action=' . $_SERVER['PHP_SELF'] . '  method=GET>';
-
-    echo '<table align="top" class="registration">';
-    echo '  <tr>';
-    echo '    <td valign="top" class="form_field">';
-
-    echo '      <fieldset>';
-    echo '        <legend>Password Change</legend>';
-    echo '        <table class="registration" cellpadding="3" cellspacing="3">';
-    echo '          <tr>';
-    echo '            <td class="form_field">';
-    echo '              <font color="red" size="-1">* </font>Password: ';
-    echo '            </td>';
-    echo '            <td>';
-    echo '              <input type="password" name="password">' . $password . '</input>';
-    //echo '              <font size=\"-1\" color=\"red\">Required</font>';
-    echo '            </td>';
-    echo '          </tr>';
-    echo '          <tr>';
-    echo '            <td class="form_field">';
-    echo '              <font color="red" size="-1">* </font>Confirm Password: ';
-    echo '            </td>';
-    echo '            <td>';
-    echo '              <input type="password" name="confirm_password"></input>';
-
-    if (!$password_match)
-      echo '<font color="red" size="-1">Passwords don\'t match</font>';
-
-    echo '            </td>';
-    echo '          </tr>';
-    echo '        </table>';
-    echo '      </fieldset>';
-    echo '    </td>';    
-    echo '  </tr>';
-
-    echo '  <tr>';
-    echo '    <td class="form_field" colspan="2">';
-    echo '      <input type="submit" name="submit" value="Submit">';
-    echo '    </td>';
-    echo '  </tr>';
-    echo '</table>';
-
-    echo '</form>';
-  }
-}
-
-
-
-
-function ProcessForm()
-{
-  global $password;
-  global $password_match;
-  global $HTTP_GET_VARS;
-  global $_SESSION;
-  global $password_changed;
-  global $exception;
-
-  $password_match = true;
-
-  if ($HTTP_GET_VARS['submit'] == "Submit") 
-  {
-    $old_password = $HTTP_GET_VARS['old_password'];
-    $password = $HTTP_GET_VARS['password'];
-    $confirm_password = $HTTP_GET_VARS['confirm_password'];
-
-    if ($password != $confirm_password)
-    {
-      $password_match = false;
-    }
-    else if ($password != "" && $password_match) 
-    {
-      try
-      {
-        $db = new PulsarArchiveDB();
-        $db->connect( DB_SERVER . ':' . DB_PORT, DB_ADMIN, DB_PASS, DB_NAME );
-
-        $db->UpdatePassword( $_SESSION['username'], $password );
-
-        $password_changed = true;
-      }
-      catch ( Exception $e ) 
-      {
-        logger_exception( $_SESSION['username'], $e->getCode(), $e->getMessage() );
-        $exception = true;
-      }
-    }
-  }
-}
-
-
-
-function OutputFoot()
-{
-  include 'footer.html';
-
-  echo '</body>';
-  echo '</html>';
-}
-
-
-function DisplayForm()
-{
-  OutputHead();
-
-  OutputPwdForm();
-
-  OutputFoot();
-}
-
-///////////////////////
-// Main
-
-$password = '';
-$password_match = false;
-$password_changed = false;
-$exception = false;
-
-ProcessForm();
-DisplayForm();
-
-?>
Index: unk/htdocs/change_password_form.html
===================================================================
--- /trunk/htdocs/change_password_form.html	(revision 230)
+++ 	(revision )
@@ -1,33 +1,0 @@
-<form action="<?php $_SERVER['PHP_SELF']; ?>" method="GET">
-
-<table align="top" class="registration">
-
-	<tr>
-	<td valign="top" class="form_field">
-
-		<fieldset>
-			<legend>Password Change</legend>
-			<table class="registration" cellpadding="3" cellspacing="3">
-				
-				
-				<tr>
-				<td class="form_field"><font color="red" size="-1">* </font>Password: </td><td><input type="password" name="password"></input></td>
-				</tr>
-				<tr>
-				<td class="form_field"><font color="red" size="-1">* </font>Confirm Password: </td><td><input type="password" name="confirm_password"></input>
-				</td>
-				</tr>
-			</table>
-		</fieldset>
-	</td>
-	</tr>
-	
-	<tr>
-	<td class="form_field" colspan="2">
-	<input type="submit" name="submit" value="Submit">
-	</td>
-	</tr>
-
-</table>
-
-</form>
