aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Setup.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Setup.php')
-rw-r--r--lib/private/Setup.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/Setup.php b/lib/private/Setup.php
index d5ccde6bba3..1d7ea5e0e53 100644
--- a/lib/private/Setup.php
+++ b/lib/private/Setup.php
@@ -52,6 +52,7 @@ use OC\Preview\BackgroundCleanupJob;
use OCP\Defaults;
use OCP\IL10N;
use OCP\ILogger;
+use OCP\IUser;
use OCP\Security\ISecureRandom;
class Setup {
@@ -368,6 +369,14 @@ 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();
}