* added footer template which also takes care of displaying the error messages
[squirrelmail.git] / src / signout.php
index 8706ed9656c218a2ab94cb98af894c6b82c75d8a..82712e1bf517065f0fecfa0457cb308640898717 100644 (file)
@@ -5,7 +5,7 @@
  *
  *  Cleans up after the user. Resets cookies and terminates session.
  *
- * @copyright © 1999-2005 The SquirrelMail Project Team
+ * @copyright © 1999-2006 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -17,7 +17,7 @@
  */
 define('SM_PATH','../');
 
-require_once(SM_PATH . 'include/validate.php');
+include_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');
@@ -25,8 +25,11 @@ require_once(SM_PATH . 'functions/html.php');
 
 /* Erase any lingering attachments */
 sqgetGlobalVar('compose_messages',  $compose_messages,  SQ_SESSION);
-foreach($compose_messages as $composeMessage) {
-    $composeMessage->purgeAttachments();
+
+if (!empty($compose_message) && is_array($compose_messages)) {
+    foreach($compose_messages as $composeMessage) {
+        $composeMessage->purgeAttachments();
+    }
 }
 
 if (!isset($frame_top)) {
@@ -89,6 +92,5 @@ html_tag( 'table',
     '', $color[0] ) ,
 'center', $color[4], 'width="50%" cellpadding="2" cellspacing="0" border="0"' )
 
-?>
-</body>
-</html>
+$oTemplate->display('footer.tpl');
+?>
\ No newline at end of file