tphp for creating new tomb - coffin - secure lan file storage on a device HTML git clone git://parazyd.org/coffin.git DIR Log DIR Files DIR Refs DIR Submodules DIR README DIR LICENSE --- DIR commit e93d938346c05f829aead9ef59febf0afa9f9403 DIR parent a30355961b624f8ef08e2b8c02d8c2a783b6456d HTML Author: parazyd <parazyd@dyne.org> Date: Sat, 6 Feb 2016 16:19:46 +0100 php for creating new tomb Diffstat: M web/index.php | 5 +++-- A web/tomb.php | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) --- DIR diff --git a/web/index.php b/web/index.php t@@ -10,8 +10,9 @@ <h3>Create new tomb and key</h3> - <form action="tombcreate.php" method="post"> + <form action="tomb.php?happenz=CREATE" method="post"> Username: <input type="text" name="undertaker"> + Tomb size (MiB): <input type="number" name="size"> <select name="device"> <option selected>Choose device to store key</option> <?php t@@ -28,7 +29,7 @@ <hr> <h3>Change tomb's key</h3> - <form action="newkey.php" method="post"> + <form action="tomb.php?happenz=REVOKE" method="post"> <select name="device"> <option selected>Choose device to store key</option> <?php DIR diff --git a/web/tomb.php b/web/tomb.php t@@ -0,0 +1,28 @@ +<!DOCTYPE html> +<!-- + tomb.php - php script called by the index form, passing vars to + undertaker (shell middleman between web and rest of tombox +--> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>Creating new tomb...</title> +</head> +<body> + <?php + $happenz = $_GET["happenz"]; + $username = $_POST["undertaker"]; + $device = $_POST["device"]; + $size = $_POST["size"]; + + $command = "./undertaker " . $happenz . " " . $device . " " . $username . " " . $size; + + echo $command; // debug + + $output = system($command, $retval); + + echo $output; + echo "<br><br><br>" . $retval; + ?> +</body> +</html>