| 1 | <? |
|---|
| 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 | |
|---|
| 11 | session_start(); // Activa variables de sesi� |
|---|
| 12 | |
|---|
| 13 | $herror=0; |
|---|
| 14 | |
|---|
| 15 | if (isset($_GET["herror"])) $herror=$_GET["herror"]; |
|---|
| 16 | if (isset($_POST["herror"])) $herror=$_POST["herror"]; |
|---|
| 17 | |
|---|
| 18 | $ITEMS_PUBLICOS=1; |
|---|
| 19 | $ITEMS_PRIVADOS=2; |
|---|
| 20 | |
|---|
| 21 | if (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 | <TITLE>Administración web de aulas</TITLE> |
|---|
| 35 | <HEAD> |
|---|
| 36 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
|---|
| 37 | <LINK rel="stylesheet" type="text/css" href="estilos.css"> |
|---|
| 38 | </HEAD> |
|---|
| 39 | <SCRIPT LANGUAGE="JAVASCRIPT"> |
|---|
| 40 | //________________________________________________________________________________________________________ |
|---|
| 41 | function confirmar(){ |
|---|
| 42 | if (comprobar_datos()) |
|---|
| 43 | document.fdatos.submit(); |
|---|
| 44 | } |
|---|
| 45 | //________________________________________________________________________________________________________ |
|---|
| 46 | function comprobar_datos(){ |
|---|
| 47 | if (document.fdatos.usu.value==""){ |
|---|
| 48 | alert("Debe introducir un nombre de Usuario") |
|---|
| 49 | document.fdatos.usu.focus() |
|---|
| 50 | return(false) |
|---|
| 51 | } |
|---|
| 52 | if (document.fdatos.pss.value==""){ |
|---|
| 53 | alert("Debe introducir una contraseña") |
|---|
| 54 | document.fdatos.pss.focus() |
|---|
| 55 | return(false) |
|---|
| 56 | } |
|---|
| 57 | return(true) |
|---|
| 58 | } |
|---|
| 59 | //______________________________________________________________________________________________________ |
|---|
| 60 | function PulsaEnter(oEvento){ |
|---|
| 61 | var iAscii; |
|---|
| 62 | if (oEvento.keyCode) |
|---|
| 63 | iAscii = oEvento.keyCode; |
|---|
| 64 | else{ |
|---|
| 65 | if (oEvento.which) |
|---|
| 66 | iAscii = oEvento.which; |
|---|
| 67 | else |
|---|
| 68 | return false; |
|---|
| 69 | } |
|---|
| 70 | if (iAscii == 13) confirmar(); |
|---|
| 71 | return true; |
|---|
| 72 | } |
|---|
| 73 | //________________________________________________________________________________________________________ |
|---|
| 74 | </SCRIPT> |
|---|
| 75 | </HEAD> |
|---|
| 76 | <BODY> |
|---|
| 77 | <DIV style="POSITION:absolute;top:20;left:150"> |
|---|
| 78 | <FORM action="accesoperadores.php" name="fdatos" method="post"> |
|---|
| 79 | <DIV align="center"> |
|---|
| 80 | <IMG src="../images/login_operador.png" width=500 > |
|---|
| 81 | <INPUT onkeypress="PulsaEnter(event)" name="usu" style="POSITION:absolute;top:125px;left:365px;width:90;height:20;COLOR: #999999; FONT-FAMILY: Verdana; FONT-SIZE: 12px;"> |
|---|
| 82 | <INPUT onkeypress="PulsaEnter(event)" name="pss" type="password" style="POSITION:absolute;top:160px;left:365;width:90;height:20;COLOR: #999999; FONT-FAMILY: Verdana; FONT-SIZE: 12px;"> |
|---|
| 83 | <IMG onclick="confirmar()" src="../images/botonok.png" style="POSITION:absolute;top:190;left:400;CURSOR: hand"> |
|---|
| 84 | </DIV> |
|---|
| 85 | </FORM> |
|---|
| 86 | </DIV> |
|---|
| 87 | <? |
|---|
| 88 | //________________________________________________________________________________________________________ |
|---|
| 89 | // Posiciona cursor en campo usuario y muestra mensaje de error si lo hubiera |
|---|
| 90 | echo '<SCRIPT LANGUAGE="javascript">'; |
|---|
| 91 | if (!empty($herror)) |
|---|
| 92 | echo " alert('".$TbErr[$herror]."');"; |
|---|
| 93 | echo 'document.fdatos.usu.focus()'; |
|---|
| 94 | echo '</SCRIPT>'; |
|---|
| 95 | //________________________________________________________________________________________________________ |
|---|
| 96 | ?> |
|---|
| 97 | </BODY> |
|---|
| 98 | </HTML> |
|---|