summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Hefter <marchefter@gmail.com>2023-03-07 18:21:17 +0100
committerMarc Hefter <marchefter@gmail.com>2023-04-06 08:20:29 +0200
commit0c6d440643414151add23d4bf7eb4cff326f7b98 (patch)
tree8b60b4ed0b26685aabb51340e8fc81abba60953c
parentdd2bd6a925f0fb482a53eac61e46d680bb074c85 (diff)
downloadnextcloud-server-0c6d440643414151add23d4bf7eb4cff326f7b98.tar.gz
nextcloud-server-0c6d440643414151add23d4bf7eb4cff326f7b98.zip
undoing the additions to OC\IUser
removed changes from lib/public/IUser.php removed changes from lib/private/User/LazyUser.php removed changes from lib/private/User/User.php Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com> Signed-off-by: Marc Hefter <marchefter@gmail.com>
-rw-r--r--lib/private/User/LazyUser.php18
-rw-r--r--lib/private/User/User.php101
-rw-r--r--lib/public/IUser.php44
3 files changed, 0 insertions, 163 deletions
diff --git a/lib/private/User/LazyUser.php b/lib/private/User/LazyUser.php
index 0645983979f..096578b8f37 100644
--- a/lib/private/User/LazyUser.php
+++ b/lib/private/User/LazyUser.php
@@ -4,8 +4,6 @@ declare(strict_types=1);
/**
* @copyright Copyright (c) 2022 Robin Appelman <robin@icewind.nl>
*
- * @author Marc Hefter <marchefter@march42.net>
- *
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
@@ -147,20 +145,4 @@ class LazyUser implements IUser {
public function setQuota($quota) {
$this->getUser()->setQuota($quota);
}
-
- public function getProfilePropertyValue(string $property): ?string {
- return $this->getUser()->getProfilePropertyValue($property);
- }
-
- public function getProfilePropertyScope(string $property): ?string {
- return $this->getUser()->getProfilePropertyScope($property);
- }
-
- public function getProfilePropertyVerified(string $property): ?string {
- return $this->getUser()->getProfilePropertyVerified($property);
- }
-
- public function setProfileProperty(string $property, $value=null, $scope=null, $verified=null) {
- $this->getUser()->setProfileProperty($property, $value, $scope, $verified);
- }
}
diff --git a/lib/private/User/User.php b/lib/private/User/User.php
index 9449705358d..2d80dbc7adf 100644
--- a/lib/private/User/User.php
+++ b/lib/private/User/User.php
@@ -12,7 +12,6 @@
* @author Julius Härtl <jus@bitgrid.net>
* @author Leon Klingele <leon@struktur.de>
* @author Lukas Reschke <lukas@statuscode.ch>
- * @author Marc Hefter <marchefter@march42.net>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Robin Appelman <robin@icewind.nl>
* @author Roeland Jago Douma <roeland@famdouma.nl>
@@ -589,104 +588,4 @@ class User implements IUser {
$this->emitter->emit('\OC\User', 'changeUser', [$this, $feature, $value, $oldValue]);
}
}
-
- /**
- * @param string $property name of the AccountProperty
- * @return ?string AccountProperty value
- * @throws InvalidArgumentException when the property name is invalid or null
- */
- public function getProfilePropertyValue($property): ?string {
- if ($property === null) {
- throw new InvalidArgumentException('Property can not be null.');
- }
- // FIXME: check $property if it's one of the IAccountManager::PROPERTY_* public constants
-
- // FIXME: I need to get the AccountProperty value to return
- //return $this->config->getUserValue($this->uid, 'user_ldap', $property, null);
- $this->ensureAccountManager();
- $account = $this->accountManager->getAccount($this);
- $property = $account->getProperty($property);
- return $property->getValue();
- }
-
- /**
- * @param string $property name of the AccountProperty
- * @return ?string AccountProperty scope
- * @throws InvalidArgumentException when the property name is invalid or null
- */
- public function getProfilePropertyScope($property): ?string {
- if ($property === null) {
- throw new InvalidArgumentException('Property can not be null.');
- }
- $this->ensureAccountManager();
- $account = $this->accountManager->getAccount($this);
- // TODO: this should be stored locally, to reduce database overhead
- $property = $account->getProperty($property);
- return $property->getScope();
- }
-
- /**
- * @param string $property name of the AccountProperty
- * @return ?string AccountProperty verified
- * @throws InvalidArgumentException when the property name is invalid or null
- */
- public function getProfilePropertyVerified($property): ?string {
- if ($property === null) {
- throw new InvalidArgumentException('Property can not be null.');
- }
- $this->ensureAccountManager();
- $account = $this->accountManager->getAccount($this);
- // TODO: this should be stored locally, to reduce database overhead
- $property = $account->getProperty($property);
- return $property->getVerified();
- }
-
- /**
- * @param string $property name of the AccountProperty
- * @param string $value AccountProperty value
- * @param string $scope AccountProperty scope
- * @param string $verified AccountProperty verified
- * @return void
- * @throws InvalidArgumentException when the property name is invalid or null
- */
- public function setProfileProperty($property, $value=null, $scope=null, $verified=null) {
- if ($property === null) {
- throw new InvalidArgumentException('Property can not be null.');
- }
- // FIXME: check $property if it's one of the IAccountManager::PROPERTY_* public constants
- $this->ensureAccountManager();
- $account = $this->accountManager->getAccount($this);
- $property = $account->getProperty($property);
- if (null !== $value) {
- $property->setValue($value);
- }
- if (null !== $scope) {
- // FIXME: should I default to IAccountManager::SCOPE_FEDERATED
- $property->setScope($scope);
- }
- if (null !== $verified) {
- // FIXME: should I default to IAccountManager::VERIFIED
- $property->setVerified($verified);
- }
- $this->accountManager->updateAccount($account);
- return;
- }
-
- /**
- * @param string $property name of the AccountProperty
- * @param string $value AccountProperty value
- * @return void
- * @throws InvalidArgumentException when the property name is invalid or null
- */
- public function setProfilePropertyValue($property, $value) {
- if ($property === null) {
- throw new InvalidArgumentException('Property can not be null.');
- }
- $this->ensureAccountManager();
- $account = $this->accountManager->getAccount($this);
- $property = $account->getProperty($property);
- $property->setValue($value);
- $this->accountManager->updateAccount($account);
- return;
- }
}
diff --git a/lib/public/IUser.php b/lib/public/IUser.php
index f942e6f036f..3a7e6ab1f11 100644
--- a/lib/public/IUser.php
+++ b/lib/public/IUser.php
@@ -5,7 +5,6 @@
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author John Molakvoæ <skjnldsv@protonmail.com>
* @author Lukas Reschke <lukas@statuscode.ch>
- * @author Marc Hefter <marchefter@march42.net>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Robin Appelman <robin@icewind.nl>
* @author Roeland Jago Douma <roeland@famdouma.nl>
@@ -271,47 +270,4 @@ interface IUser {
* @since 9.0.0
*/
public function setQuota($quota);
-
- /**
- * get users' profile property value.
- *
- * @param string $property name see IAccountManager::PROPERTY_*
- * @return string AccountProperty value
- * @throws InvalidArgumentException when the property name is invalid or null
- * @since 27.0.0
- */
- public function getProfilePropertyValue(string $property): ?string;
-
- /**
- * get users' profile property scope.
- *
- * @param string $property name see IAccountManager::PROPERTY_*
- * @return string AccountProperty scope IAccountManager::SCOPE_*
- * @throws InvalidArgumentException when the property name is invalid or null
- * @since 27.0.0
- */
- public function getProfilePropertyScope(string $property): ?string;
-
- /**
- * get users' profile property verified.
- *
- * @param string $property name see IAccountManager::PROPERTY_*
- * @return string AccountProperty verification status IAccountManager::NOT_VERIFIED/VERIFICATION_IN_PROGRESS/VERIFIED
- * @throws InvalidArgumentException when the property name is invalid or null
- * @since 27.0.0
- */
- public function getProfilePropertyVerified(string $property): ?string;
-
- /**
- * set users' profile property value,scope,verified.
- *
- * @param string $property name from IAccountManager::PROPERTY_*
- * @param string $value AccountProperty value
- * @param string $scope AccountProperty scope
- * @param string $verified AccountProperty verified
- * @return void
- * @throws InvalidArgumentException when the property name is invalid or null
- * @since 27.0.0
- */
- public function setProfileProperty(string $property, $value=null, $scope=null, $verified=null);
}