64 lines
1.4 KiB
PHP
64 lines
1.4 KiB
PHP
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>UAAP | Results</title>
|
|
<link rel='stylesheet' href='/static/style.css' type='text/css' media='all' />
|
|
</head>
|
|
<body>
|
|
<div class="wrapper">
|
|
|
|
<p><a href="/">« GO BACK</a> to main administration page</p>
|
|
|
|
<h1>Results</h1>
|
|
|
|
<table class="boxed"><tr><td>
|
|
|
|
<?php
|
|
// Reads variables of HTML form in index.php
|
|
$ACTION = $_POST['action'];
|
|
$USER = $_POST['user'];
|
|
$PASS = $_POST['pass'];
|
|
$SURE = $_POST['sure'];
|
|
|
|
// Sanitize variables
|
|
$ACTION = escapeshellarg($ACTION);
|
|
$USER = escapeshellarg($USER);
|
|
|
|
$RAND = mt_rand(100000, 999999);
|
|
$PASSFILE = $RAND . '.pass';
|
|
file_put_contents($PASSFILE, $PASS);
|
|
|
|
|
|
// Checks if checkbox is activated (default at most forms)
|
|
if($SURE == "yes")
|
|
{
|
|
// Creates full command
|
|
$command = '/bin/bash action.sh ' . $ACTION . ' ' . $USER . ' ' . $PASSFILE;
|
|
|
|
// Execute command and give output
|
|
$output = shell_exec($command);
|
|
echo "<pre>$output</pre>";
|
|
}
|
|
else
|
|
{
|
|
echo "You did not hit the necessary checkbox. Aborting.";
|
|
}
|
|
|
|
//unlink($PASSFILE);
|
|
|
|
?>
|
|
|
|
</tr></td></table>
|
|
|
|
<p>In case of errors, please check all input data again.<br />
|
|
If the problem still exists, please contact us and add the error message.</p>
|
|
|
|
</div> <!-- /wrapper -->
|
|
<div class="footer">
|
|
<p>This web application has been created by <a href="http://mehl.mx">Max Mehl</a><br />
|
|
The program can be obtained on <a href="http://src.mehl.mx/uberspace-webadmin.git">Git</a> under a GPLv3+ license.</p>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|