summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Avatars/RootCollection.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/Avatars/RootCollection.php')
-rw-r--r--apps/dav/lib/Avatars/RootCollection.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/apps/dav/lib/Avatars/RootCollection.php b/apps/dav/lib/Avatars/RootCollection.php
new file mode 100644
index 00000000000..d7c7ff4e9fb
--- /dev/null
+++ b/apps/dav/lib/Avatars/RootCollection.php
@@ -0,0 +1,29 @@
+<?php
+
+namespace OCA\DAV\Avatars;
+
+use Sabre\DAVACL\AbstractPrincipalCollection;
+
+
+class RootCollection extends AbstractPrincipalCollection {
+
+ /**
+ * This method returns a node for a principal.
+ *
+ * The passed array contains principal information, and is guaranteed to
+ * at least contain a uri item. Other properties may or may not be
+ * supplied by the authentication backend.
+ *
+ * @param array $principalInfo
+ * @return AvatarHome
+ */
+ public function getChildForPrincipal(array $principalInfo) {
+ $avatarManager = \OC::$server->getAvatarManager();
+ return new AvatarHome($principalInfo, $avatarManager);
+ }
+
+ public function getName() {
+ return 'avatars';
+ }
+
+}