From 69a38299403db073f4613e38724c16ac1009dbdf Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Thu, 30 Jul 2020 21:10:54 +0200 Subject: [PATCH 1/5] fix check for Cloud ID, missing return statements, wrong param use Signed-off-by: Arthur Schiwon --- apps/federatedfilesharing/lib/Notifier.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/apps/federatedfilesharing/lib/Notifier.php b/apps/federatedfilesharing/lib/Notifier.php index 46081240d6..cae3fc2aa9 100644 --- a/apps/federatedfilesharing/lib/Notifier.php +++ b/apps/federatedfilesharing/lib/Notifier.php @@ -107,9 +107,7 @@ class Notifier implements INotifier { ); $initiator = $params[0]; - $initiatorDisplay = isset($params[3]) ? $params[3] : null; $owner = $params[1]; - $ownerDisplay = isset($params[4]) ? $params[4] : null; $notification->setRichSubject( $l->t('You received {share} as a remote share from {user} (on behalf of {behalf})'), @@ -119,8 +117,8 @@ class Notifier implements INotifier { 'id' => $notification->getObjectId(), 'name' => $params[2], ], - 'user' => $this->createRemoteUser($initiator, $initiatorDisplay), - 'behalf' => $this->createRemoteUser($owner, $ownerDisplay), + 'user' => $this->createRemoteUser($initiator), + 'behalf' => $this->createRemoteUser($owner), ] ); } else { @@ -129,7 +127,6 @@ class Notifier implements INotifier { ); $owner = $params[0]; - $ownerDisplay = isset($params[3]) ? $params[3] : null; $notification->setRichSubject( $l->t('You received {share} as a remote share from {user}'), @@ -139,7 +136,7 @@ class Notifier implements INotifier { 'id' => $notification->getObjectId(), 'name' => $params[2], ], - 'user' => $this->createRemoteUser($owner, $ownerDisplay), + 'user' => $this->createRemoteUser($owner), ] ); } @@ -203,7 +200,7 @@ class Notifier implements INotifier { * @param ICloudId $cloudId * @return string */ - protected function getDisplayName(ICloudId $cloudId) { + protected function getDisplayName(ICloudId $cloudId): string { $server = $cloudId->getRemote(); $user = $cloudId->getUser(); if (strpos($server, 'http://') === 0) { @@ -213,17 +210,24 @@ class Notifier implements INotifier { } try { + // contains protocol in the ID return $this->getDisplayNameFromContact($cloudId->getId()); } catch (\OutOfBoundsException $e) { } try { - $this->getDisplayNameFromContact($user . '@http://' . $server); + // does not include protocol, as stored in addressbooks + return $this->getDisplayNameFromContact($cloudId->getDisplayId()); } catch (\OutOfBoundsException $e) { } try { - $this->getDisplayNameFromContact($user . '@https://' . $server); + return $this->getDisplayNameFromContact($user . '@http://' . $server); + } catch (\OutOfBoundsException $e) { + } + + try { + return $this->getDisplayNameFromContact($user . '@https://' . $server); } catch (\OutOfBoundsException $e) { } From f13d5a3ec0e3bacec53ea64ee360aae000413b16 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Thu, 30 Jul 2020 21:18:20 +0200 Subject: [PATCH 2/5] coding style fixes Signed-off-by: Arthur Schiwon --- apps/dav/lib/CardDAV/CardDavBackend.php | 69 +++++++++++----------- apps/federatedfilesharing/lib/Notifier.php | 6 +- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 40b48f69ae..542ae43e0a 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -157,13 +157,13 @@ class CardDavBackend implements BackendInterface, SyncSupport { $result = $query->execute(); while ($row = $result->fetch()) { $addressBooks[$row['id']] = [ - 'id' => $row['id'], + 'id' => $row['id'], 'uri' => $row['uri'], 'principaluri' => $this->convertPrincipal($row['principaluri'], false), '{DAV:}displayname' => $row['displayname'], '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'], '{http://calendarserver.org/ns/}getctag' => $row['synctoken'], - '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0', + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', ]; $this->addOwnerPrincipal($addressBooks[$row['id']]); @@ -177,7 +177,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { $principals = array_map(function ($principal) { return urldecode($principal); }, $principals); - $principals[]= $principalUri; + $principals[] = $principalUri; $query = $this->db->getQueryBuilder(); $result = $query->select(['a.id', 'a.uri', 'a.displayname', 'a.principaluri', 'a.description', 'a.synctoken', 's.access']) @@ -195,7 +195,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { continue; } - $readOnly = (int) $row['access'] === Backend::ACCESS_READ; + $readOnly = (int)$row['access'] === Backend::ACCESS_READ; if (isset($addressBooks[$row['id']])) { if ($readOnly) { // New share can not have more permissions then the old one. @@ -213,13 +213,13 @@ class CardDavBackend implements BackendInterface, SyncSupport { $displayName = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')'; $addressBooks[$row['id']] = [ - 'id' => $row['id'], + 'id' => $row['id'], 'uri' => $uri, 'principaluri' => $principalUriOriginal, '{DAV:}displayname' => $displayName, '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'], '{http://calendarserver.org/ns/}getctag' => $row['synctoken'], - '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0', + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $row['principaluri'], $readOnlyPropertyName => $readOnly, ]; @@ -235,21 +235,21 @@ class CardDavBackend implements BackendInterface, SyncSupport { $principalUri = $this->convertPrincipal($principalUri, true); $query = $this->db->getQueryBuilder(); $query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken']) - ->from('addressbooks') - ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri))); + ->from('addressbooks') + ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri))); $addressBooks = []; $result = $query->execute(); while ($row = $result->fetch()) { $addressBooks[$row['id']] = [ - 'id' => $row['id'], + 'id' => $row['id'], 'uri' => $row['uri'], 'principaluri' => $this->convertPrincipal($row['principaluri'], false), '{DAV:}displayname' => $row['displayname'], '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'], '{http://calendarserver.org/ns/}getctag' => $row['synctoken'], - '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0', + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', ]; $this->addOwnerPrincipal($addressBooks[$row['id']]); @@ -290,13 +290,13 @@ class CardDavBackend implements BackendInterface, SyncSupport { } $addressBook = [ - 'id' => $row['id'], + 'id' => $row['id'], 'uri' => $row['uri'], 'principaluri' => $row['principaluri'], '{DAV:}displayname' => $row['displayname'], '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'], '{http://calendarserver.org/ns/}getctag' => $row['synctoken'], - '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0', + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', ]; $this->addOwnerPrincipal($addressBook); @@ -324,13 +324,13 @@ class CardDavBackend implements BackendInterface, SyncSupport { } $addressBook = [ - 'id' => $row['id'], + 'id' => $row['id'], 'uri' => $row['uri'], 'principaluri' => $row['principaluri'], '{DAV:}displayname' => $row['displayname'], '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'], '{http://calendarserver.org/ns/}getctag' => $row['synctoken'], - '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0', + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', ]; $this->addOwnerPrincipal($addressBook); @@ -365,7 +365,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { */ $propPatch->handle($supportedProperties, function ($mutations) use ($addressBookId) { $updates = []; - foreach ($mutations as $property=>$newValue) { + foreach ($mutations as $property => $newValue) { switch ($property) { case '{DAV:}displayname': $updates['displayname'] = $newValue; @@ -378,11 +378,11 @@ class CardDavBackend implements BackendInterface, SyncSupport { $query = $this->db->getQueryBuilder(); $query->update('addressbooks'); - foreach ($updates as $key=>$value) { + foreach ($updates as $key => $value) { $query->set($key, $query->createNamedParameter($value)); } $query->where($query->expr()->eq('id', $query->createNamedParameter($addressBookId))) - ->execute(); + ->execute(); $this->addChange($addressBookId, "", 2); @@ -408,7 +408,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { 'synctoken' => 1 ]; - foreach ($properties as $property=>$newValue) { + foreach ($properties as $property => $newValue) { switch ($property) { case '{DAV:}displayname': $values['displayname'] = $newValue; @@ -634,7 +634,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { ->andWhere($q->expr()->eq('uid', $q->createNamedParameter($uid))) ->setMaxResults(1); $result = $q->execute(); - $count = (bool) $result->fetchColumn(); + $count = (bool)$result->fetchColumn(); $result->closeCursor(); if ($count) { throw new \Sabre\DAV\Exception\BadRequest('VCard object with uid already exists in this addressbook collection.'); @@ -811,7 +811,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { public function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null) { // Current synctoken $stmt = $this->db->prepare('SELECT `synctoken` FROM `*PREFIX*addressbooks` WHERE `id` = ?'); - $stmt->execute([ $addressBookId ]); + $stmt->execute([$addressBookId]); $currentToken = $stmt->fetchColumn(0); if (is_null($currentToken)) { @@ -820,14 +820,14 @@ class CardDavBackend implements BackendInterface, SyncSupport { $result = [ 'syncToken' => $currentToken, - 'added' => [], - 'modified' => [], - 'deleted' => [], + 'added' => [], + 'modified' => [], + 'deleted' => [], ]; if ($syncToken) { $query = "SELECT `uri`, `operation` FROM `*PREFIX*addressbookchanges` WHERE `synctoken` >= ? AND `synctoken` < ? AND `addressbookid` = ? ORDER BY `synctoken`"; - if ($limit>0) { + if ($limit > 0) { $query .= " LIMIT " . (int)$limit; } @@ -895,7 +895,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @param bool $modified * @return string */ - private function readBlob($cardData, &$modified=false) { + private function readBlob($cardData, &$modified = false) { if (is_resource($cardData)) { $cardData = stream_get_contents($cardData); } @@ -943,9 +943,9 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @param string $pattern which should match within the $searchProperties * @param array $searchProperties defines the properties within the query pattern should match * @param array $options = array() to define the search behavior - * - 'escape_like_param' - If set to false wildcards _ and % are not escaped, otherwise they are - * - 'limit' - Set a numeric limit for the search results - * - 'offset' - Set the offset for the limited search results + * - 'escape_like_param' - If set to false wildcards _ and % are not escaped, otherwise they are + * - 'limit' - Set a numeric limit for the search results + * - 'offset' - Set the offset for the limited search results * @return array an array of contacts which are arrays of key-value-pairs */ public function search($addressBookId, $pattern, $searchProperties, $options = []) { @@ -980,7 +980,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { $matches = $result->fetchAll(); $result->closeCursor(); $matches = array_map(function ($match) { - return (int) $match['cardid']; + return (int)$match['cardid']; }, $matches); $query = $this->db->getQueryBuilder(); @@ -1031,8 +1031,8 @@ class CardDavBackend implements BackendInterface, SyncSupport { public function getCardUri($id) { $query = $this->db->getQueryBuilder(); $query->select('uri')->from($this->dbCardsTable) - ->where($query->expr()->eq('id', $query->createParameter('id'))) - ->setParameter('id', $id); + ->where($query->expr()->eq('id', $query->createParameter('id'))) + ->setParameter('id', $id); $result = $query->execute(); $uri = $result->fetch(); @@ -1056,8 +1056,8 @@ class CardDavBackend implements BackendInterface, SyncSupport { $result = []; $query = $this->db->getQueryBuilder(); $query->select('*')->from($this->dbCardsTable) - ->where($query->expr()->eq('uri', $query->createNamedParameter($uri))) - ->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId))); + ->where($query->expr()->eq('uri', $query->createNamedParameter($uri))) + ->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId))); $queryResult = $query->execute(); $contact = $queryResult->fetch(); $queryResult->closeCursor(); @@ -1142,7 +1142,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { * @return VCard */ protected function readCard($cardData) { - return Reader::read($cardData); + return Reader::read($cardData); } /** @@ -1185,6 +1185,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { /** * For shared address books the sharee is set in the ACL of the address book + * * @param $addressBookId * @param $acl * @return array diff --git a/apps/federatedfilesharing/lib/Notifier.php b/apps/federatedfilesharing/lib/Notifier.php index cae3fc2aa9..42a07abb38 100644 --- a/apps/federatedfilesharing/lib/Notifier.php +++ b/apps/federatedfilesharing/lib/Notifier.php @@ -146,14 +146,14 @@ class Notifier implements INotifier { switch ($action->getLabel()) { case 'accept': $action->setParsedLabel( - (string) $l->t('Accept') + (string)$l->t('Accept') ) - ->setPrimary(true); + ->setPrimary(true); break; case 'decline': $action->setParsedLabel( - (string) $l->t('Decline') + (string)$l->t('Decline') ); break; } From c6becac993d04f6e8e3ebe2009967b8c4528ade3 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 3 Aug 2020 11:05:45 +0200 Subject: [PATCH 3/5] effectively revert 17fae47bdba84ed520fee2cbf1a9485cc14fbbcb fixing i10n Signed-off-by: Arthur Schiwon --- .../lib/ocm/CloudFederationProviderFiles.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php b/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php index 0e9b9dbed6..4ee33c6e05 100644 --- a/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php +++ b/apps/federatedfilesharing/lib/ocm/CloudFederationProviderFiles.php @@ -255,7 +255,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { ->setAffectedUser($shareWith) ->setObject('remote_share', (int)$shareId, $name); \OC::$server->getActivityManager()->publish($event); - $this->notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name, $sharedBy, $owner); + $this->notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name); } else { $groupMembers = $this->groupManager->get($shareWith)->getUsers(); foreach ($groupMembers as $user) { @@ -266,7 +266,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { ->setAffectedUser($user->getUID()) ->setObject('remote_share', (int)$shareId, $name); \OC::$server->getActivityManager()->publish($event); - $this->notifyAboutNewShare($user->getUID(), $shareId, $ownerFederatedId, $sharedByFederatedId, $name, $sharedBy, $owner); + $this->notifyAboutNewShare($user->getUID(), $shareId, $ownerFederatedId, $sharedByFederatedId, $name); } } return $shareId; @@ -332,22 +332,13 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { return $result; } - /** - * notify user about new federated share - * - * @param $shareWith - * @param $shareId - * @param $ownerFederatedId - * @param $sharedByFederatedId - * @param $name - */ - private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name, $sharedBy, $owner) { + private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name): void { $notification = $this->notificationManager->createNotification(); $notification->setApp('files_sharing') ->setUser($shareWith) ->setDateTime(new \DateTime()) ->setObject('remote_share', $shareId) - ->setSubject('remote_share', [$ownerFederatedId, $sharedByFederatedId, trim($name, '/'), $sharedBy, $owner]); + ->setSubject('remote_share', [$ownerFederatedId, $sharedByFederatedId, trim($name, '/')]); $declineAction = $notification->createAction(); $declineAction->setLabel('decline') From f21361770418cc7d5246ef4d380b3619f7725b9a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 3 Aug 2020 11:23:53 +0200 Subject: [PATCH 4/5] Fix missing placeholders in translations Signed-off-by: Joas Schilling --- apps/federatedfilesharing/lib/Notifier.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/federatedfilesharing/lib/Notifier.php b/apps/federatedfilesharing/lib/Notifier.php index 42a07abb38..0098d82d5c 100644 --- a/apps/federatedfilesharing/lib/Notifier.php +++ b/apps/federatedfilesharing/lib/Notifier.php @@ -102,13 +102,15 @@ class Notifier implements INotifier { $params = $notification->getSubjectParameters(); if ($params[0] !== $params[1] && $params[1] !== null) { + $remoteInitiator = $this->createRemoteUser($params[0]); + $remoteOwner = $this->createRemoteUser($params[1]); + $params[3] = $remoteInitiator['name'] . '@' . $remoteInitiator['server']; + $params[4] = $remoteOwner['name'] . '@' . $remoteOwner['server']; + $notification->setParsedSubject( $l->t('You received "%3$s" as a remote share from %4$s (%1$s) (on behalf of %5$s (%2$s))', $params) ); - $initiator = $params[0]; - $owner = $params[1]; - $notification->setRichSubject( $l->t('You received {share} as a remote share from {user} (on behalf of {behalf})'), [ @@ -117,16 +119,18 @@ class Notifier implements INotifier { 'id' => $notification->getObjectId(), 'name' => $params[2], ], - 'user' => $this->createRemoteUser($initiator), - 'behalf' => $this->createRemoteUser($owner), + 'user' => $remoteInitiator, + 'behalf' => $remoteOwner, ] ); } else { + $remoteOwner = $this->createRemoteUser($params[0]); + $params[3] = $remoteOwner['name'] . '@' . $remoteOwner['server']; + $notification->setParsedSubject( $l->t('You received "%3$s" as a remote share from %4$s (%1$s)', $params) ); - $owner = $params[0]; $notification->setRichSubject( $l->t('You received {share} as a remote share from {user}'), @@ -136,7 +140,7 @@ class Notifier implements INotifier { 'id' => $notification->getObjectId(), 'name' => $params[2], ], - 'user' => $this->createRemoteUser($owner), + 'user' => $remoteOwner, ] ); } From 5728f23b578423ebaf4a9163fd8e9f74b9ad0476 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 3 Aug 2020 11:25:21 +0200 Subject: [PATCH 5/5] Short php syntax Signed-off-by: Joas Schilling --- apps/dav/lib/CardDAV/CardDavBackend.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 542ae43e0a..20c025b037 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -163,7 +163,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { '{DAV:}displayname' => $row['displayname'], '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'], '{http://calendarserver.org/ns/}getctag' => $row['synctoken'], - '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ?: '0', ]; $this->addOwnerPrincipal($addressBooks[$row['id']]); @@ -219,7 +219,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { '{DAV:}displayname' => $displayName, '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'], '{http://calendarserver.org/ns/}getctag' => $row['synctoken'], - '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ?: '0', '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $row['principaluri'], $readOnlyPropertyName => $readOnly, ]; @@ -249,7 +249,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { '{DAV:}displayname' => $row['displayname'], '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'], '{http://calendarserver.org/ns/}getctag' => $row['synctoken'], - '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ?: '0', ]; $this->addOwnerPrincipal($addressBooks[$row['id']]); @@ -296,7 +296,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { '{DAV:}displayname' => $row['displayname'], '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'], '{http://calendarserver.org/ns/}getctag' => $row['synctoken'], - '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ?: '0', ]; $this->addOwnerPrincipal($addressBook); @@ -330,7 +330,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { '{DAV:}displayname' => $row['displayname'], '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'], '{http://calendarserver.org/ns/}getctag' => $row['synctoken'], - '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ?: '0', ]; $this->addOwnerPrincipal($addressBook);