bugfix: the slice page was broken when nobody is in slice
[plewww.git] / planetlab / persons / reset_password.php
index e0a2bca..99f5a61 100644 (file)
 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) {
+    // Print header
+    require_once 'plc_drupal.php';
+    include 'plc_header.php';
 
     if (!empty($_REQUEST['id']) && !empty($_REQUEST['key'])) {
       $person_id = intval($_REQUEST['id']);
@@ -25,8 +24,6 @@ if ( !$plc->person) {
       if ($adm->ResetPassword($person_id, $_REQUEST['key']) != 1) {
         print '<div class="messages error">' . $adm->error() . '.</div>';
       } else {
-        drupal_set_html_head("<meta http-equiv=\"refresh\" content=\"60; URL=/\"");
-
         print '<div class="messages status">';
         print "Success!  We've sent you another e-mail with your new temporary password. <br/>"; 
         print "You can login using this temporaray password.  <br/>"; 
@@ -73,8 +70,13 @@ if ( !$plc->person) {
 EOF;
 
     }
+    include 'plc_footer.php';
+
+} else {
+  // Otherwise display the user's account page.
+  Header("Location: /db/persons/index.php?id=" . $plc->person['person_id']);
+  exit();
 }
 
-include 'plc_footer.php';
 
 ?>