зеркало из https://github.com/nextcloud/guests.git
Merge pull request #1248 from nextcloud/bugfix/noid/fix-navigation-manager
This commit is contained in:
Коммит
4b5cdd6a79
|
@ -858,12 +858,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nextcloud-deps/ocp.git",
|
||||
"reference": "5460600953d265eb408baa990102b7ffb5c47134"
|
||||
"reference": "95de3516904b65613a8fb226874f967bedbd932f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/5460600953d265eb408baa990102b7ffb5c47134",
|
||||
"reference": "5460600953d265eb408baa990102b7ffb5c47134",
|
||||
"url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/95de3516904b65613a8fb226874f967bedbd932f",
|
||||
"reference": "95de3516904b65613a8fb226874f967bedbd932f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -877,7 +877,7 @@
|
|||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "30.0.0-dev"
|
||||
"dev-master": "31.0.0-dev"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
|
@ -895,7 +895,7 @@
|
|||
"issues": "https://github.com/nextcloud-deps/ocp/issues",
|
||||
"source": "https://github.com/nextcloud-deps/ocp/tree/master"
|
||||
},
|
||||
"time": "2024-07-11T00:37:32+00:00"
|
||||
"time": "2024-10-01T00:48:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nikic/php-parser",
|
||||
|
|
|
@ -69,4 +69,23 @@ class FilteredNavigationManager extends NavigationManager {
|
|||
public function setUnreadCounter(string $id, int $unreadCounter): void {
|
||||
$this->navigationManager->setUnreadCounter($id, $unreadCounter);
|
||||
}
|
||||
|
||||
public function get(string $id): ?array {
|
||||
return $this->navigationManager->get($id);
|
||||
}
|
||||
|
||||
public function getDefaultEntryIdForUser(?IUser $user = null, bool $withFallbacks = true): string {
|
||||
return $this->navigationManager->getDefaultEntryIdForUser($user, $withFallbacks);
|
||||
}
|
||||
|
||||
public function getDefaultEntryIds(bool $withFallbacks = true): array {
|
||||
return $this->navigationManager->getDefaultEntryIds($withFallbacks);
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-suppress MethodSignatureMismatch
|
||||
*/
|
||||
public function setDefaultEntryIds(array $ids): void {
|
||||
$this->navigationManager->setDefaultEntryIds($ids);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ class RestrictionManager {
|
|||
}
|
||||
|
||||
/** @var NavigationManager $navManager */
|
||||
$navManager = $this->server->getNavigationManager();
|
||||
$navManager = \OCP\Server::get(INavigationManager::class);
|
||||
|
||||
$this->server->registerService(INavigationManager::class, function () use ($navManager) {
|
||||
return new FilteredNavigationManager($this->userSession->getUser(), $navManager, $this->whitelist);
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
namespace OCA\Guests\Storage;
|
||||
|
||||
use OC\Files\Storage\Wrapper\PermissionsMask;
|
||||
use OCP\Files\Cache\ICache;
|
||||
|
||||
/**
|
||||
* While PermissionMask can mask a whole storage this can
|
||||
|
@ -100,9 +101,6 @@ class DirMask extends PermissionsMask {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-suppress ParamNameMismatch
|
||||
*/
|
||||
public function rename($source, $target): bool {
|
||||
if (!$this->isUpdatable($source)) {
|
||||
return false;
|
||||
|
@ -123,9 +121,6 @@ class DirMask extends PermissionsMask {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-suppress ParamNameMismatch
|
||||
*/
|
||||
public function copy($source, $target): bool {
|
||||
if (!$this->isReadable($source)) {
|
||||
return false;
|
||||
|
@ -162,10 +157,7 @@ class DirMask extends PermissionsMask {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-suppress MethodSignatureMustProvideReturnType
|
||||
*/
|
||||
public function rmdir($path) {
|
||||
public function rmdir($path): bool {
|
||||
if ($this->checkPath($path)) {
|
||||
return parent::rmdir($path);
|
||||
} else {
|
||||
|
@ -181,10 +173,7 @@ class DirMask extends PermissionsMask {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-suppress MethodSignatureMustProvideReturnType
|
||||
*/
|
||||
public function file_put_contents($path, $data) {
|
||||
public function file_put_contents($path, $data): int|float|false {
|
||||
if ($this->checkPath($path)) {
|
||||
return parent::file_put_contents($path, $data);
|
||||
} else {
|
||||
|
@ -192,9 +181,6 @@ class DirMask extends PermissionsMask {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-suppress MethodSignatureMustProvideReturnType
|
||||
*/
|
||||
public function fopen($path, $mode) {
|
||||
if ($this->checkPath($path)) {
|
||||
return parent::fopen($path, $mode);
|
||||
|
@ -203,10 +189,7 @@ class DirMask extends PermissionsMask {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-suppress MethodSignatureMustProvideReturnType
|
||||
*/
|
||||
public function getCache($path = '', $storage = null) {
|
||||
public function getCache($path = '', $storage = null): ICache {
|
||||
if (!$storage) {
|
||||
$storage = $this;
|
||||
}
|
||||
|
|
200
tests/stub.php
200
tests/stub.php
|
@ -127,6 +127,18 @@ namespace OC {
|
|||
*/
|
||||
public function setUnreadCounter(string $id, int $unreadCounter): void {
|
||||
}
|
||||
|
||||
public function get(string $id): ?array {
|
||||
}
|
||||
|
||||
public function getDefaultEntryIdForUser(?\OCP\IUser $user = null, bool $withFallbacks = true): string {
|
||||
}
|
||||
|
||||
public function getDefaultEntryIds(bool $withFallbacks = true): array {
|
||||
}
|
||||
|
||||
public function setDefaultEntryIds(array $ids): void {
|
||||
}
|
||||
}
|
||||
|
||||
class AppConfig {
|
||||
|
@ -575,7 +587,14 @@ namespace OC\Files\Mount {
|
|||
|
||||
namespace OC\Files\Storage\Wrapper{
|
||||
|
||||
use OCP\Files\Cache\ICache;
|
||||
use OCP\Files\Cache\IPropagator;
|
||||
use OCP\Files\Cache\IScanner;
|
||||
use OCP\Files\Cache\IUpdater;
|
||||
use OCP\Files\Cache\IWatcher;
|
||||
use OCP\Files\Storage;
|
||||
use OCP\Files\Storage\IStorage;
|
||||
use OCP\Lock\ILockingProvider;
|
||||
|
||||
class Wrapper implements IStorage {
|
||||
/**
|
||||
|
@ -583,189 +602,196 @@ namespace OC\Files\Storage\Wrapper{
|
|||
*/
|
||||
protected $storage;
|
||||
|
||||
|
||||
public function __construct(array $parameters) {
|
||||
/**
|
||||
* @param array $parameters
|
||||
*/
|
||||
public function __construct($parameters) {
|
||||
}
|
||||
|
||||
public function getWrapperStorage(): ?IStorage {
|
||||
public function getWrapperStorage(): IStorage {
|
||||
}
|
||||
|
||||
public function getId() {
|
||||
public function getId(): string {
|
||||
}
|
||||
|
||||
public function mkdir($path) {
|
||||
public function mkdir($path): bool {
|
||||
}
|
||||
|
||||
public function rmdir($path) {
|
||||
public function rmdir($path): bool {
|
||||
}
|
||||
|
||||
public function opendir($path) {
|
||||
throw new \Exception('stub');
|
||||
}
|
||||
|
||||
public function is_dir($path) {
|
||||
throw new \Exception('stub');
|
||||
public function is_dir($path): bool {
|
||||
}
|
||||
|
||||
public function is_file($path) {
|
||||
throw new \Exception('stub');
|
||||
public function is_file($path): bool {
|
||||
}
|
||||
|
||||
public function stat($path) {
|
||||
throw new \Exception('stub');
|
||||
public function stat($path): array|false {
|
||||
}
|
||||
|
||||
public function filetype($path) {
|
||||
throw new \Exception('stub');
|
||||
public function filetype($path): string|false {
|
||||
}
|
||||
|
||||
public function filesize($path) {
|
||||
throw new \Exception('stub');
|
||||
public function filesize($path): int|float|false {
|
||||
}
|
||||
|
||||
public function isCreatable($path) {
|
||||
throw new \Exception('stub');
|
||||
public function isCreatable($path): bool {
|
||||
}
|
||||
|
||||
public function isReadable($path) {
|
||||
throw new \Exception('stub');
|
||||
public function isReadable($path): bool {
|
||||
}
|
||||
|
||||
public function isUpdatable($path) {
|
||||
throw new \Exception('stub');
|
||||
public function isUpdatable($path): bool {
|
||||
}
|
||||
|
||||
public function isDeletable($path) {
|
||||
throw new \Exception('stub');
|
||||
public function isDeletable($path): bool {
|
||||
}
|
||||
|
||||
public function isSharable($path) {
|
||||
throw new \Exception('stub');
|
||||
public function isSharable($path): bool {
|
||||
}
|
||||
|
||||
public function getPermissions($path) {
|
||||
throw new \Exception('stub');
|
||||
public function getPermissions($path): int {
|
||||
}
|
||||
|
||||
public function file_exists($path) {
|
||||
throw new \Exception('stub');
|
||||
public function file_exists($path): bool {
|
||||
}
|
||||
|
||||
public function filemtime($path) {
|
||||
throw new \Exception('stub');
|
||||
public function filemtime($path): int|false {
|
||||
}
|
||||
|
||||
public function file_get_contents($path) {
|
||||
throw new \Exception('stub');
|
||||
public function file_get_contents($path): string|false {
|
||||
}
|
||||
|
||||
public function file_put_contents($path, $data) {
|
||||
throw new \Exception('stub');
|
||||
public function file_put_contents($path, $data): int|float|false {
|
||||
}
|
||||
|
||||
public function unlink($path) {
|
||||
throw new \Exception('stub');
|
||||
public function unlink($path): bool {
|
||||
}
|
||||
|
||||
public function rename($path1, $path2) {
|
||||
throw new \Exception('stub');
|
||||
public function rename($source, $target): bool {
|
||||
}
|
||||
|
||||
public function copy($path1, $path2) {
|
||||
throw new \Exception('stub');
|
||||
public function copy($source, $target): bool {
|
||||
}
|
||||
|
||||
public function fopen($path, $mode) {
|
||||
throw new \Exception('stub');
|
||||
}
|
||||
|
||||
public function getMimeType($path) {
|
||||
throw new \Exception('stub');
|
||||
public function getMimeType($path): string|false {
|
||||
}
|
||||
|
||||
public function hash($type, $path, $raw = false) {
|
||||
throw new \Exception('stub');
|
||||
public function hash($type, $path, $raw = false): string|false {
|
||||
}
|
||||
|
||||
public function free_space($path) {
|
||||
throw new \Exception('stub');
|
||||
public function free_space($path): int|float|false {
|
||||
}
|
||||
|
||||
public function touch($path, $mtime = null) {
|
||||
throw new \Exception('stub');
|
||||
public function touch($path, $mtime = null): bool {
|
||||
}
|
||||
|
||||
public function getLocalFile($path) {
|
||||
throw new \Exception('stub');
|
||||
public function getLocalFile($path): string|false {
|
||||
}
|
||||
|
||||
public function hasUpdated($path, $time) {
|
||||
throw new \Exception('stub');
|
||||
public function hasUpdated($path, $time): bool {
|
||||
}
|
||||
|
||||
public function getETag($path) {
|
||||
throw new \Exception('stub');
|
||||
public function getCache($path = '', $storage = null): ICache {
|
||||
}
|
||||
|
||||
public function isLocal() {
|
||||
throw new \Exception('stub');
|
||||
public function getScanner($path = '', $storage = null): IScanner {
|
||||
}
|
||||
|
||||
public function instanceOfStorage($class) {
|
||||
throw new \Exception('stub');
|
||||
public function getOwner($path): string|false {
|
||||
}
|
||||
|
||||
public function getDirectDownload($path) {
|
||||
throw new \Exception('stub');
|
||||
public function getWatcher($path = '', $storage = null): IWatcher {
|
||||
}
|
||||
|
||||
public function verifyPath($path, $fileName) {
|
||||
throw new \Exception('stub');
|
||||
public function getPropagator($storage = null): IPropagator {
|
||||
}
|
||||
|
||||
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
throw new \Exception('stub');
|
||||
public function getUpdater($storage = null): IUpdater {
|
||||
}
|
||||
|
||||
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
throw new \Exception('stub');
|
||||
public function getStorageCache(): \OC\Files\Cache\Storage {
|
||||
}
|
||||
|
||||
public function test() {
|
||||
throw new \Exception('stub');
|
||||
public function getETag($path): string|false {
|
||||
}
|
||||
|
||||
public function getAvailability() {
|
||||
throw new \Exception('stub');
|
||||
public function test(): bool {
|
||||
}
|
||||
|
||||
public function setAvailability($isAvailable) {
|
||||
throw new \Exception('stub');
|
||||
public function isLocal(): bool {
|
||||
}
|
||||
|
||||
public function getOwner($path) {
|
||||
throw new \Exception('stub');
|
||||
public function instanceOfStorage($class): bool {
|
||||
}
|
||||
|
||||
public function getCache() {
|
||||
throw new \Exception('stub');
|
||||
/**
|
||||
* @psalm-template T of IStorage
|
||||
* @psalm-param class-string<T> $class
|
||||
* @psalm-return T|null
|
||||
*/
|
||||
public function getInstanceOfStorage(string $class): ?IStorage {
|
||||
}
|
||||
|
||||
public function getPropagator() {
|
||||
throw new \Exception('stub');
|
||||
/**
|
||||
* Pass any methods custom to specific storage implementations to the wrapped storage
|
||||
*
|
||||
* @param string $method
|
||||
* @param array $args
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call($method, $args) {
|
||||
}
|
||||
|
||||
public function getScanner() {
|
||||
throw new \Exception('stub');
|
||||
public function getDirectDownload($path): array|false {
|
||||
}
|
||||
|
||||
public function getUpdater() {
|
||||
public function getAvailability(): array {
|
||||
}
|
||||
|
||||
public function getWatcher() {
|
||||
public function setAvailability($isAvailable): void {
|
||||
}
|
||||
|
||||
public function setOwner(?string $user) : void {
|
||||
public function verifyPath($path, $fileName): void {
|
||||
}
|
||||
|
||||
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath): bool {
|
||||
}
|
||||
|
||||
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath): bool {
|
||||
}
|
||||
|
||||
public function getMetaData($path): ?array {
|
||||
}
|
||||
|
||||
public function acquireLock($path, $type, ILockingProvider $provider): void {
|
||||
}
|
||||
|
||||
public function releaseLock($path, $type, ILockingProvider $provider): void {
|
||||
}
|
||||
|
||||
public function changeLock($path, $type, ILockingProvider $provider): void {
|
||||
}
|
||||
|
||||
public function needsPartFile(): bool {
|
||||
}
|
||||
|
||||
public function writeStream(string $path, $stream, ?int $size = null): int {
|
||||
}
|
||||
|
||||
public function getDirectoryContent($directory): \Traversable {
|
||||
}
|
||||
|
||||
public function isWrapperOf(IStorage $storage): bool {
|
||||
}
|
||||
|
||||
public function setOwner(?string $user): void {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче