2015-10-21 09:06:48 -04:00
|
|
|
<?php
|
2024-05-27 11:39:07 -04:00
|
|
|
|
2016-01-12 09:02:16 -05:00
|
|
|
/**
|
2024-05-27 11:39:07 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2016-01-12 09:02:16 -05:00
|
|
|
*/
|
2015-10-21 09:06:48 -04:00
|
|
|
namespace OCA\DAV\Files;
|
|
|
|
|
|
2024-10-10 06:40:31 -04:00
|
|
|
use OC\Files\Filesystem;
|
2015-10-21 09:06:48 -04:00
|
|
|
use OCA\DAV\Connector\Sabre\Directory;
|
2017-05-04 18:34:01 -04:00
|
|
|
use OCP\Files\FileInfo;
|
2015-10-21 09:06:48 -04:00
|
|
|
use Sabre\DAV\Exception\Forbidden;
|
|
|
|
|
|
2016-09-08 06:56:48 -04:00
|
|
|
class FilesHome extends Directory {
|
2015-10-21 09:06:48 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* FilesHome constructor.
|
|
|
|
|
*
|
|
|
|
|
* @param array $principalInfo
|
2018-05-24 08:17:53 -04:00
|
|
|
* @param FileInfo $userFolder
|
2015-10-21 09:06:48 -04:00
|
|
|
*/
|
2024-10-18 06:04:22 -04:00
|
|
|
public function __construct(
|
|
|
|
|
private $principalInfo,
|
|
|
|
|
FileInfo $userFolder,
|
|
|
|
|
) {
|
2024-10-10 06:40:31 -04:00
|
|
|
$view = Filesystem::getView();
|
2018-05-24 08:17:53 -04:00
|
|
|
parent::__construct($view, $userFolder);
|
2015-10-21 09:06:48 -04:00
|
|
|
}
|
|
|
|
|
|
2020-04-10 10:51:06 -04:00
|
|
|
public function delete() {
|
2016-09-08 06:56:48 -04:00
|
|
|
throw new Forbidden('Permission denied to delete home folder');
|
2015-10-21 09:06:48 -04:00
|
|
|
}
|
|
|
|
|
|
2020-04-10 10:51:06 -04:00
|
|
|
public function getName() {
|
2021-01-12 04:15:48 -05:00
|
|
|
[,$name] = \Sabre\Uri\split($this->principalInfo['uri']);
|
2015-10-21 09:06:48 -04:00
|
|
|
return $name;
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-10 10:51:06 -04:00
|
|
|
public function setName($name) {
|
2015-10-21 09:06:48 -04:00
|
|
|
throw new Forbidden('Permission denied to rename this folder');
|
|
|
|
|
}
|
|
|
|
|
}
|