aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2017-02-09 12:10:45 +0100
committerGitHub <noreply@github.com>2017-02-09 12:10:45 +0100
commitf33760c7f118003dfae753a2b678ae86c58b14ac (patch)
treea7172c837e12724cdee16bc3d5d56f4137dfb16a /core
parentac841ee002b7984288a67f845d23777bcf0caa4d (diff)
parent460b667f8040036a2b1a9833ebc0c15d9f586666 (diff)
downloadnextcloud-server-f33760c7f118003dfae753a2b678ae86c58b14ac.tar.gz
nextcloud-server-f33760c7f118003dfae753a2b678ae86c58b14ac.zip
Merge pull request #3407 from nextcloud/issue-3312-user-settings-email-accounts-table
Update the email in the accounts table as well
Diffstat (limited to 'core')
-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;