Line 18... |
Line 18... |
18 |
// | |
|
18 |
// | |
|
19 |
// | You should have received a copy of the GNU Lesser General Public |
|
19 |
// | You should have received a copy of the GNU Lesser General Public |
|
20 |
// | License along with this library; if not, write to the Free Software |
|
20 |
// | License along with this library; if not, write to the Free Software |
|
21 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
22 |
// +------------------------------------------------------------------------------------------------------+
|
22 |
// +------------------------------------------------------------------------------------------------------+
|
23 |
// CVS : $Id: adsi_site.fonct.php,v 1.14 2004-12-03 19:22:53 jpm Exp $
|
23 |
// CVS : $Id: adsi_site.fonct.php,v 1.15 2005-01-04 19:52:50 alex Exp $
|
24 |
/**
|
24 |
/**
|
25 |
* Bibliothèque de fonctions d'admininistration des projets
|
25 |
* Bibliothèque de fonctions d'admininistration des projets
|
26 |
*
|
26 |
*
|
27 |
* Contient un ensemble de fonctions permettant à l'application Administrateur de Papyrus, de modifier des informations
|
27 |
* Contient un ensemble de fonctions permettant à l'application Administrateur de Papyrus, de modifier des informations
|
28 |
* sur les projets (=sites gérés par Papyrus).
|
28 |
* sur les projets (=sites gérés par Papyrus).
|
Line 33... |
Line 33... |
33 |
*@author Laurent COUDOUNEAU <lc@gsite.org>
|
33 |
*@author Laurent COUDOUNEAU <lc@gsite.org>
|
34 |
//Autres auteurs :
|
34 |
//Autres auteurs :
|
35 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
35 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
36 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
36 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
37 |
*@copyright Tela-Botanica 2000-2004
|
37 |
*@copyright Tela-Botanica 2000-2004
|
38 |
*@version $Revision: 1.14 $ $Date: 2004-12-03 19:22:53 $
|
38 |
*@version $Revision: 1.15 $ $Date: 2005-01-04 19:52:50 $
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
40 |
*/
|
40 |
*/
|
Line 41... |
Line 41... |
41 |
|
41 |
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
Line 677... |
Line 677... |
677 |
$tab_rep_site = array( GEN_DOSSIER_IMAGE,
|
677 |
$tab_rep_site = array( GEN_DOSSIER_IMAGE,
|
678 |
GEN_DOSSIER_STYLE,
|
678 |
GEN_DOSSIER_STYLE,
|
679 |
GEN_DOSSIER_SCRIPT,
|
679 |
GEN_DOSSIER_SCRIPT,
|
680 |
GEN_DOSSIER_SQUELETTE,
|
680 |
GEN_DOSSIER_SQUELETTE,
|
681 |
GEN_DOSSIER_DOC);
|
681 |
GEN_DOSSIER_DOC);
|
682 |
if (!GEN_FTP_UTILISE && $id_type_site == '101') {
|
682 |
if (!GEN_FTP_UTILISE && $id_type_site != '103') {
|
683 |
foreach ($tab_rep_langue as $nom_rep_langue) {
|
683 |
foreach ($tab_rep_langue as $nom_rep_langue) {
|
684 |
foreach ($tab_rep_site as $nom_rep_site) {
|
684 |
foreach ($tab_rep_site as $nom_rep_site) {
|
685 |
$chemin_repertoire = PAP_CHEMIN_RACINE.GEN_CHEMIN_SITES.$aso_valeurs['gs_code_alpha'].GEN_SEP.
|
685 |
$chemin_repertoire = PAP_CHEMIN_RACINE.GEN_CHEMIN_SITES.$aso_valeurs['gs_code_alpha'].GEN_SEP.
|
686 |
$nom_rep_langue.GEN_SEP.$nom_rep_site;
|
686 |
$nom_rep_langue.GEN_SEP.$nom_rep_site;
|
687 |
$vieux_umask = umask(0);
|
687 |
$vieux_umask = umask(0);
|
688 |
$resultat = creerDossier($chemin_repertoire, 0755, GEN_SEP);
|
688 |
$resultat = creerDossier($chemin_repertoire, 0777, GEN_SEP);
|
689 |
umask($vieux_umask);
|
689 |
umask($vieux_umask);
|
690 |
if ($resultat == false) {
|
690 |
if ($resultat == false) {
|
691 |
$message = '<p class="pap_erreur"> ERREUR Papyrus admin : impossible de créer le répertoire.<br />'.
|
691 |
$message = '<p class="pap_erreur"> ERREUR Papyrus admin : impossible de créer le répertoire.<br />'.
|
692 |
'Répertoire : '. $chemin_repertoire .'<br />'.
|
692 |
'Répertoire : '. $chemin_repertoire .'<br />'.
|
693 |
'Ligne n° : '. __LINE__ .'<br />'.
|
693 |
'Ligne n° : '. __LINE__ .'<br />'.
|
Line 716... |
Line 716... |
716 |
'Fichier : '. $chemin_style_site .'<br />'.
|
716 |
'Fichier : '. $chemin_style_site .'<br />'.
|
717 |
'Ligne n° : '. __LINE__ .'<br />'.
|
717 |
'Ligne n° : '. __LINE__ .'<br />'.
|
718 |
'Fichier n° : '. __FILE__ .'<br /></p>';
|
718 |
'Fichier n° : '. __FILE__ .'<br /></p>';
|
719 |
return $message;
|
719 |
return $message;
|
720 |
}
|
720 |
}
|
721 |
} else if (GEN_FTP_UTILISE && $id_type_site == '101') {
|
721 |
} else if (GEN_FTP_UTILISE && $id_type_site != '103') { // 103 est le type "site externe"
|
722 |
// Création d'une connection ftp avec Net_FTP de PEAR
|
722 |
// Création d'une connection ftp avec Net_FTP de PEAR
|
723 |
// voir http://pear.php.net/manual/fr/package.networking.net-ftp.php
|
723 |
// voir http://pear.php.net/manual/fr/package.networking.net-ftp.php
|
Line 724... |
Line 724... |
724 |
|
724 |
|
725 |
// création de l'objet pear ftp
|
725 |
// création de l'objet pear ftp
|
Line 737... |
Line 737... |
737 |
'Erreur login : '.$ftp_login_result->getMessage().'<br />'.
|
737 |
'Erreur login : '.$ftp_login_result->getMessage().'<br />'.
|
738 |
'Ligne n° : '. __LINE__ .'<br />'.
|
738 |
'Ligne n° : '. __LINE__ .'<br />'.
|
739 |
'Fichier n° : '. __FILE__ .'<br /><p>';
|
739 |
'Fichier n° : '. __FILE__ .'<br /><p>';
|
740 |
return $message;
|
740 |
return $message;
|
741 |
}
|
741 |
}
|
- |
|
742 |
$objet_pear_ftp->mkdir(PAP_FTP_RACINE.GEN_CHEMIN_SITES.$aso_valeurs['gs_code_alpha']) ;
|
- |
|
743 |
|
- |
|
744 |
//$objet_pear_ftp->cd(PAP_FTP_RACINE.GEN_CHEMIN_SITES.$aso_valeurs['gs_code_alpha']) ;
|
742 |
foreach ($tab_rep_langue as $nom_rep_langue) {
|
745 |
foreach ($tab_rep_langue as $nom_rep_langue) {
|
- |
|
746 |
$objet_pear_ftp->mkdir(PAP_FTP_RACINE.GEN_CHEMIN_SITES.$aso_valeurs['gs_code_alpha'].GEN_SEP.$nom_rep_langue) ;
|
743 |
foreach ($tab_rep_site as $nom_rep_site) {
|
747 |
foreach ($tab_rep_site as $nom_rep_site) {
|
744 |
$chemin_repertoire = PAP_FTP_RACINE.GEN_CHEMIN_SITES.$aso_valeurs['gs_code_alpha'].GEN_SEP.
|
748 |
$chemin_repertoire = PAP_FTP_RACINE.GEN_CHEMIN_SITES.$aso_valeurs['gs_code_alpha'].GEN_SEP.$nom_rep_langue.GEN_SEP.$nom_rep_site;
|
745 |
$nom_rep_langue.GEN_SEP.$nom_rep_site.GEN_SEP;
|
- |
|
- |
|
749 |
|
746 |
$resultat = $objet_pear_ftp->mkdir($chemin_repertoire, true) ;
|
750 |
$resultat = $objet_pear_ftp->mkdir($chemin_repertoire) ;
|
747 |
if (PEAR::isError($resultat)) {
|
751 |
if (PEAR::isError($resultat)) {
|
748 |
$message = '<p class="pap_erreur"> ERREUR Papyrus admin : impossible de créer le répertoire par ftp.<br />'.
|
752 |
$message = '<p class="pap_erreur"> ERREUR Papyrus admin : impossible de créer le répertoire par ftp.<br />'.
|
749 |
'Répertoire : '. $chemin_repertoire .'<br />'.
|
753 |
'Répertoire : '. $chemin_repertoire .'<br />'.
|
750 |
'Erreur origine : '. $resultat->getMessage() .'<br />'.
|
754 |
'Erreur origine : '. $resultat->getMessage() .'<br />'.
|
751 |
'Ligne n° : '. __LINE__ .'<br />'.
|
755 |
'Ligne n° : '. __LINE__ .'<br />'.
|
Line 819... |
Line 823... |
819 |
$requete_complement = ', gs_url = "'.$aso_valeurs['gs_url'].'" ';
|
823 |
$requete_complement = ', gs_url = "'.$aso_valeurs['gs_url'].'" ';
|
820 |
$id_type_site = '103';// c'est un site "externe"
|
824 |
$id_type_site = '103';// c'est un site "externe"
|
821 |
}
|
825 |
}
|
Line 822... |
Line 826... |
822 |
|
826 |
|
823 |
// Si le code alphanumérique à changé et que nous n'avons pas à faire à un site externe.
|
827 |
// Si le code alphanumérique à changé et que nous n'avons pas à faire à un site externe.
|
824 |
if ($aso_valeurs['gs_code_alpha'] != $ancien_code_alphnum && $id_type_site == 102) {
|
828 |
if ($aso_valeurs['gs_code_alpha'] != $ancien_code_alphnum && $id_type_site != 103) {
|
825 |
if (!GEN_FTP_UTILISE) {
|
829 |
if (!GEN_FTP_UTILISE) {
|
826 |
$chemin_site_ancien = PAP_CHEMIN_RACINE.GEN_CHEMIN_SITES.$ancien_code_alphnum.GEN_SEP;
|
830 |
$chemin_site_ancien = PAP_CHEMIN_RACINE.GEN_CHEMIN_SITES.$ancien_code_alphnum.GEN_SEP;
|
827 |
$chemin_site_nouveau = PAP_CHEMIN_RACINE.GEN_CHEMIN_SITES.$aso_valeurs['gs_code_alpha'].GEN_SEP;
|
831 |
$chemin_site_nouveau = PAP_CHEMIN_RACINE.GEN_CHEMIN_SITES.$aso_valeurs['gs_code_alpha'].GEN_SEP;
|
828 |
if (!rename($chemin_site_ancien, $chemin_site_nouveau)) {
|
832 |
if (!rename($chemin_site_ancien, $chemin_site_nouveau)) {
|
Line 1153... |
Line 1157... |
1153 |
}
|
1157 |
}
|
Line 1154... |
Line 1158... |
1154 |
|
1158 |
|
1155 |
// +- Fin du code source --------------------------------------------------------------------------------+
|
1159 |
// +- Fin du code source --------------------------------------------------------------------------------+
|
1156 |
/*
|
1160 |
/*
|
- |
|
1161 |
* $Log: not supported by cvs2svn $
|
- |
|
1162 |
* Revision 1.14 2004/12/03 19:22:53 jpm
|
- |
|
1163 |
* Gestion des types de sites externes gérés par Papyrus.
|
1157 |
* $Log: not supported by cvs2svn $
|
1164 |
*
|
1158 |
* Revision 1.13 2004/12/03 16:37:34 jpm
|
1165 |
* Revision 1.13 2004/12/03 16:37:34 jpm
|
1159 |
* Correction d'un bogue qui empécher la mise à jour des url des sites externes.
|
1166 |
* Correction d'un bogue qui empécher la mise à jour des url des sites externes.
|
1160 |
*
|
1167 |
*
|
1161 |
* Revision 1.12 2004/12/01 17:22:58 jpm
|
1168 |
* Revision 1.12 2004/12/01 17:22:58 jpm
|