Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Feb 13, 2025
1 parent 3481f6c commit 5a981ed
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions install/createAdminUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@

if (!empty($userName) && !empty($userPass)) {
$user = new User(0, $userName, $userPass);
$user->setIsAdmin(1);
$user->setEmail("{$userName}@{$userName}.com");
$user->setName($userName);
$user->setEmailVerified(1);
$userId = $user->save();
if (!empty($user->getBdId())) {
echo "User already exists {$userName} id=".$user->getBdId();
echo "\n";
die();
} else{
$user->setIsAdmin(1);
$user->setEmail("{$userName}@{$userName}.com");
$user->setName($userName);
$user->setEmailVerified(1);
$userId = $user->save();
}
}
echo "Bye";
echo "\n";
Expand Down

0 comments on commit 5a981ed

Please sign in to comment.