2013-04-12 Sancho Lerena <slerena@artica.es>

* extensions/ssh_gateway.php: Implemented support to connect
        Telnet/SSH on different ports than standard ones.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7972 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2013-04-12 11:10:13 +00:00
parent 19d9b86914
commit 18d9b97544
2 changed files with 19 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2013-04-12 Sancho Lerena <slerena@artica.es>
* extensions/ssh_gateway.php: Implemented support to connect
Telnet/SSH on different ports than standard ones.
2013-04-12 Mario Pulido <mario.pulido@artica.es>
* godmode/users/configure_user.php,

View File

@ -29,6 +29,7 @@ function ssh_gateway () {
$HOST = get_parameter ("host", "");
$USER = get_parameter ("user", "");
$PORT = get_parameter ("port", 0);
// TODO: Put aditional filtering for ";" and "&" characters in user & host for security
// because these params are passed to server exec() call :)
@ -50,12 +51,14 @@ function ssh_gateway () {
if ($COMMIT == 1) {
echo "<h3 class=error>".__("You need to specify a user and a host address")."</h3>";
}
echo "<form method=post>";
echo "<table class=databox cellspacing=4 cellpadding=4>";
echo "<td>".__("Host address")."<td><input type=text size=25 value='$HOST' name=host>";
echo "<tr>";
echo "<td>".__("User")."<td><input type=text size=25 value='$USER' name=user>";
echo "<tr>";
echo "<td>".__("Port (use 0 for default)")."<td><input type=text size=5 value='$PORT' name=port>";
echo "<tr><td>";
echo __("Connect mode")."<td><select name=mode>";
if ($MODE == "telnet") {
@ -74,10 +77,18 @@ function ssh_gateway () {
}
else {
if ($MODE == "telnet"){
if ($PORT == 0)
$PORT = 23;
} else {
if ($PORT == 0)
$PORT = 22;
}
if ($MODE == "ssh")
echo "<iframe style='border: 0px' src='http://".$SERVER_ADDR.":8022/anyterm.html?param=$USER@$HOST' width='100%' height=550>";
echo "<iframe style='border: 0px' src='http://".$SERVER_ADDR.":8022/anyterm.html?param=-p $PORT $USER@$HOST' width='100%' height=550>";
else
echo "<iframe style='border: 0px' src='http://".$SERVER_ADDR.":8023/anyterm.html?param=$HOST' width='100%' height=550>";
echo "<iframe style='border: 0px' src='http://".$SERVER_ADDR.":8023/anyterm.html?param=$HOST $PORT' width='100%' height=550>";
echo "</iframe>";
}