Subversion Repositories Applications.papyrus

Rev

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

Rev 97 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
// | Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>                                                   |
8
// | Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>                                                   |
9
// | Copyright 2002, 2003 David DELON                                                                     |
9
// | Copyright 2002, 2003 David DELON                                                                     |
10
// | Copyright 2002 Patrick PAUL                                                                          |
10
// | Copyright 2002 Patrick PAUL                                                                          |
11
// | Copyright  2003  Jean-Pascal MILCENT                                                                 |
11
// | Copyright  2003  Jean-Pascal MILCENT                                                                 |
12
// | All rights reserved.                                                                                 |
12
// | All rights reserved.                                                                                 |
13
// | Redistribution and use in source and binary forms, with or without                                   |
13
// | Redistribution and use in source and binary forms, with or without                                   |
14
// | modification, are permitted provided that the following conditions                                   |
14
// | modification, are permitted provided that the following conditions                                   |
15
// | are met:                                                                                             |
15
// | are met:                                                                                             |
16
// | 1. Redistributions of source code must retain the above copyright                                    |
16
// | 1. Redistributions of source code must retain the above copyright                                    |
17
// | notice, this list of conditions and the following disclaimer.                                        |
17
// | notice, this list of conditions and the following disclaimer.                                        |
18
// | 2. Redistributions in binary form must reproduce the above copyright                                 |
18
// | 2. Redistributions in binary form must reproduce the above copyright                                 |
19
// | notice, this list of conditions and the following disclaimer in the                                  |
19
// | notice, this list of conditions and the following disclaimer in the                                  |
20
// | documentation and/or other materials provided with the distribution.                                 |
20
// | documentation and/or other materials provided with the distribution.                                 |
21
// | 3. The name of the author may not be used to endorse or promote products                             |
21
// | 3. The name of the author may not be used to endorse or promote products                             |
22
// | derived from this software without specific prior written permission.                                |
22
// | derived from this software without specific prior written permission.                                |
23
// |                                                                                                      |
23
// |                                                                                                      |
24
// | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR                                 |
24
// | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR                                 |
25
// | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES                            |
25
// | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES                            |
26
// | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.                              |
26
// | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.                              |
27
// | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,                                     |
27
// | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,                                     |
28
// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT                             |
28
// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT                             |
29
// | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,                            |
29
// | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,                            |
30
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY                                |
30
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY                                |
31
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT                                  |
31
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT                                  |
32
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF                             |
32
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF                             |
33
// | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                                    |
33
// | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                                    |
34
// +------------------------------------------------------------------------------------------------------+
34
// +------------------------------------------------------------------------------------------------------+
35
// CVS : $Id: instal_fichier.inc.php,v 1.6 2004-10-22 17:39:14 jpm Exp $
35
// CVS : $Id: instal_fichier.inc.php,v 1.7 2004-10-25 10:22:48 jpm Exp $
36
/**
36
/**
37
* Page de création des fichiers nécessaire à l'installation de Papyrus.
37
* Page de création des fichiers nécessaire à l'installation de Papyrus.
38
*
38
*
39
* Page permettant de créer le fichier de configuration de Papyrus.
39
* Page permettant de créer le fichier de configuration de Papyrus.
40
*
40
*
41
*@package Installateur
41
*@package Installateur
42
//Auteur original :
42
//Auteur original :
43
*@author        Hendrik MANS <hendrik@mans.de>
43
*@author        Hendrik MANS <hendrik@mans.de>
44
//Autres auteurs :
44
//Autres auteurs :
45
*@author        David DELON
45
*@author        David DELON
46
*@author        Patrick PAUL
46
*@author        Patrick PAUL
47
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
47
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
48
*@copyright     Tela-Botanica 2000-2004
48
*@copyright     Tela-Botanica 2000-2004
49
*@version       $Revision: 1.6 $ $Date: 2004-10-22 17:39:14 $
49
*@version       $Revision: 1.7 $ $Date: 2004-10-25 10:22:48 $
50
// +------------------------------------------------------------------------------------------------------+
50
// +------------------------------------------------------------------------------------------------------+
51
**/
51
**/
52
 
52
 
53
// +------------------------------------------------------------------------------------------------------+
53
// +------------------------------------------------------------------------------------------------------+
54
// |                                            ENTÊTE du PROGRAMME                                       |
54
// |                                            ENTÊTE du PROGRAMME                                       |
55
// +------------------------------------------------------------------------------------------------------+
55
// +------------------------------------------------------------------------------------------------------+
56
// Numéro de l'étape d'installation :
56
// Numéro de l'étape d'installation :
57
$num_etape = 3;
57
$num_etape = 3;
58
 
58
 
59
// Initialisation du tableau contenant les valeurs de configuration de la base de données
59
// Initialisation du tableau contenant les valeurs de configuration de la base de données
60
$tableau = array(   'PAP_FTP_SERVEUR' => '', 'PAP_FTP_PORT' => '', 'PAP_FTP_UTILISATEUR' => '', 
60
$tableau = array(   'PAP_FTP_SERVEUR' => '', 'PAP_FTP_PORT' => '', 'PAP_FTP_UTILISATEUR' => '', 
61
                    'PAP_FTP_MOT_DE_PASSE' => '', 'PAP_FTP_RACINE' => '');
61
                    'PAP_FTP_MOT_DE_PASSE' => '', 'PAP_FTP_RACINE' => '');
62
foreach ($tableau as $cle => $val) {
62
foreach ($tableau as $cle => $val) {
63
    if (!empty($_POST['fichier'][$cle])) {
63
    if (!empty($_POST['fichier'][$cle])) {
64
        $fichier[$cle] = $_POST['fichier'][$cle];
64
        $fichier[$cle] = $_POST['fichier'][$cle];
65
    } else if (defined($cle)) {
65
    } else if (defined($cle)) {
66
        $fichier[$cle] = constant($cle);
66
        $fichier[$cle] = constant($cle);
67
    } else {
67
    } else {
-
 
68
        if ($cle == 'PAP_FTP_SERVEUR') {
-
 
69
            $fichier[$cle] = $_SERVER['HTTP_HOST'];
-
 
70
        } else if ($cle == 'PAP_FTP_PORT') {
-
 
71
            $fichier[$cle] = 21;
-
 
72
        } else {
68
        $fichier[$cle] = '';
73
            $fichier[$cle] = '';
-
 
74
        }
69
    }
75
    }
70
}
76
}
71
 
77
 
72
// Récupération des paramêtres de configuration du formulaire précédent
78
// Récupération des paramêtres de configuration du formulaire précédent
73
if (isset($_POST['pref_serial'])) {
79
if (isset($_POST['pref_serial'])) {
74
    $pref = unserialize(stripslashes($_POST['pref_serial']));
80
    $pref = unserialize(stripslashes($_POST['pref_serial']));
75
}
81
}
76
if (isset($_POST['bdd'])) {
82
if (isset($_POST['bdd'])) {
77
    $bdd = $_POST['bdd'];
83
    $bdd = $_POST['bdd'];
78
} else if (isset($_POST['bdd_serial'])) {
84
} else if (isset($_POST['bdd_serial'])) {
79
    $bdd = unserialize(stripslashes($_POST['bdd_serial']));
85
    $bdd = unserialize(stripslashes($_POST['bdd_serial']));
80
}
86
}
81
 
87
 
82
// +------------------------------------------------------------------------------------------------------+
88
// +------------------------------------------------------------------------------------------------------+
83
// |                                          CORPS du PROGRAMME                                          |
89
// |                                          CORPS du PROGRAMME                                          |
84
// +------------------------------------------------------------------------------------------------------+
90
// +------------------------------------------------------------------------------------------------------+
85
// Affichage d'informations...
91
// Affichage d'informations...
86
$sortie .= '<p><strong>Etape n°'.$num_etape.' sur '.INSTAL_NBRE_ETAPE.'.</strong></p>'."\n";
92
$sortie .= '<p class="etape_numero"><strong>Etape n°'.$num_etape.' sur '.INSTAL_NBRE_ETAPE.'.</strong></p>'."\n";
87
 
93
 
88
// Correction éventuelle des informations saisies par l'utilisateur
94
// Correction éventuelle des informations saisies par l'utilisateur
89
if (preg_match('/^(?:\/|\\)(.*)$/', $fichier['PAP_FTP_RACINE']) == 1) {
95
if (ereg('^[\/\\]', $fichier['PAP_FTP_RACINE']) == false) {
90
    // le chemin FTP ne doit pas commencer par un slash, nous le supprimons
96
    // le chemin FTP ne doit pas commencer par un slash, nous le supprimons
91
    $fichier['PAP_FTP_RACINE'] = GEN_SEP.$fichier['PAP_FTP_RACINE'];
97
    $fichier['PAP_FTP_RACINE'] = GEN_SEP.$fichier['PAP_FTP_RACINE'];
92
}
98
}
93
 
99
 
94
// Nous vérifions si nous sommes en phase de test du formulaire de config de l'écriture de fichier
100
// Nous vérifions si nous sommes en phase de test du formulaire de config de l'écriture de fichier
95
$erreur = 0;
101
$erreur = 0;
96
$sortie_verif = '';
102
$sortie_verif = '';
97
if ($_GET['installation'] == 'verif_fichier') {
103
if ($_GET['installation'] == 'verif_fichier') {
98
    // Test de la configuration du FTP
104
    // Test de la configuration du FTP
99
    $sortie_verif .= '    <h2>Test de la connexion FTP</h2>'."\n";
105
    $sortie_verif .= '    <h2>Test de la connexion FTP</h2>'."\n";
100
    $erreur = testerConfig($sortie_verif, 'Test connexion FTP ...', $ftp = @ftp_connect($fichier['PAP_FTP_SERVEUR'], $fichier['PAP_FTP_PORT']), '', 1, $erreur);
106
    $erreur = testerConfig($sortie_verif, 'Test connexion FTP ...', $ftp = @ftp_connect($fichier['PAP_FTP_SERVEUR'], $fichier['PAP_FTP_PORT']), '', 1, $erreur);
101
    $erreur = testerConfig($sortie_verif, 'Test identification sur le serveur FTP ...', @ftp_login($ftp, $fichier['PAP_FTP_UTILISATEUR'],
107
    $erreur = testerConfig($sortie_verif, 'Test identification sur le serveur FTP ...', @ftp_login($ftp, $fichier['PAP_FTP_UTILISATEUR'],
102
                            $fichier['PAP_FTP_MOT_DE_PASSE']), 'Les paramêtres FTP saisies ne permettent pas l\'identification !', 1, $erreur);
108
                            $fichier['PAP_FTP_MOT_DE_PASSE']), 'Les paramêtres FTP saisies ne permettent pas l\'identification !', 1, $erreur);
103
    $sortie_verif .= '<br />'."\n";
109
    $sortie_verif .= '<br />'."\n";
104
    
110
    
105
    $configCode = "<?php\n// pap_config.inc.php construit le ".strftime("%c")."\n// ne changez pas la version de Papyrus manuellement!\n\n";
111
    $configCode = "<?php\n// pap_config.inc.php construit le ".strftime("%c")."\n// ne changez pas la version de Papyrus manuellement!\n\n";
106
    $entries[] = 'define(\''.INSTAL_VERSION_NOUVELLE_NOM.'\',\''.INSTAL_VERSION_NOUVELLE.'\');'."\n";
112
    $entries[] = 'define(\''.INSTAL_VERSION_NOUVELLE_NOM.'\',\''.INSTAL_VERSION_NOUVELLE.'\');'."\n";
107
    foreach ($bdd as $cle => $val) {
113
    foreach ($bdd as $cle => $val) {
108
        $entries[] = 'define(\''.$cle.'\',\''.$val.'\');'."\n";
114
        $entries[] = 'define(\''.$cle.'\',\''.$val.'\');'."\n";
109
    }
115
    }
110
    $entries[] = "define('PAP_DSN', 'mysql://'.PAP_BDD_UTILISATEUR.':'.PAP_BDD_MOT_DE_PASSE.'@'.PAP_BDD_SERVEUR.'/'.PAP_BDD_NOM);"."\n";
116
    $entries[] = "define('PAP_DSN', 'mysql://'.PAP_BDD_UTILISATEUR.':'.PAP_BDD_MOT_DE_PASSE.'@'.PAP_BDD_SERVEUR.'/'.PAP_BDD_NOM);"."\n";
111
    foreach ($fichier as $cle => $val) {
117
    foreach ($fichier as $cle => $val) {
112
        $entries[] = 'define(\''.$cle.'\',\''.$val.'\');'."\n";
118
        $entries[] = 'define(\''.$cle.'\',\''.$val.'\');'."\n";
113
    }
119
    }
114
    foreach ($pref as $cle => $val) {
120
    foreach ($pref as $cle => $val) {
115
        // Nous récupérons uniquement les constantes à stocker dans le fichier de config (leur nom commence par PAP_)
121
        // Nous récupérons uniquement les constantes à stocker dans le fichier de config (leur nom commence par PAP_)
116
        if (preg_match('/^PAP_/', $cle)) {
122
        if (preg_match('/^PAP_/', $cle)) {
117
            $entries[] = 'define(\''.$cle.'\',\''.$val.'\');'."\n";
123
            $entries[] = 'define(\''.$cle.'\',\''.$val.'\');'."\n";
118
        }
124
        }
119
    }
125
    }
120
    $configCode .= implode("\n", $entries)."\n\n?>";
126
    $configCode .= implode("\n", $entries)."\n\n?>";
121
    
127
    
122
    // Tentative d'écriture du fichier de config
128
    // Tentative d'écriture du fichier de config
123
    $sortie_verif .= '    <h2>Ecriture des fichiers sur le serveur par FTP</h2>'."\n";
129
    $sortie_verif .= '    <h2>Ecriture des fichiers sur le serveur par FTP</h2>'."\n";
124
    $chemin_fpt_absolu = $fichier['PAP_FTP_RACINE'].INSTAL_CHEMIN_CONFIG;
130
    $chemin_fpt_absolu = $fichier['PAP_FTP_RACINE'].INSTAL_CHEMIN_CONFIG;
125
    $url_ftp =  'ftp://'.$fichier['PAP_FTP_UTILISATEUR'].':'.$fichier['PAP_FTP_MOT_DE_PASSE'].
131
    $url_ftp =  'ftp://'.$fichier['PAP_FTP_UTILISATEUR'].':'.$fichier['PAP_FTP_MOT_DE_PASSE'].
126
                '@'.$fichier['PAP_FTP_SERVEUR'].$chemin_fpt_absolu;
132
                '@'.$fichier['PAP_FTP_SERVEUR'].$chemin_fpt_absolu;
127
    $fp = @fopen($url_ftp, 'w');
133
    $fp = @fopen($url_ftp, 'w');
128
    $txt_ecriture_conf = '&Eacute;criture sur le serveur de <tt>'.$chemin_fpt_absolu.'</tt>...';
134
    $txt_ecriture_conf = '&Eacute;criture sur le serveur de <tt>'.$chemin_fpt_absolu.'</tt>...';
129
    $txt_ecriture_conf_erreur = '<p><span class="failed">AVERTISSEMENT:</span> Le fichier de configuration <tt>'.$chemin_fpt_absolu.
135
    $txt_ecriture_conf_erreur = '<p><span class="failed">AVERTISSEMENT:</span> Le fichier de configuration <tt>'.$chemin_fpt_absolu.
130
                '</tt> n\'a pu &ecirc;tre cr&eacute;&eacute;. Veuillez vous assurez que votre serveur a les droits '.
136
                '</tt> n\'a pu &ecirc;tre cr&eacute;&eacute;. Veuillez vous assurez que votre serveur a les droits '.
131
                'd\'acc&egrave;s en &eacute;criture pour ce fichier. Si pour une raison quelconque vous ne pouvez pas '.
137
                'd\'acc&egrave;s en &eacute;criture pour ce fichier. Si pour une raison quelconque vous ne pouvez pas '.
132
                'faire &ccedil;a vous devez copier les informations suivantes dans un fichier et les transf&eacute;rer '.
138
                'faire &ccedil;a vous devez copier les informations suivantes dans un fichier et les transf&eacute;rer '.
133
                'au moyen d\'un logiciel de transfert de fichier (ftp) sur le serveur dans un fichier '.
139
                'au moyen d\'un logiciel de transfert de fichier (ftp) sur le serveur dans un fichier '.
134
                '<tt>pap_config.inc.php</tt> directement dans le r&eacute;pertoire <tt>configuration</tt> du répertoire '.
140
                '<tt>pap_config.inc.php</tt> directement dans le r&eacute;pertoire <tt>configuration</tt> du répertoire '.
135
                '<tt>papyrus</tt> de Papyrus. Une fois que vous aurez fait cela, votre site Papyrus devrait fonctionner '.
141
                '<tt>papyrus</tt> de Papyrus. Une fois que vous aurez fait cela, votre site Papyrus devrait fonctionner '.
136
                'correctement.</p>';
142
                'correctement.</p>';
137
    $txt_ecriture_conf_erreur .= '<div id="fichier_config">'."\n";
143
    $txt_ecriture_conf_erreur .= '<div id="fichier_config">'."\n";
138
    $txt_ecriture_conf_erreur .= '<xmp>'.$configCode.'</xmp>'."\n";
144
    $txt_ecriture_conf_erreur .= '<xmp>'.$configCode.'</xmp>'."\n";
139
    $txt_ecriture_conf_erreur .= '</div>'."\n";
145
    $txt_ecriture_conf_erreur .= '</div>'."\n";
140
    $erreur = testerConfig($sortie_verif, $txt_ecriture_conf, $fp, $txt_ecriture_conf_erreur, 1, $erreur);
146
    $erreur = testerConfig($sortie_verif, $txt_ecriture_conf, $fp, $txt_ecriture_conf_erreur, 1, $erreur);
141
}
147
}
142
 
148
 
143
// Gestion de l'affichage
149
// Gestion de l'affichage
144
if ($erreur == 0 && empty($sortie_verif)) {
150
if ($erreur == 0 && empty($sortie_verif)) {
145
    // Premier appel du fichier...
151
    // Premier appel du fichier...
146
    $sortie .= creerFormulaire($fichier);
152
    $sortie .= creerFormulaire($fichier);
147
    $sortie .= '<li><input type="hidden" name="pref_serial" value="'.htmlentities(serialize($pref)).'" /></li>'."\n";
153
    $sortie .= '<li><input type="hidden" name="pref_serial" value="'.htmlentities(serialize($pref)).'" /></li>'."\n";
148
    $sortie .= '<li><input type="hidden" name="bdd_serial" value="'.htmlentities(serialize($bdd)).'" /></li>'."\n";
154
    $sortie .= '<li><input type="hidden" name="bdd_serial" value="'.htmlentities(serialize($bdd)).'" /></li>'."\n";
149
    $sortie .= '<li><input type="submit" value="Tester" /></li>'."\n";
155
    $sortie .= '<li><input type="submit" value="Tester" /></li>'."\n";
150
    $sortie .= '      </ul>'."\n";
156
    $sortie .= '      </ul>'."\n";
151
    $sortie .= '    </form>';
157
    $sortie .= '    </form>';
152
} else if ($erreur == 2 && !empty($sortie_verif)) {
158
} else if ($erreur == 2 && !empty($sortie_verif)) {
153
    // Vérification du fichier avec interuption...
159
    // Vérification du fichier avec interuption...
154
    $sortie .= creerFormulaire($fichier);
160
    $sortie .= creerFormulaire($fichier);
155
    $sortie .= '<li><input type="hidden" name="pref_serial" value="'.htmlentities(serialize($pref)).'" /></li>'."\n";
161
    $sortie .= '<li><input type="hidden" name="pref_serial" value="'.htmlentities(serialize($pref)).'" /></li>'."\n";
156
    $sortie .= '<li><input type="hidden" name="bdd_serial" value="'.htmlentities(serialize($bdd)).'" /></li>'."\n";
162
    $sortie .= '<li><input type="hidden" name="bdd_serial" value="'.htmlentities(serialize($bdd)).'" /></li>'."\n";
157
    $sortie .= '<li><input type="submit" value="Tester à nouveau" /></li>'."\n";
163
    $sortie .= '<li><input type="submit" value="Tester à nouveau" /></li>'."\n";
158
    $sortie .= '      </ul>'."\n";
164
    $sortie .= '      </ul>'."\n";
159
    $sortie .= '    </form>';
165
    $sortie .= '    </form>';
160
    $sortie .= $sortie_verif;
166
    $sortie .= $sortie_verif;
161
} else if (($erreur == 0 || $erreur == 1) && !empty($sortie_verif)) {
167
} else if (($erreur == 0 || $erreur == 1) && !empty($sortie_verif)) {
162
    // Vérification du fichier sans interuption... passage à l'étape suivante
168
    // Vérification du fichier sans interuption... passage à l'étape suivante
163
    $sortie .= creerFormulaire($fichier, true);
169
    $sortie .= creerFormulaire($fichier, true);
164
    $sortie .= '      </ul>'."\n";
170
    $sortie .= '      </ul>'."\n";
165
    $sortie .= '    </form>';
171
    $sortie .= '    </form>';
166
    $sortie .= $sortie_verif;
172
    $sortie .= $sortie_verif;
167
    // Ecriture du fichier...
173
    // Ecriture du fichier...
168
    fwrite($fp, $configCode);
174
    fwrite($fp, $configCode);
169
    fclose($fp);
175
    fclose($fp);
170
    $sortie .= '    <p>Voila c\'est termin&eacute; ! Vous pouvez <a href="'.donnerUrlCourante().'">retourner sur votre site '.
176
    $sortie .= '    <p class="etape_info">Voila c\'est termin&eacute; ! Vous pouvez <a href="'.donnerUrlCourante().'">retourner sur votre site '.
171
                'Papyrus</a>. Il est conseill&eacute; de retirer l\'acc&egrave;s en &eacute;criture au fichier '.
177
                'Papyrus</a>. Il est conseill&eacute; de retirer l\'acc&egrave;s en &eacute;criture au fichier '.
172
                '<tt>pap_config.inc.php</tt>. Ceci peut &ecirc;tre une faille dans la s&eacute;curit&eacute;.</p>'."\n";
178
                '<tt>pap_config.inc.php</tt>. Ceci peut &ecirc;tre une faille dans la s&eacute;curit&eacute;.</p>'."\n";
173
}
179
}
174
 
180
 
175
// +------------------------------------------------------------------------------------------------------+
181
// +------------------------------------------------------------------------------------------------------+
176
// |                                            LISTE DES FONCTIONS                                       |
182
// |                                            LISTE DES FONCTIONS                                       |
177
// +------------------------------------------------------------------------------------------------------+
183
// +------------------------------------------------------------------------------------------------------+
178
 
184
 
179
// Création du formulaire de configuration de la base de donneés
185
// Création du formulaire de configuration de la base de donneés
180
function creerFormulaire($fichier, $bln_lecture = false) {
186
function creerFormulaire($fichier, $bln_lecture = false) {
181
    $disabled = '';
187
    $disabled = '';
182
    if ($bln_lecture) {
188
    if ($bln_lecture) {
183
        $disabled = ' disabled="disabled" ';
189
        $disabled = ' disabled="disabled" ';
184
    }
190
    }
185
    $sortie_form .= '    <form action="'.donnerUrlCourante().'?installation=verif_fichier" method="post">';
191
    $sortie_form .= '    <form action="'.donnerUrlCourante().'?installation=verif_fichier" method="post">';
186
    $sortie_form .= '      <ul>'."\n";
192
    $sortie_form .= '      <ul>'."\n";
187
    $sortie_form .=  '<li><h2>Configuration du FTP et des chemins d\'accès</h2></li>'."\n";
193
    $sortie_form .=  '<li><h2>Configuration du FTP et des chemins d\'accès</h2></li>'."\n";
-
 
194
    $sortie_form .= '<li>Le nom de la machine à laquelle vous vous connectez pour accéder à votre dépôt FTP. En '.
-
 
195
                    'g&eacute;n&eacute;ral c\'est le nom de domaine du site où vous voulez installer Papyrus.</li>'."\n";
188
    $sortie_form .=  '<li>'."\n".
196
    $sortie_form .=  '<li>'."\n".
189
                '<label for="ftp_serveur">Nom du serveur FTP :</label>'.
197
                '<label for="ftp_serveur">Nom du serveur FTP :</label>'.
190
                '<input id="ftp_serveur"'.$disabled.'type="text" size="30" name="fichier[PAP_FTP_SERVEUR]" value="'.$fichier['PAP_FTP_SERVEUR'].'" />'.
198
                '<input id="ftp_serveur"'.$disabled.'type="text" size="30" name="fichier[PAP_FTP_SERVEUR]" value="'.$fichier['PAP_FTP_SERVEUR'].'" />'.
191
                '</li>'."\n";
199
                '</li>'."\n";
-
 
200
    $sortie_form .= '<li>Le numéro du port pour le service FTP sur la machine hébergeant Papyrus. '.
-
 
201
                    'En g&eacute;n&eacute;ral c\'est 21.</li>'."\n";
192
    $sortie_form .=  '<li>'."\n".
202
    $sortie_form .=  '<li>'."\n".
193
                '<label for="ftp_port">N° du port d\'accès au serveur FTP :</label>'.
203
                '<label for="ftp_port">N° du port d\'accès au serveur FTP :</label>'.
194
                '<input id="ftp_port"'.$disabled.'type="text" size="20" name="fichier[PAP_FTP_PORT]" value="'.$fichier['PAP_FTP_PORT'].'" />'.
204
                '<input id="ftp_port"'.$disabled.'type="text" size="20" name="fichier[PAP_FTP_PORT]" value="'.$fichier['PAP_FTP_PORT'].'" />'.
195
                '</li>'."\n";
205
                '</li>'."\n";
-
 
206
    $sortie_form .=  '<li>Nom et mot de passe FTP qui sera utilis&eacute; pour se connecter &agrave; au dépôt FTP.</li>'."\n";
196
    $sortie_form .=  '<li>'."\n".
207
    $sortie_form .=  '<li>'."\n".
197
                '<label for="ftp_utilisateur">Nom d\'utilisateur pour le serveur FTP :</label>'.
208
                '<label for="ftp_utilisateur">Nom d\'utilisateur pour le serveur FTP :</label>'.
198
                '<input id="ftp_utilisateur"'.$disabled.'type="text" size="20" name="fichier[PAP_FTP_UTILISATEUR]" value="'.$fichier['PAP_FTP_UTILISATEUR'].'" />'.
209
                '<input id="ftp_utilisateur"'.$disabled.'type="text" size="20" name="fichier[PAP_FTP_UTILISATEUR]" value="'.$fichier['PAP_FTP_UTILISATEUR'].'" />'.
199
                '</li>'."\n";
210
                '</li>'."\n";
200
    $sortie_form .=  '<li>'."\n".
211
    $sortie_form .=  '<li>'."\n".
201
                '<label for="ftp_mot_de_passe">Mot de passe de l\'utilisateur pour le serveur FTP :</label>'.
212
                '<label for="ftp_mot_de_passe">Mot de passe de l\'utilisateur pour le serveur FTP :</label>'.
202
                '<input id="ftp_mot_de_passe"'.$disabled.'type="password" size="20" name="fichier[PAP_FTP_MOT_DE_PASSE]" value="'.$fichier['PAP_FTP_MOT_DE_PASSE'].'" />'.
213
                '<input id="ftp_mot_de_passe"'.$disabled.'type="password" size="20" name="fichier[PAP_FTP_MOT_DE_PASSE]" value="'.$fichier['PAP_FTP_MOT_DE_PASSE'].'" />'.
203
                '</li>'."\n";
214
                '</li>'."\n";
204
    $sortie_form .=  '<li>Lorsque vous vous connecter par FTP sur le serveur où vous avez déposé les fichiers de Papyrus, le '.
215
    $sortie_form .=  '<li>Lorsque vous vous connecter par FTP sur le serveur où vous avez déposé les fichiers de Papyrus, le '.
205
                'dossier le plus haut auquel vous pouvez accéder dans l\'arborescence est la racine. Il vous faut donc '.
216
                'dossier le plus haut auquel vous pouvez accéder dans l\'arborescence est la racine. Il vous faut donc '.
206
                'indiquez dans le champ ci-dessous le chemin depuis cette racine jusqu\'au dossier contenant le fichier '.
217
                'indiquez dans le champ ci-dessous le chemin absolu depuis cette racine jusqu\'au dossier contenant le fichier '.
207
                '<tt>papyrus.php</tt>. Exemple : <i>www/</i><br /> Notes : Le chemin doit commmencer directement par le nom'.
-
 
208
                ' du premier dossier et se terminer par un slash (/) ou un anti-slash (\\) suivant le système d\''.
-
 
209
                'exploitation de votre serveur.</li>'."\n";
218
                '<tt>papyrus.php</tt>. Exemple : <i>/www/</i></li>'."\n";
210
    $sortie_form .=  '<li>'."\n".
219
    $sortie_form .=  '<li>'."\n".
211
                '<label for="ftp_racine">Racine dépôt FTP :</label>'.
220
                '<label for="ftp_racine">Racine dépôt FTP :</label>'.
212
                '<input id="ftp_racine"'.$disabled.'type="text" size="60" name="fichier[PAP_FTP_RACINE]" value="'.$fichier['PAP_FTP_RACINE'].'" />'.
221
                '<input id="ftp_racine"'.$disabled.'type="text" size="60" name="fichier[PAP_FTP_RACINE]" value="'.$fichier['PAP_FTP_RACINE'].'" />'.
213
                '</li>'."\n";
222
                '</li>'."\n";
214
    return $sortie_form;
223
    return $sortie_form;
215
}
224
}
216
 
225
 
217
// +------------------------------------------------------------------------------------------------------+
226
// +------------------------------------------------------------------------------------------------------+
218
// |                                            PIED du PROGRAMME                                         |
227
// |                                            PIED du PROGRAMME                                         |
219
// +------------------------------------------------------------------------------------------------------+
228
// +------------------------------------------------------------------------------------------------------+
220
 
229
 
221
 
230
 
222
/* +--Fin du code ----------------------------------------------------------------------------------------+
231
/* +--Fin du code ----------------------------------------------------------------------------------------+
223
*
232
*
224
* $Log: not supported by cvs2svn $
233
* $Log: not supported by cvs2svn $
-
 
234
* Revision 1.6  2004/10/22 17:39:14  jpm
-
 
235
* Correction gestion du slash devant le chemin racine ftp.
-
 
236
*
225
* Revision 1.5  2004/10/22 17:23:04  jpm
237
* Revision 1.5  2004/10/22 17:23:04  jpm
226
* Simplification del'installation de Papyrus.
238
* Simplification del'installation de Papyrus.
227
*
239
*
228
* Revision 1.4  2004/10/19 17:01:12  jpm
240
* Revision 1.4  2004/10/19 17:01:12  jpm
229
* Correction bogues.
241
* Correction bogues.
230
*
242
*
231
* Revision 1.3  2004/10/19 15:59:18  jpm
243
* Revision 1.3  2004/10/19 15:59:18  jpm
232
* Ajout de la gestion des valeurs propre à Papyrus à insérer dans la base de données.
244
* Ajout de la gestion des valeurs propre à Papyrus à insérer dans la base de données.
233
* Ajout des constantes FTP.
245
* Ajout des constantes FTP.
234
*
246
*
235
* Revision 1.2  2004/10/18 09:12:09  jpm
247
* Revision 1.2  2004/10/18 09:12:09  jpm
236
* Changement de nom d'un fichier.
248
* Changement de nom d'un fichier.
237
*
249
*
238
* Revision 1.1  2004/10/18 09:11:05  jpm
250
* Revision 1.1  2004/10/18 09:11:05  jpm
239
* Changement de nom du fichier.
251
* Changement de nom du fichier.
240
*
252
*
241
* Revision 1.1  2004/10/15 18:28:59  jpm
253
* Revision 1.1  2004/10/15 18:28:59  jpm
242
* Début appli installateur de Papyrus.
254
* Début appli installateur de Papyrus.
243
*
255
*
244
*
256
*
245
* +-- Fin du code ----------------------------------------------------------------------------------------+
257
* +-- Fin du code ----------------------------------------------------------------------------------------+
246
*/
258
*/
247
?>
259
?>