From: Martín Marrese Date: Thu, 18 Mar 2004 20:10:30 +0000 (+0000) Subject: BugFix. X-Git-Tag: svn_import~14 X-Git-Url: https://git.llucax.com/mecon/samurai.git/commitdiff_plain/325ae567c29fec68d2be78712b3d85b2dc41a9e8 BugFix. --- 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 = ?"