Ticket modified by camel camel at 2011/04/19 17:29
Tracking System: Feature Requests
Category: FelamiMail
Version: Trunk
Status: Open
Resolution: Accepted
Completed: 0%
Priority: 5 - medium
Created By: camel camel
Created on: 2011/04/19 10:07
Assigned to: Klaus Leithoff
Summary: #2940 - ACL - pear: setacl/deleteacl -> recursiv
hi,
it is almost impossible via normal setacl/deleteacl to set the permissions for a email folder (IMAP), if there are a lot of existing folders + sub-folder and then want to add ACL for a new person to this folders...
therefor i think it would be easy to implement:
1.) new function, which load the LIST to array, and then do the setacl/deleteacl for all of this itmes froma array
(because in IMAP there it is not possible to set with wildcard all folders recursiv.
2.) adding a flag in "email folder administration" GUI, where the user can set a "RECURSIV flag on delete acl or setacl.
this should be ok - or ?
Comment by camel camel at 2011/04/19 17:29:
frohe ostern :)
ok, if wanted ....
here is my code - for recursiv (maybe this helps ..)
function cmdSetACL($mailbox_name, $user, $acl)
{
//Check if the IMAP server has ACL support
if( ! $this->hasAclSupport() ){
return new PEAR_Error("This IMAP server does not support ACL's! ");
}
$user_name=$this->_createQuotedString($user);
$mailbox_nameQuoted=$this->_createQuotedString($mailbox_name);
$retcode = $this->_genericCommand('SETACL', sprintf("%s %s \"%s\"",$mailbox_nameQuoted,$user_name,$acl) );
//recursiv code - start
$mailboxes = $this->getMailboxes(($mailbox_name.$this->getHierarchyDelimiter()),0);
foreach($mailboxes as $n => $mailbox)
{
$mailbox_nameQuoted=$this->_createQuotedString($mailbox);
if(is_array($acl)){
$acl=implode('',$acl);
}
$retcode = $this->_genericCommand('SETACL', sprintf("%s %s \"%s\"",$mailbox_nameQuoted,$user_name,$acl) );
}
//recursiv code - end
return $retcode;
}
function cmdDeleteACL($mailbox_name, $user)
{
//Check if the IMAP server has ACL support
if( ! $this->hasAclSupport() ){
return new PEAR_Error("This IMAP server does not support ACL's! ");
}
$mailbox_nameQuoted=$this->_createQuotedString($mailbox_name);
$retcode = $this->_genericCommand('DELETEACL', sprintf("%s \"%s\"",$mailbox_nameQuoted,$user) );
//recursiv code - start
$mailboxes = $this->getMailboxes(($mailbox_name.$this->getHierarchyDelimiter()),0);
foreach($mailboxes as $n => $mailbox)
{
$mailbox_nameQuoted=$this->_createQuotedString($mailbox);
$retcode = $this->_genericCommand('DELETEACL', sprintf("%s \"%s\"",$mailbox_nameQuoted,$user) );
}
//recursiv code - end
return $retcode;
}
Comment by Klaus Leithoff at 2011/04/19 17:03:
I will do that, but probably after the easter break
Comment by camel camel at 2011/04/19 16:56:
me, too, i would also like an extra checkbox on ajax, but i don'T know how to implement it (it should be done by a devel in trunk code)
can you impelemnt that -- or must it be done from ralf ?
Comment by camel camel at 2011/04/19 16:52:
same should be made for delete .... or ?
Comment by Klaus Leithoff at 2011/04/19 14:59:
I would prefer to do that in felamimail_bo, or even in ajaxfelamimail, where you may be able to control it by the user via interface (maybe another checkbox).
But yes, If you implement it for the set ACL, the deleteACL should be implemented as well
Comment by camel camel at 2011/04/19 14:46:
same should be made for delete .... or ?
Comment by camel camel at 2011/04/19 14:45:
maybe someone can clean my patch (mod) ....
see file: egw-pear/Net/IMAPProtocol.php
function cmdSetACL($mailbox_name, $user, $acl)
{
//Check if the IMAP server has ACL support
if( ! $this->hasAclSupport() ){
return new PEAR_Error("This IMAP server does not support ACL's! ");
}
$mailboxes = $this->getMailboxes($mailbox_name."/",0);
foreach($mailboxes as $n => $mailbox)
{
$mailbox_name=$this->_createQuotedString($mailbox);
$user_name=$this->_createQuotedString($user);
if(is_array($acl)){
$acl=implode('',$acl);
}
$retcode = $this->_genericCommand('SETACL', sprintf("%s %s \"%s\"",$mailbox_name,$user_name,$acl) );
}
return $retcode;
}
Comment by Klaus Leithoff at 2011/04/19 10:22:
thats a feature request. a valid one, i admit.
linked entries:
http://www.egroupware.org/egroupware/index.php?menuaction=tracker.tracker_ui.edit&tr_id=2940&no_popup=1
|