@@ -83,12 +83,23 @@ function test_input($data)
83
83
// Choose a theme
84
84
if (array_key_exists ('submittheme ' , $ _POST )) {
85
85
$ css_template = $ _POST ["themeinput " ];
86
- $ notification = "<p>Theme updated<p> " ;
86
+ $ notification[ ' theme ' ] = "<p>Theme updated<p> " ;
87
87
$ themescript = "<script>$(document).ready( function () { " ."$('#themesummary').click();});</script> " ;
88
88
$ configcontent =file_get_contents ($ configfile );
89
89
$ configcontent = preg_replace ('/\$css_template = \"(.*?)\";/ ' , '$css_template = " ' .$ css_template .'"; ' , $ configcontent );
90
90
file_put_contents ($ configfile , $ configcontent );
91
91
}
92
+ // Edit API Keys
93
+ if (array_key_exists ('apikey ' , $ _POST )) {
94
+ $ steamwebapi_key = $ _POST ["steam-api " ];
95
+ $ rustmapsapi_key = $ _POST ["rustmaps-api " ];
96
+ $ notification ['apikey ' ] = "<p>API Keys updated<p> " ;
97
+ $ configcontent =file_get_contents ($ configfile );
98
+ $ apikeyscript = "<script>$(document).ready( function () { " ."$('#apikeysummary').click();});</script> " ;
99
+ $ configcontent = preg_replace ('/\$steamwebapi_key = \"(.*?)\";/ ' , '$steamwebapi_key = " ' .$ steamwebapi_key .'"; ' , $ configcontent );
100
+ $ configcontent = preg_replace ('/\$rustmapsapi_key = \"(.*?)\";/ ' , '$rustmapsapi_key = " ' .$ rustmapsapi_key .'"; ' , $ configcontent );
101
+ file_put_contents ($ configfile , $ configcontent );
102
+ }
92
103
?>
93
104
<!doctype html>
94
105
<html lang="en">
@@ -198,24 +209,45 @@ function test_input($data)
198
209
<input type="text" id="themeinput" name="themeinput" style="display: none">
199
210
<div class="flex" style="justify-content: flex-end;line-height: 34px;">
200
211
<?php
201
- if (isset ($ notification )) {echo $ notification ;}
212
+ if (isset ($ notification[ ' theme ' ] )) {echo $ notification[ ' theme ' ] ;}
202
213
?>
203
214
<input class="addsrv" type="submit" name="submittheme" value="Submit">
204
215
</div>
205
216
</form>
206
217
</div>
207
218
</details>
208
219
<details>
209
- <summary>API Keys</summary>
210
- <div class="detailscontent"></div>
220
+ <summary id="apikeysummary">API Keys</summary>
221
+ <?php if (isset ($ apikeyscript )){echo $ apikeyscript ;}?>
222
+ <div class="detailscontent">
223
+ <form method="post" action="<?php echo htmlspecialchars ($ _SERVER ["PHP_SELF " ]);?> ">
224
+ <div class="flex">
225
+ <div id="left">
226
+ <div class="input">
227
+ <label for="input-ip" style="display: flex">Steam Web API Key<a target="_blank" href="https://docs.iguaserver.de/settings#steam-web-api-key" title="Find out more about the Steam Web API Key" style="height: 0;"><img src="../../html/img/questionmark.svg" height="19px" alt="" style="margin: 2px 0 0 5px;cursor: pointer;"></a></label>
228
+ <input id="input-ip" class="input" name="steam-api" type="text" minlength="32" maxlength="32" placeholder="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" autocomplete="off" <?php if (isset ($ steamwebapi_key )){echo "value= $ steamwebapi_key " ;}?> >
229
+ </div>
230
+ </div>
231
+ <div id="right">
232
+ <div class="input">
233
+ <label for="input-ip" style="display: flex">RustMaps.com API Key<a target="_blank" href="https://docs.iguaserver.de/settings#rustmaps.com-api-key" title="Find out more about the RustMaps.com API Key" style="height: 0;"><img src="../../html/img/questionmark.svg" height="19px" alt="" style="margin: 2px 0 0 5px;cursor: pointer;"></a></label>
234
+ <input id="input-ip" class="input" name="rustmaps-api" type="text" minlength="25" maxlength="45" placeholder="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" autocomplete="off" <?php if (isset ($ rustmapsapi_key )){echo "value= $ rustmapsapi_key " ;}?> >
235
+ </div>
236
+ </div>
237
+ </div>
238
+ <div class="flex" style="justify-content: flex-end;margin-right: 3px;line-height: 34px;">
239
+ <?php if (isset ($ notification ['apikey ' ])) {echo $ notification ['apikey ' ];} ?>
240
+ <input class="addsrv" type="submit" name="apikey" value="Submit">
241
+ </div>
242
+ </form>
243
+ </div>
211
244
</details>
212
245
<details>
213
246
<summary>Other</summary>
214
247
<div class="detailscontent"></div>
215
248
</details>
216
249
</div>
217
250
</div>
218
- <?php include 'notification.php ' ?>
219
251
<!-- Information about system | right-->
220
252
<div id="zusammenfassung">
221
253
<div id="clock"></div>
0 commit comments