1 | <? |
---|
2 | // ************************************************************************************************************************************************* |
---|
3 | // Aplicación WEB: ogAdmWebCon |
---|
4 | // Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla |
---|
5 | |
---|
6 | // Fecha Creación: Diciembre-2003 |
---|
7 | // Fecha Última modificación: Febrero-2005 |
---|
8 | // Nombre del fichero: acceso.php |
---|
9 | // Descripción : Presenta la pantalla de login de la aplicación |
---|
10 | // ************************************************************************************************************************************************* |
---|
11 | $herror=0; |
---|
12 | if (isset($_GET["herror"])) $herror=$_GET["herror"]; |
---|
13 | if (isset($_POST["herror"])) $herror=$_POST["herror"]; |
---|
14 | |
---|
15 | $TbErr=array(); |
---|
16 | $TbErr[0]="SIN ERRORES"; |
---|
17 | $TbErr[1]="ATENCIÓN: Debe acceder a la aplicación a través de la pagina inicial"; |
---|
18 | $TbErr[2]="ATENCIÓN: La Aplicación no tiene acceso al Servidor de Bases de Datos"; |
---|
19 | $TbErr[3]="ATENCIÓN: Existen problemas para recuperar el registro, puede que haya sido eliminado"; |
---|
20 | $TbErr[4]="ATENCIÓN: Usted no tiene acceso a esta aplicación"; |
---|
21 | //________________________________________________________________________________________________________ |
---|
22 | ?> |
---|
23 | <HTML> |
---|
24 | <TITLE>Administración web de aulas</TITLE> |
---|
25 | <HEAD> |
---|
26 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
27 | <LINK rel="stylesheet" type="text/css" href="estilos.css"> |
---|
28 | </HEAD> |
---|
29 | <SCRIPT LANGUAGE="JAVASCRIPT"> |
---|
30 | //________________________________________________________________________________________________________ |
---|
31 | function confirmar(){ |
---|
32 | if (comprobar_datos()) |
---|
33 | document.fdatos.submit(); |
---|
34 | } |
---|
35 | //________________________________________________________________________________________________________ |
---|
36 | function comprobar_datos(){ |
---|
37 | if (document.fdatos.usu.value==""){ |
---|
38 | alert("Debe introducir un nombre de Usuario") |
---|
39 | document.fdatos.usu.focus() |
---|
40 | return(false) |
---|
41 | } |
---|
42 | if (document.fdatos.pss.value==""){ |
---|
43 | alert("Debe introducir una contraseña") |
---|
44 | document.fdatos.pss.focus() |
---|
45 | return(false) |
---|
46 | } |
---|
47 | return(true) |
---|
48 | } |
---|
49 | //______________________________________________________________________________________________________ |
---|
50 | function PulsaEnter(oEvento){ |
---|
51 | var iAscii; |
---|
52 | if (oEvento.keyCode) |
---|
53 | iAscii = oEvento.keyCode; |
---|
54 | else{ |
---|
55 | if (oEvento.which) |
---|
56 | iAscii = oEvento.which; |
---|
57 | else |
---|
58 | return false; |
---|
59 | } |
---|
60 | if (iAscii == 13) confirmar(); |
---|
61 | return true; |
---|
62 | } |
---|
63 | //________________________________________________________________________________________________________ |
---|
64 | </SCRIPT> |
---|
65 | </HEAD> |
---|
66 | <BODY> |
---|
67 | <DIV style="POSITION:absolute;top:90;left:250"> |
---|
68 | <FORM action="controlacceso.php" name="fdatos" method="post"> |
---|
69 | <DIV align="center"> |
---|
70 | <IMG src="./images/login_esp.jpg" width=500 > |
---|
71 | <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;"> |
---|
72 | <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;"> |
---|
73 | <IMG onclick="confirmar()" src="./images/botonok.gif" style="POSITION:absolute;top:190;left:400;CURSOR: hand"> |
---|
74 | </DIV> |
---|
75 | </FORM> |
---|
76 | </DIV> |
---|
77 | <? |
---|
78 | //________________________________________________________________________________________________________ |
---|
79 | echo '<DIV style="POSITION: absolute;LEFT: 20px;TOP:300px;visibility:hidden" height=300 width=300>'; |
---|
80 | echo '<IFRAME scrolling=yes height=300 width=310 id="iframes_comodin" src="./nada.php"></IFRAME>'; |
---|
81 | echo '</DIV>'; |
---|
82 | //________________________________________________________________________________________________________ |
---|
83 | // Posiciona cursor en campo usuario y muestra mensaje de error si lo hubiera |
---|
84 | echo '<SCRIPT LANGUAGE="javascript">'; |
---|
85 | if (!empty($herror)) |
---|
86 | echo " alert('".$TbErr[$herror]."');"; |
---|
87 | echo 'document.fdatos.usu.focus()'; |
---|
88 | echo '</SCRIPT>'; |
---|
89 | //________________________________________________________________________________________________________ |
---|
90 | ?> |
---|
91 | </BODY> |
---|
92 | </HTML> |
---|