diff options
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; |