diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2018-09-24 21:49:43 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-10-02 22:24:30 +0200 |
commit | 13877c2d2068189cff180ea8f4f62826afda6414 (patch) | |
tree | df6955e61f13f9376fb0410ba04e8b28b90c4577 /lib | |
parent | 6c805ec9baf4aa875cfcbffe5fa5384caff7b7e7 (diff) | |
download | nextcloud-server-13877c2d2068189cff180ea8f4f62826afda6414.tar.gz nextcloud-server-13877c2d2068189cff180ea8f4f62826afda6414.zip |
Use setUserValue instead setEMailAddress because latter omits an changeUser events.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Setup.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/private/Setup.php b/lib/private/Setup.php index 1d7ea5e0e53..9346edd8363 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -369,14 +369,6 @@ class Setup { if (!$user) { $error[] = "User <$username> could not be created."; } - if ($user instanceof IUser && !empty($options['adminemail'])) { - $adminEmail = htmlspecialchars_decode($options['adminemail']); - if (filter_var($adminEmail, FILTER_VALIDATE_EMAIL)) { - $user->setEMailAddress($adminEmail); - } else { - $error[] = "Invalid e-mail-address <$adminEmail> for <$username>."; - } - } } catch(Exception $exception) { $error[] = $exception->getMessage(); } @@ -421,6 +413,16 @@ class Setup { $userSession->setTokenProvider($defaultTokenProvider); $userSession->login($username, $password); $userSession->createSessionToken($request, $userSession->getUser()->getUID(), $username, $password); + + // Set email for admin + if (!empty($options['adminemail'])) { + $adminEmail = htmlspecialchars_decode($options['adminemail']); + if (filter_var($adminEmail, FILTER_VALIDATE_EMAIL)) { + $config->setUserValue($user->getUID(), 'settings', 'email', $adminEmail); + } else { + $error[] = "Invalid e-mail-address <$adminEmail> for <$username>."; + } + } } return $error; |