]> git.donarmstrong.com Git - roundcube.git/blob - program/steps/mail/getunread.inc
2e417e9782b4238f9e927e92bcb38db0d26efc62
[roundcube.git] / program / steps / mail / getunread.inc
1 <?php
2
3 /*
4  +-----------------------------------------------------------------------+
5  | program/steps/mail/getunread.inc                                      |
6  |                                                                       |
7  | This file is part of the RoundCube Webmail client                     |
8  | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
9  | Licensed under the GNU GPL                                            |
10  |                                                                       |
11  | PURPOSE:                                                              |
12  |   Check all mailboxes for unread messages and update GUI              |
13  |                                                                       |
14  +-----------------------------------------------------------------------+
15  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16  +-----------------------------------------------------------------------+
17
18  $Id: getunread.inc 269 2006-06-29 23:41:40Z richs $
19
20 */
21
22 $REMOTE_REQUEST = TRUE;
23
24 $a_folders = $IMAP->list_mailboxes();
25
26 if (!empty($a_folders))
27   {
28   foreach ($a_folders as $mbox_row)
29     {
30     $commands = sprintf("this.set_unread_count('%s', %d);\n", addslashes($mbox_row), $IMAP->messagecount($mbox_row, 'UNSEEN'));
31     rcube_remote_response($commands, TRUE);
32     }
33   }
34
35 exit;
36 ?>