5 require_once
'libs/composer/vendor/autoload.php';
7 require_once
'Services/WebDAV/classes/lock/class.ilWebDAVLockObject.php';
8 require_once
'Services/WebDAV/classes/db/class.ilWebDAVDBManager.php';
9 require_once
'Services/WebDAV/classes/tree/class.ilWebDAVUriPathResolver.php';
10 require_once
'Services/WebDAV/classes/class.ilWebDAVRepositoryHelper.php';
11 require_once
'Services/WebDAV/classes/class.ilWebDAVObjDAVHelper.php';
51 $this->
user = $DIC->user();
61 public function getLocks($uri, $returnChildLocks)
63 $sabre_locks = array();
67 $ref_id = $this->uri_path_resolver->getRefIdForWebDAVPath($uri);
69 $obj_id = $this->repo_helper->getObjectIdFromRefId($ref_id);
72 if ($lock_on_obj !=
false) {
73 $sabre_locks[] = $lock_on_obj->getAsSabreDavLock($uri);
77 if ($returnChildLocks) {
97 foreach ($this->repo_helper->getChildrenOfRefId($ref_id) as $child_ref) {
99 $child_obj_id = $this->repo_helper->getObjectIdFromRefId($child_ref);
100 if ($this->obj_dav_helper->isDAVableObject($child_obj_id,
false)) {
102 $title = $this->repo_helper->getObjectTitleFromObjId($child_obj_id,
true);
104 if ($child_ilias_locks !=
false) {
105 foreach ($child_ilias_locks as $lock) {
106 $sabre_locks[] = $lock->getAsSabreDavLock($uri .
'/' .
$title);
124 $ilias_lock = $this->db_manager->getLockObjectWithTokenFromDB($lockInfo->token);
126 if ($ilias_lock && $ilias_lock->getIliasOwner() == $this->
user->getId()) {
127 $this->db_manager->removeLockWithTokenFromDB($lockInfo->token);
129 throw new Exception\Forbidden();
142 $ref_id = $this->uri_path_resolver->getRefIdForWebDAVPath($uri);
144 if ($ref_id > 0 && $this->repo_helper->checkAccess(
'write', $ref_id)) {
145 $obj_id = $this->repo_helper->getObjectIdFromRefId($ref_id);
147 $this->db_manager->saveLockToDB($ilias_lock);
149 throw new Exception\Forbidden();
152 if ($e->getCode() == -1) {
170 return $this->db_manager->getLockObjectWithObjIdFromDB($obj_id);
getLocksRecursive($sabre_locks, $ref_id, $uri)
Iterates recursive through the ilias tree to search for locked objects.
unlock($uri, Sabre\DAV\Locks\LockInfo $lockInfo)
Class ilWebDAVRepositoryHelper.
getLocks($uri, $returnChildLocks)
This function returns all locks and child locks as SabreDAV lock objects It is needed for sabreDAV to...
lock($uri, Sabre\DAV\Locks\LockInfo $lock_info)
Function for the sabreDAV interface.
Class ilWebDAVObjDAVHelper.
__construct($db_manager=null, ilWebDAVRepositoryHelper $repo_helper=null)
Constructor with dependency injection.
Class ilWebDAVLockBackend.
This is an Abstract clas for lock backends.
getLocksOnObjectId(int $obj_id)
Returns lock on given object.
static createFromSabreLock(Sabre\DAV\Locks\LockInfo $lock_info, $obj_id)
Creates an ILIAS lock object from a sabreDAV lock object.
Class ilWebDAVUriPathResolver.