diff --git a/lib/object_coordination/community/community.php b/lib/object_coordination/community/community.php index 414f6a8..67dadf1 100755 --- a/lib/object_coordination/community/community.php +++ b/lib/object_coordination/community/community.php @@ -204,7 +204,7 @@ Class Community extends CoordinationObj WithBlocPath("Community", "actionAccueil"); //Récupération de l'identifiant de la communauté : methode en fin de page - $nodeId = $this->recupCommunauty(); + $nodeId = recupCommunity(); if(is_numeric($nodeId)) //si le noeud existe { @@ -252,7 +252,7 @@ Class Community extends CoordinationObj /* fin récupération des codes par defaut */ //Récupération de l'identifiant de la communauté : methode en fin de page - $nodeId = $this->recupCommunauty(); + $nodeId = recupCommunity(); $url=$SCRIPT_NAME; $url=addIdToUrl($url); //Ajoute l'identifiant de navigation à l'url @@ -304,7 +304,7 @@ Class Community extends CoordinationObj global $SERVER_NAME, $SCRIPT_NAME, $CONF_PERSISTANT_SECURE,$CONF_DATA_PATH; //Récupération de l'identifiant de la communauté : methode en fin de page - $nodeId = $this->recupCommunauty(); + $nodeId = recupCommunity(); # Requete sur identifiant de l objet de coordination correspondant $sql="SELECT * FROM ".DATA_ACCES_TABLE_PREFIX.DATA_ACCES_OBJECT_PREFIX."textentrynode WHERE node_id=".$nodeId; @@ -670,59 +670,6 @@ Class Community extends CoordinationObj return ""; } - - -/** -* Function permettant de modifier le contenu dans la bd et redirection -* @access private -* @return chaine entier noeud de configuration -*/ - function recupCommunauty() - { - /* Récupération de la communauté courante */ - $myEntryNode =$GLOBALS["SYSTEM_USER_SESSION"]->entryNodeId; /* Noeud d'entrée de l'utilisateur */ - $myTree =$GLOBALS["SYSTEM_MANAGER"]["TREE_NODE"]->createInstance($myEntryNode); /* Récupération du Tree correspondant */ - - $nodeId=NULL; - for ($i=0; $itabFather); $i++) - { - if ($myTree->tabFather[$i]->getIdPere()==1) - { - $nodeId=$myTree->tabFather[$i]->getId(); - break; - } - } - if (is_null($nodeId)) - { - systemRedirect( $GLOBALS["CONF_PAGE_EXECUTION"] ); - } - /* -- Fin Recup Communauté */ - return $nodeId; - } - - function recupCommunityByDomain($domain) - { - /* Récupération de la communauté courante */ - $myEntryNode =$GLOBALS["SYSTEM_USER_SESSION"]->entryNodeId; /* Noeud d'entrée de l'utilisateur */ - $myTree =$GLOBALS["SYSTEM_MANAGER"]["TREE_NODE"]->createInstance($myEntryNode); /* Récupération du Tree correspondant */ - - $nodeId=NULL; - for ($i=0; $itabFather); $i++) - { - if( ($myTree->tabFather[$i]->getIdPere()==1) ) - { - $nodeId=$myTree->tabFather[$i]->getId(); - break; - } - } - if (is_null($nodeId)) - { - systemRedirect( $GLOBALS["CONF_PAGE_EXECUTION"] ); - } - /* -- Fin Recup Communauté */ - return $nodeId; - } - /** * getAllRow4Export : recupere tous les enregistrements utilisé par l'objet de coordination * le tableau est constiué de la nom_du_champ=valeur_du_champ @@ -731,7 +678,7 @@ Class Community extends CoordinationObj * @return tableau associatif */ function getAllRow4Export(){ - $nodeId = $this->recupCommunauty(); + $nodeId = recupCommunity(); $datas = array(); if(is_numeric($nodeId)){ @@ -759,7 +706,7 @@ Class Community extends CoordinationObj * @param boolean */ function setAllRow4Import($tableau){ - $nodeId = $this->recupCommunauty(); + $nodeId = recupCommunity(); if(is_numeric($nodeId)){ $sql="DELETE FROM ".DATA_ACCES_TABLE_PREFIX.DATA_ACCES_OBJECT_PREFIX."textentrynode WHERE node_id=".$nodeId; diff --git a/lib/object_coordination/home/home.php b/lib/object_coordination/home/home.php index a9b3ba3..51c4bbe 100755 --- a/lib/object_coordination/home/home.php +++ b/lib/object_coordination/home/home.php @@ -194,7 +194,7 @@ Class Home extends CoordinationObj /* fin récupération des codes par defaut */ //Récupération de l'identifiant de la communauté : methode en fin de page - $nodeId = $this->recupCommunauty(); + $nodeId = recupCommunity(); if(is_numeric($nodeId)) //si le noeud existe { @@ -487,7 +487,7 @@ Class Home extends CoordinationObj * @return tableau associatif */ function getAllRow4Export(){ - $nodeId = $this->recupCommunauty(); + $nodeId = recupCommunity(); $datas = array(); if(is_numeric($nodeId)){ @@ -515,7 +515,7 @@ Class Home extends CoordinationObj * @param boolean */ function setAllRow4Import($tableau){ - $nodeId = $this->recupCommunauty(); + $nodeId = recupCommunity(); if(is_numeric($nodeId)){ $sql="DELETE FROM ".DATA_ACCES_TABLE_PREFIX.DATA_ACCES_OBJECT_PREFIX."textentrynode WHERE node_id=".$nodeId; diff --git a/lib/object_coordination/usertemp/usertemp.php b/lib/object_coordination/usertemp/usertemp.php index 50aef69..1d9d2b5 100755 --- a/lib/object_coordination/usertemp/usertemp.php +++ b/lib/object_coordination/usertemp/usertemp.php @@ -89,7 +89,7 @@ Class UserTemp extends CoordinationObj $tabTreeGroup[0]=$myTreeGroup; //--> treeNodeUnique.... //Récupération de l'identifiant de la communauté : methode en fin de page - $nodeId = $this->recupCommunauty(); + $nodeId = recupCommunity(); /*Inclusion de la librairie UserManagerDb pour effectuer l'insertion et la vérif dans la table sys_user_temp*/ include_once($GLOBALS['CONF_LIB_PATH']."lib/system/system_data/user/ressource/usermanagerdb.php"); @@ -186,7 +186,7 @@ Class UserTemp extends CoordinationObj addMessageFile("user.ini"); //Récupération de l'identifiant de la communauté : methode en fin de page - $nodeId = $this->recupCommunauty('id'); + $nodeId = recupCommunity('id'); if(isset($_POST['user_id'])) { @@ -247,10 +247,10 @@ Class UserTemp extends CoordinationObj // $body = str_replace("<#MAIL#>",$objUser->getMail(),$body); // $mail->isMail(); // $mail->setLanguage('fr', 'lib/package/phpmailer/language/'); -// $mail->AddReplyTo($this->recupCommunauty("mailnode"),$this->recupCommunauty("lib", $currentCode)); -// $mail->SetFrom($this->recupCommunauty("mailnode"),$this->recupCommunauty("lib", $currentCode)); +// $mail->AddReplyTo(recupCommunity("mailnode"),recupCommunity("lib", $currentCode)); +// $mail->SetFrom(recupCommunity("mailnode"),recupCommunity("lib", $currentCode)); // $mail->AddAddress($address, $objUser->getLogin()); -// $mail->AddBCC($this->recupCommunauty("mailnode"), ""); +// $mail->AddBCC(recupCommunity("mailnode"), ""); // $mail->Subject = "Votre inscription sur le site ".$_SERVER['SERVER_NAME']; // // $mail->AltBody = "Pour pouvoir afficher correctement le message, veuillez utiliser un client de courriels compatible HTML !"; // optional, comment out and test // $mail->MsgHTML(utf8_decode($body)); @@ -280,10 +280,10 @@ Class UserTemp extends CoordinationObj $body = str_replace("<#MAIL#>",$objUser->getMail(),$body); $mail->isMail(); $mail->setLanguage(strtolower($currentCode), 'lib/package/phpmailer/language/'); - $mail->AddReplyTo($this->recupCommunauty("mailnode"),$this->recupCommunauty("lib", $currentCode)); - $mail->SetFrom($this->recupCommunauty("mailnode"),$this->recupCommunauty("lib", $currentCode)); + $mail->AddReplyTo(recupCommunity("mailnode"),recupCommunity("lib", $currentCode)); + $mail->SetFrom(recupCommunity("mailnode"),recupCommunity("lib", $currentCode)); $mail->AddAddress($address, $objUser->getLogin()); - $mail->AddBCC($this->recupCommunauty("mailnode"), ""); + $mail->AddBCC(recupCommunity("mailnode"), ""); $mail->Subject = "Votre inscription sur le site web ".$_SERVER['SERVER_NAME']; $mail->AddAttachment("data/image/communities/".$_GET['param']."_logo.png"); // attachment $mail->isHTML(true); @@ -323,7 +323,7 @@ Class UserTemp extends CoordinationObj addMessageFile("user.ini"); //Récupération de l'identifiant de la communauté : methode en fin de page - $nodeId = $this->recupCommunauty(); + $nodeId = recupCommunity(); if(isset($_POST['user_id'])) { @@ -370,7 +370,7 @@ Class UserTemp extends CoordinationObj // $address = $objUserTemp->getMail(); // // $mail = new PHPMailer(); // defaults to using php "mail()" -// $body = file_get_contents('lib/package/phpmailer/templates/refusedinscription_'.$this->recupCommunauty("id").'.html'); +// $body = file_get_contents('lib/package/phpmailer/templates/refusedinscription_'.recupCommunity("id").'.html'); // $body = eregi_replace("[\]",'',$body); // // $body = str_replace("<#CHARMAIN#>",$objUserTemp->getWow_CharMain(),$body); // $body = str_replace("<#IDENTIFIANT#>",$objUserTemp->getLogin(),$body); @@ -378,14 +378,14 @@ Class UserTemp extends CoordinationObj // $body = str_replace("<#MAIL#>",$objUserTemp->getMail(),$body); // $mail->isMail(); // $mail->setLanguage(strtolower($currentCode), 'lib/package/phpmailer/language/'); -// $mail->AddReplyTo($this->recupCommunauty("mailnode"),$this->recupCommunauty("lib", $currentCode)); -// $mail->SetFrom($this->recupCommunauty("mailnode"),$this->recupCommunauty("lib", $currentCode)); +// $mail->AddReplyTo(recupCommunity("mailnode"),recupCommunity("lib", $currentCode)); +// $mail->SetFrom(recupCommunity("mailnode"),recupCommunity("lib", $currentCode)); // $mail->AddAddress($address, $objUserTemp->getLogin()); -// $mail->AddBCC($this->recupCommunauty("mailnode"), ""); +// $mail->AddBCC(recupCommunity("mailnode"), ""); // $mail->Subject = "Votre pre-inscription sur le site web ".$_SERVER['SERVER_NAME']; // // $mail->AltBody = "Pour pouvoir afficher correctement le message, veuillez utiliser un client de courriels compatible HTML !"; // optional, comment out and test // $mail->MsgHTML(utf8_decode($body)); -// $mail->AddAttachment("data/image/communities/".$this->recupCommunauty("id")."_logo.png"); // attachment +// $mail->AddAttachment("data/image/communities/".recupCommunity("id")."_logo.png"); // attachment // // if(!$mail->Send()) { // systemRedirect(formatUrl($this->getId(),"UserTemp","actionManageRegister","workend_error")); @@ -410,10 +410,10 @@ Class UserTemp extends CoordinationObj $body = str_replace("<#MAIL#>",$objUserTemp->getMail(),$body); $mail->isMail(); $mail->setLanguage(strtolower($currentCode), 'lib/package/phpmailer/language/'); - $mail->AddReplyTo($this->recupCommunauty("mailnode"),$this->recupCommunauty("lib", $currentCode)); - $mail->SetFrom($this->recupCommunauty("mailnode"),$this->recupCommunauty("lib", $currentCode)); + $mail->AddReplyTo(recupCommunity("mailnode"),recupCommunity("lib", $currentCode)); + $mail->SetFrom(recupCommunity("mailnode"),recupCommunity("lib", $currentCode)); $mail->AddAddress($address, $objUser->getLogin()); - $mail->AddBCC($this->recupCommunauty("mailnode"), ""); + $mail->AddBCC(recupCommunity("mailnode"), ""); $mail->Subject = "Votre pre-inscription sur le site web ".$_SERVER['SERVER_NAME']; $mail->AddAttachment("data/image/communities/".$_GET['param']."_logo.png"); // attachment $mail->isHTML(true); @@ -433,62 +433,6 @@ Class UserTemp extends CoordinationObj } } -/** -* Function permettant de modifier le contenu dans la bd et redirection -* @access private -* @return entier id noeud -*/ -// function recupCommunauty() -// { -// /* Récupération de la communauté courante */ -// $myEntryNode =$GLOBALS["SYSTEM_USER_SESSION"]->entryNodeId; /* Noeud d'entrée de l'utilisateur */ -// $myTree =$GLOBALS["SYSTEM_MANAGER"]["TREE_NODE"]->createInstance($myEntryNode); /* Récupération du Tree correspondant */ -// $nodeId=NULL; -// for ($i=0; $itabFather); $i++) -// { -// if ($myTree->tabFather[$i]->getIdPere()==1) -// { -// $nodeId=$myTree->tabFather[$i]->getId(); -// break; -// } -// } -// if (is_null($nodeId)) -// { -// systemRedirect($GLOBALS["CONF_PAGE_EXECUTION"]); -// } -// /* -- Fin Recup Communauté */ -// return $nodeId; -// } - - function recupCommunauty($get='id',$langcode="fr") - { - /* Récupération de la communauté courante */ - $myEntryNode =$GLOBALS["SYSTEM_USER_SESSION"]->entryNodeId; /* Noeud d'entrée de l'utilisateur */ - $myTree =$GLOBALS["SYSTEM_MANAGER"]["TREE_NODE"]->createInstance($myEntryNode); /* Récupération du Tree correspondant */ - - $nodeId=NULL; - for ($i=0; $itabFather); $i++) - { - if ($myTree->tabFather[$i]->getIdPere()==1) - { - if( $get == 'id' ) { $nodeId=$myTree->tabFather[$i]->getId();} - elseif( $get == 'ctype' ) { $nodeId=$myTree->tabFather[$i]->getCType();} - elseif( $get == 'lib' ) {$nodeId=$myTree->tabFather[$i]->getLibelle($langcode);} - elseif( $get == 'usergroup' ) {$nodeId=$myTree->tabFather[$i]->getUserGroupId();} - elseif( $get == 'subsgroup' ) {$nodeId=$myTree->tabFather[$i]->getSubsGroupId();} - elseif( $get == 'mailnode' ) {$nodeId=$myTree->tabFather[$i]->getMailNode();} - - break; - } - } - if (is_null($nodeId)) - { - systemRedirect( $GLOBALS["CONF_PAGE_EXECUTION"] ); - } - /* -- Fin Recup Communauté */ - return $nodeId; - } - ####################################################################################################################################### ### Parametrage de l'instance!!! ####################################################################################################################################### diff --git a/lib/object_printing/navigationprint/navigationprint.php b/lib/object_printing/navigationprint/navigationprint.php index 435af3a..6d3f24f 100755 --- a/lib/object_printing/navigationprint/navigationprint.php +++ b/lib/object_printing/navigationprint/navigationprint.php @@ -105,8 +105,8 @@ class NavigationPrint extends Printing $urlNewAccount = $_SERVER['SCRIPT_NAME']; $urlNewAccount.= "?system=authNewAccount"; $urlNewAccount = addIdToUrl($urlNewAccount); - $MaTemplate->MxAttribut("urlActionNewAccount", formatUrl($urlArray["id"],"Home","formLecture","",$this->recupCommunauty())); - $MaTemplate->MxAttribut("urlActionNewSubscription", formatUrl($urlArray["id"],"Home","formLectureAdh","",$this->recupCommunauty())); + $MaTemplate->MxAttribut("urlActionNewAccount", formatUrl($urlArray["id"],"Home","formLecture","",recupCommunity())); + $MaTemplate->MxAttribut("urlActionNewSubscription", formatUrl($urlArray["id"],"Home","formLectureAdh","",recupCommunity())); /* Création de l'URL pour rappel du mot de passe */ $urlForgotPassword = $_SERVER['SCRIPT_NAME']; @@ -436,35 +436,5 @@ class NavigationPrint extends Printing $tab=$GLOBALS["SYSTEM_CONTROL"]->getListObjectForNavigation($nodeId); return $tab; } - -/** -* Function permettant de modifier le contenu dans la bd et redirection -* @access private -* @return chaine entier noeud de configuration -*/ - private function recupCommunauty($get='id',$langcode="fr") - { - /* Récupération de la communauté courante */ - $myEntryNode =$GLOBALS["SYSTEM_USER_SESSION"]->entryNodeId; /* Noeud d'entrée de l'utilisateur */ - $myTree =$GLOBALS["SYSTEM_MANAGER"]["TREE_NODE"]->createInstance($myEntryNode); /* Récupération du Tree correspondant */ - - $nodeId=NULL; - for ($i=0; $itabFather); $i++) - { - if ($myTree->tabFather[$i]->getIdPere()==1) - { - if( $get == 'id' ) { $nodeId=$myTree->tabFather[$i]->getId();} - elseif( $get == 'ctype' ) { $nodeId=$myTree->tabFather[$i]->getCType();} - elseif( $get == 'lib' ) {$nodeId=$myTree->tabFather[$i]->getLibelle($langcode);} - break; - } - } - if (is_null($nodeId)) - { - systemRedirect( $GLOBALS["CONF_PAGE_EXECUTION"] ); - } - /* -- Fin Recup Communauté */ - return $nodeId; - } } ?> diff --git a/lib/object_printing/userprint/userprint.php b/lib/object_printing/userprint/userprint.php index 8a28a0c..035ca6b 100755 --- a/lib/object_printing/userprint/userprint.php +++ b/lib/object_printing/userprint/userprint.php @@ -94,8 +94,8 @@ class UserPrint extends Printing // else // $proto = "http://"; // $MaTemplate->MxAttribut("urlActionNewAccount", $proto."www.fab-l3.org/wwwfab_lorg-142-les_communautes-formlecture-2.htm?abs=1&param=139"); - $MaTemplate->MxAttribut("urlActionNewAccount", formatUrl($urlArray["id"],"Home","formLecture","",$this->recupCommunauty())); - $MaTemplate->MxAttribut("urlActionNewSubscription", formatUrl($urlArray["id"],"Home","formLectureAdh","",$this->recupCommunauty())); + $MaTemplate->MxAttribut("urlActionNewAccount", formatUrl($urlArray["id"],"Home","formLecture","",recupCommunity())); + $MaTemplate->MxAttribut("urlActionNewSubscription", formatUrl($urlArray["id"],"Home","formLectureAdh","",recupCommunity())); /* Création de l'URL pour rappel du mot de passe */ $urlForgotPassword = $_SERVER['SCRIPT_NAME']; @@ -175,35 +175,5 @@ class UserPrint extends Printing $tab=$GLOBALS["SYSTEM_CONTROL"]->getListObjectForNavigation($nodeId); return $tab; } - - /** -* Function permettant de modifier le contenu dans la bd et redirection -* @access private -* @return chaine entier noeud de configuration -*/ - function recupCommunauty($get='id',$langcode="fr") - { - /* Récupération de la communauté courante */ - $myEntryNode =$GLOBALS["SYSTEM_USER_SESSION"]->entryNodeId; /* Noeud d'entrée de l'utilisateur */ - $myTree =$GLOBALS["SYSTEM_MANAGER"]["TREE_NODE"]->createInstance($myEntryNode); /* Récupération du Tree correspondant */ - - $nodeId=NULL; - for ($i=0; $itabFather); $i++) - { - if ($myTree->tabFather[$i]->getIdPere()==1) - { - if( $get == 'id' ) { $nodeId=$myTree->tabFather[$i]->getId();} - elseif( $get == 'ctype' ) { $nodeId=$myTree->tabFather[$i]->getCType();} - elseif( $get == 'lib' ) {$nodeId=$myTree->tabFather[$i]->getLibelle($langcode);} - break; - } - } - if (is_null($nodeId)) - { - systemRedirect( $GLOBALS["CONF_PAGE_EXECUTION"] ); - } - /* -- Fin Recup Communauté */ - return $nodeId; - } } ?>