1 | <? |
---|
2 | // ************************************************************************************************************************************************* |
---|
3 | // Aplicación WEB: ogAdmWebCon |
---|
4 | // Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla |
---|
5 | // Fecha Creación: Año 2010 |
---|
6 | // Fecha Última modificación: Marzo-2010 |
---|
7 | // Nombre del fichero: consolaremota.php |
---|
8 | // Descripción : |
---|
9 | // Crea una consola remota para escribir comandos de la shell de forma remota |
---|
10 | // ************************************************************************************************************************************************* |
---|
11 | include_once("../includes/ctrlacc.php"); |
---|
12 | include_once("../clases/AdoPhp.php"); |
---|
13 | include_once("../includes/constantes.php"); |
---|
14 | include_once("../includes/CreaComando.php"); |
---|
15 | include_once("../idiomas/php/".$idioma."/consolaremota_".$idioma.".php"); |
---|
16 | //________________________________________________________________________________________________________ |
---|
17 | $cmd=CreaComando($cadenaconexion); |
---|
18 | if (!$cmd) |
---|
19 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
20 | //___________________________________________________________________________________________________ |
---|
21 | $idambito=""; |
---|
22 | $litambito=""; |
---|
23 | $nomambito=""; |
---|
24 | |
---|
25 | if (isset($_GET["idambito"])) $idambito=$_GET["idambito"]; |
---|
26 | if (isset($_GET["litambito"])) $litambito=$_GET["litambito"]; |
---|
27 | if (isset($_GET["nomambito"])) $nomambito=$_GET["nomambito"]; |
---|
28 | //___________________________________________________________________________________________________ |
---|
29 | ?> |
---|
30 | <HTML> |
---|
31 | <TITLE>Administración web de aulas</TITLE> |
---|
32 | <HEAD> |
---|
33 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
34 | <LINK rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
35 | </HEAD> |
---|
36 | <BODY> |
---|
37 | <SCRIPT language="javascript" src="../clases/jscripts/HttpLib.js"></SCRIPT> |
---|
38 | <SCRIPT language="javascript" src="../jscripts/ecoremoto.js"></SCRIPT> |
---|
39 | <SCRIPT language="javascript" src="../jscripts/constantes.js"></SCRIPT> |
---|
40 | <SCRIPT language="javascript"> |
---|
41 | |
---|
42 | //______________________________________________________________________________________________________ |
---|
43 | function PulsaEnter(oEvento){ |
---|
44 | var iAscii; |
---|
45 | if (oEvento.keyCode) |
---|
46 | iAscii = oEvento.keyCode; |
---|
47 | else{ |
---|
48 | if (oEvento.which) |
---|
49 | iAscii = oEvento.which; |
---|
50 | else |
---|
51 | return false; |
---|
52 | } |
---|
53 | if (iAscii == 13) confirmar(); |
---|
54 | return true; |
---|
55 | } |
---|
56 | //______________________________________________________________________________________________________ |
---|
57 | function confirmar(){ |
---|
58 | var idambito=document.fdatos.idambito.value; |
---|
59 | var litambito=document.fdatos.litambito.value; |
---|
60 | |
---|
61 | if(litambito==LITAMBITO_ORDENADORES){ |
---|
62 | var diveco=document.getElementById("diveco"); |
---|
63 | diveco.innerHTML=" "; |
---|
64 | } |
---|
65 | var Obtcmd=document.getElementById("comando"); |
---|
66 | var cmd=Obtcmd.value; |
---|
67 | |
---|
68 | var wurl="shellconsola.php"; |
---|
69 | var prm="idambito="+idambito+"&litambito="+litambito+"&comando="+cmd; |
---|
70 | conmuta("visible"); |
---|
71 | var diveco=document.getElementById("diveco"); |
---|
72 | diveco.innerHTML="<PRE> </PRE>"; |
---|
73 | CallPage(wurl,prm,"resultado","POST"); |
---|
74 | } |
---|
75 | //______________________________________________________________________________________________________ |
---|
76 | function resultado(iHTML){ |
---|
77 | if(iHTML.length>0){ |
---|
78 | var diveco=document.getElementById("diveco"); |
---|
79 | diveco.innerHTML=iHTML |
---|
80 | } |
---|
81 | var litambito=document.fdatos.litambito.value; |
---|
82 | if(litambito==LITAMBITO_ORDENADORES){ |
---|
83 | setTimeout("enviaping();",1000); |
---|
84 | } |
---|
85 | else{ |
---|
86 | setTimeout('conmuta("hidden");',1000); |
---|
87 | //conmuta("hidden"); |
---|
88 | } |
---|
89 | } |
---|
90 | //______________________________________________________________________________________________________ |
---|
91 | </SCRIPT> |
---|
92 | <FORM name="fdatos" action="shellconsola.php"> |
---|
93 | <INPUT type=hidden name="idambito" value=<?echo $idambito?>> |
---|
94 | <INPUT type=hidden name="litambito" value=<?echo $litambito?>> |
---|
95 | <INPUT type=hidden name="nomambito" value=<?echo $nomambito?>> |
---|
96 | </FORM> |
---|
97 | |
---|
98 | <? |
---|
99 | $cols="93"; |
---|
100 | $rows="30"; |
---|
101 | switch($litambito){ |
---|
102 | case $LITAMBITO_CENTROS : |
---|
103 | $urlimg='../images/iconos/centros.gif'; |
---|
104 | $textambito=$TbMsg[0]; |
---|
105 | break; |
---|
106 | case $LITAMBITO_GRUPOSAULAS : |
---|
107 | $urlimg='../images/iconos/carpeta.gif'; |
---|
108 | $textambito=$TbMsg[1]; |
---|
109 | break; |
---|
110 | case $LITAMBITO_AULAS : |
---|
111 | $urlimg='../images/iconos/aula.gif'; |
---|
112 | $textambito=$TbMsg[2]; |
---|
113 | break; |
---|
114 | case $LITAMBITO_GRUPOSORDENADORES : |
---|
115 | $urlimg='../images/iconos/carpeta.gif'; |
---|
116 | $textambito=$TbMsg[3]; |
---|
117 | break; |
---|
118 | case $LITAMBITO_ORDENADORES : |
---|
119 | $rows="3"; |
---|
120 | $urlimg='../images/iconos/ordenador.gif'; |
---|
121 | $textambito=$TbMsg[4]; |
---|
122 | break; |
---|
123 | } |
---|
124 | ?> |
---|
125 | |
---|
126 | <P align=center class=cabeceras><?echo $TbMsg[7]?><BR> |
---|
127 | <SPAN align=center class=subcabeceras> |
---|
128 | <IMG src="<? echo $urlimg?>"> <?echo $textambito.": ".$nomambito?></SPAN></P> |
---|
129 | <table align=center border="0" cellpadding="0" cellspacing="1"> |
---|
130 | <tr><td class="presentaciones"><? echo $TbMsg[11]?></td></tr> |
---|
131 | <tr><td ><textarea class="cajacomandos" name id="comando" cols="<? echo $cols?>" rows="<? echo $rows?>"></textarea></td></tr> |
---|
132 | <TR><TD align=center><A href=#><IMG border=0 src="../images/boton_confirmar.gif" onclick="confirmar()"></A></TD></TR> |
---|
133 | <TR height=5><TD align=center> |
---|
134 | |
---|
135 | <? |
---|
136 | // Layer de las notificaciones de envío |
---|
137 | echo '<DIV id="layer_aviso" align=center style="visibility:hidden">'; |
---|
138 | echo '<BR>'; |
---|
139 | echo '<SPAN align=center class="marco"> '.$TbMsg[14].' </SPAN>'; |
---|
140 | echo '</DIV>'; |
---|
141 | ?> |
---|
142 | </TD></TR> |
---|
143 | <? |
---|
144 | if($litambito==$LITAMBITO_ORDENADORES){ |
---|
145 | echo '<tr><td class="presentaciones">'.$TbMsg[12].'</td></tr>'; |
---|
146 | echo '<tr><td>'; |
---|
147 | echo '<div id="diveco" class="marco" align=left style="width:700px;height:500px;overflow:scroll"></div>'; |
---|
148 | echo '</td></tr>'; |
---|
149 | } |
---|
150 | ?> |
---|
151 | </table> |
---|
152 | <? |
---|
153 | if($litambito!=$LITAMBITO_ORDENADORES){ |
---|
154 | echo '<DIV id="Layer_nota" align=center>'; |
---|
155 | echo '<BR>'; |
---|
156 | echo '<SPAN align=center class=notas><I><b>'.$TbMsg[13].'</b></I></SPAN>'; |
---|
157 | echo '</DIV>'; |
---|
158 | } |
---|
159 | ?> |
---|
160 | |
---|
161 | </BODY> |
---|
162 | </HTML> |
---|