forked from owncloud/core
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into accept-ocm-to-groups
- Loading branch information
Showing
1,064 changed files
with
17,153 additions
and
8,042 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
/** | ||
* @author Thomas Müller <[email protected]> | ||
* | ||
* @copyright Copyright (c) 2017, ownCloud GmbH | ||
* @copyright Copyright (c) 2022, ownCloud GmbH | ||
* @license AGPL-3.0 | ||
* | ||
* This code is free software: you can redistribute it and/or modify | ||
|
@@ -26,6 +26,7 @@ | |
use OCA\DAV\Files\IProvidesAdditionalHeaders; | ||
use OCA\DAV\Files\IFileNode; | ||
use OCP\Files\IProvidesVersionAuthor; | ||
use OCP\Files\IProvidesVersionTag; | ||
use OCP\Files\Node; | ||
use Sabre\DAV\File; | ||
|
||
|
@@ -128,24 +129,21 @@ public function getNode() { | |
} | ||
|
||
/** | ||
* @return string | ||
* @inheritdoc | ||
*/ | ||
public function getVersionAuthor() : string { | ||
public function getVersionEditedBy() : string { | ||
if ($this->file instanceof IProvidesVersionAuthor) { | ||
return $this->file->getEditedBy(); | ||
} | ||
return ''; | ||
} | ||
|
||
/** | ||
* @return string | ||
* @inheritdoc | ||
*/ | ||
public function getVersionAuthorName() : string { | ||
if ($this->file instanceof IProvidesVersionAuthor) { | ||
$uid = $this->file->getEditedBy(); | ||
$manager = \OC::$server->getUserManager(); | ||
$user = $manager->get($uid); | ||
return $user !== null ? $user->getDisplayName() : ''; | ||
public function getVersionTag() : string { | ||
if ($this->file instanceof IProvidesVersionTag) { | ||
return $this->file->getVersionTag(); | ||
} | ||
return ''; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
<?php | ||
/** | ||
* @author Thomas Müller <[email protected]> | ||
* @author Jannik Stehle <[email protected]> | ||
* @author Piotr Mrowczynski <[email protected]> | ||
* | ||
* @copyright Copyright (c) 2019, ownCloud GmbH | ||
* @license AGPL-3.0 | ||
|
@@ -33,7 +35,9 @@ class MetaPlugin extends ServerPlugin { | |
public const PATH_FOR_FILEID_PROPERTYNAME = '{http://owncloud.org/ns}meta-path-for-user'; | ||
|
||
public const VERSION_EDITED_BY_PROPERTYNAME = '{http://owncloud.org/ns}meta-version-edited-by'; | ||
public const VERSION_EDITED_BY_PROPERTYNAME_NAME = '{http://owncloud.org/ns}meta-version-edited-by-name'; | ||
public const VERSION_EDITED_BY_NAME_PROPERTYNAME = '{http://owncloud.org/ns}meta-version-edited-by-name'; | ||
public const VERSION_TAG_PROPERTYNAME = '{http://owncloud.org/ns}meta-version-tag'; | ||
|
||
/** | ||
* Reference to main server object | ||
* | ||
|
@@ -98,12 +102,36 @@ public function handleGetProperties(PropFind $propFind, INode $node) { | |
$file = \current($files); | ||
return $baseFolder->getRelativePath($file->getPath()); | ||
}); | ||
$propFind->handle(self::VERSION_EDITED_BY_PROPERTYNAME, function () use ($node) { | ||
return $node->getVersionEditedBy(); | ||
}); | ||
$propFind->handle(self::VERSION_EDITED_BY_NAME_PROPERTYNAME, function () use ($node) { | ||
$versionEditedBy = $node->getVersionEditedBy(); | ||
if (!$versionEditedBy) { | ||
return ''; | ||
} | ||
$manager = \OC::$server->getUserManager(); // FIXME: not so good | ||
$user = $manager->get($versionEditedBy); | ||
return $user !== null ? $user->getDisplayName() : ''; | ||
}); | ||
$propFind->handle(self::VERSION_TAG_PROPERTYNAME, function () use ($node) { | ||
return $node->getVersionTag(); | ||
}); | ||
} elseif ($node instanceof MetaFile) { | ||
$propFind->handle(self::VERSION_EDITED_BY_PROPERTYNAME, function () use ($node) { | ||
return $node->getVersionAuthor(); | ||
return $node->getVersionEditedBy(); | ||
}); | ||
$propFind->handle(self::VERSION_EDITED_BY_NAME_PROPERTYNAME, function () use ($node) { | ||
$versionEditedBy = $node->getVersionEditedBy(); | ||
if (!$versionEditedBy) { | ||
return ''; | ||
} | ||
$manager = \OC::$server->getUserManager(); // FIXME: not so good | ||
$user = $manager->get($versionEditedBy); | ||
return $user !== null ? $user->getDisplayName() : ''; | ||
}); | ||
$propFind->handle(self::VERSION_EDITED_BY_PROPERTYNAME_NAME, function () use ($node) { | ||
return $node->getVersionAuthorName(); | ||
$propFind->handle(self::VERSION_TAG_PROPERTYNAME, function () use ($node) { | ||
return $node->getVersionTag(); | ||
}); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.