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;
16 require_once 'plc_drupal.php';
17 include 'plc_header.php';
19 // Only display dialogs if the user is not logged in.
22 if (!empty($_REQUEST['id']) && !empty($_REQUEST['key'])) {
23 $person_id = intval($_REQUEST['id']);
24 drupal_set_title('Password Reset: Confirmed');
25 if ($adm->ResetPassword($person_id, $_REQUEST['key']) != 1) {
26 print '<div class="messages error">' . $adm->error() . '.</div>';
28 drupal_set_html_head("<meta http-equiv=\"refresh\" content=\"60; URL=/\"");
30 print '<div class="messages status">';
31 print "Success! We've sent you another e-mail with your new temporary password. <br/>";
32 print "You can login using this temporaray password. <br/>";
33 print "Please change it once you login by visiting 'My Account' and updating your password. ";
36 } elseif (!empty($_REQUEST['email'])) {
37 drupal_set_title('Password Reset: Request Sent');
38 if ($adm->ResetPassword($_REQUEST['email']) != 1) {
39 print '<div class="messages error">' . $adm->error() . '.</div>';
41 print '<div class="messages status">';
42 print "We've sent an e-mail to " . $_REQUEST['email'] . " that will allow you to confirm the password reset. <br/>";
43 print "Please check your email now and follow the link contained there to reset your password. ";
48 drupal_set_title('Password Reset');
49 $self = $_SERVER['PHP_SELF'];
50 if (!empty($_SERVER['QUERY_STRING'])) {
51 $self .= "?" . $_SERVER['QUERY_STRING'];
54 // XXX Use our own stylesheet instead of drupal.css
57 <form action="$self" method="post">
59 <table border="0" cellpadding="0" cellspacing="0" id="content">
62 <div class="form-item">
63 E-mail: <span class="form-required" title="This field is required.">*</span></label>
64 <input type="text" maxlength="60" name="email" id="edit-name" size="30" value="" class="form-text required" />
66 <input type="submit" name="op" value="Reset password" class="form-submit" />
78 include 'plc_footer.php';