phase 1 of interface improvements -- alternating row colors (needs some work)
[squirrelmail.git] / src / delete_message.php
CommitLineData
59177427 1<?php
ef870322 2 /**
3 ** delete_message.php
4 **
5 ** Copyright (c) 1999-2000 The SquirrelMail development team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
7 **
8 ** Deletes a meesage from the IMAP server
245a6892 9 **
10 ** $Id$
ef870322 11 **/
12
2a32fc83 13 session_start();
14
d068c0ec 15 if (!isset($strings_php))
16 include("../functions/strings.php");
245a6892 17 if (!isset($config_php))
18 include("../config/config.php");
d068c0ec 19 if (!isset($page_header_php))
20 include("../functions/page_header.php");
21 if (!isset($display_message_php))
22 include("../functions/display_messages.php");
23 if (!isset($imap_php))
24 include("../functions/imap.php");
d4467150 25
d3cdb279 26 include("../src/load_prefs.php");
27
e1469126 28 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
813eba2f 29 sqimap_mailbox_select($imapConnection, $mailbox);
d4467150 30
a3cb3d5f 31 sqimap_messages_delete($imapConnection, $message, $message, $mailbox);
acaa9842 32 if ($auto_expunge)
8cf653ad 33 sqimap_mailbox_expunge($imapConnection, $mailbox, true);
acaa9842 34
1195c340 35 $location = get_location();
9d7140c9 36 if (isset($where) && isset($what))
1809bad8 37 header ("Location: $location/search.php?where=".urlencode($where)."&what=".urlencode($what)."&mailbox=".urlencode($mailbox));
38 else
39 header ("Location: $location/right_main.php?sort=$sort&startMessage=$startMessage&mailbox=".urlencode($mailbox));
a48fbf9b 40
41 sqimap_logout($imapConnection);
d4467150 42?>