Source for file passreset.php
Documentation is available at passreset.php
* User password reset page.
* This file displays the form used to reset the user password and sends the
* user the newly generated random password.
* This file is part of HRDIODB.
* HRDIODB is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* HRDIODB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with HRDIODB; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
/** Configuration file */
require_once("conf.php");
/** HRDI database file */
require_once("hrdi_db_class.php");
require_once("session_class.php");
require_once("user_class.php");
require_once("common_class.php");
/** Debuggin functions */
require_once("debugging.php");
// Create class instances
$user = new user ($hdb, $session);
// Make sure we're NOT authenticated
if ($user->authenticated()) {
// If we are, lets go back to where we were
$session->go_to_last_page();
// Process the password reset request
if (isset ($_POST['reset'])) {
// Execute the password reset. If all goes well, display the message.
if ($user->reset_password($_POST)) {
require_once("header.php");
print "<br/><center><div id=\"message_block\">Your password has been reset.
An e-mail has been sent to you with the new, randomly generated password.
When you get the e-mail, you can log in with the specified password
and change your password to a new one.</div></center>";
require_once("footer.php");
// Include the page header
require_once("header.php");
// Display the password reset form
<div id="message_block">When you reset your password, a random password will be
sent to the e-mail you entered above. If you don't get the e-mail, please
contact <a href="mailto: <?php print $hrdi_admin?>"> <?php print
<form name="pass_reset" method="post" action=" <?php print $_SERVER['PHP_SELF']; ?>">
<td colspan="2" align="center"><b>HRDI User Password Reset</b></td>
<td align="right">E-mail:</td>
<input type="text" name="Email" size="20" maxlength="255" value=" <?php print common::get_value('Email', $_POST, $user->data)?>">
<td colspan="2" align="right"><input type="submit" name="reset" value="Reset Password"></td>
<script type="text/javascript">
<?php // Grab the focus and put it in the Email field ?>
document.pass_reset.Email.focus();
// Include the page footer
require_once("footer.php");
|