|
|
|
@ -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) { |
|
|
|
|