Subversion Repositories Applications.papyrus

Rev

Rev 2060 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6 jpm 1
<?php
2150 mathias 2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
6 jpm 3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
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                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
2150 mathias 22
// CVS : $Id: installateur.php,v 1.16 2007-04-20 13:31:42 florian Exp $
6 jpm 23
/**
24
* Application Installateur de Papyrus.
25
*
2150 mathias 26
* Application permettant de g�rer l'installation et les erreurs li�s � l'abscence de base de donn�es,
6 jpm 27
* d'extenssin PHP...
28
*
29
*@package Installateur
30
//Auteur original :
2150 mathias 31
*@author
32
	               'AND gm_ce_i18n = "'.GEN_I18N_ID_DEFAUT.'" ';
33
 
34
				$resultat = $db->query($requete);
35
 
36
				(DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '';
37
				$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
38
 
39
				if ($langue_test!=GEN_I18N_ID_DEFAUT) {
40
					return GEN_rechercheMenuIdentifiantVersionParDefaut($db,$ligne->gm_id_menu);
41
				}
42
		} Jean-Pascal MILCENT <jpm@tela-botanica.org>
6 jpm 43
//Autres auteurs :
44
*@author        Aucun
45
*@copyright     Tela-Botanica 2000-2004
2150 mathias 46
*@version       $Revision: 1.16 $ $Date: 2007-04-20 13:31:42 $
6 jpm 47
// +------------------------------------------------------------------------------------------------------+
48
**/
49
 
2150 mathias 50
// protection contre un accès direct ou à travers un site qui n'existe pas
2060 aurelien 51
if(GEN_VERSION == PAP_VERSION) {
52
	header('location:papyrus.php');
53
	exit;
54
}
55
 
6 jpm 56
// +------------------------------------------------------------------------------------------------------+
2150 mathias 57
// |                                            ENT�TE du PROGRAMME                                       |
6 jpm 58
// +------------------------------------------------------------------------------------------------------+
2150 mathias 59
// Constante de l'application Installateur. On devrait cr�er un fichier de config et un de langue pour rendre l'appli portable...
458 florian 60
preg_match('/^(.*)papyrus.php/', $_SERVER['SCRIPT_FILENAME'], $instal_tab_txt);
61
define('INSTAL_CHEMIN_ABSOLU', $instal_tab_txt[1]);
62
/** Nom du dossier contenant l'application Installateur.*/
63
define('INSTAL_DOSSIER_APPLI', INSTAL_CHEMIN_ABSOLU.GEN_CHEMIN_APPLICATION.'installateur'.GEN_SEP);
2150 mathias 64
/** Nom du dossier contenant la biblioth�que de code de l'application Installateur.*/
458 florian 65
define('INSTAL_DOSSIER_BIBLIO', INSTAL_DOSSIER_APPLI.'bibliotheque'.GEN_SEP);
66
/** Chemin vers le fichier de configuration de base de l'application Papyrus.*/
67
define('INSTAL_CHEMIN_CONFIG', GEN_CHEMIN_CONFIG.GEN_FICHIER_CONFIG);
2150 mathias 68
/** Nom du fichier de configuration de Papyrus � cr�er.*/
458 florian 69
define('INSTAL_FICHIER_CONFIG', GEN_FICHIER_CONFIG);
70
/** Chemin vers le fichier de configuration de base de l'application Papyrus.*/
71
define('INSTAL_CHEMIN_SQL', INSTAL_CHEMIN_ABSOLU.GEN_CHEMIN_INSTAL);
2150 mathias 72
/** Nom de la constante stockant le num�ro de la nouvelle version de l'application Papyrus.*/
458 florian 73
define('INSTAL_VERSION_NOUVELLE_NOM', 'PAP_VERSION');
2150 mathias 74
/** Num�ro de la nouvelle version de l'application Papyrus.*/
458 florian 75
define('INSTAL_VERSION_NOUVELLE', GEN_VERSION);
76
if (defined('PAP_VERSION')) {
77
    define('INSTAL_VERSION_ANCIENNE', PAP_VERSION);
78
} else {
79
    define('INSTAL_VERSION_ANCIENNE', '');
80
}
2150 mathias 81
/** Nombre d'�tapes totale de l'installation.*/
458 florian 82
define('INSTAL_NBRE_ETAPE', 3);
6 jpm 83
 
2150 mathias 84
// Fichiers � inclure
458 florian 85
require_once INSTAL_DOSSIER_BIBLIO.'instal_installation.fonct.php';
86
 
6 jpm 87
// +------------------------------------------------------------------------------------------------------+
88
// |                                          CORPS du PROGRAMME                                          |
89
// +------------------------------------------------------------------------------------------------------+
2150 mathias 90
function afficherContenuCorps()
458 florian 91
{
2150 mathias 92
    // Ent�tre XHTML des pages de l'installation de Papyrus
458 florian 93
    $sortie = '';
94
    $sortie .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'."\n";
95
    $sortie .= '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n";
96
    $sortie .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="fr-FR" xml:lang="fr-FR">'."\n";
97
    $sortie .= '  <head>'."\n";
98
    $sortie .= '    <link rel="stylesheet" type="text/css" media="screen" title="Installateur" href="papyrus/applications/installateur/presentations/styles/installateur.css" />'."\n";
99
    $sortie .= '    <title>Installation de Papyrus</title>'."\n";
100
    $sortie .= '  </head>'."\n";
986 florian 101
 	$sortie .= '  <body xml:lang="fr" lang="fr" >'."\n";
102
	$sortie .= '  <div id="page">'."\n";
2150 mathias 103
    $sortie .= '  	<div id="zone_bandeau">'."\n";
104
	$sortie .= '  		<div id="logo">'."\n";
986 florian 105
    $sortie .= '              <img src="papyrus/applications/installateur/presentations/images/Logo_papyrus.jpg" alt="Logo Papyrus" />'."\n";
458 florian 106
    $sortie .= '        </div>'."\n";
107
    $sortie .= '        <div id="site_nom">'."\n";
108
    $sortie .= '          <h1>Installation de Papyrus</h1>'."\n";
109
    $sortie .= '        </div>'."\n";
110
    $sortie .= '      </div>'."\n";
111
    $sortie .= '      <div id="zone_contenu">'."\n";
112
    // Message situation de l'installation
113
    if (defined('PAP_VERSION')) {
993 florian 114
        $sortie .=  '<p class="zone_info">Votre syst&egrave;me Papyrus existant a &eacute;t&eacute; reconnu comme &eacute;tant la version '.
458 florian 115
                    INSTAL_VERSION_ANCIENNE.'.<br />'.
993 florian 116
                    'Vous &ecirc;tes sur le point de <strong>mettre &agrave; jour</strong> Papyrus pour la version '.
458 florian 117
                    INSTAL_VERSION_NOUVELLE.'.<br />'.
993 florian 118
                    'Veuillez revoir vos informations de configuration ci-dessous.</p><br style="clear:both;">'."\n";
458 florian 119
    } else {
993 florian 120
        $sortie .=  '<p class="zone_info">Vous &ecirc;tes sur le point d\'installer Papyrus '.INSTAL_VERSION_NOUVELLE.'.<br />'.
1362 florian 121
                    'Veuillez configurer votre Papyrus en remplissant les formulaires &eacute;tape par &eacute;tape.</p><br style="clear:both;">'."\n";
458 florian 122
    }
2150 mathias 123
 
458 florian 124
    if(!isset($_GET['installation']) || ($_GET['installation'] == 'form_pref' || $_GET['installation'] == 'verif_pref')) {
125
        include_once GEN_CHEMIN_APPLICATION.'installateur/instal_preference.inc.php';
126
    } else if($_GET['installation'] == 'form_bdd' || $_GET['installation'] == 'verif_bdd') {
127
        include_once GEN_CHEMIN_APPLICATION.'installateur/instal_base_de_donnees.inc.php';
128
    } else if($_GET['installation'] == 'form_fichier' || $_GET['installation'] == 'verif_fichier') {
129
        include_once GEN_CHEMIN_APPLICATION.'installateur/instal_fichier.inc.php';
130
    }
2150 mathias 131
 
458 florian 132
    // Pied XHTML des pages de l'installation de Papyrus
133
    $sortie .= '    </div>'."\n";
134
    $sortie .= '      <div id="zone_pied">'."\n";
990 florian 135
    $sortie .= '       <div id="copyright">'."\n";
458 florian 136
    $sortie .= '        <a href="http://frenchmozilla.org"><img src="papyrus/applications/installateur/presentations/images/logo-firefox.png" alt="Logo Firefox" /></a>&nbsp;'."\n";
137
    $sortie .= '        <a href="http://validator.w3.org/check?uri=referer"><img src="papyrus/applications/installateur/presentations/images/logo-xhtml11.png" alt="Logo XHTML" /></a>&nbsp;'."\n";
138
    $sortie .= '        <a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="papyrus/applications/installateur/presentations/images/logo-css.png" alt="Logo CSS" /></a><br />'."\n";
1362 florian 139
    $sortie .= '        &copy;&nbsp;<a href="http://www.tela-botanica.org/">Tela Botanica</a> et  <a href="http://www.ecole-et-nature.org/">R&eacute;seau Ecole et Nature</a> / 2004-2006<br />'."\n";
990 florian 140
    $sortie .= '        Site utilisant <a href="http://outils-reseaux.org/wiki_papyrus">Papyrus, le CMS coop&eacute;ratif</a>'."\n";
141
    $sortie .= '       </div>'."\n";
458 florian 142
    $sortie .= '      </div>'."\n";
143
    $sortie .= '  </div>'."\n";
144
    $sortie .= ' </body>'."\n";
145
    $sortie .= '</html>';
2150 mathias 146
 
458 florian 147
    return $sortie;
148
}
1024 ddelon 149
 
150
 
6 jpm 151
// +------------------------------------------------------------------------------------------------------+
152
// |                                            PIED du PROGRAMME                                         |
458 florian 153
// +------------------------------------------------------------------------------------------------------+
6 jpm 154
 
155
/* +--Fin du code ----------------------------------------------------------------------------------------+
156
*
2150 mathias 157
* $Log: installateur.php,v $
158
* Revision 1.16  2007-04-20 13:31:42  florian
159
* remplacement des caracteres speciaux par des entite html
986 florian 160
*
2150 mathias 161
* Revision 1.15  2006/10/16 15:49:07  ddelon
162
* Refactorisation code mulitlinguisme et gestion menu invisibles
163
*
164
* Revision 1.14  2006/10/09 14:35:50  ddelon
165
* bug caractere invalide trainant dans fichier
166
*
167
* Revision 1.13  2006/10/05 15:17:29  florian
168
* changement presentation
169
*
170
* Revision 1.12  2006/10/05 15:11:17  florian
171
* changement presentation
172
*
173
* Revision 1.11  2006/10/05 14:41:53  florian
174
* changement presentation
175
*
176
* Revision 1.10  2005/09/23 14:20:23  florian
177
* nouvel habillage installateur, plus correction de quelques bugs
178
*
458 florian 179
* Revision 1.9  2004/10/27 11:43:32  jpm
2150 mathias 180
* Correction bogues diff mise � jour / installation.
6 jpm 181
*
458 florian 182
* Revision 1.8  2004/10/25 10:22:48  jpm
183
* Correction de quelques bogues, ajouts d'explications pour l'utilisateur et modification des styles CSS.
184
*
185
* Revision 1.7  2004/10/22 17:23:04  jpm
186
* Simplification del'installation de Papyrus.
187
*
188
* Revision 1.6  2004/10/19 17:01:12  jpm
189
* Correction bogues.
190
*
191
* Revision 1.5  2004/10/19 16:47:28  jpm
192
* Transformation en fonction de l'appel de l'application.
193
*
194
* Revision 1.4  2004/10/19 15:59:18  jpm
2150 mathias 195
* Ajout de la gestion des valeurs propre � Papyrus � ins�rer dans la base de donn�es.
458 florian 196
* Ajout des constantes FTP.
197
*
198
* Revision 1.3  2004/10/18 09:12:09  jpm
199
* Changement de nom d'un fichier.
200
*
201
* Revision 1.2  2004/10/15 18:28:59  jpm
2150 mathias 202
* D�but appli installateur de Papyrus.
458 florian 203
*
204
* Revision 1.1  2004/06/16 14:33:13  jpm
2150 mathias 205
* Changement de nom de G�n�sia en Papyrus.
458 florian 206
* Changement de l'arborescence.
207
*
208
* Revision 1.6  2004/04/22 08:25:48  jpm
209
* Transformation de $GS_GLOBAL en $_GEN_commun.
210
*
6 jpm 211
* Revision 1.5  2004/04/08 13:21:05  jpm
212
* Le code pour l'installation uniquement.
213
*
214
* Revision 1.4  2004/04/08 12:25:16  jpm
2150 mathias 215
* 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.
6 jpm 216
*
217
* Revision 1.3  2004/04/02 16:37:51  jpm
218
* Modification des commentaires.
219
*
220
* Revision 1.2  2004/03/31 16:57:16  jpm
2150 mathias 221
* Ajout de la gestion des erreur de base de donn�es, de la connexion � celle-ci et des extenssions php disponibles.
6 jpm 222
*
223
* Revision 1.1  2004/03/29 11:00:12  jpm
2150 mathias 224
* Transfert d'un morceau de code g�rant les erreurs et l'installation mais qui a actuellement aucun effet sur G�n�sia.
6 jpm 225
*
226
*
227
* +-- Fin du code ----------------------------------------------------------------------------------------+
228
*/
229
?>