]> git.donarmstrong.com Git - roundcube.git/blob - program/steps/mail/mark.inc
Imported Upstream version 0.1~rc1~dfsg
[roundcube.git] / program / steps / mail / mark.inc
1 <?php
2 /*
3  +-----------------------------------------------------------------------+
4  | program/steps/mail/mark.inc                                           |
5  |                                                                       |
6  | This file is part of the RoundCube Webmail client                     |
7  | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
8  | Licensed under the GNU GPL                                            |
9  |                                                                       |
10  | PURPOSE:                                                              |
11  |   Mark the submitted messages with the specified flag                 |
12  |                                                                       |
13  +-----------------------------------------------------------------------+
14  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
15  +-----------------------------------------------------------------------+
16
17  $Id: mark.inc 573 2007-05-18 11:29:25Z thomasb $
18
19 */
20
21 $a_flags_map = array(
22   'undelete' => 'UNDELETED',
23   'delete' => 'DELETED',
24   'read' => 'SEEN',
25   'unread' => 'UNSEEN');
26
27 if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_value('_flag', RCUBE_INPUT_POST)))
28 {
29   $flag = $a_flags_map[$flag] ? $a_flags_map[$flag] : strtoupper($flag);
30   $marked = $IMAP->set_flag($uids, $flag);
31
32   if ($marked != -1)
33   {
34     $mbox_name = $IMAP->get_mailbox_name();
35     $OUTPUT->command('set_unread_count', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN'));
36     $OUTPUT->send();
37   }
38 }
39   
40 exit;
41 ?>