Beispiel #1
0
*/
// ----------------------------------------------------------------------
// Original Author of file:
// Purpose of file:
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
checkRight("ocsng", "w");
commonHeader($LANG['ocsng'][0], $_SERVER['PHP_SELF'], "utils", "ocsng", "sync");
$display_list = true;
if (isset($_SESSION["ocs_update"]['computers'])) {
    if ($count = count($_SESSION["ocs_update"]['computers'])) {
        $percent = min(100, round(100 * ($_SESSION["ocs_update_count"] - $count) / $_SESSION["ocs_update_count"], 0));
        $key = array_pop($_SESSION["ocs_update"]['computers']);
        $action = OcsServer::updateComputer($key, $_SESSION["ocsservers_id"], 2);
        OcsServer::manageImportStatistics($_SESSION["ocs_update"]['statistics'], $action['status']);
        OcsServer::showStatistics($_SESSION["ocs_update"]['statistics']);
        displayProgressBar(400, $percent);
        glpi_header($_SERVER['PHP_SELF']);
    } else {
        OcsServer::showStatistics($_SESSION["ocs_update"]['statistics'], true);
        unset($_SESSION["ocs_update"]);
        $display_list = false;
        echo "<div class='center b'><br>";
        echo "<a href='" . $_SERVER['PHP_SELF'] . "'>" . $LANG['buttons'][13] . "</a></div>";
    }
}
if (!isset($_POST["update_ok"])) {
    if (!isset($_GET['check'])) {
        $_GET['check'] = 'all';
    }