mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Adding common name to sharee
This commit is contained in:
parent
5b86148d3a
commit
c1ae8b0d81
3 changed files with 7 additions and 4 deletions
|
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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']
|
||||
|
|
|
|||
Loading…
Reference in a new issue