* Added several hooks
[squirrelmail.git] / src / delete_message.php
index 086750e6b424052159a2460c43a45a05bd913c28..691c97af3bedfb762d5ecc92325c7c9262903603 100644 (file)
@@ -6,22 +6,14 @@
     **  Licensed under the GNU GPL. For full terms see the file COPYING.
     **
     **  Deletes a meesage from the IMAP server 
-    **  
+    **
+    **  $Id$
     **/
 
-   session_start();
-
-   if (!isset($config_php))
-      include("../config/config.php");
-   if (!isset($strings_php))
-      include("../functions/strings.php");
-   if (!isset($page_header_php))
-      include("../functions/page_header.php");
-   if (!isset($display_message_php))
-      include("../functions/display_messages.php");
-   if (!isset($imap_php))
-      include("../functions/imap.php");
-
+   include("../src/validate.php");
+   include("../functions/page_header.php");
+   include("../functions/display_messages.php");
+   include("../functions/imap.php");
    include("../src/load_prefs.php");
 
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
       sqimap_mailbox_expunge($imapConnection, $mailbox, true);
 
    $location = get_location();
-   if ($where && $what)
+   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_close($imapConnection);
    sqimap_logout($imapConnection);
 ?>