Implemented multi domain anon node

This commit is contained in:
Rooty 2021-03-31 02:34:56 +02:00
parent c824e0d280
commit b95195c6ae
7 changed files with 49 additions and 8 deletions

View File

@ -95,7 +95,7 @@ class NavigationPrint extends Printing
$tabObject =$this->getObjectSon(eid()); $tabObject =$this->getObjectSon(eid());
for ($i=0; $i<count($tabObject);$i++) for ($i=0; $i<count($tabObject);$i++)
{ {
if ($tabObject[$i][0]->getClassName()=="home") if ($tabObject[$i][0]->getClassName()=="Home")
{ {
$urlArray["id"]=$tabObject[$i][1]->getId(); $urlArray["id"]=$tabObject[$i][1]->getId();
} }

View File

@ -77,10 +77,12 @@ class UserPrint extends Printing
$url=addIdToUrl($url); $url=addIdToUrl($url);
$tabObject =$this->getObjectSon(eid()); $tabObject =$this->getObjectSon(eid());
// var_dump($tabObject);
for ($i=0; $i<count($tabObject);$i++) for ($i=0; $i<count($tabObject);$i++)
{ {
if ($tabObject[$i][0]->getClassName()=="home") if ($tabObject[$i][0]->getClassName()=="Home")
{ {
// var_dump($tabObject[$i][1]->getId());
$urlArray["id"]=$tabObject[$i][1]->getId(); $urlArray["id"]=$tabObject[$i][1]->getId();
} }
} }

View File

@ -1272,7 +1272,9 @@ var $currentCoordinationObject=null;
{ {
// var_dump($GLOBALS["SYSTEM_USER_SESSION"]->navigationNodeId); // var_dump($GLOBALS["SYSTEM_USER_SESSION"]->navigationNodeId);
$tabObject=$this->getListObjectForNavigation( $GLOBALS["SYSTEM_USER_SESSION"]->navigationNodeId ); $tabObject=$this->getListObjectForNavigation( $GLOBALS["SYSTEM_USER_SESSION"]->navigationNodeId );
// $tabObject=$this->getListObjectForNavigation( 104 );
// var_dump($tabObject);
/* gestion du lib en fonction de la langue courante */ /* gestion du lib en fonction de la langue courante */
$currentCode=$GLOBALS["SYSTEM_USER_SESSION"]->langue->getCode(); $currentCode=$GLOBALS["SYSTEM_USER_SESSION"]->langue->getCode();
$defaultCode=$GLOBALS["SYSTEM_DEFAULT_LANGUAGE_CODE"]; $defaultCode=$GLOBALS["SYSTEM_DEFAULT_LANGUAGE_CODE"];

View File

@ -163,9 +163,6 @@ var $conn = null;
{ {
$sql = "SELECT * FROM ".$this->getTable()." WHERE ".$this->getSqlName("id")."=".$id; $sql = "SELECT * FROM ".$this->getTable()." WHERE ".$this->getSqlName("id")."=".$id;
// $sql.= " AND ".$this->getSqlName("domain")."=".$_SERVER["SERVER_NAME"]; // $sql.= " AND ".$this->getSqlName("domain")."=".$_SERVER["SERVER_NAME"];
if( $id >> 100 )
$sql.= " AND ".$this->getSqlName("domain")."=".$_SERVER["SERVER_NAME"];
# Requete # Requete
$result=$this->conn->sql_query($sql); $result=$this->conn->sql_query($sql);

View File

@ -327,6 +327,7 @@ var $permission;
$_SESSION = &$this->session_vars; $_SESSION = &$this->session_vars;
/* parametrage par defaut */ /* parametrage par defaut */
$defaultNode =$this->getDefaultNode(); $defaultNode =$this->getDefaultNode();
// $defaultNode =104;
$this->entryNodeId =$defaultNode; $this->entryNodeId =$defaultNode;
$this->navigationNodeId =$defaultNode; $this->navigationNodeId =$defaultNode;
} }

View File

@ -349,6 +349,42 @@ var $tabSon = array();
return ($this->getLibelleFromNode($id, $langue)); return ($this->getLibelleFromNode($id, $langue));
} }
/**
* getDomainFromNode: retourne le domaine du noeud
*
* @param identifiant du Noeud
* @access public
* @return chaine
*/
function getDomainFromNode($id)
{
for ($i=0; $i<count($this->tabFather); $i++)
{
if ($this->tabFather[$i]->getId()==$id)
return $this->tabFather[$i]->getDomain();
}
for ($i=0; $i<count($this->tabSon); $i++)
{
if ($this->tabSon[$i]->getId()==$id)
return $this->tabSon[$i]->getDomain();
}
return "";
}
/**
* getDomain: retourne le domaine du noeud
*
* Alias de getDomainFromNode
* @param identifiant du Noeud
* @access public
* @return chaine
*/
function getDomain($id)
{
return ($this->getDomainFromNode($id));
}
/** /**
* getNodeId : retourne l'objet noeud * getNodeId : retourne l'objet noeud
* *

View File

@ -239,10 +239,13 @@ var $tabTree = array();
foreach($this->tabTree as $Tree) foreach($this->tabTree as $Tree)
{ {
// var_dump($Tree->getDomain($Tree->getId())); // var_dump("Tree ID: ".$Tree->getId());
// if( $Tree === $_SERVER["HTTP_HOST"] ) // var_dump("Domain: ".$Tree->getDomain($Tree->getId()));
// var_dump("HOST: ".$_SERVER["HTTP_HOST"]);
if( $Tree->getDomain($Tree->getId()) === $_SERVER["HTTP_HOST"] )
$tab[]=$Tree->getId(); $tab[]=$Tree->getId();
} }
// var_dump($tab);
return array_values(array_unique($tab)); return array_values(array_unique($tab));
} }