Fix for incorrect folding of header lines. This fix the error message
[squirrelmail.git] / src / signout.php
index 48cfc82880761b4214c79943537298f3ee8e0a55..109053101140b3a122a6ce9c6583aaadbb6f5fd3 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/prefs.php');
-require_once('../functions/plugin.php');
-require_once('../functions/strings.php');
-require_once('../functions/html.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'include/validate.php');
+require_once(SM_PATH . 'functions/prefs.php');
+require_once(SM_PATH . 'functions/plugin.php');
+require_once(SM_PATH . 'functions/strings.php');
+require_once(SM_PATH . 'functions/html.php');
 
 /* Erase any lingering attachments */
 if (isset($attachments) && is_array($attachments) 
@@ -35,17 +39,16 @@ if (!isset($frame_top)) {
 
 /* If a user hits reload on the last page, $base_uri isn't set
  * because it was deleted with the session. */
-if (!isset($base_uri)) {
+if (!isset($_SESSION['base_uri'])) {
     if (!function_exists('sqm_baseuri')){
-        require_once('../functions/display_messages.php');
+        require_once(SM_PATH . 'functions/display_messages.php');
     }
     $base_uri = sqm_baseuri();
+} else {
+    $base_uri = $_SESSION['base_uri'];
 }
-
+sqsession_destroy();
 do_hook('logout');
-setcookie('username', '', 0, $base_uri);
-setcookie('key', '', 0, $base_uri);
-session_destroy();
 
 if ($signout_page) {
     header('Status: 303 See Other');
@@ -77,7 +80,7 @@ html_tag( 'table',
     '', $color[0], 'width="100%"' ) .
     html_tag( 'tr',
          html_tag( 'td', _("You have been successfully signed out.") .
-             '<br><a href="login.php" target="' . $frame_to . '">' .
+             '<br><a href="login.php" target="' . $frame_top . '">' .
              _("Click here to log back in.") . '</a><br>' ,
          'center' ) ,
     '', $color[4], 'width="100%"' ) .
@@ -87,4 +90,4 @@ html_tag( 'table',
 'center', $color[4], 'width="50%" cols="1" cellpadding="2" cellspacing="0" border="0"' )
 ?>
 </body>
-</html>
\ No newline at end of file
+</html>