1 | <?php |
---|
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 2009-2010 |
---|
6 | // Fecha útima modificación: Marzo-2006 |
---|
7 | // Nombre del fichero: menubrowser.php |
---|
8 | // Descripción : |
---|
9 | // Este fichero implementa el menu del browser de los clientes |
---|
10 | // **************************************************************************** |
---|
11 | // Recupera la IP del ordenador que solicita la página |
---|
12 | $iph=tomaIP(); |
---|
13 | if(!empty($iph)){ |
---|
14 | Header("Location:../controlpostacceso.php?iph=".$iph); // Accede a la p�ina de menus |
---|
15 | exit; |
---|
16 | } |
---|
17 | ?> |
---|
18 | <HTML> |
---|
19 | <HEAD> |
---|
20 | <TITLE>Administración web de aulas</TITLE> |
---|
21 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
22 | <link rel="stylesheet" type="text/css" href="../estilos.css"> |
---|
23 | <SCRIPT LANGUAGE="JAVASCRIPT"> |
---|
24 | //________________________________________________________________________________________________________ |
---|
25 | function confirmar(){ |
---|
26 | if (comprobar_datos()) |
---|
27 | document.fdatos.submit(); |
---|
28 | } |
---|
29 | //________________________________________________________________________________________________________ |
---|
30 | function comprobar_datos(){ |
---|
31 | if (document.fdatos.usu.value===""){ |
---|
32 | alert("Debe introducir un nombre de Usuario"); |
---|
33 | document.fdatos.usu.focus(); |
---|
34 | return(false) |
---|
35 | } |
---|
36 | if (document.fdatos.pss.value===""){ |
---|
37 | alert("Debe introducir una contraseña"); |
---|
38 | document.fdatos.pss.focus(); |
---|
39 | return(false) |
---|
40 | } |
---|
41 | return(true) |
---|
42 | } |
---|
43 | //______________________________________________________________________________________________________ |
---|
44 | function PulsaEnter(oEvento){ |
---|
45 | var iAscii; |
---|
46 | if (oEvento.keyCode) |
---|
47 | iAscii = oEvento.keyCode; |
---|
48 | else{ |
---|
49 | if (oEvento.which) |
---|
50 | iAscii = oEvento.which; |
---|
51 | else |
---|
52 | return false; |
---|
53 | } |
---|
54 | if (iAscii === 13) confirmar(); |
---|
55 | return true; |
---|
56 | } |
---|
57 | //________________________________________________________________________________________________________ |
---|
58 | </SCRIPT> |
---|
59 | </HEAD> |
---|
60 | <BODY> |
---|
61 | <DIV style="POSITION:absolute;top:20px;left:150px"> |
---|
62 | <FORM action="../controlacceso.php" name="fdatos" method="post"></FORM> |
---|
63 | </DIV> |
---|
64 | </BODY> |
---|
65 | </HTML> |
---|
66 | <?php |
---|
67 | //___________________________________________________________________________________________________ |
---|
68 | // |
---|
69 | // Redupera la ip del cliente web |
---|
70 | //___________________________________________________________________________________________________ |
---|
71 | function tomaIP(){ |
---|
72 | // Se asegura que la pagina se solicita desde la IP que viene |
---|
73 | global $HTTP_SERVER_VARS; |
---|
74 | if ($HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"] != "") |
---|
75 | $ipcliente = $HTTP_SERVER_VARS["HTTP_X_FORWARDED_FOR"]; |
---|
76 | else |
---|
77 | $ipcliente = $HTTP_SERVER_VARS["REMOTE_ADDR"]; |
---|
78 | if (empty ($ipcliente)) |
---|
79 | $ipcliente = $_SERVER["REMOTE_ADDR"]; |
---|
80 | |
---|
81 | return($ipcliente); |
---|
82 | } |
---|