From da8392d166041a11b1e6cfe96511d847887ccd21 Mon Sep 17 00:00:00 2001 From: Matheo Bonucia Date: Tue, 23 Jul 2024 19:38:27 +0000 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7=C3=A3o=20de=20query=20e=20refer?= =?UTF-8?q?=C3=AAncia=20ao=20issue=20criado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contacteFunc.php | 2 +- include/util/funcoesApl.php | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/contacteFunc.php b/contacteFunc.php index 66f1b2b5..d6400f4f 100644 --- a/contacteFunc.php +++ b/contacteFunc.php @@ -1153,7 +1153,7 @@ function GetUsuario($dbcon, $matricula) { $org_id = $_SESSION['SSEmpresaPadrao']; - $query = "SELECT id, nome, apelido, matricula, email FROM pbx_usuarios pu INNER JOIN pbx_organizacao_usuarios pou ON pu.id = pou.id_usuario and pou.id_organizacao = $org_id WHERE matricula = '{$matricula}'"; + $query = "SELECT pu.id, nome, apelido, matricula, email FROM pbx_usuarios pu INNER JOIN pbx_organizacao_usuarios pou ON pu.id = pou.id_usuario and pou.id_organizacao = $org_id WHERE matricula = '{$matricula}'"; $result = pg_query($dbcon, $query); $data = pg_fetch_assoc($result); return $data; diff --git a/include/util/funcoesApl.php b/include/util/funcoesApl.php index 20ab77f9..d2790b9c 100755 --- a/include/util/funcoesApl.php +++ b/include/util/funcoesApl.php @@ -3998,15 +3998,15 @@ function PaginaDados($idProg, &$sql, &$params, &$regPagina, &$offSet, &$pagMostr * Em alguns casos o total de registros é passado direto * na variavel $sql como um inteiro. */ - $org_id = GetOrganizacao(); + // $org_id = GetOrganizacao(); - if (strpos($sql, 'org_id') === false && strpos($sql, 'id_organizacao') === false) { - if (strpos($sql, 'where') !== false) { - $sql = str_replace("where", "where org_id = {$org_id} and", $sql); - } else if (strpos($sql, 'WHERE') !== false) { - $sql = str_replace("WHERE", "WHERE org_id = {$org_id} AND", $sql); - } - } + // if (strpos($sql, 'org_id') === false && strpos($sql, 'id_organizacao') === false) { + // if (strpos($sql, 'where') !== false) { + // $sql = str_replace("where", "where org_id = {$org_id} and", $sql); + // } else if (strpos($sql, 'WHERE') !== false) { + // $sql = str_replace("WHERE", "WHERE org_id = {$org_id} AND", $sql); + // } + // } // if (strpos($sql, 'org_id') === false && strpos($sql, 'id_organizacao') === false) { // $org_condition = "org_id = {$org_id}";