1
1
<?php
2
2
$ configfile = 'config.php ' ;
3
3
require_once $ configfile ;
4
- if (isset ($ install ) && !$ install ) {
4
+ /* if (isset($install) && !$install) {
5
5
header("Location: /");
6
- }
6
+ }*/
7
7
function test_input ($ data )
8
8
{
9
9
$ data = trim ($ data );
@@ -14,7 +14,6 @@ function test_input($data)
14
14
$ displaysubmit = "none " ;
15
15
// Get post and check if connection to mysql db is successful
16
16
if (array_key_exists ('validate ' , $ _POST )) {
17
- $ STEAMWEBAPI_KEYI = test_input ($ _POST ["steamwebapi-key " ]);
18
17
$ DB_SERVERI = test_input ($ _POST ["input-ip " ]);
19
18
$ DB_USERNAMEI = test_input ($ _POST ["input-username " ]);
20
19
$ DB_PASSWORDI = test_input ($ _POST ["input-password " ]);
@@ -35,12 +34,10 @@ function test_input($data)
35
34
}
36
35
// Write the data into the config file and create the server table
37
36
if (array_key_exists ('submit ' , $ _POST )) {
38
- $ STEAMWEBAPI_KEYI = test_input ($ _POST ["steamwebapi-key " ]);
39
37
$ DB_SERVERI = test_input ($ _POST ["input-ip " ]);
40
38
$ DB_USERNAMEI = test_input ($ _POST ["input-username " ]);
41
39
$ DB_PASSWORDI = test_input ($ _POST ["input-password " ]);
42
40
$ DB_NAMEI = test_input ($ _POST ["input-dbname " ]);
43
- $ STEAMWEBAPI_KEY = $ STEAMWEBAPI_KEYI ;
44
41
$ DB_SERVER = $ DB_SERVERI ;
45
42
$ DB_USERNAME = $ DB_USERNAMEI ;
46
43
$ DB_PASSWORD = $ DB_PASSWORDI ;
@@ -66,18 +63,17 @@ function test_input($data)
66
63
$ write = "<?php " . "\n" .
67
64
'include ("langconf.php"); ' . "\n" .
68
65
'$install = 0; ' . "\n" .
69
- '$STEAMWEBAPI_KEY = " ' . $ STEAMWEBAPI_KEYI . '"; ' . "\n\n" .
66
+ '$steamwebapi_key = ""; ' . "\n" .
67
+ '$rustmapsapi_key = ""; ' . "\n" .
70
68
'$DB_SERVER = " ' . $ DB_SERVERI . '"; ' . "\n" .
71
69
'$DB_USERNAME = " ' . $ DB_USERNAMEI . '"; ' . "\n" .
72
70
'$DB_PASSWORD = " ' . $ DB_PASSWORDI . '"; ' . "\n" .
73
71
'$DB_NAME = " ' . $ DB_NAMEI . '"; ' . "\n" .
72
+ '$css_template = "summer-night"; ' . "\n" .
74
73
'$steamapi = "https://api.steampowered.com/"; ' . "\n" .
75
74
'$lang = "en"; ' . "\n" .
76
75
'$register = TRUE; ' . "\n" .
77
76
"?> " ;
78
- echo '<script> ' ;
79
- echo 'alert("Config file created!") ' ;
80
- echo '</script> ' ;
81
77
fwrite ($ myfile , $ write );
82
78
fclose ($ myfile );
83
79
$ register = TRUE ;
@@ -89,7 +85,7 @@ function test_input($data)
89
85
.adddbdiv {
90
86
margin: auto;
91
87
width: 500px;
92
- height: 500px;
88
+ /* height: 500px;*/
93
89
background-color: #2B2F43;
94
90
border-radius: 14px;
95
91
color: white;
@@ -100,7 +96,7 @@ function test_input($data)
100
96
.cAx {
101
97
font-family: Helvetica,sans-serif;
102
98
border-bottom: solid;
103
- margin: 15px 0 9px ;
99
+ margin: 0 0 15px ;
104
100
letter-spacing: 3px;
105
101
font-size: 23px;
106
102
}
@@ -139,10 +135,8 @@ function test_input($data)
139
135
<div class="adddbdiv">
140
136
<div class="padding25">
141
137
<?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>
146
140
<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>
147
141
<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>
148
142
<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)
194
188
}
195
189
?>
196
190
<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" >
199
193
<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">
201
195
</div>
202
196
<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">
204
198
</div>
205
199
<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">
207
201
</div>
208
- <div class="input ">
202
+ <div style="display: flex;justify-content: flex-end; ">
209
203
<button type="submit" class="button" name="reg_user">Register</button>
210
204
</div>
211
205
</form>
0 commit comments