Ejemplo n.º 1
0
if (!isset($_GET['action'])) {
    $_GET['action'] = "import";
}
if (isset($_GET['subnetsChoice'])) {
    $_POST["subnetsChoice"] = $_GET['subnetsChoice'];
}
if (isset($_POST["subnetsChoice"]) && isset($_SESSION["subnets"]) || isset($_SESSION["subnets"])) {
    $sN = "";
    $networksDetail = array();
    $ocsServerId = $_SESSION["plugin_ocsinventoryng_ocsservers_id"];
    $tab = $_SESSION["subnets"];
    $subnets = $ip->getSubnets($ocsServerId);
    if (isset($_POST["subnetsChoice"])) {
        $sN = $_POST["subnetsChoice"];
        $knownMacAdresses = $ip->getKnownMacAdresseFromGlpi();
        $networksDetail["subnets"] = $ip->showSubnets($ocsServerId, $subnets, $knownMacAdresses, $sN);
        $networksDetail["subnetsChoice"] = $_POST["subnetsChoice"];
    } else {
        $sN = "";
        if (isset($_GET["ident"])) {
            $sN = $_GET["ident"];
        } else {
            if (isset($_GET["nonident"])) {
                $sN = $_GET["nonident"];
            }
        }
        $knownMacAdresses = $ip->getKnownMacAdresseFromGlpi();
        $networksDetail["subnets"] = $ip->showSubnets($ocsServerId, $subnets, $knownMacAdresses, $sN);
        $networksDetail["subnetsChoice"] = $sN;
    }
    $lim = count($networksDetail["subnets"]);