Hello
The bug cause error wehn deleting user
the bug is in function deleteUsers
the test use
if( $this->_connected === true && !$this->isAdminConnection)
never match because I m not connected at this time
and then I never get to connect
I don’t really understand why do we need to test this
Here is what i have done to make it work
function deleteUsers($username='%')
{
if(!$this->enableCyrusAdmin || empty($username)) {
return false;
}
// add this line here
$this->openConnection(true);
// we need a admin connection
if( $this->_connected === true && !$this->isAdminConnection) {
$this->disconnect();
if(!$this->openConnection(true)) {
return false;
}
}
$mailboxName = $this->getUserMailboxString($username);
list($reference,$restriction) = explode($username,$mailboxName,2);
$mboxes = $this->getMailboxes($reference,$username.$restriction);
//error_log(__METHOD__."('$username')
getMailboxes(’$reference’,’$username$restriction’) =
".array2string($mboxes));
foreach($mboxes as $mbox) {
// give the admin account the rights to delete this mailbox
if(PEAR::isError($this->setACL($mbox, $this->adminUsername,
‘lrswipcda’))) {
$this->disconnect();
return false;
}
if(PEAR::isError($this->deleteMailbox($mbox))) {
$this->disconnect();
return false;
}
}
$this->disconnect();
return count($mboxes);
}
cyril
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers