// Copyright (C) 2007 The Trustees of Princeton University
//
// $Id$ $
//
// Get session and API handles
require_once 'plc_session.php';
global $plc, $api, $adm;
// Print header
require_once 'plc_drupal.php';
include 'plc_header.php';
// Only display dialogs if the user is not logged in.
if ( !$plc->person) {
if (!empty($_REQUEST['id']) && !empty($_REQUEST['key'])) {
$person_id = intval($_REQUEST['id']);
drupal_set_title('Password Reset: Confirmed');
if ($adm->ResetPassword($person_id, $_REQUEST['key']) != 1) {
print '
' . $adm->error() . '.
';
} else {
drupal_set_html_head("';
print "Success! We've sent you another e-mail with your new temporary password.
";
print "You can login using this temporaray password.
";
print "Please change it once you login by visiting 'My Account' and updating your password. ";
print '';
}
} elseif (!empty($_REQUEST['email'])) {
drupal_set_title('Password Reset: Request Sent');
if ($adm->ResetPassword($_REQUEST['email']) != 1) {
print '' . $adm->error() . '.
';
} else {
print '';
print "We've sent an e-mail to " . $_REQUEST['email'] . " that will allow you to confirm the password reset.
";
print "Please check your email now and follow the link contained there to reset your password. ";
print '
';
}
} else {
drupal_set_title('Password Reset');
$self = $_SERVER['PHP_SELF'];
if (!empty($_SERVER['QUERY_STRING'])) {
$self .= "?" . $_SERVER['QUERY_STRING'];
}
// XXX Use our own stylesheet instead of drupal.css
print <<
EOF;
}
}
include 'plc_footer.php';
?>