source: github/program/steps/mail/move_del.inc @ 30233b8

HEADcourier-fixdev-browser-capabilitiespdorelease-0.6release-0.7release-0.8
Last change on this file since 30233b8 was 30233b8, checked in by thomascube <thomas@…>, 8 years ago

Minor bugfixes and correction of confusing License notfications

  • Property mode set to 100644
File size: 2.4 KB
Line 
1<?php
2
3/*
4 +-----------------------------------------------------------------------+
5 | program/steps/mail/move_del.inc                                       |
6 |                                                                       |
7 | This file is part of the RoundCube Webmail client                     |
8 | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
9 | Licensed under the GNU GPL                                            |
10 |                                                                       |
11 | PURPOSE:                                                              |
12 |   Move the submitted messages to a specific mailbox or delete them    |
13 |                                                                       |
14 +-----------------------------------------------------------------------+
15 | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16 +-----------------------------------------------------------------------+
17
18 $Id$
19
20*/
21
22$REMOTE_REQUEST = TRUE;
23
24// move messages
25if ($_action=='moveto' && $_GET['_uid'] && $_GET['_target_mbox'])
26  {
27  $count = sizeof(explode(',', $_GET['_uid'])); 
28  $moved = $IMAP->move_message($_GET['_uid'], $_GET['_target_mbox'], $_GET['_mbox']);
29 
30  if (!$moved)
31    {
32    // send error message
33    exit;
34    }
35  }
36
37// delete messages
38else if ($_action=='delete' && $_GET['_uid'])
39  {
40  $count = sizeof(explode(',', $_GET['_uid']));
41  $del = $IMAP->delete_message($_GET['_uid'], $_GET['_mbox']);
42 
43  if (!$del)
44    {
45    // send error message
46    exit;
47    }
48  }
49 
50// unknown action or missing query param
51else
52  {
53  exit;
54  }
55
56
57// update message count display
58$pages = ceil($IMAP->messagecount()/$IMAP->page_size);
59$commands = sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text());
60$commands .= sprintf("this.set_env('pagecount', %d);\n", $pages);
61
62 
63// update mailboxlist
64$mbox = $IMAP->get_mailbox_name();
65$commands .= sprintf("this.set_unread_count('%s', %d);\n", $mbox, $IMAP->messagecount($mbox, 'UNSEEN'));
66$commands .= sprintf("this.set_unread_count('%s', %d);\n", $_GET['_target_mbox'], $IMAP->messagecount($_GET['_target_mbox'], 'UNSEEN'));
67
68
69// add new rows from next page (if any)
70if ($_GET['_from']!='show' && $pages>1 && $IMAP->list_page < $pages)
71  {
72  $a_headers = $IMAP->list_headers($mbox);
73  $a_headers = array_slice($a_headers, -$count, $count);
74  $commands .= rcmail_js_message_list($a_headers);
75  }
76
77 
78// send response
79rcube_remote_response($commands);
80
81exit;
82?>
Note: See TracBrowser for help on using the repository browser.