From 325ae567c29fec68d2be78712b3d85b2dc41a9e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mart=C3=ADn=20Marrese?= Date: Thu, 18 Mar 2004 20:10:30 +0000 Subject: [PATCH] BugFix. --- lib/SAMURAI/Perfil.php | 12 ++++++++++-- lib/SAMURAI/Perfil/consultas.ini | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/SAMURAI/Perfil.php b/lib/SAMURAI/Perfil.php index 1af7600..3ddfe55 100644 --- a/lib/SAMURAI/Perfil.php +++ b/lib/SAMURAI/Perfil.php @@ -417,15 +417,23 @@ class SAMURAI_Perfil { //OBTENGO LOS ID DE LA BASE $rta = array(); $sql = parse_ini_file(dirname(__FILE__) . '/Perfil/consultas.ini', true); - $consulta = $sql['obtener_id_perfiles']; if ($id_sistema) { + $consulta = $sql['obtener_id_perfiles']; $consulta.= $sql['obtener_id_perfiles3']; } - if ($filtro) { //Verifico si se paso un filtro + else { + $consulta = $sql['obtener_id_perfiles5']; + } + if ($filtro && $id_sistema) { //Verifico si se paso un filtro $tmp2 = $consulta.$sql['obtener_id_perfiles2']; //Reemplazo el filtro por ##?## $consulta = ereg_replace ('##FILTRO##', $filtro, $tmp2); } + elseif ($filtro) { + $tmp2 = $consulta.$sql['obtener_id_perfiles6']; + //Reemplazo el filtro por ##?## + $consulta = ereg_replace ('##FILTRO##', $filtro, $tmp2); + } $consulta.= $sql['obtener_id_perfiles4']; $dbh = $db->prepare($consulta); if ($id_sistema) { diff --git a/lib/SAMURAI/Perfil/consultas.ini b/lib/SAMURAI/Perfil/consultas.ini index 7e28e3a..4d698e4 100644 --- a/lib/SAMURAI/Perfil/consultas.ini +++ b/lib/SAMURAI/Perfil/consultas.ini @@ -8,6 +8,8 @@ obtener_id_perfiles = " SELECT ps.id_perfil FROM samurai.perfil_sist as ps, s obtener_id_perfiles3 = " AND ps.id_sistema = ? " obtener_id_perfiles2 = " AND p.desc_perfil like '%##FILTRO##%'" obtener_id_perfiles4 = " ORDER BY p.desc_perfil" +obtener_id_perfiles5 = " SELECT p.id_perfil FROM samurai.prefil as p " +obtener_id_perfiles6 = " WHERE p.desc_perfil like '%##FILTRO##%'" borrar_perfil = " DELETE FROM samurai.perfil as p " obtener_permisos = " SELECT id_permiso, observaciones FROM samurai.perm_perfil_sist WHERE id_perfil = ? AND id_sistema = ?" -- 2.43.0