commonCheckForUseGLPI() static public method

Common Checks needed to use GLPI
static public commonCheckForUseGLPI ( ) : 2
return 2
function step1($update)
{
    global $CFG_GLPI;
    $error = 0;
    echo "<h3>" . __s('Checking of the compatibility of your environment with the execution of GLPI') . "</h3>";
    echo "<table class='tab_check'>";
    $error = Toolbox::commonCheckForUseGLPI();
    echo "</table>";
    switch ($error) {
        case 0:
            echo "<form action='install.php' method='post'>";
            echo "<input type='hidden' name='update' value='" . $update . "'>";
            echo "<input type='hidden' name='language' value='" . $_SESSION['glpilanguage'] . "'>";
            echo "<p class='submit'><input type='hidden' name='install' value='Etape_1'>";
            echo "<input type='submit' name='submit' class='submit' value=\"" . __('Continue') . "\">";
            echo "</p>";
            Html::closeForm();
            break;
        case 1:
            echo "<h3>" . __('Do you want to continue?') . "</h3>";
            echo "<div class='submit'><form action='install.php' method='post' class='inline'>";
            echo "<input type='hidden' name='install' value='Etape_1'>";
            echo "<input type='hidden' name='update' value='" . $update . "'>";
            echo "<input type='hidden' name='language' value='" . $_SESSION['glpilanguage'] . "'>";
            echo "<input type='submit' name='submit' class='submit' value=\"" . __('Continue') . "\">";
            Html::closeForm();
            echo "&nbsp;&nbsp;";
            echo "<form action='install.php' method='post' class='inline'>";
            echo "<input type='hidden' name='update' value='" . $update . "'>";
            echo "<input type='hidden' name='language' value='" . $_SESSION['glpilanguage'] . "'>";
            echo "<input type='hidden' name='install' value='Etape_0'>";
            echo "<input type='submit' name='submit' class='submit' value=\"" . __('Try again') . "\">";
            Html::closeForm();
            echo "</div>";
            break;
        case 2:
            echo "<h3>" . __('Do you want to continue?') . "</h3>";
            echo "<form action='install.php' method='post'>";
            echo "<input type='hidden' name='update' value='" . $update . "'>";
            echo "<p class='submit'><input type='hidden' name='install' value='Etape_0'>";
            echo "<input type='submit' name='submit' class='submit' value=\"" . __('Try again') . "\">";
            echo "</p>";
            Html::closeForm();
            break;
    }
}
Exemplo n.º 2
0
             Html::nullFooter();
         }
         exit;
     }
 }
 // Check version
 if ((!isset($CFG_GLPI["version"]) || trim($CFG_GLPI["version"]) != GLPI_VERSION) && !isset($_GET["donotcheckversion"])) {
     Session::loadLanguage();
     if (isCommandLine()) {
         _e('The version of the database is not compatible with the version of the installed files. An update is necessary.');
         echo "\n";
     } else {
         Html::nullHeader("UPDATE NEEDED", $CFG_GLPI["root_doc"]);
         echo "<div class='center'>";
         echo "<table class='tab_cadre'>";
         $error = Toolbox::commonCheckForUseGLPI();
         echo "</table><br>";
         if ($error) {
             echo "<form action='" . $CFG_GLPI["root_doc"] . "/index.php' method='post'>";
             echo "<input type='submit' name='submit' class='submit' value=\"" . __s('Try again') . "\">";
             Html::closeForm();
         }
         if ($error < 2) {
             if (!isset($CFG_GLPI["version"]) || trim($CFG_GLPI["version"]) < GLPI_VERSION) {
                 echo "<form method='post' action='" . $CFG_GLPI["root_doc"] . "/install/update.php'>";
                 echo "<p class='red'>" . __('The version of the database is not compatible with the version of the installed files. An update is necessary.') . "</p>";
                 echo "<input type='submit' name='from_update' value=\"" . _sx('button', 'Upgrade') . "\"\n                      class='submit'>";
                 Html::closeForm();
             } else {
                 if (trim($CFG_GLPI["version"]) > GLPI_VERSION) {
                     echo "<p class='red'>" . __('You are trying to use GLPI with outdated files compared to the version of the database. Please install the correct GLPI files corresponding to the version of your database.') . "</p>";