Skip to content
Snippets Groups Projects
Commit f33760c7 authored by Björn Schießle's avatar Björn Schießle Committed by GitHub
Browse files

Merge pull request #3407 from nextcloud/issue-3312-user-settings-email-accounts-table

Update the email in the accounts table as well
parents ac841ee0 460b667f
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment