Subversion Repositories Applications.papyrus

Rev

Rev 1021 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1021 Rev 2150
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.12 2006-10-06 15:23:00 florian Exp $
34
// CVS : $Id: instal_preference.inc.php,v 1.12 2006-10-06 15:23:00 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.12 $ $Date: 2006-10-06 15:23:00 $
48
*@version       $Revision: 1.12 $ $Date: 2006-10-06 15:23:00 $
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_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
        if ($cle == 'PAP_CHEMIN_RACINE') $pref[$cle] = INSTAL_CHEMIN_ABSOLU;
66
        if ($cle == 'PAP_CHEMIN_RACINE') $pref[$cle] = INSTAL_CHEMIN_ABSOLU;
67
    } else {
67
    } else {
68
        if ($cle == 'PAP_URL') {
68
        if ($cle == 'PAP_URL') {
69
            $pref[$cle] =   'http://'.$_SERVER['SERVER_NAME'].
69
            $pref[$cle] =   'http://'.$_SERVER['SERVER_NAME'].
70
                            ($_SERVER['SERVER_PORT'] != 80 ? ':'.$_SERVER['SERVER_PORT'] : '').
70
                            ($_SERVER['SERVER_PORT'] != 80 ? ':'.$_SERVER['SERVER_PORT'] : '').
71
                            $_SERVER['REQUEST_URI'];
71
                            $_SERVER['REQUEST_URI'];
72
        } else if ($cle == 'PAP_CHEMIN_RACINE') {
72
        } else if ($cle == 'PAP_CHEMIN_RACINE') {
73
            $pref[$cle] = INSTAL_CHEMIN_ABSOLU;
73
            $pref[$cle] = INSTAL_CHEMIN_ABSOLU;
74
        } else {
74
        } else {
75
            $pref[$cle] = '';
75
            $pref[$cle] = '';
76
        }
76
        }
77
    }
77
    }
78
}
78
}
79
 
79
 
80
// +------------------------------------------------------------------------------------------------------+
80
// +------------------------------------------------------------------------------------------------------+
81
// |                                          CORPS du PROGRAMME                                          |
81
// |                                          CORPS du PROGRAMME                                          |
82
// +------------------------------------------------------------------------------------------------------+
82
// +------------------------------------------------------------------------------------------------------+
83
 
83
 
84
// Affichage d'informations...
84
// Affichage d'informations...
85
$sortie .= '<br /><h1>Etape n°'.$num_etape.' sur '.INSTAL_NBRE_ETAPE.'.</h1>'."\n";
85
$sortie .= '<br /><h1>Etape n°'.$num_etape.' sur '.INSTAL_NBRE_ETAPE.'.</h1>'."\n";
86
$sortie .= '<p>NOTE: Ce programme d\'installation va essayer de modifier les options de configurations dans le '.
86
$sortie .= '<p>NOTE: Ce programme d\'installation va essayer de modifier les options de configurations dans le '.
87
                'fichier <tt>pap_config.inc.php</tt>, situ&eacute; dans le r&eacute;pertoire <tt>configuration</tt> du réportoire '.
87
                'fichier <tt>pap_config.inc.php</tt>, situ&eacute; dans le r&eacute;pertoire <tt>configuration</tt> du réportoire '.
88
                '<tt>papyrus</tt>. Pour que cela fonctionne, veuillez vous assurez que votre serveur a les droits d\'acc&egrave;s '.
88
                '<tt>papyrus</tt>. Pour que cela fonctionne, veuillez vous assurez que votre serveur a les droits d\'acc&egrave;s '.
89
                'en &eacute;criture pour ce fichier. Si pour une raison quelconque vous ne pouvez pas faire &ccedil;a vous '.
89
                'en &eacute;criture pour ce fichier. Si pour une raison quelconque vous ne pouvez pas faire &ccedil;a vous '.
90
                'devrez modifier ce fichier manuellement (ce programme d\'installation vous dira comment).</p><br />'."\n";
90
                'devrez modifier ce fichier manuellement (ce programme d\'installation vous dira comment).</p><br />'."\n";
91
 
91
 
92
// Nous vérifions si nous sommes en phase de test du formulaire de config des préférences
92
// Nous vérifions si nous sommes en phase de test du formulaire de config des préférences
93
if ($_GET['installation'] == 'verif_pref' ) {
93
if ($_GET['installation'] == 'verif_pref' ) {
94
    $sortie_verif = '';
94
    $sortie_verif = '';
95
    $sortie_verif .= testerPresenceExtension();
95
    $sortie_verif .= testerPresenceExtension();
96
    // En mise à jour, nous n'affichons pas les champs pour saisir un administrateur
96
    // En mise à jour, nous n'affichons pas les champs pour saisir un administrateur
97
    if (!defined(INSTAL_VERSION_NOUVELLE_NOM)) {
97
    if (!defined(INSTAL_VERSION_NOUVELLE_NOM)) {
98
        // Nous vérifions que l'utilisateur à bien saisie les infos dans les champs du formulaire
98
        // Nous vérifions que l'utilisateur à bien saisie les infos dans les champs du formulaire
99
        if(empty($_POST['pref']['ADMIN_PRENOM'])) {
99
        if(empty($_POST['pref']['ADMIN_PRENOM'])) {
100
            $sortie_verif .= '<p class="erreur">Le champ "Prénom" ne doit pas être vide!</p>'."\n";
100
            $sortie_verif .= '<p class="erreur">Le champ "Prénom" ne doit pas être vide!</p>'."\n";
101
        }
101
        }
102
        if(empty($_POST['pref']['ADMIN_NOM'])) {
102
        if(empty($_POST['pref']['ADMIN_NOM'])) {
103
            $sortie_verif .= '<p class="erreur">Le champ "Nom" ne doit pas être vide!</p>'."\n";
103
            $sortie_verif .= '<p class="erreur">Le champ "Nom" ne doit pas être vide!</p>'."\n";
104
        }
104
        }
105
        if(empty($_POST['pref']['ADMIN_MAIL'])) {
105
        if(empty($_POST['pref']['ADMIN_MAIL'])) {
106
            $sortie_verif .= '<p class="erreur">Le champ "Courriel" ne doit pas être vide!</p>'."\n";
106
            $sortie_verif .= '<p class="erreur">Le champ "Courriel" ne doit pas être vide!</p>'."\n";
107
        }
107
        }
108
        if(empty($_POST['pref']['ADMIN_MDP_01'])) {
108
        if(empty($_POST['pref']['ADMIN_MDP_01'])) {
109
            $sortie_verif .= '<p class="erreur">Le champ "Mot de passe" ne doit pas être vide!</p>'."\n";
109
            $sortie_verif .= '<p class="erreur">Le champ "Mot de passe" ne doit pas être vide!</p>'."\n";
110
        }
110
        }
111
        if($_POST['pref']['ADMIN_MDP_01'] != $_POST['pref']['ADMIN_MDP_02']) {
111
        if($_POST['pref']['ADMIN_MDP_01'] != $_POST['pref']['ADMIN_MDP_02']) {
112
            $sortie_verif .= '<p class="erreur">Le deux mots de passes saisis pour le compte administrateur sont différents!</p>'."\n";
112
            $sortie_verif .= '<p class="erreur">Le deux mots de passes saisis pour le compte administrateur sont différents!</p>'."\n";
113
        }
113
        }
114
    }
114
    }
115
}
115
}
116
 
116
 
117
// Gestion de l'affichage de sortie
117
// Gestion de l'affichage de sortie
118
if (!isset($sortie_verif) && empty($sortie_verif)) {
118
if (!isset($sortie_verif) && empty($sortie_verif)) {
119
    // Premier appel du fichier...
119
    // Premier appel du fichier...
120
    $sortie .= creerFormulaire($pref);
120
    $sortie .= creerFormulaire($pref);
121
    $sortie .= '      </ul>'."\n";
121
    $sortie .= '      </ul>'."\n";
122
    $sortie .= '<input type="submit" value="Passer à l\'étape suivante" />'."\n";
122
    $sortie .= '<input type="submit" value="Passer à l\'étape suivante" />'."\n";
123
    $sortie .= '</form>';
123
    $sortie .= '</form>';
124
} else if (isset($sortie_verif) && !empty($sortie_verif)) {
124
} else if (isset($sortie_verif) && !empty($sortie_verif)) {
125
    // Vérification du fichier avec interuption...
125
    // Vérification du fichier avec interuption...
126
    $sortie .= $sortie_verif;
126
    $sortie .= $sortie_verif;
127
    $sortie .= creerFormulaire($pref);
127
    $sortie .= creerFormulaire($pref);
128
    $sortie .= '      </ul>'."\n";
128
    $sortie .= '      </ul>'."\n";
129
    $sortie .= '<input type="submit" value="Tester à nouveau" />'."\n";
129
    $sortie .= '<input type="submit" value="Tester à nouveau" />'."\n";
130
    $sortie .= '    </form>';
130
    $sortie .= '    </form>';
131
} else if (isset($sortie_verif) && empty($sortie_verif)) {
131
} else if (isset($sortie_verif) && empty($sortie_verif)) {
132
    // Vérification du fichier sans interuption... passage à l'étape suivante
132
    // Vérification du fichier sans interuption... passage à l'étape suivante
133
    $sortie .= creerFormulaire($pref, true);
133
    $sortie .= creerFormulaire($pref, true);
134
    $sortie .= '      </ul>'."\n";
134
    $sortie .= '      </ul>'."\n";
135
    $sortie .= '    </form>';
135
    $sortie .= '    </form>';
136
    $sortie .= '    <br /><p class="etape_info">La configuration est OK. A l\'&eacute;tape suivante, le programme d\'installation va essayer de configurer '.
136
    $sortie .= '    <br /><p class="etape_info">La configuration est OK. A l\'&eacute;tape suivante, le programme d\'installation va essayer de configurer '.
137
                    'et créer la base de données.</p>'."\n";
137
                    'et créer la base de données.</p>'."\n";
138
    $sortie .= '    <form style="clear:both;" action="'.donnerUrlCourante().'?installation=form_bdd" method="post">'."\n";
138
    $sortie .= '    <form style="clear:both;" action="'.donnerUrlCourante().'?installation=form_bdd" method="post">'."\n";
139
    $sortie .= '      <input type="hidden" name="pref_serial" value="'.htmlentities(serialize($pref)).'" />'."\n";
139
    $sortie .= '      <input type="hidden" name="pref_serial" value="'.htmlentities(serialize($pref)).'" />'."\n";
140
    $sortie .= '      <input type="submit" value="Continuer" />'."\n";
140
    $sortie .= '      <input type="submit" value="Continuer" />'."\n";
141
    $sortie .= '    </form>'."\n";
141
    $sortie .= '    </form>'."\n";
142
}
142
}
143
// +------------------------------------------------------------------------------------------------------+
143
// +------------------------------------------------------------------------------------------------------+
144
// |                                            LISTE DES FONCTIONS                                       |
144
// |                                            LISTE DES FONCTIONS                                       |
145
// +------------------------------------------------------------------------------------------------------+
145
// +------------------------------------------------------------------------------------------------------+
146
 
146
 
147
// Création du formulaire de configuration de la base de donneés
147
// Création du formulaire de configuration de la base de donneés
148
function creerFormulaire($pref, $bln_lecture = false) {
148
function creerFormulaire($pref, $bln_lecture = false) {
149
    $disabled = '';
149
    $disabled = '';
150
    if ($bln_lecture) {
150
    if ($bln_lecture) {
151
        $disabled = ' disabled="disabled" ';
151
        $disabled = ' disabled="disabled" ';
152
    }
152
    }
153
    $sortie_form = '';
153
    $sortie_form = '';
154
    $sortie_form .= '    <form action="'.donnerUrlCourante().'?installation=verif_pref" method="post">'."\n";
154
    $sortie_form .= '    <form action="'.donnerUrlCourante().'?installation=verif_pref" method="post">'."\n";
155
    $sortie_form .= '<ul>'."\n";
155
    $sortie_form .= '<ul>'."\n";
156
    // En mise à jour, nous n'affichons pas les champs pour saisir un administrateur
156
    // En mise à jour, nous n'affichons pas les champs pour saisir un administrateur
157
    if (!defined(INSTAL_VERSION_NOUVELLE_NOM)) {
157
    if (!defined(INSTAL_VERSION_NOUVELLE_NOM)) {
158
        $sortie_form .= '<li><h2>Configuration d\'un administrateur de Papyrus</h2></li>'."\n";        
158
        $sortie_form .= '<li><h2>Configuration d\'un administrateur de Papyrus</h2></li>'."\n";        
159
	$sortie_form .=  '<li>Tous les champs ci-dessous sont obligatoires.</li>'."\n";
159
	$sortie_form .=  '<li>Tous les champs ci-dessous sont obligatoires.</li>'."\n";
160
        $sortie_form .=  '<li>'."\n".
160
        $sortie_form .=  '<li>'."\n".
161
                    '<label for="admin_prenom">Prénom :</label>'.
161
                    '<label for="admin_prenom">Prénom :</label>'.
162
                    '<input id="admin_prenom"'.$disabled.'type="text" size="30" name="pref[ADMIN_PRENOM]" value="'.$pref['ADMIN_PRENOM'].'" />'.
162
                    '<input id="admin_prenom"'.$disabled.'type="text" size="30" name="pref[ADMIN_PRENOM]" value="'.$pref['ADMIN_PRENOM'].'" />'.
163
                    '</li>'."\n";
163
                    '</li>'."\n";
164
        $sortie_form .=  '<li>'."\n".
164
        $sortie_form .=  '<li>'."\n".
165
                    '<label for="admin_nom">Nom :</label>'.
165
                    '<label for="admin_nom">Nom :</label>'.
166
                    '<input id="admin_nom"'.$disabled.'type="text" size="30" name="pref[ADMIN_NOM]" value="'.$pref['ADMIN_NOM'].'" />'.
166
                    '<input id="admin_nom"'.$disabled.'type="text" size="30" name="pref[ADMIN_NOM]" value="'.$pref['ADMIN_NOM'].'" />'.
167
                    '</li>'."\n";
167
                    '</li>'."\n";
168
        $sortie_form .=  '<li>'."\n".
168
        $sortie_form .=  '<li>'."\n".
169
                    '<label for="admin_mail">Courriel :</label>'.
169
                    '<label for="admin_mail">Courriel :</label>'.
170
                    '<input id="admin_mail"'.$disabled.'type="text" size="30" name="pref[ADMIN_MAIL]" value="'.$pref['ADMIN_MAIL'].'" />'.
170
                    '<input id="admin_mail"'.$disabled.'type="text" size="30" name="pref[ADMIN_MAIL]" value="'.$pref['ADMIN_MAIL'].'" />'.
171
                    '</li>'."\n";
171
                    '</li>'."\n";
172
        $sortie_form .=  '<li>'."\n".
172
        $sortie_form .=  '<li>'."\n".
173
                    '<label for="admin_mdp_01">Mot de passe :</label>'.
173
                    '<label for="admin_mdp_01">Mot de passe :</label>'.
174
                    '<input id="admin_mdp_01"'.$disabled.'type="password" size="10" name="pref[ADMIN_MDP_01]" value="'.$pref['ADMIN_MDP_01'].'" />'.
174
                    '<input id="admin_mdp_01"'.$disabled.'type="password" size="10" name="pref[ADMIN_MDP_01]" value="'.$pref['ADMIN_MDP_01'].'" />'.
175
                    '</li>'."\n";
175
                    '</li>'."\n";
176
        $sortie_form .=  '<li>'."\n".
176
        $sortie_form .=  '<li>'."\n".
177
                    '<label for="admin_mdp_02">Taper à nouveau votre mot de passe :</label>'.
177
                    '<label for="admin_mdp_02">Taper à nouveau votre mot de passe :</label>'.
178
                    '<input id="admin_mdp_02"'.$disabled.'type="password" size="10" name="pref[ADMIN_MDP_02]" value="'.$pref['ADMIN_MDP_02'].'" />'.
178
                    '<input id="admin_mdp_02"'.$disabled.'type="password" size="10" name="pref[ADMIN_MDP_02]" value="'.$pref['ADMIN_MDP_02'].'" />'.
179
                    '</li>'."\n";
179
                    '</li>'."\n";
180
        $sortie_form .=  '<li>'."\n".
180
        $sortie_form .=  '<li>'."\n".
181
                    '<label for="admin_i18n">Langue :</label>'.
181
                    '<label for="admin_i18n">Langue :</label>'.
182
                    '<select id="admin_i18n"'.$disabled.'name="pref[ADMIN_I18N]">'.
182
                    '<select id="admin_i18n"'.$disabled.'name="pref[ADMIN_I18N]">'.
183
                        '<option value="fr-FR" selected="selected">français</option>'.
183
                        '<option value="fr-FR" selected="selected">français</option>'.
184
                    '</select>'.
184
                    '</select>'.
185
                    '</li>'."\n";
185
                    '</li>'."\n";
186
    }
186
    }
187
    $sortie_form .=  '<li>&nbsp;</li>'."\n".'<li><h2>Configuration de l\'URL</h2></li>'."\n";
187
    $sortie_form .=  '<li>&nbsp;</li>'."\n".'<li><h2>Configuration de l\'URL</h2></li>'."\n";
188
    $sortie_form .=  '<li>L\'URL courante dans la barre d\'adresse de votre navigateur devrait correspondre à la valeur '.
188
    $sortie_form .=  '<li>L\'URL courante dans la barre d\'adresse de votre navigateur devrait correspondre à la valeur '.
189
                'présente dans le champ ci-dessous. Si ce n\'est pas le cas, veuillez corriger la valeur ci-dessous.'."\n";
189
                'présente dans le champ ci-dessous. Si ce n\'est pas le cas, veuillez corriger la valeur ci-dessous.'."\n";
190
    $sortie_form .=  '<li>'."\n".
190
    $sortie_form .=  '<li>'."\n".
191
                '<label for="url_courante">URL courante :</label>'.
191
                '<label for="url_courante">URL courante :</label>'.
192
                '<input id="url_courante"'.$disabled.'type="text" size="60" name="pref[PAP_URL]" value="'.$pref['PAP_URL'].'" />'.
192
                '<input id="url_courante"'.$disabled.'type="text" size="60" name="pref[PAP_URL]" value="'.$pref['PAP_URL'].'" />'.
193
                '</li>'."\n";
193
                '</li>'."\n";
194
    $sortie_form .= '<li>Le mode "redirection automatique" doit &ecirc;tre s&eacute;lectionn&eacute; uniquement si '.
194
    $sortie_form .= '<li>Le mode "redirection automatique" doit &ecirc;tre s&eacute;lectionn&eacute; uniquement si '.
195
                    'vous utilisez Papyrus avec la redirection d\'URL (si vous ne savez pas ce qu\'est la redirection d\'URL '.
195
                    'vous utilisez Papyrus avec la redirection d\'URL (si vous ne savez pas ce qu\'est la redirection d\'URL '.
196
                    'n\'activez pas cette option).</li>'."\n";
196
                    'n\'activez pas cette option).</li>'."\n";
197
    $sortie_form .=  '<li>'."\n".
197
    $sortie_form .=  '<li>'."\n".
198
                '<label for="rewrite_mode">Mode "redirection" :</label>'.
198
                '<label for="rewrite_mode">Mode "redirection" :</label>'.
199
                '<input id="rewrite_mode"'.$disabled.'type="checkbox" name="pref[PAP_URL_REECRITURE]" value="1" />'.
199
                '<input id="rewrite_mode"'.$disabled.'type="checkbox" name="pref[PAP_URL_REECRITURE]" value="1" />'.
200
                'Activation'.'</li>'."\n";
200
                'Activation'.'</li>'."\n";
201
    $sortie_form .= '<li>Le champ suivant devrait contenir le chemin d\'accès absolu vers le fichier <tt>papyrus.php</tt> '.
201
    $sortie_form .= '<li>Le champ suivant devrait contenir le chemin d\'accès absolu vers le fichier <tt>papyrus.php</tt> '.
202
                    'sur le serveur où sont déposés les fichiers de Papyrus.</li>'."\n";
202
                    'sur le serveur où sont déposés les fichiers de Papyrus.</li>'."\n";
203
    $sortie_form .=  '<li>'."\n".
203
    $sortie_form .=  '<li>'."\n".
204
                '<label for="web_racine">Dossier de <tt>papyrus.php</tt> :</label>'.
204
                '<label for="web_racine">Dossier de <tt>papyrus.php</tt> :</label>'.
205
                '<input id="web_racine"'.$disabled.'type="text" size="60" name="pref[PAP_CHEMIN_RACINE]" value="'.$pref['PAP_CHEMIN_RACINE'].'" />'.
205
                '<input id="web_racine"'.$disabled.'type="text" size="60" name="pref[PAP_CHEMIN_RACINE]" value="'.$pref['PAP_CHEMIN_RACINE'].'" />'.
206
                '</li>'."\n";
206
                '</li>'."\n";
207
    
207
    
208
    return $sortie_form;
208
    return $sortie_form;
209
}
209
}
210
 
210
 
211
// Vérification des variables d'environnement de PHP.
211
// Vérification des variables d'environnement de PHP.
212
function testerPresenceExtension() {
212
function testerPresenceExtension() {
213
    $message = '';
213
    $message = '';
214
    $phrase_deb = '<p class="erreur">Pour fonctionner Papyrus à besoin que l\'extension PHP : ';
214
    $phrase_deb = '<p class="erreur">Pour fonctionner Papyrus à besoin que l\'extension PHP : ';
215
    $phrase_fin = 'soit installée sur le serveur.<br /> Sans cette extension vous ne pourrez pas installer Papyrus !</p>';
215
    $phrase_fin = 'soit installée sur le serveur.<br /> Sans cette extension vous ne pourrez pas installer Papyrus !</p>';
216
    // Nous avons besoin de quelques extensions
216
    // Nous avons besoin de quelques extensions
217
    if (! extension_loaded('mysql')) {
217
    if (! extension_loaded('mysql')) {
218
        $message .= $phrase_deb.'MYSQL'.$phrase_fin;
218
        $message .= $phrase_deb.'MYSQL'.$phrase_fin;
219
    }
219
    }
220
    if (! extension_loaded('ftp')) {
220
    if (! extension_loaded('ftp')) {
221
        $message .= $phrase_deb.'FTP'.$phrase_fin;
221
        $message .= $phrase_deb.'FTP'.$phrase_fin;
222
    }
222
    }
223
    if (! extension_loaded('gd')) {
223
    if (! extension_loaded('gd')) {
224
        $message .= $phrase_deb.'GD'.$phrase_fin;
224
        $message .= $phrase_deb.'GD'.$phrase_fin;
225
    }
225
    }
226
    return $message;
226
    return $message;
227
}
227
}
228
// +------------------------------------------------------------------------------------------------------+
228
// +------------------------------------------------------------------------------------------------------+
229
// |                                            PIED du PROGRAMME                                         |
229
// |                                            PIED du PROGRAMME                                         |
230
// +------------------------------------------------------------------------------------------------------+
230
// +------------------------------------------------------------------------------------------------------+
231
 
231
 
232
 
232
 
233
/* +--Fin du code ----------------------------------------------------------------------------------------+
233
/* +--Fin du code ----------------------------------------------------------------------------------------+
234
*
234
*
235
* $Log: not supported by cvs2svn $
235
* $Log: instal_preference.inc.php,v $
-
 
236
* Revision 1.12  2006-10-06 15:23:00  florian
-
 
237
* amelioration graphique de l'installateur
-
 
238
*
236
* Revision 1.11  2006/10/05 15:14:18  alexandre_tb
239
* Revision 1.11  2006/10/05 15:14:18  alexandre_tb
237
* Mise en place du chemin par défaut
240
* Mise en place du chemin par défaut
238
*
241
*
239
* Revision 1.10  2005/09/23 14:20:23  florian
242
* Revision 1.10  2005/09/23 14:20:23  florian
240
* nouvel habillage installateur, plus correction de quelques bugs
243
* nouvel habillage installateur, plus correction de quelques bugs
241
*
244
*
242
* Revision 1.9  2005/04/12 16:09:45  jpm
245
* Revision 1.9  2005/04/12 16:09:45  jpm
243
* Amélioration de la gestion de la constante de redirection des urls et de la gestion des constantes de type entier et booléen.
246
* Amélioration de la gestion de la constante de redirection des urls et de la gestion des constantes de type entier et booléen.
244
*
247
*
245
* Revision 1.8  2004/10/27 11:43:32  jpm
248
* Revision 1.8  2004/10/27 11:43:32  jpm
246
* Correction bogues diff mise à jour / installation.
249
* Correction bogues diff mise à jour / installation.
247
*
250
*
248
* Revision 1.7  2004/10/25 10:22:48  jpm
251
* Revision 1.7  2004/10/25 10:22:48  jpm
249
* Correction de quelques bogues, ajouts d'explications pour l'utilisateur et modification des styles CSS.
252
* Correction de quelques bogues, ajouts d'explications pour l'utilisateur et modification des styles CSS.
250
*
253
*
251
* Revision 1.6  2004/10/22 17:23:04  jpm
254
* Revision 1.6  2004/10/22 17:23:04  jpm
252
* Simplification del'installation de Papyrus.
255
* Simplification del'installation de Papyrus.
253
*
256
*
254
* Revision 1.5  2004/10/22 09:07:18  jpm
257
* Revision 1.5  2004/10/22 09:07:18  jpm
255
* Début simplification installateur.
258
* Début simplification installateur.
256
*
259
*
257
* Revision 1.4  2004/10/19 17:01:12  jpm
260
* Revision 1.4  2004/10/19 17:01:12  jpm
258
* Correction bogues.
261
* Correction bogues.
259
*
262
*
260
* Revision 1.3  2004/10/19 16:47:28  jpm
263
* Revision 1.3  2004/10/19 16:47:28  jpm
261
* Transformation en fonction de l'appel de l'application.
264
* Transformation en fonction de l'appel de l'application.
262
*
265
*
263
* Revision 1.2  2004/10/19 15:59:18  jpm
266
* Revision 1.2  2004/10/19 15:59:18  jpm
264
* Ajout de la gestion des valeurs propre à Papyrus à insérer dans la base de données.
267
* Ajout de la gestion des valeurs propre à Papyrus à insérer dans la base de données.
265
* Ajout des constantes FTP.
268
* Ajout des constantes FTP.
266
*
269
*
267
* Revision 1.1  2004/10/15 18:28:59  jpm
270
* Revision 1.1  2004/10/15 18:28:59  jpm
268
* Début appli installateur de Papyrus.
271
* Début appli installateur de Papyrus.
269
*
272
*
270
*
273
*
271
* +-- Fin du code ----------------------------------------------------------------------------------------+
274
* +-- Fin du code ----------------------------------------------------------------------------------------+
272
*/
275
*/
273
?>
276
?>