From f344e46f1369396bcef5170cbc3960d467338f55 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sun, 1 May 2005 00:08:57 +0000 Subject: [PATCH] =?utf8?q?-=20Se=20agrega=20algo=20de=20l=C3=B3gica=20al?= =?utf8?q?=20login,=20aunque=20no=20hace=20nada=20realmente=20todav=C3=ADa?= =?utf8?q?.=20-=20Se=20agrega=20una=20funci=C3=B3n=20para=20mostrar=20erro?= =?utf8?q?res.=20-=20Se=20hace=20que=20el=20formulario=20'recuerde'=20al?= =?utf8?q?=20usuario=20si=20estaba=20mal=20la=20contrase=C3=B1a.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/index.php | 15 ++++++++++++++- src/lib/admin.forms.php | 4 ++-- src/lib/pagina.php | 5 +++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/index.php b/src/index.php index f030497..b7dfe85 100644 --- a/src/index.php +++ b/src/index.php @@ -12,7 +12,20 @@ require_once 'lib/pagina.php'; require_once 'lib/admin.forms.php'; pagina_cabecera('Ingreso'); -admin_form_login(); + +// Si me llegó el form +if (@$_POST['user'] and @$_POST['user']) +{ + // TODO hacer el login + // Si falla el login, muestro error y form de nuevo + error('Usuario o contraseña incorrecta, intente nuevamente.'); + admin_form_login($_POST['user']); +} +else // Si no me viene el form, lo hago loguearse +{ + admin_form_login(); +} + pagina_pie('Leandro Lucarella', 'llucare@fi.uba.ar'); ?> \ No newline at end of file diff --git a/src/lib/admin.forms.php b/src/lib/admin.forms.php index fede9d6..919fc75 100644 --- a/src/lib/admin.forms.php +++ b/src/lib/admin.forms.php @@ -8,7 +8,7 @@ // // $Id$ -function admin_form_login() +function admin_form_login($user = '') { ?>

Por favor identifíquese para ingresar en el sistema:
- Usuario:
+ Usuario:
Contraseña:

diff --git a/src/lib/pagina.php b/src/lib/pagina.php index 2427a76..fbfa8ca 100644 --- a/src/lib/pagina.php +++ b/src/lib/pagina.php @@ -40,4 +40,9 @@ function pagina_pie($autor, $mail) %s

', $msg); +} + ?> \ No newline at end of file -- 2.43.0