thomascube
2006-05-05 ded2b7e166d4b0acab09c00f22f379fbabba709a
commit | author | age
4e17e6 1 <?php
T 2
3 /*
4  +-----------------------------------------------------------------------+
5  | program/steps/mail/mark.inc                                           |
6  |                                                                       |
7  | This file is part of the RoundCube Webmail client                     |
8  | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
30233b 9  | Licensed under the GNU GPL                                            |
4e17e6 10  |                                                                       |
T 11  | PURPOSE:                                                              |
12  |   Mark the submitted messages with the specified flag                 |
13  |                                                                       |
14  +-----------------------------------------------------------------------+
15  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16  +-----------------------------------------------------------------------+
17
18  $Id$
19
20 */
21
22 $REMOTE_REQUEST = TRUE;
23
4cd897 24 $a_flags_map = array('undelete' => 'UNDELETED',
S 25                      'delete' => 'DELETED',
26                      'read' => 'SEEN',
4e17e6 27                      'unread' => 'UNSEEN');
T 28
29 if ($_GET['_uid'] && $_GET['_flag'])
30   {
31   $flag = $a_flags_map[$_GET['_flag']] ? $a_flags_map[$_GET['_flag']] : strtoupper($_GET['_flag']);
32   $marked = $IMAP->set_flag($_GET['_uid'], $flag);
4cd897 33   if ($marked != -1)
4e17e6 34     {
T 35     $mbox = $IMAP->get_mailbox_name();
36     $commands = sprintf("this.set_unread_count('%s', %d);\n", $mbox, $IMAP->messagecount($mbox, 'UNSEEN'));
37     rcube_remote_response($commands);
38     }
39   }
40   
41 exit;
42 ?>