Code Cleaning
[squirrelmail.git] / src / delete_message.php
index dd59af6f1fa469c5589e2357293f3e54f4e0e393..18629228eab559a096b56fa4b444b1447a9885a2 100644 (file)
@@ -1,31 +1,37 @@
 <?php
-   /**
-    **  delete_message.php
-    **
-    **  Copyright (c) 1999-2000 The SquirrelMail development team
-    **  Licensed under the GNU GPL. For full terms see the file COPYING.
-    **
-    **  Deletes a meesage from the IMAP server 
-    **
-    **  $Id$
-    **/
 
-   include("../src/validate.php");
-   include("../functions/display_messages.php");
-   include("../functions/imap.php");
+/**
+ * delete_message.php
+ *
+ * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * Deletes a meesage from the IMAP server
+ *
+ * $Id$
+ */
 
-   $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
-   sqimap_mailbox_select($imapConnection, $mailbox);
+require_once('../src/validate.php');
+require_once('../functions/display_messages.php');
+require_once('../functions/imap.php');
 
-   sqimap_messages_delete($imapConnection, $message, $message, $mailbox);
-   if ($auto_expunge)
-      sqimap_mailbox_expunge($imapConnection, $mailbox, true);
+$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 
-   $location = get_location();
-   if (isset($where) && isset($what))
-      header ("Location: $location/search.php?where=".urlencode($where)."&what=".urlencode($what)."&mailbox=".urlencode($mailbox));
-   else   
-      header ("Location: $location/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=".urlencode($mailbox));
+sqimap_mailbox_select($imapConnection, $mailbox);
 
-   sqimap_logout($imapConnection);
+sqimap_messages_delete($imapConnection, $message, $message, $mailbox);
+if ($auto_expunge) {
+    sqimap_mailbox_expunge($imapConnection, $mailbox, true);
+}
+
+$location = get_location();
+if (isset($where) && isset($what)) {
+    header("Location: $location/search.php?where=" . urlencode($where) .
+           '&what=' . urlencode($what) . '&mailbox=' . urlencode($mailbox));
+} else {
+    header("Location: $location/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=" .
+           urlencode($mailbox));
+}
+
+sqimap_logout($imapConnection);
 ?>