Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable11] Update the email in the accounts table as well #3411

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions core/Command/User/Setting.php
Expand Up @@ -25,6 +25,7 @@
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;
Expand Down Expand Up @@ -174,6 +175,14 @@ protected function execute(InputInterface $input, OutputInterface $output) {
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;

Expand All @@ -183,6 +192,14 @@ protected function execute(InputInterface $input, OutputInterface $output) {
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;

Expand Down