IManager
in
This interface allows to manage sharing files between users and groups.
This interface must not be implemented in your application but instead should be used as a service and injected in your code with dependency injection.
Tags
Table of Contents
Methods
- acceptShare() : IShare
- Accept a share.
- allowEnumeration() : bool
- Check if user enumeration is allowed
- allowEnumerationFullMatch() : bool
- Check if user enumeration is allowed to return on full match
- allowGroupSharing() : bool
- Check if users can share with groups
- checkPassword() : bool
- Verify the password of a public share
- createShare() : IShare
- Create a Share
- currentUserCanEnumerateTargetUser() : bool
- Check if the current user can enumerate the target user
- deleteFromSelf() : mixed
- Unshare a file as the recipient.
- deleteShare() : mixed
- Delete a share
- getAccessList() : array<string|int, mixed>
- Get access list to a path. This means all the users that can access a given path.
- getAllShares() : iterable<string|int, mixed>
- getDeletedSharedWith() : array<string|int, IShare>
- Get deleted shares shared with $user.
- getShareById() : IShare
- Retrieve a share by the share id.
- getShareByToken() : IShare
- Get the share by token possible with password
- getSharedWith() : array<string|int, IShare>
- Get shares shared with $user.
- getSharesBy() : array<string|int, IShare>
- Get shares shared by (initiated) by the provided user.
- getSharesInFolder() : array<string|int, array<string|int, IShare>>
- Get all shares shared by (initiated) by the provided user in a folder.
- groupDeleted() : mixed
- The group with $gid is deleted We need to clear up all shares to this group
- ignoreSecondDisplayName() : bool
- Check if the search should ignore the second in parentheses display name if there is any
- limitEnumerationToGroups() : bool
- Check if user enumeration is limited to the users groups
- limitEnumerationToPhone() : bool
- Check if user enumeration is limited to the phonebook matches
- matchEmail() : bool
- Check if the search should match the email
- moveShare() : IShare
- Move the share as a recipient of the share.
- newShare() : IShare
- Instantiates a new share object. This is to be passed to createShare.
- outgoingServer2ServerGroupSharesAllowed() : bool
- Check if outgoing server2server shares are allowed
- outgoingServer2ServerSharesAllowed() : bool
- Check if outgoing server2server shares are allowed
- registerShareProvider() : void
- restoreShare() : IShare
- Restore the share when it has been deleted Certain share types can be restored when they have been deleted but the provider should properly handle this\
- shareApiAllowLinks() : bool
- Is public link sharing enabled
- shareApiEnabled() : bool
- Is the share API enabled
- shareApiInternalDefaultExpireDate() : bool
- Is default internal expire date enabled
- shareApiInternalDefaultExpireDateEnforced() : bool
- Is default expire date enforced
- shareApiInternalDefaultExpireDays() : int
- Number of default expire days
- shareApiLinkAllowPublicUpload() : bool
- Allow public upload on link shares
- shareApiLinkDefaultExpireDate() : bool
- Is default expire date enabled
- shareApiLinkDefaultExpireDateEnforced() : bool
- Is default expire date enforced `
- shareApiLinkDefaultExpireDays() : int
- Number of default expire days
- shareApiLinkEnforcePassword() : bool
- Is password on public link required
- shareApiRemoteDefaultExpireDate() : bool
- Is default remote expire date enabled
- shareApiRemoteDefaultExpireDateEnforced() : bool
- Is default expire date enforced for remote shares
- shareApiRemoteDefaultExpireDays() : int
- Number of default expire days for remote shares
- shareProviderExists() : bool
- Check if a given share provider exists
- shareWithGroupMembersOnly() : bool
- check if user can only share with group members
- shareWithGroupMembersOnlyExcludeGroupsList() : array<string|int, mixed>
- If shareWithGroupMembersOnly is enabled, return an optional list of groups that must be excluded from the principle of belonging to the same group.
- sharingDisabledForUser() : bool
- Check if sharing is disabled for the given user
- updateShare() : IShare
- Update a share.
- userDeleted() : mixed
- The user with UID is deleted.
- userDeletedFromGroup() : mixed
- The user $uid is deleted from the group $gid All user specific group shares have to be removed
Methods
acceptShare()
Accept a share.
public
acceptShare(IShare $share, string $recipientId) : IShare
Parameters
- $share : IShare
- $recipientId : string
Tags
Return values
IShare —The share object
allowEnumeration()
Check if user enumeration is allowed
public
allowEnumeration() : bool
Tags
Return values
boolallowEnumerationFullMatch()
Check if user enumeration is allowed to return on full match
public
allowEnumerationFullMatch() : bool
Tags
Return values
boolallowGroupSharing()
Check if users can share with groups
public
allowGroupSharing() : bool
Tags
Return values
boolcheckPassword()
Verify the password of a public share
public
checkPassword(IShare $share, string|null $password) : bool
Parameters
- $share : IShare
- $password : string|null
Tags
Return values
boolcreateShare()
Create a Share
public
createShare(IShare $share) : IShare
Parameters
- $share : IShare
Tags
Return values
IShare —The share object
currentUserCanEnumerateTargetUser()
Check if the current user can enumerate the target user
public
currentUserCanEnumerateTargetUser(IUser|null $currentUser, IUser $targetUser) : bool
Parameters
Tags
Return values
booldeleteFromSelf()
Unshare a file as the recipient.
public
deleteFromSelf(IShare $share, string $recipientId) : mixed
This can be different from a regular delete for example when one of the users in a groups deletes that share. But the provider should handle this.
Parameters
- $share : IShare
- $recipientId : string
Tags
deleteShare()
Delete a share
public
deleteShare(IShare $share) : mixed
Parameters
- $share : IShare
Tags
getAccessList()
Get access list to a path. This means all the users that can access a given path.
public
getAccessList(Node $path[, bool $recursive = true ][, bool $currentAccess = false ]) : array<string|int, mixed>
Consider: -root |-folder1 (23) |-folder2 (32) |-fileA (42)
fileA is shared with user1 and user1@server1 and email1@maildomain1 folder2 is shared with group2 (user4 is a member of group2) folder1 is shared with user2 (renamed to "folder (1)") and user2@server2 and email2@maildomain2
Then the access list to '/folder1/folder2/fileA' with $currentAccess is: [ users => [ 'user1' => ['node_id' => 42, 'node_path' => '/fileA'], 'user4' => ['node_id' => 32, 'node_path' => '/folder2'], 'user2' => ['node_id' => 23, 'node_path' => '/folder (1)'], ], remote => [ 'user1@server1' => ['node_id' => 42, 'token' => 'SeCr3t'], 'user2@server2' => ['node_id' => 23, 'token' => 'FooBaR'], ], public => bool mail => [ 'email1@maildomain1' => ['node_id' => 42, 'token' => 'aBcDeFg'], 'email2@maildomain2' => ['node_id' => 23, 'token' => 'hIjKlMn'], ]
The access list to '/folder1/folder2/fileA' without $currentAccess is: [ users => ['user1', 'user2', 'user4'], remote => bool, public => bool mail => ['email1@maildomain1', 'email2@maildomain2'] ]
This is required for encryption/activity
Parameters
- $path : Node
- $recursive : bool = true
-
Should we check all parent folders as well
- $currentAccess : bool = false
-
Should the user have currently access to the file
Tags
Return values
array<string|int, mixed>getAllShares()
public
getAllShares() : iterable<string|int, mixed>
Tags
Return values
iterable<string|int, mixed>getDeletedSharedWith()
Get deleted shares shared with $user.
public
getDeletedSharedWith(string $userId, int $shareType[, Node|null $node = null ][, int $limit = 50 ][, int $offset = 0 ]) : array<string|int, IShare>
Filter by $node if provided
Parameters
- $userId : string
- $shareType : int
- $node : Node|null = null
- $limit : int = 50
-
The maximum number of shares returned, -1 for all
- $offset : int = 0
Tags
Return values
array<string|int, IShare>getShareById()
Retrieve a share by the share id.
public
getShareById(string $id[, string|null $recipient = null ]) : IShare
If the recipient is set make sure to retrieve the file for that user. This makes sure that if a user has moved/deleted a group share this is reflected.
Parameters
- $id : string
- $recipient : string|null = null
-
userID of the recipient
Tags
Return values
ISharegetShareByToken()
Get the share by token possible with password
public
getShareByToken(string $token) : IShare
Parameters
- $token : string
Tags
Return values
ISharegetSharedWith()
Get shares shared with $user.
public
getSharedWith(string $userId, int $shareType[, Node|null $node = null ][, int $limit = 50 ][, int $offset = 0 ]) : array<string|int, IShare>
Filter by $node if provided
Parameters
- $userId : string
- $shareType : int
- $node : Node|null = null
- $limit : int = 50
-
The maximum number of shares returned, -1 for all
- $offset : int = 0
Tags
Return values
array<string|int, IShare>getSharesBy()
Get shares shared by (initiated) by the provided user.
public
getSharesBy(string $userId, int $shareType[, Node|null $path = null ][, bool $reshares = false ][, int $limit = 50 ][, int $offset = 0 ]) : array<string|int, IShare>
Parameters
- $userId : string
- $shareType : int
- $path : Node|null = null
- $reshares : bool = false
- $limit : int = 50
-
The maximum number of returned results, -1 for all results
- $offset : int = 0
Tags
Return values
array<string|int, IShare>getSharesInFolder()
Get all shares shared by (initiated) by the provided user in a folder.
public
getSharesInFolder(string $userId, Folder $node[, bool $reshares = false ][, bool $shallow = true ]) : array<string|int, array<string|int, IShare>>
Parameters
- $userId : string
- $node : Folder
- $reshares : bool = false
- $shallow : bool = true
-
Whether the method should stop at the first level, or look into sub-folders.
Tags
Return values
array<string|int, array<string|int, IShare>> —[$fileId => IShare[], ...]
groupDeleted()
The group with $gid is deleted We need to clear up all shares to this group
public
groupDeleted(string $gid) : mixed
Parameters
- $gid : string
Tags
ignoreSecondDisplayName()
Check if the search should ignore the second in parentheses display name if there is any
public
ignoreSecondDisplayName() : bool
Tags
Return values
boollimitEnumerationToGroups()
Check if user enumeration is limited to the users groups
public
limitEnumerationToGroups() : bool
Tags
Return values
boollimitEnumerationToPhone()
Check if user enumeration is limited to the phonebook matches
public
limitEnumerationToPhone() : bool
Tags
Return values
boolmatchEmail()
Check if the search should match the email
public
matchEmail() : bool
Tags
Return values
boolmoveShare()
Move the share as a recipient of the share.
public
moveShare(IShare $share, string $recipientId) : IShare
This is updating the share target. So where the recipient has the share mounted.
Parameters
- $share : IShare
- $recipientId : string
Tags
Return values
ISharenewShare()
Instantiates a new share object. This is to be passed to createShare.
public
newShare() : IShare
Tags
Return values
IShareoutgoingServer2ServerGroupSharesAllowed()
Check if outgoing server2server shares are allowed
public
outgoingServer2ServerGroupSharesAllowed() : bool
Tags
Return values
booloutgoingServer2ServerSharesAllowed()
Check if outgoing server2server shares are allowed
public
outgoingServer2ServerSharesAllowed() : bool
Tags
Return values
boolregisterShareProvider()
public
registerShareProvider(string $shareProviderClass) : void
Parameters
- $shareProviderClass : string
Tags
restoreShare()
Restore the share when it has been deleted Certain share types can be restored when they have been deleted but the provider should properly handle this\
public
restoreShare(IShare $share, string $recipientId) : IShare
Parameters
- $share : IShare
-
The share to restore
- $recipientId : string
-
The user to restore the share for
Tags
Return values
IShare —The restored share object
shareApiAllowLinks()
Is public link sharing enabled
public
shareApiAllowLinks() : bool
Tags
Return values
boolshareApiEnabled()
Is the share API enabled
public
shareApiEnabled() : bool
Tags
Return values
boolshareApiInternalDefaultExpireDate()
Is default internal expire date enabled
public
shareApiInternalDefaultExpireDate() : bool
Tags
Return values
boolshareApiInternalDefaultExpireDateEnforced()
Is default expire date enforced
public
shareApiInternalDefaultExpireDateEnforced() : bool
Tags
Return values
boolshareApiInternalDefaultExpireDays()
Number of default expire days
public
shareApiInternalDefaultExpireDays() : int
Tags
Return values
intshareApiLinkAllowPublicUpload()
Allow public upload on link shares
public
shareApiLinkAllowPublicUpload() : bool
Tags
Return values
boolshareApiLinkDefaultExpireDate()
Is default expire date enabled
public
shareApiLinkDefaultExpireDate() : bool
Tags
Return values
boolshareApiLinkDefaultExpireDateEnforced()
Is default expire date enforced `
public
shareApiLinkDefaultExpireDateEnforced() : bool
Tags
Return values
boolshareApiLinkDefaultExpireDays()
Number of default expire days
public
shareApiLinkDefaultExpireDays() : int
Tags
Return values
intshareApiLinkEnforcePassword()
Is password on public link required
public
shareApiLinkEnforcePassword([bool $checkGroupMembership = true ]) : bool
Parameters
- $checkGroupMembership : bool = true
-
Check group membership exclusion
Tags
Return values
boolshareApiRemoteDefaultExpireDate()
Is default remote expire date enabled
public
shareApiRemoteDefaultExpireDate() : bool
Tags
Return values
boolshareApiRemoteDefaultExpireDateEnforced()
Is default expire date enforced for remote shares
public
shareApiRemoteDefaultExpireDateEnforced() : bool
Tags
Return values
boolshareApiRemoteDefaultExpireDays()
Number of default expire days for remote shares
public
shareApiRemoteDefaultExpireDays() : int
Tags
Return values
intshareProviderExists()
Check if a given share provider exists
public
shareProviderExists(int $shareType) : bool
Parameters
- $shareType : int
Tags
Return values
boolshareWithGroupMembersOnly()
check if user can only share with group members
public
shareWithGroupMembersOnly() : bool
Tags
Return values
boolshareWithGroupMembersOnlyExcludeGroupsList()
If shareWithGroupMembersOnly is enabled, return an optional list of groups that must be excluded from the principle of belonging to the same group.
public
shareWithGroupMembersOnlyExcludeGroupsList() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>sharingDisabledForUser()
Check if sharing is disabled for the given user
public
sharingDisabledForUser(string $userId) : bool
Parameters
- $userId : string
Tags
Return values
boolupdateShare()
Update a share.
public
updateShare(IShare $share) : IShare
The target of the share can't be changed this way: use moveShare The share can't be removed this way (permission 0): use deleteShare The state can't be changed this way: use acceptShare
Parameters
- $share : IShare
Tags
Return values
IShare —The share object
userDeleted()
The user with UID is deleted.
public
userDeleted(string $uid) : mixed
All share providers have to cleanup the shares with this user as well as shares owned by this user. Shares only initiated by this user are fine.
Parameters
- $uid : string
Tags
userDeletedFromGroup()
The user $uid is deleted from the group $gid All user specific group shares have to be removed
public
userDeletedFromGroup(string $uid, string $gid) : mixed
Parameters
- $uid : string
- $gid : string