diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-05 17:30:16 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2016-02-08 11:36:57 +0100 |
commit | c1ae8b0d81a0f59b367e91418e6d07419c08c850 (patch) | |
tree | d81fbaa26047c5010d4cc4fcf22a594e2cbc3467 /apps | |
parent | 5b86148d3af9f383e9423d7c642345c81edccf6c (diff) | |
download | nextcloud-server-c1ae8b0d81a0f59b367e91418e6d07419c08c850.tar.gz nextcloud-server-c1ae8b0d81a0f59b367e91418e6d07419c08c850.zip |
Adding common name to sharee
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/caldav/caldavbackend.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/carddav/carddavbackend.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/dav/sharing/backend.php | 7 |
3 files changed, 7 insertions, 4 deletions
diff --git a/apps/dav/lib/caldav/caldavbackend.php b/apps/dav/lib/caldav/caldavbackend.php index 35f3ee983fd..52b4812b05b 100644 --- a/apps/dav/lib/caldav/caldavbackend.php +++ b/apps/dav/lib/caldav/caldavbackend.php @@ -106,7 +106,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription public function __construct(\OCP\IDBConnection $db, Principal $principalBackend) { $this->db = $db; $this->principalBackend = $principalBackend; - $this->sharingBackend = new Backend($this->db, 'calendar'); + $this->sharingBackend = new Backend($this->db, $principalBackend, 'calendar'); } /** diff --git a/apps/dav/lib/carddav/carddavbackend.php b/apps/dav/lib/carddav/carddavbackend.php index ef523ca8896..2c1960fbb9d 100644 --- a/apps/dav/lib/carddav/carddavbackend.php +++ b/apps/dav/lib/carddav/carddavbackend.php @@ -72,7 +72,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { public function __construct(IDBConnection $db, Principal $principalBackend) { $this->db = $db; $this->principalBackend = $principalBackend; - $this->sharingBackend = new Backend($this->db, 'addressbook'); + $this->sharingBackend = new Backend($this->db, $principalBackend, 'addressbook'); } /** diff --git a/apps/dav/lib/dav/sharing/backend.php b/apps/dav/lib/dav/sharing/backend.php index 0b28891fbc4..47940491842 100644 --- a/apps/dav/lib/dav/sharing/backend.php +++ b/apps/dav/lib/dav/sharing/backend.php @@ -24,6 +24,7 @@ namespace OCA\DAV\DAV\Sharing; +use OCA\DAV\Connector\Sabre\Principal; use OCP\IDBConnection; class Backend { @@ -43,8 +44,9 @@ class Backend { * * @param IDBConnection $db */ - public function __construct(IDBConnection $db, $resourceType) { + public function __construct(IDBConnection $db, Principal $principalBackend, $resourceType) { $this->db = $db; + $this->principalBackend = $principalBackend; $this->resourceType = $resourceType; } @@ -153,9 +155,10 @@ class Backend { $shares = []; while($row = $result->fetch()) { + $p = $this->principalBackend->getPrincipalByPath($row['principaluri']); $shares[]= [ 'href' => "principal:${row['principaluri']}", -// 'commonName' => isset($p['{DAV:}displayname']) ? $p['{DAV:}displayname'] : '', + 'commonName' => isset($p['{DAV:}displayname']) ? $p['{DAV:}displayname'] : '', 'status' => 1, 'readOnly' => ($row['access'] == self::ACCESS_READ), '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}principal' => $row['principaluri'] |