Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-02-10 08:52:41 +0300
committerGitHub <noreply@github.com>2017-02-10 08:52:41 +0300
commit020fa06d3426a10c7b0d7e3f91c224cb985f5fc0 (patch)
treecfae33229e924531dd29c4895a15195e9fb45b33
parenteb31895ad551de8e5a9d5d5e7a92eb45130750d2 (diff)
parent0ec38e2cf35b769902bf0273d7804dab1b30ba5b (diff)
Merge pull request #3411 from nextcloud/backport-3407-user-settings-email-accounts-table
[stable11] Update the email in the accounts table as well
-rw-r--r--core/Command/User/Setting.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/Command/User/Setting.php b/core/Command/User/Setting.php
index 368a0c15dcd..d7bb436783f 100644
--- a/core/Command/User/Setting.php
+++ b/core/Command/User/Setting.php
@@ -25,6 +25,7 @@ namespace OC\Core\Command\User;
use OC\Core\Command\Base;
use OCP\IConfig;
use OCP\IDBConnection;
+use OCP\IUser;
use OCP\IUserManager;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -174,6 +175,14 @@ class Setting extends Base {
return 1;
}
+ if ($app === 'settings' && $key === 'email') {
+ $user = $this->userManager->get($uid);
+ if ($user instanceof IUser) {
+ $user->setEMailAddress($input->getArgument('value'));
+ return 0;
+ }
+ }
+
$this->config->setUserValue($uid, $app, $key, $input->getArgument('value'));
return 0;
@@ -183,6 +192,14 @@ class Setting extends Base {
return 1;
}
+ if ($app === 'settings' && $key === 'email') {
+ $user = $this->userManager->get($uid);
+ if ($user instanceof IUser) {
+ $user->setEMailAddress('');
+ return 0;
+ }
+ }
+
$this->config->deleteUserValue($uid, $app, $key);
return 0;