Manager¶
-
class
OC\Share20\Manager¶ - This class is the communication hub for all sharing related operations.
Source: lib/private/Share20/Manager.php#79 Implements: OCP\Share\IManager
Properties¶
Methods¶
-
public
OC\Share20\Manager::__construct($logger, $config, $secureRandom, $hasher, $mountManager, $groupManager, $l, $l10nFactory, $factory, $userManager, $rootFolder, $legacyDispatcher, $mailer, $urlGenerator, $defaults, $dispatcher)¶ - Manager constructor.
Source: Parameters: - $logger (
OCP\ILogger) - $config (
OCP\IConfig) - $secureRandom (
OCP\Security\ISecureRandom) - $hasher (
OCP\Security\IHasher) - $mountManager (
OCP\Files\Mount\IMountManager) - $groupManager (
OCP\IGroupManager) - $l (
OCP\IL10N) - $l10nFactory (
OCP\L10N\IFactory) - $factory (
OCP\Share\IProviderFactory) - $userManager (
OCP\IUserManager) - $rootFolder (
OCP\Files\IRootFolder) - $mailer (
OCP\Mail\IMailer) - $urlGenerator (
OCP\IURLGenerator) - $defaults (
OC_Defaults)
- $logger (
-
protected
OC\Share20\Manager::verifyPassword($password)¶ - Verify if a password meets all requirements
Source: Parameters: - $password (string)
Throws: \Exception
-
protected
OC\Share20\Manager::generalCreateChecks($share)¶ - Check for generic requirements before creating a share
Source: Parameters: - $share (
OCP\Share\IShare)
Throws: \InvalidArgumentExceptionThrows: Throws: \InvalidArgumentExceptionThrows: - $share (
-
protected
OC\Share20\Manager::validateExpirationDateInternal($share)¶ - Validate if the expiration date fits the system settings
Source: Parameters: - $share (
OCP\Share\IShare) The share to validate the expiration date of
Returns: \OCP\Share\IShareThe modified share objectThrows: Throws: \InvalidArgumentExceptionThrows: \ExceptionThrows: Throws: \InvalidArgumentExceptionThrows: \ExceptionThrows: Throws: \InvalidArgumentExceptionThrows: \Exception - $share (
-
protected
OC\Share20\Manager::validateExpirationDateLink($share)¶ - Validate if the expiration date fits the system settings
Source: Parameters: - $share (
OCP\Share\IShare) The share to validate the expiration date of
Returns: \OCP\Share\IShareThe modified share objectThrows: Throws: \InvalidArgumentExceptionThrows: \ExceptionThrows: Throws: \InvalidArgumentExceptionThrows: \ExceptionThrows: Throws: \InvalidArgumentExceptionThrows: \Exception - $share (
-
protected
OC\Share20\Manager::userCreateChecks($share)¶ - Check for pre share requirements for user shares
Source: Parameters: - $share (
OCP\Share\IShare)
Throws: \Exception - $share (
-
protected
OC\Share20\Manager::groupCreateChecks($share)¶ - Check for pre share requirements for group shares
Source: Parameters: - $share (
OCP\Share\IShare)
Throws: \Exception - $share (
-
protected
OC\Share20\Manager::linkCreateChecks($share)¶ - Check for pre share requirements for link shares
Source: Parameters: - $share (
OCP\Share\IShare)
Throws: \Exception - $share (
-
protected
OC\Share20\Manager::setLinkParent($share)¶ - To make sure we don’t get invisible link shares we set the parentof a link if it is a reshare. This is a quick word arounduntil we can properly display multiple link shares in the UIFIXME: Remove once multiple link shares can be properly displayed
Source: Parameters: - $share (
OCP\Share\IShare)
- $share (
-
protected
OC\Share20\Manager::pathCreateChecks($path)¶ Source: Parameters: - $path (
OCP\Files\File|\OCP\Files\Folder)
- $path (
-
protected
OC\Share20\Manager::canShare($share)¶ - Check if the user that is sharing can actually share
Source: Parameters: - $share (
OCP\Share\IShare)
Throws: \Exception - $share (
-
public
OC\Share20\Manager::createShare($share)¶ - Share a path
Source: Parameters: - $share (
OCP\Share\IShare)
Returns: \OCP\Share\IShareThe share objectThrows: \ExceptionTODO: handle link share permissions or check them - $share (
-
protected
OC\Share20\Manager::sendMailNotification($l, $filename, $link, $initiator, $shareWith, $expiration=null)¶ - Send mail notificationsThis method will catch and log mail transmission errors
Source: Parameters: - $l (
OCP\IL10N) Language of the recipient - $filename (string) file/folder name
- $link (string) link to the file/folder
- $initiator (string) user ID of share sender
- $shareWith (string) email address of share receiver
- $expiration (
DateTime| null)
- $l (
-
public
OC\Share20\Manager::updateShare($share)¶ - Update a share
Source: Parameters: - $share (
OCP\Share\IShare)
Returns: \OCP\Share\IShareThe share objectThrows: \InvalidArgumentException - $share (
-
public
OC\Share20\Manager::acceptShare($share, $recipientId)¶ - Accept a share.
Source: Parameters: - $share (
OCP\Share\IShare) - $recipientId (string)
Returns: \OCP\Share\IShareThe share objectThrows: \InvalidArgumentExceptionSince: 9.0.0
- $share (
-
protected
OC\Share20\Manager::deleteChildren($share)¶ - Delete all the children of this shareFIXME: remove once https://github.com/owncloud/core/pull/21660 is in
Source: Parameters: - $share (
OCP\Share\IShare)
Returns: \OCP\Share\IShare[]List of deleted shares - $share (
-
public
OC\Share20\Manager::deleteShare($share)¶ - Delete a share
Source: Parameters: - $share (
OCP\Share\IShare)
Throws: Throws: \InvalidArgumentExceptionThrows: Throws: \InvalidArgumentException - $share (
-
public
OC\Share20\Manager::deleteFromSelf($share, $recipientId)¶ - Unshare a file as the recipient.This can be different from a regular delete for example when one ofthe users in a groups deletes that share. But the provider shouldhandle this.
Source: Parameters: - $share (
OCP\Share\IShare) - $recipientId (string)
- $share (
-
public
OC\Share20\Manager::restoreShare($share, $recipientId)¶ Source: lib/private/Share20/Manager.php#1236
-
public
OC\Share20\Manager::moveShare($share, $recipientId)¶ Source: lib/private/Share20/Manager.php#1246
-
public
OC\Share20\Manager::getSharesInFolder($userId, $node, $reshares=false)¶ Source: lib/private/Share20/Manager.php#1273
-
public
OC\Share20\Manager::getSharesBy($userId, $shareType, $path=null, $reshares=false, $limit=50, $offset=0)¶ Source: lib/private/Share20/Manager.php#1292
-
public
OC\Share20\Manager::getSharedWith($userId, $shareType, $node=null, $limit=50, $offset=0)¶ Source: lib/private/Share20/Manager.php#1365
-
public
OC\Share20\Manager::getDeletedSharedWith($userId, $shareType, $node=null, $limit=50, $offset=0)¶ Source: lib/private/Share20/Manager.php#1389
-
public
OC\Share20\Manager::getShareById($id, $recipient=null)¶ Source: lib/private/Share20/Manager.php#1408
-
public
OC\Share20\Manager::getSharesByPath($path, $page=0, $perPage=50)¶ - Get all the shares for a given path
Source: Parameters: - $path (
OCP\Files\Node) - $page (int)
- $perPage (int)
Returns: - $path (
-
public
OC\Share20\Manager::getShareByToken($token)¶ - Get the share by token possible with password
Source: Parameters: - $token (string)
Returns: Throws:
-
protected
OC\Share20\Manager::checkExpireDate($share)¶ Source: lib/private/Share20/Manager.php#1520
-
public
OC\Share20\Manager::checkPassword($share, $password)¶ - Verify the password of a public share
Source: Parameters: - $share (
OCP\Share\IShare) - $password (string)
Returns: bool
- $share (
-
public
OC\Share20\Manager::userDeleted($uid)¶ Source: lib/private/Share20/Manager.php#1564
-
public
OC\Share20\Manager::groupDeleted($gid)¶ Source: lib/private/Share20/Manager.php#1580
-
public
OC\Share20\Manager::userDeletedFromGroup($uid, $gid)¶ Source: lib/private/Share20/Manager.php#1601
-
public
OC\Share20\Manager::getAccessList($path, $recursive=true, $currentAccess=false)¶ - Get access list to a path. This meansall the users that can access a given path.Consider:-root|-folder1 (23)|-folder2 (32)|-fileA (42)fileA is shared with user1 and user1@server1folder2 is shared with group2 (user4 is a member of group2)folder1 is shared with user2 (renamed to “folder (1)”) and user2@server2Then 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 => boolmail => bool]The access list to ‘/folder1/folder2/fileA’ **without** $currentAccess is:[users => [‘user1’, ‘user2’, ‘user4’],remote => bool,public => boolmail => bool]This is required for encryption/activity
Source: Parameters: - $path (
OCP\Files\Node) - $recursive (bool) Should we check all parent folders as well
- $currentAccess (bool) Ensure the recipient has access to the file (e.g. did not unshare it)
Returns: array
- $path (
-
public
OC\Share20\Manager::newShare()¶ - Create a new share
Source: lib/private/Share20/Manager.php#1740 Returns: \OCP\Share\IShare
-
public
OC\Share20\Manager::shareApiEnabled()¶ - Is the share API enabled
Source: lib/private/Share20/Manager.php#1749 Returns: bool
-
public
OC\Share20\Manager::shareApiAllowLinks()¶ - Is public link sharing enabled
Source: lib/private/Share20/Manager.php#1758 Returns: bool
-
public
OC\Share20\Manager::shareApiLinkEnforcePassword()¶ - Is password on public link requires
Source: lib/private/Share20/Manager.php#1767 Returns: bool
-
public
OC\Share20\Manager::shareApiLinkDefaultExpireDate()¶ - Is default link expire date enabled
Source: lib/private/Share20/Manager.php#1776 Returns: bool
-
public
OC\Share20\Manager::shareApiLinkDefaultExpireDateEnforced()¶ - Is default link expire date enforced`
Source: lib/private/Share20/Manager.php#1785 Returns: bool
-
public
OC\Share20\Manager::shareApiLinkDefaultExpireDays()¶ - Number of default link expire days
Source: lib/private/Share20/Manager.php#1795 Returns: int
-
public
OC\Share20\Manager::shareApiInternalDefaultExpireDate()¶ - Is default internal expire date enabled
Source: lib/private/Share20/Manager.php#1804 Returns: bool
-
public
OC\Share20\Manager::shareApiRemoteDefaultExpireDate()¶ - Is default remote expire date enabled
Source: lib/private/Share20/Manager.php#1813 Returns: bool
-
public
OC\Share20\Manager::shareApiInternalDefaultExpireDateEnforced()¶ - Is default expire date enforced
Source: lib/private/Share20/Manager.php#1822 Returns: bool
-
public
OC\Share20\Manager::shareApiRemoteDefaultExpireDateEnforced()¶ - Is default expire date enforced for remote shares
Source: lib/private/Share20/Manager.php#1832 Returns: bool
-
public
OC\Share20\Manager::shareApiInternalDefaultExpireDays()¶ - Number of default expire days
Source: lib/private/Share20/Manager.php#1841 Returns: int
-
public
OC\Share20\Manager::shareApiRemoteDefaultExpireDays()¶ - Number of default expire days for remote shares
Source: lib/private/Share20/Manager.php#1849 Returns: int
-
public
OC\Share20\Manager::shareApiLinkAllowPublicUpload()¶ - Allow public upload on link shares
Source: lib/private/Share20/Manager.php#1858 Returns: bool
-
public
OC\Share20\Manager::shareWithGroupMembersOnly()¶ - check if user can only share with group members
Source: lib/private/Share20/Manager.php#1866 Returns: bool
-
public
OC\Share20\Manager::allowGroupSharing()¶ - Check if users can share with groups
Source: lib/private/Share20/Manager.php#1874 Returns: bool
-
public
OC\Share20\Manager::allowEnumeration()¶ Source: lib/private/Share20/Manager.php#1878
-
public
OC\Share20\Manager::limitEnumerationToGroups()¶ Source: lib/private/Share20/Manager.php#1882
-
public
OC\Share20\Manager::limitEnumerationToPhone()¶ Source: lib/private/Share20/Manager.php#1887
-
public
OC\Share20\Manager::allowEnumerationFullMatch()¶ Source: lib/private/Share20/Manager.php#1892
-
public
OC\Share20\Manager::sharingDisabledForUser($userId)¶ - Copied from \OC_Util::isSharingDisabledForUserTODO: Deprecate fuction from OC_Util
Source: Parameters: - $userId (string)
Returns: bool
-
public
OC\Share20\Manager::outgoingServer2ServerSharesAllowed()¶ Source: lib/private/Share20/Manager.php#1941
-
public
OC\Share20\Manager::outgoingServer2ServerGroupSharesAllowed()¶ Source: lib/private/Share20/Manager.php#1948
-
public
OC\Share20\Manager::shareProviderExists($shareType)¶ Source: lib/private/Share20/Manager.php#1955
-
public
OC\Share20\Manager::registerShareProvider($shareProviderClass)¶ Source: lib/private/Share20/Manager.php#1965
-
public
OC\Share20\Manager::getAllShares()¶ Source: lib/private/Share20/Manager.php#1969