Skip to content

Commit

Permalink
Finish Setinngs
Browse files Browse the repository at this point in the history
  • Loading branch information
AunePVP committed Jun 25, 2022
1 parent 04e0e1a commit beef226
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
29 changes: 27 additions & 2 deletions users/control/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ function test_input($data)
$configcontent = preg_replace('/\$rustmapsapi_key = \"(.*?)\";/', '$rustmapsapi_key = "'.$rustmapsapi_key.'";', $configcontent);
file_put_contents($configfile, $configcontent);
}
// Edit other settings
if (array_key_exists('other', $_POST)) {
$register = $_POST["registration"];
$notification['other'] = "<p>Settings updated<p>";
$configcontent=file_get_contents($configfile);
$otherscript = "<script>$(document).ready( function () {"."$('#othersummary').click();});</script>";
$configcontent = preg_replace('/\$register = (.*?);/', '$register = '.$register.';', $configcontent);
file_put_contents($configfile, $configcontent);
}
?>
<!doctype html>
<html lang="en">
Expand Down Expand Up @@ -243,8 +252,24 @@ function test_input($data)
</div>
</details>
<details>
<summary>Other</summary>
<div class="detailscontent"></div>
<summary id="othersummary">Other</summary>
<?php if (isset($otherscript)){echo $otherscript;}?>
<div class="detailscontent">
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<div class="flex">
<label for="selectregistration">Registration:</label>
<select required="required" name="registration" id="selectregistration">
<option <?php if($register){echo "selected ";}?>value="TRUE">Enable</option>
<option <?php if(!$register){echo "selected ";}?>value="FALSE">Disable</option>
</select>
<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>
</div>
<div class="flex" style="justify-content: flex-end;margin-right: 3px;line-height: 34px;">
<?php if (isset($notification['other'])) {echo $notification['other'];} ?>
<input class="addsrv" type="submit" name="other" value="Submit">
</div>
</form>
</div>
</details>
</div>
</div>
Expand Down
10 changes: 9 additions & 1 deletion users/control/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ label {
font-family: Helvetica,sans-serif;
font-size: 20px;
}
label #type {
#type {
border-radius: 4px;
width: 100%;
margin: 0 0 10px 0;
Expand Down Expand Up @@ -827,6 +827,14 @@ summary{
padding: 0 0 0 5px;
margin: 0;
}
#selectregistration {
border-radius: 4px;
width: 79px;
margin: 0 0 0 5px;
padding: 5px 35px 5px 5px;
font-size: 14px;
border: none;
}
@media only screen and (max-width: 1300px) {
.users {
display: none;
Expand Down

0 comments on commit beef226

Please sign in to comment.