Index: securesite-dialog.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/securesite/Attic/securesite-dialog.tpl.php,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 securesite-dialog.tpl.php
--- securesite-dialog.tpl.php	16 Jan 2008 23:50:21 -0000	1.1.2.1
+++ securesite-dialog.tpl.php	19 Feb 2008 23:42:52 -0000
@@ -8,6 +8,13 @@
 }
 
 body {
+  margin: 0;
+  padding: 0;
+  text-align: center;
+}
+
+div#securesite {
+  text-align: left;
   font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
   font-size: 76%;
   width: 30em;
@@ -41,7 +48,7 @@
 </style>
 </head>
 <body>
-  <div>
+  <div id="securesite">
     <?php print $content ?>
   </div>
   </body>
Index: securesite.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/securesite/Attic/securesite.module,v
retrieving revision 1.24.2.35
diff -u -r1.24.2.35 securesite.module
--- securesite.module	11 Feb 2008 23:07:00 -0000	1.24.2.35
+++ securesite.module	19 Feb 2008 23:40:32 -0000
@@ -161,7 +161,20 @@
     return;
   }
 
-  // Step #2: Set up variables
+  // Step #2: Process password resets
+  if (strpos(request_uri(), $base_path .'user/reset/') === 0) {
+    $args = explode('/', $_GET['q']);
+
+    // The password reset function doesn't work well if it doesn't have all the required parameters or if the UID parameter isn't valid
+    if (count($args) >= 5 && user_load(array('uid' => $args[2], 'status' => 1))) {
+      user_pass_reset($args[2], $args[3], $args[4], 'login');
+    }
+    else {
+      drupal_set_message(t('You have tried to use an invalid one-time login link. Please request a new one using the form below.'), 'error');
+    }
+  }
+
+  // Step #3: Set up variables
   $guest_name = variable_get('securesite_guest_name', '');
   $guest_pass = variable_get('securesite_guest_pass', '');
 
@@ -178,12 +191,12 @@
     }
   }
 
-  // Step #3: If needed, ask user for credentials
+  // Step #4: If needed, ask user for credentials
   if (empty($edit) && ($user->uid == 0)) {
     securesite_user_auth();
   }
 
-  // Step #4: Check if user is a guest and log them in if they are
+  // Step #5: Check if user is a guest and log them in if they are
   if (!empty($guest_name) && !empty($guest_pass) && $guest_name == $edit['name'] && $guest_pass == $edit['pass']) {
     // Mark this session to prevent re-login (note: guests can't logout)
     $_SESSION['securesite_guest'] = TRUE;
@@ -196,7 +209,7 @@
   }
   unset($_SESSION['securesite_guest']); // If not a guest make sure to unset guest session
 
-  // Step #5: Check user's credentials
+  // Step #6: Check user's credentials
   /**
    * The LDAP auth module can't use the regular external user login system, so we have to call its
    * login function separately
@@ -208,7 +221,7 @@
     $account = user_authenticate($edit['name'], $edit['pass']);
   }
 
-  // Step #6: Process login attempt
+  // Step #7: Process login attempt
   if ($account->uid && user_access('access site', $account)) {
     // Login successful
     $user = $account;
@@ -278,7 +291,6 @@
   include_once('securesite.inc');
   $edit = isset($_POST['edit']) ? $_POST['edit'] : '';
   $securesite_enabled = variable_get('securesite_enabled', SECURESITE_DISABLED);
-  $content = '';
 
   // Step #1: Check if the user attempted to submit the login form. If so, getting here means they didn't enter their
   // info correctly
@@ -325,11 +337,8 @@
         if ($mail_success) {
           watchdog('user', t('Password mailed to %name at %email.', array('%name' => $account->name, '%email' => $account->mail)));
 
-          // We exit here because presumably the user can't do anything more before visiting the password reset URL
-          header('Content-Type: text/plain; charset=UTF-8'); // We're only outputting text, so reset the Content-Type
-          print t('Your password and further instructions have been sent to your e-mail address.');
-          module_invoke_all('exit', request_uri());
-          exit;
+          drupal_set_message(t('Your password and further instructions have been sent to your e-mail address.'));
+          securesite_user_login($securesite_enabled);
         }
         else {
           // Note: At this point, the user's password has already been reset
@@ -346,7 +355,13 @@
       drupal_set_message(t('Unrecognized username or e-mail address.'), 'error');
     }
   }
+  
+  securesite_user_login($securesite_enabled);
+}
 
+function securesite_user_login($securesite_enabled) {
+  $content = '';
+  
   // Get content for dialog
   if ($securesite_enabled == SECURESITE_FORM) {
     $content .= _securesite_login_form();
