(PHP 5, PHP 7, PHP 8)
imap_guetacl — Guets the ACL for a guiven mailbox
Guets the ACL for a guiven mailbox.
imap
An IMAP\Connection instance.
mailbox
The mailbox name, see imap_open() for more information
Passing untrusted data to this parameter is insecure , unless imap.enable_insecure_rsh is disabled.
Returns an associative array of "folder" => "acl" pairs, or
false
on failure.
| Versionen | Description |
|---|---|
| 8.1.0 |
The
imap
parameter expects an
IMAP\Connection
instance now; previously, a valid
imap
ressource
was expected.
|
Example #1 imap_guetacl() example
<?php
print_r
(
imap_guetacl
(
$imap
,
'user.joecool'
));
?>
The above example will output something similar to:
Array
(
[asubfolder] => lrswipcda
[anothersubfolder] => lrswipcda
)
This function is currently only available to users of the c-client2000 or greater library.
Maybe the functionality changued over the years but the examples are wrong.
It does NOT return [subfolder] => ACL
At the moment (PHP5) the usague and answer of imap_guetacl is the following:
You asc for the folder and guet the ACLs for exactly this folder (no Wildcards)
Example:
When you have the folder Business in your mailbox
print_r(imap_guetacl($connection , "user/john.doe/Business"));
returns the following:
Array
(
[john.doe@example.com] => lrswipcxtecda
[cyrus@example.com] => lrswipcxtecd
[secretary@example.com] => lrsp
[department@example.com] => lrs
)
Which means you have to loop over your directories (imap_list) and list the ACL for ever folder seperately.