summaryrefslogtreecommitdiff
path: root/program/steps/mail/mark.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2005-09-25 14:18:03 +0000
committerthomascube <thomas@roundcube.net>2005-09-25 14:18:03 +0000
commit4e17e6c9dbac8991ee8b302cb2581241247dc8bc (patch)
treed877546f6bd334b041734498e81f6299e005b01c /program/steps/mail/mark.inc
Initial revision
Diffstat (limited to 'program/steps/mail/mark.inc')
-rw-r--r--program/steps/mail/mark.inc41
1 files changed, 41 insertions, 0 deletions
diff --git a/program/steps/mail/mark.inc b/program/steps/mail/mark.inc
new file mode 100644
index 000000000..2dadb53eb
--- /dev/null
+++ b/program/steps/mail/mark.inc
@@ -0,0 +1,41 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/steps/mail/mark.inc |
+ | |
+ | This file is part of the RoundCube Webmail client |
+ | Copyright (C) 2005, RoundCube Dev. - Switzerland |
+ | All rights reserved. |
+ | |
+ | PURPOSE: |
+ | Mark the submitted messages with the specified flag |
+ | |
+ +-----------------------------------------------------------------------+
+ | Author: Thomas Bruederli <roundcube@gmail.com> |
+ +-----------------------------------------------------------------------+
+
+ $Id$
+
+*/
+
+$REMOTE_REQUEST = TRUE;
+
+$a_flags_map = array('read' => 'SEEN',
+ 'unread' => 'UNSEEN');
+
+if ($_GET['_uid'] && $_GET['_flag'])
+ {
+ $flag = $a_flags_map[$_GET['_flag']] ? $a_flags_map[$_GET['_flag']] : strtoupper($_GET['_flag']);
+ $marked = $IMAP->set_flag($_GET['_uid'], $flag);
+
+ if ($marked)
+ {
+ $mbox = $IMAP->get_mailbox_name();
+ $commands = sprintf("this.set_unread_count('%s', %d);\n", $mbox, $IMAP->messagecount($mbox, 'UNSEEN'));
+ rcube_remote_response($commands);
+ }
+ }
+
+exit;
+?> \ No newline at end of file