formatting

This commit is contained in:
1Day 2022-01-12 08:08:14 +01:00
parent 80a7b436ad
commit 94b66250c0

View file

@ -57,262 +57,263 @@ if (!isset($_GET['step'])) {
echo $cardheader;
?>
<p class="login-box-msg">This installer will lead you through the most crucial Steps of Controlpanel.gg`s
setup</p>
<p class="login-box-msg">This installer will lead you through the most crucial Steps of Controlpanel.gg`s
setup</p>
<p class="<?php print(checkPhpVersion() === "OK" ? "ok" : "notok"); ?>"> php
version: <?php echo phpversion(); ?> (required <?php echo $requirements["php"]; ?>)</p>
<p class="<?php print(getMySQLVersion() === "OK" ? "ok" : "notok"); ?>"> mysql
version: <?php echo getMySQLVersion(); ?> (minimum required <?php echo $requirements["mysql"]; ?>)</p>
<p class="<?php print(checkPhpVersion() === "OK" ? "ok" : "notok"); ?>"> php
version: <?php echo phpversion(); ?> (required <?php echo $requirements["php"]; ?>)</p>
<p class="<?php print(getMySQLVersion() === "OK" ? "ok" : "notok"); ?>"> mysql
version: <?php echo getMySQLVersion(); ?> (minimum required <?php echo $requirements["mysql"]; ?>)</p>
<p class="<?php print(sizeof(checkExtensions()) == 0 ? "ok" : "notok"); ?>"> Missing
extentions: <?php print(sizeof(checkExtensions()) == 0 ? "None" : "");
foreach (checkExtensions() as $ext) {
echo $ext . ", ";
} ?> (try to install anyway)</p>
<p class="<?php print(sizeof(checkExtensions()) == 0 ? "ok" : "notok"); ?>"> Missing
extentions: <?php print(sizeof(checkExtensions()) == 0 ? "None" : "");
foreach (checkExtensions() as $ext) {
echo $ext . ", ";
} ?> (try to install anyway)</p>
<!-- <p class="<?php print(getZipVersion() === "OK" ? "ok" : "notok"); ?>"> Zip
<!-- <p class="<?php print(getZipVersion() === "OK" ? "ok" : "notok"); ?>"> Zip
version: <?php echo getZipVersion(); ?> </p> -->
<p class="<?php print(getGitVersion() === "OK" ? "ok" : "notok"); ?>"> Git
version: <?php echo getGitVersion(); ?> </p>
<p class="<?php print(getGitVersion() === "OK" ? "ok" : "notok"); ?>"> Git
version: <?php echo getGitVersion(); ?> </p>
<p class="<?php print(getTarVersion() === "OK" ? "ok" : "notok"); ?>"> Tar
version: <?php echo getTarVersion(); ?> </p>
<p class="<?php print(getTarVersion() === "OK" ? "ok" : "notok"); ?>"> Tar
version: <?php echo getTarVersion(); ?> </p>
<a href="?step=2">
<button class="btn btn-primary">Lets go</button>
</a>
</div>
<a href="?step=2">
<button class="btn btn-primary">Lets go</button>
</a>
</div>
</div>
<?php
}
if (isset($_GET['step']) && $_GET['step'] == 2) {
echo $cardheader;
?>
<p class="login-box-msg">Lets start with your Database</p>
<?php if (isset($_GET['message'])) {
echo "<p class='notok'>" . $_GET['message'] . "</p>";
}
?>
echo $cardheader;
?>
<p class="login-box-msg">Lets start with your Database</p>
<?php if (isset($_GET['message'])) {
echo "<p class='notok'>" . $_GET['message'] . "</p>";
}
?>
<form method="POST" enctype="multipart/form-data" class="mb-3"
action="/install/forms.php" name="checkDB">
<form method="POST" enctype="multipart/form-data" class="mb-3"
action="/install/forms.php" name="checkDB">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<div class="custom-control mb-3">
<label for="database">Database Driver</label>
<input x-model="databasedriver" id="databasedriver" name="databasedriver"
type="text" required
value="mysql" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="databasehost">Database Host</label>
<input x-model="databasehost" id="databasehost" name="databasehost" type="text"
required
value="127.0.0.1" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="databaseport">Database Port</label>
<input x-model="databaseport" id="databaseport" name="databaseport"
type="number" required
value="3306" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="databaseuser">Database User</label>
<input x-model="databaseuser" id="databaseuser" name="databaseuser" type="text"
required
value="dashboarduser" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="databaseuserpass">Database User Password</label>
<input x-model="databaseuserpass" id="databaseuserpass" name="databaseuserpass"
type="text" required
class="form-control ">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="database">Database</label>
<input x-model="database" id="database" name="database" type="text" required
value="dashboard" class="form-control">
</div>
</div>
</div>
<button class="btn btn-primary" name="checkDB">Submit</button>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<div class="custom-control mb-3">
<label for="database">Database Driver</label>
<input x-model="databasedriver" id="databasedriver" name="databasedriver"
type="text" required
value="mysql" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="databasehost">Database Host</label>
<input x-model="databasehost" id="databasehost" name="databasehost" type="text"
required
value="127.0.0.1" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="databaseport">Database Port</label>
<input x-model="databaseport" id="databaseport" name="databaseport"
type="number" required
value="3306" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="databaseuser">Database User</label>
<input x-model="databaseuser" id="databaseuser" name="databaseuser" type="text"
required
value="dashboarduser" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="databaseuserpass">Database User Password</label>
<input x-model="databaseuserpass" id="databaseuserpass" name="databaseuserpass"
type="text" required
class="form-control ">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="database">Database</label>
<input x-model="database" id="database" name="database" type="text" required
value="dashboard" class="form-control">
</div>
</div>
</div>
<button class="btn btn-primary" name="checkDB">Submit</button>
</div>
</div>
</div>
<?php
}
if (isset($_GET['step']) && $_GET['step'] == 3) {
echo $cardheader;
?>
<p class="login-box-msg">Tell us something about your Host</p>
<?php if (isset($_GET['message'])) {
echo "<p class='notok'>" . $_GET['message'] . "</p>";
}
?>
<form method="POST" enctype="multipart/form-data" class="mb-3"
action="/install/forms.php" name="checkGeneral">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<div class="custom-control mb-3">
<label for="database">Your Dashboard URL</label>
<input id="url" name="url"
type="text" required
value="https://dash.example.com" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="name">Your Host-Name</label>
<input id="name" name="name" type="text"
required
value="Controlpanel.gg" class="form-control">
</div>
</div>
</div>
<button class="btn btn-primary" name="checkGeneral">Submit</button>
</div>
</div>
</div>
<?php
}
if (isset($_GET['step']) && $_GET['step'] == 4) {
echo $cardheader;
?>
<p class="login-box-msg">Lets get your E-Mails going! </p>
<p class="login-box-msg">This might take a few seconds when submitted! </p>
<?php if (isset($_GET['message'])) {
echo "<p class='notok'>" . $_GET['message'] . "</p>";
}
?>
<form method="POST" enctype="multipart/form-data" class="mb-3"
action="/install/forms.php" name="checkSMTP">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<div class="custom-control mb-3">
<label for="method">Your E-Mail method</label>
<input id="method" name="method"
type="text" required
value="smtp" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="host">Your Mailer-Host</label>
<input id="host" name="host" type="text"
required
value="smtp.google.com" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="port">Your Mail Port</label>
<input id="port" name="port" type="port"
required
value="567" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="user">Your Mail User</label>
<input id="user" name="user" type="text"
required
value="info@mydomain.com" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="pass">Your Mail-User Password</label>
<input id="pass" name="pass" type="password"
required
value="" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="encryption">Your Mail encryption method</label>
<input id="encryption" name="encryption" type="text"
required
value="tls" class="form-control">
</div>
</div>
</div>
<button class="btn btn-primary" name="checkSMTP">Submit</button>
</div>
</div>
</div>
<?php
}
if (isset($_GET['step']) && $_GET['step'] == 5) {
if (isset($_GET['exec'])) {
$path = dirname(__FILE__, 3);
$cmd = "cd '$path' && bash -c 'exec -a ServerCPP php artisan migrate --seed --force' 2>&1";
$resp = shell_exec($cmd);
shell_exec('php artisan migrate --seed --force');
}
if (isset($_GET['step']) && $_GET['step'] == 3) {
echo $cardheader;
?>
<p class="login-box-msg">Tell us something about your Host</p>
<?php if (isset($_GET['message'])) {
echo "<p class='notok'>" . $_GET['message'] . "</p>";
}
?>
<form method="POST" enctype="multipart/form-data" class="mb-3"
action="/install/forms.php" name="checkGeneral">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<div class="custom-control mb-3">
<label for="database">Your Dashboard URL</label>
<input id="url" name="url"
type="text" required
value="https://dash.example.com" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="name">Your Host-Name</label>
<input id="name" name="name" type="text"
required
value="Controlpanel.gg" class="form-control">
</div>
</div>
</div>
<button class="btn btn-primary" name="checkGeneral">Submit</button>
</div>
</div>
</div>
<?php
}
if (isset($_GET['step']) && $_GET['step'] == 4) {
echo $cardheader;
?>
<p class="login-box-msg">Lets get your E-Mails going! </p>
<p class="login-box-msg">This might take a few seconds when submitted! </p>
<?php if (isset($_GET['message'])) {
echo "<p class='notok'>" . $_GET['message'] . "</p>";
}
?>
<form method="POST" enctype="multipart/form-data" class="mb-3"
action="/install/forms.php" name="checkSMTP">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<div class="custom-control mb-3">
<label for="method">Your E-Mail method</label>
<input id="method" name="method"
type="text" required
value="smtp" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="host">Your Mailer-Host</label>
<input id="host" name="host" type="text"
required
value="smtp.google.com" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="port">Your Mail Port</label>
<input id="port" name="port" type="port"
required
value="567" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="user">Your Mail User</label>
<input id="user" name="user" type="text"
required
value="info@mydomain.com" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="pass">Your Mail-User Password</label>
<input id="pass" name="pass" type="password"
required
value="" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="encryption">Your Mail encryption method</label>
<input id="encryption" name="encryption" type="text"
required
value="tls" class="form-control">
</div>
</div>
</div>
<button class="btn btn-primary" name="checkSMTP">Submit</button>
</div>
</div>
</div>
<?php
}
if (isset($_GET['step']) && $_GET['step'] == 5) {
if (isset($_GET['exec'])) {
$path = dirname(__FILE__, 3);
$cmd = "cd '$path' && bash -c 'exec -a ServerCPP php artisan migrate --seed --force' 2>&1";
$resp = shell_exec($cmd);
shell_exec('php artisan migrate --seed --force');
}
echo $cardheader;
?>
<p class="login-box-msg">Almost done! </p>
<p class="login-box-msg">Lets get some info about your Pterodactyl Installation!</p>
<p class="alert alert-warning" role="alert">Before this Step make sure you ran <b>php artisan migrate --seed --force</b> in
<p class="alert alert-warning" role="alert">Before this Step make sure you ran <b>php artisan migrate --seed
--force</b> in
your Linux Terminal!</p>
<?php if(!isset($resp)){ ?>
<a href="?step=5&exec">
<button class="btn btn-success">You can also try to click here</button>
<?php if (!isset($resp)) { ?>
<a href="?step=5&exec">
<button class="btn btn-success">You can also try to click here</button>
</a>
<?php }else{
</a>
<?php } else {
echo
"<div class='alert alert-info'>";
print_r($resp);
echo "</div>";
}
}
?>
@ -349,108 +350,108 @@ if (isset($_GET['step']) && $_GET['step'] == 5) {
<button class="btn btn-primary" name="checkPtero">Submit</button>
</div>
</div>
</div>
</div>
</div>
<?php
}
<?php
}
if (isset($_GET['step']) && $_GET['step'] == 6) {
echo $cardheader;
?>
<p class="login-box-msg">Lets create yourself!</p>
<p class="login-box-msg">We're making the first Admin user</p>
<?php if (isset($_GET['message'])) {
echo "<p class='notok'>" . $_GET['message'] . "</p>";
}
?>
if (isset($_GET['step']) && $_GET['step'] == 6) {
echo $cardheader;
?>
<p class="login-box-msg">Lets create yourself!</p>
<p class="login-box-msg">We're making the first Admin user</p>
<?php if (isset($_GET['message'])) {
echo "<p class='notok'>" . $_GET['message'] . "</p>";
}
?>
<form method="POST" enctype="multipart/form-data" class="mb-3"
action="/install/forms.php" name="createUser">
<form method="POST" enctype="multipart/form-data" class="mb-3"
action="/install/forms.php" name="createUser">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<div class="custom-control mb-3">
<label for="user">Your Username</label>
<input id="user" name="user"
type="text" required
value="" class="form-control">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<div class="custom-control mb-3">
<label for="user">Your Username</label>
<input id="user" name="user"
type="text" required
value="" class="form-control">
</div>
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="email">Your Email Adress (used to Login)</label>
<input id="email" name="email"
type="text" required
value="" class="form-control">
<div class="form-group">
<div class="custom-control mb-3">
<label for="email">Your Email Adress (used to Login)</label>
<input id="email" name="email"
type="text" required
value="" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="pass">Password</label>
<input id="pass" name="pass" type="password"
required
value="" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="repass">Retype Pass</label>
<input id="repass" name="repass" type="password"
required
value="" minlength="8" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="repass">Your Pterodactyl User-ID</label>
<input id="pteroID" name="pteroID" type="text"
required
value="" minlength="8" class="form-control">
</div>
</div>
</div>
<button class="btn btn-primary" name="createUser">Submit</button>
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="pass">Password</label>
<input id="pass" name="pass" type="password"
required
value="" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="repass">Retype Pass</label>
<input id="repass" name="repass" type="password"
required
value="" minlength="8" class="form-control">
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3">
<label for="repass">Your Pterodactyl User-ID</label>
<input id="pteroID" name="pteroID" type="text"
required
value="" minlength="8" class="form-control">
</div>
</div>
</div>
<button class="btn btn-primary" name="createUser">Submit</button>
</div>
</div>
<?php
}
if (isset($_GET['step']) && $_GET['step'] == 7) {
$lockfile = fopen("install.lock", "w") or die("Unable to open file!");
fwrite($lockfile, "locked");
fclose($lockfile);
echo $cardheader;
?>
<p class="login-box-msg">All done!</p>
<p class="login-box-msg">You may navigate to your Dashboard now and log in!</p>
<a href="<?php echo "https://" . $_SERVER['SERVER_NAME']; ?>">
<button class="btn btn-success">Lets go!</button>
</a>
</div>
</div>
<?php
}
if (isset($_GET['step']) && $_GET['step'] == 7) {
$lockfile = fopen("install.lock", "w") or die("Unable to open file!");
fwrite($lockfile, "locked");
fclose($lockfile);
echo $cardheader;
?>
<p class="login-box-msg">All done!</p>
<p class="login-box-msg">You may navigate to your Dashboard now and log in!</p>
<a href="<?php echo "https://" . $_SERVER['SERVER_NAME']; ?>">
<button class="btn btn-success">Lets go!</button>
</a>
</div>
</div>
<?php
}
?>
</div>
<?php
}
?>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"></script>
</body>
</html>