X-Git-Url: https://git.llucax.com/mecon/samurai.git/blobdiff_plain/fec7efb97aad98639a2d9c0170936a777147daf1..6c96af7186fde066713c880405778e445eff079b:/lib/SAMURAI/Perm.php?ds=sidebyside diff --git a/lib/SAMURAI/Perm.php b/lib/SAMURAI/Perm.php index 3533f68..965665c 100644 --- a/lib/SAMURAI/Perm.php +++ b/lib/SAMURAI/Perm.php @@ -83,7 +83,8 @@ class SAMURAI_Perm { $query = ' SELECT DISTINCT psu.id_sistema AS sistema, pps.id_permiso AS permiso FROM samurai.perfil_sist_usuario AS psu, samurai.perm_perfil_sist AS pps - WHERE psu.login = '.$db->quote($login).' AND psu.id_perfil = pps.id_perfil;'; + WHERE psu.login = '.$db->quote($login).' AND psu.id_perfil = pps.id_perfil + AND psu.id_sistema = pps.id_sistema'; foreach ($db->getAll($query, DB_FETCHMODE_ASSOC) as $row) { $this->_permisos[$row['sistema']][] = $row['permiso']; } @@ -147,7 +148,7 @@ Si no se pasa ningun parametro ($perm->tiene()), devuelve true si tiene un permi function chequear() // ~X2C { $args = func_get_args(); - if (!call_user_method_array(array($this, 'tiene'), $args)) { + if (!call_user_func_array(array($this, 'tiene'), $args)) { include 'MECON/includes/no_autorizado.html'; exit; }