Skip to content
Snippets Groups Projects
Commit 7333c322 authored by Bob Mottram's avatar Bob Mottram
Browse files

Allow turtl registration to be enabled or disabled from web UI

parent 7902a6c5
No related branches found
No related tags found
No related merge requests found
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<style>
body {
margin: 0;
font-family: Arial;
background-color: white;
color: black;
}
* {
box-sizing: border-box;
}
a, u {
text-decoration: none;
color: #72a7cf;
font-weight: bold;
}
a:visited{
color: #72a7cf;
font-weight: bold;
}
#headerpic {
width: 60%;
height: auto;
margin-right : auto;
margin-left : auto;
min-width : 220px;
}
.header {
text-align: center;
padding: 32px;
}
.headertext {
color: #72a7cf;
text-align: center;
font-size: 120%;
font-weight: bold;
}
.settingtext {
text-align: center;
font-size: 100%;
}
.row {
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
padding: 0 4px;
}
.column {
-ms-flex: 25%;
flex: 15%;
max-width: 25%;
padding: 0 4px;
}
.column img {
margin-top: 8px;
vertical-align: middle;
}
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
max-width: 600px;
margin: auto;
text-align: center;
font-family: arial;
clear: both;
}
.card input[type=text] {
width: 50%;
clear: both;
text-align: left;
color: black;
background-color: lightblue;
}
.card input[type=radio] {
width: 8%;
height: 15em;
font-size: 10%;
margin-top: 5em;
vertical-align: middle;
}
</style>
<body>
<div class="card">
<div class="header">
<a href="app_turtl.html"><img id="headerpic" class="img-responsive" src="images/logo.png" alt="Freedombone"></a>
<p class="headertext" translate="yes">Turtl allow new registrations</p>
<form action="settings_turtl.php" method="post">
<input type="radio" name="allowregistrations" value="0" checked><label translate="yes">No</label>
<input type="radio" name="allowregistrations" value="1"><label translate="yes">Yes</label>
<br><br>
<input type="submit" name="submitallowregistrations" translate="yes" value="Update" />
</form>
</div>
</div>
</body>
</html>
<?php
// Turtl settings menu
$output_filename = "app_turtl.html";
if (isset($_POST['submitallowregistrations'])) {
$confirm = htmlspecialchars($_POST['allowregistrations']);
$settings_file = fopen(".appsettings.txt", "w") or die("Unable to write to appsettings file");
fwrite($settings_file, "turtl,registration,".$confirm);
fclose($settings_file);
}
$htmlfile = fopen("$output_filename", "r") or die("Unable to open $output_filename");
echo fread($htmlfile,filesize("$output_filename"));
fclose($htmlfile);
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment