Cambios finales parte 1.
[CLab.git] / forgotpass.php
blob1f0a4e50c13114efca3b60e8013428fe18d9452a
1 <?
2 /**
3 * ForgotPass.php
5 * This page is for those users who have forgotten their
6 * password and want to have a new password generated for
7 * them and sent to the email address attached to their
8 * account in the database. The new password is not
9 * displayed on the website for security purposes.
11 * Note: If your server is not properly setup to send
12 * mail, then this page is essentially useless and it
13 * would be better to not even link to this page from
14 * your website.
16 * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
17 * Last Updated: August 26, 2004
19 include_once("include/session.php");
20 /**
21 * Forgot Password form has been submitted and no errors
22 * were found with the form (the username is in the database)
24 if(isset($_SESSION['forgotpass'])){
25 /**
26 * New password was generated for user and sent to user's
27 * email address.
29 if($_SESSION['forgotpass']){
30 echo "<h2>New Password Generated</h2>";
31 echo "<p>Your new password has been generated "
32 ."and sent to the email <br>associated with your account. "
33 ."<a href=\"main.php\">Main</a>.</p>";
35 /**
36 * Email could not be sent, therefore password was not
37 * edited in the database.
39 else{
40 echo "<h2>New Password Failure</h2>";
41 echo "<p>There was an error sending you the "
42 ."email with the new password,<br> so your password has not been changed. "
43 ."<a href=\"main.php\">Main</a>.</p>";
46 unset($_SESSION['forgotpass']);
48 else{
50 /**
51 * Forgot password form is displayed, if error found
52 * it is displayed.
56 <h2>Forgot Password</h2>
57 A new password will be generated for you and sent to the email address<br>
58 associated with your account, all you have to do is enter your
59 username.<br><br>
60 <? echo $form->error("user"); ?>
61 <form action="process.php" method="POST">
62 <b>Username:</b> <input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>">
63 <input type="hidden" name="subforgot" value="1">
64 <input type="submit" value="Get New Password">
65 </form>
71 </body>
72 </html>