source: admin/WebConsole/index.php @ 0a735488

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 0a735488 was 20885b5, checked in by ramon <ramongomez@…>, 13 years ago

#551: Siguiendo con la eliminación de errores PHP en fichero de log de Apache; incluir "favicon" e internacionalización del título de las páginas.

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

  • Property mode set to 100644
File size: 4.6 KB
Line 
1<?php
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// Nombre del fichero: acceso.php
7// Descripción: Pantalla principal de acceso a la consola de administración web.
8// Versión 1.0.3: Unificación de ficheros e internacionalización.
9// Autor: Ramón Gómez - ETSII, Universidad de Sevilla
10// Fecha: 2012-02-07
11// *****************************************************************************
12if(isset($_SESSION)){   // Si existe algua sesión ...
13        session_unset(); // Elimina variables
14        session_destroy(); // Destruye sesión
15}
16# Cambiar a HTTPS
17if (empty ($_SERVER["HTTPS"])) {
18        header ("Location: https://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]);
19        exit (0);
20}
21
22// Cargar configuración.
23include_once("controlacceso.php");
24include_once("./includes/CreaComando.php");
25include_once("./clases/AdoPhp.php");
26include_once("./includes/HTMLSELECT.php");
27
28// Valores por defecto.
29$herror=0;
30$idcentro="";
31
32// Control de errores.
33if (isset($_GET["herror"])) $herror=$_GET["herror"];
34if (isset($_POST["herror"])) $herror=$_POST["herror"];
35// Idioma.
36if (isset($_POST["nemonico"])) $parmidi=$_POST["nemonico"];
37if (!empty ($parmidi) and file_exists ("idiomas/php/$parmidi/acceso_$parmidi.php")) {
38        $idi=$parmidi;
39}
40include ("idiomas/php/$idi/acceso_$idi.php");
41
42$cmd=CreaComando($cnx); // Crea objeto comando
43if (!$cmd)
44        die($TbMsg["ACCESS_ERROR"]);
45
46?>
47<html>
48<head>
49<title><?php echo $TbMsg["ACCESS_TITLE"];?></title>
50<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
51<link rel="shortcut icon" href="images/iconos/logocirculos.png" type="image/png" />
52<link rel="stylesheet" type="text/css" href="estilos.css" />
53<script language="javascript">
54//______________________________________________________________________________
55function confirmar(){
56        if (comprobar_datos())
57                document.fdatos.submit();
58}
59//______________________________________________________________________________
60function comprobar_datos(){
61        if (document.fdatos.usu.value==""){
62                <?php echo 'alert("'.$TbMsg["ACCESS_NOUSER"].'");' ?>
63                document.fdatos.usu.focus()
64                return(false)
65        }
66        if (document.fdatos.pss.value==""){
67                <?php echo 'alert("'.$TbMsg["ACCESS_NOPASS"].'");' ?>
68                document.fdatos.pss.focus()
69                return(false)
70        }
71        var  p=document.fdatos.idcentro.selectedIndex
72        if (p==0){ 
73                <?php echo 'var res=confirm("'.$TbMsg["ACCESS_NOUNIT"].'");' ?>
74        if(!res)
75                return(false)
76        }
77        return(true)
78}
79//______________________________________________________________________________
80function PulsaEnter(oEvento){
81    var iAscii;
82    if (oEvento.keyCode)
83        iAscii = oEvento.keyCode;
84    else{
85                if (oEvento.which)
86                        iAscii = oEvento.which;
87                else
88                        return false;
89        }
90    if (iAscii == 13)  confirmar();
91        return true;
92}
93//______________________________________________________________________________
94</script>
95</head>
96
97<body>
98<div class="acceso">
99<h1> <?php echo $TbMsg["ACCESS_HEADING"]; ?> </h1>
100<h2> <?php echo $TbMsg["ACCESS_SUBHEAD"]; ?> </h2>
101<form action="controlpostacceso.php" name="fdatos" method="post">
102    <fieldset>
103        <p><label for="usu"><?php echo $TbMsg["ACCESS_USERNAME"]; ?></label>
104           <input name="usu" type="text" onkeypress="PulsaEnter(event)" /></p>
105        <p><label for="pss"><?php echo $TbMsg["ACCESS_PASSWORD"]; ?></label>
106           <input name="pss" type="password" onkeypress="PulsaEnter(event)" /></p>
107        <p><label for="idcentro"><?php echo $TbMsg["ACCESS_ORGUNIT"]; ?></label>
108           <?php echo HTMLSELECT($cmd,0,'centros',$idcentro,'idcentro','nombrecentro',220); ?></p>
109        <button type="submit" onclick="confirmar()"><?php echo $TbMsg["ACCESS_OK"]; ?></button>
110    </fieldset>
111</form>
112</div>
113<div class="pie">
114<?php
115// Añadir versión y URL al proyecto.
116$versionfile="../doc/VERSION.txt";
117if (file_exists ($versionfile)) {
118        echo '<span><a href="http://opengnsys.es/">';
119        include ($versionfile);
120        echo '</a></span>';
121}
122?>
123<form action="#" name="lang" method="post">
124      <?php echo HTMLSELECT($cmd,0,'idiomas',$idi,'nemonico','descripcion',80); ?>
125      <button type="submit"><?php echo $TbMsg["ACCESS_CHOOSE"]; ?></button>
126</form>
127</div>
128<?php
129//______________________________________________________________________________
130// Posiciona cursor en campo usuario y muestra mensaje de error si lo hubiera
131echo '<script language="javascript">';
132if (!empty($herror)) {
133        if (!empty($TbErr[$herror])) {
134                echo "  alert('".$TbErr[$herror]."');";
135        } else {
136                echo "  alert('".$TbMsg["ACCESS_UNKNOWNERROR"]."');";
137        }
138}
139echo '  document.fdatos.usu.focus()';
140echo '</script>';
141//______________________________________________________________________________
142?>
143</body>
144</html>
145
Note: See TracBrowser for help on using the repository browser.