Subversion Repositories Applications.papyrus

Rev

Rev 80 | Rev 91 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
66 jpm 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>                                                   |
9
// | Copyright 2002, 2003 David DELON                                                                     |
10
// | Copyright 2002 Patrick PAUL                                                                          |
11
// | All rights reserved.                                                                                 |
12
// | Redistribution and use in source and binary forms, with or without                                   |
13
// | modification, are permitted provided that the following conditions                                   |
14
// | are met:                                                                                             |
15
// | 1. Redistributions of source code must retain the above copyright                                    |
16
// | notice, this list of conditions and the following disclaimer.                                        |
17
// | 2. Redistributions in binary form must reproduce the above copyright                                 |
18
// | notice, this list of conditions and the following disclaimer in the                                  |
19
// | documentation and/or other materials provided with the distribution.                                 |
20
// | 3. The name of the author may not be used to endorse or promote products                             |
21
// | derived from this software without specific prior written permission.                                |
22
// |                                                                                                      |
23
// | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR                                 |
24
// | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES                            |
25
// | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.                              |
26
// | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,                                     |
27
// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT                             |
28
// | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,                            |
29
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY                                |
30
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT                                  |
31
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF                             |
32
// | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                                    |
33
// +------------------------------------------------------------------------------------------------------+
87 jpm 34
// CVS : $Id: instal_preference.inc.php,v 1.5 2004-10-22 09:07:18 jpm Exp $
66 jpm 35
/**
36
* Page d'initialisation de l'installation de Papyrus.
37
*
38
* Contenu de la page par défaut de l'installation de Papyrus.
39
*
40
*@package Installateur
41
//Auteur original :
42
*@author        Hendrik MANS <hendrik@mans.de>
43
//Autres auteurs :
44
*@author        David DELON
45
*@author        Patrick PAUL
46
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
47
*@copyright     Tela-Botanica 2000-2004
87 jpm 48
*@version       $Revision: 1.5 $ $Date: 2004-10-22 09:07:18 $
66 jpm 49
// +------------------------------------------------------------------------------------------------------+
50
**/
51
 
52
// +------------------------------------------------------------------------------------------------------+
53
// |                                            ENTÊTE du PROGRAMME                                       |
54
// +------------------------------------------------------------------------------------------------------+
76 jpm 55
$conf = array('PAP_BDD_SERVEUR' => '', 'PAP_BDD_NOM' => '', 'PAP_BDD_UTILISATEUR' => '', 'PAP_BDD_MOT_DE_PASSE' => '',
56
                'PAP_FTP_SERVEUR' => '', 'PAP_FTP_PORT' => '', 'PAP_FTP_UTILISATEUR' => '', 'PAP_FTP_MOT_DE_PASSE' => '',
57
                'PAP_FTP_RACINE' => '', 'PAP_CHEMIN_RACINE' => '', 'PAP_URL_REECRITURE' => '');
58
foreach ($conf as $c => $v) {
59
    if (!empty($_POST['config'][$c])) {
60
        $config[$c] = $_POST['config'][$c];
61
    } else if (defined($c)) {
62
        $config[$c] = constant($c);
63
    } else {
64
        $config[$c] = '';
65
    }
66 jpm 66
}
76 jpm 67
$bd = array(  'ADMIN_PRENOM' => '', 'ADMIN_NOM' => '', 'ADMIN_LOGIN' => '', 'ADMIN_MAIL' => '', 'ADMIN_MDP_01' => '',
68
                'ADMIN_MDP_02' => '', 'ADMIN_I18N' => '');
69
foreach ($bd as $c => $v) {
70
    if (!empty($_POST['bdd'][$c])) {
71
        $bdd[$c] = $_POST['bdd'][$c];
72
    } else if (defined($c)) {
73
        $bdd[$c] = constant($c);
74
    } else {
75
        $bdd[$c] = '';
76
    }
66 jpm 77
}
78
// +------------------------------------------------------------------------------------------------------+
79
// |                                          CORPS du PROGRAMME                                          |
80
// +------------------------------------------------------------------------------------------------------+
81
 
82
if (defined('PAP_VERSION')) {
83
    $sortie .=  '<p>Votre syst&egrave;me Papyrus existant a &eacute;t&eacute; reconnu comme &eacute;tant la version '.
84
                INSTAL_VERSION_ANCIENNE.'.<br />'.
85
                'Vous &ecirc;tes sur le point de <b>mettre &agrave; jour</b> Papyrus pour la version '.
86
                INSTAL_VERSION_NOUVELLE.'.<br />'.
87
                'Veuillez revoir vos informations de configuration ci-dessous.</p>'."\n";
88
} else {
89
    $sortie .=  '<p>Vous &ecirc;tes sur le point d\'installer Papyrus '.INSTAL_VERSION_NOUVELLE.'.<br />'.
90
                'Veuillez configurer votre Papyrus en utilisant le formulaire suivant.</p>'."\n";
91
}
87 jpm 92
$sortie .= '    <form action="'.donnerUrlCourante().'?installation=param_verif" method="post">';
66 jpm 93
$sortie .= '      <ul>'."\n";
94
$sortie .=  '<li>NOTE: Ce programme d\'installation va essayer de modifier les options de configurations dans le '.
95
            'fichier <tt>pap_config.inc.php</tt>, situ&eacute; dans le r&eacute;pertoire <tt>configuration</tt> du réportoire '.
96
            '<tt>papyrus</tt>. Pour que cela fonctionne, veuillez vous assurez que votre serveur a les droits d\'acc&egrave;s '.
97
            'en &eacute;criture pour ce fichier. Si pour une raison quelconque vous ne pouvez pas faire &ccedil;a vous '.
98
            'devrez modifier ce fichier manuellement (ce programme d\'installation vous dira comment).</li>'."\n";
79 jpm 99
$sortie .=  '<li><h2>Configuration de la base de donn&eacute;es</h2></li>'."\n";
66 jpm 100
$sortie .=  '<li>La machine sur laquelle se trouve votre serveur MySQL. En g&eacute;n&eacute;ral c\'est "localhost" (ie, la m&ecirc;me machine que celle o&ugrave; se trouve les pages de Papyrus.).</li>'."\n";
101
$sortie .=  '<li>'."\n".
76 jpm 102
            '<label for="mysql_serveur">Nom du serveur MySQL :</label>'.
103
            '<input id="mysql_serveur" type="text" size="30" name="config[PAP_BDD_SERVEUR]" value="'.$config['PAP_BDD_SERVEUR'].'" />'.
66 jpm 104
            '</li>'."\n";
105
$sortie .=  '<li>La base de donn&eacute;es MySQL &agrave; utiliser pour Papyrus. Cette base de donn&eacute;es doit d&eacute;j&agrave; '.
106
            'exister avant de pouvoir continuer.</li>'."\n";
107
$sortie .=  '<li>'."\n".
108
            '<label for="mysql_database">Base de donn&eacute;es MySQL :</label>'.
76 jpm 109
            '<input id="mysql_database" type="text" size="30" name="config[PAP_BDD_NOM]" value="'.$config['PAP_BDD_NOM'].'" />'.
66 jpm 110
            '</li>'."\n";
111
$sortie .=  '<li>Nom et mot de passe de l\'utilisateur MySQL qui sera utilis&eacute; pour se connecter &agrave; votre base de donn&eacute;es.</li>'."\n";
112
$sortie .=  '<li>'."\n".
113
            '<label for="mysql_user">Non de l\'utilisateur MySQL :</label>'.
76 jpm 114
            '<input id="mysql_user" type="text" size="30" name="config[PAP_BDD_UTILISATEUR]" value="'.$config['PAP_BDD_UTILISATEUR'].'" />'.
66 jpm 115
            '</li>'."\n";
116
$sortie .=  '<li>'."\n".
117
            '<label for="mysql_password">Mot de passe MySQL :</label>'.
76 jpm 118
            '<input id="mysql_password" type="password" size="30" name="config[PAP_BDD_MOT_DE_PASSE]" value="'.$config['PAP_BDD_MOT_DE_PASSE'].'" />'.
66 jpm 119
            '</li>'."\n";
79 jpm 120
$sortie .=  '<li><h2>Configuration du FTP et des chemins d\'accès</h2></li>'."\n";
76 jpm 121
$sortie .=  '<li>'."\n".
122
            '<label for="ftp_serveur">Nom du serveur FTP :</label>'.
123
            '<input id="ftp_serveur" type="text" size="30" name="config[PAP_FTP_SERVEUR]" value="'.$config['PAP_FTP_SERVEUR'].'" />'.
124
            '</li>'."\n";
125
$sortie .=  '<li>'."\n".
126
            '<label for="ftp_port">N° du port d\'accès au serveur FTP :</label>'.
127
            '<input id="ftp_port" type="text" size="20" name="config[PAP_FTP_PORT]" value="'.$config['PAP_FTP_PORT'].'" />'.
128
            '</li>'."\n";
129
$sortie .=  '<li>'."\n".
130
            '<label for="ftp_utilisateur">Nom d\'utilisateur pour le serveur FTP :</label>'.
131
            '<input id="ftp_utilisateur" type="text" size="20" name="config[PAP_FTP_UTILISATEUR]" value="'.$config['PAP_FTP_UTILISATEUR'].'" />'.
132
            '</li>'."\n";
133
$sortie .=  '<li>'."\n".
134
            '<label for="ftp_mot_de_passe">Mot de passe de l\'utilisateur pour le serveur FTP :</label>'.
135
            '<input id="ftp_mot_de_passe" type="password" size="20" name="config[PAP_FTP_MOT_DE_PASSE]" value="'.$config['PAP_FTP_MOT_DE_PASSE'].'" />'.
136
            '</li>'."\n";
79 jpm 137
$sortie .=  '<li><h2>Chemin d\'accès au fichier <tt>papyrus.php</tt> : </h2></li>'."\n";
76 jpm 138
$sortie .=  '<li>Lorsque vous vous connecter par FTP sur le serveur où vous avez déposé les fichiers de Papyrus, le '.
139
            'dossier le plus haut auquel vous pouvez accéder dans l\'arborescence est la racine. Il vous faut donc '.
140
            'indiquez dans le champ ci-dessous le chemin depuis cette racine jusqu\'au dossier contenant le fichier '.
141
            '<tt>papyrus.php</tt>. Exemple : <i>www/</i><br /> Notes : Le chemin doit commmencer directement par le nom'.
142
            ' du premier dossier et se terminer par un slash (/) ou un anti-slash (\\) suivant le système d\''.
143
            'exploitation de votre serveur.</li>'."\n";
144
$sortie .=  '<li>'."\n".
145
            '<label for="ftp_racine">Racine dépôt FTP :</label>'.
146
            '<input id="ftp_racine" type="text" size="60" name="config[PAP_FTP_RACINE]" value="'.$config['PAP_FTP_RACINE'].'" />'.
147
            '</li>'."\n";
148
$sortie .=  '<li>Lorsque vous vous connecter par FTP sur le serveur, il existe un dossier racine spécifique où vous déposez '.
149
            'les fichiers html qui seront ensuite accessible depuis une adresse web. Si ce dossier racine est le '.
150
            'dossier dans lequel vous avez déposez les fichiers de Papyrus alors laissez le champ ci-dessous vide. Si '.
151
            'par contre, Papyrus est dans une sous-dossier de ce dossier indiquez son chemin. Exemple : <i>mon_papyrus/</i><br />'.
152
            'Notes : Le chemin doit commmencer directement par le nom du sous-dossier et se terminer par un slash '.
153
            '(/) ou un anti-slash (\\) suivant le système d\'exploitation de votre serveur.</li>'."\n";
154
$sortie .=  '<li>'."\n".
155
            '<label for="web_racine">Racine dépôt web :</label>'.
156
            '<input id="web_racine" type="text" size="60" name="config[PAP_CHEMIN_RACINE]" value="'.$config['PAP_CHEMIN_RACINE'].'" />'.
157
            '</li>'."\n";
79 jpm 158
$sortie .=  '<li><h2>Configuration d\'un administrateur de Papyrus</h2></li>'."\n";
76 jpm 159
$sortie .=  '<li>Tous les champs ci-dessous sont obligatoires.</li>'."\n";
160
$sortie .=  '<li>'."\n".
161
            '<label for="admin_prenom">Prénom :</label>'.
162
            '<input id="admin_prenom" type="text" size="30" name="bdd[ADMIN_PRENOM]" value="'.$bdd['ADMIN_PRENOM'].'" />'.
163
            '</li>'."\n";
164
$sortie .=  '<li>'."\n".
165
            '<label for="admin_nom">Nom :</label>'.
166
            '<input id="admin_nom" type="text" size="30" name="bdd[ADMIN_NOM]" value="'.$bdd['ADMIN_NOM'].'" />'.
167
            '</li>'."\n";
168
$sortie .=  '<li>'."\n".
169
            '<label for="admin_login">Login :</label>'.
170
            '<input id="admin_login" type="text" size="30" name="bdd[ADMIN_LOGIN]" value="'.$bdd['ADMIN_LOGIN'].'" />'.
171
            '</li>'."\n";
172
$sortie .=  '<li>'."\n".
173
            '<label for="admin_mail">Courriel :</label>'.
174
            '<input id="admin_mail" type="text" size="30" name="bdd[ADMIN_MAIL]" value="'.$bdd['ADMIN_MAIL'].'" />'.
175
            '</li>'."\n";
176
$sortie .=  '<li>'."\n".
177
            '<label for="admin_mdp_01">Mot de passe :</label>'.
178
            '<input id="admin_mdp_01" type="password" size="10" name="bdd[ADMIN_MDP_01]" value="'.$bdd['ADMIN_MDP_01'].'" />'.
179
            '</li>'."\n";
180
$sortie .=  '<li>'."\n".
181
            '<label for="admin_mdp_02">Taper à nouveau votre mot de passe :</label>'.
182
            '<input id="admin_mdp_02" type="password" size="10" name="bdd[ADMIN_MDP_02]" value="'.$bdd['ADMIN_MDP_02'].'" />'.
183
            '</li>'."\n";
184
$sortie .=  '<li>'."\n".
185
            '<label for="admin_i18n">Langue :</label>'.
79 jpm 186
            '<select id="admin_i18n" name="bdd[ADMIN_I18N]">'.
76 jpm 187
                '<option value="fr-FR" selected="selected">français</option>'.
188
            '</select>'.
189
            '</li>'."\n";
79 jpm 190
$sortie .=  '<li><h2>Configuration de la ré-écriture d\'URL</h2></li>'."\n";
66 jpm 191
$sortie .=  '<li>Le mode "redirection automatique" doit &ecirc;tre s&eacute;lectionn&eacute; uniquement si vous utilisez WikiNi avec la redirection d\'URL (si vous ne savez pas ce qu\'est la redirection d\'URL n\'activez pas cette option).</li>'."\n";
192
$sortie .=  '<li>'."\n".
193
            '<label for="rewrite_mode">Mode "redirection" :</label>'.
79 jpm 194
            '<input id="rewrite_mode" type="checkbox" name="config[PAP_URL_REECRITURE]" value="'.$config['PAP_URL_REECRITURE'].'" />'.
66 jpm 195
            'Activation'.
196
            '<input type="hidden" name="config[PAP_URL_REECRITURE]" value="0" />'.
197
            '</li>'."\n";
198
$sortie .=  '<li>'."\n".
199
            '<input type="submit" value="Continuer" />'.
200
            '</li>'."\n";
201
$sortie .= '      </ul>'."\n";
202
$sortie .= '    </form>';
203
 
204
// +------------------------------------------------------------------------------------------------------+
205
// |                                            PIED du PROGRAMME                                         |
206
// +------------------------------------------------------------------------------------------------------+
207
 
208
 
209
/* +--Fin du code ----------------------------------------------------------------------------------------+
210
*
211
* $Log: not supported by cvs2svn $
87 jpm 212
* Revision 1.4  2004/10/19 17:01:12  jpm
213
* Correction bogues.
214
*
80 jpm 215
* Revision 1.3  2004/10/19 16:47:28  jpm
216
* Transformation en fonction de l'appel de l'application.
217
*
79 jpm 218
* Revision 1.2  2004/10/19 15:59:18  jpm
219
* Ajout de la gestion des valeurs propre à Papyrus à insérer dans la base de données.
220
* Ajout des constantes FTP.
221
*
76 jpm 222
* Revision 1.1  2004/10/15 18:28:59  jpm
223
* Début appli installateur de Papyrus.
66 jpm 224
*
76 jpm 225
*
66 jpm 226
* +-- Fin du code ----------------------------------------------------------------------------------------+
227
*/
228
?>