Beispiel #1
0
 /**
  * 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);
 }
Beispiel #2
0
 /**
  * @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')));
 }
Beispiel #3
0
 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);
 }
Beispiel #4
0
 public function __construct($path = '')
 {
     parent::__construct("Shared");
 }
Beispiel #5
0
 public function __construct($path = "")
 {
     parent::__construct(GO::config()->file_storage_path);
 }