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 | if(isset($_SESSION)){ // Si existe algua sesión ... |
---|
11 | session_unset(); // Elimina variables |
---|
12 | session_destroy(); // Destruye sesión |
---|
13 | } |
---|
14 | $herror=0; |
---|
15 | if (isset($_GET["herror"])) $herror=$_GET["herror"]; |
---|
16 | |
---|
17 | $TbErr=array(); |
---|
18 | $TbErr[0]="NO ERRORS"; |
---|
19 | $TbErr[1]="WARNING:You must access to aplication through login pag"; |
---|
20 | $TbErr[2]="WARNING:Aplication without access to Server Data Base"; |
---|
21 | $TbErr[3]="WARNING: There are some problem to recovery the record, must be it is removed"; |
---|
22 | //________________________________________________________________________________________________________ |
---|
23 | ?> |
---|
24 | <HTML> |
---|
25 | <TITLE> Administración web de aulas</TITLE> |
---|
26 | <HEAD> |
---|
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 | var usu=document.fdatos.usu.value; |
---|
34 | var pss=document.fdatos.pss.value; |
---|
35 | var ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe |
---|
36 | var wurl="controlacceso.php?usu="+usu+"&pss="+pss |
---|
37 | ifr.src=wurl; // LLama a la página gestora |
---|
38 | } |
---|
39 | } |
---|
40 | //________________________________________________________________________________________________________ |
---|
41 | function comprobar_datos(){ |
---|
42 | if (document.fdatos.usu.value==""){ |
---|
43 | alert("You must introduce a User name") |
---|
44 | document.fdatos.usu.focus() |
---|
45 | return(false) |
---|
46 | } |
---|
47 | if (document.fdatos.pss.value==""){ |
---|
48 | alert("You must introduce a Password") |
---|
49 | document.fdatos.pss.focus() |
---|
50 | return(false) |
---|
51 | } |
---|
52 | return(true) |
---|
53 | } |
---|
54 | //______________________________________________________________________________________________________ |
---|
55 | function resultado_acceso(resul){ |
---|
56 | if (!resul){ |
---|
57 | alert('WARNING: You are not authorized to access this aplication') |
---|
58 | return |
---|
59 | } |
---|
60 | location.href="frames.php"; |
---|
61 | } |
---|
62 | //______________________________________________________________________________________________________ |
---|
63 | function PulsaEnter(oEvento){ |
---|
64 | var iAscii; |
---|
65 | if (oEvento.keyCode) |
---|
66 | iAscii = oEvento.keyCode; |
---|
67 | else{ |
---|
68 | if (oEvento.which) |
---|
69 | iAscii = oEvento.which; |
---|
70 | else |
---|
71 | return false; |
---|
72 | } |
---|
73 | if (iAscii == 13) confirmar(); |
---|
74 | return true; |
---|
75 | } |
---|
76 | //________________________________________________________________________________________________________ |
---|
77 | </SCRIPT> |
---|
78 | </HEAD> |
---|
79 | <BODY> |
---|
80 | <DIV style="POSITION:absolute;top:90;left:212"> |
---|
81 | <FORM action="controlacceso.php" name="fdatos" method="post"> |
---|
82 | <DIV align="center"> |
---|
83 | <IMG src="./images/login_eng.jpg" > |
---|
84 | <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;"> |
---|
85 | <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;"> |
---|
86 | <IMG onclick="confirmar()" src="./images/botonok.gif" style="POSITION:absolute;top:215;left:555;CURSOR: hand"> |
---|
87 | </DIV> |
---|
88 | </FORM> |
---|
89 | </DIV> |
---|
90 | <? |
---|
91 | //________________________________________________________________________________________________________ |
---|
92 | echo '<DIV style="POSITION: absolute;LEFT: 20px;TOP:300px;visibility=hidden" height=300 width=300>'; |
---|
93 | echo '<IFRAME scrolling=yes height=300 width=310 id="iframes_comodin" src="./nada.php"></IFRAME>'; |
---|
94 | echo '</DIV>'; |
---|
95 | //________________________________________________________________________________________________________ |
---|
96 | // Posiciona cursor en campo usuario y muestra mensaje de error si lo hubiera |
---|
97 | echo '<SCRIPT LANGUAGE="javascript">'; |
---|
98 | if (!empty($herror)) |
---|
99 | echo " alert('".$TbErr[$herror]."');"; |
---|
100 | echo 'document.fdatos.usu.focus()'; |
---|
101 | echo '</SCRIPT>'; |
---|
102 | //________________________________________________________________________________________________________ |
---|
103 | ?> |
---|
104 | </BODY> |
---|
105 | </HTML> |
---|