示例#1
0
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*************************************************************************************************/
define('ROOT_PATH', '../');
require_once ROOT_PATH . 'define.php';
include_once ROOT_PATH . 'fonctions_conges.php';
include_once INCLUDE_PATH . 'fonction.php';
include ROOT_PATH . 'version.php';
$PHP_SELF = $_SERVER['PHP_SELF'];
//recup de la langue
$lang = isset($_GET['lang']) ? $_GET['lang'] : (isset($_POST['lang']) ? $_POST['lang'] : "");
// recup des parametres
$action = isset($_GET['action']) ? $_GET['action'] : (isset($_POST['action']) ? $_POST['action'] : "");
$version = isset($_GET['version']) ? $_GET['version'] : (isset($_POST['version']) ? $_POST['version'] : "");
$etape = isset($_GET['etape']) ? $_GET['etape'] : (isset($_POST['etape']) ? $_POST['etape'] : 0);
if ($version == 0) {
    // la version à mettre à jour dans le formulaire de index.php n'a pas été choisie : renvoit sur le formulaire
    redirect(ROOT_PATH . 'install/index.php?lang=' . $lang);
}
header_popup(' PHP_CONGES : ' . _('install_maj_titre_1'));
// affichage du titre
echo "<center>\n";
echo "<br><H1><img src=\"" . TEMPLATE_PATH . "img/tux_config_32x32.png\" width=\"32\" height=\"32\" border=\"0\" title=\"" . _('install_install_phpconges') . "\" alt=\"" . _('install_install_phpconges') . "\"> " . _('install_maj_titre_2') . "</H1>\n";
echo "<br><br>\n";
// $config_php_conges_version est fourni par include_once ROOT_PATH .'version.php' ;
\install\Fonctions::lance_maj($lang, $version, $config_php_conges_version, $etape);
bottom();
示例#2
0
            echo "<INPUT type=\"hidden\" value=\"" . $lang . "\" name=\"lang\"><br>";
            echo "<br>\n";
            echo "<input type=\"submit\" value=\"OK\">\n";
            echo "</form>\n";
        } else {
            $is_dbconf_ok = write_db_config($dbserver, $dbuser, $dbpasswd, $dbdb);
            if ($is_dbconf_ok != true) {
                echo "le dossier " . CONFIG_PATH . " n'est pas accessible en écriture";
            } else {
                echo _('db_configuration_ok');
                echo "<br><a href=\"{$PHP_SELF}?session={$session}&lang={$lang}\"> continuez....</a><br>\n";
            }
        }
        bottom();
    } else {
        $installed_version = \install\Fonctions::get_installed_version();
        $installed_version = 0;
        if ($installed_version == 0) {
            \install\Fonctions::install($lang);
        } else {
            // on compare la version déclarée dans la database avec la version déclarée dans le fichier de config
            if ($installed_version != $config_php_conges_version) {
                // on attaque une mise a jour à partir de la version installée
                echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL=mise_a_jour.php?version={$installed_version}&lang={$lang}\">";
            } else {
                // pas de mise a jour a faire : on propose les pages de config
                echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL=../config/\">";
            }
        }
    }
}
示例#3
0
Ce programme est distribué car potentiellement utile, mais SANS AUCUNE GARANTIE,
ni explicite ni implicite, y compris les garanties de commercialisation ou d'adaptation
dans un but spécifique. Reportez-vous à la Licence Publique Générale GNU pour plus de détails.
Vous devez avoir reçu une copie de la Licence Publique Générale GNU en même temps
que ce programme ; si ce n'est pas le cas, écrivez à la Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, États-Unis.
*************************************************************************************************
This program is free software; you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation; either
version 2 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*************************************************************************************************/
define('ROOT_PATH', '../');
require_once ROOT_PATH . 'define.php';
/*******************************************************************/
// SCRIPT DE MIGRATION DE LA VERSION 1.6.0 vers 1.7.0
/*******************************************************************/
include_once ROOT_PATH . 'fonctions_conges.php';
include_once INCLUDE_PATH . 'fonction.php';
$PHP_SELF = $_SERVER['PHP_SELF'];
$version = isset($_GET['version']) ? $_GET['version'] : (isset($_POST['version']) ? $_POST['version'] : "");
$lang = isset($_GET['lang']) ? $_GET['lang'] : (isset($_POST['lang']) ? $_POST['lang'] : "");
//étape 1 création de la table de gestion des plugins
\install\Fonctions::e1_create_table_plugins();
// on renvoit à la page mise_a_jour.php (là d'ou on vient)
echo "<a href=\"mise_a_jour.php?etape=2&version={$version}&lang={$lang}\">upgrade_from_v1.6.0  OK</a><br>\n";
示例#4
0
Ce programme est distribué car potentiellement utile, mais SANS AUCUNE GARANTIE, 
ni explicite ni implicite, y compris les garanties de commercialisation ou d'adaptation 
dans un but spécifique. Reportez-vous à la Licence Publique Générale GNU pour plus de détails.
Vous devez avoir reçu une copie de la Licence Publique Générale GNU en même temps 
que ce programme ; si ce n'est pas le cas, écrivez à la Free Software Foundation, 
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, États-Unis.
*************************************************************************************************
This program is free software; you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation; either 
version 2 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*************************************************************************************************/
define('ROOT_PATH', '../');
require_once ROOT_PATH . 'define.php';
include_once ROOT_PATH . 'fonctions_conges.php';
include_once INCLUDE_PATH . 'fonction.php';
$PHP_SELF = $_SERVER['PHP_SELF'];
//recup de la langue
$lang = isset($_GET['lang']) ? $_GET['lang'] : (isset($_POST['lang']) ? $_POST['lang'] : "");
header_popup('PHP_CONGES : Installation');
// affichage du titre
echo "<center>\n";
echo "<br><H1><img src=\"" . TEMPLATE_PATH . "img/tux_config_32x32.png\" width=\"32\" height=\"32\" border=\"0\" title=\"" . _('install_install_phpconges') . "\" alt=\"" . _('install_install_phpconges') . "\"> " . _('install_install_titre') . "</H1>\n";
echo "<br><br>\n";
\install\Fonctions::lance_install($lang);
bottom();
示例#5
0
 public static function lance_maj($lang, $installed_version, $config_php_conges_version, $etape)
 {
     $PHP_SELF = $_SERVER['PHP_SELF'];
     include CONFIG_PATH . 'dbconnect.php';
     //*** ETAPE 0
     if ($etape == 0) {
         //avant tout , on conseille une sauvegarde de la database !! (cf vieux index.php)
         echo "<h3>" . _('install_maj_passer_de') . " <font color=\"black\">{$installed_version}</font> " . _('install_maj_a_version') . " <font color=\"black\">{$config_php_conges_version}</font> .</h3>\n";
         echo "<h3><font color=\"red\">" . _('install_maj_sauvegardez') . " !!!</font></h3>\n";
         echo "<h2>....</h2>\n";
         echo "<br>\n";
         echo "<form action=\"{$PHP_SELF}?lang={$lang}\" method=\"POST\">\n";
         echo "<input type=\"hidden\" name=\"etape\" value=\"1\">\n";
         echo "<input type=\"hidden\" name=\"version\" value=\"{$installed_version}\">\n";
         echo "<input type=\"submit\" value=\"" . _('form_continuer') . "\">\n";
         echo "</form>\n";
         echo "<br><br>\n";
     } elseif ($etape == 1) {
         //verif si create / alter table possible !!!
         if (!\install\Fonctions::test_create_table()) {
             echo "<font color=\"red\"><b>CREATE TABLE</b> " . _('install_impossible_sur_db') . " <b>{$mysql_database}</b> (" . _('install_verif_droits_mysql') . " <b>{$mysql_user}</b>)...</font><br> \n";
             echo "<br>puis ...<br>\n";
             echo "<form action=\"{$PHP_SELF}?lang={$lang}\" method=\"POST\">\n";
             echo "<input type=\"hidden\" name=\"etape\"value=\"1\" >\n";
             echo "<input type=\"hidden\" name=\"version\" value=\"{$installed_version}\">\n";
             echo "<input type=\"submit\" value=\"" . _('form_redo') . "\">\n";
             echo "</form>\n";
         } elseif (!\install\Fonctions::test_alter_table()) {
             echo "<font color=\"red\"><b>ALTER TABLE</b> " . _('install_impossible_sur_db') . " <b>{$mysql_database}</b> (" . _('install_verif_droits_mysql') . " <b>{$mysql_user}</b>)...</font><br> \n";
             echo "<br>puis ...<br>\n";
             echo "<form action=\"{$PHP_SELF}?lang={$lang}\" method=\"POST\">\n";
             echo "<input type=\"hidden\" name=\"etape\"value=\"1\" >\n";
             echo "<input type=\"hidden\" name=\"version\" value=\"{$installed_version}\">\n";
             echo "<input type=\"submit\" value=\"" . _('form_redo') . "\">\n";
             echo "</form>\n";
         } elseif (!\install\Fonctions::test_drop_table()) {
             echo "<font color=\"red\"><b>DROP TABLE</b> " . _('install_impossible_sur_db') . " <b>{$mysql_database}</b> (" . _('install_verif_droits_mysql') . " <b>{$mysql_user}</b>)...</font><br> \n";
             echo "<br>puis ...<br>\n";
             echo "<form action=\"{$PHP_SELF}?lang={$lang}\">\n";
             echo "<input type=\"hidden\" name=\"etape\"value=\"1\" >\n";
             echo "<input type=\"hidden\" name=\"version\" value=\"{$installed_version}\">\n";
             echo "<input type=\"submit\" value=\"" . _('form_redo') . "\">\n";
             echo "</form>\n";
         } else {
             echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL={$PHP_SELF}?etape=2&version={$installed_version}&lang={$lang}\">";
         }
     } elseif ($etape == 2) {
         $start_version = $installed_version;
         //on lance l'execution (include) des scripts d'upgrade l'un après l'autre jusqu a la version voulue ($config_php_conges_version) ..
         if ($start_version == "1.5.0" || $start_version == "1.5.1") {
             $file_upgrade = 'upgrade_from_v1.5.0.php';
             $new_installed_version = "1.6.0";
             // execute le script php d'upgrade de la version1.5.0 (vers la suivante (1.6.0))
             echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL={$file_upgrade}?version={$new_installed_version}&lang={$lang}\">";
         } elseif ($start_version == "1.6.0") {
             $file_upgrade = 'upgrade_from_v1.6.0.php';
             $new_installed_version = "1.7.0";
             // execute le script php d'upgrade de la version1.6.0 (vers la suivante (1.7.0))
             echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL={$file_upgrade}?version={$new_installed_version}&lang={$lang}\">";
         } elseif ($start_version == "1.7.0") {
             $file_upgrade = 'upgrade_from_v1.7.0.php';
             $new_installed_version = "1.8";
             // execute le script php d'upgrade de la version1.7.0 (vers la suivante (1.8))
             echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL={$file_upgrade}?version={$new_installed_version}&lang={$lang}\">";
         } else {
             echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL={$PHP_SELF}?etape=5&version={$new_installed_version}&lang={$lang}\">";
         }
     } elseif ($etape == 3) {
         // FIN
         // test si fichiers config.php ou config_old.php existent encore (si oui : demande de les éffacer !
         if (\install\Fonctions::test_config_file() || \install\Fonctions::test_old_config_file()) {
             if (test_config_file()) {
                 echo _('install_le_fichier') . " <b>\"config.php\"</b> " . _('install_remove_fichier') . ".<br> \n";
             }
             if (test_old_config_file()) {
                 echo _('install_le_fichier') . " <b>\"install/config_old.php\"</b> " . _('install_remove_fichier') . ".<br> \n";
             }
             echo "<br><a href=\"{$PHP_SELF}?etape=5&version={$config_php_conges_version}&lang={$lang}\">" . _('install_reload_page') . " ....</a><br>\n";
         } else {
             // mise à jour de la "installed_version" et de la langue dans la table conges_config
             $sql_update_version = "UPDATE conges_config SET conf_valeur = '{$config_php_conges_version}' WHERE conf_nom='installed_version' ";
             $result_update_version = \includes\SQL::query($sql_update_version);
             $sql_update_lang = "UPDATE conges_config SET conf_valeur = '{$lang}' WHERE conf_nom='lang' ";
             $result_update_lang = \includes\SQL::query($sql_update_lang);
             $comment_log = _('install_maj_titre_2') . " (version {$installed_version} --> version {$config_php_conges_version}) ";
             log_action(0, "", "", $comment_log);
             // on propose la page de config ....
             echo "<br><br><h2>" . _('install_ok') . " !</h2><br>\n";
             echo "<META HTTP-EQUIV=REFRESH CONTENT=\"2; URL=../config/\">";
         }
     }
 }