Browse Source

Resolver o bug de não apenas obter o admin no email

1.9-pjsip
bruno 3 months ago
parent
commit
4738c273a5
  1. 24
      include/util/funcoesApl.php

24
include/util/funcoesApl.php

@ -588,10 +588,28 @@ function IsUserAdmin() {
}
function IsAdmin() {
if (strpos(GetLogin(), "@") !== false) {
return strtolower(GetLogin()) == 'admin@system.cloud';
if( strtoupper(GetLogin() ) != 'ADMIN' ){
return false;
}
$matricula = GetMatricula();
$query = "select \"admin\" from pbx_usuarios where matricula = '$matricula' and org_padrao = 0";
$isadmin = pg_query($GLOBALS["dbcon"], $query);
/* Não foi possível obter se o usuário é admin
* retorna false */
if(!$isadmin){
return false;
}
return strtoupper(GetLogin()) == 'ADMIN';
/* se a matrícula tem permissão de admin */
if(pg_num_rows($isadmin) < 1){
return false;
}
return true;
}
function AgenteON($idUser = null) {

Loading…
Cancel
Save