From 460b667f8040036a2b1a9833ebc0c15d9f586666 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 8 Feb 2017 13:52:55 +0100 Subject: Update the email in the accounts table as well Signed-off-by: Joas Schilling --- core/Command/User/Setting.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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; -- cgit v1.2.3