isExpired()) { $cacheutils->setValue([getAdminList(), date('d-m-Y H:i:s')], 30); } $adminlist = $cacheutils->getValue(); // FUNCTIONS function getAdminList() { global $config; global $lang; $admingroups = $config["adminlist"]; $localIcons = array(100, 200, 300, 400, 500, 600); try { $tsAdmin = getTeamspeakConnection(); $output = ""; foreach ($admingroups as $group) { if (!array_key_exists((string)$group, $tsAdmin->serverGroupList())) continue; $group = $tsAdmin->serverGroupGetById($group); $icon = ''; if ($group["iconid"]) { if (!$group->iconIsLocal("iconid")) { $groupicon = getGroupIcon($tsAdmin, $group); if ($groupicon) { $icon = ' '; } } elseif (in_array($group["iconid"], $localIcons)) { $icon = ' '; } } $output .= "
$icon$group
"; $clients = $group->clientList(); if (empty($clients)) { $output .= '' . translate($lang["adminlist"]["emptygroup"]) . '
'; continue; } $onlineClients = []; $offlineClients = []; foreach ($clients as $userInfo) { $user = getClientByDbid($tsAdmin, $userInfo['cldbid']); if($user["client_type"]) continue; if (!$user) { $offlineClients[] = '' . $userInfo['client_nickname'] . '' . translate($lang["adminlist"]["status"]["offline"]) . '
'; continue; } $onlineClients[] = '' . '' . $user . '' . ($user['client_away'] ? '' . translate($lang["adminlist"]["status"]["away"]) . '' : '' . translate($lang["adminlist"]["status"]["online"]) . '') . '
'; } foreach (array_merge($onlineClients, $offlineClients) as $str) $output .= $str; } return $output; } catch (TeamSpeak3_Exception $e) { return '' . translate($lang["general"]["scripterror"], [$e->getCode(), $e->getMessage()]) . '