aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Traits/PrincipalProxyTrait.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/Traits/PrincipalProxyTrait.php')
-rw-r--r--apps/dav/lib/Traits/PrincipalProxyTrait.php43
1 files changed, 12 insertions, 31 deletions
diff --git a/apps/dav/lib/Traits/PrincipalProxyTrait.php b/apps/dav/lib/Traits/PrincipalProxyTrait.php
index 5da4e64a6df..feec485fe5c 100644
--- a/apps/dav/lib/Traits/PrincipalProxyTrait.php
+++ b/apps/dav/lib/Traits/PrincipalProxyTrait.php
@@ -1,28 +1,9 @@
<?php
+
/**
- * @copyright 2019, Georg Ehrke <oc.list@georgehrke.com>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Georg Ehrke <oc.list@georgehrke.com>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
-
namespace OCA\DAV\Traits;
use OCA\DAV\CalDAV\Proxy\Proxy;
@@ -77,7 +58,7 @@ trait PrincipalProxyTrait {
* @throws Exception
*/
public function getGroupMembership($principal, $needGroups = false) {
- list($prefix, $name) = \Sabre\Uri\split($principal);
+ [$prefix, $name] = \Sabre\Uri\split($principal);
if ($prefix !== $this->principalPrefix) {
return [];
@@ -113,7 +94,7 @@ trait PrincipalProxyTrait {
* @throws Exception
*/
public function setGroupMemberSet($principal, array $members) {
- list($principalUri, $target) = \Sabre\Uri\split($principal);
+ [$principalUri, $target] = \Sabre\Uri\split($principal);
if ($target !== 'calendar-proxy-write' && $target !== 'calendar-proxy-read') {
throw new Exception('Setting members of the group is not supported yet');
@@ -129,11 +110,11 @@ trait PrincipalProxyTrait {
$permission |= ProxyMapper::PERMISSION_WRITE;
}
- list($prefix, $owner) = \Sabre\Uri\split($principalUri);
+ [$prefix, $owner] = \Sabre\Uri\split($principalUri);
$proxies = $this->proxyMapper->getProxiesOf($principalUri);
foreach ($members as $member) {
- list($prefix, $name) = \Sabre\Uri\split($member);
+ [$prefix, $name] = \Sabre\Uri\split($member);
if ($prefix !== $this->principalPrefix) {
throw new Exception('Invalid member group prefix: ' . $prefix);
@@ -182,8 +163,8 @@ trait PrincipalProxyTrait {
* @return bool
*/
private function isProxyPrincipal(string $principalUri):bool {
- list($realPrincipalUri, $proxy) = \Sabre\Uri\split($principalUri);
- list($prefix, $userId) = \Sabre\Uri\split($realPrincipalUri);
+ [$realPrincipalUri, $proxy] = \Sabre\Uri\split($principalUri);
+ [$prefix, $userId] = \Sabre\Uri\split($realPrincipalUri);
if (!isset($prefix) || !isset($userId)) {
return false;
@@ -201,7 +182,7 @@ trait PrincipalProxyTrait {
* @return bool
*/
private function isReadProxyPrincipal(string $principalUri):bool {
- list(, $proxy) = \Sabre\Uri\split($principalUri);
+ [, $proxy] = \Sabre\Uri\split($principalUri);
return $proxy === 'calendar-proxy-read';
}
@@ -210,7 +191,7 @@ trait PrincipalProxyTrait {
* @return bool
*/
private function isWriteProxyPrincipal(string $principalUri):bool {
- list(, $proxy) = \Sabre\Uri\split($principalUri);
+ [, $proxy] = \Sabre\Uri\split($principalUri);
return $proxy === 'calendar-proxy-write';
}
@@ -219,7 +200,7 @@ trait PrincipalProxyTrait {
* @return string
*/
private function getPrincipalUriFromProxyPrincipal(string $principalUri):string {
- list($realPrincipalUri, ) = \Sabre\Uri\split($principalUri);
+ [$realPrincipalUri, ] = \Sabre\Uri\split($principalUri);
return $realPrincipalUri;
}
}