| Server IP : 213.186.33.4 / Your IP : 216.73.216.193 Web Server : Apache System : Linux webm006.cluster103.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : awebpaca ( 35430) PHP Version : 8.5.0 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/a/w/e/awebpaca/Dolibarr/htdocs/includes/sabre/sabre/dav/tests/Sabre/DAV/Mock/ |
Upload File : |
<?php
namespace Sabre\DAV\Mock;
use Sabre\DAV\Sharing\ISharedNode;
use Sabre\DAV\Sharing\Sharee;
class SharedNode extends \Sabre\DAV\Node implements ISharedNode {
protected $name;
protected $access;
protected $invites = [];
function __construct($name, $access) {
$this->name = $name;
$this->access = $access;
}
function getName() {
return $this->name;
}
/**
* Returns the 'access level' for the instance of this shared resource.
*
* The value should be one of the Sabre\DAV\Sharing\Plugin::ACCESS_
* constants.
*
* @return int
*/
function getShareAccess() {
return $this->access;
}
/**
* This function must return a URI that uniquely identifies the shared
* resource. This URI should be identical across instances, and is
* also used in several other XML bodies to connect invites to
* resources.
*
* This may simply be a relative reference to the original shared instance,
* but it could also be a urn. As long as it's a valid URI and unique.
*
* @return string
*/
function getShareResourceUri() {
return 'urn:example:bar';
}
/**
* Updates the list of sharees.
*
* Every item must be a Sharee object.
*
* @param Sharee[] $sharees
* @return void
*/
function updateInvites(array $sharees) {
foreach ($sharees as $sharee) {
if ($sharee->access === \Sabre\DAV\Sharing\Plugin::ACCESS_NOACCESS) {
// Removal
foreach ($this->invites as $k => $invitee) {
if ($invitee->href = $sharee->href) {
unset($this->invites[$k]);
}
}
} else {
foreach ($this->invites as $k => $invitee) {
if ($invitee->href = $sharee->href) {
if (!$sharee->inviteStatus) {
$sharee->inviteStatus = $invitee->inviteStatus;
}
// Overwriting an existing invitee
$this->invites[$k] = $sharee;
continue 2;
}
}
if (!$sharee->inviteStatus) {
$sharee->inviteStatus = \Sabre\DAV\Sharing\Plugin::INVITE_NORESPONSE;
}
// Adding a new invitee
$this->invites[] = $sharee;
}
}
}
/**
* Returns the list of people whom this resource is shared with.
*
* Every item in the returned array must be a Sharee object with
* at least the following properties set:
*
* * $href
* * $shareAccess
* * $inviteStatus
*
* and optionally:
*
* * $properties
*
* @return \Sabre\DAV\Xml\Element\Sharee[]
*/
function getInvites() {
return $this->invites;
}
}