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 8e6c181 commit 3481f6c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions install/createAdminUser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
//streamer config
require_once '../videos/configuration.php';

if (!isCommandLineInterface()) {
return die('Command Line only');
}
echo "Enter the username or press enter to skip:";
echo "\n";
ob_flush();
$userName = trim(readline(""));
echo "Enter the password:";
echo "\n";
ob_flush();
$userPass = trim(readline(""));

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();
}
echo "Bye";
echo "\n";
die();

0 comments on commit 3481f6c

Please sign in to comment.