Exemplo n.º 1
0
 protected function LOCK($locktoken, &$httpTimeout, &$owner, &$scope, &$type, $update)
 {
     $arRequestPath = self::ParsePath($this->request->GetPath());
     $path = CDavVirtualFileSystem::GetLockPath($arRequestPath["application"], $arRequestPath["id"]);
     $handler = $this->GetApplicationHandler($arRequestPath["application"]);
     if (!$arRequestPath["id"] || $this->request->GetDepth() || !$handler->CheckPrivilegesByPath("DAV:write", $this->request->GetPrincipal(), $arRequestPath["site"], $arRequestPath["account"], $arRequestPath["path"])) {
         return '409 Conflict';
     }
     $httpTimeout = time() + 300;
     if (!$update) {
         $ret = CDavVirtualFileSystem::Lock($path, $locktoken, $httpTimeout, $owner, $scope, $type);
         return $ret ? '200 OK' : '409 Conflict';
     }
     $ret = CDavVirtualFileSystem::UpdateLock($path, $locktoken, $httpTimeout, $owner, $scope, $type);
     return $ret;
 }
Exemplo n.º 2
0
 protected function LOCK($locktoken, &$httpTimeout, &$owner, &$scope, &$type, $update)
 {
     /** @var CDavRequest $request */
     $request = $this->request;
     $arRequestPath = self::ParsePath($request->GetPath());
     if (!$arRequestPath[0]) {
         return '409 Conflict';
     }
     $path = CDavVirtualFileSystem::GetLockPath("WS" . $arRequestPath[0]->getId(), $arRequestPath[1]);
     //		if (!$arRequestPath["id"] || $request->GetDepth() || !$handler->CheckPrivilegesByPath("DAV:write", $request->GetPrincipal(), $arRequestPath["site"], $arRequestPath["account"], $arRequestPath["path"]))
     //			return '409 Conflict';
     $httpTimeout = time() + 300;
     if (!$update) {
         $ret = CDavVirtualFileSystem::Lock($path, $locktoken, $httpTimeout, $owner, $scope, $type);
         return $ret ? '200 OK' : '409 Conflict';
     }
     $ret = CDavVirtualFileSystem::UpdateLock($path, $locktoken, $httpTimeout, $owner, $scope, $type);
     return $ret;
 }