예제 #1
0
    $exptime = explode('_', $pxe['filename']);
    $template->assign(array("FILE" => $pxe['filename']));
    $template->parse("FILENAMES_LIST", ".Filenames");
}
$expcn = explode('_', $pxe['cn']);
$name = array_slice($expcn, 1);
$pxecn = implode('_', $name);
# Bootmenü Einträge
$menuentries = get_menuentries($pxeDN, array("dn", "menuposition", "label", "menulabel", "menudefault", "menupasswd", "menuhide"));
#print_r($menuentries); echo "<br>";
$maxpos = count($menuentries) + 1;
# Globale Parameter
$template->assign(array("PXEDN" => $pxeDN, "PXECN" => $pxecn, "TIMERANGE" => $pxe['timerange'], "RBSDN" => $rbsDN, "RBS" => $rbsdata['cn'], "RBSAU" => $rbsau, "NFS" => $rbsdata['nfsserverip'], "NFSROOT" => $rbsdata['exportpath'], "TFTP" => $rbsdata['tftpserverip'], "TFTPROOT" => $rbsdata['tftppath'], "TFTPFILE" => $rbsdata['tftpclientconfpath'], "FILEURI" => $pxe['fileuri'], "FILE" => $pxe['filename'], "ALLOW" => $pxe['allowoptions'], "CONSOLE" => $pxe['console'], "DEFAULT" => $pxe['default'], "DISPLAY" => $pxe['display'], "FONT" => $pxe['font'], "IMPLICIT" => $pxe['implicit'], "KBDMAP" => $pxe['kbdmap'], "MENMPW" => $pxe['menumasterpasswd'], "MENTIT" => $pxe['menutitle'], "NOESC" => $pxe['noescape'], "ONERR" => $pxe['onerror'], "ONTIME" => $pxe['ontimeout'], "PROMPT" => $pxe['prompt'], "SAY" => $pxe['say'], "SERIAL" => $pxe['serial'], "TIMEOUT" => $pxe['timeout'], "MAXPOS" => $maxpos, "NODEDN" => $nodeDN, "DEFDN" => $rbsDN, "MNR" => $mnr, "SBMNR" => $sbmnr, "MCNR" => $mcnr));
# RB Dienste für Submenüeinträge holen
# kommt wohl wieder raus (->Submenüs nur im eigenen RBS Bereich)
$subrbs = get_rbsoffers($auDN);
# Für Submenü Einträge
$template->assign(array("SUBRBSDN" => "", "SUBRBSCN" => "", "SUBRBSAU" => ""));
if (count($subrbs) != 0) {
    $template->define_dynamic("Subrbs", "Webseite");
    foreach ($subrbs as $item) {
        $rbsdnexp = ldap_explode_dn($item, 1);
        $subrbscn = $rbsdnexp[0];
        $subrbsau = $rbsdnexp[2];
        #$subrbsexp = explode(',',$item['dn']);
        #$subrbsau = explode('=',$subrbsexp[2]);
        $template->assign(array("SUBRBSDN" => $item, "SUBRBSCN" => $subrbscn, "SUBRBSAU" => "[ " . $subrbsau . " ]"));
        $template->parse("SUBRBS_LIST", ".Subrbs");
    }
}
################################################
function alternative_rbservices($rbsDN)
{
    global $ds, $suffix, $auDN, $ldapError;
    $alt_rbs = array();
    $rbsarray = get_rbsoffers($auDN);
    # print_r($rbsarray); echo "<br>";
    if (count($rbsarray) != 0) {
        for ($i = 0; $i < count($rbsarray); $i++) {
            if ($rbsarray[$i] != $rbsDN) {
                $exp = ldap_explode_dn($rbsarray[$i], 1);
                $alt = array("dn" => $rbsarray[$i], "cn" => $exp[0], "au" => " &nbsp;&nbsp;[ Abt.: " . $exp[2] . " ]");
                $alt_rbs[] = $alt;
            }
        }
    }
    return $alt_rbs;
}
$pxecn = $dnexp[0];
# RBS Daten
$pxe = get_node_data($pxeDN, array("rbservicedn"));
$rbsDN = $pxe['rbservicedn'];
$exp = explode(',', $rbsDN);
$exprbsau = explode('=', $exp[2]);
$rbsau = $exprbsau[1];
$rbsdata = get_node_data($rbsDN, array("cn", "nfsserverip", "exportpath", "tftpserverip", "tftppath"));
# Anzahl Menüeinträge
$menens = get_menuentries($pxeDN, array("dn"));
$maxpos = count($menens) + 1;
# Bootmenu Daten
$template->assign(array("MECN" => $mecn, "LABEL" => "", "MELABEL" => "", "MEDEF" => "", "MEPASSWD" => "", "MEHIDE" => "", "VGA" => "", "SPLASH" => "", "NOLDSC" => "", "ELEVATOR" => "", "VCI" => "", "CCV" => "", "APIC" => "", "COWLOOP" => "", "UNIONFS" => "", "DEBUG" => "", "LOCALBOOT" => "", "SUBMENULINK" => "", "MENPOS" => "", "MAXPOS" => $maxpos, "PXEDN" => $pxeDN, "PXECN" => $pxecn, "MNR" => $mnr, "SBMNR" => $sbmnr, "MCNR" => $mcnr));
# verwendbare GBMs holen
# eigene AU (andere noch über "offer" Attribut in RBS suchen)
$rbsoffers = get_rbsoffers($auDN);
# eigene AU
if (count($rbsoffers) != 0) {
    $rbservices = get_rbservices($auDN, array("dn"));
    # wenn eigene RBS anbietet dann diese GBMs als erstes (oben in der Liste)
    if (count($rbservices) != 0) {
        foreach ($rbservices as $rbs) {
            for ($i = 0; $i < count($rbsoffers); $i++) {
                if ($rbs['dn'] == $rbsoffers[$i]) {
                    array_splice($rbsoffers, $i, 1);
                }
            }
        }
        # momentan maximal ein RBS in der AU
        $rbsaudn[] = $rbservices[0]['dn'];
        $rbsoffsorted = array_merge($rbsaudn, $rbsoffers);