Name

Zarafa specific functions — This section describes Zarafa specific functions to manage users and groups and get and set permissions on folders.

Synopsis

long mapi_zarafa_createuser(store $storeid,
                            string $username,
                            string $password,
                            string $fullname,
                            string $emailaddress,
                            long $isnonactive,
                            long $isadmin);

boolean mapi_zarafa_setuser(store $store,
                            long $userid,
                            string $username,
                            string $fullname,
                            string $emailaddress,
                            string $password,
                            long $isnonactive,
                            long $isadmin);

boolean mapi_zarafa_createstore(store $storeid,
                                long $storetype,
                                long $userid);

boolean mapi_zarafa_deleteuser(resource $store,
                               string $username);

array mapi_zarafa_getuserlist(resource $messagestore,
                              int $companyid);

array mapi_zarafa_getuser_by_id(resource $messagestore,
                                int $userid);

array mapi_zarafa_getuser_by_name(resource $messagestore,
                                  string $username);

array mapi_zarafa_getgroup_by_id(resource $messagestore,
                                 int $groupid);

array mapi_zarafa_getgroup_by_name(resource $messagestore,
                                   string $group);

boolean mapi_zarafa_setgroup(resource $messagestore,
                             long $groupid,
                             string $groupname);

array mapi_zarafa_getgrouplist(resource $messagestore,
                               int $companyid);

long mapi_zarafa_creategroup(resource $messagestore,
                             string $groupname);

boolean mapi_zarafa_deletegroup(resource $messagestore,
                                string $groupname);

boolean mapi_zarafa_addgroupmember(resource $messagestore,
                                   int $groupid,
                                   int $userid);

boolean mapi_zarafa_deletegroupmember(resource $messagestore,
                                      int $groupid,
                                      int $userid);

array mapi_zarafa_getgrouplistofuser(resource $messagestore,
                                     long $userid);

array mapi_zarafa_getuserlistofgroup(resource $messagestore,
                                     long $groupid);

long mapi_zarafa_createcompany(resource $messagestore,
                               string $companyname);

boolean mapi_zarafa_deletecompany(resource $messagestore,
                                  string $companyname);

array mapi_zarafa_getcompany_by_id(resource $messagestore,
                                   int $companyid);

array mapi_zarafa_getcompany_by_name(resource $messagestore,
                                     string $company);

array mapi_zarafa_getcompanylist(resource $messagestore);
boolean mapi_zarafa_add_company_remote_viewlist(resource $messagestore,
                                                int $setcompanyid,
                                                int $companyid);

boolean mapi_zarafa_del_company_remote_viewlist(resource $messagestore,
                                                int $setcompanyid,
                                                int $companyid);

array mapi_zarafa_get_remote_viewlist(resource $messagestore,
                                      int $companyid);

boolean mapi_zarafa_add_user_remote_adminlist(resource $messagestore,
                                              int $userid,
                                              int $companyid);

boolean mapi_zarafa_del_user_remote_adminlist(resource $messagestore,
                                              int $userid,
                                              int $companyid);

array mapi_zarafa_get_remote_adminlist(resource $messagestore,
                                       int $companyid);

boolean mapi_zarafa_add_quota_recipient(resource $messagestore,
                                        int $companyid,
                                        int $recipient,
                                        int $type);

boolean mapi_zarafa_del_quota_recipient(resource $messagestore,
                                        int $companyid,
                                        int $recipientid,
                                        int $type);

array mapi_zarafa_get_quota_recipientlist(resource $messagestore,
                                          int $userid);

array mapi_zarafa_getpermissionrules(resource $mapiobject,
                                     long $acl_type);

boolean mapi_zarafa_setpermissionrules(resource $mapiobject,
                                       array $acls);

Details

mapi_zarafa_createuser ()

long mapi_zarafa_createuser(store $storeid, string $username, string $password, string $fullname, string $emailaddress, long $isnonactive, long $isadmin)

Creates a new user on an Zarafa server

Creates a new user on the Zarafa server. This can only be done when a store is specified which is logged on to a server with administration rights. The user is then created, but is initially 'nonactive' after being created. If the username existed before the call to mapi_zarafa_createstore(), an error is generated. The returned value can be used in a call to mapi_zarafa_setuser to set user settings of the created user.

$store
A store that is logged on to an Zarafa server, with sufficient permissions to create users.
$username
The username of the user to be added. The user must not exist prior to calling mapi_zarafa_createuser.
$password
The login password for this user
$fullname
The full name of the user as to be displayed to human users (e.g. 'John Doe')
$emailaddress
The fully qualified e-mail address of the user (e.g. 'john.doe@domain.com')
$isnonactive (optional)
Specifies whether the account is non-active. Specify 0 here to activate an account.
$isadmin (optional)
Specifies whether the account is an administator user. Specify 0 here for a normal account, 1 for an admin account.

Example 3.86. Creating a user

$session = mapi_logon_zarafa($admin_user, $password, $serverlocation);

$stores = mapi_getmsgstorestable($session);
$storeslist = mapi_table_queryallrows($stores);
$adminstore = mapi_openmsgstore($session, $storeslist[0][PR_ENTRYID]);

$userid = mapi_zarafa_createuser($adminstore, "newuser", "pass", "New User Name", "new@test.com");

if($userid == false) {
	print "Error creating user\n";
}
		

mapi_zarafa_setuser ()

Sets user information for a specific user on a Zarafa server

This function sets the user information on a user previously created (with mapi_zarafa_createuser). This call can only be done by users with administration rights on the server.

boolean mapi_zarafa_setuser(store $store,
                            long $userid,
                            string $username,
                            string $fullname,
                            string $emailaddress,
                            string $password,
                            long $isnonactive,
                            long $isadmin);
$store
A store that is logged on to a Zarafa server, with sufficient permissions to create users.
$userid
The ID of the user to update
$username
The username of the user, this is the name which was used to login into the system.
$fullname
The full name of the user as to be displayed to human users (e.g. 'John Doe')
$emailaddress
The fully qualified e-mail address of the user (e.g. 'john.doe@domain.com')
$password
The login password for this user
$isnonactive
Specifies whether the account is non-active. Specify 0 here to activate an account.

Example 3.87. Setting user information

$store = mapi_openmsgstore_zarafa("user","password");

$userid = mapi_zarafa_createuser($store, "newuser", "pass", "New User Name", "new@test.com");

if($userid == false)
	print "Error creating user\n";
else
	mapi_zarafa_setuser($store, $userid, 'John Doe', 'john.doe@domain.com', 'password', 0);
		

mapi_zarafa_createstore ()

Creates a store on a Zarafa server

Creates a complete store either for a specific user or creates a public store. When creating a user store, the standard folders 'Inbox', 'Outbox', etc. are all created and added to the store.

boolean mapi_zarafa_createstore(store $storeid,
                                long $storetype,
                                long $userid);
$store
A store that is logged on to a Zarafa server, with sufficient permissions to create users.
$storetype
The type of the store. (0 = private mailbox, 1 = public store)
$userid
The user ID to which the store should be coupled if this is a private mailbox

Example 3.88. Creating a store

$store = mapi_openmsgstore_zarafa("user","password");

$userid = mapi_zarafa_createuser($store, "newuser");

if($userid == false)
	print "Error creating user\n";

mapi_zarafa_setuser($store, $userid, 'John Doe', 'john.doe@domain.com', 'password', 0);

mapi_zarafa_createstore($store, 0, $userid);
		

mapi_zarafa_deleteuser ()

Deletes a Zarafa user.

This function deletes a user from the Zarafa server. The deleted store will be moved to an Admin folder in the toplevel of the public store. true is returned on success.

boolean mapi_zarafa_deleteuser(resource $store,
                               string $username);
$store
The store resource of an admin user.
$username
The loginname of the user to delete.

Example 3.89. Deleting a user

// Deleting a user, deleting store with it.
$result = mapi_zarafa_deleteuser($store, "john");
		

mapi_zarafa_getuserlist ()

Retreive a list of Zarafa users.

Returns an associative array of all users, with the username as key, and the full name as value.

array mapi_zarafa_getuserlist(resource $messagestore,
                              int $companyid);
$messagestore
The resource id of the messagestore of the logged-on user.
$companyid
This companyid for which we are requesting the members of. (optional)

Example 3.90. Listing the Zarafa users

$tempStoreslist = mapi_openmsgstore_zarafa($username, "password", "http://localhost:236/zarafa");
$msgstore = $tempStoreslist[0];
$users = mapi_zarafa_getuserlist($msgstore);
print_r($users);
		

Array ( [SYSTEM] => SYSTEM User [username] => Fullname )

mapi_zarafa_getuser_by_id ()

Retreive user information for zarafa user.

Returns an associative array of information for the specified user, or FALSE of the user does not exist or an other error occurred. The associative array contains 'userid', 'username', 'fullname', 'emailaddress', 'nonactive' and 'admin'.

array mapi_zarafa_getuser_by_id(resource $messagestore,
                                int $userid);
$messagestore
The resource id of the messagestore of the logged-on user.
$userid
The id of the user whose information is te be returned

Example 3.91. Getting user information

$info = mapi_zarafa_getuser_by_id($msgstore, 10);

print $info["userid"];
print $info["username"];
print $info["fullname"];
print $info["emailaddress"];
print $info["admin"];
print $info["nonactive"];
		

mapi_zarafa_getuser_by_name ()

mapi_zarafa_getuser ()

Retreive user information for zarafa user.

Returns an associative array of information for the specified user, or FALSE of the user does not exist or an other error occurred. The associative array contains 'userid', 'username', 'fullname', 'emailaddress', 'nonactive' and 'admin'.

array mapi_zarafa_getuser_by_name(resource $messagestore,
                                  string $username);
$messagestore
The resource id of the messagestore of the logged-on user.
$username
The username of the user whose information is te be returned

Example 3.92. Getting user information

$info = mapi_zarafa_getuser($msgstore, "username");

print $info["userid"];
print $info["username"];
print $info["fullname"];
print $info["emailaddress"];
print $info["admin"];
print $info["nonactive"];
		

mapi_zarafa_getgroup_by_id ()

Retrieve group information for zarafa group.

Returns an associative array of information for the specified group, or FALSE of the group does not exist or an other error occurred. The associative array contains 'groupid' and 'groupname'.

array mapi_zarafa_getgroup_by_id(resource $messagestore,
                                 int $groupid);
$messagestore
The resource id of the messagestore of the logged-on user.
$groupid
The id of the group whose information is te be returned

Example 3.93. Getting group information

$info = mapi_zarafa_getgroup_by_id($msgstore, 2);

print $info["groupid"];
print $info["groupname"];
		

mapi_zarafa_getgroup_by_name ()

mapi_zarafa_getgroup ()

Retrieve group information for zarafa group.

Returns an associative array of information for the specified group, or FALSE of the group does not exist or an other error occurred. The associative array contains 'groupid' and 'groupname'.

array mapi_zarafa_getgroup_by_name(resource $messagestore,
                                   string $group);
$messagestore
The resource id of the messagestore of the logged-on user.
$groupname
The name of the group whose information is te be returned

Example 3.94. Getting group information

$info = mapi_zarafa_getgroup($msgstore, "Everyone");

print $info["groupid"];
print $info["groupname"];
		

mapi_zarafa_setgroup ()

Set group information for a specific Zarafa group.

Modifies the given group, setting the groupname. Basically, this is a 'rename' of a group, as groups currently have no other information apart from their name. Returns TRUE on success, FALSE on error.

boolean mapi_zarafa_setgroup(resource $messagestore,
                             long $groupid,
                             string $groupname);
$messagestore
The resource id of the messagestore of the logged-on user.
$groupid
The ID of the group to be changed
$groupname
The name of the group whose information is te be returned

Example 3.95. Changing group information

mapi_zarafa_setgroup($msgstore, 5, "NewName");
		

mapi_zarafa_getgrouplist ()

Get list of all groups

Returns an array of all groups. Each list item is an associative array with the keys 'groupname' and 'groupid'. There are as many items in the returned array as there are groups that are viewable by the user

array mapi_zarafa_getgrouplist(resource $messagestore,
                               int $companyid);
$messagestore
The resource id of the messagestore of the logged-on user.
$companyid
The companyid for which we are requesting the groups (optional)

Example 3.96. Listing groups

$array = mapi_zarafa_getgrouplist($msgstore);
		

mapi_zarafa_creategroup ()

Create a new group.

This function creates a new group with the specified name on the server. After creation, the group will contain no users. Returns TRUE if the group was created successfully, FALSE if the creation failed. You cannot create a group which already exists.

long mapi_zarafa_creategroup(resource $messagestore,
                             string $groupname);
$messagestore
The resource id of the messagestore of the logged-on user.
$groupname
The name of the group to be created.

Example 3.97. Creating a group

$groupid = mapi_zarafa_creategroup($msgstore, "newgroup");
		

mapi_zarafa_deletegroup ()

Delete an existing group.

This function deletes a group on the server. Any users within this group are left untouched. Returns TRUE if the deletion was successful, FALSE if the group could not be deleted (not found).

boolean mapi_zarafa_deletegroup(resource $messagestore,
                                string $groupname);
$messagestore
The resource id of the messagestore of the logged-on user.
$groupname
The name of the group to be created.

Example 3.98. Deleting a group

mapi_zarafa_deletegroup($msgstore,"newgroup");
		

mapi_zarafa_addgroupmember ()

Add a user to a group.

This function adds a user to an existing group. Returns TRUE on success, FALSE on failure (ie unknown user or unknown group)

boolean mapi_zarafa_addgroupmember(resource $messagestore,
                                   int $groupid,
                                   int $userid);
$messagestore
The resource id of the messagestore of the logged-on user.
$groupid
The id of the group to add the user to.
$userid
The id of the user to add to the group.

Example 3.99. Adding a user to a group

mapi_zarafa_addgroupmember($msgstore,$groupid,$userid);
		

mapi_zarafa_deletegroupmember ()

Delete a user from a group.

This function deletes a user from an existing group. Returns TRUE on success, FALSE on failure (ie unknown user or unknown group)

boolean mapi_zarafa_deletegroupmember(resource $messagestore,
                                      int $groupid,
                                      int $userid);
$messagestore
The resource id of the messagestore of the logged-on user.
$groupid
The id of the group to remove the user from.
$userid
The id of the user to remove from the group.

Example 3.100. Deleting a user from a group

mapi_zarafa_deletegroupmember($msgstore,$groupid,$userid);
		

mapi_zarafa_getgrouplistofuser ()

Get a list of groups for a specific user.

This function returns a list of groups in the same way as mapi_zarafa_getgrouplist, but only returns the groups of which the specified user is a member.

array mapi_zarafa_getgrouplistofuser(resource $messagestore,
                                     long $userid);
$messagestore
The resource id of the messagestore of the logged-on user.
$username
The id of the user to be queried.

Example 3.101. Getting groups of a user

$groups = mapi_zarafa_getgrouplistofuser($msgstore,2);
		

mapi_zarafa_getuserlistofgroup ()

Get a list of users for a specific group.

This function returns a list of users in the same way as mapi_zarafa_getuserlist, but only returns the users that are members of the specified group.

array mapi_zarafa_getuserlistofgroup(resource $messagestore,
                                     long $groupid);
$messagestore
The resource id of the messagestore of the logged-on user.
$groupid
The id of the group to be queried.

Example 3.102. Getting users of a group

$groups = mapi_zarafa_getuserlistofgroup($msgstore, 1);
		

mapi_zarafa_createcompany ()

Create a new company.

This function creates a new company with the specified name on the server. After creation, the company will contain no users. Returns TRUE if the company was created successfully, FALSE if the creation failed. You cannot create a company which already exists.

long mapi_zarafa_createcompany(resource $messagestore,
                               string $companyname);
$messagestore
The resource id of the messagestore of the logged-on user.
$companyname
The name of the company to be created.

Example 3.103. Creating a company

$groupid = mapi_zarafa_createcompany($msgstore, "newcompany");
		

mapi_zarafa_deletecompany ()

Delete an existing company.

This function deletes a company on the server. Any users within this company are left untouched. Returns TRUE if the deletion was successful, FALSE if the company could not be deleted (not found).

boolean mapi_zarafa_deletecompany(resource $messagestore,
                                  string $companyname);
$messagestore
The resource id of the messagestore of the logged-on user.
$companyname
The name of the company to be deleted.

Example 3.104. Deleting a company

mapi_zarafa_deletecompany($msgstore,"delcompany");
		

mapi_zarafa_getcompany_by_id ()

Retrieve company information for zarafa company.

Returns an associative array of information for the specified company, or FALSE of the company does not exist or an other error occurred. The associative array contains 'companyid' and 'companyname'.

array mapi_zarafa_getcompany_by_id(resource $messagestore,
                                   int $companyid);
$messagestore
The resource id of the messagestore of the logged-on user.
$companyid
The id of the company whose information is te be returned

Example 3.105. Getting company information

$info = mapi_zarafa_getcompany_by_id($msgstore, 2);

print $info["companyid"];
print $info["companyname"];
		

mapi_zarafa_getcompany_by_name ()

Retrieve company information for zarafa company.

Returns an associative array of information for the specified company, or FALSE of the company does not exist or an other error occurred. The associative array contains 'companyid' and 'companyname'.

array mapi_zarafa_getcompany_by_name(resource $messagestore,
                                     string $company);
$messagestore
The resource id of the messagestore of the logged-on user.
$companyname
The name of the company whose information is te be returned

Example 3.106. Getting company information

$info = mapi_zarafa_getcompany_by_name($msgstore, "default");

print $info["companyid"];
print $info["companyname"];
		

mapi_zarafa_getcompanylist ()

Get list of all companies

Returns an array of all companies on the server.Each list item is an associative array with the keys 'companyname' and 'companyid'. There are as many items in the returned array as there are companies

array mapi_zarafa_getcompanylist(resource $messagestore);
$messagestore
The resource id of the messagestore of the logged-on user.

Example 3.107. Listing companies

$array = mapi_zarafa_getcompanylist($msgstore);
		

mapi_zarafa_add_company_remote_viewlist ()

Add a company to the remote view list of a different company

This will add a company (setcompanyid) to the remote view list of a different company (companyid). This will allow the members of company 'companyid' to view the members of company 'setcompanyid'.

boolean mapi_zarafa_add_company_remote_viewlist(resource $messagestore,
                                                int $setcompanyid,
                                                int $companyid);
$messagestore
The resource id of the messagestore of the logged-on user.
$setcompanyid
The company to be added to the remote view list.
$companyid
The company which remote view list should be edited.

Example 3.108. Add a company to the remote view list of a different company

mapi_zarafa_add_company_remote_viewlist($msgstore, $setcompanyid, $companyid);
		

mapi_zarafa_del_company_remote_viewlist ()

Delete a company from the remote view list of a different company

This will delete a company (setcompanyid) from the remote view list of a different company (companyid). This will prevent the members of company 'companyid' to view the members of company 'setcompanyid'.

boolean mapi_zarafa_del_company_remote_viewlist(resource $messagestore,
                                                int $setcompanyid,
                                                int $companyid);
$messagestore
The resource id of the messagestore of the logged-on user.
$setcompanyid
The company to be deleted from the remote view list.
$companyid
The company which remote view list should be edited.

Example 3.109. Delete a company from the remote view list of a different company

mapi_zarafa_del_company_remote_viewlist($msgstore, $setcompanyid, $companyid);
		

mapi_zarafa_get_remote_viewlist ()

List all companies in the remote view list

This will return the remote view list for the specified company.

array mapi_zarafa_get_remote_viewlist(resource $messagestore,
                                      int $companyid);
$messagestore
The resource id of the messagestore of the logged-on user.
$companyid
The company for which we are requesting the remote view list.

Example 3.110. List all companies in the remote view list

$companies = mapi_zarafa_get_remote_viewlist($msgstore, $companyid);
print_r($companies);
		

mapi_zarafa_add_user_remote_adminlist ()

Add a user to the remote admin list of a company

This will add a user to the remote admin list of a company. This will allow the user to perform administrator tasks over the specified company.

boolean mapi_zarafa_add_user_remote_adminlist(resource $messagestore,
                                              int $userid,
                                              int $companyid);
$messagestore
The resource id of the messagestore of the logged-on user.
$userid
The user to be added to the remote administrator list.
$companyid
The company for which the user will be set as administrator.

Example 3.111. Add a user to the remote admin list of a different company

mapi_zarafa_add_user_remote_adminlist($msgstore, $userid, $companyid);
		

mapi_zarafa_del_user_remote_adminlist ()

Delete a user from the remote admin list of a company

This will delete an user from the remote admin list of a company. This will strip the administrator rights for the user on the specified company.

boolean mapi_zarafa_del_user_remote_adminlist(resource $messagestore,
                                              int $userid,
                                              int $companyid);
$messagestore
The resource id of the messagestore of the logged-on user.
$userid
The user to be deleted from the remote administrator list.
$companyid
The company for which the user will no longer be administrator.

Example 3.112. Delete a user from the admin list of a company

mapi_zarafa_del_user_remote_adminlist($msgstore, $userid, $companyid);
		

mapi_zarafa_get_remote_adminlist ()

List all users in the remote admin list

This will return the remote admin list for the specified company.

array mapi_zarafa_get_remote_adminlist(resource $messagestore,
                                       int $companyid);
$messagestore
The resource id of the messagestore of the logged-on user.
$companyid
The company for which we are requesting the remote admin list.

Example 3.113. List all users in the remote admin list

$users = mapi_zarafa_get_remote_adminlist($msgstore, $companyid);
print_r($users);
		

mapi_zarafa_add_quota_recipient ()

Add a recipient to the recipient list of a company

When a user exceeds his quota, he will receive a warning email. With this function you can edit the list of additional recipients for this email. With the type argument you can set if the recipient list of userquota or companyquota warnings should be edited.

boolean mapi_zarafa_add_quota_recipient(resource $messagestore,
                                        int $companyid,
                                        int $recipient,
                                        int $type);
$messagestore
The resource id of the messagestore of the logged-on user.
$companyid
The company for which to edit the recipientlist.
$recipientid
The user to be added to the recipientlist.
$type
The recipientlist type (USEROBJECT_TYPE_USER or USEROBJECT_TYPE_COMPANY).

Example 3.114. Add a recipient to the recipient list of a company

mapi_zarafa_add_quota_recipient($msgstore, $companyid, $recipientid, USEROBJECT_TYPE_COMPANY);
		

mapi_zarafa_del_quota_recipient ()

Delete a recipient from the recipient list of a company

When a user exceeds his quota, he will receive a warning email. With this function you can edit the list of additional recipients for this email. With the type argument you can set if the recipient list of userquota or companyquota warnings should be edited.

boolean mapi_zarafa_del_quota_recipient(resource $messagestore,
                                        int $companyid,
                                        int $recipientid,
                                        int $type);
$messagestore
The resource id of the messagestore of the logged-on user.
$companyid
The company for which to edit the recipientlist.
$recipientid
The user to be removed from the recipientlist.
$type
The recipientlist type (USEROBJECT_TYPE_USER or USEROBJECT_TYPE_COMPANY).

Example 3.115. Delete a recipient from the recipient list of a company

mapi_zarafa_del_quota_recipient($msgstore, $companyid, $userid, USEROBJECT_TYPE_COMPANY);
		

mapi_zarafa_get_quota_recipientlist ()

List all users in the recipient list

When a user exceeds his quota, he will receive a warning email. With this function you can request the list of additional recipients for this email. The userid as argument can either be a userid or companyid.

array mapi_zarafa_get_quota_recipientlist(resource $messagestore,
                                          int $userid);
$messagestore
The resource id of the messagestore of the logged-on user.
$userid
The user for which we are requesting the recipientlist.

Example 3.116. List all users in the recipient list

$users = mapi_zarafa_get_quota_recipientlist($msgstore, $userid);
print_r($users);
		

mapi_zarafa_getpermissionrules ()

Get a list of ACLs from an object.

This function returns an array of set ACLs of the requested type.

The type field is one of: ACCESS_TYPE_DENIED, ACCESS_TYPE_GRANT, ACCESS_TYPE_BOTH,

The 'rights' field in the array is the access value. These values are defined in the ecRights* defines, found in include/mapidefs.php. The values are bitwise OR-ed. 1531 == 0x5FB == ecRightsAll.

The state field is one of: RIGHT_NORMAL, RIGHT_NEW, RIGHT_MODIFY, RIGHT_DELETED, RIGHT_AUTOUPDATE_DENIED, . In the mapi_zarafa_getpermissionrules(), only RIGHT_NORMAL is returned.

array mapi_zarafa_getpermissionrules(resource $mapiobject,
                                     long $acl_type);
$mapiobject

This is a mapi object. It can be a store, folder, message or attachment.

Note: Only ACLs on the store and on a folder work.

$acl_type
The ACL type to query. This is one of: ACCESS_TYPE_DENIED, ACCESS_TYPE_GRANT, ACCESS_TYPE_BOTH,

Example 3.117. Getting the ACL list of the store.

$acls = mapi_zarafa_getpermissionrules($msgstore, ACCESS_TYPE_GRANT);
print_r($acls);
		

Output:

Array
(
    [0] => Array
        (
            [userid] => 4
            [type] => 2
            [rights] => 1531
            [state] => 0
        )

)
		

mapi_zarafa_setpermissionrules ()

Set a list of ACLs on an object.

This function sets returns an array of set ACLs of the requested type.

Each entry contains the following fields: userid, type, rights, state, .

Userid
This is an id from a user. Use mapi_getuserlist() to get all valid users.
Type
Type is one off: ACCESS_TYPE_DENIED, ACCESS_TYPE_GRANT, ACCESS_TYPE_BOTH, .
Rights
Rights is an OR-ed value, by ecRights* defines, found in include/mapi/mapidefs.php.
State
State is one of: RIGHT_NEW, RIGHT_MODIFY, RIGHT_DELETED, . RIGHT_NORMAL is not used, since it is no update action. RIGHT_AUTOUPDATE_DENIED can be OR-ed to an action to automatically set the inverted DENY action.

boolean mapi_zarafa_setpermissionrules(resource $mapiobject,
                                       array $acls);
$mapiobject

This is a mapi object. It can be a store, folder, message or attachment.

Note: Only ACLs on the store and on a folder work.

$acls
An Array containing ACL settings.

Example 3.118. Setting the ACL list on the inbox.

$acls = array( 0 => array(
		'userid'	=> 3,
		'type'		=> ACCESS_TYPE_GRANT,
		'rights'	=> ecRightsFullControl,
		'state'		=> RIGHT_NEW | RIGHT_AUTOUPDATE_DENIED
	)
);

$ret = mapi_zarafa_setpermissionrules($inbox, $acls);