Subversion Repositories Applications.papyrus

Rev

Rev 97 | Rev 108 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 97 Rev 100
Line 30... Line 30...
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
*
Line 44... Line 44...
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
**/
Line 52... Line 52...
52
 
52
 
53
// +------------------------------------------------------------------------------------------------------+
53
// +------------------------------------------------------------------------------------------------------+
Line 63... Line 63...
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
}
Line 71... Line 77...
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
Line 81... Line 87...
81
 
87
 
82
// +------------------------------------------------------------------------------------------------------+
88
// +------------------------------------------------------------------------------------------------------+
83
// |                                          CORPS du PROGRAMME                                          |
89
// |                                          CORPS du PROGRAMME                                          |
84
// +------------------------------------------------------------------------------------------------------+
90
// +------------------------------------------------------------------------------------------------------+
85
// Affichage d'informations...
91
// Affichage d'informations...
Line 86... Line 92...
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
Line 91... Line 97...
91
    $fichier['PAP_FTP_RACINE'] = GEN_SEP.$fichier['PAP_FTP_RACINE'];
97
    $fichier['PAP_FTP_RACINE'] = GEN_SEP.$fichier['PAP_FTP_RACINE'];
Line 165... Line 171...
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
}
Line 174... Line 180...
174
 
180
 
Line 183... Line 189...
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;
Line 220... Line 229...
220
 
229
 
221
 
230
 
222
/* +--Fin du code ----------------------------------------------------------------------------------------+
231
/* +--Fin du code ----------------------------------------------------------------------------------------+
-
 
232
*
-
 
233
* $Log: not supported by cvs2svn $
-
 
234
* Revision 1.6  2004/10/22 17:39:14  jpm
223
*
235
* Correction gestion du slash devant le chemin racine ftp.
224
* $Log: not supported by cvs2svn $
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
*