* Centralise the attachment deleting code into the Message class
[squirrelmail.git] / src / signout.php
index 83fd6fae60b17b7729d4e8a3dffda5a114192030..8706ed9656c218a2ab94cb98af894c6b82c75d8a 100644 (file)
@@ -24,15 +24,9 @@ require_once(SM_PATH . 'functions/strings.php');
 require_once(SM_PATH . 'functions/html.php');
 
 /* Erase any lingering attachments */
-if (isset($attachments) && is_array($attachments)
-    && sizeof($attachments)){
-    $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
-    foreach ($attachments as $info) {
-        $attached_file = "$hashed_attachment_dir/$info[localfilename]";
-        if (file_exists($attached_file)) {
-            unlink($attached_file);
-        }
-    }
+sqgetGlobalVar('compose_messages',  $compose_messages,  SQ_SESSION);
+foreach($compose_messages as $composeMessage) {
+    $composeMessage->purgeAttachments();
 }
 
 if (!isset($frame_top)) {
@@ -97,4 +91,4 @@ html_tag( 'table',
 
 ?>
 </body>
-</html>
\ No newline at end of file
+</html>