/** * This test makes sure that a path like /foo cannot be copied into a path * like /foo/bar/ * * @expectedException \Sabre\DAV\Exception\Conflict */ public function testCopyIntoSubPath() { $dir = new FS\Directory(SABRE_TEMPDIR); $server = new Server($dir); $dir->createDirectory('foo'); $request = new HTTP\Request('COPY', '/foo', ['Destination' => '/foo/bar']); $response = new HTTP\ResponseMock(); $server->invokeMethod($request, $response); }
/** * @depends testTreeMove * @depends testCopyMoveInfo */ function testEverything() { // Request object $serverVars = array('REQUEST_METHOD' => 'MOVE', 'REQUEST_URI' => '/webdav/bar', 'HTTP_DESTINATION' => 'http://dev2.tribalos.com/webdav/%C3%A0fo%C3%B3', 'HTTP_OVERWRITE' => 'F'); $request = new HTTP\Request($serverVars); $request->setBody(''); $response = new HTTP\ResponseMock(); // Server setup mkdir(SABRE_TEMPDIR . '/issue33'); $dir = new FS\Directory(SABRE_TEMPDIR . '/issue33'); $dir->createDirectory('bar'); $tree = new ObjectTree($dir); $server = new Server($tree); $server->setBaseUri('/webdav/'); $server->httpRequest = $request; $server->httpResponse = $response; $server->exec(); $this->assertTrue(file_exists(SABRE_TEMPDIR . '/issue33/' . urldecode('%C3%A0fo%C3%B3'))); }
public function __construct($path) { $path = rtrim($path, '/'); $this->relpath = $path; $path = \GO::config()->file_storage_path . $path; // if(!$this->_getFolder()->checkPermissionLevel(\GO\Base\Model\Acl::READ_PERMISSION)){ // \GO::debug("DAV: User ".\GO::user()->username." doesn't have write permission for ".$this->relpath); // throw new Sabre\DAV\Exception\Forbidden ("DAV: User ".\GO::user()->username." doesn't have write permission for folder '".$this->relpath.'"'); // } parent::__construct($path); }
public function __construct($path = '') { parent::__construct("Shared"); }
public function __construct($path = "") { parent::__construct(GO::config()->file_storage_path); }