Update the email in the accounts table as well

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-02-08 13:52:55 +01:00
parent 1aba2d9ed8
commit 460b667f80
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 17 additions and 0 deletions

View File

@ -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;