source: admin/WebConsole/index.php @ 39a8a99

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 39a8a99 was 39a8a99, checked in by ramon <ramongomez@…>, 13 years ago

Versión 1.0.3, #483: Unificación e internacionalización de la pantalla principal de acceso.

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

  • Property mode set to 100644
File size: 4.0 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// Control de errores.
29$herror=0;
30if (isset($_GET["herror"])) $herror=$_GET["herror"];
31if (isset($_POST["herror"])) $herror=$_POST["herror"];
32// Idioma.
33if (isset($_GET["idi"])) $idi=$_GET["idi"];
34if (isset($_POST["idi"])) $idi=$_POST["idi"];
35include ("idiomas/php/$idi/acceso_$idi.php");
36
37$cmd=CreaComando($cnx); // Crea objeto comando
38if (!$cmd)
39        die($TbMsg["ACCESS_ERROR"]);
40
41?>
42<html>
43<title><?php echo $TbMsg["ACCESS_TITLE"];?></title>
44<head>
45        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
46        <link rel="stylesheet" type="text/css" href="estilos.css">
47<script language="javascript">
48//______________________________________________________________________________
49function confirmar(){
50        if (comprobar_datos())
51                document.fdatos.submit();
52}
53//______________________________________________________________________________
54function comprobar_datos(){
55        if (document.fdatos.usu.value==""){
56                <?php echo 'alert("'.$TbMsg["ACCESS_NOUSER"].'");' ?>
57                document.fdatos.usu.focus()
58                return(false)
59        }
60        if (document.fdatos.pss.value==""){
61                <?php echo 'alert("'.$TbMsg["ACCESS_NOPASS"].'");' ?>
62                document.fdatos.pss.focus()
63                return(false)
64        }
65        var  p=document.fdatos.idcentro.selectedIndex
66        if (p==0){ 
67                <?php echo 'var res=confirm("'.$TbMsg["ACCESS_NOUNIT"].'");' ?>
68        if(!res)
69                return(false)
70        }
71        return(true)
72}
73//______________________________________________________________________________
74function PulsaEnter(oEvento){
75    var iAscii;
76    if (oEvento.keyCode)
77        iAscii = oEvento.keyCode;
78    else{
79                if (oEvento.which)
80                        iAscii = oEvento.which;
81                else
82                        return false;
83        }
84    if (iAscii == 13)  confirmar();
85        return true;
86}
87//______________________________________________________________________________
88</script>
89</head>
90
91<body>
92<div class="acceso">
93<h1> <?php echo $TbMsg["ACCESS_HEADING"]; ?> </h1>
94<h2> <?php echo $TbMsg["ACCESS_SUBHEAD"]; ?> </h2>
95<form action="controlpostacceso.php" name="fdatos" method="post">
96    <fieldset>
97        <p><label for="usu"><?php echo $TbMsg["ACCESS_USERNAME"]; ?></label>
98           <input name="usu" type="text" onkeypress="PulsaEnter(event)" /></p>
99        <p><label for="pss"><?php echo $TbMsg["ACCESS_PASSWORD"]; ?></label>
100           <input name="pss" type="password" onkeypress="PulsaEnter(event)" /></p>
101        <p><label for="idcentro"><?php echo $TbMsg["ACCESS_ORGUNIT"]; ?></label>
102           <?php echo HTMLSELECT($cmd,0,'centros',$idcentro,'idcentro','nombrecentro',220); ?></p>
103        <button type="submit" onclick="confirmar()"><?php echo $TbMsg["ACCESS_OK"]; ?></button>
104    </fieldset>
105</form>
106</div>
107<?
108//______________________________________________________________________________
109// Posiciona cursor en campo usuario y muestra mensaje de error si lo hubiera
110echo '<script language="javascript">';
111if (!empty($herror)) {
112        if (!empty($TbErr[$herror])) {
113                echo "  alert('".$TbErr[$herror]."');";
114        } else {
115                echo "  alert('".$TbMsg["ACCESS_UNKNOWNERROR"]."');";
116        }
117}
118echo '  document.fdatos.usu.focus()';
119echo '</script>';
120//______________________________________________________________________________
121?>
122</body>
123</html>
124
Note: See TracBrowser for help on using the repository browser.