Skip to content

Commit beef226

Browse files
committed
Finish Setinngs
1 parent 04e0e1a commit beef226

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

users/control/settings.php

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@ function test_input($data)
100100
$configcontent = preg_replace('/\$rustmapsapi_key = \"(.*?)\";/', '$rustmapsapi_key = "'.$rustmapsapi_key.'";', $configcontent);
101101
file_put_contents($configfile, $configcontent);
102102
}
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+
}
103112
?>
104113
<!doctype html>
105114
<html lang="en">
@@ -243,8 +252,24 @@ function test_input($data)
243252
</div>
244253
</details>
245254
<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>
248273
</details>
249274
</div>
250275
</div>

users/control/style.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ label {
281281
font-family: Helvetica,sans-serif;
282282
font-size: 20px;
283283
}
284-
label #type {
284+
#type {
285285
border-radius: 4px;
286286
width: 100%;
287287
margin: 0 0 10px 0;
@@ -827,6 +827,14 @@ summary{
827827
padding: 0 0 0 5px;
828828
margin: 0;
829829
}
830+
#selectregistration {
831+
border-radius: 4px;
832+
width: 79px;
833+
margin: 0 0 0 5px;
834+
padding: 5px 35px 5px 5px;
835+
font-size: 14px;
836+
border: none;
837+
}
830838
@media only screen and (max-width: 1300px) {
831839
.users {
832840
display: none;

0 commit comments

Comments
 (0)