4 * Request recovery of the lost password
6 * This page sends confirmation email with link to reset password
9 * SourceForge: Breaking Down the Barriers to Open Source Development
10 * Copyright 1999-2001 (c) VA Linux Systems
11 * http://sourceforge.net
18 require_once('pre.php');
22 $u = user_get_object_by_name($loginname);
24 if (!$u || !is_object($u)){
25 exit_error("Invalid user","That user does not exist.");
28 // First, we need to create new confirm hash
30 $confirm_hash = md5($session_hash . strval(time()) . strval(rand()));
32 $u->setNewEmailAndHash($u->getEmail(), $confirm_hash);
34 exit_error('Error',$u->getErrorMessage());
37 $message = stripcslashes($Language->getText('account_lostpw', 'message', array($GLOBALS['HTTP_HOST'], $confirm_hash)));
39 mail($u->getEmail(),$Language->getText('account_lostpw', 'subject'),$message,"From: noreply@$GLOBALS[HTTP_HOST]");
41 $HTML->header(array('title'=>"Lost Password Confirmation",'pagename'=>'account_lostpw'));
45 <P>An email has been sent to the address you have on file. Follow
46 the instructions in the email to change your account password.
48 <P><A href="/">[ Home ]</A>
51 $HTML->footer(array());
57 $HTML->header(array('title'=>"Lost Account Password",'pagename'=>'account_lostpw'));
60 <P>Hey... losing your password is serious business. It compromises the
61 security of your account, your projects, and this site.
63 <P>Clicking "Send Lost PW Hash" below will email a URL to the email
64 address we have on file for you. In this URL is a 128-bit confirmation
65 hash for your account. Visiting the URL will allow you to change
66 your password online and login.
68 <FORM action="<?php echo $PHP_SELF; ?>" method="POST">
71 <INPUT type="text" name="loginname"><br>
72 <INPUT type="submit" name="submit" value="Send Lost PW Hash">
75 <P><A href="/"><?php echo $Language->getText('general', 'return'); ?></A>
79 $HTML->footer(array());