| 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.22 2006-11-30 17:41:30 alexandre_tb Exp $
|
35 |
// CVS : $Id: instal_fichier.inc.php,v 1.23 2006-12-01 11:46:11 alexandre_tb 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.22 $ $Date: 2006-11-30 17:41:30 $
|
49 |
*@version $Revision: 1.23 $ $Date: 2006-12-01 11:46:11 $
|
| 50 |
// +------------------------------------------------------------------------------------------------------+
|
50 |
// +------------------------------------------------------------------------------------------------------+
|
| 51 |
**/
|
51 |
**/
|
| Line 52... |
Line 52... |
| 52 |
|
52 |
|
| 53 |
// +------------------------------------------------------------------------------------------------------+
|
53 |
// +------------------------------------------------------------------------------------------------------+
|
| Line 159... |
Line 159... |
| 159 |
|
159 |
|
| 160 |
// tentative d ecriture du fichier .htaccess
|
160 |
// tentative d ecriture du fichier .htaccess
|
| 161 |
$url_ftp_htaccess = 'ftp://'.$fichier['PAP_FTP_UTILISATEUR'].':'.$fichier['PAP_FTP_MOT_DE_PASSE'].
|
161 |
$url_ftp_htaccess = 'ftp://'.$fichier['PAP_FTP_UTILISATEUR'].':'.$fichier['PAP_FTP_MOT_DE_PASSE'].
|
| Line 162... |
Line -... |
| 162 |
'@'.$fichier['PAP_FTP_SERVEUR'].$fichier['PAP_FTP_RACINE'].'/.htaccess';
|
- |
|
| 163 |
|
162 |
'@'.$fichier['PAP_FTP_SERVEUR'].$fichier['PAP_FTP_RACINE'].'/.htaccess';
|
| 164 |
if (file_exists($pref['PAP_CHEMIN_RACINE'].'/.htaccess')) {
|
- |
|
| 165 |
$sortie_verif .='<p>Attention: Un fichier .htaccess est déjà présent sur le serveur.'.
|
163 |
|
| 166 |
'<br />Veillez à le configurer correctement<br /><br />'.
|
164 |
$url_parse = parse_url('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
|
| 167 |
'Contenu par défaut: <br /><br /> ErrorDocument 404 /erreur_404.php';
|
- |
|
| 168 |
} else {
|
165 |
$prefixe = dirname($url_parse['path']);var_dump ($url_parse);
|
| 169 |
$prefixe = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
- |
|
| 170 |
$url = 'http://'.$_SERVER['HTTP_HOST'].$prefixe;
|
- |
|
| 171 |
|
- |
|
| 172 |
$tempfn = tempnam("","");
|
- |
|
| 173 |
$temp = fopen($tempfn, "w");
|
- |
|
| 174 |
|
- |
|
| 175 |
|
166 |
var_dump ($prefixe);
|
| 176 |
|
167 |
$url = 'http://'.$_SERVER['HTTP_HOST'].$prefixe;
|
| 177 |
$contenu_htaccess = '# Raccourci pour les menus et sites de Papyrus'."\n".
|
168 |
$contenu_htaccess = '# Raccourci pour les menus et sites de Papyrus'."\n".
|
| 178 |
'RewriteEngine on'."\n".
|
169 |
'RewriteEngine on'."\n".
|
| 179 |
'# si le fichier ou le dossier existe dans le système de fichier on l\'utilise directement'."\n".
|
170 |
'# si le fichier ou le dossier existe dans le système de fichier on l\'utilise directement'."\n".
|
| 180 |
'RewriteCond %{REQUEST_FILENAME} !-d'."\n".
|
171 |
'RewriteCond %{REQUEST_FILENAME} !-d'."\n".
|
| Line 195... |
Line 186... |
| 195 |
'RewriteRule ^site:.+$ papyrus.php [QSA,L]'."\n".
|
186 |
'RewriteRule ^site:.+$ papyrus.php [QSA,L]'."\n".
|
| 196 |
'# Réecriture d\'url pour les menus de Papyrus : à modifier si les valeurs par défaut ont été changées'."\n".
|
187 |
'# Réecriture d\'url pour les menus de Papyrus : à modifier si les valeurs par défaut ont été changées'."\n".
|
| 197 |
'RewriteRule ^page:.+$ papyrus.php [QSA,L]'."\n\n".
|
188 |
'RewriteRule ^page:.+$ papyrus.php [QSA,L]'."\n\n".
|
| 198 |
'# Gestion des erreurs 404'."\n".
|
189 |
'# Gestion des erreurs 404'."\n".
|
| 199 |
'ErrorDocument 404 '.$prefixe.'/erreur_http.php?erreur=404';
|
190 |
'ErrorDocument 404 '.$prefixe.'/erreur_http.php?erreur=404';
|
| - |
|
191 |
|
| - |
|
192 |
if (file_exists($pref['PAP_CHEMIN_RACINE'].'/.htaccess')) {
|
| - |
|
193 |
$sortie_verif .='<p>Attention: Un fichier .htaccess est déjà présent sur le serveur.'.
|
| - |
|
194 |
'<br />'.$pref['PAP_CHEMIN_RACINE'].'/.htaccess'.
|
| - |
|
195 |
'<br />Veillez à le configurer correctement<br /><br />'.
|
| - |
|
196 |
'Contenu par défaut: <br /><br /> ErrorDocument 404 /erreur_404.php';
|
| - |
|
197 |
} else {
|
| - |
|
198 |
|
| Line -... |
Line 199... |
| - |
|
199 |
|
| - |
|
200 |
$tempfn = tempnam("","");
|
| - |
|
201 |
$temp = fopen($tempfn, "w");
|
| 200 |
|
202 |
|
| 201 |
fwrite($temp, $contenu_htaccess);
|
203 |
fwrite($temp, $contenu_htaccess);
|
| 202 |
fclose($temp);
|
204 |
fclose($temp);
|
| 203 |
$fichier_config_source = $tempfn;
|
205 |
$fichier_config_source = $tempfn;
|
| Line 204... |
Line 206... |
| 204 |
$fichier_config_cible = substr($fichier['PAP_FTP_RACINE'].".htaccess", 1) ;
|
206 |
$fichier_config_cible = substr($fichier['PAP_FTP_RACINE']."/.htaccess", 1) ;
|
| 205 |
|
207 |
|
| 206 |
$txt_ecriture_conf_erreur = 'AVERTISSEMENT: Le fichier .htaccess <tt>'.$fichier_config_cible.
|
208 |
$txt_ecriture_conf_erreur = 'AVERTISSEMENT: Le fichier .htaccess <tt>'.$fichier_config_cible.
|
| 207 |
'</tt> n\'a pu être créé. Veuillez vous assurez que votre serveur a les droits '.
|
209 |
'</tt> n\'a pu être créé. Veuillez vous assurez que votre serveur a les droits '.
|
| Line 337... |
Line 339... |
| 337 |
|
339 |
|
| 338 |
|
340 |
|
| 339 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
341 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
| - |
|
342 |
*
|
| - |
|
343 |
* $Log: not supported by cvs2svn $
|
| - |
|
344 |
* Revision 1.22 2006/11/30 17:41:30 alexandre_tb
|
| 340 |
*
|
345 |
* ecriture htaccess
|
| 341 |
* $Log: not supported by cvs2svn $
|
346 |
*
|
| 342 |
* Revision 1.21 2006/11/30 17:36:29 alexandre_tb
|
347 |
* Revision 1.21 2006/11/30 17:36:29 alexandre_tb
|
| 343 |
* ecriture htaccess
|
348 |
* ecriture htaccess
|
| 344 |
*
|
349 |
*
|