Subversion Repositories Applications.papyrus

Rev

Rev 91 | Rev 119 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 91 Rev 100
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: installateur.php,v 1.7 2004-10-22 17:23:04 jpm Exp $
22
// CVS : $Id: installateur.php,v 1.8 2004-10-25 10:22:48 jpm Exp $
23
/**
23
/**
24
* Application Installateur de Papyrus.
24
* Application Installateur de Papyrus.
25
*
25
*
26
* Application permettant de gérer l'installation et les erreurs liés à l'abscence de base de données, 
26
* Application permettant de gérer l'installation et les erreurs liés à l'abscence de base de données, 
27
* d'extenssin PHP...
27
* d'extenssin PHP...
28
*
28
*
29
*@package Installateur
29
*@package Installateur
30
//Auteur original :
30
//Auteur original :
31
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
31
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
32
//Autres auteurs :
32
//Autres auteurs :
33
*@author        Aucun
33
*@author        Aucun
34
*@copyright     Tela-Botanica 2000-2004
34
*@copyright     Tela-Botanica 2000-2004
35
*@version       $Revision: 1.7 $ $Date: 2004-10-22 17:23:04 $
35
*@version       $Revision: 1.8 $ $Date: 2004-10-25 10:22:48 $
36
// +------------------------------------------------------------------------------------------------------+
36
// +------------------------------------------------------------------------------------------------------+
37
**/
37
**/
38
 
38
 
39
// +------------------------------------------------------------------------------------------------------+
39
// +------------------------------------------------------------------------------------------------------+
40
// |                                            ENTÊTE du PROGRAMME                                       |
40
// |                                            ENTÊTE du PROGRAMME                                       |
41
// +------------------------------------------------------------------------------------------------------+
41
// +------------------------------------------------------------------------------------------------------+
42
// Constante de l'application Installateur. On devrait créer un fichier de config et un de langue pour rendre l'appli portable...
42
// Constante de l'application Installateur. On devrait créer un fichier de config et un de langue pour rendre l'appli portable...
43
preg_match('/^(.*)papyrus.php/', $_SERVER['SCRIPT_FILENAME'], $instal_tab_txt);
43
preg_match('/^(.*)papyrus.php/', $_SERVER['SCRIPT_FILENAME'], $instal_tab_txt);
44
define('INSTAL_CHEMIN_ABSOLU', $instal_tab_txt[1]);
44
define('INSTAL_CHEMIN_ABSOLU', $instal_tab_txt[1]);
45
/** Nom du dossier contenant l'application Installateur.*/
45
/** Nom du dossier contenant l'application Installateur.*/
46
define('INSTAL_DOSSIER_APPLI', INSTAL_CHEMIN_ABSOLU.GEN_CHEMIN_APPLICATION.'installateur'.GEN_SEP);
46
define('INSTAL_DOSSIER_APPLI', INSTAL_CHEMIN_ABSOLU.GEN_CHEMIN_APPLICATION.'installateur'.GEN_SEP);
47
/** Nom du dossier contenant la bibliothèque de code de l'application Installateur.*/
47
/** Nom du dossier contenant la bibliothèque de code de l'application Installateur.*/
48
define('INSTAL_DOSSIER_BIBLIO', INSTAL_DOSSIER_APPLI.'bibliotheque'.GEN_SEP);
48
define('INSTAL_DOSSIER_BIBLIO', INSTAL_DOSSIER_APPLI.'bibliotheque'.GEN_SEP);
49
/** Chemin vers le fichier de configuration de base de l'application Papyrus.*/
49
/** Chemin vers le fichier de configuration de base de l'application Papyrus.*/
50
define('INSTAL_CHEMIN_CONFIG', GEN_CHEMIN_CONFIG.GEN_FICHIER_CONFIG);
50
define('INSTAL_CHEMIN_CONFIG', GEN_CHEMIN_CONFIG.GEN_FICHIER_CONFIG);
51
/** Nom du fichier de configuration de Papyrus à créer.*/
51
/** Nom du fichier de configuration de Papyrus à créer.*/
52
define('INSTAL_FICHIER_CONFIG', GEN_FICHIER_CONFIG);
52
define('INSTAL_FICHIER_CONFIG', GEN_FICHIER_CONFIG);
53
/** Chemin vers le fichier de configuration de base de l'application Papyrus.*/
53
/** Chemin vers le fichier de configuration de base de l'application Papyrus.*/
54
define('INSTAL_CHEMIN_SQL', INSTAL_CHEMIN_ABSOLU.GEN_CHEMIN_INSTAL);
54
define('INSTAL_CHEMIN_SQL', INSTAL_CHEMIN_ABSOLU.GEN_CHEMIN_INSTAL);
55
/** Nom de la constante stockant le numéro de la nouvelle version de l'application Papyrus.*/
55
/** Nom de la constante stockant le numéro de la nouvelle version de l'application Papyrus.*/
56
define('INSTAL_VERSION_NOUVELLE_NOM', 'PAP_VERSION');
56
define('INSTAL_VERSION_NOUVELLE_NOM', 'PAP_VERSION');
57
/** Numéro de la nouvelle version de l'application Papyrus.*/
57
/** Numéro de la nouvelle version de l'application Papyrus.*/
58
define('INSTAL_VERSION_NOUVELLE', GEN_VERSION);
58
define('INSTAL_VERSION_NOUVELLE', GEN_VERSION);
59
if (defined('PAP_VERSION')) {
59
if (defined('PAP_VERSION')) {
60
    define('INSTAL_VERSION_ANCIENNE', PAP_VERSION);
60
    define('INSTAL_VERSION_ANCIENNE', PAP_VERSION);
61
} else {
61
} else {
62
    define('INSTAL_VERSION_ANCIENNE', '');
62
    define('INSTAL_VERSION_ANCIENNE', '');
63
}
63
}
64
/** Nombre d'étapes totale de l'installation.*/
64
/** Nombre d'étapes totale de l'installation.*/
65
define('INSTAL_NBRE_ETAPE', 3);
65
define('INSTAL_NBRE_ETAPE', 3);
66
 
66
 
67
// Fichiers à inclure
67
// Fichiers à inclure
68
require_once INSTAL_DOSSIER_BIBLIO.'instal_installation.fonct.php';
68
require_once INSTAL_DOSSIER_BIBLIO.'instal_installation.fonct.php';
69
 
69
 
70
// +------------------------------------------------------------------------------------------------------+
70
// +------------------------------------------------------------------------------------------------------+
71
// |                                          CORPS du PROGRAMME                                          |
71
// |                                          CORPS du PROGRAMME                                          |
72
// +------------------------------------------------------------------------------------------------------+
72
// +------------------------------------------------------------------------------------------------------+
73
function afficherContenuCorps() 
73
function afficherContenuCorps() 
74
{
74
{
75
    // Entêtre XHTML des pages de l'installation de Papyrus
75
    // Entêtre XHTML des pages de l'installation de Papyrus
76
    $sortie = '';
76
    $sortie = '';
77
    $sortie .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'."\n";
77
    $sortie .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'."\n";
78
    $sortie .= '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n";
78
    $sortie .= '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n";
79
    $sortie .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="fr-FR" xml:lang="fr-FR">'."\n";
79
    $sortie .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="fr-FR" xml:lang="fr-FR">'."\n";
80
    $sortie .= '  <head>'."\n";
80
    $sortie .= '  <head>'."\n";
81
    $sortie .= '    <title>Installation de Papyrus</title>'."\n";
81
    $sortie .= '    <title>Installation de Papyrus</title>'."\n";
82
    $sortie .= '    <style type="text/css">'."\n";
82
    $sortie .= '    <style type="text/css">'."\n";
83
    $sortie .= '      p, body, td, li, input, select, textarea { font-family: Verdana; font-size: 13px; }'."\n";
83
    $sortie .= '      p, body, td, li, input, select, textarea { font-family: Verdana; font-size: 13px; }'."\n";
84
    $sortie .= '      h1 { font-size: 1.8em; text-align: center; color: #880000; }'."\n";
84
    $sortie .= '      h1 { font-size: 1.8em; text-align: center; color: #0C6628; }'."\n";
85
    $sortie .= '      h2 { font-size: 1.2em; text-align: left; color: #880000; }'."\n";
85
    $sortie .= '      h2 { font-size: 1.2em; text-align: left; color: #0C6628; }'."\n";
86
    $sortie .= '      input { color: #880000; }'."\n";
86
    $sortie .= '      input { color: #0C6628; }'."\n";
87
    $sortie .= '      form ul { list-style-type: none; padding : 0px; }'."\n";
87
    $sortie .= '      form ul { list-style-type: none; padding : 0px; }'."\n";
88
    $sortie .= '      form ul li { clear:both;text-align: left; padding-left: 0px; margin-left: 0px; }'."\n";
88
    $sortie .= '      form ul li { clear:both;text-align: left; padding-left: 0px; margin-left: 0px; }'."\n";
89
    $sortie .= '      form ul li label { float: left; width: 175px; text-align: left; }'."\n";
89
    $sortie .= '      form ul li label { float: left; width: 175px; text-align: left; }'."\n";
90
    $sortie .= '      li { margin: 5px 5px 5px 5px; }'."\n";
90
    $sortie .= '      li { margin: 5px 5px 5px 5px; }'."\n";
91
    $sortie .= '      a { color: #0000FF; }'."\n";
91
    $sortie .= '      a { color: #0000FF; }'."\n";
92
    $sortie .= '      .ok { color: #008800; font-weight: bold; }'."\n";
92
    $sortie .= '      .ok { color: #008800; font-weight: bold; }'."\n";
93
    $sortie .= '      .failed { color: #880000; font-weight: bold; }'."\n";
93
    $sortie .= '      .failed { color: #880000; font-weight: bold; }'."\n";
94
    $sortie .= '      .erreur { color: red; font-weight: bold;}'."\n";
94
    $sortie .= '      .erreur { color: red; font-weight: bold;}'."\n";
95
    $sortie .= '      .zone_requete { height: 300px; width: 550px; overflow: auto;}'."\n";
95
    $sortie .= '      .zone_requete { height: 300px; width: 550px; overflow: auto;}'."\n";
-
 
96
    $sortie .= '      .etape_info { margin: 5px 10% 5px 10%; padding: 3px; text-align: center; background-color: #92C492; border: 1px dashed black; }'."\n";
-
 
97
    $sortie .= '      .etape_numero { width: 200px; text-align: center; padding: 3px; font-size: 1.2em; border: 1px dotted black; color: #0C6628;}'."\n";
96
    $sortie .= '      #fichier_config { background-color: #EEEEEE; padding: 10px 10px;}'."\n";
98
    $sortie .= '      #fichier_config { background-color: #EEEEEE; padding: 10px 10px;}'."\n";
97
    $sortie .= '    </style>'."\n";
99
    $sortie .= '    </style>'."\n";
98
    $sortie .= '  </head>'."\n";
100
    $sortie .= '  </head>'."\n";
99
    $sortie .= '  <body>'."\n";
101
    $sortie .= '  <body>'."\n";
100
    $sortie .= '    <h1>Installation de Papyrus</h1></h1>'."\n";
102
    $sortie .= '    <h1>Installation de Papyrus</h1></h1>'."\n";
101
    
103
    
102
    // Message situation de l'installation
104
    // Message situation de l'installation
103
    if (defined('PAP_VERSION')) {
105
    if (defined('PAP_VERSION')) {
104
        $sortie .=  '<p>Votre syst&egrave;me Papyrus existant a &eacute;t&eacute; reconnu comme &eacute;tant la version '.
106
        $sortie .=  '<p>Votre syst&egrave;me Papyrus existant a &eacute;t&eacute; reconnu comme &eacute;tant la version '.
105
                    INSTAL_VERSION_ANCIENNE.'.<br />'.
107
                    INSTAL_VERSION_ANCIENNE.'.<br />'.
106
                    'Vous &ecirc;tes sur le point de <b>mettre &agrave; jour</b> Papyrus pour la version '.
108
                    'Vous &ecirc;tes sur le point de <b>mettre &agrave; jour</b> Papyrus pour la version '.
107
                    INSTAL_VERSION_NOUVELLE.'.<br />'.
109
                    INSTAL_VERSION_NOUVELLE.'.<br />'.
108
                    'Veuillez revoir vos informations de configuration ci-dessous.</p>'."\n";
110
                    'Veuillez revoir vos informations de configuration ci-dessous.</p>'."\n";
109
    } else {
111
    } else {
110
        $sortie .=  '<p>Vous &ecirc;tes sur le point d\'installer Papyrus '.INSTAL_VERSION_NOUVELLE.'.<br />'.
112
        $sortie .=  '<p>Vous &ecirc;tes sur le point d\'installer Papyrus '.INSTAL_VERSION_NOUVELLE.'.<br />'.
111
                    'Veuillez configurer votre Papyrus en remplissant les formulaires étape par étape.</p>'."\n";
113
                    'Veuillez configurer votre Papyrus en remplissant les formulaires étape par étape.</p>'."\n";
112
    }
114
    }
113
    
115
    
114
    if(!isset($_GET['installation']) || ($_GET['installation'] == 'form_pref' || $_GET['installation'] == 'verif_pref')) {
116
    if(!isset($_GET['installation']) || ($_GET['installation'] == 'form_pref' || $_GET['installation'] == 'verif_pref')) {
115
        include_once GEN_CHEMIN_APPLICATION.'installateur/instal_preference.inc.php';
117
        include_once GEN_CHEMIN_APPLICATION.'installateur/instal_preference.inc.php';
116
    } else if($_GET['installation'] == 'form_bdd' || $_GET['installation'] == 'verif_bdd') {
118
    } else if($_GET['installation'] == 'form_bdd' || $_GET['installation'] == 'verif_bdd') {
117
        include_once GEN_CHEMIN_APPLICATION.'installateur/instal_base_de_donnees.inc.php';
119
        include_once GEN_CHEMIN_APPLICATION.'installateur/instal_base_de_donnees.inc.php';
118
    } else if($_GET['installation'] == 'form_fichier' || $_GET['installation'] == 'verif_fichier') {
120
    } else if($_GET['installation'] == 'form_fichier' || $_GET['installation'] == 'verif_fichier') {
119
        include_once GEN_CHEMIN_APPLICATION.'installateur/instal_fichier.inc.php';
121
        include_once GEN_CHEMIN_APPLICATION.'installateur/instal_fichier.inc.php';
120
    }
122
    }
121
    
123
    
122
    // Pied XHTML des pages de l'installation de Papyrus
124
    // Pied XHTML des pages de l'installation de Papyrus
123
    $sortie .= '  </body>'."\n";
125
    $sortie .= '  </body>'."\n";
124
    $sortie .= '</html>';
126
    $sortie .= '</html>';
125
    
127
    
126
    return $sortie;
128
    return $sortie;
127
}
129
}
128
// +------------------------------------------------------------------------------------------------------+
130
// +------------------------------------------------------------------------------------------------------+
129
// |                                            PIED du PROGRAMME                                         |
131
// |                                            PIED du PROGRAMME                                         |
130
// +------------------------------------------------------------------------------------------------------+
132
// +------------------------------------------------------------------------------------------------------+
131
 
133
 
132
/* +--Fin du code ----------------------------------------------------------------------------------------+
134
/* +--Fin du code ----------------------------------------------------------------------------------------+
133
*
135
*
134
* $Log: not supported by cvs2svn $
136
* $Log: not supported by cvs2svn $
-
 
137
* Revision 1.7  2004/10/22 17:23:04  jpm
-
 
138
* Simplification del'installation de Papyrus.
-
 
139
*
135
* Revision 1.6  2004/10/19 17:01:12  jpm
140
* Revision 1.6  2004/10/19 17:01:12  jpm
136
* Correction bogues.
141
* Correction bogues.
137
*
142
*
138
* Revision 1.5  2004/10/19 16:47:28  jpm
143
* Revision 1.5  2004/10/19 16:47:28  jpm
139
* Transformation en fonction de l'appel de l'application.
144
* Transformation en fonction de l'appel de l'application.
140
*
145
*
141
* Revision 1.4  2004/10/19 15:59:18  jpm
146
* Revision 1.4  2004/10/19 15:59:18  jpm
142
* Ajout de la gestion des valeurs propre à Papyrus à insérer dans la base de données.
147
* Ajout de la gestion des valeurs propre à Papyrus à insérer dans la base de données.
143
* Ajout des constantes FTP.
148
* Ajout des constantes FTP.
144
*
149
*
145
* Revision 1.3  2004/10/18 09:12:09  jpm
150
* Revision 1.3  2004/10/18 09:12:09  jpm
146
* Changement de nom d'un fichier.
151
* Changement de nom d'un fichier.
147
*
152
*
148
* Revision 1.2  2004/10/15 18:28:59  jpm
153
* Revision 1.2  2004/10/15 18:28:59  jpm
149
* Début appli installateur de Papyrus.
154
* Début appli installateur de Papyrus.
150
*
155
*
151
* Revision 1.1  2004/06/16 14:33:13  jpm
156
* Revision 1.1  2004/06/16 14:33:13  jpm
152
* Changement de nom de Génésia en Papyrus.
157
* Changement de nom de Génésia en Papyrus.
153
* Changement de l'arborescence.
158
* Changement de l'arborescence.
154
*
159
*
155
* Revision 1.6  2004/04/22 08:25:48  jpm
160
* Revision 1.6  2004/04/22 08:25:48  jpm
156
* Transformation de $GS_GLOBAL en $_GEN_commun.
161
* Transformation de $GS_GLOBAL en $_GEN_commun.
157
*
162
*
158
* Revision 1.5  2004/04/08 13:21:05  jpm
163
* Revision 1.5  2004/04/08 13:21:05  jpm
159
* Le code pour l'installation uniquement.
164
* Le code pour l'installation uniquement.
160
*
165
*
161
* Revision 1.4  2004/04/08 12:25:16  jpm
166
* Revision 1.4  2004/04/08 12:25:16  jpm
162
* Suppression de tous le code réalisant les vérifications. L'application Installateur ne fera qu'installer Génésia et non vérifier son bon fonctionnement.
167
* Suppression de tous le code réalisant les vérifications. L'application Installateur ne fera qu'installer Génésia et non vérifier son bon fonctionnement.
163
*
168
*
164
* Revision 1.3  2004/04/02 16:37:51  jpm
169
* Revision 1.3  2004/04/02 16:37:51  jpm
165
* Modification des commentaires.
170
* Modification des commentaires.
166
*
171
*
167
* Revision 1.2  2004/03/31 16:57:16  jpm
172
* Revision 1.2  2004/03/31 16:57:16  jpm
168
* Ajout de la gestion des erreur de base de données, de la connexion à celle-ci et des extenssions php disponibles.
173
* Ajout de la gestion des erreur de base de données, de la connexion à celle-ci et des extenssions php disponibles.
169
*
174
*
170
* Revision 1.1  2004/03/29 11:00:12  jpm
175
* Revision 1.1  2004/03/29 11:00:12  jpm
171
* Transfert d'un morceau de code gérant les erreurs et l'installation mais qui a actuellement aucun effet sur Génésia.
176
* Transfert d'un morceau de code gérant les erreurs et l'installation mais qui a actuellement aucun effet sur Génésia.
172
*
177
*
173
*
178
*
174
* +-- Fin du code ----------------------------------------------------------------------------------------+
179
* +-- Fin du code ----------------------------------------------------------------------------------------+
175
*/
180
*/
176
?>
181
?>