|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-07-20 08:21 UTC] damian@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 12:00:01 2025 UTC |
Description: ------------ The getMailboxes('malibox', false) matches any mailbox, that either starts or ends with 'mailbox' = ("*/mailbox" || "mailbox/*"). The function should ?? return only the mailbox that contains that exact name?... While resolving the problem, I took the liberty to alter the code, so it is also possible to retrieve only the immediate submailboxes. I changed the second (boolean) parameter into an integer, so a third option was available without making problems with backward compatibility? While at is, I also added the ability to use a string as the second parameter, so it is possible to use the same function for those of us, at prefer to handle the reference/mailbox stuff manually? ======================================== 831,832c831,832 < * @param string $mailbox_base base mailbox to start the search < * $mailbox_base if $mailbox_base == '' then $mailbox_base is the curent selected mailbox --- > * @param string $reference base mailbox to start the search > * $reference if $reference == '' then $reference is the curent selected mailbox 842c842 < function getMailboxes($mailbox_base = '' , $restriction_search = true, $returnAttributes=false ) --- > function getMailboxes($reference = '' , $restriction_search = 1, $returnAttributes=false ) 844a845,865 > if ( is_bool($restriction_search)) > $restriction_search = (int) $restriction_search; > > if (is_int($restriction_search)){ > switch ($restriction_search) { > case 0: > $mailbox = "*"; > break; > case 1: > $mailbox = $reference; > $reference = '%'; > break; > case 2: > $mailbox = "%"; > break; > } > } elseif (is_string($restriction_search)){ > $mailbox = $restriction_search; > } else { > return new PEAR_Error("UPS..."); > } 846,850c867 < if( $restriction_search ){ < $mailbox_base .="*"; < } < < if( PEAR::isError( $ret = $this->cmdList('*',$mailbox_base) ) ){ --- > if( PEAR::isError( $ret = $this->cmdList($reference, $mailbox) ) ){ ========================================