$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'];
}