thomascube
2010-12-17 db1a87cd6c506f2afbd1a37c64cb56ae11120b49
commit | author | age
9b3fdc 1 <?php
A 2
3 /*
4  +-----------------------------------------------------------------------+
5  | program/steps/mail/copy.inc                                           |
6  |                                                                       |
e019f2 7  | This file is part of the Roundcube Webmail client                     |
A 8  | Copyright (C) 2005-2010, Roundcube Dev. - Switzerland                 |
9b3fdc 9  | Licensed under the GNU GPL                                            |
A 10  |                                                                       |
11  | PURPOSE:                                                              |
12  |   Copy the submitted messages to a specific mailbox                   |
13  |                                                                       |
14  +-----------------------------------------------------------------------+
15  | Author: Aleksander Machniak <alec@alec.pl>                            |
16  +-----------------------------------------------------------------------+
17
18  $Id$
19
20 */
21
22 // only process ajax requests
23 if (!$OUTPUT->ajax_call)
24   return;
25
26 // move messages
27 if (!empty($_POST['_uid']) && !empty($_POST['_target_mbox'])) {
1c9bd8 28     $uids = get_input_value('_uid', RCUBE_INPUT_POST);
b72e2f 29     $target = get_input_value('_target_mbox', RCUBE_INPUT_POST, true);
A 30     $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true);
9b3fdc 31
A 32     $copied = $IMAP->copy_message($uids, $target, $mbox);
c50d88 33
9b3fdc 34     if (!$copied) {
A 35         // send error message
db1a87 36         rcmail_display_server_error('errorcopying');
9b3fdc 37         $OUTPUT->send();
A 38         exit;
39     }
c50d88 40     else {
A 41         $OUTPUT->show_message('messagecopied', 'confirmation');
42     }
9b3fdc 43
A 44     rcmail_send_unread_count($target, true);
45
46     $OUTPUT->command('set_quota', rcmail_quota_content());
47 }
48 // unknown action or missing query param
49 else {
50     exit;
51 }
52
53 // send response
54 $OUTPUT->send();