PABX da Simples IP
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

131 lines
3.6 KiB

<?php session_start(); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link href="popups.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php
include('Net/SSH2.php');
function vai_comando($servidor, $usuario, $senha, $comando)
{
$ssh = new Net_SSH2($servidor);
if (!$ssh->login($usuario, $senha)) {
echo "NÃO FOI POSSÍVEL CONECTAR AO SERVIDOR!";
return false;
exit;
}
return $ssh->exec($comando);
}
$entra = $_GET["entra"];
$comanda = $_GET["comanda"];
if ($entra != "") {
$servidor = $_POST["servidor"];
$usuario = $_POST["usuario"];
$senha = $_POST["senha"];
$comando = 'pwd';
$_SESSION["servidor"] = $servidor;
$_SESSION["usuario"] = $usuario;
$_SESSION["senha"] = $senha;
}
if ($comanda != "") {
$servidor = $_SESSION["servidor"];
$usuario = $_SESSION["usuario"];
$senha = $_SESSION["senha"];
$comando = $_POST["comando"];
}
// admin123@a$sterisk
if ((($entra != "") or ($comanda != "")) and (vai_comando($servidor, $usuario, $senha, $comando) == true)) {
?>
<body onLoad="document.form3.comando.focus();">
<link href="popups.css" rel="stylesheet" type="text/css">
<form name="form3" method="post" action="micro_terminal.php?comanda=sim">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<font color="#C0C0C0" size="3">
<code>
<?= ' [' . $_SESSION['usuario'] . '@' . $_SESSION["servidor"] . ']# ' . $comando; ?><br>
<?= ' ' . preg_replace(chr(13) . chr(10), '<br>', vai_comando($servidor, $usuario, $senha, $comando)); ?>
</xmp>
</code>
</font>
</td>
</tr>
<tr>
<td>
<font color="#C0C0C0" size="3">
<code>
<?= '[' . $_SESSION['usuario'] . '@' . $_SESSION["servidor"] . ']# ' ?>
<input name="comando" type="text" id="comando3" size="100" class="comandos">
</xmp>
</code>
</td>
</tr>
</table>
</form>
<?php } else { ?>
<form name="form1" method="post" action="admin/micro_terminal.php?entra=ok">
<br>
<br>
<br>
<br>
<table border="1" align="center" cellpadding="0" cellspacing="2">
<tr>
<td colspan="2">
<div align="center">
<span class="style11">
<code>Terminal SSH2:</code>
</span>
</div>
</td>
</tr>
<tr>
<td width="120">
<div align="right">
<span class="style11">
<code>Servidor:</code>
</span>
</div>
</td>
<td width="100">
<input name="servidor" type="text" class="comandos" id="servidor" value="127.0.0.1">
</td>
</tr>
<tr>
<td width="120">
<div align="right" class="style11">
<code>Login:</code>
</div>
</td>
<td width="100">
<input name="usuario" type="text" class="comandos" id="usuario">
</td>
</tr>
<tr>
<td width="120">
<div align="right" class="style11">
<code>Senha:</code>
</div>
</td>
<td width="100">
<input name="senha" type="password" class="comandos" id="senha">
</td>
</tr>
<tr>
<td colspan="2">
<div align="center">
<input type="submit" name="Submit" value="Entrar">
</div>
</td>
</tr>
</table>
</form>
</body>
<?php } ?>