예제 #1
0
        $display_list = false;
    }
}
if (!isset($_POST["import_ok"])) {
    if (!isset($_GET['check'])) {
        $_GET['check'] = 'all';
    }
    if (!isset($_GET['start'])) {
        $_GET['start'] = 0;
    }
    if (isset($_SESSION["ocs_import"])) {
        unset($_SESSION["ocs_import"]);
    }
    OcsServer::manageDeleted($_SESSION["ocsservers_id"]);
    if ($display_list) {
        OcsServer::showComputersToAdd($_SESSION["ocsservers_id"], $_SESSION["change_import_mode"], $_GET['check'], $_GET['start'], $_SESSION['glpiactiveentities']);
    }
} else {
    if (count($_POST['toimport']) > 0) {
        $_SESSION["ocs_import_count"] = 0;
        foreach ($_POST['toimport'] as $key => $val) {
            if ($val == "on") {
                $_SESSION["ocs_import"]["id"][] = $key;
                if (isset($_POST['toimport_entities'])) {
                    $_SESSION["ocs_import"]["entities_id"][$key] = $_POST['toimport_entities'][$key];
                }
                if (isset($_POST['toimport_locations'])) {
                    $_SESSION["ocs_import"]["locations_id"][$key] = $_POST['toimport_locations'][$key];
                }
                $_SESSION["ocs_import_count"]++;
            }