source: admin/WebConsole/varios/acceso_operador.php @ a89da3d

Last change on this file since a89da3d 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: 3.7 KB
Line 
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: Agosto-2010
6// Fecha Última modificación: Agosto-2010
7// Nombre del fichero: acceso.php
8// Descripción : Presenta la pantalla de login del operador
9// *************************************************************************************************************************************************
10
11session_start(); // Activa variables de sesión
12
13$herror=0;
14
15if (isset($_GET["herror"])) $herror=$_GET["herror"];
16if (isset($_POST["herror"])) $herror=$_POST["herror"];
17
18$ITEMS_PUBLICOS=1;
19$ITEMS_PRIVADOS=2;
20
21if (isset($_SESSION["swop"])){
22        // Acceso al menu de adminitración del aula
23        $wurl="menucliente.php?tip=".$ITEMS_PRIVADOS;
24        Header('Location:'.$wurl);
25}
26
27$TbErr=array();
28$TbErr[0]="SIN ERRORES";
29$TbErr[1]="ATENCIÓN: Usted no tiene acceso al menú de administración";
30$TbErr[2]="ERROR de conexión con el servidor de datos";
31//________________________________________________________________________________________________________
32?>
33<HTML>
34<HEAD>
35<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
36<TITLE>Administración web de aulas</TITLE>
37<LINK rel="stylesheet" type="text/css" href="../estilos.css">
38<SCRIPT LANGUAGE="JAVASCRIPT">
39//________________________________________________________________________________________________________
40function confirmar(){
41        if (comprobar_datos())
42                document.fdatos.submit();
43}
44//________________________________________________________________________________________________________
45function comprobar_datos(){
46        if (document.fdatos.usu.value===""){
47                alert("Debe introducir un nombre de Usuario");
48                document.fdatos.usu.focus();
49                return(false)
50        }
51        if (document.fdatos.pss.value===""){
52                alert("Debe introducir una contraseña");
53                document.fdatos.pss.focus();
54                return(false)
55        }
56        return(true)
57}
58//______________________________________________________________________________________________________
59function PulsaEnter(oEvento){
60    var iAscii;
61    if (oEvento.keyCode)
62        iAscii = oEvento.keyCode;
63    else{
64                if (oEvento.which)
65                        iAscii = oEvento.which;
66                else
67                        return false;
68        }
69    if (iAscii === 13)  confirmar();
70        return true;
71}
72//________________________________________________________________________________________________________
73</SCRIPT>
74</HEAD>
75<BODY>
76<DIV style="POSITION:absolute;top:20px;left:150px">
77        <FORM action="accesoperadores.php" name="fdatos" method="post">
78                <DIV align="center">
79                        <IMG src="../images/login_operador.png" width=500 >
80                        <INPUT onkeypress="PulsaEnter(event)" name="usu"  style="POSITION:absolute;top:125px;left:365px;width:90px;height:20px;COLOR: #999999; FONT-FAMILY: Verdana, sans-serif; FONT-SIZE: 12px;">
81                        <INPUT onkeypress="PulsaEnter(event)"  name="pss" type="password"  style="POSITION:absolute;top:160px;left:365px;width:90px;height:20px;COLOR: #999999; FONT-FAMILY: Verdana, sans-serif; FONT-SIZE: 12px;">
82                        <IMG onclick="confirmar()" src="../images/botonok.png" style="POSITION:absolute;top:190px;left:400px;CURSOR: hand">
83                </DIV>
84        </FORM>
85</DIV>
86<?php
87//________________________________________________________________________________________________________
88// Posiciona cursor en campo usuario y muestra mensaje de error si lo hubiera
89echo '<SCRIPT LANGUAGE="javascript">';
90if (!empty($herror))
91        echo "  alert('".$TbErr[$herror]."');";
92echo 'document.fdatos.usu.focus()';
93echo '</SCRIPT>';
94//________________________________________________________________________________________________________
95?>
96</BODY>
97</HTML>
Note: See TracBrowser for help on using the repository browser.