fixed errors in function alias in metaconsole

This commit is contained in:
daniel 2018-04-24 13:23:45 +02:00
parent 30889074af
commit ef9d31adfd
1 changed files with 3 additions and 2 deletions

View File

@ -1330,12 +1330,13 @@ function agents_get_name ($id_agent, $case = "none") {
* @return string Alias of the given agent.
*/
function agents_get_alias ($id_agent, $case = 'none') {
if(is_metaconsole()){
global $config;
if($config['dbconnection_cache'] == null && is_metaconsole()){
$alias = (string) db_get_value ('alias', 'tmetaconsole_agent', 'id_tagente', (int) $id_agent);
} else {
$alias = (string) db_get_value ('alias', 'tagente', 'id_agente', (int) $id_agent);
}
switch ($case) {
case 'upper':
return mb_strtoupper($alias, 'UTF-8');