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

Store pending installs to a file

parent 99e76714
No related branches found
No related tags found
No related merge requests found
......@@ -96,7 +96,7 @@
<p class="appdesc">APPDESCRIPTION</p>
<form action="installapp.php" method="post">
<p><label>Domain:</label><input type="text" name="domain"></p>
<p><label>Domain:</label><input type="text" name="install_domain"></p>
<p><label><a href="https://freedns.afraid.org/dynamic">FreeDNS code</a>:</label><input type="text" name="freedns_code"></p>
<input type="hidden" name="app_name" value="APPNAME">
<input type="submit" name="install" value="Install">
......
......@@ -2,8 +2,19 @@
if (isset($_POST['install'])) {
$app_name = htmlspecialchars($_POST['app_name']);
$install_domain = $app_name.".".gethostname();
$install_domain = $_POST['install_domain'];
echo "domain: ".$install_domain;
if(! file_exists("pending_installs.txt")) {
$pending_installs = fopen("pending_installs.txt", "w") or die("Unable to create installs file");
fclose($pending_installs);
}
if(! exec('grep '.escapeshellarg("install_".$app_name).' ./pending_installs.txt')) {
$pending_installs = fopen("pending_installs.txt", "a") or die("Unable to append to installs file");
fwrite($pending_installs, "install_".$app_name."\n");
fclose($pending_installs);
}
}
?>
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