예제 #1
0
$rbsDN = $pxe['rbservicedn'];
$exp = explode(',', $rbsDN);
$exprbsau = explode('=', $exp[2]);
$rbsau = $exprbsau[1];
$rbsdata = get_node_data($rbsDN, array("cn", "nfsserverip", "exportpath", "tftpserverip", "tftppath"));
# Bootmenu Daten
$template->assign(array("MEDN" => $meDN, "MECN" => $me['cn'], "GMECN" => $gmecn, "GMEOU" => $gmeou, "GMERBS" => $gmerbs, "LABEL" => $me['label'], "MELABEL" => $me['menulabel'], "MEDEF" => $me['menudefault'], "MEPASSWD" => $me['menupasswd'], "MEHIDE" => $me['menuhide'], "VGA" => $me['vga'], "SPLASH" => $me['splash'], "NOLDSC" => $me['noldsc'], "ELEVATOR" => $me['elevator'], "VCI" => $me['vci'], "CCV" => $me['clientconfvia'], "APIC" => $me['apic'], "COWLOOP" => $me['cowloop'], "UNIONFS" => $me['unionfs'], "DEBUG" => $me['debug'], "MENPOS" => $me['menuposition'], "LOCALBOOT" => $me['localboot'], "KERNEL" => $me['kernel'], "SUBMENULINK" => $me['submenulink'], "PXEDN" => $pxeDN, "PXECN" => $pxecn, "TIMERANGE" => $timerange, "MNR" => $mnr, "SBMNR" => $sbmnr, "MCNR" => $mcnr));
#$template->define_dynamic("Submenulink", "Webseite");
#if (count($me['submenulink']) != 0){
#	foreach ($me['submenulink'] as $sbml){
#		$template->assign(array("SUBMENULINK" => $sbml));
#   	$template->parse("SUBMENULINK_LIST", ".Submenulink");
#	}
#}
# Alternative RB Dienste holen
$altrbs = get_rbservices($auDN, array("dn", "cn"));
if (count($altrbs) != 0) {
    for ($i = 0; $i < count($altrbs); $i++) {
        if ($rbsDN == $altrbs[$i]['dn']) {
            array_splice($altrbs, $i, 1);
        }
    }
}
if (count($altrbs) != 0) {
    $template->define_dynamic("Altrbs", "Webseite");
    foreach ($altrbs as $item) {
        $altrbsexp = explode(',', $item['dn']);
        $altrbsau = explode('=', $altrebsexp[2]);
        $template->assign(array("ALTRBSDN" => $item['dn'], "ALTRBSCN" => $item['cn'], "ALTRBSAU" => "[ " . $altrbsau[1] . " ]"));
        $template->parse("ALTRBS_LIST", ".Altrbs");
    }
$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);
    } else {
        for ($i = 0; $i < count($rbsoffers); $i++) {
            if ($rbsDN == $rbsoffers[$i]) {
예제 #3
0
# 3. Dateiname und evtl. Pfad des Templates für die Webseite
$webseite = "gbm.dwt";
include 'rbs_header.inc.php';
###################################################################################
$mnr = -1;
$sbmnr = -1;
$mnr = $_GET['mnr'];
$sbmnr = $_GET['sbmnr'];
# Menuleisten erstellen
createMainMenu($rollen, $mainnr);
createRBSMenu($rollen, $mnr, $auDN, $sbmnr);
###################################################################################
$gbmDN = $_GET['dn'];
$template->assign(array("TFTPROOT" => "", "TFTPKERNEL" => "", "TFTPPXE" => "", "TFTPCLIENTCONF" => "", "NFS" => "", "NFSPATH" => "", "NBD" => ""));
# rbservice und pxe daten (voerst nur ein rbs)
$rbs_array = get_rbservices($auDN, array("dn", "cn"));
$rbsDN = $rbs_array[0]['dn'];
# RBS Daten
$rbs_data = get_node_data($rbsDN, array("cn", "tftpserverip", "tftproot", "tftpkernelpath", "tftpclientconfpath", "tftppxepath", "nfsserverip", "exportpath", "nbdserverip", "fileserveruri"));
$template->assign(array("RBSCN" => $rbs_data['cn'], "TFTPIP" => $rbs_data['tftpserverip'], "TFTPROOT" => $rbs_data['tftproot'], "TFTPKERNEL" => $rbs_data['tftpkernelpath'], "TFTPPXE" => $rbs_data['tftppxepath'], "TFTPCLIENTCONF" => $rbs_data['tftpclientconfpath'], "NFS" => $rbs_data['nfsserverip'], "NFSPATH" => $rbs_data['exportpath'], "NBD" => $rbs_data['nbdserverip']));
$template->assign(array("GBMDN" => $gbmDN, "GBMCN" => "", "LABEL" => "", "KERNEL" => "", "INITRD" => "", "FSTYPE" => "", "ROOTFS" => "", "DEBUG" => "", "MISC" => "", "IPAPPEND" => ""));
# GBM Daten
$attributes = array("dn", "cn", "label", "kernel", "initrd", "rootfs", "rootfstype", "rootfspath", "debug", "appendmisc", "ipappend");
$gbm = get_node_data($gbmDN, $attributes);
$selectboxmax = count($rbs_data['fileserveruri']) + 1;
$fsuriselectbox = "<select name='rootfs' size='" . $selectboxmax . "' class='rootfs_form_selectbox'>\n                  <option value='none'>---------------------------------</option>";
if ($rbs_data['fileserveruri'] != "") {
    foreach ($rbs_data['fileserveruri'] as $fsuri) {
        $fsuriselectbox .= "<option value='" . $fsuri . "'>" . $fsuri . "</option>";
    }
}
예제 #4
0
function createRBSMenu($rollen, $mnr, $auDN, $sbmnr)
{
    global $template;
    global $START_PATH;
    # rbservices (momentan nur für einen RBS konzipiert)
    $rbs_array = get_rbservices($auDN, array("dn", "cn"));
    # Struktur der Registerkartenleiste
    $hauptmenu = array(array("link" => "rbs.php?mnr=0", "text" => "&Uuml;bersicht", "zugriff" => "alle"));
    $submenu = array(array());
    $n = 1;
    if (count($rbs_array) != 0) {
        for ($i = 0; $i < count($rbs_array); $i++) {
            $hauptmenu[] = array("link" => "rbservice.php?rbsdn=" . $rbs_array[$i]['dn'] . "&mnr=" . $n, "text" => $rbs_array[$i]['cn'], "zugriff" => array("MainAdmin", "RbsAdmin"));
            $submenu[] = array(array("link" => "gbm_overview.php?rbsdn=" . $rbs_array[$i]['dn'] . "&mnr=" . $n . "&sbmnr=0", "text" => "Generische Bootmen&uuml;s", "zugriff" => array("MainAdmin", "RbsAdmin")), array("link" => "pxeconfig_default.php?rbsdn=" . $rbs_array[$i]['dn'] . "&mnr=" . $n . "&sbmnr=1", "text" => "Default PXE Configs", "zugriff" => array("MainAdmin", "RbsAdmin")), array("link" => "new_gbm.php?rbsdn=" . $rbs_array[$i]['dn'] . "&mnr=" . $n . "&sbmnr=2", "text" => "Neues GBM anlegen", "zugriff" => array("MainAdmin", "RbsAdmin")), array("link" => "new_pxe.php?rbsdn=" . $rbs_array[$i]['dn'] . "&mnr=" . $n . "&sbmnr=3", "text" => "Neue PXE Config anlegen", "zugriff" => array("MainAdmin", "RbsAdmin")));
            $n++;
        }
    }
    $hauptmenu[] = array("link" => "new_rbservice.php?&mnr=" . $n, "text" => "Neuen RBS anlegen", "zugriff" => array("MainAdmin", "RbsAdmin"));
    $submenu[] = array();
    #print_r($hauptmenu); echo "<br><br>";
    #print_r($submenu);
    # Zusammenstellen der Menuleiste
    $template->define_dynamic("Hauptmenu", "Menu");
    $template->define_dynamic("Submenu", "Menu");
    $i = 0;
    $maxmenu = count($hauptmenu);
    foreach ($hauptmenu as $item) {
        $template->clear_parse("SUBMENU_LIST");
        if ($item['zugriff'] === "alle" || vergleicheArrays($rollen, $item['zugriff'])) {
            $subempty = 0;
            $j = 0;
            $maxsub = count($submenu[$mnr]);
            if ($maxsub > 0) {
                foreach ($submenu[$mnr] as $item2) {
                    if ($item2['zugriff'] === "alle" || vergleicheArrays($rollen, $item2['zugriff'])) {
                        if ($i != $mnr) {
                            $template->assign(array("SUB" => ""));
                            # 								"LINK_S" => "",
                            #                       "TEXT_S" => ""));
                            $template->parse("SUBMENU_LIST", ".Submenu");
                            $template->clear_dynamic("Submenu");
                        } else {
                            if ($j == 0) {
                                if ($sbmnr == 0) {
                                    if ($maxsub == 1) {
                                        $zwisch = "branchbottom2";
                                    } else {
                                        $zwisch = "branch2";
                                    }
                                    $lastaktive = true;
                                    $farb = "#505050";
                                } else {
                                    if ($maxsub == 1) {
                                        $zwisch = "branchbottom2";
                                    } else {
                                        $zwisch = "branch2";
                                    }
                                    $farb = "#A0A0A0";
                                    $lastaktive = false;
                                }
                            } else {
                                if ($sbmnr == $j) {
                                    if ($maxsub == $j + 1) {
                                        $zwisch = "branchbottom2";
                                    } else {
                                        $zwisch = "branch2";
                                    }
                                    $lastaktive = true;
                                    $farb = "#505050";
                                } else {
                                    $farb = "#A0A0A0";
                                    if ($maxsub == $j + 1) {
                                        $zwisch = "branchbottom2";
                                    } else {
                                        $zwisch = "branch2";
                                    }
                                    # if ($lastaktive) {$zwisch="branch";}
                                    # else {$zwisch="branch";}
                                    $lastaktive = false;
                                }
                            }
                            $htmlcode = "\n\t\t   \t\t<tr height='4'>\n\t\t\t\t\t\t<td></td><td align='right'><img src='../pics/line2.gif' height='4'></td><td></td><td></td>\n\t\t   \t\t</tr>\n\t\t   \t\t<tr>\n\t\t\t\t\t\t<td width='8%'>&nbsp;</td>\n\t\t\t\t\t\t<td width='8%' align='right'><img src='../pics/" . $zwisch . ".gif'></td>\r\n\t\t     \t\t\t<td width='74%' align='left' style='border-width:1 1 1 1;border-color:#000000;border-style:solid;padding:2;padding-left:30px;background-color:{FARBE_S}'> \n\t\t     \t\t\t<a href='" . $item2['link'] . "' style='text-decoration:none'><code class='submenue_schrift'>" . $item2['text'] . "</code></a></td>\n\t\t\t\t\t\t<td width='10%'>&nbsp;</td> \t\t\t\t\t\t\n\t\t\t\t\t</tr>\n\t\t\t\t\t";
                            $template->assign(array("SUB" => $htmlcode));
                            $template->assign(array("FARBE_S" => $farb));
                            $template->parse("SUBMENU_LIST", ".Submenu");
                            $template->clear_dynamic("Submenu");
                        }
                    } else {
                        $subempty++;
                    }
                    $j = $j + 1;
                }
            }
            if ($subempty == count($submenu[$mnr])) {
                $template->assign(array("SUB" => ""));
                #							  "LINK_S" => "",
                #                       "TEXT_S" => ""));
                $template->parse("SUBMENU_LIST", ".Submenu");
                $template->clear_dynamic("Submenu");
            }
            if ($i == 0) {
                if ($mnr == 0) {
                    if (count($submenu[$i][0]) != 0) {
                        if ($maxmenu == 1) {
                            $zwisch = "";
                        } else {
                            $zwisch = "";
                        }
                    } else {
                        $zwisch = "";
                    }
                    $lastaktive = true;
                    $farb = "#505050";
                } else {
                    if (count($submenu[$i][0]) != 0) {
                        if ($maxmenu == 1) {
                            $zwisch = "<a href='{LINK_M}' style='border-style=none;text-decoration:none'>\n               \t<img style='border-width:0;border-style=none;' src='../pics/plus2.gif'></a>";
                        } else {
                            $zwisch = "<a href='{LINK_M}' style='border-style=none;text-decoration:none'>\n               \t<img style='border-width:0;border-style=none;' src='../pics/plus2.gif'></a>";
                        }
                    } else {
                        $zwisch = "";
                    }
                    $farb = "#A0A0A0";
                    $lastaktive = false;
                }
            } else {
                if ($mnr == $i) {
                    if (count($submenu[$mnr][0]) != 0) {
                        if ($maxmenu == $i + 1) {
                            $zwisch = "";
                        } else {
                            $zwisch = "";
                        }
                    } else {
                        $zwisch = "";
                    }
                    $lastaktive = true;
                    $farb = "#505050";
                } else {
                    $farb = "#A0A0A0";
                    if (count($submenu[$i][0]) != 0) {
                        if ($maxmenu == $i + 1) {
                            $zwisch = "<a href='{LINK_M}' style='border-style=none;text-decoration:none'>\n               \t<img style='border-width:0;border-style=none;' src='../pics/plus2.gif'></a>";
                        } else {
                            $zwisch = "<a href='{LINK_M}' style='border-style=none;text-decoration:none'>\n               \t<img style='border-width:0;border-style=none;' src='../pics/plus2.gif'></a>";
                        }
                    } else {
                        $zwisch = "";
                    }
                    #if ($lastaktive) {$zwisch="";}
                    #else {$zwisch="";}
                    $lastaktive = false;
                }
            }
            $template->assign(array("ICON" => $zwisch, "FARBE" => $farb, "LINK_M" => $item["link"], "TEXT_M" => $item["text"]));
            $template->parse("HAUPTMENU_LIST", ".Hauptmenu");
            $template->clear_dynamic("Hauptmenu");
        }
        $i = $i + 1;
    }
    if ($lastaktive) {
        $template->assign(array("ENDE" => ""));
    } else {
        $template->assign(array("ENDE" => ""));
    }
}