diff options
author | Joas Schilling <coding@schilljs.com> | 2021-03-31 15:18:25 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-03-31 15:18:25 +0200 |
commit | fcedbc85d08f66b296416b00774d8a3ca3ba5257 (patch) | |
tree | 7ea81e041962c6eee25eea0b16543c051303a61d /lib/private | |
parent | b67ac4ec9bc0b8ab82765f11267e7c9cbd6988a6 (diff) | |
download | nextcloud-server-fcedbc85d08f66b296416b00774d8a3ca3ba5257.tar.gz nextcloud-server-fcedbc85d08f66b296416b00774d8a3ca3ba5257.zip |
Allow apps to write/update account data
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Accounts/AccountManager.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php index 6198f8dbddd..7b08fa3e598 100644 --- a/lib/private/Accounts/AccountManager.php +++ b/lib/private/Accounts/AccountManager.php @@ -510,4 +510,18 @@ class AccountManager implements IAccountManager { public function getAccount(IUser $user): IAccount { return $this->parseAccountData($user, $this->getUser($user)); } + + public function updateAccount(IAccount $account): void { + $data = []; + + foreach ($account->getProperties() as $property) { + $data[$property->getName()] = [ + 'value' => $property->getValue(), + 'scope' => $property->getScope(), + 'verified' => $property->getVerified(), + ]; + } + + $this->updateUser($account->getUser(), $data, true); + } } |