|
[SM-CVS] CVS: squirrelmail/functions imap_mailbox.php,1.152,1.153
From: Rob Siemborski <robsiemb@us...> - 2002-08-29 15:43
|
Update of /cvsroot/squirrelmail/squirrelmail/functions
In directory usw-pr-cvs1:/tmp/cvs-serv23439
Modified Files:
imap_mailbox.php
Log Message:
correctly detect \Noselect in LSUB responses, and set $mbx->is_noselect
so that the folder tree does not allow you to select a nonexistant
mailbox
Index: imap_mailbox.php
===================================================================
RCS file: /cvsroot/squirrelmail/squirrelmail/functions/imap_mailbox.php,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -w -r1.152 -r1.153
--- imap_mailbox.php 26 Aug 2002 09:38:08 -0000 1.152
+++ imap_mailbox.php 29 Aug 2002 15:43:38 -0000 1.153
@@ -75,13 +75,15 @@
return ($acmp>$bcmp) ? 1: -1;
}
-
function find_mailbox_name ($mailbox) {
if (ereg(" *\"([^\r\n\"]*)\"[ \r\n]*$", $mailbox, $regs))
return $regs[1];
ereg(" *([^ \r\n\"]*)[ \r\n]*$",$mailbox,$regs);
return $regs[1];
+}
+function check_is_noselect ($lsub_line) {
+ return preg_match("/^\* LSUB \([^\)]*\\Noselect[^\)]*\)/i", $lsub_line);
}
/**
@@ -740,10 +742,11 @@
// $sorted_lsub_ary[] = array ('mbx' => $mbx, 'flag' => $flag);
// }
$mbx = find_mailbox_name($lsub_ary[$i]);
+ $noselect = check_is_noselect($lsub_ary[$i]);
if (substr($mbx, -1) == $delimiter) {
$mbx = substr($mbx, 0, strlen($mbx) - 1);
}
- $sorted_lsub_ary[] = array ('mbx' => $mbx, 'flag' => '');
+ $sorted_lsub_ary[] = array ('mbx' => $mbx, 'noselect' => $noselect);
}
array_multisort($sorted_lsub_ary, SORT_ASC, SORT_REGULAR);
@@ -861,6 +864,8 @@
if (isset($mbx_ary[$i]['nummessages'])) {
$mbx->total = $mbx_ary[$i]['nummessages'];
}
+
+ $mbx->is_noselect = $mbx_ary[$i]['noselect'];
$r_del_pos = strrpos($mbx_ary[$i]['mbx'], $delimiter);
if ($r_del_pos) {
|
| Thread | Author | Date |
|---|---|---|
| [SM-CVS] CVS: squirrelmail/functions imap_mailbox.php,1.152,1.153 | Rob Siemborski <robsiemb@us...> |