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