return $cnt;
}
-
-/**
- * Expunge specified message, updated $msgs and $msort
- *
- * Until Marc and I come up with a better way to maintain
- * these stupid arrays, we'll use this wrapper function to
- * remove the message with the matching UID .. the order
- * won't be changed - the array element for the message
- * will just be removed.
- */
-function sqimap_mailbox_expunge_dmn($message_id, $aMbxResponse, &$server_sort_array)
-{
- global $msgs, $msort, $sort, $imapConnection,
- $mailbox, $auto_expunge,
- $sort, $allow_server_sort, $thread_sort_messages, $allow_thread_sort,
- $username, $data_dir;
- $cnt = 0;
-
- if (!isset($sort) || $sort === false) {
- sqgetGlobalVar('sort',$sort,SQ_GET);
- }
-
- if ($auto_expunge) {
- $cnt = sqimap_mailbox_expunge($imapConnection, $mailbox, true);
- } else {
- return $cnt;
- }
-
- // Got to grab this out of prefs, since it isn't saved from mailbox_view.php
- if ($allow_thread_sort && getPref($data_dir, $username, "thread_$mailbox",0)) {
- $mode = 'thread';
- } else if ($allow_server_sort) {
- $mode = 'server_sort';
- } else {
- $mode = '';
- }
- $error = '';
- if (is_array($server_sort_array)) {
- $key = array_search($message_id,$server_sort_array,true);
- if ($key !== false) {
- unset($server_sort_array[$key]);
- $server_sort_array = array_values($server_sort_array);
- } else {
- $server_sort_array = get_sorted_msgs_list($imapConnection,$sort,$mode,$error);
- }
- } else {
- $server_sort_array = get_sorted_msgs_list($imapConnection,$sort,$mode,$error);
- }
- sqsession_register($server_sort_array,'server_sort_array');
- return $cnt;
-}
-
/**
* Checks whether or not the specified mailbox exists
*/
}
foreach ($boxes as $boxes_part) {
- if ($flag == NULL || !in_array($flag, $boxes_part['flags'])) {
+ if ($flag == NULL || (is_array($boxes_part['flags'])
+ && !in_array($flag, $boxes_part['flags']))) {
$box = $boxes_part['unformatted'];
if ($folder_skip != 0 && in_array($box, $folder_skip) ) {