@@ -100,6 +100,15 @@ function test_input($data)
100
100
$ configcontent = preg_replace ('/\$rustmapsapi_key = \"(.*?)\";/ ' , '$rustmapsapi_key = " ' .$ rustmapsapi_key .'"; ' , $ configcontent );
101
101
file_put_contents ($ configfile , $ configcontent );
102
102
}
103
+ // Edit other settings
104
+ if (array_key_exists ('other ' , $ _POST )) {
105
+ $ register = $ _POST ["registration " ];
106
+ $ notification ['other ' ] = "<p>Settings updated<p> " ;
107
+ $ configcontent =file_get_contents ($ configfile );
108
+ $ otherscript = "<script>$(document).ready( function () { " ."$('#othersummary').click();});</script> " ;
109
+ $ configcontent = preg_replace ('/\$register = (.*?);/ ' , '$register = ' .$ register .'; ' , $ configcontent );
110
+ file_put_contents ($ configfile , $ configcontent );
111
+ }
103
112
?>
104
113
<!doctype html>
105
114
<html lang="en">
@@ -243,8 +252,24 @@ function test_input($data)
243
252
</div>
244
253
</details>
245
254
<details>
246
- <summary>Other</summary>
247
- <div class="detailscontent"></div>
255
+ <summary id="othersummary">Other</summary>
256
+ <?php if (isset ($ otherscript )){echo $ otherscript ;}?>
257
+ <div class="detailscontent">
258
+ <form method="post" action="<?php echo htmlspecialchars ($ _SERVER ["PHP_SELF " ]);?> ">
259
+ <div class="flex">
260
+ <label for="selectregistration">Registration:</label>
261
+ <select required="required" name="registration" id="selectregistration">
262
+ <option <?php if ($ register ){echo "selected " ;}?> value="TRUE">Enable</option>
263
+ <option <?php if (!$ register ){echo "selected " ;}?> value="FALSE">Disable</option>
264
+ </select>
265
+ <a target="_blank" href="https://docs.iguaserver.de/settings#registration" title="Find out more about the registration." style="height: 0;"><img src="../../html/img/questionmark.svg" height="19px" alt="" style="margin: 2px 0 0 5px;cursor: pointer;"></a>
266
+ </div>
267
+ <div class="flex" style="justify-content: flex-end;margin-right: 3px;line-height: 34px;">
268
+ <?php if (isset ($ notification ['other ' ])) {echo $ notification ['other ' ];} ?>
269
+ <input class="addsrv" type="submit" name="other" value="Submit">
270
+ </div>
271
+ </form>
272
+ </div>
248
273
</details>
249
274
</div>
250
275
</div>
0 commit comments