[3ec149c] | 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 de la aplicación |
---|
| 9 | // ******************************************************************************************************** |
---|
| 10 | include_once("controlacceso.php"); |
---|
| 11 | include_once("./includes/CreaComando.php"); |
---|
| 12 | include_once("./clases/AdoPhp.php"); |
---|
| 13 | include_once("./includes/HTMLSELECT.php"); |
---|
| 14 | //________________________________________________________________________________________________________ |
---|
| 15 | $cmd=CreaComando($cnx); // Crea objeto comando |
---|
| 16 | if (!$cmd) |
---|
| 17 | die("Error de acceso"); |
---|
| 18 | //________________________________________________________________________________________________________ |
---|
| 19 | $herror=0; |
---|
| 20 | if (isset($_GET["herror"])) $herror=$_GET["herror"]; |
---|
| 21 | if (isset($_POST["herror"])) $herror=$_POST["herror"]; |
---|
| 22 | |
---|
| 23 | $TbErr=array(); |
---|
| 24 | $TbErr[0]="SIN ERRORES"; |
---|
| 25 | $TbErr[1]="ATENCIÓN: Debe acceder a la aplicación a través de la pagina inicial"; |
---|
| 26 | $TbErr[2]="ATENCIÓN: La Aplicación no tiene acceso al Servidor de Bases de Datos"; |
---|
| 27 | $TbErr[3]="ATENCIÓN: Existen problemas para recuperar el registro, puede que haya sido eliminado"; |
---|
| 28 | $TbErr[4]="ATENCIÓN: Usted no tiene acceso a esta aplicación"; |
---|
| 29 | //________________________________________________________________________________________________________ |
---|
| 30 | ?> |
---|
| 31 | <HTML> |
---|
| 32 | <TITLE>Administración web de aulas</TITLE> |
---|
| 33 | <HEAD> |
---|
| 34 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
| 35 | <LINK rel="stylesheet" type="text/css" href="estilos.css"> |
---|
| 36 | </HEAD> |
---|
| 37 | <SCRIPT LANGUAGE="JAVASCRIPT"> |
---|
| 38 | //________________________________________________________________________________________________________ |
---|
| 39 | function confirmar(){ |
---|
| 40 | if (comprobar_datos()) |
---|
| 41 | document.fdatos.submit(); |
---|
| 42 | } |
---|
| 43 | //________________________________________________________________________________________________________ |
---|
| 44 | function comprobar_datos(){ |
---|
| 45 | if (document.fdatos.usu.value==""){ |
---|
| 46 | alert("Debe introducir un nombre de Usuario") |
---|
| 47 | document.fdatos.usu.focus() |
---|
| 48 | return(false) |
---|
| 49 | } |
---|
| 50 | if (document.fdatos.pss.value==""){ |
---|
| 51 | alert("Debe introducir una contraseña") |
---|
| 52 | document.fdatos.pss.focus() |
---|
| 53 | return(false) |
---|
| 54 | } |
---|
| 55 | var p=document.fdatos.idcentro.selectedIndex |
---|
| 56 | if (p==0){ |
---|
| 57 | var res=confirm("ATENCIÓN: No ha introducido ninguna Unidad Organizativa. NO tendrá acceso al sistema a menos que sea adminstrador general de la Aplicación. ¿Desea acceder con este perfil?"); |
---|
| 58 | if(!res) |
---|
| 59 | return(false) |
---|
| 60 | } |
---|
| 61 | return(true) |
---|
| 62 | } |
---|
| 63 | //______________________________________________________________________________________________________ |
---|
| 64 | function PulsaEnter(oEvento){ |
---|
| 65 | var iAscii; |
---|
| 66 | if (oEvento.keyCode) |
---|
| 67 | iAscii = oEvento.keyCode; |
---|
| 68 | else{ |
---|
| 69 | if (oEvento.which) |
---|
| 70 | iAscii = oEvento.which; |
---|
| 71 | else |
---|
| 72 | return false; |
---|
| 73 | } |
---|
| 74 | if (iAscii == 13) confirmar(); |
---|
| 75 | return true; |
---|
| 76 | } |
---|
| 77 | //________________________________________________________________________________________________________ |
---|
| 78 | </SCRIPT> |
---|
| 79 | </HEAD> |
---|
| 80 | <BODY> |
---|
| 81 | <DIV style="POSITION:absolute;top:90;left:250"> |
---|
| 82 | <FORM action="controlpostacceso.php" name="fdatos" method="post"> |
---|
| 83 | <DIV align="center"> |
---|
| 84 | <IMG src="./images/login_esp.jpg" width=500 > |
---|
| 85 | <INPUT onkeypress="PulsaEnter(event)" name="usu" |
---|
| 86 | style="POSITION:absolute;top:125px;left:365px;width:90;height:20;COLOR: #999999; FONT-FAMILY: Verdana; FONT-SIZE: 12px;"> |
---|
| 87 | <INPUT onkeypress="PulsaEnter(event)" name="pss" type="password" |
---|
| 88 | style="POSITION:absolute;top:160px;left:365;width:90;height:20;COLOR: #999999; FONT-FAMILY: Verdana; FONT-SIZE: 12px;"> |
---|
| 89 | |
---|
| 90 | <DIV style="POSITION:absolute;top:180px;left:265;COLOR: #F9F9F9; FONT-FAMILY: Verdana; FONT-SIZE: 12px;"> |
---|
| 91 | <P>Unidad Organizativa<BR> |
---|
| 92 | <? |
---|
| 93 | |
---|
| 94 | echo HTMLSELECT($cmd,0,'centros',$idcentro,'idcentro','nombrecentro',220); |
---|
| 95 | ?> |
---|
| 96 | </P></DIV> |
---|
| 97 | |
---|
| 98 | <IMG onclick="confirmar()" src="./images/botonok.gif" style="POSITION:absolute;top:240;left:400;CURSOR: hand"> |
---|
| 99 | </DIV> |
---|
| 100 | </FORM> |
---|
| 101 | </DIV> |
---|
| 102 | <? |
---|
| 103 | //________________________________________________________________________________________________________ |
---|
| 104 | echo '<DIV style="POSITION: absolute;LEFT: 20px;TOP:300px;visibility:hidden" height=300 width=300>'; |
---|
| 105 | echo '<IFRAME scrolling=yes height=300 width=310 id="iframes_comodin" src="./nada.php"></IFRAME>'; |
---|
| 106 | echo '</DIV>'; |
---|
| 107 | //________________________________________________________________________________________________________ |
---|
| 108 | // Posiciona cursor en campo usuario y muestra mensaje de error si lo hubiera |
---|
| 109 | echo '<SCRIPT LANGUAGE="javascript">'; |
---|
| 110 | if (!empty($herror)) |
---|
| 111 | echo " alert('".$TbErr[$herror]."');"; |
---|
| 112 | echo 'document.fdatos.usu.focus()'; |
---|
| 113 | echo '</SCRIPT>'; |
---|
| 114 | //________________________________________________________________________________________________________ |
---|
| 115 | ?> |
---|
| 116 | </BODY> |
---|
| 117 | </HTML> |
---|