source: admin/WebConsole/varios/menubrowser.php

lgromero-new-oglive
Last change on this file was 6694784, checked in by Ramón M. Gómez <ramongomez@…>, 6 years ago

#834: Fixing more code cleanup: CSS units, HTML tags; Javascript comparisons, and PHP variables.

  • Property mode set to 100644
File size: 2.7 KB
RevLine 
[043e67d]1<?php
[3ec149c]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();
13if(!empty($iph)){
14        Header("Location:../controlpostacceso.php?iph=".$iph); // Accede a la p�ina de menus
15        exit;
16}
17?>
18<HTML>
19<HEAD>
[1985678]20    <TITLE>Administración web de aulas</TITLE>
21    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
[6694784]22    <link rel="stylesheet" type="text/css" href="../estilos.css">
[1985678]23    <SCRIPT LANGUAGE="JAVASCRIPT">
[3ec149c]24//________________________________________________________________________________________________________
25function confirmar(){
26        if (comprobar_datos())
27                document.fdatos.submit();
28}
29//________________________________________________________________________________________________________
30function comprobar_datos(){
[a7406f2]31        if (document.fdatos.usu.value===""){
[3806a31]32                alert("Debe introducir un nombre de Usuario");
33                document.fdatos.usu.focus();
[3ec149c]34                return(false)
35        }
[a7406f2]36        if (document.fdatos.pss.value===""){
[3806a31]37                alert("Debe introducir una contraseña");
38                document.fdatos.pss.focus();
[3ec149c]39                return(false)
40        }
41        return(true)
42}
43//______________________________________________________________________________________________________
44function 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        }
[a7406f2]54    if (iAscii === 13)  confirmar();
[3ec149c]55        return true;
56}
57//________________________________________________________________________________________________________
[1985678]58    </SCRIPT>
[3ec149c]59</HEAD>
60<BODY>
[a7406f2]61<DIV style="POSITION:absolute;top:20px;left:150px">
[6694784]62        <FORM action="../controlacceso.php" name="fdatos" method="post"></FORM>
[3ec149c]63</DIV>
64</BODY>
65</HTML>
[043e67d]66<?php
[3ec149c]67//___________________________________________________________________________________________________
68//
69// Redupera la ip del cliente web
70//___________________________________________________________________________________________________
71function 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"];
[bf54d36]78        if (empty ($ipcliente))
79                $ipcliente = $_SERVER["REMOTE_ADDR"];
[3ec149c]80               
81        return($ipcliente);
82}
Note: See TracBrowser for help on using the repository browser.