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