Subversion Repositories Applications.papyrus

Rev

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

Rev 328 Rev 458
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
// | All rights reserved.                                                                                 |
11
// | All rights reserved.                                                                                 |
12
// | Redistribution and use in source and binary forms, with or without                                   |
12
// | Redistribution and use in source and binary forms, with or without                                   |
13
// | modification, are permitted provided that the following conditions                                   |
13
// | modification, are permitted provided that the following conditions                                   |
14
// | are met:                                                                                             |
14
// | are met:                                                                                             |
15
// | 1. Redistributions of source code must retain the above copyright                                    |
15
// | 1. Redistributions of source code must retain the above copyright                                    |
16
// | notice, this list of conditions and the following disclaimer.                                        |
16
// | notice, this list of conditions and the following disclaimer.                                        |
17
// | 2. Redistributions in binary form must reproduce the above copyright                                 |
17
// | 2. Redistributions in binary form must reproduce the above copyright                                 |
18
// | notice, this list of conditions and the following disclaimer in the                                  |
18
// | notice, this list of conditions and the following disclaimer in the                                  |
19
// | documentation and/or other materials provided with the distribution.                                 |
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                             |
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.                                |
21
// | derived from this software without specific prior written permission.                                |
22
// |                                                                                                      |
22
// |                                                                                                      |
23
// | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR                                 |
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                            |
24
// | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES                            |
25
// | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.                              |
25
// | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.                              |
26
// | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,                                     |
26
// | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,                                     |
27
// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT                             |
27
// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT                             |
28
// | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,                            |
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                                |
29
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY                                |
30
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT                                  |
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                             |
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.                                    |
32
// | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                                    |
33
// +------------------------------------------------------------------------------------------------------+
33
// +------------------------------------------------------------------------------------------------------+
34
// CVS : $Id: instal_preference.inc.php,v 1.9 2005-04-12 16:09:45 jpm Exp $
34
// CVS : $Id: instal_preference.inc.php,v 1.10 2005-09-23 14:20:23 florian Exp $
35
/**
35
/**
36
* Page d'initialisation de l'installation de Papyrus.
36
* Page d'initialisation de l'installation de Papyrus.
37
*
37
*
38
* Contenu de la page par défaut de l'installation de Papyrus.
38
* Contenu de la page par défaut de l'installation de Papyrus.
39
*
39
*
40
*@package Installateur
40
*@package Installateur
41
//Auteur original :
41
//Auteur original :
42
*@author        Hendrik MANS <hendrik@mans.de>
42
*@author        Hendrik MANS <hendrik@mans.de>
43
//Autres auteurs :
43
//Autres auteurs :
44
*@author        David DELON
44
*@author        David DELON
45
*@author        Patrick PAUL
45
*@author        Patrick PAUL
46
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
46
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
47
*@copyright     Tela-Botanica 2000-2004
47
*@copyright     Tela-Botanica 2000-2004
48
*@version       $Revision: 1.9 $ $Date: 2005-04-12 16:09:45 $
48
*@version       $Revision: 1.10 $ $Date: 2005-09-23 14:20:23 $
49
// +------------------------------------------------------------------------------------------------------+
49
// +------------------------------------------------------------------------------------------------------+
50
**/
50
**/
51
 
51
 
52
// +------------------------------------------------------------------------------------------------------+
52
// +------------------------------------------------------------------------------------------------------+
53
// |                                            ENTÊTE du PROGRAMME                                       |
53
// |                                            ENTÊTE du PROGRAMME                                       |
54
// +------------------------------------------------------------------------------------------------------+
54
// +------------------------------------------------------------------------------------------------------+
55
// Numéro de l'étape d'installation :
55
// Numéro de l'étape d'installation :
56
$num_etape = 1;
56
$num_etape = 1;
57
 
57
 
58
// Initialisation du tableau contenant les valeurs de configuration de la base de données
58
// Initialisation du tableau contenant les valeurs de configuration de la base de données
59
$tableau = array('ADMIN_PRENOM' => '', 'ADMIN_NOM' => '', 'ADMIN_LOGIN' => '', 'ADMIN_MAIL' => '', 'ADMIN_MDP_01' => '', 
59
$tableau = array('ADMIN_PRENOM' => '', 'ADMIN_NOM' => '', 'ADMIN_MAIL' => '', 'ADMIN_MDP_01' => '', 
60
                'ADMIN_MDP_02' => '', 'ADMIN_I18N' => '', 'PAP_URL' => '', 'PAP_CHEMIN_RACINE' => '', 'PAP_URL_REECRITURE' => '0');
60
                'ADMIN_MDP_02' => '', 'ADMIN_I18N' => '', 'PAP_URL' => '', 'PAP_CHEMIN_RACINE' => '', 'PAP_URL_REECRITURE' => '0');
61
foreach ($tableau as $cle => $val) {
61
foreach ($tableau as $cle => $val) {
62
    if (!empty($_POST['pref'][$cle])) {
62
    if (!empty($_POST['pref'][$cle])) {
63
        $pref[$cle] = $_POST['pref'][$cle];
63
        $pref[$cle] = $_POST['pref'][$cle];
64
    } else if (defined($cle)) {
64
    } else if (defined($cle)) {
65
        $pref[$cle] = constant($cle);
65
        $pref[$cle] = constant($cle);
66
    } else {
66
    } else {
67
        if ($cle == 'PAP_URL') {
67
        if ($cle == 'PAP_URL') {
68
            $pref[$cle] =   'http://'.$_SERVER['SERVER_NAME'].
68
            $pref[$cle] =   'http://'.$_SERVER['SERVER_NAME'].
69
                            ($_SERVER['SERVER_PORT'] != 80 ? ':'.$_SERVER['SERVER_PORT'] : '').
69
                            ($_SERVER['SERVER_PORT'] != 80 ? ':'.$_SERVER['SERVER_PORT'] : '').
70
                            $_SERVER['REQUEST_URI'];
70
                            $_SERVER['REQUEST_URI'];
71
        } else if ($cle == 'PAP_CHEMIN_RACINE') {
71
        } else if ($cle == 'PAP_CHEMIN_RACINE') {
72
            $pref[$cle] = INSTAL_CHEMIN_ABSOLU;
72
            $pref[$cle] = INSTAL_CHEMIN_ABSOLU;
73
        } else {
73
        } else {
74
            $pref[$cle] = '';
74
            $pref[$cle] = '';
75
        }
75
        }
76
    }
76
    }
77
}
77
}
78
 
78
 
79
// +------------------------------------------------------------------------------------------------------+
79
// +------------------------------------------------------------------------------------------------------+
80
// |                                          CORPS du PROGRAMME                                          |
80
// |                                          CORPS du PROGRAMME                                          |
81
// +------------------------------------------------------------------------------------------------------+
81
// +------------------------------------------------------------------------------------------------------+
82
 
82
 
83
// Affichage d'informations...
83
// Affichage d'informations...
84
$sortie .= '<p class="etape_numero"><strong>Etape n°'.$num_etape.' sur '.INSTAL_NBRE_ETAPE.'.</strong></p>'."\n";
84
$sortie .= '<br /><h1>Etape n°'.$num_etape.' sur '.INSTAL_NBRE_ETAPE.'.</h1>'."\n";
85
$sortie .= '<p>NOTE: Ce programme d\'installation va essayer de modifier les options de configurations dans le '.
85
$sortie .= '<p>NOTE: Ce programme d\'installation va essayer de modifier les options de configurations dans le '.
86
                'fichier <tt>pap_config.inc.php</tt>, situ&eacute; dans le r&eacute;pertoire <tt>configuration</tt> du réportoire '.
86
                'fichier <tt>pap_config.inc.php</tt>, situ&eacute; dans le r&eacute;pertoire <tt>configuration</tt> du réportoire '.
87
                '<tt>papyrus</tt>. Pour que cela fonctionne, veuillez vous assurez que votre serveur a les droits d\'acc&egrave;s '.
87
                '<tt>papyrus</tt>. Pour que cela fonctionne, veuillez vous assurez que votre serveur a les droits d\'acc&egrave;s '.
88
                'en &eacute;criture pour ce fichier. Si pour une raison quelconque vous ne pouvez pas faire &ccedil;a vous '.
88
                'en &eacute;criture pour ce fichier. Si pour une raison quelconque vous ne pouvez pas faire &ccedil;a vous '.
89
                'devrez modifier ce fichier manuellement (ce programme d\'installation vous dira comment).</p>'."\n";
89
                'devrez modifier ce fichier manuellement (ce programme d\'installation vous dira comment).</p><br />'."\n";
90
 
90
 
91
// Nous vérifions si nous sommes en phase de test du formulaire de config des préférences
91
// Nous vérifions si nous sommes en phase de test du formulaire de config des préférences
92
if ($_GET['installation'] == 'verif_pref' ) {
92
if ($_GET['installation'] == 'verif_pref' ) {
93
    $sortie_verif = '';
93
    $sortie_verif = '';
94
    $sortie_verif .= testerPresenceExtension();
94
    $sortie_verif .= testerPresenceExtension();
95
    // En mise à jour, nous n'affichons pas les champs pour saisir un administrateur
95
    // En mise à jour, nous n'affichons pas les champs pour saisir un administrateur
96
    if (!defined(INSTAL_VERSION_NOUVELLE_NOM)) {
96
    if (!defined(INSTAL_VERSION_NOUVELLE_NOM)) {
97
        // Nous vérifions que l'utilisateur à bien saisie les infos dans les champs du formulaire
97
        // Nous vérifions que l'utilisateur à bien saisie les infos dans les champs du formulaire
98
        if(empty($_POST['pref']['ADMIN_PRENOM'])) {
98
        if(empty($_POST['pref']['ADMIN_PRENOM'])) {
99
            $sortie_verif .= '<p class="erreur">Le champ "Prénom" ne doit pas être vide!</p>'."\n";
99
            $sortie_verif .= '<p class="erreur">Le champ "Prénom" ne doit pas être vide!</p>'."\n";
100
        }
100
        }
101
        if(empty($_POST['pref']['ADMIN_NOM'])) {
101
        if(empty($_POST['pref']['ADMIN_NOM'])) {
102
            $sortie_verif .= '<p class="erreur">Le champ "Nom" ne doit pas être vide!</p>'."\n";
102
            $sortie_verif .= '<p class="erreur">Le champ "Nom" ne doit pas être vide!</p>'."\n";
103
        }
103
        }
104
        if(empty($_POST['pref']['ADMIN_LOGIN'])) {
-
 
105
            $sortie_verif .= '<p class="erreur">Le champ "Login" ne doit pas être vide!</p>'."\n";
-
 
106
        }
-
 
107
        if(empty($_POST['pref']['ADMIN_MAIL'])) {
104
        if(empty($_POST['pref']['ADMIN_MAIL'])) {
108
            $sortie_verif .= '<p class="erreur">Le champ "Courriel" ne doit pas être vide!</p>'."\n";
105
            $sortie_verif .= '<p class="erreur">Le champ "Courriel" ne doit pas être vide!</p>'."\n";
109
        }
106
        }
110
        if(empty($_POST['pref']['ADMIN_MDP_01'])) {
107
        if(empty($_POST['pref']['ADMIN_MDP_01'])) {
111
            $sortie_verif .= '<p class="erreur">Le champ "Mot de passe" ne doit pas être vide!</p>'."\n";
108
            $sortie_verif .= '<p class="erreur">Le champ "Mot de passe" ne doit pas être vide!</p>'."\n";
112
        }
109
        }
113
        if($_POST['pref']['ADMIN_MDP_01'] != $_POST['pref']['ADMIN_MDP_02']) {
110
        if($_POST['pref']['ADMIN_MDP_01'] != $_POST['pref']['ADMIN_MDP_02']) {
114
            $sortie_verif .= '<p class="erreur">Le deux mots de passes saisis pour le compte administrateur sont différents!</p>'."\n";
111
            $sortie_verif .= '<p class="erreur">Le deux mots de passes saisis pour le compte administrateur sont différents!</p>'."\n";
115
        }
112
        }
116
    }
113
    }
117
}
114
}
118
 
115
 
119
// Gestion de l'affichage de sortie
116
// Gestion de l'affichage de sortie
120
if (!isset($sortie_verif) && empty($sortie_verif)) {
117
if (!isset($sortie_verif) && empty($sortie_verif)) {
121
    // Premier appel du fichier...
118
    // Premier appel du fichier...
122
    $sortie .= creerFormulaire($pref);
119
    $sortie .= creerFormulaire($pref);
123
    $sortie .= '<li><input type="submit" value="Tester" /></li>'."\n";
-
 
124
    $sortie .= '      </ul>'."\n";
120
    $sortie .= '      </ul>'."\n";
-
 
121
    $sortie .= '<input type="submit" value="Passer à l\'étape suivante" />'."\n";
125
    $sortie .= '    </form>';
122
    $sortie .= '</form>';
126
} else if (isset($sortie_verif) && !empty($sortie_verif)) {
123
} else if (isset($sortie_verif) && !empty($sortie_verif)) {
127
    // Vérification du fichier avec interuption...
124
    // Vérification du fichier avec interuption...
128
    $sortie .= $sortie_verif;
125
    $sortie .= $sortie_verif;
129
    $sortie .= creerFormulaire($pref);
126
    $sortie .= creerFormulaire($pref);
130
    $sortie .= '<li><input type="submit" value="Tester à nouveau" /></li>'."\n";
-
 
131
    $sortie .= '      </ul>'."\n";
127
    $sortie .= '      </ul>'."\n";
-
 
128
    $sortie .= '<input type="submit" value="Tester à nouveau" />'."\n";
132
    $sortie .= '    </form>';
129
    $sortie .= '    </form>';
133
} else if (isset($sortie_verif) && empty($sortie_verif)) {
130
} else if (isset($sortie_verif) && empty($sortie_verif)) {
134
    // Vérification du fichier sans interuption... passage à l'étape suivante
131
    // Vérification du fichier sans interuption... passage à l'étape suivante
135
    $sortie .= creerFormulaire($pref, true);
132
    $sortie .= creerFormulaire($pref, true);
136
    $sortie .= '      </ul>'."\n";
133
    $sortie .= '      </ul>'."\n";
137
    $sortie .= '    </form>';
134
    $sortie .= '    </form>';
138
    $sortie .= '    <p class="etape_info">A l\'&eacute;tape suivante, le programme d\'installation va essayer de configurer '.
135
    $sortie .= '    <p class="etape_info">La configuration est OK. A l\'&eacute;tape suivante, le programme d\'installation va essayer de configurer '.
139
                    'et créer la base de données.</p>'."\n";
136
                    'et créer la base de données.</p>'."\n";
140
    $sortie .= '    <form action="'.donnerUrlCourante().'?installation=form_bdd" method="POST" />'."\n";
137
    $sortie .= '    <form action="'.donnerUrlCourante().'?installation=form_bdd" method="post">'."\n";
141
    $sortie .= '      <input type="hidden" name="pref_serial" value="'.htmlentities(serialize($pref)).'" />'."\n";
138
    $sortie .= '      <input type="hidden" name="pref_serial" value="'.htmlentities(serialize($pref)).'" />'."\n";
142
    $sortie .= '      <input type="submit" value="Continuer" />'."\n";
139
    $sortie .= '      <input type="submit" value="Continuer" />'."\n";
143
    $sortie .= '    </form>'."\n";
140
    $sortie .= '    </form>'."\n";
144
}
141
}
145
// +------------------------------------------------------------------------------------------------------+
142
// +------------------------------------------------------------------------------------------------------+
146
// |                                            LISTE DES FONCTIONS                                       |
143
// |                                            LISTE DES FONCTIONS                                       |
147
// +------------------------------------------------------------------------------------------------------+
144
// +------------------------------------------------------------------------------------------------------+
148
 
145
 
149
// Création du formulaire de configuration de la base de donneés
146
// Création du formulaire de configuration de la base de donneés
150
function creerFormulaire($pref, $bln_lecture = false) {
147
function creerFormulaire($pref, $bln_lecture = false) {
151
    $disabled = '';
148
    $disabled = '';
152
    if ($bln_lecture) {
149
    if ($bln_lecture) {
153
        $disabled = ' disabled="disabled" ';
150
        $disabled = ' disabled="disabled" ';
154
    }
151
    }
155
    $sortie_form = '';
152
    $sortie_form = '';
156
    $sortie_form .= '    <form action="'.donnerUrlCourante().'?installation=verif_pref" method="post">';
153
    $sortie_form .= '    <form action="'.donnerUrlCourante().'?installation=verif_pref" method="post">'."\n";
157
    $sortie_form .= '      <ul>'."\n";
154
    $sortie_form .= '<ul>'."\n";
158
    // En mise à jour, nous n'affichons pas les champs pour saisir un administrateur
155
    // En mise à jour, nous n'affichons pas les champs pour saisir un administrateur
159
    if (!defined(INSTAL_VERSION_NOUVELLE_NOM)) {
156
    if (!defined(INSTAL_VERSION_NOUVELLE_NOM)) {
160
        $sortie_form .=  '<li><h2>Configuration d\'un administrateur de Papyrus</h2></li>'."\n";
157
        $sortie_form .= '<li><h2>Configuration d\'un administrateur de Papyrus</h2></li>'."\n";        
161
        $sortie_form .=  '<li>Tous les champs ci-dessous sont obligatoires.</li>'."\n";
158
	$sortie_form .=  '<li>Tous les champs ci-dessous sont obligatoires.</li>'."\n";
162
        $sortie_form .=  '<li>'."\n".
159
        $sortie_form .=  '<li>'."\n".
163
                    '<label for="admin_prenom">Prénom :</label>'.
160
                    '<label for="admin_prenom">Prénom :</label>'.
164
                    '<input id="admin_prenom"'.$disabled.'type="text" size="30" name="pref[ADMIN_PRENOM]" value="'.$pref['ADMIN_PRENOM'].'" />'.
161
                    '<input id="admin_prenom"'.$disabled.'type="text" size="30" name="pref[ADMIN_PRENOM]" value="'.$pref['ADMIN_PRENOM'].'" />'.
165
                    '</li>'."\n";
162
                    '</li>'."\n";
166
        $sortie_form .=  '<li>'."\n".
163
        $sortie_form .=  '<li>'."\n".
167
                    '<label for="admin_nom">Nom :</label>'.
164
                    '<label for="admin_nom">Nom :</label>'.
168
                    '<input id="admin_nom"'.$disabled.'type="text" size="30" name="pref[ADMIN_NOM]" value="'.$pref['ADMIN_NOM'].'" />'.
165
                    '<input id="admin_nom"'.$disabled.'type="text" size="30" name="pref[ADMIN_NOM]" value="'.$pref['ADMIN_NOM'].'" />'.
169
                    '</li>'."\n";
166
                    '</li>'."\n";
170
        $sortie_form .=  '<li>'."\n".
167
        $sortie_form .=  '<li>'."\n".
171
                    '<label for="admin_login">Login :</label>'.
-
 
172
                    '<input id="admin_login"'.$disabled.'type="text" size="30" name="pref[ADMIN_LOGIN]" value="'.$pref['ADMIN_LOGIN'].'" />'.
-
 
173
                    '</li>'."\n";
-
 
174
        $sortie_form .=  '<li>'."\n".
-
 
175
                    '<label for="admin_mail">Courriel :</label>'.
168
                    '<label for="admin_mail">Courriel :</label>'.
176
                    '<input id="admin_mail"'.$disabled.'type="text" size="30" name="pref[ADMIN_MAIL]" value="'.$pref['ADMIN_MAIL'].'" />'.
169
                    '<input id="admin_mail"'.$disabled.'type="text" size="30" name="pref[ADMIN_MAIL]" value="'.$pref['ADMIN_MAIL'].'" />'.
177
                    '</li>'."\n";
170
                    '</li>'."\n";
178
        $sortie_form .=  '<li>'."\n".
171
        $sortie_form .=  '<li>'."\n".
179
                    '<label for="admin_mdp_01">Mot de passe :</label>'.
172
                    '<label for="admin_mdp_01">Mot de passe :</label>'.
180
                    '<input id="admin_mdp_01"'.$disabled.'type="password" size="10" name="pref[ADMIN_MDP_01]" value="'.$pref['ADMIN_MDP_01'].'" />'.
173
                    '<input id="admin_mdp_01"'.$disabled.'type="password" size="10" name="pref[ADMIN_MDP_01]" value="'.$pref['ADMIN_MDP_01'].'" />'.
181
                    '</li>'."\n";
174
                    '</li>'."\n";
182
        $sortie_form .=  '<li>'."\n".
175
        $sortie_form .=  '<li>'."\n".
183
                    '<label for="admin_mdp_02">Taper à nouveau votre mot de passe :</label>'.
176
                    '<label for="admin_mdp_02">Taper à nouveau votre mot de passe :</label>'.
184
                    '<input id="admin_mdp_02"'.$disabled.'type="password" size="10" name="pref[ADMIN_MDP_02]" value="'.$pref['ADMIN_MDP_02'].'" />'.
177
                    '<input id="admin_mdp_02"'.$disabled.'type="password" size="10" name="pref[ADMIN_MDP_02]" value="'.$pref['ADMIN_MDP_02'].'" />'.
185
                    '</li>'."\n";
178
                    '</li>'."\n";
186
        $sortie_form .=  '<li>'."\n".
179
        $sortie_form .=  '<li>'."\n".
187
                    '<label for="admin_i18n">Langue :</label>'.
180
                    '<label for="admin_i18n">Langue :</label>'.
188
                    '<select id="admin_i18n"'.$disabled.'name="pref[ADMIN_I18N]">'.
181
                    '<select id="admin_i18n"'.$disabled.'name="pref[ADMIN_I18N]">'.
189
                        '<option value="fr-FR" selected="selected">français</option>'.
182
                        '<option value="fr-FR" selected="selected">français</option>'.
190
                    '</select>'.
183
                    '</select>'.
191
                    '</li>'."\n";
184
                    '</li>'."\n";
192
    }
185
    }
193
    $sortie_form .=  '<li><h2>Configuration de l\'URL</h2></li>'."\n";
186
    $sortie_form .=  '<li>&nbsp;</li>'."\n".'<li><h2>Configuration de l\'URL</h2></li>'."\n";
194
    $sortie_form .=  '<li>L\'URL courante dans la barre d\'adresse de votre navigateur devrait correspondre à la valeur '.
187
    $sortie_form .=  '<li>L\'URL courante dans la barre d\'adresse de votre navigateur devrait correspondre à la valeur '.
195
                'présente dans le champ ci-dessous. Si ce n\'est pas le cas, veuillez corriger la valeur ci-dessous.'."\n";
188
                'présente dans le champ ci-dessous. Si ce n\'est pas le cas, veuillez corriger la valeur ci-dessous.'."\n";
196
    $sortie_form .=  '<li>'."\n".
189
    $sortie_form .=  '<li>'."\n".
197
                '<label for="url_courante">URL courante :</label>'.
190
                '<label for="url_courante">URL courante :</label>'.
198
                '<input id="url_courante"'.$disabled.'type="text" size="60" name="pref[PAP_URL]" value="'.$pref['PAP_URL'].'" />'.
191
                '<input id="url_courante"'.$disabled.'type="text" size="60" name="pref[PAP_URL]" value="'.$pref['PAP_URL'].'" />'.
199
                '</li>'."\n";
192
                '</li>'."\n";
200
    $sortie_form .= '<li>Le mode "redirection automatique" doit &ecirc;tre s&eacute;lectionn&eacute; uniquement si '.
193
    $sortie_form .= '<li>Le mode "redirection automatique" doit &ecirc;tre s&eacute;lectionn&eacute; uniquement si '.
201
                    'vous utilisez Papyrus avec la redirection d\'URL (si vous ne savez pas ce qu\'est la redirection d\'URL '.
194
                    'vous utilisez Papyrus avec la redirection d\'URL (si vous ne savez pas ce qu\'est la redirection d\'URL '.
202
                    'n\'activez pas cette option).</li>'."\n";
195
                    'n\'activez pas cette option).</li>'."\n";
203
    $sortie_form .=  '<li>'."\n".
196
    $sortie_form .=  '<li>'."\n".
204
                '<label for="rewrite_mode">Mode "redirection" :</label>'.
197
                '<label for="rewrite_mode">Mode "redirection" :</label>'.
205
                '<input id="rewrite_mode"'.$disabled.'type="checkbox" name="pref[PAP_URL_REECRITURE]" value="1" />'.
198
                '<input id="rewrite_mode"'.$disabled.'type="checkbox" name="pref[PAP_URL_REECRITURE]" value="1" />'.
206
                'Activation'.'</li>'."\n";
199
                'Activation'.'</li>'."\n";
207
    $sortie_form .= '<li>Le champ suivant devrait contenir le chemin d\'accès absolu vers le fichier <tt>papyrus.php</tt> '.
200
    $sortie_form .= '<li>Le champ suivant devrait contenir le chemin d\'accès absolu vers le fichier <tt>papyrus.php</tt> '.
208
                    'sur le serveur où sont déposés les fichiers de Papyrus.</li>'."\n";
201
                    'sur le serveur où sont déposés les fichiers de Papyrus.</li>'."\n";
209
    $sortie_form .=  '<li>'."\n".
202
    $sortie_form .=  '<li>'."\n".
210
                '<label for="web_racine">Dossier de <tt>papyrus.php</tt> :</label>'.
203
                '<label for="web_racine">Dossier de <tt>papyrus.php</tt> :</label>'.
211
                '<input id="web_racine"'.$disabled.'type="text" size="60" name="pref[PAP_CHEMIN_RACINE]" value="'.$pref['PAP_CHEMIN_RACINE'].'" />'.
204
                '<input id="web_racine"'.$disabled.'type="text" size="60" name="pref[PAP_CHEMIN_RACINE]" value="'.$pref['PAP_CHEMIN_RACINE'].'" />'.
212
                '</li>'."\n";
205
                '</li>'."\n";
213
    
206
    
214
    return $sortie_form;
207
    return $sortie_form;
215
}
208
}
216
 
209
 
217
// Vérification des variables d'environnement de PHP.
210
// Vérification des variables d'environnement de PHP.
218
function testerPresenceExtension() {
211
function testerPresenceExtension() {
219
    $message = '';
212
    $message = '';
220
    $phrase_deb = '<p class="erreur">Pour fonctionner Papyrus à besoin que l\'extension PHP : ';
213
    $phrase_deb = '<p class="erreur">Pour fonctionner Papyrus à besoin que l\'extension PHP : ';
221
    $phrase_fin = 'soit installée sur le serveur.<br /> Sans cette extension vous ne pourrez pas installer Papyrus !</p>';
214
    $phrase_fin = 'soit installée sur le serveur.<br /> Sans cette extension vous ne pourrez pas installer Papyrus !</p>';
222
    // Nous avons besoin de quelques extensions
215
    // Nous avons besoin de quelques extensions
223
    if (! extension_loaded('mysql')) {
216
    if (! extension_loaded('mysql')) {
224
        $message .= $phrase_deb.'MYSQL'.$phrase_fin;
217
        $message .= $phrase_deb.'MYSQL'.$phrase_fin;
225
    }
218
    }
226
    if (! extension_loaded('ftp')) {
219
    if (! extension_loaded('ftp')) {
227
        $message .= $phrase_deb.'FTP'.$phrase_fin;
220
        $message .= $phrase_deb.'FTP'.$phrase_fin;
228
    }
221
    }
229
    if (! extension_loaded('gd')) {
222
    if (! extension_loaded('gd')) {
230
        $message .= $phrase_deb.'GD'.$phrase_fin;
223
        $message .= $phrase_deb.'GD'.$phrase_fin;
231
    }
224
    }
232
    return $message;
225
    return $message;
233
}
226
}
234
// +------------------------------------------------------------------------------------------------------+
227
// +------------------------------------------------------------------------------------------------------+
235
// |                                            PIED du PROGRAMME                                         |
228
// |                                            PIED du PROGRAMME                                         |
236
// +------------------------------------------------------------------------------------------------------+
229
// +------------------------------------------------------------------------------------------------------+
237
 
230
 
238
 
231
 
239
/* +--Fin du code ----------------------------------------------------------------------------------------+
232
/* +--Fin du code ----------------------------------------------------------------------------------------+
240
*
233
*
241
* $Log: not supported by cvs2svn $
234
* $Log: not supported by cvs2svn $
-
 
235
* Revision 1.9  2005/04/12 16:09:45  jpm
-
 
236
* Amélioration de la gestion de la constante de redirection des urls et de la gestion des constantes de type entier et booléen.
-
 
237
*
242
* Revision 1.8  2004/10/27 11:43:32  jpm
238
* Revision 1.8  2004/10/27 11:43:32  jpm
243
* Correction bogues diff mise à jour / installation.
239
* Correction bogues diff mise à jour / installation.
244
*
240
*
245
* Revision 1.7  2004/10/25 10:22:48  jpm
241
* Revision 1.7  2004/10/25 10:22:48  jpm
246
* Correction de quelques bogues, ajouts d'explications pour l'utilisateur et modification des styles CSS.
242
* Correction de quelques bogues, ajouts d'explications pour l'utilisateur et modification des styles CSS.
247
*
243
*
248
* Revision 1.6  2004/10/22 17:23:04  jpm
244
* Revision 1.6  2004/10/22 17:23:04  jpm
249
* Simplification del'installation de Papyrus.
245
* Simplification del'installation de Papyrus.
250
*
246
*
251
* Revision 1.5  2004/10/22 09:07:18  jpm
247
* Revision 1.5  2004/10/22 09:07:18  jpm
252
* Début simplification installateur.
248
* Début simplification installateur.
253
*
249
*
254
* Revision 1.4  2004/10/19 17:01:12  jpm
250
* Revision 1.4  2004/10/19 17:01:12  jpm
255
* Correction bogues.
251
* Correction bogues.
256
*
252
*
257
* Revision 1.3  2004/10/19 16:47:28  jpm
253
* Revision 1.3  2004/10/19 16:47:28  jpm
258
* Transformation en fonction de l'appel de l'application.
254
* Transformation en fonction de l'appel de l'application.
259
*
255
*
260
* Revision 1.2  2004/10/19 15:59:18  jpm
256
* Revision 1.2  2004/10/19 15:59:18  jpm
261
* Ajout de la gestion des valeurs propre à Papyrus à insérer dans la base de données.
257
* Ajout de la gestion des valeurs propre à Papyrus à insérer dans la base de données.
262
* Ajout des constantes FTP.
258
* Ajout des constantes FTP.
263
*
259
*
264
* Revision 1.1  2004/10/15 18:28:59  jpm
260
* Revision 1.1  2004/10/15 18:28:59  jpm
265
* Début appli installateur de Papyrus.
261
* Début appli installateur de Papyrus.
266
*
262
*
267
*
263
*
268
* +-- Fin du code ----------------------------------------------------------------------------------------+
264
* +-- Fin du code ----------------------------------------------------------------------------------------+
269
*/
265
*/
270
?>
266
?>