From 84f76d573967832523dfc728235a56f2b2e14dba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mart=C3=ADn=20Marrese?= Date: Mon, 12 Apr 2004 21:03:31 +0000 Subject: [PATCH] Minor BugFix. --- lib/SAMURAI/DB.php | 5 +---- sistema/local_lib/prepend.php | 10 ++++++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/SAMURAI/DB.php b/lib/SAMURAI/DB.php index 03f40b5..98a2b66 100644 --- a/lib/SAMURAI/DB.php +++ b/lib/SAMURAI/DB.php @@ -48,12 +48,9 @@ class SAMURAI_DB extends DB { { $conf = parse_ini_file(dirname(__FILE__) . '/DB/consultas.ini', true); $db = DB::connect($conf['dsn'],$conf['opciones']); - if (DB::isError($db)) { - trigger_error($db->getMessage(), E_USER_ERROR); - } return $db; } // -X2C } // -X2C Class :SAMURAI_DB -?> \ No newline at end of file +?> diff --git a/sistema/local_lib/prepend.php b/sistema/local_lib/prepend.php index 57331d5..fd3706d 100644 --- a/sistema/local_lib/prepend.php +++ b/sistema/local_lib/prepend.php @@ -5,18 +5,24 @@ //prepend_include_path('/home/mmarrese/public_html/meconlib/lib/'); require_once 'MECON/Marco.php'; +require_once 'MECON/HTML/Error.php'; require_once 'SAMURAI/DB.php'; require_once 'SAMURAI/Perm.php'; require_once 'util.php'; require_once 'SAMURAI/constantes.php'; - - require_once 'MECON/Usuario.php'; //Realizo la conexion con la base de datos $tmp = new SAMURAI_DB(); $DB =& $tmp->connect(); +if (PEAR::isError($DB)) { + $ERROR = new MECON_HTML_Error($DB->getMessage()); + echo $ERROR->toHtml(); + exit; +} + + //CARGO LAS VARIABLES DE SESION INTERNAS {{{ if (!isset($_SESSION['usuario'])) { header('Location: /sistemas/intranet/login?redirect='.$_SERVER['REQUEST_URI']); -- 2.43.0