Exemple #1
0
} else {
    $list = $group->members();
    $members = array();
    foreach ($list as $member) {
        $members[$member['hostname'] . "##" . $member['uuid']] = $member['hostname'];
        $listOfMembers[$member['uuid']] = $member;
    }
    if (!$members) {
        $members = array();
    }
    if (!$listOfMembers) {
        $listOfMembers = array();
    }
    $truncate_limit = getMaxElementsForStaticList();
    $listOfMachines = getRestrictedComputersList(0, $truncate_limit, array('get' => array('cn', 'objectUUID'), 'imaging_server' => $imaging_server), False);
    $count = getRestrictedComputersListLen(array('imaging_server' => $imaging_server));
    if ($truncate_limit < $count) {
        new NotifyWidgetWarning(sprintf(_T("Computers list has been truncated at %d computers", "dyngroup"), $truncate_limit));
    }
    $machines = array();
    foreach ($listOfMachines as $machine) {
        $machines[$machine['cn'] . "##" . $machine['objectUUID']] = $machine['cn'];
    }
}
ksort($members);
reset($members);
ksort($machines);
$diff = array_diff_assoc($machines, $members);
natcasesort($diff);
if (isset($_GET['pieGroupStatus'])) {
    // if group creation page is called by clicking on a Pie slice
}
$cl = getRestrictedComputersList($start, $start + $maxperpage, $filter, False);
$cl1 = array();
foreach ($cl as $k => $v) {
    $cl1[$v[1]['cn'][0] . $k] = $k;
}
$names = array();
function my_cmp($a, $b)
{
    return strcmp(strtolower($a), strtolower($b));
}
uksort($cl1, "my_cmp");
foreach ($cl1 as $k1 => $k) {
    $names[] = join_value($cl[$k]);
}
$count = getRestrictedComputersListLen($filter);
/* Check:
 *   - if MSC is configured with file download capability
 *   - if MSC is configured with VNC client capability
 * */
$msc_can_download_file = False;
$msc_vnc_show_icon = False;
if (in_array("msc", $_SESSION["supportModList"])) {
    require_once "modules/msc/includes/scheduler_xmlrpc.php";
    require_once "modules/msc/includes/mscoptions_xmlrpc.php";
    $msc_can_download_file = msc_can_download_file();
    $msc_vnc_show_icon = web_vnc_show_icon();
}
list_computers($names, $filter, $count, $canbedeleted, $canbedeletedfromgroup, $is_group, $msc_can_download_file, $msc_vnc_show_icon);
function join_value($n)
{