aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Accounts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Accounts')
-rw-r--r--lib/private/Accounts/Account.php23
-rw-r--r--lib/private/Accounts/AccountManager.php347
-rw-r--r--lib/private/Accounts/AccountProperty.php50
-rw-r--r--lib/private/Accounts/AccountPropertyCollection.php23
-rw-r--r--lib/private/Accounts/Hooks.php24
-rw-r--r--lib/private/Accounts/TAccountsHelper.php23
6 files changed, 244 insertions, 246 deletions
diff --git a/lib/private/Accounts/Account.php b/lib/private/Accounts/Account.php
index bc74c85eac2..946168d7755 100644
--- a/lib/private/Accounts/Account.php
+++ b/lib/private/Accounts/Account.php
@@ -3,27 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net>
- *
- * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Julius Härtl <jus@bitgrid.net>
- *
- * @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: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\Accounts;
diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php
index 97156a027e6..d00b1d2e9a3 100644
--- a/lib/private/Accounts/AccountManager.php
+++ b/lib/private/Accounts/AccountManager.php
@@ -1,36 +1,9 @@
<?php
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- * @copyright Copyright (c) 2016, Björn Schießle
- *
- * @author Bjoern Schiessle <bjoern@schiessle.org>
- * @author Björn Schießle <bjoern@schiessle.org>
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Daniel Calviño Sánchez <danxuliu@gmail.com>
- * @author Daniel Kesselberg <mail@danielkesselberg.de>
- * @author Joas Schilling <coding@schilljs.com>
- * @author Julius Härtl <jus@bitgrid.net>
- * @author Lukas Reschke <lukas@statuscode.ch>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- * @author Thomas Citharel <nextcloud@tcit.fr>
- * @author Vincent Petry <vincent@nextcloud.com>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * 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, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OC\Accounts;
@@ -50,6 +23,7 @@ use OCP\Cache\CappedMemoryCache;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Defaults;
use OCP\EventDispatcher\IEventDispatcher;
+use OCP\Http\Client\IClientService;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\IL10N;
@@ -91,18 +65,21 @@ class AccountManager implements IAccountManager {
* The list of default scopes for each property.
*/
public const DEFAULT_SCOPES = [
- self::PROPERTY_DISPLAYNAME => self::SCOPE_FEDERATED,
self::PROPERTY_ADDRESS => self::SCOPE_LOCAL,
- self::PROPERTY_WEBSITE => self::SCOPE_LOCAL,
- self::PROPERTY_EMAIL => self::SCOPE_FEDERATED,
self::PROPERTY_AVATAR => self::SCOPE_FEDERATED,
- self::PROPERTY_PHONE => self::SCOPE_LOCAL,
- self::PROPERTY_TWITTER => self::SCOPE_LOCAL,
+ self::PROPERTY_BIOGRAPHY => self::SCOPE_LOCAL,
+ self::PROPERTY_BIRTHDATE => self::SCOPE_LOCAL,
+ self::PROPERTY_DISPLAYNAME => self::SCOPE_FEDERATED,
+ self::PROPERTY_EMAIL => self::SCOPE_FEDERATED,
self::PROPERTY_FEDIVERSE => self::SCOPE_LOCAL,
+ self::PROPERTY_HEADLINE => self::SCOPE_LOCAL,
self::PROPERTY_ORGANISATION => self::SCOPE_LOCAL,
+ self::PROPERTY_PHONE => self::SCOPE_LOCAL,
+ self::PROPERTY_PRONOUNS => self::SCOPE_FEDERATED,
self::PROPERTY_ROLE => self::SCOPE_LOCAL,
- self::PROPERTY_HEADLINE => self::SCOPE_LOCAL,
- self::PROPERTY_BIOGRAPHY => self::SCOPE_LOCAL,
+ self::PROPERTY_TWITTER => self::SCOPE_LOCAL,
+ self::PROPERTY_BLUESKY => self::SCOPE_LOCAL,
+ self::PROPERTY_WEBSITE => self::SCOPE_LOCAL,
];
public function __construct(
@@ -118,51 +95,12 @@ class AccountManager implements IAccountManager {
private IURLGenerator $urlGenerator,
private ICrypto $crypto,
private IPhoneNumberUtil $phoneNumberUtil,
+ private IClientService $clientService,
) {
$this->internalCache = new CappedMemoryCache();
}
/**
- * @return string Provided phone number in E.164 format when it was a valid number
- * @throws InvalidArgumentException When the phone number was invalid or no default region is set and the number doesn't start with a country code
- */
- protected function parsePhoneNumber(string $input): string {
- $defaultRegion = $this->config->getSystemValueString('default_phone_region', '');
-
- if ($defaultRegion === '') {
- // When no default region is set, only +49… numbers are valid
- if (!str_starts_with($input, '+')) {
- throw new InvalidArgumentException(self::PROPERTY_PHONE);
- }
-
- $defaultRegion = 'EN';
- }
-
- $phoneNumber = $this->phoneNumberUtil->convertToStandardFormat($input, $defaultRegion);
- if ($phoneNumber !== null) {
- return $phoneNumber;
- }
-
- throw new InvalidArgumentException(self::PROPERTY_PHONE);
- }
-
- /**
- * @throws InvalidArgumentException When the website did not have http(s) as protocol or the host name was empty
- */
- protected function parseWebsite(string $input): string {
- $parts = parse_url($input);
- if (!isset($parts['scheme']) || ($parts['scheme'] !== 'https' && $parts['scheme'] !== 'http')) {
- throw new InvalidArgumentException(self::PROPERTY_WEBSITE);
- }
-
- if (!isset($parts['host']) || $parts['host'] === '') {
- throw new InvalidArgumentException(self::PROPERTY_WEBSITE);
- }
-
- return $input;
- }
-
- /**
* @param IAccountProperty[] $properties
*/
protected function testValueLengths(array $properties, bool $throwOnData = false): void {
@@ -194,45 +132,7 @@ class AccountManager implements IAccountManager {
$property->setScope(self::SCOPE_LOCAL);
}
} else {
- // migrate scope values to the new format
- // invalid scopes are mapped to a default value
- $property->setScope(AccountProperty::mapScopeToV2($property->getScope()));
- }
- }
-
- protected function sanitizePhoneNumberValue(IAccountProperty $property, bool $throwOnData = false): void {
- if ($property->getName() !== self::PROPERTY_PHONE) {
- if ($throwOnData) {
- throw new InvalidArgumentException(sprintf('sanitizePhoneNumberValue can only sanitize phone numbers, %s given', $property->getName()));
- }
- return;
- }
- if ($property->getValue() === '') {
- return;
- }
- try {
- $property->setValue($this->parsePhoneNumber($property->getValue()));
- } catch (InvalidArgumentException $e) {
- if ($throwOnData) {
- throw $e;
- }
- $property->setValue('');
- }
- }
-
- protected function sanitizeWebsite(IAccountProperty $property, bool $throwOnData = false): void {
- if ($property->getName() !== self::PROPERTY_WEBSITE) {
- if ($throwOnData) {
- throw new InvalidArgumentException(sprintf('sanitizeWebsite can only sanitize web domains, %s given', $property->getName()));
- }
- }
- try {
- $property->setValue($this->parseWebsite($property->getValue()));
- } catch (InvalidArgumentException $e) {
- if ($throwOnData) {
- throw $e;
- }
- $property->setValue('');
+ $property->setScope($property->getScope());
}
}
@@ -268,7 +168,7 @@ class AccountManager implements IAccountManager {
$query = $this->connection->getQueryBuilder();
$query->delete($this->table)
->where($query->expr()->eq('uid', $query->createNamedParameter($uid)))
- ->execute();
+ ->executeStatement();
$this->deleteUserData($user);
}
@@ -281,7 +181,7 @@ class AccountManager implements IAccountManager {
$query = $this->connection->getQueryBuilder();
$query->delete($this->dataTable)
->where($query->expr()->eq('uid', $query->createNamedParameter($uid)))
- ->execute();
+ ->executeStatement();
}
/**
@@ -665,6 +565,13 @@ class AccountManager implements IAccountManager {
],
[
+ 'name' => self::PROPERTY_BLUESKY,
+ 'value' => '',
+ 'scope' => $scopes[self::PROPERTY_BLUESKY],
+ 'verified' => self::NOT_VERIFIED,
+ ],
+
+ [
'name' => self::PROPERTY_FEDIVERSE,
'value' => '',
'scope' => $scopes[self::PROPERTY_FEDIVERSE],
@@ -696,9 +603,21 @@ class AccountManager implements IAccountManager {
],
[
+ 'name' => self::PROPERTY_BIRTHDATE,
+ 'value' => '',
+ 'scope' => $scopes[self::PROPERTY_BIRTHDATE],
+ ],
+
+ [
'name' => self::PROPERTY_PROFILE_ENABLED,
'value' => $this->isProfileEnabledByDefault($this->config) ? '1' : '0',
],
+
+ [
+ 'name' => self::PROPERTY_PRONOUNS,
+ 'value' => '',
+ 'scope' => $scopes[self::PROPERTY_PRONOUNS],
+ ],
];
}
@@ -748,18 +667,206 @@ class AccountManager implements IAccountManager {
return $account;
}
+ /**
+ * Converts value (phone number) in E.164 format when it was a valid number
+ * @throws InvalidArgumentException When the phone number was invalid or no default region is set and the number doesn't start with a country code
+ */
+ protected function sanitizePropertyPhoneNumber(IAccountProperty $property): void {
+ $defaultRegion = $this->config->getSystemValueString('default_phone_region', '');
+
+ if ($defaultRegion === '') {
+ // When no default region is set, only +49… numbers are valid
+ if (!str_starts_with($property->getValue(), '+')) {
+ throw new InvalidArgumentException(self::PROPERTY_PHONE);
+ }
+
+ $defaultRegion = 'EN';
+ }
+
+ $phoneNumber = $this->phoneNumberUtil->convertToStandardFormat($property->getValue(), $defaultRegion);
+ if ($phoneNumber === null) {
+ throw new InvalidArgumentException(self::PROPERTY_PHONE);
+ }
+ $property->setValue($phoneNumber);
+ }
+
+ /**
+ * @throws InvalidArgumentException When the website did not have http(s) as protocol or the host name was empty
+ */
+ private function sanitizePropertyWebsite(IAccountProperty $property): void {
+ $parts = parse_url($property->getValue());
+ if (!isset($parts['scheme']) || ($parts['scheme'] !== 'https' && $parts['scheme'] !== 'http')) {
+ throw new InvalidArgumentException(self::PROPERTY_WEBSITE);
+ }
+
+ if (!isset($parts['host']) || $parts['host'] === '') {
+ throw new InvalidArgumentException(self::PROPERTY_WEBSITE);
+ }
+ }
+
+ /**
+ * @throws InvalidArgumentException If the property value is not a valid user handle according to X's rules
+ */
+ private function sanitizePropertyTwitter(IAccountProperty $property): void {
+ if ($property->getName() === self::PROPERTY_TWITTER) {
+ $matches = [];
+ // twitter handles only contain alpha numeric characters and the underscore and must not be longer than 15 characters
+ if (preg_match('/^@?([a-zA-Z0-9_]{2,15})$/', $property->getValue(), $matches) !== 1) {
+ throw new InvalidArgumentException(self::PROPERTY_TWITTER);
+ }
+
+ // drop the leading @ if any to make it the valid handle
+ $property->setValue($matches[1]);
+
+ }
+ }
+
+ private function validateBlueSkyHandle(string $text): bool {
+ if ($text === '') {
+ return true;
+ }
+
+ $lowerText = strtolower($text);
+
+ if ($lowerText === 'bsky.social') {
+ // "bsky.social" itself is not a valid handle
+ return false;
+ }
+
+ if (str_ends_with($lowerText, '.bsky.social')) {
+ $parts = explode('.', $lowerText);
+
+ // Must be exactly: username.bsky.social → 3 parts
+ if (count($parts) !== 3 || $parts[1] !== 'bsky' || $parts[2] !== 'social') {
+ return false;
+ }
+
+ $username = $parts[0];
+
+ // Must be 3–18 chars, alphanumeric/hyphen, no start/end hyphen
+ return preg_match('/^[a-z0-9][a-z0-9-]{2,17}$/', $username) === 1;
+ }
+
+ // Allow custom domains (Bluesky handle via personal domain)
+ return filter_var($text, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) !== false;
+ }
+
+
+ private function sanitizePropertyBluesky(IAccountProperty $property): void {
+ if ($property->getName() === self::PROPERTY_BLUESKY) {
+ if (!$this->validateBlueSkyHandle($property->getValue())) {
+ throw new InvalidArgumentException(self::PROPERTY_BLUESKY);
+ }
+
+ $property->setValue($property->getValue());
+ }
+ }
+
+ /**
+ * @throws InvalidArgumentException If the property value is not a valid fediverse handle (username@instance where instance is a valid domain)
+ */
+ private function sanitizePropertyFediverse(IAccountProperty $property): void {
+ if ($property->getName() === self::PROPERTY_FEDIVERSE) {
+ $matches = [];
+ if (preg_match('/^@?([^@\s\/\\\]+)@([^\s\/\\\]+)$/', trim($property->getValue()), $matches) !== 1) {
+ throw new InvalidArgumentException(self::PROPERTY_FEDIVERSE);
+ }
+
+ [, $username, $instance] = $matches;
+ $validated = filter_var($instance, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME);
+ if ($validated !== $instance) {
+ throw new InvalidArgumentException(self::PROPERTY_FEDIVERSE);
+ }
+
+ if ($this->config->getSystemValueBool('has_internet_connection', true)) {
+ $client = $this->clientService->newClient();
+
+ try {
+ // try the public account lookup API of mastodon
+ $response = $client->get("https://{$instance}/.well-known/webfinger?resource=acct:{$username}@{$instance}");
+ // should be a json response with account information
+ $data = $response->getBody();
+ if (is_resource($data)) {
+ $data = stream_get_contents($data);
+ }
+ $decoded = json_decode($data, true);
+ // ensure the username is the same the user passed
+ // in this case we can assume this is a valid fediverse server and account
+ if (!is_array($decoded) || ($decoded['subject'] ?? '') !== "acct:{$username}@{$instance}") {
+ throw new InvalidArgumentException();
+ }
+ // check for activitypub link
+ if (is_array($decoded['links']) && isset($decoded['links'])) {
+ $found = false;
+ foreach ($decoded['links'] as $link) {
+ // have application/activity+json or application/ld+json
+ if (isset($link['type']) && (
+ $link['type'] === 'application/activity+json'
+ || $link['type'] === 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
+ )) {
+ $found = true;
+ break;
+ }
+ }
+ if (!$found) {
+ throw new InvalidArgumentException();
+ }
+ }
+ } catch (InvalidArgumentException) {
+ throw new InvalidArgumentException(self::PROPERTY_FEDIVERSE);
+ } catch (\Exception $error) {
+ $this->logger->error('Could not verify fediverse account', ['exception' => $error, 'instance' => $instance]);
+ throw new InvalidArgumentException(self::PROPERTY_FEDIVERSE);
+ }
+ }
+
+ $property->setValue("$username@$instance");
+ }
+ }
+
public function updateAccount(IAccount $account): void {
$this->testValueLengths(iterator_to_array($account->getAllProperties()), true);
try {
$property = $account->getProperty(self::PROPERTY_PHONE);
- $this->sanitizePhoneNumberValue($property);
+ if ($property->getValue() !== '') {
+ $this->sanitizePropertyPhoneNumber($property);
+ }
} catch (PropertyDoesNotExistException $e) {
// valid case, nothing to do
}
try {
$property = $account->getProperty(self::PROPERTY_WEBSITE);
- $this->sanitizeWebsite($property);
+ if ($property->getValue() !== '') {
+ $this->sanitizePropertyWebsite($property);
+ }
+ } catch (PropertyDoesNotExistException $e) {
+ // valid case, nothing to do
+ }
+
+ try {
+ $property = $account->getProperty(self::PROPERTY_TWITTER);
+ if ($property->getValue() !== '') {
+ $this->sanitizePropertyTwitter($property);
+ }
+ } catch (PropertyDoesNotExistException $e) {
+ // valid case, nothing to do
+ }
+
+ try {
+ $property = $account->getProperty(self::PROPERTY_BLUESKY);
+ if ($property->getValue() !== '') {
+ $this->sanitizePropertyBluesky($property);
+ }
+ } catch (PropertyDoesNotExistException $e) {
+ // valid case, nothing to do
+ }
+
+ try {
+ $property = $account->getProperty(self::PROPERTY_FEDIVERSE);
+ if ($property->getValue() !== '') {
+ $this->sanitizePropertyFediverse($property);
+ }
} catch (PropertyDoesNotExistException $e) {
// valid case, nothing to do
}
diff --git a/lib/private/Accounts/AccountProperty.php b/lib/private/Accounts/AccountProperty.php
index 207dc1d139d..3a89e9bbc7a 100644
--- a/lib/private/Accounts/AccountProperty.php
+++ b/lib/private/Accounts/AccountProperty.php
@@ -3,27 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net>
- *
- * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
- * @author Julius Härtl <jus@bitgrid.net>
- * @author Vincent Petry <vincent@nextcloud.com>
- *
- * @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: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\Accounts;
@@ -32,6 +13,9 @@ use OCP\Accounts\IAccountManager;
use OCP\Accounts\IAccountProperty;
class AccountProperty implements IAccountProperty {
+ /**
+ * @var IAccountManager::SCOPE_*
+ */
private string $scope;
private string $locallyVerified = IAccountManager::NOT_VERIFIED;
@@ -71,16 +55,11 @@ class AccountProperty implements IAccountProperty {
* @since 15.0.0
*/
public function setScope(string $scope): IAccountProperty {
- $newScope = $this->mapScopeToV2($scope);
- if (!in_array($newScope, [
- IAccountManager::SCOPE_LOCAL,
- IAccountManager::SCOPE_FEDERATED,
- IAccountManager::SCOPE_PRIVATE,
- IAccountManager::SCOPE_PUBLISHED
- ])) {
+ if (!in_array($scope, IAccountManager::ALLOWED_SCOPES, )) {
throw new InvalidArgumentException('Invalid scope');
}
- $this->scope = $newScope;
+ /** @var IAccountManager::SCOPE_* $scope */
+ $this->scope = $scope;
return $this;
}
@@ -121,19 +100,6 @@ class AccountProperty implements IAccountProperty {
return $this->scope;
}
- public static function mapScopeToV2(string $scope): string {
- if (str_starts_with($scope, 'v2-')) {
- return $scope;
- }
-
- return match ($scope) {
- IAccountManager::VISIBILITY_PRIVATE, '' => IAccountManager::SCOPE_LOCAL,
- IAccountManager::VISIBILITY_CONTACTS_ONLY => IAccountManager::SCOPE_FEDERATED,
- IAccountManager::VISIBILITY_PUBLIC => IAccountManager::SCOPE_PUBLISHED,
- default => $scope,
- };
- }
-
/**
* Get the verification status of a property
*
diff --git a/lib/private/Accounts/AccountPropertyCollection.php b/lib/private/Accounts/AccountPropertyCollection.php
index 660a245714d..75eea76e686 100644
--- a/lib/private/Accounts/AccountPropertyCollection.php
+++ b/lib/private/Accounts/AccountPropertyCollection.php
@@ -1,29 +1,10 @@
<?php
declare(strict_types=1);
-
/**
- * @copyright Copyright (c) 2021 Arthur Schiwon <blizzz@arthur-schiwon.de>
- *
- * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
- *
- * @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 <https://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
-
namespace OC\Accounts;
use InvalidArgumentException;
diff --git a/lib/private/Accounts/Hooks.php b/lib/private/Accounts/Hooks.php
index b449c41c1da..12f2b4777f8 100644
--- a/lib/private/Accounts/Hooks.php
+++ b/lib/private/Accounts/Hooks.php
@@ -1,26 +1,8 @@
<?php
+
/**
- * @copyright Copyright (c) 2016 Bjoern Schiessle <bjoern@schiessle.org>
- *
- * @author Bjoern Schiessle <bjoern@schiessle.org>
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Joas Schilling <coding@schilljs.com>
- *
- * @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: 2016 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\Accounts;
diff --git a/lib/private/Accounts/TAccountsHelper.php b/lib/private/Accounts/TAccountsHelper.php
index f3be6523d29..69d25d9a933 100644
--- a/lib/private/Accounts/TAccountsHelper.php
+++ b/lib/private/Accounts/TAccountsHelper.php
@@ -1,29 +1,10 @@
<?php
declare(strict_types=1);
-
/**
- * @copyright Copyright (c) 2021 Arthur Schiwon <blizzz@arthur-schiwon.de>
- *
- * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
- *
- * @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 <https://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
-
namespace OC\Accounts;
use OCP\Accounts\IAccountManager;