Skip to content

Commit c152b39

Browse files
committed
Fix install.php
1 parent 0c7a918 commit c152b39

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

html/install.php

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
$configfile = 'config.php';
33
require_once $configfile;
4-
if (isset($install) && !$install) {
4+
/*if (isset($install) && !$install) {
55
header("Location: /");
6-
}
6+
}*/
77
function test_input($data)
88
{
99
$data = trim($data);
@@ -14,7 +14,6 @@ function test_input($data)
1414
$displaysubmit = "none";
1515
// Get post and check if connection to mysql db is successful
1616
if (array_key_exists('validate', $_POST)) {
17-
$STEAMWEBAPI_KEYI = test_input($_POST["steamwebapi-key"]);
1817
$DB_SERVERI = test_input($_POST["input-ip"]);
1918
$DB_USERNAMEI = test_input($_POST["input-username"]);
2019
$DB_PASSWORDI = test_input($_POST["input-password"]);
@@ -35,12 +34,10 @@ function test_input($data)
3534
}
3635
// Write the data into the config file and create the server table
3736
if (array_key_exists('submit', $_POST)) {
38-
$STEAMWEBAPI_KEYI = test_input($_POST["steamwebapi-key"]);
3937
$DB_SERVERI = test_input($_POST["input-ip"]);
4038
$DB_USERNAMEI = test_input($_POST["input-username"]);
4139
$DB_PASSWORDI = test_input($_POST["input-password"]);
4240
$DB_NAMEI = test_input($_POST["input-dbname"]);
43-
$STEAMWEBAPI_KEY = $STEAMWEBAPI_KEYI;
4441
$DB_SERVER = $DB_SERVERI;
4542
$DB_USERNAME = $DB_USERNAMEI;
4643
$DB_PASSWORD = $DB_PASSWORDI;
@@ -66,18 +63,17 @@ function test_input($data)
6663
$write = "<?php" . "\n" .
6764
'include ("langconf.php");' . "\n" .
6865
'$install = 0;' . "\n" .
69-
'$STEAMWEBAPI_KEY = "' . $STEAMWEBAPI_KEYI . '";' . "\n\n" .
66+
'$steamwebapi_key = "";' . "\n" .
67+
'$rustmapsapi_key = "";' . "\n" .
7068
'$DB_SERVER = "' . $DB_SERVERI . '";' . "\n" .
7169
'$DB_USERNAME = "' . $DB_USERNAMEI . '";' . "\n" .
7270
'$DB_PASSWORD = "' . $DB_PASSWORDI . '";' . "\n" .
7371
'$DB_NAME = "' . $DB_NAMEI . '";' . "\n" .
72+
'$css_template = "summer-night";' . "\n" .
7473
'$steamapi = "https://api.steampowered.com/";' . "\n" .
7574
'$lang = "en";' . "\n" .
7675
'$register = TRUE;' . "\n" .
7776
"?>";
78-
echo '<script>';
79-
echo 'alert("Config file created!")';
80-
echo '</script>';
8177
fwrite($myfile, $write);
8278
fclose($myfile);
8379
$register = TRUE;
@@ -89,7 +85,7 @@ function test_input($data)
8985
.adddbdiv {
9086
margin: auto;
9187
width: 500px;
92-
height: 500px;
88+
/*height: 500px;*/
9389
background-color: #2B2F43;
9490
border-radius: 14px;
9591
color: white;
@@ -100,7 +96,7 @@ function test_input($data)
10096
.cAx {
10197
font-family: Helvetica,sans-serif;
10298
border-bottom: solid;
103-
margin: 15px 0 9px;
99+
margin: 0 0 15px;
104100
letter-spacing: 3px;
105101
font-size: 23px;
106102
}
@@ -139,10 +135,8 @@ function test_input($data)
139135
<div class="adddbdiv">
140136
<div class="padding25">
141137
<?php if (!isset($register)):?>
142-
<h2 style="margin: 0 0 10px;font-family: Helvetica,sans-serif;">Settings</h2>
143-
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
144-
<div class="input"><label for="steamwebapi-key">Steam Web API Key:</label><input id="steamwebapi-key" class="inputstyle" name="steamwebapi-key" type="password" required="required" minlength="32" maxlength="32" placeholder="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" autocomplete="off" <?php if (isset($STEAMWEBAPI_KEY)){echo "value=$STEAMWEBAPI_KEY";}?>></div>
145-
<p class="cAx">Database:</p>
138+
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" style="margin:0">
139+
<p class="cAx">Database</p>
146140
<div class="input"><label for="input-ip">IP:</label><input id="input-ip" class="inputstyle" name="input-ip" type="text" minlength="3" maxlength="40" required="required" placeholder="xxx.xxx.xxx.xx" autocomplete="off" <?php if (isset($DB_SERVER)){echo "value=$DB_SERVER";}?>></div>
147141
<div class="input"><label for="input-username">Username:</label><input id="input-username" class="inputstyle" name="input-username" type="text" minlength="2" maxlength="15" placeholder="xxxxx" autocomplete="off" <?php if (isset($DB_USERNAME)){echo "value=$DB_USERNAME";}?>></div>
148142
<div class="input"><label for="input-password">Password:</label><input id="input-password" class="inputstyle" name="input-password" type="password" minlength="3" placeholder="xxxxxxxxxxxx" autocomplete="off" <?php if (isset($DB_PASSWORD)){echo "value=$DB_PASSWORD";}?>></div>
@@ -194,18 +188,18 @@ function test_input($data)
194188
}
195189
?>
196190
<div style="margin: auto;">
197-
<h2 style="margin: 0 0 10px;font-family: Helvetica,sans-serif;">Create Admin User</h2>
198-
<form method="post" action=<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>>
191+
<p class="cAx">Create Admin User</p>
192+
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" style="margin:0">
199193
<div class="input">
200-
<label for="username">Username</label><input type="text" class="inputstyle" readonly="readonly" name="username" id="username" value="admin">
194+
<label for="username">Username:</label><input type="text" class="inputstyle" readonly="readonly" name="username" id="username" value="admin">
201195
</div>
202196
<div class="input">
203-
<label for="password_1">Password</label><input type="password" id="password_1" class="inputstyle" name="password_1">
197+
<label for="password_1">Password:</label><input type="password" id="password_1" class="inputstyle" name="password_1">
204198
</div>
205199
<div class="input">
206-
<label for="password_2">Confirm password</label><input type="password" id="password_2" class="inputstyle" name="password_2">
200+
<label for="password_2">Confirm password:</label><input type="password" id="password_2" class="inputstyle" name="password_2">
207201
</div>
208-
<div class="input">
202+
<div style="display: flex;justify-content: flex-end;">
209203
<button type="submit" class="button" name="reg_user">Register</button>
210204
</div>
211205
</form>

0 commit comments

Comments
 (0)