5 // Mark Huang <mlhuang@cs.princeton.edu>
6 // Copyright (C) 2007 The Trustees of Princeton University
11 // Get session and API handles
12 require_once 'plc_session.php';
13 global $plc, $api, $adm;
15 // Only display dialogs if the user is not logged in.
18 require_once 'plc_drupal.php';
19 include 'plc_header.php';
21 if (!empty($_REQUEST['id']) && !empty($_REQUEST['key'])) {
22 $person_id = intval($_REQUEST['id']);
23 drupal_set_title('Password Reset: Confirmed');
24 if ($adm->ResetPassword($person_id, $_REQUEST['key']) != 1) {
25 print '<div class="messages error">' . $adm->error() . '.</div>';
27 drupal_set_html_head("<meta http-equiv=\"refresh\" content=\"60; URL=/\"");
29 print '<div class="messages status">';
30 print "Success! We've sent you another e-mail with your new temporary password. <br/>";
31 print "You can login using this temporaray password. <br/>";
32 print "Please change it once you login by visiting 'My Account' and updating your password. ";
35 } elseif (!empty($_REQUEST['email'])) {
36 drupal_set_title('Password Reset: Request Sent');
37 if ($adm->ResetPassword($_REQUEST['email']) != 1) {
38 print '<div class="messages error">' . $adm->error() . '.</div>';
40 print '<div class="messages status">';
41 print "We've sent an e-mail to " . $_REQUEST['email'] . " that will allow you to confirm the password reset. <br/>";
42 print "Please check your email now and follow the link contained there to reset your password. ";
47 drupal_set_title('Password Reset');
48 $self = $_SERVER['PHP_SELF'];
49 if (!empty($_SERVER['QUERY_STRING'])) {
50 $self .= "?" . $_SERVER['QUERY_STRING'];
53 // XXX Use our own stylesheet instead of drupal.css
56 <form action="$self" method="post">
58 <table border="0" cellpadding="0" cellspacing="0" id="content">
61 <div class="form-item">
62 E-mail: <span class="form-required" title="This field is required.">*</span></label>
63 <input type="text" maxlength="60" name="email" id="edit-name" size="30" value="" class="form-text required" />
65 <input type="submit" name="op" value="Reset password" class="form-submit" />
75 include 'plc_footer.php';
78 Header("Location: /db/persons/index.php?id=" . $plc->person['person_id']);