I noticed that using:
imap_setacl ($conn, $mbox, $userid, "")
will act like:
"deleteaclmailbox $mbox $userid" (remove the ACL on mailbox for userid).
(PHP 4 >= 4.0.7, PHP 5, PHP 7, PHP 8)
imap_setacl — 指定したメールボックスの ACL を設定する
指定したメールボックスの ACL を設定します。
imap
IMAP\Connection クラスのインスタンス。
mailbox
メールボックス名。詳細は imap_open() を参照ください。
信頼できないデータをこのパラメータに渡すのであれば、 imap.enable_insecure_rsh を無効にしておかなければ危険です。
user_id
権限を付与するユーザー。
rights
そのユーザーに付与する権限。空文字列を渡すと、acl を削除します。
成功した場合に true
を、失敗した場合に false
を返します。
バージョン | 説明 |
---|---|
8.1.0 |
引数 imap は、IMAP\Connection
クラスのインスタンスを期待するようになりました。
これより前のバージョンでは、有効な imap リソース が期待されていました。
|
この関数は、現在 c-client2000 以降のユーザーのみ使用可能です。
I noticed that using:
imap_setacl ($conn, $mbox, $userid, "")
will act like:
"deleteaclmailbox $mbox $userid" (remove the ACL on mailbox for userid).
After getting the ACL's from imap_getacl you want to set them for a user on any mailbox folder like this:
foreach ( $Folders as $key => $Maildir ) {
imap_setacl($domains , "user/john.doe/".$Maildir , $userid, "lrswipkxte");
}
You can use a form that translates the ACLs like the following (thanks to cyradm manual):
switch ($right) {
case "read" : $aclstring = "lrs";
break;
case "post" : $aclstring = "lrsp";
break;
case "append" : $aclstring = "lrsip";
break;
case "write" : $aclstring = "lrswipkxte";
break;
case "delete" : $aclstring = "lrxte";
break;
case "all" : $aclstring = "lrswipkxte";
break;
case "admin" : $aclstring = "lrswipkxtea";
break;
case "none" : $aclstring = "";
break;
}