source: admin/WebConsole/acceso_esp.php @ 01a36ca

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Last change on this file since 01a36ca was 3e24aa5, checked in by ramon <ramongomez@…>, 14 years ago

Versión 1.0.2: acceso a consola web por HTTPS (modifica #443).

git-svn-id: https://opengnsys.es/svn/branches/version1.0@2329 a21b9725-9963-47de-94b9-378ad31fedc9

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