Commit a309fcdd authored by José Luis  Gutiérrez's avatar José Luis Gutiérrez Committed by Alessandro Rubini

/var/www/menu.php Adding new options (binary uploads and terminal simulator)

New options added to the local management tool menu:
	- Loading binaries to LM32
	- Loading binaries to FPGA
	- Terminal Simulator

New files:
- /var/www/load.php: It is used to load binary files into the lm32 or
the FPGA
- /var/www/terminal.php: It runs a terminal simulator, similar to a
accessing a SSH terminal.
parent 1f97c54f
<?php include 'title.php'; ?>
<body>
<div class="page">
<div class="left-bar">
<div class="menu">
<?php include 'menu.php'; ?>
</div>
</div>
<div class="right-bar">
<div class="header"><?php include 'header.php'; ?></div>
<div class="content">
<br><br><br>
<div>
<FORM method="POST" ENCTYPE="multipart/form-data">
Load FPGA binary <INPUT type=file name="file">
<INPUT type=submit value="Load">
<INPUT type=hidden name=MAX_FILE_SIZE VALUE=8192>
</FORM>
</div>
<?
$uploaddir = '/tmp/';
$uploadfile = $uploaddir . basename($_FILES['file']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} //else {
//echo "Possible file upload attack!\n";
//}
//echo 'Here is some more debugging info:';
//print_r($_FILES);
print "</pre>";
?>
<? include 'functions.php'; wrs_check_writeable(); ?>
</div>
<div class="footer"><?php include 'footer.php'; ?></div>
</div>
</div>
</body>
</html>
<p><a href="index.php"> Dashboard </a></p>
<!-- <p>Monitor</p> -->
<!-- <p>Configuration</p> -->
<p><a href="vlan.php"> VLAN Configuration </a></p>
<p><a href="tools.php"> Command Execution </a></p>
<p><a href="management.php"> Switch Management </a></p>
<p><a href="load.php"> LM32 & FPGA </a></p>
<p><a href="terminal.php"> Terminal Emulator </a></p>
<p><a href="about.php"> About </a></p>
<?php include 'title.php'; ?>
<body>
<div class="page">
<div class="left-bar">
<div class="menu">
<?php include 'menu.php'; ?>
</div>
</div>
<div class="right-bar">
<div class="header"><?php include 'header.php'; ?></div>
<div class="content">
</br>
</br></br>
<FORM action="terminal.php" method="POST" accept-charset="UTF-8">
Unix Command: <input type="text" name="cmd">
<input type="submit" value="Submit">
</FORM>
<?php
$cmd = htmlspecialchars($_POST["cmd"]);
echo '$' . $cmd . ':';
$output = shell_exec($cmd);
echo $output;
?>
</div>
<div class="footer"><?php include 'footer.php'; ?></div>
</div>
</div>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment