reSIProcate/repro  9694
changepassword.php
Go to the documentation of this file.
00001 <?php
00002 require('reprofunctions.php');
00003 dbgSquirt("============= Change Password ===============");
00004 
00005 $result = checkCookies($forceLogin,$error,FALSE);
00006 if (!($result) || $forceLogin) {
00007   // we got an error back that occurred while checkCookies was being run, 
00008   // or authentication failed.  Either way, bounce them back to the login screen
00009   header("Location: http://" . $_SERVER['HTTP_HOST'] . 
00010          dirname($_SERVER['PHP_SELF']) . 
00011          "/index.php?error=$error");
00012   exit;
00013  }
00014 $username = $_COOKIE['user'];
00015 ?>
00016 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
00017 
00018 <!--
00019 System:  Repro
00020 File:    changepassword.php
00021 Purpose: Allow an authenticated user to change the password stored for them
00022 Author:  S. Chanin
00023 -->
00024 <html>
00025 <head>
00026 <link rel="stylesheet" type="text/css" href="repro_style.css" />
00027   <title>Change Password</title>
00028 </head>
00029 
00030 <body>
00031 <h1 class="title">Repro</h1>
00032 <h1>Change Password</h1>
00033 <hr />
00034 <?php
00035 // if we've looped back due to an error, show the message
00036 if (isset($_GET["error"])) {
00037     echo '<p class="error">' . $_GET["error"] . "</p>\n";
00038 }
00039 if (lookupUserInformation($username,$id,$fullname,$domain,$email)) {
00040   // lookup successful
00041 ?>
00042 <form method="POST" action="updatepassword.php">
00043 <table>
00044 <tr>
00045 <td>Current Password</td>
00046 <td><input type="password" name="current" id="current" value=""/></td>
00047 </tr>
00048 <tr>
00049 <td>New Password</td>
00050 <td><input type="password" name="newpassword" id="newpassword" value=""/></td>
00051 </tr>
00052 <tr>
00053 <td>Retype New Password</td>
00054 <td><input type="password" name="newpassword2" id="newpassword2" value=""/></td>
00055 </tr>
00056 <tr>
00057 <td>&nbsp</td>
00058 <td>
00059 <input type="submit" name="submit" id="submit" value="Save" />
00060 <input type="submit" name="submit" id="submit" value="Cancel" />
00061 </td>
00062 </tr>
00063 </table>
00064 </form>
00065 
00066 <?php
00067    } else {
00068   echo "<p>Internal Error while accessing user information.</p>\n";
00069   echo "<p>Please contact an administrator.</p>\n";
00070  }
00071 ?>
00072 
00073 <br /><hr />
00074 <a href="userhome.php">Return to User Home</a><br />
00075 <a href="logout.php">Logout</a><br />
00076 
00077 </body>
00078 </html>