diff --git a/GPL_LIB/AutoComplete/autocomplete-1.html b/GPL_LIB/AutoComplete/autocomplete-1.html
new file mode 100644
index 0000000000000000000000000000000000000000..86e477e671c400e07ae50f97ed2a5e088c3038e0
--- /dev/null
+++ b/GPL_LIB/AutoComplete/autocomplete-1.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
+    <head>
+        <title>Test d'autocompletion</title>
+        <script type="text/javascript" src="autocomplete-1.js"></script>
+<script type="text/javascript">
+window.onload = function(){initAutoComplete(document.getElementById('form-test'),
+document.getElementById('champ-texte'),document.getElementById('bouton-submit'))};
+</script>
+    </head>
+    <body>
+        <form name="form-test" id="form-test" action="javascript:alert('soumission de ' + document.getElementById('champ-texte').value)" style="margin-left: 50px; margin-top:20px">
+            <input type="text" name="champ-texte" id="champ-texte" size="20" />
+            <input type="submit" id="bouton-submit">
+        </form>
+    </body>
+</html>
\ No newline at end of file
diff --git a/GPL_LIB/AutoComplete/autocomplete-1.js b/GPL_LIB/AutoComplete/autocomplete-1.js
new file mode 100644
index 0000000000000000000000000000000000000000..e912c020643ac1f7dac74c768a3f016048ad456d
--- /dev/null
+++ b/GPL_LIB/AutoComplete/autocomplete-1.js
@@ -0,0 +1,130 @@
+// retourne un objet xmlHttpRequest.
+// m�thode compatible entre tous les navigateurs (IE/Firefox/Opera)
+function getXMLHTTP(){
+  var xhr=null;
+  if(window.XMLHttpRequest) // Firefox et autres
+  xhr = new XMLHttpRequest();
+  else if(window.ActiveXObject){ // Internet Explorer
+    try {
+      xhr = new ActiveXObject("Msxml2.XMLHTTP");
+    } catch (e) {
+      try {
+        xhr = new ActiveXObject("Microsoft.XMLHTTP");
+      } catch (e1) {
+        xhr = null;
+      }
+    }
+  }
+  else { // XMLHttpRequest non support� par le navigateur
+    alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
+  }
+  return xhr;
+}
+
+var _documentForm=null; // le formulaire contenant notre champ texte
+var _inputField=null; // le champ texte lui-m�me
+var _submitButton=null; // le bouton submit de notre formulaire
+
+function initAutoComplete(form,field,submit){
+  _documentForm=form;
+  _inputField=field;
+  _submitButton=submit;
+  _inputField.autocomplete="off";
+  creeAutocompletionListe();
+  _currentInputFieldValue=_inputField.value;
+  _oldInputFieldValue=_currentInputFieldValue;
+  cacheResults("",new Array())
+  // Premier d�clenchement de la fonction dans 200 millisecondes
+  setTimeout("mainLoop()",200)
+}
+
+var _oldInputFieldValue=""; // valeur pr�c�dente du champ texte
+var _currentInputFieldValue=""; // valeur actuelle du champ texte
+var _resultCache=new Object(); // m�canisme de cache des requetes
+
+// tourne en permanence pour suggerer suite � un changement du champ texte
+function mainLoop(){
+  _currentInputFieldValue = _inputField.value;
+  if(_oldInputFieldValue!=_currentInputFieldValue){
+    var valeur=escapeURI(_currentInputFieldValue);
+    var suggestions=_resultCache[_currentInputFieldValue];
+    if(suggestions){ // la r�ponse �tait encore dans le cache
+      metsEnPlace(valeur,suggestions)
+    }else{
+      callSuggestions(valeur) // appel distant
+    }
+    _inputField.focus()
+  }
+  _oldInputFieldValue=_currentInputFieldValue;
+  setTimeout("mainLoop()",200); // la fonction se red�clenchera dans 200 ms
+  return true
+}
+
+// echappe les caract�re sp�ciaux
+function escapeURI(La){
+  if(encodeURIComponent) {
+    return encodeURIComponent(La);
+  }
+  if(escape) {
+    return escape(La)
+  }
+}
+
+var _xmlHttp = null; //l'objet xmlHttpRequest utilis� pour contacter le serveur
+var _adresseRecherche = "options.php" //l'adresse � interroger pour trouver les suggestions
+
+function callSuggestions(valeur){
+  if(_xmlHttp&&_xmlHttp.readyState!=0){
+    _xmlHttp.abort()
+  }
+  _xmlHttp=getXMLHTTP();
+  if(_xmlHttp){
+    //appel � l'url distante
+    _xmlHttp.open("GET",_adresseRecherche+"?debut="+valeur,true);
+    _xmlHttp.onreadystatechange=function() {
+      if(_xmlHttp.readyState==4&&_xmlHttp.responseXML) {
+        var liste = traiteXmlSuggestions(_xmlHttp.responseXML)
+        cacheResults(valeur,liste)
+        metsEnPlace(valeur,liste)
+      }
+    };
+    // envoi de la requete
+    _xmlHttp.send(null)
+  }
+}
+
+// Mecanisme de caching des r�ponses
+function cacheResults(debut,suggestions){
+  _resultCache[debut]=suggestions
+}
+
+// Transformation XML en tableau
+function traiteXmlSuggestions(xmlDoc) {
+  var options = xmlDoc.getElementsByTagName('option');
+  var optionsListe = new Array();
+  for (var i=0; i < options.length; ++i) {
+    optionsListe.push(options[i].firstChild.data);
+  }
+  return optionsListe;
+}
+
+var _completeListe=null; // la liste contenant les suggestions
+
+// cr�ation d'une div pour les suggestions
+// m�thode appell�e � l'initialisation
+function creeAutocompletionListe(){
+  _completeListe=document.createElement("UL");
+  _completeListe.id="completeDiv";
+  document.body.appendChild(_completeListe);
+}
+
+function metsEnPlace(valeur, liste) {
+  while(_completeListe.childNodes.length>0) {
+    _completeListe.removeChild(_completeListe.childNodes[0]);
+  }
+  for (var i=0; i < liste.length; ++i) {
+    var nouveauElmt = document.createElement("LI")
+    nouveauElmt.innerHTML = liste[i]
+    _completeListe.appendChild(nouveauElmt)
+  }
+}
\ No newline at end of file
diff --git a/GPL_LIB/AutoComplete/autocomplete-2.html b/GPL_LIB/AutoComplete/autocomplete-2.html
new file mode 100644
index 0000000000000000000000000000000000000000..cb637ff3cfbd806b7cf650831a8cae2cbed924f6
--- /dev/null
+++ b/GPL_LIB/AutoComplete/autocomplete-2.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
+    <head>
+        <title>Test d'autocompletion</title>
+        <link rel="stylesheet" type="text/css" href="autocompletion.css" />
+        <script type="text/javascript" src="autocomplete-2.js"></script>
+<script type="text/javascript">
+window.onload = function(){initAutoComplete(document.getElementById('form-test'),
+document.getElementById('champ-texte'),document.getElementById('bouton-submit'))};
+</script>
+    </head>
+    <body>
+        <form name="form-test" id="form-test" action="javascript:alert('soumission de ' + document.getElementById('champ-texte').value)" style="margin-left: 50px; margin-top:20px">
+            <input type="text" name="champ-texte" id="champ-texte" size="20" />
+            <input type="submit" id="bouton-submit">
+        </form>
+    </body>
+</html>
\ No newline at end of file
diff --git a/GPL_LIB/AutoComplete/autocomplete-2.js b/GPL_LIB/AutoComplete/autocomplete-2.js
new file mode 100644
index 0000000000000000000000000000000000000000..0cfbccec1a3085f50446c9db02853686273f834a
--- /dev/null
+++ b/GPL_LIB/AutoComplete/autocomplete-2.js
@@ -0,0 +1,209 @@
+// retourne un objet xmlHttpRequest.
+// m�thode compatible entre tous les navigateurs (IE/Firefox/Opera)
+function getXMLHTTP(){
+  var xhr=null;
+  if(window.XMLHttpRequest) // Firefox et autres
+  xhr = new XMLHttpRequest();
+  else if(window.ActiveXObject){ // Internet Explorer
+    try {
+      xhr = new ActiveXObject("Msxml2.XMLHTTP");
+    } catch (e) {
+      try {
+        xhr = new ActiveXObject("Microsoft.XMLHTTP");
+      } catch (e1) {
+        xhr = null;
+      }
+    }
+  }
+  else { // XMLHttpRequest non support� par le navigateur
+    alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
+  }
+  return xhr;
+}
+
+var _documentForm=null; // le formulaire contenant notre champ texte
+var _inputField=null; // le champ texte lui-m�me
+var _submitButton=null; // le bouton submit de notre formulaire
+
+function initAutoComplete(form,field,submit){
+  _documentForm=form;
+  _inputField=field;
+  _submitButton=submit;
+  _inputField.autocomplete="off";
+  creeAutocompletionDiv();
+  _currentInputFieldValue=_inputField.value;
+  _oldInputFieldValue=_currentInputFieldValue;
+  cacheResults("",new Array())
+  // Premier d�clenchement de la fonction dans 200 millisecondes
+  setTimeout("mainLoop()",200)
+}
+
+var _oldInputFieldValue=""; // valeur pr�c�dente du champ texte
+var _currentInputFieldValue=""; // valeur actuelle du champ texte
+var _resultCache=new Object(); // m�canisme de cache des requetes
+
+// tourne en permanence pour suggerer suite � un changement du champ texte
+function mainLoop(){
+  _currentInputFieldValue = _inputField.value;
+  if(_oldInputFieldValue!=_currentInputFieldValue){
+    var valeur=escapeURI(_currentInputFieldValue);
+    var suggestions=_resultCache[_currentInputFieldValue];
+    if(suggestions){ // la r�ponse �tait encore dans le cache
+      metsEnPlace(valeur,suggestions)
+    }else{
+      callSuggestions(valeur) // appel distant
+    }
+    _inputField.focus()
+  }
+  _oldInputFieldValue=_currentInputFieldValue;
+  setTimeout("mainLoop()",200); // la fonction se red�clenchera dans 200 ms
+  return true
+}
+
+// echappe les caract�re sp�ciaux
+function escapeURI(La){
+  if(encodeURIComponent) {
+    return encodeURIComponent(La);
+  }
+  if(escape) {
+    return escape(La)
+  }
+}
+
+var _xmlHttp = null; //l'objet xmlHttpRequest utilis� pour contacter le serveur
+var _adresseRecherche = "options.php" //l'adresse � interroger pour trouver les suggestions
+
+function callSuggestions(valeur){
+  if(_xmlHttp&&_xmlHttp.readyState!=0){
+    _xmlHttp.abort()
+  }
+  _xmlHttp=getXMLHTTP();
+  if(_xmlHttp){
+    //appel � l'url distante
+    _xmlHttp.open("GET",_adresseRecherche+"?debut="+valeur,true);
+    _xmlHttp.onreadystatechange=function() {
+      if(_xmlHttp.readyState==4&&_xmlHttp.responseXML) {
+        var liste = traiteXmlSuggestions(_xmlHttp.responseXML)
+        cacheResults(valeur,liste)
+        metsEnPlace(valeur,liste)
+      }
+    };
+    // envoi de la requete
+    _xmlHttp.send(null)
+  }
+}
+
+// Mecanisme de caching des r�ponses
+function cacheResults(debut,suggestions){
+  _resultCache[debut]=suggestions
+}
+
+// Transformation XML en tableau
+function traiteXmlSuggestions(xmlDoc) {
+  var options = xmlDoc.getElementsByTagName('option');
+  var optionsListe = new Array();
+  for (var i=0; i < options.length; ++i) {
+    optionsListe.push(options[i].firstChild.data);
+  }
+  return optionsListe;
+}
+
+//ins�re une r�gle avec son nom
+function insereCSS(nom,regle){
+  if (document.styleSheets) {
+    var I=document.styleSheets[0];
+    if(I.addRule){ // m�thode IE
+      I.addRule(nom,regle)
+    }else if(I.insertRule){ // m�thode DOM
+      I.insertRule(nom+" { "+regle+" }",I.cssRules.length)
+    }
+  }
+}
+
+function initStyle(){
+  var AutoCompleteDivListeStyle="font-size: 13px; font-family: arial,sans-serif; word-wrap:break-word; ";
+  var AutoCompleteDivStyle="display: block; padding-left: 3; padding-right: 3; height: 16px; overflow: hidden; background-color: white;";
+  var AutoCompleteDivActStyle="background-color: #3366cc; color: white ! important; ";
+  insereCSS(".AutoCompleteDivListeStyle",AutoCompleteDivListeStyle);
+  insereCSS(".AutoCompleteDiv",AutoCompleteDivStyle);
+  insereCSS(".AutoCompleteDivAct",AutoCompleteDivActStyle);
+}
+
+function setStylePourElement(c,name){
+  c.className=name;
+}
+
+// calcule le d�calage � gauche
+function calculateOffsetLeft(r){
+  return calculateOffset(r,"offsetLeft")
+}
+
+// calcule le d�calage vertical
+function calculateOffsetTop(r){
+  return calculateOffset(r,"offsetTop")
+}
+
+function calculateOffset(r,attr){
+  var kb=0;
+  while(r){
+    kb+=r[attr];
+    r=r.offsetParent
+  }
+  return kb
+}
+
+// calcule la largeur du champ
+function calculateWidth(){
+  return _inputField.offsetWidth-2*1
+}
+
+function setCompleteDivSize(){
+  if(_completeDiv){
+    _completeDiv.style.left=calculateOffsetLeft(_inputField)+"px";
+    _completeDiv.style.top=calculateOffsetTop(_inputField)+_inputField.offsetHeight-1+"px";
+    _completeDiv.style.width=calculateWidth()+"px"
+  }
+}
+
+function creeAutocompletionDiv() {
+  initStyle();
+  _completeDiv=document.createElement("DIV");
+  _completeDiv.id="completeDiv";
+  var borderLeftRight=1;
+  var borderTopBottom=1;
+  _completeDiv.style.borderRight="black "+borderLeftRight+"px solid";
+  _completeDiv.style.borderLeft="black "+borderLeftRight+"px solid";
+  _completeDiv.style.borderTop="black "+borderTopBottom+"px solid";
+  _completeDiv.style.borderBottom="black "+borderTopBottom+"px solid";
+  _completeDiv.style.zIndex="1";
+  _completeDiv.style.paddingRight="0";
+  _completeDiv.style.paddingLeft="0";
+  _completeDiv.style.paddingTop="0";
+  _completeDiv.style.paddingBottom="0";
+  setCompleteDivSize();
+  _completeDiv.style.visibility="visible";
+  _completeDiv.style.position="absolute";
+  _completeDiv.style.backgroundColor="white";
+  document.body.appendChild(_completeDiv);
+  setStylePourElement(_completeDiv,"AutoCompleteDivListeStyle");
+}
+
+function metsEnPlace(valeur, liste){
+  while(_completeDiv.childNodes.length>0) {
+    _completeDiv.removeChild(_completeDiv.childNodes[0]);
+  }
+  // mise en place des suggestions
+  for(var f=0; f<liste.length; ++f){
+    var nouveauDiv=document.createElement("DIV");
+    setStylePourElement(nouveauDiv,"AutoCompleteDiv");
+    var nouveauSpan=document.createElement("SPAN");
+    nouveauSpan.innerHTML=liste[f]; // le texte de la suggestion
+    nouveauDiv.appendChild(nouveauSpan);
+    _completeDiv.appendChild(nouveauDiv)
+  }
+  if(_completeDivRows>0) {
+    _completeDiv.height=16*_completeDivRows+4;
+  } else {
+    hideCompleteDiv();
+  }
+}
\ No newline at end of file
diff --git a/GPL_LIB/AutoComplete/autocomplete-3-1.html b/GPL_LIB/AutoComplete/autocomplete-3-1.html
new file mode 100644
index 0000000000000000000000000000000000000000..a7ce8b1bae1a252d72758a31a1deeeb341978d83
--- /dev/null
+++ b/GPL_LIB/AutoComplete/autocomplete-3-1.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
+    <head>
+        <title>Test d'autocompletion</title>
+        <link rel="stylesheet" type="text/css" href="autocompletion.css" />
+        <script type="text/javascript" src="autocomplete-3-1.js"></script>
+<script type="text/javascript">
+window.onload = function(){initAutoComplete(document.getElementById('form-test'),
+document.getElementById('champ-texte'),document.getElementById('bouton-submit'))};
+</script>
+    </head>
+    <body>
+        <form name="form-test" id="form-test" action="javascript:alert('soumission de ' + document.getElementById('champ-texte').value)" style="margin-left: 50px; margin-top:20px">
+            <input type="text" name="champ-texte" id="champ-texte" size="20" autocomplete="off" />
+            <input type="submit" id="bouton-submit">
+        </form>
+    </body>
+</html>
\ No newline at end of file
diff --git a/GPL_LIB/AutoComplete/autocomplete-3-1.js b/GPL_LIB/AutoComplete/autocomplete-3-1.js
new file mode 100644
index 0000000000000000000000000000000000000000..b0bedd891a2b71a7c6c986ba80f7104d6d81133e
--- /dev/null
+++ b/GPL_LIB/AutoComplete/autocomplete-3-1.js
@@ -0,0 +1,493 @@
+// retourne un objet xmlHttpRequest.
+// m�thode compatible entre tous les navigateurs (IE/Firefox/Opera)
+function getXMLHTTP(){
+  var xhr=null;
+  if(window.XMLHttpRequest) // Firefox et autres
+  xhr = new XMLHttpRequest();
+  else if(window.ActiveXObject){ // Internet Explorer
+    try {
+      xhr = new ActiveXObject("Msxml2.XMLHTTP");
+    } catch (e) {
+      try {
+        xhr = new ActiveXObject("Microsoft.XMLHTTP");
+      } catch (e1) {
+        xhr = null;
+      }
+    }
+  }
+  else { // XMLHttpRequest non support� par le navigateur
+    alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
+  }
+  return xhr;
+}
+
+var _documentForm=null; // le formulaire contenant notre champ texte
+var _inputField=null; // le champ texte lui-m�me
+var _submitButton=null; // le bouton submit de notre formulaire
+
+function initAutoComplete(form,field,submit){
+  _documentForm=form;
+  _inputField=field;
+  _submitButton=submit;
+  _inputField.autocomplete="off";
+  creeAutocompletionDiv();
+  _currentInputFieldValue=_inputField.value;
+  _oldInputFieldValue=_currentInputFieldValue;
+  cacheResults("",new Array())
+  document.onkeydown=onKeyDownHandler;
+  _inputField.onkeyup=onKeyUpHandler;
+  // Premier d�clenchement de la fonction dans 200 millisecondes
+  setTimeout("mainLoop()",200)
+}
+
+var _oldInputFieldValue=""; // valeur pr�c�dente du champ texte
+var _currentInputFieldValue=""; // valeur actuelle du champ texte
+var _resultCache=new Object(); // m�canisme de cache des requetes
+
+// tourne en permanence pour suggerer suite � un changement du champ texte
+function mainLoop(){
+  if(_oldInputFieldValue!=_currentInputFieldValue){
+    var valeur=escapeURI(_currentInputFieldValue);
+    var suggestions=_resultCache[_currentInputFieldValue];
+    if(suggestions){ // la r�ponse �tait encore dans le cache
+      metsEnPlace(valeur,suggestions)
+    }else{
+      callSuggestions(valeur) // appel distant
+    }
+    _inputField.focus()
+  }
+  _oldInputFieldValue=_currentInputFieldValue;
+  setTimeout("mainLoop()",200); // la fonction se red�clenchera dans 200 ms
+  return true
+}
+
+// echappe les caract�re sp�ciaux
+function escapeURI(La){
+  if(encodeURIComponent) {
+    return encodeURIComponent(La);
+  }
+  if(escape) {
+    return escape(La)
+  }
+}
+
+var _xmlHttp = null; //l'objet xmlHttpRequest utilis� pour contacter le serveur
+var _adresseRecherche = "options.php" //l'adresse � interroger pour trouver les suggestions
+
+function callSuggestions(valeur){
+  if(_xmlHttp&&_xmlHttp.readyState!=0){
+    _xmlHttp.abort()
+  }
+  _xmlHttp=getXMLHTTP();
+  if(_xmlHttp){
+    //appel � l'url distante
+    _xmlHttp.open("GET",_adresseRecherche+"?debut="+valeur,true);
+    _xmlHttp.onreadystatechange=function() {
+      if(_xmlHttp.readyState==4&&_xmlHttp.responseXML) {
+        var liste = traiteXmlSuggestions(_xmlHttp.responseXML)
+        cacheResults(valeur,liste)
+        metsEnPlace(valeur,liste)
+      }
+    };
+    // envoi de la requete
+    _xmlHttp.send(null)
+  }
+}
+
+// Mecanisme de caching des r�ponses
+function cacheResults(debut,suggestions){
+  _resultCache[debut]=suggestions
+}
+
+// Transformation XML en tableau
+function traiteXmlSuggestions(xmlDoc) {
+  var options = xmlDoc.getElementsByTagName('option');
+  var optionsListe = new Array();
+  for (var i=0; i < options.length; ++i) {
+    optionsListe.push(options[i].firstChild.data);
+  }
+  return optionsListe;
+}
+
+//ins�re une r�gle avec son nom
+function insereCSS(nom,regle){
+  if (document.styleSheets) {
+    var I=document.styleSheets[0];
+    if(I.addRule){ // m�thode IE
+      I.addRule(nom,regle)
+    }else if(I.insertRule){ // m�thode DOM
+      I.insertRule(nom+" { "+regle+" }",I.cssRules.length)
+    }
+  }
+}
+
+function initStyle(){
+  var AutoCompleteDivListeStyle="font-size: 13px; font-family: arial,sans-serif; word-wrap:break-word; ";
+  var AutoCompleteDivStyle="display: block; padding-left: 3; padding-right: 3; height: 16px; overflow: hidden; background-color: white;";
+  var AutoCompleteDivActStyle="background-color: #3366cc; color: white ! important; ";
+  insereCSS(".AutoCompleteDivListeStyle",AutoCompleteDivListeStyle);
+  insereCSS(".AutoCompleteDiv",AutoCompleteDivStyle);
+  insereCSS(".AutoCompleteDivAct",AutoCompleteDivActStyle);
+}
+
+function setStylePourElement(c,name){
+  c.className=name;
+}
+
+// calcule le d�calage � gauche
+function calculateOffsetLeft(r){
+  return calculateOffset(r,"offsetLeft")
+}
+
+// calcule le d�calage vertical
+function calculateOffsetTop(r){
+  return calculateOffset(r,"offsetTop")
+}
+
+function calculateOffset(r,attr){
+  var kb=0;
+  while(r){
+    kb+=r[attr];
+    r=r.offsetParent
+  }
+  return kb
+}
+
+// calcule la largeur du champ
+function calculateWidth(){
+  return _inputField.offsetWidth-2*1
+}
+
+function setCompleteDivSize(){
+  if(_completeDiv){
+    _completeDiv.style.left=calculateOffsetLeft(_inputField)+"px";
+    _completeDiv.style.top=calculateOffsetTop(_inputField)+_inputField.offsetHeight-1+"px";
+    _completeDiv.style.width=calculateWidth()+"px"
+  }
+}
+
+function creeAutocompletionDiv() {
+  initStyle();
+  _completeDiv=document.createElement("DIV");
+  _completeDiv.id="completeDiv";
+  var borderLeftRight=1;
+  var borderTopBottom=1;
+  _completeDiv.style.borderRight="black "+borderLeftRight+"px solid";
+  _completeDiv.style.borderLeft="black "+borderLeftRight+"px solid";
+  _completeDiv.style.borderTop="black "+borderTopBottom+"px solid";
+  _completeDiv.style.borderBottom="black "+borderTopBottom+"px solid";
+  _completeDiv.style.zIndex="1";
+  _completeDiv.style.paddingRight="0";
+  _completeDiv.style.paddingLeft="0";
+  _completeDiv.style.paddingTop="0";
+  _completeDiv.style.paddingBottom="0";
+  setCompleteDivSize();
+  _completeDiv.style.visibility="hidden";
+  _completeDiv.style.position="absolute";
+  _completeDiv.style.backgroundColor="white";
+  document.body.appendChild(_completeDiv);
+  setStylePourElement(_completeDiv,"AutoCompleteDivListeStyle");
+}
+
+function metsEnPlace(valeur, liste){
+  while(_completeDiv.childNodes.length>0) {
+    _completeDiv.removeChild(_completeDiv.childNodes[0]);
+  }
+  // mise en place des suggestions
+  for(var f=0; f<liste.length; ++f){
+    var nouveauDiv=document.createElement("DIV");
+    setStylePourElement(nouveauDiv,"AutoCompleteDiv");
+    var nouveauSpan=document.createElement("SPAN");
+    nouveauSpan.innerHTML=liste[f]; // le texte de la suggestion
+    nouveauDiv.appendChild(nouveauSpan);
+    _completeDiv.appendChild(nouveauDiv)
+  }
+  PressAction();
+  if(_completeDivRows>0) {
+    _completeDiv.height=16*_completeDivRows+4;
+  } else {
+    hideCompleteDiv();
+  }
+
+}
+
+var _lastKeyCode=null;
+
+// Handler pour le keydown du document
+var onKeyDownHandler=function(event){
+  // acc�s evenement compatible IE/Firefox
+  if(!event&&window.event) {
+    event=window.event;
+  }
+  // on enregistre la touche ayant d�clench� l'evenement
+  if(event) {
+    _lastKeyCode=event.keyCode;
+  }
+}
+
+var _eventKeycode = null;
+
+// Handler pour le keyup de lu champ texte
+var onKeyUpHandler=function(event){
+  // acc�s evenement compatible IE/Firefox
+  if(!event&&window.event) {
+    event=window.event;
+  }
+  _eventKeycode=event.keyCode;
+  // Dans les cas touches touche haute(38) ou touche basse (40)
+  if(_eventKeycode==40||_eventKeycode==38) {
+    // on autorise le blur du champ (traitement dans onblur)
+    blurThenGetFocus();
+  }
+  // taille de la selection
+  var N=rangeSize(_inputField);
+  // taille du texte avant la selection (selection = suggestion d'autocompl�tion)
+  var v=beforeRangeSize(_inputField);
+  // contenu du champ texte
+  var V=_inputField.value;
+  if(_eventKeycode!=0){
+    if(N>0&&v!=-1) {
+      // on recupere uniquement le champ texte tap� par l'utilisateur
+      V=V.substring(0,v);
+    }
+    // 13 = touche entr�e
+    if(_eventKeycode==13||_eventKeycode==3){
+      var d=_inputField;
+      // on mets en place l'ensemble du champ texte en repoussant la selection
+      if(_inputField.createTextRange){
+        var t=_inputField.createTextRange();
+        t.moveStart("character",_inputField.value.length);
+        _inputField.select()
+      } else if (d.setSelectionRange){
+        _inputField.setSelectionRange(_inputField.value.length,_inputField.value.length)
+      }
+    } else {
+      // si on a pas pu agrandir le champ non selectionn�, on le mets en place violemment.
+      if(_inputField.value!=V) {
+        _inputField.value=V
+      }
+    }
+  }
+  // si la touche n'est ni haut, ni bas, on stocke la valeur utilisateur du champ
+  if(_eventKeycode!=40&&_eventKeycode!=38) {
+  	_currentInputFieldValue=V;
+  }
+  if(handleCursorUpDownEnter(_eventKeycode)&&_eventKeycode!=0) {
+    // si on a pr�ss� une touche autre que haut/bas/enter
+    PressAction();
+  }
+}
+
+// Change la suggestion selectionn�.
+// cette m�thode traite les touches haut, bas et enter
+function handleCursorUpDownEnter(eventCode){
+  if(eventCode==40){
+    highlightNewValue(_highlightedSuggestionIndex+1);
+    return false
+  }else if(eventCode==38){
+    highlightNewValue(_highlightedSuggestionIndex-1);
+    return false
+  }else if(eventCode==13||eventCode==3){
+    return false
+  }
+  return true
+}
+
+var _completeDivRows = 0;
+var _completeDivDivList = null;
+var _highlightedSuggestionIndex = -1;
+var _highlightedSuggestionDiv = null;
+
+// g�re une touche press�e autre que haut/bas/enter
+function PressAction(){
+  _highlightedSuggestionIndex=-1;
+  var suggestionList=_completeDiv.getElementsByTagName("div");
+  var suggestionLongueur=suggestionList.length;
+  // on stocke les valeurs pr�c�dentes
+  // nombre de possibilit�s de compl�tion
+  _completeDivRows=suggestionLongueur;
+  // possiblit�s de compl�tion
+  _completeDivDivList=suggestionList;
+  // si le champ est vide, on cache les propositions de compl�tion
+  if(_currentInputFieldValue==""||suggestionLongueur==0){
+    hideCompleteDiv()
+  }else{
+    showCompleteDiv()
+  }
+  var trouve=false;
+  // si on a du texte sur lequel travailler
+  if(_currentInputFieldValue.length>0){
+    var indice;
+    // T vaut true si on a dans la liste de suggestions un mot commencant comme l'entr�e utilisateur
+    for(indice=0; indice<suggestionLongueur; indice++){
+      if(getSuggestion(suggestionList.item(indice)).toUpperCase().indexOf(_currentInputFieldValue.toUpperCase())==0) {
+        trouve=true;
+        break
+      }
+    }
+  }
+  // on d�s�lectionne toutes les suggestions
+  for(var i=0; i<suggestionLongueur; i++) {
+    setStylePourElement(suggestionList.item(i),"AutoCompleteDiv");
+  }
+  // si l'entr�e utilisateur (n) est le d�but d'une suggestion (n-1) on s�lectionne cette suggestion avant de continuer
+  if(trouve){
+    _highlightedSuggestionIndex=indice;
+    _highlightedSuggestionDiv=suggestionList.item(_highlightedSuggestionIndex);
+  }else{
+    _highlightedSuggestionIndex=-1;
+    _highlightedSuggestionDiv=null
+  }
+  var supprSelection=false;
+  switch(_eventKeycode){
+    // cursor left, cursor right, page up, page down, others??
+    case 8:
+    case 33:
+    case 34:
+    case 35:
+    case 35:
+    case 36:
+    case 37:
+    case 39:
+    case 45:
+    case 46:
+      // on supprime la suggestion du texte utilisateur
+      supprSelection=true;
+      break;
+    default:
+      break
+  }
+  // si on a une suggestion (n-1) s�lectionn�e
+  if(!supprSelection&&_highlightedSuggestionDiv){
+    setStylePourElement(_highlightedSuggestionDiv,"AutoCompleteDivAct");
+    var z;
+    if(trouve) {
+      z=getSuggestion(_highlightedSuggestionDiv).substr(0);
+    } else {
+      z=_currentInputFieldValue;
+    }
+    if(z!=_inputField.value){
+      if(_inputField.value!=_currentInputFieldValue) {
+        return;
+      }
+      // si on peut cr�er des range dans le document
+      if(_inputField.createTextRange||_inputField.setSelectionRange) {
+        _inputField.value=z;
+      }
+      // on s�lectionne la fin de la suggestion
+      if(_inputField.createTextRange){
+        var t=_inputField.createTextRange();
+        t.moveStart("character",_currentInputFieldValue.length);
+        t.select()
+      }else if(_inputField.setSelectionRange){
+        _inputField.setSelectionRange(_currentInputFieldValue.length,_inputField.value.length)
+      }
+    }
+  }else{
+    // sinon, plus aucune suggestion de s�lectionn�e
+    _highlightedSuggestionIndex=-1;
+  }
+}
+
+var _cursorUpDownPressed = null;
+
+// permet le blur du champ texte apr�s que la touche haut/bas ai �t� press�.
+// le focus est r�cup�r� apr�s traitement (via le timeout).
+function blurThenGetFocus(){
+  _cursorUpDownPressed=true;
+  _inputField.blur();
+  setTimeout("_inputField.focus();",10);
+  return
+}
+
+// taille de la selection dans le champ input
+function rangeSize(n){
+  var N=-1;
+  if(n.createTextRange){
+    var fa=document.selection.createRange().duplicate();
+    N=fa.text.length
+  }else if(n.setSelectionRange){
+    N=n.selectionEnd-n.selectionStart
+  }
+  return N
+}
+
+// taille du champ input non selectionne
+function beforeRangeSize(n){
+  var v=0;
+  if(n.createTextRange){
+    var fa=document.selection.createRange().duplicate();
+    fa.moveEnd("textedit",1);
+    v=n.value.length-fa.text.length
+  }else if(n.setSelectionRange){
+    v=n.selectionStart
+  }else{
+    v=-1
+  }
+  return v
+}
+
+// Place le curseur � la fin du champ
+function cursorAfterValue(n){
+  if(n.createTextRange){
+    var t=n.createTextRange();
+    t.moveStart("character",n.value.length);
+    t.select()
+  } else if(n.setSelectionRange) {
+    n.setSelectionRange(n.value.length,n.value.length)
+  }
+}
+
+
+// Retourne la valeur de la possibilite (texte) contenu dans une div de possibilite
+function getSuggestion(uneDiv){
+  if(!uneDiv) {
+    return null;
+  }
+  return trimCR(uneDiv.getElementsByTagName('span')[0].firstChild.data)
+}
+
+// supprime les caract�res retour chariot et line feed d'une chaine de caract�res
+function trimCR(chaine){
+  for(var f=0,nChaine="",zb="\n\r"; f<chaine.length; f++) {
+    if (zb.indexOf(chaine.charAt(f))==-1) {
+      nChaine+=chaine.charAt(f);
+    }
+  }
+  return nChaine
+}
+
+// Cache completement les choix de completion
+function hideCompleteDiv(){
+  _completeDiv.style.visibility="hidden"
+}
+
+// Rends les choix de completion visibles
+function showCompleteDiv(){
+  _completeDiv.style.visibility="visible";
+  setCompleteDivSize()
+}
+
+// Change la suggestion en surbrillance
+function highlightNewValue(C){
+  if(!_completeDivDivList||_completeDivRows<=0) {
+    return;
+  }
+  showCompleteDiv();
+  if(C>=_completeDivRows){
+    C=_completeDivRows-1
+  }
+  if(_highlightedSuggestionIndex!=-1&&C!=_highlightedSuggestionIndex){
+    setStylePourElement(_highlightedSuggestionDiv,"AutoCompleteDiv");
+    _highlightedSuggestionIndex=-1
+  }
+  if(C<0){
+    _highlightedSuggestionIndex=-1;
+    _inputField.focus();
+    return
+  }
+  _highlightedSuggestionIndex=C;
+  _highlightedSuggestionDiv=_completeDivDivList.item(C);
+  setStylePourElement(_highlightedSuggestionDiv,"AutoCompleteDivAct");
+  _inputField.value=getSuggestion(_highlightedSuggestionDiv);
+}
\ No newline at end of file
diff --git a/GPL_LIB/AutoComplete/autocomplete-3-2.html b/GPL_LIB/AutoComplete/autocomplete-3-2.html
new file mode 100644
index 0000000000000000000000000000000000000000..507bbf55266b469d7f41bc6697a97f1ae522f2ce
--- /dev/null
+++ b/GPL_LIB/AutoComplete/autocomplete-3-2.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
+    <head>
+        <title>Test d'autocompletion</title>
+        <link rel="stylesheet" type="text/css" href="autocompletion.css" />
+        <script type="text/javascript" src="autocomplete-3-2.js"></script>
+<script type="text/javascript">
+window.onload = function(){initAutoComplete(document.getElementById('form-test'),
+document.getElementById('champ-texte'),document.getElementById('bouton-submit'))};
+</script>
+    </head>
+    <body>
+        <form name="form-test" id="form-test" action="javascript:alert('soumission de ' + document.getElementById('champ-texte').value)" style="margin-left: 50px; margin-top:20px">
+            <input type="text" name="champ-texte" id="champ-texte" size="20" autocomplete="off" />
+            <input type="submit" id="bouton-submit">
+        </form>
+    </body>
+</html>
\ No newline at end of file
diff --git a/GPL_LIB/AutoComplete/autocomplete-3-2.js b/GPL_LIB/AutoComplete/autocomplete-3-2.js
new file mode 100644
index 0000000000000000000000000000000000000000..8300f70b67b211b859ac8d36aa7a5792a81dbeb9
--- /dev/null
+++ b/GPL_LIB/AutoComplete/autocomplete-3-2.js
@@ -0,0 +1,544 @@
+// retourne un objet xmlHttpRequest.
+// m�thode compatible entre tous les navigateurs (IE/Firefox/Opera)
+function getXMLHTTP(){
+  var xhr=null;
+  if(window.XMLHttpRequest) // Firefox et autres
+  xhr = new XMLHttpRequest();
+  else if(window.ActiveXObject){ // Internet Explorer
+    try {
+      xhr = new ActiveXObject("Msxml2.XMLHTTP");
+    } catch (e) {
+      try {
+        xhr = new ActiveXObject("Microsoft.XMLHTTP");
+      } catch (e1) {
+        xhr = null;
+      }
+    }
+  }
+  else { // XMLHttpRequest non support� par le navigateur
+    alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
+  }
+  return xhr;
+}
+
+var _documentForm=null; // le formulaire contenant notre champ texte
+var _inputField=null; // le champ texte lui-m�me
+var _submitButton=null; // le bouton submit de notre formulaire
+
+function initAutoComplete(form,field,submit){
+  _documentForm=form;
+  _inputField=field;
+  _submitButton=submit;
+  _inputField.autocomplete="off";
+  creeAutocompletionDiv();
+  _currentInputFieldValue=_inputField.value;
+  _oldInputFieldValue=_currentInputFieldValue;
+  cacheResults("",new Array())
+  document.onkeydown=onKeyDownHandler;
+  _inputField.onkeyup=onKeyUpHandler;
+  _inputField.onblur=onBlurHandler;
+  window.onresize=onResizeHandler;
+  // Premier d�clenchement de la fonction dans 200 millisecondes
+  setTimeout("mainLoop()",200)
+}
+
+var _oldInputFieldValue=""; // valeur pr�c�dente du champ texte
+var _currentInputFieldValue=""; // valeur actuelle du champ texte
+var _resultCache=new Object(); // m�canisme de cache des requetes
+
+// tourne en permanence pour suggerer suite � un changement du champ texte
+function mainLoop(){
+  if(_oldInputFieldValue!=_currentInputFieldValue){
+    var valeur=escapeURI(_currentInputFieldValue);
+    var suggestions=_resultCache[_currentInputFieldValue];
+    if(suggestions){ // la r�ponse �tait encore dans le cache
+      metsEnPlace(valeur,suggestions)
+    }else{
+      callSuggestions(valeur) // appel distant
+    }
+    _inputField.focus()
+  }
+  _oldInputFieldValue=_currentInputFieldValue;
+  setTimeout("mainLoop()",200); // la fonction se red�clenchera dans 200 ms
+  return true
+}
+
+// echappe les caract�re sp�ciaux
+function escapeURI(La){
+  if(encodeURIComponent) {
+    return encodeURIComponent(La);
+  }
+  if(escape) {
+    return escape(La)
+  }
+}
+
+var _xmlHttp = null; //l'objet xmlHttpRequest utilis� pour contacter le serveur
+var _adresseRecherche = "options.php" //l'adresse � interroger pour trouver les suggestions
+
+function callSuggestions(valeur){
+  if(_xmlHttp&&_xmlHttp.readyState!=0){
+    _xmlHttp.abort()
+  }
+  _xmlHttp=getXMLHTTP();
+  if(_xmlHttp){
+    //appel � l'url distante
+    _xmlHttp.open("GET",_adresseRecherche+"?debut="+valeur,true);
+    _xmlHttp.onreadystatechange=function() {
+      if(_xmlHttp.readyState==4&&_xmlHttp.responseXML) {
+        var liste = traiteXmlSuggestions(_xmlHttp.responseXML)
+        cacheResults(valeur,liste)
+        metsEnPlace(valeur,liste)
+      }
+    };
+    // envoi de la requete
+    _xmlHttp.send(null)
+  }
+}
+
+// Mecanisme de caching des r�ponses
+function cacheResults(debut,suggestions){
+  _resultCache[debut]=suggestions
+}
+
+// Transformation XML en tableau
+function traiteXmlSuggestions(xmlDoc) {
+  var options = xmlDoc.getElementsByTagName('option');
+  var optionsListe = new Array();
+  for (var i=0; i < options.length; ++i) {
+    optionsListe.push(options[i].firstChild.data);
+  }
+  return optionsListe;
+}
+
+//ins�re une r�gle avec son nom
+function insereCSS(nom,regle){
+  if (document.styleSheets) {
+    var I=document.styleSheets[0];
+    if(I.addRule){ // m�thode IE
+      I.addRule(nom,regle)
+    }else if(I.insertRule){ // m�thode DOM
+      I.insertRule(nom+" { "+regle+" }",I.cssRules.length)
+    }
+  }
+}
+
+function initStyle(){
+  var AutoCompleteDivListeStyle="font-size: 13px; font-family: arial,sans-serif; word-wrap:break-word; ";
+  var AutoCompleteDivStyle="display: block; padding-left: 3; padding-right: 3; height: 16px; overflow: hidden; background-color: white;";
+  var AutoCompleteDivActStyle="background-color: #3366cc; color: white ! important; ";
+  insereCSS(".AutoCompleteDivListeStyle",AutoCompleteDivListeStyle);
+  insereCSS(".AutoCompleteDiv",AutoCompleteDivStyle);
+  insereCSS(".AutoCompleteDivAct",AutoCompleteDivActStyle);
+}
+
+function setStylePourElement(c,name){
+  c.className=name;
+}
+
+// calcule le d�calage � gauche
+function calculateOffsetLeft(r){
+  return calculateOffset(r,"offsetLeft")
+}
+
+// calcule le d�calage vertical
+function calculateOffsetTop(r){
+  return calculateOffset(r,"offsetTop")
+}
+
+function calculateOffset(r,attr){
+  var kb=0;
+  while(r){
+    kb+=r[attr];
+    r=r.offsetParent
+  }
+  return kb
+}
+
+// calcule la largeur du champ
+function calculateWidth(){
+  return _inputField.offsetWidth-2*1
+}
+
+function setCompleteDivSize(){
+  if(_completeDiv){
+    _completeDiv.style.left=calculateOffsetLeft(_inputField)+"px";
+    _completeDiv.style.top=calculateOffsetTop(_inputField)+_inputField.offsetHeight-1+"px";
+    _completeDiv.style.width=calculateWidth()+"px"
+  }
+}
+
+function creeAutocompletionDiv() {
+  initStyle();
+  _completeDiv=document.createElement("DIV");
+  _completeDiv.id="completeDiv";
+  var borderLeftRight=1;
+  var borderTopBottom=1;
+  _completeDiv.style.borderRight="black "+borderLeftRight+"px solid";
+  _completeDiv.style.borderLeft="black "+borderLeftRight+"px solid";
+  _completeDiv.style.borderTop="black "+borderTopBottom+"px solid";
+  _completeDiv.style.borderBottom="black "+borderTopBottom+"px solid";
+  _completeDiv.style.zIndex="1";
+  _completeDiv.style.paddingRight="0";
+  _completeDiv.style.paddingLeft="0";
+  _completeDiv.style.paddingTop="0";
+  _completeDiv.style.paddingBottom="0";
+  setCompleteDivSize();
+  _completeDiv.style.visibility="hidden";
+  _completeDiv.style.position="absolute";
+  _completeDiv.style.backgroundColor="white";
+  document.body.appendChild(_completeDiv);
+  setStylePourElement(_completeDiv,"AutoCompleteDivListeStyle");
+}
+
+function metsEnPlace(valeur, liste){
+  while(_completeDiv.childNodes.length>0) {
+    _completeDiv.removeChild(_completeDiv.childNodes[0]);
+  }
+  // mise en place des suggestions
+  for(var f=0; f<liste.length; ++f){
+    var nouveauDiv=document.createElement("DIV");
+    nouveauDiv.onmousedown=divOnMouseDown;
+    nouveauDiv.onmouseover=divOnMouseOver;
+    nouveauDiv.onmouseout=divOnMouseOut;
+    setStylePourElement(nouveauDiv,"AutoCompleteDiv");
+    var nouveauSpan=document.createElement("SPAN");
+    nouveauSpan.innerHTML=liste[f]; // le texte de la suggestion
+    nouveauDiv.appendChild(nouveauSpan);
+    _completeDiv.appendChild(nouveauDiv)
+  }
+  PressAction();
+  if(_completeDivRows>0) {
+    _completeDiv.height=16*_completeDivRows+4;
+  } else {
+    hideCompleteDiv();
+  }
+
+}
+
+var _lastKeyCode=null;
+
+// Handler pour le keydown du document
+var onKeyDownHandler=function(event){
+  // acc�s evenement compatible IE/Firefox
+  if(!event&&window.event) {
+    event=window.event;
+  }
+  // on enregistre la touche ayant d�clench� l'evenement
+  if(event) {
+    _lastKeyCode=event.keyCode;
+  }
+}
+
+var _eventKeycode = null;
+
+// Handler pour le keyup de lu champ texte
+var onKeyUpHandler=function(event){
+  // acc�s evenement compatible IE/Firefox
+  if(!event&&window.event) {
+    event=window.event;
+  }
+  _eventKeycode=event.keyCode;
+  // Dans les cas touches touche haute(38) ou touche basse (40)
+  if(_eventKeycode==40||_eventKeycode==38) {
+    // on autorise le blur du champ (traitement dans onblur)
+    blurThenGetFocus();
+  }
+  // taille de la selection
+  var N=rangeSize(_inputField);
+  // taille du texte avant la selection (selection = suggestion d'autocompl�tion)
+  var v=beforeRangeSize(_inputField);
+  // contenu du champ texte
+  var V=_inputField.value;
+  if(_eventKeycode!=0){
+    if(N>0&&v!=-1) {
+      // on recupere uniquement le champ texte tap� par l'utilisateur
+      V=V.substring(0,v);
+    }
+    // 13 = touche entr�e
+    if(_eventKeycode==13||_eventKeycode==3){
+      var d=_inputField;
+      // on mets en place l'ensemble du champ texte en repoussant la selection
+      if(_inputField.createTextRange){
+        var t=_inputField.createTextRange();
+        t.moveStart("character",_inputField.value.length);
+        _inputField.select()
+      } else if (d.setSelectionRange){
+        _inputField.setSelectionRange(_inputField.value.length,_inputField.value.length)
+      }
+    } else {
+      // si on a pas pu agrandir le champ non selectionn�, on le mets en place violemment.
+      if(_inputField.value!=V) {
+        _inputField.value=V
+      }
+    }
+  }
+  // si la touche n'est ni haut, ni bas, on stocke la valeur utilisateur du champ
+  if(_eventKeycode!=40&&_eventKeycode!=38) {
+    // le champ courant n est pas change si key Up ou key Down
+  	_currentInputFieldValue=V;
+  }
+  if(handleCursorUpDownEnter(_eventKeycode)&&_eventKeycode!=0) {
+    // si on a pr�ss� une touche autre que haut/bas/enter
+    PressAction();
+  }
+}
+
+// Change la suggestion selectionn�.
+// cette m�thode traite les touches haut, bas et enter
+function handleCursorUpDownEnter(eventCode){
+  if(eventCode==40){
+    highlightNewValue(_highlightedSuggestionIndex+1);
+    return false
+  }else if(eventCode==38){
+    highlightNewValue(_highlightedSuggestionIndex-1);
+    return false
+  }else if(eventCode==13||eventCode==3){
+    return false
+  }
+  return true
+}
+
+var _completeDivRows = 0;
+var _completeDivDivList = null;
+var _highlightedSuggestionIndex = -1;
+var _highlightedSuggestionDiv = null;
+
+// g�re une touche press�e autre que haut/bas/enter
+function PressAction(){
+  _highlightedSuggestionIndex=-1;
+  var suggestionList=_completeDiv.getElementsByTagName("div");
+  var suggestionLongueur=suggestionList.length;
+  // on stocke les valeurs pr�c�dentes
+  // nombre de possibilit�s de compl�tion
+  _completeDivRows=suggestionLongueur;
+  // possiblit�s de compl�tion
+  _completeDivDivList=suggestionList;
+  // si le champ est vide, on cache les propositions de compl�tion
+  if(_currentInputFieldValue==""||suggestionLongueur==0){
+    hideCompleteDiv()
+  }else{
+    showCompleteDiv()
+  }
+  var trouve=false;
+  // si on a du texte sur lequel travailler
+  if(_currentInputFieldValue.length>0){
+    var indice;
+    // T vaut true si on a dans la liste de suggestions un mot commencant comme l'entr�e utilisateur
+    for(indice=0; indice<suggestionLongueur; indice++){
+      if(getSuggestion(suggestionList.item(indice)).toUpperCase().indexOf(_currentInputFieldValue.toUpperCase())==0) {
+        trouve=true;
+        break
+      }
+    }
+  }
+  // on d�s�lectionne toutes les suggestions
+  for(var i=0; i<suggestionLongueur; i++) {
+    setStylePourElement(suggestionList.item(i),"AutoCompleteDiv");
+  }
+  // si l'entr�e utilisateur (n) est le d�but d'une suggestion (n-1) on s�lectionne cette suggestion avant de continuer
+  if(trouve){
+    _highlightedSuggestionIndex=indice;
+    _highlightedSuggestionDiv=suggestionList.item(_highlightedSuggestionIndex);
+  }else{
+    _highlightedSuggestionIndex=-1;
+    _highlightedSuggestionDiv=null
+  }
+  var supprSelection=false;
+  switch(_eventKeycode){
+    // cursor left, cursor right, page up, page down, others??
+    case 8:
+    case 33:
+    case 34:
+    case 35:
+    case 35:
+    case 36:
+    case 37:
+    case 39:
+    case 45:
+    case 46:
+      // on supprime la suggestion du texte utilisateur
+      supprSelection=true;
+      break;
+    default:
+      break
+  }
+  // si on a une suggestion (n-1) s�lectionn�e
+  if(!supprSelection&&_highlightedSuggestionDiv){
+    setStylePourElement(_highlightedSuggestionDiv,"AutoCompleteDivAct");
+    var z;
+    if(trouve) {
+      z=getSuggestion(_highlightedSuggestionDiv).substr(0);
+    } else {
+      z=_currentInputFieldValue;
+    }
+    if(z!=_inputField.value){
+      if(_inputField.value!=_currentInputFieldValue) {
+        return;
+      }
+      // si on peut cr�er des range dans le document
+      if(_inputField.createTextRange||_inputField.setSelectionRange) {
+        _inputField.value=z;
+      }
+      // on s�lectionne la fin de la suggestion
+      if(_inputField.createTextRange){
+        var t=_inputField.createTextRange();
+        t.moveStart("character",_currentInputFieldValue.length);
+        t.select()
+      }else if(_inputField.setSelectionRange){
+        _inputField.setSelectionRange(_currentInputFieldValue.length,_inputField.value.length)
+      }
+    }
+  }else{
+    // sinon, plus aucune suggestion de s�lectionn�e
+    _highlightedSuggestionIndex=-1;
+  }
+}
+
+var _cursorUpDownPressed = null;
+
+// permet le blur du champ texte apr�s que la touche haut/bas ai �t� press�.
+// le focus est r�cup�r� apr�s traitement (via le timeout).
+function blurThenGetFocus(){
+  _cursorUpDownPressed=true;
+  _inputField.blur();
+  setTimeout("_inputField.focus();",10);
+  return
+}
+
+// taille de la selection dans le champ input
+function rangeSize(n){
+  var N=-1;
+  if(n.createTextRange){
+    var fa=document.selection.createRange().duplicate();
+    N=fa.text.length
+  }else if(n.setSelectionRange){
+    N=n.selectionEnd-n.selectionStart
+  }
+  return N
+}
+
+// taille du champ input non selectionne
+function beforeRangeSize(n){
+  var v=0;
+  if(n.createTextRange){
+    var fa=document.selection.createRange().duplicate();
+    fa.moveEnd("textedit",1);
+    v=n.value.length-fa.text.length
+  }else if(n.setSelectionRange){
+    v=n.selectionStart
+  }else{
+    v=-1
+  }
+  return v
+}
+
+// Place le curseur � la fin du champ
+function cursorAfterValue(n){
+  if(n.createTextRange){
+    var t=n.createTextRange();
+    t.moveStart("character",n.value.length);
+    t.select()
+  } else if(n.setSelectionRange) {
+    n.setSelectionRange(n.value.length,n.value.length)
+  }
+}
+
+
+// Retourne la valeur de la possibilite (texte) contenu dans une div de possibilite
+function getSuggestion(uneDiv){
+  if(!uneDiv) {
+    return null;
+  }
+  return trimCR(uneDiv.getElementsByTagName('span')[0].firstChild.data)
+}
+
+// supprime les caract�res retour chariot et line feed d'une chaine de caract�res
+function trimCR(chaine){
+  for(var f=0,nChaine="",zb="\n\r"; f<chaine.length; f++) {
+    if (zb.indexOf(chaine.charAt(f))==-1) {
+      nChaine+=chaine.charAt(f);
+    }
+  }
+  return nChaine
+}
+
+// Cache completement les choix de completion
+function hideCompleteDiv(){
+  _completeDiv.style.visibility="hidden"
+}
+
+// Rends les choix de completion visibles
+function showCompleteDiv(){
+  _completeDiv.style.visibility="visible";
+  setCompleteDivSize()
+}
+
+// Change la suggestion en surbrillance
+function highlightNewValue(C){
+  if(!_completeDivDivList||_completeDivRows<=0) {
+    return;
+  }
+  showCompleteDiv();
+  if(C>=_completeDivRows){
+    C=_completeDivRows-1
+  }
+  if(_highlightedSuggestionIndex!=-1&&C!=_highlightedSuggestionIndex){
+    setStylePourElement(_highlightedSuggestionDiv,"AutoCompleteDiv");
+    _highlightedSuggestionIndex=-1
+  }
+  if(C<0){
+    _highlightedSuggestionIndex=-1;
+    _inputField.focus();
+    return
+  }
+  _highlightedSuggestionIndex=C;
+  _highlightedSuggestionDiv=_completeDivDivList.item(C);
+  setStylePourElement(_highlightedSuggestionDiv,"AutoCompleteDivAct");
+  _inputField.value=getSuggestion(_highlightedSuggestionDiv);
+}
+
+// Handler de resize de la fenetre
+var onResizeHandler=function(event){
+  // recalcule la taille des suggestions
+  setCompleteDivSize();
+}
+
+// Handler de blur sur le champ texte
+var onBlurHandler=function(event){
+  if(!_cursorUpDownPressed){
+    // si le blur n'est pas caus� par la touche haut/bas
+    hideCompleteDiv();
+    // Si la derni�re touche pr�ss� est tab, on passe au bouton de validation
+    if(_lastKeyCode==9){
+      _submitButton.focus();
+      _lastKeyCode=-1
+    }
+  }
+  _cursorUpDownPressed=false
+};
+
+// declenchee quand on clique sur une div contenant une possibilite
+var divOnMouseDown=function(){
+  _inputField.value=getSuggestion(this);
+  _documentForm.submit()
+};
+
+// declenchee quand on passe sur une div de possibilite. La div pr�c�dente est passee en style normal
+var divOnMouseOver=function(){
+  if(_highlightedSuggestionDiv) {
+    setStylePourElement(_highlightedSuggestionDiv,"AutoCompleteDiv");
+  }
+  setStylePourElement(this,"AutoCompleteDivAct")
+};
+
+// declenchee quand la sourie quitte une div de possiblite. La div repasse a l'etat normal
+var divOnMouseOut = function(){
+  setStylePourElement(this,"AutoCompleteDiv");
+};
+
+
+
+
+
+
diff --git a/GPL_LIB/AutoComplete/autocompletion.css b/GPL_LIB/AutoComplete/autocompletion.css
new file mode 100644
index 0000000000000000000000000000000000000000..eee20e4f50e782284dbf4286a3854c3920ccdeb4
--- /dev/null
+++ b/GPL_LIB/AutoComplete/autocompletion.css
@@ -0,0 +1,2 @@
+body {
+}
\ No newline at end of file
diff --git a/GPL_LIB/AutoComplete/options.php b/GPL_LIB/AutoComplete/options.php
new file mode 100644
index 0000000000000000000000000000000000000000..91e38dfaa292b0736bc5f92e487bbef348eacb4e
--- /dev/null
+++ b/GPL_LIB/AutoComplete/options.php
@@ -0,0 +1,26 @@
+<?php
+header('Content-Type: text/xml;charset=utf-8');
+echo(utf8_encode("<?xml version='1.0' encoding='UTF-8' ?><options>"));
+if (isset($_GET['debut'])) {
+    $debut = utf8_decode($_GET['debut']);
+} else {
+    $debut = "";
+}
+$debut = strtolower($debut);
+$liste = array("abeille","abricot","acheter","acheteur","adjectif","adroit","adroitement","agent","aigle","aile","air","amour","�ne","approcher","ardoise","ar�te","arracher","asperge","astre","aujourd'hui","au lieu de","aussi","autobus","autocar","autruche","avant","avertir","aviation","avril","bain","bal","balcon","balle","ballon","banc","bande","banque","barque","bas","basse","bassin","bataille","b�ton","bavarder","baver","bavette","bazar","beau","belle","bec","b�ler","b�te","bidon","bien","bille","billet","biscuit","bise","blanc","blancheur","blanchir","bleu","bord","bordure","borne","botte","bottine","boucher","bouchon","boucle","boue","boulanger","boulangerie","bouquet","bouteille","boutique","bras","brioche","briquet","brise","briser","brochet","brosse","brosser","brouette","bureau","cachette","cadre","campagne","canal","canard","capitaine","carnaval","carnet","case","castor","chacun","chameau","chant","chapeau","chapelle","chaque","chaton","chaud","chaudement","chef","chenille","chevalier","cheville","chocolat","chose","choucroute","cidre","ciel","cinq","cirque","clocher","clochette","clou","combien","comment","compagne","compagnie","compagnon","compliment","conduire","conduite","confortable","conjuguer","contenir","continuer","coq","coquin","corbeau","corbeille","corde","corne","cornet","corniche","coton","cou","couchette","coudre","coupant","cour","courir","course","couverture","couvrir","craie","cr�ne","crier","croire","croix","cuire","cuisine","cuisson","cuit","cuivre","cuve","date","d�cembre","d�couverte","demi","d�monter","dent","depuis","dernier","derri�re","dessin","dessiner","dessous","devant","dire","direct","directement","diriger","disque","diviser","division","dix","docteur","domestique","donner","dos","double","douloureux","doux","douce","douze","dragon","dur","dur�e","durer","eau","�caille","�chapper","�charpe","�chelle","�colier","�couter","�crevisse","�crire","�criteau","�curie","�l�mentaire","�leveur","en bas","encore","encrier","encre","endormir","enfantin","enfermer","enfin","en haut","ensuite","entier","entr�e","�picerie","�pine","�pingle","�plucher","escalier","escargot","estrade","�trange","fabrique","fabriquer","fatigue","f�minin","fen�tre","fer","fermer","feuille","feutre","fid�le","film","fils","fin","fleuriste","foin","folie","fondre","fontaine","force","forme","formidable","fort","fortement","fourche","franc","franche","fr�re","frileux","fruit","fuite","fumer","gamin","garage","garde","garde","garder","gardien","garnir","gauche","genre","gerbe","gibier","gilet","girafe","gomme","grammaire","grandeur","grandir","gras","grasse","grave","grenouille","gris","grossir","groupe","haut","hauteur","herbe","heure","hibou","hier","histoire","hiver","ici","id�e","injuste","insecte","inspecteur","instrument","invisible","jambe","janvier","jaune","jeune","joie","joue","jouet","joueur","juillet","juin","jument","jusqu'�","labourer","lac","langue","larme","lavage","laver","l�cher","le�on","l�ger","l�gume","lettre","l�vre","li�vre","linge","liquide","litre","livret","loin","long","longue","lorsque","loup","lueur","lunettes","lutte","machine","mademoiselle","magasin","mai","maintenant","maisonnette","ma�tre","ma�tresse","majuscule","malin","mari","masculin","mati�re","matinal","mauve","m�lange","m�langer","m�moire","m�nagerie","menteur","menu","mer","merci","mercredi","merle","merveille","messe","m�tier","mie","miel","le mien","miette","mine","minuit","miracle","moderne","moineau","mois","moment","monstre","montagne","montre","montrer","morue","moteur","motif","moucheron","mouchoir","moudre","mouette","moutarde","mouvement","muraille","murmure","murmurer","nappe","n�","neuf","nez","nid","no�l","noir","nom","nombre","nouer","nuageux","nuit","nul","odeur","oie","oncle","ongle","or","orage","orageux","oreille","ours","ourson","ouvert","ouvrage","ouvrier","paille","pain","paire","panier","pantalon","papier","papillon","parcourir","pardon","parent","parfait","parole","partage","partager","partie","partir","partout","parvenir","pass�","passer","pastille","p�te","patron","patte","pays","peau","p�che","p�cher","p�cheur","peine","pendant","pendre","p�pin","perche","perdant","perdre","perte","peureux","pie","pi�ce","pied","pi�ge","pierre","pi�ton","pioche","piocher","piquet","place","plage","plaine","plaisir","planter","plaque","plat","pleurer","plonger","pluie","pluriel","pochette","point","pointe","poirier","poitrine","pompe","pomper","pondre","porter","pot","pouce","poudre","pourquoi","pourtant","prairie","pratique","presque","prince","princesse","probl�me","produire","produit","promenade","promeneur","propre","proprement","provenir","puis","puisque","punir","pur","pur�e","quatre","quoi","racine","radis","rage","raie","raisin","rame","ramener","raquette","rare","rarement","rebord","recopier","recoudre","recouper","reculer","redevenir","r�duire","regard","r�gime","renard","rencontre","rencontrer","repartir","repasser","r�pondre","r�ponse","reprendre","reproduire","requin","respiration","respirer","r�union","richesse","ride","risque","rivage","rivi�re","robinet","robot","rocher","rond","rondelle","ros�e","roue","rude","ruelle","rugir","salle","saluer","s'amuser","sans","sardine","sauvage","sauver","savoir","secouer","se fatiguer","sel","semelle","se moquer","se munir","s'envoler","se rendormir","se souvenir","seul","si�ge","signe","singulier","soie","soir�e","soldat","solidement","sombre","somme","sonner","sonnerie","sorci�re","sorte","sot","sotte","sottise","souper","soupi�re","sous","souvent","spectateur","sport","sportif","sucrier","sueur","suivant","sujet","superbe","surprise","surtout","tableau","tablier","tabouret","tache","taupe","taille","tante","tapage","taper","taureau","tenir","tenue","tigre","timbre","tirer","tissage","tisser","titre","toile","tondre","tordre","train","traire","tranche","traverser","tr�fle","tr�sor","tresse","tricher","tricheur","tristement","trompe","trou","truite","unit�","usage","us�","utile","utilit�","vague","valeur","valoir","vanille","vapeur","vendeur","vendre","vent","vente","ventre","verger","vernir","vert","verte","veste","viande","victoire","vide","vider","vieux","vif","vive","villa","vinaigre","violette","vip�re","virgule","visible","vitesse","vitre","vitrine","vivement","vivre","vocabulaire","voile","voile","voisin","voisinage","vouloir","voyage","voyageur","z�bre","z�ro");
+
+function generateOptions($debut,$liste) {
+    $MAX_RETURN = 10;
+    $i = 0;
+    foreach ($liste as $element) {
+        if ($i<$MAX_RETURN && substr($element, 0, strlen($debut))==$debut) {
+            echo(utf8_encode("<option>".$element."</option>"));
+            $i++;
+        }
+    }
+}
+
+generateOptions($debut,$liste);
+
+echo("</options>");
+?>
diff --git a/GPL_LIB/Color_Picker/color_picker.html b/GPL_LIB/Color_Picker/color_picker.html
new file mode 100644
index 0000000000000000000000000000000000000000..bb7ed3f6c8fea2c1fc42ac92898ba6f9fe81b25c
--- /dev/null
+++ b/GPL_LIB/Color_Picker/color_picker.html
@@ -0,0 +1,189 @@
+<html>
+<head>
+	<title>Color Picker</title>
+	<style type="text/css">
+	
+		body	{ font-size: 12px; font-family: Verdana, Sans-Serif; text-align:center; background-color:#FFFFFF; color:navy;}
+		td  { font-size: 12px; font-family: Verdana, Sans-Serif; text-align:center; background-color:#FFFFFF}
+		.table_black_border {border-style:solid; border-width:1px; border-color:#000000;}
+
+   </style>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<script type="text/javascript">
+	
+		// D�pos� par Frosty sur www.toutjavascript.com
+		// 27/5/2003 - Ajout compatibilit� IE5 sur MacOS
+		// 5/6/2003  - Ajout compatibilit� Mozilla
+		// 5/9/2005  - Correction d'un bug (clic sur la bordure de la palette principale)
+		// 6/9/2005  - Ajout de la possibilit� de s�lectionner une couleur en d�pla�ant la souris
+		//             sur les palettes (bouton gauche enfonc�)
+
+		/*****************************************************************
+		* Script Color Picker �crit par Frosty (Maxime Pacary) - Mai 2003
+		******************************************************************/
+	
+		// var. globale
+		var detail = 50; // nombre de nuances de couleurs dans la barre de droite
+		
+		// ne pas modifier
+		var strhex = "0123456789ABCDEF";
+		var i;
+		var is_mouse_down = false;
+		var is_mouse_over = false;
+		
+		// conversion decimal (0-255) => hexa
+		function dechex(n) {
+			return strhex.charAt(Math.floor(n/16)) + strhex.charAt(n%16);
+		}
+
+		// d�tection d'un clic/mouvement souris sur la "palette" (� gauche)
+		function compute_color(e)
+		{
+			x = e.offsetX ? e.offsetX : (e.target ? e.clientX-e.target.x : 0);
+			y = e.offsetY ? e.offsetY : (e.target ? e.clientY-e.target.y : 0);
+			
+			// calcul de la couleur � partir des coordonn�es du clic
+			var part_width = document.all ? document.all.color_picker.width/6 : document.getElementById('color_picker').width/6;
+			var part_detail = detail/2;
+			var im_height = document.all ? document.all.color_picker.height : document.getElementById('color_picker').height;
+			
+			
+			var red = (x >= 0)*(x < part_width)*255
+					+ (x >= part_width)*(x < 2*part_width)*(2*255 - x * 255 / part_width)
+					+ (x >= 4*part_width)*(x < 5*part_width)*(-4*255 + x * 255 / part_width)
+					+ (x >= 5*part_width)*(x < 6*part_width)*255;
+			var blue = (x >= 2*part_width)*(x < 3*part_width)*(-2*255 + x * 255 / part_width)
+					+ (x >= 3*part_width)*(x < 5*part_width)*255
+					+ (x >= 5*part_width)*(x < 6*part_width)*(6*255 - x * 255 / part_width);
+			var green = (x >= 0)*(x < part_width)*(x * 255 / part_width)
+					+ (x >= part_width)*(x < 3*part_width)*255
+					+ (x >= 3*part_width)*(x < 4*part_width)*(4*255 - x * 255 / part_width);
+			
+			var coef = (im_height-y)/im_height;
+			
+			// composantes de la couleur choisie sur la "palette"
+			red = 128+(red-128)*coef;
+			green = 128+(green-128)*coef;
+			blue = 128+(blue-128)*coef;
+			
+			// mise � jour de la couleur finale
+			changeFinalColor('#' + dechex(red) + dechex(green) + dechex(blue));
+			
+			// mise � jour de la barre de droite en fonction de cette couleur
+			for(i = 0; i < detail; i++)
+			{
+				if ((i >= 0) && (i < part_detail))
+				{
+					var final_coef = i/part_detail ;
+					var final_red = dechex(255 - (255 - red) * final_coef);
+					var final_green = dechex(255 - (255 - green) * final_coef);
+					var final_blue = dechex(255 - (255 - blue) * final_coef);
+				}
+				else
+				{
+					var final_coef = 2 - i/part_detail ;
+					var final_red = dechex(red * final_coef);
+					var final_green = dechex(green * final_coef);
+					var final_blue = dechex(blue * final_coef);
+				}
+				color = final_red + final_green + final_blue ;
+				document.all ? document.all('gs'+i).style.backgroundColor = '#'+color : document.getElementById('gs'+i).style.backgroundColor = '#'+color;
+			}
+			
+		}
+		
+		// pour afficher la couleur finale choisie
+		function changeFinalColor(color)
+		{
+			document.forms['colpick_form'].elements['btn_choose_color'].style.backgroundColor = color;
+			document.forms['colpick_form'].elements['btn_choose_color'].style.borderColor = color;
+		}
+		
+		// "renvoyer" la couleur en cliquant sur OK
+		function send_color()
+		{
+			if (window.opener)
+			{
+			   var new_color = document.forms['colpick_form'].elements['btn_choose_color'].style.backgroundColor;
+			   exp_rgb = new RegExp("rgb","g");
+			   if (exp_rgb.test(new_color))
+			   {
+			   	exp_extract = new RegExp("[0-9]+","g");
+			   	var tab_rgb = new_color.match(exp_extract);
+			   	
+			      new_color = '#'+dechex(parseInt(tab_rgb[0]))+dechex(parseInt(tab_rgb[1]))+dechex(parseInt(tab_rgb[2]));
+			   }
+                window.opener.document.forms['Form'].elements['couleur'].value = new_color;
+        	     window.opener.document.forms['Form'].elements['exemple'].style.borderColor = new_color;
+			   window.opener.document.forms['Form'].elements['exemple'].style.backgroundColor = new_color;
+				window.opener.focus();
+				window.close();
+			}
+		}
+		
+		window.focus();
+	
+	</script>
+</head>
+
+<body>
+   <form name="colpick_form" action="#" method="post">
+
+	<h2>Choisissez une couleur</h2>
+	<table border="0" cellspacing="0" cellpadding="0" align="center">
+		<tr>
+			<td>
+				<table border="1" cellspacing="0" cellpadding="0" class="table_black_border">
+					<tr>
+						<td style="padding:0px; border-width:0px; border-style:none;">
+							<img id="color_picker" src="colpick.jpg" onclick="compute_color(event)"
+							   onmousedown="is_mouse_down = true; return false;"
+							   onmouseup="is_mouse_down = false;"
+							   onmousemove="if (is_mouse_down && is_mouse_over) compute_color(event); return false;"
+							   onmouseover="is_mouse_over = true;"
+							   onmouseout="is_mouse_over = false;"
+                        style="cursor:crosshair;" /></td>
+
+						</td>
+					</tr>
+				</table>
+			<td style="background-color:#ffffff; width:20px; height:2px; padding:0px;"></td>
+			<td>
+				<table border="1" cellspacing="0" cellpadding="0" class="table_black_border" style="cursor:crosshair">
+					<script type="text/javascript">
+					
+						for(i = 0; i < detail; i++)
+						{
+							document.write('<tr><td id="gs'+i+'" style="background-color:#000000; width:20px; height:3px; border-style:none; border-width:0px;"'
+                        + ' onclick="changeFinalColor(this.style.backgroundColor)"'
+                        + ' onmousedown="is_mouse_down = true; return false;"'
+                        + ' onmouseup="is_mouse_down = false;"'
+                        + ' onmousemove="if (is_mouse_down && is_mouse_over) changeFinalColor(this.style.backgroundColor); return false;"'
+                        + ' onmouseover="is_mouse_over = true;"'
+							   + ' onmouseout="is_mouse_over = false;"'
+                        
+                        + '></td></tr>');
+						}
+					
+					</script>
+				</table>
+
+			</td>
+		</tr>
+	</table>
+	<br>
+	<table align="center">
+		<tr valign="center">
+			<td>R&eacute;sultat :</td>
+			<td><input type="button" name="btn_choose_color" value="&nbsp;" style="background-color:#000000; border-color:#000000; width:100px; height:35px;"></td>
+
+			<td><input type="button" name="btn_ok" value="Ok" style="width:70px" onclick="send_color();"></td>
+		</tr>
+		
+	</table>
+	</form>
+
+</body>
+</html>
+
+
diff --git a/GPL_LIB/Color_Picker/color_picker.php b/GPL_LIB/Color_Picker/color_picker.php
new file mode 100644
index 0000000000000000000000000000000000000000..b27c6c61a86bce493e7cd7977a4c712634fbc077
--- /dev/null
+++ b/GPL_LIB/Color_Picker/color_picker.php
@@ -0,0 +1,202 @@
+<?php
+$n ="";
+$name ="";
+$title ="";
+
+$n = $_GET['n'];
+$name = $_GET['name'];
+$title = $_GET['title'];
+
+$name1 = $n."";
+$name2 = $n."_color";
+?>
+<html>
+<head>
+	<title>Color Picker</title>
+	<style type="text/css">
+	
+		body	{ font-size: 12px; font-family: Verdana, Sans-Serif; text-align:center; background-color:#FFFFFF; color:navy;}
+		td  { font-size: 12px; font-family: Verdana, Sans-Serif; text-align:center; background-color:#FFFFFF}
+		.table_black_border {border-style:solid; border-width:1px; border-color:#000000;}
+
+   </style>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<script type="text/javascript">
+	
+		// D�pos� par Frosty sur www.toutjavascript.com
+		// 27/5/2003 - Ajout compatibilit� IE5 sur MacOS
+		// 5/6/2003  - Ajout compatibilit� Mozilla
+		// 5/9/2005  - Correction d'un bug (clic sur la bordure de la palette principale)
+		// 6/9/2005  - Ajout de la possibilit� de s�lectionner une couleur en d�pla�ant la souris
+		//             sur les palettes (bouton gauche enfonc�)
+
+		/*****************************************************************
+		* Script Color Picker �crit par Frosty (Maxime Pacary) - Mai 2003
+		******************************************************************/
+	
+		// var. globale
+		var detail = 50; // nombre de nuances de couleurs dans la barre de droite
+		
+		// ne pas modifier
+		var strhex = "0123456789ABCDEF";
+		var i;
+		var is_mouse_down = false;
+		var is_mouse_over = false;
+		
+		// conversion decimal (0-255) => hexa
+		function dechex(n) {
+			return strhex.charAt(Math.floor(n/16)) + strhex.charAt(n%16);
+		}
+
+		// d�tection d'un clic/mouvement souris sur la "palette" (� gauche)
+		function compute_color(e)
+		{
+			x = e.offsetX ? e.offsetX : (e.target ? e.clientX-e.target.x : 0);
+			y = e.offsetY ? e.offsetY : (e.target ? e.clientY-e.target.y : 0);
+			
+			// calcul de la couleur � partir des coordonn�es du clic
+			var part_width = document.all ? document.all.color_picker.width/6 : document.getElementById('color_picker').width/6;
+			var part_detail = detail/2;
+			var im_height = document.all ? document.all.color_picker.height : document.getElementById('color_picker').height;
+			
+			
+			var red = (x >= 0)*(x < part_width)*255
+					+ (x >= part_width)*(x < 2*part_width)*(2*255 - x * 255 / part_width)
+					+ (x >= 4*part_width)*(x < 5*part_width)*(-4*255 + x * 255 / part_width)
+					+ (x >= 5*part_width)*(x < 6*part_width)*255;
+			var blue = (x >= 2*part_width)*(x < 3*part_width)*(-2*255 + x * 255 / part_width)
+					+ (x >= 3*part_width)*(x < 5*part_width)*255
+					+ (x >= 5*part_width)*(x < 6*part_width)*(6*255 - x * 255 / part_width);
+			var green = (x >= 0)*(x < part_width)*(x * 255 / part_width)
+					+ (x >= part_width)*(x < 3*part_width)*255
+					+ (x >= 3*part_width)*(x < 4*part_width)*(4*255 - x * 255 / part_width);
+			
+			var coef = (im_height-y)/im_height;
+			
+			// composantes de la couleur choisie sur la "palette"
+			red = 128+(red-128)*coef;
+			green = 128+(green-128)*coef;
+			blue = 128+(blue-128)*coef;
+			
+			// mise � jour de la couleur finale
+			changeFinalColor('#' + dechex(red) + dechex(green) + dechex(blue));
+			
+			// mise � jour de la barre de droite en fonction de cette couleur
+			for(i = 0; i < detail; i++)
+			{
+				if ((i >= 0) && (i < part_detail))
+				{
+					var final_coef = i/part_detail ;
+					var final_red = dechex(255 - (255 - red) * final_coef);
+					var final_green = dechex(255 - (255 - green) * final_coef);
+					var final_blue = dechex(255 - (255 - blue) * final_coef);
+				}
+				else
+				{
+					var final_coef = 2 - i/part_detail ;
+					var final_red = dechex(red * final_coef);
+					var final_green = dechex(green * final_coef);
+					var final_blue = dechex(blue * final_coef);
+				}
+				color = final_red + final_green + final_blue ;
+				document.all ? document.all('gs'+i).style.backgroundColor = '#'+color : document.getElementById('gs'+i).style.backgroundColor = '#'+color;
+			}
+			
+		}
+		
+		// pour afficher la couleur finale choisie
+		function changeFinalColor(color)
+		{
+			document.forms['colpick_form'].elements['btn_choose_color'].style.backgroundColor = color;
+			document.forms['colpick_form'].elements['btn_choose_color'].style.borderColor = color;
+		}
+		
+		// "renvoyer" la couleur en cliquant sur OK
+		function send_color()
+		{
+			if (window.opener)
+			{
+			   var new_color = document.forms['colpick_form'].elements['btn_choose_color'].style.backgroundColor;
+			   exp_rgb = new RegExp("rgb","g");
+			   if (exp_rgb.test(new_color))
+			   {
+			   	exp_extract = new RegExp("[0-9]+","g");
+			   	var tab_rgb = new_color.match(exp_extract);
+			   	
+			      new_color = '#'+dechex(parseInt(tab_rgb[0]))+dechex(parseInt(tab_rgb[1]))+dechex(parseInt(tab_rgb[2]));
+			   }
+
+                window.opener.document.forms['Form'].elements['<? echo $name1; ?>'].value = new_color;
+        	     window.opener.document.forms['Form'].elements['<? echo $name2;?>'].style.borderColor = new_color;
+			   window.opener.document.forms['Form'].elements['<? echo $name2; ?>'].style.backgroundColor = new_color;
+				window.opener.focus();
+				window.close();
+			}
+		}
+		
+		window.focus();
+	
+	</script>
+</head>
+
+<body>
+   <form name="colpick_form" action="#" method="post">
+
+	<h2><? echo $title; ?></h2>
+	<h3><? echo $name; ?></h3>
+	<table border="0" cellspacing="0" cellpadding="0" align="center">
+		<tr>
+			<td>
+				<table border="1" cellspacing="0" cellpadding="0" class="table_black_border">
+					<tr>
+						<td style="padding:0px; border-width:0px; border-style:none;">
+							<img id="color_picker" src="colpick.jpg" onclick="compute_color(event)"
+							   onmousedown="is_mouse_down = true; return false;"
+							   onmouseup="is_mouse_down = false;"
+							   onmousemove="if (is_mouse_down && is_mouse_over) compute_color(event); return false;"
+							   onmouseover="is_mouse_over = true;"
+							   onmouseout="is_mouse_over = false;"
+                        style="cursor:crosshair;" /></td>
+
+						</td>
+					</tr>
+				</table>
+			<td style="background-color:#ffffff; width:20px; height:2px; padding:0px;"></td>
+			<td>
+				<table border="1" cellspacing="0" cellpadding="0" class="table_black_border" style="cursor:crosshair">
+					<script type="text/javascript">
+					
+						for(i = 0; i < detail; i++)
+						{
+							document.write('<tr><td id="gs'+i+'" style="background-color:#000000; width:20px; height:3px; border-style:none; border-width:0px;"'
+                        + ' onclick="changeFinalColor(this.style.backgroundColor)"'
+                        + ' onmousedown="is_mouse_down = true; return false;"'
+                        + ' onmouseup="is_mouse_down = false;"'
+                        + ' onmousemove="if (is_mouse_down && is_mouse_over) changeFinalColor(this.style.backgroundColor); return false;"'
+                        + ' onmouseover="is_mouse_over = true;"'
+				   + ' onmouseout="is_mouse_over = false;"'
+                        
+                        + '></td></tr>');
+						}
+					
+					</script>
+				</table>
+
+			</td>
+		</tr>
+	</table>
+	<br>
+	<table align="center">
+		<tr valign="center">
+			<td><input type="button" name="btn_choose_color" value="&nbsp;" style="background-color:#000000; border-color:#000000; width:100px; height:35px;"></td>
+
+			<td><input type="button" name="btn_ok" value="Ok" style="width:70px" onclick="send_color();"></td>
+		</tr>
+		
+	</table>
+	</form>
+
+</body>
+</html>
+
+
diff --git a/GPL_LIB/Color_Picker/colpick.html b/GPL_LIB/Color_Picker/colpick.html
new file mode 100644
index 0000000000000000000000000000000000000000..0ee926fa7f934ebd3a3298ed4e0cdb1de9288468
--- /dev/null
+++ b/GPL_LIB/Color_Picker/colpick.html
@@ -0,0 +1,42 @@
+<html>
+<head>
+	<title>Color Picker</title>
+	<style type="text/css">
+	
+   	body	{ font-size: 12px; font-family: Verdana, Sans-Serif; text-align:center; background-color:#ffffff; color:navy;}
+		td  { font-size: 12px; font-family: Verdana, Sans-Serif; text-align:center; background-color:#ffffff}
+	
+   </style>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<script type="text/javascript">
+	
+		function popup_color_picker()
+		{
+			var width = 400;
+			var height = 300;
+			window.open('color_picker.html', 'cp', 'resizable=no, location=no, width='
+						+width+', height='+height+', menubar=no, status=yes, scrollbars=no, menubar=no');
+		}
+		
+	</script>
+</head>
+
+<body>
+   <form name="opener_form" action="#" method="post">
+   
+	<h2>Test Color Picker</h2>
+	<table align="center">
+		<tr>
+			<td>Couleur : </td>
+			<td><input type="text" name="couleur" size="7" maxlength="7" value="#000000" style="width:70px;"></td>
+			<td><input type="button" name="exemple" style="width:60px; height:25px; background-color:#000000; border-color:#000000;"></td>
+			<td><input type="button" value="Changer..." onclick="popup_color_picker();"></td>
+      </tr>
+	</table>
+	
+	</form>
+	<p>Cliquer sur le bouton Changer pour choisir une nouvelle couleur.</p>
+	<p>Compatible Internet Explorer 5.0+ et Mozilla.</p>
+   <p>Script �galement disponible sur <a href="www.toutjavascript.com">www.toutjavascript.com</a></p>
+</body>
+</html>
diff --git a/GPL_LIB/Color_Picker/colpick.jpg b/GPL_LIB/Color_Picker/colpick.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..b4c542d107b25f68a9d4f9d7a109d0565d1f1437
Binary files /dev/null and b/GPL_LIB/Color_Picker/colpick.jpg differ
diff --git a/GPL_LIB/Date_Picker/datePicker.css b/GPL_LIB/Date_Picker/datePicker.css
new file mode 100644
index 0000000000000000000000000000000000000000..6622fbb3ba2b27204de993cdfd87b86ada5cfed6
--- /dev/null
+++ b/GPL_LIB/Date_Picker/datePicker.css
@@ -0,0 +1,120 @@
+body {
+	font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
+	font-size: .8em;
+	}
+
+/* the div that holds the date picker calendar */
+.dpDiv {
+	}
+
+
+/* the table (within the div) that holds the date picker calendar */
+.dpTable {
+	font-family: Tahoma, Arial, Helvetica, sans-serif;
+	font-size: 12px;
+	text-align: center;
+	color: #505050;
+	background-color: #ece9d8;
+	border: 1px solid #AAAAAA;
+	}
+
+
+/* a table row that holds date numbers (either blank or 1-31) */
+.dpTR {
+	}
+
+
+/* the top table row that holds the month, year, and forward/backward buttons */
+.dpTitleTR {
+	}
+
+
+/* the second table row, that holds the names of days of the week (Mo, Tu, We, etc.) */
+.dpDayTR {
+	}
+
+
+/* the bottom table row, that has the "This Month" and "Close" buttons */
+.dpTodayButtonTR {
+	}
+
+
+/* a table cell that holds a date number (either blank or 1-31) */
+.dpTD {
+	border: 1px solid #ece9d8;
+	}
+
+
+/* a table cell that holds a highlighted day (usually either today's date or the current date field value) */
+.dpDayHighlightTD {
+	background-color: #CCCCCC;
+	border: 1px solid #AAAAAA;
+	}
+
+
+/* the date number table cell that the mouse pointer is currently over (you can use contrasting colors to make it apparent which cell is being hovered over) */
+.dpTDHover {
+	background-color: #aca998;
+	border: 1px solid #888888;
+	cursor: pointer;
+	color: red;
+	}
+
+
+/* the table cell that holds the name of the month and the year */
+.dpTitleTD {
+	}
+
+
+/* a table cell that holds one of the forward/backward buttons */
+.dpButtonTD {
+	}
+
+
+/* the table cell that holds the "This Month" or "Close" button at the bottom */
+.dpTodayButtonTD {
+	}
+
+
+/* a table cell that holds the names of days of the week (Mo, Tu, We, etc.) */
+.dpDayTD {
+	background-color: #CCCCCC;
+	border: 1px solid #AAAAAA;
+	color: white;
+	}
+
+
+/* additional style information for the text that indicates the month and year */
+.dpTitleText {
+	font-size: 12px;
+	color: gray;
+	font-weight: bold;
+	}
+
+
+/* additional style information for the cell that holds a highlighted day (usually either today's date or the current date field value) */ 
+.dpDayHighlight {
+	color: 4060ff;
+	font-weight: bold;
+	}
+
+
+/* the forward/backward buttons at the top */
+.dpButton {
+	font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
+	font-size: 10px;
+	color: gray;
+	background: #d8e8ff;
+	font-weight: bold;
+	padding: 0px;
+	}
+
+
+/* the "This Month" and "Close" buttons at the bottom */
+.dpTodayButton {
+	font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
+	font-size: 10px;
+	color: gray;
+	background: #d8e8ff;
+	font-weight: bold;
+	}
\ No newline at end of file
diff --git a/GPL_LIB/Date_Picker/datePicker.js b/GPL_LIB/Date_Picker/datePicker.js
new file mode 100644
index 0000000000000000000000000000000000000000..f5fb437d5a686cc4140f0479e721f90bb4ea9b5a
--- /dev/null
+++ b/GPL_LIB/Date_Picker/datePicker.js
@@ -0,0 +1,498 @@
+/**
+This is a JavaScript library that will allow you to easily add some basic DHTML
+drop-down datepicker functionality to your Notes forms. This script is not as
+full-featured as others you may find on the Internet, but it's free, it's easy to
+understand, and it's easy to change.
+
+You'll also want to include a stylesheet that makes the datepicker elements
+look nice. An example one can be found in the database that this script was
+originally released with, at:
+
+http://www.nsftools.com/tips/NotesTips.htm#datepicker
+
+I've tested this lightly with Internet Explorer 6 and Mozilla Firefox. I have no idea
+how compatible it is with other browsers.
+
+version 1.5
+December 4, 2005
+Julian Robichaux -- http://www.nsftools.com
+
+HISTORY
+--  version 1.0 (Sept. 4, 2004):
+Initial release.
+
+--  version 1.1 (Sept. 5, 2004):
+Added capability to define the date format to be used, either globally (using the
+defaultDateSeparator and defaultDateFormat variables) or when the displayDatePicker
+function is called.
+
+--  version 1.2 (Sept. 7, 2004):
+Fixed problem where datepicker x-y coordinates weren't right inside of a table.
+Fixed problem where datepicker wouldn't display over selection lists on a page.
+Added a call to the datePickerClosed function (if one exists) after the datepicker
+is closed, to allow the developer to add their own custom validation after a date
+has been chosen. For this to work, you must have a function called datePickerClosed
+somewhere on the page, that accepts a field object as a parameter. See the
+example in the comments of the updateDateField function for more details.
+
+--  version 1.3 (Sept. 9, 2004)
+Fixed problem where adding the <div> and <iFrame> used for displaying the datepicker
+was causing problems on IE 6 with global variables that had handles to objects on
+the page (I fixed the problem by adding the elements using document.createElement()
+and document.body.appendChild() instead of document.body.innerHTML += ...).
+
+--  version 1.4 (Dec. 20, 2004)
+Added "targetDateField.focus();" to the updateDateField function (as suggested
+by Alan Lepofsky) to avoid a situation where the cursor focus is at the top of the
+form after a date has been picked. Added "padding: 0px;" to the dpButton CSS
+style, to keep the table from being so wide when displayed in Firefox.
+
+-- version 1.5 (Dec 4, 2005)
+Added display=none when datepicker is hidden, to fix problem where cursor is
+not visible on input fields that are beneath the date picker. Added additional null
+date handling for date errors in Safari when the date is empty. Added additional
+error handling for iFrame creation, to avoid reported errors in Opera. Added
+onMouseOver event for day cells, to allow color changes when the mouse hovers
+over a cell (to make it easier to determine what cell you're over). Added comments
+in the style sheet, to make it more clear what the different style elements are for.
+*/
+
+var datePickerDivID = "datepicker";
+var iFrameDivID = "datepickeriframe";
+
+var dayArrayShort = new Array('Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa');
+var dayArrayMed = new Array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
+var dayArrayLong = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
+var monthArrayShort = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
+var monthArrayMed = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec');
+var monthArrayLong = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
+ 
+// these variables define the date formatting we're expecting and outputting.
+// If you want to use a different format by default, change the defaultDateSeparator
+// and defaultDateFormat variables either here or on your HTML page.
+var defaultDateSeparator = "/";        // common values would be "/" or "."
+var defaultDateFormat = "mdy"    // valid values are "mdy", "dmy", and "ymd"
+var dateSeparator = defaultDateSeparator;
+var dateFormat = defaultDateFormat;
+
+/**
+This is the main function you'll call from the onClick event of a button.
+Normally, you'll have something like this on your HTML page:
+
+Start Date: <input name="StartDate">
+<input type=button value="select" onclick="displayDatePicker('StartDate');">
+
+That will cause the datepicker to be displayed beneath the StartDate field and
+any date that is chosen will update the value of that field. If you'd rather have the
+datepicker display beneath the button that was clicked, you can code the button
+like this:
+
+<input type=button value="select" onclick="displayDatePicker('StartDate', this);">
+
+So, pretty much, the first argument (dateFieldName) is a string representing the
+name of the field that will be modified if the user picks a date, and the second
+argument (displayBelowThisObject) is optional and represents an actual node
+on the HTML document that the datepicker should be displayed below.
+
+In version 1.1 of this code, the dtFormat and dtSep variables were added, allowing
+you to use a specific date format or date separator for a given call to this function.
+Normally, you'll just want to set these defaults globally with the defaultDateSeparator
+and defaultDateFormat variables, but it doesn't hurt anything to add them as optional
+parameters here. An example of use is:
+
+<input type=button value="select" onclick="displayDatePicker('StartDate', false, 'dmy', '.');">
+
+This would display the datepicker beneath the StartDate field (because the
+displayBelowThisObject parameter was false), and update the StartDate field with
+the chosen value of the datepicker using a date format of dd.mm.yyyy
+*/
+function displayDatePicker(dateFieldName, displayBelowThisObject, dtFormat, dtSep)
+{
+  var targetDateField = document.getElementsByName (dateFieldName).item(0);
+ 
+  // if we weren't told what node to display the datepicker beneath, just display it
+  // beneath the date field we're updating
+  if (!displayBelowThisObject)
+    displayBelowThisObject = targetDateField;
+ 
+  // if a date separator character was given, update the dateSeparator variable
+  if (dtSep)
+    dateSeparator = dtSep;
+  else
+    dateSeparator = defaultDateSeparator;
+ 
+  // if a date format was given, update the dateFormat variable
+  if (dtFormat)
+    dateFormat = dtFormat;
+  else
+    dateFormat = defaultDateFormat;
+ 
+  var x = displayBelowThisObject.offsetLeft;
+  var y = displayBelowThisObject.offsetTop + displayBelowThisObject.offsetHeight ;
+ 
+  // deal with elements inside tables and such
+  var parent = displayBelowThisObject;
+  while (parent.offsetParent) {
+    parent = parent.offsetParent;
+    x += parent.offsetLeft;
+    y += parent.offsetTop ;
+  }
+ 
+  drawDatePicker(targetDateField, x, y);
+}
+
+
+/**
+Draw the datepicker object (which is just a table with calendar elements) at the
+specified x and y coordinates, using the targetDateField object as the input tag
+that will ultimately be populated with a date.
+
+This function will normally be called by the displayDatePicker function.
+*/
+function drawDatePicker(targetDateField, x, y)
+{
+  var dt = getFieldDate(targetDateField.value );
+ 
+  // the datepicker table will be drawn inside of a <div> with an ID defined by the
+  // global datePickerDivID variable. If such a div doesn't yet exist on the HTML
+  // document we're working with, add one.
+  if (!document.getElementById(datePickerDivID)) {
+    // don't use innerHTML to update the body, because it can cause global variables
+    // that are currently pointing to objects on the page to have bad references
+    //document.body.innerHTML += "<div id='" + datePickerDivID + "' class='dpDiv'></div>";
+    var newNode = document.createElement("div");
+    newNode.setAttribute("id", datePickerDivID);
+    newNode.setAttribute("class", "dpDiv");
+    newNode.setAttribute("style", "visibility: hidden;");
+    document.body.appendChild(newNode);
+  }
+ 
+  // move the datepicker div to the proper x,y coordinate and toggle the visiblity
+  var pickerDiv = document.getElementById(datePickerDivID);
+  pickerDiv.style.position = "absolute";
+  pickerDiv.style.left = x + "px";
+  pickerDiv.style.top = y + "px";
+  pickerDiv.style.visibility = (pickerDiv.style.visibility == "visible" ? "hidden" : "visible");
+  pickerDiv.style.display = (pickerDiv.style.display == "block" ? "none" : "block");
+  pickerDiv.style.zIndex = 10000;
+ 
+  // draw the datepicker table
+  refreshDatePicker(targetDateField.name, dt.getFullYear(), dt.getMonth(), dt.getDate());
+}
+
+
+/**
+This is the function that actually draws the datepicker calendar.
+*/
+function refreshDatePicker(dateFieldName, year, month, day)
+{
+  // if no arguments are passed, use today's date; otherwise, month and year
+  // are required (if a day is passed, it will be highlighted later)
+  var thisDay = new Date();
+ 
+  if ((month >= 0) && (year > 0)) {
+    thisDay = new Date(year, month, 1);
+  } else {
+    day = thisDay.getDate();
+    thisDay.setDate(1);
+  }
+ 
+  // the calendar will be drawn as a table
+  // you can customize the table elements with a global CSS style sheet,
+  // or by hardcoding style and formatting elements below
+  var crlf = "\r\n";
+  var TABLE = "<table cols=7 class='dpTable'>" + crlf;
+  var xTABLE = "</table>" + crlf;
+  var TR = "<tr class='dpTR'>";
+  var TR_title = "<tr class='dpTitleTR'>";
+  var TR_days = "<tr class='dpDayTR'>";
+  var TR_todaybutton = "<tr class='dpTodayButtonTR'>";
+  var xTR = "</tr>" + crlf;
+  var TD = "<td class='dpTD' onMouseOut='this.className=\"dpTD\";' onMouseOver=' this.className=\"dpTDHover\";' ";    // leave this tag open, because we'll be adding an onClick event
+  var TD_title = "<td colspan=5 class='dpTitleTD'>";
+  var TD_buttons = "<td class='dpButtonTD'>";
+  var TD_todaybutton = "<td colspan=7 class='dpTodayButtonTD'>";
+  var TD_days = "<td class='dpDayTD'>";
+  var TD_selected = "<td class='dpDayHighlightTD' onMouseOut='this.className=\"dpDayHighlightTD\";' onMouseOver='this.className=\"dpTDHover\";' ";    // leave this tag open, because we'll be adding an onClick event
+  var xTD = "</td>" + crlf;
+  var DIV_title = "<div class='dpTitleText'>";
+  var DIV_selected = "<div class='dpDayHighlight'>";
+  var xDIV = "</div>";
+ 
+  // start generating the code for the calendar table
+  var html = TABLE;
+ 
+  // this is the title bar, which displays the month and the buttons to
+  // go back to a previous month or forward to the next month
+  html += TR_title;
+  html += TD_buttons + getButtonCode(dateFieldName, thisDay, -1, "&lt;") + xTD;
+  html += TD_title + DIV_title + monthArrayLong[ thisDay.getMonth()] + " " + thisDay.getFullYear() + xDIV + xTD;
+  html += TD_buttons + getButtonCode(dateFieldName, thisDay, 1, "&gt;") + xTD;
+  html += xTR;
+ 
+  // this is the row that indicates which day of the week we're on
+  html += TR_days;
+  for(i = 0; i < dayArrayShort.length; i++)
+    html += TD_days + dayArrayShort[i] + xTD;
+  html += xTR;
+ 
+  // now we'll start populating the table with days of the month
+  html += TR;
+ 
+  // first, the leading blanks
+  for (i = 0; i < thisDay.getDay(); i++)
+    html += TD + "&nbsp;" + xTD;
+ 
+  // now, the days of the month
+  do {
+    dayNum = thisDay.getDate();
+    TD_onclick = " onclick=\"updateDateField('" + dateFieldName + "', '" + getDateString(thisDay) + "');\">";
+    
+    if (dayNum == day)
+      html += TD_selected + TD_onclick + DIV_selected + dayNum + xDIV + xTD;
+    else
+      html += TD + TD_onclick + dayNum + xTD;
+    
+    // if this is a Saturday, start a new row
+    if (thisDay.getDay() == 6)
+      html += xTR + TR;
+    
+    // increment the day
+    thisDay.setDate(thisDay.getDate() + 1);
+  } while (thisDay.getDate() > 1)
+ 
+  // fill in any trailing blanks
+  if (thisDay.getDay() > 0) {
+    for (i = 6; i > thisDay.getDay(); i--)
+      html += TD + "&nbsp;" + xTD;
+  }
+  html += xTR;
+ 
+  // add a button to allow the user to easily return to today, or close the calendar
+  var today = new Date();
+  var todayString = "Today is " + dayArrayMed[today.getDay()] + ", " + monthArrayMed[ today.getMonth()] + " " + today.getDate();
+  html += TR_todaybutton + TD_todaybutton;
+  html += "<button class='dpTodayButton' onClick='refreshDatePicker(\"" + dateFieldName + "\");'>this month</button> ";
+  html += "<button class='dpTodayButton' onClick='updateDateField(\"" + dateFieldName + "\");'>close</button>";
+  html += xTD + xTR;
+ 
+  // and finally, close the table
+  html += xTABLE;
+ 
+  document.getElementById(datePickerDivID).innerHTML = html;
+  // add an "iFrame shim" to allow the datepicker to display above selection lists
+  adjustiFrame();
+}
+
+
+/**
+Convenience function for writing the code for the buttons that bring us back or forward
+a month.
+*/
+function getButtonCode(dateFieldName, dateVal, adjust, label)
+{
+  var newMonth = (dateVal.getMonth () + adjust) % 12;
+  var newYear = dateVal.getFullYear() + parseInt((dateVal.getMonth() + adjust) / 12);
+  if (newMonth < 0) {
+    newMonth += 12;
+    newYear += -1;
+  }
+ 
+  return "<button class='dpButton' onClick='refreshDatePicker(\"" + dateFieldName + "\", " + newYear + ", " + newMonth + ");'>" + label + "</button>";
+}
+
+
+/**
+Convert a JavaScript Date object to a string, based on the dateFormat and dateSeparator
+variables at the beginning of this script library.
+*/
+function getDateString(dateVal)
+{
+  var dayString = "00" + dateVal.getDate();
+  var monthString = "00" + (dateVal.getMonth()+1);
+  dayString = dayString.substring(dayString.length - 2);
+  monthString = monthString.substring(monthString.length - 2);
+ 
+  switch (dateFormat) {
+    case "dmy" :
+      return dayString + dateSeparator + monthString + dateSeparator + dateVal.getFullYear();
+    case "ymd" :
+      return dateVal.getFullYear() + dateSeparator + monthString + dateSeparator + dayString;
+    case "mdy" :
+    default :
+      return monthString + dateSeparator + dayString + dateSeparator + dateVal.getFullYear();
+  }
+}
+
+
+/**
+Convert a string to a JavaScript Date object.
+*/
+function getFieldDate(dateString)
+{
+  var dateVal;
+  var dArray;
+  var d, m, y;
+ 
+  try {
+    dArray = splitDateString(dateString);
+    if (dArray) {
+      switch (dateFormat) {
+        case "dmy" :
+          d = parseInt(dArray[0], 10);
+          m = parseInt(dArray[1], 10) - 1;
+          y = parseInt(dArray[2], 10);
+          break;
+        case "ymd" :
+          d = parseInt(dArray[2], 10);
+          m = parseInt(dArray[1], 10) - 1;
+          y = parseInt(dArray[0], 10);
+          break;
+        case "mdy" :
+        default :
+          d = parseInt(dArray[1], 10);
+          m = parseInt(dArray[0], 10) - 1;
+          y = parseInt(dArray[2], 10);
+          break;
+      }
+      dateVal = new Date(y, m, d);
+    } else if (dateString) {
+      dateVal = new Date(dateString);
+    } else {
+      dateVal = new Date();
+    }
+  } catch(e) {
+    dateVal = new Date();
+  }
+ 
+  return dateVal;
+}
+
+
+/**
+Try to split a date string into an array of elements, using common date separators.
+If the date is split, an array is returned; otherwise, we just return false.
+*/
+function splitDateString(dateString)
+{
+  var dArray;
+  if (dateString.indexOf("/") >= 0)
+    dArray = dateString.split("/");
+  else if (dateString.indexOf(".") >= 0)
+    dArray = dateString.split(".");
+  else if (dateString.indexOf("-") >= 0)
+    dArray = dateString.split("-");
+  else if (dateString.indexOf("\\") >= 0)
+    dArray = dateString.split("\\");
+  else
+    dArray = false;
+ 
+  return dArray;
+}
+
+/**
+Update the field with the given dateFieldName with the dateString that has been passed,
+and hide the datepicker. If no dateString is passed, just close the datepicker without
+changing the field value.
+
+Also, if the page developer has defined a function called datePickerClosed anywhere on
+the page or in an imported library, we will attempt to run that function with the updated
+field as a parameter. This can be used for such things as date validation, setting default
+values for related fields, etc. For example, you might have a function like this to validate
+a start date field:
+
+function datePickerClosed(dateField)
+{
+  var dateObj = getFieldDate(dateField.value);
+  var today = new Date();
+  today = new Date(today.getFullYear(), today.getMonth(), today.getDate());
+ 
+  if (dateField.name == "StartDate") {
+    if (dateObj < today) {
+      // if the date is before today, alert the user and display the datepicker again
+      alert("Please enter a date that is today or later");
+      dateField.value = "";
+      document.getElementById(datePickerDivID).style.visibility = "visible";
+      adjustiFrame();
+    } else {
+      // if the date is okay, set the EndDate field to 7 days after the StartDate
+      dateObj.setTime(dateObj.getTime() + (7 * 24 * 60 * 60 * 1000));
+      var endDateField = document.getElementsByName ("EndDate").item(0);
+      endDateField.value = getDateString(dateObj);
+    }
+  }
+}
+
+*/
+function updateDateField(dateFieldName, dateString)
+{
+  var targetDateField = document.getElementsByName (dateFieldName).item(0);
+  if (dateString)
+    targetDateField.value = dateString;
+ 
+  var pickerDiv = document.getElementById(datePickerDivID);
+  pickerDiv.style.visibility = "hidden";
+  pickerDiv.style.display = "none";
+ 
+  adjustiFrame();
+  targetDateField.focus();
+ 
+  // after the datepicker has closed, optionally run a user-defined function called
+  // datePickerClosed, passing the field that was just updated as a parameter
+  // (note that this will only run if the user actually selected a date from the datepicker)
+  if ((dateString) && (typeof(datePickerClosed) == "function"))
+    datePickerClosed(targetDateField);
+}
+
+
+/**
+Use an "iFrame shim" to deal with problems where the datepicker shows up behind
+selection list elements, if they're below the datepicker. The problem and solution are
+described at:
+
+http://dotnetjunkies.com/WebLog/jking/archive/2003/07/21/488.aspx
+http://dotnetjunkies.com/WebLog/jking/archive/2003/10/30/2975.aspx
+*/
+function adjustiFrame(pickerDiv, iFrameDiv)
+{
+  // we know that Opera doesn't like something about this, so if we
+  // think we're using Opera, don't even try
+  var is_opera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
+  if (is_opera)
+    return;
+  
+  // put a try/catch block around the whole thing, just in case
+  try {
+    if (!document.getElementById(iFrameDivID)) {
+      // don't use innerHTML to update the body, because it can cause global variables
+      // that are currently pointing to objects on the page to have bad references
+      //document.body.innerHTML += "<iframe id='" + iFrameDivID + "' src='javascript:false;' scrolling='no' frameborder='0'>";
+      var newNode = document.createElement("iFrame");
+      newNode.setAttribute("id", iFrameDivID);
+      newNode.setAttribute("src", "javascript:false;");
+      newNode.setAttribute("scrolling", "no");
+      newNode.setAttribute ("frameborder", "0");
+      document.body.appendChild(newNode);
+    }
+    
+    if (!pickerDiv)
+      pickerDiv = document.getElementById(datePickerDivID);
+    if (!iFrameDiv)
+      iFrameDiv = document.getElementById(iFrameDivID);
+    
+    try {
+      iFrameDiv.style.position = "absolute";
+      iFrameDiv.style.width = pickerDiv.offsetWidth;
+      iFrameDiv.style.height = pickerDiv.offsetHeight ;
+      iFrameDiv.style.top = pickerDiv.style.top;
+      iFrameDiv.style.left = pickerDiv.style.left;
+      iFrameDiv.style.zIndex = pickerDiv.style.zIndex - 1;
+      iFrameDiv.style.visibility = pickerDiv.style.visibility ;
+      iFrameDiv.style.display = pickerDiv.style.display;
+    } catch(e) {
+    }
+ 
+  } catch (ee) {
+  }
+ 
+}
\ No newline at end of file
diff --git a/GPL_LIB/Smarty/BUGS b/GPL_LIB/Smarty/BUGS
new file mode 100644
index 0000000000000000000000000000000000000000..9f1a80f31c572a37414e44f7ab91cc8f17170367
--- /dev/null
+++ b/GPL_LIB/Smarty/BUGS
@@ -0,0 +1,7 @@
+Smarty is supported only in PHP 4.0.6 or later.
+
+Smarty versions previous to 2.0 require the PEAR libraries. Be sure to include
+the path to the PEAR libraries in your php include_path. Config_file.class.php
+uses the PEAR library for its error handling routines. PEAR comes with the PHP
+distribution. Unix users check /usr/local/lib/php, windows users check
+C:/php/pear.
diff --git a/GPL_LIB/Smarty/COPYING.lib b/GPL_LIB/Smarty/COPYING.lib
new file mode 100644
index 0000000000000000000000000000000000000000..3b204400cf3d548f93a0f4f8e85d41d7e39ecb59
--- /dev/null
+++ b/GPL_LIB/Smarty/COPYING.lib
@@ -0,0 +1,458 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
diff --git a/GPL_LIB/Smarty/ChangeLog b/GPL_LIB/Smarty/ChangeLog
new file mode 100644
index 0000000000000000000000000000000000000000..e9ff555a4b4f58613440605d6f2d63ac55a6a839
--- /dev/null
+++ b/GPL_LIB/Smarty/ChangeLog
@@ -0,0 +1,7574 @@
+2006-01-15  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fixed use of references $cache_attrs and $repeat in Smarty_Compiler.
+      
+      php does not allow to pass an assigned by reference to a function. since
+      php-5.1.2
+      the reference to the lval gets lost when passing an assignment.
+
+2005-12-31  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php:
+      fixed incompatible use of fread() in Smarty::_read_file()
+      it choke on php-5.1.1 and later.
+      thanks to andig for pointing this out.
+
+2005-12-21  boots  <jayboots@yahoo.com>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      Fix improper tokenization of certain inline math expressions.
+      
+      Thanks to gerard at forums for reporting this.
+
+2005-12-19  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.math.php:
+      fixed problem with math in certain LC_NUMERIC locales.
+      thanks to wiebren for providing problem+solution.
+
+2005-12-14  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS:
+      fixed iso-latin1 special chars
+
+2005-12-14  Monte Ohrt  <monte@ohrt.com>
+
+    * libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      update version numbers
+
+    * (Smarty_2_6_11)
+      NEWS:
+      commit NEWS file for 2.6.11
+
+2005-12-08  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/de/getting-started.xml:
+      sync with en
+
+2005-11-29  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fixed code generation of non-cacheable blocks to play well with php's
+      "Alternative syntax" used for example in compiled {if}..{else}..{/if}
+      blocks.
+      
+      (see: http://php.net/manual/en/control-structures.alternative-syntax.php
+      on "Alternative syntax")
+      
+      thanks to kihara from the forum.
+
+2005-11-26  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS:
+      fixed handling of multiple identical calls to {insert}.
+      
+      the function was called multiple times, but all inserts where replaced
+      by the results of the first call to the insert function.
+
+    * libs/plugins/compiler.assign.php
+      libs/plugins/function.config_load.php:
+      added credits
+
+    * libs/plugins/function.popup.php:
+      added "closeclick" from
+      http://www.bosrup.com/web/overlib/?Command_Reference
+
+2005-11-23  boots  <jayboots@yahoo.com>
+
+    * NEWS
+      libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/plugins/modifier.escape.php:
+      replace {} string access with equivalent substr() to avoid E_STRICT
+      warnings in PHP 5.1
+
+2005-11-09  boots  <jayboots@yahoo.com>
+
+    * NEWS
+      libs/Smarty.class.php:
+      return valid reference in get_config_vars() when given var is non-existant
+
+2005-10-11  Monte Ohrt  <monte@ohrt.com>
+
+    * libs/plugins/block.textformat.php
+      libs/plugins/compiler.assign.php
+      libs/plugins/function.assign_debug_info.php
+      libs/plugins/function.config_load.php
+      libs/plugins/function.counter.php
+      libs/plugins/function.eval.php
+      libs/plugins/function.fetch.php
+      libs/plugins/function.html_options.php
+      libs/plugins/function.html_select_date.php
+      libs/plugins/function.html_select_time.php
+      libs/plugins/function.math.php
+      libs/plugins/function.popup.php
+      libs/plugins/function.popup_init.php
+      libs/plugins/modifier.capitalize.php
+      libs/plugins/modifier.count_characters.php
+      libs/plugins/modifier.count_paragraphs.php
+      libs/plugins/modifier.count_sentences.php
+      libs/plugins/modifier.count_words.php
+      libs/plugins/modifier.date_format.php
+      libs/plugins/modifier.debug_print_var.php
+      libs/plugins/modifier.default.php
+      libs/plugins/modifier.escape.php
+      libs/plugins/modifier.indent.php
+      libs/plugins/modifier.lower.php
+      libs/plugins/modifier.regex_replace.php
+      libs/plugins/modifier.replace.php
+      libs/plugins/modifier.spacify.php
+      libs/plugins/modifier.string_format.php
+      libs/plugins/modifier.strip_tags.php
+      libs/plugins/modifier.truncate.php
+      libs/plugins/modifier.upper.php
+      libs/plugins/modifier.wordwrap.php
+      libs/plugins/shared.escape_special_chars.php
+      libs/plugins/shared.make_timestamp.php:
+      Added author title to plugins where they don't exist. I put my name where I
+      was the original or co-author. If there needs to be more credit given
+      somewhere, speak up!
+
+2005-10-10  Monte Ohrt  <monte@ohrt.com>
+
+    * NEWS
+      libs/plugins/function.html_image.php:
+      add path_prefix to html_image, fix incorrect secure_dir error when image
+      file is missing
+
+2005-10-04  Monte Ohrt  <monte@ohrt.com>
+
+    * demo/templates/index.tpl:
+      remove popup example, update section var syntax
+
+2005-09-16  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/de/getting-started.xml:
+      more fixes
+
+    * docs/de/getting-started.xml:
+      fix php bug #34520: broken example display (de only)
+
+2005-08-30  Monte Ohrt  <monte@ohrt.com>
+
+    * libs/plugins/modifier.escape.php:
+      change default charset from utf8 to iso-8859-1
+
+    * NEWS
+      libs/plugins/modifier.escape.php:
+      add char_set param
+
+2005-08-17  Monte Ohrt  <monte@ohrt.com>
+
+    * NEWS:
+      fix notice in debug security check
+
+    * libs/Smarty.class.php:
+      fix typo
+
+    * NEWS
+      libs/Smarty.class.php:
+      return valid reference in get_template_vars() when given var is
+      non-existant
+
+2005-08-12  Monte Ohrt  <monte@ohrt.com>
+
+    * NEWS
+      libs/plugins/modifier.escape.php:
+      add "urlpathinfo" escape type to escape modifier. (apache does not like %2F
+      in the PATH_INFO)
+
+2005-08-05  Monte Ohrt  <monte@ohrt.com>
+
+    * NEWS
+      libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      update version numbers
+
+2005-08-04  Monte Ohrt  <monte@ohrt.com>
+
+    * NEWS:
+      update secure_dir notes
+
+    * NEWS:
+      allow debug.tpl to work from arbitrary dir
+
+2005-08-04  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fixed proper escaping for literal strings passed to
+      Smarty_Compiler::_expand_quoted_text() by
+      Smarty_Compiler::_parse_var_props()
+
+2005-07-27  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/shared.make_timestamp.php:
+      removed ambiguity for numeric values passed to smarty_make_timestamp().
+      numeric values are *always* treated as timestamps now.
+
+2005-07-18  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Config_File.class.php:
+      removed E_NOTICE from Config_File::get()
+
+    * libs/Smarty.class.php:
+      removed E_NOTICE
+
+2005-07-10  Yannick Torres  <yannick.torres@keliglia.com>
+
+    * docs/fr/getting-started.xml:
+      sync with EN
+
+2005-07-08  Monte Ohrt  <monte@ohrt.com>
+
+    * NEWS:
+      correct username in NEWS file
+
+    * NEWS
+      libs/plugins/function.html_select_date.php:
+      added passthru attribute feature to html_select_date
+
+2005-07-03  Yannick Torres  <yannick.torres@keliglia.com>
+
+    * docs/fr/language-snippets.ent
+      docs/fr/preface.xml:
+      sync with EN
+
+2005-06-16  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/de/preface.xml
+      docs/de/preface.xml:
+      sync with en
+
+2005-06-13  Monte Ohrt  <monte@ohrt.com>
+
+    * NEWS
+      libs/plugins/modifier.truncate.php:
+      add "middle" parameter to truncate modifier
+
+2005-06-10  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/de/livedocs.ent:
+      added german livedocs.ent
+
+    * docs/de/language-snippets.ent
+      docs/de/preface.xml:
+      sync with en
+
+2005-06-09  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/de/bookinfo.xml
+      docs/de/getting-started.xml
+      docs/de/getting-started.xml:
+      sync with en
+
+2005-05-24  Yannick Torres  <yannick.torres@keliglia.com>
+
+    * docs/fr/getting-started.xml
+      docs/fr/language-snippets.ent:
+      sync with EN
+
+2005-05-20  Monte Ohrt  <monte@ohrt.com>
+
+    * libs/plugins/function.html_radios.php:
+      fix allowable label id characters
+
+2005-05-06  Monte Ohrt  <monte@ohrt.com>
+
+    * NEWS
+      libs/plugins/function.html_radios.php:
+      make form input label ids optional (monte)
+
+2005-05-02  Monte Ohrt  <monte@ohrt.com>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      add error message for empty if/elseif statements
+
+2005-04-15  Monte Ohrt  <monte@ohrt.com>
+
+    * NEWS
+      libs/plugins/function.html_radios.php:
+      cast selected value to string for comparison in html_radios
+
+2005-04-07  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/function.html_select_date.php:
+      added xhtml compliance to html_select_date's year_as_text-feature
+      thanks to Mark West
+
+    * NEWS
+      libs/plugins/function.html_select_date.php:
+      fixed handling of selected month html_select_date
+      thanks to Yuri Weseman for providing problem+solution
+
+2005-04-07  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/configure.in:
+      sync configure and file-entities scripts with phpdoc, for better
+      windows/cygwin support
+
+2005-03-31  Monte Ohrt  <monte@ohrt.com>
+
+    * libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      update version numbers
+
+    * (Smarty_2_6_9)
+      NEWS:
+      update NEWS file
+
+2005-03-30  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.math.php:
+      re-enabled hex-constant. i hope in a sane way this time.
+
+2005-03-30  Monte Ohrt  <monte@ohrt.com>
+
+    * libs/plugins/function.math.php:
+      fix function testing logic
+
+    * libs/Smarty_Compiler.class.php:
+      disable variable func calls completely
+
+    * libs/Smarty_Compiler.class.php:
+      disallow variable func calls when security is enabled
+
+2005-03-22  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      bumped version-number to 2.6.9-dev
+      added headline of 2.6.6 release to NEWS file
+
+2005-03-21  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * (Smarty_2_6_8)
+      NEWS:
+      maybe even better this way. thanks monte :)
+
+    * NEWS:
+      little more clear news-entry
+
+2005-03-21  Monte Ohrt  <monte@ohrt.com>
+
+    * NEWS:
+      update NEWS with e-modifier removal
+
+    * (Smarty_2_6_8)
+      libs/plugins/modifier.regex_replace.php:
+      remove e-modifier
+
+2005-03-19  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      objects don't get casted to arrays anymore in {foreach}
+
+2005-02-26  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php:
+      add "null" as a valid token for {if} when security is enabled
+
+2005-02-25  Monte Ohrt  <monte@ohrt.com>
+
+    * NEWS
+      libs/plugins/function.mailto.php:
+      add javascript_charcode option to mailto
+
+2005-02-24  Monte Ohrt  <monte@ohrt.com>
+
+    * NEWS:
+      update NEWS file
+
+    * QUICK_START
+      libs/plugins/function.html_radios.php:
+      add label ids to html_radios
+
+2005-02-10  Monte Ohrt  <monte@ohrt.com>
+
+    * QUICK_START:
+      update with directory structure
+
+2005-02-10  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/Makefile.in:
+      fix chm generation
+
+2005-02-10  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      fixed too agressive {strip} around delimiters inside strip-blocks
+
+2005-02-10  Monte Ohrt  <monte@ohrt.com>
+
+    * QUICK_START:
+      fix a couple errors
+
+2005-02-10  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/Makefile.in
+      docs/README:
+      commiting the new tools to make the CHM manual.
+
+2005-02-09  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fixed handling of strip-tags with non-default delimiters
+
+2005-02-04  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.html_radios.php:
+      fixed syntax error. shame on me.
+
+2005-02-03  Monte Ohrt  <monte@ohrt.com>
+
+    * QUICK_START:
+      fix example
+
+    * QUICK_START:
+      initial commit
+
+    * RELEASE_NOTES
+      libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      update version numbers in cvs
+
+    * (Smarty_2_6_7)
+      NEWS
+      libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      commit version numbers for new release
+
+2005-02-03  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * (Smarty_2_6_7)
+      libs/plugins/function.html_image.php:
+      fixed comment (thanks to CirTap)
+
+2005-02-01  Monte Ohrt  <monte@ohrt.com>
+
+    * libs/plugins/function.html_image.php:
+      remove border tag
+
+2005-02-01  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      fixed serialization of values containing newlines (like _cache_attrs)
+      in core_write_cache_file()
+      
+      bumped version to 2.6.6-dev-3 to indicate that the fileformat of cache
+      has changed
+
+2005-01-30  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fixed handling of hashed opening php-tags inside strip-blocks
+      (reported by titi_rafa)
+
+2005-01-30  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/fr/language-snippets.ent:
+      fix build
+
+2005-01-28  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/modifier.escape.php:
+      escape:url now uses the (RFC 1738 compliant) rawurlencode()
+
+2005-01-23  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      replaced ? true : false and removed intermediate $_cookie_var in the
+      handling of the SMARTY_DEBUG-cookie
+
+2005-01-22  Yannick Torres  <yannick.torres@keliglia.com>
+
+    * docs/fr/bookinfo.xml:
+      update EN-Revision tag
+
+2005-01-21  Monte Ohrt  <monte@ohrt.com>
+
+    * README
+      RELEASE_NOTES
+      docs/de/bookinfo.xml
+      docs/fr/bookinfo.xml
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/plugins/function.cycle.php
+      libs/plugins/function.debug.php
+      libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_image.php
+      libs/plugins/function.html_radios.php
+      libs/plugins/function.html_table.php
+      libs/plugins/function.mailto.php
+      libs/plugins/modifier.cat.php
+      libs/plugins/modifier.nl2br.php
+      libs/plugins/modifier.strip.php
+      libs/plugins/outputfilter.trimwhitespace.php:
+      de-spammify e-mails
+
+    * README
+      RELEASE_NOTES
+      docs/de/bookinfo.xml
+      docs/fr/bookinfo.xml
+      libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/plugins/function.cycle.php
+      libs/plugins/function.debug.php
+      libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_image.php
+      libs/plugins/function.html_radios.php
+      libs/plugins/function.html_table.php
+      libs/plugins/function.mailto.php
+      libs/plugins/modifier.cat.php
+      libs/plugins/modifier.nl2br.php
+      libs/plugins/modifier.strip.php
+      libs/plugins/outputfilter.trimwhitespace.php:
+      update copyright notices, e-mail addresses
+
+2005-01-06  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      reduced the code that is generated on a {foreach}-block that has a
+      name.
+      
+      instead of pre-computing all foreach-properties (like first, last,
+      show) on each iteration, they are computed on demand as soon as
+      {$smarty.foreach.*}-variables are used.
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      slight optimization in the compilation of $smarty.const.FOO .
+      
+      more complex consts like $smarty.const.$name still compile to
+      constant($this->_tpl_vars['name'])
+
+2005-01-05  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      make block functions and registered objects' block methods use a
+      local variable for block_content instead of $this->_block_content
+      
+      it's not necessary to have $smarty->_block_content accessible.
+
+2005-01-04  Yannick Torres  <yannick.torres@keliglia.com>
+
+    * docs/fr/bookinfo.xml:
+      sync with EN
+
+2005-01-01  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      Happy new year from germany.
+
+2004-12-28  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty.class.php:
+      fix _read_file comments
+
+2004-12-26  Yannick Torres  <yannick.torres@keliglia.com>
+
+    * docs/fr/getting-started.xml
+      docs/fr/preface.xml:
+      typo
+
+    * docs/fr/language-defs.ent
+      docs/fr/language-snippets.ent
+      docs/fr/livedocs.ent:
+      sync with EN & typo
+
+2004-12-21  Yannick Torres  <yannick.torres@keliglia.com>
+
+    * docs/fr/bookinfo.xml
+      docs/fr/getting-started.xml
+      docs/fr/translation.xml:
+      sync with EN
+
+2004-12-17  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fixed escaping of template-filenames in the generated code that loads
+      needed plugins
+
+2004-12-15  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/plugins/function.popup.php:
+      fix invalid HTML issue with popup
+
+2004-12-06  boots  <jayboots@yahoo.com>
+
+    * NEWS
+      libs/plugins/function.popup.php:
+      - fixed {popup} to properly handle inarray and function parameters and
+      added support for mouseoff and followmouse options
+
+2004-11-21  Mehdi Achour  <didou@keliglia.com>
+
+    * docs/fr/livedocs.ent:
+      add livedocs specific entities files
+
+2004-11-16  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_radios.php:
+      cleaned up typecasting
+
+2004-11-15  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.html_options.php:
+      fixed semantically misleading check for $options (use isset() instead
+      of is_array() because it is always an array).
+      
+      thanks to albert almeida.
+
+2004-11-08  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      removed unused code
+
+2004-10-25  Mehdi Achour  <didou@keliglia.com>
+
+    * docs/fr/bookinfo.xml
+      docs/fr/getting-started.xml:
+      sync with en
+
+2004-10-13  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS:
+      update header
+
+2004-10-02  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS:
+      fixed nocache-handling with nested includes. there was a logical error
+      in the replacement of internal nocache-tags to dynamic content that
+      lead to false results with deeply nested includes or with
+      nocache-blocks inside nocache-blocks.
+      
+      many thanks to Lars Jankowfsky for providing big help on reproducing
+      and tracking down this bug!
+
+2004-10-01  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      - better header for compiled includes (more in line with compiled
+      templates)
+      
+      - reuse cache_serials if a file is compiled more than once in one
+        process (force_compile)
+      
+      - don't print nocache-delimiters wenn already inside
+      process_cached_inserts()
+
+2004-09-29  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      switched from @count() to !empty() . this was pointed out a few times
+      by a few people with buggy error-handlers
+
+    * libs/Smarty_Compiler.class.php:
+      added some property declarations
+
+2004-09-28  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      bumped up version number to reflect incompatibility in tempfiles of
+      'core' vs. 'internals'
+
+2004-09-24  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.html_select_date.php:
+      fixed $start_year when no value for the year in $time is given.
+
+2004-09-21  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.html_table.php:
+      fixed handling of "inner"-attribute
+
+    * libs/Smarty_Compiler.class.php:
+      fixed handling of object derefence inside backticks
+
+2004-09-20  Monte Ohrt  <monte@ispi.net>
+
+    * libs/debug.tpl:
+      add <head></head> tags
+
+2004-09-18  boots  <jayboots@yahoo.com>
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/plugins/function.config_load.php
+      libs/plugins/function.debug.php
+      libs/plugins/function.fetch.php
+      libs/plugins/function.html_image.php:
+      Fixed \\r\\n line endings mistakenly introduced in last commit. d'oh.
+
+2004-09-16  boots  <jayboots@yahoo.com>
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/core/core.assemble_plugin_filepath.php
+      libs/core/core.assign_smarty_interface.php
+      libs/core/core.create_dir_structure.php
+      libs/core/core.display_debug_console.php
+      libs/core/core.get_include_path.php
+      libs/core/core.get_microtime.php
+      libs/core/core.get_php_resource.php
+      libs/core/core.is_secure.php
+      libs/core/core.is_trusted.php
+      libs/core/core.load_plugins.php
+      libs/core/core.load_resource_plugin.php
+      libs/core/core.process_cached_inserts.php
+      libs/core/core.process_compiled_include.php
+      libs/core/core.read_cache_file.php
+      libs/core/core.rm_auto.php
+      libs/core/core.rmdir.php
+      libs/core/core.run_insert_handler.php
+      libs/core/core.smarty_include_php.php
+      libs/core/core.write_cache_file.php
+      libs/core/core.write_compiled_include.php
+      libs/core/core.write_compiled_resource.php
+      libs/core/core.write_file.php
+      libs/plugins/function.config_load.php
+      libs/plugins/function.debug.php
+      libs/plugins/function.fetch.php
+      libs/plugins/function.html_image.php:
+      Moved /libs/core to /libs/internals and created new constant,
+      SMARTY_CORE_DIR which defaults to SMARTY_DIR/internals. This should help
+      CVS and rsynch users butupgrades will require changes and this may affect
+      3rd party plugins that use the /core dir.
+
+2004-09-15  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      moved $this->_num_const_regexp out of $this->_var_regexp and added it
+      to the places that affect $this->_var_regexp
+      
+      this should fix some problems parsing plugin-names endings with digits
+
+2004-09-14  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      update files to 2.6.6-dev
+
+2004-09-13  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS:
+      fixed typo
+
+2004-09-13  Monte Ohrt  <monte@ispi.net>
+
+    * (Smarty_2_6_5)
+      NEWS:
+      update NEWS file with parsing correction note
+
+2004-09-11  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.debug.php:
+      removed notice from {debug}
+      thanks to Peter Billen for pointing this one out!
+
+2004-09-11  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty_Compiler.class.php:
+      fix more object calling syntax issues
+
+2004-09-10  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      added $smarty->security_settings['ALLOW_CONSTANTS']
+      including test-cases for them
+
+2004-09-09  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty_Compiler.class.php:
+      break down regex to digestable chunks, fix multiple param problem with
+      method calls,
+      add object method testing to unit_test cases
+
+    * libs/Smarty_Compiler.class.php:
+      update code comment with more examples
+
+    * libs/Smarty_Compiler.class.php:
+      allow objects in arbitrary param positions
+
+    * libs/Smarty_Compiler.class.php:
+      fix object parameter regex, allow one level of object indirection
+
+    * libs/Smarty_Compiler.class.php:
+      fix compile problem with numeric constants and math operator matching
+
+2004-09-07  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      update files to 2.6.5-dev
+
+    * (Smarty_2_6_4)
+      NEWS:
+      update NEWS file with 2.6.4 header
+
+2004-08-31  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty_Compiler.class.php:
+      fix preg_quote
+
+    * libs/Smarty_Compiler.class.php:
+      fix math in object params, clean up some regex on the way, change
+      preg_ delimiters to ~ to avoid character clashes with ! and %
+
+2004-08-30  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      add $smarty.ldelim and $smarty.rdelim to smarty special var
+
+2004-08-29  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/core/core.write_file.php:
+      tempnam() seems to be borken on many installation.
+      
+      now we try tempnam first and if that fails we generate our own
+      temp-filename with uniqid()
+
+2004-08-23  Monte Ohrt  <monte@ispi.net>
+
+    * libs/plugins/modifier.capitalize.php:
+      dont use constant, use static var instead
+
+    * libs/plugins/modifier.capitalize.php:
+      implement optional param to capitalize for digit behavior
+
+    * libs/plugins/modifier.capitalize.php:
+      another commit to capitalize, taking special chars into account
+
+2004-08-23  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      cleaned up attribute-handling in Smarty_Compiler::_compile_foreach_start()
+
+2004-08-23  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/plugins/function.html_select_date.php
+      libs/plugins/modifier.capitalize.php:
+      fix capitalize modifier to not rely on buggy ucwords() func
+
+2004-08-20  Monte Ohrt  <monte@ispi.net>
+
+    * libs/plugins/function.html_select_date.php:
+      update version
+
+    * NEWS
+      libs/plugins/function.html_select_date.php:
+      make time param work with negative timestamps, force year range to include
+      given date unless explicitly set
+
+2004-08-19  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/plugins/function.fetch.php:
+      fix bug with fetch, passing user/pass in url did not work
+
+2004-08-13  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      fixed handling of {foreachelse} and {sectionelse} that got borked with
+      the latest commit (v 1.330)
+
+2004-08-12  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fixed occasional wrong error messages on mismatched tags when
+      {else}, {elseif}, {foreachelse} or {sectionelse} is involved
+      
+      thanks to Ooypunk for pointing me on this
+
+2004-08-12  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/.cvsignore
+      docs/Makefile.in
+      docs/configure.in:
+      enable russian PDF builds
+
+2004-07-30  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/configure.in:
+      typo
+
+    * docs/Makefile.in
+      docs/README
+      docs/configure.in:
+      add make test_xml
+      this is usefull to detect XML problems
+
+2004-07-29  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/configure.in:
+      avoid warnings in head
+
+    * docs/.cvsignore
+      docs/Makefile.in
+      docs/README
+      docs/configure.in:
+      build pdf files
+      just type make pdf
+
+2004-07-27  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fixed handling of methods arguments.
+      
+      thanks to Manfred Wischin for finding this one and providing the
+      conceptual fix.
+
+2004-07-23  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_radios.php:
+      there was little flaw in smarty_function_html_radios() and
+      smarty_function_html_checkboxes():
+      
+      the newly introduced assign-attribute was still added to the
+      tag-output as an extra-attribute.
+      
+      fixed.
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/core/core.load_plugins.php
+      libs/core/core.load_resource_plugin.php
+      libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_image.php
+      libs/plugins/function.html_options.php
+      libs/plugins/function.html_radios.php
+      libs/plugins/function.html_select_date.php
+      libs/plugins/function.html_select_time.php
+      libs/plugins/modifier.date_format.php:
+      backed out renaming of _get_plugin_filepath() to get_plugin_filepath()
+      
+      we'll stick to _get_plugin_filepath() and look for a more viable
+      solution to be exposed to plugin-writers.
+
+2004-07-20  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php
+      libs/core/core.is_trusted.php
+      libs/plugins/compiler.assign.php:
+      Some fixes on PhpDocumentor comments. Thanks go to Ruben Vermeersch.
+
+2004-07-16  andreas halter  <phpcvs@andreashalter.ch>
+
+    * docs/de/bookinfo.xml
+      docs/de/getting-started.xml
+      docs/de/language-defs.ent
+      docs/de/language-snippets.ent
+      docs/de/preface.xml:
+      - updated for 2.6.3
+      - updates for new build system
+      - added missing files
+      - corrections from users
+      - revcheck comments for all files
+      - big up to didou and nuno, brilliant work
+      - make test: ok
+      - make: ok
+
+2004-07-16  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/de/getting-started.xml:
+      fix the revision tracking tag
+      the revision number might not be right. just check it, please
+
+2004-07-16  andreas halter  <phpcvs@andreashalter.ch>
+
+    * docs/de/getting-started.xml:
+      - updated version (incl revcheck comment) for revcheck testing
+
+2004-07-14  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty.class.php:
+      replace " with ' where literal strings are quoted (ever so slight speedup)
+
+2004-07-12  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/modifier.date_format.php:
+      changed call from $smarty->_get_plugin_filepath() to
+      $smarty->get_plugin_filepath()
+
+    * libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_image.php
+      libs/plugins/function.html_options.php
+      libs/plugins/function.html_radios.php
+      libs/plugins/function.html_select_date.php
+      libs/plugins/function.html_select_time.php:
+      renamed calls to $smarty->_get_plugin_filepath() to
+      $smarty->get_plugin_filepath()
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/core/core.load_plugins.php
+      libs/core/core.load_resource_plugin.php:
+      renamed Smarty::_get_plugin_filepath() to Smarty::get_plugin_filepath()
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/core/core.write_compiled_include.php
+      libs/core/core.write_compiled_resource.php
+      libs/core/core.write_file.php:
+      removed touch() call. changing the timestamp of the compiled-template
+      to the source template's may be irritating for certain
+      source-code-caches. now a newly compiled template gets the current
+      time as timestamp.
+
+2004-07-02  gerald croes  <gerald@phpside.org>
+
+    * docs/fr/getting-started.xml
+      docs/fr/preface.xml:
+      Fixed missing tags to be able to make doc again
+
+    * docs/fr/preface.xml:
+      added the "is a good thing [TM]" as in en docs
+
+    * docs/fr/getting-started.xml:
+      added ctags, updated screen => programm listing.
+      added the technical note founded on the en doc
+
+2004-07-02  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_radios.php
+      libs/plugins/function.mailto.php:
+      add assign attribute to html_checkboxes and html_radios
+
+2004-07-01  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php:
+      removed use of get_include_filepath() inside
+      get_auto_filename(). thanks go to c960657
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      enhanced error-reporting for {foreach}
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fixed handling of digits inside tagnames. this problem slipped into
+      the regexps by adding support for numeric contants next to string
+      constants as variables.
+
+2004-06-27  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fixed escaping of backslashes in Smarty_Compiler::_quote_replace()
+
+2004-06-23  Monte Ohrt  <monte@ispi.net>
+
+    * libs/plugins/modifier.date_format.php:
+      display date_format %e, %T and %D as expected for windows
+
+2004-06-17  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      changed version-number to 2.6.4-dev
+
+2004-06-16  Monte Ohrt  <monte@ispi.net>
+
+    * (Smarty_2_6_3)
+      NEWS:
+      update NEWS file with version number
+
+2004-06-09  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/plugins/modifier.escape.php:
+      added escapement of '</' to javascript escaping
+
+2004-06-08  gerald croes  <gerald@phpside.org>
+
+    * docs/fr/translation.xml:
+      Add other translators.
+
+2004-06-08  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      made the correct value of "use_sub_dirs" available to the compiler.
+      (not worth a NEWS-entry, i think)
+
+2004-06-01  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.fetch.php:
+      fix: proper initialistaion of $content.
+      thanks to Dmitry Koteroff for pointing this out.
+
+2004-05-29  Mehdi Achour  <didou@keliglia.com>
+
+    * docs/fr/translation.xml:
+      oups :)
+
+    * docs/fr/translation.xml:
+      added translation file
+
+2004-05-28  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/Makefile.in:
+      clean also file-entities.php
+
+2004-05-28  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/function.mailto.php:
+      added obfuscation of protocol-string in {mailto} when using
+      hex-encoding (thanks to bharat)
+
+2004-05-26  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php:
+      enhanced auto-generated filenames for templates_c and cache
+      
+      incremented Smarty::_version because the tempfiles' structure changed
+      a little
+
+2004-05-23  Mehdi Achour  <didou@keliglia.com>
+
+    * docs/fr/bookinfo.xml
+      docs/fr/getting-started.xml
+      docs/fr/preface.xml:
+      WS and added revcheck
+
+2004-05-21  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      fixed typo in error-messages
+
+    * docs/de/language-snippets.ent
+      docs/fr/language-snippets.ent:
+      added empty language-snippets.ent to fix "make web"
+
+2004-05-12  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/plugins/modifier.escape.php:
+      add 'nonstd' escape modifier
+
+2004-05-07  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/plugins/block.textformat.php:
+      update textformat to not output wrap chars after last para
+
+2004-05-06  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/core/core.write_file.php:
+      use tempnam() instead of unqid() to create better temporary files in
+      smarty_core_write_file().
+      
+      (thanks to xces for finding this race-condition and his work on
+      fixing it)
+
+2004-05-04  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      added check if for file_exists() to Smarty::_read_file()
+
+2004-04-30  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/plugins/modifier.escape.php:
+      add 'mail' attribute to escape modifier
+
+2004-04-20  Mehdi Achour  <didou@keliglia.com>
+
+    * docs/manual.xml.in:
+      added the language-snippets.ent file and started using entities for notes
+      under en/programmers/api-functions
+
+2004-04-18  Mehdi Achour  <didou@keliglia.com>
+
+    * docs/de/getting-started.xml
+      docs/fr/getting-started.xml:
+      new global entity for zend and php-accelerator
+
+    * docs/fr/bookinfo.xml
+      docs/fr/getting-started.xml
+      docs/fr/preface.xml:
+      added myself as translator and added vim comments and xml tags
+
+2004-04-16  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS:
+      added entry for numeric constants
+
+    * libs/Smarty_Compiler.class.php:
+      removed unused 2nd param in call to _parse_var()
+
+    * libs/Smarty_Compiler.class.php:
+      added explanation for $this->_num_const_regexp
+
+    * NEWS
+      libs/plugins/modifier.escape.php:
+      added escape type "decentity" to smarty_modifier_escape()
+
+    * libs/Smarty_Compiler.class.php:
+      enabled numerical constants be parsed as statements.
+      (like {10} or {10|@range:12} )
+
+    * libs/Smarty_Compiler.class.php:
+      removed unused $smarty_compiler->_dvar_num_var_regexp
+
+    * libs/Smarty.class.php:
+      reverted Stuff
+
+    * libs/debug.tpl
+      libs/core/core.assemble_plugin_filepath.php
+      libs/core/core.read_cache_file.php
+      libs/core/core.write_file.php
+      libs/plugins/function.eval.php
+      libs/plugins/function.popup.php
+      libs/plugins/modifier.escape.php
+      libs/plugins/shared.make_timestamp.php:
+      reverted stuff
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/debug.tpl
+      libs/core/core.assemble_plugin_filepath.php
+      libs/core/core.read_cache_file.php
+      libs/core/core.write_file.php
+      libs/plugins/function.eval.php
+      libs/plugins/function.popup.php
+      libs/plugins/modifier.escape.php
+      libs/plugins/shared.make_timestamp.php:
+      Smarty_Compiler.class.php
+
+2004-04-15  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/core/core.write_compiled_include.php:
+      made smarty_core_write_compiled_include() php5-aware
+      
+      if someone knows a better way than patching the source with the
+      tokenizer, please stand up!
+
+2004-04-14  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/Makefile.in:
+      remove file-entities.ent also
+
+    * docs/.cvsignore
+      docs/Makefile.in
+      docs/README:
+      allow make revcheck
+
+2004-04-13  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/configure.in:
+      do not need inipath
+
+2004-04-13  Mehdi Achour  <didou@keliglia.com>
+
+    * docs/TODO:
+      done
+
+    * docs/configure.in
+      docs/manual.xml.in:
+      now the files entites are generated dynamically
+
+2004-04-12  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Config_File.class.php
+      libs/Smarty.class.php:
+      removed unused functionality to load a subset of lines from a file in
+      Smarty::_read_file()
+      
+      additionally removed a warning that is emitted since php-4.3.5 when
+      fread() is called on an empty file (with filesize()==0). thanks to
+      Andreas Streichardt who pointed this out.
+
+    * NEWS
+      libs/core/core.is_secure.php:
+      smarty_core_is_secure() only checks the file for readability now, not
+      the directory where is in.
+
+    * libs/Smarty.class.php:
+      removed unused security_setting 'ALLOW_CONSTANTS'
+
+2004-04-07  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.assign_debug_info.php
+      libs/plugins/function.cycle.php
+      libs/plugins/function.mailto.php:
+      removed trailing spaces
+
+    * libs/Smarty.class.php:
+      removed unused $smarty->_error_msg
+
+2004-04-04  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/configure.in:
+      fixing my crap
+      put build_date back on-line
+
+2004-04-03  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/Makefile.in
+      docs/configure.in
+      docs/manual.xml.in:
+      trying to fix ru problems
+
+2004-03-30  Monte Ohrt  <monte@ispi.net>
+
+    * libs/core/core.display_debug_console.php:
+      fix problem with debug_tpl path and security
+
+    * NEWS
+      libs/core/core.display_debug_console.php:
+      fix problem displaying debug console when $default_resource_type is not
+      "file:"
+
+2004-03-29  Mehdi Achour  <didou@keliglia.com>
+
+    * docs/TODO:
+      and finally, add a TODO here
+
+    * docs/de/bookinfo.xml
+      docs/de/manual.sgml
+      docs/fr/bookinfo.xml
+      docs/fr/manual.xml:
+      translate bookinfo.xml and put back the translators
+
+2004-03-28  Mehdi Achour  <didou@keliglia.com>
+
+    * docs/manual.xml.in:
+      add global.ent and define some general entities
+
+    * docs/de/bookinfo.xml
+      docs/de/getting-started.xml
+      docs/de/language-defs.ent
+      docs/de/preface.xml:
+      add new de files
+
+    * docs/de/appendixes.sgml
+      docs/de/designers.sgml
+      docs/de/getting-started.sgml
+      docs/de/html-common.dsl
+      docs/de/preface.sgml
+      docs/de/programmers.sgml:
+      drop old de files
+
+    * docs/fr/bookinfo.xml
+      docs/fr/getting-started.xml
+      docs/fr/manual.xml
+      docs/fr/preface.xml:
+      add ommited files
+
+    * docs/fr/language-defs.ent:
+      split the french dir
+
+    * docs/fr/appendixes.sgml
+      docs/fr/designers.sgml
+      docs/fr/getting-started.sgml
+      docs/fr/html-common.dsl
+      docs/fr/manual.sgml
+      docs/fr/preface.sgml
+      docs/fr/programmers.sgml:
+      drop old french files
+
+    * docs/manual.xml.in:
+      let's put the new build system
+
+2004-03-26  Mehdi Achour  <didou@keliglia.com>
+
+    * docs/de/common.dsl
+      docs/de/html.dsl
+      docs/fr/common.dsl
+      docs/fr/html.dsl
+      docs/fr/php.dsl:
+      not needed anymore
+
+2004-03-24  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/Makefile.in:
+      updated stylesheets
+      highlight PHP automatically
+
+    * docs/Makefile.in
+      docs/html.dsl:
+      remove unneeded file
+
+2004-03-23  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/version.ent.in:
+      remove this also
+
+    * docs/getting-started.sgml:
+      remove this one too
+
+    * docs/appendixes.sgml
+      docs/common.dsl
+      docs/designers.sgml
+      docs/html-common.dsl
+      docs/manual.sgml
+      docs/php.dsl
+      docs/preface.sgml
+      docs/programmers.sgml:
+      removing uneeded files
+
+    * docs/.cvsignore:
+      commiting missing files for docbook
+
+    * docs/.cvsignore
+      docs/Makefile.in
+      docs/configure.in
+      docs/manual.xml.in:
+      bundling docbook 4
+      now make and make web works
+
+2004-03-23  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/function.config_load.php:
+      unrolled call to the is_compiled()-check to be able to supply the
+      correct resource_base_path for config_load. this avoids errors when
+      config-files are accessed where security is enabled.
+      
+      thanks to shuther for pointing out this bug.
+
+2004-03-20  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/manual.xml.in:
+      fix build date
+
+2004-03-18  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/core/core.is_secure.php:
+      removed merging of $smarty->template_dir into $smarty->secure_dir
+      
+      the resource_base_path is considerd secure instead. this change should
+      have absolutely no impact on smarty's security's behaviour
+
+2004-03-18  Nuno Lopes  <nunoplopes@sapo.pt>
+
+    * docs/configure.in:
+      correcting non-existent var
+
+    * docs/.cvsignore
+      docs/Makefile.in
+      docs/configure.in
+      docs/manual.xml.in
+      docs/version.ent.in:
+      generate build date
+
+    * docs/.cvsignore
+      docs/Makefile.in
+      docs/README
+      docs/configure.in
+      docs/manual.xml.in:
+      new build/test system
+
+2004-03-18  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      moved setting of a default resource_base_path from
+      Smarty::_parse_resource_name() to Smarty::_fetch_resource_info()
+      
+      this shouldn't affect anything, since all calls to
+      _parse_resource_name() that are not done from within
+      _fetch_resource_info() all pass their own resource_base_path
+
+2004-03-17  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php:
+      removed '.' from the list of default resource_base_paths in
+      _parse_resource_name()
+      
+      this should only affect _parse_resource_name() for templates, not for
+      php-resources and not for config_files. the latter pass two their own
+      resource_base_path.
+
+2004-03-16  Mehdi Achour  <didou@keliglia.com>
+
+    * docs/appendixes.sgml
+      docs/getting-started.sgml
+      docs/preface.sgml:
+      adding editor comments
+
+    * docs/appendixes.sgml
+      docs/getting-started.sgml:
+      cleaning words spacing, killing tabulations, using roles for
+      programlisting..
+
+2004-03-15  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      simplified Smarty::clear_all_cache();
+
+2004-03-12  boots  <jayboots@yahoo.com>
+
+    * docs/programmers.sgml:
+      Updated is_cached prototype to indicate proper return type. (thanks to
+      Geoffrey Hoffman)
+
+2004-03-11  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/core/core.assemble_plugin_filepath.php:
+      fixed little bug that prevented plugins filepaths that are found in
+      php's include_path (and not in one of the plugins_dirs) from being
+      cached in the internal plugins-filepath-cache
+
+2004-03-01  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml:
+      update include_php docs:wq
+      :q
+
+    * docs/appendixes.sgml:
+      update componentized template example to something useful
+
+2004-02-24  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php:
+      _parse_resource_name() returned true on non-existant absolute
+      paths. This caused a warning on _fetch_resource_info() when used in
+      conjunction with template_exists(). It should be fixed now without
+      negative effects.
+
+2004-02-24  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml:
+      one more typo
+
+    * docs/designers.sgml:
+      fix typo
+
+2004-02-24  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/core/core.is_secure.php:
+      smarty_resource_*_secure got &$smarty passed errornously as 3rd
+      parameter and not as 2nd. this is fixed.
+
+2004-02-23  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS:
+      fix handling of integer values like width and delay im
+      smarty_function_popup()
+
+    * libs/plugins/function.popup.php:
+      fixed handling of integer-attributes
+
+    * libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      updated version to 2.6.3-dev
+
+2004-02-22  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.html_select_date.php:
+      removed notice on html_select_date with the month_empty-attribute
+
+    * libs/plugins/function.mailto.php:
+      removed 2 notices of undefined vars (thanks Cit)
+
+2004-02-17  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS:
+      add header
+
+    * (Smarty_2_6_2)
+      libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      change some info in headers, remove fluff
+
+2004-02-13  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/function.html_select_date.php:
+      correctly handle partially empty dates (like "2004--" or "-12-").
+
+    * docs/programmers.sgml:
+      learned something about <note> and sgml and applied this to the
+      use.sub.dirs-section :)
+
+    * docs/designers.sgml:
+      changed attribute-name "checked" to "selected" in the docs for
+      html_radios and html_checkboxes. "checked" is deprecated for ages
+      AFAIK and selected is recommended for consistency with {html_options}
+
+    * docs/programmers.sgml:
+      added note about use_sub_dirs and Smarty-2.6.2 .
+      fixed markup for section about clear_compiled_tpl() .
+
+2004-02-12  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Config_File.class.php:
+      YES and NO should not be booleanized inside triple-quotes in a
+      config-file. this behaviour changed by accident in 2.6.1 and is now
+      reverted to pre-2.6.1 behaviour
+
+2004-02-10  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Config_File.class.php:
+      fixed slurping of a the next line following a triple-quoted value in a
+      config-file
+
+2004-02-07  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Config_File.class.php:
+      avoid @-operator for handling empty lines in Config_File.class.php
+
+    * libs/Smarty_Compiler.class.php:
+      removed two notices from Smarty_Compiler::_parse_is_expr()
+      (thanks shuther!)
+
+    * NEWS
+      libs/Smarty.class.php:
+      changed default for use_sub_dirs to false
+
+    * libs/plugins/function.mailto.php:
+      removed notice of undefined variable. (thanks shuther!)
+
+2004-01-29  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      added file and line-number-information to error-messages regarding
+      assigned objects an an error messages regarding modifiers with
+      security.
+
+2004-01-27  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      removed use of temporary var $_params in compiled code of block-plugins
+
+    * NEWS
+      libs/plugins/function.popup.php:
+      fixed quoting of values in smarty_function_popup()
+
+2004-01-25  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/programmers.sgml:
+      documented parameters of Smarty::clear_compiled_tpl()
+
+    * libs/Smarty_Compiler.class.php:
+      Smarty_Compiler::_syntax_error() uses Smarty::_trigger_fatal_error() now
+      instead of the trigger_error()-function
+
+    * libs/Smarty.class.php:
+      Smarty::_trigger_fatal_error() uses Smarty::trigger_error() now,
+      instead of the native trigger_error()-function
+
+    * libs/Smarty_Compiler.class.php:
+      unrecognized custom-functions trigger an error at compile now, not at
+      display-time.
+
+2004-01-23  Monte Ohrt  <monte@ispi.net>
+
+    * docs/getting-started.sgml:
+      reword a paragraph
+
+2004-01-22  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.config_load.php:
+      removed emission of unnecessary notices for unavailable config-files
+      in config_load()
+
+    * NEWS
+      libs/Config_File.class.php:
+      fixed handling of hidden sections in Config_File
+
+2004-01-21  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/function.config_load.php:
+      added handling of resources for {config_load}
+
+2004-01-19  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/function.html_table.php:
+      fixed bug when using arrays with tr_attr and td_attr in {html_table}
+
+2004-01-16  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS:
+      add unit testing
+
+    * NEWS
+      libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      update version numbers, add initial unit test directory
+
+    * (Smarty_2_6_1)
+      libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      update version numbers for 2.6.1 release
+
+2004-01-16  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * (Smarty_2_6_1)
+      NEWS
+      docs/programmers.sgml
+      libs/Smarty.class.php:
+      renamed $smarty->tpl_rror_reporting to $smarty->error_reporting
+      "tpl_" is a bit redundant here (it's a TemPLate-engine overall :)
+
+2004-01-15  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.html_image.php:
+      forgot to remove duplicate is_secure()-check
+
+    * NEWS
+      libs/plugins/function.html_image.php:
+      fix: $smarty->security is now correctly handled
+      
+      minor optimizations:
+         core/core.is_secure.php is only included when needed
+         $dpi_default is only determined when needed
+
+2004-01-14  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/appendixes.sgml
+      docs/programmers.sgml:
+      removed suggestions to use extract() from the manual
+
+    * docs/designers.sgml:
+      fixed typo
+
+2004-01-12  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/designers.sgml:
+      mention SCRIPT_NAME below {$smarty} reserved variable because it got
+      lost in the docs for $smarty->global_assign
+
+    * docs/designers.sgml:
+      added docs for {$smarty.version} special variable
+
+    * docs/programmers.sgml:
+      removed docs for $global_assign
+
+    * docs/programmers.sgml:
+      added docs for tpl_error_reporting
+
+    * docs/designers.sgml:
+      added docs for year_empty-, month_empty- and day_emtpy-attributes of
+      html_select_date. maybe an example is needed to better explain empty
+      values in YYY-MM-DD.
+
+2004-01-10  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      fixed handling of {php}-tags
+
+2004-01-10  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml:
+      fix html_checkboxes examples
+
+2004-01-08  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/core/core.assemble_plugin_filepath.php:
+      added caching of requested paths to smarty_core_assemble_plugin_filepath()
+
+    * NEWS:
+      fix handling of comments inside {php}- and {literal}-blocks
+
+    * libs/Smarty_Compiler.class.php:
+      fixed handling of comments inside {php} and {literal}
+
+2004-01-06  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Config_File.class.php:
+      fixed bug handling triple-quotes in config-files
+
+    * libs/Config_File.class.php:
+      fixed bugs with triple-quotes in config-files
+      thanks BRDude for finding them testing!
+
+2004-01-02  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      removed unnecessary param in call to _fetch_resource_info()
+
+2003-12-30  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      oops! removed tabs.
+
+2003-12-27  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php:
+      made $SCRIPT_NAME available again
+      changes default for request_use_auto_global to prefer autoglobals
+
+    * libs/Smarty.class.php:
+      removed tabs and trailing spaces
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      readded default_modifiers. who removed that?
+
+2003-12-23  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS:
+      add portuguese docs
+
+2003-12-22  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml:
+      fix counter example
+
+2003-12-19  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty.class.php:
+      add debug console persistance feature
+
+2003-12-19  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/block.textformat.php
+      libs/plugins/function.html_table.php
+      libs/plugins/function.popup.php:
+      removed extract(). enhanced parameter parsing.
+
+    * libs/plugins/function.counter.php
+      libs/plugins/function.fetch.php
+      libs/plugins/function.popup_init.php
+      libs/plugins/modifier.capitalize.php
+      libs/plugins/modifier.cat.php
+      libs/plugins/modifier.date_format.php
+      libs/plugins/modifier.debug_print_var.php
+      libs/plugins/modifier.escape.php
+      libs/plugins/modifier.indent.php
+      libs/plugins/modifier.lower.php
+      libs/plugins/modifier.nl2br.php
+      libs/plugins/modifier.strip.php
+      libs/plugins/modifier.upper.php
+      libs/plugins/modifier.wordwrap.php
+      libs/plugins/outputfilter.trimwhitespace.php
+      libs/plugins/shared.escape_special_chars.php:
+      removed tabs. fixed indentiation.
+
+    * libs/plugins/modifier.truncate.php:
+      removed tabs
+
+    * libs/plugins/function.counter.php
+      libs/plugins/function.cycle.php:
+      removed extract() from parameter-parsing
+
+2003-12-17  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.html_select_date.php:
+      fix plugin-name in error message
+
+    * libs/plugins/function.html_select_time.php:
+      remove extract-call from {html_select_time}
+
+    * NEWS
+      libs/plugins/function.html_select_date.php:
+      allow single-digit days and months without smarty_make_timestamp()
+      this makes dates like "1968-11-6" work correctly since no strtotime()
+      is involved
+      
+      add warning when unknown parameter is passed
+
+2003-12-16  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php:
+      fix headers sent erroneously with cache_modified_check and fetch()
+
+2003-12-12  Monte Ohrt  <monte@ispi.net>
+
+    * libs/plugins/function.config_load.php:
+      move set_path() call below the conditional bracket
+
+    * NEWS
+      libs/plugins/function.config_load.php:
+      fix config_load filepath bug
+
+2003-12-12  boots  <jayboots@yahoo.com>
+
+    * docs/designers.sgml:
+      Updated language.function.if with additional annotation and to fix error
+      that broke docs build process
+
+2003-12-11  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      little optimization for "is odd" and "is even"
+
+2003-12-11  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fix 'is even by' and 'is odd by' logic
+
+2003-12-11  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/designers.sgml:
+      update example-output of {mailto}
+
+    * libs/plugins/function.mailto.php:
+      removed extract-call -> cleaner parameter-handling
+
+    * libs/plugins/function.mailto.php:
+      fixed indentiation
+
+    * TODO:
+      removed two done topics
+
+2003-12-11  boots  <jayboots@yahoo.com>
+
+    * docs/designers.sgml:
+      Updated language.function.if to describe qualifiers (thanks andre)
+
+2003-12-10  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/function.html_select_date.php:
+      added day_empty, month_empty, year_empty and all_empty attributes
+      to pass an undefined date use {html_select_date time="--" ...}
+
+    * libs/plugins/function.html_select_date.php:
+      removed extract()-call
+
+    * libs/plugins/function.html_select_date.php:
+      fixed indetiation
+
+2003-12-10  boots  <jayboots@yahoo.com>
+
+    * NEWS
+      docs/designers.sgml:
+      Added table to language.function.if to describe qualifiers
+
+2003-12-09  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_options.php:
+      strict comparason didn't work in all cases. use type-casting now.
+
+    * NEWS
+      libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_options.php:
+      fix bug when comparing array-keys to "selected" in html_options and
+      html_checkboxes
+      
+      in_array() uses "strict" comparason now.
+
+    * libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_options.php
+      libs/plugins/function.html_radios.php:
+      removed tabs, fixed indentiation
+
+2003-12-08  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      add better checks for correctly nested tags when compiling
+
+2003-12-04  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php
+      libs/plugins/function.html_image.php:
+      fix: check $smarty->request_use_auto_globals at the last occurences of
+           HTTP_*_VARS
+
+2003-12-03  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php:
+      remove $global_assign property from Smarty and $global_assign-handling
+      from the constructor. the only visible change is, that $SCRIPT_NAME is
+      not available in the tempates anymore. $smarty.server.SCRIPT_NAME has
+      to be used from now.
+
+2003-12-03  boots  <jayboots@yahoo.com>
+
+    * docs/designers.sgml:
+      Fixed example for count_characters
+
+2003-12-01  boots  <jayboots@yahoo.com>
+
+    * docs/designers.sgml:
+      Added section "Escaping Smarty Parsing" under Basic Syntax.
+
+2003-12-01  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/core/core.create_dir_structure.php:
+      thought again about my latest commit and backed it out.
+
+    * libs/core/core.create_dir_structure.php:
+      fix root-dir-handling on windows filepath
+
+2003-11-29  boots  <jayboots@yahoo.com>
+
+    * libs/plugins/function.config_load.php:
+      really make the fixes the last patch was supposed to do
+
+    * libs/plugins/function.config_load.php:
+      removed tabs and killed trailing white-space
+
+    * libs/plugins/function.config_load.php:
+      changed $smarty->_syntax_error to $smarty->trigger_error
+
+2003-11-27  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/modifier.debug_print_var.php:
+      remove warning in debug_print_var on php-resources
+
+    * README:
+      fix version number
+
+2003-11-26  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      raise max_level for $smarty.config... to 3 to allow arrays of config-vars
+
+2003-11-25  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      changed version-tag to indicate incompatibility to older compiled
+      templates
+
+2003-11-24  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/compiler.assign.php
+      libs/plugins/function.assign.php:
+      move function.assign.php to compiler.assign.php
+
+    * libs/core/core.get_include_path.php:
+      silence occasional warnings of open_basedir- and
+      safe_mode-restrictions in core.get_include_path.php
+
+2003-11-23  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/core/core.write_compiled_resource.php
+      libs/core/core.write_file.php:
+      avoid touch()-ing of recently unlinked files by touch()-ing the
+      tempfile before rename instead of touch()-ing the resulting file after
+      rename.
+
+    * NEWS
+      libs/Smarty.class.php:
+      add property $tpl_error_reporting
+
+2003-11-22  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.assign.php:
+      remove use of extract() in smarty_function_assign()
+
+    * NEWS
+      libs/Smarty.class.php:
+      remove property $undefined. "null" is used literally instead
+
+2003-11-21  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      remove two E_NOTICES
+
+2003-11-20  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      change version to 2.6.1-dev
+
+2003-11-19  Monte Ohrt  <monte@ispi.net>
+
+    * (Smarty_2_6_0)
+      NEWS:
+      update NEWS file
+
+    * (Smarty_2_6_0)
+      docs/designers.sgml
+      libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      change version numbers to 2.6.0
+
+2003-11-19  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/designers.sgml
+      docs/de/designers.sgml
+      docs/fr/designers.sgml:
+      fix examples of escape-modifier (in docs, docs/de and docs/fr !)
+
+2003-11-18  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      move Smarty::quote_replace() to Smarty_Compiler::_quote_replace()
+
+    * libs/Smarty.class.php:
+      removed extract-calls from _include()- and _eval()-wrappers
+      variables passed with {include_php} have to accessed as members of $params
+      now
+
+2003-11-17  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/designers.sgml:
+      fixed typo
+
+2003-11-13  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Config_File.class.php:
+      fix occasional notice
+
+2003-11-13  andreas halter  <phpcvs@andreashalter.ch>
+
+    * docs/de/designers.sgml:
+      - added cat modifier, thanks messju :-)
+
+2003-11-13  Monte Ohrt  <monte@ispi.net>
+
+    * (Smarty_2_6_0-RC3)
+      NEWS
+      libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      commit RC3 tags
+
+2003-11-13  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fix handling of $var.key inside []
+
+    * libs/Smarty.class.php:
+      fix unnecessary loading of core.load_resource_plugin.php
+
+    * (Smarty_2_6_0-RC3)
+      docs/fr/designers.sgml:
+      fixed example of html_table
+
+2003-11-11  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/core/core.process_cached_inserts.php:
+      fix handling of assign inside {insert}-tags
+
+2003-11-06  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/core/core.read_cache_file.php:
+      added $exp_time-parameter
+
+    * docs/programmers.sgml:
+      added $exp_time to cache_handler_func-example
+
+    * libs/Smarty.class.php
+      libs/core/core.write_cache_file.php:
+      added $exp_time-parameter of clear_cache() and clear_all_cache() to
+      cache_handler_func.
+
+2003-11-05  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Config_File.class.php:
+      fix handling if [...] inside triple-quotes in config-files
+
+2003-11-04  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      fixed little bug in _parse_resource_name() (jlgunter, messju)
+
+2003-11-03  andreas halter  <phpcvs@andreashalter.ch>
+
+    * docs/designers.sgml
+      docs/de/designers.sgml
+      docs/fr/designers.sgml:
+      - changed Smarty.php.class occurences to Smarty.class.php
+
+2003-10-29  boots  <jayboots@yahoo.com>
+
+    * docs/appendixes.sgml
+      docs/designers.sgml
+      docs/manual.sgml
+      docs/programmers.sgml
+      docs/de/appendixes.sgml
+      docs/de/designers.sgml
+      docs/de/programmers.sgml
+      docs/fr/appendixes.sgml
+      docs/fr/designers.sgml
+      docs/fr/getting-started.sgml
+      docs/fr/manual.sgml
+      docs/fr/preface.sgml
+      docs/fr/programmers.sgml:
+      Fixes to documentation syntax so that all content can be processed used
+      xsltproc docbook-xsl tools. In particular, fixes unescaped entities,
+      broken tags, unquoted attributes.
+
+2003-10-27  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fix handling of simple-math-operators inside modifiers
+
+2003-10-25  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      removed unused property _output_type
+      removed unused param $tag_attrs of _parse_var_props()
+      cleaned up alignment of class-properties
+
+2003-10-23  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      removed notice in php-tag handling in Smarty_Compiler::_compile_file()
+
+    * libs/Smarty_Compiler.class.php:
+      removed two occasional E_NOTICES from
+      Smarty_Compiler::_compile_include_php_tag()
+
+    * NEWS
+      libs/core/core.create_dir_structure.php:
+      fix handling of trailing-slashes in open_basedir in
+      smarty_core_create_dir_structure()
+
+2003-10-20  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      elements inside `` are bracketed now inside the compiled-tpl. this
+      fixes some issues with simple-math inside backticks.
+
+2003-10-16  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml:
+      update overlib docs, no working examples
+
+2003-10-12  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php
+      libs/core/core.is_secure.php:
+      move check for template_dir in secure_dir-array into core.is_secure.php
+      
+      this makes template_exists() work correctly with security=true even if
+      template_dir is not inside the secure_dir-array
+
+2003-10-11  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/shared.make_timestamp.php:
+      tightened check for YYYYMMDDHHMMSS-format. thanks konstantin for
+      pointing this out.
+      
+      removed a few tabs.
+
+    * libs/Smarty_Compiler.class.php:
+      fix precedence of simple-math-operators before modifiers.
+      thanks dominik!
+
+    * libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/core/core.assemble_plugin_filepath.php
+      libs/core/core.assign_smarty_interface.php
+      libs/core/core.create_dir_structure.php
+      libs/core/core.display_debug_console.php
+      libs/core/core.get_include_path.php
+      libs/core/core.get_microtime.php
+      libs/core/core.get_php_resource.php
+      libs/core/core.is_secure.php
+      libs/core/core.is_trusted.php
+      libs/core/core.load_plugins.php
+      libs/core/core.load_resource_plugin.php
+      libs/core/core.process_cached_inserts.php
+      libs/core/core.process_compiled_include.php
+      libs/core/core.read_cache_file.php
+      libs/core/core.rm_auto.php
+      libs/core/core.rmdir.php
+      libs/core/core.run_insert_handler.php
+      libs/core/core.smarty_include_php.php
+      libs/core/core.write_compiled_include.php
+      libs/core/core.write_compiled_resource.php
+      libs/core/core.write_file.php:
+      removed tabs from the main and the core/*.php files
+
+2003-10-08  Monte Ohrt  <monte@ispi.net>
+
+    * (Smarty_2_6_0-RC2)
+      NEWS
+      libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      update version numbers to RC2
+
+2003-09-18  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/designers.sgml
+      docs/de/designers.sgml:
+      fixed description of cycle's advance-attribute
+
+2003-09-16  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      apply modifiers only once to section-loop and foreach-from attributes
+
+2003-09-15  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/core/core.write_cache_paths_file.php:
+      backed out _smarty_cached_paths-file-handling
+
+    * libs/Smarty.class.php
+      libs/core/core.rm_auto.php:
+      fixed clear_compiled_tpl with explicit $tpl_file given
+      fixed return value of smarty_core_rm_auto() + Smarty::_unlink()
+
+    * libs/Smarty.class.php:
+      little fix in _get_auto_filename()
+
+2003-09-14  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php
+      libs/core/core.assemble_auto_filename.php:
+      removed auto-filenames from path-cache. merged assemble_auto_filename
+      back into Smarty::_get_auto_filename()
+
+2003-09-12  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      fixed quoting of modifier parameters
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/core/core.get_php_resource.php
+      libs/core/core.load_plugins.php
+      libs/core/core.load_resource_plugin.php:
+      remove Smarty::_plugin_implementation_exists() - use php's native
+      is_callable()
+
+2003-09-11  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      silenced two notices acces HTTP_SERVER_VARS
+
+2003-09-10  andreas halter  <phpcvs@andreashalter.ch>
+
+    * docs/de/designers.sgml
+      docs/de/getting-started.sgml
+      docs/de/programmers.sgml:
+      - minor fixes (2 rep), slight wording changes
+      - jade transform problem fixed
+
+2003-09-08  andreas halter  <phpcvs@andreashalter.ch>
+
+    * docs/de/designers.sgml
+      docs/de/getting-started.sgml
+      docs/de/manual.sgml
+      docs/de/preface.sgml
+      docs/de/programmers.sgml:
+      all updated for 2.6.0 release, translated everything from 2_5_0 branch to
+      20030908
+
+2003-09-04  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      proper checking for files in  _fetch_resource_info()
+
+2003-09-02  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      ignore {strip}/{/strip) inside {strip}-blocks
+
+    * libs/plugins/function.mailto.php:
+      fixed 2 notices in smarty_function_mailto()
+
+2003-09-01  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      re-include cache_paths on multiple calls to fetch() to avoid
+      inconsistencies
+      at multiple calls to fetch() in one script
+
+    * libs/Smarty_Compiler.class.php:
+      fixed handling of \r in {strip}
+      renamed $_trailing_lf to $_additional_newline
+
+    * libs/Smarty_Compiler.class.php:
+      the weekly fix for {strip} :)
+
+    * docs/designers.sgml:
+      fixed example for simple math.
+
+2003-08-29  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/core/core.assign_smarty_interface.php
+      libs/core/core.display_debug_console.php
+      libs/plugins/function.assign.php
+      libs/plugins/function.html_options.php
+      libs/plugins/function.html_table.php:
+      fixed PHPDocumentor-comments (thanks Konstantin)
+
+    * libs/core/core.rmdir.php:
+      made rmdir a bit more optimistic. especially it now removes
+      directories correctly that where created accidently by "safe_mode=On
+      && $use_sub_dirs=true"
+
+2003-08-27  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fixed removal of leading/trailing newlines in {strip}-blocks
+
+2003-08-25  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * INSTALL:
+      added note emphasizing the introduction of "libs/" with 2.5.0
+
+    * NEWS
+      libs/plugins/modifier.escape.php:
+      fixed proper escaping of " and ' with escape:javascript
+
+2003-08-22  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/core/core.assemble_plugin_filepath.php:
+      fixed bug in traversal of $smarty->plugins_dir-array in
+      smarty_core_assemble_plugin_filepath(). the first matching plugin in
+      the path should be used, not the last one.
+
+    * libs/core/core.read_cache_file.php:
+      discard $_cache_info when the cache should be regenerated
+
+2003-08-20  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php
+      libs/plugins/block.strip.php:
+      reverted {strip} from a block-plugin back into the compiler
+
+    * docs/programmers.sgml:
+      fixed examples for register_function() and register_block()
+
+    * libs/Smarty.class.php:
+      made template_exists() quiet when the template does not exist (thanks
+      to konstatin for pointing this out)
+
+2003-08-18  Monte Ohrt  <monte@ispi.net>
+
+    * docs/getting-started.sgml:
+      fix example title
+
+    * docs/README
+      docs/getting-started.sgml:
+      change installation wording confusion
+
+2003-08-18  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php
+      libs/core/core.read_cache_file.php:
+      fixed unnecessary load of source in template_exists() and the
+      compile-check of smarty_core_read_cache_file()
+
+    * libs/Smarty_Compiler.class.php:
+      allow section-, array- and object-dereference in $smarty-references
+
+2003-08-15  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/designers.sgml:
+      added parameter-descriptions for count_characters (thanks Konstantin
+      A. Pelepelin)
+      
+      fixed docs for {html_checkboxes}
+
+2003-08-14  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php
+      libs/core/core.read_cache_file.php:
+      fixed timestamp-check of config-files in smarty_core_read_cache_file()
+
+    * libs/Smarty.class.php:
+      fixed typecasting for arrays in _parse_resource_name()
+
+    * NEWS
+      libs/plugins/function.config_load.php:
+      fixes in config_load:
+      - handling of section-attribute
+      - reusing the same config-file multiple times
+      - serialization of config-data for php<4.2.0 (no var_export)
+      
+      many thanks to atu for pointing this out and for testing
+
+2003-08-13  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php
+      libs/core/core.smarty_include_php.php:
+      fixed problem with vars as attributes in {include_php}
+
+2003-08-13  Monte Ohrt  <monte@ispi.net>
+
+    * docs/README:
+      commit README file for documentation compiling
+
+2003-08-13  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/debug.tpl
+      libs/plugins/modifier.debug_print_var.php:
+      removed '\r' from debug_print_vars' output
+      properly escape vars in javascript-version of debug.tpl
+
+2003-08-11  Monte Ohrt  <monte@ispi.net>
+
+    * (Smarty_2_6_0_RC1)
+      NEWS
+      docs/designers.sgml
+      docs/html.dsl
+      docs/php.dsl
+      libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      get ready for 2.6.0-RC1 release
+
+2003-08-10  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php:
+      fixed status-header for cache_modified_check under cgi-sapi
+
+2003-08-09  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/core/core.is_secure.php
+      libs/core/core.is_trusted.php:
+      synced secure_dir-checking with trusted_dir-checking
+
+    * libs/core/core.is_secure.php:
+      tightenend path checking in smarty_core_is_secure()
+
+2003-08-08  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      fix: proper nesting of $smarty->_cache_including flag in cascaded
+      cached/not-cached/fetched/inserted/foo-templates
+
+    * libs/debug.tpl:
+      better escaping for $_debug_tpls[templates].filenames
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      removed redundant $smarty from Smarty::_smarty_include()
+
+    * libs/debug.tpl:
+      proper escaping of filenames in debug-console (thanks to prossel).
+
+2003-08-07  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/programmers.sgml:
+      added docs for block-methods of registered objects
+
+    * docs/programmers.sgml:
+      fixed typo in example for registered objects
+
+    * docs/designers.sgml:
+      fixed exampls of html_image and html_checkboxes
+
+    * libs/plugins/function.debug.php:
+      fixed {debug} and removed tabs in function.debug.php
+
+    * docs/programmers.sgml:
+      fixed example for register_object
+
+    * docs/designers.sgml
+      docs/programmers.sgml:
+      updated docs for capture, html_table, html_image and register_object
+
+2003-08-07  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml
+      docs/programmers.sgml:
+      add math and default_resource_type to docs
+
+    * docs/getting-started.sgml:
+      add core to example, add tech note
+
+2003-08-07  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/manual.sgml
+      docs/fr/manual.sgml:
+      upd copyright in the docs
+
+2003-08-07  Monte Ohrt  <monte@ispi.net>
+
+    * docs/getting-started.sgml:
+      added core directory to install instructions
+
+2003-08-07  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/designers.sgml
+      docs/programmers.sgml:
+      added docs for php-functions as modifiers
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      better caching of attributes for $cacheable=false-plugins
+
+    * docs/programmers.sgml:
+      added section "caching.cacheable" to the docs, explaining the usage of
+      the $cacheable-flag of the register_(block|compiler|function)-functions
+
+    * libs/Smarty_Compiler.class.php:
+      fixed output of custom-functions with cached attributes
+
+    * docs/programmers.sgml:
+      docs update on callbacks to the register_*-functions
+
+2003-08-06  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/core/core.process_compiled_include.php:
+      added optional parameter $cache_attrs to register_function() and
+      register_block(). $cache_attrs is an array containing attribute- names
+      that should be cached on calls to functions that have $cacheable set
+      to false.
+
+    * libs/Smarty.class.php:
+      fixed bug in _run_mod_handler
+
+    * libs/Smarty_Compiler.class.php:
+      fixed bug with autoload-handling of modifiers. thanks �ndre.
+
+2003-08-05  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      updated copyright notice
+
+    * libs/Smarty.class.php
+      libs/core/core.load_plugins.php:
+      fixed bug that occurred when using the same not-cacheable plugin in
+      multiple includes
+
+    * docs/programmers.sgml:
+      docs-update for plugins.writing
+
+2003-08-04  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/designers.sgml
+      docs/programmers.sgml:
+      updated docs for register_block_function(), block-functions,
+      $request_use_auto_globals and html_checkboxes
+
+2003-07-31  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      enabled registration of class-methods as callbacks for the
+      register_*-functions
+      
+      use: array('classname', 'method_name')) as callback
+
+2003-07-29  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      modifiers are resolved at compile-time now. _run_mod_handler() is
+      still used for modifiers with map_array=true (== no preceeding '@')
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/core/core.smarty_include.php:
+      moved _smarty_include() back into Smarty.class.php
+
+    * libs/Smarty.class.php
+      libs/core/core.load_plugins.php:
+      prevent unnecessary calls to _read_file() in _is_compiled()
+      converted method-call to internal function-call in
+      smarty_core_load_plugins()
+
+2003-07-28  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      quote smarty-header properly to prevent resource-names from escaping from
+      the comment
+
+2003-07-25  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/core/core.create_dir_structure.php:
+      weakend race-condition and removed bogus error-message caused by that
+      in smarty_core_create_dir_structure().
+
+2003-07-23  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php
+      libs/core/core.display_debug_console.php
+      libs/core/core.fetch_resource_info.php
+      libs/core/core.get_php_resource.php
+      libs/core/core.parse_resource_name.php
+      libs/core/core.process_cached_inserts.php
+      libs/core/core.read_cache_file.php
+      libs/core/core.run_insert_handler.php
+      libs/core/core.smarty_include.php
+      libs/core/core.smarty_include_php.php
+      libs/plugins/function.eval.php:
+      moved  _fetch_resource_info and _parse_resource_name back into
+      Smarty.class.php
+      renamed smarty_include and smarty_eval wrappers to _include and _eval
+
+2003-07-17  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/core/core.process_compiled_include.php
+      libs/core/core.read_cache_file.php:
+      improved checking of compiled_include against cached-template with
+      non-cached-chunks
+
+    * libs/core/core.write_compiled_include.php:
+      fixed too short open-tag
+
+    * libs/plugins/function.eval.php:
+      fixed assign parameter for eval (must have gotton lost on its way to 2.5.0)
+      cleaned up indentiation
+
+2003-07-03  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      resurrected $foo->$bar syntax
+
+    * libs/Smarty_Compiler.class.php:
+      i'm so stupid. kick me.
+
+    * libs/Smarty_Compiler.class.php:
+      fixed initialisation of $this->_plugins in compile_block_tag()
+
+2003-07-03  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Config_File.class.php:
+      add preg_quote delimiter
+
+2003-07-03  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      applied fix for {$var1->p1|modifier:$var2->p2}-syntax - thanks Dominik
+
+2003-07-02  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      fixed duplicate generation of arg-list in _compile_block_tag()
+
+    * libs/Smarty_Compiler.class.php:
+      fixed off-by-one-error in nocache-tag-handling
+
+2003-06-30  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      backed out errornously committed support for $foo->$bar
+
+    * libs/core/core.write_file.php:
+      fixed indentiation, silenced occasional warning
+
+    * libs/plugins/function.html_image.php:
+      match first character of file-attribute against "/" instead of
+      DIRECTORY_SEPARATOR since it is a url-path and not a file-path.
+
+    * libs/Smarty_Compiler.class.php
+      libs/core/core.write_file.php
+      libs/plugins/function.html_image.php:
+      libs/plugins/function.html_image.php
+
+    * libs/Smarty_Compiler.class.php:
+      re-fixed cacheable_state-handling
+
+    * libs/core/core.display_debug_console.php
+      libs/core/core.process_cached_inserts.php
+      libs/core/core.process_compiled_include.php
+      libs/core/core.run_insert_handler.php:
+      extincting $this out of smarty_core_*-functions
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      fixed handling of nocache-state
+
+2003-06-29  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php
+      libs/core/core.smarty_include.php
+      libs/core/core.smarty_include_php.php
+      libs/plugins/function.eval.php:
+      removed $this from smarty_include and smarty_include_php
+      added cleaner handling of $this to {eval}
+
+    * libs/core/core.load_resource_plugin.php:
+      fixed inlude_once-call
+
+    * docs/de/designers.sgml
+      docs/fr/designers.sgml:
+      fixed examples of html_radios and html_checkboxes in german and french docs
+
+2003-06-25  Monte Ohrt  <monte@ispi.net>
+
+    * libs/core/core.assemble_auto_filename.php
+      libs/core/core.write_cache_paths_file.php:
+      fix typo, fix write_cache_paths logic
+
+    * libs/Smarty.class.php
+      libs/core/core.assemble_auto_filename.php:
+      fix SMARTY_COMPILE_DIR_SEP problem, make local var
+
+2003-06-24  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty.class.php
+      libs/core/core.assemble_auto_filename.php
+      libs/core/core.write_cache_paths_file.php:
+      fixed cache_paths bug, simplified filename assembly logic
+
+2003-06-24  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.html_image.php:
+      added parsing of forgotton param "basedir"
+
+    * libs/Smarty_Compiler.class.php:
+      fixed $smarty.get-reference
+
+    * libs/plugins/block.textformat.php:
+      removed warning
+
+    * libs/Smarty_Compiler.class.php:
+      fixed value of _cacheable_state on compiler-startup
+
+2003-06-23  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/core/core.write_cache_paths_file.php:
+      make cache_path per resource, fix a couple directory path issues
+
+2003-06-23  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      removed warning when compiling empty template
+
+    * libs/core/core.write_compiled_include.php:
+      fixed bug in write_compiled_include
+
+    * libs/core/core.assemble_plugin_filepath.php:
+      fixed warning
+
+2003-06-22  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.eval.php:
+      fixed propagation of $this into evald code in smarty_function_eval()
+
+    * libs/core/core.write_cache_paths_file.php
+      libs/core/core.write_compiled_include.php:
+      fix in compiled-include-handling
+
+    * libs/core/core.assemble_auto_filename.php
+      libs/core/core.assemble_plugin_filepath.php
+      libs/core/core.assign_smarty_interface.php
+      libs/core/core.create_dir_structure.php
+      libs/core/core.fetch_resource_info.php
+      libs/core/core.get_include_path.php
+      libs/core/core.get_microtime.php
+      libs/core/core.get_php_resource.php
+      libs/core/core.is_secure.php
+      libs/core/core.is_trusted.php
+      libs/core/core.load_plugins.php
+      libs/core/core.load_resource_plugin.php
+      libs/core/core.parse_resource_name.php
+      libs/core/core.read_cache_file.php
+      libs/core/core.rm_auto.php
+      libs/core/core.rmdir.php
+      libs/core/core.write_cache_file.php
+      libs/core/core.write_cache_paths_file.php
+      libs/core/core.write_compiled_include.php
+      libs/core/core.write_compiled_resource.php
+      libs/core/core.write_file.php
+      libs/plugins/modifier.date_format.php:
+      started moving from $this to $smarty in core.*.php
+
+2003-06-21  Monte Ohrt  <monte@ispi.net>
+
+    * libs/core/core.create_dir_structure.php
+      libs/core/core.write_file.php
+      libs/plugins/function.config_load.php:
+      fix more dir paths
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/core/core.assemble_auto_filename.php
+      libs/core/core.assemble_plugin_filepath.php
+      libs/core/core.fetch_resource_info.php
+      libs/core/core.get_php_resource.php
+      libs/core/core.parse_resource_name.php
+      libs/core/core.process_cached_inserts.php
+      libs/core/core.read_cache_file.php
+      libs/core/core.rm_auto.php
+      libs/core/core.rmdir.php
+      libs/core/core.run_insert_handler.php
+      libs/core/core.smarty_include.php
+      libs/core/core.smarty_include_php.php
+      libs/core/core.write_cache_file.php
+      libs/core/core.write_cache_paths_file.php
+      libs/core/core.write_compiled_include.php
+      libs/core/core.write_compiled_resource.php
+      libs/core/core.write_file.php
+      libs/plugins/function.config_load.php
+      libs/plugins/function.fetch.php
+      libs/plugins/function.html_image.php:
+      fix filepaths to core files to use DIRECTORY_SEPARATOR
+
+2003-06-21  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      fixed {plugin|modifier} syntax
+
+    * libs/Smarty.class.php
+      libs/core/core.write_compiled_include.php:
+      fixed compiled include handling
+
+2003-06-21  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/core/core.assemble_auto_filename.php
+      libs/core/core.assemble_plugin_filepath.php
+      libs/core/core.write_cache_paths_file.php:
+      added filepath caching
+
+2003-06-20  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty_Compiler.class.php:
+      update more varnames
+
+    * libs/Smarty.class.php
+      libs/core/core.display_debug_console.php
+      libs/core/core.fetch_file_info.php
+      libs/core/core.fetch_resource_info.php
+      libs/core/core.get_php_resource.php
+      libs/core/core.parse_file_path.php
+      libs/core/core.parse_resource_name.php
+      libs/core/core.process_cached_inserts.php
+      libs/core/core.read_cache_file.php
+      libs/core/core.run_insert_handler.php
+      libs/core/core.smarty_include.php
+      libs/core/core.smarty_include_php.php
+      libs/core/core.write_compiled_resource.php
+      libs/core/core.write_compiled_template.php
+      libs/plugins/function.config_load.php:
+      refactored var naming to better reflect "resource" instead of "file" where
+      appropriate
+
+2003-06-19  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      updated version-number to 2.5.0-cvs
+
+    * libs/core/core.write_cache_file.php:
+      omit is-cache_dir-writable-check if a cache_handler_function is in use
+
+    * libs/core/core.smarty_include_php.php:
+      fixed comments in smarty_include_php
+
+2003-06-19  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/core/core.display_debug_console.php
+      libs/core/core.smarty_include.php
+      libs/plugins/function.eval.php:
+      split up _compile_template to _compile_file and _compile_source, fix eval
+      function
+      VS: ----------------------------------------------------------------------
+
+    * libs/plugins/function.config_load.php:
+      fix logic for _is_compiled()
+
+2003-06-19  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      added optional assign-attribute to {capture}-tag
+
+    * NEWS
+      libs/Smarty.class.php:
+      added $cacheable-parameter to register_compiler_function()
+
+2003-06-18  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/core/core.load_plugins.php
+      libs/core/core.process_compiled_include.php
+      libs/core/core.read_cache_file.php
+      libs/core/core.write_cache_file.php
+      libs/core/core.write_compiled_include.php:
+      added $cacheable-parameter to register_function() and register_block()
+
+    * libs/Smarty.class.php:
+      append '.php' to all compiled templates regardless of the settings of
+      $use_sub_dirs
+
+    * libs/Smarty.class.php
+      libs/core/core.read_cache_file.php:
+      fixed $file_path-parameters  passed to smarty_core_fetch_file_info()
+
+2003-06-17  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS:
+      fix name
+
+    * libs/Smarty_Compiler.class.php:
+      change varnames to follow coding methods
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      add math patch to core
+
+2003-06-17  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/core/core.smarty_include.php:
+      switched _process_template() to _is_compiled()-logic
+
+2003-06-17  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty.class.php:
+      fix _is_compiled logic
+
+    * NEWS:
+      update news file
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      fix _run_mod_handler routine
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/core/core.display_debug_console.php
+      libs/core/core.fetch_file_info.php
+      libs/core/core.parse_file_path.php
+      libs/core/core.write_compiled_template.php
+      libs/plugins/function.config_load.php:
+      fix path problems, rename some varibles from "template" to "file"
+
+2003-06-16  Monte Ohrt  <monte@ispi.net>
+
+    * libs/core/core.fetch_file_info.php
+      libs/core/core.fetch_template_info.php:
+      rename file, commit
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/core/core.parse_file_path.php
+      libs/core/core.read_cache_file.php
+      libs/plugins/block.strip.php
+      libs/plugins/block.textformat.php
+      libs/plugins/compiler.config_load.php
+      libs/plugins/function.config_load.php
+      libs/plugins/function.eval.php
+      libs/plugins/function.fetch.php
+      libs/plugins/function.html_image.php:
+      fix config_load, compile fetched arrays to compile_dir, switch display
+      back to runtime. clean up var names and function names,  split up compile
+      testing and compiling to separate funcs, rename some template_* functions
+      to
+      file_* functions and update logic so they can be used for file resources
+      other than templates.
+
+2003-06-16  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      fixed little bug in _compile_custom_tag()
+
+2003-06-16  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/core/core.assign_smarty_interface.php
+      libs/core/core.create_dir_structure.php
+      libs/core/core.display_debug_console.php
+      libs/core/core.fetch_template_info.php
+      libs/core/core.get_include_path.php
+      libs/core/core.get_microtime.php
+      libs/core/core.get_php_resource.php
+      libs/core/core.is_secure.php
+      libs/core/core.is_trusted.php
+      libs/core/core.load_plugins.php
+      libs/core/core.load_resource_plugin.php
+      libs/core/core.parse_file_path.php
+      libs/core/core.process_cached_inserts.php
+      libs/core/core.read_cache_file.php
+      libs/core/core.rm_auto.php
+      libs/core/core.rmdir.php
+      libs/core/core.run_insert_handler.php
+      libs/core/core.smarty_include.php
+      libs/core/core.smarty_include_php.php
+      libs/core/core.write_cache_file.php
+      libs/core/core.write_compiled_template.php
+      libs/core/core.write_file.php
+      libs/plugins/core.assign_smarty_interface.php
+      libs/plugins/core.create_dir_structure.php
+      libs/plugins/core.display_debug_console.php
+      libs/plugins/core.fetch_template_info.php
+      libs/plugins/core.get_include_path.php
+      libs/plugins/core.get_microtime.php
+      libs/plugins/core.get_php_resource.php
+      libs/plugins/core.is_secure.php
+      libs/plugins/core.is_trusted.php
+      libs/plugins/core.load_plugins.php
+      libs/plugins/core.load_resource_plugin.php
+      libs/plugins/core.parse_file_path.php
+      libs/plugins/core.process_cached_inserts.php
+      libs/plugins/core.read_cache_file.php
+      libs/plugins/core.rm_auto.php
+      libs/plugins/core.rmdir.php
+      libs/plugins/core.run_insert_handler.php
+      libs/plugins/core.smarty_include.php
+      libs/plugins/core.smarty_include_php.php
+      libs/plugins/core.write_cache_file.php
+      libs/plugins/core.write_compiled_template.php
+      libs/plugins/core.write_file.php:
+      move core files into their own directory under SMARTY_DIR,
+      remove abstraction function _execute_core_function
+
+    * libs/Smarty_Compiler.class.php:
+      fix newline handling for template for all template tags
+
+2003-06-11  Monte Ohrt  <monte@ispi.net>
+
+    * libs/plugins/compiler.config_load.php:
+      add compiler function to cvs repository
+
+2003-06-11  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      added config-option "request_use_auto_globals" to make auto-globals be
+      used as request vars instead of HTTP_*_VARS
+
+2003-06-11  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/plugins/function.config_load.php:
+      make config vars compile statically
+
+2003-06-11  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      backed out newlines patch
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      removed newlines in compiled templates after closing tags
+
+2003-06-10  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/de/designers.sgml:
+      fixed german note on html_image and disk-access
+
+2003-06-10  Monte Ohrt  <monte@ispi.net>
+
+    * libs/plugins/core.parse_file_path.php:
+      fix bug with resource_type resolving
+
+2003-06-09  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml:
+      replace example with more practical one
+
+2003-06-08  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      added block-methods for registered objects
+
+2003-06-07  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/programmers.sgml:
+      fixed bug in documentation for $smarty->default_modifiers
+
+2003-06-06  Monte Ohrt  <monte@ispi.net>
+
+    * libs/plugins/core.parse_file_path.php:
+      fix problem with new default_resource_type changes
+
+    * NEWS:
+      update NEWS file info
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/plugins/core.parse_file_path.php:
+      add default_resource_type, ignore 1 char resource names
+
+    * NEWS
+      libs/Config_File.class.php:
+      fix bug where config file starts with hidden section
+
+2003-06-04  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/Smarty.class.php:
+      -** empty log message ***
+
+2003-06-03  Monte Ohrt  <monte@ispi.net>
+
+    * libs/plugins/function.html_image.php:
+      fix example in code comments
+
+2003-06-03  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/function.counter.php:
+      fixed behaviour of start=... for {counter}
+
+2003-06-02  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/function.counter.php:
+      fixed assign for {counter}
+
+2003-05-30  Monte Ohrt  <monte@ispi.net>
+
+    * libs/plugins/core.write_cache_file.php
+      libs/plugins/core.write_compiled_template.php:
+      add discrete error checking pertaining to $cache_dir
+      and $compile_dir, their existance and writability
+
+2003-05-28  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/function.html_table.php:
+      added params vdir, hdir and inner to html_table to allow looping over
+      the data in various directions
+
+2003-05-28  Monte Ohrt  <monte@ispi.net>
+
+    * libs/plugins/core.compile_template.php
+      libs/plugins/core.display_debug_console.php:
+      fix problem with security and debug.tpl file
+
+2003-05-23  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS:
+      upd NEWS file
+
+    * libs/Smarty_Compiler.class.php:
+      allow spaces in literal tags
+
+2003-05-22  Monte Ohrt  <monte@ispi.net>
+
+    * docs/fr/programmers.sgml:
+      fix special chars
+
+2003-05-19  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      speed up compiled templates, hardcode plugin filepaths instead of
+      recalculate at runtime
+
+2003-05-19  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/designers.sgml:
+      fixed example of {html_image}
+
+    * docs/designers.sgml:
+      fixed typo
+
+2003-05-12  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php
+      libs/plugins/core.read_cache_file.php
+      libs/plugins/core.smarty_include.php
+      libs/plugins/function.config_load.php:
+      fixed multiple redundant occurrences for 'config' and 'template' in
+      $smarty->_cache_info
+
+2003-05-10  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/core.create_dir_structure.php:
+      refurbished create_dir_structure to use '/' internally
+
+    * libs/plugins/core.create_dir_structure.php:
+      fixed windows absolute-paths in smarty_core_create_dir_structure()
+
+    * libs/plugins/core.create_dir_structure.php:
+      fixed error-message
+
+2003-05-09  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      fixed warning due to missing param to _execute_core_function()
+
+    * libs/Smarty_Compiler.class.php:
+      fixed quoting in _compile_include_php
+
+    * libs/Smarty_Compiler.class.php:
+      fixed quoting of "file"-parameter in _compile_include_tag()
+
+2003-05-08  Monte Ohrt  <monte@ispi.net>
+
+    * docs/programmers.sgml:
+      fix typo
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/plugins/core.compile_template.php
+      libs/plugins/core.create_dir_structure.php
+      libs/plugins/core.fetch_template_info.php
+      libs/plugins/core.get_include_path.php
+      libs/plugins/core.get_microtime.php
+      libs/plugins/core.get_php_resource.php
+      libs/plugins/core.is_secure.php
+      libs/plugins/core.is_trusted.php
+      libs/plugins/core.load_plugins.php
+      libs/plugins/core.load_resource_plugin.php
+      libs/plugins/core.parse_file_path.php
+      libs/plugins/core.process_cached_inserts.php
+      libs/plugins/core.read_cache_file.php
+      libs/plugins/core.rm_auto.php
+      libs/plugins/core.rmdir.php
+      libs/plugins/core.run_insert_handler.php
+      libs/plugins/core.smarty_include.php
+      libs/plugins/core.smarty_include_php.php
+      libs/plugins/core.write_cache_file.php
+      libs/plugins/core.write_compiled_template.php
+      libs/plugins/core.write_file.php
+      libs/plugins/function.config_load.php
+      libs/plugins/function.fetch.php
+      libs/plugins/function.html_image.php:
+      abstract more private functions to plugin directory
+
+    * libs/Config_File.class.php:
+      only add DIRECTORY_SEPARATOR if it isn't already present
+
+    * libs/Config_File.class.php:
+      fix directory separator code, use DIRECTORY_SEPARATOR
+
+2003-05-08  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/designers.sgml:
+      fixed example of html_checkboxes
+
+    * NEWS
+      libs/Smarty.class.php:
+      fixed bug in _create_dir_structure() when used with
+      open_basedir-restriction and relative paths
+
+    * docs/designers.sgml:
+      fixed example for html_radios
+
+2003-05-07  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php
+      libs/plugins/core.assign_smarty_interface.php
+      libs/plugins/core.display_debug_console.php
+      libs/plugins/function.display_debug_console.php:
+      abstracted display_debug_console and assign_smarty_interface to plugin dir
+      as a test
+
+    * libs/Smarty.class.php
+      libs/plugins/function.display_debug_console.php:
+      correct misc varnames, abstract debug console display to plugin function
+
+    * libs/plugins/modifier.escape.php:
+      fix typo
+
+2003-05-05  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty_Compiler.class.php:
+      add % to math
+
+    * libs/Smarty.class.php:
+      clean up comments, formatting
+
+    * NEWS
+      libs/Smarty.class.php:
+      keep DIR_SEP for 3rd party compatability
+
+    * NEWS
+      libs/Smarty.class.php:
+      remove DIR_SEP, use DIRECTORY_SEPARATOR exclusively
+
+    * libs/Smarty_Compiler.class.php:
+      remove ++ and -- math operators on template vars
+
+2003-05-04  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty_Compiler.class.php:
+      removed unused parameter $quote from Smarty_Compiler::_parse_attrs()
+
+    * libs/plugins/function.html_image.php:
+      fixed DIR_SEP in html_image-plugin
+
+2003-05-04  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/Smarty.class.php:
+      rename DIR_SEP to SMARTY_DIR_SEP to avoid varname collisions
+
+2003-05-04  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/function.html_image.php:
+      changed "link" to "href" in html_image. "link" is still working but
+      deprecated
+      html_image always renders an alt-tag now (default alt="")
+      cleaned up indentiation of function.html_image.php
+
+2003-05-03  Monte Ohrt  <monte@ispi.net>
+
+    * libs/debug.tpl:
+      fix typo
+
+2003-05-02  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/function.counter.php:
+      fixed assign attribute for multiple counters
+
+2003-05-02  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty_Compiler.class.php:
+      allow math on negative number
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      added simple math operators to variables
+
+2003-05-02  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/designers.sgml:
+      fixed typos
+
+2003-04-30  Monte Ohrt  <monte@ispi.net>
+
+    * docs/fr/appendixes.sgml
+      docs/fr/common.dsl
+      docs/fr/designers.sgml
+      docs/fr/getting-started.sgml
+      docs/fr/html-common.dsl
+      docs/fr/html.dsl
+      docs/fr/manual.sgml
+      docs/fr/php.dsl
+      docs/fr/preface.sgml
+      docs/fr/programmers.sgml:
+      add frech docs to cvs repository
+
+2003-04-29  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      reverted patch for case-insensitive tag-names
+
+2003-04-28  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/programmers.sgml:
+      reverted back to humerous redundancy in the docs :). although we all
+      know we are here to generate template-based output, and not to have
+      fun ;-)
+
+    * docs/getting-started.sgml:
+      fixed default user and group for max os x installation
+
+    * libs/Smarty.class.php:
+      made $function[2] and $function[3] options for register_resource
+
+    * libs/Smarty.class.php:
+      fixed issue with object-callback when fetching a php-resource
+
+    * NEWS
+      libs/Smarty.class.php:
+      enabled array(&$obj. 'source', 'timestamp', 'secure', 'trusted') as
+      callback for register_resource()
+      
+      enabled array(&$obj, 'method') as callback for
+      $default_template_handler_func
+
+2003-04-27  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/designers.sgml
+      docs/programmers.sgml:
+      fixed some typos, thank to mehdi
+
+    * libs/plugins/function.counter.php:
+      prevent assign from overruling print-attribute in function.counter.php
+
+    * libs/plugins/function.counter.php:
+      fixed problem with counter and assign
+
+    * libs/Smarty.class.php:
+      fixed notice in  _load_plugins()
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      made plugin-names case-insensitive. this affects
+      compiler/block/custom-functions and modifers.
+
+2003-04-26  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      remove unnecessary close/open tags from compiled templates
+
+2003-04-26  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/designers.sgml:
+      added documentation for foreach.property.*
+
+2003-04-24  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * docs/designers.sgml:
+      fixed example table_attr and tr_attr in html_table-example
+
+2003-04-21  Greg Beaver  <greg@chiaraquartet.net>
+
+    * libs/Smarty.class.php:
+      fixed small bug in doc comments
+
+2003-04-21  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/function.html_image.php:
+      fixed errornous creation of '//' in image_path in html_image
+
+2003-04-21  Monte Ohrt  <monte@ispi.net>
+
+    * libs/plugins/modifier.debug_print_var.php:
+      fix htmlspecialchars() conflict
+
+    * NEWS
+      libs/plugins/modifier.debug_print_var.php:
+      fix escapement of special chars in key values of debug console
+
+    * NEWS
+      libs/plugins/function.config_load.php:
+      fixed debug timing logic for config_load
+
+    * docs/designers.sgml:
+      fix example text
+
+
+2003-04-20  Greg Beaver <cellog@users.sourceforge.net>
+    * plugins/*
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      Config_File.class.php:
+      updated all doc comments to phpDocumentor format (whew!)
+
+2003-04-06  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/plugins/function.math.php:
+      allowed "_" in the name of variable-parameters to {math}-function
+
+2003-04-04  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      docs/designers.sgml
+      libs/Smarty_Compiler.class.php:
+      change backtic syntax from $`foo` to `$foo`
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      recognize $foo[][] syntax in embedded quotes without backticks
+
+2003-04-03  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      name=123 is passed as an integer (not a string) to plugins now
+
+2003-04-01  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      added CVS $Id: ChangeLog,v 1.407 2006/01/16 06:31:51 changelog Exp $
+
+2003-03-31  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      added missing compile_id inside Smarty_Compiler
+
+    * libs/Smarty_Compiler.class.php:
+      fixed flaw when generating an error for missing postfilter
+
+2003-03-31  Monte Ohrt  <monte@ispi.net>
+
+    * docs/getting-started.sgml
+      docs/programmers.sgml:
+      fix typos
+
+2003-03-27  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/modifier.debug_print_var.php:
+      $length is now propagated to sub-values in debug_print_var
+
+2003-03-26  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS:
+      update header
+
+    * RELEASE_NOTES:
+      commit changes to release notes
+
+    * (Smarty_2_5_0_RC2)
+      libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      committing RC2
+
+2003-03-24  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php:
+      made clear_cache() ignore compile_id when clearing cache_groups
+
+    * libs/plugins/function.popup.php:
+      made onmouseout XHTML-compatible in function.popup.php
+
+2003-03-21  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php:
+      applied new var-names to fetch()
+
+    * NEWS
+      libs/Smarty.class.php:
+      renamed $localvars to $_localvars in cache-file-handling-functions,
+      added _get_auto_id()-function
+
+2003-03-21  Monte Ohrt  <monte@ispi.net>
+
+    * libs/plugins/function.mailto.php
+      libs/plugins/function.popup.php:
+      update functions for XHTML compatability
+
+2003-03-21  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * libs/Smarty.class.php:
+      fixed wrong $auto_id in _read_cache_file()
+
+    * NEWS
+      libs/Smarty.class.php:
+      swapped compile_id and cache_id in read_cache_file and write_cache_file
+
+    * libs/Smarty.class.php:
+      reverted patch for ignoring compile-id back to -r1.364, due to problems
+
+    * NEWS
+      libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_radios.php:
+      html_radios and html_checkboxes accept "selected" instead of "checked"
+      optionally now
+
+    * NEWS
+      libs/Smarty.class.php:
+      swapped compile_id and cache_id for cache-file-handling again
+
+2003-03-20  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty_Compiler.class.php:
+      fix notice when no parameter is passed to default
+
+2003-03-20  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php:
+      removed notice of undefined var in _rm_auto()
+
+2003-03-19  Monte Ohrt  <monte@ispi.net>
+
+    * libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_radios.php
+      libs/plugins/function.html_table.php:
+      fix a few error messages, follow consistancy format plugin_name: errormsg
+
+    * libs/plugins/function.html_radios.php:
+      update error messages
+
+    * NEWS
+      libs/plugins/function.html_radios.php:
+      add a warning when an array is passed as the 'checked' value of html_radios
+
+2003-03-19  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fixed errormessage in _compile_smarty_ref()
+
+    * NEWS
+      docs/designers.sgml:
+      updated docs for html_image
+
+2003-03-18  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/Smarty.class.php:
+      cleaned up calls to readdir()
+
+    * libs/plugins/function.html_options.php:
+      fixed label for optgroup in html_options
+
+2003-03-18  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fix (newly introduced) bug with passing multiple modifiers to a parameter
+
+2003-03-18  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      docs/designers.sgml:
+      updated docs for html_checkboxes, html_options and html_radios
+
+    * libs/plugins/function.html_options.php:
+      fixed wrong default-"name" in function.html_options.php
+
+    * NEWS
+      libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_radios.php:
+      renamed "checkbox" and "radios" to "options" in {html_checkboxes} and
+      {html_radios}
+
+    * libs/plugins/outputfilter.trimwhitespace.php:
+      tried to optimize re-replacement in outputfilter.trimwhitespace.php a
+      little
+
+    * libs/plugins/outputfilter.trimwhitespace.php:
+      fixed greedy str_replace in outputfilter.trimwhitespace.php
+
+    * NEWS
+      libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_options.php
+      libs/plugins/function.html_radios.php:
+      html_options, html_checkboxes and html_radios now pass-thru all unknown
+      paramters
+
+2003-03-17  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/function.html_options.php:
+      html_options passthru all unknown paramters now
+
+2003-03-17  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/plugins/function.html_image.php:
+      Fix link bug in html_image function, also make output XHTML compatible
+
+    * libs/Smarty_Compiler.class.php:
+      fix issue of embedded var and escaped double quotes
+
+2003-03-15  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      back out "@" logic, apply only to default modifier special case
+
+    * libs/Smarty_Compiler.class.php:
+      fix @ logic, only use upon an echo
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      append "@" to template var echoes to supress possible notices
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      append "@" to _run_mod_handler to supress warnings
+
+2003-03-14  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fix problem with escaped double quotes
+
+    * NEWS
+      libs/plugins/function.html_radios.php:
+      fixed html_options to not return an array
+
+2003-03-12  Messju Mohr  <messju@lammfellpuschen.de>
+
+    * NEWS
+      libs/plugins/modifier.truncate.php:
+      fixed length in modifier.truncate.php
+
+    * NEWS
+      libs/plugins/outputfilter.trimwhitespace.php:
+      fixed handling of '$'-signs in trimwhitespace outputfilter (messju)
+
+2003-03-12  Monte Ohrt  <monte@ispi.net>
+
+    * docs/programmers.sgml:
+      update technical explanation of assign_by_ref and append_by_ref
+
+2003-03-11  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/Smarty.class.php:
+      fix config file recompiling code
+
+2003-03-07  Monte Ohrt  <monte@ispi.net>
+
+    * libs/plugins/function.html_image.php:
+      change E_USER_ERROR to E_USER_NOTICE
+
+    * libs/plugins/function.html_image.php:
+      suppress warning in html_image
+
+    * NEWS
+      libs/plugins/function.html_image.php:
+      update changes to html_image
+
+2003-03-06  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml
+      docs/de/appendixes.sgml
+      docs/de/common.dsl
+      docs/de/designers.sgml
+      docs/de/getting-started.sgml
+      docs/de/html-common.dsl
+      docs/de/html.dsl
+      docs/de/manual.sgml
+      docs/de/preface.sgml
+      docs/de/programmers.sgml:
+      add german docs to dist
+
+    * NEWS:
+      update news file
+
+    * libs/plugins/function.html_image.php:
+      fix width/height parameter index
+
+    * NEWS
+      libs/Smarty.class.php:
+      get rid of unsetting name and script attributes to insert tags
+
+2003-03-05  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      RELEASE_NOTES:
+      update NEWS file
+
+    * libs/plugins/modifier.string_format.php:
+      fix argument order, erroneously swapped a while back
+
+    * (Smarty_2_5_0_RC1)
+      NEWS
+      README
+      RELEASE_NOTES
+      libs/Config_File.class.php
+      libs/Smarty.class.php
+      libs/Smarty_Compiler.class.php:
+      commit final changes for 2.5.0-RC1
+
+2003-03-04  Monte Ohrt  <monte@ispi.net>
+
+    * docs/programmers.sgml:
+      remove $show_info_header and $show_info_include property vars from docs
+
+2003-03-03  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/plugins/function.popup.php:
+      fixed PHP notice
+
+2003-02-28  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty_Compiler.class.php:
+      simplify smarty.const.foo and smarty.const.$foo logic
+
+    * libs/Smarty_Compiler.class.php:
+      only allow $foo syntax in embedded quotes, unless escaped with backticks
+      then allow any dollar var
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      fix "once" var compiling to work with new attr compiling methods for
+      include_php
+
+    * FAQ
+      NEWS
+      README
+      docs/designers.sgml
+      docs/getting-started.sgml
+      libs/Smarty_Compiler.class.php
+      libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_image.php
+      libs/plugins/function.html_options.php
+      libs/plugins/function.html_radios.php
+      libs/plugins/function.html_select_date.php
+      libs/plugins/function.html_select_time.php
+      libs/plugins/function.html_table.php:
+      fix $smarty.const.foo compiling, clean up double quoted strings,
+      allow full dollar var syntax in quotes again
+
+2003-02-27  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml
+      docs/programmers.sgml
+      libs/Smarty_Compiler.class.php:
+      update docs, fix smarty var compiling, allow any $smarty.*.$foo syntax,
+      add $`foobar` for embedded variables
+
+    * libs/plugins/function.html_image.php:
+      update functionality
+
+2003-02-26  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      libs/plugins/modifier.nl2br.php:
+      add nl2br modifier
+
+    * libs/plugins/function.html_image.php:
+      add link parameter
+
+2003-02-24  Monte Ohrt  <monte@ispi.net>
+
+    * libs/Smarty.class.php
+      libs/plugins/function.html_image.php:
+      fix rename problem in windows, unlink first
+
+    * libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_image.php
+      libs/plugins/function.html_options.php
+      libs/plugins/function.html_radios.php
+      libs/plugins/shared.escape_special_chars.php:
+      update functions with separate escape_special_chars routine
+
+    * NEWS
+      libs/plugins/function.html_checkboxes.php
+      libs/plugins/function.html_radios.php:
+      commit checkboxes, update radios
+
+    * NEWS
+      libs/Smarty.class.php
+      libs/plugins/function.html_image.php:
+      fix bug with get_registered_object
+
+    * NEWS
+      libs/plugins/modifier.cat.php:
+      added cat modifier to distribution
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      added << >> <> support to IF statements
+
+    * libs/plugins/function.html_radios.php:
+      apply patch to initial html_radios function
+
+    * NEWS
+      libs/Smarty.class.php:
+      fix _assign_smarty_interface to not overwrite keys other than 'request'
+
+    * NEWS
+      libs/plugins/function.html_radios.php:
+      added html_radios to distribution
+
+    * NEWS
+      libs/plugins/modifier.string_format.php:
+      fixed arg order of string_format
+
+    * NEWS
+      libs/Smarty.class.php:
+      use tmp file for file writes, avoid race condition
+
+    * NEWS
+      libs/Smarty_Compiler.class.php:
+      add $smarty.config.foo var, handle embedded smarty var correctly
+
+    * NEWS
+      libs/plugins/function.fetch.php:
+      silence warnings in fetch plugin
+
+2003-02-21  Monte Ohrt  <monte@ispi.net>
+
+    * INSTALL:
+      update wording
+
+    * INSTALL:
+      update install instructions
+
+    * AUTHORS
+      BUGS
+      CREDITS
+      QUICKSTART
+      README
+      RESOURCES
+      TESTIMONIALS:
+      remove some files already in docs or elsewhere
+
+    * demo/index.php:
+      add templates_c to repository
+
+    * index.php:
+      move demo files to demo directory
+
+    * Config_File.class.php
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      debug.tpl:
+      moved lib files under libs directory
+
+2003-02-20  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.class.php:
+      add get_config_vars() method, update get_template_vars() functionality
+
+    * NEWS
+      Smarty.class.php:
+      fix minor logic in _fetch_template_info()
+
+    * NEWS
+      Smarty.class.php:
+      support merging appended vars
+
+    * NEWS
+      Smarty.class.php:
+      fix cache groups behavior with compile_id set
+
+2003-02-19  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php:
+      back out third parameter, extend functionality of append
+
+    * NEWS
+      Smarty_Compiler.class.php:
+      update imbedded vars, allow special $smarty vars
+
+    * plugins/function.html_table.php:
+      add plugin html_table
+
+    * NEWS
+      Smarty.class.php:
+      support appending key=>val pairs
+
+    * NEWS
+      Smarty_Compiler.class.php:
+      change embedded variable logic to only recognize $foo and $foo[0][bar]
+      syntax
+
+    * NEWS
+      Smarty_Compiler.class.php:
+      allow null as function attribute value
+
+2003-02-18  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+      support foo->bar[index] syntax
+
+    * Smarty_Compiler.class.php:
+      allow $foo->bar[0] syntax
+
+2003-02-17  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/modifier.escape.php:
+      fix syntax error from previous commit
+
+    * NEWS
+      Smarty.class.php:
+      add error msgs to get_registered_object
+
+    * Smarty.class.php:
+      add function for getting reference to registered object
+
+    * Smarty_Compiler.class.php:
+      back out patches for object and objref calls on $smarty var
+
+    * NEWS
+      Smarty_Compiler.class.php:
+      treat unrecognized param attribute syntax as a string
+
+    * NEWS
+      Smarty_Compiler.class.php:
+      support $smarty.const.$foo syntax
+
+    * NEWS
+      debug.tpl
+      plugins/modifier.count_words.php
+      plugins/modifier.escape.php:
+      fix E_NOTICE messages
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+      add @ and === to if tokens, few param cleanups
+
+2003-02-16  Greg Beaver  <greg@chiaraquartet.net>
+
+    * ChangeLog
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+      many more phpdoc comment upgrades
+
+2003-02-15  Greg Beaver <cellog@sourceforge.net>
+    * Smarty.class.php
+      Smarty_Compiler.class.php
+      continue cleaning of phpdoc comments.  All that is needed is the
+      addition of @return tags and perhaps a bit more verbose comments
+      and they are finished.
+
+2003-02-14  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.class.php:
+      enable config_load error messages
+
+    * NEWS
+      plugins/function.html_options.php:
+      fix html_options to not escape already escaped entities
+
+    * NEWS
+      Smarty.class.php:
+      send Last-Modified header on cache creation, misc tab/spacing cleanup
+
+2003-02-13  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php
+      docs/designers.sgml:
+      allow dash in plain text
+
+    * NEWS
+      Smarty_Compiler.class.php:
+      check strict syntax of function attributes
+
+2003-02-12  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty_Compiler.class.php:
+      dropped support for modifiers on object parameters,
+      added support for objects as modifier parameters
+
+    * NEWS
+      Smarty_Compiler.class.php
+      docs/designers.sgml:
+      fix bug with decimal numbers in if statements, misc doc updates
+
+2003-02-11  Monte Ohrt  <monte@ispi.net>
+
+    * (Smarty_2_4_2)
+      Config_File.class.php
+      NEWS
+      README
+      RELEASE_NOTES
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+      update version numbers
+
+2003-02-10  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty_Compiler.class.php:
+      add support for $foo->$bar syntax
+
+    * NEWS:
+      update NEWS file
+
+    * NEWS
+      Smarty_Compiler.class.php:
+      support full var syntax in quoted text, fix problem with const var access,
+      clean up some more regex code, fix object problem with no properties
+
+2003-02-06  Monte Ohrt  <monte@ispi.net>
+
+    * (Smarty_2_4_1)
+      Config_File.class.php
+      NEWS
+      README
+      RELEASE_NOTES
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+      committed 2.4.1 changes
+
+    * NEWS
+      Smarty_Compiler.class.php:
+      ignore case in IF statements
+
+2003-02-05  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty_Compiler.class.php:
+      treat undefined constants as null
+
+    * NEWS
+      Smarty.class.php:
+      fix problem with inserts and nested fetches
+
+    * Smarty_Compiler.class.php:
+      fix "if" regex for math tokens
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      docs/getting-started.sgml:
+      added support for extracting params to include_php
+
+2003-02-04  Monte Ohrt  <monte@ispi.net>
+
+    * RELEASE_NOTES:
+      reformat text
+
+2003-02-03  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS:
+      update news file
+
+2003-02-03  Greg Beaver  <greg@chiaraquartet.net>
+
+    * ChangeLog
+      Smarty.class.php:
+      begin fixing phpdoc comments in Smarty.class.php
+
+    * ChangeLog
+      Config_File.class.php:
+      fixed phpdoc comments
+
+2003-02-03  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php:
+      allow $foo->bar[$x].foo syntax
+
+    * Smarty_Compiler.class.php
+      index.php
+      configs/test.conf
+      templates/index.tpl:
+      fix accidental commit
+
+    * index.php
+      configs/test.conf
+      templates/index.tpl:
+      allow $foo->bar[$j].blah type of syntax
+
+2003-02-02  Greg Beaver  <cellog@php.net>
+
+    * Smarty.class.php
+      begin fixing of phpdoc comments
+
+    * Config_File.class.php
+      fix phpdoc comments, add phpDocumentor docblock templates
+
+2003-02-02  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php
+      docs/html.dsl
+      docs/php.dsl:
+      fix version number
+
+    * (Smarty_2_4_0)
+      Config_File.class.php
+      NEWS
+      README
+      RELEASE_NOTES
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      docs/appendixes.sgml
+      docs/designers.sgml
+      docs/programmers.sgml:
+      update Smarty version numbers
+
+2003-01-30  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty_Compiler.class.php
+      TODO:
+      fix order of php tag comparisons
+
+    * NEWS
+      Smarty_Compiler.class.php:
+      fix known php tag handling problems
+
+2003-01-29  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php:
+      change comments to phpdoc style
+
+2003-01-28  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php
+      docs/programmers.sgml:
+      make separate var for compiler file
+
+    * plugins/function.fetch.php:
+      fix error call
+
+2003-01-25  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php:
+      add support for restriction to registered methods
+
+    * plugins/outputfilter.trimwhitespace.php:
+      update with textarea support
+
+2003-01-24  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php:
+      fix compiling problem with {foreach} tags
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php:
+      put objects in own array, add object param format support, change
+      object syntax from foo.bar to foo->bar
+
+2003-01-23  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+      add support for object registration
+
+2003-01-22  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php:
+      add file & line number of calling error to error message
+
+2003-01-21  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php:
+      put php style object syntax back in
+
+2003-01-20  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php:
+      move security settings to fetch function for template_dir
+
+    * NEWS
+      Smarty.class.php:
+      fix debug template and security, add template_dir to secure_dir at runtime
+
+2003-01-17  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+      added new object support without new template syntax
+
+2003-01-15  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+      fix if statement syntax for negative integers, fix issue with directories
+      named '0'
+
+2003-01-08  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php
+      plugins/function.counter.php
+      plugins/function.cycle.php
+      plugins/function.debug.php
+      plugins/function.eval.php
+      plugins/function.fetch.php
+      plugins/function.html_options.php
+      plugins/function.html_select_date.php
+      plugins/function.html_select_time.php
+      plugins/function.mailto.php
+      plugins/function.math.php
+      plugins/function.popup.php
+      plugins/function.popup_init.php:
+      update plugins to return values instead of echo, fix config file cache
+      to include global config variables in cache file
+
+    * Smarty_Compiler.class.php:
+      fix bug with >= tests in if statements, comment out full object support
+
+2003-01-06  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      docs/html.dsl
+      plugins/modifier.escape.php:
+      add javascript escape parameter to escape modifier
+
+2003-01-02  Monte Ohrt  <monte@ispi.net>
+
+    * templates/header.tpl:
+      move the title into head where it should be
+
+2002-12-24  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php:
+      added correct line numbers to smarty syntax error messages
+
+    * docs/programmers.sgml:
+      update append documentation, make more clear on its function
+
+    * Smarty_Compiler.class.php:
+      fix modifier matching regexp
+
+2002-12-23  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php:
+      support nested function calls in IF statements
+
+2002-12-20  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php:
+      few more fixes, spaces around function parameters
+
+    * Smarty_Compiler.class.php:
+      fix misc syntax issues with {if} tags
+
+2002-12-20  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php:
+      fix misc syntax issues with {if} tags
+
+2002-12-19  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php:
+      commit updates, passes all smoke tests
+
+    * NEWS:
+      update NEWS file
+
+    * Smarty_Compiler.class.php:
+      fixed literal string not in quotes as parameters
+
+    * NEWS
+      Smarty_Compiler.class.php:
+      fix misc syntax issues, add ability to pass modifiers to functions
+
+2002-12-18  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS:
+      update NEWS
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+      update compiler code, clean up regex, add new syntax features
+
+2002-12-16  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS:
+      update NEWS file
+
+    * Smarty_Compiler.class.php:
+      commit updates for objects
+
+2002-12-14  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php:
+      fix bug with compiling config files with caching on
+
+2002-12-13  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php:
+      fix problem with matching single quoted strings
+
+    * Smarty_Compiler.class.php:
+      update embedded variable logic, get rid of ."" at end of output
+
+    * NEWS
+      docs/designers.sgml
+      plugins/function.html_select_date.php:
+      add day_value_format to html_select_date
+
+2002-12-12  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/modifier.debug_print_var.php:
+      fix bug, double escaped values in display
+
+    * Smarty.class.php:
+      move debug test back into fetch()
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      plugins/outputfilter.trimwhitespace.php:
+      assigned vars are no longer in global name space, few debug cleanups
+
+2002-12-11  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/function.popup.php:
+      fix error in newline code
+
+    * plugins/function.popup.php:
+      fix popup to allow newlines in text data
+
+2002-12-10  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php:
+      fix plugin error logic
+
+    * docs/designers.sgml
+      docs/programmers.sgml:
+      edit examples, make more verbose
+
+    * NEWS
+      plugins/function.html_options.php:
+      escape html entities in the option values and output
+
+    * NEWS
+      plugins/function.html_options.php:
+      fixed bug with label of html_options
+
+2002-12-09  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php:
+      add support for var_export()
+
+    * Config_File.class.php
+      Smarty.class.php:
+      clean up code, respect force_compile and compile_check flags
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      docs/designers.sgml
+      plugins/function.mailto.php:
+      add caching feature to config loading, document update, add mailto plugin
+
+2002-12-08  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/function.fetch.php:
+      fix query part of URL
+
+2002-12-05  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml:
+      fix typos
+
+2002-11-22  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php:
+      patch for warning message
+
+2002-11-21  Monte Ohrt  <monte@ispi.net>
+
+    * RELEASE_NOTES
+      Smarty.class.php:
+      get rid of testing for a set value with assign function, just set to
+      whatever is passed into the template
+
+    * docs/programmers.sgml:
+      fix typo
+
+2002-11-19  Monte Ohrt  <monte@ispi.net>
+
+    * Config_File.class.php
+      NEWS
+      README
+      RELEASE_NOTES
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+      commit changes, ready for 2.3.1 release
+
+2002-11-01  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/function.html_options.php:
+    added label attribute to all option outputs, cover w3c spec.
+
+    * NEWS: update NEWS file
+
+    * docs/designers.sgml: update docs for optgroup output
+
+    * plugins/function.html_options.php:
+    make html_options work with optgroup, make func modular and recursive.
+
+2002-10-29  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.class.php: set mtime on compile files so they match source files
+
+2002-10-18  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.class.php: added proper support for open_basedir setting
+
+    * docs/designers.sgml: clear up docs on index, iteration and rownum
+
+2002-10-16  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/modifier.default.php: fix warning message in default modifier
+
+2002-09-25  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml
+      plugins/modifier.strip.php
+      NEWS: added strip variable modifier
+
+2002-09-24  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+    * Smarty_Compiler.class.php:
+    Fix to be able to use $smarty.x variables as arrays.
+
+2002-09-23  Monte Ohrt  <monte@ispi.net>
+
+    * Config_File.class.php:
+    add support for mac/dos formatted config files (fix newlines)
+
+    * docs/programmers.sgml: add optional tags to clear_cache parameters
+
+    * docs/designers.sgml:
+    fix error with include_php description, add $this to description
+
+2002-09-20  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      docs/getting-started.sgml: fixed errors with example setup docs
+
+2002-09-16  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/block.textformat.php
+      docs/designers.sgml
+      NEWS: add textformat block function
+
+2002-09-10  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml:
+    add assign attribute to cycle function documentation
+
+    * docs/designers.sgml
+      docs/programmers.sgml: fix typos
+
+2002-09-09  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/function.debug.php
+      templates/header.tpl:
+    fix header in debug template, fix typo in header.tpl example
+
+2002-08-15  mohrt  <mohrt@pb1.pair.com>
+
+    * docs/programmers.sgml: fix typos
+
+2002-08-08  mohrt  <mohrt@pb1.pair.com>
+
+    * RELEASE_NOTES
+      Smarty.class.php:
+    supress warnings from unlink() and is_dir(), let error handler deal with it
+
+2002-08-07  mohrt  <mohrt@pb1.pair.com>
+
+    * docs/appendixes.sgml
+      docs/designers.sgml
+      docs/programmers.sgml
+      Config_File.class.php
+      NEWS
+      README
+      RELEASE_NOTES
+      Smarty.class.php
+      Smarty_Compiler.class.php: update files with new version numbers
+
+2002-08-02  mohrt  <mohrt@pb1.pair.com>
+
+    * NEWS: update NEWS file with credits
+
+    * NEWS
+      Smarty.class.php: added assign_by_ref() and append_by_ref() functions
+
+2002-08-01  mohrt  <mohrt@pb1.pair.com>
+
+    * TODO
+      NEWS
+      Smarty.class.php:
+    changed default warning type for plugin errors from E_USER_WARNING to E_USER_ERROR
+
+2002-07-29  mohrt  <mohrt@pb1.pair.com>
+
+    * plugins/function.html_select_time.php
+      docs/designers.sgml
+      NEWS: added paramters to html_select_time plugin
+
+2002-07-25  Andrei Zmievski  <andrei@pb1.pair.com>
+
+    * TODO: *** empty log message ***
+
+2002-07-24  mohrt  <mohrt@pb1.pair.com>
+
+    * QUICKSTART: update QUICKSTART guide
+
+    * NEWS
+      debug.tpl
+      plugins/modifier.debug_print_var.php:
+    update debug console to show objects, fix warning in debug.tpl
+
+2002-07-23  mohrt  <mohrt@pb1.pair.com>
+
+    * docs/programmers.sgml: fix load_filter examples
+
+    * Config_File.class.php
+      NEWS: fix error when there are no sections in config file
+
+2002-07-19  mohrt  <mohrt@pb1.pair.com>
+
+    * docs/getting-started.sgml: fix error in install guide
+
+2002-07-18  mohrt  <mohrt@pb1.pair.com>
+
+    * Smarty_Compiler.class.php:
+    correct the expression match for smarty:nodefaults
+
+2002-07-17  mohrt  <mohrt@pb1.pair.com>
+
+    * Smarty_Compiler.class.php: fix default modifier to work with config vars
+
+    * Smarty_Compiler.class.php: got args to strstr backwards...
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+    change default modifiers to array instead of string
+
+    * Smarty_Compiler.class.php
+      docs/designers.sgml
+      Smarty.class.php: add default modifier logic, minor doc updates
+
+    * NEWS
+      Smarty.class.php
+      plugins/function.popup_init.php:
+    make popup_init xhtml compliant, minor variable name changes for consistancy
+
+2002-07-16  mohrt  <mohrt@pb1.pair.com>
+
+    * NEWS: update NEWS file
+
+    * plugins/function.debug.php
+      Smarty.class.php
+      debug.tpl
+      NEWS:
+    fix problem with filenames on windows, add ability to supply expire time in seconds when clearing cache or compiled files
+
+2002-07-15  mohrt  <mohrt@pb1.pair.com>
+
+    * Smarty.class.php:
+    fixed problem with insert tags when loading function from script attribute
+    and caching enabled (Monte)
+
+2002-07-14  mohrt  <mohrt@pb1.pair.com>
+
+    * NEWS
+      Smarty.class.php: fix bug with debug_tpl file path for Windows
+
+2002-07-12  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: fix append function with array/string issue
+
+2002-07-11  Monte Ohrt  <monte@ispi.net>
+
+    * RELEASE_NOTES: update release notes
+
+    * NEWS
+      README
+      RELEASE_NOTES
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      Config_File.class.php: update files to 2.2.0 tags, get ready for release
+
+2002-07-09  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.class.php: make debug.tpl work with any delimiter
+
+    * NEWS
+      Smarty.class.php:
+    change tests in append and assign to != '' instead of empty(), which is more accurate
+
+2002-07-08  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml: minor doc update
+
+    * Smarty.class.php:
+    cast var as an array, simplify and get rid of PHP warning messages
+
+2002-07-03  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: one more N
+
+    * Smarty.class.php:
+    prepend "N" to filenames to avoid possible OS issues with dir names starting with "-"
+
+    * Smarty.class.php: only set $debug_tpl in constructor if empty
+
+    * Smarty.class.php
+      docs/designers.sgml
+      docs/getting-started.sgml
+      docs/programmers.sgml:
+    make use_sub_dirs go back to crc32 for subdir separation
+
+2002-06-29  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/function.eval.php: do nothing if $val is empty
+
+    * TODO
+      plugins/function.eval.php
+      plugins/function.popup_init.php:
+    add zindex to popup init, fix error message for eval.
+
+2002-06-27  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php:
+    only loop through relative paths for PHP include_path, remove $_relative variable
+
+    * Smarty_Compiler.class.php: added {$smarty.version} variable
+
+2002-06-26  Monte Ohrt  <monte@ispi.net>
+
+    * docs/appendixes.sgml
+      docs/designers.sgml
+      docs/getting-started.sgml
+      docs/programmers.sgml
+      Smarty.class.php:
+    update plugin loading logic, look in SMARTY_DIR, then cwd. If all fail, then retry all with include_path
+
+    * templates/header.tpl
+      Smarty.class.php: update get_include_path, get _path_array only once
+
+    * Smarty.class.php: fix get_include_path function for windows
+
+    * Smarty.class.php: update plugin search logic
+
+    * Smarty.class.php: only search include_path if relative path
+
+    * plugins/function.html_select_date.php
+      plugins/function.html_select_time.php
+      plugins/modifier.date_format.php
+      Smarty_Compiler.class.php
+      NEWS
+      Smarty.class.php: allow plugins_dir to be an array of directories
+
+2002-06-25  Monte Ohrt  <monte@ispi.net>
+
+    * docs/programmers.sgml
+      docs/getting-started.sgml: update installation docs
+
+    * debug.tpl
+      docs/getting-started.sgml
+      templates/debug.tpl
+      NEWS
+      Smarty.class.php: move debug.tpl to SMARTY_DIR, add to constructor
+
+2002-06-24  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/function.assign_debug_info.php
+      NEWS: fixed warning message in function.assign_debug_info
+
+    * Smarty.class.php: update include_path fixes
+
+    * NEWS:
+    fixed $template_dir, $compile_dir, $cache_dir, $config_dir to respect include_path
+
+2002-06-23  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/shared.make_timestamp.php:
+    update timestamp plugin to work when passed a timestamp
+
+2002-06-19  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS: update NEWS file
+
+    * plugins/modifier.date_format.php
+      docs/designers.sgml:
+    update date_format, allow optional 2nd paramater as default date if passed date is empty. update docs.
+
+    * plugins/modifier.date_format.php:
+    fix date_format modifier, return nothing if given empty string
+
+2002-06-18  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      plugins/function.cycle.php:
+    gave $reset a default value in cycle function
+
+    * plugins/function.html_select_date.php
+      plugins/shared.make_timestamp.php
+      NEWS:
+    corrected warnings in html_select_time function, made make timestamp always return a timestamp
+
+2002-06-17  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: swapped around cache_id and compile_id order
+
+2002-06-14  Monte Ohrt  <monte@ispi.net>
+
+    * docs/programmers.sgml
+      plugins/function.popup_init.php
+      Smarty.class.php:
+    change directory delimiter to "^" for cache and compile files
+
+2002-06-13  Andrei Zmievski  <andrei@php.net>
+
+    * TODO: done.
+
+    * Smarty_Compiler.class.php:
+    Optimize the calculation of section 'total' property.
+
+2002-06-11  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.class.php:
+    added support for subdir exclusion, deletion by full or partial cache_id and compile_id, change file format to urlencoded values instead of crc32
+
+2002-06-07  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: fix bug with last_modified_check code
+
+    * NEWS
+      Smarty.class.php:
+    updated $GLOBALS refererence for HTTP_IF_MODIFIED_SINCE
+
+2002-06-06  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml
+      overlib.js:
+    remove overlib.js file from distribution, update plugin and docs
+
+2002-06-05  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml
+      NEWS
+      Smarty.class.php: fix 304 Not Modified, don't send content
+
+2002-06-03  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/function.cycle.php: update version number
+
+    * plugins/function.cycle.php
+      NEWS:
+    fixed cycle function to respect delimiter setting after initial setting
+
+    * Smarty.class.php
+      NEWS:
+    update $GLOBALS references to work properly with track_globals settings
+
+    * plugins/function.math.php: fixed bug with call $assign
+
+    * docs/appendixes.sgml
+      docs/designers.sgml
+      plugins/function.html_options.php
+      plugins/function.html_select_time.php
+      NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+    optimized for loops with count() function calls
+
+2002-06-01  Andrei Zmievski  <andrei@php.net>
+
+    * TODO: *** empty log message ***
+
+2002-05-21  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS: update NEWS file
+
+    * plugins/function.html_select_date.php
+      RESOURCES
+      docs/designers.sgml
+      Config_File.class.php:
+    update html_select_date with month_value_format attribute for controlling the format of the month values.
+
+2002-05-17  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty_Compiler.class.php:
+    Made it possible to use simple variables inside [] for indexing.
+
+2002-05-16  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml
+      docs/getting-started.sgml
+      NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      TESTIMONIALS: add "once" attribute to php_include, update docs
+
+2002-05-09  Andrei Zmievski  <andrei@ispi.net>
+
+    * NEWS
+      TODO: *** empty log message ***
+
+2002-05-07  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/function.cycle.php: remove \n from cycle function
+
+    * docs/designers.sgml
+      plugins/function.cycle.php
+      README
+      RELEASE_NOTES
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      NEWS:
+    update cycle function to handle array as input, update files to 2.1.1
+
+2002-05-06  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/function.fetch.php:
+    update fetch function with more error checking
+
+2002-05-03  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml
+      plugins/function.counter.php:
+    update counter to use name instead of id (id still works though)
+
+    * plugins/function.cycle.php
+      docs/designers.sgml: rename id to name for cycle function
+
+    * plugins/function.cycle.php:
+    update cycle function to allow blank values parameter after initialized
+
+    * plugins/function.cycle.php: fix syntax error
+
+2002-05-02  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/function.cycle.php: ugh, another typo
+
+    * plugins/function.cycle.php: update comments
+
+    * docs/designers.sgml
+      plugins/function.cycle.php
+      NEWS: added function cycle
+
+    * FAQ
+      Smarty.class.php: fix register_outputfilter function
+
+2002-05-01  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml
+      NEWS
+      Smarty.class.php: fixed bug with resource testing and include_path
+
+2002-04-30  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      README
+      RELEASE_NOTES
+      Smarty.class.php
+      Smarty_Compiler.class.php: update files for 2.1.0 release
+
+2002-04-30  Andrei Zmievski  <andrei@ispi.net>
+
+    * plugins/function.fetch.php
+      docs/programmers.sgml
+      Smarty.class.php: Fix.
+
+2002-04-29  Andrei Zmievski  <andrei@ispi.net>
+
+    * docs/programmers.sgml
+      docs/designers.sgml: A whole bunch of docs.
+
+2002-04-26  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ
+      QUICKSTART
+      docs/programmers.sgml: update FAQ, QUICKSTART, small doc syntax fix
+
+2002-04-24  Monte Ohrt  <monte@ispi.net>
+
+    * docs/programmers.sgml
+      templates/debug.tpl
+      Smarty.class.php: changed doc structure a bit
+
+2002-04-16  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: Add register/unregister API for output filters.
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      TODO:
+    Changed the way filters are loaded, which now has to be done explicitly,
+    either through load_filter() API or by filling in $autoload_filters variable.
+    Also renamed internal variable to avoid namespace pollution.
+
+2002-04-15  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php:
+    Fixed _get_php_resource() to take include_path into account.
+
+2002-04-15  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml:
+    update docs, get modifiers and functions into index for easy access
+
+    * docs/programmers.sgml
+      NEWS
+      Smarty.class.php: update caching documentation
+
+2002-04-15  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+    * Smarty.class.php: Only turn down error notices if $debugging is false.
+
+2002-04-15  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS: update NEWS file
+
+    * plugins/function.html_select_date.php:
+    fixed logic so this works right when field_separator = "/"
+
+    * plugins/function.html_select_date.php:
+    fix regular expression for matching date
+
+2002-04-13  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml: updated html_select_date docs to reflect changes
+
+    * NEWS
+      plugins/function.html_select_date.php:
+    added YYYY-MM-DD support to html_select_date
+
+2002-04-12  Andrei Zmievski  <andrei@php.net>
+
+    * TESTIMONIALS: New entry.
+
+2002-04-12  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/modifier.strip_tags.php: back out changes to strip_tags
+
+    * docs/programmers.sgml: update docs regarding cache_lifetime
+
+    * plugins/modifier.strip_tags.php
+      Smarty.class.php:
+    update cache_lifetime logic: -1 = never expire, 0 = always expire
+
+2002-04-11  Andrei Zmievski  <andrei@php.net>
+
+    * BUGS
+      FAQ
+      INSTALL
+      NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      docs/getting-started.sgml:
+    Fixed directory separtor issue. Requiring PHP 4.0.6 now.
+
+    * NEWS
+      Smarty_Compiler.class.php:
+    Added ability to use simple variables for array indices or object properties.
+
+    * TESTIMONIALS: Another one.
+
+    * TESTIMONIALS: Adding one from Mark P.
+
+2002-04-05  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php
+      NEWS
+      Smarty.class.php: Make it possible to unregister pre/postfilter plugins.
+
+2002-04-05  Monte Ohrt  <monte@ispi.net>
+
+    * INSTALL: Remove addons file from INSTALL instructions
+
+2002-04-04  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml: update doc error
+
+    * docs/designers.sgml
+      plugins/modifier.escape.php
+      NEWS
+      Smarty.class.php: added htmlall attribute to escape modifier
+
+2002-04-03  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php: Fixed undefined offset warning in {if} tag.
+
+    * Smarty.class.php
+      NEWS: Added template_exists() API.
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php
+      NEWS:
+    - Added $smarty.template variable.
+    - Fixed {include_php} tag when dynamic values were used for 'file' attribute.
+
+    * Config_File.class.php: Separator setting fix.
+
+2002-03-28  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ
+      README: add digest address
+
+    * FAQ
+      README
+      Smarty.class.php: update mailing list addresses
+
+2002-03-28  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+    * plugins/function.html_select_date.php
+      plugins/function.html_select_time.php
+      plugins/modifier.date_format.php:
+    Fix for when plugins directory is not the default one.
+
+2002-03-28  Andrei Zmievski  <andrei@ispi.net>
+
+    * NEWS: *** empty log message ***
+
+    * plugins/function.html_select_date.php
+      plugins/function.html_select_time.php
+      plugins/modifier.date_format.php:
+    Fix for when plugins directory is not the default one.
+
+2002-03-27  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ: update FAQ page
+
+2002-03-26  Andrei Zmievski  <andrei@ispi.net>
+
+    * CREDITS
+      NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      TODO: Block functions changes.
+
+    * Config_File.class.php: *** empty log message ***
+
+2002-03-25  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php: Initial implementation of block functions.
+
+2002-03-22  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml: fix documentation error in capture
+
+2002-03-22  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: *** empty log message ***
+
+    * Smarty.class.php: Turn off notices.
+
+2002-03-21  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php: Make _current_file available to prefilters.
+
+    * NEWS
+      Smarty.class.php:
+    Made is possible to assign variables in pre/postfilters.
+
+2002-03-20  Andrei Zmievski  <andrei@php.net>
+
+    * plugins/function.html_select_date.php: Fixed +/- functionality.
+
+    * NEWS: *** empty log message ***
+
+2002-03-20  Monte Ohrt  <monte@ispi.net>
+
+    * Config_File.class.php
+      NEWS
+      README
+      RELEASE_NOTES
+      Smarty.class.php
+      Smarty_Compiler.class.php: update version numbers
+
+    * plugins/function.html_select_date.php
+      plugins/function.html_select_time.php
+      plugins/modifier.date_format.php:
+    move .make_timestamp.php to shared.make_timestamp.php
+
+    * NEWS
+      Smarty.class.php
+      docs/designers.sgml
+      plugins/function.fetch.php
+      plugins/function.html_select_date.php:
+    update file generation, replace crc32() '-' with 'N'
+
+2002-03-20  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php: *** empty log message ***
+
+2002-03-19  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php:
+    Fix plugin behavior for inserts with script attribute.
+
+    * NEWS: *** empty log message ***
+
+    * Smarty_Compiler.class.php: Fix bug with $smarty.cookies.
+
+    * TESTIMONIALS: *** empty log message ***
+
+2002-03-15  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      docs/designers.sgml: update Changelog
+
+    * plugins/modifier.indent.php
+      plugins/modifier.wordwrap.php: add wordwrap and indent to repository
+
+2002-03-14  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php:
+    remove show_info_include and show_info_header functions
+
+2002-03-13  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/function.fetch.php: update fetch function
+
+    * plugins/function.fetch.php: update fetch function with new parameters
+
+2002-03-12  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml: update doc tables
+
+    * docs/designers.sgml: update docs columns
+
+    * docs/getting-started.sgml
+      docs/appendixes.sgml: update docs
+
+    * TESTIMONIALS
+      docs/appendixes.sgml: update syntax error in docs, add to testimonials
+
+2002-03-04  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ
+      README: update FAQ, README with digest mode info
+
+2002-03-02  Monte Ohrt  <monte@ispi.net>
+
+    * QUICKSTART: update quickstart
+
+    * Smarty.class.php:
+    change behavior so cache_lifetime = 0 never expires (instead of always regenerate)
+
+2002-03-01  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml: update doc example
+
+2002-03-01  Andrei Zmievski  <andrei@php.net>
+
+    * CREDITS
+      RELEASE_NOTES
+      TODO
+      NEWS: *** empty log message ***
+
+2002-03-01  Monte Ohrt  <monte@ispi.net>
+
+    * docs/appendixes.sgml
+      docs/designers.sgml
+      docs/getting-started.sgml
+      docs/programmers.sgml: update document id tags
+
+    * docs.sgml: remove docs.sgml
+
+    * RESOURCES
+      Smarty.class.php: update resources
+
+2002-02-28  Andrei Zmievski  <andrei@php.net>
+
+    * TESTIMONIALS
+      docs/appendixes.sgml
+      docs/designers.sgml
+      docs/programmers.sgml: *** empty log message ***
+
+2002-02-27  Andrei Zmievski  <andrei@php.net>
+
+    * plugins/function.eval.php
+      docs/designers.sgml: *** empty log message ***
+
+2002-02-27  Monte Ohrt  <monte@ispi.net>
+
+    * plugins/function.eval.php: added eval function to plugin dir
+
+2002-02-27  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+2002-02-27  Monte Ohrt  <monte@ispi.net>
+
+    * docs/designers.sgml: fix syntax error
+
+    * docs/appendixes.sgml
+      docs/designers.sgml
+      docs/getting-started.sgml
+      docs/programmers.sgml: convert technical notes to docbook format
+
+    * NEWS
+      docs/designers.sgml: added "eval" plugin docs
+
+2002-02-26  Andrei Zmievski  <andrei@php.net>
+
+    * docs/programmers.sgml
+      docs/designers.sgml
+      docs/appendixes.sgml
+      docs/getting-started.sgml
+      docs/html-common.dsl
+      docs/.cvsignore: *** empty log message ***
+
+    * docs/appendixes.sgml
+      docs/common.dsl
+      docs/designers.sgml
+      docs/getting-started.sgml
+      docs/html-common.dsl
+      docs/html.dsl
+      docs/manual.sgml
+      docs/preface.sgml
+      docs/programmers.sgml: Split up docs.
+
+2002-02-25  Andrei Zmievski  <andrei@php.net>
+
+    * docs.sgml: *** empty log message ***
+
+2002-02-22  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml: update docs
+
+2002-02-22  Andrei Zmievski  <andrei@php.net>
+
+    * docs.sgml
+      AUTHORS
+      NEWS: *** empty log message ***
+
+2002-02-21  Monte Ohrt  <monte@ispi.net>
+
+    * Config_File.class.php
+      NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      docs.sgml: update misc changes
+
+2002-02-21  Andrei Zmievski  <andrei@php.net>
+
+    * docs.sgml: *** empty log message ***
+
+2002-02-20  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml: misc updates
+
+2002-02-20  Andrei Zmievski  <andrei@php.net>
+
+    * docs.sgml: *** empty log message ***
+
+    * Smarty.class.php
+      plugins/function.assign.php
+      plugins/function.assign_debug_info.php
+      plugins/function.counter.php
+      plugins/function.fetch.php
+      plugins/function.math.php
+      plugins/function.popup.php
+      plugins/function.popup_init.php
+      plugins/modifier.escape.php: Fixup some naming.
+
+2002-02-20  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml: update docs
+
+2002-02-20  Andrei Zmievski  <andrei@php.net>
+
+    * docs.sgml: *** empty log message ***
+
+2002-02-20  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      docs.sgml
+      plugins/modifier.escape.php:
+    removed global vars from fetch function, added attrs to escape modifier
+
+    * docs.sgml: add plugin chapter outline
+
+2002-02-19  Monte Ohrt  <monte@ispi.net>
+
+    * README
+      RELEASE_NOTES
+      RESOURCES
+      Smarty.class.php
+      docs.sgml
+      BUGS
+      FAQ
+      INSTALL
+      QUICKSTART: update docs
+
+2002-02-19  Andrei Zmievski  <andrei@php.net>
+
+    * docs.sgml: Updated resources docs.
+
+    * README: *** empty log message ***
+
+    * docs.sgml: Updated description of {$smarty} variable.
+
+    * BUGS
+      FAQ
+      INSTALL
+      QUICKSTART
+      RELEASE_NOTES
+      docs.sgml: Remove PEAR notes.
+
+2002-02-18  Andrei Zmievski  <andrei@php.net>
+
+    * Config_File.class.php
+      NEWS: Removed dependency on PEAR.
+
+2002-02-18  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      docs.sgml
+      plugins/function.popup_init.php: add src attribute to popup_init
+
+2002-02-15  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php
+      plugins/modifier.debug_print_var.php
+      NEWS
+      Smarty.class.php: Performance enhancements.
+
+2002-02-06  Andrei Zmievski  <andrei@php.net>
+
+    * plugins/function.html_options.php:
+    Fix html_options output to be XHTML compatible.
+
+2002-02-05  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php: Fix up plugin inclusion.
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php
+      TODO
+      plugins/function.html_select_date.php
+      plugins/function.html_select_time.php
+      plugins/modifier.date_format.php: Fix plugin directory access.
+
+2002-02-04  Andrei Zmievski  <andrei@php.net>
+
+    * .cvsignore
+      Smarty_Compiler.class.php: *** empty log message ***
+
+2002-01-31  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+    * Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      TODO
+      plugins/function.assign.php
+      plugins/function.assign_debug_info.php
+      plugins/function.counter.php
+      plugins/function.fetch.php
+      plugins/function.html_options.php
+      plugins/function.html_select_date.php
+      plugins/function.html_select_time.php
+      plugins/function.math.php
+      plugins/function.popup.php
+      plugins/function.popup_init.php
+      plugins/modifier.capitalize.php
+      plugins/modifier.count_characters.php
+      plugins/modifier.count_paragraphs.php
+      plugins/modifier.count_sentences.php
+      plugins/modifier.count_words.php
+      plugins/modifier.date_format.php
+      plugins/modifier.debug_print_var.php
+      plugins/modifier.default.php
+      plugins/modifier.escape.php
+      plugins/modifier.lower.php
+      plugins/modifier.regex_replace.php
+      plugins/modifier.replace.php
+      plugins/modifier.spacify.php
+      plugins/modifier.string_format.php
+      plugins/modifier.strip_tags.php
+      plugins/modifier.truncate.php
+      plugins/modifier.upper.php
+      plugins/shared.make_timestamp.php
+      templates/index.tpl
+      AUTHORS
+      CREDITS
+      Config_File.class.php
+      README: Implemented plugin architecture.
+
+    * NEWS: *** empty log message ***
+
+2002-01-30  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.addons.php
+      Smarty.class.php
+      docs.sgml: added modifiers wordwrap and indent
+
+2002-01-28  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php
+      docs.sgml:
+    add support for is-modified-since headers, adjust a doc example
+
+2002-01-24  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: cleanup formatting
+
+    * NEWS
+      Smarty.class.php
+      docs.sgml: update ChangeLog, remove insert_tag_check parameter
+
+2002-01-24  Andrei Zmievski  <andrei@php.net>
+
+    * plugins/standard.plugin.php: *** empty log message ***
+
+2002-01-24  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: fix syntax error
+
+    * Smarty.class.php: removed unneccesary test from fetch()
+
+2002-01-23  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.addons.php: update overlib fixes
+
+    * NEWS: update changelog
+
+    * FAQ
+      NEWS
+      RESOURCES
+      Smarty.addons.php: updated overlib fixes
+
+2001-12-31  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php: Fixed compile_id problem.
+
+2001-12-28  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+    fixed problem with using assigned var with include_php filepath
+
+2001-12-21  Monte Ohrt  <monte@ispi.net>
+
+    * RESOURCES: update RESOURCES
+
+2001-12-20  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ
+      README: update FAQ
+
+2001-12-18  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php
+      docs.sgml
+      Config_File.class.php
+      NEWS
+      README
+      RELEASE_NOTES
+      Smarty.addons.php
+      Smarty.class.php: update version numbers
+
+2001-12-18  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php: Fixed clear_cache().
+
+2001-12-14  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.addons.php:
+    fixed bug in smarty_make_timestamp introduced in PHP 4.1.0
+
+2001-12-13  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.class.php
+      docs.sgml: update default function args, fix cached insert debug timing
+
+2001-12-12  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml: fix syntax error in documentation
+
+    * Smarty.class.php: update default template handling functionality
+
+2001-12-11  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php: update file fetching logic
+
+2001-12-11  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php: Added 'script' attribute to {insert..}.
+
+2001-12-10  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.class.php: added default template function handler
+
+    * Config_File.class.php
+      NEWS
+      README
+      RELEASE_NOTES
+      Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php: update version numbers in files to 1.5.1
+
+2001-12-10  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php: Removed error message from the _read_file() method.
+
+    * Smarty.class.php: Fix check for compile and cache IDs.
+
+2001-12-06  Monte Ohrt  <monte@ispi.net>
+
+    * QUICKSTART: fix spelling error in QUICKSTART
+
+    * docs.sgml: fixed spelling errors in documenation
+
+    * Smarty_Compiler.class.php
+      docs.sgml
+      Config_File.class.php
+      NEWS
+      README
+      RELEASE_NOTES
+      Smarty.addons.php
+      Smarty.class.php: commit 1.5.0 release
+
+    * RESOURCES
+      docs.sgml: added RESOURCES file
+
+2001-12-05  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php: Refactor.
+
+2001-12-05  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty_Compiler.class.php
+      docs.sgml: added assign to include and php_include
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php
+      docs.sgml: *** empty log message ***
+
+2001-12-04  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty_Compiler.class.php: Formatting.
+
+2001-12-04  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php
+      NEWS
+      Smarty.class.php: update ChangeLog
+
+2001-12-04  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php: Formatting.
+
+2001-12-04  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: removed SMARTY_DIR setting in constructor
+
+    * Smarty.class.php: fix Smarty.class.php indention error
+
+    * Smarty.class.php: update trusted logic
+
+2001-12-03  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php:
+    fix up is_secure, is_trusted, make _parse_tpl_path function
+
+    * Smarty.class.php: fix problem with testing SMARTY_DIR as empty
+
+    * NEWS
+      docs.sgml: update documentation, change log
+
+    * Smarty.class.php:
+    update constructor to check for SMARTY_DIR before assigning
+
+2001-12-03  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php: *** empty log message ***
+
+2001-12-03  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ
+      INSTALL
+      RELEASE_NOTES: update a few files
+
+    * NEWS
+      QUICKSTART
+      Smarty.class.php
+      docs.sgml: added trusted_dir functionality, cleaned up secure_dir logic
+
+2001-12-03  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+    * NEWS
+      Smarty.class.php: - Introduced $compile_id class variable.
+    - Fixed a situation where if $cache_id and $compile_id were both null
+      they were passed to auto functions as empty string instead of null.
+
+2001-11-30  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.class.php:
+    change variable names in fetch() fuction to smarty_* to avoid namespace conflicts
+
+    * NEWS
+      Smarty.class.php: fixed bug in _rm_auto with catenated null values
+
+2001-11-29  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty_Compiler.class.php: Added $smarty.section.* syntax.
+
+    * Smarty_Compiler.class.php: Made 'name' attribute optional for {foreach}.
+
+2001-11-29  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php
+      index.php: remove assign "now" in index.tpl
+
+2001-11-29  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.addons.php
+      Smarty.class.php: Fix formatting.
+
+2001-11-28  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.class.php
+      docs.sgml:
+    removed return statements from _read_cache_file (how did they get in there?)
+
+2001-11-27  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml
+      NEWS
+      Smarty.addons.php
+      Smarty.class.php:
+    fixed bugs and added assign attribute to several functions
+
+2001-11-27  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: Some rewording.
+
+    * Smarty_Compiler.class.php: Fix $smarty.capture access.
+
+    * TODO: *** empty log message ***
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+    Made {config_load ..} merge globals from each config file only once per scope.
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php: - Added {foreach ...}.
+    - Made certain $smarty.* references handled at compilation time.
+
+2001-11-26  Monte Ohrt  <monte@ispi.net>
+
+    * Config_File.class.php
+      NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      docs.sgml: commit cache handler functionality
+
+2001-11-20  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.addons.php
+      Smarty_Compiler.class.php: Various fixes and additions.
+
+    * NEWS
+      index.php: *** empty log message ***
+
+2001-11-05  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: changed _read_file parameter from $end to $lines
+
+    * NEWS
+      Smarty.class.php: fixed is_cache, make cache reading more efficient
+
+2001-11-02  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ
+      NEWS: update FAQ with mailing list Reply-To header FAQ
+
+    * NEWS
+      Smarty.class.php
+      index.php: supress fopen errors, return false if cache file won't load
+
+2001-11-01  Monte Ohrt  <monte@ispi.net>
+
+    * QUICKSTART
+      docs.sgml
+      index.php: update QUICKSTART guide with index key example
+
+    * Config_File.class.php
+      NEWS
+      README
+      RELEASE_NOTES
+      Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      docs.sgml: commit all updates for 1.4.6
+
+2001-11-01  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+2001-10-30  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.addons.php: fix assign function problem with empty value passed
+
+    * NEWS
+      Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      templates/debug.tpl:
+    fixed bug in assign function when passing an empty value
+
+2001-10-26  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.addons.php
+      Smarty.class.php
+      index.php: fix minor typo in debug code
+
+2001-10-26  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: Typo.
+
+2001-10-26  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.addons.php:
+    update debug console output, handle html encoding correctly
+
+2001-10-26  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.addons.php
+      templates/debug.tpl: Debug formatting.
+
+    * Smarty.class.php: Disable rmdir warning.
+
+2001-10-26  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.addons.php
+      Smarty.class.php
+      templates/debug.tpl: update debugging to expand array variables
+
+    * Smarty.class.php
+      docs.sgml:
+    update docs for fetching only timestamp with custom template source functions
+
+    * Smarty.addons.php: fix debug console error
+
+2001-10-26  Andrei Zmievski  <andrei@php.net>
+
+    * docs.sgml: Typos.
+
+    * Smarty.addons.php: Cleanup whitespace.
+
+    * Smarty_Compiler.class.php: Clean up whitespace.
+
+    * Smarty.class.php: Cleaning up code, formatting mostly.
+
+    * NEWS: *** empty log message ***
+
+2001-10-25  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      docs.sgml: update documentation to current version
+
+    * NEWS
+      Smarty.addons.php:
+    updated fetch to give proper warning when fetching unreadable or nonexistant files
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+    fixed problem with newline at the end of compiled templates
+
+    * NEWS
+      Smarty.class.php: recompile cache if config file gets modified too.
+
+    * NEWS
+      Smarty.class.php:
+    added feature to regenerate cache if compile_check is enabled and an
+    involved template is modified
+
+2001-10-23  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: fix indent for insert tags in debug console
+
+    * templates/debug.tpl: update debug.tpl file format
+
+    * NEWS
+      Smarty.addons.php
+      Smarty.class.php
+      templates/debug.tpl:
+    update execution time debugging, move into include list
+
+2001-10-10  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+    fixed up execution time output in debug console
+
+2001-10-09  Andrei Zmievski  <andrei@php.net>
+
+    * Config_File.class.php
+      NEWS
+      Smarty.class.php
+      TODO: Added support for hidden config vars.
+
+2001-10-04  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.addons.php
+      Smarty.class.php
+      templates/debug.tpl: added execution times to debug console
+
+2001-10-02  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php: Add space.
+
+2001-10-01  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: Fix reference to compile_id.
+
+2001-09-28  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php: Added postfilter functions.
+
+2001-09-26  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php
+      docs.sgml: Rename to clear_compiled_tpl().
+
+2001-09-25  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty_Compiler.class.php:
+    Fixed line number reporting when removing comments.
+
+2001-09-20  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      RELEASE_NOTES
+      Smarty.addons.php: made html_options output xhtml compatible
+
+2001-09-19  Monte Ohrt  <monte@ispi.net>
+
+    * Config_File.class.php
+      NEWS
+      README
+      RELEASE_NOTES
+      Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      templates/debug.tpl: updated version numbers
+
+2001-09-16  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ
+      NEWS
+      docs.sgml: fix doc error with insert function
+
+2001-09-06  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+2001-08-31  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS: update ChangeLog
+
+    * overlib.js
+      Smarty.addons.php
+      Smarty.class.php
+      docs.sgml:
+    update overlib to 3.50, adjust addon code so that the overlib.js file isn't modified
+
+2001-08-31  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: - compile_id changes
+
+    * NEWS
+      Smarty.addons.php: - compile_id support
+    - new options for html_select_date
+
+2001-08-23  Andrei Zmievski  <andrei@php.net>
+
+    * TODO: *** empty log message ***
+
+2001-08-10  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+    Modified to pass Smarty object as second parameter to insert functions.
+    Also moved _smarty_mod_handler() and _smarty_insert_handler() into the class.
+
+    * NEWS
+      Smarty_Compiler.class.php:
+    Passing Smarty as second parameter to prefilter functions.
+
+2001-08-09  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+2001-08-09  Monte Ohrt  <monte@ispi.net>
+
+    * templates/index.tpl
+      Smarty.class.php: add smarty.now variable to template
+
+2001-08-06  Monte Ohrt  <monte@ispi.net>
+
+    * templates/index.tpl: change config_load section back to setup
+
+2001-08-06  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.addons.php: Optimize a bit.
+
+2001-08-04  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml: update capture documentation
+
+2001-08-03  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ
+      NEWS
+      Smarty.class.php:
+    fix bug with URL controlled debugging, works now (Monte)
+
+2001-08-01  Andrei Zmievski  <andrei@php.net>
+
+    * Config_File.class.php: *** empty log message ***
+
+    * Smarty_Compiler.class.php
+      Smarty.class.php: - Fixed some E_NOTICE stuff in compiler.
+    - Generalized assign_smarty_interface() a bit.
+
+2001-07-24  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty_Compiler.class.php
+      TODO: See ChangeLog for details.
+
+2001-07-20  Andrei Zmievski  <andrei@php.net>
+
+    * Config_File.class.php: Booleanize case-insensitively.
+
+2001-07-17  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS: update ChangeLog
+
+    * Smarty.class.php
+      docs.sgml: put SMARTY_DIR on Config_File require
+
+2001-07-11  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml
+      FAQ
+      NEWS
+      Smarty.class.php:
+    updated security to not include insecure docs, only warning
+
+2001-07-10  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: Adding 'sizeof' as an allowed {if} function.
+
+2001-07-06  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+2001-07-06  Monte Ohrt  <monte@ispi.net>
+
+    * Config_File.class.php
+      NEWS
+      README
+      RELEASE_NOTES
+      Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php: update version number to 1.4.4
+
+    * NEWS
+      Smarty.addons.php
+      Smarty_Compiler.class.php
+      docs.sgml
+      templates/header.tpl
+      templates/index.tpl: update documenatation, template examples
+
+2001-07-03  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php: Implemented access to request vars via $smarty var.
+
+    * NEWS
+      Smarty_Compiler.class.php:
+    Fixed a bug with parsing function arguments in {if} tags.
+
+2001-06-30  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS: update ChangeLog
+
+2001-06-29  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.addons.php
+      Smarty.class.php
+      docs.sgml
+      overlib.js:
+    moved overlib to separate file, added SMARTY_DIR, documented. added much documentation
+
+2001-06-29  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      RELEASE_NOTES
+      TODO: *** empty log message ***
+
+2001-06-29  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      README
+      RELEASE_NOTES
+      Smarty.addons.php
+      Smarty.class.php
+      docs.sgml
+      index.php
+      templates/debug.tpl
+      templates/header.tpl
+      templates/index.tpl: update release notes
+
+2001-06-27  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php: *** empty log message ***
+
+    * NEWS
+      Smarty_Compiler.class.php: Implemented 'step' section attribute.
+
+    * Smarty_Compiler.class.php: Negative values of 'max' will mean no max.
+
+    * AUTHORS
+      NEWS: *** empty log message ***
+
+2001-06-26  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      index.php: Added 'max' and 'start' section attributes.
+    Added 'total' and 'iteration' section properties.
+
+2001-06-25  Andrei Zmievski  <andrei@php.net>
+
+    * Config_File.class.php
+      RELEASE_NOTES
+      Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php: Update version numbers.
+
+2001-06-23  Andrei Zmievski  <andrei@php.net>
+
+    * TODO: *** empty log message ***
+
+2001-06-21  Andrei Zmievski  <andrei@php.net>
+
+    * Config_File.class.php
+      NEWS: Fixed booleanization bug.
+
+2001-06-20  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml:
+    update documents to reflect changes to cached content & debugging
+
+2001-06-20  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.addons.php
+      Smarty.class.php: Remove debug output for cached and fetched cases.
+
+2001-06-20  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: update include_info to false
+
+    * Smarty.class.php
+      docs.sgml
+      index.php
+      templates/footer.tpl:
+    moved debug logic into Smarty completely, created flags for it
+
+2001-06-19  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.addons.php
+      Smarty.class.php
+      templates/debug.tpl: *** empty log message ***
+
+    * NEWS
+      Smarty.class.php: Remove unneeded debug functions.
+
+2001-06-19  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.addons.php
+      Smarty.class.php
+      docs.sgml
+      templates/debug.tpl
+      templates/footer.tpl: commit updates, add debug template
+
+2001-06-19  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php
+      TODO:
+    Moved config loading code inside main class, the compiled template now
+    simply calls that method.
+
+2001-06-15  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      templates/index.tpl: * moved config array into class itself
+    * added 'scope' attribute for config_load
+
+    * Smarty_Compiler.class.php
+      Smarty.addons.php
+      Smarty.class.php: Finishing up secure mode.
+
+2001-06-15  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS: update ChangeLog
+
+    * Smarty_Compiler.class.php: cleaned up logic of if statement security
+
+    * Smarty_Compiler.class.php: update if logic to cover more situations
+
+    * Smarty_Compiler.class.php
+      docs.sgml: update if statement security feature
+
+2001-06-14  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.addons.php
+      Smarty.class.php: *** empty log message ***
+
+    * NEWS
+      Smarty_Compiler.class.php:
+    Fixed a bug with quoted strings inside if statements.
+
+2001-06-13  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.addons.php
+      Smarty.class.php: added secure_dir array for multiple secure directories
+
+    * Smarty.addons.php: update fetch funtion to respect security setting
+
+    * NEWS
+      Smarty.addons.php
+      Smarty.class.php
+      docs.sgml: update documentation, changelog
+
+    * Smarty.addons.php
+      Smarty.class.php: moved _extract setting to assign functions
+
+    * Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+    added assign/unassign custom functions, ability to re-extract tpl_vars
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php
+      docs.sgml
+      index.php: commit security features
+
+2001-06-11  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: Version variable typo.
+
+2001-06-05  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php:
+    Create config object in fetch() or just set the config path if it already
+    exists.
+
+2001-06-04  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: *** empty log message ***
+
+    * NEWS
+      Smarty_Compiler.class.php:
+    Fixed a problem with $<number> inside strip tags.
+
+2001-05-31  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+    * Config_File.class.php: Allow empty config_path.
+
+2001-05-29  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php
+      docs.sgml
+      NEWS
+      README
+      RELEASE_NOTES
+      Smarty.addons.php
+      Smarty.class.php: update version numbers
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      docs.sgml: moved version variable to internal variable
+
+2001-05-22  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php:
+    Moved $_smarty_sections and $_smarty_conf_obj into Smarty class.
+
+2001-05-18  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS: update ChangeLog
+
+    * FAQ
+      QUICKSTART: update FAQ, QUICKSTART for windows include_path setup
+
+    * configs/test.conf: added configs directory to cvs
+
+2001-05-18  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: Use compiler_class for including the file.
+
+2001-05-18  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml: fix typo
+
+2001-05-16  Monte Ohrt  <monte@ispi.net>
+
+    * README
+      RELEASE_NOTES
+      Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php: update files to version 1.4.1
+
+    * NEWS: update ChangeLog
+
+2001-05-15  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+    * index.php: forget that!
+
+    * NEWS
+      Smarty_Compiler.class.php
+      index.php: Fixed a few E_NOTICE warnings.
+
+2001-05-09  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      RELEASE_NOTES
+      Smarty.addons.php
+      Smarty.class.php
+      docs.sgml: update dates versions
+
+2001-05-09  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+    * Smarty.class.php:
+    Use absolute paths when requiring/including Smart components.
+
+    * NEWS: *** empty log message ***
+
+    * Smarty.class.php: Use write mode instead of append.
+
+2001-05-02  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty_Compiler.class.php: Fix indexing by section properties.
+
+2001-05-02  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS: update changelog
+
+    * Smarty.class.php: remove period from syntax error
+
+2001-05-02  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php: Double-quote the attribute values by default.
+
+2001-04-30  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php
+      NEWS: added simple {capture} logic
+
+2001-04-30  Andrei Zmievski  <andrei@php.net>
+
+    * TODO: *** empty log message ***
+
+    * Smarty_Compiler.class.php
+      Smarty.class.php: Fix passing config vars to included files.
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php: Fix inclusion again.
+
+2001-04-30  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ
+      RELEASE_NOTES
+      Smarty.class.php
+      misc/fix_vars.php
+      NEWS: update paths for windows (c:)
+
+2001-04-28  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php: Fix passing variables to included files.
+
+    * templates/index.tpl: *** empty log message ***
+
+2001-04-27  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php: Fix includes.
+
+2001-04-26  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php
+      docs.sgml
+      Smarty.class.php: Formatting mostly.
+
+    * Smarty_Compiler.class.php
+      Config_File.class.php: *** empty log message ***
+
+2001-04-26  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php
+      docs.sgml
+      FAQ
+      NEWS
+      QUICKSTART
+      RELEASE_NOTES
+      Smarty.class.php: update docs with new changes
+
+2001-04-26  Andrei Zmievski  <andrei@php.net>
+
+    * RELEASE_NOTES: *** empty log message ***
+
+    * docs.sgml
+      templates/index.tpl
+      NEWS
+      Smarty_Compiler.class.php: Added ability to reference object properties.
+
+2001-04-25  Andrei Zmievski  <andrei@php.net>
+
+    * README
+      Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      docs.sgml
+      AUTHORS
+      Config_File.class.php
+      CREDITS
+      RELEASE_NOTES
+      NEWS: *** empty log message ***
+
+    * docs.sgml: Docs on new parameter to custom functions.
+
+    * NEWS: *** empty log message ***
+
+    * Smarty_Compiler.class.php:
+    Changing the way tpl vars are referenced and passing smarty object
+    to custom functions.
+
+    * RELEASE_NOTES
+      docs.sgml: Fixing docs a bit.
+
+2001-04-24  Andrei Zmievski  <andrei@php.net>
+
+    * docs.sgml: Docs for $compiler_class and compiler functions.
+
+    * templates/index.tpl: *** empty log message ***
+
+    * Smarty_Compiler.class.php: Remove debugging.
+
+2001-04-24  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml: update compiler function docs
+
+2001-04-24  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      templates/index.tpl: Added compiler function support.
+
+2001-04-24  Monte Ohrt  <monte@ispi.net>
+
+    * RELEASE_NOTES
+      Smarty.class.php:
+    update notes, change show_info_header to false by default
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php
+      docs.sgml
+      CREDITS
+      FAQ
+      NEWS
+      README
+      RELEASE_NOTES: update documenation, bug fixes
+
+2001-04-24  Andrei Zmievski  <andrei@php.net>
+
+    * misc/fix_vars.php: Hopefully fix for sure.
+
+2001-04-23  Monte Ohrt  <monte@ispi.net>
+
+    * misc/fix_vars.php: uncomment copy/unlink
+
+2001-04-23  Andrei Zmievski  <andrei@php.net>
+
+    * misc/fix_vars.php: Do it more thoroughly.
+
+    * misc/fix_vars.php: check for }
+
+2001-04-22  Andrei Zmievski  <andrei@php.net>
+
+    * misc/fix_vars.php: Fix variable parsing.
+
+2001-04-20  Monte Ohrt  <monte@ispi.net>
+
+    * misc/fix_vars.php: fix problem with 4.0.5-dev and preg_replace_callback
+
+2001-04-19  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php
+      docs.sgml
+      misc/fix_vars.php
+      NEWS
+      RELEASE_NOTES
+      Smarty.class.php: update notes/documentation
+
+    * NEWS
+      README
+      RELEASE_NOTES
+      Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      docs.sgml: update files for 1.4.0 release
+
+2001-04-16  Andrei Zmievski  <andrei@php.net>
+
+    * misc/fix_vars.php: Added fix_vars.php script.
+
+2001-04-16  Monte Ohrt  <monte@ispi.net>
+
+    * QUICKSTART
+      RELEASE_NOTES
+      docs.sgml
+      templates/index.tpl:
+    update RELEASE_NOTES & scripts with new section var syntax
+
+2001-04-13  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php: * Implement new variable format parser.
+    * Optimizing config load a bit.
+
+2001-04-13  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ
+      NEWS
+      RELEASE_NOTES
+      Smarty.class.php:
+    added $check_cached_insert_tags to speed up cached pages if
+          {insert ...} is not used (Monte)
+
+2001-04-12  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php
+      RELEASE_NOTES: *** empty log message ***
+
+    * Smarty_Compiler.class.php: Remove redundant functions.
+
+    * Smarty.class.php: Formatting.
+
+2001-04-12  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: update file: parsing
+
+    * Smarty.class.php
+      docs.sgml: update documentation
+
+2001-04-12  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php
+      TODO: *** empty log message ***
+
+2001-04-11  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ
+      QUICKSTART
+      RELEASE_NOTES: added RELEASE_NOTES file to cvs
+
+    * NEWS
+      docs.sgml: update ChangeLog, update documentation
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php
+      templates/index.tpl:
+    update Smarty to compile at run-time. added ability to get files from
+    absolute paths, added work around for LOCK_EX and windows, changed a few
+    file permissions to be more secure.
+
+2001-03-29  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.addons.php:
+    allow arbitrary date strings instead of just timestamps
+
+2001-03-28  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php
+      docs.sgml
+      FAQ
+      NEWS
+      README
+      Smarty.addons.php:
+    update version in class, update docs for count_ and new vars
+
+    * templates/index.tpl
+      docs.sgml: update docs, example template
+
+2001-03-28  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php: Some variable renaming.
+
+2001-03-23  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php
+      NEWS: Fixed nested include infinite repeat bug.
+
+2001-03-23  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: fix version number
+
+    * Smarty.class.php
+      NEWS: added optional HTML header to output
+
+2001-03-22  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php: Fixed inclusion of dynamic files.
+
+2001-03-16  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty_Compiler.class.php: Fixing the config_load scoping.
+
+    * Smarty_Compiler.class.php: making config variables global for now.
+
+2001-03-15  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+    * Smarty_Compiler.class.php:
+    * Includes are now always done via generated function call to protect
+      namespace.
+    * config_load now always uses global config object to improve
+      performance.
+
+2001-03-13  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml: update math documentation with format attribute
+
+2001-03-11  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml
+      NEWS
+      Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php: update math function with format attribute
+
+2001-03-10  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.addons.php: *** empty log message ***
+
+    * NEWS
+      Smarty.addons.php
+      Smarty.class.php: Added html_select_time custom function.
+
+2001-03-08  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php
+      NEWS
+      README
+      Smarty.addons.php: rename 1.3.1b to 1.3.1pl1
+
+    * NEWS
+      Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php: update version numbers, changelog
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php:
+    moved _syntax_error to Smarty_Compiler.class.php
+
+    * Smarty.class.php
+      docs.sgml:
+    missing _syntax_error function recovered. fixed minor syntax in docs
+
+2001-03-07  Monte Ohrt  <monte@ispi.net>
+
+    * QUICKSTART
+      README
+      Smarty.addons.php
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      BUGS
+      INSTALL
+      NEWS: update everything to 1.3.1
+
+2001-03-03  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty_Compiler.class.php
+      Smarty.class.php: fixed bug with cached insert tags
+
+2001-03-02  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php
+      Smarty_Compiler.class.php:
+    fix cache fuctions with separated compiled class
+
+    * FAQ
+      NEWS
+      docs.sgml: update changelog
+
+2001-03-02  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty_Compiler.class.php: Added 'first' and 'last' section properties.
+
+2001-03-02  Monte Ohrt  <monte@ispi.net>
+
+    * TODO: remove compiling separation TODO
+
+    * Smarty_Compiler.class.php
+      Smarty.addons.php
+      Smarty.class.php: update function headers
+
+    * templates/index.tpl
+      NEWS
+      Smarty.class.php
+      Smarty_Compiler.class.php
+      index.php: split out compiling code for faster execution
+
+    * Smarty.class.php: fixed a few warning messages
+
+    * Smarty.addons.php
+      Smarty.class.php
+      docs.sgml
+      NEWS: added fetch, unregister mod/fun, updated docs
+
+2001-03-01  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.addons.php: added "int" to available list
+
+    * docs.sgml
+      FAQ
+      Smarty.class.php: update FAQ, add math functions & update documetation
+
+    * index.php
+      Smarty.addons.php
+      Smarty.class.php
+      docs.sgml: fixed literal tags and other optional delimiters
+
+2001-02-26  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php:
+    Added index_prev, index_next section properties and ability to
+    index by them.
+
+    * NEWS
+      Smarty.addons.php
+      Smarty.class.php: Reverting the plugins patch - needs more thought.
+
+    * Smarty.class.php: Fixing plugin loading.
+
+2001-02-23  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.addons.php
+      Smarty.class.php
+      plugins/standard.plugin.php
+      NEWS: Added plugin functionality.
+
+2001-02-22  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml
+      templates/index.tpl
+      NEWS
+      README
+      Smarty.class.php: fixed issue with php tags executed in literal blocks
+
+2001-02-21  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS: update changelog for LGPL change
+
+    * Smarty.class.php
+      docs.sgml
+      README
+      Smarty.addons.php: updated version numbers to 1.3.0
+
+    * NEWS
+      templates/index.tpl: update changelog, rearrange index.tpl file
+
+2001-02-21  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php: *** empty log message ***
+
+2001-02-21  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml: update parameters for is_cached and fetch
+
+2001-02-21  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php: *** empty log message ***
+
+2001-02-21  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS
+      Smarty.addons.php
+      docs.sgml: update docs, remove header function from addons
+
+2001-02-20  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ
+      NEWS: update changelog
+
+    * TODO: update todo
+
+    * TODO: update todo list
+
+    * Smarty.class.php: update php tag handling logic
+
+2001-02-19  Monte Ohrt  <monte@ispi.net>
+
+    * index.php
+      Config_File.class.php
+      FAQ
+      Smarty.class.php
+      docs.sgml: fixed <?php tag at beginning of files, updated docs
+
+2001-02-19  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.addons.php: *** empty log message ***
+
+2001-02-13  Andrei Zmievski  <andrei@php.net>
+
+    * TODO: *** empty log message ***
+
+2001-02-12  Andrei Zmievski  <andrei@php.net>
+
+    * templates/index.tpl
+      Smarty.class.php: *** empty log message ***
+
+2001-02-10  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: remove  unneeded preg_match
+
+    * Smarty.class.php: remove comment
+
+    * Smarty.class.php: updated php escape to handle <script language="php">
+
+    * NEWS
+      Smarty.class.php: fix php tag escapement logic
+
+    * NEWS: commit changelog
+
+    * docs.sgml: update header docs
+
+    * docs.sgml
+      Smarty.addons.php
+      Smarty.class.php: added header custom function
+
+2001-02-09  Monte Ohrt  <monte@ispi.net>
+
+    * index.php
+      templates/header.tpl
+      templates/index.tpl
+      INSTALL
+      QUICKSTART
+      docs.sgml: update documentation, add examples to test script.
+
+2001-02-08  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: *** empty log message ***
+
+2001-02-08  Monte Ohrt  <monte@ispi.net>
+
+    * COPYING.lib: added COPYING.lib
+
+    * COPYING
+      Config_File.class.php
+      Smarty.addons.php
+      Smarty.class.php
+      docs.sgml: changed license to LGPL for commercial use
+
+    * docs.sgml
+      Smarty.class.php: fix clear_assign syntax error
+
+2001-02-07  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: added ability to pass array to clear_assign
+
+    * index.php
+      templates/index.tpl
+      docs.sgml:
+    update documentation, remove tests from index file and template
+
+2001-02-07  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php: Adding file locking.
+
+    * templates/index.tpl
+      Smarty.addons.php
+      Smarty.class.php
+      index.php: More cache work.
+
+2001-02-06  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml
+      Smarty.class.php:
+    change register_ function names, update documents with tables
+
+2001-02-06  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php
+      templates/index.tpl: Reworking and optimizing the cache system.
+
+    * Smarty.class.php: Restoring ?> in patterns.
+
+2001-02-05  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php
+      docs.sgml: update cache directory creation logic
+
+2001-02-05  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: Removing once-only subpattern for now..
+
+    * Smarty.class.php: Fix modifier arg parsing.
+
+2001-02-02  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      Smarty.class.php
+      templates/index.tpl: See changelog.
+
+2001-02-01  Andrei Zmievski  <andrei@php.net>
+
+    * README: *** empty log message ***
+
+    * Smarty.class.php: Use 'echo' instead of 'print'.
+
+    * Smarty.addons.php: *** empty log message ***
+
+2001-02-01  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: rearranged variables at top of script
+
+2001-02-01  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: Retabbing.
+
+    * templates/index.tpl
+      Smarty.class.php
+      index.php: *** empty log message ***
+
+2001-02-01  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: update caching logic
+
+    * Smarty.class.php: fixed clear_all_cache bugs
+
+    * Smarty.class.php: fix .cache check
+
+    * docs.sgml
+      FAQ
+      Smarty.class.php: update .che to .cache
+
+    * FAQ
+      Smarty.class.php
+      docs.sgml: updated docs for caching, added clear_all_cache() directive
+
+2001-01-31  Monte Ohrt  <monte@ispi.net>
+
+    * index.php
+      templates/index.tpl
+      docs.sgml: upated docs for date_format and html_options
+
+2001-01-31  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+    * Smarty.addons.php
+      index.php: Added ability to pass 'options' attribute to html_options.
+
+    * Smarty.addons.php
+      Smarty.class.php
+      docs.sgml
+      index.php
+      templates/index.tpl
+      Config_File.class.php
+      NEWS
+      README: Reworking, simplifying, and speeding up cache implementation.
+    Fixing the infelicity where you couldn't have '|' and ':' inside
+    quoted modifier arguments.
+
+2001-01-31  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php
+      index.php
+      templates/index.tpl: removed DEBUG lines
+
+2001-01-30  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: changed default expire to 3600
+
+    * Config_File.class.php
+      NEWS
+      README
+      Smarty.addons.php
+      Smarty.class.php: updated version numbers
+
+    * docs.sgml
+      NEWS
+      Smarty.class.php:
+    added caching, force compile, force cache, misc performance updates
+
+2001-01-30  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS: *** empty log message ***
+
+    * Smarty.class.php
+      templates/index.tpl: Remove debug message.
+
+    * Smarty.class.php
+      templates/index.tpl: Fixing the compile directory mayhem...
+
+    * Smarty.class.php:
+    Fix problem with {strip} around {section} and {include}
+
+    * Smarty.addons.php: *** empty log message ***
+
+2001-01-29  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ
+      NEWS
+      README
+      Smarty.class.php: fixed PHP_VERSION check, misc doc updates
+
+    * index.php
+      Config_File.class.php
+      NEWS
+      QUICKSTART
+      README
+      Smarty.addons.php
+      Smarty.class.php
+      docs.sgml: updated for 1.2.1 compile_dir changes, misc doc updates
+
+2001-01-26  Monte Ohrt  <monte@ispi.net>
+
+    * BUGS
+      README: update BUGS and README files
+
+    * FAQ: updated FAQ
+
+    * Config_File.class.php
+      FAQ
+      NEWS
+      README
+      Smarty.addons.php
+      docs.sgml
+      templates/index.tpl
+      AUTHORS: update again
+
+2001-01-26  Andrei Zmievski  <andrei@php.net>
+
+    * docs.sgml
+      NEWS
+      README
+      Smarty.class.php
+      templates/index.tpl: *** empty log message ***
+
+    * Smarty.class.php
+      index.php
+      templates/index.tpl: Added ability to index by key.
+
+2001-01-25  Monte Ohrt  <monte@ispi.net>
+
+    * NEWS: update changelog
+
+    * README
+      Smarty.addons.php
+      Smarty.class.php
+      docs.sgml
+      AUTHORS: updated versions to 1.1.0
+
+    * docs.sgml
+      templates/index.tpl
+      Config_File.class.php
+      Smarty.addons.php
+      Smarty.class.php: update copyright notice
+
+    * Config_File.class.php
+      Smarty.addons.php
+      Smarty.class.php
+      docs.sgml: added misc info
+
+2001-01-24  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.addons.php
+      index.php
+      templates/index.tpl
+      Config_File.class.php: initial commit
+
+2001-01-23  Monte Ohrt  <monte@ispi.net>
+
+    * docs.sgml: fix typo
+
+2001-01-22  Monte Ohrt  <monte@ispi.net>
+
+    * doc.sgm
+      docs.sgml: updated docs, renamed file
+
+    * FAQ: updated FAQ
+
+    * NEWS
+      README: updated Changelog and Readme
+
+    * doc.sgm: updated doc.sgm error
+
+    * AUTHORS
+      COPYING
+      INSTALL
+      NEWS
+      QUICKSTART: misc doc changes, added AUTHORS, COPYING
+
+2001-01-22  Andrei Zmievski  <andrei@php.net>
+
+    * NEWS
+      templates/index.tpl: *** empty log message ***
+
+    * Smarty.class.php
+      templates/index.tpl:
+    Fixed bug that wouldn't let you do specify non-array values for 'loop'
+    attribute.
+
+2001-01-22  Monte Ohrt  <monte@ispi.net>
+
+    * QUICKSTART: updated QUICKSTART
+
+    * BUGS
+      FAQ
+      INSTALL
+      README
+      doc.sgm: added BUGS and INSTALL, updated docs, FAQ, README
+
+2001-01-21  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ
+      doc.sgm: updates to FAQ and docs
+
+2001-01-19  Monte Ohrt  <monte@ispi.net>
+
+    * FAQ: initial commit of FAQ
+
+    * QUICKSTART
+      README
+      doc.sgm
+      index.php:
+    updated README, doc.sgm with preg_replace() parameter issue. also removed "./" from index.php file
+
+    * NEWS: initial commit of changelog
+
+    * doc.sgm
+      QUICKSTART: update quickstart text
+
+2001-01-19  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: Fix the compiled template check.
+
+2001-01-18  Andrei Zmievski  <andrei@php.net>
+
+    * doc.sgm: *** empty log message ***
+
+2001-01-18  Monte Ohrt  <monte@ispi.net>
+
+    * index.php
+      templates/index.tpl
+      QUICKSTART
+      Smarty.addons.php
+      Smarty.class.php
+      doc.sgm: update changes
+
+2001-01-18  Andrei Zmievski  <andrei@php.net>
+
+    * QUICKSTART
+      Smarty.addons.php: *** empty log message ***
+
+2001-01-18  Monte Ohrt  <monte@ispi.net>
+
+    * QUICKSTART
+      doc.sgm: add QUICKSTART, update docs for default modifier
+
+    * Smarty.addons.php
+      Smarty.class.php: added default modifier
+
+    * README
+      Smarty.addons.php
+      Smarty.class.php
+      doc.sgm
+      templates/index.tpl: added dislaimers
+
+2001-01-18  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: *** empty log message ***
+
+2001-01-16  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php
+      templates/index.tpl: Implement 'div by'.
+
+2001-01-12  Monte Ohrt  <monte@ispi.net>
+
+    * doc.sgm: update docs
+
+    * doc.sgm: doc changes
+
+    * doc.sgm: update docs
+
+2001-01-12  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php
+      doc.sgm: *** empty log message ***
+
+    * Smarty.class.php: Fix template traversal.
+
+2001-01-11  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: *** empty log message ***
+
+2001-01-09  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.addons.php
+      Smarty.class.php: *** empty log message ***
+
+2001-01-09  Monte Ohrt  <monte@ispi.net>
+
+    * doc.sgm: update manual
+
+2001-01-05  Monte Ohrt  <monte@ispi.net>
+
+    * doc.sgm
+      Smarty.addons.php: commit changes
+
+2001-01-04  Monte Ohrt  <monte@ispi.net>
+
+    * doc.sgm
+      templates/index.tpl
+      Smarty.class.php: update changes
+
+    * index.php
+      Smarty.addons.php
+      doc.sgm: add documentation
+
+2001-01-02  Monte Ohrt  <monte@ispi.net>
+
+    * index.php
+      templates/index.tpl
+      Smarty.addons.php
+      Smarty.class.php: prepend insert_ to insert tag functions
+
+    * Smarty.class.php
+      index.php
+      templates/index.tpl: remove caching logic
+
+    * README
+      Smarty.class.php
+      index.php
+      templates/index.tpl: update changes
+
+2000-12-27  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php
+      templates/header.tpl
+      templates/index.tpl
+      Smarty.addons.php: *** empty log message ***
+
+2000-12-21  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php: Fix access to template variables.
+
+    * Smarty.class.php
+      templates/header.tpl:
+    Added support for passing variables to included files.
+
+2000-12-20  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php:
+    Added support for inserting results of function processing a template.
+
+2000-12-18  Monte Ohrt  <monte@ispi.net>
+
+    * Smarty.class.php: added string_format function
+
+    * Smarty.addons.php: update format to string_format
+
+    * README
+      Smarty.addons.php
+      Smarty.class.php: added format addon function
+
+2000-12-13  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.addons.php
+      Smarty.class.php: Fix sectionelse.
+
+2000-12-07  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.addons.php
+      Smarty.class.php
+      templates/index.tpl: *** empty log message ***
+
+2000-12-04  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php
+      templates/index.tpl
+      Smarty.addons.php: *** empty log message ***
+
+2000-11-27  Andrei Zmievski  <andrei@php.net>
+
+    * templates/index.tpl
+      Smarty.class.php: *** empty log message ***
+
+2000-11-22  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php
+      templates/index.tpl: *** empty log message ***
+
+2000-11-21  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php
+      templates/index.tpl
+      Smarty.addons.php: *** empty log message ***
+
+2000-11-20  Andrei Zmievski  <andrei@php.net>
+
+    * templates/index.tpl
+      Smarty.class.php
+      Smarty.addons.php
+      index.php: *** empty log message ***
+
+    * Smarty.class.php
+      index.php
+      templates/index.tpl: Made sections work mostly.
+
+2000-11-19  Andrei Zmievski  <andrei@php.net>
+
+    * index.php
+      templates/index.tpl: *** empty log message ***
+
+2000-11-17  Andrei Zmievski  <andrei@php.net>
+
+    * Smarty.class.php
+      Smarty.addons.php: *** empty log message ***
+
+2000-11-15  Monte Ohrt  <monte@ispi.net>
+
+    * index.php
+      templates/footer.tpl
+      templates/header.tpl
+      templates/index.tpl: added template files to cvs dir
+
+    * README
+      Smarty.class.php: commit changes
+
+2000-08-08  Monte Ohrt  <monte@ispi.net>
+
+    * README
+      Smarty.class.php: update include path bug
+
+    * README: add README file
+
+    * Smarty.class.php: New file.
+
+    * Smarty.class.php: initial import
+
diff --git a/GPL_LIB/Smarty/FAQ b/GPL_LIB/Smarty/FAQ
new file mode 100644
index 0000000000000000000000000000000000000000..1860678e7006a2af126e9a6110bce7d67c0fde8c
--- /dev/null
+++ b/GPL_LIB/Smarty/FAQ
@@ -0,0 +1,284 @@
+QUESTION INDEX
+--------------
+
+GENERAL
+
+Q: What is Smarty?
+Q: What's the difference between Smarty and other template engines?
+Q: What do you mean "Compiled PHP Scripts" ?
+Q: Why can't I just use PHPA (http://php-accelerator.co.uk) or Zend Cache?
+Q: Why does smarty have a built in cache? Wouldn't it be better to handle this
+   in a separate class?
+Q: Is Smarty faster than <insert other PHP template engine>?
+Q: How can I be sure to get the best performance from Smarty?
+Q: Do you have a mailing list?
+Q: Can you change the mailing list so reply-to sends to the list and not the
+   user?
+
+TROUBLESHOOTING
+
+Q: Smarty doesn't work.
+Q: I get the following error when running Smarty:
+   Warning:  Smarty error: problem creating directory "templates_c/239/239105369"
+   in /path/to/Smarty.class.php on line 542
+Q: I get the following error when running Smarty:
+   Warning: Wrong parameter count for preg_replace() in
+   Smarty.class.php on line 371
+Q: I get this error when passing variables to {include}:
+   Fatal error: Call to undefined function: get_defined_vars() in
+   /path/to/Smarty/templates_c/index.tpl.php on line 8
+Q: I get PHP errors in my {if} tag logic.
+Q: I'm changing my php code and/or templates, and my results are not getting
+   updated.
+Q: I'm running Windows 2000 and I get blank content. My compiled PHP files are
+   also zero length.
+Q: The template goes into an infinite loop when I include included templates
+   that pass local variables
+Q: Javascript is causing Smarty errors in my templates.
+Q: I get "SAFE MODE Restriction in effect. ..."-errors when running smarty.
+
+MISC
+
+Q: Can I use Macromedia's Dreamweaver to edit my templates?
+Q: Dreamweaver is urlencoding the template delimiters when they are in a SRC or
+   HREF link. How do I get around this?
+
+HOWTO
+
+Q: How do I generate different cache files per template based on arguments
+   passed to the page?
+Q: How do I pass a template variable as a parameter? {function param={$varname}}
+   does not work.
+Q: How do I include cached template(s) within a non-cached template?
+
+
+GENERAL
+-------
+
+Q: What is Smarty?
+A: Smarty is a template engine for PHP... but be aware this isn't just another
+   PHP template engine. It's much more than that.
+
+Q: What's the difference between Smarty and other template engines?
+A: Most other template engines for PHP provide basic variable substitution and
+   dynamic block functionality. Smarty takes a step further to be a "smart"
+   template engine, adding features such as configuration files, template
+   functions, variable modifiers (see the docs!) and making all of this
+   functionality as easy as possible to use for both programmers and template
+   designers. Smarty also compiles the templates into PHP scripts, eliminating
+   the need to parse the templates on every invocation, making Smarty extremely
+   scalable and manageable for large application needs.
+
+Q: What do you mean "Compiled PHP Scripts" ?
+A: Smarty reads the template files and creates PHP scripts from them. Once
+   these PHP scripts are created, Smarty executes these, never having to parse
+   the template files again. If you change a template file, Smarty will
+   recreate the PHP script for it. All this is done automatically by Smarty.
+   Template designers never need to mess with the generated PHP scripts or even
+   know of their existance. (NOTE: you can turn off this compile checking step
+   in Smarty for increased performance.)
+
+Q: Why can't I just use PHPA (http://php-accelerator.co.uk) or Zend Cache?
+A: You certainly can, and we highly recommend it! What PHPA does is caches
+   compiled bytecode of your PHP scripts in shared memory or in a file. This
+   speeds up server response and saves the compilation step. Smarty creates PHP
+   scripts, which PHPA will cache nicely. Now, Smarty's built-in cache is
+   something completely different. It caches the _output_ of the template
+   contents. For example, if you have a template that requires several database
+   queries, Smarty can cache this output, saving the need to call the database
+   every time. Smarty and PHPA (or Zend Cache) complement each other nicely. If
+   performance is of the utmost importance, we would recommend using one of
+   these with any PHP application, using Smarty or not. As you can see in the
+   benchmarks, Smartys performance _really_ excels in combination with a PHP
+   accelerator.
+
+Q: Why does Smarty have a built in cache? Wouldn't it be better to handle this
+   in a separate class?
+A: Smarty's caching functionality is tightly integrated with the template
+   engine, making it quite a bit more flexible than a simple caching wrapper.
+   For instance, you can cache select portions of a template page. Let's say
+   you have a polling box on your site. With Smarty, you can leave the poll
+   dynamic and cache the rest of the page. You can also pass templates
+   multiple cache ids, meaning that a template can have several caches
+   depending on URL, cookies, etc.
+
+Q: Is Smarty faster than <insert other PHP template engine>?
+A: See the benchmark page for some performance comparisons. Smarty's approach
+   to templates is a bit different from some languages: it compiles templates
+   into PHP scripts instead of parsing them on each invocation. This usually
+   results in great performance gains, especially with complex templates.
+   Coupled with the built-in caching of Smarty templates, the performance is
+   outstanding.
+
+Q: How can I be sure to get the best performance from Smarty?
+A: Be sure you set $compile_check=false once your templates are initially
+   compiled. This will skip the unneeded step of testing if the template has
+   changed since it was last compiled. If you have complex pages that don't
+   change too often, turn on the caching engine and adjust your application so
+   it doesn't do unnecessary work (like db calls) if a cached page is
+   available. See the documentation for examples.
+   
+Q: Do you have a mailing list?
+A:  We have a few mailing lists. "general" for you to share your ideas or ask
+	questions, "dev" for those interested in the development efforts of Smarty,
+	and "cvs" for those that would like to track the updates made in the cvs
+	repository.
+
+    send a blank e-mail message to:
+      smarty-general-subscribe@lists.php.net (subscribe to the general list)
+      smarty-general-unsubscribe@lists.php.net (unsubscribe from the general list)
+      smarty-general-digest-subscribe@lists.php.net (subscribe to digest)
+      smarty-general-digest-unsubscribe@lists.php.net (unsubscribe from digest)
+      smarty-dev-subscribe@lists.php.net (subscribe to the dev list)
+      smarty-dev-unsubscribe@lists.php.net (unsubscribe from the dev list)
+      smarty-cvs-subscribe@lists.php.net (subscribe to the cvs list)
+      smarty-cvs-unsubscribe@lists.php.net (unsubscribe from the cvs list)
+    You can also browse the mailing list archives at
+    http://marc.theaimsgroup.com/?l=smarty&r=1&w=2
+
+
+
+Q: Can you change the mailing list so Reply-To sends to the list and not the
+   user?
+A: Yes we could, but no we won't. Use "Reply-All" in your e-mail client to send
+   to the list. http://www.unicom.com/pw/reply-to-harmful.html
+
+TROUBLESHOOTING
+---------------
+
+Q: Smarty doesn't work.
+A: You must be using PHP 4.0.6 or later if you use any version of Smarty
+   past 2.0.1. Read the BUGS file for more info.
+
+Q: I get the following error when running Smarty:
+   Warning:  Smarty error: problem creating directory "templates_c/239/239105369"
+   in /path/to/Smarty.class.php on line 542
+A: Your web server user does not have permission to write to the templates_c
+   directory, or is unable to create the templates_c directory. Be sure the
+   templates_c directory exists in the location defined in Smarty.class.php,
+   and the web server user can write to it. If you do not know the web server
+   user, chmod 777 the templates_c directory, reload the page, then check the
+   file ownership of the files created in templates_c. Or, you can check the
+   httpd.conf (usually in /usr/local/apache/conf) file for this setting:
+   User nobody
+   Group nobody
+
+Q: I get the following error when running Smarty: Warning: Wrong parameter
+   count for preg_replace() in Smarty.class.php on line 371
+A: preg_replace had a parameter added in PHP 4.0.2 that Smarty
+   requires. Upgrade to at least 4.0.6 to fix all known PHP issues with
+   Smarty.
+
+Q: I get this error when passing variables to {include}:
+   Fatal error: Call to undefined function: get_defined_vars() in
+   /path/to/Smarty/templates_c/index.tpl.php on line 8
+A: get_defined_vars() was added to PHP 4.0.4. If you plan on passing
+   variables to included templates, you will need PHP 4.0.6 or later.
+
+Q: I get PHP errors in my {if} tag logic.
+A: All conditional qualifiers must be separated by spaces. This syntax will not
+   work: {if $name=="Wilma"} You must instead do this: {if $name == "Wilma"}.
+   The reason for this is syntax ambiguity. Both "==" and "eq" are equivalent
+   in the template parser, so something like {if $nameeq"Wilma"} wouldn't be
+   parsable by the tokenizer.
+
+Q: I'm changing my php code and/or templates, and my results are not getting
+   updated.
+A: This may be the result of your compile or cache settings. If you are
+   changing your php code, your templates will not necessarily get recompiled
+   to reflect the changes. Use $force_compile during develpment to avoid these
+   situations. Also turn off caching during development when you aren't
+   specifically testing it. You can also remove everything from your
+   compile_dir and cache_dir and reload the page to be sure everything gets
+   regenerated.
+
+Q: I'm running Windows 2000 and I get blank content. My compiled PHP files are
+   also zero length.
+A: There seems to be a problem with some W2k machines and exclusive file
+   locking. Comment out the flock() call in _write_file to get around this,
+   although be aware this could possibly cause a problem with simultaneous
+   writes to a file, especially with caching turned on. NOTE: As of Smarty
+   1.4.0, a workaround was put in place that should solve this.
+
+Q: The template goes into an infinite loop when I include included templates
+   that pass local variables
+A: This was fixed in 1.3.2 (new global attribute)
+
+Q: Javascript is causing Smarty errors in my templates.
+A: Surround your javascript with {literal}{/literal} tags. See the docs.
+
+Q: I get "SAFE MODE Restriction in effect. ..."-errors when running smarty.
+A: Use $smarty->use_sub_dirs = false when running php in safe mode.
+
+MISC
+----
+
+Q: Can I use Macromedia's Dreamweaver to edit my templates?
+A: Certainly. You might want to change your tag delimiters from {} to something
+   that resembles valid HTML, like <!--{ }--> or <{ }> or something similar.
+   This way the editor won't view the template tags as errors.
+
+Q: Dreamweaver is urlencoding the template delimiters when they are in a SRC or
+   HREF link. How do I get around this?
+A: In Edit - Properties - Rewrite HTML you can specify if Dreamweaver should
+   change special letters to %-equivalent or not. The default is on which
+   produces this error.
+
+HOWTO
+-----
+   
+Q: How do I generate different cache files per template based on arguments
+   passed to the page?
+A: Use your $REQUEST_URI as the cache_id when fetching the page:
+
+   global $REQUEST_URI; // if not already present
+   $smarty->display('index.tpl',$REQUEST_URI);
+
+   This will create a separate cache file for each unique URL when you call
+   index.tpl. See the documentation for display() and fetch()
+
+Q: How do I pass a template variable as a parameter? {function param={$varname}}
+   does not work.
+A: {function param=$varname} (You cannot nest template delimiters.)
+
+Q: How do I include cached template(s) within a non-cached template?
+A: One way to do it:
+
+   $smarty->caching = true;
+   $tpl1 = $smarty->fetch("internal1.tpl");
+   $tpl2 = $smarty->fetch("internal2.tpl");
+   $tpl3 = $smarty->fetch("internal3.tpl");
+
+   $smarty->assign("tpl1_contents",$tpl1);
+   $smarty->assign("tpl2_contents",$tpl2);
+   $smarty->assign("tpl3_contents",$tpl3);
+
+   $smarty->caching = false;
+   $smarty->display('index.tpl');
+
+   index.tpl
+   ---------
+
+   <table>
+           <tr>
+                   <td>{$tpl1_contents}</td>
+                   <td>{$tpl2_contents}</td>
+                   <td>{$tpl3_contents}</td>
+           </tr>
+   </table>
+
+
+
+
+   Another approach:
+
+   You could write a custom insert function to fetch your internal
+   templates:
+
+   <table>
+           <tr>
+                   <td>{insert name=fetch_tpl tpl="internal1.tpl"}</td>
+                   <td>{insert name=fetch_tpl tpl="internal2.tpl"}</td>
+                   <td>{insert name=fetch_tpl tpl="internal3.tpl"}</td>
+           </tr>
+   </table>
diff --git a/GPL_LIB/Smarty/INSTALL b/GPL_LIB/Smarty/INSTALL
new file mode 100644
index 0000000000000000000000000000000000000000..f622ee8ffe6eff269bdd81a3582e4d3a60d08a74
--- /dev/null
+++ b/GPL_LIB/Smarty/INSTALL
@@ -0,0 +1,29 @@
+REQUIREMENTS:
+
+Smarty requires PHP 4.0.6 or later.
+See the on-line documentation for complete install instructions.
+
+INSTALLATION (quick):
+
+* copy the files under the libs/ directory to a directory that is in your PHP
+  include_path, or set the SMARTY_DIR constant and put them in this directory.
+  (if you upgrade from versions before 2.5.0 be aware that up to Smarty 2.4.2
+  all necessary files where in the distribution's root directory, but are now
+  in libs/.)
+
+* for each application using Smarty, create a "templates", "configs", and a
+  "templates_c" directory, be sure to set the appropriate directory settings in
+  Smarty for them. If they are located in the same directory as your
+  application, they shouldn't need to be modified. Be sure the "templates_c"
+  directory is writable by your web server user (usually nobody). chown
+  nobody:nobody templates_c; chmod 700 templates_c You can also chmod 777 this
+  directory, but be aware of security issues for multi-user systems. If you are
+  using Smarty's built-in caching, create a "cache" directory and also chown
+  nobody:nobody.
+
+* setup your php and template files. A good working example is in the on-line
+  documentation.
+
+* TECHNICAL NOTE: If you do not have access to the php.ini file, you can change
+  non-server settings (such as your include_path) with the ini_set() command.
+  example: ini_set("include_path",".:/usr/local/lib/php");
diff --git a/GPL_LIB/Smarty/NEWS b/GPL_LIB/Smarty/NEWS
new file mode 100644
index 0000000000000000000000000000000000000000..4cacb9356b9bc1a68cc0c360716995db25bbab48
--- /dev/null
+++ b/GPL_LIB/Smarty/NEWS
@@ -0,0 +1,951 @@
+Version 2.6.12 (Jan 18th, 2006)
+-------------------------------
+
+ - fix improper use of references in the compiler handling cached
+   attributes and in compiled code handling block plugins (messju)
+ - make Smarty::_read_file() work on latest php (messju)
+ - fixed improper tokenization of certain inline math expressions (boots)
+
+Version 2.6.11 (Dec 14, 2005)
+-----------------------------
+
+ - fixed code generation of non-cacheable blocks to play well with php's
+   "Alternative syntax for control structures" (kihara, messju)
+ - fix handling of multiple identical inserts in one display()-call (messju)
+ - replace {} string access with equivalent substr() to avoid E_STRICT
+   warnings in PHP 5.1 (boots)
+ - return valid reference in get_config_vars() when given var is
+   non-existant (Thomas Schulz, boots)
+ - plugin html_image: fix incorrect secure_dir error when
+   file doesn't exist (monte)
+ - plugin html_image: add path_prefix param (monte)
+ - add char_set parameter to escape modifier (Loading, monte)
+ - fix notice in debug security check (Drakla, monte)
+ - return valid reference in get_template_vars() when given var is
+   non-existant (monte)
+ - add escape type "urlpathinfo" to escape modifier (monte)
+
+Version 2.6.10 (Aug 5, 2005)
+----------------------------
+
+  - allow secure_dir to be a filename, not just
+    a directory name (monte)
+  - set debug.tpl as a secure_dir, not the entire
+    SMARTY_DIR (monte)
+  - fix proper escaping for literal strings in
+    Smarty_Compiler::_parse_var_props() (boots, messju)
+  - remove ambiguity for numeric values passed to smarty_make_timestamp()
+    (and thus the date_format modifier). numeric values are treated as
+    timestamps now. (andreas, messju)
+  - add passthru attribute feature to html_select_date (Sedgar,
+    monte)
+  - add "middle" parameter to truncate (monte)
+  - make form input label ids optional (monte)
+  - add error message for empty if/elseif statements (eykanal,
+    monte)
+  - cast selected value to string for comparison in html_radios
+    (Exeption, monte)
+  - updated html_select_date's year_as_text-feature to be xhtml compliant
+    (Mark West, messju)
+  - fix handling of selected month html_select_date (Yuri Weseman, messju)
+
+Version 2.6.9 (Mar 31, 2005)
+----------------------------
+
+  - disallow variable function calls in {if} statements (messju, monte)
+  - disallow variable function calls in {math} equations (messju, monte)
+
+Version 2.6.8 (Mar 21, 2005)
+----------------------------
+
+  - remove e-modifier from regex_replace modifier (messju)
+  - remove cast of object to array in foreach's from-attribute (messju)
+  - add "null" as a valid token for {if} when security is enabled (messju)
+  - add javascript_charcode encoding option to mailto function
+    (monte)
+  - add ids to html_radios labels (monte, menulis)
+  - fix handling of strip-tags with non-default delimiters (Mark West, messju)
+
+Version 2.6.7 (Feb 3, 2005)
+---------------------------
+
+  - fix handling of hashed opening php-tags inside strip-blocks (messju)
+  - removed border tag from html_image function (monte)
+  - change escape:url use rawurlencode() instead of urlencode() (messju)
+  - make $smarty.const.FOO compile to "FOO", and not to "constant('foo')".
+    this is less code and a little faster execution. note that undefined
+    constants are now displayed as the constant's name. (messju)
+  - make block functions and registered objects' block methods use a
+    local variable for block_content instead of a property of $smarty (messju)
+  - fix escaping in the generated code that calls smarty_core_load_plugins
+    (jes5199, messju)
+  - fix invalid HTML issue with popup (Stefanos Harhalakis,
+    Monte)
+  - fixed {popup} to properly handle inarray and function parameters and added
+    support for mouseoff and followmouse options (boots)
+
+Version 2.6.6 (Oct 13, 2004)
+----------------------------
+
+  - fixed nocache-handling with nested includes (Lars Jankowfsky, messju)
+  - moved /libs/core to /libs/internals (boots)
+  - fixed more parsing problems (messju)
+
+Version 2.6.5 (Sept 13, 2004)
+-----------------------------
+
+  - fixed some parsing problems with object calls introduced
+    in 2.6.4 (Monte)
+  - add $smarty->security_settings['ALLOW_CONSTANTS']. note: this
+    defaults to false which means you have to allow them explicitly
+    in your secured templates from now on! (messju)
+
+Version 2.6.4 (Sept 7, 2004)
+----------------------------
+
+  - add $smarty.ldelim and $smarty.rdelim to smarty special var (Monte)
+  - fall back to old uniqid()-behaviour when tempnam() fails in
+    core.write_file.php (messju)
+  - fix capitalize modifier, don't rely on buggy ucwords (Monte)
+  - make html_select_date work with negative timestamps, also
+    force year range to include given date unless explicitly
+    set (Garo, Monte)
+  - fix bug with {fetch}, passing user/pass in url did not work
+    (Monte)
+  - fix occasional wrong error messages on mismatched tags when
+    {else}, {elseif}, {foreachelse} or {sectionelse} is involved (messju)
+  - fix handling of methods arguments (messju, Manfred Wischin)
+  - remove touch() call that made the compiled-template's timestamp the
+    same as the source-template's one. (messju)
+  - add assign attribute to html_checkboxes and html_radios
+    (pcg, Monte)
+  - remove non-xhtml conformant tag from mailto function
+    (tacker, Monte)
+  - handle date_format codes %e, %T and %D for windows (tip,
+    Monte)
+  - fix unnecessary call to smarty_core_get_include_path() inside
+    Smarty::_get_auto_filename() (c960657, messju)
+  - add error-messages when anything else than an identifier is passed
+    to foreach's key- or item-attribute (messju)
+  - fix handling of digits inside tagnames (messju)
+  - fix escaping of backslashes in Smarty_Compiler::_quote_replace() (messju)
+
+Version 2.6.3 (June 16, 2004)
+-----------------------------
+
+  - added escapement of '</' to '<\/' in escape:javascript
+    modifier (c960657, Monte)
+  - added obfuscation of protocol-string in {mailto} when using hex-
+    encoding (bharat, messju)
+  - enhanced auto-generated filenames for templates_c and cache (messju)
+  - add 'nonstd' to escape modifier for escaping non-std chars,
+    such as ms doc quote (Monte)
+  - adjusted textformat to not output wrap chars after last para
+    (Monte)
+  - use tempnam() instead of unqid() to create better temporary files in
+    smarty_core_write_file() (xces, messju)
+  - add 'mail' to escape modifier for safe display of e-mail
+    addresses (Monte)
+  - add cycle function attribute "reset" to english docs (Monte)
+  - enhanced support of numeric constants as variable-expressions (messju)
+  - add case decentity to smarty_modifier_escape() (Konstantin A. Pelepelin,
+    messju)
+  - make smarty_core_write_compiled_include() php5-aware (messju)
+  - removed unused functionality to load a subset of lines from a file (messju)
+  - fix is_secure() should only check if a file is_readable, not if
+    the directory where it is in is readable (sagi, messju)
+  - fix problem displaying debug console when $default_resource_type
+    is not "file:" (c960657, Monte)
+  - fix permission handling with security and config_load (messju)
+  - removed '.' from the list of default template locations in
+    _parse_resource_name() (messju)
+  - fix avoid warning with template_exists() on an absolute paths (messju)
+  - fix parameters passed to resource's secure()-function (messju)
+  - fix handling of integer values like width and delay im
+    smarty_function_popup() (messju)
+
+Version 2.6.2 (Feb 17, 2004)
+----------------------------
+
+  - fix allow empty years, months and days in html_select_date's
+    time-attribute (messju)
+  - fix YES and NO should not be booleanized inside triple-quotes in a
+    config-file (messju)
+  - fix accidently slurped line following a triple-quoted value in a
+    config-file (messju)
+  - change default for use_sub_dirs to false (messju)
+  - fix quoting of values in smarty_function_popup() (messju)
+  - fix handling of hidden sections in Config_File (messju)
+  - add handling of resources for {config_load} (messju)
+  - fix bug when using arrays with tr_attr and td_attr in {html_table} (messju)
+  - add unit testing to cvs core (Monte)
+
+Version 2.6.1 (Jan 16, 2004)
+----------------------------
+
+  - rename $smarty->tpl_error_reporting to $smarty->error_reporting
+    (messju)
+  - fix interpretation of $smarty->security in {html_image} (messju)
+  - add caching of requested paths to _assemble_plugin_filepath() (messju)
+  - fix handling of comments inside {php}- and {literal}-blocks (messju)
+  - fix bug handling triple-quotes in config-files (BRDude, messju)
+  - change default of request_use_auto_globals to true - $_SERVER is
+    now preferred over $HTTP_SERVER_VARS (messju)
+  - re-add support for $SCRIPT_NAME (messju)
+  - reactivate $smarty->default_modifiers (messju)
+  - add cookie persistance to debug console (Monte)
+  - allow single-digit days and months without smarty_make_timestamp()
+    in html_select_date (messju)
+  - fix headers sent erroneously with cache_modified_check and fetch()
+    (wphilips, messju)
+  - fix config_file path bug (Marc Cabadas, Monte)
+  - fix 'is even by' and 'is odd by' logic (Monte)
+  - add day_empty, month_empty, year_empty and all_empty attributes to
+    html_select_date (messju)
+  - add table of explanation for {if} qualifiers in docs (boots)
+  - fix bug when comparing array-keys to "selected" in html_options
+    and html_checkboxes (messju)
+  - add better checks for correctly nested tags when compiling (messju)
+  - remove {$SCRIPT_NAME}. use {$smarty.server.SCRIPT_NAME} instead (messju)
+  - remove $global_assign. assign global variables explicitly instead (messju)
+  - fix example for count_characters in docs (boots)
+  - add section new basic syntax section "Escaping Smarty Parsing" in docs (boots)
+  - fix error handler call in config_load (boots)
+  - remove warning in debug_print_var on php-resources (messju)
+  - move function.assign.php to compiler.assign.php (messju)
+  - add property $tpl_error_reporting (messju)
+  - remove property $undefined. "null" is used literally instead (messju)
+
+Version 2.6.0 (Nov 19, 2003)
+----------------------------
+
+  - move Smarty::quote_replace() to Smarty_Compiler::_quote_replace() (messju)
+  - remove import of of attributes of {include_php} to php's namespace.
+    use $params[name] instead (messju)
+
+Version 2.6.0-RC3 (Nov 13, 2003)
+--------------------------------
+
+  - fix handling of $var.key inside [] (messju)
+  - fix handling of assign inside {insert}-tags (messju)
+  - fix handling if [...] inside triple-quotes in config-files (messju)
+  - fix handling of simple-math-operators inside modifiers (Dominik, messju)
+  - fix handling of trailing-slashes in open_basedir in
+    smarty_core_create_dir_structure() (packman, messju)
+
+Version 2.6.0-RC2 (Oct 8, 2003)
+-------------------------------
+
+  - apply modifiers only once to section-loop and foreach-from attrs (messju)
+  - remove use of _smarty_cached_paths-files (messju)
+  - remove Smarty::_plugin_implementation_exists() - use is_callable() (messju)
+  - ignore {strip}/{/strip) inside {strip}-blocks (messju)
+  - fixed removal of leading/trailing newlines in {strip}-blocks (messju)
+  - fixed proper escaping of " and ' with escape:javascript (messju)
+  - fixed bug in traversal of $smarty->plugins_dir-array. now the
+    first matching plugin is taken (messju)
+  - moved {strip} back into the compiler (messju)
+  - fixed config_load: handling of section-attribute and use of
+    multiple config-files in one template (atu, messju)
+
+Version 2.6.0-RC1 (August 11, 2003)
+-----------------------------------
+
+  - fixed status-header for cache_modified_check under cgi-sapi (messju)
+  - added optional parameter $cache_attrs to register_function() and
+    register_block(). $cache_attrs is an array containing attribute-
+    names that should be cached on calls to functions that have
+    $cacheable set to false. (messju)
+  - enabled registration of class-methods as callbacks for the register_*-
+    functions (use: array('classname', 'method_name')) as callback) (messju)
+  - added filepath caching (Monte)
+  - added optional assign-attribute to {capture}-tag (messju)
+  - added $cacheable-parameter to register_compiler_function() (messju)
+  - added $cacheable-parameter with default=true to register_function()
+    and register_block() (messju)
+  - add math speedup to core (Dominik, Monte)
+  - fix newlines for tags without template output (Monte)
+  - added config-option "request_use_auto_globals" to make auto-globals be
+    used as request vars instead of HTTP_*_VARS (messju)
+  - speed up config_load, simplify compiling (Monte)
+  - added block-methods for registered objects (Bharat Mediratta, messju)
+  - ignore one char resource names like c:foo.tpl (Monte)
+  - added default_resource_type feature (Monte)
+  - fix bug where config file starts with hidden section (boots, Monte)
+  - add discrete error checking pertaining to $cache_dir
+    and $compile_dir, their existance and writability (Monte)
+  - fixed behaviour of start=... for {counter} (messju)
+  - fixed assign for {counter} (messju)
+  - added params vdir, hdir and inner to html_table to allow looping
+    over the data in various directions (messju)
+  - allow spaces in literal tags (Paul Lockaby, Monte)
+  - speed up compiled templates, hardcode plugin filepaths
+    instead of dynamically calculate at runtime. (Monte)
+  - abstract many core components from Smarty.class.php,
+    speeding up core class instantiation (Monte)
+  - fixed bug in _create_dir_structure() when used with open_basedir-
+    restriction and relative paths (messju)
+  - use DIRECTORY_SEPARATOR exclusively, keep DIR_SEP for BC (Monte)
+  - changed "link" to "href" in html_image. "link" is still working
+    but deprecated (messju)
+  - html_image always renders an alt-tag now (default alt="") (messju)
+  - fixed assign attribute for multiple counters (messju)
+  - added simple math operators to variables (Monte)
+  - enabled array(&$obj. 'source', 'timestamp', 'secure', 'trusted')
+    as callback for register_resource() (messju);
+  - enabled array(&$obj, 'method') as callback for
+    $default_template_handler_func (messju)
+  - remove unnecessary close/open tags from compiled templates
+    (Monte)
+  - fixed errornous creation of '//' in image_path in html_image (messju)
+  - fix escapement of special chars for key vals in debug
+    console (Monte)
+  - fixed debug timing logic for config_load (Tom Sommer, Monte)
+  - all in-code doc comments converted to phpDocumentor format (Greg)
+  - moved strip from smarty core to plugin (Monte)
+  - moved config_load from smarty core to plugin (Monte)
+  - added &$repeat-parameter to block-functions (messju)
+  - enabled hex-constants in function.math.php (messju)
+  - enabled hex-constants (0x...) as function-attributes, inside if-statements
+    and as modifier-parameters (messju)
+  - fixed bug with passing $smarty as reference in Smarty.compiler.class
+    (messju)
+  - corrected output with {strip} and PHP tag newlines (Monte)
+  - added possibility to register function-callbacks as "array(&$obj, 'method)"
+    this affects register_function(), -block, -compiler_function, -modifier,
+    -prefilter, -postfilter, -outputfilter-functions() and $cache_handler_func
+    (messju)
+  - added <labels> to html_checkboxes and html_radios (Philippe, messju)
+  - added "labels"-options to turn off labels in html_checkboxes and _radios
+    (messju)
+
+Version 2.5.0 (April 11, 2003)
+------------------------------
+
+   - fixed bug with default modifier when passing integer 0
+     (Monte)
+   - change backtic syntax from $`foo` to `$foo` (Monte)
+   - recognize $foo[][] syntax inside embedded quotes without
+     backtics (Monte)
+   - name=123 is passed as an integer (not a string) to plugins now (messju)
+   - $length is now propagated to sub-values in debug_print_var (messju)
+
+Version 2.5.0-RC2 (March 26, 2003)
+----------------------------------
+
+    - made clear_cache() ignore compile_id, when clearing cache-groups (this
+      is when no $tpl_file is supplied) (messju)
+    - made onmouseout XHTML-compliant in function.popup.php (messju)
+    - applied local-var-naming-scheme to fetch() (messju)
+    - renamed $localvars to $_localvars in cache-file-handling-functions,
+      added _get_auto_id()-function (messju)
+    - swapped compile_id and cache_id in read_cache_file and write_cache_file
+      (messju)
+    - reverted patch for cache-file-handling (messju)
+    - made html_radios and html_checkboxes accept "selected" instead
+      of "checked" optionally. (messju)
+    - made compile_id ignored in clear_cache, made order of
+      auto_file_name $cache_id.$compile_id again, applied the the new
+      variable-naming-scheme for cache_file_handing functions (messju)
+    - removed notice of undefined var in _rm_auto() (messju)
+    - added warning message when an array is passed as
+      the "checked" value of html_radios (Monte)
+    - fixed errormessage in _compile_smarty_ref() (messju)
+    - updated docs for html_image "name" -> "file" (messju)
+    - fixed bug with html_options-optgroups (Nichlas L�fdahl, messju)
+    - cleaned up calls to readdir() (messju)
+    - fixed bug with passing multiple modifiers to a parameter
+      (Monte)
+    - updated docs for html_checkboxes, html_options and html_radios (messju)
+    - fixed wrong default "name" attribute for html_options (messju)
+    - html_checkboxes now expect the options as attribute "options" instead
+      of "checkboxes. html_radios expect "options" instead of "radios".
+      cleaned up indentiation (messju)
+    - fixed too greedy str_replace in trimwhitespace outputfilter (messju)
+    - html_checkboxes and html_radios passthru all unknown paramters now
+      additionally their output is now XHTML compliant (messju)
+    - html_options passthru all unknown paramters now (messju)
+    - fix link functionality of html_image, also make
+      output XHTML compatible (Hinrich Donner, Monte)
+    - append "@" to default modifier vars/args
+      supress possible warnings (Monte)
+    - fix problem with escaped double quotes (Monte)
+    - fix html_radios to not return an array (Monte)
+    - fixed length in modifier.truncate.php (messju)
+    - fixed handling of '$'-signs in trimwhitespace outputfilter (messju)
+    - fix bug that makes config files recompile every time
+      (Nagger, Monte)
+    - add dpi functionality to html_image, change "name"
+      parameter to "file" (Thomas Shulz, Monte)
+    - fix height/width parameter index in html_image (Gerard,
+      Monte)
+    - get rid of unsetting name and script attributes
+      to insert tag (Thomas Schulz, Monte)
+    - changed argument order of string_format modifier back,
+      was right in the first place (Monte)
+
+Version 2.5.0-RC1 (March 5, 2003)
+---------------------------------
+
+    - fixed notice in popup function (Nagger, Monte)
+    - fix "once" var compiling for include_php (Monte)
+    - added nl2br modifier to distribution (Monte)
+    - added html_image to distribution (Monte)
+    - added cat modifier to distribution (Monte)
+    - added html_table to distribution (Monte)
+    - added << >> <> support to if statments (SMK, Monte)
+    - fix _assign_smarty_interface to not overwrite keys
+      other than 'request' (Jerome Poudevigne, Monte)
+    - added html_checkboxes to distribution (Christopher Kvarme, Monte)
+    - added html_radios to distribution (Christopher Kvarme, Monte)
+    - fixed string_format modifier args (wrong order) (Paul
+      Lockaby, Monte)
+    - use tmp file for file writes, avoid file lock race (Monte)
+    - support syntax "$`smarty.config.foo`.tpl" for embedded
+      vars in quotes, and allow full dollar var syntax (Monte)
+    - add $smarty.config.varname variable for accessing config vars (Paul
+      Lockaby, Monte)
+    - silence PHP warnings in function.fetch.php (Eduardo,
+      Monte)
+    - added get_config_vars(), same basic functionality as
+      get_template_vars() (Monte)
+    - update get_template_vars() to be able to get
+      individual vars (Monte)
+    - fix minor logic in _fetch_template_info (Dennis Gearon,
+      Monte)
+    - fix cache groups with compile_id set (Monte)
+    - add support for merging appended vars (messju, Monte)
+    - allow null as function attribute value
+      (Andr� Rabold, Monte)
+    - support $foo->bar[index] syntax (Monte)
+    - add get_registered_object function (messju, Monte)
+    - treat unrecognized param attribute syntax as string (Monte)
+    - support $smarty.const.$foo syntax (messju, Monte)
+    - remove E_NOTICE warnings from debug.tpl,
+      escape modifier (Kanstantin, Monte)
+    - don't count non-ascii chars in count_words modifier
+      (Kanstantin, Monte)
+    - clean up param calls to _parse_var and _parse_attrs (Monte)
+    - define $template_source var, elude possible warning
+      (Monte)
+    - fix syntax problem with evaluating PHP constants (Monte)
+    - add @ and === as valid if statement tokens (Monte)
+    - enable error messages for config_load errors,
+      use $this->config_class for loading class name (Monte)
+    - fix html_options to not escape already escaped entities (Monte)
+    - send Last-Modified header on cache creation (Monte)
+    - check strict syntax of function attributes (Monte)
+    - dropped support for modifers on object parameters,
+      added support for objects as modifier parameters (Monte)
+    - fixed bug with decimal numbers in if statements (Monte)
+
+Version 2.4.2 (Feb 11, 2003)
+----------------------------
+    - support embedded variables in objects (Monte)
+    - fix bug with objects with no properties (M Mohr, Monte)
+    - support full dollar var syntax in quoted text (Monte)
+    - fixed bug in $smarty.const.FOO introduced in 2.4.1 (M
+      Mohr, Monte)
+
+Version 2.4.1 (Feb 6, 2003)
+---------------------------
+
+    - ignore case in IF statements (Rainer Collet, Monte)
+    - treat undefined constants as null (Ferdinand Beyer, Monte)
+    - fix problem with inserts and nested fetches
+      (Rainer Collet, Monte)
+    - added support for passing params to include_php
+      (Tim Riley, Monte)
+    - added support for math operators in if statements (Monte)
+    - added support for $foo->bar[$x].blah syntax (Monte)
+
+Version 2.4.0 (Feb 2, 2003)
+---------------------------
+
+    - fix known problems with php tag handling in templates
+      (recursion, echoing xml tags) (Monte)
+    - add support for object registration (Monte)
+    - add debug template to secure_dir, add template_dir
+      to secure_dir by default (Ferdinand Beyer, Monte)
+    - added support for assigned object access (Monte)
+    - fixed bug with directories named '0' (Frank Bauer, Monte)
+    - add javascript parameter to escape modifier (Monte)
+    - added calling function line numbers to syntax error
+      messages in compiler (Monte)
+    - added support for modifiers to function calls (Monte)
+    - support return value for custom functions
+      instead of echoing (but echo still works) (Monte)
+    - added direct access to constants
+      via $smarty.const.FOO (Monte)
+    - added support for passing modifiers
+      to static values (Monte)
+    - fix up regex code in compiler, more accurate and
+      maintainable (Monte)
+    - added day_value_format to html_select_date (Marcus
+      Bointon, Monte)
+    - assigned variables are no longer in global
+      namespace, saving extract() calls and speeding
+      up fetch() and display() linearly with no. of
+      assigned variables (Monte)
+    - added trimwhitespace output filter to dist. (Monte)
+    - fix popup function to allow newlines in text (Monte)
+    - escape html entities in html_options (Monte)
+    - fixed bug with label for html_options (Monte)
+    - added config_load API function (Monte)
+    - added caching to config file loading (Monte)
+    - added "extra" parameter to mailto function (Monte,
+      Massimiliano Perantoni)
+    - added mailto plugin to dist.  (Monte)
+
+Version 2.3.1 (Nov 19, 2002)
+----------------------------
+
+    - added optgroup support to html_options (Monte, Robert
+      Amos)
+    - set mtime on compile files so they match source
+      files (Monte, Peter Bowen)
+    - added proper support for open_basedir setting
+      (Monte, Alessandro Astarita)
+    - added strip variable modifier, updated docs (Monte)
+    - fixed access to $smarty.x variables as arrays. (Andrei)
+    - fixed errors with example setup docs (Monte, Matthew
+      Hagerty)
+    - added textformat block function (Monte)
+
+Version 2.3.0 (Aug 7, 2002)
+---------------------------
+
+    - added assign_by_ref() and append_by_ref() functions
+      (Bob Silva, Monte)
+    - changed default warning type for plugin errors from
+      E_USER_WARNING to E_USER_ERROR (Monte)
+    - added $all_extra, $hour_extra, $minute_extra,
+      $second_extra and $meridian_extra parameters to
+      html_select_time function (Rainer Collet, Monte)
+    - update debug console to print objects (Simon Willison,
+      Monte)
+    - fix Config_File class to not error when there are no
+      sections (Peter Kmet, Monte)
+    - add default modifier logic (Monte)
+    - updated popup_init to be xhtml compliant (Tom Oram, Monte)
+    - fix filename bug with windows (Gary Loescher, Monte)
+    - add ability to supply expire time in seconds when clearing
+      cache or compile files (Monte)
+    - add {debug} plugin to distribution (Monte)
+    - fixed bug with insert tags, loading from "script" attribute
+      when caching is enabled (Monte)
+    - fix bug with debug_tpl file path with Windows (.SMK., Monte)
+    - fix append() function with string/array problem (Monte)
+
+Version 2.2.0 (July 11, 2002)
+-----------------------------
+
+    - make debug.tpl work with any delimiter (Monte)
+    - change logic in assign() and append() to test var names
+      against != '' instead of empty() (Monte)
+    - fix PHP notice in append() function (Monte)
+    - allow $plugins_dir to be an array of directories
+      (Andreas Kossmeier, Monte)
+    - move debug.tpl to SMARTY_DIR, add to constructor (Monte)
+    - fixed warning message in function.assign_debug_info (Monte)
+    - fixed $template_dir, $compile_dir, $cache_dir, $config_dir,
+      $plugin_dir to respect include_path (Monte)
+    - fixed warning message with output filter array (Monte)
+    - add optional 2nd parameter to date_format, used as
+      the default date if the passed date is empty (Monte)
+    - gave $reset a default value in cycle plugin (Monte)
+    - fixed warnings with html_select_date and timestamp
+      functions (Monte)
+    - added support for sub directory exlusion format (Monte)
+    - added support for grouping by cache_id, compile_id
+      and segments thereof (Monte)
+    - changed cache and compile files to human readable
+      format (Monte)
+    - remove overlib.js file from distribution (Monte)
+    - fixed bug with 304 Not Modified response sending
+      content (Monte)
+    - fixed cycle function to respect delimiter after
+      initial setting (Monte)
+    - update $GLOBALS references to work properly with
+      track_globals settings (Michal Prinke, Monte)
+    - fixed bug in math function with call to assign
+      (Grigory V. Kareev, Monte)
+    - optimized for loops with count() function calls (Monte)
+    - add month_value_format attribute to html_select_date
+      plugin (Gary Loescher, Monte)
+    - made it possible to use simple variables inside [] for
+      indexing. (Andrei)
+    - added "once" attribute to {include_php}. (Monte)
+
+Version 2.1.1
+-------------
+    - added cycle function. (Monte)
+    - fixed bug with resource testing, and include_path. (Monte)
+    - fixed a bug with register_outputfilter function. (Monte)
+
+Version 2.1.0
+-------------
+
+    - introduced output filters. (Andrei)
+    - changed the way filters are loaded, added load_filter()
+      API function and $autoload_filters variable. (Andrei)
+    - added caching logic for expire times per cache file
+      (Norbert Rocher, Monte)
+    - fixed html_select_date when field separator is "/"
+      (Roberto Berto, Monte)
+    - added YYYY-MM-DD format support to html_select_date
+      (Jan Rosier, Monte)
+    - fixed cache_lifetime logic bug, also made -1 = never
+      expire (Monte)
+    - fixed directory separator issue for Windows. (Andrei)
+    - added ability to use simple variables as array indices or
+      object properties. (Andrei)
+    - added ability to unregister pre/postfilters plugins at
+      runtime. (Andrei)
+    - added 'htmlall' attribute to escape modifier. (Monte)
+    - added template_exists() API function. (Andrei)
+    - fixed a problem with using dynamic values for 'file'
+      attribute of {include_php} tag. (Andrei)
+    - added $smarty.template variable. (Andrei)
+    - fixed several plugins that would not work if the plugin
+      directory was not the default one. (Andrei)
+    - implemented support for block functions. (Andrei)
+    - made it possible to assign variables in pre/postfilter
+      plugins. (Andrei)
+
+Version 2.0.1
+-------------
+    - rename plugin .make_timestamp.php to shared.make_timestamp.php.
+      (Monte)
+    - changed crc32() generated values, replace '-' with 'N'. (Monte)
+    - added support for +/- N syntax in html_select_date year values.
+      (Monte)
+    - fixed behavior of inserts with script attribute. (Andrei)
+    - fixed bug with $smarty.cookies and $smarty.server. (Andrei)
+    - wordwrap and indent are missing from 2.0 release, now fixed.
+      (Monte)
+    - removed show_info_header and show_info_include variables. (Monte)
+
+Version 2.0.0
+-------------
+    - added "eval" function plugin for evaluating variables as
+      templates. (Monte)
+    - removed $tpl_file_ext class variable, no longer used. (Monte)
+    - added "hex" and "hexentity" escape types to escape modifier.
+      (Monte)
+    - removed dependency on PEAR. (Andrei)
+    - update popup_init to accept src attribute. (Monte, Duncan Forrest)
+    - implemented several optimizations, speeding up Smarty
+      significantly in most cases. (Andrei,Monte)
+    - implemented plugin architecture. (Andrei)
+    - added wordwrap and indent modifiers. (Monte)
+    - added support for 'If-Modified-Since' headers for cached content.
+      (Monte)
+    - removed insert_tag_check class variable, no longer needed. (Monte)
+    - optimized cache fetches by scanning for insert tags only if they
+      exist. (Monte)
+    - fixed bugs in overlib. (Monte, Duncan Forrest)
+    - fixed a problem with compile_id usage. (Andrei)
+    - fixed problem with using assigned vars with {include_php ...}
+      filepath. (Monte)
+
+Version 1.5.2
+-------------
+    - added Smarty object as fifth argument for template resource functions.
+      (Monte)
+    - fixed a bug with incorrectly combined cache and compile id in
+      clear_cache(). (Andrei)
+    - fixed bug in smarty_make_timestamp introduced in PHP 4.1.0. (Monte)
+    - fixed bug with cached insert debug timing. (Monte)
+    - added 'script' attribute to {insert..} which specifies the script that
+      the insert function can be found in. (Andrei)
+    - added default template function handler. (Monte)
+
+Version 1.5.1
+-------------
+    - removed error message from the generic _read_file() method, the caller
+      should take care of that. (Andrei)
+    - fixed a bug with incorrectly combined cache and compile id. (Andrei)
+
+Version 1.5.0
+-------------
+    - added include_php built-in function, documented. (Monte)
+    - added trusted_dir functionality, documented. (Monte)
+    - consolidated secure_dir tests to one function. (Monte)
+    - prepended _smarty_ to variable names in fetch() class function to avoid
+      namespace conflicts. (Monte)
+    - introduced $compile_id class variable that can be used to set persistent
+      compile identifier across multiple display calls, documented. (Andrei)
+    - fixed bug with concatenated null cache and compile identifiers. (Andrei)
+    - added $smarty.section.* syntax for accessing section properties,
+      documented. (Andrei)
+    - added custom cache handling function ability, documented. (Monte)
+    - added assign attribute to include, include_php, insert, fetch, math, and
+      counter functions, documented. (Monte)
+    - fixed bug with fetch testing for local file when http address. (Monte)
+    - fixed bug with counter and skipval setting. (Monte)
+    - made {config_load ...} merge globals from each config file only once per
+      scope, thus avoiding several problems. (Andrei)
+    - added {foreach ...} tag that can be used to iterate through
+      non-sequential and associative arrays, documented. (Andrei)
+    - speeded up section property access a bit. (Andrei)
+    - removed $smarty variable from storage used by normal template variables,
+      to prevent any problems. (Andrei)
+    - fixed a bug that could cause parse error with quotes inside literal
+      blocks. (Andrei, Alexander Belonosov)
+    - added 'field_array' attribute to html_select_time function, documented.
+      (Andrei, Michael Caplan)
+    - documented {section} "max" attribute. (Monte)
+    - fixed notice message in Smarty_Compiler.class.php. (Monte)
+    - fixed bug with clear_cache introduced in 1.4.6, third parameter should
+      default to null. (Monte)
+    - updated Config_File class to support '\' path separator in OS/2. (Monte,
+      Francesco Cipriani)
+    - removed secure_ext setting (not used). (Monte)
+    - made cache reading process more efficient. (Monte)
+    - fixed bug, is_cached() now supports new 1.4.6 caching behavior. (Monte)
+    - update FAQ with mailing list Reply-To header FAQ. (Monte)
+    - supress error messages for fopen(), fix cache to regenerate if cache
+      file is not available (i.e. cluster race condition). (Monte)
+    - added index key example to QUICKSTART guide. (Monte)
+
+Version 1.4.6
+-------------
+    - fixed bug with {assign ...} when passing an empty value. (Monte)
+    - add more warning message fixes. (Monte, Tara Johnson)
+    - documentation updates. (Monte)
+    - update fetch function to give proper warning when fetching a non-readable
+      or non-existant file. (Monte)
+    - fixed problem with newline at the end of included templates (Monte, Andrei)
+    - added feature to regenerate cache if compile_check is enabled and an
+      involved template or config file gets modified. (Monte)
+    - added DEBUG execution times to included files: REQUIRES updated debug.tpl
+      file! (Monte)
+    - added support for hidden config variables that cannot be read by
+      templates. (Andrei)
+    - added execution time to DEBUG console, total and inserts. (Monte)
+    - fixed bug where DEBUG console would not appear with cached content. (Monte)
+    - added support for postfilter functions that are applied to compiled
+      template right after compilation. (Andrei)
+    - fixed the name of clear_compile_tpl() API function to clear_compiled_tpl.
+      (Andrei)
+    - added fix for removing comments so that the line numbers are reported
+      correctly in case of errors. (patch from Anders Janson)
+    - made html_options output xhtml compatible code. (Monte, Arnaud Limbourg)
+
+Version 1.4.5
+-------------
+    - update FAQ with index of questions at the top
+    - update overlib to 3.50, adjust addon code so that the overlib.js
+      file isn't modified, and not using the mini one. (Monte)
+    - added many more options to html_select_date. (Alexander Skwar, Andrei)
+    - added support for generating different compiled templates from the same
+      source template. (Hans-Peter Oeri, Andrei)
+    - modified Smarty to pass itself to insert functions as the second
+      parameter. (Andrei)
+    - modified Smarty to pass itself to prefilter functions as the second
+      parameter. (Andrei)
+    - fixed syntax error when including a non-existant template with security
+      enabled. (Monte)
+    - fixed comments handling to allow commenting out template blocks. (Andrei)
+    - implemented named capture buffers, with results accessible via
+      $smarty.capture.<name>. (Andrei)
+    - added ability to index arrays directly by numbers. (Andrei)
+    - fixed bug with SMARTY_DIR not prepended to Config_File include. (Monte)
+
+Version 1.4.4
+-------------
+    - fixed problem with including insecure templates with security enabled.
+      (Monte)
+    - numerous documentation updates. (Monte)
+    - added ENT_QUOTES to escapement of html. (Monte, Sam Beckwith)
+    - implemented access to request variables via auto-assigned $smarty
+      template variable. (Andrei)
+    - fixed a bug with parsing function arguments inside {if} tags if a comma
+      was present. (Andrei)
+    - updated debug console with config file vars. (Monte)
+    - added SMARTY_DIR constant as an alternative to relying on include_path.
+      (Monte)
+    - added popup_init and popup functions (requires overlib.js). (Monte)
+    - updated debug console with config file vars. (Monte)
+    - added debugging url control. (Monte)
+    - added 'quotes' type to escape modifier. (Monte, Mike Krus)
+    - added 'total' and 'iteration' section properties. (Andrei)
+    - added 'start', 'max', and 'step' section attributes/properties. (Andrei)
+    - fixed a bug with security checking of functions inside {if} tags.
+      (Andrei)
+    - fixed a bug in Config_File that would incorrectly booleanize values that
+      weren't really booleans. (Andrei)
+
+Version 1.4.3
+-------------
+    - added regex_replace modifier, documented. (Monte)
+    - added debugging console feature and custom function assign_debug_info,
+      documented. (Monte)
+    - added 'scope' attribute for {config_load}, 'global' is now deprecated but
+      is still supported. (Andrei)
+    - reduced template symbol table pollution by moving config array into the
+      class itself. (Andrei)
+    - fixed a bug with passing quoted arguments to modifiers inside {if}
+      statements. (Andrei, Sam Beckwith)
+    - added security features for third party template editing, documented
+      (Monte)
+    - added assign custom function, documented. (Monte)
+    - fixed bug with template header using version instead of _version. (Monte)
+    - fixed a problem with putting $ followed by numbers inside {strip} and
+      {/strip} tags. (Andrei)
+    - fixed Config_File class to allow empty config paths (defaults to current
+      directory). (Andrei)
+
+Version 1.4.2
+-------------
+    - move $version to internal variable, remove from docs. (Monte)
+    - cleaned up compiled templates global scope by moving some variables into
+      the class itself. (Andrei)
+    - fixed a bug that would not allow referring to a section in the including
+      file from the included file. (Andrei)
+    - configs directory missing from 1.4.1 release, added back in. (Monte)
+    - added windows include_path setup instructions to FAQ & QUICKSTART.
+      (Monte)
+
+Version 1.4.1
+-------------
+    - fix LOCK_EX logic for all windows platforms (Monte)
+    - fixed indexing by section properties with the new syntax. (Andrei)
+    - updated Smarty to use absolute paths when requiring/including Smarty
+      components. (Andrei, John Lim)
+
+Version 1.4.0
+-------------
+    - added {capture}{/capture} function, documented (Monte)
+    - added {counter} function, documented (Monte)
+
+Version 1.4.0b2
+---------------
+    - fixed issue in Config_File.class with referencing blank sections (Andrei)
+    - fixed problem with passing variables to included files (Andrei)
+    - fixed resource path recognition for windows (Monte)
+
+Version 1.4.0b1
+---------------
+    - added "componentized templates" tip into documentation (Monte)
+    - added {php}{/php} tags for embedding php code into templates (Monte)
+    - changed default value of $show_info_header to false (Monte)
+    - implemented '->' syntax for accessing properties of objects passed to the
+      template. (Andrei)
+    - allowed custom functions to receive Smarty object as the second
+      parameter; this can be used to dynamically change template variables, for
+      example. (Andrei)
+    - added custom compiler functions support, register_compiler_function() and
+      unregister_compiler_function() API functions. (Andrei, Ivo Jansch).
+    - updated GLOBAL_ASSIGN to take SCRIPT_NAME from HTTP_SERVER_VARS
+      instead of global variable. You can also assign several variables
+      in one shot with an array. (Monte, Roman Neuhauser)
+    - added template prefilters, register_prefilter() and
+      unregister_prefilter() API functions. (Monte)
+    - added RELEASE_NOTES file to distribution. (Monte)
+    - moved CREDITS out of manual into its own file. (Monte)
+    - added register_resource() and unregister_resource() API functions. (Monte)
+    - changed the syntax of indexing template variables, thus supporting
+      structures of arbitrary complexity; supplied fix_vars.php script to fix
+      old syntax. (Andrei)
+    - added $insert_tag_check to speed up cached pages if {insert ...} is not
+      used. (Monte)
+    - added $compiler_class variable to allow specifying a different compiler
+      class. (Andrei)
+    - changed Smarty to compile templates at runtime, allowing for arbitrary
+      template resources. (Monte)
+    - added fix for LOCK_EX under Windows and changed a couple of file
+      permissions for security. (Monte, Fernando Nunes)
+    - allow arbitrary date strings to date_format, html_select_date and
+      html_select_time (Monte)
+
+Version 1.3.2
+-------------
+    - fixed a bug that caused some nested includes to loop infinitely. (Andrei)
+    - added optional HTML header to output. (Monte)
+    - significantly improved config_load performance. (Andrei)
+    - added format attribute to math function. (Monte)
+    - added html_select_time custom function. (Andrei)
+    - fixed minor PHP warning when attempting to unset an unset variable
+      (Monte)
+    - added count_characters, count_words, count_sentences, count_paragraphs
+      modifiers (Monte)
+
+Version 1.3.1pl1
+--------------
+    - bug fix, recovered missing _syntax_error function (Monte)
+
+Version 1.3.1
+-------------
+    - document first, last, index_prev, index_next (Monte)
+    - added 'first' and 'last' section properties. (Andrei)
+    - split out compiling code to separate class for faster template execution
+      time (Monte)
+    - fixed a couple of minor PHP warnings (Monte)
+    - added and documented unregister_modifier() and unregister_function() API
+      calls. (Monte)
+    - added and documented 'fetch' and 'math' functions. (Monte)
+    - added ability to index looped variables by section properties, e.g.
+      $foo.index_prev/bar. (Andrei)
+    - added index_prev and index_next section properties. (Andrei)
+    - fixed issue with php executing in literal blocks. (Monte)
+
+Version 1.3.0
+-------------
+    - moved license from GPL to LGPL (Monte)
+    - implemented workaround for PHP "feature" that eats carriage returns
+      if the PHP tag is at the end of the line. (Andrei)
+    - removed $allow_php, added $php_handling logic (Monte)
+    - added file locking to prevent reader/writer problem. (Andrei)
+    - made Smarty catch unimplemented modifiers and custom functions and output
+      error messages during compilation instead of failing during run time.
+      (Andrei)
+    - removed short-tags at the top of the smarty scripts (Monte)
+    - added register_function() and register_modifier() API calls to make
+      registering stuff easier. (Andrei)
+    - added template results caching capability. (Monte, Andrei)
+    - added optional 'options' attribute to html_options custom function
+      that allows passing associative arrays for values/output. (Andrei)
+    - modifier arguments can now contain '|' and ':' characters inside quoted
+      strings. (Andrei)
+
+Version 1.2.2
+-------------
+    - fixed bug that would not respect nested template directories and would
+      put all compiled files into top-level one. (Andrei)
+    - fixed bug using $PHP_VERSION instead of environment var PHP_VERSION.
+      (Monte)
+    - a couple small warning fixes. (Monte)
+
+Version 1.2.1
+-------------
+    - added $compile_dir, removed $compile_dir_ext, simplified usage. (Monte)
+    - added tips & tricks chapter to documentation. (Monte)
+    - misc documentation updates. (Monte)
+
+Version 1.2.0
+-------------
+    - updated documentation (Monte)
+    - added file and line number information to syntax error messages. (Andrei)
+    - added ability to index template vars by a key. (Andrei)
+
+Version 1.1.0
+-------------
+    - misc documentation changes, official stable release
+
+Version 1.0b
+------------
+    - fixed the bug that prevented using non-array values for 'loop' attribute.
+      (Andrei)
+    - many misc documentation changes & additions (Monte)
+
+Version 1.0a
+------------
+    - fixed bug that caused templates to recompile every time (Monte)
+
+Version 1.0
+------------
+    - initial release
+
+/* vim: set et tw=64 ft=changelog: */
diff --git a/GPL_LIB/Smarty/QUICK_START b/GPL_LIB/Smarty/QUICK_START
new file mode 100644
index 0000000000000000000000000000000000000000..6ae3e466a074192d0650389e6a0b9d9b0faa7864
--- /dev/null
+++ b/GPL_LIB/Smarty/QUICK_START
@@ -0,0 +1,103 @@
+This is a simple guide to get Smarty setup and running quickly. The online
+documentation includes a very thorough explanation of a Smarty installation.
+This guide is meant to be a quick and painless way of getting Smarty working,
+and nothing more. The guide assumes you are familiar with the UNIX system
+environment. Windows users will need to make adjustments where necessary.
+
+INSTALL SMARTY LIBRARY FILES
+
+Copy the Smarty library files to your system. In our example, we place them in
+/usr/local/lib/php/Smarty/
+
+$> cd YOUR_DOWNLOAD_DIRECTORY
+$> gtar -ztvf Smarty-2.6.7.tar.gz
+$> mkdir /usr/local/lib/php/Smarty
+$> cp -r Smarty-2.6.7/libs/* /usr/local/lib/php/Smarty
+
+You should now have the following file structure:
+
+/usr/local/lib/php/Smarty/
+                          Config_File.class.php
+                          debug.tpl
+                          internals/
+                          plugins/
+                          Smarty.class.php
+                          Smarty_Compiler.class.php
+
+
+SETUP SMARTY DIRECTORIES
+
+You will need four directories setup for Smarty to work. These files are for
+templates, compiled templates, cached templates and config files. You may or
+may not use caching or config files, but it is a good idea to set them up
+anyways. It is also recommended to place them outside of the web server
+document root. The web server PHP user will need write access to the cache and
+compile directories as well.
+
+In our example, the document root is /web/www.domain.com/docs and the
+web server username is "nobody". We will keep our Smarty files under
+/web/www.domain.com/smarty
+
+$> cd /web/www.domain.com
+$> mkdir smarty
+$> mkdir smarty/templates
+$> mkdir smarty/templates_c
+$> mkdir smarty/cache
+$> mkdir smarty/configs
+$> chown nobody:nobody smarty/templates_c
+$> chown nobody:nobody smarty/cache
+$> chmod 775 smarty/templates_c
+$> chmod 775 smarty/cache
+
+
+SETUP SMARTY PHP SCRIPTS
+
+Now we setup our application in the document root:
+
+$> cd /web/www.domain.com/docs
+$> mkdir myapp
+$> cd myapp
+$> vi index.php
+
+Edit the index.php file to look like the following:
+
+<?php
+
+// put full path to Smarty.class.php
+require('/usr/local/lib/php/Smarty/Smarty.class.php');
+$smarty = new Smarty();
+
+$smarty->template_dir = '/web/www.domain.com/smarty/templates';
+$smarty->compile_dir = '/web/www.domain.com/smarty/templates_c';
+$smarty->cache_dir = '/web/www.domain.com/smarty/cache';
+$smarty->config_dir = '/web/www.domain.com/smarty/configs';
+
+$smarty->assign('name', 'Ned');
+$smarty->display('index.tpl');
+
+?>
+
+
+SETUP SMARTY TEMPLATE
+
+$> vi /web/www.domain.com/smarty/templates/index.tpl
+
+Edit the index.tpl file with the following:
+
+<html>
+<head>
+<title>Smarty</title>
+</head>
+<body>
+Hello, {$name}!
+</body>
+</html>
+
+
+
+Now go to your new application through the web browser,
+http://www.domain.com/myapp/index.php in our example. You should see the text
+"Hello Ned!" in your browser.
+
+Once you get this far, you can continue on to the Smarty Crash Course to learn
+a few more simple things, or on to the documentation to learn it all.
diff --git a/GPL_LIB/Smarty/README b/GPL_LIB/Smarty/README
new file mode 100644
index 0000000000000000000000000000000000000000..7d3e56e0087a598c5768ec5fcc6fdbcc3a422fc6
--- /dev/null
+++ b/GPL_LIB/Smarty/README
@@ -0,0 +1,80 @@
+NAME:
+
+    Smarty - the PHP compiling template engine
+
+VERSION: 2.6.0
+
+AUTHORS:
+    
+    Monte Ohrt <monte at ohrt dot com>
+    Andrei Zmievski <andrei@php.net>
+
+MAILING LISTS:
+
+    We have a few mailing lists. "general" for you to share your ideas or ask
+	questions, "dev" for those interested in the development efforts of Smarty,
+	and "cvs" for those that would like to track the updates made in the cvs
+	repository.
+
+    send a blank e-mail message to:
+      smarty-general-subscribe@lists.php.net (subscribe to the general list)
+      smarty-general-unsubscribe@lists.php.net (unsubscribe from the general list)
+      smarty-general-digest-subscribe@lists.php.net (subscribe to digest)
+      smarty-general-digest-unsubscribe@lists.php.net (unsubscribe from digest)
+      smarty-dev-subscribe@lists.php.net (subscribe to the dev list)
+      smarty-dev-unsubscribe@lists.php.net (unsubscribe from the dev list)
+      smarty-cvs-subscribe@lists.php.net (subscribe to the cvs list)
+      smarty-cvs-unsubscribe@lists.php.net (unsubscribe from the cvs list)
+    You can also browse the mailing list archives at
+    http://marc.theaimsgroup.com/?l=smarty&r=1&w=2
+
+SYNOPSIS:
+
+    require("Smarty.class.php");
+
+    $smarty = new Smarty;
+
+    $smarty->assign("Title","My Homepage");
+    $smarty->assign("Names",array("John","Gary","Gregg","James"));
+
+    $smarty->display("index.tpl");
+
+
+DESCRIPTION:
+
+    What is Smarty?
+
+    Smarty is a template engine for PHP. Many other template engines for PHP
+    provide basic variable substitution and dynamic block functionality.
+    Smarty takes a step further to be a "smart" template engine, adding
+    features such as configuration files, template functions, and variable
+    modifiers, and making all of this functionality as easy as possible to
+    use for both programmers and template designers. Smarty also converts
+    the templates into PHP scripts, eliminating the need to parse the
+    templates on every invocation. This makes Smarty extremely scalable and
+    manageable for large application needs.
+
+    Some of Smarty's features:
+
+    * it is extremely fast
+    * no template parsing overhead, only compiles once.
+	* it is smart about recompiling only the template files that have
+	  changed.
+    * the template language is remarkably extensible via the plugin
+      architecture.
+    * configurable template delimiter tag syntax, so you can use
+      {}, {{}}, <!--{}-->, or whatever you like.
+    * built-in caching of template output.
+    * arbitrary template sources (filesystem, databases, etc.)
+    * template if/elseif/else/endif constructs are passed to the PHP parser,
+      so the if syntax can be as simple or as complex as you like.
+    * unlimited nesting of sections, conditionals, etc. allowed
+    * it is possible to embed PHP code right in your template files,
+      although not recommended and doubtfully needed since the engine
+      is so customizable.
+    * and many more.
+
+COPYRIGHT:
+    Copyright (c) 2001-2005 New Digital Group, Inc. All rights reserved.
+    This software is released under the GNU Lesser General Public License.
+    Please read the disclaimer at the top of the Smarty.class.php file.
diff --git a/GPL_LIB/Smarty/RELEASE_NOTES b/GPL_LIB/Smarty/RELEASE_NOTES
new file mode 100644
index 0000000000000000000000000000000000000000..2cc9896bbf41856856353ff18ae3396fcfe65d9b
--- /dev/null
+++ b/GPL_LIB/Smarty/RELEASE_NOTES
@@ -0,0 +1,428 @@
+2.6.7
+-----
+
+Those using Smarty with security enabled: a hole was found that allowed PHP code to be executed from within a template file. This has been fixed and you are engouraged to upgrade immediately. Note that this hole does NOT affect the security of your web server or PHP applications, only the ability for someone editing a template to execute PHP code. Other changes in this release can be found in the NEWS file.
+
+2.5.0
+-----
+
+Very minor adjustments since RC2, see the NEWS file for details.
+
+2.5.0-RC2
+---------
+
+Many fixes since the RC1 release. This one is as close to production quality as
+they come, so this will be the last release before 2.5.0. The SGML documentation
+files have also been removed from the tarball. If you want them, get them from
+the CVS repository.
+
+2.5.0-RC1
+---------
+
+Release Candidate 1. All $smarty vars can now be dynamic, such as
+$smarty.get.$foo. A new class function get_function_object() gets you a
+reference to an assigned object, useful within your own custom functions.
+append() can now merge as well as append with a third optional attribute. A new
+class function get_config_vars() was added, and get_template_vars() can now be
+used to get individual vars. Full variable syntax is now supported within
+double quotes via a backtick (`) syntax. Files created by smarty are now
+written to a tmp file then renamed to avoid file lock retention. html_radios,
+html_checkboxes, html_table, html_image, nl2br functions added, see the NEWS
+file for full details.
+
+2.4.2
+-----
+Another point release. Added support for dynamic object reference syntax
+($foo->$bar), support for full variable syntax within quotes ("$foo[0].bar"),
+and other minor fixes. See the NEWS file for full details.
+
+2.4.1
+-----
+
+This is basically a point release, cleaning up a few things caught
+in the 2.4.0 release. See the NEWS file for full details.
+
+2.4.0
+-----
+
+Smarty now supports the ability to access objects within the templates. Two
+methods are available, one which closely follows Smartys conventions, and
+another that follows more traditional object syntax for those familiar with
+PHP.
+
+The internal compiling engine has also undergone some major work. The regex
+parsing was rewritten to be much more strict, more secure and more
+maintainable. Config files are now compiled, which can speed up pages quite a
+bit that use config files extensively. Assigned variables are no longer
+extracted to PHP namespace, saving an extract call for every template. There is
+now support for applying modifiers to static values and functions. You can now
+access constants with $smarty.const.VAR.  See the NEWS file for complete
+changes.
+ 
+2.3.1
+-----
+
+The mtime on compiled files will now match the source files, in the case where
+the source file may not get the current timestamp, recompiling will still work
+as expected. Proper support for open_basedir has been added, so Smarty should
+work correctly in safe mode. Added a few new features such as textformat block
+function, strip variable modifier and optgroup support for html_options. Also
+other minor bug fixes, see the Change Log.
+
+2.3.0
+-----
+
+Smarty now has a {debug} template function that brings up the debugging console
+right where {debug} is called, regardless of $debugging settings. This works a
+little different than turning on $debugging in the sense that it shows all the
+template variables available at the time {debug} is called, including local
+scope vars. It does not show the templates names however, since this
+executed during runtime of the template.
+
+You can now supply an expire time when clearing cache or compile files. This is
+mostly useful for removing stale files via the API.
+
+Plugins now stop execution upon error, instead of outputting a warning and
+continuing.
+
+Two new API functions, assign_by_ref() and append_by_ref() were added. They
+allow assigning template variables by reference. This can make a significant
+performance gain, especially if you are assigning large arrays of data. PHP 5.0
+will do this implicitly, so these functions are basically workarounds.
+
+Several misc bug fixes, see the Change Log for information.
+
+
+2.2.0
+-----
+
+Smarty now allows an array of paths for the $plugin_dir class variable. The
+directories will be searched in the order they are given, so for efficiency keep
+the most-used plugins at the top. Also, absolute paths to the plugin directories are
+more efficient than relying on the PHP include_path.
+
+Cache files can now be grouped with the cache_id. See the documentation under
+the new "Caching" section for details. compile_id also respects the same
+grouping syntax. The cache/compile file structure changed, so be sure to clear
+out all your cache and compile files when upgrading Smarty. Also if you are
+using PHP-accelerator, restart apache. I've seen some quirky things happen if
+the phpa files do not get cleared (known issue with phpa and parent
+class-member changes, so just clear 'em.)
+
+Smarty now correctly respects the PHP include_path for $template_dir, $compile_dir,
+$cache_dir, $config_dir and $plugin_dir. Be aware that relying on the
+include_path is an overhead, try to use absolute pathnames when possible
+(or relative to working directory.)
+
+Documentation has been updated and rearranged a bit. Most notably, the
+installation instructions are completely revamped, and a new Caching section
+explains Smarty's caching in detail along with the new grouping functionality.
+
+Many misc. bug fixes and enhancements, see the full ChangeLog (NEWS file) for
+details.
+
+2.1.1
+-----
+
+There was a bug with template paths and the include_path, this has been fixed.
+Also register_outputfilter() did not work, this is fixed. A new template
+function named "cycle" has been added to the distribution, nice for cycling
+through a list (or array) of values.
+
+2.1.0
+-----
+
+This release has quite a few new features and fixes. Most notable are the
+introduction of block functions, so you can write plugins that work on a block
+of text with {func}{/func} notation. Also output filters were added, so you can
+apply a function against the output of your templates. This differs from the 
+postfilter function, which works on the compiled template at compile time, and
+output filters work on the template output at runtime.
+
+Many other features and bug fixes are noted in the NEWS file.
+
+
+2.0.1
+-----
+
+This is a point release, fixing a few bugs and cleaning things up. A plugin
+was renamed, the dash "-" was removed from compiled template and cached file
+names. If you're upgrading, you might want to clear them out first.  See the
+ChangeLog for details.
+
+2.0.0
+-----
+
+This release is a huge milestone for Smarty. Most notable new things are a
+plugin architecture, removal of PEAR dependency, and optimizations that
+drastically improve the performance of Smarty in most cases.
+
+The plugin architecture allows modifiers, custom functions, compiler functions,
+prefilters, postfilters, resources, and insert functions to be added by
+simply dropping a file into the plugins directory. Once dropped in, they are
+automatically registered by the template engine. This makes user-contributed
+plugins easy to manage, as well as the internal workings of Smarty easy to
+control and customize. This new architecture depends on the __FILE__ constant,
+which contains the full path to the executing script. Some older versions of
+PHP incorrectly gave the script name and not the full filesystem path. Be sure
+your version of PHP populates __FILE__ correctly. If you use custom template
+resource functions, the format of these changed with the plugin architecture.
+Be sure to update your functions accordingly. See the template resource section
+of the documentation.
+
+The PEAR dependancy was removed from Smarty. The Config_File class that comes
+with Smarty was actually what needed PEAR for error handling which Smarty didn't
+use, but now everything is self-contained.
+
+Performance improvements are graphed on the benchmark page, you will see that
+overall performance has been sped up by as much as 80% in some cases.
+
+Smarty-cached pages now support If-Modified-Since headers, meaning that if a
+cached template page has not changed since the last request, a "304 Not
+Modified" header will be sent instead of resending the same page. This is
+disabled by default, change the setting of $cache_modified_check.
+
+
+1.5.2
+-----
+
+Mostly bug fixes, added a default template resource handler.
+
+
+1.5.1
+-----
+
+Critical bug fix release. If you use caching, you'll need to upgrade.
+
+
+1.5.0
+-----
+
+Several feature enhancements were made to this version, most notably the
+{foreach ...} command which is an alternative to {section ...} with an easier
+syntax for looping through a single array of values. Several functions were
+enhanced so that the output can be automatically assigned to a template
+variable instead of displayed (assign attribute). Cache files can now be
+controlled with a custom function as an alternative to the built-in file based
+method. Many code cleanups and bug fixed went into this release as well.
+
+
+1.4.6
+-----
+
+The behavior with caching and compile_check has been slightly enhanced. If
+caching is enabled AND compile_check is enabled, the cache will immediately get
+regenerated if _any_ involved template or config file is updated. This imposes
+a slight performance hit because it must check all the files for changes, so be
+sure to run live sites with caching enabled and compile_check disabled for best
+performance. If you update a template or config file, simply turn on
+compile_check, load the page, then turn it back off. This will update the cache
+file with the new content. This is accomplished by maintaining a list of
+included/loaded templates and config files at the beginning of the cache file.
+Therefore it is advisable to remove all cache files after upgrading to 1.4.6
+(although not absolutely necessary, old cache files will regenerate)
+
+The debug console now has script timing and array values printed. You MUST
+update your debug.tpl file with this version of Smarty. Also, the new debug.tpl
+will not work with older versions of Smarty.
+
+
+1.4.5
+-----
+
+Mostly bug fixes and minor improvements. Added compile id for separate compiled
+versions of the same script. The directory format and filename convention for
+the files in templates_c has changed, so you may want to remove all of the
+existing ones before you upgrade.
+
+
+1.4.4
+-----
+
+A few bug fixes, new section looping attributes and properties, debugging
+console function for control via URL, and overLib integration and access
+to request variables from within the template.
+
+
+1.4.3
+-----
+
+This release has a few bug fixes and several enhancements. Smarty now supports
+template security for third-party template editing. These features disallow the
+ability for someone to execute commands or PHP code from the template language.
+Smarty also now has a built-in debugging console, which is a javascript pop-up
+window that displays all the included template names and assigned variables.
+
+
+1.4.2
+-----
+
+This was mostly one bug fix with variable scoping within included templates
+and a few documentation changes and updates. See the ChangeLog file for full
+details.
+
+
+1.4.1
+-----
+
+It seems that the EX_LOCK logic from the previous release didn't fix all the
+problems with windows platforms. Hopefully this one does. It basically
+disables file locking on windows, so there is a potential that two programs
+could write over the same file at the same time, fyi.
+
+The reset is minor bug fixes, please refer to the ChangeLog file.
+
+
+1.4.0
+-----
+
+IMPORTANT NOTICE
+
+Smarty now has a new syntax for accessing elements within section loops. The
+new syntax is easier to use and nicely handles data structures of any
+complexity. Consequently, this breaks the old syntax.
+
+Here is an example of the syntax change:
+
+old syntax:
+{$sec1/sec2/sec3/customer.phone}
+
+new syntax:
+{$customer[$sec1][$sec2][$sec3].phone}
+
+The section names used to come first, followed by the variable name. Now the
+variable name always comes first, followed by the section names in brackets.
+You can access variable indexes anywhere, depending on how you passed the
+variables in.
+
+To fix your current templates, we have provided a script that will adjust the
+syntax for you. Located in misc/fix_vars.php, run this script from the the
+command line, giving each template as an argument. Be sure to use absolute
+pathnames, or pathnames relative to the executing script. Probably the easiest
+way to do this is to copy the fix_vars.php script into your template directory
+and run 'php -q fix_vars.php *.tpl' Be sure you have proper write permission,
+and backup your scripts first to be safe! The examples in the 1.4.0
+documentation have been updated to reflect the changes.
+
+cd /path/to/templates
+cp /path/to/fix_vars.php .
+find . -name "*.tpl" -exec php -q ./fix_vars.php {} \;
+
+NEW AND IMPROVED COMPILATION PROCESS
+
+Smarty 1.4.0 also has a new compilation process. Instead of compiling all the
+templates up front, it now compiles them at runtime. This has several
+advantages. First of all, there is no longer a need to have a single template
+directory. You can now have arbitrary template sources, such as multiple
+directories or even database calls. This also speeds the performance of Smarty
+when $compile_check is enabled, since it is only checking the template that is
+being executed instead of everything found in the template directory. The
+$tpl_file_ext is no longer needed, but kept for backward compatability.
+Templates can now be named anything you like with any extension.
+
+MINOR FIXES
+
+A workaround for LOCK_EX on Windows systems was added, and changed a couple of
+file permissions for better security on public servers.
+
+$show_info_header is now defaulted to false instead of true. This header causes
+problems when displaying content other than HTML, so now you must explicitly
+set this flag to true to show the header information (or change the default in
+your copy of Smarty.)
+
+Documentation is written in docbook format. I updated the docbook -> HTML
+generating software & style-sheets, and consequently the examples are no longer
+in a different background color. If anyone wants to contribute a better
+stylesheet or help with documentation, drop me a line. <monte at ohrt dot com>
+
+CHANGES/ENHANCEMENTS/UPDATES
+
+date_format, html_select_date and html_select_time used to require a unix
+timestamp as the format of the date passed into the template. Smarty is now a
+bit smarter at this. It will take a unix timestamp, a mysql timestamp, or any
+date string that is parsable by strtotime, such as 10/01/2001 or 2001-10-01,
+etc. Just give some formats a try and see what works.
+
+Smarty now has template prefilters, meaning that you can run your templates
+through custom functions before they are compiled. This is good for things like
+removing unwanted comments, keeping an eye on words or functionality people are
+putting in templates, translating XML -> HTML, etc. See the register_prefilter
+documentation for more info.
+
+Another addition are the so-called compiler functions. These are custom
+functions registered by the user that are executed at compilation time of the
+template. They can be used to inject PHP code or time-sensitive static content
+into the compiled template.
+
+The run-time custom functions are now passed the Smarty object as the second
+parameter. This can be used, for example, to assign or clear template variables
+from inside the custom function.
+
+clear_compile_dir() was added for clearing out compiled versions of your
+templates. Not something normally needed, but you may have a need for this if
+you have $compile_check set to false and you periodically update templates via
+some automated process. As of 1.4.0, uncompiled templates _always_ get
+compiled regardless of $compile_check setting, although they won't be checked
+for recompile if $compile_check is set to false.
+
+You can now refer to properties of objects assigned from PHP by using the '->'
+symbol and specifying the property name after it, e.g. $foo->bar.
+
+{php}{/php} tags were added to embed php into the templates. Not normally
+needed, but some circumstances may call for it. Check out the "componentized
+templates" tip in the documentation for an example.
+
+{capture}{/capture} and {counter} functions were added. See the documentation
+for a complete description and examples.
+
+UPGRADE NOTES
+
+The format of the files created in the $compile_dir are now a bit different.
+The compiled template filename is the template resource name url-encoded.
+Therefore, all compiled files are now in the top directory of $compile_dir.
+This was done to make way for arbitrary template resources. Each compiled
+template also has a header that states what template resource was used to
+create it. From a unix command prompt, you can use "head -2 *" to see the first
+two lines of each file.
+
+When upgrading to 1.4.0, you will want to clear out all your old files in the
+$compile_dir. If you have $compile_check set to false and the compiled template
+does not yet exist, it will compile it regardless of this setting. This way you
+can clear out the $compile_dir and not worry about setting $compile_check to
+true to get the inital compilation under way.
+
+
+1.3.2
+-----
+
+Smarty now has (an optional) header prepended to the output of the Smarty
+templates. This displays the Smarty version and the date/time when the page was
+generated. This is useful for debugging your cache routines, and purely
+informational so there is evidence that the page was generated by Smarty. Set
+$show_info_header to false to disable it.
+
+{config_load ...} performance was tuned by placing the loaded variables into a
+global array, so basically a config file is read from the file system and
+placed into a php array structure only once, no matter how many times it is
+called in any of the templates. The scope of the loaded variables has changed a
+bit as well. Variables loaded by config_load used to be treated as global
+variables, meaning that parent templates (templates that included the current
+template) could see them. Now the default behavior is such that loaded
+variables are only visible by the current template and child templates (all
+templates included after the {config_load ...} is called.) To mimic the
+original behavior, provide the attribute "global=yes" like so: {config_load
+file="mystuff.conf" global=yes}. Now when you load in mystuff.conf, the
+variables will be visible to parent templates (merged with any existing config
+variables.)
+
+A formatting attribute was added to the {math ...} function, adding the ability
+to control the format of the output. Use the same formatting syntax as the PHP
+function sprintf().
+
+{html_select_time ...} was added, a custom function that works much like
+{html_select_date ...} except it displays time elements instead of dates.
+
+A few custom modifiers were added: count_characters, count_words,
+count_sentences, count_paragraphs. All pretty self-explanatory.
+
+/* vim: set et: */
diff --git a/GPL_LIB/Smarty/TODO b/GPL_LIB/Smarty/TODO
new file mode 100644
index 0000000000000000000000000000000000000000..82b0a462c2235f51d3ba392d0dacac399acd8cbf
--- /dev/null
+++ b/GPL_LIB/Smarty/TODO
@@ -0,0 +1,10 @@
+* handle asp style tags in $php_handler
+* fix all E_NOTICE warnings
+* make simple math easier
+* caching all but parts of the template
+* change plugins so $smarty variable always comes first
+* get cache ttl with function call
+FIX: make inserts use normal functions before plugins
+UPD: change it so that if template comes from some resource,
+     that resource stays as the default, no need to specify it
+     in includes.
diff --git a/GPL_LIB/Smarty/demo/configs/test.conf b/GPL_LIB/Smarty/demo/configs/test.conf
new file mode 100644
index 0000000000000000000000000000000000000000..5eac748ec3359444ac287ddc6f152470203d0e9c
--- /dev/null
+++ b/GPL_LIB/Smarty/demo/configs/test.conf
@@ -0,0 +1,5 @@
+title = Welcome to Smarty!
+cutoff_size = 40
+
+[setup]
+bold = true
diff --git a/GPL_LIB/Smarty/demo/index.php b/GPL_LIB/Smarty/demo/index.php
new file mode 100644
index 0000000000000000000000000000000000000000..ac538d08c513266d640dca985d02322ca6cba658
--- /dev/null
+++ b/GPL_LIB/Smarty/demo/index.php
@@ -0,0 +1,25 @@
+<?php
+
+require '../libs/Smarty.class.php';
+
+$smarty = new Smarty;
+
+$smarty->compile_check = true;
+$smarty->debugging = true;
+
+$smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill");
+$smarty->assign("FirstName",array("John","Mary","James","Henry"));
+$smarty->assign("LastName",array("Doe","Smith","Johnson","Case"));
+$smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"),
+	  array("I", "J", "K", "L"), array("M", "N", "O", "P")));
+
+$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"),
+	  array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234")));
+
+$smarty->assign("option_values", array("NY","NE","KS","IA","OK","TX"));
+$smarty->assign("option_output", array("New York","Nebraska","Kansas","Iowa","Oklahoma","Texas"));
+$smarty->assign("option_selected", "NE");
+
+$smarty->display('index.tpl');
+
+?>
diff --git a/GPL_LIB/Smarty/demo/templates/footer.tpl b/GPL_LIB/Smarty/demo/templates/footer.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..e04310fdd2d58c69a390aef96e25821cf20ae5ee
--- /dev/null
+++ b/GPL_LIB/Smarty/demo/templates/footer.tpl
@@ -0,0 +1,2 @@
+</BODY>
+</HTML>
diff --git a/GPL_LIB/Smarty/demo/templates/header.tpl b/GPL_LIB/Smarty/demo/templates/header.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..af8f61381d4b42acdc9d1b1ef42bd3b6a3d128a7
--- /dev/null
+++ b/GPL_LIB/Smarty/demo/templates/header.tpl
@@ -0,0 +1,6 @@
+<HTML>
+<HEAD>
+{popup_init src="/javascripts/overlib.js"}
+<TITLE>{$title} - {$Name}</TITLE>
+</HEAD>
+<BODY bgcolor="#ffffff">
diff --git a/GPL_LIB/Smarty/demo/templates/index.tpl b/GPL_LIB/Smarty/demo/templates/index.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..f274cc5e1b253dd194e8c55666b1bf7a27bf1f1a
--- /dev/null
+++ b/GPL_LIB/Smarty/demo/templates/index.tpl
@@ -0,0 +1,81 @@
+{config_load file=test.conf section="setup"}
+{include file="header.tpl" title=foo}
+
+<PRE>
+
+{* bold and title are read from the config file *}
+{if #bold#}<b>{/if}
+{* capitalize the first letters of each word of the title *}
+Title: {#title#|capitalize}
+{if #bold#}</b>{/if}
+
+The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
+
+The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}
+
+Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}
+
+The value of {ldelim}$Name{rdelim} is <b>{$Name}</b>
+
+variable modifier example of {ldelim}$Name|upper{rdelim}
+
+<b>{$Name|upper}</b>
+
+
+An example of a section loop:
+
+{section name=outer loop=$FirstName}
+{if $smarty.section.outer.index is odd by 2}
+	{$smarty.section.outer.rownum} . {$FirstName[outer]} {$LastName[outer]}
+{else}
+	{$smarty.section.outer.rownum} * {$FirstName[outer]} {$LastName[outer]}
+{/if}
+{sectionelse}
+	none
+{/section}
+
+An example of section looped key values:
+
+{section name=sec1 loop=$contacts}
+	phone: {$contacts[sec1].phone}<br>
+	fax: {$contacts[sec1].fax}<br>
+	cell: {$contacts[sec1].cell}<br>
+{/section}
+<p>
+
+testing strip tags
+{strip}
+<table border=0>
+	<tr>
+		<td>
+			<A HREF="{$SCRIPT_NAME}">
+			<font color="red">This is a  test     </font>
+			</A>
+		</td>
+	</tr>
+</table>
+{/strip}
+
+</PRE>
+
+This is an example of the html_select_date function:
+
+<form>
+{html_select_date start_year=1998 end_year=2010}
+</form>
+
+This is an example of the html_select_time function:
+
+<form>
+{html_select_time use_24_hours=false}
+</form>
+
+This is an example of the html_options function:
+
+<form>
+<select name=states>
+{html_options values=$option_values selected=$option_selected output=$option_output}
+</select>
+</form>
+
+{include file="footer.tpl"}
diff --git a/GPL_LIB/Smarty/libs/Config_File.class.php b/GPL_LIB/Smarty/libs/Config_File.class.php
new file mode 100644
index 0000000000000000000000000000000000000000..d415b3c2e4bd623861bf2861327ec5614cd55451
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/Config_File.class.php
@@ -0,0 +1,389 @@
+<?php
+
+/**
+ * Config_File class.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * @link http://smarty.php.net/
+ * @version 2.6.12
+ * @copyright Copyright: 2001-2005 New Digital Group, Inc.
+ * @author Andrei Zmievski <andrei@php.net>
+ * @access public
+ * @package Smarty
+ */
+
+/* $Id: Config_File.class.php,v 1.83 2005/12/14 14:53:55 mohrt Exp $ */
+
+/**
+ * Config file reading class
+ * @package Smarty
+ */
+class Config_File {
+    /**#@+
+     * Options
+     * @var boolean
+     */
+    /**
+     * Controls whether variables with the same name overwrite each other.
+     */
+    var $overwrite        =    true;
+
+    /**
+     * Controls whether config values of on/true/yes and off/false/no get
+     * converted to boolean values automatically.
+     */
+    var $booleanize        =    true;
+
+    /**
+     * Controls whether hidden config sections/vars are read from the file.
+     */
+    var $read_hidden     =    true;
+
+    /**
+     * Controls whether or not to fix mac or dos formatted newlines.
+     * If set to true, \r or \r\n will be changed to \n.
+     */
+    var $fix_newlines =    true;
+    /**#@-*/
+
+    /** @access private */
+    var $_config_path    = "";
+    var $_config_data    = array();
+    /**#@-*/
+
+    /**
+     * Constructs a new config file class.
+     *
+     * @param string $config_path (optional) path to the config files
+     */
+    function Config_File($config_path = NULL)
+    {
+        if (isset($config_path))
+            $this->set_path($config_path);
+    }
+
+
+    /**
+     * Set the path where configuration files can be found.
+     *
+     * @param string $config_path path to the config files
+     */
+    function set_path($config_path)
+    {
+        if (!empty($config_path)) {
+            if (!is_string($config_path) || !file_exists($config_path) || !is_dir($config_path)) {
+                $this->_trigger_error_msg("Bad config file path '$config_path'");
+                return;
+            }
+            if(substr($config_path, -1) != DIRECTORY_SEPARATOR) {
+                $config_path .= DIRECTORY_SEPARATOR;
+            }
+
+            $this->_config_path = $config_path;
+        }
+    }
+
+
+    /**
+     * Retrieves config info based on the file, section, and variable name.
+     *
+     * @param string $file_name config file to get info for
+     * @param string $section_name (optional) section to get info for
+     * @param string $var_name (optional) variable to get info for
+     * @return string|array a value or array of values
+     */
+    function get($file_name, $section_name = NULL, $var_name = NULL)
+    {
+        if (empty($file_name)) {
+            $this->_trigger_error_msg('Empty config file name');
+            return;
+        } else {
+            $file_name = $this->_config_path . $file_name;
+            if (!isset($this->_config_data[$file_name]))
+                $this->load_file($file_name, false);
+        }
+
+        if (!empty($var_name)) {
+            if (empty($section_name)) {
+                return $this->_config_data[$file_name]["vars"][$var_name];
+            } else {
+                if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name]))
+                    return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name];
+                else
+                    return array();
+            }
+        } else {
+            if (empty($section_name)) {
+                return (array)$this->_config_data[$file_name]["vars"];
+            } else {
+                if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"]))
+                    return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"];
+                else
+                    return array();
+            }
+        }
+    }
+
+
+    /**
+     * Retrieves config info based on the key.
+     *
+     * @param $file_name string config key (filename/section/var)
+     * @return string|array same as get()
+     * @uses get() retrieves information from config file and returns it
+     */
+    function &get_key($config_key)
+    {
+        list($file_name, $section_name, $var_name) = explode('/', $config_key, 3);
+        $result = &$this->get($file_name, $section_name, $var_name);
+        return $result;
+    }
+
+    /**
+     * Get all loaded config file names.
+     *
+     * @return array an array of loaded config file names
+     */
+    function get_file_names()
+    {
+        return array_keys($this->_config_data);
+    }
+
+
+    /**
+     * Get all section names from a loaded file.
+     *
+     * @param string $file_name config file to get section names from
+     * @return array an array of section names from the specified file
+     */
+    function get_section_names($file_name)
+    {
+        $file_name = $this->_config_path . $file_name;
+        if (!isset($this->_config_data[$file_name])) {
+            $this->_trigger_error_msg("Unknown config file '$file_name'");
+            return;
+        }
+
+        return array_keys($this->_config_data[$file_name]["sections"]);
+    }
+
+
+    /**
+     * Get all global or section variable names.
+     *
+     * @param string $file_name config file to get info for
+     * @param string $section_name (optional) section to get info for
+     * @return array an array of variables names from the specified file/section
+     */
+    function get_var_names($file_name, $section = NULL)
+    {
+        if (empty($file_name)) {
+            $this->_trigger_error_msg('Empty config file name');
+            return;
+        } else if (!isset($this->_config_data[$file_name])) {
+            $this->_trigger_error_msg("Unknown config file '$file_name'");
+            return;
+        }
+
+        if (empty($section))
+            return array_keys($this->_config_data[$file_name]["vars"]);
+        else
+            return array_keys($this->_config_data[$file_name]["sections"][$section]["vars"]);
+    }
+
+
+    /**
+     * Clear loaded config data for a certain file or all files.
+     *
+     * @param string $file_name file to clear config data for
+     */
+    function clear($file_name = NULL)
+    {
+        if ($file_name === NULL)
+            $this->_config_data = array();
+        else if (isset($this->_config_data[$file_name]))
+            $this->_config_data[$file_name] = array();
+    }
+
+
+    /**
+     * Load a configuration file manually.
+     *
+     * @param string $file_name file name to load
+     * @param boolean $prepend_path whether current config path should be
+     *                              prepended to the filename
+     */
+    function load_file($file_name, $prepend_path = true)
+    {
+        if ($prepend_path && $this->_config_path != "")
+            $config_file = $this->_config_path . $file_name;
+        else
+            $config_file = $file_name;
+
+        ini_set('track_errors', true);
+        $fp = @fopen($config_file, "r");
+        if (!is_resource($fp)) {
+            $this->_trigger_error_msg("Could not open config file '$config_file'");
+            return false;
+        }
+
+        $contents = ($size = filesize($config_file)) ? fread($fp, $size) : '';
+        fclose($fp);
+
+        $this->_config_data[$config_file] = $this->parse_contents($contents);
+        return true;
+    }
+
+    /**
+     * Store the contents of a file manually.
+     *
+     * @param string $config_file file name of the related contents
+     * @param string $contents the file-contents to parse
+     */
+    function set_file_contents($config_file, $contents)
+    {
+        $this->_config_data[$config_file] = $this->parse_contents($contents);
+        return true;
+    }
+
+    /**
+     * parse the source of a configuration file manually.
+     *
+     * @param string $contents the file-contents to parse
+     */
+    function parse_contents($contents)
+    {
+        if($this->fix_newlines) {
+            // fix mac/dos formatted newlines
+            $contents = preg_replace('!\r\n?!', "\n", $contents);
+        }
+
+        $config_data = array();
+        $config_data['sections'] = array();
+        $config_data['vars'] = array();
+
+        /* reference to fill with data */
+        $vars =& $config_data['vars'];
+
+        /* parse file line by line */
+        preg_match_all('!^.*\r?\n?!m', $contents, $match);
+        $lines = $match[0];
+        for ($i=0, $count=count($lines); $i<$count; $i++) {
+            $line = $lines[$i];
+            if (empty($line)) continue;
+
+            if ( substr($line, 0, 1) == '[' && preg_match('!^\[(.*?)\]!', $line, $match) ) {
+                /* section found */
+                if (substr($match[1], 0, 1) == '.') {
+                    /* hidden section */
+                    if ($this->read_hidden) {
+                        $section_name = substr($match[1], 1);
+                    } else {
+                        /* break reference to $vars to ignore hidden section */
+                        unset($vars);
+                        $vars = array();
+                        continue;
+                    }
+                } else {                    
+                    $section_name = $match[1];
+                }
+                if (!isset($config_data['sections'][$section_name]))
+                    $config_data['sections'][$section_name] = array('vars' => array());
+                $vars =& $config_data['sections'][$section_name]['vars'];
+                continue;
+            }
+
+            if (preg_match('/^\s*(\.?\w+)\s*=\s*(.*)/s', $line, $match)) {
+                /* variable found */
+                $var_name = rtrim($match[1]);
+                if (strpos($match[2], '"""') === 0) {
+                    /* handle multiline-value */
+                    $lines[$i] = substr($match[2], 3);
+                    $var_value = '';
+                    while ($i<$count) {
+                        if (($pos = strpos($lines[$i], '"""')) === false) {
+                            $var_value .= $lines[$i++];
+                        } else {
+                            /* end of multiline-value */
+                            $var_value .= substr($lines[$i], 0, $pos);
+                            break;
+                        }
+                    }
+                    $booleanize = false;
+
+                } else {
+                    /* handle simple value */
+                    $var_value = preg_replace('/^([\'"])(.*)\1$/', '\2', rtrim($match[2]));
+                    $booleanize = $this->booleanize;
+
+                }
+                $this->_set_config_var($vars, $var_name, $var_value, $booleanize);
+            }
+            /* else unparsable line / means it is a comment / means ignore it */
+        }
+        return $config_data;
+    }
+
+    /**#@+ @access private */
+    /**
+     * @param array &$container
+     * @param string $var_name
+     * @param mixed $var_value
+     * @param boolean $booleanize determines whether $var_value is converted to
+     *                            to true/false
+     */
+    function _set_config_var(&$container, $var_name, $var_value, $booleanize)
+    {
+        if (substr($var_name, 0, 1) == '.') {
+            if (!$this->read_hidden)
+                return;
+            else
+                $var_name = substr($var_name, 1);
+        }
+
+        if (!preg_match("/^[a-zA-Z_]\w*$/", $var_name)) {
+            $this->_trigger_error_msg("Bad variable name '$var_name'");
+            return;
+        }
+
+        if ($booleanize) {
+            if (preg_match("/^(on|true|yes)$/i", $var_value))
+                $var_value = true;
+            else if (preg_match("/^(off|false|no)$/i", $var_value))
+                $var_value = false;
+        }
+
+        if (!isset($container[$var_name]) || $this->overwrite)
+            $container[$var_name] = $var_value;
+        else {
+            settype($container[$var_name], 'array');
+            $container[$var_name][] = $var_value;
+        }
+    }
+
+    /**
+     * @uses trigger_error() creates a PHP warning/error
+     * @param string $error_msg
+     * @param integer $error_type one of
+     */
+    function _trigger_error_msg($error_msg, $error_type = E_USER_WARNING)
+    {
+        trigger_error("Config_File error: $error_msg", $error_type);
+    }
+    /**#@-*/
+}
+
+?>
diff --git a/GPL_LIB/Smarty/libs/Smarty.class.php b/GPL_LIB/Smarty/libs/Smarty.class.php
new file mode 100644
index 0000000000000000000000000000000000000000..06a2e9527022cd2f9a37b45d8860525995837552
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/Smarty.class.php
@@ -0,0 +1,1944 @@
+<?php
+
+/**
+ * Project:     Smarty: the PHP compiling template engine
+ * File:        Smarty.class.php
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * For questions, help, comments, discussion, etc., please join the
+ * Smarty mailing list. Send a blank e-mail to
+ * smarty-general-subscribe@lists.php.net
+ *
+ * @link http://smarty.php.net/
+ * @copyright 2001-2005 New Digital Group, Inc.
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author Andrei Zmievski <andrei@php.net>
+ * @package Smarty
+ * @version 2.6.12
+ */
+
+/* $Id: Smarty.class.php,v 1.523 2005/12/31 19:17:04 messju Exp $ */
+
+/**
+ * DIR_SEP isn't used anymore, but third party apps might
+ */
+if(!defined('DIR_SEP')) {
+    define('DIR_SEP', DIRECTORY_SEPARATOR);
+}
+
+/**
+ * set SMARTY_DIR to absolute path to Smarty library files.
+ * if not defined, include_path will be used. Sets SMARTY_DIR only if user
+ * application has not already defined it.
+ */
+
+if (!defined('SMARTY_DIR')) {
+    define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+}
+
+if (!defined('SMARTY_CORE_DIR')) {
+    define('SMARTY_CORE_DIR', SMARTY_DIR . 'internals' . DIRECTORY_SEPARATOR);
+}
+
+define('SMARTY_PHP_PASSTHRU',   0);
+define('SMARTY_PHP_QUOTE',      1);
+define('SMARTY_PHP_REMOVE',     2);
+define('SMARTY_PHP_ALLOW',      3);
+
+/**
+ * @package Smarty
+ */
+class Smarty
+{
+    /**#@+
+     * Smarty Configuration Section
+     */
+
+    /**
+     * The name of the directory where templates are located.
+     *
+     * @var string
+     */
+    var $template_dir    =  'templates';
+
+    /**
+     * The directory where compiled templates are located.
+     *
+     * @var string
+     */
+    var $compile_dir     =  'templates_c';
+
+    /**
+     * The directory where config files are located.
+     *
+     * @var string
+     */
+    var $config_dir      =  'configs';
+
+    /**
+     * An array of directories searched for plugins.
+     *
+     * @var array
+     */
+    var $plugins_dir     =  array('plugins');
+
+    /**
+     * If debugging is enabled, a debug console window will display
+     * when the page loads (make sure your browser allows unrequested
+     * popup windows)
+     *
+     * @var boolean
+     */
+    var $debugging       =  false;
+
+    /**
+     * When set, smarty does uses this value as error_reporting-level.
+     *
+     * @var boolean
+     */
+    var $error_reporting  =  null;
+
+    /**
+     * This is the path to the debug console template. If not set,
+     * the default one will be used.
+     *
+     * @var string
+     */
+    var $debug_tpl       =  '';
+
+    /**
+     * This determines if debugging is enable-able from the browser.
+     * <ul>
+     *  <li>NONE => no debugging control allowed</li>
+     *  <li>URL => enable debugging when SMARTY_DEBUG is found in the URL.</li>
+     * </ul>
+     * @link http://www.foo.dom/index.php?SMARTY_DEBUG
+     * @var string
+     */
+    var $debugging_ctrl  =  'NONE';
+
+    /**
+     * This tells Smarty whether to check for recompiling or not. Recompiling
+     * does not need to happen unless a template or config file is changed.
+     * Typically you enable this during development, and disable for
+     * production.
+     *
+     * @var boolean
+     */
+    var $compile_check   =  true;
+
+    /**
+     * This forces templates to compile every time. Useful for development
+     * or debugging.
+     *
+     * @var boolean
+     */
+    var $force_compile   =  false;
+
+    /**
+     * This enables template caching.
+     * <ul>
+     *  <li>0 = no caching</li>
+     *  <li>1 = use class cache_lifetime value</li>
+     *  <li>2 = use cache_lifetime in cache file</li>
+     * </ul>
+     * @var integer
+     */
+    var $caching         =  0;
+
+    /**
+     * The name of the directory for cache files.
+     *
+     * @var string
+     */
+    var $cache_dir       =  'cache';
+
+    /**
+     * This is the number of seconds cached content will persist.
+     * <ul>
+     *  <li>0 = always regenerate cache</li>
+     *  <li>-1 = never expires</li>
+     * </ul>
+     *
+     * @var integer
+     */
+    var $cache_lifetime  =  3600;
+
+    /**
+     * Only used when $caching is enabled. If true, then If-Modified-Since headers
+     * are respected with cached content, and appropriate HTTP headers are sent.
+     * This way repeated hits to a cached page do not send the entire page to the
+     * client every time.
+     *
+     * @var boolean
+     */
+    var $cache_modified_check = false;
+
+    /**
+     * This determines how Smarty handles "<?php ... ?>" tags in templates.
+     * possible values:
+     * <ul>
+     *  <li>SMARTY_PHP_PASSTHRU -> print tags as plain text</li>
+     *  <li>SMARTY_PHP_QUOTE    -> escape tags as entities</li>
+     *  <li>SMARTY_PHP_REMOVE   -> remove php tags</li>
+     *  <li>SMARTY_PHP_ALLOW    -> execute php tags</li>
+     * </ul>
+     *
+     * @var integer
+     */
+    var $php_handling    =  SMARTY_PHP_PASSTHRU;
+
+    /**
+     * This enables template security. When enabled, many things are restricted
+     * in the templates that normally would go unchecked. This is useful when
+     * untrusted parties are editing templates and you want a reasonable level
+     * of security. (no direct execution of PHP in templates for example)
+     *
+     * @var boolean
+     */
+    var $security       =   false;
+
+    /**
+     * This is the list of template directories that are considered secure. This
+     * is used only if {@link $security} is enabled. One directory per array
+     * element.  {@link $template_dir} is in this list implicitly.
+     *
+     * @var array
+     */
+    var $secure_dir     =   array();
+
+    /**
+     * These are the security settings for Smarty. They are used only when
+     * {@link $security} is enabled.
+     *
+     * @var array
+     */
+    var $security_settings  = array(
+                                    'PHP_HANDLING'    => false,
+                                    'IF_FUNCS'        => array('array', 'list',
+                                                               'isset', 'empty',
+                                                               'count', 'sizeof',
+                                                               'in_array', 'is_array',
+                                                               'true', 'false', 'null'),
+                                    'INCLUDE_ANY'     => false,
+                                    'PHP_TAGS'        => false,
+                                    'MODIFIER_FUNCS'  => array('count'),
+                                    'ALLOW_CONSTANTS'  => false
+                                   );
+
+    /**
+     * This is an array of directories where trusted php scripts reside.
+     * {@link $security} is disabled during their inclusion/execution.
+     *
+     * @var array
+     */
+    var $trusted_dir        = array();
+
+    /**
+     * The left delimiter used for the template tags.
+     *
+     * @var string
+     */
+    var $left_delimiter  =  '{';
+
+    /**
+     * The right delimiter used for the template tags.
+     *
+     * @var string
+     */
+    var $right_delimiter =  '}';
+
+    /**
+     * The order in which request variables are registered, similar to
+     * variables_order in php.ini E = Environment, G = GET, P = POST,
+     * C = Cookies, S = Server
+     *
+     * @var string
+     */
+    var $request_vars_order    = 'EGPCS';
+
+    /**
+     * Indicates wether $HTTP_*_VARS[] (request_use_auto_globals=false)
+     * are uses as request-vars or $_*[]-vars. note: if
+     * request_use_auto_globals is true, then $request_vars_order has
+     * no effect, but the php-ini-value "gpc_order"
+     *
+     * @var boolean
+     */
+    var $request_use_auto_globals      = true;
+
+    /**
+     * Set this if you want different sets of compiled files for the same
+     * templates. This is useful for things like different languages.
+     * Instead of creating separate sets of templates per language, you
+     * set different compile_ids like 'en' and 'de'.
+     *
+     * @var string
+     */
+    var $compile_id            = null;
+
+    /**
+     * This tells Smarty whether or not to use sub dirs in the cache/ and
+     * templates_c/ directories. sub directories better organized, but
+     * may not work well with PHP safe mode enabled.
+     *
+     * @var boolean
+     *
+     */
+    var $use_sub_dirs          = false;
+
+    /**
+     * This is a list of the modifiers to apply to all template variables.
+     * Put each modifier in a separate array element in the order you want
+     * them applied. example: <code>array('escape:"htmlall"');</code>
+     *
+     * @var array
+     */
+    var $default_modifiers        = array();
+
+    /**
+     * This is the resource type to be used when not specified
+     * at the beginning of the resource path. examples:
+     * $smarty->display('file:index.tpl');
+     * $smarty->display('db:index.tpl');
+     * $smarty->display('index.tpl'); // will use default resource type
+     * {include file="file:index.tpl"}
+     * {include file="db:index.tpl"}
+     * {include file="index.tpl"} {* will use default resource type *}
+     *
+     * @var array
+     */
+    var $default_resource_type    = 'file';
+
+    /**
+     * The function used for cache file handling. If not set, built-in caching is used.
+     *
+     * @var null|string function name
+     */
+    var $cache_handler_func   = null;
+
+    /**
+     * This indicates which filters are automatically loaded into Smarty.
+     *
+     * @var array array of filter names
+     */
+    var $autoload_filters = array();
+
+    /**#@+
+     * @var boolean
+     */
+    /**
+     * This tells if config file vars of the same name overwrite each other or not.
+     * if disabled, same name variables are accumulated in an array.
+     */
+    var $config_overwrite = true;
+
+    /**
+     * This tells whether or not to automatically booleanize config file variables.
+     * If enabled, then the strings "on", "true", and "yes" are treated as boolean
+     * true, and "off", "false" and "no" are treated as boolean false.
+     */
+    var $config_booleanize = true;
+
+    /**
+     * This tells whether hidden sections [.foobar] are readable from the
+     * tempalates or not. Normally you would never allow this since that is
+     * the point behind hidden sections: the application can access them, but
+     * the templates cannot.
+     */
+    var $config_read_hidden = false;
+
+    /**
+     * This tells whether or not automatically fix newlines in config files.
+     * It basically converts \r (mac) or \r\n (dos) to \n
+     */
+    var $config_fix_newlines = true;
+    /**#@-*/
+
+    /**
+     * If a template cannot be found, this PHP function will be executed.
+     * Useful for creating templates on-the-fly or other special action.
+     *
+     * @var string function name
+     */
+    var $default_template_handler_func = '';
+
+    /**
+     * The file that contains the compiler class. This can a full
+     * pathname, or relative to the php_include path.
+     *
+     * @var string
+     */
+    var $compiler_file        =    'Smarty_Compiler.class.php';
+
+    /**
+     * The class used for compiling templates.
+     *
+     * @var string
+     */
+    var $compiler_class        =   'Smarty_Compiler';
+
+    /**
+     * The class used to load config vars.
+     *
+     * @var string
+     */
+    var $config_class          =   'Config_File';
+
+/**#@+
+ * END Smarty Configuration Section
+ * There should be no need to touch anything below this line.
+ * @access private
+ */
+    /**
+     * where assigned template vars are kept
+     *
+     * @var array
+     */
+    var $_tpl_vars             = array();
+
+    /**
+     * stores run-time $smarty.* vars
+     *
+     * @var null|array
+     */
+    var $_smarty_vars          = null;
+
+    /**
+     * keeps track of sections
+     *
+     * @var array
+     */
+    var $_sections             = array();
+
+    /**
+     * keeps track of foreach blocks
+     *
+     * @var array
+     */
+    var $_foreach              = array();
+
+    /**
+     * keeps track of tag hierarchy
+     *
+     * @var array
+     */
+    var $_tag_stack            = array();
+
+    /**
+     * configuration object
+     *
+     * @var Config_file
+     */
+    var $_conf_obj             = null;
+
+    /**
+     * loaded configuration settings
+     *
+     * @var array
+     */
+    var $_config               = array(array('vars'  => array(), 'files' => array()));
+
+    /**
+     * md5 checksum of the string 'Smarty'
+     *
+     * @var string
+     */
+    var $_smarty_md5           = 'f8d698aea36fcbead2b9d5359ffca76f';
+
+    /**
+     * Smarty version number
+     *
+     * @var string
+     */
+    var $_version              = '2.6.12';
+
+    /**
+     * current template inclusion depth
+     *
+     * @var integer
+     */
+    var $_inclusion_depth      = 0;
+
+    /**
+     * for different compiled templates
+     *
+     * @var string
+     */
+    var $_compile_id           = null;
+
+    /**
+     * text in URL to enable debug mode
+     *
+     * @var string
+     */
+    var $_smarty_debug_id      = 'SMARTY_DEBUG';
+
+    /**
+     * debugging information for debug console
+     *
+     * @var array
+     */
+    var $_smarty_debug_info    = array();
+
+    /**
+     * info that makes up a cache file
+     *
+     * @var array
+     */
+    var $_cache_info           = array();
+
+    /**
+     * default file permissions
+     *
+     * @var integer
+     */
+    var $_file_perms           = 0644;
+
+    /**
+     * default dir permissions
+     *
+     * @var integer
+     */
+    var $_dir_perms               = 0771;
+
+    /**
+     * registered objects
+     *
+     * @var array
+     */
+    var $_reg_objects           = array();
+
+    /**
+     * table keeping track of plugins
+     *
+     * @var array
+     */
+    var $_plugins              = array(
+                                       'modifier'      => array(),
+                                       'function'      => array(),
+                                       'block'         => array(),
+                                       'compiler'      => array(),
+                                       'prefilter'     => array(),
+                                       'postfilter'    => array(),
+                                       'outputfilter'  => array(),
+                                       'resource'      => array(),
+                                       'insert'        => array());
+
+
+    /**
+     * cache serials
+     *
+     * @var array
+     */
+    var $_cache_serials = array();
+
+    /**
+     * name of optional cache include file
+     *
+     * @var string
+     */
+    var $_cache_include = null;
+
+    /**
+     * indicate if the current code is used in a compiled
+     * include
+     *
+     * @var string
+     */
+    var $_cache_including = false;
+
+    /**#@-*/
+    /**
+     * The class constructor.
+     */
+    function Smarty()
+    {
+      $this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME']
+                    : @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']);
+    }
+
+    /**
+     * assigns values to template variables
+     *
+     * @param array|string $tpl_var the template variable name(s)
+     * @param mixed $value the value to assign
+     */
+    function assign($tpl_var, $value = null)
+    {
+        if (is_array($tpl_var)){
+            foreach ($tpl_var as $key => $val) {
+                if ($key != '') {
+                    $this->_tpl_vars[$key] = $val;
+                }
+            }
+        } else {
+            if ($tpl_var != '')
+                $this->_tpl_vars[$tpl_var] = $value;
+        }
+    }
+
+    /**
+     * assigns values to template variables by reference
+     *
+     * @param string $tpl_var the template variable name
+     * @param mixed $value the referenced value to assign
+     */
+    function assign_by_ref($tpl_var, &$value)
+    {
+        if ($tpl_var != '')
+            $this->_tpl_vars[$tpl_var] = &$value;
+    }
+
+    /**
+     * appends values to template variables
+     *
+     * @param array|string $tpl_var the template variable name(s)
+     * @param mixed $value the value to append
+     */
+    function append($tpl_var, $value=null, $merge=false)
+    {
+        if (is_array($tpl_var)) {
+            // $tpl_var is an array, ignore $value
+            foreach ($tpl_var as $_key => $_val) {
+                if ($_key != '') {
+                    if(!@is_array($this->_tpl_vars[$_key])) {
+                        settype($this->_tpl_vars[$_key],'array');
+                    }
+                    if($merge && is_array($_val)) {
+                        foreach($_val as $_mkey => $_mval) {
+                            $this->_tpl_vars[$_key][$_mkey] = $_mval;
+                        }
+                    } else {
+                        $this->_tpl_vars[$_key][] = $_val;
+                    }
+                }
+            }
+        } else {
+            if ($tpl_var != '' && isset($value)) {
+                if(!@is_array($this->_tpl_vars[$tpl_var])) {
+                    settype($this->_tpl_vars[$tpl_var],'array');
+                }
+                if($merge && is_array($value)) {
+                    foreach($value as $_mkey => $_mval) {
+                        $this->_tpl_vars[$tpl_var][$_mkey] = $_mval;
+                    }
+                } else {
+                    $this->_tpl_vars[$tpl_var][] = $value;
+                }
+            }
+        }
+    }
+
+    /**
+     * appends values to template variables by reference
+     *
+     * @param string $tpl_var the template variable name
+     * @param mixed $value the referenced value to append
+     */
+    function append_by_ref($tpl_var, &$value, $merge=false)
+    {
+        if ($tpl_var != '' && isset($value)) {
+            if(!@is_array($this->_tpl_vars[$tpl_var])) {
+             settype($this->_tpl_vars[$tpl_var],'array');
+            }
+            if ($merge && is_array($value)) {
+                foreach($value as $_key => $_val) {
+                    $this->_tpl_vars[$tpl_var][$_key] = &$value[$_key];
+                }
+            } else {
+                $this->_tpl_vars[$tpl_var][] = &$value;
+            }
+        }
+    }
+
+
+    /**
+     * clear the given assigned template variable.
+     *
+     * @param string $tpl_var the template variable to clear
+     */
+    function clear_assign($tpl_var)
+    {
+        if (is_array($tpl_var))
+            foreach ($tpl_var as $curr_var)
+                unset($this->_tpl_vars[$curr_var]);
+        else
+            unset($this->_tpl_vars[$tpl_var]);
+    }
+
+
+    /**
+     * Registers custom function to be used in templates
+     *
+     * @param string $function the name of the template function
+     * @param string $function_impl the name of the PHP function to register
+     */
+    function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null)
+    {
+        $this->_plugins['function'][$function] =
+            array($function_impl, null, null, false, $cacheable, $cache_attrs);
+
+    }
+
+    /**
+     * Unregisters custom function
+     *
+     * @param string $function name of template function
+     */
+    function unregister_function($function)
+    {
+        unset($this->_plugins['function'][$function]);
+    }
+
+    /**
+     * Registers object to be used in templates
+     *
+     * @param string $object name of template object
+     * @param object &$object_impl the referenced PHP object to register
+     * @param null|array $allowed list of allowed methods (empty = all)
+     * @param boolean $smarty_args smarty argument format, else traditional
+     * @param null|array $block_functs list of methods that are block format
+     */
+    function register_object($object, &$object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
+    {
+        settype($allowed, 'array');
+        settype($smarty_args, 'boolean');
+        $this->_reg_objects[$object] =
+            array(&$object_impl, $allowed, $smarty_args, $block_methods);
+    }
+
+    /**
+     * Unregisters object
+     *
+     * @param string $object name of template object
+     */
+    function unregister_object($object)
+    {
+        unset($this->_reg_objects[$object]);
+    }
+
+
+    /**
+     * Registers block function to be used in templates
+     *
+     * @param string $block name of template block
+     * @param string $block_impl PHP function to register
+     */
+    function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null)
+    {
+        $this->_plugins['block'][$block] =
+            array($block_impl, null, null, false, $cacheable, $cache_attrs);
+    }
+
+    /**
+     * Unregisters block function
+     *
+     * @param string $block name of template function
+     */
+    function unregister_block($block)
+    {
+        unset($this->_plugins['block'][$block]);
+    }
+
+    /**
+     * Registers compiler function
+     *
+     * @param string $function name of template function
+     * @param string $function_impl name of PHP function to register
+     */
+    function register_compiler_function($function, $function_impl, $cacheable=true)
+    {
+        $this->_plugins['compiler'][$function] =
+            array($function_impl, null, null, false, $cacheable);
+    }
+
+    /**
+     * Unregisters compiler function
+     *
+     * @param string $function name of template function
+     */
+    function unregister_compiler_function($function)
+    {
+        unset($this->_plugins['compiler'][$function]);
+    }
+
+    /**
+     * Registers modifier to be used in templates
+     *
+     * @param string $modifier name of template modifier
+     * @param string $modifier_impl name of PHP function to register
+     */
+    function register_modifier($modifier, $modifier_impl)
+    {
+        $this->_plugins['modifier'][$modifier] =
+            array($modifier_impl, null, null, false);
+    }
+
+    /**
+     * Unregisters modifier
+     *
+     * @param string $modifier name of template modifier
+     */
+    function unregister_modifier($modifier)
+    {
+        unset($this->_plugins['modifier'][$modifier]);
+    }
+
+    /**
+     * Registers a resource to fetch a template
+     *
+     * @param string $type name of resource
+     * @param array $functions array of functions to handle resource
+     */
+    function register_resource($type, $functions)
+    {
+        if (count($functions)==4) {
+            $this->_plugins['resource'][$type] =
+                array($functions, false);
+
+        } elseif (count($functions)==5) {
+            $this->_plugins['resource'][$type] =
+                array(array(array(&$functions[0], $functions[1])
+                            ,array(&$functions[0], $functions[2])
+                            ,array(&$functions[0], $functions[3])
+                            ,array(&$functions[0], $functions[4]))
+                      ,false);
+
+        } else {
+            $this->trigger_error("malformed function-list for '$type' in register_resource");
+
+        }
+    }
+
+    /**
+     * Unregisters a resource
+     *
+     * @param string $type name of resource
+     */
+    function unregister_resource($type)
+    {
+        unset($this->_plugins['resource'][$type]);
+    }
+
+    /**
+     * Registers a prefilter function to apply
+     * to a template before compiling
+     *
+     * @param string $function name of PHP function to register
+     */
+    function register_prefilter($function)
+    {
+    $_name = (is_array($function)) ? $function[1] : $function;
+        $this->_plugins['prefilter'][$_name]
+            = array($function, null, null, false);
+    }
+
+    /**
+     * Unregisters a prefilter function
+     *
+     * @param string $function name of PHP function
+     */
+    function unregister_prefilter($function)
+    {
+        unset($this->_plugins['prefilter'][$function]);
+    }
+
+    /**
+     * Registers a postfilter function to apply
+     * to a compiled template after compilation
+     *
+     * @param string $function name of PHP function to register
+     */
+    function register_postfilter($function)
+    {
+    $_name = (is_array($function)) ? $function[1] : $function;
+        $this->_plugins['postfilter'][$_name]
+            = array($function, null, null, false);
+    }
+
+    /**
+     * Unregisters a postfilter function
+     *
+     * @param string $function name of PHP function
+     */
+    function unregister_postfilter($function)
+    {
+        unset($this->_plugins['postfilter'][$function]);
+    }
+
+    /**
+     * Registers an output filter function to apply
+     * to a template output
+     *
+     * @param string $function name of PHP function
+     */
+    function register_outputfilter($function)
+    {
+    $_name = (is_array($function)) ? $function[1] : $function;
+        $this->_plugins['outputfilter'][$_name]
+            = array($function, null, null, false);
+    }
+
+    /**
+     * Unregisters an outputfilter function
+     *
+     * @param string $function name of PHP function
+     */
+    function unregister_outputfilter($function)
+    {
+        unset($this->_plugins['outputfilter'][$function]);
+    }
+
+    /**
+     * load a filter of specified type and name
+     *
+     * @param string $type filter type
+     * @param string $name filter name
+     */
+    function load_filter($type, $name)
+    {
+        switch ($type) {
+            case 'output':
+                $_params = array('plugins' => array(array($type . 'filter', $name, null, null, false)));
+                require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
+                smarty_core_load_plugins($_params, $this);
+                break;
+
+            case 'pre':
+            case 'post':
+                if (!isset($this->_plugins[$type . 'filter'][$name]))
+                    $this->_plugins[$type . 'filter'][$name] = false;
+                break;
+        }
+    }
+
+    /**
+     * clear cached content for the given template and cache id
+     *
+     * @param string $tpl_file name of template file
+     * @param string $cache_id name of cache_id
+     * @param string $compile_id name of compile_id
+     * @param string $exp_time expiration time
+     * @return boolean
+     */
+    function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)
+    {
+
+        if (!isset($compile_id))
+            $compile_id = $this->compile_id;
+
+        if (!isset($tpl_file))
+            $compile_id = null;
+
+        $_auto_id = $this->_get_auto_id($cache_id, $compile_id);
+
+        if (!empty($this->cache_handler_func)) {
+            return call_user_func_array($this->cache_handler_func,
+                                  array('clear', &$this, &$dummy, $tpl_file, $cache_id, $compile_id, $exp_time));
+        } else {
+            $_params = array('auto_base' => $this->cache_dir,
+                            'auto_source' => $tpl_file,
+                            'auto_id' => $_auto_id,
+                            'exp_time' => $exp_time);
+            require_once(SMARTY_CORE_DIR . 'core.rm_auto.php');
+            return smarty_core_rm_auto($_params, $this);
+        }
+
+    }
+
+
+    /**
+     * clear the entire contents of cache (all templates)
+     *
+     * @param string $exp_time expire time
+     * @return boolean results of {@link smarty_core_rm_auto()}
+     */
+    function clear_all_cache($exp_time = null)
+    {
+        return $this->clear_cache(null, null, null, $exp_time);
+    }
+
+
+    /**
+     * test to see if valid cache exists for this template
+     *
+     * @param string $tpl_file name of template file
+     * @param string $cache_id
+     * @param string $compile_id
+     * @return string|false results of {@link _read_cache_file()}
+     */
+    function is_cached($tpl_file, $cache_id = null, $compile_id = null)
+    {
+        if (!$this->caching)
+            return false;
+
+        if (!isset($compile_id))
+            $compile_id = $this->compile_id;
+
+        $_params = array(
+            'tpl_file' => $tpl_file,
+            'cache_id' => $cache_id,
+            'compile_id' => $compile_id
+        );
+        require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
+        return smarty_core_read_cache_file($_params, $this);
+    }
+
+
+    /**
+     * clear all the assigned template variables.
+     *
+     */
+    function clear_all_assign()
+    {
+        $this->_tpl_vars = array();
+    }
+
+    /**
+     * clears compiled version of specified template resource,
+     * or all compiled template files if one is not specified.
+     * This function is for advanced use only, not normally needed.
+     *
+     * @param string $tpl_file
+     * @param string $compile_id
+     * @param string $exp_time
+     * @return boolean results of {@link smarty_core_rm_auto()}
+     */
+    function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)
+    {
+        if (!isset($compile_id)) {
+            $compile_id = $this->compile_id;
+        }
+        $_params = array('auto_base' => $this->compile_dir,
+                        'auto_source' => $tpl_file,
+                        'auto_id' => $compile_id,
+                        'exp_time' => $exp_time,
+                        'extensions' => array('.inc', '.php'));
+        require_once(SMARTY_CORE_DIR . 'core.rm_auto.php');
+        return smarty_core_rm_auto($_params, $this);
+    }
+
+    /**
+     * Checks whether requested template exists.
+     *
+     * @param string $tpl_file
+     * @return boolean
+     */
+    function template_exists($tpl_file)
+    {
+        $_params = array('resource_name' => $tpl_file, 'quiet'=>true, 'get_source'=>false);
+        return $this->_fetch_resource_info($_params);
+    }
+
+    /**
+     * Returns an array containing template variables
+     *
+     * @param string $name
+     * @param string $type
+     * @return array
+     */
+    function &get_template_vars($name=null)
+    {
+        if(!isset($name)) {
+            return $this->_tpl_vars;
+        } elseif(isset($this->_tpl_vars[$name])) {
+            return $this->_tpl_vars[$name];
+        } else {
+            // var non-existant, return valid reference
+            $_tmp = null;
+            return $_tmp;   
+        }
+    }
+
+    /**
+     * Returns an array containing config variables
+     *
+     * @param string $name
+     * @param string $type
+     * @return array
+     */
+    function &get_config_vars($name=null)
+    {
+        if(!isset($name) && is_array($this->_config[0])) {
+            return $this->_config[0]['vars'];
+        } else if(isset($this->_config[0]['vars'][$name])) {
+            return $this->_config[0]['vars'][$name];
+        } else {
+            // var non-existant, return valid reference
+            $_tmp = null;
+            return $_tmp;
+        }
+    }
+
+    /**
+     * trigger Smarty error
+     *
+     * @param string $error_msg
+     * @param integer $error_type
+     */
+    function trigger_error($error_msg, $error_type = E_USER_WARNING)
+    {
+        trigger_error("Smarty error: $error_msg", $error_type);
+    }
+
+
+    /**
+     * executes & displays the template results
+     *
+     * @param string $resource_name
+     * @param string $cache_id
+     * @param string $compile_id
+     */
+    function display($resource_name, $cache_id = null, $compile_id = null)
+    {
+        $this->fetch($resource_name, $cache_id, $compile_id, true);
+    }
+
+    /**
+     * executes & returns or displays the template results
+     *
+     * @param string $resource_name
+     * @param string $cache_id
+     * @param string $compile_id
+     * @param boolean $display
+     */
+    function fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)
+    {
+        static $_cache_info = array();
+        
+        $_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(isset($this->error_reporting)
+               ? $this->error_reporting : error_reporting() & ~E_NOTICE);
+
+        if (!$this->debugging && $this->debugging_ctrl == 'URL') {
+            $_query_string = $this->request_use_auto_globals ? $_SERVER['QUERY_STRING'] : $GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING'];
+            if (@strstr($_query_string, $this->_smarty_debug_id)) {
+                if (@strstr($_query_string, $this->_smarty_debug_id . '=on')) {
+                    // enable debugging for this browser session
+                    @setcookie('SMARTY_DEBUG', true);
+                    $this->debugging = true;
+                } elseif (@strstr($_query_string, $this->_smarty_debug_id . '=off')) {
+                    // disable debugging for this browser session
+                    @setcookie('SMARTY_DEBUG', false);
+                    $this->debugging = false;
+                } else {
+                    // enable debugging for this page
+                    $this->debugging = true;
+                }
+            } else {
+                $this->debugging = (bool)($this->request_use_auto_globals ? @$_COOKIE['SMARTY_DEBUG'] : @$GLOBALS['HTTP_COOKIE_VARS']['SMARTY_DEBUG']);
+            }
+        }
+
+        if ($this->debugging) {
+            // capture time for debugging info
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $_debug_start_time = smarty_core_get_microtime($_params, $this);
+            $this->_smarty_debug_info[] = array('type'      => 'template',
+                                                'filename'  => $resource_name,
+                                                'depth'     => 0);
+            $_included_tpls_idx = count($this->_smarty_debug_info) - 1;
+        }
+
+        if (!isset($compile_id)) {
+            $compile_id = $this->compile_id;
+        }
+
+        $this->_compile_id = $compile_id;
+        $this->_inclusion_depth = 0;
+
+        if ($this->caching) {
+            // save old cache_info, initialize cache_info
+            array_push($_cache_info, $this->_cache_info);
+            $this->_cache_info = array();
+            $_params = array(
+                'tpl_file' => $resource_name,
+                'cache_id' => $cache_id,
+                'compile_id' => $compile_id,
+                'results' => null
+            );
+            require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
+            if (smarty_core_read_cache_file($_params, $this)) {
+                $_smarty_results = $_params['results'];
+                if (!empty($this->_cache_info['insert_tags'])) {
+                    $_params = array('plugins' => $this->_cache_info['insert_tags']);
+                    require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
+                    smarty_core_load_plugins($_params, $this);
+                    $_params = array('results' => $_smarty_results);
+                    require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php');
+                    $_smarty_results = smarty_core_process_cached_inserts($_params, $this);
+                }
+                if (!empty($this->_cache_info['cache_serials'])) {
+                    $_params = array('results' => $_smarty_results);
+                    require_once(SMARTY_CORE_DIR . 'core.process_compiled_include.php');
+                    $_smarty_results = smarty_core_process_compiled_include($_params, $this);
+                }
+
+
+                if ($display) {
+                    if ($this->debugging)
+                    {
+                        // capture time for debugging info
+                        $_params = array();
+                        require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+                        $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $_debug_start_time;
+                        require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
+                        $_smarty_results .= smarty_core_display_debug_console($_params, $this);
+                    }
+                    if ($this->cache_modified_check) {
+                        $_server_vars = ($this->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
+                        $_last_modified_date = @substr($_server_vars['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_server_vars['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3);
+                        $_gmt_mtime = gmdate('D, d M Y H:i:s', $this->_cache_info['timestamp']).' GMT';
+                        if (@count($this->_cache_info['insert_tags']) == 0
+                            && !$this->_cache_serials
+                            && $_gmt_mtime == $_last_modified_date) {
+                            if (php_sapi_name()=='cgi')
+                                header('Status: 304 Not Modified');
+                            else
+                                header('HTTP/1.1 304 Not Modified');
+
+                        } else {
+                            header('Last-Modified: '.$_gmt_mtime);
+                            echo $_smarty_results;
+                        }
+                    } else {
+                            echo $_smarty_results;
+                    }
+                    error_reporting($_smarty_old_error_level);
+                    // restore initial cache_info
+                    $this->_cache_info = array_pop($_cache_info);
+                    return true;
+                } else {
+                    error_reporting($_smarty_old_error_level);
+                    // restore initial cache_info
+                    $this->_cache_info = array_pop($_cache_info);
+                    return $_smarty_results;
+                }
+            } else {
+                $this->_cache_info['template'][$resource_name] = true;
+                if ($this->cache_modified_check && $display) {
+                    header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT');
+                }
+            }
+        }
+
+        // load filters that are marked as autoload
+        if (count($this->autoload_filters)) {
+            foreach ($this->autoload_filters as $_filter_type => $_filters) {
+                foreach ($_filters as $_filter) {
+                    $this->load_filter($_filter_type, $_filter);
+                }
+            }
+        }
+
+        $_smarty_compile_path = $this->_get_compile_path($resource_name);
+
+        // if we just need to display the results, don't perform output
+        // buffering - for speed
+        $_cache_including = $this->_cache_including;
+        $this->_cache_including = false;
+        if ($display && !$this->caching && count($this->_plugins['outputfilter']) == 0) {
+            if ($this->_is_compiled($resource_name, $_smarty_compile_path)
+                    || $this->_compile_resource($resource_name, $_smarty_compile_path))
+            {
+                include($_smarty_compile_path);
+            }
+        } else {
+            ob_start();
+            if ($this->_is_compiled($resource_name, $_smarty_compile_path)
+                    || $this->_compile_resource($resource_name, $_smarty_compile_path))
+            {
+                include($_smarty_compile_path);
+            }
+            $_smarty_results = ob_get_contents();
+            ob_end_clean();
+
+            foreach ((array)$this->_plugins['outputfilter'] as $_output_filter) {
+                $_smarty_results = call_user_func_array($_output_filter[0], array($_smarty_results, &$this));
+            }
+        }
+
+        if ($this->caching) {
+            $_params = array('tpl_file' => $resource_name,
+                        'cache_id' => $cache_id,
+                        'compile_id' => $compile_id,
+                        'results' => $_smarty_results);
+            require_once(SMARTY_CORE_DIR . 'core.write_cache_file.php');
+            smarty_core_write_cache_file($_params, $this);
+            require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php');
+            $_smarty_results = smarty_core_process_cached_inserts($_params, $this);
+
+            if ($this->_cache_serials) {
+                // strip nocache-tags from output
+                $_smarty_results = preg_replace('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!s'
+                                                ,''
+                                                ,$_smarty_results);
+            }
+            // restore initial cache_info
+            $this->_cache_info = array_pop($_cache_info);
+        }
+        $this->_cache_including = $_cache_including;
+
+        if ($display) {
+            if (isset($_smarty_results)) { echo $_smarty_results; }
+            if ($this->debugging) {
+                // capture time for debugging info
+                $_params = array();
+                require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+                $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = (smarty_core_get_microtime($_params, $this) - $_debug_start_time);
+                require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
+                echo smarty_core_display_debug_console($_params, $this);
+            }
+            error_reporting($_smarty_old_error_level);
+            return;
+        } else {
+            error_reporting($_smarty_old_error_level);
+            if (isset($_smarty_results)) { return $_smarty_results; }
+        }
+    }
+
+    /**
+     * load configuration values
+     *
+     * @param string $file
+     * @param string $section
+     * @param string $scope
+     */
+    function config_load($file, $section = null, $scope = 'global')
+    {
+        require_once($this->_get_plugin_filepath('function', 'config_load'));
+        smarty_function_config_load(array('file' => $file, 'section' => $section, 'scope' => $scope), $this);
+    }
+
+    /**
+     * return a reference to a registered object
+     *
+     * @param string $name
+     * @return object
+     */
+    function &get_registered_object($name) {
+        if (!isset($this->_reg_objects[$name]))
+        $this->_trigger_fatal_error("'$name' is not a registered object");
+
+        if (!is_object($this->_reg_objects[$name][0]))
+        $this->_trigger_fatal_error("registered '$name' is not an object");
+
+        return $this->_reg_objects[$name][0];
+    }
+
+    /**
+     * clear configuration values
+     *
+     * @param string $var
+     */
+    function clear_config($var = null)
+    {
+        if(!isset($var)) {
+            // clear all values
+            $this->_config = array(array('vars'  => array(),
+                                         'files' => array()));
+        } else {
+            unset($this->_config[0]['vars'][$var]);
+        }
+    }
+
+    /**
+     * get filepath of requested plugin
+     *
+     * @param string $type
+     * @param string $name
+     * @return string|false
+     */
+    function _get_plugin_filepath($type, $name)
+    {
+        $_params = array('type' => $type, 'name' => $name);
+        require_once(SMARTY_CORE_DIR . 'core.assemble_plugin_filepath.php');
+        return smarty_core_assemble_plugin_filepath($_params, $this);
+    }
+
+   /**
+     * test if resource needs compiling
+     *
+     * @param string $resource_name
+     * @param string $compile_path
+     * @return boolean
+     */
+    function _is_compiled($resource_name, $compile_path)
+    {
+        if (!$this->force_compile && file_exists($compile_path)) {
+            if (!$this->compile_check) {
+                // no need to check compiled file
+                return true;
+            } else {
+                // get file source and timestamp
+                $_params = array('resource_name' => $resource_name, 'get_source'=>false);
+                if (!$this->_fetch_resource_info($_params)) {
+                    return false;
+                }
+                if ($_params['resource_timestamp'] <= filemtime($compile_path)) {
+                    // template not expired, no recompile
+                    return true;
+                } else {
+                    // compile template
+                    return false;
+                }
+            }
+        } else {
+            // compiled template does not exist, or forced compile
+            return false;
+        }
+    }
+
+   /**
+     * compile the template
+     *
+     * @param string $resource_name
+     * @param string $compile_path
+     * @return boolean
+     */
+    function _compile_resource($resource_name, $compile_path)
+    {
+
+        $_params = array('resource_name' => $resource_name);
+        if (!$this->_fetch_resource_info($_params)) {
+            return false;
+        }
+
+        $_source_content = $_params['source_content'];
+        $_cache_include    = substr($compile_path, 0, -4).'.inc';
+
+        if ($this->_compile_source($resource_name, $_source_content, $_compiled_content, $_cache_include)) {
+            // if a _cache_serial was set, we also have to write an include-file:
+            if ($this->_cache_include_info) {
+                require_once(SMARTY_CORE_DIR . 'core.write_compiled_include.php');
+                smarty_core_write_compiled_include(array_merge($this->_cache_include_info, array('compiled_content'=>$_compiled_content, 'resource_name'=>$resource_name)),  $this);
+            }
+
+            $_params = array('compile_path'=>$compile_path, 'compiled_content' => $_compiled_content);
+            require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php');
+            smarty_core_write_compiled_resource($_params, $this);
+
+            return true;
+        } else {
+            return false;
+        }
+
+    }
+
+   /**
+     * compile the given source
+     *
+     * @param string $resource_name
+     * @param string $source_content
+     * @param string $compiled_content
+     * @return boolean
+     */
+    function _compile_source($resource_name, &$source_content, &$compiled_content, $cache_include_path=null)
+    {
+        if (file_exists(SMARTY_DIR . $this->compiler_file)) {
+            require_once(SMARTY_DIR . $this->compiler_file);
+        } else {
+            // use include_path
+            require_once($this->compiler_file);
+        }
+
+
+        $smarty_compiler = new $this->compiler_class;
+
+        $smarty_compiler->template_dir      = $this->template_dir;
+        $smarty_compiler->compile_dir       = $this->compile_dir;
+        $smarty_compiler->plugins_dir       = $this->plugins_dir;
+        $smarty_compiler->config_dir        = $this->config_dir;
+        $smarty_compiler->force_compile     = $this->force_compile;
+        $smarty_compiler->caching           = $this->caching;
+        $smarty_compiler->php_handling      = $this->php_handling;
+        $smarty_compiler->left_delimiter    = $this->left_delimiter;
+        $smarty_compiler->right_delimiter   = $this->right_delimiter;
+        $smarty_compiler->_version          = $this->_version;
+        $smarty_compiler->security          = $this->security;
+        $smarty_compiler->secure_dir        = $this->secure_dir;
+        $smarty_compiler->security_settings = $this->security_settings;
+        $smarty_compiler->trusted_dir       = $this->trusted_dir;
+        $smarty_compiler->use_sub_dirs      = $this->use_sub_dirs;
+        $smarty_compiler->_reg_objects      = &$this->_reg_objects;
+        $smarty_compiler->_plugins          = &$this->_plugins;
+        $smarty_compiler->_tpl_vars         = &$this->_tpl_vars;
+        $smarty_compiler->default_modifiers = $this->default_modifiers;
+        $smarty_compiler->compile_id        = $this->_compile_id;
+        $smarty_compiler->_config            = $this->_config;
+        $smarty_compiler->request_use_auto_globals  = $this->request_use_auto_globals;
+
+        if (isset($cache_include_path) && isset($this->_cache_serials[$cache_include_path])) {
+            $smarty_compiler->_cache_serial = $this->_cache_serials[$cache_include_path];
+        }
+        $smarty_compiler->_cache_include = $cache_include_path;
+
+
+        $_results = $smarty_compiler->_compile_file($resource_name, $source_content, $compiled_content);
+
+        if ($smarty_compiler->_cache_serial) {
+            $this->_cache_include_info = array(
+                'cache_serial'=>$smarty_compiler->_cache_serial
+                ,'plugins_code'=>$smarty_compiler->_plugins_code
+                ,'include_file_path' => $cache_include_path);
+
+        } else {
+            $this->_cache_include_info = null;
+
+        }
+
+        return $_results;
+    }
+
+    /**
+     * Get the compile path for this resource
+     *
+     * @param string $resource_name
+     * @return string results of {@link _get_auto_filename()}
+     */
+    function _get_compile_path($resource_name)
+    {
+        return $this->_get_auto_filename($this->compile_dir, $resource_name,
+                                         $this->_compile_id) . '.php';
+    }
+
+    /**
+     * fetch the template info. Gets timestamp, and source
+     * if get_source is true
+     *
+     * sets $source_content to the source of the template, and
+     * $resource_timestamp to its time stamp
+     * @param string $resource_name
+     * @param string $source_content
+     * @param integer $resource_timestamp
+     * @param boolean $get_source
+     * @param boolean $quiet
+     * @return boolean
+     */
+
+    function _fetch_resource_info(&$params)
+    {
+        if(!isset($params['get_source'])) { $params['get_source'] = true; }
+        if(!isset($params['quiet'])) { $params['quiet'] = false; }
+
+        $_return = false;
+        $_params = array('resource_name' => $params['resource_name']) ;
+        if (isset($params['resource_base_path']))
+            $_params['resource_base_path'] = $params['resource_base_path'];
+        else
+            $_params['resource_base_path'] = $this->template_dir;
+
+        if ($this->_parse_resource_name($_params)) {
+            $_resource_type = $_params['resource_type'];
+            $_resource_name = $_params['resource_name'];
+            switch ($_resource_type) {
+                case 'file':
+                    if ($params['get_source']) {
+                        $params['source_content'] = $this->_read_file($_resource_name);
+                    }
+                    $params['resource_timestamp'] = filemtime($_resource_name);
+                    $_return = is_file($_resource_name);
+                    break;
+
+                default:
+                    // call resource functions to fetch the template source and timestamp
+                    if ($params['get_source']) {
+                        $_source_return = isset($this->_plugins['resource'][$_resource_type]) &&
+                            call_user_func_array($this->_plugins['resource'][$_resource_type][0][0],
+                                                 array($_resource_name, &$params['source_content'], &$this));
+                    } else {
+                        $_source_return = true;
+                    }
+
+                    $_timestamp_return = isset($this->_plugins['resource'][$_resource_type]) &&
+                        call_user_func_array($this->_plugins['resource'][$_resource_type][0][1],
+                                             array($_resource_name, &$params['resource_timestamp'], &$this));
+
+                    $_return = $_source_return && $_timestamp_return;
+                    break;
+            }
+        }
+
+        if (!$_return) {
+            // see if we can get a template with the default template handler
+            if (!empty($this->default_template_handler_func)) {
+                if (!is_callable($this->default_template_handler_func)) {
+                    $this->trigger_error("default template handler function \"$this->default_template_handler_func\" doesn't exist.");
+                } else {
+                    $_return = call_user_func_array(
+                        $this->default_template_handler_func,
+                        array($_params['resource_type'], $_params['resource_name'], &$params['source_content'], &$params['resource_timestamp'], &$this));
+                }
+            }
+        }
+
+        if (!$_return) {
+            if (!$params['quiet']) {
+                $this->trigger_error('unable to read resource: "' . $params['resource_name'] . '"');
+            }
+        } else if ($_return && $this->security) {
+            require_once(SMARTY_CORE_DIR . 'core.is_secure.php');
+            if (!smarty_core_is_secure($_params, $this)) {
+                if (!$params['quiet'])
+                    $this->trigger_error('(secure mode) accessing "' . $params['resource_name'] . '" is not allowed');
+                $params['source_content'] = null;
+                $params['resource_timestamp'] = null;
+                return false;
+            }
+        }
+        return $_return;
+    }
+
+
+    /**
+     * parse out the type and name from the resource
+     *
+     * @param string $resource_base_path
+     * @param string $resource_name
+     * @param string $resource_type
+     * @param string $resource_name
+     * @return boolean
+     */
+
+    function _parse_resource_name(&$params)
+    {
+
+        // split tpl_path by the first colon
+        $_resource_name_parts = explode(':', $params['resource_name'], 2);
+
+        if (count($_resource_name_parts) == 1) {
+            // no resource type given
+            $params['resource_type'] = $this->default_resource_type;
+            $params['resource_name'] = $_resource_name_parts[0];
+        } else {
+            if(strlen($_resource_name_parts[0]) == 1) {
+                // 1 char is not resource type, but part of filepath
+                $params['resource_type'] = $this->default_resource_type;
+                $params['resource_name'] = $params['resource_name'];
+            } else {
+                $params['resource_type'] = $_resource_name_parts[0];
+                $params['resource_name'] = $_resource_name_parts[1];
+            }
+        }
+
+        if ($params['resource_type'] == 'file') {
+            if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $params['resource_name'])) {
+                // relative pathname to $params['resource_base_path']
+                // use the first directory where the file is found
+                foreach ((array)$params['resource_base_path'] as $_curr_path) {
+                    $_fullpath = $_curr_path . DIRECTORY_SEPARATOR . $params['resource_name'];
+                    if (file_exists($_fullpath) && is_file($_fullpath)) {
+                        $params['resource_name'] = $_fullpath;
+                        return true;
+                    }
+                    // didn't find the file, try include_path
+                    $_params = array('file_path' => $_fullpath);
+                    require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
+                    if(smarty_core_get_include_path($_params, $this)) {
+                        $params['resource_name'] = $_params['new_file_path'];
+                        return true;
+                    }
+                }
+                return false;
+            } else {
+                /* absolute path */
+                return file_exists($params['resource_name']);
+            }
+        } elseif (empty($this->_plugins['resource'][$params['resource_type']])) {
+            $_params = array('type' => $params['resource_type']);
+            require_once(SMARTY_CORE_DIR . 'core.load_resource_plugin.php');
+            smarty_core_load_resource_plugin($_params, $this);
+        }
+
+        return true;
+    }
+
+
+    /**
+     * Handle modifiers
+     *
+     * @param string|null $modifier_name
+     * @param array|null $map_array
+     * @return string result of modifiers
+     */
+    function _run_mod_handler()
+    {
+        $_args = func_get_args();
+        list($_modifier_name, $_map_array) = array_splice($_args, 0, 2);
+        list($_func_name, $_tpl_file, $_tpl_line) =
+            $this->_plugins['modifier'][$_modifier_name];
+
+        $_var = $_args[0];
+        foreach ($_var as $_key => $_val) {
+            $_args[0] = $_val;
+            $_var[$_key] = call_user_func_array($_func_name, $_args);
+        }
+        return $_var;
+    }
+
+    /**
+     * Remove starting and ending quotes from the string
+     *
+     * @param string $string
+     * @return string
+     */
+    function _dequote($string)
+    {
+        if ((substr($string, 0, 1) == "'" || substr($string, 0, 1) == '"') &&
+            substr($string, -1) == substr($string, 0, 1))
+            return substr($string, 1, -1);
+        else
+            return $string;
+    }
+
+
+    /**
+     * read in a file
+     *
+     * @param string $filename
+     * @return string
+     */
+    function _read_file($filename)
+    {
+        if ( file_exists($filename) && ($fd = @fopen($filename, 'rb')) ) {
+            $contents = '';
+            while (!feof($fd)) {
+                $contents .= fread($fd, 8192);
+            }
+            fclose($fd);
+            return $contents;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * get a concrete filename for automagically created content
+     *
+     * @param string $auto_base
+     * @param string $auto_source
+     * @param string $auto_id
+     * @return string
+     * @staticvar string|null
+     * @staticvar string|null
+     */
+    function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null)
+    {
+        $_compile_dir_sep =  $this->use_sub_dirs ? DIRECTORY_SEPARATOR : '^';
+        $_return = $auto_base . DIRECTORY_SEPARATOR;
+
+        if(isset($auto_id)) {
+            // make auto_id safe for directory names
+            $auto_id = str_replace('%7C',$_compile_dir_sep,(urlencode($auto_id)));
+            // split into separate directories
+            $_return .= $auto_id . $_compile_dir_sep;
+        }
+
+        if(isset($auto_source)) {
+            // make source name safe for filename
+            $_filename = urlencode(basename($auto_source));
+            $_crc32 = sprintf('%08X', crc32($auto_source));
+            // prepend %% to avoid name conflicts with
+            // with $params['auto_id'] names
+            $_crc32 = substr($_crc32, 0, 2) . $_compile_dir_sep .
+                      substr($_crc32, 0, 3) . $_compile_dir_sep . $_crc32;
+            $_return .= '%%' . $_crc32 . '%%' . $_filename;
+        }
+
+        return $_return;
+    }
+
+    /**
+     * unlink a file, possibly using expiration time
+     *
+     * @param string $resource
+     * @param integer $exp_time
+     */
+    function _unlink($resource, $exp_time = null)
+    {
+        if(isset($exp_time)) {
+            if(time() - @filemtime($resource) >= $exp_time) {
+                return @unlink($resource);
+            }
+        } else {
+            return @unlink($resource);
+        }
+    }
+
+    /**
+     * returns an auto_id for auto-file-functions
+     *
+     * @param string $cache_id
+     * @param string $compile_id
+     * @return string|null
+     */
+    function _get_auto_id($cache_id=null, $compile_id=null) {
+    if (isset($cache_id))
+        return (isset($compile_id)) ? $cache_id . '|' . $compile_id  : $cache_id;
+    elseif(isset($compile_id))
+        return $compile_id;
+    else
+        return null;
+    }
+
+    /**
+     * trigger Smarty plugin error
+     *
+     * @param string $error_msg
+     * @param string $tpl_file
+     * @param integer $tpl_line
+     * @param string $file
+     * @param integer $line
+     * @param integer $error_type
+     */
+    function _trigger_fatal_error($error_msg, $tpl_file = null, $tpl_line = null,
+            $file = null, $line = null, $error_type = E_USER_ERROR)
+    {
+        if(isset($file) && isset($line)) {
+            $info = ' ('.basename($file).", line $line)";
+        } else {
+            $info = '';
+        }
+        if (isset($tpl_line) && isset($tpl_file)) {
+            $this->trigger_error('[in ' . $tpl_file . ' line ' . $tpl_line . "]: $error_msg$info", $error_type);
+        } else {
+            $this->trigger_error($error_msg . $info, $error_type);
+        }
+    }
+
+
+    /**
+     * callback function for preg_replace, to call a non-cacheable block
+     * @return string
+     */
+    function _process_compiled_include_callback($match) {
+        $_func = '_smarty_tplfunc_'.$match[2].'_'.$match[3];
+        ob_start();
+        $_func($this);
+        $_ret = ob_get_contents();
+        ob_end_clean();
+        return $_ret;
+    }
+
+
+    /**
+     * called for included templates
+     *
+     * @param string $_smarty_include_tpl_file
+     * @param string $_smarty_include_vars
+     */
+
+    // $_smarty_include_tpl_file, $_smarty_include_vars
+
+    function _smarty_include($params)
+    {
+        if ($this->debugging) {
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $debug_start_time = smarty_core_get_microtime($_params, $this);
+            $this->_smarty_debug_info[] = array('type'      => 'template',
+                                                  'filename'  => $params['smarty_include_tpl_file'],
+                                                  'depth'     => ++$this->_inclusion_depth);
+            $included_tpls_idx = count($this->_smarty_debug_info) - 1;
+        }
+
+        $this->_tpl_vars = array_merge($this->_tpl_vars, $params['smarty_include_vars']);
+
+        // config vars are treated as local, so push a copy of the
+        // current ones onto the front of the stack
+        array_unshift($this->_config, $this->_config[0]);
+
+        $_smarty_compile_path = $this->_get_compile_path($params['smarty_include_tpl_file']);
+
+
+        if ($this->_is_compiled($params['smarty_include_tpl_file'], $_smarty_compile_path)
+            || $this->_compile_resource($params['smarty_include_tpl_file'], $_smarty_compile_path))
+        {
+            include($_smarty_compile_path);
+        }
+
+        // pop the local vars off the front of the stack
+        array_shift($this->_config);
+
+        $this->_inclusion_depth--;
+
+        if ($this->debugging) {
+            // capture time for debugging info
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $this->_smarty_debug_info[$included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $debug_start_time;
+        }
+
+        if ($this->caching) {
+            $this->_cache_info['template'][$params['smarty_include_tpl_file']] = true;
+        }
+    }
+
+
+    /**
+     * get or set an array of cached attributes for function that is
+     * not cacheable
+     * @return array
+     */
+    function &_smarty_cache_attrs($cache_serial, $count) {
+        $_cache_attrs =& $this->_cache_info['cache_attrs'][$cache_serial][$count];
+
+        if ($this->_cache_including) {
+            /* return next set of cache_attrs */
+            $_return = current($_cache_attrs);
+            next($_cache_attrs);
+            return $_return;
+
+        } else {
+            /* add a reference to a new set of cache_attrs */
+            $_cache_attrs[] = array();
+            return $_cache_attrs[count($_cache_attrs)-1];
+
+        }
+
+    }
+
+
+    /**
+     * wrapper for include() retaining $this
+     * @return mixed
+     */
+    function _include($filename, $once=false, $params=null)
+    {
+        if ($once) {
+            return include_once($filename);
+        } else {
+            return include($filename);
+        }
+    }
+
+
+    /**
+     * wrapper for eval() retaining $this
+     * @return mixed
+     */
+    function _eval($code, $params=null)
+    {
+        return eval($code);
+    }
+    /**#@-*/
+
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/Smarty_Compiler.class.php b/GPL_LIB/Smarty/libs/Smarty_Compiler.class.php
new file mode 100644
index 0000000000000000000000000000000000000000..394f5f52d6e801052663d0ee83da57b48695c1ae
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/Smarty_Compiler.class.php
@@ -0,0 +1,2313 @@
+<?php
+
+/**
+ * Project:     Smarty: the PHP compiling template engine
+ * File:        Smarty_Compiler.class.php
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * @link http://smarty.php.net/
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author Andrei Zmievski <andrei@php.net>
+ * @version 2.6.12
+ * @copyright 2001-2005 New Digital Group, Inc.
+ * @package Smarty
+ */
+
+/* $Id: Smarty_Compiler.class.php,v 1.376 2006/01/15 19:29:45 messju Exp $ */
+
+/**
+ * Template compiling class
+ * @package Smarty
+ */
+class Smarty_Compiler extends Smarty {
+
+    // internal vars
+    /**#@+
+     * @access private
+     */
+    var $_folded_blocks         =   array();    // keeps folded template blocks
+    var $_current_file          =   null;       // the current template being compiled
+    var $_current_line_no       =   1;          // line number for error messages
+    var $_capture_stack         =   array();    // keeps track of nested capture buffers
+    var $_plugin_info           =   array();    // keeps track of plugins to load
+    var $_init_smarty_vars      =   false;
+    var $_permitted_tokens      =   array('true','false','yes','no','on','off','null');
+    var $_db_qstr_regexp        =   null;        // regexps are setup in the constructor
+    var $_si_qstr_regexp        =   null;
+    var $_qstr_regexp           =   null;
+    var $_func_regexp           =   null;
+    var $_reg_obj_regexp        =   null;
+    var $_var_bracket_regexp    =   null;
+    var $_num_const_regexp      =   null;
+    var $_dvar_guts_regexp      =   null;
+    var $_dvar_regexp           =   null;
+    var $_cvar_regexp           =   null;
+    var $_svar_regexp           =   null;
+    var $_avar_regexp           =   null;
+    var $_mod_regexp            =   null;
+    var $_var_regexp            =   null;
+    var $_parenth_param_regexp  =   null;
+    var $_func_call_regexp      =   null;
+    var $_obj_ext_regexp        =   null;
+    var $_obj_start_regexp      =   null;
+    var $_obj_params_regexp     =   null;
+    var $_obj_call_regexp       =   null;
+    var $_cacheable_state       =   0;
+    var $_cache_attrs_count     =   0;
+    var $_nocache_count         =   0;
+    var $_cache_serial          =   null;
+    var $_cache_include         =   null;
+
+    var $_strip_depth           =   0;
+    var $_additional_newline    =   "\n";
+
+    /**#@-*/
+    /**
+     * The class constructor.
+     */
+    function Smarty_Compiler()
+    {
+        // matches double quoted strings:
+        // "foobar"
+        // "foo\"bar"
+        $this->_db_qstr_regexp = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"';
+
+        // matches single quoted strings:
+        // 'foobar'
+        // 'foo\'bar'
+        $this->_si_qstr_regexp = '\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'';
+
+        // matches single or double quoted strings
+        $this->_qstr_regexp = '(?:' . $this->_db_qstr_regexp . '|' . $this->_si_qstr_regexp . ')';
+
+        // matches bracket portion of vars
+        // [0]
+        // [foo]
+        // [$bar]
+        $this->_var_bracket_regexp = '\[\$?[\w\.]+\]';
+
+        // matches numerical constants
+        // 30
+        // -12
+        // 13.22
+        $this->_num_const_regexp = '(?:\-?\d+(?:\.\d+)?)';
+
+        // matches $ vars (not objects):
+        // $foo
+        // $foo.bar
+        // $foo.bar.foobar
+        // $foo[0]
+        // $foo[$bar]
+        // $foo[5][blah]
+        // $foo[5].bar[$foobar][4]
+        $this->_dvar_math_regexp = '(?:[\+\*\/\%]|(?:-(?!>)))';
+        $this->_dvar_math_var_regexp = '[\$\w\.\+\-\*\/\%\d\>\[\]]';
+        $this->_dvar_guts_regexp = '\w+(?:' . $this->_var_bracket_regexp
+                . ')*(?:\.\$?\w+(?:' . $this->_var_bracket_regexp . ')*)*(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?';
+        $this->_dvar_regexp = '\$' . $this->_dvar_guts_regexp;
+
+        // matches config vars:
+        // #foo#
+        // #foobar123_foo#
+        $this->_cvar_regexp = '\#\w+\#';
+
+        // matches section vars:
+        // %foo.bar%
+        $this->_svar_regexp = '\%\w+\.\w+\%';
+
+        // matches all valid variables (no quotes, no modifiers)
+        $this->_avar_regexp = '(?:' . $this->_dvar_regexp . '|'
+           . $this->_cvar_regexp . '|' . $this->_svar_regexp . ')';
+
+        // matches valid variable syntax:
+        // $foo
+        // $foo
+        // #foo#
+        // #foo#
+        // "text"
+        // "text"
+        $this->_var_regexp = '(?:' . $this->_avar_regexp . '|' . $this->_qstr_regexp . ')';
+
+        // matches valid object call (one level of object nesting allowed in parameters):
+        // $foo->bar
+        // $foo->bar()
+        // $foo->bar("text")
+        // $foo->bar($foo, $bar, "text")
+        // $foo->bar($foo, "foo")
+        // $foo->bar->foo()
+        // $foo->bar->foo->bar()
+        // $foo->bar($foo->bar)
+        // $foo->bar($foo->bar())
+        // $foo->bar($foo->bar($blah,$foo,44,"foo",$foo[0].bar))
+        $this->_obj_ext_regexp = '\->(?:\$?' . $this->_dvar_guts_regexp . ')';
+        $this->_obj_restricted_param_regexp = '(?:'
+                . '(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')(?:' . $this->_obj_ext_regexp . '(?:\((?:(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')'
+                . '(?:\s*,\s*(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . '))*)?\))?)*)';
+        $this->_obj_single_param_regexp = '(?:\w+|' . $this->_obj_restricted_param_regexp . '(?:\s*,\s*(?:(?:\w+|'
+                . $this->_var_regexp . $this->_obj_restricted_param_regexp . ')))*)';
+        $this->_obj_params_regexp = '\((?:' . $this->_obj_single_param_regexp
+                . '(?:\s*,\s*' . $this->_obj_single_param_regexp . ')*)?\)';
+        $this->_obj_start_regexp = '(?:' . $this->_dvar_regexp . '(?:' . $this->_obj_ext_regexp . ')+)';
+        $this->_obj_call_regexp = '(?:' . $this->_obj_start_regexp . '(?:' . $this->_obj_params_regexp . ')?(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?)';
+        
+        // matches valid modifier syntax:
+        // |foo
+        // |@foo
+        // |foo:"bar"
+        // |foo:$bar
+        // |foo:"bar":$foobar
+        // |foo|bar
+        // |foo:$foo->bar
+        $this->_mod_regexp = '(?:\|@?\w+(?::(?:\w+|' . $this->_num_const_regexp . '|'
+           . $this->_obj_call_regexp . '|' . $this->_avar_regexp . '|' . $this->_qstr_regexp .'))*)';
+
+        // matches valid function name:
+        // foo123
+        // _foo_bar
+        $this->_func_regexp = '[a-zA-Z_]\w*';
+
+        // matches valid registered object:
+        // foo->bar
+        $this->_reg_obj_regexp = '[a-zA-Z_]\w*->[a-zA-Z_]\w*';
+
+        // matches valid parameter values:
+        // true
+        // $foo
+        // $foo|bar
+        // #foo#
+        // #foo#|bar
+        // "text"
+        // "text"|bar
+        // $foo->bar
+        $this->_param_regexp = '(?:\s*(?:' . $this->_obj_call_regexp . '|'
+           . $this->_var_regexp . '|' . $this->_num_const_regexp  . '|\w+)(?>' . $this->_mod_regexp . '*)\s*)';
+
+        // matches valid parenthesised function parameters:
+        //
+        // "text"
+        //    $foo, $bar, "text"
+        // $foo|bar, "foo"|bar, $foo->bar($foo)|bar
+        $this->_parenth_param_regexp = '(?:\((?:\w+|'
+                . $this->_param_regexp . '(?:\s*,\s*(?:(?:\w+|'
+                . $this->_param_regexp . ')))*)?\))';
+
+        // matches valid function call:
+        // foo()
+        // foo_bar($foo)
+        // _foo_bar($foo,"bar")
+        // foo123($foo,$foo->bar(),"foo")
+        $this->_func_call_regexp = '(?:' . $this->_func_regexp . '\s*(?:'
+           . $this->_parenth_param_regexp . '))';
+    }
+
+    /**
+     * compile a resource
+     *
+     * sets $compiled_content to the compiled source
+     * @param string $resource_name
+     * @param string $source_content
+     * @param string $compiled_content
+     * @return true
+     */
+    function _compile_file($resource_name, $source_content, &$compiled_content)
+    {
+
+        if ($this->security) {
+            // do not allow php syntax to be executed unless specified
+            if ($this->php_handling == SMARTY_PHP_ALLOW &&
+                !$this->security_settings['PHP_HANDLING']) {
+                $this->php_handling = SMARTY_PHP_PASSTHRU;
+            }
+        }
+
+        $this->_load_filters();
+
+        $this->_current_file = $resource_name;
+        $this->_current_line_no = 1;
+        $ldq = preg_quote($this->left_delimiter, '~');
+        $rdq = preg_quote($this->right_delimiter, '~');
+
+        // run template source through prefilter functions
+        if (count($this->_plugins['prefilter']) > 0) {
+            foreach ($this->_plugins['prefilter'] as $filter_name => $prefilter) {
+                if ($prefilter === false) continue;
+                if ($prefilter[3] || is_callable($prefilter[0])) {
+                    $source_content = call_user_func_array($prefilter[0],
+                                                            array($source_content, &$this));
+                    $this->_plugins['prefilter'][$filter_name][3] = true;
+                } else {
+                    $this->_trigger_fatal_error("[plugin] prefilter '$filter_name' is not implemented");
+                }
+            }
+        }
+
+        /* fetch all special blocks */
+        $search = "~{$ldq}\*(.*?)\*{$rdq}|{$ldq}\s*literal\s*{$rdq}(.*?){$ldq}\s*/literal\s*{$rdq}|{$ldq}\s*php\s*{$rdq}(.*?){$ldq}\s*/php\s*{$rdq}~s";
+
+        preg_match_all($search, $source_content, $match,  PREG_SET_ORDER);
+        $this->_folded_blocks = $match;
+        reset($this->_folded_blocks);
+
+        /* replace special blocks by "{php}" */
+        $source_content = preg_replace($search.'e', "'"
+                                       . $this->_quote_replace($this->left_delimiter) . 'php'
+                                       . "' . str_repeat(\"\n\", substr_count('\\0', \"\n\")) .'"
+                                       . $this->_quote_replace($this->right_delimiter)
+                                       . "'"
+                                       , $source_content);
+
+        /* Gather all template tags. */
+        preg_match_all("~{$ldq}\s*(.*?)\s*{$rdq}~s", $source_content, $_match);
+        $template_tags = $_match[1];
+        /* Split content by template tags to obtain non-template content. */
+        $text_blocks = preg_split("~{$ldq}.*?{$rdq}~s", $source_content);
+
+        /* loop through text blocks */
+        for ($curr_tb = 0, $for_max = count($text_blocks); $curr_tb < $for_max; $curr_tb++) {
+            /* match anything resembling php tags */
+            if (preg_match_all('~(<\?(?:\w+|=)?|\?>|language\s*=\s*[\"\']?php[\"\']?)~is', $text_blocks[$curr_tb], $sp_match)) {
+                /* replace tags with placeholders to prevent recursive replacements */
+                $sp_match[1] = array_unique($sp_match[1]);
+                usort($sp_match[1], '_smarty_sort_length');
+                for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) {
+                    $text_blocks[$curr_tb] = str_replace($sp_match[1][$curr_sp],'%%%SMARTYSP'.$curr_sp.'%%%',$text_blocks[$curr_tb]);
+                }
+                /* process each one */
+                for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) {
+                    if ($this->php_handling == SMARTY_PHP_PASSTHRU) {
+                        /* echo php contents */
+                        $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', '<?php echo \''.str_replace("'", "\'", $sp_match[1][$curr_sp]).'\'; ?>'."\n", $text_blocks[$curr_tb]);
+                    } else if ($this->php_handling == SMARTY_PHP_QUOTE) {
+                        /* quote php tags */
+                        $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', htmlspecialchars($sp_match[1][$curr_sp]), $text_blocks[$curr_tb]);
+                    } else if ($this->php_handling == SMARTY_PHP_REMOVE) {
+                        /* remove php tags */
+                        $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', '', $text_blocks[$curr_tb]);
+                    } else {
+                        /* SMARTY_PHP_ALLOW, but echo non php starting tags */
+                        $sp_match[1][$curr_sp] = preg_replace('~(<\?(?!php|=|$))~i', '<?php echo \'\\1\'?>'."\n", $sp_match[1][$curr_sp]);
+                        $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', $sp_match[1][$curr_sp], $text_blocks[$curr_tb]);
+                    }
+                }
+            }
+        }
+
+        /* Compile the template tags into PHP code. */
+        $compiled_tags = array();
+        for ($i = 0, $for_max = count($template_tags); $i < $for_max; $i++) {
+            $this->_current_line_no += substr_count($text_blocks[$i], "\n");
+            $compiled_tags[] = $this->_compile_tag($template_tags[$i]);
+            $this->_current_line_no += substr_count($template_tags[$i], "\n");
+        }
+        if (count($this->_tag_stack)>0) {
+            list($_open_tag, $_line_no) = end($this->_tag_stack);
+            $this->_syntax_error("unclosed tag \{$_open_tag} (opened line $_line_no).", E_USER_ERROR, __FILE__, __LINE__);
+            return;
+        }
+
+        /* Reformat $text_blocks between 'strip' and '/strip' tags,
+           removing spaces, tabs and newlines. */
+        $strip = false;
+        for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; $i++) {
+            if ($compiled_tags[$i] == '{strip}') {
+                $compiled_tags[$i] = '';
+                $strip = true;
+                /* remove leading whitespaces */
+                $text_blocks[$i + 1] = ltrim($text_blocks[$i + 1]);
+            }
+            if ($strip) {
+                /* strip all $text_blocks before the next '/strip' */
+                for ($j = $i + 1; $j < $for_max; $j++) {
+                    /* remove leading and trailing whitespaces of each line */
+                    $text_blocks[$j] = preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $text_blocks[$j]);
+                    if ($compiled_tags[$j] == '{/strip}') {                       
+                        /* remove trailing whitespaces from the last text_block */
+                        $text_blocks[$j] = rtrim($text_blocks[$j]);
+                    }
+                    $text_blocks[$j] = "<?php echo '" . strtr($text_blocks[$j], array("'"=>"\'", "\\"=>"\\\\")) . "'; ?>";
+                    if ($compiled_tags[$j] == '{/strip}') {
+                        $compiled_tags[$j] = "\n"; /* slurped by php, but necessary
+                                    if a newline is following the closing strip-tag */
+                        $strip = false;
+                        $i = $j;
+                        break;
+                    }
+                }
+            }
+        }
+        $compiled_content = '';
+
+        /* Interleave the compiled contents and text blocks to get the final result. */
+        for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; $i++) {
+            if ($compiled_tags[$i] == '') {
+                // tag result empty, remove first newline from following text block
+                $text_blocks[$i+1] = preg_replace('~^(\r\n|\r|\n)~', '', $text_blocks[$i+1]);
+            }
+            $compiled_content .= $text_blocks[$i].$compiled_tags[$i];
+        }
+        $compiled_content .= $text_blocks[$i];
+
+        // remove \n from the end of the file, if any
+        if (strlen($compiled_content) && (substr($compiled_content, -1) == "\n") ) {
+            $compiled_content = substr($compiled_content, 0, -1);
+        }
+
+        if (!empty($this->_cache_serial)) {
+            $compiled_content = "<?php \$this->_cache_serials['".$this->_cache_include."'] = '".$this->_cache_serial."'; ?>" . $compiled_content;
+        }
+
+        // remove unnecessary close/open tags
+        $compiled_content = preg_replace('~\?>\n?<\?php~', '', $compiled_content);
+
+        // run compiled template through postfilter functions
+        if (count($this->_plugins['postfilter']) > 0) {
+            foreach ($this->_plugins['postfilter'] as $filter_name => $postfilter) {
+                if ($postfilter === false) continue;
+                if ($postfilter[3] || is_callable($postfilter[0])) {
+                    $compiled_content = call_user_func_array($postfilter[0],
+                                                              array($compiled_content, &$this));
+                    $this->_plugins['postfilter'][$filter_name][3] = true;
+                } else {
+                    $this->_trigger_fatal_error("Smarty plugin error: postfilter '$filter_name' is not implemented");
+                }
+            }
+        }
+
+        // put header at the top of the compiled template
+        $template_header = "<?php /* Smarty version ".$this->_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n";
+        $template_header .= "         compiled from ".strtr(urlencode($resource_name), array('%2F'=>'/', '%3A'=>':'))." */ ?>\n";
+
+        /* Emit code to load needed plugins. */
+        $this->_plugins_code = '';
+        if (count($this->_plugin_info)) {
+            $_plugins_params = "array('plugins' => array(";
+            foreach ($this->_plugin_info as $plugin_type => $plugins) {
+                foreach ($plugins as $plugin_name => $plugin_info) {
+                    $_plugins_params .= "array('$plugin_type', '$plugin_name', '" . strtr($plugin_info[0], array("'" => "\\'", "\\" => "\\\\")) . "', $plugin_info[1], ";
+                    $_plugins_params .= $plugin_info[2] ? 'true),' : 'false),';
+                }
+            }
+            $_plugins_params .= '))';
+            $plugins_code = "<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');\nsmarty_core_load_plugins($_plugins_params, \$this); ?>\n";
+            $template_header .= $plugins_code;
+            $this->_plugin_info = array();
+            $this->_plugins_code = $plugins_code;
+        }
+
+        if ($this->_init_smarty_vars) {
+            $template_header .= "<?php require_once(SMARTY_CORE_DIR . 'core.assign_smarty_interface.php');\nsmarty_core_assign_smarty_interface(null, \$this); ?>\n";
+            $this->_init_smarty_vars = false;
+        }
+
+        $compiled_content = $template_header . $compiled_content;
+        return true;
+    }
+
+    /**
+     * Compile a template tag
+     *
+     * @param string $template_tag
+     * @return string
+     */
+    function _compile_tag($template_tag)
+    {
+        /* Matched comment. */
+        if (substr($template_tag, 0, 1) == '*' && substr($template_tag, -1) == '*')
+            return '';
+        
+        /* Split tag into two three parts: command, command modifiers and the arguments. */
+        if(! preg_match('~^(?:(' . $this->_num_const_regexp . '|' . $this->_obj_call_regexp . '|' . $this->_var_regexp
+                . '|\/?' . $this->_reg_obj_regexp . '|\/?' . $this->_func_regexp . ')(' . $this->_mod_regexp . '*))
+                      (?:\s+(.*))?$
+                    ~xs', $template_tag, $match)) {
+            $this->_syntax_error("unrecognized tag: $template_tag", E_USER_ERROR, __FILE__, __LINE__);
+        }
+        
+        $tag_command = $match[1];
+        $tag_modifier = isset($match[2]) ? $match[2] : null;
+        $tag_args = isset($match[3]) ? $match[3] : null;
+
+        if (preg_match('~^' . $this->_num_const_regexp . '|' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '$~', $tag_command)) {
+            /* tag name is a variable or object */
+            $_return = $this->_parse_var_props($tag_command . $tag_modifier);
+            return "<?php echo $_return; ?>" . $this->_additional_newline;
+        }
+
+        /* If the tag name is a registered object, we process it. */
+        if (preg_match('~^\/?' . $this->_reg_obj_regexp . '$~', $tag_command)) {
+            return $this->_compile_registered_object_tag($tag_command, $this->_parse_attrs($tag_args), $tag_modifier);
+        }
+
+        switch ($tag_command) {
+            case 'include':
+                return $this->_compile_include_tag($tag_args);
+
+            case 'include_php':
+                return $this->_compile_include_php_tag($tag_args);
+
+            case 'if':
+                $this->_push_tag('if');
+                return $this->_compile_if_tag($tag_args);
+
+            case 'else':
+                list($_open_tag) = end($this->_tag_stack);
+                if ($_open_tag != 'if' && $_open_tag != 'elseif')
+                    $this->_syntax_error('unexpected {else}', E_USER_ERROR, __FILE__, __LINE__);
+                else
+                    $this->_push_tag('else');
+                return '<?php else: ?>';
+
+            case 'elseif':
+                list($_open_tag) = end($this->_tag_stack);
+                if ($_open_tag != 'if' && $_open_tag != 'elseif')
+                    $this->_syntax_error('unexpected {elseif}', E_USER_ERROR, __FILE__, __LINE__);
+                if ($_open_tag == 'if')
+                    $this->_push_tag('elseif');
+                return $this->_compile_if_tag($tag_args, true);
+
+            case '/if':
+                $this->_pop_tag('if');
+                return '<?php endif; ?>';
+
+            case 'capture':
+                return $this->_compile_capture_tag(true, $tag_args);
+
+            case '/capture':
+                return $this->_compile_capture_tag(false);
+
+            case 'ldelim':
+                return $this->left_delimiter;
+
+            case 'rdelim':
+                return $this->right_delimiter;
+
+            case 'section':
+                $this->_push_tag('section');
+                return $this->_compile_section_start($tag_args);
+
+            case 'sectionelse':
+                $this->_push_tag('sectionelse');
+                return "<?php endfor; else: ?>";
+                break;
+
+            case '/section':
+                $_open_tag = $this->_pop_tag('section');
+                if ($_open_tag == 'sectionelse')
+                    return "<?php endif; ?>";
+                else
+                    return "<?php endfor; endif; ?>";
+
+            case 'foreach':
+                $this->_push_tag('foreach');
+                return $this->_compile_foreach_start($tag_args);
+                break;
+
+            case 'foreachelse':
+                $this->_push_tag('foreachelse');
+                return "<?php endforeach; else: ?>";
+
+            case '/foreach':
+                $_open_tag = $this->_pop_tag('foreach');
+                if ($_open_tag == 'foreachelse')
+                    return "<?php endif; unset(\$_from); ?>";
+                else
+                    return "<?php endforeach; endif; unset(\$_from); ?>";
+                break;
+
+            case 'strip':
+            case '/strip':
+                if (substr($tag_command, 0, 1)=='/') {
+                    $this->_pop_tag('strip');
+                    if (--$this->_strip_depth==0) { /* outermost closing {/strip} */
+                        $this->_additional_newline = "\n";
+                        return '{' . $tag_command . '}';
+                    }
+                } else {
+                    $this->_push_tag('strip');
+                    if ($this->_strip_depth++==0) { /* outermost opening {strip} */
+                        $this->_additional_newline = "";
+                        return '{' . $tag_command . '}';
+                    }
+                }
+                return '';
+
+            case 'php':
+                /* handle folded tags replaced by {php} */
+                list(, $block) = each($this->_folded_blocks);
+                $this->_current_line_no += substr_count($block[0], "\n");
+                /* the number of matched elements in the regexp in _compile_file()
+                   determins the type of folded tag that was found */
+                switch (count($block)) {
+                    case 2: /* comment */
+                        return '';
+
+                    case 3: /* literal */
+                        return "<?php echo '" . strtr($block[2], array("'"=>"\'", "\\"=>"\\\\")) . "'; ?>" . $this->_additional_newline;
+
+                    case 4: /* php */
+                        if ($this->security && !$this->security_settings['PHP_TAGS']) {
+                            $this->_syntax_error("(secure mode) php tags not permitted", E_USER_WARNING, __FILE__, __LINE__);
+                            return;
+                        }
+                        return '<?php ' . $block[3] .' ?>';
+                }
+                break;
+
+            case 'insert':
+                return $this->_compile_insert_tag($tag_args);
+
+            default:
+                if ($this->_compile_compiler_tag($tag_command, $tag_args, $output)) {
+                    return $output;
+                } else if ($this->_compile_block_tag($tag_command, $tag_args, $tag_modifier, $output)) {
+                    return $output;
+                } else if ($this->_compile_custom_tag($tag_command, $tag_args, $tag_modifier, $output)) {
+                    return $output;                    
+                } else {
+                    $this->_syntax_error("unrecognized tag '$tag_command'", E_USER_ERROR, __FILE__, __LINE__);
+                }
+
+        }
+    }
+
+
+    /**
+     * compile the custom compiler tag
+     *
+     * sets $output to the compiled custom compiler tag
+     * @param string $tag_command
+     * @param string $tag_args
+     * @param string $output
+     * @return boolean
+     */
+    function _compile_compiler_tag($tag_command, $tag_args, &$output)
+    {
+        $found = false;
+        $have_function = true;
+
+        /*
+         * First we check if the compiler function has already been registered
+         * or loaded from a plugin file.
+         */
+        if (isset($this->_plugins['compiler'][$tag_command])) {
+            $found = true;
+            $plugin_func = $this->_plugins['compiler'][$tag_command][0];
+            if (!is_callable($plugin_func)) {
+                $message = "compiler function '$tag_command' is not implemented";
+                $have_function = false;
+            }
+        }
+        /*
+         * Otherwise we need to load plugin file and look for the function
+         * inside it.
+         */
+        else if ($plugin_file = $this->_get_plugin_filepath('compiler', $tag_command)) {
+            $found = true;
+
+            include_once $plugin_file;
+
+            $plugin_func = 'smarty_compiler_' . $tag_command;
+            if (!is_callable($plugin_func)) {
+                $message = "plugin function $plugin_func() not found in $plugin_file\n";
+                $have_function = false;
+            } else {
+                $this->_plugins['compiler'][$tag_command] = array($plugin_func, null, null, null, true);
+            }
+        }
+
+        /*
+         * True return value means that we either found a plugin or a
+         * dynamically registered function. False means that we didn't and the
+         * compiler should now emit code to load custom function plugin for this
+         * tag.
+         */
+        if ($found) {
+            if ($have_function) {
+                $output = call_user_func_array($plugin_func, array($tag_args, &$this));
+                if($output != '') {
+                $output = '<?php ' . $this->_push_cacheable_state('compiler', $tag_command)
+                                   . $output
+                                   . $this->_pop_cacheable_state('compiler', $tag_command) . ' ?>';
+                }
+            } else {
+                $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__);
+            }
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+
+    /**
+     * compile block function tag
+     *
+     * sets $output to compiled block function tag
+     * @param string $tag_command
+     * @param string $tag_args
+     * @param string $tag_modifier
+     * @param string $output
+     * @return boolean
+     */
+    function _compile_block_tag($tag_command, $tag_args, $tag_modifier, &$output)
+    {
+        if (substr($tag_command, 0, 1) == '/') {
+            $start_tag = false;
+            $tag_command = substr($tag_command, 1);
+        } else
+            $start_tag = true;
+
+        $found = false;
+        $have_function = true;
+
+        /*
+         * First we check if the block function has already been registered
+         * or loaded from a plugin file.
+         */
+        if (isset($this->_plugins['block'][$tag_command])) {
+            $found = true;
+            $plugin_func = $this->_plugins['block'][$tag_command][0];
+            if (!is_callable($plugin_func)) {
+                $message = "block function '$tag_command' is not implemented";
+                $have_function = false;
+            }
+        }
+        /*
+         * Otherwise we need to load plugin file and look for the function
+         * inside it.
+         */
+        else if ($plugin_file = $this->_get_plugin_filepath('block', $tag_command)) {
+            $found = true;
+
+            include_once $plugin_file;
+
+            $plugin_func = 'smarty_block_' . $tag_command;
+            if (!function_exists($plugin_func)) {
+                $message = "plugin function $plugin_func() not found in $plugin_file\n";
+                $have_function = false;
+            } else {
+                $this->_plugins['block'][$tag_command] = array($plugin_func, null, null, null, true);
+
+            }
+        }
+
+        if (!$found) {
+            return false;
+        } else if (!$have_function) {
+            $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__);
+            return true;
+        }
+
+        /*
+         * Even though we've located the plugin function, compilation
+         * happens only once, so the plugin will still need to be loaded
+         * at runtime for future requests.
+         */
+        $this->_add_plugin('block', $tag_command);
+
+        if ($start_tag)
+            $this->_push_tag($tag_command);
+        else
+            $this->_pop_tag($tag_command);
+
+        if ($start_tag) {
+            $output = '<?php ' . $this->_push_cacheable_state('block', $tag_command);
+            $attrs = $this->_parse_attrs($tag_args);
+            $_cache_attrs='';
+            $arg_list = $this->_compile_arg_list('block', $tag_command, $attrs, $_cache_attrs);
+            $output .= "$_cache_attrs\$this->_tag_stack[] = array('$tag_command', array(".implode(',', $arg_list).')); ';
+            $output .= '$_block_repeat=true;' . $this->_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);';
+            $output .= 'while ($_block_repeat) { ob_start(); ?>';
+        } else {
+            $output = '<?php $_block_content = ob_get_contents(); ob_end_clean(); ';
+            $_out_tag_text = $this->_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat)';
+            if ($tag_modifier != '') {
+                $this->_parse_modifiers($_out_tag_text, $tag_modifier);
+            }
+            $output .= '$_block_repeat=false;echo ' . $_out_tag_text . '; } ';
+            $output .= " array_pop(\$this->_tag_stack); " . $this->_pop_cacheable_state('block', $tag_command) . '?>';
+        }
+
+        return true;
+    }
+
+
+    /**
+     * compile custom function tag
+     *
+     * @param string $tag_command
+     * @param string $tag_args
+     * @param string $tag_modifier
+     * @return string
+     */
+    function _compile_custom_tag($tag_command, $tag_args, $tag_modifier, &$output)
+    {
+        $found = false;
+        $have_function = true;
+
+        /*
+         * First we check if the custom function has already been registered
+         * or loaded from a plugin file.
+         */
+        if (isset($this->_plugins['function'][$tag_command])) {
+            $found = true;
+            $plugin_func = $this->_plugins['function'][$tag_command][0];
+            if (!is_callable($plugin_func)) {
+                $message = "custom function '$tag_command' is not implemented";
+                $have_function = false;
+            }
+        }
+        /*
+         * Otherwise we need to load plugin file and look for the function
+         * inside it.
+         */
+        else if ($plugin_file = $this->_get_plugin_filepath('function', $tag_command)) {
+            $found = true;
+
+            include_once $plugin_file;
+
+            $plugin_func = 'smarty_function_' . $tag_command;
+            if (!function_exists($plugin_func)) {
+                $message = "plugin function $plugin_func() not found in $plugin_file\n";
+                $have_function = false;
+            } else {
+                $this->_plugins['function'][$tag_command] = array($plugin_func, null, null, null, true);
+
+            }
+        }
+
+        if (!$found) {
+            return false;
+        } else if (!$have_function) {
+            $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__);
+            return true;
+        }
+
+        /* declare plugin to be loaded on display of the template that
+           we compile right now */
+        $this->_add_plugin('function', $tag_command);
+
+        $_cacheable_state = $this->_push_cacheable_state('function', $tag_command);
+        $attrs = $this->_parse_attrs($tag_args);
+        $_cache_attrs = '';
+        $arg_list = $this->_compile_arg_list('function', $tag_command, $attrs, $_cache_attrs);
+
+        $output = $this->_compile_plugin_call('function', $tag_command).'(array('.implode(',', $arg_list)."), \$this)";
+        if($tag_modifier != '') {
+            $this->_parse_modifiers($output, $tag_modifier);
+        }
+
+        if($output != '') {
+            $output =  '<?php ' . $_cacheable_state . $_cache_attrs . 'echo ' . $output . ';'
+                . $this->_pop_cacheable_state('function', $tag_command) . "?>" . $this->_additional_newline;
+        }
+
+        return true;
+    }
+
+    /**
+     * compile a registered object tag
+     *
+     * @param string $tag_command
+     * @param array $attrs
+     * @param string $tag_modifier
+     * @return string
+     */
+    function _compile_registered_object_tag($tag_command, $attrs, $tag_modifier)
+    {
+        if (substr($tag_command, 0, 1) == '/') {
+            $start_tag = false;
+            $tag_command = substr($tag_command, 1);
+        } else {
+            $start_tag = true;
+        }
+
+        list($object, $obj_comp) = explode('->', $tag_command);
+
+        $arg_list = array();
+        if(count($attrs)) {
+            $_assign_var = false;
+            foreach ($attrs as $arg_name => $arg_value) {
+                if($arg_name == 'assign') {
+                    $_assign_var = $arg_value;
+                    unset($attrs['assign']);
+                    continue;
+                }
+                if (is_bool($arg_value))
+                    $arg_value = $arg_value ? 'true' : 'false';
+                $arg_list[] = "'$arg_name' => $arg_value";
+            }
+        }
+
+        if($this->_reg_objects[$object][2]) {
+            // smarty object argument format
+            $args = "array(".implode(',', (array)$arg_list)."), \$this";
+        } else {
+            // traditional argument format
+            $args = implode(',', array_values($attrs));
+            if (empty($args)) {
+                $args = 'null';
+            }
+        }
+
+        $prefix = '';
+        $postfix = '';
+        $newline = '';
+        if(!is_object($this->_reg_objects[$object][0])) {
+            $this->_trigger_fatal_error("registered '$object' is not an object" , $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);
+        } elseif(!empty($this->_reg_objects[$object][1]) && !in_array($obj_comp, $this->_reg_objects[$object][1])) {
+            $this->_trigger_fatal_error("'$obj_comp' is not a registered component of object '$object'", $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);
+        } elseif(method_exists($this->_reg_objects[$object][0], $obj_comp)) {
+            // method
+            if(in_array($obj_comp, $this->_reg_objects[$object][3])) {
+                // block method
+                if ($start_tag) {
+                    $prefix = "\$this->_tag_stack[] = array('$obj_comp', $args); ";
+                    $prefix .= "\$_block_repeat=true; \$this->_reg_objects['$object'][0]->$obj_comp(\$this->_tag_stack[count(\$this->_tag_stack)-1][1], null, \$this, \$_block_repeat); ";
+                    $prefix .= "while (\$_block_repeat) { ob_start();";
+                    $return = null;
+                    $postfix = '';
+            } else {
+                    $prefix = "\$_obj_block_content = ob_get_contents(); ob_end_clean(); ";
+                    $return = "\$_block_repeat=false; \$this->_reg_objects['$object'][0]->$obj_comp(\$this->_tag_stack[count(\$this->_tag_stack)-1][1], \$_obj_block_content, \$this, \$_block_repeat)";
+                    $postfix = "} array_pop(\$this->_tag_stack);";
+                }
+            } else {
+                // non-block method
+                $return = "\$this->_reg_objects['$object'][0]->$obj_comp($args)";
+            }
+        } else {
+            // property
+            $return = "\$this->_reg_objects['$object'][0]->$obj_comp";
+        }
+
+        if($return != null) {
+            if($tag_modifier != '') {
+                $this->_parse_modifiers($return, $tag_modifier);
+            }
+
+            if(!empty($_assign_var)) {
+                $output = "\$this->assign('" . $this->_dequote($_assign_var) ."',  $return);";
+            } else {
+                $output = 'echo ' . $return . ';';
+                $newline = $this->_additional_newline;
+            }
+        } else {
+            $output = '';
+        }
+
+        return '<?php ' . $prefix . $output . $postfix . "?>" . $newline;
+    }
+
+    /**
+     * Compile {insert ...} tag
+     *
+     * @param string $tag_args
+     * @return string
+     */
+    function _compile_insert_tag($tag_args)
+    {
+        $attrs = $this->_parse_attrs($tag_args);
+        $name = $this->_dequote($attrs['name']);
+
+        if (empty($name)) {
+            $this->_syntax_error("missing insert name", E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        if (!empty($attrs['script'])) {
+            $delayed_loading = true;
+        } else {
+            $delayed_loading = false;
+        }
+
+        foreach ($attrs as $arg_name => $arg_value) {
+            if (is_bool($arg_value))
+                $arg_value = $arg_value ? 'true' : 'false';
+            $arg_list[] = "'$arg_name' => $arg_value";
+        }
+
+        $this->_add_plugin('insert', $name, $delayed_loading);
+
+        $_params = "array('args' => array(".implode(', ', (array)$arg_list)."))";
+
+        return "<?php require_once(SMARTY_CORE_DIR . 'core.run_insert_handler.php');\necho smarty_core_run_insert_handler($_params, \$this); ?>" . $this->_additional_newline;
+    }
+
+    /**
+     * Compile {include ...} tag
+     *
+     * @param string $tag_args
+     * @return string
+     */
+    function _compile_include_tag($tag_args)
+    {
+        $attrs = $this->_parse_attrs($tag_args);
+        $arg_list = array();
+
+        if (empty($attrs['file'])) {
+            $this->_syntax_error("missing 'file' attribute in include tag", E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        foreach ($attrs as $arg_name => $arg_value) {
+            if ($arg_name == 'file') {
+                $include_file = $arg_value;
+                continue;
+            } else if ($arg_name == 'assign') {
+                $assign_var = $arg_value;
+                continue;
+            }
+            if (is_bool($arg_value))
+                $arg_value = $arg_value ? 'true' : 'false';
+            $arg_list[] = "'$arg_name' => $arg_value";
+        }
+
+        $output = '<?php ';
+
+        if (isset($assign_var)) {
+            $output .= "ob_start();\n";
+        }
+
+        $output .=
+            "\$_smarty_tpl_vars = \$this->_tpl_vars;\n";
+
+
+        $_params = "array('smarty_include_tpl_file' => " . $include_file . ", 'smarty_include_vars' => array(".implode(',', (array)$arg_list)."))";
+        $output .= "\$this->_smarty_include($_params);\n" .
+        "\$this->_tpl_vars = \$_smarty_tpl_vars;\n" .
+        "unset(\$_smarty_tpl_vars);\n";
+
+        if (isset($assign_var)) {
+            $output .= "\$this->assign(" . $assign_var . ", ob_get_contents()); ob_end_clean();\n";
+        }
+
+        $output .= ' ?>';
+
+        return $output;
+
+    }
+
+    /**
+     * Compile {include ...} tag
+     *
+     * @param string $tag_args
+     * @return string
+     */
+    function _compile_include_php_tag($tag_args)
+    {
+        $attrs = $this->_parse_attrs($tag_args);
+
+        if (empty($attrs['file'])) {
+            $this->_syntax_error("missing 'file' attribute in include_php tag", E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        $assign_var = (empty($attrs['assign'])) ? '' : $this->_dequote($attrs['assign']);
+        $once_var = (empty($attrs['once']) || $attrs['once']=='false') ? 'false' : 'true';
+
+        $arg_list = array();
+        foreach($attrs as $arg_name => $arg_value) {
+            if($arg_name != 'file' AND $arg_name != 'once' AND $arg_name != 'assign') {
+                if(is_bool($arg_value))
+                    $arg_value = $arg_value ? 'true' : 'false';
+                $arg_list[] = "'$arg_name' => $arg_value";
+            }
+        }
+
+        $_params = "array('smarty_file' => " . $attrs['file'] . ", 'smarty_assign' => '$assign_var', 'smarty_once' => $once_var, 'smarty_include_vars' => array(".implode(',', $arg_list)."))";
+
+        return "<?php require_once(SMARTY_CORE_DIR . 'core.smarty_include_php.php');\nsmarty_core_smarty_include_php($_params, \$this); ?>" . $this->_additional_newline;
+    }
+
+
+    /**
+     * Compile {section ...} tag
+     *
+     * @param string $tag_args
+     * @return string
+     */
+    function _compile_section_start($tag_args)
+    {
+        $attrs = $this->_parse_attrs($tag_args);
+        $arg_list = array();
+
+        $output = '<?php ';
+        $section_name = $attrs['name'];
+        if (empty($section_name)) {
+            $this->_syntax_error("missing section name", E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        $output .= "unset(\$this->_sections[$section_name]);\n";
+        $section_props = "\$this->_sections[$section_name]";
+
+        foreach ($attrs as $attr_name => $attr_value) {
+            switch ($attr_name) {
+                case 'loop':
+                    $output .= "{$section_props}['loop'] = is_array(\$_loop=$attr_value) ? count(\$_loop) : max(0, (int)\$_loop); unset(\$_loop);\n";
+                    break;
+
+                case 'show':
+                    if (is_bool($attr_value))
+                        $show_attr_value = $attr_value ? 'true' : 'false';
+                    else
+                        $show_attr_value = "(bool)$attr_value";
+                    $output .= "{$section_props}['show'] = $show_attr_value;\n";
+                    break;
+
+                case 'name':
+                    $output .= "{$section_props}['$attr_name'] = $attr_value;\n";
+                    break;
+
+                case 'max':
+                case 'start':
+                    $output .= "{$section_props}['$attr_name'] = (int)$attr_value;\n";
+                    break;
+
+                case 'step':
+                    $output .= "{$section_props}['$attr_name'] = ((int)$attr_value) == 0 ? 1 : (int)$attr_value;\n";
+                    break;
+
+                default:
+                    $this->_syntax_error("unknown section attribute - '$attr_name'", E_USER_ERROR, __FILE__, __LINE__);
+                    break;
+            }
+        }
+
+        if (!isset($attrs['show']))
+            $output .= "{$section_props}['show'] = true;\n";
+
+        if (!isset($attrs['loop']))
+            $output .= "{$section_props}['loop'] = 1;\n";
+
+        if (!isset($attrs['max']))
+            $output .= "{$section_props}['max'] = {$section_props}['loop'];\n";
+        else
+            $output .= "if ({$section_props}['max'] < 0)\n" .
+                       "    {$section_props}['max'] = {$section_props}['loop'];\n";
+
+        if (!isset($attrs['step']))
+            $output .= "{$section_props}['step'] = 1;\n";
+
+        if (!isset($attrs['start']))
+            $output .= "{$section_props}['start'] = {$section_props}['step'] > 0 ? 0 : {$section_props}['loop']-1;\n";
+        else {
+            $output .= "if ({$section_props}['start'] < 0)\n" .
+                       "    {$section_props}['start'] = max({$section_props}['step'] > 0 ? 0 : -1, {$section_props}['loop'] + {$section_props}['start']);\n" .
+                       "else\n" .
+                       "    {$section_props}['start'] = min({$section_props}['start'], {$section_props}['step'] > 0 ? {$section_props}['loop'] : {$section_props}['loop']-1);\n";
+        }
+
+        $output .= "if ({$section_props}['show']) {\n";
+        if (!isset($attrs['start']) && !isset($attrs['step']) && !isset($attrs['max'])) {
+            $output .= "    {$section_props}['total'] = {$section_props}['loop'];\n";
+        } else {
+            $output .= "    {$section_props}['total'] = min(ceil(({$section_props}['step'] > 0 ? {$section_props}['loop'] - {$section_props}['start'] : {$section_props}['start']+1)/abs({$section_props}['step'])), {$section_props}['max']);\n";
+        }
+        $output .= "    if ({$section_props}['total'] == 0)\n" .
+                   "        {$section_props}['show'] = false;\n" .
+                   "} else\n" .
+                   "    {$section_props}['total'] = 0;\n";
+
+        $output .= "if ({$section_props}['show']):\n";
+        $output .= "
+            for ({$section_props}['index'] = {$section_props}['start'], {$section_props}['iteration'] = 1;
+                 {$section_props}['iteration'] <= {$section_props}['total'];
+                 {$section_props}['index'] += {$section_props}['step'], {$section_props}['iteration']++):\n";
+        $output .= "{$section_props}['rownum'] = {$section_props}['iteration'];\n";
+        $output .= "{$section_props}['index_prev'] = {$section_props}['index'] - {$section_props}['step'];\n";
+        $output .= "{$section_props}['index_next'] = {$section_props}['index'] + {$section_props}['step'];\n";
+        $output .= "{$section_props}['first']      = ({$section_props}['iteration'] == 1);\n";
+        $output .= "{$section_props}['last']       = ({$section_props}['iteration'] == {$section_props}['total']);\n";
+
+        $output .= "?>";
+
+        return $output;
+    }
+
+
+    /**
+     * Compile {foreach ...} tag.
+     *
+     * @param string $tag_args
+     * @return string
+     */
+    function _compile_foreach_start($tag_args)
+    {
+        $attrs = $this->_parse_attrs($tag_args);
+        $arg_list = array();
+
+        if (empty($attrs['from'])) {
+            return $this->_syntax_error("foreach: missing 'from' attribute", E_USER_ERROR, __FILE__, __LINE__);
+        }
+        $from = $attrs['from'];
+
+        if (empty($attrs['item'])) {
+            return $this->_syntax_error("foreach: missing 'item' attribute", E_USER_ERROR, __FILE__, __LINE__);
+        }
+        $item = $this->_dequote($attrs['item']);
+        if (!preg_match('~^\w+$~', $item)) {
+            return $this->_syntax_error("'foreach: item' must be a variable name (literal string)", E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        if (isset($attrs['key'])) {
+            $key  = $this->_dequote($attrs['key']);
+            if (!preg_match('~^\w+$~', $key)) {
+                return $this->_syntax_error("foreach: 'key' must to be a variable name (literal string)", E_USER_ERROR, __FILE__, __LINE__);
+            }
+            $key_part = "\$this->_tpl_vars['$key'] => ";
+        } else {
+            $key = null;
+            $key_part = '';
+        }
+
+        if (isset($attrs['name'])) {
+            $name = $attrs['name'];
+        } else {
+            $name = null;
+        }
+
+        $output = '<?php ';
+        $output .= "\$_from = $from; if (!is_array(\$_from) && !is_object(\$_from)) { settype(\$_from, 'array'); }";
+        if (isset($name)) {
+            $foreach_props = "\$this->_foreach[$name]";
+            $output .= "{$foreach_props} = array('total' => count(\$_from), 'iteration' => 0);\n";
+            $output .= "if ({$foreach_props}['total'] > 0):\n";
+            $output .= "    foreach (\$_from as $key_part\$this->_tpl_vars['$item']):\n";
+            $output .= "        {$foreach_props}['iteration']++;\n";
+        } else {
+            $output .= "if (count(\$_from)):\n";
+            $output .= "    foreach (\$_from as $key_part\$this->_tpl_vars['$item']):\n";
+        }
+        $output .= '?>';
+
+        return $output;
+    }
+
+
+    /**
+     * Compile {capture} .. {/capture} tags
+     *
+     * @param boolean $start true if this is the {capture} tag
+     * @param string $tag_args
+     * @return string
+     */
+
+    function _compile_capture_tag($start, $tag_args = '')
+    {
+        $attrs = $this->_parse_attrs($tag_args);
+
+        if ($start) {
+            if (isset($attrs['name']))
+                $buffer = $attrs['name'];
+            else
+                $buffer = "'default'";
+
+            if (isset($attrs['assign']))
+                $assign = $attrs['assign'];
+            else
+                $assign = null;
+            $output = "<?php ob_start(); ?>";
+            $this->_capture_stack[] = array($buffer, $assign);
+        } else {
+            list($buffer, $assign) = array_pop($this->_capture_stack);
+            $output = "<?php \$this->_smarty_vars['capture'][$buffer] = ob_get_contents(); ";
+            if (isset($assign)) {
+                $output .= " \$this->assign($assign, ob_get_contents());";
+            }
+            $output .= "ob_end_clean(); ?>";
+        }
+
+        return $output;
+    }
+
+    /**
+     * Compile {if ...} tag
+     *
+     * @param string $tag_args
+     * @param boolean $elseif if true, uses elseif instead of if
+     * @return string
+     */
+    function _compile_if_tag($tag_args, $elseif = false)
+    {
+
+        /* Tokenize args for 'if' tag. */
+        preg_match_all('~(?>
+                ' . $this->_obj_call_regexp . '(?:' . $this->_mod_regexp . '*)? | # valid object call
+                ' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*)?    | # var or quoted string
+                \-?0[xX][0-9a-fA-F]+|\-?\d+(?:\.\d+)?|\.\d+|!==|===|==|!=|<>|<<|>>|<=|>=|\&\&|\|\||\(|\)|,|\!|\^|=|\&|\~|<|>|\||\%|\+|\-|\/|\*|\@    | # valid non-word token
+                \b\w+\b                                                        | # valid word token
+                \S+                                                           # anything else
+                )~x', $tag_args, $match);
+
+        $tokens = $match[0];
+
+        if(empty($tokens)) {
+            $_error_msg .= $elseif ? "'elseif'" : "'if'";
+            $_error_msg .= ' statement requires arguments'; 
+            $this->_syntax_error($_error_msg, E_USER_ERROR, __FILE__, __LINE__);
+        }
+            
+                
+        // make sure we have balanced parenthesis
+        $token_count = array_count_values($tokens);
+        if(isset($token_count['(']) && $token_count['('] != $token_count[')']) {
+            $this->_syntax_error("unbalanced parenthesis in if statement", E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        $is_arg_stack = array();
+
+        for ($i = 0; $i < count($tokens); $i++) {
+
+            $token = &$tokens[$i];
+
+            switch (strtolower($token)) {
+                case '!':
+                case '%':
+                case '!==':
+                case '==':
+                case '===':
+                case '>':
+                case '<':
+                case '!=':
+                case '<>':
+                case '<<':
+                case '>>':
+                case '<=':
+                case '>=':
+                case '&&':
+                case '||':
+                case '|':
+                case '^':
+                case '&':
+                case '~':
+                case ')':
+                case ',':
+                case '+':
+                case '-':
+                case '*':
+                case '/':
+                case '@':
+                    break;
+
+                case 'eq':
+                    $token = '==';
+                    break;
+
+                case 'ne':
+                case 'neq':
+                    $token = '!=';
+                    break;
+
+                case 'lt':
+                    $token = '<';
+                    break;
+
+                case 'le':
+                case 'lte':
+                    $token = '<=';
+                    break;
+
+                case 'gt':
+                    $token = '>';
+                    break;
+
+                case 'ge':
+                case 'gte':
+                    $token = '>=';
+                    break;
+
+                case 'and':
+                    $token = '&&';
+                    break;
+
+                case 'or':
+                    $token = '||';
+                    break;
+
+                case 'not':
+                    $token = '!';
+                    break;
+
+                case 'mod':
+                    $token = '%';
+                    break;
+
+                case '(':
+                    array_push($is_arg_stack, $i);
+                    break;
+
+                case 'is':
+                    /* If last token was a ')', we operate on the parenthesized
+                       expression. The start of the expression is on the stack.
+                       Otherwise, we operate on the last encountered token. */
+                    if ($tokens[$i-1] == ')')
+                        $is_arg_start = array_pop($is_arg_stack);
+                    else
+                        $is_arg_start = $i-1;
+                    /* Construct the argument for 'is' expression, so it knows
+                       what to operate on. */
+                    $is_arg = implode(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start));
+
+                    /* Pass all tokens from next one until the end to the
+                       'is' expression parsing function. The function will
+                       return modified tokens, where the first one is the result
+                       of the 'is' expression and the rest are the tokens it
+                       didn't touch. */
+                    $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i+1));
+
+                    /* Replace the old tokens with the new ones. */
+                    array_splice($tokens, $is_arg_start, count($tokens), $new_tokens);
+
+                    /* Adjust argument start so that it won't change from the
+                       current position for the next iteration. */
+                    $i = $is_arg_start;
+                    break;
+
+                default:
+                    if(preg_match('~^' . $this->_func_regexp . '$~', $token) ) {
+                            // function call
+                            if($this->security &&
+                               !in_array($token, $this->security_settings['IF_FUNCS'])) {
+                                $this->_syntax_error("(secure mode) '$token' not allowed in if statement", E_USER_ERROR, __FILE__, __LINE__);
+                            }
+                    } elseif(preg_match('~^' . $this->_var_regexp . '$~', $token) && (strpos('+-*/^%&|', substr($token, -1)) === false) && isset($tokens[$i+1]) && $tokens[$i+1] == '(') {
+                        // variable function call
+                        $this->_syntax_error("variable function call '$token' not allowed in if statement", E_USER_ERROR, __FILE__, __LINE__);                      
+                    } elseif(preg_match('~^' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*)$~', $token)) {
+                        // object or variable
+                        $token = $this->_parse_var_props($token);
+                    } elseif(is_numeric($token)) {
+                        // number, skip it
+                    } else {
+                        $this->_syntax_error("unidentified token '$token'", E_USER_ERROR, __FILE__, __LINE__);
+                    }
+                    break;
+            }
+        }
+
+        if ($elseif)
+            return '<?php elseif ('.implode(' ', $tokens).'): ?>';
+        else
+            return '<?php if ('.implode(' ', $tokens).'): ?>';
+    }
+
+
+    function _compile_arg_list($type, $name, $attrs, &$cache_code) {
+        $arg_list = array();
+
+        if (isset($type) && isset($name)
+            && isset($this->_plugins[$type])
+            && isset($this->_plugins[$type][$name])
+            && empty($this->_plugins[$type][$name][4])
+            && is_array($this->_plugins[$type][$name][5])
+            ) {
+            /* we have a list of parameters that should be cached */
+            $_cache_attrs = $this->_plugins[$type][$name][5];
+            $_count = $this->_cache_attrs_count++;
+            $cache_code = "\$_cache_attrs =& \$this->_smarty_cache_attrs('$this->_cache_serial','$_count');";
+
+        } else {
+            /* no parameters are cached */
+            $_cache_attrs = null;
+        }
+
+        foreach ($attrs as $arg_name => $arg_value) {
+            if (is_bool($arg_value))
+                $arg_value = $arg_value ? 'true' : 'false';
+            if (is_null($arg_value))
+                $arg_value = 'null';
+            if ($_cache_attrs && in_array($arg_name, $_cache_attrs)) {
+                $arg_list[] = "'$arg_name' => (\$this->_cache_including) ? \$_cache_attrs['$arg_name'] : (\$_cache_attrs['$arg_name']=$arg_value)";
+            } else {
+                $arg_list[] = "'$arg_name' => $arg_value";
+            }
+        }
+        return $arg_list;
+    }
+
+    /**
+     * Parse is expression
+     *
+     * @param string $is_arg
+     * @param array $tokens
+     * @return array
+     */
+    function _parse_is_expr($is_arg, $tokens)
+    {
+        $expr_end = 0;
+        $negate_expr = false;
+
+        if (($first_token = array_shift($tokens)) == 'not') {
+            $negate_expr = true;
+            $expr_type = array_shift($tokens);
+        } else
+            $expr_type = $first_token;
+
+        switch ($expr_type) {
+            case 'even':
+                if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') {
+                    $expr_end++;
+                    $expr_arg = $tokens[$expr_end++];
+                    $expr = "!(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
+                } else
+                    $expr = "!(1 & $is_arg)";
+                break;
+
+            case 'odd':
+                if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') {
+                    $expr_end++;
+                    $expr_arg = $tokens[$expr_end++];
+                    $expr = "(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
+                } else
+                    $expr = "(1 & $is_arg)";
+                break;
+
+            case 'div':
+                if (@$tokens[$expr_end] == 'by') {
+                    $expr_end++;
+                    $expr_arg = $tokens[$expr_end++];
+                    $expr = "!($is_arg % " . $this->_parse_var_props($expr_arg) . ")";
+                } else {
+                    $this->_syntax_error("expecting 'by' after 'div'", E_USER_ERROR, __FILE__, __LINE__);
+                }
+                break;
+
+            default:
+                $this->_syntax_error("unknown 'is' expression - '$expr_type'", E_USER_ERROR, __FILE__, __LINE__);
+                break;
+        }
+
+        if ($negate_expr) {
+            $expr = "!($expr)";
+        }
+
+        array_splice($tokens, 0, $expr_end, $expr);
+
+        return $tokens;
+    }
+
+
+    /**
+     * Parse attribute string
+     *
+     * @param string $tag_args
+     * @return array
+     */
+    function _parse_attrs($tag_args)
+    {
+
+        /* Tokenize tag attributes. */
+        preg_match_all('~(?:' . $this->_obj_call_regexp . '|' . $this->_qstr_regexp . ' | (?>[^"\'=\s]+)
+                         )+ |
+                         [=]
+                        ~x', $tag_args, $match);
+        $tokens       = $match[0];
+
+        $attrs = array();
+        /* Parse state:
+            0 - expecting attribute name
+            1 - expecting '='
+            2 - expecting attribute value (not '=') */
+        $state = 0;
+
+        foreach ($tokens as $token) {
+            switch ($state) {
+                case 0:
+                    /* If the token is a valid identifier, we set attribute name
+                       and go to state 1. */
+                    if (preg_match('~^\w+$~', $token)) {
+                        $attr_name = $token;
+                        $state = 1;
+                    } else
+                        $this->_syntax_error("invalid attribute name: '$token'", E_USER_ERROR, __FILE__, __LINE__);
+                    break;
+
+                case 1:
+                    /* If the token is '=', then we go to state 2. */
+                    if ($token == '=') {
+                        $state = 2;
+                    } else
+                        $this->_syntax_error("expecting '=' after attribute name '$last_token'", E_USER_ERROR, __FILE__, __LINE__);
+                    break;
+
+                case 2:
+                    /* If token is not '=', we set the attribute value and go to
+                       state 0. */
+                    if ($token != '=') {
+                        /* We booleanize the token if it's a non-quoted possible
+                           boolean value. */
+                        if (preg_match('~^(on|yes|true)$~', $token)) {
+                            $token = 'true';
+                        } else if (preg_match('~^(off|no|false)$~', $token)) {
+                            $token = 'false';
+                        } else if ($token == 'null') {
+                            $token = 'null';
+                        } else if (preg_match('~^' . $this->_num_const_regexp . '|0[xX][0-9a-fA-F]+$~', $token)) {
+                            /* treat integer literally */
+                        } else if (!preg_match('~^' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '(?:' . $this->_mod_regexp . ')*$~', $token)) {
+                            /* treat as a string, double-quote it escaping quotes */
+                            $token = '"'.addslashes($token).'"';
+                        }
+
+                        $attrs[$attr_name] = $token;
+                        $state = 0;
+                    } else
+                        $this->_syntax_error("'=' cannot be an attribute value", E_USER_ERROR, __FILE__, __LINE__);
+                    break;
+            }
+            $last_token = $token;
+        }
+
+        if($state != 0) {
+            if($state == 1) {
+                $this->_syntax_error("expecting '=' after attribute name '$last_token'", E_USER_ERROR, __FILE__, __LINE__);
+            } else {
+                $this->_syntax_error("missing attribute value", E_USER_ERROR, __FILE__, __LINE__);
+            }
+        }
+
+        $this->_parse_vars_props($attrs);
+
+        return $attrs;
+    }
+
+    /**
+     * compile multiple variables and section properties tokens into
+     * PHP code
+     *
+     * @param array $tokens
+     */
+    function _parse_vars_props(&$tokens)
+    {
+        foreach($tokens as $key => $val) {
+            $tokens[$key] = $this->_parse_var_props($val);
+        }
+    }
+
+    /**
+     * compile single variable and section properties token into
+     * PHP code
+     *
+     * @param string $val
+     * @param string $tag_attrs
+     * @return string
+     */
+    function _parse_var_props($val)
+    {
+        $val = trim($val);
+
+        if(preg_match('~^(' . $this->_obj_call_regexp . '|' . $this->_dvar_regexp . ')(' . $this->_mod_regexp . '*)$~', $val, $match)) {
+            // $ variable or object
+            $return = $this->_parse_var($match[1]);
+            $modifiers = $match[2];
+            if (!empty($this->default_modifiers) && !preg_match('~(^|\|)smarty:nodefaults($|\|)~',$modifiers)) {
+                $_default_mod_string = implode('|',(array)$this->default_modifiers);
+                $modifiers = empty($modifiers) ? $_default_mod_string : $_default_mod_string . '|' . $modifiers;
+            }
+            $this->_parse_modifiers($return, $modifiers);
+            return $return;
+        } elseif (preg_match('~^' . $this->_db_qstr_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
+                // double quoted text
+                preg_match('~^(' . $this->_db_qstr_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match);
+                $return = $this->_expand_quoted_text($match[1]);
+                if($match[2] != '') {
+                    $this->_parse_modifiers($return, $match[2]);
+                }
+                return $return;
+            }
+        elseif(preg_match('~^' . $this->_num_const_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
+                // numerical constant
+                preg_match('~^(' . $this->_num_const_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match);
+                if($match[2] != '') {
+                    $this->_parse_modifiers($match[1], $match[2]);
+                    return $match[1];
+                }
+            }
+        elseif(preg_match('~^' . $this->_si_qstr_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
+                // single quoted text
+                preg_match('~^(' . $this->_si_qstr_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match);
+                if($match[2] != '') {
+                    $this->_parse_modifiers($match[1], $match[2]);
+                    return $match[1];
+                }
+            }
+        elseif(preg_match('~^' . $this->_cvar_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
+                // config var
+                return $this->_parse_conf_var($val);
+            }
+        elseif(preg_match('~^' . $this->_svar_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) {
+                // section var
+                return $this->_parse_section_prop($val);
+            }
+        elseif(!in_array($val, $this->_permitted_tokens) && !is_numeric($val)) {
+            // literal string
+            return $this->_expand_quoted_text('"' . strtr($val, array('\\' => '\\\\', '"' => '\\"')) .'"');
+        }
+        return $val;
+    }
+
+    /**
+     * expand quoted text with embedded variables
+     *
+     * @param string $var_expr
+     * @return string
+     */
+    function _expand_quoted_text($var_expr)
+    {
+        // if contains unescaped $, expand it
+        if(preg_match_all('~(?:\`(?<!\\\\)\$' . $this->_dvar_guts_regexp . '(?:' . $this->_obj_ext_regexp . ')*\`)|(?:(?<!\\\\)\$\w+(\[[a-zA-Z0-9]+\])*)~', $var_expr, $_match)) {
+            $_match = $_match[0];
+            rsort($_match);
+            reset($_match);
+            foreach($_match as $_var) {
+                $var_expr = str_replace ($_var, '".(' . $this->_parse_var(str_replace('`','',$_var)) . ')."', $var_expr);
+            }
+            $_return = preg_replace('~\.""|(?<!\\\\)""\.~', '', $var_expr);
+        } else {
+            $_return = $var_expr;
+        }
+        // replace double quoted literal string with single quotes
+        $_return = preg_replace('~^"([\s\w]+)"$~',"'\\1'",$_return);
+        return $_return;
+    }
+
+    /**
+     * parse variable expression into PHP code
+     *
+     * @param string $var_expr
+     * @param string $output
+     * @return string
+     */
+    function _parse_var($var_expr)
+    {
+        $_has_math = false;
+        $_math_vars = preg_split('~('.$this->_dvar_math_regexp.'|'.$this->_qstr_regexp.')~', $var_expr, -1, PREG_SPLIT_DELIM_CAPTURE);
+
+        if(count($_math_vars) > 1) {
+            $_first_var = "";
+            $_complete_var = "";
+            $_output = "";
+            // simple check if there is any math, to stop recursion (due to modifiers with "xx % yy" as parameter)
+            foreach($_math_vars as $_k => $_math_var) {
+                $_math_var = $_math_vars[$_k];
+
+                if(!empty($_math_var) || is_numeric($_math_var)) {
+                    // hit a math operator, so process the stuff which came before it
+                    if(preg_match('~^' . $this->_dvar_math_regexp . '$~', $_math_var)) {
+                        $_has_math = true;
+                        if(!empty($_complete_var) || is_numeric($_complete_var)) {
+                            $_output .= $this->_parse_var($_complete_var);
+                        }
+
+                        // just output the math operator to php
+                        $_output .= $_math_var;
+
+                        if(empty($_first_var))
+                            $_first_var = $_complete_var;
+
+                        $_complete_var = "";
+                    } else {
+                        $_complete_var .= $_math_var;
+                    }
+                }
+            }
+            if($_has_math) {
+                if(!empty($_complete_var) || is_numeric($_complete_var))
+                    $_output .= $this->_parse_var($_complete_var);
+
+                // get the modifiers working (only the last var from math + modifier is left)
+                $var_expr = $_complete_var;
+            }
+        }
+
+        // prevent cutting of first digit in the number (we _definitly_ got a number if the first char is a digit)
+        if(is_numeric(substr($var_expr, 0, 1)))
+            $_var_ref = $var_expr;
+        else
+            $_var_ref = substr($var_expr, 1);
+        
+        if(!$_has_math) {
+            
+            // get [foo] and .foo and ->foo and (...) pieces
+            preg_match_all('~(?:^\w+)|' . $this->_obj_params_regexp . '|(?:' . $this->_var_bracket_regexp . ')|->\$?\w+|\.\$?\w+|\S+~', $_var_ref, $match);
+                        
+            $_indexes = $match[0];
+            $_var_name = array_shift($_indexes);
+
+            /* Handle $smarty.* variable references as a special case. */
+            if ($_var_name == 'smarty') {
+                /*
+                 * If the reference could be compiled, use the compiled output;
+                 * otherwise, fall back on the $smarty variable generated at
+                 * run-time.
+                 */
+                if (($smarty_ref = $this->_compile_smarty_ref($_indexes)) !== null) {
+                    $_output = $smarty_ref;
+                } else {
+                    $_var_name = substr(array_shift($_indexes), 1);
+                    $_output = "\$this->_smarty_vars['$_var_name']";
+                }
+            } elseif(is_numeric($_var_name) && is_numeric(substr($var_expr, 0, 1))) {
+                // because . is the operator for accessing arrays thru inidizes we need to put it together again for floating point numbers
+                if(count($_indexes) > 0)
+                {
+                    $_var_name .= implode("", $_indexes);
+                    $_indexes = array();
+                }
+                $_output = $_var_name;
+            } else {
+                $_output = "\$this->_tpl_vars['$_var_name']";
+            }
+
+            foreach ($_indexes as $_index) {
+                if (substr($_index, 0, 1) == '[') {
+                    $_index = substr($_index, 1, -1);
+                    if (is_numeric($_index)) {
+                        $_output .= "[$_index]";
+                    } elseif (substr($_index, 0, 1) == '$') {
+                        if (strpos($_index, '.') !== false) {
+                            $_output .= '[' . $this->_parse_var($_index) . ']';
+                        } else {
+                            $_output .= "[\$this->_tpl_vars['" . substr($_index, 1) . "']]";
+                        }
+                    } else {
+                        $_var_parts = explode('.', $_index);
+                        $_var_section = $_var_parts[0];
+                        $_var_section_prop = isset($_var_parts[1]) ? $_var_parts[1] : 'index';
+                        $_output .= "[\$this->_sections['$_var_section']['$_var_section_prop']]";
+                    }
+                } else if (substr($_index, 0, 1) == '.') {
+                    if (substr($_index, 1, 1) == '$')
+                        $_output .= "[\$this->_tpl_vars['" . substr($_index, 2) . "']]";
+                    else
+                        $_output .= "['" . substr($_index, 1) . "']";
+                } else if (substr($_index,0,2) == '->') {
+                    if(substr($_index,2,2) == '__') {
+                        $this->_syntax_error('call to internal object members is not allowed', E_USER_ERROR, __FILE__, __LINE__);
+                    } elseif($this->security && substr($_index, 2, 1) == '_') {
+                        $this->_syntax_error('(secure) call to private object member is not allowed', E_USER_ERROR, __FILE__, __LINE__);
+                    } elseif (substr($_index, 2, 1) == '$') {
+                        if ($this->security) {
+                            $this->_syntax_error('(secure) call to dynamic object member is not allowed', E_USER_ERROR, __FILE__, __LINE__);
+                        } else {
+                            $_output .= '->{(($_var=$this->_tpl_vars[\''.substr($_index,3).'\']) && substr($_var,0,2)!=\'__\') ? $_var : $this->trigger_error("cannot access property \\"$_var\\"")}';
+                        }
+                    } else {
+                        $_output .= $_index;
+                    }
+                } elseif (substr($_index, 0, 1) == '(') {
+                    $_index = $this->_parse_parenth_args($_index);
+                    $_output .= $_index;
+                } else {
+                    $_output .= $_index;
+                }
+            }
+        }
+
+        return $_output;
+    }
+
+    /**
+     * parse arguments in function call parenthesis
+     *
+     * @param string $parenth_args
+     * @return string
+     */
+    function _parse_parenth_args($parenth_args)
+    {
+        preg_match_all('~' . $this->_param_regexp . '~',$parenth_args, $match);
+        $orig_vals = $match = $match[0];
+        $this->_parse_vars_props($match);
+        $replace = array();
+        for ($i = 0, $count = count($match); $i < $count; $i++) {
+            $replace[$orig_vals[$i]] = $match[$i];
+        }
+        return strtr($parenth_args, $replace);
+    }
+
+    /**
+     * parse configuration variable expression into PHP code
+     *
+     * @param string $conf_var_expr
+     */
+    function _parse_conf_var($conf_var_expr)
+    {
+        $parts = explode('|', $conf_var_expr, 2);
+        $var_ref = $parts[0];
+        $modifiers = isset($parts[1]) ? $parts[1] : '';
+
+        $var_name = substr($var_ref, 1, -1);
+
+        $output = "\$this->_config[0]['vars']['$var_name']";
+
+        $this->_parse_modifiers($output, $modifiers);
+
+        return $output;
+    }
+
+    /**
+     * parse section property expression into PHP code
+     *
+     * @param string $section_prop_expr
+     * @return string
+     */
+    function _parse_section_prop($section_prop_expr)
+    {
+        $parts = explode('|', $section_prop_expr, 2);
+        $var_ref = $parts[0];
+        $modifiers = isset($parts[1]) ? $parts[1] : '';
+
+        preg_match('!%(\w+)\.(\w+)%!', $var_ref, $match);
+        $section_name = $match[1];
+        $prop_name = $match[2];
+
+        $output = "\$this->_sections['$section_name']['$prop_name']";
+
+        $this->_parse_modifiers($output, $modifiers);
+
+        return $output;
+    }
+
+
+    /**
+     * parse modifier chain into PHP code
+     *
+     * sets $output to parsed modified chain
+     * @param string $output
+     * @param string $modifier_string
+     */
+    function _parse_modifiers(&$output, $modifier_string)
+    {
+        preg_match_all('~\|(@?\w+)((?>:(?:'. $this->_qstr_regexp . '|[^|]+))*)~', '|' . $modifier_string, $_match);
+        list(, $_modifiers, $modifier_arg_strings) = $_match;
+
+        for ($_i = 0, $_for_max = count($_modifiers); $_i < $_for_max; $_i++) {
+            $_modifier_name = $_modifiers[$_i];
+
+            if($_modifier_name == 'smarty') {
+                // skip smarty modifier
+                continue;
+            }
+
+            preg_match_all('~:(' . $this->_qstr_regexp . '|[^:]+)~', $modifier_arg_strings[$_i], $_match);
+            $_modifier_args = $_match[1];
+
+            if (substr($_modifier_name, 0, 1) == '@') {
+                $_map_array = false;
+                $_modifier_name = substr($_modifier_name, 1);
+            } else {
+                $_map_array = true;
+            }
+
+            if (empty($this->_plugins['modifier'][$_modifier_name])
+                && !$this->_get_plugin_filepath('modifier', $_modifier_name)
+                && function_exists($_modifier_name)) {
+                if ($this->security && !in_array($_modifier_name, $this->security_settings['MODIFIER_FUNCS'])) {
+                    $this->_trigger_fatal_error("[plugin] (secure mode) modifier '$_modifier_name' is not allowed" , $this->_current_file, $this->_current_line_no, __FILE__, __LINE__);
+                } else {
+                    $this->_plugins['modifier'][$_modifier_name] = array($_modifier_name,  null, null, false);
+                }
+            }
+            $this->_add_plugin('modifier', $_modifier_name);
+
+            $this->_parse_vars_props($_modifier_args);
+
+            if($_modifier_name == 'default') {
+                // supress notifications of default modifier vars and args
+                if(substr($output, 0, 1) == '$') {
+                    $output = '@' . $output;
+                }
+                if(isset($_modifier_args[0]) && substr($_modifier_args[0], 0, 1) == '$') {
+                    $_modifier_args[0] = '@' . $_modifier_args[0];
+                }
+            }
+            if (count($_modifier_args) > 0)
+                $_modifier_args = ', '.implode(', ', $_modifier_args);
+            else
+                $_modifier_args = '';
+
+            if ($_map_array) {
+                $output = "((is_array(\$_tmp=$output)) ? \$this->_run_mod_handler('$_modifier_name', true, \$_tmp$_modifier_args) : " . $this->_compile_plugin_call('modifier', $_modifier_name) . "(\$_tmp$_modifier_args))";
+
+            } else {
+
+                $output = $this->_compile_plugin_call('modifier', $_modifier_name)."($output$_modifier_args)";
+
+            }
+        }
+    }
+
+
+    /**
+     * add plugin
+     *
+     * @param string $type
+     * @param string $name
+     * @param boolean? $delayed_loading
+     */
+    function _add_plugin($type, $name, $delayed_loading = null)
+    {
+        if (!isset($this->_plugin_info[$type])) {
+            $this->_plugin_info[$type] = array();
+        }
+        if (!isset($this->_plugin_info[$type][$name])) {
+            $this->_plugin_info[$type][$name] = array($this->_current_file,
+                                                      $this->_current_line_no,
+                                                      $delayed_loading);
+        }
+    }
+
+
+    /**
+     * Compiles references of type $smarty.foo
+     *
+     * @param string $indexes
+     * @return string
+     */
+    function _compile_smarty_ref(&$indexes)
+    {
+        /* Extract the reference name. */
+        $_ref = substr($indexes[0], 1);
+        foreach($indexes as $_index_no=>$_index) {
+            if (substr($_index, 0, 1) != '.' && $_index_no<2 || !preg_match('~^(\.|\[|->)~', $_index)) {
+                $this->_syntax_error('$smarty' . implode('', array_slice($indexes, 0, 2)) . ' is an invalid reference', E_USER_ERROR, __FILE__, __LINE__);
+            }
+        }
+
+        switch ($_ref) {
+            case 'now':
+                $compiled_ref = 'time()';
+                $_max_index = 1;
+                break;
+
+            case 'foreach':
+                array_shift($indexes);
+                $_var = $this->_parse_var_props(substr($indexes[0], 1));
+                $_propname = substr($indexes[1], 1);
+                $_max_index = 1;
+                switch ($_propname) {
+                    case 'index':
+                        array_shift($indexes);
+                        $compiled_ref = "(\$this->_foreach[$_var]['iteration']-1)";
+                        break;
+                        
+                    case 'first':
+                        array_shift($indexes);
+                        $compiled_ref = "(\$this->_foreach[$_var]['iteration'] <= 1)";
+                        break;
+
+                    case 'last':
+                        array_shift($indexes);
+                        $compiled_ref = "(\$this->_foreach[$_var]['iteration'] == \$this->_foreach[$_var]['total'])";
+                        break;
+                        
+                    case 'show':
+                        array_shift($indexes);
+                        $compiled_ref = "(\$this->_foreach[$_var]['total'] > 0)";
+                        break;
+                        
+                    default:
+                        unset($_max_index);
+                        $compiled_ref = "\$this->_foreach[$_var]";
+                }
+                break;
+
+            case 'section':
+                array_shift($indexes);
+                $_var = $this->_parse_var_props(substr($indexes[0], 1));
+                $compiled_ref = "\$this->_sections[$_var]";
+                break;
+
+            case 'get':
+                $compiled_ref = ($this->request_use_auto_globals) ? '$_GET' : "\$GLOBALS['HTTP_GET_VARS']";
+                break;
+
+            case 'post':
+                $compiled_ref = ($this->request_use_auto_globals) ? '$_POST' : "\$GLOBALS['HTTP_POST_VARS']";
+                break;
+
+            case 'cookies':
+                $compiled_ref = ($this->request_use_auto_globals) ? '$_COOKIE' : "\$GLOBALS['HTTP_COOKIE_VARS']";
+                break;
+
+            case 'env':
+                $compiled_ref = ($this->request_use_auto_globals) ? '$_ENV' : "\$GLOBALS['HTTP_ENV_VARS']";
+                break;
+
+            case 'server':
+                $compiled_ref = ($this->request_use_auto_globals) ? '$_SERVER' : "\$GLOBALS['HTTP_SERVER_VARS']";
+                break;
+
+            case 'session':
+                $compiled_ref = ($this->request_use_auto_globals) ? '$_SESSION' : "\$GLOBALS['HTTP_SESSION_VARS']";
+                break;
+
+            /*
+             * These cases are handled either at run-time or elsewhere in the
+             * compiler.
+             */
+            case 'request':
+                if ($this->request_use_auto_globals) {
+                    $compiled_ref = '$_REQUEST';
+                    break;
+                } else {
+                    $this->_init_smarty_vars = true;
+                }
+                return null;
+
+            case 'capture':
+                return null;
+
+            case 'template':
+                $compiled_ref = "'$this->_current_file'";
+                $_max_index = 1;
+                break;
+
+            case 'version':
+                $compiled_ref = "'$this->_version'";
+                $_max_index = 1;
+                break;
+
+            case 'const':
+                if ($this->security && !$this->security_settings['ALLOW_CONSTANTS']) {
+                    $this->_syntax_error("(secure mode) constants not permitted",
+                                         E_USER_WARNING, __FILE__, __LINE__);
+                    return;
+                }
+                array_shift($indexes);
+                if (preg_match('!^\.\w+$!', $indexes[0])) {
+                    $compiled_ref = '@' . substr($indexes[0], 1);
+                } else {
+                    $_val = $this->_parse_var_props(substr($indexes[0], 1));
+                    $compiled_ref = '@constant(' . $_val . ')';
+                }
+                $_max_index = 1;
+                break;
+
+            case 'config':
+                $compiled_ref = "\$this->_config[0]['vars']";
+                $_max_index = 3;
+                break;
+
+            case 'ldelim':
+                $compiled_ref = "'$this->left_delimiter'";
+                break;
+
+            case 'rdelim':
+                $compiled_ref = "'$this->right_delimiter'";
+                break;
+                
+            default:
+                $this->_syntax_error('$smarty.' . $_ref . ' is an unknown reference', E_USER_ERROR, __FILE__, __LINE__);
+                break;
+        }
+
+        if (isset($_max_index) && count($indexes) > $_max_index) {
+            $this->_syntax_error('$smarty' . implode('', $indexes) .' is an invalid reference', E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        array_shift($indexes);
+        return $compiled_ref;
+    }
+
+    /**
+     * compiles call to plugin of type $type with name $name
+     * returns a string containing the function-name or method call
+     * without the paramter-list that would have follow to make the
+     * call valid php-syntax
+     *
+     * @param string $type
+     * @param string $name
+     * @return string
+     */
+    function _compile_plugin_call($type, $name) {
+        if (isset($this->_plugins[$type][$name])) {
+            /* plugin loaded */
+            if (is_array($this->_plugins[$type][$name][0])) {
+                return ((is_object($this->_plugins[$type][$name][0][0])) ?
+                        "\$this->_plugins['$type']['$name'][0][0]->"    /* method callback */
+                        : (string)($this->_plugins[$type][$name][0][0]).'::'    /* class callback */
+                       ). $this->_plugins[$type][$name][0][1];
+
+            } else {
+                /* function callback */
+                return $this->_plugins[$type][$name][0];
+
+            }
+        } else {
+            /* plugin not loaded -> auto-loadable-plugin */
+            return 'smarty_'.$type.'_'.$name;
+
+        }
+    }
+
+    /**
+     * load pre- and post-filters
+     */
+    function _load_filters()
+    {
+        if (count($this->_plugins['prefilter']) > 0) {
+            foreach ($this->_plugins['prefilter'] as $filter_name => $prefilter) {
+                if ($prefilter === false) {
+                    unset($this->_plugins['prefilter'][$filter_name]);
+                    $_params = array('plugins' => array(array('prefilter', $filter_name, null, null, false)));
+                    require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
+                    smarty_core_load_plugins($_params, $this);
+                }
+            }
+        }
+        if (count($this->_plugins['postfilter']) > 0) {
+            foreach ($this->_plugins['postfilter'] as $filter_name => $postfilter) {
+                if ($postfilter === false) {
+                    unset($this->_plugins['postfilter'][$filter_name]);
+                    $_params = array('plugins' => array(array('postfilter', $filter_name, null, null, false)));
+                    require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
+                    smarty_core_load_plugins($_params, $this);
+                }
+            }
+        }
+    }
+
+
+    /**
+     * Quote subpattern references
+     *
+     * @param string $string
+     * @return string
+     */
+    function _quote_replace($string)
+    {
+        return strtr($string, array('\\' => '\\\\', '$' => '\\$'));
+    }
+
+    /**
+     * display Smarty syntax error
+     *
+     * @param string $error_msg
+     * @param integer $error_type
+     * @param string $file
+     * @param integer $line
+     */
+    function _syntax_error($error_msg, $error_type = E_USER_ERROR, $file=null, $line=null)
+    {
+        $this->_trigger_fatal_error("syntax error: $error_msg", $this->_current_file, $this->_current_line_no, $file, $line, $error_type);
+    }
+
+
+    /**
+     * check if the compilation changes from cacheable to
+     * non-cacheable state with the beginning of the current
+     * plugin. return php-code to reflect the transition.
+     * @return string
+     */
+    function _push_cacheable_state($type, $name) {
+        $_cacheable = !isset($this->_plugins[$type][$name]) || $this->_plugins[$type][$name][4];
+        if ($_cacheable
+            || 0<$this->_cacheable_state++) return '';
+        if (!isset($this->_cache_serial)) $this->_cache_serial = md5(uniqid('Smarty'));
+        $_ret = 'if ($this->caching && !$this->_cache_including) { echo \'{nocache:'
+            . $this->_cache_serial . '#' . $this->_nocache_count
+            . '}\'; };';
+        return $_ret;
+    }
+
+
+    /**
+     * check if the compilation changes from non-cacheable to
+     * cacheable state with the end of the current plugin return
+     * php-code to reflect the transition.
+     * @return string
+     */
+    function _pop_cacheable_state($type, $name) {
+        $_cacheable = !isset($this->_plugins[$type][$name]) || $this->_plugins[$type][$name][4];
+        if ($_cacheable
+            || --$this->_cacheable_state>0) return '';
+        return 'if ($this->caching && !$this->_cache_including) { echo \'{/nocache:'
+            . $this->_cache_serial . '#' . ($this->_nocache_count++)
+            . '}\'; };';
+    }
+
+
+    /**
+     * push opening tag-name, file-name and line-number on the tag-stack
+     * @param string the opening tag's name
+     */
+    function _push_tag($open_tag)
+    {
+        array_push($this->_tag_stack, array($open_tag, $this->_current_line_no));
+    }
+
+    /**
+     * pop closing tag-name
+     * raise an error if this stack-top doesn't match with the closing tag
+     * @param string the closing tag's name
+     * @return string the opening tag's name
+     */
+    function _pop_tag($close_tag)
+    {
+        $message = '';
+        if (count($this->_tag_stack)>0) {
+            list($_open_tag, $_line_no) = array_pop($this->_tag_stack);
+            if ($close_tag == $_open_tag) {
+                return $_open_tag;
+            }
+            if ($close_tag == 'if' && ($_open_tag == 'else' || $_open_tag == 'elseif' )) {
+                return $this->_pop_tag($close_tag);
+            }
+            if ($close_tag == 'section' && $_open_tag == 'sectionelse') {
+                $this->_pop_tag($close_tag);
+                return $_open_tag;
+            }
+            if ($close_tag == 'foreach' && $_open_tag == 'foreachelse') {
+                $this->_pop_tag($close_tag);
+                return $_open_tag;
+            }
+            if ($_open_tag == 'else' || $_open_tag == 'elseif') {
+                $_open_tag = 'if';
+            } elseif ($_open_tag == 'sectionelse') {
+                $_open_tag = 'section';
+            } elseif ($_open_tag == 'foreachelse') {
+                $_open_tag = 'foreach';
+            }
+            $message = " expected {/$_open_tag} (opened line $_line_no).";
+        }
+        $this->_syntax_error("mismatched tag {/$close_tag}.$message",
+                             E_USER_ERROR, __FILE__, __LINE__);
+    }
+
+}
+
+/**
+ * compare to values by their string length
+ *
+ * @access private
+ * @param string $a
+ * @param string $b
+ * @return 0|-1|1
+ */
+function _smarty_sort_length($a, $b)
+{
+    if($a == $b)
+        return 0;
+
+    if(strlen($a) == strlen($b))
+        return ($a > $b) ? -1 : 1;
+
+    return (strlen($a) > strlen($b)) ? -1 : 1;
+}
+
+
+/* vim: set et: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/debug.tpl b/GPL_LIB/Smarty/libs/debug.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..7f1c9d42587ceb21a097334af84aa6292f352f67
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/debug.tpl
@@ -0,0 +1,64 @@
+{* Smarty *}
+
+{* debug.tpl, last updated version 2.0.1 *}
+
+{assign_debug_info}
+
+{if isset($_smarty_debug_output) and $_smarty_debug_output eq "html"}
+	<table border=0 width=100%>
+	<tr bgcolor=#cccccc><th colspan=2>Smarty Debug Console</th></tr>
+	<tr bgcolor=#cccccc><td colspan=2><b>included templates & config files (load time in seconds):</b></td></tr>
+	{section name=templates loop=$_debug_tpls}
+		<tr bgcolor={if %templates.index% is even}#eeeeee{else}#fafafa{/if}><td colspan=2><tt>{section name=indent loop=$_debug_tpls[templates].depth}&nbsp;&nbsp;&nbsp;{/section}<font color={if $_debug_tpls[templates].type eq "template"}brown{elseif $_debug_tpls[templates].type eq "insert"}black{else}green{/if}>{$_debug_tpls[templates].filename|escape:html}</font>{if isset($_debug_tpls[templates].exec_time)} <font size=-1><i>({$_debug_tpls[templates].exec_time|string_format:"%.5f"}){if %templates.index% eq 0} (total){/if}</i></font>{/if}</tt></td></tr>
+	{sectionelse}
+		<tr bgcolor=#eeeeee><td colspan=2><tt><i>no templates included</i></tt></td></tr>	
+	{/section}
+	<tr bgcolor=#cccccc><td colspan=2><b>assigned template variables:</b></td></tr>
+	{section name=vars loop=$_debug_keys}
+		<tr bgcolor={if %vars.index% is even}#eeeeee{else}#fafafa{/if}><td valign=top><tt><font color=blue>{ldelim}${$_debug_keys[vars]}{rdelim}</font></tt></td><td nowrap><tt><font color=green>{$_debug_vals[vars]|@debug_print_var}</font></tt></td></tr>
+	{sectionelse}
+		<tr bgcolor=#eeeeee><td colspan=2><tt><i>no template variables assigned</i></tt></td></tr>	
+	{/section}
+	<tr bgcolor=#cccccc><td colspan=2><b>assigned config file variables (outer template scope):</b></td></tr>
+	{section name=config_vars loop=$_debug_config_keys}
+		<tr bgcolor={if %config_vars.index% is even}#eeeeee{else}#fafafa{/if}><td valign=top><tt><font color=maroon>{ldelim}#{$_debug_config_keys[config_vars]}#{rdelim}</font></tt></td><td><tt><font color=green>{$_debug_config_vals[config_vars]|@debug_print_var}</font></tt></td></tr>
+	{sectionelse}
+		<tr bgcolor=#eeeeee><td colspan=2><tt><i>no config vars assigned</i></tt></td></tr>	
+	{/section}
+	</table>
+</BODY></HTML>
+{else}
+<SCRIPT language=javascript>
+	if( self.name == '' ) {ldelim}
+	   var title = 'Console';
+	{rdelim}
+	else {ldelim}
+	   var title = 'Console_' + self.name;
+	{rdelim}
+	_smarty_console = window.open("",title.value,"width=680,height=600,resizable,scrollbars=yes");
+	_smarty_console.document.write("<HTML><HEAD><TITLE>Smarty Debug Console_"+self.name+"</TITLE></HEAD><BODY bgcolor=#ffffff>");
+	_smarty_console.document.write("<table border=0 width=100%>");
+	_smarty_console.document.write("<tr bgcolor=#cccccc><th colspan=2>Smarty Debug Console</th></tr>");
+	_smarty_console.document.write("<tr bgcolor=#cccccc><td colspan=2><b>included templates & config files (load time in seconds):</b></td></tr>");
+	{section name=templates loop=$_debug_tpls}
+		_smarty_console.document.write("<tr bgcolor={if %templates.index% is even}#eeeeee{else}#fafafa{/if}><td colspan=2><tt>{section name=indent loop=$_debug_tpls[templates].depth}&nbsp;&nbsp;&nbsp;{/section}<font color={if $_debug_tpls[templates].type eq "template"}brown{elseif $_debug_tpls[templates].type eq "insert"}black{else}green{/if}>{$_debug_tpls[templates].filename|escape:html|escape:javascript}</font>{if isset($_debug_tpls[templates].exec_time)} <font size=-1><i>({$_debug_tpls[templates].exec_time|string_format:"%.5f"}){if %templates.index% eq 0} (total){/if}</i></font>{/if}</tt></td></tr>");
+	{sectionelse}
+		_smarty_console.document.write("<tr bgcolor=#eeeeee><td colspan=2><tt><i>no templates included</i></tt></td></tr>");	
+	{/section}
+	_smarty_console.document.write("<tr bgcolor=#cccccc><td colspan=2><b>assigned template variables:</b></td></tr>");
+	{section name=vars loop=$_debug_keys}
+		_smarty_console.document.write("<tr bgcolor={if %vars.index% is even}#eeeeee{else}#fafafa{/if}><td valign=top><tt><font color=blue>{ldelim}${$_debug_keys[vars]}{rdelim}</font></tt></td><td nowrap><tt><font color=green>{$_debug_vals[vars]|@debug_print_var|escape:javascript}</font></tt></td></tr>");
+	{sectionelse}
+		_smarty_console.document.write("<tr bgcolor=#eeeeee><td colspan=2><tt><i>no template variables assigned</i></tt></td></tr>");	
+	{/section}
+	_smarty_console.document.write("<tr bgcolor=#cccccc><td colspan=2><b>assigned config file variables (outer template scope):</b></td></tr>");
+	{section name=config_vars loop=$_debug_config_keys}
+		_smarty_console.document.write("<tr bgcolor={if %config_vars.index% is even}#eeeeee{else}#fafafa{/if}><td valign=top><tt><font color=maroon>{ldelim}#{$_debug_config_keys[config_vars]}#{rdelim}</font></tt></td><td><tt><font color=green>{$_debug_config_vals[config_vars]|@debug_print_var|escape:javascript}</font></tt></td></tr>");
+	{sectionelse}
+		_smarty_console.document.write("<tr bgcolor=#eeeeee><td colspan=2><tt><i>no config vars assigned</i></tt></td></tr>");	
+	{/section}
+	_smarty_console.document.write("</table>");
+	_smarty_console.document.write("</BODY></HTML>");
+	_smarty_console.document.close();
+</SCRIPT>
+{/if}
diff --git a/GPL_LIB/Smarty/libs/internals/core.assemble_plugin_filepath.php b/GPL_LIB/Smarty/libs/internals/core.assemble_plugin_filepath.php
new file mode 100644
index 0000000000000000000000000000000000000000..fc64b8c27f4ceb56d1953ff9cf96a7ee55b124ec
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.assemble_plugin_filepath.php
@@ -0,0 +1,67 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * assemble filepath of requested plugin
+ *
+ * @param string $type
+ * @param string $name
+ * @return string|false
+ */
+function smarty_core_assemble_plugin_filepath($params, &$smarty)
+{
+    static $_filepaths_cache = array();
+
+    $_plugin_filename = $params['type'] . '.' . $params['name'] . '.php';
+    if (isset($_filepaths_cache[$_plugin_filename])) {
+        return $_filepaths_cache[$_plugin_filename];
+    }
+    $_return = false;
+
+    foreach ((array)$smarty->plugins_dir as $_plugin_dir) {
+
+        $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename;
+
+        // see if path is relative
+        if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) {
+            $_relative_paths[] = $_plugin_dir;
+            // relative path, see if it is in the SMARTY_DIR
+            if (@is_readable(SMARTY_DIR . $_plugin_filepath)) {
+                $_return = SMARTY_DIR . $_plugin_filepath;
+                break;
+            }
+        }
+        // try relative to cwd (or absolute)
+        if (@is_readable($_plugin_filepath)) {
+            $_return = $_plugin_filepath;
+            break;
+        }
+    }
+
+    if($_return === false) {
+        // still not found, try PHP include_path
+        if(isset($_relative_paths)) {
+            foreach ((array)$_relative_paths as $_plugin_dir) {
+
+                $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename;
+
+                $_params = array('file_path' => $_plugin_filepath);
+                require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
+                if(smarty_core_get_include_path($_params, $smarty)) {
+                    $_return = $_params['new_file_path'];
+                    break;
+                }
+            }
+        }
+    }
+    $_filepaths_cache[$_plugin_filename] = $_return;
+    return $_return;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.assign_smarty_interface.php b/GPL_LIB/Smarty/libs/internals/core.assign_smarty_interface.php
new file mode 100644
index 0000000000000000000000000000000000000000..500ba9a96a3555d821e10f204685865b78d3be8d
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.assign_smarty_interface.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty assign_smarty_interface core plugin
+ *
+ * Type:     core<br>
+ * Name:     assign_smarty_interface<br>
+ * Purpose:  assign the $smarty interface variable
+ * @param array Format: null
+ * @param Smarty
+ */
+function smarty_core_assign_smarty_interface($params, &$smarty)
+{
+        if (isset($smarty->_smarty_vars) && isset($smarty->_smarty_vars['request'])) {
+            return;
+        }
+
+        $_globals_map = array('g'  => 'HTTP_GET_VARS',
+                             'p'  => 'HTTP_POST_VARS',
+                             'c'  => 'HTTP_COOKIE_VARS',
+                             's'  => 'HTTP_SERVER_VARS',
+                             'e'  => 'HTTP_ENV_VARS');
+
+        $_smarty_vars_request  = array();
+
+        foreach (preg_split('!!', strtolower($smarty->request_vars_order)) as $_c) {
+            if (isset($_globals_map[$_c])) {
+                $_smarty_vars_request = array_merge($_smarty_vars_request, $GLOBALS[$_globals_map[$_c]]);
+            }
+        }
+        $_smarty_vars_request = @array_merge($_smarty_vars_request, $GLOBALS['HTTP_SESSION_VARS']);
+
+        $smarty->_smarty_vars['request'] = $_smarty_vars_request;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.create_dir_structure.php b/GPL_LIB/Smarty/libs/internals/core.create_dir_structure.php
new file mode 100644
index 0000000000000000000000000000000000000000..abc2850c1debd3f245099b88ad2aab25b69150e2
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.create_dir_structure.php
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * create full directory structure
+ *
+ * @param string $dir
+ */
+
+// $dir
+
+function smarty_core_create_dir_structure($params, &$smarty)
+{
+    if (!file_exists($params['dir'])) {
+        $_open_basedir_ini = ini_get('open_basedir');
+
+        if (DIRECTORY_SEPARATOR=='/') {
+            /* unix-style paths */
+            $_dir = $params['dir'];
+            $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);
+            $_new_dir = (substr($_dir, 0, 1)=='/') ? '/' : getcwd().'/';
+            if($_use_open_basedir = !empty($_open_basedir_ini)) {
+                $_open_basedirs = explode(':', $_open_basedir_ini);
+            }
+
+        } else {
+            /* other-style paths */
+            $_dir = str_replace('\\','/', $params['dir']);
+            $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);
+            if (preg_match('!^((//)|([a-zA-Z]:/))!', $_dir, $_root_dir)) {
+                /* leading "//" for network volume, or "[letter]:/" for full path */
+                $_new_dir = $_root_dir[1];
+                /* remove drive-letter from _dir_parts */
+                if (isset($_root_dir[3])) array_shift($_dir_parts);
+
+            } else {
+                $_new_dir = str_replace('\\', '/', getcwd()).'/';
+
+            }
+
+            if($_use_open_basedir = !empty($_open_basedir_ini)) {
+                $_open_basedirs = explode(';', str_replace('\\', '/', $_open_basedir_ini));
+            }
+
+        }
+
+        /* all paths use "/" only from here */
+        foreach ($_dir_parts as $_dir_part) {
+            $_new_dir .= $_dir_part;
+
+            if ($_use_open_basedir) {
+                // do not attempt to test or make directories outside of open_basedir
+                $_make_new_dir = false;
+                foreach ($_open_basedirs as $_open_basedir) {
+                    if (substr($_new_dir, 0, strlen($_open_basedir)) == $_open_basedir) {
+                        $_make_new_dir = true;
+                        break;
+                    }
+                }
+            } else {
+                $_make_new_dir = true;
+            }
+
+            if ($_make_new_dir && !file_exists($_new_dir) && !@mkdir($_new_dir, $smarty->_dir_perms) && !is_dir($_new_dir)) {
+                $smarty->trigger_error("problem creating directory '" . $_new_dir . "'");
+                return false;
+            }
+            $_new_dir .= '/';
+        }
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.display_debug_console.php b/GPL_LIB/Smarty/libs/internals/core.display_debug_console.php
new file mode 100644
index 0000000000000000000000000000000000000000..596867673fc05fba51db5a7b17cfb549f05352f7
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.display_debug_console.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty debug_console function plugin
+ *
+ * Type:     core<br>
+ * Name:     display_debug_console<br>
+ * Purpose:  display the javascript debug console window
+ * @param array Format: null
+ * @param Smarty
+ */
+function smarty_core_display_debug_console($params, &$smarty)
+{
+    // we must force compile the debug template in case the environment
+    // changed between separate applications.
+
+    if(empty($smarty->debug_tpl)) {
+        // set path to debug template from SMARTY_DIR
+        $smarty->debug_tpl = SMARTY_DIR . 'debug.tpl';
+        if($smarty->security && is_file($smarty->debug_tpl)) {
+            $smarty->secure_dir[] = realpath($smarty->debug_tpl);
+        }
+        $smarty->debug_tpl = 'file:' . SMARTY_DIR . 'debug.tpl';
+    }
+
+    $_ldelim_orig = $smarty->left_delimiter;
+    $_rdelim_orig = $smarty->right_delimiter;
+
+    $smarty->left_delimiter = '{';
+    $smarty->right_delimiter = '}';
+
+    $_compile_id_orig = $smarty->_compile_id;
+    $smarty->_compile_id = null;
+
+    $_compile_path = $smarty->_get_compile_path($smarty->debug_tpl);
+    if ($smarty->_compile_resource($smarty->debug_tpl, $_compile_path))
+    {
+        ob_start();
+        $smarty->_include($_compile_path);
+        $_results = ob_get_contents();
+        ob_end_clean();
+    } else {
+        $_results = '';
+    }
+
+    $smarty->_compile_id = $_compile_id_orig;
+
+    $smarty->left_delimiter = $_ldelim_orig;
+    $smarty->right_delimiter = $_rdelim_orig;
+
+    return $_results;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.get_include_path.php b/GPL_LIB/Smarty/libs/internals/core.get_include_path.php
new file mode 100644
index 0000000000000000000000000000000000000000..0cfdbdcc21d13aea0d0b640bed3dba51e59c4138
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.get_include_path.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Get path to file from include_path
+ *
+ * @param string $file_path
+ * @param string $new_file_path
+ * @return boolean
+ * @staticvar array|null
+ */
+
+//  $file_path, &$new_file_path
+
+function smarty_core_get_include_path(&$params, &$smarty)
+{
+    static $_path_array = null;
+
+    if(!isset($_path_array)) {
+        $_ini_include_path = ini_get('include_path');
+
+        if(strstr($_ini_include_path,';')) {
+            // windows pathnames
+            $_path_array = explode(';',$_ini_include_path);
+        } else {
+            $_path_array = explode(':',$_ini_include_path);
+        }
+    }
+    foreach ($_path_array as $_include_path) {
+        if (@is_readable($_include_path . DIRECTORY_SEPARATOR . $params['file_path'])) {
+               $params['new_file_path'] = $_include_path . DIRECTORY_SEPARATOR . $params['file_path'];
+            return true;
+        }
+    }
+    return false;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.get_microtime.php b/GPL_LIB/Smarty/libs/internals/core.get_microtime.php
new file mode 100644
index 0000000000000000000000000000000000000000..3c998a71f0ebbc0396974f4efd439f875f78bbee
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.get_microtime.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Get seconds and microseconds
+ * @return double
+ */
+function smarty_core_get_microtime($params, &$smarty)
+{
+    $mtime = microtime();
+    $mtime = explode(" ", $mtime);
+    $mtime = (double)($mtime[1]) + (double)($mtime[0]);
+    return ($mtime);
+}
+
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.get_php_resource.php b/GPL_LIB/Smarty/libs/internals/core.get_php_resource.php
new file mode 100644
index 0000000000000000000000000000000000000000..8fa1da6bfb3d653599d199a580958b58a3e59b1c
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.get_php_resource.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Retrieves PHP script resource
+ *
+ * sets $php_resource to the returned resource
+ * @param string $resource
+ * @param string $resource_type
+ * @param  $php_resource
+ * @return boolean
+ */
+
+function smarty_core_get_php_resource(&$params, &$smarty)
+{
+
+    $params['resource_base_path'] = $smarty->trusted_dir;
+    $smarty->_parse_resource_name($params, $smarty);
+
+    /*
+     * Find out if the resource exists.
+     */
+
+    if ($params['resource_type'] == 'file') {
+        $_readable = false;
+        if(file_exists($params['resource_name']) && is_readable($params['resource_name'])) {
+            $_readable = true;
+        } else {
+            // test for file in include_path
+            $_params = array('file_path' => $params['resource_name']);
+            require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
+            if(smarty_core_get_include_path($_params, $smarty)) {
+                $_include_path = $_params['new_file_path'];
+                $_readable = true;
+            }
+        }
+    } else if ($params['resource_type'] != 'file') {
+        $_template_source = null;
+        $_readable = is_callable($smarty->_plugins['resource'][$params['resource_type']][0][0])
+            && call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][0],
+                                    array($params['resource_name'], &$_template_source, &$smarty));
+    }
+
+    /*
+     * Set the error function, depending on which class calls us.
+     */
+    if (method_exists($smarty, '_syntax_error')) {
+        $_error_funcc = '_syntax_error';
+    } else {
+        $_error_funcc = 'trigger_error';
+    }
+
+    if ($_readable) {
+        if ($smarty->security) {
+            require_once(SMARTY_CORE_DIR . 'core.is_trusted.php');
+            if (!smarty_core_is_trusted($params, $smarty)) {
+                $smarty->$_error_funcc('(secure mode) ' . $params['resource_type'] . ':' . $params['resource_name'] . ' is not trusted');
+                return false;
+            }
+        }
+    } else {
+        $smarty->$_error_funcc($params['resource_type'] . ':' . $params['resource_name'] . ' is not readable');
+        return false;
+    }
+
+    if ($params['resource_type'] == 'file') {
+        $params['php_resource'] = $params['resource_name'];
+    } else {
+        $params['php_resource'] = $_template_source;
+    }
+    return true;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.is_secure.php b/GPL_LIB/Smarty/libs/internals/core.is_secure.php
new file mode 100644
index 0000000000000000000000000000000000000000..15c729ea3c6bb7d8486fdcf30d65fdaccc4eed24
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.is_secure.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * determines if a resource is secure or not.
+ *
+ * @param string $resource_type
+ * @param string $resource_name
+ * @return boolean
+ */
+
+//  $resource_type, $resource_name
+
+function smarty_core_is_secure($params, &$smarty)
+{
+    if (!$smarty->security || $smarty->security_settings['INCLUDE_ANY']) {
+        return true;
+    }
+
+    if ($params['resource_type'] == 'file') {
+        $_rp = realpath($params['resource_name']);
+        if (isset($params['resource_base_path'])) {
+            foreach ((array)$params['resource_base_path'] as $curr_dir) {
+                if ( ($_cd = realpath($curr_dir)) !== false &&
+                     strncmp($_rp, $_cd, strlen($_cd)) == 0 &&
+                     substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) {
+                    return true;
+                }
+            }
+        }
+        if (!empty($smarty->secure_dir)) {
+            foreach ((array)$smarty->secure_dir as $curr_dir) {
+                if ( ($_cd = realpath($curr_dir)) !== false) {
+                    if($_cd == $_rp) {
+                        return true;
+                    } elseif (strncmp($_rp, $_cd, strlen($_cd)) == 0 &&
+                        substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR) {
+                        return true;
+                    }
+                }
+            }
+        }
+    } else {
+        // resource is not on local file system
+        return call_user_func_array(
+            $smarty->_plugins['resource'][$params['resource_type']][0][2],
+            array($params['resource_name'], &$smarty));
+    }
+
+    return false;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.is_trusted.php b/GPL_LIB/Smarty/libs/internals/core.is_trusted.php
new file mode 100644
index 0000000000000000000000000000000000000000..ecf703c83032043d579e5c94cb25fd02b7d1b131
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.is_trusted.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * determines if a resource is trusted or not
+ *
+ * @param string $resource_type
+ * @param string $resource_name
+ * @return boolean
+ */
+
+ // $resource_type, $resource_name
+
+function smarty_core_is_trusted($params, &$smarty)
+{
+    $_smarty_trusted = false;
+    if ($params['resource_type'] == 'file') {
+        if (!empty($smarty->trusted_dir)) {
+            $_rp = realpath($params['resource_name']);
+            foreach ((array)$smarty->trusted_dir as $curr_dir) {
+                if (!empty($curr_dir) && is_readable ($curr_dir)) {
+                    $_cd = realpath($curr_dir);
+                    if (strncmp($_rp, $_cd, strlen($_cd)) == 0
+                        && substr($_rp, strlen($_cd), 1) == DIRECTORY_SEPARATOR ) {
+                        $_smarty_trusted = true;
+                        break;
+                    }
+                }
+            }
+        }
+
+    } else {
+        // resource is not on local file system
+        $_smarty_trusted = call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][3],
+                                                array($params['resource_name'], $smarty));
+    }
+
+    return $_smarty_trusted;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.load_plugins.php b/GPL_LIB/Smarty/libs/internals/core.load_plugins.php
new file mode 100644
index 0000000000000000000000000000000000000000..6f412ec99ac7ed27f1d31b46276723d8d96e2887
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.load_plugins.php
@@ -0,0 +1,125 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Load requested plugins
+ *
+ * @param array $plugins
+ */
+
+// $plugins
+
+function smarty_core_load_plugins($params, &$smarty)
+{
+
+    foreach ($params['plugins'] as $_plugin_info) {
+        list($_type, $_name, $_tpl_file, $_tpl_line, $_delayed_loading) = $_plugin_info;
+        $_plugin = &$smarty->_plugins[$_type][$_name];
+
+        /*
+         * We do not load plugin more than once for each instance of Smarty.
+         * The following code checks for that. The plugin can also be
+         * registered dynamically at runtime, in which case template file
+         * and line number will be unknown, so we fill them in.
+         *
+         * The final element of the info array is a flag that indicates
+         * whether the dynamically registered plugin function has been
+         * checked for existence yet or not.
+         */
+        if (isset($_plugin)) {
+            if (empty($_plugin[3])) {
+                if (!is_callable($_plugin[0])) {
+                    $smarty->_trigger_fatal_error("[plugin] $_type '$_name' is not implemented", $_tpl_file, $_tpl_line, __FILE__, __LINE__);
+                } else {
+                    $_plugin[1] = $_tpl_file;
+                    $_plugin[2] = $_tpl_line;
+                    $_plugin[3] = true;
+                    if (!isset($_plugin[4])) $_plugin[4] = true; /* cacheable */
+                }
+            }
+            continue;
+        } else if ($_type == 'insert') {
+            /*
+             * For backwards compatibility, we check for insert functions in
+             * the symbol table before trying to load them as a plugin.
+             */
+            $_plugin_func = 'insert_' . $_name;
+            if (function_exists($_plugin_func)) {
+                $_plugin = array($_plugin_func, $_tpl_file, $_tpl_line, true, false);
+                continue;
+            }
+        }
+
+        $_plugin_file = $smarty->_get_plugin_filepath($_type, $_name);
+
+        if (! $_found = ($_plugin_file != false)) {
+            $_message = "could not load plugin file '$_type.$_name.php'\n";
+        }
+
+        /*
+         * If plugin file is found, it -must- provide the properly named
+         * plugin function. In case it doesn't, simply output the error and
+         * do not fall back on any other method.
+         */
+        if ($_found) {
+            include_once $_plugin_file;
+
+            $_plugin_func = 'smarty_' . $_type . '_' . $_name;
+            if (!function_exists($_plugin_func)) {
+                $smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", $_tpl_file, $_tpl_line, __FILE__, __LINE__);
+                continue;
+            }
+        }
+        /*
+         * In case of insert plugins, their code may be loaded later via
+         * 'script' attribute.
+         */
+        else if ($_type == 'insert' && $_delayed_loading) {
+            $_plugin_func = 'smarty_' . $_type . '_' . $_name;
+            $_found = true;
+        }
+
+        /*
+         * Plugin specific processing and error checking.
+         */
+        if (!$_found) {
+            if ($_type == 'modifier') {
+                /*
+                 * In case modifier falls back on using PHP functions
+                 * directly, we only allow those specified in the security
+                 * context.
+                 */
+                if ($smarty->security && !in_array($_name, $smarty->security_settings['MODIFIER_FUNCS'])) {
+                    $_message = "(secure mode) modifier '$_name' is not allowed";
+                } else {
+                    if (!function_exists($_name)) {
+                        $_message = "modifier '$_name' is not implemented";
+                    } else {
+                        $_plugin_func = $_name;
+                        $_found = true;
+                    }
+                }
+            } else if ($_type == 'function') {
+                /*
+                 * This is a catch-all situation.
+                 */
+                $_message = "unknown tag - '$_name'";
+            }
+        }
+
+        if ($_found) {
+            $smarty->_plugins[$_type][$_name] = array($_plugin_func, $_tpl_file, $_tpl_line, true, true);
+        } else {
+            // output error
+            $smarty->_trigger_fatal_error('[plugin] ' . $_message, $_tpl_file, $_tpl_line, __FILE__, __LINE__);
+        }
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.load_resource_plugin.php b/GPL_LIB/Smarty/libs/internals/core.load_resource_plugin.php
new file mode 100644
index 0000000000000000000000000000000000000000..8a084f1b671a987f8313b0be9d766b85622871a2
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.load_resource_plugin.php
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * load a resource plugin
+ *
+ * @param string $type
+ */
+
+// $type
+
+function smarty_core_load_resource_plugin($params, &$smarty)
+{
+    /*
+     * Resource plugins are not quite like the other ones, so they are
+     * handled differently. The first element of plugin info is the array of
+     * functions provided by the plugin, the second one indicates whether
+     * all of them exist or not.
+     */
+
+    $_plugin = &$smarty->_plugins['resource'][$params['type']];
+    if (isset($_plugin)) {
+        if (!$_plugin[1] && count($_plugin[0])) {
+            $_plugin[1] = true;
+            foreach ($_plugin[0] as $_plugin_func) {
+                if (!is_callable($_plugin_func)) {
+                    $_plugin[1] = false;
+                    break;
+                }
+            }
+        }
+
+        if (!$_plugin[1]) {
+            $smarty->_trigger_fatal_error("[plugin] resource '" . $params['type'] . "' is not implemented", null, null, __FILE__, __LINE__);
+        }
+
+        return;
+    }
+
+    $_plugin_file = $smarty->_get_plugin_filepath('resource', $params['type']);
+    $_found = ($_plugin_file != false);
+
+    if ($_found) {            /*
+         * If the plugin file is found, it -must- provide the properly named
+         * plugin functions.
+         */
+        include_once($_plugin_file);
+
+        /*
+         * Locate functions that we require the plugin to provide.
+         */
+        $_resource_ops = array('source', 'timestamp', 'secure', 'trusted');
+        $_resource_funcs = array();
+        foreach ($_resource_ops as $_op) {
+            $_plugin_func = 'smarty_resource_' . $params['type'] . '_' . $_op;
+            if (!function_exists($_plugin_func)) {
+                $smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", null, null, __FILE__, __LINE__);
+                return;
+            } else {
+                $_resource_funcs[] = $_plugin_func;
+            }
+        }
+
+        $smarty->_plugins['resource'][$params['type']] = array($_resource_funcs, true);
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.process_cached_inserts.php b/GPL_LIB/Smarty/libs/internals/core.process_cached_inserts.php
new file mode 100644
index 0000000000000000000000000000000000000000..046e2c4d7ec3707fb97b904b9f8fc23dc61c0286
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.process_cached_inserts.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Replace cached inserts with the actual results
+ *
+ * @param string $results
+ * @return string
+ */
+function smarty_core_process_cached_inserts($params, &$smarty)
+{
+    preg_match_all('!'.$smarty->_smarty_md5.'{insert_cache (.*)}'.$smarty->_smarty_md5.'!Uis',
+                   $params['results'], $match);
+    list($cached_inserts, $insert_args) = $match;
+
+    for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) {
+        if ($smarty->debugging) {
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $debug_start_time = smarty_core_get_microtime($_params, $smarty);
+        }
+
+        $args = unserialize($insert_args[$i]);
+        $name = $args['name'];
+
+        if (isset($args['script'])) {
+            $_params = array('resource_name' => $smarty->_dequote($args['script']));
+            require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
+            if(!smarty_core_get_php_resource($_params, $smarty)) {
+                return false;
+            }
+            $resource_type = $_params['resource_type'];
+            $php_resource = $_params['php_resource'];
+
+
+            if ($resource_type == 'file') {
+                $smarty->_include($php_resource, true);
+            } else {
+                $smarty->_eval($php_resource);
+            }
+        }
+
+        $function_name = $smarty->_plugins['insert'][$name][0];
+        if (empty($args['assign'])) {
+            $replace = $function_name($args, $smarty);
+        } else {
+            $smarty->assign($args['assign'], $function_name($args, $smarty));
+            $replace = '';
+        }
+
+        $params['results'] = substr_replace($params['results'], $replace, strpos($params['results'], $cached_inserts[$i]), strlen($cached_inserts[$i]));
+        if ($smarty->debugging) {
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $smarty->_smarty_debug_info[] = array('type'      => 'insert',
+                                                'filename'  => 'insert_'.$name,
+                                                'depth'     => $smarty->_inclusion_depth,
+                                                'exec_time' => smarty_core_get_microtime($_params, $smarty) - $debug_start_time);
+        }
+    }
+
+    return $params['results'];
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.process_compiled_include.php b/GPL_LIB/Smarty/libs/internals/core.process_compiled_include.php
new file mode 100644
index 0000000000000000000000000000000000000000..76492eb5c12b86c4b3d987faf8c7c2ec23351300
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.process_compiled_include.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Replace nocache-tags by results of the corresponding non-cacheable
+ * functions and return it
+ *
+ * @param string $compiled_tpl
+ * @param string $cached_source
+ * @return string
+ */
+
+function smarty_core_process_compiled_include($params, &$smarty)
+{
+    $_cache_including = $smarty->_cache_including;
+    $smarty->_cache_including = true;
+
+    $_return = $params['results'];
+
+    foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) {
+        $smarty->_include($_include_file_path, true);
+    }
+
+    foreach ($smarty->_cache_serials as $_include_file_path=>$_cache_serial) {
+        $_return = preg_replace_callback('!(\{nocache\:('.$_cache_serial.')#(\d+)\})!s',
+                                         array(&$smarty, '_process_compiled_include_callback'),
+                                         $_return);
+    }
+    $smarty->_cache_including = $_cache_including;
+    return $_return;
+}
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.read_cache_file.php b/GPL_LIB/Smarty/libs/internals/core.read_cache_file.php
new file mode 100644
index 0000000000000000000000000000000000000000..2205b2ae84820138b253fc3f6eae9a2e8a2d60e4
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.read_cache_file.php
@@ -0,0 +1,101 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * read a cache file, determine if it needs to be
+ * regenerated or not
+ *
+ * @param string $tpl_file
+ * @param string $cache_id
+ * @param string $compile_id
+ * @param string $results
+ * @return boolean
+ */
+
+//  $tpl_file, $cache_id, $compile_id, &$results
+
+function smarty_core_read_cache_file(&$params, &$smarty)
+{
+    static  $content_cache = array();
+
+    if ($smarty->force_compile) {
+        // force compile enabled, always regenerate
+        return false;
+    }
+
+    if (isset($content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']])) {
+        list($params['results'], $smarty->_cache_info) = $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']];
+        return true;
+    }
+
+    if (!empty($smarty->cache_handler_func)) {
+        // use cache_handler function
+        call_user_func_array($smarty->cache_handler_func,
+                             array('read', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], null));
+    } else {
+        // use local cache file
+        $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']);
+        $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id);
+        $params['results'] = $smarty->_read_file($_cache_file);
+    }
+
+    if (empty($params['results'])) {
+        // nothing to parse (error?), regenerate cache
+        return false;
+    }
+
+    $_contents = $params['results'];
+    $_info_start = strpos($_contents, "\n") + 1;
+    $_info_len = (int)substr($_contents, 0, $_info_start - 1);
+    $_cache_info = unserialize(substr($_contents, $_info_start, $_info_len));
+    $params['results'] = substr($_contents, $_info_start + $_info_len);
+
+    if ($smarty->caching == 2 && isset ($_cache_info['expires'])){
+        // caching by expiration time
+        if ($_cache_info['expires'] > -1 && (time() > $_cache_info['expires'])) {
+            // cache expired, regenerate
+            return false;
+        }
+    } else {
+        // caching by lifetime
+        if ($smarty->cache_lifetime > -1 && (time() - $_cache_info['timestamp'] > $smarty->cache_lifetime)) {
+            // cache expired, regenerate
+            return false;
+        }
+    }
+
+    if ($smarty->compile_check) {
+        $_params = array('get_source' => false, 'quiet'=>true);
+        foreach (array_keys($_cache_info['template']) as $_template_dep) {
+            $_params['resource_name'] = $_template_dep;
+            if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) {
+                // template file has changed, regenerate cache
+                return false;
+            }
+        }
+
+        if (isset($_cache_info['config'])) {
+            $_params = array('resource_base_path' => $smarty->config_dir, 'get_source' => false, 'quiet'=>true);
+            foreach (array_keys($_cache_info['config']) as $_config_dep) {
+                $_params['resource_name'] = $_config_dep;
+                if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) {
+                    // config file has changed, regenerate cache
+                    return false;
+                }
+            }
+        }
+    }
+
+    $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']] = array($params['results'], $_cache_info);
+
+    $smarty->_cache_info = $_cache_info;
+    return true;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.rm_auto.php b/GPL_LIB/Smarty/libs/internals/core.rm_auto.php
new file mode 100644
index 0000000000000000000000000000000000000000..5174f024760573b38be7b77b51ad7001b44e5a94
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.rm_auto.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * delete an automagically created file by name and id
+ *
+ * @param string $auto_base
+ * @param string $auto_source
+ * @param string $auto_id
+ * @param integer $exp_time
+ * @return boolean
+ */
+
+// $auto_base, $auto_source = null, $auto_id = null, $exp_time = null
+
+function smarty_core_rm_auto($params, &$smarty)
+{
+    if (!@is_dir($params['auto_base']))
+      return false;
+
+    if(!isset($params['auto_id']) && !isset($params['auto_source'])) {
+        $_params = array(
+            'dirname' => $params['auto_base'],
+            'level' => 0,
+            'exp_time' => $params['exp_time']
+        );
+        require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
+        $_res = smarty_core_rmdir($_params, $smarty);
+    } else {
+        $_tname = $smarty->_get_auto_filename($params['auto_base'], $params['auto_source'], $params['auto_id']);
+
+        if(isset($params['auto_source'])) {
+            if (isset($params['extensions'])) {
+                $_res = false;
+                foreach ((array)$params['extensions'] as $_extension)
+                    $_res |= $smarty->_unlink($_tname.$_extension, $params['exp_time']);
+            } else {
+                $_res = $smarty->_unlink($_tname, $params['exp_time']);
+            }
+        } elseif ($smarty->use_sub_dirs) {
+            $_params = array(
+                'dirname' => $_tname,
+                'level' => 1,
+                'exp_time' => $params['exp_time']
+            );
+            require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
+            $_res = smarty_core_rmdir($_params, $smarty);
+        } else {
+            // remove matching file names
+            $_handle = opendir($params['auto_base']);
+            $_res = true;
+            while (false !== ($_filename = readdir($_handle))) {
+                if($_filename == '.' || $_filename == '..') {
+                    continue;
+                } elseif (substr($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, 0, strlen($_tname)) == $_tname) {
+                    $_res &= (bool)$smarty->_unlink($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, $params['exp_time']);
+                }
+            }
+        }
+    }
+
+    return $_res;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.rmdir.php b/GPL_LIB/Smarty/libs/internals/core.rmdir.php
new file mode 100644
index 0000000000000000000000000000000000000000..3280ff75db97433126112a7f98b59a172099680d
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.rmdir.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * delete a dir recursively (level=0 -> keep root)
+ * WARNING: no tests, it will try to remove what you tell it!
+ *
+ * @param string $dirname
+ * @param integer $level
+ * @param integer $exp_time
+ * @return boolean
+ */
+
+//  $dirname, $level = 1, $exp_time = null
+
+function smarty_core_rmdir($params, &$smarty)
+{
+   if(!isset($params['level'])) { $params['level'] = 1; }
+   if(!isset($params['exp_time'])) { $params['exp_time'] = null; }
+
+   if($_handle = @opendir($params['dirname'])) {
+
+        while (false !== ($_entry = readdir($_handle))) {
+            if ($_entry != '.' && $_entry != '..') {
+                if (@is_dir($params['dirname'] . DIRECTORY_SEPARATOR . $_entry)) {
+                    $_params = array(
+                        'dirname' => $params['dirname'] . DIRECTORY_SEPARATOR . $_entry,
+                        'level' => $params['level'] + 1,
+                        'exp_time' => $params['exp_time']
+                    );
+                    smarty_core_rmdir($_params, $smarty);
+                }
+                else {
+                    $smarty->_unlink($params['dirname'] . DIRECTORY_SEPARATOR . $_entry, $params['exp_time']);
+                }
+            }
+        }
+        closedir($_handle);
+   }
+
+   if ($params['level']) {
+       return @rmdir($params['dirname']);
+   }
+   return (bool)$_handle;
+
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.run_insert_handler.php b/GPL_LIB/Smarty/libs/internals/core.run_insert_handler.php
new file mode 100644
index 0000000000000000000000000000000000000000..40e539f70b18d345201e3a8b5b4471d435bcabee
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.run_insert_handler.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Handle insert tags
+ *
+ * @param array $args
+ * @return string
+ */
+function smarty_core_run_insert_handler($params, &$smarty)
+{
+
+    require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+    if ($smarty->debugging) {
+        $_params = array();
+        $_debug_start_time = smarty_core_get_microtime($_params, $smarty);
+    }
+
+    if ($smarty->caching) {
+        $_arg_string = serialize($params['args']);
+        $_name = $params['args']['name'];
+        if (!isset($smarty->_cache_info['insert_tags'][$_name])) {
+            $smarty->_cache_info['insert_tags'][$_name] = array('insert',
+                                                             $_name,
+                                                             $smarty->_plugins['insert'][$_name][1],
+                                                             $smarty->_plugins['insert'][$_name][2],
+                                                             !empty($params['args']['script']) ? true : false);
+        }
+        return $smarty->_smarty_md5."{insert_cache $_arg_string}".$smarty->_smarty_md5;
+    } else {
+        if (isset($params['args']['script'])) {
+            $_params = array('resource_name' => $smarty->_dequote($params['args']['script']));
+            require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
+            if(!smarty_core_get_php_resource($_params, $smarty)) {
+                return false;
+            }
+
+            if ($_params['resource_type'] == 'file') {
+                $smarty->_include($_params['php_resource'], true);
+            } else {
+                $smarty->_eval($_params['php_resource']);
+            }
+            unset($params['args']['script']);
+        }
+
+        $_funcname = $smarty->_plugins['insert'][$params['args']['name']][0];
+        $_content = $_funcname($params['args'], $smarty);
+        if ($smarty->debugging) {
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $smarty->_smarty_debug_info[] = array('type'      => 'insert',
+                                                'filename'  => 'insert_'.$params['args']['name'],
+                                                'depth'     => $smarty->_inclusion_depth,
+                                                'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time);
+        }
+
+        if (!empty($params['args']["assign"])) {
+            $smarty->assign($params['args']["assign"], $_content);
+        } else {
+            return $_content;
+        }
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.smarty_include_php.php b/GPL_LIB/Smarty/libs/internals/core.smarty_include_php.php
new file mode 100644
index 0000000000000000000000000000000000000000..de03f93daa8d305c5757c23df77310995738e890
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.smarty_include_php.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * called for included php files within templates
+ *
+ * @param string $smarty_file
+ * @param string $smarty_assign variable to assign the included template's
+ *               output into
+ * @param boolean $smarty_once uses include_once if this is true
+ * @param array $smarty_include_vars associative array of vars from
+ *              {include file="blah" var=$var}
+ */
+
+//  $file, $assign, $once, $_smarty_include_vars
+
+function smarty_core_smarty_include_php($params, &$smarty)
+{
+    $_params = array('resource_name' => $params['smarty_file']);
+    require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
+    smarty_core_get_php_resource($_params, $smarty);
+    $_smarty_resource_type = $_params['resource_type'];
+    $_smarty_php_resource = $_params['php_resource'];
+
+    if (!empty($params['smarty_assign'])) {
+        ob_start();
+        if ($_smarty_resource_type == 'file') {
+            $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']);
+        } else {
+            $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']);
+        }
+        $smarty->assign($params['smarty_assign'], ob_get_contents());
+        ob_end_clean();
+    } else {
+        if ($_smarty_resource_type == 'file') {
+            $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']);
+        } else {
+            $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']);
+        }
+    }
+}
+
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.write_cache_file.php b/GPL_LIB/Smarty/libs/internals/core.write_cache_file.php
new file mode 100644
index 0000000000000000000000000000000000000000..4cf3601d5e0884c437ebc6a4f5b28bf23e1ff206
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.write_cache_file.php
@@ -0,0 +1,96 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Prepend the cache information to the cache file
+ * and write it
+ *
+ * @param string $tpl_file
+ * @param string $cache_id
+ * @param string $compile_id
+ * @param string $results
+ * @return true|null
+ */
+
+ // $tpl_file, $cache_id, $compile_id, $results
+
+function smarty_core_write_cache_file($params, &$smarty)
+{
+
+    // put timestamp in cache header
+    $smarty->_cache_info['timestamp'] = time();
+    if ($smarty->cache_lifetime > -1){
+        // expiration set
+        $smarty->_cache_info['expires'] = $smarty->_cache_info['timestamp'] + $smarty->cache_lifetime;
+    } else {
+        // cache will never expire
+        $smarty->_cache_info['expires'] = -1;
+    }
+
+    // collapse nocache.../nocache-tags
+    if (preg_match_all('!\{(/?)nocache\:[0-9a-f]{32}#\d+\}!', $params['results'], $match, PREG_PATTERN_ORDER)) {
+        // remove everything between every pair of outermost noache.../nocache-tags
+        // and replace it by a single nocache-tag
+        // this new nocache-tag will be replaced by dynamic contents in
+        // smarty_core_process_compiled_includes() on a cache-read
+        
+        $match_count = count($match[0]);
+        $results = preg_split('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!', $params['results'], -1, PREG_SPLIT_DELIM_CAPTURE);
+        
+        $level = 0;
+        $j = 0;
+        for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; $i++) {
+            if ($results[$i] == $match[0][$j]) {
+                // nocache tag
+                if ($match[1][$j]) { // closing tag
+                    $level--;
+                    unset($results[$i]);
+                } else { // opening tag
+                    if ($level++ > 0) unset($results[$i]);
+                }
+                $j++;
+            } elseif ($level > 0) {
+                unset($results[$i]);
+            }
+        }
+        $params['results'] = implode('', $results);
+    }
+    $smarty->_cache_info['cache_serials'] = $smarty->_cache_serials;
+
+    // prepend the cache header info into cache file
+    $_cache_info = serialize($smarty->_cache_info);
+    $params['results'] = strlen($_cache_info) . "\n" . $_cache_info . $params['results'];
+
+    if (!empty($smarty->cache_handler_func)) {
+        // use cache_handler function
+        call_user_func_array($smarty->cache_handler_func,
+                             array('write', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], null));
+    } else {
+        // use local cache file
+
+        if(!@is_writable($smarty->cache_dir)) {
+            // cache_dir not writable, see if it exists
+            if(!@is_dir($smarty->cache_dir)) {
+                $smarty->trigger_error('the $cache_dir \'' . $smarty->cache_dir . '\' does not exist, or is not a directory.', E_USER_ERROR);
+                return false;
+            }
+            $smarty->trigger_error('unable to write to $cache_dir \'' . realpath($smarty->cache_dir) . '\'. Be sure $cache_dir is writable by the web server user.', E_USER_ERROR);
+            return false;
+        }
+
+        $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']);
+        $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id);
+        $_params = array('filename' => $_cache_file, 'contents' => $params['results'], 'create_dirs' => true);
+        require_once(SMARTY_CORE_DIR . 'core.write_file.php');
+        smarty_core_write_file($_params, $smarty);
+        return true;
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.write_compiled_include.php b/GPL_LIB/Smarty/libs/internals/core.write_compiled_include.php
new file mode 100644
index 0000000000000000000000000000000000000000..9cf89298f42a3cb4e970e05e1cd0bef530a76d2c
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.write_compiled_include.php
@@ -0,0 +1,91 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Extract non-cacheable parts out of compiled template and write it
+ *
+ * @param string $compile_path
+ * @param string $template_compiled
+ * @return boolean
+ */
+
+function smarty_core_write_compiled_include($params, &$smarty)
+{
+    $_tag_start = 'if \(\$this->caching && \!\$this->_cache_including\) \{ echo \'\{nocache\:('.$params['cache_serial'].')#(\d+)\}\'; \};';
+    $_tag_end   = 'if \(\$this->caching && \!\$this->_cache_including\) \{ echo \'\{/nocache\:(\\2)#(\\3)\}\'; \};';
+
+    preg_match_all('!('.$_tag_start.'(.*)'.$_tag_end.')!Us',
+                   $params['compiled_content'], $_match_source, PREG_SET_ORDER);
+
+    // no nocache-parts found: done
+    if (count($_match_source)==0) return;
+
+    // convert the matched php-code to functions
+    $_include_compiled =  "<?php /* Smarty version ".$smarty->_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n";
+    $_include_compiled .= "         compiled from " . strtr(urlencode($params['resource_name']), array('%2F'=>'/', '%3A'=>':')) . " */\n\n";
+
+    $_compile_path = $params['include_file_path'];
+
+    $smarty->_cache_serials[$_compile_path] = $params['cache_serial'];
+    $_include_compiled .= "\$this->_cache_serials['".$_compile_path."'] = '".$params['cache_serial']."';\n\n?>";
+
+    $_include_compiled .= $params['plugins_code'];
+    $_include_compiled .= "<?php";
+
+    $this_varname = ((double)phpversion() >= 5.0) ? '_smarty' : 'this';
+    for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; $_i++) {
+        $_match =& $_match_source[$_i];
+        $source = $_match[4];
+        if ($this_varname == '_smarty') {
+            /* rename $this to $_smarty in the sourcecode */
+            $tokens = token_get_all('<?php ' . $_match[4]);
+
+            /* remove trailing <?php */
+            $open_tag = '';
+            while ($tokens) {
+                $token = array_shift($tokens);
+                if (is_array($token)) {
+                    $open_tag .= $token[1];
+                } else {
+                    $open_tag .= $token;
+                }
+                if ($open_tag == '<?php ') break;
+            }
+
+            for ($i=0, $count = count($tokens); $i < $count; $i++) {
+                if (is_array($tokens[$i])) {
+                    if ($tokens[$i][0] == T_VARIABLE && $tokens[$i][1] == '$this') {
+                        $tokens[$i] = '$' . $this_varname;
+                    } else {
+                        $tokens[$i] = $tokens[$i][1];
+                    }                   
+                }
+            }
+            $source = implode('', $tokens);
+        }
+
+        /* add function to compiled include */
+        $_include_compiled .= "
+function _smarty_tplfunc_$_match[2]_$_match[3](&\$$this_varname)
+{
+$source
+}
+
+";
+    }
+    $_include_compiled .= "\n\n?>\n";
+
+    $_params = array('filename' => $_compile_path,
+                     'contents' => $_include_compiled, 'create_dirs' => true);
+
+    require_once(SMARTY_CORE_DIR . 'core.write_file.php');
+    smarty_core_write_file($_params, $smarty);
+    return true;
+}
+
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.write_compiled_resource.php b/GPL_LIB/Smarty/libs/internals/core.write_compiled_resource.php
new file mode 100644
index 0000000000000000000000000000000000000000..d0e56480a38c2bfd31224525b045fc602b9e770a
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.write_compiled_resource.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * write the compiled resource
+ *
+ * @param string $compile_path
+ * @param string $compiled_content
+ * @return true
+ */
+function smarty_core_write_compiled_resource($params, &$smarty)
+{
+    if(!@is_writable($smarty->compile_dir)) {
+        // compile_dir not writable, see if it exists
+        if(!@is_dir($smarty->compile_dir)) {
+            $smarty->trigger_error('the $compile_dir \'' . $smarty->compile_dir . '\' does not exist, or is not a directory.', E_USER_ERROR);
+            return false;
+        }
+        $smarty->trigger_error('unable to write to $compile_dir \'' . realpath($smarty->compile_dir) . '\'. Be sure $compile_dir is writable by the web server user.', E_USER_ERROR);
+        return false;
+    }
+
+    $_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true);
+    require_once(SMARTY_CORE_DIR . 'core.write_file.php');
+    smarty_core_write_file($_params, $smarty);
+    return true;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/internals/core.write_file.php b/GPL_LIB/Smarty/libs/internals/core.write_file.php
new file mode 100644
index 0000000000000000000000000000000000000000..333b7621b3cff992249e45650b8ae32c09a5950b
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/internals/core.write_file.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * write out a file to disk
+ *
+ * @param string $filename
+ * @param string $contents
+ * @param boolean $create_dirs
+ * @return boolean
+ */
+function smarty_core_write_file($params, &$smarty)
+{
+    $_dirname = dirname($params['filename']);
+
+    if ($params['create_dirs']) {
+        $_params = array('dir' => $_dirname);
+        require_once(SMARTY_CORE_DIR . 'core.create_dir_structure.php');
+        smarty_core_create_dir_structure($_params, $smarty);
+    }
+
+    // write to tmp file, then rename it to avoid
+    // file locking race condition
+    $_tmp_file = tempnam($_dirname, 'wrt');
+
+    if (!($fd = @fopen($_tmp_file, 'wb'))) {
+        $_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('wrt');
+        if (!($fd = @fopen($_tmp_file, 'wb'))) {
+            $smarty->trigger_error("problem writing temporary file '$_tmp_file'");
+            return false;
+        }
+    }
+
+    fwrite($fd, $params['contents']);
+    fclose($fd);
+
+    // Delete the file if it allready exists (this is needed on Win,
+    // because it cannot overwrite files with rename()
+    if (file_exists($params['filename'])) {
+        @unlink($params['filename']);
+    }
+    @rename($_tmp_file, $params['filename']);
+    @chmod($params['filename'], $smarty->_file_perms);
+
+    return true;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/block.textformat.php b/GPL_LIB/Smarty/libs/plugins/block.textformat.php
new file mode 100644
index 0000000000000000000000000000000000000000..2a374232d976b10dd75d871f48f419ec51715a36
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/block.textformat.php
@@ -0,0 +1,103 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {textformat}{/textformat} block plugin
+ *
+ * Type:     block function<br>
+ * Name:     textformat<br>
+ * Purpose:  format text a certain way with preset styles
+ *           or custom wrap/indent settings<br>
+ * @link http://smarty.php.net/manual/en/language.function.textformat.php {textformat}
+ *       (Smarty online manual)
+ * @param array
+ * <pre>
+ * Params:   style: string (email)
+ *           indent: integer (0)
+ *           wrap: integer (80)
+ *           wrap_char string ("\n")
+ *           indent_char: string (" ")
+ *           wrap_boundary: boolean (true)
+ * </pre>
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param string contents of the block
+ * @param Smarty clever simulation of a method
+ * @return string string $content re-formatted
+ */
+function smarty_block_textformat($params, $content, &$smarty)
+{
+    if (is_null($content)) {
+        return;
+    }
+
+    $style = null;
+    $indent = 0;
+    $indent_first = 0;
+    $indent_char = ' ';
+    $wrap = 80;
+    $wrap_char = "\n";
+    $wrap_cut = false;
+    $assign = null;
+    
+    foreach ($params as $_key => $_val) {
+        switch ($_key) {
+            case 'style':
+            case 'indent_char':
+            case 'wrap_char':
+            case 'assign':
+                $$_key = (string)$_val;
+                break;
+
+            case 'indent':
+            case 'indent_first':
+            case 'wrap':
+                $$_key = (int)$_val;
+                break;
+
+            case 'wrap_cut':
+                $$_key = (bool)$_val;
+                break;
+
+            default:
+                $smarty->trigger_error("textformat: unknown attribute '$_key'");
+        }
+    }
+
+    if ($style == 'email') {
+        $wrap = 72;
+    }
+
+    // split into paragraphs
+    $_paragraphs = preg_split('![\r\n][\r\n]!',$content);
+    $_output = '';
+
+    for($_x = 0, $_y = count($_paragraphs); $_x < $_y; $_x++) {
+        if ($_paragraphs[$_x] == '') {
+            continue;
+        }
+        // convert mult. spaces & special chars to single space
+        $_paragraphs[$_x] = preg_replace(array('!\s+!','!(^\s+)|(\s+$)!'), array(' ',''), $_paragraphs[$_x]);
+        // indent first line
+        if($indent_first > 0) {
+            $_paragraphs[$_x] = str_repeat($indent_char, $indent_first) . $_paragraphs[$_x];
+        }
+        // wordwrap sentences
+        $_paragraphs[$_x] = wordwrap($_paragraphs[$_x], $wrap - $indent, $wrap_char, $wrap_cut);
+        // indent lines
+        if($indent > 0) {
+            $_paragraphs[$_x] = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraphs[$_x]);
+        }
+    }
+    $_output = implode($wrap_char . $wrap_char, $_paragraphs);
+
+    return $assign ? $smarty->assign($assign, $_output) : $_output;
+
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/compiler.assign.php b/GPL_LIB/Smarty/libs/plugins/compiler.assign.php
new file mode 100644
index 0000000000000000000000000000000000000000..25970f1bfae0213fb3bfffa4a1fc2ca9ce82edb4
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/compiler.assign.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {assign} compiler function plugin
+ *
+ * Type:     compiler function<br>
+ * Name:     assign<br>
+ * Purpose:  assign a value to a template variable
+ * @link http://smarty.php.net/manual/en/language.custom.functions.php#LANGUAGE.FUNCTION.ASSIGN {assign}
+ *       (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com> (initial author)
+ * @auther messju mohr <messju at lammfellpuschen dot de> (conversion to compiler function)
+ * @param string containing var-attribute and value-attribute
+ * @param Smarty_Compiler
+ */
+function smarty_compiler_assign($tag_attrs, &$compiler)
+{
+    $_params = $compiler->_parse_attrs($tag_attrs);
+
+    if (!isset($_params['var'])) {
+        $compiler->_syntax_error("assign: missing 'var' parameter", E_USER_WARNING);
+        return;
+    }
+
+    if (!isset($_params['value'])) {
+        $compiler->_syntax_error("assign: missing 'value' parameter", E_USER_WARNING);
+        return;
+    }
+
+    return "\$this->assign({$_params['var']}, {$_params['value']});";
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.assign_debug_info.php b/GPL_LIB/Smarty/libs/plugins/function.assign_debug_info.php
new file mode 100644
index 0000000000000000000000000000000000000000..cc2c14b542c60e433c81383b0af1bb09bd06780f
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.assign_debug_info.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {assign_debug_info} function plugin
+ *
+ * Type:     function<br>
+ * Name:     assign_debug_info<br>
+ * Purpose:  assign debug info to the template<br>
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array unused in this plugin, this plugin uses {@link Smarty::$_config},
+ *              {@link Smarty::$_tpl_vars} and {@link Smarty::$_smarty_debug_info}
+ * @param Smarty
+ */
+function smarty_function_assign_debug_info($params, &$smarty)
+{
+    $assigned_vars = $smarty->_tpl_vars;
+    ksort($assigned_vars);
+    if (@is_array($smarty->_config[0])) {
+        $config_vars = $smarty->_config[0];
+        ksort($config_vars);
+        $smarty->assign("_debug_config_keys", array_keys($config_vars));
+        $smarty->assign("_debug_config_vals", array_values($config_vars));
+    }
+    
+    $included_templates = $smarty->_smarty_debug_info;
+    
+    $smarty->assign("_debug_keys", array_keys($assigned_vars));
+    $smarty->assign("_debug_vals", array_values($assigned_vars));
+    
+    $smarty->assign("_debug_tpls", $included_templates);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.config_load.php b/GPL_LIB/Smarty/libs/plugins/function.config_load.php
new file mode 100644
index 0000000000000000000000000000000000000000..062c3564a9bc0d55ffbc141cb7b64ad690825c1b
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.config_load.php
@@ -0,0 +1,142 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {config_load} function plugin
+ *
+ * Type:     function<br>
+ * Name:     config_load<br>
+ * Purpose:  load config file vars
+ * @link http://smarty.php.net/manual/en/language.function.config.load.php {config_load}
+ *       (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author messju mohr <messju at lammfellpuschen dot de> (added use of resources)
+ * @param array Format:
+ * <pre>
+ * array('file' => required config file name,
+ *       'section' => optional config file section to load
+ *       'scope' => local/parent/global
+ *       'global' => overrides scope, setting to parent if true)
+ * </pre>
+ * @param Smarty
+ */
+function smarty_function_config_load($params, &$smarty)
+{
+        if ($smarty->debugging) {
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $_debug_start_time = smarty_core_get_microtime($_params, $smarty);
+        }
+
+        $_file = isset($params['file']) ? $smarty->_dequote($params['file']) : null;
+        $_section = isset($params['section']) ? $smarty->_dequote($params['section']) : null;
+        $_scope = isset($params['scope']) ? $smarty->_dequote($params['scope']) : 'global';
+        $_global = isset($params['global']) ? $smarty->_dequote($params['global']) : false;
+
+        if (!isset($_file) || strlen($_file) == 0) {
+            $smarty->trigger_error("missing 'file' attribute in config_load tag", E_USER_ERROR, __FILE__, __LINE__);
+        }
+
+        if (isset($_scope)) {
+            if ($_scope != 'local' &&
+                $_scope != 'parent' &&
+                $_scope != 'global') {
+                $smarty->trigger_error("invalid 'scope' attribute value", E_USER_ERROR, __FILE__, __LINE__);
+            }
+        } else {
+            if ($_global) {
+                $_scope = 'parent';
+            } else {
+                $_scope = 'local';
+            }
+        }
+
+        $_params = array('resource_name' => $_file,
+                         'resource_base_path' => $smarty->config_dir,
+                         'get_source' => false);
+        $smarty->_parse_resource_name($_params);
+        $_file_path = $_params['resource_type'] . ':' . $_params['resource_name'];
+        if (isset($_section))
+            $_compile_file = $smarty->_get_compile_path($_file_path.'|'.$_section);
+        else
+            $_compile_file = $smarty->_get_compile_path($_file_path);
+
+        if($smarty->force_compile || !file_exists($_compile_file)) {
+            $_compile = true;
+        } elseif ($smarty->compile_check) {
+            $_params = array('resource_name' => $_file,
+                             'resource_base_path' => $smarty->config_dir,
+                             'get_source' => false);
+            $_compile = $smarty->_fetch_resource_info($_params) &&
+                $_params['resource_timestamp'] > filemtime($_compile_file);
+        } else {
+            $_compile = false;
+        }
+
+        if($_compile) {
+            // compile config file
+            if(!is_object($smarty->_conf_obj)) {
+                require_once SMARTY_DIR . $smarty->config_class . '.class.php';
+                $smarty->_conf_obj = new $smarty->config_class();
+                $smarty->_conf_obj->overwrite = $smarty->config_overwrite;
+                $smarty->_conf_obj->booleanize = $smarty->config_booleanize;
+                $smarty->_conf_obj->read_hidden = $smarty->config_read_hidden;
+                $smarty->_conf_obj->fix_newlines = $smarty->config_fix_newlines;
+            }
+
+            $_params = array('resource_name' => $_file,
+                             'resource_base_path' => $smarty->config_dir,
+                             $_params['get_source'] = true);
+            if (!$smarty->_fetch_resource_info($_params)) {
+                return;
+            }
+            $smarty->_conf_obj->set_file_contents($_file, $_params['source_content']);
+            $_config_vars = array_merge($smarty->_conf_obj->get($_file),
+                    $smarty->_conf_obj->get($_file, $_section));
+            if(function_exists('var_export')) {
+                $_output = '<?php $_config_vars = ' . var_export($_config_vars, true) . '; ?>';
+            } else {
+                $_output = '<?php $_config_vars = unserialize(\'' . strtr(serialize($_config_vars),array('\''=>'\\\'', '\\'=>'\\\\')) . '\'); ?>';
+            }
+            $_params = (array('compile_path' => $_compile_file, 'compiled_content' => $_output, 'resource_timestamp' => $_params['resource_timestamp']));
+            require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php');
+            smarty_core_write_compiled_resource($_params, $smarty);
+        } else {
+            include($_compile_file);
+        }
+
+        if ($smarty->caching) {
+            $smarty->_cache_info['config'][$_file] = true;
+        }
+
+        $smarty->_config[0]['vars'] = @array_merge($smarty->_config[0]['vars'], $_config_vars);
+        $smarty->_config[0]['files'][$_file] = true;
+
+        if ($_scope == 'parent') {
+                $smarty->_config[1]['vars'] = @array_merge($smarty->_config[1]['vars'], $_config_vars);
+                $smarty->_config[1]['files'][$_file] = true;
+        } else if ($_scope == 'global') {
+            for ($i = 1, $for_max = count($smarty->_config); $i < $for_max; $i++) {
+                $smarty->_config[$i]['vars'] = @array_merge($smarty->_config[$i]['vars'], $_config_vars);
+                $smarty->_config[$i]['files'][$_file] = true;
+            }
+        }
+
+        if ($smarty->debugging) {
+            $_params = array();
+            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+            $smarty->_smarty_debug_info[] = array('type'      => 'config',
+                                                'filename'  => $_file.' ['.$_section.'] '.$_scope,
+                                                'depth'     => $smarty->_inclusion_depth,
+                                                'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time);
+        }
+
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.counter.php b/GPL_LIB/Smarty/libs/plugins/function.counter.php
new file mode 100644
index 0000000000000000000000000000000000000000..e8937d11156901749105fdce0504c5fa890ea654
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.counter.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {counter} function plugin
+ *
+ * Type:     function<br>
+ * Name:     counter<br>
+ * Purpose:  print out a counter value
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @link http://smarty.php.net/manual/en/language.function.counter.php {counter}
+ *       (Smarty online manual)
+ * @param array parameters
+ * @param Smarty
+ * @return string|null
+ */
+function smarty_function_counter($params, &$smarty)
+{
+    static $counters = array();
+
+    $name = (isset($params['name'])) ? $params['name'] : 'default';
+    if (!isset($counters[$name])) {
+        $counters[$name] = array(
+            'start'=>1,
+            'skip'=>1,
+            'direction'=>'up',
+            'count'=>1
+            );
+    }
+    $counter =& $counters[$name];
+
+    if (isset($params['start'])) {
+        $counter['start'] = $counter['count'] = (int)$params['start'];
+    }
+
+    if (!empty($params['assign'])) {
+        $counter['assign'] = $params['assign'];
+    }
+
+    if (isset($counter['assign'])) {
+        $smarty->assign($counter['assign'], $counter['count']);
+    }
+    
+    if (isset($params['print'])) {
+        $print = (bool)$params['print'];
+    } else {
+        $print = empty($counter['assign']);
+    }
+
+    if ($print) {
+        $retval = $counter['count'];
+    } else {
+        $retval = null;
+    }
+
+    if (isset($params['skip'])) {
+        $counter['skip'] = $params['skip'];
+    }
+    
+    if (isset($params['direction'])) {
+        $counter['direction'] = $params['direction'];
+    }
+
+    if ($counter['direction'] == "down")
+        $counter['count'] -= $counter['skip'];
+    else
+        $counter['count'] += $counter['skip'];
+    
+    return $retval;
+    
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.cycle.php b/GPL_LIB/Smarty/libs/plugins/function.cycle.php
new file mode 100644
index 0000000000000000000000000000000000000000..1a04af98ae8cd22d2fbb5c0b2c4e77e5ae547fc5
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.cycle.php
@@ -0,0 +1,102 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {cycle} function plugin
+ *
+ * Type:     function<br>
+ * Name:     cycle<br>
+ * Date:     May 3, 2002<br>
+ * Purpose:  cycle through given values<br>
+ * Input:
+ *         - name = name of cycle (optional)
+ *         - values = comma separated list of values to cycle,
+ *                    or an array of values to cycle
+ *                    (this can be left out for subsequent calls)
+ *         - reset = boolean - resets given var to true
+ *         - print = boolean - print var or not. default is true
+ *         - advance = boolean - whether or not to advance the cycle
+ *         - delimiter = the value delimiter, default is ","
+ *         - assign = boolean, assigns to template var instead of
+ *                    printed.
+ *
+ * Examples:<br>
+ * <pre>
+ * {cycle values="#eeeeee,#d0d0d0d"}
+ * {cycle name=row values="one,two,three" reset=true}
+ * {cycle name=row}
+ * </pre>
+ * @link http://smarty.php.net/manual/en/language.function.cycle.php {cycle}
+ *       (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author credit to Mark Priatel <mpriatel@rogers.com>
+ * @author credit to Gerard <gerard@interfold.com>
+ * @author credit to Jason Sweat <jsweat_php@yahoo.com>
+ * @version  1.3
+ * @param array
+ * @param Smarty
+ * @return string|null
+ */
+function smarty_function_cycle($params, &$smarty)
+{
+    static $cycle_vars;
+    
+    $name = (empty($params['name'])) ? 'default' : $params['name'];
+    $print = (isset($params['print'])) ? (bool)$params['print'] : true;
+    $advance = (isset($params['advance'])) ? (bool)$params['advance'] : true;
+    $reset = (isset($params['reset'])) ? (bool)$params['reset'] : false;
+            
+    if (!in_array('values', array_keys($params))) {
+        if(!isset($cycle_vars[$name]['values'])) {
+            $smarty->trigger_error("cycle: missing 'values' parameter");
+            return;
+        }
+    } else {
+        if(isset($cycle_vars[$name]['values'])
+            && $cycle_vars[$name]['values'] != $params['values'] ) {
+            $cycle_vars[$name]['index'] = 0;
+        }
+        $cycle_vars[$name]['values'] = $params['values'];
+    }
+
+    $cycle_vars[$name]['delimiter'] = (isset($params['delimiter'])) ? $params['delimiter'] : ',';
+    
+    if(is_array($cycle_vars[$name]['values'])) {
+        $cycle_array = $cycle_vars[$name]['values'];
+    } else {
+        $cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']);
+    }
+    
+    if(!isset($cycle_vars[$name]['index']) || $reset ) {
+        $cycle_vars[$name]['index'] = 0;
+    }
+    
+    if (isset($params['assign'])) {
+        $print = false;
+        $smarty->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]);
+    }
+        
+    if($print) {
+        $retval = $cycle_array[$cycle_vars[$name]['index']];
+    } else {
+        $retval = null;
+    }
+
+    if($advance) {
+        if ( $cycle_vars[$name]['index'] >= count($cycle_array) -1 ) {
+            $cycle_vars[$name]['index'] = 0;
+        } else {
+            $cycle_vars[$name]['index']++;
+        }
+    }
+    
+    return $retval;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.debug.php b/GPL_LIB/Smarty/libs/plugins/function.debug.php
new file mode 100644
index 0000000000000000000000000000000000000000..de09b308cd5b49bfdcc564657d4e3c760b0f98ee
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.debug.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {debug} function plugin
+ *
+ * Type:     function<br>
+ * Name:     debug<br>
+ * Date:     July 1, 2002<br>
+ * Purpose:  popup debug window
+ * @link http://smarty.php.net/manual/en/language.function.debug.php {debug}
+ *       (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @version  1.0
+ * @param array
+ * @param Smarty
+ * @return string output from {@link Smarty::_generate_debug_output()}
+ */
+function smarty_function_debug($params, &$smarty)
+{
+    if (isset($params['output'])) {
+        $smarty->assign('_smarty_debug_output', $params['output']);
+    }
+    require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
+    return smarty_core_display_debug_console(null, $smarty);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.eval.php b/GPL_LIB/Smarty/libs/plugins/function.eval.php
new file mode 100644
index 0000000000000000000000000000000000000000..3bb8cbb4269234c835811ebc14a47cab185742a6
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.eval.php
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {eval} function plugin
+ *
+ * Type:     function<br>
+ * Name:     eval<br>
+ * Purpose:  evaluate a template variable as a template<br>
+ * @link http://smarty.php.net/manual/en/language.function.eval.php {eval}
+ *       (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ */
+function smarty_function_eval($params, &$smarty)
+{
+
+    if (!isset($params['var'])) {
+        $smarty->trigger_error("eval: missing 'var' parameter");
+        return;
+    }
+
+    if($params['var'] == '') {
+        return;
+    }
+
+    $smarty->_compile_source('evaluated template', $params['var'], $_var_compiled);
+
+    ob_start();
+    $smarty->_eval('?>' . $_var_compiled);
+    $_contents = ob_get_contents();
+    ob_end_clean();
+
+    if (!empty($params['assign'])) {
+        $smarty->assign($params['assign'], $_contents);
+    } else {
+        return $_contents;
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.fetch.php b/GPL_LIB/Smarty/libs/plugins/function.fetch.php
new file mode 100644
index 0000000000000000000000000000000000000000..0d5ce7f7591134a5eb46f843b2595f7d2d5ebfa0
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.fetch.php
@@ -0,0 +1,221 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {fetch} plugin
+ *
+ * Type:     function<br>
+ * Name:     fetch<br>
+ * Purpose:  fetch file, web or ftp data and display results
+ * @link http://smarty.php.net/manual/en/language.function.fetch.php {fetch}
+ *       (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ * @return string|null if the assign parameter is passed, Smarty assigns the
+ *                     result to a template variable
+ */
+function smarty_function_fetch($params, &$smarty)
+{
+    if (empty($params['file'])) {
+        $smarty->_trigger_fatal_error("[plugin] parameter 'file' cannot be empty");
+        return;
+    }
+
+    $content = '';
+    if ($smarty->security && !preg_match('!^(http|ftp)://!i', $params['file'])) {
+        $_params = array('resource_type' => 'file', 'resource_name' => $params['file']);
+        require_once(SMARTY_CORE_DIR . 'core.is_secure.php');
+        if(!smarty_core_is_secure($_params, $smarty)) {
+            $smarty->_trigger_fatal_error('[plugin] (secure mode) fetch \'' . $params['file'] . '\' is not allowed');
+            return;
+        }
+        
+        // fetch the file
+        if($fp = @fopen($params['file'],'r')) {
+            while(!feof($fp)) {
+                $content .= fgets ($fp,4096);
+            }
+            fclose($fp);
+        } else {
+            $smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] . '\'');
+            return;
+        }
+    } else {
+        // not a local file
+        if(preg_match('!^http://!i',$params['file'])) {
+            // http fetch
+            if($uri_parts = parse_url($params['file'])) {
+                // set defaults
+                $host = $server_name = $uri_parts['host'];
+                $timeout = 30;
+                $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*";
+                $agent = "Smarty Template Engine ".$smarty->_version;
+                $referer = "";
+                $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/';
+                $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : '';
+                $_is_proxy = false;
+                if(empty($uri_parts['port'])) {
+                    $port = 80;
+                } else {
+                    $port = $uri_parts['port'];
+                }
+                if(!empty($uri_parts['user'])) {
+                    $user = $uri_parts['user'];
+                }
+                if(!empty($uri_parts['pass'])) {
+                    $pass = $uri_parts['pass'];
+                }
+                // loop through parameters, setup headers
+                foreach($params as $param_key => $param_value) {
+                    switch($param_key) {
+                        case "file":
+                        case "assign":
+                        case "assign_headers":
+                            break;
+                        case "user":
+                            if(!empty($param_value)) {
+                                $user = $param_value;
+                            }
+                            break;
+                        case "pass":
+                            if(!empty($param_value)) {
+                                $pass = $param_value;
+                            }
+                            break;
+                        case "accept":
+                            if(!empty($param_value)) {
+                                $accept = $param_value;
+                            }
+                            break;
+                        case "header":
+                            if(!empty($param_value)) {
+                                if(!preg_match('![\w\d-]+: .+!',$param_value)) {
+                                    $smarty->_trigger_fatal_error("[plugin] invalid header format '".$param_value."'");
+                                    return;
+                                } else {
+                                    $extra_headers[] = $param_value;
+                                }
+                            }
+                            break;
+                        case "proxy_host":
+                            if(!empty($param_value)) {
+                                $proxy_host = $param_value;
+                            }
+                            break;
+                        case "proxy_port":
+                            if(!preg_match('!\D!', $param_value)) {
+                                $proxy_port = (int) $param_value;
+                            } else {
+                                $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'");
+                                return;
+                            }
+                            break;
+                        case "agent":
+                            if(!empty($param_value)) {
+                                $agent = $param_value;
+                            }
+                            break;
+                        case "referer":
+                            if(!empty($param_value)) {
+                                $referer = $param_value;
+                            }
+                            break;
+                        case "timeout":
+                            if(!preg_match('!\D!', $param_value)) {
+                                $timeout = (int) $param_value;
+                            } else {
+                                $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'");
+                                return;
+                            }
+                            break;
+                        default:
+                            $smarty->_trigger_fatal_error("[plugin] unrecognized attribute '".$param_key."'");
+                            return;
+                    }
+                }
+                if(!empty($proxy_host) && !empty($proxy_port)) {
+                    $_is_proxy = true;
+                    $fp = fsockopen($proxy_host,$proxy_port,$errno,$errstr,$timeout);
+                } else {
+                    $fp = fsockopen($server_name,$port,$errno,$errstr,$timeout);
+                }
+
+                if(!$fp) {
+                    $smarty->_trigger_fatal_error("[plugin] unable to fetch: $errstr ($errno)");
+                    return;
+                } else {
+                    if($_is_proxy) {
+                        fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n");
+                    } else {
+                        fputs($fp, "GET $uri HTTP/1.0\r\n");
+                    }
+                    if(!empty($host)) {
+                        fputs($fp, "Host: $host\r\n");
+                    }
+                    if(!empty($accept)) {
+                        fputs($fp, "Accept: $accept\r\n");
+                    }
+                    if(!empty($agent)) {
+                        fputs($fp, "User-Agent: $agent\r\n");
+                    }
+                    if(!empty($referer)) {
+                        fputs($fp, "Referer: $referer\r\n");
+                    }
+                    if(isset($extra_headers) && is_array($extra_headers)) {
+                        foreach($extra_headers as $curr_header) {
+                            fputs($fp, $curr_header."\r\n");
+                        }
+                    }
+                    if(!empty($user) && !empty($pass)) {
+                        fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n");
+                    }
+
+                    fputs($fp, "\r\n");
+                    while(!feof($fp)) {
+                        $content .= fgets($fp,4096);
+                    }
+                    fclose($fp);
+                    $csplit = split("\r\n\r\n",$content,2);
+
+                    $content = $csplit[1];
+
+                    if(!empty($params['assign_headers'])) {
+                        $smarty->assign($params['assign_headers'],split("\r\n",$csplit[0]));
+                    }
+                }
+            } else {
+                $smarty->_trigger_fatal_error("[plugin] unable to parse URL, check syntax");
+                return;
+            }
+        } else {
+            // ftp fetch
+            if($fp = @fopen($params['file'],'r')) {
+                while(!feof($fp)) {
+                    $content .= fgets ($fp,4096);
+                }
+                fclose($fp);
+            } else {
+                $smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] .'\'');
+                return;
+            }
+        }
+
+    }
+
+
+    if (!empty($params['assign'])) {
+        $smarty->assign($params['assign'],$content);
+    } else {
+        return $content;
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.html_checkboxes.php b/GPL_LIB/Smarty/libs/plugins/function.html_checkboxes.php
new file mode 100644
index 0000000000000000000000000000000000000000..45a161be6e776f8b52c9324afc8c767a6e364fa2
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.html_checkboxes.php
@@ -0,0 +1,143 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_checkboxes} function plugin
+ *
+ * File:       function.html_checkboxes.php<br>
+ * Type:       function<br>
+ * Name:       html_checkboxes<br>
+ * Date:       24.Feb.2003<br>
+ * Purpose:    Prints out a list of checkbox input types<br>
+ * Input:<br>
+ *           - name       (optional) - string default "checkbox"
+ *           - values     (required) - array
+ *           - options    (optional) - associative array
+ *           - checked    (optional) - array default not set
+ *           - separator  (optional) - ie <br> or &nbsp;
+ *           - output     (optional) - the output next to each checkbox
+ *           - assign     (optional) - assign the output as an array to this variable
+ * Examples:
+ * <pre>
+ * {html_checkboxes values=$ids output=$names}
+ * {html_checkboxes values=$ids name='box' separator='<br>' output=$names}
+ * {html_checkboxes values=$ids checked=$checked separator='<br>' output=$names}
+ * </pre>
+ * @link http://smarty.php.net/manual/en/language.function.html.checkboxes.php {html_checkboxes}
+ *      (Smarty online manual)
+ * @author     Christopher Kvarme <christopher.kvarme@flashjab.com>
+ * @author credits to Monte Ohrt <monte at ohrt dot com>
+ * @version    1.0
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_checkboxes($params, &$smarty)
+{
+    require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+
+    $name = 'checkbox';
+    $values = null;
+    $options = null;
+    $selected = null;
+    $separator = '';
+    $labels = true;
+    $output = null;
+
+    $extra = '';
+
+    foreach($params as $_key => $_val) {
+        switch($_key) {
+            case 'name':
+            case 'separator':
+                $$_key = $_val;
+                break;
+
+            case 'labels':
+                $$_key = (bool)$_val;
+                break;
+
+            case 'options':
+                $$_key = (array)$_val;
+                break;
+
+            case 'values':
+            case 'output':
+                $$_key = array_values((array)$_val);
+                break;
+
+            case 'checked':
+            case 'selected':
+                $selected = array_map('strval', array_values((array)$_val));
+                break;
+
+            case 'checkboxes':
+                $smarty->trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING);
+                $options = (array)$_val;
+                break;
+
+            case 'assign':
+                break;
+
+            default:
+                if(!is_array($_val)) {
+                    $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+                } else {
+                    $smarty->trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                }
+                break;
+        }
+    }
+
+    if (!isset($options) && !isset($values))
+        return ''; /* raise error here? */
+
+    settype($selected, 'array');
+    $_html_result = array();
+
+    if (isset($options)) {
+
+        foreach ($options as $_key=>$_val)
+            $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
+
+
+    } else {
+        foreach ($values as $_i=>$_key) {
+            $_val = isset($output[$_i]) ? $output[$_i] : '';
+            $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
+        }
+
+    }
+
+    if(!empty($params['assign'])) {
+        $smarty->assign($params['assign'], $_html_result);
+    } else {
+        return implode("\n",$_html_result);
+    }
+
+}
+
+function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels) {
+    $_output = '';
+    if ($labels) $_output .= '<label>';
+    $_output .= '<input type="checkbox" name="'
+        . smarty_function_escape_special_chars($name) . '[]" value="'
+        . smarty_function_escape_special_chars($value) . '"';
+
+    if (in_array((string)$value, $selected)) {
+        $_output .= ' checked="checked"';
+    }
+    $_output .= $extra . ' />' . $output;
+    if ($labels) $_output .= '</label>';
+    $_output .=  $separator;
+
+    return $_output;
+}
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.html_image.php b/GPL_LIB/Smarty/libs/plugins/function.html_image.php
new file mode 100644
index 0000000000000000000000000000000000000000..d758ebe7d8371c14fce73757ca77ca72e873915e
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.html_image.php
@@ -0,0 +1,142 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_image} function plugin
+ *
+ * Type:     function<br>
+ * Name:     html_image<br>
+ * Date:     Feb 24, 2003<br>
+ * Purpose:  format HTML tags for the image<br>
+ * Input:<br>
+ *         - file = file (and path) of image (required)
+ *         - height = image height (optional, default actual height)
+ *         - width = image width (optional, default actual width)
+ *         - basedir = base directory for absolute paths, default
+ *                     is environment variable DOCUMENT_ROOT
+ *         - path_prefix = prefix for path output (optional, default empty)
+ *
+ * Examples: {html_image file="/images/masthead.gif"}
+ * Output:   <img src="/images/masthead.gif" width=400 height=23>
+ * @link http://smarty.php.net/manual/en/language.function.html.image.php {html_image}
+ *      (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @author credits to Duda <duda@big.hu> - wrote first image function
+ *           in repository, helped with lots of functionality
+ * @version  1.0
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_image($params, &$smarty)
+{
+    require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+    
+    $alt = '';
+    $file = '';
+    $height = '';
+    $width = '';
+    $extra = '';
+    $prefix = '';
+    $suffix = '';
+    $path_prefix = '';
+    $server_vars = ($smarty->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
+    $basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : '';
+    foreach($params as $_key => $_val) {
+        switch($_key) {
+            case 'file':
+            case 'height':
+            case 'width':
+            case 'dpi':
+            case 'path_prefix':
+            case 'basedir':
+                $$_key = $_val;
+                break;
+
+            case 'alt':
+                if(!is_array($_val)) {
+                    $$_key = smarty_function_escape_special_chars($_val);
+                } else {
+                    $smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                }
+                break;
+
+            case 'link':
+            case 'href':
+                $prefix = '<a href="' . $_val . '">';
+                $suffix = '</a>';
+                break;
+
+            default:
+                if(!is_array($_val)) {
+                    $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+                } else {
+                    $smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                }
+                break;
+        }
+    }
+
+    if (empty($file)) {
+        $smarty->trigger_error("html_image: missing 'file' parameter", E_USER_NOTICE);
+        return;
+    }
+
+    if (substr($file,0,1) == '/') {
+        $_image_path = $basedir . $file;
+    } else {
+        $_image_path = $file;
+    }
+    
+    if(!isset($params['width']) || !isset($params['height'])) {
+        if(!$_image_data = @getimagesize($_image_path)) {
+            if(!file_exists($_image_path)) {
+                $smarty->trigger_error("html_image: unable to find '$_image_path'", E_USER_NOTICE);
+                return;
+            } else if(!is_readable($_image_path)) {
+                $smarty->trigger_error("html_image: unable to read '$_image_path'", E_USER_NOTICE);
+                return;
+            } else {
+                $smarty->trigger_error("html_image: '$_image_path' is not a valid image file", E_USER_NOTICE);
+                return;
+            }
+        }
+        if ($smarty->security &&
+            ($_params = array('resource_type' => 'file', 'resource_name' => $_image_path)) &&
+            (require_once(SMARTY_CORE_DIR . 'core.is_secure.php')) &&
+            (!smarty_core_is_secure($_params, $smarty)) ) {
+            $smarty->trigger_error("html_image: (secure) '$_image_path' not in secure directory", E_USER_NOTICE);
+        }        
+        
+        if(!isset($params['width'])) {
+            $width = $_image_data[0];
+        }
+        if(!isset($params['height'])) {
+            $height = $_image_data[1];
+        }
+
+    }
+
+    if(isset($params['dpi'])) {
+        if(strstr($server_vars['HTTP_USER_AGENT'], 'Mac')) {
+            $dpi_default = 72;
+        } else {
+            $dpi_default = 96;
+        }
+        $_resize = $dpi_default/$params['dpi'];
+        $width = round($width * $_resize);
+        $height = round($height * $_resize);
+    }
+
+    return $prefix . '<img src="'.$path_prefix.$file.'" alt="'.$alt.'" width="'.$width.'" height="'.$height.'"'.$extra.' />' . $suffix;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.html_options.php b/GPL_LIB/Smarty/libs/plugins/function.html_options.php
new file mode 100644
index 0000000000000000000000000000000000000000..f84b63136b82582d516d4aff590ed4e24b4ddd3a
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.html_options.php
@@ -0,0 +1,122 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_options} function plugin
+ *
+ * Type:     function<br>
+ * Name:     html_options<br>
+ * Input:<br>
+ *           - name       (optional) - string default "select"
+ *           - values     (required if no options supplied) - array
+ *           - options    (required if no values supplied) - associative array
+ *           - selected   (optional) - string default not set
+ *           - output     (required if not options supplied) - array
+ * Purpose:  Prints the list of <option> tags generated from
+ *           the passed parameters
+ * @link http://smarty.php.net/manual/en/language.function.html.options.php {html_image}
+ *      (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_options($params, &$smarty)
+{
+    require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+    
+    $name = null;
+    $values = null;
+    $options = null;
+    $selected = array();
+    $output = null;
+    
+    $extra = '';
+    
+    foreach($params as $_key => $_val) {
+        switch($_key) {
+            case 'name':
+                $$_key = (string)$_val;
+                break;
+            
+            case 'options':
+                $$_key = (array)$_val;
+                break;
+                
+            case 'values':
+            case 'output':
+                $$_key = array_values((array)$_val);
+                break;
+
+            case 'selected':
+                $$_key = array_map('strval', array_values((array)$_val));
+                break;
+                
+            default:
+                if(!is_array($_val)) {
+                    $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+                } else {
+                    $smarty->trigger_error("html_options: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                }
+                break;
+        }
+    }
+
+    if (!isset($options) && !isset($values))
+        return ''; /* raise error here? */
+
+    $_html_result = '';
+
+    if (isset($options)) {
+        
+        foreach ($options as $_key=>$_val)
+            $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
+
+    } else {
+        
+        foreach ($values as $_i=>$_key) {
+            $_val = isset($output[$_i]) ? $output[$_i] : '';
+            $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
+        }
+
+    }
+
+    if(!empty($name)) {
+        $_html_result = '<select name="' . $name . '"' . $extra . '>' . "\n" . $_html_result . '</select>' . "\n";
+    }
+
+    return $_html_result;
+
+}
+
+function smarty_function_html_options_optoutput($key, $value, $selected) {
+    if(!is_array($value)) {
+        $_html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' .
+            smarty_function_escape_special_chars($key) . '"';
+        if (in_array((string)$key, $selected))
+            $_html_result .= ' selected="selected"';
+        $_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n";
+    } else {
+        $_html_result = smarty_function_html_options_optgroup($key, $value, $selected);
+    }
+    return $_html_result;
+}
+
+function smarty_function_html_options_optgroup($key, $values, $selected) {
+    $optgroup_html = '<optgroup label="' . smarty_function_escape_special_chars($key) . '">' . "\n";
+    foreach ($values as $key => $value) {
+        $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected);
+    }
+    $optgroup_html .= "</optgroup>\n";
+    return $optgroup_html;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.html_radios.php b/GPL_LIB/Smarty/libs/plugins/function.html_radios.php
new file mode 100644
index 0000000000000000000000000000000000000000..239ad8fc835b6114bf4e4ef90e8c88b14f262b2d
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.html_radios.php
@@ -0,0 +1,156 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_radios} function plugin
+ *
+ * File:       function.html_radios.php<br>
+ * Type:       function<br>
+ * Name:       html_radios<br>
+ * Date:       24.Feb.2003<br>
+ * Purpose:    Prints out a list of radio input types<br>
+ * Input:<br>
+ *           - name       (optional) - string default "radio"
+ *           - values     (required) - array
+ *           - options    (optional) - associative array
+ *           - checked    (optional) - array default not set
+ *           - separator  (optional) - ie <br> or &nbsp;
+ *           - output     (optional) - the output next to each radio button
+ *           - assign     (optional) - assign the output as an array to this variable
+ * Examples:
+ * <pre>
+ * {html_radios values=$ids output=$names}
+ * {html_radios values=$ids name='box' separator='<br>' output=$names}
+ * {html_radios values=$ids checked=$checked separator='<br>' output=$names}
+ * </pre>
+ * @link http://smarty.php.net/manual/en/language.function.html.radios.php {html_radios}
+ *      (Smarty online manual)
+ * @author     Christopher Kvarme <christopher.kvarme@flashjab.com>
+ * @author credits to Monte Ohrt <monte at ohrt dot com>
+ * @version    1.0
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_radios($params, &$smarty)
+{
+    require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+   
+    $name = 'radio';
+    $values = null;
+    $options = null;
+    $selected = null;
+    $separator = '';
+    $labels = true;
+    $label_ids = false;
+    $output = null;
+    $extra = '';
+
+    foreach($params as $_key => $_val) {
+        switch($_key) {
+            case 'name':
+            case 'separator':
+                $$_key = (string)$_val;
+                break;
+
+            case 'checked':
+            case 'selected':
+                if(is_array($_val)) {
+                    $smarty->trigger_error('html_radios: the "' . $_key . '" attribute cannot be an array', E_USER_WARNING);
+                } else {
+                    $selected = (string)$_val;
+                }
+                break;
+
+            case 'labels':
+            case 'label_ids':
+                $$_key = (bool)$_val;
+                break;
+
+            case 'options':
+                $$_key = (array)$_val;
+                break;
+
+            case 'values':
+            case 'output':
+                $$_key = array_values((array)$_val);
+                break;
+
+            case 'radios':
+                $smarty->trigger_error('html_radios: the use of the "radios" attribute is deprecated, use "options" instead', E_USER_WARNING);
+                $options = (array)$_val;
+                break;
+
+            case 'assign':
+                break;
+
+            default:
+                if(!is_array($_val)) {
+                    $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+                } else {
+                    $smarty->trigger_error("html_radios: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                }
+                break;
+        }
+    }
+
+    if (!isset($options) && !isset($values))
+        return ''; /* raise error here? */
+
+    $_html_result = array();
+
+    if (isset($options)) {
+
+        foreach ($options as $_key=>$_val)
+            $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids);
+
+    } else {
+
+        foreach ($values as $_i=>$_key) {
+            $_val = isset($output[$_i]) ? $output[$_i] : '';
+            $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids);
+        }
+
+    }
+
+    if(!empty($params['assign'])) {
+        $smarty->assign($params['assign'], $_html_result);
+    } else {
+        return implode("\n",$_html_result);
+    }
+
+}
+
+function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids) {
+    $_output = '';
+    if ($labels) {
+      if($label_ids) {
+          $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!', '_', $name . '_' . $value));
+          $_output .= '<label for="' . $_id . '">';
+      } else {
+          $_output .= '<label>';           
+      }
+   }
+   $_output .= '<input type="radio" name="'
+        . smarty_function_escape_special_chars($name) . '" value="'
+        . smarty_function_escape_special_chars($value) . '"';
+
+   if ($labels && $label_ids) $_output .= ' id="' . $_id . '"';
+
+    if ((string)$value==$selected) {
+        $_output .= ' checked="checked"';
+    }
+    $_output .= $extra . ' />' . $output;
+    if ($labels) $_output .= '</label>';
+    $_output .=  $separator;
+
+    return $_output;
+}
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.html_select_date.php b/GPL_LIB/Smarty/libs/plugins/function.html_select_date.php
new file mode 100644
index 0000000000000000000000000000000000000000..e216d587dd999af699948a8267f9e7a44f6b58bb
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.html_select_date.php
@@ -0,0 +1,323 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {html_select_date} plugin
+ *
+ * Type:     function<br>
+ * Name:     html_select_date<br>
+ * Purpose:  Prints the dropdowns for date selection.
+ *
+ * ChangeLog:<br>
+ *           - 1.0 initial release
+ *           - 1.1 added support for +/- N syntax for begin
+ *                and end year values. (Monte)
+ *           - 1.2 added support for yyyy-mm-dd syntax for
+ *                time value. (Jan Rosier)
+ *           - 1.3 added support for choosing format for
+ *                month values (Gary Loescher)
+ *           - 1.3.1 added support for choosing format for
+ *                day values (Marcus Bointon)
+ *           - 1.3.2 suppport negative timestamps, force year
+ *             dropdown to include given date unless explicitly set (Monte)
+ * @link http://smarty.php.net/manual/en/language.function.html.select.date.php {html_select_date}
+ *      (Smarty online manual)
+ * @version 1.3.2
+ * @author Andrei Zmievski
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_html_select_date($params, &$smarty)
+{
+    require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+    require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
+    require_once $smarty->_get_plugin_filepath('function','html_options');
+    /* Default values. */
+    $prefix          = "Date_";
+    $start_year      = strftime("%Y");
+    $end_year        = $start_year;
+    $display_days    = true;
+    $display_months  = true;
+    $display_years   = true;
+    $month_format    = "%B";
+    /* Write months as numbers by default  GL */
+    $month_value_format = "%m";
+    $day_format      = "%02d";
+    /* Write day values using this format MB */
+    $day_value_format = "%d";
+    $year_as_text    = false;
+    /* Display years in reverse order? Ie. 2000,1999,.... */
+    $reverse_years   = false;
+    /* Should the select boxes be part of an array when returned from PHP?
+       e.g. setting it to "birthday", would create "birthday[Day]",
+       "birthday[Month]" & "birthday[Year]". Can be combined with prefix */
+    $field_array     = null;
+    /* <select size>'s of the different <select> tags.
+       If not set, uses default dropdown. */
+    $day_size        = null;
+    $month_size      = null;
+    $year_size       = null;
+    /* Unparsed attributes common to *ALL* the <select>/<input> tags.
+       An example might be in the template: all_extra ='class ="foo"'. */
+    $all_extra       = null;
+    /* Separate attributes for the tags. */
+    $day_extra       = null;
+    $month_extra     = null;
+    $year_extra      = null;
+    /* Order in which to display the fields.
+       "D" -> day, "M" -> month, "Y" -> year. */
+    $field_order     = 'MDY';
+    /* String printed between the different fields. */
+    $field_separator = "\n";
+    $time = time();
+    $all_empty       = null;
+    $day_empty       = null;
+    $month_empty     = null;
+    $year_empty      = null;
+    $extra_attrs     = '';
+
+    foreach ($params as $_key=>$_value) {
+        switch ($_key) {
+            case 'prefix':
+            case 'time':
+            case 'start_year':
+            case 'end_year':
+            case 'month_format':
+            case 'day_format':
+            case 'day_value_format':
+            case 'field_array':
+            case 'day_size':
+            case 'month_size':
+            case 'year_size':
+            case 'all_extra':
+            case 'day_extra':
+            case 'month_extra':
+            case 'year_extra':
+            case 'field_order':
+            case 'field_separator':
+            case 'month_value_format':
+            case 'month_empty':
+            case 'day_empty':
+            case 'year_empty':
+                $$_key = (string)$_value;
+                break;
+
+            case 'all_empty':
+                $$_key = (string)$_value;
+                $day_empty = $month_empty = $year_empty = $all_empty;
+                break;
+
+            case 'display_days':
+            case 'display_months':
+            case 'display_years':
+            case 'year_as_text':
+            case 'reverse_years':
+                $$_key = (bool)$_value;
+                break;
+
+            default:
+                if(!is_array($_value)) {
+                    $extra_attrs .= ' '.$_key.'="'.smarty_function_escape_special_chars($_value).'"';
+                } else {
+                    $smarty->trigger_error("html_select_date: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+                }
+                break;
+        }
+    }
+
+    if(preg_match('!^-\d+$!',$time)) {
+        // negative timestamp, use date()
+        $time = date('Y-m-d',$time);
+    }
+    // If $time is not in format yyyy-mm-dd
+    if (!preg_match('/^\d{0,4}-\d{0,2}-\d{0,2}$/', $time)) {
+        // use smarty_make_timestamp to get an unix timestamp and
+        // strftime to make yyyy-mm-dd
+        $time = strftime('%Y-%m-%d', smarty_make_timestamp($time));
+    }
+    // Now split this in pieces, which later can be used to set the select
+    $time = explode("-", $time);
+    
+    // make syntax "+N" or "-N" work with start_year and end_year
+    if (preg_match('!^(\+|\-)\s*(\d+)$!', $end_year, $match)) {
+        if ($match[1] == '+') {
+            $end_year = strftime('%Y') + $match[2];
+        } else {
+            $end_year = strftime('%Y') - $match[2];
+        }
+    }
+    if (preg_match('!^(\+|\-)\s*(\d+)$!', $start_year, $match)) {
+        if ($match[1] == '+') {
+            $start_year = strftime('%Y') + $match[2];
+        } else {
+            $start_year = strftime('%Y') - $match[2];
+        }
+    }
+    if (strlen($time[0]) > 0) { 
+        if ($start_year > $time[0] && !isset($params['start_year'])) {
+            // force start year to include given date if not explicitly set
+            $start_year = $time[0];
+        }
+        if($end_year < $time[0] && !isset($params['end_year'])) {
+            // force end year to include given date if not explicitly set
+            $end_year = $time[0];
+        }
+    }
+
+    $field_order = strtoupper($field_order);
+
+    $html_result = $month_result = $day_result = $year_result = "";
+
+    if ($display_months) {
+        $month_names = array();
+        $month_values = array();
+        if(isset($month_empty)) {
+            $month_names[''] = $month_empty;
+            $month_values[''] = '';
+        }
+        for ($i = 1; $i <= 12; $i++) {
+            $month_names[$i] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000));
+            $month_values[$i] = strftime($month_value_format, mktime(0, 0, 0, $i, 1, 2000));
+        }
+
+        $month_result .= '<select name=';
+        if (null !== $field_array){
+            $month_result .= '"' . $field_array . '[' . $prefix . 'Month]"';
+        } else {
+            $month_result .= '"' . $prefix . 'Month"';
+        }
+        if (null !== $month_size){
+            $month_result .= ' size="' . $month_size . '"';
+        }
+        if (null !== $month_extra){
+            $month_result .= ' ' . $month_extra;
+        }
+        if (null !== $all_extra){
+            $month_result .= ' ' . $all_extra;
+        }
+        $month_result .= $extra_attrs . '>'."\n";
+
+        $month_result .= smarty_function_html_options(array('output'     => $month_names,
+                                                            'values'     => $month_values,
+                                                            'selected'   => (int)$time[1] ? strftime($month_value_format, mktime(0, 0, 0, (int)$time[1], 1, 2000)) : '',
+                                                            'print_result' => false),
+                                                      $smarty);
+        $month_result .= '</select>';
+    }
+
+    if ($display_days) {
+        $days = array();
+        if (isset($day_empty)) {
+            $days[''] = $day_empty;
+            $day_values[''] = '';
+        }
+        for ($i = 1; $i <= 31; $i++) {
+            $days[] = sprintf($day_format, $i);
+            $day_values[] = sprintf($day_value_format, $i);
+        }
+
+        $day_result .= '<select name=';
+        if (null !== $field_array){
+            $day_result .= '"' . $field_array . '[' . $prefix . 'Day]"';
+        } else {
+            $day_result .= '"' . $prefix . 'Day"';
+        }
+        if (null !== $day_size){
+            $day_result .= ' size="' . $day_size . '"';
+        }
+        if (null !== $all_extra){
+            $day_result .= ' ' . $all_extra;
+        }
+        if (null !== $day_extra){
+            $day_result .= ' ' . $day_extra;
+        }
+        $day_result .= $extra_attrs . '>'."\n";
+        $day_result .= smarty_function_html_options(array('output'     => $days,
+                                                          'values'     => $day_values,
+                                                          'selected'   => $time[2],
+                                                          'print_result' => false),
+                                                    $smarty);
+        $day_result .= '</select>';
+    }
+
+    if ($display_years) {
+        if (null !== $field_array){
+            $year_name = $field_array . '[' . $prefix . 'Year]';
+        } else {
+            $year_name = $prefix . 'Year';
+        }
+        if ($year_as_text) {
+            $year_result .= '<input type="text" name="' . $year_name . '" value="' . $time[0] . '" size="4" maxlength="4"';
+            if (null !== $all_extra){
+                $year_result .= ' ' . $all_extra;
+            }
+            if (null !== $year_extra){
+                $year_result .= ' ' . $year_extra;
+            }
+            $year_result .= ' />';
+        } else {
+            $years = range((int)$start_year, (int)$end_year);
+            if ($reverse_years) {
+                rsort($years, SORT_NUMERIC);
+            } else {
+                sort($years, SORT_NUMERIC);
+            }
+            $yearvals = $years;
+            if(isset($year_empty)) {
+                array_unshift($years, $year_empty);
+                array_unshift($yearvals, '');
+            }
+            $year_result .= '<select name="' . $year_name . '"';
+            if (null !== $year_size){
+                $year_result .= ' size="' . $year_size . '"';
+            }
+            if (null !== $all_extra){
+                $year_result .= ' ' . $all_extra;
+            }
+            if (null !== $year_extra){
+                $year_result .= ' ' . $year_extra;
+            }
+            $year_result .= $extra_attrs . '>'."\n";
+            $year_result .= smarty_function_html_options(array('output' => $years,
+                                                               'values' => $yearvals,
+                                                               'selected'   => $time[0],
+                                                               'print_result' => false),
+                                                         $smarty);
+            $year_result .= '</select>';
+        }
+    }
+
+    // Loop thru the field_order field
+    for ($i = 0; $i <= 2; $i++){
+        $c = substr($field_order, $i, 1);
+        switch ($c){
+            case 'D':
+                $html_result .= $day_result;
+                break;
+
+            case 'M':
+                $html_result .= $month_result;
+                break;
+
+            case 'Y':
+                $html_result .= $year_result;
+                break;
+        }
+        // Add the field seperator
+        if($i != 2) {
+            $html_result .= $field_separator;
+        }
+    }
+
+    return $html_result;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.html_select_time.php b/GPL_LIB/Smarty/libs/plugins/function.html_select_time.php
new file mode 100644
index 0000000000000000000000000000000000000000..c0f56eec03b7b554ad1eac02e687b51859d1bb98
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.html_select_time.php
@@ -0,0 +1,194 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_select_time} function plugin
+ *
+ * Type:     function<br>
+ * Name:     html_select_time<br>
+ * Purpose:  Prints the dropdowns for time selection
+ * @link http://smarty.php.net/manual/en/language.function.html.select.time.php {html_select_time}
+ *          (Smarty online manual)
+ * @author Roberto Berto <roberto@berto.net>
+ * @credits Monte Ohrt <monte AT ohrt DOT com>
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_make_timestamp()
+ */
+function smarty_function_html_select_time($params, &$smarty)
+{
+    require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
+    require_once $smarty->_get_plugin_filepath('function','html_options');
+    /* Default values. */
+    $prefix             = "Time_";
+    $time               = time();
+    $display_hours      = true;
+    $display_minutes    = true;
+    $display_seconds    = true;
+    $display_meridian   = true;
+    $use_24_hours       = true;
+    $minute_interval    = 1;
+    $second_interval    = 1;
+    /* Should the select boxes be part of an array when returned from PHP?
+       e.g. setting it to "birthday", would create "birthday[Hour]",
+       "birthday[Minute]", "birthday[Seconds]" & "birthday[Meridian]".
+       Can be combined with prefix. */
+    $field_array        = null;
+    $all_extra          = null;
+    $hour_extra         = null;
+    $minute_extra       = null;
+    $second_extra       = null;
+    $meridian_extra     = null;
+
+    foreach ($params as $_key=>$_value) {
+        switch ($_key) {
+            case 'prefix':
+            case 'time':
+            case 'field_array':
+            case 'all_extra':
+            case 'hour_extra':
+            case 'minute_extra':
+            case 'second_extra':
+            case 'meridian_extra':
+                $$_key = (string)$_value;
+                break;
+
+            case 'display_hours':
+            case 'display_minutes':
+            case 'display_seconds':
+            case 'display_meridian':
+            case 'use_24_hours':
+                $$_key = (bool)$_value;
+                break;
+
+            case 'minute_interval':
+            case 'second_interval':
+                $$_key = (int)$_value;
+                break;
+
+            default:
+                $smarty->trigger_error("[html_select_time] unknown parameter $_key", E_USER_WARNING);
+        }
+    }
+
+    $time = smarty_make_timestamp($time);
+
+    $html_result = '';
+
+    if ($display_hours) {
+        $hours       = $use_24_hours ? range(0, 23) : range(1, 12);
+        $hour_fmt = $use_24_hours ? '%H' : '%I';
+        for ($i = 0, $for_max = count($hours); $i < $for_max; $i++)
+            $hours[$i] = sprintf('%02d', $hours[$i]);
+        $html_result .= '<select name=';
+        if (null !== $field_array) {
+            $html_result .= '"' . $field_array . '[' . $prefix . 'Hour]"';
+        } else {
+            $html_result .= '"' . $prefix . 'Hour"';
+        }
+        if (null !== $hour_extra){
+            $html_result .= ' ' . $hour_extra;
+        }
+        if (null !== $all_extra){
+            $html_result .= ' ' . $all_extra;
+        }
+        $html_result .= '>'."\n";
+        $html_result .= smarty_function_html_options(array('output'          => $hours,
+                                                           'values'          => $hours,
+                                                           'selected'      => strftime($hour_fmt, $time),
+                                                           'print_result' => false),
+                                                     $smarty);
+        $html_result .= "</select>\n";
+    }
+
+    if ($display_minutes) {
+        $all_minutes = range(0, 59);
+        for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i+= $minute_interval)
+            $minutes[] = sprintf('%02d', $all_minutes[$i]);
+        $selected = intval(floor(strftime('%M', $time) / $minute_interval) * $minute_interval);
+        $html_result .= '<select name=';
+        if (null !== $field_array) {
+            $html_result .= '"' . $field_array . '[' . $prefix . 'Minute]"';
+        } else {
+            $html_result .= '"' . $prefix . 'Minute"';
+        }
+        if (null !== $minute_extra){
+            $html_result .= ' ' . $minute_extra;
+        }
+        if (null !== $all_extra){
+            $html_result .= ' ' . $all_extra;
+        }
+        $html_result .= '>'."\n";
+        
+        $html_result .= smarty_function_html_options(array('output'          => $minutes,
+                                                           'values'          => $minutes,
+                                                           'selected'      => $selected,
+                                                           'print_result' => false),
+                                                     $smarty);
+        $html_result .= "</select>\n";
+    }
+
+    if ($display_seconds) {
+        $all_seconds = range(0, 59);
+        for ($i = 0, $for_max = count($all_seconds); $i < $for_max; $i+= $second_interval)
+            $seconds[] = sprintf('%02d', $all_seconds[$i]);
+        $selected = intval(floor(strftime('%S', $time) / $second_interval) * $second_interval);
+        $html_result .= '<select name=';
+        if (null !== $field_array) {
+            $html_result .= '"' . $field_array . '[' . $prefix . 'Second]"';
+        } else {
+            $html_result .= '"' . $prefix . 'Second"';
+        }
+        
+        if (null !== $second_extra){
+            $html_result .= ' ' . $second_extra;
+        }
+        if (null !== $all_extra){
+            $html_result .= ' ' . $all_extra;
+        }
+        $html_result .= '>'."\n";
+        
+        $html_result .= smarty_function_html_options(array('output'          => $seconds,
+                                                           'values'          => $seconds,
+                                                           'selected'      => $selected,
+                                                           'print_result' => false),
+                                                     $smarty);
+        $html_result .= "</select>\n";
+    }
+
+    if ($display_meridian && !$use_24_hours) {
+        $html_result .= '<select name=';
+        if (null !== $field_array) {
+            $html_result .= '"' . $field_array . '[' . $prefix . 'Meridian]"';
+        } else {
+            $html_result .= '"' . $prefix . 'Meridian"';
+        }
+        
+        if (null !== $meridian_extra){
+            $html_result .= ' ' . $meridian_extra;
+        }
+        if (null !== $all_extra){
+            $html_result .= ' ' . $all_extra;
+        }
+        $html_result .= '>'."\n";
+        
+        $html_result .= smarty_function_html_options(array('output'          => array('AM', 'PM'),
+                                                           'values'          => array('am', 'pm'),
+                                                           'selected'      => strtolower(strftime('%p', $time)),
+                                                           'print_result' => false),
+                                                     $smarty);
+        $html_result .= "</select>\n";
+    }
+
+    return $html_result;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.html_table.php b/GPL_LIB/Smarty/libs/plugins/function.html_table.php
new file mode 100644
index 0000000000000000000000000000000000000000..b009f8ec0db6f72918f7fa74d8bce43eabc89f67
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.html_table.php
@@ -0,0 +1,137 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_table} function plugin
+ *
+ * Type:     function<br>
+ * Name:     html_table<br>
+ * Date:     Feb 17, 2003<br>
+ * Purpose:  make an html table from an array of data<br>
+ * Input:<br>
+ *         - loop = array to loop through
+ *         - cols = number of columns
+ *         - rows = number of rows
+ *         - table_attr = table attributes
+ *         - tr_attr = table row attributes (arrays are cycled)
+ *         - td_attr = table cell attributes (arrays are cycled)
+ *         - trailpad = value to pad trailing cells with
+ *         - vdir = vertical direction (default: "down", means top-to-bottom)
+ *         - hdir = horizontal direction (default: "right", means left-to-right)
+ *         - inner = inner loop (default "cols": print $loop line by line,
+ *                   $loop will be printed column by column otherwise)
+ *
+ *
+ * Examples:
+ * <pre>
+ * {table loop=$data}
+ * {table loop=$data cols=4 tr_attr='"bgcolor=red"'}
+ * {table loop=$data cols=4 tr_attr=$colors}
+ * </pre>
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @version  1.0
+ * @link http://smarty.php.net/manual/en/language.function.html.table.php {html_table}
+ *          (Smarty online manual)
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_html_table($params, &$smarty)
+{
+    $table_attr = 'border="1"';
+    $tr_attr = '';
+    $td_attr = '';
+    $cols = 3;
+    $rows = 3;
+    $trailpad = '&nbsp;';
+    $vdir = 'down';
+    $hdir = 'right';
+    $inner = 'cols';
+
+    if (!isset($params['loop'])) {
+        $smarty->trigger_error("html_table: missing 'loop' parameter");
+        return;
+    }
+
+    foreach ($params as $_key=>$_value) {
+        switch ($_key) {
+            case 'loop':
+                $$_key = (array)$_value;
+                break;
+
+            case 'cols':
+            case 'rows':
+                $$_key = (int)$_value;
+                break;
+
+            case 'table_attr':
+            case 'trailpad':
+            case 'hdir':
+            case 'vdir':
+            case 'inner':
+                $$_key = (string)$_value;
+                break;
+
+            case 'tr_attr':
+            case 'td_attr':
+                $$_key = $_value;
+                break;
+        }
+    }
+
+    $loop_count = count($loop);
+    if (empty($params['rows'])) {
+        /* no rows specified */
+        $rows = ceil($loop_count/$cols);
+    } elseif (empty($params['cols'])) {
+        if (!empty($params['rows'])) {
+            /* no cols specified, but rows */
+            $cols = ceil($loop_count/$rows);
+        }
+    }
+
+    $output = "<table $table_attr>\n";
+
+    for ($r=0; $r<$rows; $r++) {
+        $output .= "<tr" . smarty_function_html_table_cycle('tr', $tr_attr, $r) . ">\n";
+        $rx =  ($vdir == 'down') ? $r*$cols : ($rows-1-$r)*$cols;
+
+        for ($c=0; $c<$cols; $c++) {
+            $x =  ($hdir == 'right') ? $rx+$c : $rx+$cols-1-$c;
+            if ($inner!='cols') {
+                /* shuffle x to loop over rows*/
+                $x = floor($x/$cols) + ($x%$cols)*$rows;
+            }
+
+            if ($x<$loop_count) {
+                $output .= "<td" . smarty_function_html_table_cycle('td', $td_attr, $c) . ">" . $loop[$x] . "</td>\n";
+            } else {
+                $output .= "<td" . smarty_function_html_table_cycle('td', $td_attr, $c) . ">$trailpad</td>\n";
+            }
+        }
+        $output .= "</tr>\n";
+    }
+    $output .= "</table>\n";
+    
+    return $output;
+}
+
+function smarty_function_html_table_cycle($name, $var, $no) {
+    if(!is_array($var)) {
+        $ret = $var;
+    } else {
+        $ret = $var[$no % count($var)];
+    }
+    
+    return ($ret) ? ' '.$ret : '';
+}
+
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.mailto.php b/GPL_LIB/Smarty/libs/plugins/function.mailto.php
new file mode 100644
index 0000000000000000000000000000000000000000..b88fa617ae3ff0f0839a0001870052b5f12fe5c5
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.mailto.php
@@ -0,0 +1,163 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {mailto} function plugin
+ *
+ * Type:     function<br>
+ * Name:     mailto<br>
+ * Date:     May 21, 2002
+ * Purpose:  automate mailto address link creation, and optionally
+ *           encode them.<br>
+ * Input:<br>
+ *         - address = e-mail address
+ *         - text = (optional) text to display, default is address
+ *         - encode = (optional) can be one of:
+ *                * none : no encoding (default)
+ *                * javascript : encode with javascript
+ *                * javascript_charcode : encode with javascript charcode
+ *                * hex : encode with hexidecimal (no javascript)
+ *         - cc = (optional) address(es) to carbon copy
+ *         - bcc = (optional) address(es) to blind carbon copy
+ *         - subject = (optional) e-mail subject
+ *         - newsgroups = (optional) newsgroup(s) to post to
+ *         - followupto = (optional) address(es) to follow up to
+ *         - extra = (optional) extra tags for the href link
+ *
+ * Examples:
+ * <pre>
+ * {mailto address="me@domain.com"}
+ * {mailto address="me@domain.com" encode="javascript"}
+ * {mailto address="me@domain.com" encode="hex"}
+ * {mailto address="me@domain.com" subject="Hello to you!"}
+ * {mailto address="me@domain.com" cc="you@domain.com,they@domain.com"}
+ * {mailto address="me@domain.com" extra='class="mailto"'}
+ * </pre>
+ * @link http://smarty.php.net/manual/en/language.function.mailto.php {mailto}
+ *          (Smarty online manual)
+ * @version  1.2
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @author   credits to Jason Sweat (added cc, bcc and subject functionality)
+ * @param    array
+ * @param    Smarty
+ * @return   string
+ */
+function smarty_function_mailto($params, &$smarty)
+{
+    $extra = '';
+
+    if (empty($params['address'])) {
+        $smarty->trigger_error("mailto: missing 'address' parameter");
+        return;
+    } else {
+        $address = $params['address'];
+    }
+
+    $text = $address;
+
+    // netscape and mozilla do not decode %40 (@) in BCC field (bug?)
+    // so, don't encode it.
+    $mail_parms = array();
+    foreach ($params as $var=>$value) {
+        switch ($var) {
+            case 'cc':
+            case 'bcc':
+            case 'followupto':
+                if (!empty($value))
+                    $mail_parms[] = $var.'='.str_replace('%40','@',rawurlencode($value));
+                break;
+                
+            case 'subject':
+            case 'newsgroups':
+                $mail_parms[] = $var.'='.rawurlencode($value);
+                break;
+
+            case 'extra':
+            case 'text':
+                $$var = $value;
+
+            default:
+        }
+    }
+
+    $mail_parm_vals = '';
+    for ($i=0; $i<count($mail_parms); $i++) {
+        $mail_parm_vals .= (0==$i) ? '?' : '&';
+        $mail_parm_vals .= $mail_parms[$i];
+    }
+    $address .= $mail_parm_vals;
+
+    $encode = (empty($params['encode'])) ? 'none' : $params['encode'];
+    if (!in_array($encode,array('javascript','javascript_charcode','hex','none')) ) {
+        $smarty->trigger_error("mailto: 'encode' parameter must be none, javascript or hex");
+        return;
+    }
+
+    if ($encode == 'javascript' ) {
+        $string = 'document.write(\'<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>\');';
+
+        $js_encode = '';
+        for ($x=0; $x < strlen($string); $x++) {
+            $js_encode .= '%' . bin2hex($string[$x]);
+        }
+
+        return '<script type="text/javascript">eval(unescape(\''.$js_encode.'\'))</script>';
+
+    } elseif ($encode == 'javascript_charcode' ) {
+        $string = '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>';
+
+        for($x = 0, $y = strlen($string); $x < $y; $x++ ) {
+            $ord[] = ord($string[$x]);   
+        }
+
+        $_ret = "<script type=\"text/javascript\" language=\"javascript\">\n";
+        $_ret .= "<!--\n";
+        $_ret .= "{document.write(String.fromCharCode(";
+        $_ret .= implode(',',$ord);
+        $_ret .= "))";
+        $_ret .= "}\n";
+        $_ret .= "//-->\n";
+        $_ret .= "</script>\n";
+        
+        return $_ret;
+        
+        
+    } elseif ($encode == 'hex') {
+
+        preg_match('!^(.*)(\?.*)$!',$address,$match);
+        if(!empty($match[2])) {
+            $smarty->trigger_error("mailto: hex encoding does not work with extra attributes. Try javascript.");
+            return;
+        }
+        $address_encode = '';
+        for ($x=0; $x < strlen($address); $x++) {
+            if(preg_match('!\w!',$address[$x])) {
+                $address_encode .= '%' . bin2hex($address[$x]);
+            } else {
+                $address_encode .= $address[$x];
+            }
+        }
+        $text_encode = '';
+        for ($x=0; $x < strlen($text); $x++) {
+            $text_encode .= '&#x' . bin2hex($text[$x]).';';
+        }
+
+        $mailto = "&#109;&#97;&#105;&#108;&#116;&#111;&#58;";
+        return '<a href="'.$mailto.$address_encode.'" '.$extra.'>'.$text_encode.'</a>';
+
+    } else {
+        // no encoding
+        return '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>';
+
+    }
+
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.math.php b/GPL_LIB/Smarty/libs/plugins/function.math.php
new file mode 100644
index 0000000000000000000000000000000000000000..ed5c2d3439feed4a7093d36fdffbeccbd9cb4aed
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.math.php
@@ -0,0 +1,84 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {math} function plugin
+ *
+ * Type:     function<br>
+ * Name:     math<br>
+ * Purpose:  handle math computations in template<br>
+ * @link http://smarty.php.net/manual/en/language.function.math.php {math}
+ *          (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_math($params, &$smarty)
+{
+    // be sure equation parameter is present
+    if (empty($params['equation'])) {
+        $smarty->trigger_error("math: missing equation parameter");
+        return;
+    }
+
+    $equation = $params['equation'];
+
+    // make sure parenthesis are balanced
+    if (substr_count($equation,"(") != substr_count($equation,")")) {
+        $smarty->trigger_error("math: unbalanced parenthesis");
+        return;
+    }
+
+    // match all vars in equation, make sure all are passed
+    preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]+)!",$equation, $match);
+    $allowed_funcs = array('int','abs','ceil','cos','exp','floor','log','log10',
+                           'max','min','pi','pow','rand','round','sin','sqrt','srand','tan');
+    
+    foreach($match[1] as $curr_var) {
+        if ($curr_var && !in_array($curr_var, array_keys($params)) && !in_array($curr_var, $allowed_funcs)) {
+            $smarty->trigger_error("math: function call $curr_var not allowed");
+            return;
+        }
+    }
+
+    foreach($params as $key => $val) {
+        if ($key != "equation" && $key != "format" && $key != "assign") {
+            // make sure value is not empty
+            if (strlen($val)==0) {
+                $smarty->trigger_error("math: parameter $key is empty");
+                return;
+            }
+            if (!is_numeric($val)) {
+                $smarty->trigger_error("math: parameter $key: is not numeric");
+                return;
+            }
+            $equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation);
+        }
+    }
+
+    eval("\$smarty_math_result = ".$equation.";");
+
+    if (empty($params['format'])) {
+        if (empty($params['assign'])) {
+            return $smarty_math_result;
+        } else {
+            $smarty->assign($params['assign'],$smarty_math_result);
+        }
+    } else {
+        if (empty($params['assign'])){
+            printf($params['format'],$smarty_math_result);
+        } else {
+            $smarty->assign($params['assign'],sprintf($params['format'],$smarty_math_result));
+        }
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.popup.php b/GPL_LIB/Smarty/libs/plugins/function.popup.php
new file mode 100644
index 0000000000000000000000000000000000000000..2048e4a6a5bf3d75909e70a0de0f1f059106a7cf
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.popup.php
@@ -0,0 +1,119 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {popup} function plugin
+ *
+ * Type:     function<br>
+ * Name:     popup<br>
+ * Purpose:  make text pop up in windows via overlib
+ * @link http://smarty.php.net/manual/en/language.function.popup.php {popup}
+ *          (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_popup($params, &$smarty)
+{
+    $append = '';
+    foreach ($params as $_key=>$_value) {
+        switch ($_key) {
+            case 'text':
+            case 'trigger':
+            case 'function':
+            case 'inarray':
+                $$_key = (string)$_value;
+                if ($_key == 'function' || $_key == 'inarray')
+                    $append .= ',' . strtoupper($_key) . ",'$_value'";
+                break;
+
+            case 'caption':
+            case 'closetext':
+            case 'status':
+                $append .= ',' . strtoupper($_key) . ",'" . str_replace("'","\'",$_value) . "'";
+                break;
+
+            case 'fgcolor':
+            case 'bgcolor':
+            case 'textcolor':
+            case 'capcolor':
+            case 'closecolor':
+            case 'textfont':
+            case 'captionfont':
+            case 'closefont':
+            case 'fgbackground':
+            case 'bgbackground':
+            case 'caparray':
+            case 'capicon':
+            case 'background':
+            case 'frame':
+                $append .= ',' . strtoupper($_key) . ",'$_value'";
+                break;
+
+            case 'textsize':
+            case 'captionsize':
+            case 'closesize':
+            case 'width':
+            case 'height':
+            case 'border':
+            case 'offsetx':
+            case 'offsety':
+            case 'snapx':
+            case 'snapy':
+            case 'fixx':
+            case 'fixy':
+            case 'padx':
+            case 'pady':
+            case 'timeout':
+            case 'delay':
+                $append .= ',' . strtoupper($_key) . ",$_value";
+                break;
+
+            case 'sticky':
+            case 'left':
+            case 'right':
+            case 'center':
+            case 'above':
+            case 'below':
+            case 'noclose':
+            case 'autostatus':
+            case 'autostatuscap':
+            case 'fullhtml':
+            case 'hauto':
+            case 'vauto':
+            case 'mouseoff':
+            case 'followmouse':
+            case 'closeclick':
+                if ($_value) $append .= ',' . strtoupper($_key);
+                break;
+
+            default:
+                $smarty->trigger_error("[popup] unknown parameter $_key", E_USER_WARNING);
+        }
+    }
+
+    if (empty($text) && !isset($inarray) && empty($function)) {
+        $smarty->trigger_error("overlib: attribute 'text' or 'inarray' or 'function' required");
+        return false;
+    }
+
+    if (empty($trigger)) { $trigger = "onmouseover"; }
+
+    $retval = $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\'';
+    $retval .= $append . ');"';
+    if ($trigger == 'onmouseover')
+       $retval .= ' onmouseout="nd();"';
+
+
+    return $retval;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/function.popup_init.php b/GPL_LIB/Smarty/libs/plugins/function.popup_init.php
new file mode 100644
index 0000000000000000000000000000000000000000..3b0ab9944c6a119a62fca51831d3a4b53a81778e
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/function.popup_init.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {popup_init} function plugin
+ *
+ * Type:     function<br>
+ * Name:     popup_init<br>
+ * Purpose:  initialize overlib
+ * @link http://smarty.php.net/manual/en/language.function.popup.init.php {popup_init}
+ *          (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_popup_init($params, &$smarty)
+{
+    $zindex = 1000;
+    
+    if (!empty($params['zindex'])) {
+        $zindex = $params['zindex'];
+    }
+    
+    if (!empty($params['src'])) {
+        return '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>' . "\n"
+         . '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>' . "\n";
+    } else {
+        $smarty->trigger_error("popup_init: missing src parameter");
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.capitalize.php b/GPL_LIB/Smarty/libs/plugins/modifier.capitalize.php
new file mode 100644
index 0000000000000000000000000000000000000000..f987ba42965a7d2edfe8ea782e2ebfc363afea39
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.capitalize.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty capitalize modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     capitalize<br>
+ * Purpose:  capitalize words in the string
+ * @link http://smarty.php.net/manual/en/language.modifiers.php#LANGUAGE.MODIFIER.CAPITALIZE
+ *      capitalize (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return string
+ */
+function smarty_modifier_capitalize($string, $uc_digits = false)
+{
+    smarty_modifier_capitalize_ucfirst(null, $uc_digits);
+    return preg_replace_callback('!\b\w+\b!', 'smarty_modifier_capitalize_ucfirst', $string);
+}
+
+function smarty_modifier_capitalize_ucfirst($string, $uc_digits = null)
+{
+    static $_uc_digits = false;
+    
+    if(isset($uc_digits)) {
+        $_uc_digits = $uc_digits;
+        return;
+    }
+    
+    if(!preg_match('!\d!',$string[0]) || $_uc_digits)
+        return ucfirst($string[0]);
+    else
+        return $string[0];
+}
+
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.cat.php b/GPL_LIB/Smarty/libs/plugins/modifier.cat.php
new file mode 100644
index 0000000000000000000000000000000000000000..308e597e7449edb41a129fd381e6199e37369f49
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.cat.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty cat modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     cat<br>
+ * Date:     Feb 24, 2003
+ * Purpose:  catenate a value to a variable
+ * Input:    string to catenate
+ * Example:  {$var|cat:"foo"}
+ * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat
+ *          (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @version 1.0
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_cat($string, $cat)
+{
+    return $string . $cat;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.count_characters.php b/GPL_LIB/Smarty/libs/plugins/modifier.count_characters.php
new file mode 100644
index 0000000000000000000000000000000000000000..3888886200f015c8b90b3a6e377d9b9b62b80ad1
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.count_characters.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty count_characters modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     count_characteres<br>
+ * Purpose:  count the number of characters in a text
+ * @link http://smarty.php.net/manual/en/language.modifier.count.characters.php
+ *          count_characters (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param boolean include whitespace in the character count
+ * @return integer
+ */
+function smarty_modifier_count_characters($string, $include_spaces = false)
+{
+    if ($include_spaces)
+       return(strlen($string));
+
+    return preg_match_all("/[^\s]/",$string, $match);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.count_paragraphs.php b/GPL_LIB/Smarty/libs/plugins/modifier.count_paragraphs.php
new file mode 100644
index 0000000000000000000000000000000000000000..f52228da9a00f87fe941699082e52225983a145a
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.count_paragraphs.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty count_paragraphs modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     count_paragraphs<br>
+ * Purpose:  count the number of paragraphs in a text
+ * @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php
+ *          count_paragraphs (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return integer
+ */
+function smarty_modifier_count_paragraphs($string)
+{
+    // count \r or \n characters
+    return count(preg_split('/[\r\n]+/', $string));
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.count_sentences.php b/GPL_LIB/Smarty/libs/plugins/modifier.count_sentences.php
new file mode 100644
index 0000000000000000000000000000000000000000..0f5af29af0d47212e9c4e6a9d3acad478c0f88f1
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.count_sentences.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty count_sentences modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     count_sentences
+ * Purpose:  count the number of sentences in a text
+ * @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php
+ *          count_sentences (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return integer
+ */
+function smarty_modifier_count_sentences($string)
+{
+    // find periods with a word before but not after.
+    return preg_match_all('/[^\s]\.(?!\w)/', $string, $match);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.count_words.php b/GPL_LIB/Smarty/libs/plugins/modifier.count_words.php
new file mode 100644
index 0000000000000000000000000000000000000000..607ed46acf11d957befbcd06466c905b3775ea07
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.count_words.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty count_words modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     count_words<br>
+ * Purpose:  count the number of words in a text
+ * @link http://smarty.php.net/manual/en/language.modifier.count.words.php
+ *          count_words (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return integer
+ */
+function smarty_modifier_count_words($string)
+{
+    // split text by ' ',\r,\n,\f,\t
+    $split_array = preg_split('/\s+/',$string);
+    // count matches that contain alphanumerics
+    $word_count = preg_grep('/[a-zA-Z0-9\\x80-\\xff]/', $split_array);
+
+    return count($word_count);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.date_format.php b/GPL_LIB/Smarty/libs/plugins/modifier.date_format.php
new file mode 100644
index 0000000000000000000000000000000000000000..82b82c4f90e1d9171f0edd1f488265e8c23ea2c3
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.date_format.php
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Include the {@link shared.make_timestamp.php} plugin
+ */
+require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
+/**
+ * Smarty date_format modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     date_format<br>
+ * Purpose:  format datestamps via strftime<br>
+ * Input:<br>
+ *         - string: input date string
+ *         - format: strftime format for output
+ *         - default_date: default date if $string is empty
+ * @link http://smarty.php.net/manual/en/language.modifier.date.format.php
+ *          date_format (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param string
+ * @param string
+ * @return string|void
+ * @uses smarty_make_timestamp()
+ */
+function smarty_modifier_date_format($string, $format="%b %e, %Y", $default_date=null)
+{
+    if (substr(PHP_OS,0,3) == 'WIN') {
+           $_win_from = array ('%e',  '%T',       '%D');
+           $_win_to   = array ('%#d', '%H:%M:%S', '%m/%d/%y');
+           $format = str_replace($_win_from, $_win_to, $format);
+    }
+    if($string != '') {
+        return strftime($format, smarty_make_timestamp($string));
+    } elseif (isset($default_date) && $default_date != '') {
+        return strftime($format, smarty_make_timestamp($default_date));
+    } else {
+        return;
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.debug_print_var.php b/GPL_LIB/Smarty/libs/plugins/modifier.debug_print_var.php
new file mode 100644
index 0000000000000000000000000000000000000000..a88817b77116e3f9b7c40d5ac6c7bd8453f44ba1
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.debug_print_var.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty debug_print_var modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     debug_print_var<br>
+ * Purpose:  formats variable contents for display in the console
+ * @link http://smarty.php.net/manual/en/language.modifier.debug.print.var.php
+ *          debug_print_var (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param array|object
+ * @param integer
+ * @param integer
+ * @return string
+ */
+function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
+{
+    $_replace = array("\n"=>'<i>&#92;n</i>', "\r"=>'<i>&#92;r</i>', "\t"=>'<i>&#92;t</i>');
+    if (is_array($var)) {
+        $results = "<b>Array (".count($var).")</b>";
+        foreach ($var as $curr_key => $curr_val) {
+            $return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length);
+            $results .= "<br>".str_repeat('&nbsp;', $depth*2)."<b>".strtr($curr_key, $_replace)."</b> =&gt; $return";
+        }
+    } else if (is_object($var)) {
+        $object_vars = get_object_vars($var);
+        $results = "<b>".get_class($var)." Object (".count($object_vars).")</b>";
+        foreach ($object_vars as $curr_key => $curr_val) {
+            $return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length);
+            $results .= "<br>".str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $return";
+        }
+    } else if (is_resource($var)) {
+        $results = '<i>'.(string)$var.'</i>';
+    } else if (empty($var) && $var != "0") {
+        $results = '<i>empty</i>';
+    } else {
+        if (strlen($var) > $length ) {
+            $results = substr($var, 0, $length-3).'...';
+        } else {
+            $results = $var;
+        }
+        $results = htmlspecialchars($results);
+        $results = strtr($results, $_replace);
+    }
+    return $results;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.default.php b/GPL_LIB/Smarty/libs/plugins/modifier.default.php
new file mode 100644
index 0000000000000000000000000000000000000000..a96de03e3b9c601331afd366180ebd41cc7c021c
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.default.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty default modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     default<br>
+ * Purpose:  designate default value for empty variables
+ * @link http://smarty.php.net/manual/en/language.modifier.default.php
+ *          default (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_default($string, $default = '')
+{
+    if (!isset($string) || $string === '')
+        return $default;
+    else
+        return $string;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.escape.php b/GPL_LIB/Smarty/libs/plugins/modifier.escape.php
new file mode 100644
index 0000000000000000000000000000000000000000..dc528643bfc945db78d7305a110f911e0a7411de
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.escape.php
@@ -0,0 +1,93 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty escape modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     escape<br>
+ * Purpose:  Escape the string according to escapement type
+ * @link http://smarty.php.net/manual/en/language.modifier.escape.php
+ *          escape (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param html|htmlall|url|quotes|hex|hexentity|javascript
+ * @return string
+ */
+function smarty_modifier_escape($string, $esc_type = 'html', $char_set = 'ISO-8859-1')
+{
+    switch ($esc_type) {
+        case 'html':
+            return htmlspecialchars($string, ENT_QUOTES, $char_set);
+
+        case 'htmlall':
+            return htmlentities($string, ENT_QUOTES, $char_set);
+
+        case 'url':
+            return rawurlencode($string);
+
+        case 'urlpathinfo':
+            return str_replace('%2F','/',rawurlencode($string));
+            
+        case 'quotes':
+            // escape unescaped single quotes
+            return preg_replace("%(?<!\\\\)'%", "\\'", $string);
+
+        case 'hex':
+            // escape every character into hex
+            $return = '';
+            for ($x=0; $x < strlen($string); $x++) {
+                $return .= '%' . bin2hex($string[$x]);
+            }
+            return $return;
+            
+        case 'hexentity':
+            $return = '';
+            for ($x=0; $x < strlen($string); $x++) {
+                $return .= '&#x' . bin2hex($string[$x]) . ';';
+            }
+            return $return;
+
+        case 'decentity':
+            $return = '';
+            for ($x=0; $x < strlen($string); $x++) {
+                $return .= '&#' . ord($string[$x]) . ';';
+            }
+            return $return;
+
+        case 'javascript':
+            // escape quotes and backslashes, newlines, etc.
+            return strtr($string, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n','</'=>'<\/'));
+            
+        case 'mail':
+            // safe way to display e-mail address on a web page
+            return str_replace(array('@', '.'),array(' [AT] ', ' [DOT] '), $string);
+            
+        case 'nonstd':
+           // escape non-standard chars, such as ms document quotes
+           $_res = '';
+           for($_i = 0, $_len = strlen($string); $_i < $_len; $_i++) {
+               $_ord = ord(substr($string, $_i, 1));
+               // non-standard char, escape it
+               if($_ord >= 126){
+                   $_res .= '&#' . $_ord . ';';
+               }
+               else {
+                   $_res .= substr($string, $_i, 1);
+               }
+           }
+           return $_res;
+
+        default:
+            return $string;
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.indent.php b/GPL_LIB/Smarty/libs/plugins/modifier.indent.php
new file mode 100644
index 0000000000000000000000000000000000000000..0633c22c82da2444bf5d34ec54d03e5be4f72662
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.indent.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty indent modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     indent<br>
+ * Purpose:  indent lines of text
+ * @link http://smarty.php.net/manual/en/language.modifier.indent.php
+ *          indent (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param integer
+ * @param string
+ * @return string
+ */
+function smarty_modifier_indent($string,$chars=4,$char=" ")
+{
+    return preg_replace('!^!m',str_repeat($char,$chars),$string);
+}
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.lower.php b/GPL_LIB/Smarty/libs/plugins/modifier.lower.php
new file mode 100644
index 0000000000000000000000000000000000000000..f3e30bae28db4a839d351762f1bffb3f6b598c8a
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.lower.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty lower modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     lower<br>
+ * Purpose:  convert string to lowercase
+ * @link http://smarty.php.net/manual/en/language.modifier.lower.php
+ *          lower (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return string
+ */
+function smarty_modifier_lower($string)
+{
+    return strtolower($string);
+}
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.nl2br.php b/GPL_LIB/Smarty/libs/plugins/modifier.nl2br.php
new file mode 100644
index 0000000000000000000000000000000000000000..faf0b2bef7ed84cf239a4da2b6da02b39d3c20d4
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.nl2br.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty plugin
+ *
+ * Type:     modifier<br>
+ * Name:     nl2br<br>
+ * Date:     Feb 26, 2003
+ * Purpose:  convert \r\n, \r or \n to <<br>>
+ * Input:<br>
+ *         - contents = contents to replace
+ *         - preceed_test = if true, includes preceeding break tags
+ *           in replacement
+ * Example:  {$text|nl2br}
+ * @link http://smarty.php.net/manual/en/language.modifier.nl2br.php
+ *          nl2br (Smarty online manual)
+ * @version  1.0
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return string
+ */
+function smarty_modifier_nl2br($string)
+{
+    return nl2br($string);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.regex_replace.php b/GPL_LIB/Smarty/libs/plugins/modifier.regex_replace.php
new file mode 100644
index 0000000000000000000000000000000000000000..b1aedf800d788ebb202daeff5128feb0cfba7ff9
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.regex_replace.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty regex_replace modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     regex_replace<br>
+ * Purpose:  regular epxression search/replace
+ * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php
+ *          regex_replace (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param string|array
+ * @param string|array
+ * @return string
+ */
+function smarty_modifier_regex_replace($string, $search, $replace)
+{
+    if (preg_match('!\W(\w+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) {
+        /* remove eval-modifier from $search */
+        $search = substr($search, 0, -strlen($match[1])) . str_replace('e', '', $match[1]);
+    }
+    return preg_replace($search, $replace, $string);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.replace.php b/GPL_LIB/Smarty/libs/plugins/modifier.replace.php
new file mode 100644
index 0000000000000000000000000000000000000000..fde66cfebeb4b3e9b504714c7dfdd8c6b4dd4fa9
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.replace.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty replace modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     replace<br>
+ * Purpose:  simple search/replace
+ * @link http://smarty.php.net/manual/en/language.modifier.replace.php
+ *          replace (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_replace($string, $search, $replace)
+{
+    return str_replace($search, $replace, $string);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.spacify.php b/GPL_LIB/Smarty/libs/plugins/modifier.spacify.php
new file mode 100644
index 0000000000000000000000000000000000000000..755b51e21adeb50962477ad8789f4bc8c2f0625f
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.spacify.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty spacify modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     spacify<br>
+ * Purpose:  add spaces between characters in a string
+ * @link http://smarty.php.net/manual/en/language.modifier.spacify.php
+ *          spacify (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_spacify($string, $spacify_char = ' ')
+{
+    return implode($spacify_char,
+                   preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY));
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.string_format.php b/GPL_LIB/Smarty/libs/plugins/modifier.string_format.php
new file mode 100644
index 0000000000000000000000000000000000000000..f58d7eedec5552a587e02a4c51c8455a9b228723
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.string_format.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty string_format modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     string_format<br>
+ * Purpose:  format strings via sprintf
+ * @link http://smarty.php.net/manual/en/language.modifier.string.format.php
+ *          string_format (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_string_format($string, $format)
+{
+    return sprintf($format, $string);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.strip.php b/GPL_LIB/Smarty/libs/plugins/modifier.strip.php
new file mode 100644
index 0000000000000000000000000000000000000000..7c9006f16f2bfa0d07df26a9e16a6e02165ae206
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.strip.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty strip modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     strip<br>
+ * Purpose:  Replace all repeated spaces, newlines, tabs
+ *           with a single space or supplied replacement string.<br>
+ * Example:  {$var|strip} {$var|strip:"&nbsp;"}
+ * Date:     September 25th, 2002
+ * @link http://smarty.php.net/manual/en/language.modifier.strip.php
+ *          strip (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @version  1.0
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_strip($text, $replace = ' ')
+{
+    return preg_replace('!\s+!', $replace, $text);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.strip_tags.php b/GPL_LIB/Smarty/libs/plugins/modifier.strip_tags.php
new file mode 100644
index 0000000000000000000000000000000000000000..af60b372f8b5b5d9aee5ce9b3cc828f3026c11af
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.strip_tags.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty strip_tags modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     strip_tags<br>
+ * Purpose:  strip html tags from text
+ * @link http://smarty.php.net/manual/en/language.modifier.strip.tags.php
+ *          strip_tags (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param boolean
+ * @return string
+ */
+function smarty_modifier_strip_tags($string, $replace_with_space = true)
+{
+    if ($replace_with_space)
+        return preg_replace('!<[^>]*?>!', ' ', $string);
+    else
+        return strip_tags($string);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.truncate.php b/GPL_LIB/Smarty/libs/plugins/modifier.truncate.php
new file mode 100644
index 0000000000000000000000000000000000000000..8113f1250de7a1438f2ed7e818e7bb98a773c188
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.truncate.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty truncate modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     truncate<br>
+ * Purpose:  Truncate a string to a certain length if necessary,
+ *           optionally splitting in the middle of a word, and
+ *           appending the $etc string or inserting $etc into the middle.
+ * @link http://smarty.php.net/manual/en/language.modifier.truncate.php
+ *          truncate (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param integer
+ * @param string
+ * @param boolean
+ * @param boolean
+ * @return string
+ */
+function smarty_modifier_truncate($string, $length = 80, $etc = '...',
+                                  $break_words = false, $middle = false)
+{
+    if ($length == 0)
+        return '';
+
+    if (strlen($string) > $length) {
+        $length -= strlen($etc);
+        if (!$break_words && !$middle) {
+            $string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length+1));
+        }
+        if(!$middle) {
+            return substr($string, 0, $length).$etc;
+        } else {
+            return substr($string, 0, $length/2) . $etc . substr($string, -$length/2);
+        }
+    } else {
+        return $string;
+    }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.upper.php b/GPL_LIB/Smarty/libs/plugins/modifier.upper.php
new file mode 100644
index 0000000000000000000000000000000000000000..b92a5a34ee536f48f617338dc3a24ea387c93339
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.upper.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty upper modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     upper<br>
+ * Purpose:  convert string to uppercase
+ * @link http://smarty.php.net/manual/en/language.modifier.upper.php
+ *          upper (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return string
+ */
+function smarty_modifier_upper($string)
+{
+    return strtoupper($string);
+}
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/modifier.wordwrap.php b/GPL_LIB/Smarty/libs/plugins/modifier.wordwrap.php
new file mode 100644
index 0000000000000000000000000000000000000000..2d131293a0721b69617fd00859494bb6fe4233a4
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/modifier.wordwrap.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty wordwrap modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     wordwrap<br>
+ * Purpose:  wrap a string of text at a given length
+ * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php
+ *          wordwrap (Smarty online manual)
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @param integer
+ * @param string
+ * @param boolean
+ * @return string
+ */
+function smarty_modifier_wordwrap($string,$length=80,$break="\n",$cut=false)
+{
+    return wordwrap($string,$length,$break,$cut);
+}
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/outputfilter.trimwhitespace.php b/GPL_LIB/Smarty/libs/plugins/outputfilter.trimwhitespace.php
new file mode 100644
index 0000000000000000000000000000000000000000..2e6ee377814db4d4d34a56be519342ae7eef0d40
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/outputfilter.trimwhitespace.php
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty trimwhitespace outputfilter plugin
+ *
+ * File:     outputfilter.trimwhitespace.php<br>
+ * Type:     outputfilter<br>
+ * Name:     trimwhitespace<br>
+ * Date:     Jan 25, 2003<br>
+ * Purpose:  trim leading white space and blank lines from
+ *           template source after it gets interpreted, cleaning
+ *           up code and saving bandwidth. Does not affect
+ *           <<PRE>></PRE> and <SCRIPT></SCRIPT> blocks.<br>
+ * Install:  Drop into the plugin directory, call
+ *           <code>$smarty->load_filter('output','trimwhitespace');</code>
+ *           from application.
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @author Contributions from Lars Noschinski <lars@usenet.noschinski.de>
+ * @version  1.3
+ * @param string
+ * @param Smarty
+ */
+function smarty_outputfilter_trimwhitespace($source, &$smarty)
+{
+    // Pull out the script blocks
+    preg_match_all("!<script[^>]+>.*?</script>!is", $source, $match);
+    $_script_blocks = $match[0];
+    $source = preg_replace("!<script[^>]+>.*?</script>!is",
+                           '@@@SMARTY:TRIM:SCRIPT@@@', $source);
+
+    // Pull out the pre blocks
+    preg_match_all("!<pre>.*?</pre>!is", $source, $match);
+    $_pre_blocks = $match[0];
+    $source = preg_replace("!<pre>.*?</pre>!is",
+                           '@@@SMARTY:TRIM:PRE@@@', $source);
+
+    // Pull out the textarea blocks
+    preg_match_all("!<textarea[^>]+>.*?</textarea>!is", $source, $match);
+    $_textarea_blocks = $match[0];
+    $source = preg_replace("!<textarea[^>]+>.*?</textarea>!is",
+                           '@@@SMARTY:TRIM:TEXTAREA@@@', $source);
+
+    // remove all leading spaces, tabs and carriage returns NOT
+    // preceeded by a php close tag.
+    $source = trim(preg_replace('/((?<!\?>)\n)[\s]+/m', '\1', $source));
+
+    // replace script blocks
+    smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:SCRIPT@@@",$_script_blocks, $source);
+
+    // replace pre blocks
+    smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:PRE@@@",$_pre_blocks, $source);
+
+    // replace textarea blocks
+    smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:TEXTAREA@@@",$_textarea_blocks, $source);
+
+    return $source;
+}
+
+function smarty_outputfilter_trimwhitespace_replace($search_str, $replace, &$subject) {
+    $_len = strlen($search_str);
+    $_pos = 0;
+    for ($_i=0, $_count=count($replace); $_i<$_count; $_i++)
+        if (($_pos=strpos($subject, $search_str, $_pos))!==false)
+            $subject = substr_replace($subject, $replace[$_i], $_pos, $_len);
+        else
+            break;
+
+}
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/shared.escape_special_chars.php b/GPL_LIB/Smarty/libs/plugins/shared.escape_special_chars.php
new file mode 100644
index 0000000000000000000000000000000000000000..4ea0979c29243e980b098e7824d3882cfe1881cf
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/shared.escape_special_chars.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Smarty shared plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * escape_special_chars common function
+ *
+ * Function: smarty_function_escape_special_chars<br>
+ * Purpose:  used by other smarty functions to escape
+ *           special chars except for already escaped ones
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return string
+ */
+function smarty_function_escape_special_chars($string)
+{
+    if(!is_array($string)) {
+        $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
+        $string = htmlspecialchars($string);
+        $string = str_replace(array('%%%SMARTY_START%%%','%%%SMARTY_END%%%'), array('&',';'), $string);
+    }
+    return $string;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/libs/plugins/shared.make_timestamp.php b/GPL_LIB/Smarty/libs/plugins/shared.make_timestamp.php
new file mode 100644
index 0000000000000000000000000000000000000000..2673165cd2ea8f61b93e410b8838103a3097082f
--- /dev/null
+++ b/GPL_LIB/Smarty/libs/plugins/shared.make_timestamp.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Smarty shared plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Function: smarty_make_timestamp<br>
+ * Purpose:  used by other smarty functions to make a timestamp
+ *           from a string.
+ * @author   Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return string
+ */
+function smarty_make_timestamp($string)
+{
+    if(empty($string)) {
+        // use "now":
+        $time = time();
+
+    } elseif (preg_match('/^\d{14}$/', $string)) {
+        // it is mysql timestamp format of YYYYMMDDHHMMSS?            
+        $time = mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2),
+                       substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4));
+        
+    } elseif (is_numeric($string)) {
+        // it is a numeric string, we handle it as timestamp
+        $time = (int)$string;
+        
+    } else {
+        // strtotime should handle it
+        $time = strtotime($string);
+        if ($time == -1 || $time === false) {
+            // strtotime() was not able to parse $string, use "now":
+            $time = time();
+        }
+    }
+    return $time;
+
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/GPL_LIB/Smarty/misc/smarty_icon.README b/GPL_LIB/Smarty/misc/smarty_icon.README
new file mode 100644
index 0000000000000000000000000000000000000000..a5b4d05cc70f7abbcedabe4c1d3df37b55f4fd6b
--- /dev/null
+++ b/GPL_LIB/Smarty/misc/smarty_icon.README
@@ -0,0 +1,6 @@
+Feel free to put the smarty icon on your site.
+You can cut-and-paste the following code, be sure
+to adjust the path to the image:
+
+<a href="http://smarty.php.net/">
+<img src="smarty_icon.gif" border="0" height="31" width="88" /></a>
diff --git a/GPL_LIB/Smarty/misc/smarty_icon.gif b/GPL_LIB/Smarty/misc/smarty_icon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5d5196995c01db0c78f6ff1b3191f6dbd8225460
Binary files /dev/null and b/GPL_LIB/Smarty/misc/smarty_icon.gif differ
diff --git a/GPL_LIB/Smarty/unit_test/README b/GPL_LIB/Smarty/unit_test/README
new file mode 100644
index 0000000000000000000000000000000000000000..d4d97313063af3796c8c841fcc4fb5cfe67529e6
--- /dev/null
+++ b/GPL_LIB/Smarty/unit_test/README
@@ -0,0 +1,32 @@
+Smarty Unit Testing
+-------------------
+
+Smarty unit tests require the PEAR PHPUnit
+package to be installed. See if you have that
+installed with the following command:
+
+$> pear list
+
+If you don't see PHPUnit, install with this:
+
+$> pear install PHPUnit
+
+Edit the config.php file,
+be sure everything is defined correctly.
+
+Be sure the following directories are present:
+
+templates
+configs
+templates_c (writable)
+cache (writable)
+
+Then run from the command line:
+php -q smarty_unit_test.php
+
+Or from the web browser:
+http://www.your_domain.com/path/to/smarty_unit_test_gui.php
+
+This will run a unit test for every component
+of Smarty and dump the results. All should pass
+with flying colors. :)
diff --git a/GPL_LIB/Smarty/unit_test/config.php b/GPL_LIB/Smarty/unit_test/config.php
new file mode 100644
index 0000000000000000000000000000000000000000..acd2900ec5d4d1d6365384ad1331da0101f78252
--- /dev/null
+++ b/GPL_LIB/Smarty/unit_test/config.php
@@ -0,0 +1,5 @@
+<?php
+
+define('SMARTY_DIR', '../libs/');
+
+?>
diff --git a/GPL_LIB/Smarty/unit_test/configs/globals_double_quotes.conf b/GPL_LIB/Smarty/unit_test/configs/globals_double_quotes.conf
new file mode 100644
index 0000000000000000000000000000000000000000..5abc475eb9112323a63000837f780a024279efde
--- /dev/null
+++ b/GPL_LIB/Smarty/unit_test/configs/globals_double_quotes.conf
@@ -0,0 +1 @@
+foo = "bar"
diff --git a/GPL_LIB/Smarty/unit_test/configs/globals_single_quotes.conf b/GPL_LIB/Smarty/unit_test/configs/globals_single_quotes.conf
new file mode 100644
index 0000000000000000000000000000000000000000..4517b7bd1aa272e30e261a16840ad71c1b0a5f54
--- /dev/null
+++ b/GPL_LIB/Smarty/unit_test/configs/globals_single_quotes.conf
@@ -0,0 +1 @@
+foo = 'bar'
diff --git a/GPL_LIB/Smarty/unit_test/smarty_unit_test.php b/GPL_LIB/Smarty/unit_test/smarty_unit_test.php
new file mode 100644
index 0000000000000000000000000000000000000000..a4f77d56b40606dfa84bd07e89fbd0d593890da1
--- /dev/null
+++ b/GPL_LIB/Smarty/unit_test/smarty_unit_test.php
@@ -0,0 +1,10 @@
+<?php
+
+require_once 'test_cases.php';
+require_once 'PHPUnit.php';
+
+$suite = new PHPUnit_TestSuite("SmartyTest");
+$result = PHPUnit::run($suite);
+
+echo $result -> toString();
+?>
diff --git a/GPL_LIB/Smarty/unit_test/smarty_unit_test_gui.php b/GPL_LIB/Smarty/unit_test/smarty_unit_test_gui.php
new file mode 100644
index 0000000000000000000000000000000000000000..e0df5372d617349d3a00f7786e52f778333f436f
--- /dev/null
+++ b/GPL_LIB/Smarty/unit_test/smarty_unit_test_gui.php
@@ -0,0 +1,10 @@
+<?php
+
+require_once 'test_cases.php';
+require_once 'PHPUnit.php';
+
+$suite = new PHPUnit_TestSuite("SmartyTest");
+$result = PHPUnit::run($suite);
+
+echo $result -> toHTML();
+?>
diff --git a/GPL_LIB/Smarty/unit_test/templates/assign_var.tpl b/GPL_LIB/Smarty/unit_test/templates/assign_var.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..acc4b66a42c744c593cea8aed0d3df5d565d78ab
--- /dev/null
+++ b/GPL_LIB/Smarty/unit_test/templates/assign_var.tpl
@@ -0,0 +1 @@
+{$foo}
diff --git a/GPL_LIB/Smarty/unit_test/templates/constant.tpl b/GPL_LIB/Smarty/unit_test/templates/constant.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..7ae11f1dc9382b1bce4c6d9a81b5e9bc6d9678c7
--- /dev/null
+++ b/GPL_LIB/Smarty/unit_test/templates/constant.tpl
@@ -0,0 +1 @@
+{$smarty.const.TEST_CONSTANT}
diff --git a/GPL_LIB/Smarty/unit_test/templates/index.tpl b/GPL_LIB/Smarty/unit_test/templates/index.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..fb6aad233d17fc6d3b2cb7a9d56284f253afd6bf
--- /dev/null
+++ b/GPL_LIB/Smarty/unit_test/templates/index.tpl
@@ -0,0 +1 @@
+TEST STRING
diff --git a/GPL_LIB/Smarty/unit_test/templates/parse_math.tpl b/GPL_LIB/Smarty/unit_test/templates/parse_math.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..0b787d363ca4f6fd9d2516701f11ca94380e3eb1
--- /dev/null
+++ b/GPL_LIB/Smarty/unit_test/templates/parse_math.tpl
@@ -0,0 +1,12 @@
+{foreach name=loop from=$items item=i}
+{$smarty.foreach.loop.iteration+2}
+{$smarty.foreach.loop.iteration+$flt}
+{$smarty.foreach.loop.iteration+$obj->six()}
+{$smarty.foreach.loop.iteration+$obj->ten}
+{/foreach}
+{$obj->ten+$flt}
+{$obj->ten*$flt}
+{$obj->six()+$obj->ten}
+{$obj->ten+$obj->ten}
+{$obj->six()+$flt}
+{$obj->six()+$items.0}
diff --git a/GPL_LIB/Smarty/unit_test/templates/parse_obj_meth.tpl b/GPL_LIB/Smarty/unit_test/templates/parse_obj_meth.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..ab198327f58556577e008c569957d71bb5fb5372
--- /dev/null
+++ b/GPL_LIB/Smarty/unit_test/templates/parse_obj_meth.tpl
@@ -0,0 +1,8 @@
+{$obj->meth($foo, 2.5)}
+{$obj->meth(2.5, $foo)}
+{$obj->meth(2.5)}
+{$obj->meth($obj->val, "foo")}
+{$obj->meth("foo", $obj->val)}
+{$obj->meth("foo", $foo)}
+{$obj->meth($obj->arr.one, 2)}
+{$obj->meth($obj->meth("foo", $foo))}
diff --git a/GPL_LIB/Smarty/unit_test/test_cases.php b/GPL_LIB/Smarty/unit_test/test_cases.php
new file mode 100644
index 0000000000000000000000000000000000000000..baf801a7dc7e30975c0766e9c8d8f7436ef29cb3
--- /dev/null
+++ b/GPL_LIB/Smarty/unit_test/test_cases.php
@@ -0,0 +1,450 @@
+<?php
+
+require_once './config.php';
+require_once SMARTY_DIR . 'Smarty.class.php';
+require_once 'PHPUnit.php';
+
+class Obj {
+    var $val = 'val';
+    var $arr = array('one' => 'one', 'two' => 2);
+    var $ten = 10;
+
+    function meth($a="a", $b="b") {
+        return "$a:$b";
+    }
+
+    function six() {
+        return 6;
+    }
+}
+
+    
+class SmartyTest extends PHPUnit_TestCase {   
+    // contains the object handle of the string class
+    var $abc;
+    // contains the last triggered error's errorlevel
+    var $errorlevel;
+
+    // constructor of the test suite
+    function SmartyTest($name) {
+       $this->PHPUnit_TestCase($name);
+    }
+
+    // called before the test functions will be executed    
+    // this function is defined in PHPUnit_TestCase and overwritten 
+    // here
+    function setUp() {
+        // create a new instance of String with the
+        // string 'abc'
+        $this->smarty = new Smarty;
+    }
+    // called after the test functions are executed    
+    // this function is defined in PHPUnit_TestCase and overwritten 
+    // here    
+    function tearDown() {
+        // delete your instance
+        unset($this->smarty);
+    }
+    
+    // dummy errorhandler for functions that are supposed to call trigger_error()
+    function error_handler($errorlevel) {
+        if ($errorlevel) $this->errorlevel = $errorlevel;
+    }
+
+    /* DIRECTORY TESTS */
+    
+    // test that template_dir exists
+    function test_template_dir_exists() {
+        $this->assertTrue(file_exists($this->smarty->template_dir));                       
+    }
+    // test that template_dir is a directory
+    function test_template_dir_is_dir() {
+        $this->assertTrue(is_dir($this->smarty->template_dir));                       
+    }
+    // test that template_dir is readable
+    function test_template_dir_is_readable() {
+        $this->assertTrue(is_readable($this->smarty->template_dir));                       
+    }
+    // test that config_dir exists
+    function test_config_dir_exists() {
+        $this->assertTrue(file_exists($this->smarty->config_dir));                       
+    }
+    // test that config_dir is a directory
+    function test_config_dir_is_dir() {
+        $this->assertTrue(is_dir($this->smarty->config_dir));                       
+    }
+    // test that config_dir is readable
+    function test_config_dir_is_readable() {
+        $this->assertTrue(is_readable($this->smarty->config_dir));                       
+    }
+    // test that compile_dir exists
+    function test_compile_dir_exists() {
+        $this->assertTrue(file_exists($this->smarty->compile_dir));                       
+    }
+    // test that compile_dir is a directory
+    function test_compile_dir_is_dir() {
+        $this->assertTrue(is_dir($this->smarty->compile_dir));                       
+    }
+    // test that compile_dir is readable
+    function test_compile_dir_is_readable() {
+        $this->assertTrue(is_readable($this->smarty->compile_dir));                       
+    }
+    // test that compile_dir is writable
+    function test_compile_dir_is_writable() {
+        $this->assertTrue(is_writable($this->smarty->compile_dir));                       
+    }
+    // test that cache_dir exists
+    function test_cache_dir_exists() {
+        $this->assertTrue(file_exists($this->smarty->cache_dir));                       
+    }
+    // test that cache_dir is a directory
+    function test_cache_dir_is_dir() {
+        $this->assertTrue(is_dir($this->smarty->cache_dir));                       
+    }
+    // test that cache_dir is readable
+    function test_cache_dir_is_readable() {
+        $this->assertTrue(is_readable($this->smarty->cache_dir));                       
+    }
+    // test that cache_dir is writable
+    function test_cache_dir_is_writable() {
+        $this->assertTrue(is_writable($this->smarty->cache_dir));                       
+    }
+
+    /* METHOD EXISTS TESTS */
+    function test_assign_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'assign'));
+    }
+    function test_assign_by_ref_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'assign_by_ref'));
+    }
+    function test_append_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'append'));
+    }
+    function test_append_by_ref_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'append_by_ref'));
+    }
+    function test_clear_assign_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'clear_assign'));
+    }
+    function test_register_function_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'register_function'));
+    }
+    function test_unregister_function_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'unregister_function'));
+    }
+    function test_register_object_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'register_object'));
+    }
+    function test_unregister_object_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'unregister_object'));
+    }
+    function test_register_block_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'register_block'));
+    }
+    function test_unregister_block_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'unregister_block'));
+    }
+    function test_register_compiler_function_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'register_compiler_function'));
+    }
+    function test_unregister_compiler_function_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'unregister_compiler_function'));
+    }
+    function test_register_modifier_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'register_modifier'));
+    }
+    function test_unregister_modifier_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'unregister_modifier'));
+    }
+    function test_register_resource_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'register_resource'));
+    }
+    function test_unregister_resource_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'unregister_resource'));
+    }
+    function test_register_prefilter_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'register_prefilter'));
+    }
+    function test_unregister_prefilter_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'unregister_prefilter'));
+    }
+    function test_register_postfilter_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'register_postfilter'));
+    }
+    function test_unregister_postfilter_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'unregister_postfilter'));
+    }
+    function test_register_outputfilter_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'register_outputfilter'));
+    }
+    function test_unregister_outputfilter_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'unregister_outputfilter'));
+    }
+    function test_load_filter_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'load_filter'));
+    }
+    function test_clear_cache_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'clear_cache'));
+    }
+    function test_clear_all_cache_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'clear_all_cache'));
+    }
+    function test_is_cached_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'is_cached'));
+    }
+    function test_clear_all_assign_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'clear_all_assign'));
+    }
+    function test_clear_compiled_tpl_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'clear_compiled_tpl'));
+    }
+    function test_template_exists_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'template_exists'));
+    }
+    function test_get_template_vars_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'get_template_vars'));
+    }
+    function test_get_config_vars_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'get_config_vars'));
+    }
+    function test_trigger_error_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'trigger_error'));
+    }
+    function test_display_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'display'));
+    }
+    function test_fetch_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'fetch'));
+    }
+    function test_config_load_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'config_load'));
+    }
+    function test_get_registered_object_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'get_registered_object'));
+    }
+    function test_clear_config_method_exists() {
+        $this->assertTrue(method_exists($this->smarty, 'clear_config'));
+    }
+    function test_get_plugin_filepath() {
+        $this->assertTrue(method_exists($this->smarty, '_get_plugin_filepath'));
+    }
+
+    
+    function test_clear_compiled_tpl() {
+        $this->assertTrue($this->smarty->clear_compiled_tpl());
+    }
+    
+    /* DISPLAY TESTS */
+    
+    // test that display() executes properly
+    function test_call_to_display() {
+        ob_start();
+        $this->smarty->display('index.tpl');
+        $output = ob_get_contents();
+        ob_end_clean();
+        $this->assertEquals($output, 'TEST STRING');
+    }
+
+    /* FETCH TESTS */
+
+    // test that fetch() executes properly
+    function test_call_to_fetch() {
+        $this->assertEquals($this->smarty->fetch('index.tpl'), 'TEST STRING');
+    }
+    
+    /* ASSIGN TESTS */
+
+    // test assigning a simple template variable
+    function test_assign_var() {
+        $this->smarty->assign('foo', 'bar');
+        $this->assertEquals($this->smarty->fetch('assign_var.tpl'), 'bar');
+    }
+
+    /* PARSING TESTS */
+    
+    // test assigning and calling an object
+    function test_parse_obj_meth() {
+        $obj  = new Obj();
+        $this->smarty->assign('obj', $obj);
+        $this->smarty->assign('foo', 'foo');
+        $this->assertEquals('foo:2.5
+2.5:foo
+2.5:b
+val:foo
+foo:val
+foo:foo
+one:2
+foo:foo:b', $this->smarty->fetch('parse_obj_meth.tpl'));
+    }
+    
+    // test assigning and calling an object
+    function test_parse_math() {
+        $obj  = new Obj();
+        $this->smarty->assign('obj', $obj);
+        $this->smarty->assign('flt', 2.5);
+        $this->smarty->assign('items', array(1, 2));
+        $this->assertEquals('3
+3.5
+7
+11
+4
+4.5
+8
+12
+12.5
+25
+16
+20
+8.5
+7', $this->smarty->fetch('parse_math.tpl'));
+    }
+    
+    /* CONFIG FILE TESTS */
+
+    // test assigning a double quoted global variable
+    function test_config_load_globals_double_quotes() {
+        // load the global var
+        $this->smarty->config_load('globals_double_quotes.conf');
+        // test that it is assigned
+        $this->assertEquals($this->smarty->_config[0]['vars']['foo'], 'bar');
+    }
+
+    // test assigning a single quoted global variable
+    function test_config_load_globals_single_quotes() {
+        // load the global var
+        $this->smarty->config_load('globals_single_quotes.conf');
+        // test that it is assigned
+        $this->assertEquals($this->smarty->_config[0]['vars']['foo'], 'bar');
+    }
+
+    // test loading and running modifier.escape.php
+    function test_escape_modifier_get_plugins_filepath() {
+        $filepath = $this->smarty->_get_plugin_filepath('modifier', 'escape');
+        $this->assertTrue($filepath);
+    }
+
+    function test_escape_modifier_include_file() {
+        $filepath = $this->smarty->_get_plugin_filepath('modifier', 'escape');
+        $this->assertTrue(include($filepath));
+    }
+
+    function test_escape_modifier_function_exists() {
+        $this->assertTrue(function_exists('smarty_modifier_escape'));
+    }
+
+    function test_escape_modifier_escape_default() {
+        $string = smarty_modifier_escape("<html><body></body></html>");
+        $this->assertEquals('&lt;html&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;',
+                            $string);
+    }
+
+    function test_escape_modifier_escape_html() {
+        $string = smarty_modifier_escape("<html><body></body></html>", 'html');
+        $this->assertEquals('&lt;html&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;',
+                            $string);
+    }
+
+    function test_escape_modifier_escape_htmlall() {
+        $string = smarty_modifier_escape("<html><body></body></html>", 'htmlall');
+        $this->assertEquals('&lt;html&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;',
+                            $string);
+    }
+
+    function test_escape_modifier_escape_url() {
+        $string = smarty_modifier_escape("http://test.com?foo=bar", 'url');
+        $this->assertEquals('http%3A%2F%2Ftest.com%3Ffoo%3Dbar', $string);
+    }
+
+    function test_escape_modifier_escape_quotes() {
+        $string = smarty_modifier_escape("'\\'\\''", 'quotes');
+        $this->assertEquals("\\'\\'\\'\\'", $string);
+    }
+
+    function test_escape_modifier_escape_hex() {
+        $string = smarty_modifier_escape("abcd", 'hex');
+        $this->assertEquals('%61%62%63%64', $string);
+    }
+
+    function test_escape_modifier_escape_hexentity() {
+        $string = smarty_modifier_escape("ABCD", 'hexentity');
+        $this->assertEquals('&#x41;&#x42;&#x43;&#x44;', $string);
+    }
+
+    function test_escape_modifier_escape_javascript() {
+        $string = smarty_modifier_escape("\r\n\\", 'javascript');
+        $this->assertEquals('\\r\\n\\\\', $string);
+    }
+
+
+    function test_core_is_secure_file_exists() {
+        $file = SMARTY_CORE_DIR . 'core.is_secure.php';
+        $this->assertTrue(file_exists($file));
+    }
+
+    function test_core_is_secure_file_include() {
+        $file = SMARTY_CORE_DIR . 'core.is_secure.php';
+        $this->assertTrue(include($file));
+    }
+
+    function test_core_is_secure_function_exists() {
+        $this->assertTrue(function_exists('smarty_core_is_secure'));
+    }
+
+    function test_core_is_secure_function_is_secure_true() {
+        $security = $this->smarty->security;
+        $this->smarty->security = true;
+
+        /* check if index.tpl is secure (should be true) */
+        $params = array('resource_type' => 'file',
+                        'resource_base_path' => dirname(__FILE__) . '/templates',
+                        'resource_name' => dirname(__FILE__) . '/templates/index.tpl');
+        $this->assertTrue(smarty_core_is_secure($params, $this->smarty));
+        $this->smarty->security = $security;
+    }
+
+    function test_core_is_secure_function_is_secure_false() {
+        $security = $this->smarty->security;
+        $this->smarty->security = true;
+        /* check if test_cases.php is secure (should be false) */
+        $params = array('resource_type' => 'file',
+                        'resource_base_path' => dirname(__FILE__) . '/templates',
+                        'resource_name' => __FILE__);
+        $this->assertFalse(smarty_core_is_secure($params, $this->smarty));
+        $this->smarty->security = $security;
+
+    }
+
+    // test constants and security
+    function test_core_is_secure_function_smarty_var_const() {
+        define('TEST_CONSTANT', 'test constant');
+        $this->assertEquals('test constant', $this->smarty->fetch('constant.tpl',
+                                                             null, 'var_const'));
+    }
+
+    function test_core_is_secure_function_smarty_var_const_allowed() {
+        $security = $this->smarty->security;
+        $security_settings = $this->smarty->security_settings;
+        $this->smarty->security_settings['ALLOW_CONSTANTS'] = true;
+        $this->smarty->security = true;
+        $this->assertEquals('test constant', $this->smarty->fetch('constant.tpl',
+                                                     null, 'var_const_allowed'));
+        $this->smarty->security_settings = $security_settings;
+        $this->smarty->security = $security;   
+    }
+
+    function test_core_is_secure_function_smarty_var_const_not_allowed() {
+        $security = $this->smarty->security;
+        $this->smarty->security = true;
+        /* catch errors: */
+        $this->errorlevel = null;
+        set_error_handler(array(&$this, 'error_handler'));
+        $this->smarty->fetch('constant.tpl', null, 'var_const_not_allowed');
+        restore_error_handler();
+
+        $this->assertEquals( $this->errorlevel, E_USER_WARNING);
+        $this->smarty->security = $security;
+    }
+
+}
+
+?>
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000000000000000000000000000000000000..31edf675bfc6b1e2a0fed520f2b4bf94438d59d8
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,40 @@
+To use graphic plugins, you need to have on your server :
+- RRDTOOL
+- perl/RRDTOOL (RRDs.pm)
+- Net::SNMP
+
+To use Oreon, you need to have on your server :
+- php4 ( php5 not supported yet )
+- php-snmp
+- php-gd
+- perl-GD
+
+FRANCAIS :
+----------
+
+
+Pour installer Oreon sans mise � jour :
+
+	Lancer la commande "./install.sh"
+
+Pour mettre � jour :
+
+	Lancer la commande "./upgrade.sh"
+
+
+ENGLISH :
+---------
+
+
+For install only :
+
+	Launch "./install.sh"
+
+For update :
+
+	Launch "./upgrade.sh"
+
+
+For more informations, mail infos@oreon-project.org or visit Oreon's forum http://forum.oreon-project.org.
+
+Thanks for using oreon.
diff --git a/LICENCE b/LICENCE
new file mode 100644
index 0000000000000000000000000000000000000000..b8602677e0980076f7617bb74a921885983282b9
--- /dev/null
+++ b/LICENCE
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/README b/README
new file mode 100644
index 0000000000000000000000000000000000000000..9cc33a165f125c6f6f0bae9565220f7f99d0ce26
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+Please view "INSTALL" and "UPGRADE" for more information.
diff --git a/UPGRADE b/UPGRADE
new file mode 100644
index 0000000000000000000000000000000000000000..27a548e37bf47997323552d47a4ff631a2a78a9b
--- /dev/null
+++ b/UPGRADE
@@ -0,0 +1,102 @@
+WARNING !!!
+This file is obsolete for Oreon 1.3
+
+
+To use graphic plugins, you need to have on your server :
+- RRDTOOL
+- perl/RRDTOOL (RRDs.pm)
+- Net::SNMP
+
+To use Oreon, you need to have on your server :
+- php4 ( php5 not supported yet )
+- php-snmp
+- php-gd
+- perl-GD
+
+FRANCAIS :
+----------
+Pour mettre � jour :
+
+	Etape 1- Executer les requ�tes du fichier d'update.
+
+	Etape 2- Mettre � jour les fichiers avec ceux de la 1.2.3
+
+	Arr�ter nagios le temps de la manipulation
+	Faire une sauvegarde de tout le repertoire de oreon en cas de mauvaise manipulation.
+
+	Garder les r�pertoires et fichiers suivants :
+
+	/usr/local/oreon/include/trafficmap/average
+	/usr/local/oreon/include/trafficmap/png
+	/usr/local/oreon/include/trafficmap/bg
+	/usr/local/oreon/include/log/
+	/usr/local/oreon/etc/
+	/usr/local/oreon/etc/conf/
+	/usr/local/oreon/temp/
+	/usr/local/oreon/rrd/
+	/usr/local/oreon/oreon.conf.php
+
+	Le r�pertoire '/usr/local/oreon/etc/'  devient '/usr/local/oreon/nagios_cfg/'
+	Creer le r�pertoire 'upload' dans '/usr/local/oreon/nagios_cfg/'
+
+	Remplacer les autres fichiers par ceux pr�sents dans 'oreon_src' � la racine du package
+	Mettre les bons droits, cad :
+
+	chown -R apache:apache /usr/local/oreon/
+	chmod 755 /usr/local/oreon/
+
+	chown nagios:nagios /usr/local/oreon/rrd/
+	chmod -R 775 /usr/local/oreon/rrd/
+
+	chown nagios:nagios /usr/local/oreon/include/trafficmap/average
+	chmod -R 775 /usr/local/oreon/include/trafficmap/average
+
+Pour plus d'informations, infos@oreon.org, ou allez sur les forums d'Oreon http://www.oreon.org/Forum/
+
+Merci d'utiliser oreon
+
+
+ENGLISH :
+---------
+For update :
+
+	Step 1 - Execute MySQL request locate on the update file
+
+	Step 2 - Update Oreon files with the new files
+
+For the files :
+
+        Stop nagios during the update
+        Make a tgz with all files in order to save all your data
+
+        Keep thes following files and directories :
+
+        /usr/local/oreon/include/trafficmap/average
+        /usr/local/oreon/include/trafficmap/png
+        /usr/local/oreon/include/trafficmap/bg
+        /usr/local/oreon/include/log/
+        /usr/local/oreon/etc/
+        /usr/local/oreon/etc/conf/
+        /usr/local/oreon/temp/
+        /usr/local/oreon/rrd/
+        /usr/local/oreon/oreon.conf.php
+
+	  	'/usr/local/oreon/etc/' becomes '/usr/local/oreon/nagios_cfg/'
+	  	Create directory 'upload' in '/usr/local/oreon/nagios_cfg/'
+
+        Replace others files by files in oreon_src/
+		and now :
+
+        chown -R apache:apache /usr/local/oreon/
+        chmod 755 /usr/local/oreon/
+
+        chown nagios:nagios /usr/local/oreon/rrd/
+        chmod -R 775 /usr/local/oreon/rrd/
+
+        chown nagios:nagios /usr/local/oreon/include/trafficmap/average
+        chmod -R 775 /usr/local/oreon/include/trafficmap/average
+
+
+For more informations, mail infos@oreon.org or visit Oreon's forum http://www.oreon.org/Forum/.
+
+Thanks for using oreon.
diff --git a/filesGeneration/osm/osm_list.xml b/filesGeneration/osm/osm_list.xml
new file mode 100644
index 0000000000000000000000000000000000000000..fc5e3c325f118c4d2b500f407046730754410518
--- /dev/null
+++ b/filesGeneration/osm/osm_list.xml
@@ -0,0 +1,6 @@
+<osm_list>
+        <elements>
+        </elements>
+        <dependencies>
+        </dependencies>
+</osm_list>
\ No newline at end of file
diff --git a/functions b/functions
new file mode 100644
index 0000000000000000000000000000000000000000..1779a5a27efbc9072488873ba79699cdda6dc6cd
--- /dev/null
+++ b/functions
@@ -0,0 +1,441 @@
+# -*-Shell-script-*-
+#
+# functions     This file contains functions to be used by Oreon install scripts
+#
+
+##
+## COLOR FUNCTIONS
+##
+
+
+RES_COL=60
+MOVE_TO_COL="echo -en \\033[${RES_COL}G"
+SETCOLOR_INFO="echo -en \\033[1;38m"
+SETCOLOR_SUCCESS="echo -en \\033[1;32m"
+SETCOLOR_FAILURE="echo -en \\033[1;31m"
+SETCOLOR_WARNING="echo -en \\033[1;33m"
+SETCOLOR_NORMAL="echo -en \\033[0;39m"
+
+OREON_CONF="/etc/oreon.conf"
+
+function  echo_info() {
+    echo -n "$1"
+    $MOVE_TO_COL
+    $SETCOLOR_INFO
+    echo -n "$2"
+    $SETCOLOR_NORMAL
+    echo -e "\r"
+}
+
+function  echo_success() {
+    echo -n "$1"
+    $MOVE_TO_COL
+    $SETCOLOR_SUCCESS
+    echo -n "$2"
+    $SETCOLOR_NORMAL
+    echo -e "\r"
+}
+
+function echo_failure() {
+    echo -n "$1"
+    $MOVE_TO_COL
+    $SETCOLOR_FAILURE
+    echo -n "$2"
+    $SETCOLOR_NORMAL
+    echo -e "\r"
+}
+
+function echo_passed() {
+    echo -n "$1"
+    $MOVE_TO_COL
+    $SETCOLOR_WARNING
+    echo -n "$2"
+    $SETCOLOR_NORMAL
+    echo -e "\r"
+}
+
+function echo_warning() {
+    echo -n "$1"
+    $MOVE_TO_COL
+    $SETCOLOR_WARNING
+    echo -n "$2"
+    $SETCOLOR_NORMAL
+    echo -e "\r"
+}
+
+##
+## FUNCTION
+##
+# Find the user and group nagios in nagios.cfg and ask if we don't find
+function find_user_nagios()
+{
+    NAGIOS_USER=`more $NAGIOS_ETC/nagios.cfg | grep ^nagios_user | cut -d = -f 2`
+    
+    if [ -z "$NAGIOS_USER"  ] ; then
+	for fichier in $NAGIOS_ETC/*.cfg
+      do
+	  if [ -f "$fichier" ];	then
+	      NAGIOS_USER_TEMP=`more $fichier | grep ^nagios_user | cut -d = -f 2`
+	      if [ -n "$NAGIOS_USER_TEMP" ]; then
+		  NAGIOS_USER=$NAGIOS_USER_TEMP
+    fi
+	  fi
+	done
+    fi
+    
+    if [ -z "$NAGIOS_USER"  ] ; then
+	#Nagios User
+	NAGIOS_USER="nagios"
+	echo_passed "Sorry, we don't found nagios user" "PASSED"
+	echo "Which is your nagios user ?"
+	echo -n "default to [$NAGIOS_USER]:"
+	read temp
+	test_answer NAGIOS_USER $temp
+	echo ""
+    else
+	echo_info "Finding Nagios user :" "$NAGIOS_USER"
+    fi
+    
+}
+
+function find_group_nagios()
+{
+    NAGIOS_GROUP=`more $NAGIOS_ETC/nagios.cfg | grep ^nagios_group | cut -d = -f 2`
+    
+    if [ -z "$NAGIOS_GROUP"  ] ; then
+	for fichier in $NAGIOS_ETC/*.cfg
+      do
+	  if [ -f "$fichier" ];	then
+	      NAGIOS_GROUP_TEMP=`more $fichier | grep ^nagios_group | cut -d = -f 2`
+	      if [ -n "$NAGIOS_GROUP_TEMP" ]; then
+		  NAGIOS_GROUP=$NAGIOS_GROUP_TEMP
+	      fi
+	  fi
+    done
+    fi
+    
+    if [ -z "$NAGIOS_GROUP"  ] ; then
+	#Nagios Group
+	NAGIOS_GROUP="nagiocmd"
+	echo_passed "Sorry, we don't found nagios group" "PASSED"
+	echo "Which is your nagios group ?"
+	echo -n "default to [$NAGIOS_GROUP]:"
+	read temp
+	test_answer NAGIOS_GROUP $temp
+	echo ""
+    else
+	echo_info "Finding Nagios group :" "$NAGIOS_GROUP"
+    fi
+    
+}
+
+# Check the user and group nagios and create it if necessary
+
+function check_user_nagios()
+{
+	# Try to find nagios user/group from nagios.cfg file.
+    # If not, we ask...
+    find_user_nagios
+    
+    
+    nagios_user_grep=`grep $NAGIOS_USER /etc/passwd > /dev/null; echo $?`
+    if [ $nagios_user_grep == 0 ]; then
+    	echo_success "Finding nagios user '$NAGIOS_USER' in /etc/passwd" "YES"
+    else
+    	echo_warning "Finding nagios user '$NAGIOS_USER' in /etc/passwd" "NOT FOUND"
+  		useradd -G $NAGIOS_GROUP $NAGIOS_USER
+  		if [ $? == 0 ]; then
+		    echo_success  "Creating nagios user '$NAGIOS_USER'" "OK"
+		else
+		    echo_failure  "error creating nagios user '$NAGIOS_USER' check you environnement" "ERROR"
+		    exit
+		fi
+    fi
+}
+
+function check_group_nagios()
+{
+	# Try to find nagios user/group from nagios.cfg file.
+	# If not, we ask...
+    find_group_nagios
+    
+    nagios_group_grep=`grep $NAGIOS_GROUP /etc/group > /dev/null; echo $?`
+    if [ $nagios_group_grep == 0 ]; then
+    	echo_success "Finding nagios group '$NAGIOS_GROUP' in /etc/group" "YES"
+    else
+    	echo_warning "Finding nagios group '$NAGIOS_GROUP' in /etc/group" "NOT FOUND"
+	groupadd $NAGIOS_GROUP
+	if [ $? == 0 ]; then
+      echo_success  "Creating nagios group '$NAGIOS_GROUP'" "OK"
+	else
+	    echo_failure  "error creating group $NAGIOS_GROUP check you environnement" "ERROR"
+	    exit
+	fi
+    fi
+}
+
+function check_group_nagiocmd()
+{
+    nagios_group=`grep nagiocmd /etc/group > /dev/null; echo $?`
+    if [ $nagios_group == 0 ]; then
+	echo_success "Finding nagios group 'nagiocmd' in /etc/group" "YES"
+    else
+	echo_warning "Finding nagios group 'nagiocmd' in /etc/group" "NO"
+	groupadd nagiocmd
+	if [ $? == 0 ]; then
+	    echo_passed  "Creating nagios group 'nagiocmd'" "OK"
+	else
+	    echo_failure  "error creating nagios group 'nagiocmd' check you environnement" "ERROR"
+	    exit
+	fi
+    fi
+}
+
+function check_httpd_directory()
+{
+    if test -d /etc/apache/conf ; then
+	DIR_APACHE="/etc/apache/conf"
+	DIR_APACHE_CONF="/etc/apache/conf.d"
+	HTPASSWD="htpasswd"
+    else if test -d /usr/local/apache2/conf ; then
+	DIR_APACHE="/usr/local/apache2/conf"
+	DIR_APACHE_CONF="/usr/local/apache2/conf"
+	HTPASSWD="htpasswd2"
+    else if test -d /etc/apache2 ; then
+	DIR_APACHE="/etc/apache2"
+	DIR_APACHE_CONF="/etc/apache2/conf.d"
+	HTPASSWD="htpasswd2"
+    else if test -d /etc/httpd/conf ; then
+	DIR_APACHE="/etc/httpd/conf"
+	DIR_APACHE_CONF="/etc/httpd/conf.d"
+	HTPASSWD="htpasswd"
+    fi
+    fi
+    fi
+    fi
+    
+    if test -e $DIR_APACHE/apache2.conf ; then
+	APACHE_CONF="apache2.conf"
+    else if test -e $DIR_APACHE/commondhttpd.conf ; then
+	APACHE_CONF="commondhttpd.conf"
+    else if test -e $DIR_APACHE/httpd.conf ; then
+	APACHE_CONF="httpd.conf"
+    fi
+    fi
+    fi
+}
+
+function check_user_apache()
+{
+    WEB_USER=`more $DIR_APACHE/$APACHE_CONF | grep ^User | cut -d " " -f 2`
+    
+    if [ -z "$WEB_USER"  ] ; then
+	for fichier in $DIR_APACHE/*
+	  do
+	  if [ -f "$fichier" ];	then
+	      WEB_USER_TEMP=`more $fichier | grep ^User | cut -d " " -f 2`
+	      if [ -n "$WEB_USER_TEMP" ]; then
+		  WEB_USER=$WEB_USER_TEMP
+	      fi
+	  fi
+	done
+    fi
+    echo_info "Finding Apache user :" "$WEB_USER"
+}
+
+function check_group_apache()
+{
+    WEB_GROUP=`more $DIR_APACHE/$APACHE_CONF | grep ^Group | cut -d " " -f 2`
+    
+    if [ -z "$WEB_GROUP"  ] ; then
+	for fichier in $DIR_APACHE/*
+	  do
+	  if [ -f "$fichier" ];	then
+	      WEB_GROUP_TEMP=`more $fichier | grep ^Group | cut -d " " -f 2`
+	      if [ -n "$WEB_GROUP_TEMP" ]; then
+		  WEB_GROUP=$WEB_GROUP_TEMP
+	      fi
+	  fi
+	done
+    fi
+    echo_info "Finding Apache group :" "$WEB_GROUP"
+}
+
+function install_oreon_plugins()
+{
+# install plugins oreon
+    echo ""
+    if test -d $NAGIOS_PLUGIN ; then
+	echo_passed "$NAGIOS_PLUGIN already exists" "PASSED"
+    else
+	mkdir $NAGIOS_PLUGIN >> $LOG_FILE 2>> $LOG_FILE
+	echo_success "Creating Nagios Plugin Directory '$NAGIOS_PLUGIN'" "OK"
+    fi
+    echo "Preparing Oreon Plugins..."
+    if [ -n "$PLUGINS_DIR" ]; then
+	rm -f $PLUGINS_DIR/*.pl 2> /dev/null
+	rm -f $PLUGINS_DIR/*.pm 2> /dev/null
+	rm -f $PLUGINS_DIR/*.conf 2> /dev/null
+    else
+	rm -f *.pl 2> /dev/null
+	rm -f *.pm 2> /dev/null
+	rm -f *.conf 2> /dev/null
+    fi
+    
+    if [ -n "$PLUGINS_DIR" ]; then
+	for fichier in $PLUGINS_DIR/src/*
+	  do
+	  if [ -d "$fichier" ]; then
+	      echo "$fichier is a directory"
+	  else
+	      filename=`echo $fichier  | sed -e 's|.*\/\(.*\)|\1|'`
+	      echo "-> $filename"
+	      `sed -e 's|@INSTALL_DIR_NAGIOS@|'"$INSTALL_DIR_NAGIOS"'|g' -e 's|@NAGIOS_ETC@|'"$NAGIOS_ETC"'|g' -e 's|@NAGIOS_PLUGINS@|'"$NAGIOS_PLUGIN"'|g' -e 's|@RRDTOOL_PERL_LIB@|'"$RRD_PERL"'|g' -e 's|@INSTALL_DIR_OREON@|'"$INSTALL_DIR_OREON"'|g'  "$fichier" > "$PLUGINS_DIR/$filename"`
+	  fi
+	done
+	echo_success "Installing Oreon Plugins on '$NAGIOS_PLUGIN'" "OK"
+	cp $PLUGINS_DIR/*.pl $NAGIOS_PLUGIN
+    else
+	for fichier in src/*
+	  do
+	  if [ -d "$fichier" ]; then
+	      echo "$fichier is a directory"
+	  else
+	      filename=`echo $fichier  | sed -e 's|.*\/\(.*\)|\1|'`
+	      echo "	-> $filename"
+	      `sed -e 's|@INSTALL_DIR_NAGIOS@|'"$INSTALL_DIR_NAGIOS"'|g' -e 's|@NAGIOS_ETC@|'"$NAGIOS_ETC"'|g' -e 's|@NAGIOS_PLUGINS@|'"$NAGIOS_PLUGIN"'|g' -e 's|@RRDTOOL_PERL_LIB@|'"$RRD_PERL"'|g' -e 's|@INSTALL_DIR_OREON@|'"$INSTALL_DIR_OREON"'|g'  "$fichier" > "$filename"`
+	  fi
+	done
+	echo_success "Installing Oreon Plugins on '$NAGIOS_PLUGIN'" "OK"
+	cp *.pl $NAGIOS_PLUGIN
+    fi
+    
+    chown -R $WEB_USER:$NAGIOS_GROUP $NAGIOS_PLUGIN >> $LOG_FILE 2>> $LOG_FILE
+    chmod 775 $NAGIOS_PLUGIN >> $LOG_FILE 2>> $LOG_FILE
+    chmod 775 $NAGIOS_PLUGIN/* >> $LOG_FILE 2>> $LOG_FILE
+
+    if [ -n "$PLUGINS_DIR/traps" ]; then
+	if [ -e "$NAGIOS_PLUGIN/traps" ]; then
+	    echo "$NAGIOS_PLUGIN/traps already exists"
+	else
+	    mkdir $NAGIOS_PLUGIN/traps
+	fi
+	for fichier in $PLUGINS_DIR/src/traps/*
+	  do
+	  filename=`echo $fichier  | sed -e 's|.*\/\(.*\)|\1|'`
+	  echo "-> $filename"
+	  `sed -e 's|@INSTALL_DIR_NAGIOS@|'"$INSTALL_DIR_NAGIOS"'|g' -e 's|@NAGIOS_ETC@|'"$NAGIOS_ETC"'|g' -e 's|@NAGIOS_PLUGINS@|'"$NAGIOS_PLUGIN"'|g' -e 's|@RRDTOOL_PERL_LIB@|'"$RRD_PERL"'|g' -e 's|@INSTALL_DIR_OREON@|'"$INSTALL_DIR_OREON"'|g'  "$fichier" > "$PLUGINS_DIR/$filename"`
+	done
+	cp $PLUGINS_DIR/src/traps/* $NAGIOS_PLUGIN/traps
+	echo_success "Installing Oreon Traps Plugins on '$NAGIOS_PLUGIN/traps'" "OK"
+	chmod 775 $NAGIOS_PLUGIN/traps/* >> $LOG_FILE 2>> $LOG_FILE
+    fi
+    
+    if test -a $NAGIOS_PLUGIN/oreon.conf ; then
+	echo ""
+	echo_success "Finding Oreon Plugins configuration file 'oreon.conf' :" "OK"
+	echo "You already seem to have installed the plugins Oreon."
+	echo "Do you want overwrite this file ? You must regenerate this one from Oreon interface."
+	echo -n "[y/n], default to [n]:"
+	read temp
+	if [ -z $temp ];then
+	    temp=n
+	fi
+    else
+	temp=y
+    fi
+    
+    if [ $temp = "y" ];then
+	cp ${PLUGINS_DIR}oreon.conf $NAGIOS_PLUGIN >> $LOG_FILE 2>> $LOG_FILE
+	chmod 775 $NAGIOS_PLUGIN/oreon.conf >> $LOG_FILE 2>> $LOG_FILE
+	chown $WEB_USER:$WEB_GROUP $NAGIOS_PLUGIN/oreon.conf >> $LOG_FILE 2>> $LOG_FILE
+  fi
+    
+    cp ${PLUGINS_DIR}oreon.pm $NAGIOS_PLUGIN >> $LOG_FILE 2>> $LOG_FILE
+    chmod 775 $NAGIOS_PLUGIN/oreon.pm >> $LOG_FILE 2>> $LOG_FILE
+}
+
+
+function install_oreon()
+{
+    echo ""
+    echo "Start Oreon Installation"
+    echo "------------------------"
+    
+    if test -d $INSTALL_DIR_OREON ; then
+	echo_passed "Oreon Directory already exists" "PASSED"
+    else
+	mkdir $INSTALL_DIR_OREON >> $LOG_FILE 2>> $LOG_FILE
+	echo_success "Creating Oreon Directory '$INSTALL_DIR_OREON'" "OK"
+    fi
+    
+    for directory in "filesGeneration" "filesUpload" "GPL_LIB" "log" "rrd" "www"
+      do
+      if test -d $directory ; then
+	  cp -Rf $directory $INSTALL_DIR_OREON >> $LOG_FILE 2>> $LOG_FILE
+	  echo_success "Copy '$directory'" "OK"
+      fi
+    done
+    
+    
+#  cp -Rf $SRC_OREON/* $INSTALL_DIR_OREON  >> $LOG_FILE 2>> $LOG_FILE
+    chown -R $WEB_USER:$WEB_GROUP $INSTALL_DIR_OREON/ >> $LOG_FILE 2>> $LOG_FILE
+    chmod -R 775 $INSTALL_DIR_OREON >> $LOG_FILE 2>> $LOG_FILE
+    chmod -R 775 $INSTALL_DIR_OREON/* >> $LOG_FILE 2>> $LOG_FILE
+    chmod -R 775 $INSTALL_DIR_NAGIOS  >> $LOG_FILE 2>> $LOG_FILE
+    chmod -R 775 $INSTALL_DIR_NAGIOS/*  >> $LOG_FILE 2>> $LOG_FILE
+    if test -d /etc/nagios ; then
+	chmod -R 775 /etc/nagios >> $LOG_FILE 2>> $LOG_FILE
+    fi
+    
+# rrdtool directory configuration
+    
+    chown -R $NAGIOS_USER:$NAGIOS_GROUP $INSTALL_DIR_OREON/rrd >> $LOG_FILE 2>> $LOG_FILE
+    chmod 775 $INSTALL_DIR_OREON/rrd/*  >> $LOG_FILE 2>> $LOG_FILE
+    
+# trafficMap data directory configuration
+    
+#  chown -R $NAGIOS_USER:$NAGIOS_GROUP $INSTALL_DIR_OREON/include/trafficMap/average >> $LOG_FILE 2>> $LOG_FILE
+#  chmod 775 $INSTALL_DIR_OREON/include/trafficMap/average  >> $LOG_FILE 2>> $LOG_FILE
+#  chown -R $WEB_USER:$WEB_GROUP $INSTALL_DIR_OREON/include/trafficMap/bg >> $LOG_FILE 2>> $LOG_FILE
+#  chmod 775 $INSTALL_DIR_OREON/include/trafficMap/bg  >> $LOG_FILE 2>> $LOG_FILE
+#  chown -R $WEB_USER:$WEB_GROUP $INSTALL_DIR_OREON/include/trafficMap/png >> $LOG_FILE 2>> $LOG_FILE
+#  chmod 775 $INSTALL_DIR_OREON/include/trafficMap/png  >> $LOG_FILE 2>> $LOG_FILE
+    
+    install_oreon_plugins
+    
+    if test -d $NAGIOS_ETC ; then
+	echo_passed "$NAGIOS_ETC already exists" "PASSED"
+    else
+	mkdir  $NAGIOS_ETC  >> $LOG_FILE 2>> $LOG_FILE
+	echo_success "Creating '$NAGIOS_ETC'" "OK"
+    fi
+    
+    chown -R $WEB_USER:$NAGIOS_GROUP $NAGIOS_ETC >> $LOG_FILE 2>> $LOG_FILE
+    chmod 775 $NAGIOS_ETC >> $LOG_FILE 2>> $LOG_FILE
+    
+    if test -d $INSTALL_DIR_OREON/filesGeneration/nagiosCFG ; then
+	echo_passed "$INSTALL_DIR_OREON/filesGeneration/nagiosCFG already exists" "PASSED"
+    else
+	echo_success "Creating '$INSTALL_DIR_OREON/filesGeneration/nagiosCFG'" "OK"
+	mkdir $INSTALL_DIR_OREON/filesGeneration/nagiosCFG
+    fi
+    
+    chmod 775 $INSTALL_DIR_OREON/filesGeneration >> $LOG_FILE 2>> $LOG_FILE
+    chown -R $WEB_USER:$WEB_GROUP $INSTALL_DIR_OREON/filesGeneration >> $LOG_FILE 2>> $LOG_FILE
+    
+    if test -d $INSTALL_DIR_OREON/filesUpload/nagiosCFG ; then
+	echo_passed "$INSTALL_DIR_OREON/filesUpload/nagiosCFG already exists" "PASSED"
+    else
+	echo_success "Creating '$INSTALL_DIR_OREON/filesUpload/nagiosCFG'" "OK"
+	mkdir $INSTALL_DIR_OREON/filesUpload/nagiosCFG
+    fi
+    
+    chmod 775 $INSTALL_DIR_OREON/filesUpload/nagiosCFG >> $LOG_FILE 2>> $LOG_FILE
+    chown -R $WEB_USER:$WEB_GROUP $INSTALL_DIR_OREON/filesUpload/nagiosCFG >> $LOG_FILE 2>> $LOG_FILE
+    
+}
+
+
+
+
diff --git a/install.sh b/install.sh
new file mode 100644
index 0000000000000000000000000000000000000000..47c7327802c46b4b481f4fd689808ec0ae8569e1
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,597 @@
+#!/bin/sh
+#
+# Oreon is developped with Apache Licence 2.0 :
+# http://www.apache.org/licenses/LICENSE-2.0.txt
+# Developped by : Julien Mathis - Romain Le Merlus
+#                 Christophe Coraboeuf - Mathieu Chateau
+
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+#Load install script functions
+. functions
+
+##
+## VARIABLES
+##
+## Make sure you know what you do if you modify it !!
+
+SRC_OREON="oreon_src"
+
+PLUGINS_DIR="plugins/"
+
+PWD=`pwd`
+
+LOG_FILE="$PWD/log/install_oreon.log"
+
+date > $LOG_FILE
+
+TRUETYPE="/usr/X11R6/lib/X11/fonts/truetype"
+
+
+echo
+echo "###############################################################################"
+echo "#                    OREON Project (www.oreon-project.org)                    #"
+echo "#                            Thanks for using OREON                           #"
+echo "#                                                                             #"
+echo "#                                    v 1.3                                    #"
+echo "#                                                                             #"
+echo "#                             infos@oreon-project.org                         #"
+echo "#                                                                             #"
+echo "#                     Make sure you have installed and configured             #"
+echo "#                                   sudo - sed                                #"
+echo "#                          php - apache - rrdtool - mysql                     #"
+echo "#                                                                             #"
+echo "#                                                                             #"
+echo "###############################################################################"
+echo "#                                 The Team OREON                              #"
+echo "###############################################################################"
+echo ""
+echo ""
+$SETCOLOR_WARNING
+echo "                     Make sure you have root permissions !"
+echo ""
+echo ""
+echo " WARNING : Setup will delete all previous informations in your OREON DATABASE. "
+$SETCOLOR_NORMAL
+echo ""
+echo "Are you sure to continue ?"
+echo -n "[y/n], default to [n]:"
+read temp
+if [ -z $temp ];then
+    temp=n
+fi
+
+if [ $temp = "n" ];then
+    echo "Okay... have a nice day!"
+    exit
+fi
+
+test_answer()
+{
+    #$1 variable to fill
+    #$2 text typed by user
+    if [ ! -z $2 ];then
+        if [ $2 != "" ];then
+      eval $1=$2
+        fi
+    fi
+}
+
+##
+## CONFIGURATION
+##
+if test -a $OREON_CONF ; then
+	echo ""
+	echo_success "Finding Oreon configuration file '$OREON_CONF' :" "OK"
+	echo "You already seem to have to install Oreon."
+    echo "Do you want use last Oreon install parameters ?"
+	echo -n "[y/n], default to [y]:"
+	read temp
+	if [ -z $temp ];then
+	    temp=y
+	fi
+
+	if [ $temp = "y" ];then
+	    echo ""
+		echo_passed "Using '$OREON_CONF' :" "PASSED"
+	    . $OREON_CONF
+	    echo ""
+	else
+		echo ""
+		echo "First, let's talk about you !"
+		echo "-----------------------------"
+		echo ""
+	fi
+fi
+
+	if [ -z $INSTALL_DIR_NAGIOS ];then
+		INSTALL_DIR_NAGIOS="/usr/local/nagios"
+		echo "Where is installed Nagios ?"
+		echo -n "default to [$INSTALL_DIR_NAGIOS]:"
+		read temp
+		test_answer INSTALL_DIR_NAGIOS $temp
+		INSTALL_DIR_NAGIOS=${INSTALL_DIR_NAGIOS%/}
+		echo ""
+	fi
+
+	if [ -z $NAGIOS_ETC ];then
+		#nagios etc directory for oreon
+		NAGIOS_ETC="$INSTALL_DIR_NAGIOS/etc"
+		echo "Where are your nagios etc directory ?"
+		echo -n "default to [$NAGIOS_ETC]:"
+		read temp
+		test_answer NAGIOS_ETC $temp
+		NAGIOS_ETC=${NAGIOS_ETC%/}
+		if [ -a "${NAGIOS_ETC}/nagios.cfg" ]; then
+		     echo_success "Path $NAGIOS_ETC/nagios.cfg" "OK"
+		else
+			echo_passed "${NAGIOS_ETC}/nagios.cfg not found" "CRITICAL"
+			echo "Where are your nagios etc directory ?"
+			echo -n " :"
+			read temp
+			test_answer NAGIOS_ETC $temp
+			NAGIOS_ETC=${NAGIOS_ETC%/}
+		fi
+		echo ""
+	fi
+
+	if [ -z $NAGIOS_PLUGIN ];then
+		#nagios plugins directory for oreon
+		NAGIOS_PLUGIN="$INSTALL_DIR_NAGIOS/libexec"
+		echo "Where are your nagios plugins / libexec  directory ?"
+		echo -n "default to [$NAGIOS_PLUGIN]:"
+		read temp
+		test_answer NAGIOS_PLUGIN $temp
+		NAGIOS_PLUGIN=${NAGIOS_PLUGIN%/}
+		echo ""
+	fi
+
+	if [ -z $NAGIOS_BIN ];then
+		#nagios plugins directory for oreon
+		NAGIOS_BIN="$INSTALL_DIR_NAGIOS/bin"
+		echo "Where are your nagios bin  directory ?"
+		echo -n "default to [$NAGIOS_BIN]:"
+		read temp
+		test_answer NAGIOS_BIN $temp
+		NAGIOS_BIN=${NAGIOS_BIN%/}
+		echo ""
+	fi
+
+	if [ -z $INSTALL_DIR_OREON ];then
+		#setup directory for oreon
+		INSTALL_DIR_OREON="/usr/local/oreon"
+		echo "Where do I install Oreon ?"
+		echo -n "default to [$INSTALL_DIR_OREON]:"
+		read temp
+		test_answer INSTALL_DIR_OREON $temp
+		INSTALL_DIR_OREON=${INSTALL_DIR_OREON%/}
+		echo ""
+	fi
+
+	if [ -z $SUDO_FILE ];then
+		#Configuration file for sudo
+		SUDO_FILE="/etc/sudoers"
+		echo "Where is sudo ?"
+		echo -n "default to [$SUDO_FILE]:"
+		read temp
+		test_answer SUDO_FILE $temp
+		SUDO_FILE=${SUDO_FILE%/}
+		echo ""
+	fi
+
+	if [ -z $RRD_PERL ];then
+		#RRDTOOL perl module directory
+		RRD_PERL="/usr/local/rrdtool/lib/perl"
+		echo "Where is RRD perl modules RRDs.pm ?"
+		echo "Just put directory, not full path."
+		echo -n "default to [$RRD_PERL]:"
+		read temp
+		test_answer RRD_PERL $temp
+		RRD_PERL=${RRD_PERL%/}
+		echo ""
+	fi
+
+	if [ -z $BIN_RRDTOOL ];then
+		#RRDTOOL binary path
+		BIN_RRDTOOL="/usr/bin/rrdtool"
+		echo "Where is rrdtool binary ?"
+		echo -n "default to [$BIN_RRDTOOL]:"
+		read temp
+		test_answer BIN_RRDTOOL $temp
+		BIN_RRDTOOL=${BIN_RRDTOOL%/}
+		if [ -x "$BIN_RRDTOOL" ]; then
+		     echo_success "$BIN_RRDTOOL" "OK"
+		else
+			echo_passed "$BIN_RRDTOOL not found" "CRITICAL"
+			echo "Where is rrdtool binary ?"
+			echo -n " :"
+			read temp
+			test_answer BIN_RRDTOOL $temp
+			BIN_RRDTOOL=${BIN_RRDTOOL%/}
+		fi
+		echo ""
+	fi
+
+
+	if [ -z $BIN_MAIL ];then
+		#MAIL binary path
+		BIN_MAIL="/usr/bin/mail"
+		echo "Where is mail binary ?"
+		echo -n "default to [$BIN_MAIL]:"
+		read temp
+		test_answer BIN_MAIL $temp
+		BIN_MAIL=${BIN_MAIL%/}
+		if [ -x "$BIN_MAIL" ]; then
+		     echo_success "$BIN_MAIL" "OK"
+		else
+			echo_passed "$BIN_MAIL not found" "CRITICAL"
+			echo "Where is mail binary ?"
+			echo -n " :"
+			read temp
+			test_answer BIN_MAIL $temp
+			BIN_MAIL=${BIN_MAIL%/}
+		fi
+
+		echo ""
+	fi
+
+	if [ -z $PEAR_PATH ];then
+		PEAR_PATH="/usr/share/pear"
+		echo "Where is PEAR Path ?"
+		echo -n "default to [$PEAR_PATH]:"
+		read temp
+		test_answer PEAR_PATH $temp
+		PEAR_PATH=${PEAR_PATH%/}
+		if [ -a "${PEAR_PATH}/PEAR.php" ]; then
+		     echo_success "PEAR Path $PEAR_PATH/PEAR.php" "OK"
+		else
+			echo_passed "${PEAR_PATH}/PEAR.php not found" "CRITICAL"
+			echo "Where is PEAR Path ?"
+			echo -n "default to [$PEAR_PATH]:"
+			read temp
+			test_answer PEAR_PATH $temp
+			PEAR_PATH=${PEAR_PATH%/}
+		fi
+		echo ""
+	fi
+
+
+##
+## Functions
+##
+
+# When exit on error
+
+function error()
+{
+    echo "ERROR"
+    exit 2
+}
+
+# Check apache version, and configure it. Ask to restart apache server
+# Make a copy of the original file as httpd.conf.initial
+
+function configure_apache()
+{
+    echo ""
+    echo "Configure Apache server"
+    echo "-----------------------"
+
+  if test -d $INSTALL_DIR_OREON ; then
+      echo_passed "$INSTALL_DIR_OREON already exists" "PASSED"
+  else
+      mkdir $INSTALL_DIR_OREON >> $LOG_FILE 2>> $LOG_FILE
+      echo_success "Creating $INSTALL_DIR_OREON" "OK"
+  fi
+
+    # configure httpd.conf
+    if test -e $DIR_APACHE_CONF/oreon.conf ; then
+	   	echo "Finding Apache Oreon configuration file"
+	   	echo_success "'$DIR_APACHE_CONF/oreon.conf' :" "OK"
+	    echo "Do you want rewrite Apache configuration file ?"
+		echo -n "[y/n], default to [y]:"
+		read temp
+		if [ -z $temp ];then
+		    temp=y
+		fi
+	else
+	    temp=y
+	fi
+
+	if [ $temp = "y" ];then
+	     echo "" > $DIR_APACHE_CONF/oreon.conf
+    	 echo "##" >> $DIR_APACHE_CONF/oreon.conf
+         echo "## Section add by OREON Install Setup" >> $DIR_APACHE_CONF/oreon.conf
+         echo "##" >> $DIR_APACHE_CONF/oreon.conf
+         echo "" >> $DIR_APACHE_CONF/oreon.conf
+         echo "AddType application/x-java-jnlp-file .jnlp" >> $DIR_APACHE_CONF/oreon.conf
+         echo "Alias /oreon/ $INSTALL_DIR_OREON/www/" >> $DIR_APACHE_CONF/oreon.conf
+         echo "<Directory "$INSTALL_DIR_OREON/www">" >> $DIR_APACHE_CONF/oreon.conf
+         echo "    Options None" >> $DIR_APACHE_CONF/oreon.conf
+         echo "    AllowOverride AuthConfig Options" >> $DIR_APACHE_CONF/oreon.conf
+         echo "    Order allow,deny" >> $DIR_APACHE_CONF/oreon.conf
+         echo "    Allow from all" >> $DIR_APACHE_CONF/oreon.conf
+         echo "</Directory>" >> $DIR_APACHE_CONF/oreon.conf
+         echo "" >> $DIR_APACHE_CONF/oreon.conf
+	    echo_success "Create '$DIR_APACHE_CONF/oreon.conf'" "OK"
+    	echo_success "Configuring Apache" "OK"
+    else
+	    echo_passed "Apache is already configurated" "PASSED"
+    fi
+
+    # add apache user to nagios group
+    usermod -G $NAGIOS_GROUP,$WEB_USER $WEB_USER >> $LOG_FILE 2>> $LOG_FILE
+    echo_success "User $WEB_USER added to nagios group" "OK"
+    echo ""
+
+    #restart apache !
+    if test -x /etc/init.d/apache ; then
+    /etc/init.d/apache restart >> $LOG_FILE 2>> $LOG_FILE
+    else if test -x /etc/init.d/httpd ; then
+    /etc/init.d/httpd restart
+  else if test -e /etc/init.d/apache2 ; then
+    /etc/init.d/apache2 restart >> $LOG_FILE 2>> $LOG_FILE
+    else
+      echo_warning "Unable to restart apache server" "WARNING"
+    fi
+    fi
+    fi
+
+}
+
+# install OREON interface
+
+function confirm_oreon()
+{
+    if test -f $INSTALL_DIR_OREON/www/oreon.conf.php ; then
+	  echo ""
+	  echo "Oreon is already install on your server !"
+
+	  echo -n "Are you sure you want to install OREON ? [y/n] "
+	  read answer
+	  if [ $answer == 'n' ]; then
+	      echo "Ok, so bye bye !! "
+	      exit
+	  else if [ $answer == 'y' ]; then
+	      install_oreon
+	      config_sudo
+	      #restart_mysql
+	  else
+	      echo "Please answer y or n ! "
+	      confirm_oreon
+	  fi
+	  fi
+    else
+	    install_oreon
+	    config_sudo
+	    #restart_mysql
+    fi
+}
+
+## old install_oreon
+
+
+function restart_mysql()
+{
+  # restart mysql to be sure that mysqld is running !
+    echo ""
+    echo "Restart Mysql server"
+    echo "-------------------"
+  if test -x /etc/init.d/mysqld ; then
+      /etc/init.d/mysqld restart
+  else if test -x /etc/init.d/mysql ; then
+      /etc/init.d/mysql restart
+  else
+      echo_failure "We don't find Mysql server. OREON will not run." "FAILURE"
+      exit
+  fi
+  fi
+}
+
+function config_sudo()
+{
+# modify sudoers file
+    echo ""
+    echo "Configure Sudo"
+    echo "--------------"
+
+  sudo=`cat $SUDO_FILE | grep OREON > /dev/null; echo $?`
+
+  if [ $sudo == '1' ]; then
+      echo "#Add by OREON" >> $SUDO_FILE
+      echo "User_Alias      OREON= $WEB_USER" >> $SUDO_FILE
+      echo "OREON   ALL = NOPASSWD: /etc/init.d/nagios restart" >> $SUDO_FILE
+      echo "" >> $SUDO_FILE
+      echo_success "Configuring Sudo" "OK"
+  else
+      echo_passed "Sudo is already configurated" "PASSED"
+  fi
+}
+
+function oreon_post_install()
+{
+    echo ""
+    echo "Post Install"
+    echo "------------"
+
+      #BIN_MAIL=`whereis -b mail | cut -d : -f2`
+      #BIN_MAIL=${BIN_MAIL# }
+	  echo_success "Finding mail binary : $BIN_MAIL " "OK"
+
+	  #BIN_RRDTOOL=`whereis -b rrdtool | cut -d : -f2 | cut -d " " -f2`
+      #BIN_RRDTOOL=${BIN_RRDTOOL# }
+	  echo_success "Finding rrdtool binary : $BIN_RRDTOOL " "OK"
+
+
+	  INSTALL_DIR_OREON_CONF="$INSTALL_DIR_OREON/www/install/installoreon.conf.php"
+      echo "<?" > $INSTALL_DIR_OREON_CONF
+      echo "/**" >> $INSTALL_DIR_OREON_CONF
+      echo "Oreon is developped with GPL Licence 2.0 :" >> $INSTALL_DIR_OREON_CONF
+      echo "http://www.gnu.org/licenses/gpl.txt" >> $INSTALL_DIR_OREON_CONF
+      echo "Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf" >> $INSTALL_DIR_OREON_CONF
+      echo "" >> $INSTALL_DIR_OREON_CONF
+      echo "The Software is provided to you AS IS and WITH ALL FAULTS." >> $INSTALL_DIR_OREON_CONF
+      echo "OREON makes no representation and gives no warranty whatsoever," >> $INSTALL_DIR_OREON_CONF
+      echo "whether express or implied, and without limitation, with regard to the quality," >> $INSTALL_DIR_OREON_CONF
+      echo "safety, contents, performance, merchantability, non-infringement or suitability for" >> $INSTALL_DIR_OREON_CONF
+      echo "any particular or intended purpose of the Software found on the OREON web site." >> $INSTALL_DIR_OREON_CONF
+      echo "In no event will OREON be liable for any direct, indirect, punitive, special," >> $INSTALL_DIR_OREON_CONF
+      echo "incidental or consequential damages however they may arise and even if OREON has" >> $INSTALL_DIR_OREON_CONF
+      echo "been previously advised of the possibility of such damages." >> $INSTALL_DIR_OREON_CONF
+      echo "" >> $INSTALL_DIR_OREON_CONF
+      echo "For information : contact@oreon-project.org" >> $INSTALL_DIR_OREON_CONF
+      echo "	*/" >> $INSTALL_DIR_OREON_CONF
+      echo "" >> $INSTALL_DIR_OREON_CONF
+      echo "\$conf_installoreon['oreon_dir'] = \"$INSTALL_DIR_OREON/\";" >> $INSTALL_DIR_OREON_CONF
+      echo "\$conf_installoreon['oreon_dir_www'] = \"$INSTALL_DIR_OREON/www/\";" >> $INSTALL_DIR_OREON_CONF
+      echo "\$conf_installoreon['oreon_dir_rrd'] = \"$INSTALL_DIR_OREON/rrd/\";" >> $INSTALL_DIR_OREON_CONF
+      echo "\$conf_installoreon['nagios'] = \"$INSTALL_DIR_NAGIOS/\";" >> $INSTALL_DIR_OREON_CONF
+      echo "\$conf_installoreon['nagios_conf'] = \"$NAGIOS_ETC/\";" >> $INSTALL_DIR_OREON_CONF
+      echo "\$conf_installoreon['nagios_plugins'] = \"$NAGIOS_PLUGIN/\";" >> $INSTALL_DIR_OREON_CONF
+      echo "\$conf_installoreon['nagios_bin'] = \"$NAGIOS_BIN/\";" >> $INSTALL_DIR_OREON_CONF
+     # echo "\$conf_installoreon['rrdtool_perl_dir'] = \"$RRD_PERL\";" >> $INSTALL_DIR_OREON_CONF
+      echo "\$conf_installoreon['rrdtool_dir'] = \"$BIN_RRDTOOL\";" >> $INSTALL_DIR_OREON_CONF
+      echo "\$conf_installoreon['apache_user'] = \"$WEB_USER\";" >> $INSTALL_DIR_OREON_CONF
+      echo "\$conf_installoreon['apache_group'] = \"$WEB_GROUP\";" >> $INSTALL_DIR_OREON_CONF
+      echo "\$conf_installoreon['nagios_user'] = \"$NAGIOS_USER\";" >> $INSTALL_DIR_OREON_CONF
+      echo "\$conf_installoreon['nagios_group'] = \"$NAGIOS_GROUP\";" >> $INSTALL_DIR_OREON_CONF
+      echo "\$conf_installoreon['mail'] = \"$BIN_MAIL\";" >> $INSTALL_DIR_OREON_CONF
+      #echo "\$conf_installoreon['rrdtool_dir'] = \"$BIN_RRDTOOL\";" >> $INSTALL_DIR_OREON_CONF
+      echo "\$conf_installoreon['pear_dir'] = \"$PEAR_PATH\";" >> $INSTALL_DIR_OREON_CONF
+
+      for fichier in `cat $NAGIOS_ETC/nagios.cfg | grep _file | grep -v \#`
+      do
+      	echo -n "\$conf_installoreon['" >> $INSTALL_DIR_OREON_CONF
+	    tmp=`echo  "$fichier" | cut -d = -f1` >> $INSTALL_DIR_OREON_CONF
+    	echo -n $tmp >> $INSTALL_DIR_OREON_CONF
+      	echo -n "'] = \"" >> $INSTALL_DIR_OREON_CONF
+      	tmp=`echo "$fichier" | cut -d = -f2` >> $INSTALL_DIR_OREON_CONF
+        echo -n $tmp >> $INSTALL_DIR_OREON_CONF
+      	echo "\";" >> $INSTALL_DIR_OREON_CONF
+      done
+      for fichier in `cat $NAGIOS_ETC/nagios.cfg | grep _path | grep -v \#`
+      do
+      	echo -n "\$conf_installoreon['" >> $INSTALL_DIR_OREON_CONF
+	    tmp=`echo  "$fichier" | cut -d = -f1` >> $INSTALL_DIR_OREON_CONF
+    	echo -n $tmp >> $INSTALL_DIR_OREON_CONF
+      	echo -n "'] = \"" >> $INSTALL_DIR_OREON_CONF
+      	tmp=`echo "$fichier" | cut -d = -f2` >> $INSTALL_DIR_OREON_CONF
+        echo -n $tmp >> $INSTALL_DIR_OREON_CONF
+      	echo "\";" >> $INSTALL_DIR_OREON_CONF
+      done
+        for fichier in `cat $NAGIOS_ETC/cgi.cfg | grep physical_html_path | grep -v \#`
+      do
+      	echo -n "\$conf_installoreon['" >> $INSTALL_DIR_OREON_CONF
+	    tmp=`echo  "$fichier" | cut -d = -f1` >> $INSTALL_DIR_OREON_CONF
+    	echo -n $tmp >> $INSTALL_DIR_OREON_CONF
+      	echo -n "'] = \"" >> $INSTALL_DIR_OREON_CONF
+      	tmp=`echo "$fichier" | cut -d = -f2` >> $INSTALL_DIR_OREON_CONF
+        echo -n $tmp >> $INSTALL_DIR_OREON_CONF
+      	echo "\";" >> $INSTALL_DIR_OREON_CONF
+      done
+
+      echo "?>" >> $INSTALL_DIR_OREON_CONF
+      echo_success "Create $INSTALL_DIR_OREON_CONF" "OK"
+
+     echo "INSTALL_DIR_OREON=$INSTALL_DIR_OREON" > $OREON_CONF
+     echo "NAGIOS_ETC=$NAGIOS_ETC" >> $OREON_CONF
+     echo "NAGIOS_PLUGIN=$NAGIOS_PLUGIN" >> $OREON_CONF
+     echo "NAGIOS_BIN=$NAGIOS_BIN" >> $OREON_CONF
+     echo "INSTALL_DIR_NAGIOS=$INSTALL_DIR_NAGIOS" >> $OREON_CONF
+     echo "RRD_PERL=$RRD_PERL" >> $OREON_CONF
+     echo "SUDO_FILE=$SUDO_FILE" >> $OREON_CONF
+     echo "WEB_USER=$WEB_USER" >> $OREON_CONF
+     echo "WEB_GROUP=$WEB_GROUP" >> $OREON_CONF
+     echo "NAGIOS_USER=$NAGIOS_USER" >> $OREON_CONF
+     echo "NAGIOS_GROUP=$NAGIOS_GROUP" >> $OREON_CONF
+     echo "BIN_RRDTOOL=$BIN_RRDTOOL" >> $OREON_CONF
+     echo "BIN_MAIL=$BIN_MAIL" >> $OREON_CONF
+     echo "PEAR_PATH=$PEAR_PATH" >> $OREON_CONF
+
+
+     echo_success "Create $OREON_CONF " "OK"
+     echo_success "Configuring Oreon post-install" "OK"
+}
+
+
+##
+## INSTALL
+##
+echo "Users Management"
+echo "----------------"
+# check for httpd directory
+check_httpd_directory
+## group apache
+check_group_apache
+## user apache
+check_user_apache
+check_group_nagios
+check_user_nagios
+echo ""
+
+echo "Other Stuff"
+echo "------------"
+if test -d $NAGIOS_PLUGIN ; then
+    echo_success "Nagios libexec directory" "OK"
+else
+    mkdir -p $NAGIOS_PLUGIN > /dev/null
+    echo_success "Nagios libexec directory created" "OK"
+fi
+
+if test -d $TRUETYPE ; then
+    cp truetype/verdanab.ttf $TRUETYPE/verdanab.ttf > /dev/null
+    echo_success "TrueType verdana installed" "OK"
+else
+    mkdir -p $TRUETYPE > /dev/null
+    echo_success "TrueType directory created" "OK"
+    cp truetype/verdanab.ttf $TRUETYPE/verdanab.ttf > /dev/null
+    echo_success "TrueType verdana installed" "OK"
+fi
+
+  #PEAR_PATH=`whereis -b pear | cut -d : -f2 | cut -d " " -f4`
+ # PEAR_PATH=${PEAR_PATH# }
+ # PEAR_PATH=${PEAR_PATH%/}
+  echo_success "Finding PEAR Path : $PEAR_PATH " "OK"
+	if test -d "$PEAR_PATH/Image/Canvas/Fonts" ; then
+		cp truetype/arial.ttf $PEAR_PATH/Image/Canvas/Fonts/arial.ttf > /dev/null
+  		cp truetype/fontmap.txt $PEAR_PATH/Image/Canvas/Fonts/fontmap.txt > /dev/null
+  		echo_success "PEAR Font installed" "OK"
+	else
+		if [ -z $PEAR_PATH ];then
+			echo_passed "PEAR directory not found" "PASSED"
+		else
+		    mkdir -p "$PEAR_PATH/Image/Canvas/Fonts" > /dev/null
+		    echo_success "PEAR Font directory created" "OK"
+		    cp truetype/arial.ttf $PEAR_PATH/Image/Canvas/Fonts/arial.ttf > /dev/null
+	  	  	cp truetype/fontmap.txt $PEAR_PATH/Image/Canvas/Fonts/fontmap.txt > /dev/null
+		    echo_success "PEAR Font installed" "OK"
+		 fi
+	fi
+
+
+
+# installation script
+
+#check_group_nagiocmd
+configure_apache
+confirm_oreon
+oreon_post_install
+
+echo ""
+echo "###############################################################################"
+echo "#      Go to the URL : http://your-server/oreon/  to finish the setup         #"
+echo "#                                                                             #"
+echo "#                    Report bugs at bugs@oreon-project.org                    #"
+echo "#                                                                             #"
+echo "#                             Thanks for using OREON.                         #"
+echo "#                             -----------------------                         #"
+echo "#                        Contact : infos@oreon-project.org                    #"
+echo "#                           http://www.oreon-project.org                      #"
+echo "###############################################################################"
diff --git a/plugins/.project b/plugins/.project
new file mode 100644
index 0000000000000000000000000000000000000000..2d8bb837b878554a46538d3d18fb56028ccdb4b3
--- /dev/null
+++ b/plugins/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>plugins</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>
diff --git a/plugins/CHANGELOG b/plugins/CHANGELOG
new file mode 100644
index 0000000000000000000000000000000000000000..2ece925663090bbf3595e82a98682f5c704d27f2
--- /dev/null
+++ b/plugins/CHANGELOG
@@ -0,0 +1,22 @@
+##########################
+# Oreon Plugins Change Log
+##########################
+
+1.2.3 - 02/11/2005
+----------------
+* Enhanced Oreon Perl Package oreon.pm (wistof)
+* Integration of some Manubulon plugins (wistof)
+* New install script for plugins (wistof)
+* Minor bug fixes
+
+1.2.2 - xx/08/2005
+----------------
+* Add Oreon Perl Package oreon.pm (gollum123)
+* Globalization of paths in oreon.conf (gollum123)
+* Management of RRDTOOL errors (wistof)
+* Use Net::SNMP instead of snmpwalk and snmpget (wistof)
+* Disable regex for '-H' option (wistof)
+* Minor bug fixes
+
+
+
diff --git a/plugins/INSTALL b/plugins/INSTALL
new file mode 100644
index 0000000000000000000000000000000000000000..ebefe6175ab5b247eefa7a8a0706ac50062c7778
--- /dev/null
+++ b/plugins/INSTALL
@@ -0,0 +1,8 @@
+############################
+# Oreon Plugins Installation
+############################
+
+- just run install.sh in src/ directory
+- don't directly copy plugins in Nagios plugins directory
+
+
diff --git a/plugins/REQUIREMENT b/plugins/REQUIREMENT
new file mode 100644
index 0000000000000000000000000000000000000000..1ba6eba1db16e6ee7701c2d2ee6b1ddf0b60b6eb
--- /dev/null
+++ b/plugins/REQUIREMENT
@@ -0,0 +1,12 @@
+###########################
+# Oreon Plugins Requirement
+###########################
+
+- Perl in /usr/bin/perl - or just run 'perl script'
+- Net::SNMP
+- Config::IniFiles
+- RRDTool installed (RRDs.pm)
+- Oreon perl module (oreon.pm)
+- Oreon configuration file for Oreon perl module (oreon.conf)
+- file 'utils.pm' in plugin diretory (/usr/local/nagios/libexec)
+- sed program for installation script
\ No newline at end of file
diff --git a/plugins/install.sh b/plugins/install.sh
new file mode 100644
index 0000000000000000000000000000000000000000..8866b218224cb68963ba9a3e1f1372a3847d9f22
--- /dev/null
+++ b/plugins/install.sh
@@ -0,0 +1,228 @@
+#!/bin/sh
+#
+# Oreon is developped with Apache Licence 2.0 :
+# http://www.apache.org/licenses/LICENSE-2.0.txt
+# Developped by : Julien Mathis - Romain Le Merlus
+#                 Christophe Coraboeuf - Mathieu Chateau
+
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+#Load install script functions
+. ../functions
+
+##
+## VARIABLES
+##
+## Make sure you know what you do if you modify it !!
+
+PWD=`pwd`
+
+PLUGINS_DIR=""
+
+LOG_FILE="../log/install_oreon.log"
+
+date > $LOG_FILE
+
+echo
+echo "##########################################################################"
+echo "#                     OREON Project (www.oreon.org)                      #"
+echo "#                         Thanks for using OREON                         #"
+echo "#                                                                        #"
+echo "#                                v 1.2.3                                 #"
+echo "#                                                                        #"
+echo "#                            infos@oreon.org                             #"
+echo "#                                                                        #"
+echo "#                  Make sure you have installed and configured           #"
+echo "#                             perl - sed                                 #"
+echo "#                                                                        #"
+echo "#                                                                        #"
+echo "##########################################################################"
+echo "#                              The Team OREON                            #"
+echo "##########################################################################"
+echo ""
+echo ""
+$SETCOLOR_WARNING
+echo "                     Make sure you have root permissions !"
+$SETCOLOR_NORMAL
+echo ""
+
+echo "Are you sure to continue?"
+echo -n "[y/n], default to [n]:"
+read temp
+if [ -z $temp ];then
+    temp=n
+fi
+
+if [ $temp = "n" ];then
+    echo "Bye bye !"
+    exit
+fi
+
+test_answer()
+{
+    #$1 variable to fill
+    #$2 text typed by user
+    if [ ! -z $2 ];then
+        if [ $2 != "" ];then
+      eval $1=$2
+        fi
+    fi
+}
+
+##
+## CONFIGURATION
+##
+if test -a $OREON_CONF ; then
+	echo ""
+	echo_success "Finding Oreon configuration file '$OREON_CONF' :" "OK"
+	echo "You already seem to have to install Oreon."
+    echo "Do you want use last Oreon install parameters ?"
+	echo -n "[y/n], default to [y]:"
+	read temp
+	if [ -z $temp ];then
+	    temp=y
+	fi
+
+	if [ $temp = "y" ];then
+	    echo ""
+		echo_passed "Using '$OREON_CONF' :" "PASSED"
+	    . $OREON_CONF
+	    echo ""
+	else
+		echo ""
+		echo "First, let's talk about you !"
+		echo "-----------------------------"
+		echo ""
+	fi
+fi
+	if [ -z $INSTALL_DIR_NAGIOS ];then
+		INSTALL_DIR_NAGIOS="/usr/local/nagios"
+		echo "Where is installed Nagios ?"
+		echo -n "default to [$INSTALL_DIR_NAGIOS]:"
+		read temp
+		test_answer INSTALL_DIR_NAGIOS $temp
+		echo ""
+	fi
+
+	if [ -z $NAGIOS_ETC ];then
+		#nagios etc directory for oreon
+		NAGIOS_ETC="$INSTALL_DIR_NAGIOS/etc"
+		echo "Where are your nagios etc directory ?"
+		echo -n "default to [$NAGIOS_ETC]:"
+		read temp
+		test_answer NAGIOS_ETC $temp
+		echo ""
+	fi
+
+	if [ -z $NAGIOS_PLUGIN ];then
+		#nagios plugins directory for oreon
+		NAGIOS_PLUGIN="$INSTALL_DIR_NAGIOS/libexec"
+		echo "Where are your nagios plugin / libexec  directory ?"
+		echo -n "default to [$NAGIOS_PLUGIN]:"
+		read temp
+		test_answer NAGIOS_PLUGIN $temp
+		echo ""
+	fi
+
+	if [ -z $INSTALL_DIR_OREON ];then
+		#setup directory for oreon
+		INSTALL_DIR_OREON="/usr/local/oreon"
+		echo "Where do I install Oreon ?"
+		echo -n "default to [$INSTALL_DIR_OREON]:"
+		read temp
+		test_answer INSTALL_DIR_OREON $temp
+		echo ""
+	fi
+
+	if [ -z $SUDO_FILE ];then
+		#Configuration file for sudo
+		SUDO_FILE="/etc/sudoers"
+		echo "Where is sudo ?"
+		echo -n "default to [$SUDO_FILE]:"
+		read temp
+		test_answer SUDO_FILE $temp
+		echo ""
+	fi
+
+	if [ -z $RRD_PERL ];then
+		#RRDTOOL perl module directory
+		RRD_PERL="/usr/local/rrdtool/lib/perl"
+		echo "Where is RRD perl modules RRDs.pm ?"
+		echo -n "default to [$RRD_PERL]:"
+		read temp
+		test_answer RRD_PERL $temp
+		echo ""
+	fi
+
+##
+## FUNCTION
+##
+
+# When exit on error
+
+function error()
+{
+    echo "ERROR"
+    exit 2
+}
+
+# install OREON PLUGIN
+
+function confirm_oreon()
+{
+    	install_oreon_plugins
+}
+
+# installation script
+
+#check_group_nagios
+#check_user_nagios
+#check_group_nagiocmd
+#confirm_oreon
+
+##
+## INSTALL
+##
+echo "Users Management"
+echo "----------------"
+# check for httpd directory
+check_httpd_directory
+## group apache
+check_group_apache
+## user apache
+check_user_apache
+check_group_nagios
+check_user_nagios
+echo ""
+
+echo "Other Stuff"
+echo "------------"
+if test -d $NAGIOS_PLUGIN ; then
+    echo_success "Nagios libexec directory" "OK"
+else
+    mkdir -p $NAGIOS_PLUGIN > /dev/null
+    echo_success "Nagios libexec directory created" "OK"
+fi
+
+# installation script
+
+confirm_oreon
+#oreon_post_install
+
+echo ""
+echo "###############################################################################"
+echo "#                                                                             #"
+echo "#                    Report bugs at bugs@oreon-project.org                    #"
+echo "#                                                                             #"
+echo "#                             Thanks for using OREON.                         #"
+echo "#                             -----------------------                         #"
+echo "#                        Contact : infos@oreon-project.org                    #"
+echo "#                           http://www.oreon-project.org                      #"
+echo "###############################################################################"
diff --git a/plugins/src/check_graph_dell_temperature.pl b/plugins/src/check_graph_dell_temperature.pl
new file mode 100644
index 0000000000000000000000000000000000000000..bc6e51e6cae4c51bbb0230095c4fa429aee3517e
--- /dev/null
+++ b/plugins/src/check_graph_dell_temperature.pl
@@ -0,0 +1,218 @@
+#! /usr/bin/perl -w
+#
+# $Id: check_graph_dell_temperature.pl,v 1.1 2005/07/27 22:22:48 wistof Exp $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Developped by : Wistof
+#
+# Modified for Oreon Project by : Mathieu Chateau - Christophe Coraboeuf
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+# based on "graph plugins" developped by Oreon Team. See http://www.oreon.org.
+##
+## Plugin init
+##
+use strict;
+use Net::SNMP qw(:snmp oid_lex_sort);
+use FindBin;
+use lib "$FindBin::Bin";
+use lib "@NAGIOS_PLUGINS@";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+if (eval "require oreon" ) {
+	use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+	use vars qw($VERSION %oreon);
+	%oreon=get_parameters();
+} else {
+	print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+use vars qw($PROGNAME $VERSION);
+use Getopt::Long;
+use vars qw($opt_h $opt_V $opt_g $opt_D $opt_S $opt_H $opt_C $opt_v $opt_s $opt_t $opt_step $step $sensor $OID $OID_DESC);
+
+##
+## Plugin var init
+##
+
+
+$VERSION = '$Revision: 1.1 $';
+$VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;
+
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+$PROGNAME = $0;
+sub print_help ();
+sub print_usage ();
+
+Getopt::Long::Configure('bundling');
+GetOptions
+    ("h"   => \$opt_h, "help"         => \$opt_h,
+     "V"   => \$opt_V, "version"      => \$opt_V,
+     "g"   => \$opt_g, "rrdgraph"     => \$opt_g,
+     "rrd_step=s" => \$opt_step,
+     "v=s" => \$opt_v, "snmp=s"       => \$opt_v,
+     "C=s" => \$opt_C, "community=s"  => \$opt_C,
+     "S=s" => \$opt_S, "ServiceId=s"  => \$opt_S,
+     "s"   => \$opt_s, "show"     => \$opt_s,
+     "t=s"   => \$opt_t, "sensor=s"     => \$opt_t,
+     "H=s" => \$opt_H, "hostname=s"   => \$opt_H);
+
+if ($opt_V) {
+    print_revision($PROGNAME,'$Revision: 1.1 $');
+    exit $ERRORS{'OK'};
+}
+
+if ($opt_h) {
+    print_help();
+    exit $ERRORS{'OK'};
+}
+
+$opt_H = shift unless ($opt_H);
+(print_usage() && exit $ERRORS{'OK'}) unless ($opt_H);
+
+($opt_v) || ($opt_v = shift) || ($opt_v = "1");
+my $snmp = $1 if ($opt_v =~ /(\d)/);
+
+($opt_t) || ($opt_t = shift) || ($opt_t = "1");
+my $sensor = $1 if ($opt_t =~ /(\d)/);
+
+($opt_S) || ($opt_S = shift) || ($opt_S = "1_1");
+my $ServiceId = is_valid_serviceid($opt_S);
+
+($opt_C) || ($opt_C = shift) || ($opt_C = "public");
+
+($opt_step) || ($opt_step = shift) || ($opt_step = "300");
+$step = $1 if ($opt_step =~ /(\d+)/);
+
+
+my $rrd = $pathtorrdbase.$ServiceId.".rrd";
+
+my $start=time;
+my $name = $0;
+$name =~ s/\.pl.*//g;
+
+##
+## RRDTools create rrd
+##
+if ($opt_g) {
+    if (! -e $rrd) {
+          	oreon::create_rrd ($rrd,1,$start,$step,"U","U","GAUGE");
+    }
+}
+
+##
+## Plugin snmp requests
+##
+my $OID = ".1.3.6.1.4.1.674.10892.1.700.20.1.6.1";
+my $OID_DESC = ".1.3.6.1.4.1.674.10892.1.700.20.1.8.1";
+
+
+# create a SNMP session
+my ( $session, $error ) = Net::SNMP->session(-hostname  => $opt_H,-community => $opt_C, -version  => $snmp);
+if ( !defined($session) ) {
+    print("UNKNOWN: $error");
+    exit $ERRORS{'UNKNOWN'};
+}
+
+if ($opt_s) {
+    # Get desctiption table
+    my $result = $session->get_table(
+        Baseoid => $OID_DESC
+    );
+
+    if (!defined($result)) {
+        printf("ERROR: Description Table : %s.\n", $session->error);
+        $session->close;
+        exit $ERRORS{'UNKNOWN'};
+    }
+
+    foreach my $key ( oid_lex_sort(keys %$result)) {
+        my @oid_list = split (/\./,$key);
+        my $index = pop (@oid_list) ;
+        print "Temperature Sensor $index :: $$result{$key}\n";
+    }
+exit $ERRORS{'OK'};
+}
+
+
+my $result = $session->get_request(
+                                -varbindlist => [$OID.".".$sensor,
+                                                  $OID_DESC.".".$sensor]
+                                   );
+if (!defined($result)) {
+    printf("UNKNOWN: %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{'UNKNOWN'};
+}
+
+my $return_result =  $result->{$OID.".".$sensor};
+my $un = 0;
+if ($return_result =~ /(\d+)/ ) {
+    $un = $1;
+} else {
+    printf("UNKNOWN:  Unable to parse SNMP Output :: %s", $return_result );
+    $session->close;
+    exit $ERRORS{'UNKNOWN'};
+}
+
+$un =  sprintf("%02.2f", $un / 10);
+
+##
+## RRDtools update
+##
+if ($opt_g) {
+    $start=time;
+    oreon::update_rrd ($rrd,$start,$un);
+}
+
+##
+## Plugin return code
+##
+if ($un || ( $un == 0) ){
+    print "OK - ". $result->{$OID_DESC.".".$sensor} ." : $un\n";
+    exit $ERRORS{'OK'};
+}
+else{
+        print "CRITICAL Host unavailable\n";
+        exit $ERRORS{'CRITICAL'};
+}
+
+
+sub print_usage () {
+    print "\nUsage:\n";
+    print "$PROGNAME\n";
+    print "   -H (--hostname)   Hostname to query - (required)\n";
+    print "   -C (--community)  SNMP read community (defaults to public,\n";
+    print "                     used with SNMP v1 and v2c\n";
+    print "   -v (--snmp_version)  1 for SNMP v1 (default)\n";
+    print "                        2 for SNMP v2c\n";
+    print "   -g (--rrdgraph)   create a rrd base and add datas into this one\n";
+    print "   --rrd_step	    Specifies the base interval in seconds with which data will be fed into the RRD (300 by default)\n";
+    print "   -D (--directory)  Path to rrdatabase (or create the .rrd in this directory)\n";
+    print "                     by default: ".$pathtorrdbase."\n";
+    print "                     (The path is valid with spaces '/my\ path/...')\n";
+    print "   -S (--ServiceId)  Oreon Service Id\n";
+    print "   -t (--sensor)     Set the sensor number (1 by default)\n";
+    print "   -s (--show)       Describes all sensors \n";
+    print "   -V (--version)    Plugin version\n";
+    print "   -h (--help)       usage help\n";
+
+}
+
+sub print_help () {
+    print "Copyright (c) 2005 Oreon\n";
+    print "Bugs to http://www.oreon.org/\n";
+    print "\n";
+    print_usage();
+    print "\n";
+}
diff --git a/plugins/src/check_graph_http.pl b/plugins/src/check_graph_http.pl
new file mode 100644
index 0000000000000000000000000000000000000000..e9c066fb79399a60fe109bf8de780d1ea692e129
--- /dev/null
+++ b/plugins/src/check_graph_http.pl
@@ -0,0 +1,218 @@
+#! /usr/bin/perl -w
+#
+# $Id: check_graph_http.pl,v 1.3 2005/08/01 18:03:52 gollum123 Exp $
+#
+# This plugin is developped under GPL Licence:
+# http://www.fsf.org/licenses/gpl.txt
+
+# Developped by Linagora SA: http://www.linagora.com
+
+# Modified for Oreon Project by : Mathieu Chateau - Christophe Coraboeuf
+
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# LINAGORA makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the LINAGORA web site.
+# In no event will LINAGORA be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if LINAGORA has
+# been previously advised of the possibility of such damages.
+
+# based on "graph plugins" developped by Oreon Team. See http://www.oreon.org.
+
+##
+## Plugin init
+##
+use strict;
+use FindBin;
+use lib "$FindBin::Bin";
+use lib "@NAGIOS_PLUGINS@";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+if (eval "require oreon" ) {
+	use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+	use vars qw($VERSION %oreon);
+	%oreon=get_parameters();
+} else {
+	print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+use Getopt::Long;
+use vars qw($opt_h $opt_V $opt_g $opt_D $opt_S $opt_H $opt_I $opt_e $opt_s $opt_u $opt_p $opt_P $opt_w $opt_c
+            $opt_t $opt_a $opt_L $opt_f $opt_l $opt_r $opt_R $opt_z $opt_C $opt_step $step);
+use vars qw($PROGNAME);
+
+##
+## Plugin var init
+##
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+my $pathtolibexechttp = $oreon{GLOBAL}{ NAGIOS_LIBEXEC}."check_http";
+
+$PROGNAME = "$0";
+sub print_help ();
+sub print_usage ();
+
+Getopt::Long::Configure('bundling');
+GetOptions
+    ("h"     => \$opt_h, "help"             => \$opt_h,
+     "V"     => \$opt_V, "version"          => \$opt_V,
+     "g"     => \$opt_g, "rrdgraph"         => \$opt_g,
+     "rrd_step=s" => \$opt_step,
+     "S=s"   => \$opt_S, "ServiceId=s"      => \$opt_S,
+     "H=s"   => \$opt_H, "hostname=s"       => \$opt_H,
+     "I=s"   => \$opt_I, "IP-address=s"     => \$opt_I,
+     "e=s"   => \$opt_e, "expect=s"         => \$opt_e,
+     "s=s"   => \$opt_s, "string=s"         => \$opt_s,
+     "u=s"   => \$opt_u, "url=s"            => \$opt_u,
+     "p=s"   => \$opt_p, "port=s"           => \$opt_p,
+     "P=s"   => \$opt_P, "post=s"           => \$opt_P,
+     "w=s"   => \$opt_w, "warning=s"        => \$opt_w,
+     "c=s"   => \$opt_c, "critical=s"       => \$opt_c,
+     "t=s"   => \$opt_t, "timeout=s"        => \$opt_t,
+     "a=s"   => \$opt_a, "authorization=s"  => \$opt_a,
+     "L=s"   => \$opt_L, "link=s"           => \$opt_L,
+     "f=s"   => \$opt_f, "onredirect=s"     => \$opt_f,
+     "l=s"   => \$opt_l, "linespan=s"       => \$opt_l,
+     "r=s"   => \$opt_r, "regex=s"          => \$opt_r,
+     "R=s"   => \$opt_R, "eregi=s"          => \$opt_R,
+     "C=s"   => \$opt_C, "certificate=s"    => \$opt_C,
+     "z"   => \$opt_R, "ssl"              => \$opt_z
+
+     );
+
+if ($opt_V) {
+    print_revision($PROGNAME,'$Revision: 1.3 $');
+    exit $ERRORS{'OK'};
+}
+
+if ($opt_h) {
+    print_help();
+    exit $ERRORS{'OK'};
+}
+
+$opt_H = shift unless ($opt_H);
+(print_usage() && exit $ERRORS{'OK'}) unless ($opt_H);
+
+($opt_S) || ($opt_S = shift) || ($opt_S = "1_1");
+my $ServiceId = is_valid_serviceid($opt_S);
+
+($opt_step) || ($opt_step = shift) || ($opt_step = "300");
+$step = $1 if ($opt_step =~ /(\d+)/);
+
+my $args_check_http = "";
+if ( $opt_H ) {
+    $args_check_http .= " -H $opt_H";
+}
+if ( $opt_I ) {
+    $args_check_http .= " -I $opt_I";
+}
+if ( $opt_e ) {
+    $args_check_http .= " -e $opt_e";
+}
+if ( $opt_s ) {
+    $args_check_http .= " -s $opt_s";
+}
+if ( $opt_u ) {
+    $args_check_http .= " -u $opt_u";
+}
+if ( $opt_p ) {
+    $args_check_http .= " -p $opt_p";
+}
+if ( $opt_P ) {
+    $args_check_http .= " -P $opt_P";
+}
+if ( $opt_I ) {
+    $args_check_http .= " -I $opt_I";
+}
+if ( $opt_e ) {
+    $args_check_http .= " -e $opt_e";
+}
+if ( $opt_w ) {
+    $args_check_http .= " -w $opt_w";
+}
+if ( $opt_c ) {
+    $args_check_http .= " -c $opt_c";
+}
+if ( $opt_t ) {
+    $args_check_http .= " -t $opt_t";
+}
+if ( $opt_a ) {
+    $args_check_http .= " -a $opt_a";
+}
+if ( $opt_L ) {
+    $args_check_http .= " -L $opt_L";
+}
+if ( $opt_f ) {
+    $args_check_http .= " -f $opt_f";
+}
+if ( $opt_l ) {
+    $args_check_http .= " -l $opt_l";
+}
+if ( $opt_r ) {
+    $args_check_http .= " -r $opt_r";
+}
+if ( $opt_R ) {
+    $args_check_http .= " -R $opt_R";
+}
+if ( $opt_C ) {
+    $args_check_http .= " -C $opt_C";
+}
+if ( $opt_z ) {
+    $args_check_http .= " --ssl";
+}
+
+
+my $rrd = $pathtorrdbase.$ServiceId.".rrd";
+
+my $start=time;
+my $name = $0;
+$name =~ s/\.pl.*//g;
+
+##
+## RRDTools create rrd
+##
+if ($opt_g) {
+	if (! -e $rrd) {
+        create_rrd ($rrd,1,$start,$step,"U","U","GAUGE");
+	}
+}
+##
+## Plugin requests
+##
+# print "args: $args_check_http \n";
+my $result = `$pathtolibexechttp $args_check_http`;
+my $return_code = $? / 256;
+
+$_ = $result;
+m/time=\s*(\d*\.\d*)/;
+my $time = $1;
+
+##
+## RRDtools update
+##
+if ($opt_g && $time ) {
+    $start=time;
+    update_rrd ($rrd,$start,$time);
+}
+
+print "$result";
+exit $return_code;
+
+##
+## Plugin return code
+##
+sub print_usage () {
+    my $screen = `$pathtolibexechttp -h`;
+    $screen =~ s/check_http/check_graph_http/g;
+    $screen =~ s/-S/-Z/;
+    print $screen;
+}
+
+sub print_help () {
+    print "Copyright (c) 2005 LINAGORA SA\n";
+    print "Bugs to http://www.linagora.com/\n";
+    print "\n";
+    print_usage();
+    print "\n";
+}
diff --git a/plugins/src/check_graph_load_average.pl b/plugins/src/check_graph_load_average.pl
new file mode 100644
index 0000000000000000000000000000000000000000..a17014e29e348a08cd9c76c48b13113b3b6146d7
--- /dev/null
+++ b/plugins/src/check_graph_load_average.pl
@@ -0,0 +1,185 @@
+#! /usr/bin/perl -w
+#
+# $Id: check_graph_load_average.pl,v 1.2 2005/07/27 22:21:49 wistof Exp $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Developped by : Julien Mathis - Romain Le Merlus
+#
+# Modified for Oreon Project by : Mathieu Chateau - Christophe Coraboeuf
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+##
+## Plugin init
+##
+use strict;
+use Net::SNMP qw(:snmp);
+use FindBin;
+use lib "$FindBin::Bin";
+#use lib "@NAGIOS_PLUGINS@";
+use lib "/usr/local/nagios/libexec/";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+if (eval "require oreon" ) {
+	use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+	use vars qw($VERSION %oreon);
+	%oreon=get_parameters();
+} else {
+	print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+use vars qw($PROGNAME);
+use Getopt::Long;
+use vars qw($opt_V $opt_h $opt_g $opt_v $opt_C $opt_H $opt_D $opt_S $opt_step $step $snmp $opt_f);
+
+
+##
+## Plugin var init
+##
+my($return_code);
+
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+
+$PROGNAME = "check_graph_load_average";
+sub print_help ();
+sub print_usage ();
+
+Getopt::Long::Configure('bundling');
+GetOptions
+    ("h"   => \$opt_h, "help"         => \$opt_h,
+     "V"   => \$opt_V, "version"      => \$opt_V,
+     "g"   => \$opt_g, "rrdgraph"     => \$opt_g,
+     "rrd_step=s" => \$opt_step,
+     "v=s" => \$opt_v, "snmp=s"       => \$opt_v,
+     "C=s" => \$opt_C, "community=s"  => \$opt_C,
+     "S=s" => \$opt_S, "ServiceId=s"  => \$opt_S,
+     "H=s" => \$opt_H, "hostname=s"   => \$opt_H, 
+     "f" => \$opt_f);
+
+if ($opt_V) {
+    print_revision($PROGNAME,'$Revision: 1.2 $');
+    exit $ERRORS{'OK'};
+}
+
+if ($opt_h) {
+    print_help();
+    exit $ERRORS{'OK'};
+}
+
+$opt_H = shift unless ($opt_H);
+(print_usage() && exit $ERRORS{'OK'}) unless ($opt_H);
+
+($opt_S) || ($opt_S = shift) || ($opt_S = "1_1");
+my $ServiceId = is_valid_serviceid($opt_S);
+
+($opt_v) || ($opt_v = shift) || ($opt_v = "2");
+$snmp = $1 if ($opt_v =~ /(\d)/);
+
+($opt_C) || ($opt_C = shift) || ($opt_C = "public");
+
+($opt_step) || ($opt_step = shift) || ($opt_step = "300");
+$step = $1 if ($opt_step =~ /(\d+)/);
+
+my $rrd = $pathtorrdbase.$ServiceId.".rrd";
+
+my $start=time;
+my $name = $0;
+$name =~ s/\.pl.*//g;
+
+##
+## RRDTools create rrd
+##
+if ($opt_g) {
+    if (! -e $rrd) {
+          	create_rrd ($rrd,3,$start,$step,"U","U","GAUGE");
+    }
+}
+
+##
+## Plugin snmp requests
+##
+$return_code = 0;
+
+my $OID_CPULOAD_1 =$oreon{UNIX}{CPU_LOAD_1M};
+my $OID_CPULOAD_5 =$oreon{UNIX}{CPU_LOAD_5M};
+my $OID_CPULOAD_15 =$oreon{UNIX}{CPU_LOAD_15M};
+
+my ( $session, $error ) = Net::SNMP->session(-hostname  => $opt_H,-community => $opt_C, -version  => $snmp);
+if ( !defined($session) ) {
+    print("UNKNOWN: $error");
+    exit $ERRORS{'UNKNOWN'};
+}
+
+my $result = $session->get_request(
+                                -varbindlist => [$OID_CPULOAD_1, $OID_CPULOAD_5, $OID_CPULOAD_15 ]
+                                   );
+if (!defined($result)) {
+    printf("UNKNOWN: %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{'UNKNOWN'};
+}
+
+my $un =  $result->{$OID_CPULOAD_1};
+my $cinq  =  $result->{$OID_CPULOAD_5};
+my $quinze  =  $result->{$OID_CPULOAD_15};
+
+##
+## RRDtools update
+##
+if ($opt_g && ( $return_code == 0) ) {
+    $start=time;
+    update_rrd ($rrd,$start,$un,$cinq,$quinze);
+}
+
+##
+## Plugin return code
+##
+
+my $PERFPARSE = "";
+
+if ($return_code == 0){
+    if ($opt_f){
+		$PERFPARSE = "|load1=".$un."%;;;0;100 load5=".$cinq."%;;;0;100 load15=".$quinze."%;;;0;100";
+    }
+    print "load average: $un, $cinq, $quinze".$PERFPARSE."\n";
+    exit $ERRORS{'OK'};
+} else {
+    print "Load Average CRITICAL\n";
+    exit $ERRORS{'CRITICAL'};
+}
+
+sub print_usage () {
+    print "\nUsage:\n";
+    print "$PROGNAME\n";
+    print "   -H (--hostname)   Hostname to query - (required)\n";
+    print "   -C (--community)  SNMP read community (defaults to public,\n";
+    print "                     used with SNMP v1 and v2c\n";
+    print "   -v (--snmp_version)  1 for SNMP v1 (default)\n";
+    print "                        2 for SNMP v2c\n";
+    print "   -g (--rrdgraph)   create  � rrd base and add datas into this one\n";
+    print "   --rrd_step	    Specifies the base interval in seconds with which data will be fed into the RRD (300 by default)\n";
+    print "   -D (--directory)  Path to rrdatabase (or create the .rrd in this directory)\n";
+    print "                     by default: ".$pathtorrdbase."\n";
+    print "                     (The path is valid with spaces '/my\ path/...')\n";
+    print "   -S (--ServiceId)  Oreon Service Id\n";
+    print "   -V (--version)    Plugin version\n";
+    print "   -h (--help)       usage help\n";
+    print "   -f                Perfparse Compatible\n";
+}
+
+sub print_help () {
+    print "Copyright (c) 2004-2005 OREON\n";
+    print "Bugs to http://bugs.oreon-project.org/\n";
+    print "\n";
+    print_usage();
+    print "\n";
+}
diff --git a/plugins/src/check_graph_nt.pl b/plugins/src/check_graph_nt.pl
new file mode 100644
index 0000000000000000000000000000000000000000..aad8fd5c6aa97bbe1a56670158c87b6785798488
--- /dev/null
+++ b/plugins/src/check_graph_nt.pl
@@ -0,0 +1,400 @@
+#! /usr/bin/perl -w
+#
+# $Id: check_graph_nt.pl,v 1.3 2005/08/01 18:04:00 gollum123 Exp $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Developped by : Julien Mathis - Mathieu Mettre
+# Under control of Flavien Astraud, Jerome Landrieu for Epitech.
+# Oreon's plugins are developped in partnership with Linagora company.
+#
+# Modified for Oreon Project by : Mathieu Chateau - Christophe Coraboeuf
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+##
+## Plugin init
+##
+use strict;
+use FindBin;
+use lib "$FindBin::Bin";
+use lib "@NAGIOS_PLUGINS@";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+
+if (eval "require oreon" ) {
+	use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+	use vars qw($VERSION %oreon);
+	%oreon=get_parameters();
+} else {
+	print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+use vars qw($PROGNAME);
+use Getopt::Long;
+use vars qw($opt_H $opt_p $opt_s $opt_v $opt_V $opt_h $opt_w $opt_c $opt_S $opt_g $opt_t $opt_l $opt_d $opt_D $opt_step $step $opt_f);
+
+##
+## Plugin var init
+##
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+my $pathtolibexecnt = $oreon{GLOBAL}{NAGIOS_LIBEXEC}."check_nt";
+
+my($op_v, $op_d, $op_s, $op_t, $op_l, $port, @values,  @test, @test2, @test3, @test4, @test5, $warning, $critical, @w, @c, $uptime);
+my($warning2, $critical2, $warning3, $critical3, $warning4, $critical4, @output);
+$PROGNAME = "check_graph_nt";
+sub print_help ();
+sub print_usage ();
+
+Getopt::Long::Configure('bundling');
+GetOptions
+    ("h"   => \$opt_h, "help"         => \$opt_h,
+     "p=s" => \$opt_p, "port=s"       => \$opt_p,
+     "V"   => \$opt_V, "version"      => \$opt_V,
+     "g"   => \$opt_g, "rrdgraph"     => \$opt_g,
+     "rrd_step=s" => \$opt_step,
+     "s=s" => \$opt_s, "password=s"   => \$opt_s,
+     "d=s" => \$opt_d, "showall=s"    => \$opt_d,
+     "v=s" => \$opt_v, "variable=s"   => \$opt_v,
+     "D=s" => \$opt_D, "directory=s"  => \$opt_D,
+     "t=s" => \$opt_t, "timeout=s"    => \$opt_t,
+     "l:s" => \$opt_l, "parameter:s"  => \$opt_l,
+     "w=s" => \$opt_w, "warning=s"    => \$opt_w,
+     "c=s" => \$opt_c, "critical=s"   => \$opt_c,
+     "S=s" => \$opt_S, "ServiceId=s"  => \$opt_S,
+     "H=s" => \$opt_H, "hostname=s"   => \$opt_H);
+
+if ($opt_h) {
+    print_help();
+    exit $ERRORS{'OK'};
+}
+
+if ($opt_V) {
+    $_ = `$pathtolibexecnt -V`;
+    print "$_";
+    exit $ERRORS{'OK'};
+}
+
+if ($opt_p) {
+  if ($opt_p =~ /([0-9]+)/){
+    $port = $1;
+  }
+  else{
+    print "Unknown -p number expected... or it doesn't exist, try another port - number\n";
+    exit $ERRORS{'UNKNOWN'};
+  }
+}
+
+$opt_H = shift unless ($opt_H);
+(print_usage() && exit $ERRORS{'OK'}) unless ($opt_H);
+
+
+if ($opt_c) {
+  ($opt_c) || ($opt_c = shift);
+  $critical = $1 if ($opt_c =~ /([0-9]+)/);
+}
+
+if ($opt_w) {
+  ($opt_w) || ($opt_w = shift);
+  $warning = $1 if ($opt_w =~ /([0-9]+)/);
+}
+
+if (($critical && $warning) && ($critical <= $warning)) {
+    print "(--crit) must be superior to (--warn)";
+    print_usage();
+    exit $ERRORS{'OK'};
+}
+
+
+if ($opt_t) {
+  ($opt_t) || ($opt_t = shift);
+  $op_t = $1 if ($opt_t =~ /([-\.,\w]+)/);
+}
+
+if ($opt_l) {
+  ($opt_l) || ($opt_l = shift);
+   $op_l = $1 if ($opt_l =~ /(.+)/);
+}
+
+if ($opt_s) {
+  ($opt_s) || ($opt_s = shift);
+  $op_s = $1 if ($opt_s =~ /([-.,A-Za-z0-9]+)/);
+}
+
+if ($opt_d) {
+  ($opt_d) || ($opt_d = shift);
+  $op_d = $1 if ($opt_d =~ /([-.,A-Za-z0-9]+)/);
+}
+
+if ($opt_v) {
+  ($opt_v) || ($opt_v = shift);
+  $op_v = $1 if ($opt_v =~ /([-.,A-Za-z0-9]+)/);
+}
+
+($opt_step) || ($opt_step = shift) || ($opt_step = 300);
+$step = $1 if ($opt_step =~ /(\d+)/);
+
+($opt_S) || ($opt_S = shift) || ($opt_S = "1_1");
+my $ServiceId = is_valid_serviceid($opt_S);
+
+##
+## RRDTool var init
+##
+
+my $rrd = $pathtorrdbase.$ServiceId.".rrd";
+my $name = $0;
+$name =~ s/\.pl.*//g;
+my $return_code;
+##
+## Plugin requests
+##
+my $start=time;
+if ($op_v) {
+    if ($op_v) {$op_v = "-v ".$op_v;}
+    if ($port) {$port = "-p ".$port;} else { $port = " ";}
+    if ($warning) {$warning = "-w ".$warning;} else { $warning = " ";}
+    if ($critical) {$critical = "-c ".$critical;} else { $critical = " ";}
+    if ($op_l) {$op_l = "-l \"".$op_l ."\"";} else { $op_l = " ";}
+    if ($op_t) {$op_t = "-t ".$op_t;} else { $op_t = " ";}
+    if ($op_s) {$op_s = "-s ".$op_s;} else { $op_s = " ";}
+    if ($op_d) {$op_d = "-d ".$op_d;} else { $op_d = " ";}
+#   print "$pathtolibexecnt -H $opt_H $op_v $port $warning $critical $op_l $op_t $op_s $op_d\n";
+    $_ = `$pathtolibexecnt -H $opt_H $op_v $port $warning $critical $op_l $op_t $op_s $op_d 2>/dev/null`;
+    my $return = $_;
+    $return =~ s/\\//g;
+    $return_code = $? / 256;
+
+    ##
+    ## CLIENTVERSION
+    ##
+    if ($op_v =~ /CLIENTVERSION/){
+        print "CLIENTVERSION impossible to Graph!\n";
+        exit $ERRORS{'UNKNOWN'};
+    }
+    
+    if (($op_v =~ /CPULOAD/) && ($op_l =~ /([-\.,\w]+)/)){    ## CPULOAD
+	@output = split(/\|/,$_);
+        @values = $output[0] =~ /(\d*)\%/g  ;
+        $start=time;
+        if ($opt_g)  {
+            unless (-e $rrd) {
+		create_rrd ($rrd,$#values +1,$start,$step,"U","U","GAUGE");
+            }
+	    update_rrd ($rrd,$start,@values);
+        }
+        ## Print Plugins Output
+        $return =~ s/\n/ /g;
+        if (@values){
+	    if (defined($opt_c) && defined($opt_w)){
+		print $return . "|cpu=@values;$opt_w;$opt_c\n";
+	    } else {
+		print $return . "|cpu=@values\n";
+	    }
+	} else {
+	    print $return . "\n";
+	}
+        exit $return_code;
+    } elsif ($op_v =~ /UPTIME/){		## UPTIME
+        if ($_ =~ /.*[-:]+\s(\d+)\s.*$/ ) {
+            $uptime = $1;
+        } else {
+            print "unable to parse check_nt output: $_\n" ;
+            exit $ERRORS{'UNKNOWN'};
+        }
+        if ($opt_g) {
+        	if (! -e $rrd) {
+          		create_rrd ($rrd,1,$start,$step,"U","U","GAUGE");
+			} else {
+                update_rrd ($rrd,$start,$uptime);
+         	}
+        }
+        $_ =~ s/\n/ /g;
+        if (defined($uptime)){
+	        print $_ . "|uptime=".$uptime."d\n";
+    	} else {
+    	    print $_ . "\n";
+    	}
+        exit $return_code;
+    } elsif (($op_v =~ /USEDDISKSPACE/) && ($op_l =~ /([-\.,\w]+)/)){	## USEDDISKSPACE
+        my @test = split(/ /,$_);
+        if (defined($test[9]) && defined($test2[1])){
+	        @test2 = split(/\(/, $test[9]);
+    	    @test3 = split(/\%/, $test2[1]);
+        }
+        @c = split(/ /, $critical);
+        $critical = $c[1];
+        @w = split(/ /, $warning);
+        $warning = $w[1];
+        if ($opt_g) {
+            unless (-e $rrd) {
+            	create_rrd ($rrd,3,$start,$step,"U","U","GAUGE");
+            }
+        	$test[3] =~ s/,/\./ ;
+        	$test[7] =~ s/,/\./ ;
+        	$test[12] =~ s/,/\./ ;
+        	update_rrd ($rrd,$start,$test[3],$test[7],$test[12]);
+        }
+        ## Print Plugins Output
+        $return =~ s/\n/ /g;
+        $return =~ s/%/ pct/g;
+        if (defined($test[3]) && defined($test[7]) && defined($test[12])){
+	        print $return . "|total=".$test[3]."Mo used=".$test[7]."Mo free=".$test[12]."Mo\n";
+		} else {
+			print $return . "\n";
+		}
+		exit $return_code;
+    } elsif ($op_v =~ /MEMUSE/){    ## MEMUSE
+        $start=time;
+        my @test = split(/ /,$_);
+        if (defined($test[2])){
+        	@test4 = split(/:/, $test[2]);
+        }
+        @c = split(/ /, $critical);
+        $critical = $c[1];
+        @w = split(/ /, $warning);
+        $warning = $w[1];
+        if ($opt_g) {
+        	unless (-e $rrd) {
+            	create_rrd ($rrd,3,$start,$step,"U","U","GAUGE");
+            }
+            # Replace , by . to convert in real float number (for rrdtool)
+            $test4[1] =~ s/,/\./ ;
+            $test[6] =~ s/,/\./ ;
+            $test[11] =~ s/,/\./ ;
+            update_rrd ($rrd,$start,$test4[1],$test[6],$test[11]);
+        }
+        ## Print Plugins Output
+        $return =~ s/\n/ /g;
+        $return =~ s/%/ pct/g;
+        if ($test4[1] && $test[6] && $test[11]){
+	        print $return . "|total=".$test4[1]." used=".$test[6]." free=".$test[11]."\n";
+        } else {
+        	print $return . "\n";
+        }
+        exit $return_code;
+    } elsif ($op_v =~ /SERVICESTATE/){## SERVICESTATE
+       	my (@tab, $process, $nom, $etat);
+       	@tab = split (' - ',$_);
+       	foreach $process (@tab) {
+       		($nom,$etat) = split (': ', $process);
+            if (defined($etat)) {
+               	$etat =~ s/\n//;
+            } else {
+               	$etat = "Unknow";
+            }
+            if ($etat =~ /Started/)
+              	{$etat=1;}
+            elsif ($etat =~ /Stopped/)
+               	{$etat=0;}
+            elsif ($etat =~ /Unknown/)
+               	{$etat=-1;}
+            else {
+               	print "Unable to get $nom status [$etat]: \n\t$_\n";
+                exit $ERRORS{'UNKNOWN'};
+            }
+        }
+        if ($opt_g) {
+        	if (! -e $rrd) {
+            	create_rrd ($rrd,1,$start,$step,"U","U","GAUGE");
+            } else {
+                update_rrd ($rrd,$start,$etat);
+            }
+        }
+        $return =~ s/%/ pct/g;
+        print $return;
+        exit $return_code;
+    } elsif ($op_v =~ /PROCSTATE/){## PROCSTATE
+        print "PROCSTATE not graphed\n";
+        exit $ERRORS{'UNKNOWN'};
+    } elsif (($op_v =~ /COUNTER/) && ($op_l =~ /(.+)/))  {    ## COUNTER
+		@output = split(/\|/,$_);
+        @values = $output[0] =~ /([,\.\d]*)\s?\%/  ;
+        if (!@values) {@values = $output[0] =~ /([\d]*)/;}
+        $start=time;
+        if ($opt_g)  {
+            unless (-e $rrd) {
+	            create_rrd ($rrd,$#values +1,$start,$step,"U","U","GAUGE");
+            }
+        	update_rrd ($rrd,$start,@values);
+        }
+        ## Print Plugins Output
+        $return =~ s/\n/ /g;
+        $return =~ s/%/ pct/g;
+        print $return . "|counter=".@values."\n";
+        exit $return_code;
+    }
+} else {
+	print "Could not parse arguments\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+##
+## Plugin return code
+##
+
+sub print_usage () {
+    print "\nUsage:\n";
+    print "$PROGNAME\n";
+    print "   Usage: check_graph_nt -H host -v variable [-p port] [-s password] [-w warning] [-c critical] [-l params] [-d SHOWALL] [-t timeout] [-D rrd directory] -g -S ServiceID\n";
+    print "   Options:\n";
+    print "   -H, --hostname=HOST\n";
+    print "      Name of the host to check\n";
+    print "   -p, --port=INTEGER\n";
+    print "      Optional port number (default: 1248)\n";
+    print "   -s <password>\n";
+    print "      Password needed for the request\n";
+    print "   -v, --variable=STRING\n";
+    print "      Variable to check.  Valid variables are:\n";
+    print "         CLIENTVERSION = Not Graphed. Get the NSClient version\n";
+    print "         CPULOAD = Average CPU load on last x minutes. Request a -l parameter with the following syntax:\n";
+    print "           -l <minutes range>,<warning threshold>,<critical threshold>. <minute range> should be less than 24*60.\n";
+    print "          Thresholds are percentage and up to 10 requests can be done in one shot. ie: -l 60,90,95,120,90,95\n";
+    print "          and 4 requests can be graphed.\n";
+    print "         UPTIME = Only Days are graphed. Get the uptime of the machine. No specific parameters. No warning or critical threshold.\n";
+    print "         USEDDISKSPACE = Size and percentage of disk use. Request a -l parameter containing the drive letter only.\n";
+    print "                         Warning and critical thresholds can be specified with -w and -c.\n";
+    print "         MEMUSE = Memory use. Warning and critical thresholds can be specified with -w and -c.\n";
+    print "         SERVICESTATE = Check and graph the state of one service. Request a -l parameters with the following syntax:\n";
+    print "           -l <service1>... You MUST specify -d SHOWALL in the input command.\n";
+    print "           1: Service Started - 0: Service Stopped - -1: Service Unknown.\n";
+#    print "         SERVICESTATE = Not Graphed. Check the state of one or several services. Request a -l parameters with the following syntax:\n";
+#    print "           -l <service1>,<service2>,<service3>,... You can specify -d SHOWALL in case you want to see working services\n";
+#    print "           in the returned string.\n";
+    print "         PROCSTATE = Not Graphed. Check if one or several process are running. Same syntax as SERVICESTATE.\n";
+    print "         COUNTER = Check any performance counter of Windows NT/2000. Request a -l parameters with the following syntax:\n";
+    print "           -l \"<performance object>counter\",\"<description>\"  The <description> parameter is optional and\n";
+    print "           is given to a printf output command which require a float parameters. Some examples:\n";
+    print "             \"Paging file usage is %.2f %%\" or \"%.f %% paging file used.\"\n";
+    print "    -w, --warning=INTEGER\n";
+    print "      Threshold which will result in a warning status\n";
+    print "    -c, --critical=INTEGER\n";
+    print "      Threshold which will result in a critical status\n";
+    print "    -t, --timeout=INTEGER\n";
+    print "      Seconds before connection attempt times out (default: 10)\n";
+    print "   -h, --help\n";
+    print "      Print this help screen\n";
+    print "   -V, --version\n";
+    print "      Print version information\n";
+    print "   -g (--rrdgraph)   create  � rrd base and add datas into this one\n";
+    print "   --rrd_step	    Specifies the base interval in seconds with which data will be fed into the RRD (300 by default)\n";
+    print "   -D (--directory)  Path to rrdatabase (or create the .rrd in this directory)\n";
+    print "                     by default: ".$pathtorrdbase."\n";
+    print "                     (The path is valid with spaces '/my\ path/...')\n";
+    print "   -S (--ServiceId)  Oreon Service Id\n";
+}
+
+sub print_help () {
+    print "Copyright (c) 2004 OREON\n";
+    print "Bugs to http://www.oreon.org/\n";
+    print "\n";
+    print_usage();
+    print "\n";
+}
diff --git a/plugins/src/check_graph_ping.pl b/plugins/src/check_graph_ping.pl
new file mode 100644
index 0000000000000000000000000000000000000000..a6c0d9b2df8ec54c1b007925b8badb90d0ccd686
--- /dev/null
+++ b/plugins/src/check_graph_ping.pl
@@ -0,0 +1,215 @@
+#! /usr/bin/perl -w
+#
+# $Id: check_graph_ping.pl,v 1.2 2006/04/28 10:21:49 Julien Mathis $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Developped by : Julien Mathis - Mathieu Mettre - Romain Le Merlus 
+#
+# Modified for Oreon Project by : Mathieu Chateau - Christophe Coraboeuf
+# Modified By Julien Mathis For Merethis Company
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+#
+# Plugin init
+#
+
+use strict;
+use FindBin;
+use lib "$FindBin::Bin";
+use lib "@NAGIOS_PLUGINS@";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+if (eval "require oreon" ) {
+	use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+	use vars qw($VERSION %oreon);
+	%oreon=get_parameters();
+} else {
+	print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+use vars qw($PROGNAME);
+use Getopt::Long;
+use vars qw($opt_V $opt_h $opt_g $opt_H $opt_D $opt_w $opt_c $opt_n $opt_f $opt_S $rta_critical $rta_warning $pl_critical $pl_warning $opt_s $opt_step $step );
+
+#
+# Plugin var init
+#
+
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+
+my $ping = `whereis -b ping`;
+$ping =~ /^.*:\s(.*)$/;
+$ping = $1;
+
+$PROGNAME = "check_graph_ping";
+sub print_help ();
+sub print_usage ();
+
+Getopt::Long::Configure('bundling');
+GetOptions
+    ("h" => \$opt_h,		"help" => \$opt_h,
+     "V" => \$opt_V,		"version" => \$opt_V,
+     "rrd_step=s" => \$opt_step,"f" => \$opt_f,
+     "g" => \$opt_g,		"rrdgraph" => \$opt_g,
+     "w=s" => \$opt_w,		"warning=s" => \$opt_w,
+     "c=s" => \$opt_c,		"critical=s" => \$opt_c,
+     "n=s" => \$opt_n,		"number=s" => \$opt_n,
+     "S=s" => \$opt_S,		"ServiceId=s" => \$opt_S,
+     "H=s" => \$opt_H,		"hostname=s" => \$opt_H);
+
+if ($opt_V) {
+    print_revision($PROGNAME,'$Revision: 1.2 $');
+    exit $ERRORS{'OK'};
+}
+
+if ($opt_h) {
+    print_help();
+    exit $ERRORS{'OK'};
+}
+
+$opt_H = shift unless ($opt_H);
+(print_usage() && exit $ERRORS{'OK'}) unless ($opt_H);
+
+($opt_c) || ($opt_c = shift) || ($opt_c = "500,40%");
+if ($opt_c =~ /([0-9]+),([0-9]+)%/) {
+    $rta_critical = $1;
+    $pl_critical = $2;
+}
+
+($opt_w) || ($opt_w = shift) || ($opt_w = "200,20%");
+if ($opt_w =~ /([0-9]+),([0-9]+)%/) {
+    $rta_warning = $1;
+    $pl_warning = $2;
+}
+
+if ( ($rta_critical <= $rta_warning) || ($pl_critical <= $pl_warning) ) {
+    print "critical must be superior to warning\n";
+    print_usage();
+    exit $ERRORS{'OK'};
+}
+
+($opt_n) || ($opt_n = shift) || ($opt_n = 1);
+my $NbPing;
+if ($opt_n =~ /([0-9]+)/){
+    $NbPing = $1;
+} else{
+    print "Unknown ping number\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+($opt_S) || ($opt_S = shift) || ($opt_S = 1);
+my $rrd = $pathtorrdbase.is_valid_serviceid($opt_S).".rrd";
+
+
+($opt_step) || ($opt_step = shift) || ($opt_step = "300");
+$step = $1 if ($opt_step =~ /(\d+)/);
+
+
+my $start=time;
+
+#
+# RRDTools create rrd
+#
+
+if ($opt_g) {
+    create_rrd($rrd,1,$start,$step,0,"U","GAUGE") if (! -e $rrd);}
+
+#
+# Plugin requests
+#
+
+$_ = `$ping -n -c $NbPing $opt_H 2>/dev/null`;
+my $return = $? / 256;
+
+#
+# Get Data From Ping Result
+#
+
+my $ping_result = $_;
+my @ping_result_array = split(/\n/,$ping_result);
+my @ping_subresult1_array;
+my @ping_subresult2_array;
+my $rta = 0;
+my $pl;
+my $time_answer;
+
+if( ( $return != 0 ) || $ping_result_array[@ping_result_array -2 ] =~ /100% packet loss/) {
+    $rta = -1;
+    $time_answer = 0;
+} else {
+    @ping_subresult1_array = split(/=/,$ping_result_array[@ping_result_array -1 ]);
+    @ping_subresult2_array = split(/,/,$ping_result_array[@ping_result_array -2 ]);
+    @ping_subresult1_array = split(/\//,$ping_subresult1_array[1]);
+    @ping_subresult2_array = split(/ /,$ping_subresult2_array[2]);
+    $rta = $ping_subresult1_array[1];
+    $pl = $ping_subresult2_array[1];
+    $time_answer = $ping_subresult1_array[1];
+    $pl =~ /([0-9]+)\%/;
+    $pl = $1;
+}
+
+#
+# Update RRDTool Database.
+#
+
+update_rrd($rrd,$start,$rta) if ($opt_g);
+
+#
+# Plugin return code
+#
+
+my $result_str = "";
+
+if( $rta == -1 ) {
+    $ping_result_array[@ping_result_array -2 ] =~ s/\%/percent/g; 
+    print "GPING CRITICAL - ".$ping_result_array[@ping_result_array -2 ]."|time=0 ok=0\n";
+    exit $ERRORS{'CRITICAL'};
+} elsif ( ($pl >= $pl_critical) || ($rta >= $rta_critical) ) {
+    $ping_result_array[@ping_result_array -1 ] =~ s/\%/percent/g;
+    my @tab = split(/,/,$ping_result_array[@ping_result_array -1 ]);
+    print "GPING CRITICAL - ". $tab[1] ."|time=".$time_answer."ms;$pl_warning;$pl_critical;; ok=1\n";
+    exit $ERRORS{'CRITICAL'};
+} elsif ( ($pl >= $pl_warning) || ($rta >= $rta_warning) ) {
+    $ping_result_array[@ping_result_array -1 ] =~ s/\%/percent/g;
+    my @tab = split(/,/,$ping_result_array[@ping_result_array -1 ]);
+    print "GPING WARNING - ".$tab[0]."|time=".$time_answer."ms;$pl_warning;$pl_critical;; ok=1\n";
+    exit $ERRORS{'WARNING'};
+} else {
+    $ping_result_array[@ping_result_array -1 ] =~ s/\%/percent/g;
+    my @tab = split(/,/,$ping_result_array[@ping_result_array -1 ]);
+    print "GPING OK - ".$tab[0]."|time=".$time_answer."ms;$pl_warning;$pl_critical;; ok=1\n";
+    exit $ERRORS{'OK'};
+}
+
+sub print_usage () {
+    print "Usage:\n";
+    print "$PROGNAME\n";
+    print "   -H (--hostname)   Hostname to query (Required)\n";
+    print "   -g (--rrdgraph)   Create a rrd base if necessary and add datas into this one\n";
+    print "   --rrd_step	Specifies the base interval in seconds with which data will be fed into the RRD (300 by default)\n";
+    print "   -S (--ServiceId)  Oreon Service Id\n";
+    print "   -w (--warning)    Threshold pair (Default: 200,20%)\n";
+    print "   -c (--critical)   Threshold pair (Default: 500,40%)\n";
+    print "   -n (--number)     number of ICMP ECHO packets to send (Default: 1)\n";
+    print "   -V (--version)    Plugin version\n";
+    print "   -h (--help)       usage help\n";
+}
+
+sub print_help () {
+    print "######################################################\n";
+    print "#      Copyright (c) 2004-2006 Oreon-project         #\n";
+	print "#      Bugs to http://www.oreon-project.org/         #\n";
+	print "######################################################\n";
+    print_usage();
+    print "\n";
+}
diff --git a/plugins/src/check_graph_process.pl b/plugins/src/check_graph_process.pl
new file mode 100644
index 0000000000000000000000000000000000000000..cc65ea0008923b02a6f53b60ad00a5af3ed17eea
--- /dev/null
+++ b/plugins/src/check_graph_process.pl
@@ -0,0 +1,232 @@
+#! /usr/bin/perl -w
+#
+# $Id: check_graph_process.pl,v 1.2 2005/07/27 22:21:49 wistof Exp $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Developped by : Julien Mathis - Mathieu Mettre - Romain Le Merlus
+#
+# Modified for Oreon Project by : Mathieu Chateau - Christophe Coraboeuf
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+##
+## Plugin init
+##
+use strict;
+use Net::SNMP qw(:snmp oid_lex_sort);
+use FindBin;
+use lib "$FindBin::Bin";
+use lib "@NAGIOS_PLUGINS@";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+if (eval "require oreon" ) {
+	use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+	use vars qw($VERSION %oreon);
+	%oreon=get_parameters();
+} else {
+	print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+use vars qw($PROGNAME);
+use Getopt::Long;
+use vars qw($opt_V $opt_h $opt_g $opt_v $opt_C $opt_p $opt_H $opt_D $opt_n $opt_S $opt_step $step $result @result %process_list %STATUS $opt_f);
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+
+##
+## Plugin var init
+##
+
+my($proc, $proc_run);
+
+$PROGNAME = "check_graph_process";
+sub print_help ();
+sub print_usage ();
+
+
+%STATUS=(1=>'running',2=>'runnable',3=>'notRunnable',4=>'invalid');
+
+Getopt::Long::Configure('bundling');
+GetOptions
+    ("h"   => \$opt_h, "help"         => \$opt_h,
+     "V"   => \$opt_V, "version"      => \$opt_V,
+     "g"   => \$opt_g, "rrdgraph"     => \$opt_g,
+     "rrd_step=s" => \$opt_step, "f"  => \$opt_f,
+     "n"   => \$opt_n, "number"       => \$opt_n,
+     "v=s" => \$opt_v, "snmp=s"       => \$opt_v,
+     "C=s" => \$opt_C, "community=s"  => \$opt_C,
+     "p=s" => \$opt_p, "process=s"    => \$opt_p,
+     "S=s" => \$opt_S, "ServiceId=s"  => \$opt_S,
+     "H=s" => \$opt_H, "hostname=s"   => \$opt_H);
+
+if ($opt_V) {
+    print_revision($PROGNAME,'$Revision: 1.2 $');
+    exit $ERRORS{'OK'};
+}
+
+if ($opt_h) {
+    print_help();
+    exit $ERRORS{'OK'};
+}
+
+$opt_H = shift unless ($opt_H);
+(print_usage() && exit $ERRORS{'OK'}) unless ($opt_H);
+
+($opt_v) || ($opt_v = shift) || ($opt_v = "1");
+my $snmp = $1 if ($opt_v =~ /(\d)/);
+
+($opt_S) || ($opt_S = shift) || ($opt_S = 1);
+my $ServiceId = is_valid_serviceid($opt_S);
+
+($opt_C) || ($opt_C = shift) || ($opt_C = "public");
+
+my $process = "";
+if ($opt_p){
+    $process = $1 if ($opt_p =~ /([-.A-Za-z0-9]+)/);
+} 
+
+($opt_step) || ($opt_step = shift) || ($opt_step = "300");
+$step = $1 if ($opt_step =~ /(\d+)/);
+
+
+my $rrd = $pathtorrdbase.$ServiceId.".rrd";
+my $start=time;
+my $name = $0;
+$name =~ s/\.pl.*//g;
+
+##
+## RRDTools create rrd
+##
+
+if ( $opt_g && $opt_n && (! -e $rrd))   {
+    create_rrd ($rrd,1,$start,$step,"U","U","GAUGE");
+}
+
+##
+## Plugin snmp requests
+##
+my $OID_SW_RunName = $oreon{MIB2}{SW_RUNNAME};
+my $OID_SW_RunIndex =$oreon{MIB2}{SW_RUNINDEX};
+my $OID_SW_RunStatus =$oreon{MIB2}{SW_RUNSTATUS};
+
+my ( $session, $error ) = Net::SNMP->session(-hostname  => $opt_H,-community => $opt_C, -version  => $snmp);
+if ( !defined($session) ) {
+    print("UNKNOWN: $error");
+    exit $ERRORS{'UNKNOWN'};
+}
+
+$result = $session->get_table(Baseoid => $OID_SW_RunName);
+if (!defined($result)) {
+    printf("UNKNOWN: %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{'UNKNOWN'};
+}
+
+$proc = 0;
+foreach my $key (oid_lex_sort(keys %$result)) {
+    my @oid_list = split (/\./,$key);
+    $process_list{$$result{$key}} =  pop (@oid_list) ;
+    if (defined($opt_p) && $opt_p ne ""){
+	if ($$result{$key} eq $opt_p){
+	    $proc++;
+	}
+    } else {
+	$proc++;
+    }
+}
+
+
+
+if (!($opt_n))
+{
+    if ($process_list{$process}) {
+        $result = $session->get_request(-varbindlist => [$OID_SW_RunStatus . "." . $process_list{$process}]);
+        if (!defined($result)) {
+            printf("UNKNOWN: %s.\n", $session->error);
+            $session->close;
+            exit $ERRORS{'UNKNOWN'};
+        }
+	$proc_run =  $result->{$OID_SW_RunStatus . "." . $process_list{$process} };
+	print $proc_run;
+    }
+}
+
+##
+## RRDtools update
+##
+
+if ( $opt_g && $opt_n) {
+    $start=time;
+    my $totrrd;
+    if ($opt_n){$totrrd = $proc;}
+    else{
+        if ( ($proc_run == "3") ||  ($proc_run == "4") ){$totrrd = 0;}
+        else{$totrrd = 1;}
+    }
+    update_rrd ($rrd,$start,$totrrd);
+}
+
+##
+## Plugin return code
+##
+
+my $PERFPARSE = "";
+
+if ($opt_n){
+    if ($opt_f){
+	$PERFPARSE = "|nbproc=$proc";
+    }
+    print "Processes OK - Number of current processes: $proc".$PERFPARSE."\n";
+    exit $ERRORS{'OK'};
+} else {
+    if ($proc_run){
+	if ($opt_f){
+	    $PERFPARSE = "|procstatus=$proc_run";
+	}
+        print "Process OK - $process: $STATUS{$proc_run}".$PERFPARSE."\n";
+        exit $ERRORS{'OK'};
+    } else {
+        print "Process CRITICAL - $process not in 'running' state\n";
+        exit $ERRORS{'CRITICAL'};
+    }
+}
+
+sub print_usage () {
+    print "\nUsage:\n";
+    print "$PROGNAME\n";
+    print "   -H (--hostname)   Hostname to query - (required)\n";
+    print "   -C (--community)  SNMP read community (defaults to public,\n";
+    print "                     used with SNMP v1 and v2c\n";
+    print "   -v (--snmp_version)  1 for SNMP v1 (default)\n";
+    print "                        2 for SNMP v2c\n";
+    print "   -g (--rrdgraph)   create  � rrd base and add datas into this one\n";
+    print "   --rrd_step	    Specifies the base interval in seconds with which data will be fed into the RRD (300 by default)\n";
+    print "   -D (--directory)  Path to rrdatabase (or create the .rrd in this directory)\n";
+    print "                     by default: ".$pathtorrdbase."\n";
+    print "                     (The path is valid with spaces '/my\ path/...')\n";
+    print "   -n (--number)     Return the number of current running processes. \n";
+    print "   -p (--process)    Set the process name ex: by default smbd\n";
+    print "   -S (--ServiceId)  Oreon Service Id\n";
+    print "   -V (--version)    Plugin version\n";
+    print "   -h (--help)       usage help\n";
+    print "   -f       Perfparse Compatible\n";
+}
+
+
+sub print_help () {
+    print "##########################################\n";
+    print "#  Copyright (c) 2004-2006 Oreon         #\n";
+    print "#  Bugs to http://www.oreon-project.org/ #\n";
+    print "##########################################\n";
+    print_usage();
+    print "\n";
+}
+
diff --git a/plugins/src/check_graph_remote_storage.pl b/plugins/src/check_graph_remote_storage.pl
new file mode 100644
index 0000000000000000000000000000000000000000..fbcbc7faf196e8450f9cd3355ed5d0818c1d4035
--- /dev/null
+++ b/plugins/src/check_graph_remote_storage.pl
@@ -0,0 +1,293 @@
+#! /usr/bin/perl -w
+#
+# $Id: check_graph_remote_storage.pl,v 1.2 2005/07/27 22:21:49 wistof Exp $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Developped by : Jean Baptiste Gouret - Julien Mathis - Mathieu Mettre - Romain Le Merlus - Yohann Lecarpentier
+# Under control of Flavien Astraud, Jerome Landrieu for Epitech.
+# Oreon's plugins are developped in partnership with Linagora company.
+#
+# Modified for Oreon Project by : Mathieu Chateau - Christophe Coraboeuf
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+##
+## Plugin init
+##
+use strict;
+use Net::SNMP qw(:snmp);
+use FindBin;
+use lib "$FindBin::Bin";
+use lib "@NAGIOS_PLUGINS@";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+if (eval "require oreon" ) {
+	use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+	use vars qw($VERSION %oreon);
+	%oreon=get_parameters();
+} else {
+	print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+use vars qw($PROGNAME);
+use Getopt::Long;
+use vars qw($opt_V $opt_h $opt_g $opt_v $opt_C $opt_d $opt_w $opt_c $opt_H $opt_S $opt_D $opt_s $opt_step $step @test $opt_f);
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+##
+## Plugin var init
+##
+my ($hrStorageDescr, $hrStorageAllocationUnits, $hrStorageSize, $hrStorageUsed);
+my ($AllocationUnits, $Size, $Used);
+my ($tot, $used, $pourcent, $return_code);
+
+$PROGNAME = "check_graph_remote_storage";
+sub print_help ();
+sub print_usage ();
+Getopt::Long::Configure('bundling');
+GetOptions
+    ("h"   => \$opt_h, "help"         => \$opt_h,
+     "V"   => \$opt_V, "version"      => \$opt_V,
+     "s"   => \$opt_s, "show"         => \$opt_s,
+     "g"   => \$opt_g, "rrdgraph"     => \$opt_g,
+     "rrd_step=s" => \$opt_step, "f"  => \$opt_f,
+     "v=s" => \$opt_v, "snmp=s"       => \$opt_v,
+     "C=s" => \$opt_C, "community=s"  => \$opt_C,
+     "d=s" => \$opt_d, "disk=s"       => \$opt_d,
+     "w=s" => \$opt_w, "warning=s"    => \$opt_w,
+     "c=s" => \$opt_c, "critical=s"   => \$opt_c,
+     "S=s" => \$opt_S, "ServiceId=s"  => \$opt_S,
+     "H=s" => \$opt_H, "hostname=s"   => \$opt_H);
+
+
+if ($opt_V) {
+    print_revision($PROGNAME,'$Revision: 1.2 $');
+    exit $ERRORS{'OK'};
+}
+
+if ($opt_h) {
+    print_help();
+    exit $ERRORS{'OK'};
+}
+
+$opt_H = shift unless ($opt_H);
+(print_usage() && exit $ERRORS{'OK'}) unless ($opt_H);
+
+
+($opt_v) || ($opt_v = shift) || ($opt_v = "2");
+my $snmp = $1 if ($opt_v =~ /(\d)/);
+
+($opt_C) || ($opt_C = shift) || ($opt_C = "public");
+
+($opt_d) || ($opt_d = shift) || ($opt_d = 2);
+
+my $partition;
+if ($opt_d =~ /([0-9]+)/){
+    $partition = $1;
+}
+else{
+    print "Unknown -d number expected... or it doesn't exist, try another disk - number\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+($opt_S) || ($opt_S = shift) || ($opt_S = "1_1");
+my $ServiceId = is_valid_serviceid($opt_S);
+
+($opt_c) || ($opt_c = shift) || ($opt_c = 95);
+my $critical = $1 if ($opt_c =~ /([0-9]+)/);
+
+($opt_w) || ($opt_w = shift) || ($opt_w = 80);
+my $warning = $1 if ($opt_w =~ /([0-9]+)/);
+if ($critical <= $warning){
+    print "(--crit) must be superior to (--warn)";
+    print_usage();
+    exit $ERRORS{'OK'};
+}
+
+($opt_step) || ($opt_step = shift) || ($opt_step = "300");
+$step = $1 if ($opt_step =~ /(\d+)/);
+
+my $rrd = $pathtorrdbase.$ServiceId.".rrd";
+my $start=time;
+my $name = $0;
+$name =~ s/\.pl.*//g;
+
+##
+## RRDTools create rrd
+##
+if ($opt_g) {
+    if (! -e $rrd) {
+    	create_rrd ($rrd,2,$start,$step,"U","U","GAUGE");
+    }
+}
+
+##
+## Plugin snmp requests
+##
+
+my $OID_hrStorageDescr =$oreon{MIB2}{HR_STORAGE_DESCR};
+my $OID_hrStorageAllocationUnits =$oreon{MIB2}{HR_STORAGE_ALLOCATION_UNITS};
+my $OID_hrStorageSize =$oreon{MIB2}{HR_STORAGE_SIZE};
+my $OID_hrStorageUsed =$oreon{MIB2}{HR_STORAGE_USED};
+
+# create a SNMP session
+my ( $session, $error ) = Net::SNMP->session(-hostname  => $opt_H,-community => $opt_C, -version  => $snmp);
+if ( !defined($session) ) {
+    print("CRITICAL: SNMP Session : $error");
+    exit $ERRORS{'CRITICAL'};
+}
+
+if ($opt_s) {
+    # Get description table
+    my $result = $session->get_table(
+        Baseoid => $OID_hrStorageDescr
+    );
+
+    if (!defined($result)) {
+        printf("ERROR: hrStorageDescr Table : %s.\n", $session->error);
+        $session->close;
+        exit $ERRORS{'UNKNOWN'};
+    }
+
+    foreach my $key ( oid_lex_sort(keys %$result)) {
+        my @oid_list = split (/\./,$key);
+        my $index = pop (@oid_list) ;
+        print "hrStorage $index :: $$result{$key}\n";
+    }
+exit $ERRORS{'OK'};
+}
+
+my $result = $session->get_request(
+                                   -varbindlist => [$OID_hrStorageDescr.".".$partition  ,
+                                                    $OID_hrStorageAllocationUnits.".".$partition  ,
+                                                    $OID_hrStorageSize.".".$partition,
+                                                    $OID_hrStorageUsed.".".$partition
+                                                    ]
+                                   );
+if (!defined($result)) {
+    printf("ERROR:  %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{'UNKNOWN'};
+}
+$hrStorageDescr  =  $result->{$OID_hrStorageDescr.".".$partition };
+$AllocationUnits  =  $result->{$OID_hrStorageAllocationUnits.".".$partition };
+$Size  =  $result->{$OID_hrStorageSize.".".$partition };
+$Used  =  $result->{$OID_hrStorageUsed.".".$partition };
+
+
+##
+## Plugins var treatment
+##
+if (!$Size){
+    print "Disk CRITICAL - no output (-p number expected... it doesn't exist, try another disk - number\n";
+    exit $ERRORS{'CRITICAL'};
+}
+if (($Size =~  /([0-9]+)/) && ($AllocationUnits =~ /([0-9]+)/)){
+    if (!$Size){
+        print "The number of the option -p is not a hard drive\n";
+        exit $ERRORS{'CRITICAL'};
+    }
+    $tot = 1;
+    $tot = $Size * $AllocationUnits;
+    if (!$tot){$tot = 1;}
+    $used = $Used * $AllocationUnits;
+    $pourcent = ($used * 100) / $tot;
+
+    if (length($pourcent) > 2){
+        @test = split (/\./, $pourcent);
+        $pourcent = $test[0];
+    }
+    $tot = $tot / 1073741824;
+    #$tot = $tot / 1000000000;
+    $Used = ($Used * $AllocationUnits) / 1073741824;
+    #$Used = ($Used * $AllocationUnits) / 1000000000;
+
+    ##
+    ## RRDtools update
+    ##
+    if ($opt_g) {
+        $start=time;
+        my $totrrd;
+        $totrrd = $tot * 1073741824;
+       #$totrrd = $tot * 1000000000;
+		update_rrd ($rrd,$start,$totrrd,$used);
+    }
+
+    ##
+    ## Plugin return code
+    ##
+        if ($pourcent >= $critical){
+            print "Disk CRITICAL - ";
+            $return_code = 2;
+        }
+        elsif ($pourcent >= $warning){
+            print "Disk WARNING - ";
+            $return_code = 1;
+        }
+        else {
+            print "Disk OK - ";
+            $return_code = 0;
+        }
+
+        if ($hrStorageDescr){
+            print $hrStorageDescr . " TOTAL: ";
+            printf("%.3f", $tot);
+            print " Go USED: " . $pourcent . "% : ";
+            printf("%.3f", $Used);
+            print " Go\n";
+            exit $return_code;
+        }
+        else {
+            print "TOTAL: ";
+            printf("%.3f", $tot);
+            print " Go USED: " . $pourcent . "% : ";
+            printf("%.3f", $Used);
+            print " Go\n";
+            exit $return_code;
+        }
+}
+else {
+    print "Disk CRITICAL - no output (-d number expected... it doesn't exist, try another disk - number\n";
+    exit $ERRORS{'CRITICAL'};
+}
+
+sub print_usage () {
+    print "\nUsage:\n";
+    print "$PROGNAME\n";
+    print "   -H (--hostname)   Hostname to query - (required)\n";
+    print "   -C (--community)  SNMP read community (defaults to public,\n";
+    print "                     used with SNMP v1 and v2c\n";
+    print "   -v (--snmp_version)  1 for SNMP v1 (default)\n";
+    print "                        2 for SNMP v2c\n";
+    print "   -d (--disk)       Set the disk (number expected) ex: 1, 2,... (defaults to 2 )\n";
+    print "   -s (--show)       Describes all disk (debug mode)\n";
+    print "   -g (--rrdgraph)   create a rrd base and add datas into this one\n";
+    print "   --rrd_step	    Specifies the base interval in seconds with which data will be fed into the RRD (300 by default)\n";
+    print "   -D (--directory)  Path to rrdatabase (or create the .rrd in this directory)\n";
+    print "                     by default: ".$pathtorrdbase."\n";
+    print "                     (The path is valid with spaces '/my\ path/...')\n";
+    print "   -w (--warn)       Signal strength at which a warning message will be generated\n";
+    print "                     (default 80)\n";
+    print "   -c (--crit)       Signal strength at which a critical message will be generated\n";
+    print "                     (default 95)\n";
+    print "   -S (--ServiceId)  Oreon Service Id\n";
+    print "   -V (--version)    Plugin version\n";
+    print "   -h (--help)       usage help\n";
+
+}
+
+sub print_help () {
+    print "Copyright (c) 2004 OREON\n";
+    print "Bugs to http://www.oreon.org/\n";
+    print "\n";
+    print_usage();
+    print "\n";
+}
diff --git a/plugins/src/check_graph_snmp_value.pl b/plugins/src/check_graph_snmp_value.pl
new file mode 100644
index 0000000000000000000000000000000000000000..f3e64f853927e9844191e5f18b48d45d66798b9e
--- /dev/null
+++ b/plugins/src/check_graph_snmp_value.pl
@@ -0,0 +1,195 @@
+#! /usr/bin/perl -w
+#
+# $Id: check_snmp_value.pl,v 1.2 2005/11/17 10:21:49 Julien Mathis $
+#
+# This plugin is developped under GPL Licence:
+# http://www.fsf.org/licenses/gpl.txt
+#
+# Developped by Merethis SARL : http://www.merethis.com
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# MERETHIS makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the LINAGORA web site.
+# In no event will MERETHIS be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if MERETHIS has
+# been previously advised of the possibility of such damages.
+
+##
+## Plugin init
+##
+
+use strict;
+use Net::SNMP qw(:snmp);
+use FindBin;
+use lib "$FindBin::Bin";
+use lib "@NAGIOS_PLUGINS@";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+if (eval "require oreon" ) {
+	use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+	use vars qw($VERSION %oreon);
+	%oreon=get_parameters();
+} else {
+	print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+use vars qw($PROGNAME);
+use Getopt::Long;
+use vars qw($opt_h $opt_V $opt_g $opt_D $opt_S $opt_H $opt_C $opt_v $opt_o $opt_c $opt_w $opt_f $opt_t);
+use vars qw($ServiceId $rrd $snmp $DS_type);
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+
+$PROGNAME = $0;
+sub print_help ();
+sub print_usage ();
+
+Getopt::Long::Configure('bundling');
+GetOptions
+    ("h"   => \$opt_h, "help"         => \$opt_h,
+     "V"   => \$opt_V, "version"      => \$opt_V,
+     "g"   => \$opt_g, "rrdgraph"     => \$opt_g,
+     "f"   => \$opt_f,
+     "v=s" => \$opt_v, "snmp=s"       => \$opt_v,
+     "C=s" => \$opt_C, "community=s"  => \$opt_C,
+     "S=s" => \$opt_S, "ServiceId=s"  => \$opt_S,
+     "o=s"   => \$opt_o, "oid=s"          => \$opt_o,
+     "t=s"   => \$opt_t, "type=s"          => \$opt_t,
+     "w=s" => \$opt_w, "warning=s"    => \$opt_w,
+     "c=s" => \$opt_c, "critical=s"   => \$opt_c,
+     "H=s" => \$opt_H, "hostname=s"   => \$opt_H);
+
+if ($opt_V) {
+    print_revision($PROGNAME,'$Revision: 1.0');
+    exit $ERRORS{'OK'};
+}
+
+if ($opt_h) {
+    print_help();
+    exit $ERRORS{'OK'};
+}
+
+$opt_H = shift unless ($opt_H);
+(print_usage() && exit $ERRORS{'OK'}) unless ($opt_H);
+
+($opt_v) || ($opt_v = shift) || ($opt_v = "1");
+my $snmp = $1 if ($opt_v =~ /(\d)/);
+
+($opt_S) || ($opt_S = shift) || ($opt_S = "1_1");
+my $ServiceId = is_valid_serviceid($opt_S);
+
+($opt_C) || ($opt_C = shift) || ($opt_C = "public");
+my $rrd = $pathtorrdbase.$ServiceId.".rrd";
+
+($opt_t) || ($opt_t = shift) || ($opt_t = "GAUGE");
+my $DS_type = $1 if ($opt_t =~ /(GAUGE)/ || $opt_t =~ /(COUNTER)/);
+
+($opt_c) || ($opt_c = shift);
+my $critical = $1 if ($opt_c =~ /([0-9]+)/);
+
+($opt_w) || ($opt_w = shift);
+my $warning = $1 if ($opt_w =~ /([0-9]+)/);
+if ($critical <= $warning){
+    print "(--critical) must be superior to (--warning)";
+    print_usage();
+    exit $ERRORS{'OK'};
+}
+
+
+
+my $start=time;
+my $name = $0;
+$name =~ s/\.pl.*//g;
+my $day = 0;
+
+
+#===  RRDTools create rrd  ====
+
+
+if ($opt_g) {
+    if (! -e $rrd) {
+		create_rrd($rrd,1,$start,300,"U","U",$DS_type);
+    }
+}
+
+#===  create a SNMP session ====
+
+my ($session, $error) = Net::SNMP->session(-hostname  => $opt_H,-community => $opt_C, -version  => $snmp);
+if (!defined($session)) {
+    print("CRITICAL: $error");
+    exit $ERRORS{'CRITICAL'};
+}
+
+my $result = $session->get_request(-varbindlist => [$opt_o]);
+if (!defined($result)) {
+    printf("UNKNOWN: %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{'UNKNOWN'};
+}
+
+my $return_result =  $result->{$opt_o};
+
+#===  RRDtools update  ====
+
+if ($opt_g) {
+    $start=time;
+    update_rrd($rrd,$start,$return_result);
+}
+
+#===  Plugin return code  ====
+if (defined($return_result)){
+    if ($opt_w && $opt_c && $return_result < $opt_w){
+    	print "Ok value : " . $return_result;
+	if ($opt_f){ print "|value=".$return_result.";".$opt_w.";".$opt_c.";;";}
+	print "\n";
+	exit $ERRORS{'OK'};
+    } elsif ($opt_w && $opt_c && $return_result >= $opt_w && $return_result < $opt_c){
+	print "Warning value : " . $return_result;
+	if ($opt_f){ print "|value=$return_result;".$opt_w.";".$opt_c.";;";}
+	print "\n";
+	exit $ERRORS{'WARNING'};
+    } elsif ($opt_w && $opt_c && $return_result >= $opt_c){
+    	print "Critical value : " . $return_result;
+	if ($opt_f){ print "|value=".$return_result.";".$opt_w.";".$opt_c.";;";}
+	print "\n";
+	exit $ERRORS{'CRITICAL'};
+    }
+} else {
+    print "CRITICAL Host unavailable\n";
+    exit $ERRORS{'CRITICAL'};
+}
+
+
+sub print_usage () {
+    print "\nUsage:\n";
+    print "$PROGNAME\n";
+    print "   -H (--hostname)   Hostname to query - (required)\n";
+    print "   -C (--community)  SNMP read community (defaults to public,\n";
+    print "                     used with SNMP v1 and v2c\n";
+    print "   -v (--snmp_version)  1 for SNMP v1 (default)\n";
+    print "                        2 for SNMP v2c\n";
+    print "   -t (--type)       Data Source Type (GAUGE or COUNTER) (GAUGE by default)\n";
+    print "   -g (--rrdgraph)   create a rrd base and add datas into this one\n";
+    print "   -D (--directory)  Path to rrdatabase (or create the .rrd in this directory)\n";
+    print "                     by default: ".$pathtorrdbase."\n";
+    print "                     (The path is valid with spaces '/my\ path/...')\n";
+    print "   -S (--ServiceId)  Oreon Service Id\n";
+    print "   -o (--oid)        OID to check\n";
+    print "   -w (--warning)    Warning level\n";
+    print "   -c (--critical)   Critical level\n";
+    print "   -V (--version)    Plugin version\n";
+    print "   -h (--help)       usage help\n";
+    print "   -f                Perfparse Compatible\n";
+}
+
+sub print_help () {
+    print "#=========================================\n";
+    print "#  Copyright (c) 2005 Merethis SARL      =\n";
+    print "#  Developped by Julien Mathis           =\n";
+    print "#  Bugs to http://www.oreon-project.org/ =\n";
+    print "#=========================================\n";
+    print_usage();
+    print "\n";
+}
diff --git a/plugins/src/check_graph_tcp.pl b/plugins/src/check_graph_tcp.pl
new file mode 100644
index 0000000000000000000000000000000000000000..9a9d60d2c19e3860298642e9a3cc5d6924bbaa5e
--- /dev/null
+++ b/plugins/src/check_graph_tcp.pl
@@ -0,0 +1,135 @@
+#! /usr/bin/perl -w
+# $Id: check_graph_tcp.pl,v 1.2 2005/08/01 17:50:50 gollum123 Exp $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Developped by : Julien Mathis - Romain Le Merlus
+#
+# Modified for Oreon Project by : Mathieu Chateau - Christophe Coraboeuf
+# Modified By Julien Mathis For Merethis Company
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+use strict;
+use FindBin;
+use lib "$FindBin::Bin";
+#use lib "@NAGIOS_PLUGINS@";
+use lib "/usr/lib/nagios/plugins";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+if (eval "require oreon" ) {
+	use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+	use vars qw($VERSION %oreon);
+	%oreon=get_parameters();
+} else {
+	print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+use Getopt::Long;
+use vars qw($opt_V $opt_h $opt_p $opt_c $opt_w $opt_H $opt_S $opt_g $opt_D $opt_step);
+use vars qw($PROGNAME);
+
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+my $pathtolibexectcp = $oreon{GLOBAL}{NAGIOS_LIBEXEC}."check_tcp";
+
+sub print_help ();
+sub print_usage ();
+$PROGNAME = "check_graph_tcp";
+
+#
+# get options
+#
+
+Getopt::Long::Configure('bundling');
+GetOptions
+    ("h|help"   		=> \$opt_h,
+     "V|version"   		=> \$opt_V,
+     "H|hostname=s" 	=> \$opt_H,
+     "p|port=s" 		=> \$opt_p,
+     "w|warning=s" 		=> \$opt_w,
+     "c|critical=s" 	=> \$opt_c,
+     "S|ServiceId=s" 	=> \$opt_S,
+     "rrd_step=s" 		=> \$opt_step,
+     "g|rrdgraph"   	=> \$opt_g);
+
+if (defined($opt_h)) {
+	print_help();
+    exit $ERRORS{'OK'};
+}
+
+$opt_H = shift unless ($opt_H);
+(print_usage() && exit $ERRORS{'OK'}) unless ($opt_H);
+
+($opt_S) || ($opt_S = shift) || ($opt_S = "1_1");
+my $ServiceId = is_valid_serviceid($opt_S);
+
+($opt_step) || ($opt_step = shift) || ($opt_step = "300");
+my $step = $1 if ($opt_step =~ /(\d+)/);
+
+##################################################
+#### Create Command line 
+#
+
+my $args_check_tcp = "-H $opt_H -p $opt_p";
+$args_check_tcp .= " -w $opt_w -c $opt_c" if ($opt_w && $opt_c);
+
+my $start=time;
+
+
+##
+## RRDTools create rrd
+##
+if ($opt_g) {
+	create_rrd ($pathtorrdbase.$ServiceId.".rrd",1,$start,$step,"U","U","GAUGE") if (! -e $pathtorrdbase.$ServiceId.".rrd");
+}
+
+my $result = `$pathtolibexectcp $args_check_tcp`;
+my $return_code = $? / 256;
+$_ = $result;
+m/(\d*\.\d*) second/;
+my $time = $1;
+
+#
+# RRDtools update
+#
+
+update_rrd ($pathtorrdbase.$ServiceId.".rrd",$start,$time) if ($opt_g && $time );
+
+print "$result";
+exit $return_code;
+
+sub print_usage () {
+    print "\nUsage:\n";
+    print $0."\n";
+    print "\t-H (--hostname)\t\tHostname to query (required)\n";
+    print "\t-p, --port\t\tPort number (required)\n";
+    print "\t-w, --warning\t\tResponse time to result in warning status (seconds) - optional\n";
+    print "\t-c, --critical\t\tResponse time to result in critical status (seconds) - optional\n";
+    print "\t--rrd_step\t\tSpecifies the base interval in seconds with which data will be fed into the RRD (300 by default)\n";
+    print "\t-V (--version)\t\tVieuw plugin version\n";
+    print "\t-h (--help)\t\tusage help\n";
+
+}
+
+sub print_help () {
+    print "################################################\n";
+    print "#    Bugs to http://bugs.oreon-project.org/    #\n";
+    print "################################################\n";
+    print "\n";
+    print_usage();
+    print "\n";
+}
+
+
+
+
+
+
diff --git a/plugins/src/check_graph_traffic.pl b/plugins/src/check_graph_traffic.pl
new file mode 100644
index 0000000000000000000000000000000000000000..1ca5f85fb3f9f9618737a6a355f0c46dd80864f2
--- /dev/null
+++ b/plugins/src/check_graph_traffic.pl
@@ -0,0 +1,405 @@
+#! /usr/bin/perl -w
+#
+# $Id: check_graph_traffic.pl,v 1.2 2005/07/27 22:21:49 Julio $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Developped by : Julien Mathis - Romain Le Merlus
+#
+# Modified for Oreon Project by : Mathieu Chateau - Christophe Coraboeuf
+# Modified By Julien Mathis For Merethis Company
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+#
+# Plugin init
+#
+
+use strict;
+use Net::SNMP qw(:snmp oid_lex_sort);
+use FindBin;
+use lib "$FindBin::Bin";
+use lib "@NAGIOS_PLUGINS@";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+if (eval "require oreon" ) {
+	use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+	use vars qw($VERSION %oreon);
+	%oreon=get_parameters();
+} else {
+    print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+use vars qw($VERSION %oreon);
+use vars qw(%oreon);
+$VERSION = '$Revision: 1.2 $';
+$VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;
+
+use vars qw($PROGNAME);
+use Getopt::Long;
+use vars qw($opt_V $opt_h $opt_g $opt_v $opt_C $opt_b $opt_H $opt_D $opt_i $opt_w $opt_c $opt_s $opt_S $opt_T $opt_step $step);
+
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+
+#
+# Plugin var init
+#
+
+my($proc, $proc_run, @test, $row, @laste_values, $last_check_time, $last_in_bytes, $last_out_bytes, @last_values, $update_time, $db_file, $in_traffic, $out_traffic, $in_usage, $out_usage);
+my $pathtolibexecnt = $oreon{NAGIOS_LIBEXEC};
+
+$PROGNAME = "check_graph_traffic";
+sub print_help ();
+sub print_usage ();
+
+Getopt::Long::Configure('bundling');
+GetOptions
+    ("h"   => \$opt_h, "help"         => \$opt_h,
+     "s"   => \$opt_s, "show"         => \$opt_s,
+     "V"   => \$opt_V, "version"      => \$opt_V,
+     "g"   => \$opt_g, "rrdgraph"     => \$opt_g,
+     "rrd_step=s" => \$opt_step,
+     "i=s" => \$opt_i, "interface=s"  => \$opt_i,
+     "v=s" => \$opt_v, "snmp=s"       => \$opt_v,
+     "C=s" => \$opt_C, "community=s"  => \$opt_C,
+     "b=s" => \$opt_b, "bps=s"        => \$opt_b,
+     "w=s" => \$opt_w, "warning=s"    => \$opt_w,
+     "c=s" => \$opt_c, "critical=s"   => \$opt_c,
+     "S=s" => \$opt_S, "ServiceId=s"  => \$opt_S,
+     "T=s" => \$opt_T, "TrafficMap=s"  => \$opt_T,
+     "H=s" => \$opt_H, "hostname=s"   => \$opt_H);
+
+if ($opt_V) {
+    print_revision($PROGNAME,'$Revision: 1.2 $');
+    exit $ERRORS{'OK'};
+}
+
+if ($opt_h) {
+    print_help();
+    exit $ERRORS{'OK'};
+}
+
+##################################################
+#####      Verify Options
+##
+
+$opt_H = shift unless ($opt_H);
+(print_usage() && exit $ERRORS{'OK'}) unless ($opt_H);
+
+($opt_v) || ($opt_v = shift) || ($opt_v = "1");
+my $snmp = $1 if ($opt_v =~ /(\d)/);
+
+($opt_C) || ($opt_C = shift) || ($opt_C = "public");
+($opt_i) || ($opt_i = shift) || ($opt_i = 2);
+($opt_S) || ($opt_S = shift) || ($opt_S = 1);
+my $ServiceId = is_valid_serviceid($opt_S);
+
+($opt_b) || ($opt_b = shift) || ($opt_b = 95);
+my $bps = $1 if ($opt_b =~ /([0-9]+)/);
+
+($opt_c) || ($opt_c = shift) || ($opt_c = 95);
+my $critical = $1 if ($opt_c =~ /([0-9]+)/);
+
+($opt_w) || ($opt_w = shift) || ($opt_w = 80);
+my $warning = $1 if ($opt_w =~ /([0-9]+)/);
+
+my $interface;
+if ($opt_i =~ /([0-9]+)/){
+    $interface = $1;
+} else {
+    print "Unknown -i number expected... or it doesn't exist, try another interface - number\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+if ($critical <= $warning){
+    print "(--crit) must be superior to (--warn)";
+    print_usage();
+    exit $ERRORS{'OK'};
+}
+
+($opt_step) || ($opt_step = shift) || ($opt_step = "300");
+$step = $1 if ($opt_step =~ /(\d+)/);
+
+##################################################
+#####           RRDTool var init
+##
+
+my $rrd = $pathtorrdbase.$ServiceId.".rrd";
+my $start=time;
+
+##################################################
+#####           RRDTool create rrd
+##
+
+if ($opt_g) {
+    if (! -e $rrd) {
+         create_rrd ($rrd,2,$start,$step,"U","U","GAUGE");
+    }
+}
+
+#################################################
+#####            Plugin snmp requests
+##
+
+my $OID_IN =$oreon{MIB2}{IF_IN_OCTET}.".".$interface;
+my $OID_OUT = $oreon{MIB2}{IF_OUT_OCTET}.".".$interface;
+my $OID_SPEED = $oreon{MIB2}{IF_SPEED}.".".$interface;
+my $OID_DESC =$oreon{MIB2}{IF_DESC};
+
+# create a SNMP session
+
+my ($session, $error) = Net::SNMP->session(-hostname => $opt_H, -community => $opt_C, -version => $snmp);
+if (!defined($session)) {
+    print("UNKNOWN: SNMP Session : $error");
+    exit $ERRORS{'UNKNOWN'};
+}
+
+# Get desctiption table
+
+if ($opt_s) {
+    my $result = $session->get_table(Baseoid => $OID_DESC);
+    if (!defined($result)) {
+        printf("ERROR: Description Table : %s.\n", $session->error);
+        $session->close;
+        exit $ERRORS{'UNKNOWN'};
+    }
+    foreach my $key ( oid_lex_sort(keys %$result)) {
+        my @oid_list = split (/\./,$key);
+        my $index = pop (@oid_list) ;
+        print "Interface $index :: $$result{$key}\n";
+    }
+    exit $ERRORS{'OK'};
+}
+
+
+#######  Get IN bytes
+
+my $in_bytes;
+my $result = $session->get_request(-varbindlist => [$OID_IN]);
+if (!defined($result)) {
+    printf("ERROR: IN Bytes :  %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{'UNKNOWN'};
+}
+$in_bytes =  $result->{$OID_IN};
+
+
+#######  Get OUT bytes
+
+my $out_bytes;
+$result = $session->get_request(-varbindlist => [$OID_OUT]);
+if (!defined($result)) {
+    printf("ERROR: Out Bytes : %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{'UNKNOWN'};
+}
+$out_bytes = $result->{$OID_OUT};
+
+
+#######  Get SPEED of interface
+
+my $speed_card;
+$result = $session->get_request(-varbindlist => [$OID_SPEED]);
+if (!defined($result)) {
+    printf("ERROR: Interface Speed : %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{'UNKNOWN'};
+}
+$speed_card = $result->{$OID_SPEED} / 8;
+
+#############################################
+#####          Plugin return code
+##
+
+$last_in_bytes = 0;
+$last_out_bytes  = 0;
+
+my $flg_created;
+
+if (-e "/tmp/traffic_if".$interface."_".$opt_H) {
+    open(FILE,"<"."/tmp/traffic_if".$interface."_".$opt_H);
+    while($row = <FILE>){
+	@last_values = split(":",$row);
+	$last_check_time = $last_values[0];
+	$last_in_bytes = $last_values[1];
+	$last_out_bytes = $last_values[2];
+	$flg_created = 1;
+    }
+    close(FILE);
+} else {
+    $flg_created = 0;
+}
+
+$update_time = time;
+
+unless (open(FILE,">"."/tmp/traffic_if".$interface."_".$opt_H)){
+    print "Unknown - /tmp/traffic_if".$interface."_".$opt_H. " !\n";
+    exit $ERRORS{"UNKNOWN"};
+}
+print FILE "$update_time:$in_bytes:$out_bytes";
+close(FILE);
+
+if ($flg_created eq 0){
+    print "First execution : Buffer in creation.... \n";
+    exit($ERRORS{"UNKNOWN"});
+}
+
+
+## Bandwith = IN + OUT / Delta(T) = 6 Mb/s
+## (100 * Bandwith) / (2(si full duplex) * Ispeed)
+## Count must round at 4294967296 
+##
+
+if (($in_bytes - $last_in_bytes > 0) && defined($last_in_bytes)) {
+	my $total = 0;
+	if ($in_bytes - $last_in_bytes < 0){
+		$total = 4294967296 - $last_in_bytes + $in_bytes;
+	} else {
+		$total = $in_bytes - $last_in_bytes;
+	}
+    my $pct_in_traffic = $in_traffic = abs($total / (time - $last_check_time));
+} else {
+    $in_traffic = 0;
+} 
+
+if ($out_bytes - $last_out_bytes > 0 && defined($last_out_bytes)) {
+    my $total = 0;
+    if ($out_bytes - $last_out_bytes < 0){
+	$total = 4294967296 - $last_out_bytes + $out_bytes;
+    } else {
+	$total = $out_bytes - $last_out_bytes;
+    }
+    my $pct_out_traffic = $out_traffic = abs($total / (time - $last_check_time));
+} else {
+    $out_traffic = 0;
+}
+
+if ( $speed_card != 0 ) {
+    $in_usage = sprintf("%.1f",($in_traffic*100) / $speed_card);
+    $out_usage = sprintf("%.1f",($out_traffic*100) / $speed_card);
+    ## RRDtools update
+    if ($opt_g) {
+        $start = time;
+    	update_rrd($rrd,$start, sprintf("%.1f",abs($in_traffic)), sprintf("%.1f",abs($out_traffic)));
+    }
+}
+
+my $in_prefix = "";
+my $out_prefix = "";
+
+my $in_perfparse_traffic = $in_traffic;
+my $out_perfparse_traffic = $out_traffic;
+
+if ($in_traffic > 1024) {
+    $in_traffic = $in_traffic / 1024;
+    $in_prefix = "k";
+    if($in_traffic > 1024){
+		$in_traffic = $in_traffic / 1024;
+		$in_prefix = "M";
+    }
+    if($in_traffic > 1024){
+		$in_traffic = $in_traffic / 1024;
+		$in_prefix = "G";
+    }
+}
+
+if ($out_traffic > 1024){
+    $out_traffic = $out_traffic / 1024;
+    $out_prefix = "k";
+    if ($out_traffic > 1024){
+		$out_traffic = $out_traffic / 1024;
+		$out_prefix = "M";
+	}
+    if ($out_traffic > 1024){
+		$out_traffic = $out_traffic / 1024;
+		$out_prefix = "G";
+    }
+}
+
+my $in_bytes_unit = "";
+$in_bytes = $in_bytes/1048576;
+if ($in_bytes > 1024){
+    $in_bytes = $in_bytes / 1024;
+    $in_bytes_unit = "G";
+} else { 
+    $in_bytes_unit = "M";
+}
+
+my $out_bytes_unit = "";
+$out_bytes = $out_bytes/1048576;
+if ($out_bytes > 1024){
+    $out_bytes = $out_bytes / 1024;
+    $out_bytes_unit = "G";
+} else {
+    $out_bytes_unit = "M";
+}
+
+
+if ( $speed_card == 0 ) {
+    print "CRITICAL: Interface speed equal 0! Interface must be down.|traffic_in=0B/s traffic_out=0B/s\n";
+    exit($ERRORS{"CRITICAL"});
+}
+
+if (($in_usage > $critical) or ($out_usage > $critical)){
+    print "CRITICAL: ".$critical."% bandwidth utilization.\n";
+    exit($ERRORS{"CRITICAL"});
+}
+
+if(($in_usage > $warning) or ($out_usage > $warning)){
+    print "WARNING: ".$warning."% bandwidth utilization.|traffic_in=0B/s traffic_out=0B/s\n";
+    exit($ERRORS{"WARNING"});
+}
+
+#####################################
+#####        Display result
+##
+
+printf("Traffic In : %.2f ".$in_prefix."B/s (".$in_usage." %%), Out : %.2f ".$out_prefix."B/s (".$out_usage." %%) - ", $in_traffic, $out_traffic);
+printf("Total RX Bytes In : %.2f ".$in_bytes_unit."B, Out : %.2f ".$out_bytes_unit."B", $in_bytes, $out_bytes);
+printf("|traffic_in=%.2fB/s traffic_out=%.2fB/s\n", $in_perfparse_traffic, $out_perfparse_traffic);
+exit($ERRORS{"OK"});
+
+
+
+
+sub print_usage () {
+    print "\nUsage:\n";
+    print "$PROGNAME\n";
+    print "   -H (--hostname)   Hostname to query - (required)\n";
+    print "   -C (--community)  SNMP read community (defaults to public,\n";
+    print "                     used with SNMP v1 and v2c\n";
+    print "   -v (--snmp_version)  1 for SNMP v1 (default)\n";
+    print "                        2 for SNMP v2c\n";
+    print "   -g (--rrdgraph)   create a rrd base and add datas into this one\n";
+    print "   --rrd_step	    Specifies the base interval in seconds with which data will be fed into the RRD (300 by default)\n";
+    print "   -D (--directory)  Path to rrdatabase (or create the .rrd in this directory)\n";
+    print "                     by default: ".$pathtorrdbase."\n";
+    print "                     (The path is valid with spaces '/my\ path/...')\n";
+    print "                     (The path is valid with spaces '/my\ path/...')\n";
+    print "   -s (--show)       Describes all interfaces number (debug mode)\n";
+    print "   -i (--interface)  Set the interface number (2 by default)\n";
+    print "   -w (--warn)       Signal strength at which a warning message will be generated\n";
+    print "                     (default 80)\n";
+    print "   -c (--crit)       Signal strength at which a critical message will be generated\n";
+    print "                     (default 95)\n";
+    print "   -S (--ServiceId)  Oreon Service Id\n";
+    print "   -V (--version)    Plugin version\n";
+    print "   -h (--help)       usage help\n";
+}
+
+sub print_help () {
+    print "##########################################\n";
+    print "#  Copyright (c) 2004-2006 Oreon         #\n";
+    print "#  Bugs to http://www.oreon-project.org/ #\n";
+    print "##########################################\n";
+    print_usage();
+    print "\n";
+}
diff --git a/plugins/src/check_graph_traffic2.pl b/plugins/src/check_graph_traffic2.pl
new file mode 100644
index 0000000000000000000000000000000000000000..19e1bcb543b79acb5b0dffa92eee164d248f20d8
--- /dev/null
+++ b/plugins/src/check_graph_traffic2.pl
@@ -0,0 +1,426 @@
+#! /usr/bin/perl -w
+#
+# $Id: check_graph_traffic.pl,v 1.2 2005/07/27 22:21:49 wistof Exp $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Developped by : Jean Baptiste Gouret - Julien Mathis - Mathieu Mettre - Romain Le Merlus - Yohann Lecarpentier
+# Under control of Flavien Astraud, Jerome Landrieu for Epitech.
+# Oreon's plugins are developped in partnership with Linagora company.
+#
+# Modified for Oreon Project by : Mathieu Chateau - Christophe Coraboeuf
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+##
+## Plugin init
+##
+use strict;
+use Net::SNMP qw(:snmp oid_lex_sort);
+use FindBin;
+use lib "$FindBin::Bin";
+use lib "@NAGIOS_PLUGINS@";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+if (eval "require oreon" ) {
+	use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+	use vars qw($VERSION %oreon);
+	%oreon=get_parameters();
+} else {
+	print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+use vars qw($VERSION %oreon);
+use vars qw(%oreon);
+$VERSION = '$Revision: 1.2 $';
+$VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;
+
+use vars qw($PROGNAME);
+use Getopt::Long;
+use vars qw($opt_V $opt_h $opt_g $opt_v $opt_C $opt_b $opt_H $opt_D $opt_i $opt_w $opt_c $opt_s $opt_S $opt_T $opt_step $step);
+
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+my $pathtotrafficmap = $oreon{GLOBAL}{DIR_OREON}."include/trafficMap/average/";
+
+
+##
+## Plugin var init
+##
+my($proc, $proc_run, @test, $row, @laste_values, $last_check_time);
+my($last_in_bytes, $last_out_bytes, @last_values, $update_time);
+my($db_file, $in_traffic, $out_traffic, $in_usage, $out_usage);
+
+$PROGNAME = "check_graph_traffic";
+sub print_help ();
+sub print_usage ();
+
+Getopt::Long::Configure('bundling');
+GetOptions
+    ("h"   => \$opt_h, "help"         => \$opt_h,
+     "s"   => \$opt_s, "show"         => \$opt_s,
+     "V"   => \$opt_V, "version"      => \$opt_V,
+     "g"   => \$opt_g, "rrdgraph"     => \$opt_g,
+     "rrd_step=s" => \$opt_step,
+     "i=s" => \$opt_i, "interface=s"  => \$opt_i,
+     "v=s" => \$opt_v, "snmp=s"       => \$opt_v,
+     "C=s" => \$opt_C, "community=s"  => \$opt_C,
+     "b=s" => \$opt_b, "bps=s"        => \$opt_b,
+     "w=s" => \$opt_w, "warning=s"    => \$opt_w,
+     "c=s" => \$opt_c, "critical=s"   => \$opt_c,
+     "S=s" => \$opt_S, "ServiceId=s"  => \$opt_S,
+     "T=s" => \$opt_T, "TrafficMap=s"  => \$opt_T,
+     "H=s" => \$opt_H, "hostname=s"   => \$opt_H);
+
+
+if ($opt_V) {
+    print_revision($PROGNAME,'$Revision: 1.2 $');
+    exit $ERRORS{'OK'};
+}
+
+if ($opt_h) {
+    print_help();
+    exit $ERRORS{'OK'};
+}
+
+$opt_H = shift unless ($opt_H);
+(print_usage() && exit $ERRORS{'OK'}) unless ($opt_H);
+
+($opt_v) || ($opt_v = shift) || ($opt_v = "1");
+my $snmp = $1 if ($opt_v =~ /(\d)/);
+
+
+($opt_C) || ($opt_C = shift) || ($opt_C = "public");
+
+($opt_i) || ($opt_i = shift) || ($opt_i = 2);
+my $interface;
+if ($opt_i =~ /([0-9]+)/){
+    $interface = $1;
+}
+else{
+    print "Unknown -i number expected... or it doesn't exist, try another interface - number\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+($opt_S) || ($opt_S = shift) || ($opt_S = "1_1");
+my $ServiceId = is_valid_serviceid($opt_S);
+
+($opt_b) || ($opt_b = shift) || ($opt_b = 95);
+my $bps = $1 if ($opt_b =~ /([0-9]+)/);
+
+($opt_c) || ($opt_c = shift) || ($opt_c = 95);
+my $critical = $1 if ($opt_c =~ /([0-9]+)/);
+
+($opt_w) || ($opt_w = shift) || ($opt_w = 80);
+my $warning = $1 if ($opt_w =~ /([0-9]+)/);
+if ($critical <= $warning){
+    print "(--crit) must be superior to (--warn)";
+    print_usage();
+    exit $ERRORS{'OK'};
+}
+
+($opt_step) || ($opt_step = shift) || ($opt_step = "300");
+$step = $1 if ($opt_step =~ /(\d+)/);
+
+($opt_T) || ($opt_T = shift) || ($opt_T = $pathtotrafficmap);
+$pathtotrafficmap = $1 if ($opt_T =~ /([-.\/\_\ A-Za-z0-9]+)/);
+
+##
+## RRDTool var init
+##
+my $rrd = $pathtorrdbase.$ServiceId.".rrd";
+my $start=time;
+my $name = $0;
+$name =~ s/\.pl.*//g;
+
+##
+## RRDTool create rrd
+##
+if ($opt_g) {
+    if (! -e $rrd) {
+         create_rrd ($rrd,2,$start,$step,"U","U","COUNTER");
+    }
+}
+##
+## Plugin snmp requests
+##
+
+my $OID_IN =$oreon{MIB2}{IF_IN_OCTET}.".".$interface;
+my $OID_OUT = $oreon{MIB2}{IF_OUT_OCTET}.".".$interface;
+my $OID_SPEED = $oreon{MIB2}{IF_SPEED}.".".$interface;
+my $OID_DESC =$oreon{MIB2}{IF_DESC};
+
+# create a SNMP session
+my ( $session, $error ) = Net::SNMP->session(-hostname  => $opt_H,-community => $opt_C, -version  => $snmp);
+if ( !defined($session) ) {
+    print("UNKNOWN: SNMP Session : $error");
+    exit $ERRORS{'UNKNOWN'};
+}
+
+if ($opt_s) {
+    # Get desctiption table
+    my $result = $session->get_table(
+        Baseoid => $OID_DESC
+    );
+
+    if (!defined($result)) {
+        printf("ERROR: Description Table : %s.\n", $session->error);
+        $session->close;
+        exit $ERRORS{'UNKNOWN'};
+    }
+
+    foreach my $key ( oid_lex_sort(keys %$result)) {
+        my @oid_list = split (/\./,$key);
+        my $index = pop (@oid_list) ;
+        print "Interface $index :: $$result{$key}\n";
+    }
+exit $ERRORS{'OK'};
+}
+
+
+# get IN bytes
+my $result = $session->get_request(
+                                   -varbindlist => [$OID_IN]
+                                   );
+if (!defined($result)) {
+    printf("ERROR: IN Bytes :  %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{'UNKNOWN'};
+}
+my $in_bytes;
+$in_bytes =  $result->{$OID_IN};
+#print "in_bytes: $in_bytes\n";
+
+
+# get OUT bytes
+my $out_bytes;
+$result = $session->get_request(
+                                -varbindlist => [$OID_OUT]
+                                );
+if (!defined($result)) {
+    printf("ERROR: Out Bytes : %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{'UNKNOWN'};
+}
+$out_bytes = $result->{$OID_OUT};
+#print "out_bytes: $out_bytes\n";
+
+# Get SPEED of interface
+$result = $session->get_request(
+                                -varbindlist => [$OID_SPEED]
+                                );
+if (!defined($result)) {
+    printf("ERROR: Interface Speed : %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{'UNKNOWN'};
+}
+my $speed;
+$speed = $result->{$OID_SPEED};
+#print "speed: $speed \n";
+##
+## Plugin return code
+##
+
+##
+## Status
+##
+my $last_check_time_status = 0;
+my $last_in_bytes_status = 0;
+my $last_out_bytes_stastus = 0;
+my $flg = 0;
+$last_in_bytes = 0;
+$last_out_bytes  = 0;
+
+if (-e "/tmp/traffic_if".$interface."_".$opt_H ) {
+    open(FILE,"<"."/tmp/traffic_if".$interface."_".$opt_H);
+    while($row = <FILE>)
+    {
+     @last_values = split(":",$row);
+     $last_check_time = $last_values[0];
+     $last_in_bytes = $last_values[1];
+     $last_out_bytes = $last_values[2];
+     ##
+     ## Status
+     ##
+     $last_check_time_status = $last_values[3];
+     $last_in_bytes_status = $last_values[4];
+     $last_out_bytes_stastus = $last_values[5];
+     $flg = $last_values[6];
+    }
+    close(FILE);
+}
+
+$update_time = time;
+
+unless (open(FILE,">"."/tmp/traffic"."_if".$interface."_".$opt_H) )
+    {
+        print "Unknown - /tmp/traffic"."_if".$interface."_".$opt_H. " $!\n";
+        exit $ERRORS{"UNKNOWN"};
+    }
+print FILE "$update_time:$in_bytes:$out_bytes";
+
+##
+## TRAFFIC - map depends:Status
+##
+if (!$flg) { #if new
+print FILE ":$update_time:$in_bytes:$out_bytes:17";
+}
+my $hour;
+$hour = `/bin/date +%k 2>/dev/null`;
+#$hour = 17;
+if ($hour =~ /^17$/){
+    if ($flg =~ /^18$/){ # 17H flg=18 (update done)
+    $flg = 18;
+    print FILE ":$last_check_time_status:$last_in_bytes_status:$last_out_bytes_stastus:$flg";
+    }
+    if ($flg =~ /^17$/){ # 17H flg=17
+    $flg = 18;
+    print FILE ":$update_time:$in_bytes:$out_bytes:$flg";
+    }
+} else {
+    if ($flg =~ /^18$/){# =! 17H flg 18
+    $flg = 17;
+    }
+    print FILE ":$last_check_time_status:$last_in_bytes_status:$last_out_bytes_stastus:$flg";
+
+}
+close(FILE);
+
+$in_traffic = sprintf("%.2f",($in_bytes-$last_in_bytes_status)/(time-$last_check_time_status));
+$out_traffic = sprintf("%.2f",($out_bytes-$last_out_bytes_stastus)/(time-$last_check_time_status));
+my $in_traffic2;
+my $out_traffic2;
+$in_traffic2 = int($in_traffic);
+$out_traffic2 = int($out_traffic);
+
+unless (open(HTML,">".$pathtotrafficmap.$opt_H."_".$ServiceId.".html") )
+    {
+        print "Unknown - $pathtotrafficmap".$opt_H."_".$ServiceId.".html - $!\n";
+        exit $ERRORS{"UNKNOWN"};
+    }
+
+my $sortie = "<html>\n<head>\n<!-- cuin d $in_traffic2 --> <!-- cuout d $out_traffic2 -->\n</head>\n<body>\n</body>\n</html>";
+print HTML $sortie;
+
+close(HTML);
+
+
+## Bandwith = IN + OUT / Delta(T) = 6 Mb/s
+## (100 * Bandwith) / (2(si full duplex) * Ispeed)
+if ($in_bytes - $last_in_bytes > 0) {
+    $in_traffic = sprintf("%.2f",($in_bytes-$last_in_bytes)/(time-$last_check_time));
+}
+if ($out_bytes - $last_out_bytes > 0) {
+    $out_traffic = sprintf("%.2f",($out_bytes-$last_out_bytes)/(time-$last_check_time));
+}
+
+if ( $speed != 0 ) {
+    $in_usage = sprintf("%.1f",($in_traffic*100)/$speed);
+    $out_usage = sprintf("%.1f",($out_traffic*100)/$speed);
+
+
+##
+## RRDtools update
+##
+    if ($opt_g) {
+        $start=time;
+    	update_rrd ($rrd,$start,$in_bytes,$out_bytes);
+    }
+}
+
+
+my $in_prefix;
+my $out_prefix;
+$in_prefix = " ";
+$out_prefix = " ";
+if($in_traffic > 1024)
+{
+ $in_traffic = sprintf("%.2f",$in_traffic/1024);
+ $in_prefix = "k";
+ if($in_traffic > 1024)
+ {
+  $in_traffic = sprintf("%.2f",$in_traffic/1024);
+  $in_prefix = "M";
+ }
+}
+
+if($out_traffic > 1024)
+{
+ $out_traffic = sprintf("%.2f",$out_traffic/1024);
+ $out_prefix = "k";
+ if($out_traffic > 1024)
+ {
+  $out_traffic = sprintf("%.2f",$out_traffic/1024);
+  $out_prefix = "M";
+ }
+}
+
+$in_bytes = sprintf("%.2f",($in_bytes/1024)/1024);
+$out_bytes = sprintf("%.2f",($out_bytes/1024)/1024);
+
+if ( $speed == 0 ) {
+    print "<br>CRITICAL: Interface speed equal 0! Interface must be down.\n";
+    exit($ERRORS{"CRITICAL"});
+}
+
+if(($in_usage > $critical) or ($out_usage > $critical) )
+{
+ print "<br>CRITICAL: (".$critical."%) bandwidth utilization.\n";
+ exit($ERRORS{"CRITICAL"});
+}
+
+if(($in_usage > $warning) or ($out_usage > $warning))
+{
+ print "WARNING: (".$warning."%) bandwidth utilization.\n";
+ exit($ERRORS{"WARNING"});
+}
+
+
+print "Traffic: $in_traffic ".$in_prefix."B/s (".$in_usage."%) in, $out_traffic ".$out_prefix."B/s (".$out_usage."%) out - ";
+print "Total RX Bytes: $in_bytes MB, Total TX Bytes: $out_bytes MB \n";
+exit($ERRORS{"OK"});
+
+
+sub print_usage () {
+    print "\nUsage:\n";
+    print "$PROGNAME\n\n";
+    print "This plugin directly store data in COUNTER format RRD\n\n";
+    print "   -H (--hostname)   Hostname to query - (required)\n";
+    print "   -C (--community)  SNMP read community (defaults to public,\n";
+    print "                     used with SNMP v1 and v2c\n";
+    print "   -v (--snmp_version)  1 for SNMP v1 (default)\n";
+    print "                        2 for SNMP v2c\n";
+    print "   -g (--rrdgraph)   create a rrd base and add datas into this one\n";
+    print "   --rrd_step	    Specifies the base interval in seconds with which data will be fed into the RRD (300 by default)\n";
+    print "   -D (--directory)  Path to rrdatabase (or create the .rrd in this directory)\n";
+    print "                     by default: ".$pathtorrdbase."\n";
+    print "                     (The path is valid with spaces '/my\ path/...')\n";
+    print "   -T (--TrafficMap) Path to trafficmap (or create the .html in this directory)\n";
+    print "                     by default: ".$pathtotrafficmap."\n";
+    print "                     (The path is valid with spaces '/my\ path/...')\n";
+    print "   -s (--show)       Describes all interfaces number (debug mode)\n";
+    print "   -i (--interface)  Set the interface number (2 by default)\n";
+    print "   -w (--warn)       Signal strength at which a warning message will be generated\n";
+    print "                     (default 80)\n";
+    print "   -c (--crit)       Signal strength at which a critical message will be generated\n";
+    print "                     (default 95)\n";
+    print "   -S (--ServiceId)  Oreon Service Id\n";
+    print "   -V (--version)    Plugin version\n";
+    print "   -h (--help)       usage help\n";
+
+}
+
+sub print_help () {
+    print "Copyright (c) 2004 OREON\n";
+    print "Bugs to http://www.oreon.org/\n";
+    print "\n";
+    print_usage();
+    print "\n";
+}
diff --git a/plugins/src/check_graph_traffic_rrd.pl b/plugins/src/check_graph_traffic_rrd.pl
new file mode 100644
index 0000000000000000000000000000000000000000..6344de2a1d5f547eec84661e04006952117a8217
--- /dev/null
+++ b/plugins/src/check_graph_traffic_rrd.pl
@@ -0,0 +1,316 @@
+#! /usr/bin/perl -w
+#
+# $Id: check_graph_traffic,v 1.1 2004/10/21 17:00:00 projectOREON $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Last Developpement by : Jean Baptiste Gouret - Julien Mathis - Mathieu Mettre - Romain Le Merlus - Yohann Lecarpentier
+#
+# REVISED BY CVF 6/05/05
+# Modified for Oreon Project by : Christophe Coraboeuf
+
+##
+## Plugin init
+##
+use strict;
+use Net::SNMP qw(:snmp oid_lex_sort);
+use FindBin;
+use lib "$FindBin::Bin";
+use lib "@NAGIOS_PLUGINS@";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+if (eval "require oreon" ) {
+	use oreon qw(get_parameters create_rrd update_rrd fetch_rrd &is_valid_serviceid);
+	use vars qw($VERSION %oreon);
+	%oreon=get_parameters();
+} else {
+	print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+use vars qw($VERSION %oreon);
+
+use Getopt::Long;
+use vars qw($opt_V $opt_h $opt_g $opt_v $opt_C $opt_H $opt_D  $opt_step $opt_i $opt_w $opt_c $opt_s $opt_S $opt_T $opt_Y);
+use Data::Dumper;
+
+Getopt::Long::Configure('bundling');
+    GetOptions  ("h"   => \$opt_h, "help"         => \$opt_h,
+                 "s"   => \$opt_s, "show"         => \$opt_s,
+                 "V"   => \$opt_V, "version"      => \$opt_V,
+                 "g"   => \$opt_g, "rrdgraph"     => \$opt_g,
+                 "D=s" => \$opt_D, "directory=s"  => \$opt_D,
+                 "i=s" => \$opt_i, "interface=s"  => \$opt_i,
+                 "v=s" => \$opt_v, "snmp=s"       => \$opt_v,
+                 "C=s" => \$opt_C, "community=s"  => \$opt_C,
+                 "w=s" => \$opt_w, "warning=s"    => \$opt_w,
+                 "c=s" => \$opt_c, "critical=s"   => \$opt_c,
+                 "S=s" => \$opt_S, "ServiceId=s"  => \$opt_S,
+                 "H=s" => \$opt_H, "hostname=s"   => \$opt_H,
+                 "T=s" => \$opt_T, "Speed=s"      => \$opt_T,
+     			 "rrd_step=s" => \$opt_step,
+                 );
+
+my $PROGNAME = "check_graph_traffic_rrd";
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+
+
+sub print_help () {
+    print "\n";
+    print_revision($PROGNAME,'Revision: 1.1 ');
+    print "\n";
+    print_usage();
+    print "\n";
+    support();
+    print "\n";
+}
+
+sub main () {
+
+##
+## Plugin var init
+##
+    my ($in_usage, $out_usage, $in_prefix, $out_prefix, $in_traffic, $out_traffic);
+    my ($host, $snmp, $community);
+    my ($interface, $ServiceId, $critical, $warning, $rrd, $start, $name);
+    my $ERROR;
+    my $result;
+    my ($in_bits, $out_bits, $speed, $ds_names, $step, $data);
+    my @valeur;
+    my $i = 0;
+    my ($line, $update_time, $rrdstep, $rrdheartbeat, $bitcounter);
+    my $not_traffic = 1;
+
+    my $OID_IN =$oreon{MIB2}{IF_IN_OCTET};
+	my $OID_OUT = $oreon{MIB2}{IF_OUT_OCTET};
+	my $OID_SPEED = $oreon{MIB2}{IF_SPEED};
+	my $OID_DESC = $oreon{MIB2}{IF_DESC};
+
+    if ($opt_V) { print_revision ($PROGNAME, "Revision: 1.1 "); exit $ERRORS{'OK'}; }
+    if ($opt_h) { print_help(); exit $ERRORS{'OK'}; }
+    if (defined($opt_H) && $opt_H =~ m/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/) { $host = $1; } else { print_usage(); exit $ERRORS{'UNKNOWN'}; }
+    if ($opt_v) { $snmp = $opt_v; } else { $snmp = "2c"; }
+    if ($opt_C) { $community = $opt_C; } else { $community = "public"; }
+    if ($opt_s || (defined($opt_i) && $opt_i =~ /([0-9]+)/)) { $interface = $1;} else { print "\nUnknown -i number expected... or it doesn't exist, try another interface - number\n"; }
+    if ($opt_g) {
+    ($opt_S) || ($opt_S = shift) || ($opt_S = "1_1");
+		$ServiceId = is_valid_serviceid($opt_S);
+    }
+    if (defined($opt_step) && $opt_step =~ /([0-9]+)/) { $rrdstep = $1; $rrdheartbeat = $rrdstep * 2; } else { $rrdstep = 300; $rrdheartbeat = $rrdstep * 2; }
+    if (defined($opt_c) && $opt_c =~ /([0-9]+)/) { $critical = $1; } else { $critical = 95; }
+    if (defined($opt_w) && $opt_w =~ /([0-9]+)/) { $warning = $1; } else { $warning = 80; }
+    if (defined($opt_c) && defined($opt_w) && $critical <= $warning){ print "(--crit) must be superior to (--warn)"; print_usage(); exit $ERRORS{'OK'}; }
+    if (defined($opt_D) && $opt_D =~ /([-.\/\_\ A-Za-z0-9]+)/) { $pathtorrdbase = $1; }
+
+	($opt_v) || ($opt_v = shift) || ($opt_v = "1");
+	$snmp = $1 if ($opt_v =~ /(\d)/);
+
+##
+## RRDTool var init
+##
+    if ($opt_i) {
+        $OID_IN .= ".".$interface;
+        $OID_OUT .= ".".$interface;
+        $OID_SPEED .= ".".$interface;
+    }
+
+    if ($opt_g && $opt_S) {
+	    $rrd = $pathtorrdbase.$ServiceId.".rrd";
+	    $start = time;
+	    $name = $0;
+	    $name =~ s/\.pl.*//g;
+
+		##
+		## RRDTool create rrd
+		##
+
+        if (!(-e $rrd)) {
+	        $_ = `/usr/bin/snmpwalk  $host -c $community -v $snmp $OID_IN 2>/dev/null`;
+	        if ($_ =~ m/Counter(\d+)/) { $bitcounter = $1; } else { $bitcounter = 32; }
+	        $bitcounter = 2 ** $bitcounter;
+	        create_rrd ($rrd,2,$start,$rrdstep,0,$bitcounter,"COUNTER");
+      }
+    }
+
+
+##
+## Plugin snmp requests
+##
+
+  #  if ($opt_s) { $_ = `/usr/bin/snmpwalk  $host -c $community -v $snmp $OID_DESC 2>/dev/null`; print $_; exit $ERRORS{'OK'}; }
+
+
+# create a SNMP session #
+    my ( $session, $error ) = Net::SNMP->session(-hostname  => $host,-community => $community, -version  => $snmp);
+    if ( !defined($session) ) { print("UNKNOWN: $error"); exit $ERRORS{'UNKNOWN'}; }
+
+
+if ($opt_s) {
+    # Get desctiption table
+    my $result = $session->get_table(
+        Baseoid => $OID_DESC
+    );
+
+    if (!defined($result)) {
+        printf("ERROR: Description Table : %s.\n", $session->error);
+        $session->close;
+        exit $ERRORS{'UNKNOWN'};
+    }
+
+    foreach my $key ( oid_lex_sort(keys %$result)) {
+        my @oid_list = split (/\./,$key);
+        my $index = pop (@oid_list) ;
+        print "Interface $index :: $$result{$key}\n";
+    }
+exit $ERRORS{'OK'};
+}
+
+# get IN bits #
+    $result = $session->get_request( -varbindlist => [$OID_IN] );
+    if (!defined($result)) { printf("ERROR : IN : %s.\n", $session->error); $session->close; exit($ERRORS{"CRITICAL"}); }
+    $in_bits =  $result->{$OID_IN} * 8;
+
+
+# get OUT bits #
+    $result = $session->get_request( -varbindlist => [$OID_OUT] );
+    if (!defined($result)) { printf("ERROR : OUT : %s.\n", $session->error); $session->close; exit($ERRORS{"CRITICAL"}); }
+    $out_bits = $result->{$OID_OUT} * 8;
+
+
+# Get SPEED of interface #
+    if (!defined($opt_T) || $opt_T == 0) {
+	    $result = $session->get_request( -varbindlist => [$OID_SPEED] );
+	    if (!defined($result)) { printf("ERROR: %s.\n", $session->error); $session->close; exit($ERRORS{"CRITICAL"}); }
+	    $speed = $result->{$OID_SPEED};
+    }
+    else {
+	    $speed = $opt_T * 1000000;
+    }
+
+
+##
+## RRDtools update
+##
+
+    if ($opt_g) {
+        $start=time;
+    	update_rrd ($rrd,$start,$in_bits,$out_bits);
+
+	##
+	## Get the real value in rrdfile
+	##
+   # ($update_time,$step,$ds_names,$data) = RRDs::fetch($rrd, "--resolution=300","--start=now-5min","--end=now","AVERAGE");
+   #  foreach $line (@$data) {
+    #    foreach $val (@$line) {
+	#        if ( defined $val ) { $valeur[$i]=$val; } else { $valeur[$i]="undef"; }
+	#        $i++;
+   #    }
+ #   }*/
+    @valeur = fetch_rrd($rrd,"AVERAGE");
+    $in_traffic = $valeur[0];
+    $out_traffic = $valeur[1];
+  }
+
+    if (!(defined($in_traffic)) && !(defined($out_traffic))) {
+	   $not_traffic = 0;
+    } else {
+	    $in_prefix = " ";
+	    $out_prefix = " ";
+
+	    if (!($in_traffic eq "undef")) {
+	        if ($in_traffic > 1000000) {
+		        $in_usage = sprintf("%.2f",($in_traffic/($speed))*100);
+		        $in_traffic = sprintf("%.2f",$in_traffic/1000000);
+		        $in_prefix = "M";
+	        }
+	        elsif ($in_traffic > 1000) {
+		        $in_usage = sprintf("%.2f",($in_traffic/($speed))*100);
+		        $in_traffic = sprintf("%.2f",$in_traffic/1000);
+		        $in_prefix = "K";
+	        }
+	        elsif ($in_traffic < 1000) {
+		        $in_usage = sprintf("%.2f",($in_traffic/($speed))*100);
+		        $in_traffic = sprintf("%.2f",$in_traffic);
+		        $in_prefix = " ";
+	        }
+	        else {
+	        print "ERROR\n"; exit 1;
+	        }
+
+	    } else {
+	    	 $in_usage = 0 ;
+	    }
+
+	    if (!($out_traffic eq "undef")) {
+	        if ($out_traffic > 1000000) {
+		        $out_usage = sprintf("%.2f",($out_traffic/($speed))*100);
+		        $out_traffic = sprintf("%.2f",$out_traffic/1000000);
+		        $out_prefix = "M";
+	        }
+	        elsif ($out_traffic > 1000) {
+		        $out_usage = sprintf("%.2f",($out_traffic/($speed))*100);
+		        $out_traffic = sprintf("%.2f",$out_traffic/1000);
+		        $out_prefix = "K";
+	        }
+	        elsif ($out_traffic < 1000) {
+		        $out_usage = sprintf("%.2f",($out_traffic/($speed))*100);
+		        $out_traffic = sprintf("%.2f",$out_traffic);
+		        $out_prefix = " ";
+	        }
+	    } else {
+	    	$out_usage = 0 ;
+	    }
+    }
+
+##
+## Plugin return code && Status
+##
+
+    if ( $speed == 0 ) {
+	    print "CRITICAL: Interface speed equal 0! Interface must be down.\n";
+	    exit($ERRORS{"CRITICAL"});
+    }
+    else {
+	    $speed = sprintf("%.2f",($speed/1000000));
+    }
+
+    if ($not_traffic != 1) {
+	    print "Counter: IN = $in_bits bits and OUT = $out_bits bits - Traffic cannot be calculated when the last value from the rrdfile is `undef' (check if the `-g' option is enabled)\n"; exit($ERRORS{"OK"});
+    } else {
+	    if(($in_usage > $critical) || ($out_usage > $critical)) {
+	        print "CRITICAL: (".$critical."%) depassed threshold. Traffic: $in_traffic ".$in_prefix."b/s (".$in_usage."%) in, $out_traffic ".$out_prefix."b/s (".$out_usage."%) out - Speed Interface = ".$speed." Mb/s \n";
+    	    exit($ERRORS{"CRITICAL"});
+	    }
+    	if(($in_usage > $warning) || ($out_usage > $warning)) {
+	        print "WARNING: (".$warning."%) depassed threshold. Traffic: $in_traffic ".$in_prefix."b/s (".$in_usage."%) in, $out_traffic ".$out_prefix."b/s (".$out_usage."%) out - Speed Interface = ".$speed." Mb/s\n";
+    	    exit($ERRORS{"WARNING"});
+    	}
+    print "OK: Traffic: $in_traffic ".$in_prefix."b/s (".$in_usage."%) in, $out_traffic ".$out_prefix."b/s (".$out_usage."%) out - Speed Interface = ".$speed." Mb/s\n $opt_g"; exit($ERRORS{"OK"});
+    }
+}
+sub print_usage () {
+    print "\nUsage:\n";
+    print "$PROGNAME\n";
+    print "   -H (--hostname)   Hostname to query - (required)\n";
+    print "   -C (--community)  SNMP read community (defaults to public,\n";
+    print "                     used with SNMP v1 and v2c\n";
+    print "   -v (--snmp_version)  1 for SNMP v1 (default)\n";
+    print "                        2 for SNMP v2c\n";
+    print "   -g (--rrdgraph)   create  � rrd base and add datas into this one\n";
+    print "   -D (--directory)  Path to rrdatabase (or create the .rrd in this directory)\n";
+    print "                     by default: ".$pathtorrdbase."\n";
+    print "                     (The path is valid with spaces '/my\ path/...')\n";
+    print "   -s (--show)       Describes all interfaces number (debug mode)\n";
+    print "   -i (--interface)  Set the interface number (2 by default)\n";
+    print "   -T (--speed)      Set the speed interface in Mbit/s (by default speed interface capacity)\n";
+    print "   --rrdstep         Set the rrdstep in second (5 minuntes by default)\n";
+    print "   -w (--warn)       Signal strength at which a warning message will be generated\n";
+    print "                     (default 80)\n";
+    print "   -c (--crit)       Signal strength at which a critical message will be generated\n";
+    print "                     (default 95)\n";
+    print "   -S (--ServiceId)  Oreon Service Id\n";
+    print "   -V (--version)    Plugin version\n";
+    print "   -h (--help)       usage help\n\n";
+}
+
+main ();
diff --git a/plugins/src/check_graph_uptime.pl b/plugins/src/check_graph_uptime.pl
new file mode 100644
index 0000000000000000000000000000000000000000..07c8ef47f62dfb48b718299b347cb0701e1a33bd
--- /dev/null
+++ b/plugins/src/check_graph_uptime.pl
@@ -0,0 +1,212 @@
+#! /usr/bin/perl -w
+#
+# $Id: check_graph_uptime.pl,v 1.2 2005/07/27 22:21:49 wistof Exp $
+#
+# This plugin is developped under GPL Licence:
+# http://www.fsf.org/licenses/gpl.txt
+
+# Developped by Linagora SA: http://www.linagora.com
+
+# Modified for Oreon Project by : Mathieu Chateau - Christophe Coraboeuf
+# Modified For Oreon compatibility by Julien Mathis For Merethis
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# LINAGORA makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the LINAGORA web site.
+# In no event will LINAGORA be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if LINAGORA has
+# been previously advised of the possibility of such damages.
+
+# based on "graph plugins" developped by Oreon Team. See http://www.oreon.org.
+##
+## Plugin init
+##
+use strict;
+use Net::SNMP qw(:snmp);
+use FindBin;
+use lib "$FindBin::Bin";
+use lib "@NAGIOS_PLUGINS@";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+if (eval "require oreon" ) {
+	use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+	use vars qw($VERSION %oreon);
+	%oreon=get_parameters();
+} else {
+	print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+use vars qw($PROGNAME);
+use Getopt::Long;
+use vars qw($opt_h $opt_V $opt_g $opt_D $opt_S $opt_H $opt_C $opt_v $opt_d $day $opt_step);
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+
+$PROGNAME = $0;
+sub print_help ();
+sub print_usage ();
+
+Getopt::Long::Configure('bundling');
+GetOptions
+    ("h"   => \$opt_h, "help"         => \$opt_h,
+     "V"   => \$opt_V, "version"      => \$opt_V,
+     "g"   => \$opt_g, "rrdgraph"     => \$opt_g,
+     "rrd_step=s" => \$opt_step,
+     "v=s" => \$opt_v, "snmp=s"       => \$opt_v,
+     "C=s" => \$opt_C, "community=s"  => \$opt_C,
+     "S=s" => \$opt_S, "ServiceId=s"  => \$opt_S,
+     "d"   => \$opt_d, "day"     => \$opt_d,
+     "H=s" => \$opt_H, "hostname=s"   => \$opt_H);
+
+if ($opt_V) {
+    print_revision($PROGNAME,'$Revision: 1.2 $');
+    exit $ERRORS{'OK'};
+}
+
+if ($opt_h) {
+    print_help();
+    exit $ERRORS{'OK'};
+}
+
+$opt_H = shift unless ($opt_H);
+(print_usage() && exit $ERRORS{'OK'}) unless ($opt_H);
+
+
+($opt_v) || ($opt_v = shift) || ($opt_v = "1");
+my $snmp = $1 if ($opt_v =~ /(\d)/);
+
+($opt_S) || ($opt_S = shift) || ($opt_S = "1_1");
+my $ServiceId = is_valid_serviceid($opt_S);
+
+($opt_C) || ($opt_C = shift) || ($opt_C = "public");
+
+my $rrd = $pathtorrdbase.$ServiceId.".rrd";
+
+my $start=time;
+my $name = $0;
+$name =~ s/\.pl.*//g;
+my $day = 0;
+
+##
+## RRDTools create rrd
+##
+if ($opt_g) {
+    if (! -e $rrd) {
+         create_rrd($rrd,1,$start,300,"U","U","GAUGE");
+    }
+}
+
+##
+## Plugin snmp requests
+##
+
+my $OID_OBJECTID =$oreon{MIB2}{OBJECTID};
+my $OID_UPTIME_WINDOWS =$oreon{MIB2}{UPTIME_WINDOWS};
+my $OID_UPTIME_OTHER =$oreon{MIB2}{UPTIME_OTHER};
+
+# create a SNMP session
+my ( $session, $error ) = Net::SNMP->session(-hostname  => $opt_H,-community => $opt_C, -version  => $snmp);
+if ( !defined($session) ) {
+    print("CRITICAL: $error");
+    exit $ERRORS{'CRITICAL'};
+}
+
+my $result = $session->get_request(
+                                -varbindlist => [$OID_OBJECTID]
+                                   );
+if (!defined($result)) {
+    printf("UNKNOWN: %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{'UNKNOWN'};
+}
+
+my $return_result =  $result->{$OID_OBJECTID};
+my $OID = "";
+if ($return_result =~ /.*Windows.*/i ) {
+    $OID = $OID_UPTIME_WINDOWS;
+} else {
+    $OID = $OID_UPTIME_OTHER;
+}
+
+$result = $session->get_request(
+                   -varbindlist => [$OID]
+                   );
+if (!defined($result)) {
+    printf("UNKNOWN: %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{'UNKNOWN'};
+}
+
+my $un = 0;
+
+$return_result =  $result->{$OID};
+if ( $return_result =~ m/(\d*) day[s]?,\s*(\d*):(\d*):(\d*).(\d*)/ ) {
+ $un = $5 + $4 * 100 + $3 * 100 * 60 + $2 * 100 * 60 * 60 + $1 * 100 * 60 * 60 * 24;
+ $day = $1;
+}
+
+if ( $return_result =~ m/(\d*) hour.*(\d*):(\d*).(\d*)/ ) {
+ $un = $4 + $3 * 100 + $3 * 100 * 60 + $1 * 100 * 60 * 60 ;
+}
+
+if ($opt_d) {
+    $un = $day;
+}
+
+#print "un : $un\n";
+
+##
+## RRDtools update
+##
+if ($opt_g) {
+    $start=time;
+    update_rrd($rrd,$start,$un);
+}
+
+##
+## Plugin return code
+##
+
+if ($un || ( $un == 0) ){
+    if ($opt_d) {
+        print "OK - Uptime (in day): $un|uptime=".$un."hs\n";
+    } else {
+        print "OK - Uptime (in hundredths of a second): $un|uptime=".$un."hs\n";
+    }
+    exit $ERRORS{'OK'};
+}
+else{
+   print "CRITICAL Host unavailable\n";
+   exit $ERRORS{'CRITICAL'};
+}
+
+
+sub print_usage () {
+    print "\nUsage:\n";
+    print "$PROGNAME\n";
+    print "   -H (--hostname)   Hostname to query - (required)\n";
+    print "   -C (--community)  SNMP read community (defaults to public,\n";
+    print "                     used with SNMP v1 and v2c\n";
+    print "   -v (--snmp_version)  1 for SNMP v1 (default)\n";
+    print "                        2 for SNMP v2c\n";
+    print "   -g (--rrdgraph)   create a rrd base and add datas into this one\n";
+    print "   -D (--directory)  Path to rrdatabase (or create the .rrd in this directory)\n";
+    print "                     by default: ".$pathtorrdbase."\n";
+    print "                     (The path is valid with spaces '/my\ path/...')\n";
+    print "   -S (--ServiceId)  Oreon Service Id\n";
+    print "   -d (--day)        Uptime in day\n";
+    print "   -V (--version)    Plugin version\n";
+    print "   -h (--help)       usage help\n";
+
+}
+
+sub print_help () {
+    print "Copyright (c) 2005 Linagora\n";
+    print "Modified by Merethis \n";
+    print "Bugs to http://www.linagora.com/\n";
+    print "\n";
+    print_usage();
+    print "\n";
+}
diff --git a/plugins/src/check_meta_service.pl b/plugins/src/check_meta_service.pl
new file mode 100644
index 0000000000000000000000000000000000000000..4696f9ac5c3ce1e4156e215ad783eca359cf47c8
--- /dev/null
+++ b/plugins/src/check_meta_service.pl
@@ -0,0 +1,362 @@
+#! /usr/bin/perl -w
+#
+# $Id: check_meta_service.pl,v 1.2 2005/07/27 22:21:49 Julio $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Developped by : Julien Mathis - Romain Le Merlus
+#
+# Developped by Julien Mathis for Merethis SARL 
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+##
+## Plugin init
+##
+
+use strict;
+use DBI;
+use vars qw($PROGNAME);
+use Getopt::Long;
+use vars qw($opt_V $opt_H $opt_h $opt_i);
+use lib "@NAGIOS_PLUGINS@";
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+## For Debug mode = 1
+my $debug = 0;
+
+sub print_help ();
+sub print_usage ();
+
+Getopt::Long::Configure('bundling');
+GetOptions
+    ("h" => \$opt_h, 
+     "help" => \$opt_h,
+     "V" => \$opt_V, 
+     "H" => \$opt_H,
+     "i=s" => \$opt_i);
+
+
+my $dbh = DBI->connect("DBI:mysql:database=oreon;host=localhost",
+                         "root", "",
+                         {'RaiseError' => 1});
+
+my $str1 = "SELECT * FROM `cfg_perfparse`";
+if ($debug) {print $str1 . "\n";}
+my $sth1 = $dbh->prepare($str1);
+if (!$sth1->execute) {
+    die "Error:" . $sth1->errstr . "\n";
+}
+my $ref1 = $sth1->fetchrow_hashref();
+
+my $dbh2 = DBI->connect("DBI:".$ref1->{'Storage_Modules_Load'}.":database=".$ref1->{'DB_Name'}.";host=".$ref1->{'DB_Host'},
+                         $ref1->{'DB_User'}, $ref1->{'DB_Pass'},
+                         {'RaiseError' => 1});
+
+if ($opt_V) {
+    print_revision($PROGNAME,'$Revision: 0.1 $');
+    exit $ERRORS{'OK'};
+}
+
+if ($opt_h) {
+    print_help();
+    exit $ERRORS{'OK'};
+}
+
+my $result;
+my $warning;
+my $critical;
+my $metric_id;
+
+sub return_value($$$){
+    
+    #print "warning : ".$warning."-Critical : ".$critical.":$result\b";
+    
+    if ($warning ne $critical){
+	if ($warning < $critical){ # Bon sens
+	    if ($result < $warning){
+		print "OK result : " . $result . "|OMS=" . $result . ";".$warning.";".$critical."\n";
+		exit $ERRORS{'OK'};
+	    } elsif (($result >= $warning) && ($result < $critical)){
+		print "WARNING result : " . $result . "|OMS=" . $result . ";".$warning.";".$critical."\n";
+		exit $ERRORS{'WARNING'};
+	    } elsif ($result >= $critical){
+		print "CRITICAL result : " . $result . "|OMS=" . $result . ";".$warning.";".$critical."\n";
+		exit $ERRORS{'CRITICAL'};
+	    }
+	} else { # sens inverse
+	    if ($result < $critical){
+	    print "CRITICAL result : " . $result . "|OMS=" . $result . ";".$warning.";".$critical."\n";	    
+		exit $ERRORS{'CRITICAL'};
+	    } elsif ($result >= $critical && $result < $warning){
+		print "WARNING result : " . $result . "|OMS=" . $result . ";".$warning.";".$critical."\n";
+		exit $ERRORS{'WARNING'};
+	    } elsif ($result >= $warning){
+		print "OK result : " . $result . "|OMS=" . $result . ";".$warning.";".$critical."\n";
+		exit $ERRORS{'OK'};
+	    } else{
+		print "OK result : " . $result . "|OMS=" . $result . ";".$warning.";".$critical."\n";
+		exit $ERRORS{'OK'};
+	    }
+	}
+    } else {
+	print "ERROR : warnig level = critical level";
+	exit $ERRORS{'CRITICAL'};
+    }
+}
+
+my $ref;
+my $svc_id;
+my $metric;
+my $host_id;
+
+## Get Value by metric Option
+
+sub get_value_in_database_metric_id($$$$){
+    ## Get last entry in perfparse database for this service
+    my $str = "SELECT value FROM perfdata_service_metric,perfdata_service_bin WHERE perfdata_service_metric.metric_id = '".$metric_id."' AND perfdata_service_metric.last_perfdata_bin = perfdata_service_bin.id";
+    if ($debug) {print $str . "\n";}
+    my $sth_deb2 = $dbh2->prepare($str);
+    if (!$sth_deb2->execute) {die "Error:" . $sth_deb2->errstr . "\n";}
+    my $sth_deb2_data = $sth_deb2->fetchrow_hashref();
+    return $sth_deb2_data->{'value'};
+}
+
+## Get value For Regexp Options
+
+sub get_value_in_database($$$$$){
+
+    my $str;
+    ## Get hostname and service description for perfparse request
+    
+    $str = "SELECT host_name,service_description FROM host,host_service_relation,service WHERE host.host_id = host_service_relation.host_host_id AND 
+service.service_id = host_service_relation.service_service_id AND service.service_id = '".$svc_id."'";
+    
+    if ($debug) {print $str . "\n";}
+    my $host_data = $dbh->prepare($str);
+    if (!$host_data->execute) {die "Error:" . $host_data->errstr . "\n";}
+    my $data = $host_data->fetchrow_hashref();
+    
+    ## Get last entry in perfparse database for this service
+    my $sth_deb2 = $dbh2->prepare("SELECT value FROM perfdata_service_metric,perfdata_service_bin WHERE perfdata_service_metric.host_name = '".$data->{'host_name'}."' AND perfdata_service_metric.service_description = '".$data->{'service_description'}."' AND perfdata_service_metric.last_perfdata_bin = perfdata_service_bin.id AND perfdata_service_metric.metric = '".$metric."'");
+    if (!$sth_deb2->execute) {die "Error:" . $sth_deb2->errstr . "\n";}
+    my $sth_deb2_data = $sth_deb2->fetchrow_hashref();
+    return $sth_deb2_data->{'value'};
+}
+
+sub get_value_in_database_by_host($$$$$){
+
+    my $str;
+    
+    ## Get hostname and service description for perfparse request
+    
+    $str = "SELECT host_name,service_description FROM host,host_service_relation,service WHERE host.host_id = host_service_relation.host_host_id AND service.service_id = host_service_relation.service_service_id AND service.service_id = '".$svc_id."'";
+    if ($debug) {print $str . "\n";}
+    my $host_data = $dbh->prepare($str);
+    if (!$host_data->execute) {die "Error:" . $host_data->errstr . "\n";}
+    my $data = $host_data->fetchrow_hashref();
+
+    ## Get last entry in perfparse database for this service
+
+    my $sth_deb2 = $dbh2->prepare("SELECT value FROM perfdata_service_metric,perfdata_service_bin WHERE perfdata_service_metric.host_name = '".$data->{'host_name'}."' AND perfdata_service_metric.service_description = '".$data->{'service_description'}."' AND perfdata_service_metric.last_perfdata_bin = perfdata_service_bin.id AND perfdata_service_metric.metric = '".$metric."'");
+    if (!$sth_deb2->execute) {die "Error:" . $sth_deb2->errstr . "\n";}
+    my $sth_deb2_data = $sth_deb2->fetchrow_hashref();
+    return $sth_deb2_data->{'value'};
+}
+
+sub get_value_in_database_by_hg($$$$$$){
+
+    my $str;
+   
+    ## Get hostname 
+    
+    $str = "SELECT host_name FROM host WHERE host.host_id = '".$host_id."'";
+    if ($debug) {print $str . "\n";}
+    my $hd = $dbh->prepare($str);
+    if (!$hd->execute) {die "Error:" . $hd->errstr . "\n";}
+    my $host_data = $hd->fetchrow_hashref();
+   
+    ## Get service description
+    
+    $str = "SELECT service_description FROM service WHERE service.service_id = '".$svc_id."'";
+    if ($debug) {print $str . "\n";}
+    my $sd = $dbh->prepare($str);
+    if (!$sd->execute) {die "Error:" . $sd->errstr . "\n";}
+    my $service_data = $sd->fetchrow_hashref();
+    
+    ## Get last entry in perfparse database for this service
+    
+    my $sth_deb2 = $dbh2->prepare("SELECT value FROM perfdata_service_metric,perfdata_service_bin WHERE perfdata_service_metric.host_name = '".$host_data->{'host_name'}."' AND perfdata_service_metric.service_description = '".$service_data->{'service_description'}."' AND perfdata_service_metric.last_perfdata_bin = perfdata_service_bin.id AND perfdata_service_metric.metric = '".$metric."'");
+    if (!$sth_deb2->execute) {die "Error:" . $sth_deb2->errstr . "\n";}
+    my $sth_deb2_data = $sth_deb2->fetchrow_hashref();
+    return $sth_deb2_data->{'value'};
+}
+
+my $cpt = 0;
+my $total = 0;
+my $max = 0;
+my $min = 999999999;
+my $svc;
+my $value = 0;
+
+if ($opt_i){
+    
+    my $str;
+    # get osl info
+    my $sth = $dbh->prepare("SELECT calcul_type,regexp_str,warning,critical,metric, meta_select_mode FROM meta_service WHERE meta_id = '".$opt_i."'");
+    if (!$sth->execute) {die "Error:" . $sth->errstr . "\n";}
+    $ref = $sth->fetchrow_hashref();
+    if (!defined($ref->{'calcul_type'})){
+	print "Unvalidate Meta Service\n";
+	exit $ERRORS{'CRITICAL'};
+    }
+    
+    $warning = $ref->{'warning'};
+    $critical = $ref->{'critical'};
+    
+    # Get Service List by regexp
+    
+    if ($ref->{'meta_select_mode'} eq '2'){
+	
+	###############################################
+	
+	$str = "SELECT service_id FROM service WHERE `service_description` LIKE '".$ref->{'regexp_str'}."' AND service_activate = '1' AND service_register = '1'";
+	if ($debug) {print $str . "\n";}
+	$sth = $dbh->prepare($str);
+	if (!$sth->execute) {die "Error:" . $sth->errstr . "\n";}
+	while ($svc = $sth->fetchrow_hashref()){
+	    my $sth2 = $dbh->prepare("SELECT * FROM host_service_relation WHERE service_service_id = '".$svc->{'service_id'}."'");
+	    if (!$sth2->execute) {die "Error:" . $sth2->errstr . "\n";}
+	    my $svc_relation = $sth2->fetchrow_hashref();
+	    if (defined($svc_relation->{'host_host_id'})){
+    		
+    		#### Par Host
+    		
+		if (defined($svc->{'service_id'})){$svc_id = $svc->{'service_id'};} else {$svc_id = $svc->{'svc_id'};}
+		if (defined($ref->{'regexp_str'})){$metric = $ref->{'metric'};} else {$metric = $svc->{'metric'};}
+		$value = get_value_in_database_by_host($dbh,$dbh2,$svc_id,$metric,$debug);			    
+		if ($ref->{'calcul_type'} =~ "AVE"){			
+		    if (defined($value) && $value){$total += $value;}
+		    if ($debug) {print "total = " . $total . "  value = ".$value."\n";} 
+		    $cpt++;
+		    $result = $total / $cpt;
+		} elsif ($ref->{'calcul_type'} =~ "SOM"){
+		    if ($value){$total += $value;}
+		    if ($debug){print "total = " . $total . "  value = ".$value."\n";} 
+		    $result = $total;
+		} elsif ($ref->{'calcul_type'} =~ "MIN"){
+		    if ($debug){print " min : " . $min . "  value = ".$value."\n";} 
+		    if ($value && $value <= $min){$min = $value;}
+		    $result = $min;
+		} elsif ($ref->{'calcul_type'} =~ "MAX"){
+		    if ($debug){print "max = " . $max . "  value = ".$value."\n";}
+		    if ($value && $value >= $max){$max = $value;}
+		    $result = $max;
+		}
+	    } else {
+ 
+		### Par Hostgroup
+
+		my $sth3 = $dbh->prepare("SELECT host_host_id FROM hostgroup_relation WHERE hostgroup_hg_id = '".$svc_relation->{'hostgroup_hg_id'}."'");
+	    	if (!$sth3->execute) {die "Error:" . $sth3->errstr . "\n";}
+	    	while ($svc_relation = $sth3->fetchrow_hashref()){
+		    if (defined($svc->{'service_id'})){$svc_id = $svc->{'service_id'};} else {$svc_id = $svc->{'svc_id'};}
+		    if (defined($ref->{'regexp_str'})){$metric = $ref->{'metric'};} else {$metric = $svc->{'metric'};}
+		    $host_id = $svc_relation->{'host_host_id'};
+		    $value = get_value_in_database_by_hg($dbh,$dbh2,$svc_id, $host_id, $metric, $debug);			    
+		    if ($ref->{'calcul_type'} =~ "AVE"){			
+			if (defined($value) && $value){$total += $value;}
+			if ($debug) {print "total = " . $total . "  value = ".$value."\n";} 
+			$cpt++;
+		    } elsif ($ref->{'calcul_type'} =~ "SOM"){
+			if ($value){$total += $value;}
+			if ($debug){print "total = " . $total . "  value = ".$value."\n";} 
+		    } elsif ($ref->{'calcul_type'} =~ "MIN"){
+			if ($debug){print " min : " . $min . "  value = ".$value."\n";} 
+			if ($value && $value <= $min){$min = $value;}
+		    } elsif ($ref->{'calcul_type'} =~ "MAX"){
+			if ($debug){print "max = " . $max . "  value = ".$value."\n";}
+			if ($value && $value >= $max){$max = $value;}
+		    }
+		}
+		if ($ref->{'calcul_type'} =~ "AVE"){
+		    $result = $total / $cpt;
+		} elsif ($ref->{'calcul_type'} =~ "SOM"){
+		    $result = $total;
+		} elsif ($ref->{'calcul_type'} =~ "MIN"){
+		    $result = $min;
+		} elsif ($ref->{'calcul_type'} =~ "MAX"){
+		    $result = $max;
+		}
+	    }
+	}
+	return_value($result, $warning, $critical);
+	###############################################
+    } else {
+	$sth = $dbh->prepare("SELECT metric_id FROM `meta_service_relation` WHERE meta_id = '".$opt_i."'");
+	if (!$sth->execute) {die "Error:" . $sth->errstr . "\n";}
+	if ($ref->{'calcul_type'} =~ "AVE"){
+	    while ($svc = $sth->fetchrow_hashref()){
+		if (defined($svc->{'metric_id'})){$metric_id = $svc->{'metric_id'};}
+		$value = get_value_in_database_metric_id($dbh,$dbh2,$metric_id,$debug);
+		if (defined($value) && $value){$total += $value;}
+		$cpt++;
+	    }
+	    $result = $total / $cpt;
+	} elsif ($ref->{'calcul_type'} =~ "SOM"){
+	    while ($svc = $sth->fetchrow_hashref()){
+		if (defined($svc->{'metric_id'})){$metric_id = $svc->{'metric_id'};}
+		$value = get_value_in_database_metric_id($dbh,$dbh2,$metric_id,$debug);
+		if ($value){$total += $value;}
+		if ($debug){print "total = " . $total . "  value = ".$value."\n";} 
+	    }
+	    $result = $total;
+	} elsif ($ref->{'calcul_type'} =~ "MIN"){
+	    while ($svc = $sth->fetchrow_hashref()){
+		if (defined($svc->{'metric_id'})){$metric_id = $svc->{'metric_id'};}
+		$value = get_value_in_database_metric_id($dbh,$dbh2,$metric_id,$debug);
+		if ($debug){print " min : " . $min . "  value = ".$value."\n";} 
+		if ($value && $value <= $min){$min = $value;}
+	    }
+	    $result = $min;
+	} elsif ($ref->{'calcul_type'} =~ "MAX"){
+	    while ($svc = $sth->fetchrow_hashref()){
+		if (defined($svc->{'metric_id'})){$metric_id = $svc->{'metric_id'};}
+		$value = get_value_in_database_metric_id($dbh,$dbh2,$metric_id,$debug);
+		if ($debug){print "max = " . $max . "  value = ".$value."\n";}
+		if ($value && $value >= $max){$max = $value;}
+	    }
+	    $result = $max;
+	}     
+	return_value($result, $warning, $critical);
+    }
+}
+
+
+sub print_usage () {
+    print "Usage:\n";
+    print " check_osl.pl\n";
+    print "   -H		Hostname to query (Required)\n";
+    print "   -i		OSL id\n";
+    print "   -V (--version)    Plugin version\n";
+    print "   -h (--help)       usage help\n";
+}
+
+sub print_help () 
+{
+    print "###########################################\n";
+    print "#                                         #\n";
+    print "#  Copyright (c) 2004-2006 Merethis       #\n";
+    print "#  Bugs to http://www.oreon-services.com  #\n";
+    print "#                                         #\n";
+    print "###########################################\n";
+    print_usage();
+    print "\n";
+}
diff --git a/plugins/src/check_snmp_cpfw.pl b/plugins/src/check_snmp_cpfw.pl
new file mode 100644
index 0000000000000000000000000000000000000000..7ea3bc60819e78606e61f89f2109ef8517e5c78a
--- /dev/null
+++ b/plugins/src/check_snmp_cpfw.pl
@@ -0,0 +1,534 @@
+#!/usr/bin/perl -w
+############################## check_snmp_cpfw ##############
+# Version : 0.7
+# Date : Oct 02 2004
+# Author  : Patrick Proy (patrick at proy.org)
+# Help : http://www.manubulon.com/nagios/
+# Licence : GPL - http://www.fsf.org/licenses/gpl.txt
+# TODO :
+# - check sync method
+#################################################################
+#
+# Help : ./check_snmp_cpfw.pl -h
+#
+
+use strict;
+use Net::SNMP;
+use Getopt::Long;
+
+# Nagios specific
+
+use lib "@NAGIOS_PLUGINS@";
+use utils qw(%ERRORS $TIMEOUT);
+#my $TIMEOUT = 15;
+#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+# Oreon specific
+
+if (eval "require oreon" ) {
+  use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+  use vars qw($VERSION %oreon);
+  %oreon=get_parameters();
+} else {
+  print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+
+
+########### SNMP Datas ###########
+
+###### FW data
+my $policy_state	= "1.3.6.1.4.1.2620.1.1.1.0"; # "Installed"
+my $policy_name		= "1.3.6.1.4.1.2620.1.1.2.0"; # Installed policy name
+my $connections		= "1.3.6.1.4.1.2620.1.1.25.3.0"; # number of connections
+#my $connections_peak	= "1.3.6.1.4.1.2620.1.1.25.4.0"; # peak number of connections
+my @fw_checks 		= ($policy_state,$policy_name,$connections);
+
+###### SVN data
+my $svn_status		= "1.3.6.1.4.1.2620.1.6.102.0"; # "OK" svn status
+my %svn_checks		= ($svn_status,"OK");
+my %svn_checks_n	= ($svn_status,"SVN status");
+my @svn_checks_oid	= ($svn_status);
+
+###### HA data
+
+my $ha_active		= "1.3.6.1.4.1.2620.1.5.5.0"; 	# "yes"
+my $ha_state		= "1.3.6.1.4.1.2620.1.5.6.0"; 	# "active"
+my $ha_block_state	= "1.3.6.1.4.1.2620.1.5.7.0"; 	#"OK" : ha blocking state
+my $ha_status		= "1.3.6.1.4.1.2620.1.5.102.0"; # "OK" : ha status
+
+my %ha_checks		=( $ha_active,"yes",$ha_state,"active",$ha_block_state,"OK",$ha_status,"OK");
+my %ha_checks_n		=( $ha_active,"HA active",$ha_state,"HA state",$ha_block_state,"HA block state",$ha_status,"ha_status");
+my @ha_checks_oid	=( $ha_active,$ha_state,$ha_block_state,$ha_status);
+
+my $ha_mode		= "1.3.6.1.4.1.2620.1.5.11.0";  # "Sync only" : ha Working mode
+
+my $ha_tables		= "1.3.6.1.4.1.2620.1.5.13.1"; 	# ha status table
+my $ha_tables_index	= ".1";
+my $ha_tables_name	= ".2";
+my $ha_tables_state	= ".3"; # "OK"
+my $ha_tables_prbdesc	= ".6"; # Description if state is != "OK"
+
+#my @ha_table_check	= ("Synchronization","Filter","cphad","fwd"); # process to check
+
+####### MGMT data
+
+my $mgmt_status		= "1.3.6.1.4.1.2620.1.7.5.0";	# "active" : management status
+my $mgmt_alive		= "1.3.6.1.4.1.2620.1.7.6.0";   # 1 : management is alive if 1
+my $mgmt_stat_desc	= "1.3.6.1.4.1.2620.1.7.102.0"; # Management status description
+my $mgmt_stats_desc_l	= "1.3.6.1.4.1.2620.1.7.103.0"; # Management status long description
+
+my %mgmt_checks		= ($mgmt_status,"active",$mgmt_alive,"1");
+my %mgmt_checks_n	= ($mgmt_status,"Mgmt status",$mgmt_alive,"Mgmt alive");
+my @mgmt_checks_oid	= ($mgmt_status,$mgmt_alive);
+
+#################################### Globals ##############################""
+
+my $Version='0.7';
+
+my $o_host = 	undef; 		# hostname
+my $o_community = undef; 	# community
+my $o_port = 	161; 		# port
+my $o_help=	undef; 		# wan't some help ?
+my $o_verb=	undef;		# verbose mode
+my $o_version=	undef;		# print version
+my $o_warn=	undef;		# Warning for connections
+my $o_crit=	undef;		# Crit for connections
+my $o_svn=	undef;		# Check for SVN status
+my $o_fw=	undef;		# Check for FW status
+my $o_ha=	undef;		# Check for HA status
+my $o_mgmt=	undef;		# Check for management status
+my $o_policy=	undef;		# Check for policy name
+my $o_conn=	undef;		# Check for connexions
+my $o_perf=	undef;		# Performance data output
+
+# SNMPv3 specific
+my $o_login=	undef;		# Login for snmpv3
+my $o_passwd=	undef;		# Pass for snmpv3
+
+# Oreon specific
+my $o_step=	undef;
+my $o_g=	undef;
+my $o_S=	undef;
+my $step=	undef;
+my $rrd=	undef;
+my $start=	undef;
+my $ServiceId=	undef;
+my @rrd_data= undef;
+
+
+# functions
+
+sub p_version { print "check_snmp_cpfw version : $Version\n"; }
+
+sub print_usage {
+    print "Usage: $0 [-v] -H <host> -C <snmp_community> | (-l login -x passwd) [-s] [-w [-p=pol_name] [-c=warn,crit]] [-m] [-a] [-f] [-p <port>] [-t <timeout>] [-V]\n";
+}
+
+sub isnnum { # Return true if arg is not a number
+  my $num = shift;
+  if ( $num =~ /^(\d+\.?\d*)|(^\.\d+)$/ ) { return 0 ;}
+  return 1;
+}
+
+sub help {
+   print "\nSNMP Checkpoint FW-1 Monitor for Nagios version ",$Version,"\n";
+   print "(c)2004 - to my cat Ratoune\n\n";
+   print_usage();
+   print <<EOT;
+-v, --verbose
+   print extra debugging information (including interface list on the system)
+-h, --help
+   print this help message
+-H, --hostname=HOST
+   name or IP address of host to check
+-C, --community=COMMUNITY NAME
+   community name for the host's SNMP agent (implies v1 protocol)
+-s, --svn
+   check for svn status
+-w, --fw
+   check for fw status
+-a, --ha
+   check for ha status
+-m, --mgmt
+   check for management status
+-p, --policy=POLICY_NAME
+   check if installed policy is POLICY_NAME (must have -w)
+-c, --connexions=WARN,CRIT
+   check warn and critical number of connexions (must have -w)
+-f, --perfparse
+   perfparse output (only works with -c)
+-l, --login=LOGIN
+   Login for snmpv3 authentication (implies v3 protocol with MD5)
+-x, --passwd=PASSWD
+   Password for snmpv3 authentication
+-P, --port=PORT
+   SNMP port (Default 161)
+-t, --timeout=INTEGER
+   timeout for SNMP (Default: Nagios default)
+-V, --version
+   prints version number
+-g (--rrdgraph)   Create a rrd base if necessary and add datas into this one
+--rrd_step	     Specifies the base interval in seconds with which data will be fed into the RRD (300 by default)
+-S (--ServiceId)  Oreon Service Id
+
+EOT
+}
+
+# For verbose output
+sub verb { my $t=shift; print $t,"\n" if defined($o_verb) ; }
+
+sub check_options {
+    Getopt::Long::Configure ("bundling");
+    GetOptions(
+   	'v'	=> \$o_verb,		'verbose'	=> \$o_verb,
+        'h'     => \$o_help,    	'help'        	=> \$o_help,
+        'H:s'   => \$o_host,		'hostname:s'	=> \$o_host,
+        'P:i'   => \$o_port,   		'port:i'	=> \$o_port,
+        'C:s'   => \$o_community,	'community:s'	=> \$o_community,
+	'l:s'	=> \$o_login,		'login:s'	=> \$o_login,
+	'x:s'	=> \$o_passwd,		'passwd:s'	=> \$o_passwd,
+        't:i'   => \$TIMEOUT,    	'timeout:i'	=> \$TIMEOUT,
+	'V'	=> \$o_version,		'version'	=> \$o_version,
+	's'	=> \$o_svn,		'svn'		=> \$o_svn,
+	'w'	=> \$o_fw,		'fw'		=> \$o_fw,
+	'a'	=> \$o_ha,		'ha'		=> \$o_ha,
+	'm'	=> \$o_mgmt,		'mgmt'		=> \$o_mgmt,
+	'p:s'	=> \$o_policy,		'policy:s'	=> \$o_policy,
+	'c:s'	=> \$o_conn,		'connexions:s'	=> \$o_conn,
+	'f'	=> \$o_perf,		'perfparse'	=> \$o_perf,
+	# For Oreon rrdtool graph
+  "rrd_step:s" => \$o_step,
+  "g"   => \$o_g, "rrdgraph"     => \$o_g,
+  "S=s" => \$o_S, "ServiceId=s"  => \$o_S
+    );
+    if (defined ($o_help) ) { help(); exit $ERRORS{"UNKNOWN"}};
+    if (defined($o_version)) { p_version(); exit $ERRORS{"UNKNOWN"}};
+    if ( ! defined($o_host) ) # check host and filter
+	{ print_usage(); exit $ERRORS{"UNKNOWN"}}
+    # check snmp information
+    if ( !defined($o_community) && (!defined($o_login) || !defined($o_passwd)) )
+	{ print "Put snmp login info!\n"; print_usage(); exit $ERRORS{"UNKNOWN"}}
+    # Check firewall options
+    if ( defined($o_conn)) {
+      if ( ! defined($o_fw))
+ 	{ print "Cannot check connexions without checking fw\n"; print_usage(); exit $ERRORS{"UNKNOWN"}}
+      my @warncrit=split(/,/ , $o_conn);
+      if ( $#warncrit != 1 )
+        { print "Put warn,crit levels with -c option\n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+      ($o_warn,$o_crit)=@warncrit;
+      if ( isnnum($o_warn) || isnnum($o_crit) )
+	{ print "Numeric values for warning and critical in -c options\n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+      if ($o_warn >= $o_crit)
+	{ print "warning <= critical ! \n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+    }
+    if ( defined($o_policy)) {
+      if (! defined($o_fw))
+	{ print "Cannot check policy name without checking fw\n"; print_usage(); exit $ERRORS{"UNKNOWN"}}
+      if ($o_policy eq "")
+        { print "Put a policy name !\n"; print_usage(); exit $ERRORS{"UNKNOWN"}}
+    }
+    if (defined($o_perf) && ! defined ($o_conn))
+	{ print "Nothing selected for perfparse !\n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+    if (!defined($o_fw) && !defined($o_ha) && !defined($o_mgmt) && !defined($o_svn))
+	{ print "Must select a product to check !\n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+
+	###### Oreon #######
+
+	if (!defined($o_S)) { $o_S="1_1" }
+	$ServiceId = is_valid_serviceid($o_S);
+
+	if (!defined($o_step)) { $o_step="300" }
+	$step = $1 if ($o_step =~ /(\d+)/);
+
+}
+
+########## MAIN #######
+
+check_options();
+
+$rrd = $pathtorrdbase.$ServiceId.".rrd";
+$start=time;
+
+# Check gobal timeout if snmp screws up
+alarm($TIMEOUT+15);
+
+# Connect to host
+my ($session,$error);
+if ( defined($o_login) && defined($o_passwd)) {
+  # SNMPv3 login
+  verb("SNMPv3 login");
+  ($session, $error) = Net::SNMP->session(
+      -hostname   	=> $o_host,
+      -version		=> '3',
+      -username		=> $o_login,
+      -authpassword	=> $o_passwd,
+      -authprotocol	=> 'md5',
+      -privpassword	=> $o_passwd
+   );
+} else {
+  # SNMPV1 login
+  ($session, $error) = Net::SNMP->session(
+     -hostname  => $o_host,
+     -community => $o_community,
+     -port      => $o_port,
+     -timeout   => $TIMEOUT
+  );
+}
+if (!defined($session)) {
+   printf("ERROR opening session: %s.\n", $error);
+   exit $ERRORS{"UNKNOWN"};
+}
+
+########### Global checks #################
+
+my $global_status=0; # global status : 0=OK, 1=Warn, 2=Crit
+my ($resultat,$key)=(undef,undef);
+
+##########  Check SVN status #############
+my $svn_print="";
+my $svn_state=0;
+
+if (defined ($o_svn)) {
+
+$resultat = $session->get_request(
+    Varbindlist => \@svn_checks_oid
+);
+
+  if (defined($resultat)) {
+    foreach $key ( keys %svn_checks) {
+      verb("$svn_checks_n{$key} : $svn_checks{$key} / $$resultat{$key}");
+      if ( $$resultat{$key} ne $svn_checks{$key} ) {
+	$svn_print .= $svn_checks_n{$key} . ":" . $$resultat{$key} . " ";
+	$svn_state=2;
+      }
+    }
+  } else {
+    $svn_print .= "cannot find oids";
+    #Critical state if not found because it means soft is not activated
+    $svn_state=2;
+  }
+
+  if ($svn_state == 0) {
+    $svn_print="SVN : OK";
+  } else {
+    $svn_print="SVN : " . $svn_print;
+  }
+  verb("$svn_print");
+}
+##########  Check mgmt status #############
+my $mgmt_state=0;
+my $mgmt_print="";
+
+if (defined ($o_mgmt)) {
+# Check all states
+  $resultat=undef;
+  $resultat = $session->get_request(
+      Varbindlist => \@mgmt_checks_oid
+  );
+  if (defined($resultat)) {
+    foreach $key ( keys %mgmt_checks) {
+      verb("$mgmt_checks_n{$key} : $mgmt_checks{$key} / $$resultat{$key}");
+      if ( $$resultat{$key} ne $mgmt_checks{$key} ) {
+        $mgmt_print .= $mgmt_checks_n{$key} . ":" . $$resultat{$key} . " ";
+        $mgmt_state=2;
+      }
+    }
+  } else {
+    $mgmt_print .= "cannot find oids";
+    #Critical state if not found because it means soft is not activated
+    $mgmt_state=2;
+  }
+  if ($mgmt_state == 0) {
+    $mgmt_print="MGMT : OK";
+  } else {
+    $mgmt_print="MGMT : " . $mgmt_print;
+  }
+  verb("$svn_print");
+}
+
+########### Check fw status  ##############
+
+my $fw_state=0;
+my $fw_print="";
+my $perf_conn=undef;
+
+if (defined ($o_fw)) {
+
+# Check all states
+
+  $resultat = $session->get_request(
+      Varbindlist => \@fw_checks
+  );
+  if (defined($resultat)) {
+    verb("State : $$resultat{$policy_state}");
+    verb("Name : $$resultat{$policy_name}");
+    verb("connections : $$resultat{$connections}");
+
+    if ($$resultat{$policy_state} ne "Installed") {
+      $fw_state=2;
+      $fw_print .= "Policy:". $$resultat{$policy_state}." ";
+      verb("Policy state not installed");
+    }
+
+    if (defined($o_policy)) {
+      if ($$resultat{$policy_name} ne $o_policy) {
+	$fw_state=2;
+	$fw_print .= "Policy installed : $$resultat{$policy_name}";
+      }
+    }
+
+    if (defined($o_conn)) {
+      if ($$resultat{$connections} > $o_crit) {
+	$fw_state=2;
+    $fw_print .= "Connexions : ".$$resultat{$connections}." > ".$o_crit." ";
+      } else {
+	if ($$resultat{$connections} > $o_warn) {
+	  $fw_state=1;
+	  $fw_print .= "Connexions : ".$$resultat{$connections}." > ".$o_warn." ";
+	}
+      }
+      $perf_conn=$$resultat{$connections};
+
+     	##
+		## RRD management
+		##
+
+		if ($o_g) {
+			$start=time;
+			 if (! -e $rrd) {
+		        create_rrd($rrd,1,$start,$step,0,"U","GAUGE");
+		     }
+		     update_rrd($rrd,$start, $perf_conn);
+		}
+    }
+  } else {
+    $fw_print .= "cannot find oids";
+    #Critical state if not found because it means soft is not activated
+    $fw_state=2;
+  }
+
+  if ($fw_state==0) {
+    $fw_print="FW : OK";
+  } else {
+    $fw_print="FW : " . $fw_print;
+  }
+
+}
+########### Check ha status  ##############
+
+my $ha_state_n=0;
+my $ha_print="";
+
+if (defined ($o_ha)) {
+  # Check all states
+
+  $resultat = $session->get_request(
+      Varbindlist => \@ha_checks_oid
+  );
+
+  if (defined($resultat)) {
+    foreach $key ( keys %ha_checks) {
+      verb("$ha_checks_n{$key} : $ha_checks{$key} / $$resultat{$key}");
+      if ( $$resultat{$key} ne $ha_checks{$key} ) {
+	$ha_print .= $ha_checks_n{$key} . ":" . $$resultat{$key} . " ";
+	$ha_state_n=2;
+      }
+    }
+    #my $ha_mode		= "1.3.6.1.4.1.2620.1.5.11.0";  # "Sync only" : ha Working mode
+  } else {
+    $ha_print .= "cannot find oids";
+    #Critical state if not found because it means soft is not activated
+    $ha_state_n=2;
+  }
+
+  # get ha status table
+  $resultat = $session->get_table(
+	  Baseoid => $ha_tables
+  );
+  my %status;
+  my (@index,@oid) = (undef,undef);
+  my $nindex=0;
+  my $index_search= $ha_tables . $ha_tables_index;
+
+  if (defined($resultat)) {
+    foreach $key ( keys %$resultat) {
+      if ( $key =~ /$index_search/) {
+	@oid=split (/\./,$key);
+	pop(@oid);
+	$index[$nindex]=pop(@oid);
+	$nindex++;
+      }
+    }
+  } else {
+    $ha_print .= "cannot find oids" if ($ha_state_n ==0);
+    #Critical state if not found because it means soft is not activated
+    $ha_state_n=2;
+  }
+  verb ("found $nindex ha softs");
+  if ( $nindex == 0 )
+  {
+    $ha_print .= " no ha soft found" if ($ha_state_n ==0);
+    $ha_state_n=2;
+  } else {
+    my $ha_soft_name=undef;
+
+    for (my $i=0;$i<$nindex;$i++) {
+
+      $key=$ha_tables . $ha_tables_name . "." . $index[$i] . ".0";
+      $ha_soft_name= $$resultat{$key};
+
+      $key=$ha_tables . $ha_tables_state . "." . $index[$i] . ".0";
+      if (($status{$ha_soft_name} = $$resultat{$key}) ne "OK") {
+	    $key=$ha_tables . $ha_tables_prbdesc . "." . $index[$i] . ".0";
+	    $status{$ha_soft_name} = $$resultat{$key};
+	    $ha_print .= $ha_soft_name . ":" . $status{$ha_soft_name} . " ";
+	    $ha_state_n=2
+      }
+      verb ("$ha_soft_name : $status{$ha_soft_name}");
+    }
+  }
+
+  if ($ha_state_n == 0) {
+    $ha_print = "HA : OK";
+  } else {
+    $ha_print = "HA : " . $ha_print;
+  }
+
+}
+
+$session->close;
+
+########## print results and exit
+
+my $f_print=undef;
+
+if (defined ($o_fw)) { $f_print = $fw_print }
+if (defined ($o_svn)) { $f_print = (defined ($f_print)) ? $f_print . " / ". $svn_print : $svn_print }
+if (defined ($o_ha)) { $f_print = (defined ($f_print)) ? $f_print . " / ". $ha_print : $ha_print }
+if (defined ($o_mgmt)) { $f_print = (defined ($f_print)) ? $f_print . " / ". $mgmt_print : $mgmt_print }
+
+my $exit_status=undef;
+$f_print .= " / CPFW Status : ";
+if (($ha_state_n+$svn_state+$fw_state+$mgmt_state) == 0 ) {
+  $f_print .= "OK";
+  $exit_status= $ERRORS{"OK"};
+} else {
+  if (($fw_state==1) || ($ha_state_n==1) || ($svn_state==1) || ($mgmt_state==1)) {
+    $f_print .= "WARNING";
+    $exit_status= $ERRORS{"WARNING"};
+  } else {
+    $f_print .= "CRITICAL";
+    $exit_status=$ERRORS{"CRITICAL"};
+  }
+}
+
+if (defined($o_perf) && defined ($perf_conn)) {
+  $f_print .= " | fw_connexions=" . $perf_conn;
+}
+
+print "$f_print\n";
+exit $exit_status;
+
diff --git a/plugins/src/check_snmp_load.pl b/plugins/src/check_snmp_load.pl
new file mode 100644
index 0000000000000000000000000000000000000000..5b84ef8fde20772c1ab73359cb9397af57578fa1
--- /dev/null
+++ b/plugins/src/check_snmp_load.pl
@@ -0,0 +1,593 @@
+#!/usr/bin/perl -w
+############################## check_snmp_load #################
+# Version : 1.2 / BETA
+# Date : Aug 27 2005
+# Author  : Patrick Proy ( patrick at proy.org)
+# Help : http://www.manubulon.com/nagios/
+# Licence : GPL - http://www.fsf.org/licenses/gpl.txt
+# Changelog : HP Procurve
+# TODO :
+#################################################################
+#
+# Help : ./check_snmp_load.pl -h
+#
+
+use strict;
+use Net::SNMP;
+use Getopt::Long;
+
+# Nagios specific
+
+use lib "@NAGIOS_PLUGINS@";
+use utils qw(%ERRORS $TIMEOUT);
+#my $TIMEOUT = 15;
+#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+# Oreon specific
+
+
+if (eval "require oreon" ) {
+  use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+  use vars qw($VERSION %oreon);
+  %oreon=get_parameters();
+} else {
+  print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+
+# SNMP Datas
+
+# Generic with host-ressource-mib
+my $base_proc = "1.3.6.1.2.1.25.3.3.1";   # oid for all proc info
+my $proc_id   = "1.3.6.1.2.1.25.3.3.1.1"; # list of processors (product ID)
+my $proc_load = "1.3.6.1.2.1.25.3.3.1.2"; # %time the proc was not idle over last minute
+
+# Linux load
+
+my $linload_table= "1.3.6.1.4.1.2021.10.1";   # net-snmp load table
+my $linload_name = "1.3.6.1.4.1.2021.10.1.2"; # text 'Load-1','Load-5', 'Load-15'
+my $linload_load = "1.3.6.1.4.1.2021.10.1.3"; # effective load table
+
+# Cisco cpu/load
+
+my $cisco_cpu_5m = "1.3.6.1.4.1.9.2.1.58.0"; # Cisco CPU load (5min %)
+my $cisco_cpu_1m = "1.3.6.1.4.1.9.2.1.57.0"; # Cisco CPU load (1min %)
+my $cisco_cpu_5s = "1.3.6.1.4.1.9.2.1.56.0"; # Cisco CPU load (5sec %)
+
+# AS/400 CPU
+
+my $as400_cpu = "1.3.6.1.4.1.2.6.4.5.1.0"; # AS400 CPU load (10000=100%);
+
+# Net-SNMP CPU
+
+my $ns_cpu_idle   = "1.3.6.1.4.1.2021.11.11.0"; # Net-snmp cpu idle
+my $ns_cpu_user   = "1.3.6.1.4.1.2021.11.9.0";  # Net-snmp user cpu usage
+my $ns_cpu_system = "1.3.6.1.4.1.2021.11.10.0"; # Net-snmp system cpu usage
+
+# Procurve CPU
+my $procurve_cpu = "1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0"; # Procurve CPU Counter
+
+# Nokia CPU
+my $nokia_cpu = "1.3.6.1.4.1.94.1.21.1.7.1.0"; # Nokia CPU % usage
+
+# Bluecoat Appliance
+my $bluecoat_cpu = "1.3.6.1.4.1.3417.2.4.1.1.1.4.1"; # Bluecoat %cpu usage.
+
+# Linkproof Appliance
+my $linkproof_cpu= "1.3.6.1.4.1.89.35.1.53.0"; # Ressource utilisation (%) Considers network utilization and internal CPU utilization
+# 1.3.6.1.4.1.89.35.1.54 : CPU only (%)
+# 1.3.6.1.4.1.89.35.1.55 : network only (%)
+
+# CPU OID array
+my %cpu_oid = ("netsc",$ns_cpu_idle,"as400",$as400_cpu,"bc",$bluecoat_cpu,"nokia",$nokia_cpu,"hp",$procurve_cpu,"lp",$linkproof_cpu);
+
+# Globals
+
+my $Version='1.2';
+
+my $o_host = 	undef; 		# hostname
+my $o_community = undef; 	# community
+my $o_port = 	161; 		# port
+my $o_help=	undef; 		# wan't some help ?
+my $o_verb=	undef;		# verbose mode
+my $o_version=	undef;		# print version
+my $o_check_type= "stand";	# check type  : stand | netsc |  netsl | as400 | cisco | bc | nokia | hp | lp
+# For backward compatibility
+my $o_linux=	undef;		# Check linux load instead of CPU
+my $o_linuxC=	undef;		# Check Net-SNMP CPU
+my $o_as400=	undef;		# Check for AS 400 load
+my $o_cisco=	undef;		# Check for Cisco CPU
+# End compatibility
+my $o_warn=	undef;		# warning level
+my @o_warnL=	undef;		# warning levels for Linux Load or Cisco CPU
+my $o_crit=	undef;		# critical level
+my @o_critL=	undef;		# critical level for Linux Load or Cisco CPU
+my $o_timeout=  5;             	# Default 5s Timeout
+my $o_perf=     undef;          # Output performance data
+my $o_version2= undef;          # use snmp v2c
+# SNMPv3 specific
+my $o_login=	undef;		# Login for snmpv3
+my $o_passwd=	undef;		# Pass for snmpv3
+# Oreon specific
+my $o_step=	undef;
+my $o_g=	undef;
+my $o_S=	undef;
+my $step=	undef;
+my $rrd=	undef;
+my $start=	undef;
+my $ServiceId=	undef;
+
+# functions
+
+sub p_version { print "check_snmp_load version : $Version\n"; }
+
+sub print_usage {
+    print "Usage: $0 [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd)  [-p <port>] -w <warn level> -c <crit level> -T=[stand|netsl|netsc|as400|cisco|bc|nokia|hp|lp] [-f] [-t <timeout>] [-V]\n";
+}
+
+sub isnnum { # Return true if arg is not a number
+  my $num = shift;
+  if ( $num =~ /^(\d+\.?\d*)|(^\.\d+)$/ ) { return 0 ;}
+  return 1;
+}
+
+sub help {
+   print "\nSNMP Load & CPU Monitor for Nagios version ",$Version,"\n";
+   print "(c)2004 to my cat Ratoune - Author : Patrick Proy\n\n";
+   print_usage();
+   print <<EOT;
+-v, --verbose
+   print extra debugging information
+-h, --help
+   print this help message
+-H, --hostname=HOST
+   name or IP address of host to check
+-C, --community=COMMUNITY NAME
+   community name for the host's SNMP agent (implies v1 protocol)
+-2, --v2c
+   Use snmp v2c
+-l, --login=LOGIN
+   Login for snmpv3 authentication (implies v3 protocol with MD5)
+-x, --passwd=PASSWD
+   Password for snmpv3 authentication
+-P, --port=PORT
+   SNMP port (Default 161)
+-w, --warn=INTEGER | INT,INT,INT
+   warning level for cpu in percent (on one minute)
+   if -L switch then comma separated level for load-1,load-5,load-15
+   if -I switch then comma separated level for cpu 5s,cpu 1m,cpu 5m
+-c, --crit=INTEGER | INT,INT,INT
+   critical level for cpu in percent (on one minute)
+   if -L switch then comma separated level for load-1,load-5,load-15
+   if -I switch then comma separated level for cpu 5s,cpu 1m,cpu 5m
+-T, --type=stand|netsl|netsc|as400|cisco|bc|nokia|hp|lp
+  CPU check :
+    stand : standard MIBII (works with Windows),
+            can handle multiple CPU.
+    netsl : check linux load provided by Net SNMP
+    netsc : check cpu usage given by net-snmp (100-idle)
+    as400 : check as400 CPU usage
+    cisco : check cisco CPU usage
+    bc    : check bluecoat CPU usage
+    nokia : check nokia CPU usage
+    hp    : check HP procurve switch CPU usage
+    lp    : Linkproof CPU usage
+-f, --perfparse
+   Perfparse compatible output
+-t, --timeout=INTEGER
+   timeout for SNMP in seconds (Default: 5)
+-V, --version
+   prints version number
+-L, --linux, -A, --as400, -I, --cisco, -N, --netsnmp
+   These options are for backward compatibility (version<1.2)
+-g (--rrdgraph)   Create a rrd base if necessary and add datas into this one
+--rrd_step	     Specifies the base interval in seconds with which data will be fed into the RRD (300 by default)
+-S (--ServiceId)  Oreon Service Id
+EOT
+}
+
+# For verbose output
+sub verb { my $t=shift; print $t,"\n" if defined($o_verb) ; }
+
+sub check_options {
+    Getopt::Long::Configure ("bundling");
+    GetOptions(
+     'v'	=> \$o_verb,		'verbose'	=> \$o_verb,
+        'h'     => \$o_help,    	'help'        	=> \$o_help,
+        'H:s'   => \$o_host,		'hostname:s'	=> \$o_host,
+        'p:i'   => \$o_port,   		'port:i'	=> \$o_port,
+        'C:s'   => \$o_community,	'community:s'	=> \$o_community,
+  'l:s'	=> \$o_login,		'login:s'	=> \$o_login,
+  'x:s'	=> \$o_passwd,		'passwd:s'	=> \$o_passwd,
+        't:i'   => \$o_timeout,       	'timeout:i'     => \$o_timeout,
+  'V'	=> \$o_version,		'version'	=> \$o_version,
+
+  '2'     => \$o_version2,        'v2c'           => \$o_version2,
+        'c:s'   => \$o_crit,            'critical:s'    => \$o_crit,
+        'w:s'   => \$o_warn,            'warn:s'        => \$o_warn,
+        'f'     => \$o_perf,            'perfparse'     => \$o_perf,
+    'T:s'		=> \$o_check_type,			'type:s'		=> \$o_check_type,
+#  For backward compatibility
+  'L'	=> \$o_linux,		'linux'		=> \$o_linux,
+  'A'	=> \$o_as400,		'as400'		=> \$o_as400,
+  'I'	=> \$o_cisco,		'cisco'		=> \$o_cisco,
+  'N'	=> \$o_linuxC,		'netsnmp'	=> \$o_linuxC,
+# For Oreon rrdtool graph
+  "rrd_step:s" => \$o_step,
+  "g"   => \$o_g, "rrdgraph"     => \$o_g,
+  "S=s" => \$o_S, "ServiceId=s"  => \$o_S
+    );
+  # For backward compat
+  if (defined($o_linux)) { $o_check_type="netsl" }
+  if (defined($o_linuxC)) { $o_check_type="netsc" }
+  if (defined($o_as400)) { $o_check_type="as400"}
+  if (defined($o_cisco)) { $o_check_type="cisco"}
+    # TODO : check the -T option
+    if (defined ($o_help) ) { help(); exit $ERRORS{"UNKNOWN"}};
+    if (defined($o_version)) { p_version(); exit $ERRORS{"UNKNOWN"}};
+    if ( ! defined($o_host) ) # check host and filter
+  { print_usage(); exit $ERRORS{"UNKNOWN"}}
+    # check snmp information
+    if ( !defined($o_community) && (!defined($o_login) || !defined($o_passwd)) )
+  { print "Put snmp login info!\n"; print_usage(); exit $ERRORS{"UNKNOWN"}}
+    # Check warnings and critical
+    if (!defined($o_warn) || !defined($o_crit))
+   { print "put warning and critical info!\n"; print_usage(); exit $ERRORS{"UNKNOWN"}}
+    # Get rid of % sign
+    $o_warn =~ s/\%//g;
+    $o_crit =~ s/\%//g;
+    # Check for multiple warning and crit in case of -L
+    if (($o_warn =~ /,/) || ($o_crit =~ /,/)) {
+    if (($o_check_type ne "netsl") && ($o_check_type ne "cisco")) { print "Multiple warning without -L or -I switch\n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+    @o_warnL=split(/,/ , $o_warn);
+    @o_critL=split(/,/ , $o_crit);
+     if (($#o_warnL != 2) || ($#o_critL != 2))
+      { print "3 warnings and critical !\n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+    for (my $i=0;$i<3;$i++) {
+        if ( isnnum($o_warnL[$i]) || isnnum($o_critL[$i]))
+      { print "Numeric value for warning or critical !\n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+      if ($o_warnL[$i] > $o_critL[$i])
+       { print "warning <= critical ! \n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+  }
+    } else {
+        if (($o_check_type eq "netsl") || ($o_check_type eq "cisco")) { print "Multiple warn and crit levels needed with -L or -I switch\n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+        if ( isnnum($o_warn) || isnnum($o_crit) )
+      { print "Numeric value for warning or critical !\n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+  if ($o_warn > $o_crit)
+            { print "warning <= critical ! \n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+    }
+
+    ###### Oreon #######
+
+	if (!defined($o_S)) { $o_S="1_1" }
+	$ServiceId = is_valid_serviceid($o_S);
+
+	if (!defined($o_step)) { $o_step="300" }
+	$step = $1 if ($o_step =~ /(\d+)/);
+
+
+}
+
+
+
+
+
+########## MAIN #######
+
+check_options();
+
+$rrd = $pathtorrdbase.$ServiceId.".rrd";
+$start=time;
+
+# Check gobal timeout if snmp screws up
+if (defined($TIMEOUT)) {
+  verb("Alarm at $TIMEOUT + 5");
+  alarm($TIMEOUT+5);
+} else {
+  verb("no timeout defined : $o_timeout + 10");
+  alarm ($o_timeout+10);
+}
+
+# Connect to host
+my ($session,$error);
+if ( defined($o_login) && defined($o_passwd)) {
+  # SNMPv3 login
+  verb("SNMPv3 login");
+  ($session, $error) = Net::SNMP->session(
+      -hostname   	=> $o_host,
+      -version		=> '3',
+      -username		=> $o_login,
+      -authpassword	=> $o_passwd,
+      -authprotocol	=> 'md5',
+      -privpassword	=> $o_passwd,
+      -timeout          => $o_timeout
+   );
+} else {
+  if (defined ($o_version2)) {
+          # SNMPv2 Login
+              ($session, $error) = Net::SNMP->session(
+             -hostname  => $o_host,
+             -version   => 2,
+             -community => $o_community,
+             -port      => $o_port,
+             -timeout   => $o_timeout
+          );
+    } else {
+    # SNMPV1 login
+    ($session, $error) = Net::SNMP->session(
+    -hostname  => $o_host,
+    -community => $o_community,
+    -port      => $o_port,
+    -timeout   => $o_timeout
+    );
+  }
+}
+if (!defined($session)) {
+   printf("ERROR opening session: %s.\n", $error);
+   exit $ERRORS{"UNKNOWN"};
+}
+
+my $exit_val=undef;
+########### Linux load check ##############
+
+if ($o_check_type eq "netsl") {
+
+verb("Checking linux load");
+# Get load table
+my $resultat = (Net::SNMP->VERSION < 4) ?
+      $session->get_table($linload_table)
+    : $session->get_table(Baseoid => $linload_table);
+
+if (!defined($resultat)) {
+   printf("ERROR: Description table : %s.\n", $session->error);
+   $session->close;
+   exit $ERRORS{"UNKNOWN"};
+}
+$session->close;
+
+my @load = undef;
+my @iload = undef;
+my @oid=undef;
+foreach my $key ( keys %$resultat) {
+   verb("OID : $key, Desc : $$resultat{$key}");
+   if ( $key =~ /$linload_name/ ) {
+      @oid=split (/\./,$key);
+      $iload[0]= pop(@oid) if ($$resultat{$key} eq "Load-1");
+      $iload[1]= pop(@oid) if ($$resultat{$key} eq "Load-5");
+      $iload[2]= pop(@oid) if ($$resultat{$key} eq "Load-15");
+   }
+}
+
+for (my $i=0;$i<3;$i++) { $load[$i] = $$resultat{$linload_load . "." . $iload[$i]}};
+
+##
+## RRD management
+##
+
+if ($o_g) {
+	$start=time;
+	 if (! -e $rrd) {
+        create_rrd($rrd,3,$start,$step,0,"U","GAUGE");
+     }
+     update_rrd($rrd,$start, $load[0] ,$load[1], $load[2]);
+}
+
+
+print "Load : $load[0] $load[1] $load[2] :";
+
+$exit_val=$ERRORS{"OK"};
+for (my $i=0;$i<3;$i++) {
+  if ( $load[$i] > $o_critL[$i] ) {
+   print " $load[$i] > $o_critL[$i] : CRITICAL";
+   $exit_val=$ERRORS{"CRITICAL"};
+  }
+  if ( $load[$i] > $o_warnL[$i] ) {
+     # output warn error only if no critical was found
+     if ($exit_val eq $ERRORS{"OK"}) {
+       print " $load[$i] > $o_warnL[$i] : WARNING";
+       $exit_val=$ERRORS{"WARNING"};
+     }
+  }
+}
+print " OK" if ($exit_val eq $ERRORS{"OK"});
+if (defined($o_perf)) {
+   print " | load_1_min=$load[0];$o_warnL[0];$o_critL[0],";
+   print "load_5_min=$load[1];$o_warnL[1];$o_critL[1],";
+   print "load_15_min=$load[2];$o_warnL[2];$o_critL[2]\n";
+} else {
+ print "\n";
+}
+exit $exit_val;
+}
+
+############## Cisco CPU check ################
+
+if ($o_check_type eq "cisco") {
+my @oidlists = ($cisco_cpu_5m, $cisco_cpu_1m, $cisco_cpu_5s);
+my $resultat = (Net::SNMP->VERSION < 4) ?
+    $session->get_request(@oidlists)
+  : $session->get_request(-varbindlist => \@oidlists);
+
+if (!defined($resultat)) {
+   printf("ERROR: Description table : %s.\n", $session->error);
+   $session->close;
+   exit $ERRORS{"UNKNOWN"};
+}
+
+$session->close;
+
+if (!defined ($$resultat{$cisco_cpu_5s})) {
+  print "No CPU information : UNKNOWN\n";
+  exit $ERRORS{"UNKNOWN"};
+}
+
+my @load = undef;
+
+$load[0]=$$resultat{$cisco_cpu_5s};
+$load[1]=$$resultat{$cisco_cpu_1m};
+$load[2]=$$resultat{$cisco_cpu_5m};
+
+##
+## RRD management
+##
+
+if ($o_g) {
+	$start=time;
+	 if (! -e $rrd) {
+        create_rrd($rrd,3,$start,$step,0,"U","GAUGE");
+     }
+     update_rrd($rrd,$start,$load[0] ,$load[1], $load[2]);
+}
+
+print "CPU : $load[0] $load[1] $load[2] :";
+
+$exit_val=$ERRORS{"OK"};
+for (my $i=0;$i<3;$i++) {
+  if ( $load[$i] > $o_critL[$i] ) {
+   print " $load[$i] > $o_critL[$i] : CRITICAL";
+   $exit_val=$ERRORS{"CRITICAL"};
+  }
+  if ( $load[$i] > $o_warnL[$i] ) {
+     # output warn error only if no critical was found
+     if ($exit_val eq $ERRORS{"OK"}) {
+       print " $load[$i] > $o_warnL[$i] : WARNING";
+       $exit_val=$ERRORS{"WARNING"};
+     }
+  }
+}
+print " OK" if ($exit_val eq $ERRORS{"OK"});
+if (defined($o_perf)) {
+   print " | load_5_sec=$load[0]%;$o_warnL[0];$o_critL[0],";
+   print "load_1_min=$load[1]%;$o_warnL[1];$o_critL[1],";
+   print "load_5_min=$load[2]%;$o_warnL[2];$o_critL[2]\n";
+} else {
+ print "\n";
+}
+
+exit $exit_val;
+}
+
+################## CPU for : AS/400 , Netsnmp, HP, Bluecoat, linkproof  ###########
+if ( $o_check_type =~ /netsc|as400|bc|nokia|hp|lp/ ) {
+
+# Get load table
+my @oidlist = $cpu_oid{$o_check_type};
+verb("Checking OID : @oidlist");
+my $resultat = (Net::SNMP->VERSION < 4) ?
+    $session->get_request(@oidlist)
+  : $session->get_request(-varbindlist => \@oidlist);
+if (!defined($resultat)) {
+   printf("ERROR: Description table : %s.\n", $session->error);
+   $session->close;
+   exit $ERRORS{"UNKNOWN"};
+}
+$session->close;
+
+if (!defined ($$resultat{$cpu_oid{$o_check_type}})) {
+  print "No CPU information : UNKNOWN\n";
+  exit $ERRORS{"UNKNOWN"};
+}
+
+my $load=$$resultat{$cpu_oid{$o_check_type}};
+verb("OID returned $load");
+# for AS400, divide by 100
+if ($o_check_type eq "as400") {$load /= 100; };
+# for Net-snmp : oid returned idle time so load = 100-idle.
+if ($o_check_type eq "netsc") {$load = 100 - $load; };
+
+##
+## RRD management
+##
+
+if ($o_g) {
+	$start=time;
+	 if (! -e $rrd) {
+        create_rrd($rrd,1,$start,$step,0,"U","GAUGE");
+     }
+     update_rrd($rrd,$start,$load);
+}
+
+
+printf("CPU used %.1f%% (",$load);
+
+$exit_val=$ERRORS{"OK"};
+if ($load > $o_crit) {
+ print ">$o_crit) : CRITICAL";
+ $exit_val=$ERRORS{"CRITICAL"};
+} else {
+  if ($load > $o_warn) {
+   print ">$o_warn) : WARNING";
+   $exit_val=$ERRORS{"WARNING"};
+  }
+}
+print "<$o_warn) : OK" if ($exit_val eq $ERRORS{"OK"});
+(defined($o_perf)) ?
+   print " | cpu_prct_used=$load%;$o_warn;$o_crit\n"
+ : print "\n";
+exit $exit_val;
+
+}
+
+########## Standard cpu usage check ############
+# Get desctiption table
+my $resultat =  (Net::SNMP->VERSION < 4) ?
+    $session->get_table($base_proc)
+  : $session->get_table(Baseoid => $base_proc);
+
+if (!defined($resultat)) {
+   printf("ERROR: Description table : %s.\n", $session->error);
+   $session->close;
+   exit $ERRORS{"UNKNOWN"};
+}
+
+$session->close;
+
+my ($cpu_used,$ncpu)=(0,0);
+foreach my $key ( keys %$resultat) {
+   verb("OID : $key, Desc : $$resultat{$key}");
+   if ( $key =~ /$proc_load/) {
+     $cpu_used += $$resultat{$key};
+     $ncpu++;
+   }
+}
+
+if ($ncpu==0) {
+  print "Can't find CPU usage information : UNKNOWN\n";
+  exit $ERRORS{"UNKNOWN"};
+}
+
+$cpu_used /= $ncpu;
+
+##
+## RRD management
+##
+
+if ($o_g) {
+	$start=time;
+	 if (! -e $rrd) {
+        create_rrd($rrd,1,$start,$step,0,"U","GAUGE");
+     }
+     update_rrd($rrd,$start,$cpu_used);
+}
+
+print "$ncpu CPU, ", $ncpu==1 ? "load" : "average load";
+printf(" %.1f",$cpu_used);
+$exit_val=$ERRORS{"OK"};
+
+if ($cpu_used > $o_crit) {
+ print " > $o_crit : CRITICAL";
+ $exit_val=$ERRORS{"CRITICAL"};
+} else {
+  if ($cpu_used > $o_warn) {
+   print " > $o_warn : WARNING";
+   $exit_val=$ERRORS{"WARNING"};
+  }
+}
+print " < $o_warn : OK" if ($exit_val eq $ERRORS{"OK"});
+(defined($o_perf)) ?
+   print " | cpu_prct_used=$cpu_used%;$o_warn;$o_crit\n"
+ : print "\n";
+exit $exit_val;
+
diff --git a/plugins/src/check_snmp_mem.pl b/plugins/src/check_snmp_mem.pl
new file mode 100644
index 0000000000000000000000000000000000000000..48298d15e24062584052e9c910286aa335e747e4
--- /dev/null
+++ b/plugins/src/check_snmp_mem.pl
@@ -0,0 +1,543 @@
+#!/usr/bin/perl -w
+############################## check_snmp_mem ##############
+# Version : 0.9
+# Date : Jul 20 2005
+# Author  : Patrick Proy (patrick at proy.org)
+# Help : http://www.manubulon.com/nagios/
+# Licence : GPL - http://www.fsf.org/licenses/gpl.txt
+# TODO : snmpv3
+#################################################################
+#
+# Help : ./check_snmp_mem.pl -h
+#
+
+use strict;
+use Net::SNMP;
+use Getopt::Long;
+
+# Nagios specific
+
+use lib "@NAGIOS_PLUGINS@";
+use utils qw(%ERRORS $TIMEOUT);
+#my $TIMEOUT = 15;
+#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+# Oreon specific
+
+#use lib "@NAGIOS_PLUGINS@";
+if (eval "require oreon" ) {
+  use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+  use vars qw($VERSION %oreon);
+  %oreon=get_parameters();
+} else {
+  print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+
+# SNMP Datas
+
+# Net-snmp memory
+
+my $nets_ram_free	= "1.3.6.1.4.1.2021.4.6.0";  # Real memory free
+my $nets_ram_total	= "1.3.6.1.4.1.2021.4.5.0";  # Real memory total
+my $nets_swap_free	= "1.3.6.1.4.1.2021.4.4.0";  # swap memory free
+my $nets_swap_total	= "1.3.6.1.4.1.2021.4.3.0";  # Swap memory total
+my @nets_oids		= ($nets_ram_free,$nets_ram_total,$nets_swap_free,$nets_swap_total);
+
+# Cisco
+
+my $cisco_mem_pool      = "1.3.6.1.4.1.9.9.48.1.1.1"; # Cisco memory pool
+my $cisco_index         = "1.3.6.1.4.1.9.9.48.1.1.1.2"; # memory pool name and index
+my $cisco_valid         = "1.3.6.1.4.1.9.9.48.1.1.1.4"; # Valid memory if 1
+my $cisco_used          = "1.3.6.1.4.1.9.9.48.1.1.1.5"; # Used memory
+my $cisco_free          = "1.3.6.1.4.1.9.9.48.1.1.1.6"; # Used memory
+# .1 : type, .2 : name, .3 : alternate, .4 : valid, .5 : used, .6 : free, .7 : max free
+
+# HP Procurve
+
+my $hp_mem_pool		= "1.3.6.1.4.1.11.2.14.11.5.1.1.2.2.1.1";   # HP memory pool
+my $hp_mem_index	= "1.3.6.1.4.1.11.2.14.11.5.1.1.2.2.1.1.1"; # memory slot index
+my $hp_mem_total	= "1.3.6.1.4.1.11.2.14.11.5.1.1.2.2.1.1.5"; # Total Bytes
+my $hp_mem_free		= "1.3.6.1.4.1.11.2.14.11.5.1.1.2.2.1.1.6"; # Free Bytes
+my $hp_mem_free_seg	= "1.3.6.1.4.1.11.2.14.11.5.1.1.2.2.1.1.3"; # Free segments
+
+# AS/400
+
+# Windows NT/2K/(XP?)
+
+# check_snmp_storage.pl -C <community> -H <hostIP> -m "^Virtual Memory$"  -w <warn %> -c <crit %>
+
+
+# Globals
+
+my $Version='0.9';
+
+my $o_host = 	undef; 		# hostname
+my $o_community = undef; 	# community
+my $o_port = 	161; 		# port
+my $o_help=	undef; 		# wan't some help ?
+my $o_verb=	undef;		# verbose mode
+my $o_version=	undef;		# print version
+my $o_netsnmp=	1;		# Check with netsnmp (default)
+my $o_cisco=	undef;		# Check cisco router mem
+my $o_hp=	undef;		# Check hp procurve mem
+my $o_warn=	undef;		# warning level option
+my $o_warnR=	undef;		# warning level for Real memory
+my $o_warnS=	undef;		# warning levels for swap
+my $o_crit=	undef;		# Critical level option
+my $o_critR=	undef;		# critical level for Real memory
+my $o_critS=	undef;		# critical level for swap
+my $o_perf=	undef;		# Performance data option
+my $o_timeout=  5;             	# Default 5s Timeout
+my $o_version2= undef;          # use snmp v2c
+# SNMPv3 specific
+my $o_login=	undef;		# Login for snmpv3
+my $o_passwd=	undef;		# Pass for snmpv3
+
+# Oreon specific
+my $o_step=	undef;
+my $o_g=	undef;
+my $o_S=	undef;
+my $step=	undef;
+my $rrd=	undef;
+my $start=	undef;
+my $ServiceId=	undef;
+
+
+# functions
+
+sub p_version { print "check_snmp_mem version : $Version\n"; }
+
+sub print_usage {
+    print "Usage: $0 [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd)  [-p <port>] -w <warn level> -c <crit level> [-I|-N|-E] [-f] [-t <timeout>] [-V]\n";
+}
+
+sub isnnum { # Return true if arg is not a number
+  my $num = shift;
+  if ( $num =~ /^(\d+\.?\d*)|(^\.\d+)$/ ) { return 0 ;}
+  return 1;
+}
+
+sub round ($$) {
+    sprintf "%.$_[1]f", $_[0];
+}
+
+sub help {
+   print "\nSNMP Memory Monitor for Nagios version ",$Version,"\n";
+   print "(c)2004 to my cat Ratoune - Author: Patrick Proy\n\n";
+   print_usage();
+   print <<EOT;
+-v, --verbose
+   print extra debugging information (including interface list on the system)
+-h, --help
+   print this help message
+-H, --hostname=HOST
+   name or IP address of host to check
+-C, --community=COMMUNITY NAME
+   community name for the host's SNMP agent (implies SNMP v1 or v2c with option)
+-2, --v2c
+   Use snmp v2c
+-l, --login=LOGIN
+   Login for snmpv3 authentication (implies v3 protocol with MD5)
+-x, --passwd=PASSWD
+   Password for snmpv3 authentication
+-P, --port=PORT
+   SNMP port (Default 161)
+-w, --warn=INTEGER | INT,INT
+   warning level for memory in percent (0 for no checks)
+     Default (-N switch) : comma separated level for Real Memory and Swap
+     -I switch : warning level
+-c, --crit=INTEGER | INT,INT
+   critical level for memory in percent (0 for no checks)
+     Default (-N switch) : comma separated level for Real Memory and Swap
+     -I switch : critical level
+-N, --netsnmp (default)
+   check linux memory & swap provided by Net SNMP
+-I, --cisco
+   check cisco memory (sum of all memory pools)
+-E, --hp
+   check HP proccurve memory
+-f, --perfdata
+   Performance data output
+-t, --timeout=INTEGER
+   timeout for SNMP in seconds (Default: 5)
+-V, --version
+   prints version number
+-g (--rrdgraph)   Create a rrd base if necessary and add datas into this one
+--rrd_step	     Specifies the base interval in seconds with which data will be fed into the RRD (300 by default)
+-S (--ServiceId)  Oreon Service Id
+EOT
+}
+
+# For verbose output
+sub verb { my $t=shift; print $t,"\n" if defined($o_verb) ; }
+
+# Get the alarm signal (just in case snmp timout screws up)
+$SIG{'ALRM'} = sub {
+     print ("ERROR: Alarm signal (Nagios time-out)\n");
+     exit $ERRORS{"UNKNOWN"};
+};
+
+sub check_options {
+    Getopt::Long::Configure ("bundling");
+    GetOptions(
+   	'v'	=> \$o_verb,		'verbose'	=> \$o_verb,
+        'h'     => \$o_help,    	'help'        	=> \$o_help,
+        'H:s'   => \$o_host,		'hostname:s'	=> \$o_host,
+        'p:i'   => \$o_port,   		'port:i'	=> \$o_port,
+        'C:s'   => \$o_community,	'community:s'	=> \$o_community,
+	'l:s'	=> \$o_login,		'login:s'	=> \$o_login,
+	'x:s'	=> \$o_passwd,		'passwd:s'	=> \$o_passwd,
+        't:i'   => \$o_timeout,       	'timeout:i'     => \$o_timeout,
+	'V'	=> \$o_version,		'version'	=> \$o_version,
+	'I'	=> \$o_cisco,		'cisco'		=> \$o_cisco,
+	'N'	=> \$o_netsnmp,		'netsnmp'	=> \$o_netsnmp,
+        'E'	=> \$o_hp,		'hp'		=> \$o_hp,
+        '2'     => \$o_version2,        'v2c'           => \$o_version2,
+        'c:s'   => \$o_crit,            'critical:s'    => \$o_crit,
+        'w:s'   => \$o_warn,            'warn:s'        => \$o_warn,
+        'f'     => \$o_perf,            'perfdata'      => \$o_perf,
+# For Oreon rrdtool graph
+  "rrd_step:s" => \$o_step,
+  "g"   => \$o_g, "rrdgraph"     => \$o_g,
+  "S=s" => \$o_S, "ServiceId=s"  => \$o_S
+    );
+    if (defined ($o_help) ) { help(); exit $ERRORS{"UNKNOWN"}};
+    if (defined($o_version)) { p_version(); exit $ERRORS{"UNKNOWN"}};
+    if ( ! defined($o_host) ) # check host and filter
+	{ print "No host defined!\n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+    # check snmp information
+    if ( !defined($o_community) && (!defined($o_login) || !defined($o_passwd)) )
+	{ print "Put snmp login info!\n"; print_usage(); exit $ERRORS{"UNKNOWN"}}
+    #Check Warning and crit are present
+    if ( ! defined($o_warn) || ! defined($o_crit))
+ 	{ print "Put warning and critical values!\n"; print_usage(); exit $ERRORS{"UNKNOWN"}}
+    # Get rid of % sign
+    $o_warn =~ s/\%//g;
+    $o_crit =~ s/\%//g;
+    # if -N or -E switch , undef $o_netsnmp
+    if (defined($o_cisco) || defined($o_hp) ) {
+      $o_netsnmp=undef;
+      if ( isnnum($o_warn) || isnnum($o_crit))
+	{ print "Numeric value for warning or critical !\n";print_usage(); exit $ERRORS{"UNKNOWN"} }
+      if ( ($o_crit != 0) && ($o_warn > $o_crit) )
+        { print "warning <= critical ! \n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+    }
+    if (defined($o_netsnmp)) {
+      my @o_warnL=split(/,/ , $o_warn);
+      my @o_critL=split(/,/ , $o_crit);
+      if (($#o_warnL != 1) || ($#o_critL != 1))
+	{ print "2 warnings and critical !\n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+      for (my $i=0;$i<2;$i++) {
+	if ( isnnum($o_warnL[$i]) || isnnum($o_critL[$i]))
+	    { print "Numeric value for warning or critical !\n";print_usage(); exit $ERRORS{"UNKNOWN"} }
+	if (($o_critL[$i]!= 0) && ($o_warnL[$i] > $o_critL[$i]))
+	   { print "warning <= critical ! \n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+ 	if ( $o_critL[$i] > 100)
+	   { print "critical percent must be < 100 !\n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+      }
+      $o_warnR=$o_warnL[0];$o_warnS=$o_warnL[1];
+      $o_critR=$o_critL[0];$o_critS=$o_critL[1];
+    }
+
+    ###### Oreon #######
+
+	if (!defined($o_S)) { $o_S="1_1" }
+	$ServiceId = is_valid_serviceid($o_S);
+
+	if (!defined($o_step)) { $o_step="300" }
+	$step = $1 if ($o_step =~ /(\d+)/);
+
+}
+
+########## MAIN #######
+
+check_options();
+
+$rrd = $pathtorrdbase.$ServiceId.".rrd";
+$start=time;
+
+# Check gobal timeout if snmp screws up
+if (defined($TIMEOUT)) {
+  verb("Alarm at $TIMEOUT");
+  alarm($TIMEOUT);
+} else {
+  verb("no timeout defined : $o_timeout + 10");
+  alarm ($o_timeout+10);
+}
+
+# Connect to host
+my ($session,$error);
+if ( defined($o_login) && defined($o_passwd)) {
+  # SNMPv3 login
+  verb("SNMPv3 login");
+  ($session, $error) = Net::SNMP->session(
+      -hostname   	=> $o_host,
+      -version		=> '3',
+      -username		=> $o_login,
+      -authpassword	=> $o_passwd,
+      -authprotocol	=> 'md5',
+      -privpassword	=> $o_passwd,
+      -timeout          => $o_timeout
+   );
+} else {
+   if (defined ($o_version2)) {
+     # SNMPv2 Login
+	 ($session, $error) = Net::SNMP->session(
+	-hostname  => $o_host,
+	    -version   => 2,
+	-community => $o_community,
+	-port      => $o_port,
+	-timeout   => $o_timeout
+     );
+   } else {
+
+    # SNMPV1 login
+    ($session, $error) = Net::SNMP->session(
+       -hostname  => $o_host,
+       -community => $o_community,
+       -port      => $o_port,
+       -timeout   => $o_timeout
+    );
+  }
+}
+if (!defined($session)) {
+   printf("ERROR opening session: %s.\n", $error);
+   exit $ERRORS{"UNKNOWN"};
+}
+
+# Global variable
+my $resultat=undef;
+
+########### Cisco memory check ############
+if (defined ($o_cisco)) {
+
+  # Get Cisco memory table
+  $resultat = (Net::SNMP->VERSION < 4) ?
+                 $session->get_table($cisco_mem_pool)
+                 :$session->get_table(Baseoid => $cisco_mem_pool);
+
+  if (!defined($resultat)) {
+    printf("ERROR: Description table : %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{"UNKNOWN"};
+  }
+  my (@oid,@index)=(undef,undef);
+  my $nindex=0;
+  foreach my $key ( keys %$resultat) {
+     verb("OID : $key, Desc : $$resultat{$key}");
+     if ( $key =~ /$cisco_index/ ) {
+	@oid=split (/\./,$key);
+	$index[$nindex++] = pop(@oid);
+     }
+  }
+
+  # Check if at least 1 memory pool exists
+  if ($nindex == 0) {
+   printf("ERROR: No memory pools found");
+   $session->close;
+   exit $ERRORS{"UNKNOWN"};
+  }
+
+  # Consolidate the datas
+  my ($used,$free)=(0,0);
+  my ($c_output,$prct_free)=(undef,undef);
+  foreach (@index) {
+    if ( $$resultat{$cisco_valid . "." . $_} == 1 ) {
+      $c_output .="," if defined ($c_output);
+      $used += $$resultat{$cisco_used . "." . $_};
+      $free += $$resultat{$cisco_free . "." . $_};
+      $c_output .= $$resultat{$cisco_index . "." . $_} . ":"
+		 .round($$resultat{$cisco_used . "." . $_}*100/($$resultat{$cisco_free . "." . $_}+$$resultat{$cisco_used . "." . $_}) ,0)
+		 . "%";
+    }
+  }
+  my $total=$used+$free;
+  $prct_free=round($used*100/($total),0);
+  verb("Used : $used, Free: $free, Output : $c_output");
+
+  ##
+  ## RRD management
+  ##
+
+	if ($o_g) {
+		$start=time;
+		 if (! -e $rrd) {
+	        create_rrd($rrd,1,$start,$step,0,100,"GAUGE");
+	     }
+	     update_rrd($rrd,$start,$prct_free);
+	}
+
+  my $c_status="OK";
+  $c_output .=" : " . $prct_free ."% : ";
+  if (($o_crit!=0)&&($o_crit <= $prct_free)) {
+    $c_output .= " > " . $o_crit ;
+    $c_status="CRITICAL";
+  } else {
+    if (($o_warn!=0)&&($o_warn <= $prct_free)) {
+      $c_output.=" > " . $o_warn;
+      $c_status="WARNING";
+    }
+  }
+  $c_output .= " ; ".$c_status;
+  if (defined ($o_perf)) {
+    $c_output .= " | ram_used=" . $used.";";
+    $c_output .= ($o_warn ==0)? ";" : round($o_warn * $total/100,0).";";
+    $c_output .= ($o_crit ==0)? ";" : round($o_crit * $total/100,0).";";
+    $c_output .= "0;" . $total ;
+  }
+  $session->close;
+  print "$c_output \n";
+  exit $ERRORS{$c_status};
+}
+
+########### HP Procurve memory check ############
+if (defined ($o_hp)) {
+
+  # Get hp memory table
+  $resultat = (Net::SNMP->VERSION < 4) ?
+                 $session->get_table($hp_mem_pool)
+                 :$session->get_table(Baseoid => $hp_mem_pool);
+
+  if (!defined($resultat)) {
+    printf("ERROR: Description table : %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{"UNKNOWN"};
+  }
+  my (@oid,@index)=(undef,undef);
+  my $nindex=0;
+  foreach my $key ( keys %$resultat) {
+     verb("OID : $key, Desc : $$resultat{$key}");
+     if ( $key =~ /$hp_mem_index/ ) {
+	@oid=split (/\./,$key);
+	$index[$nindex++] = pop(@oid);
+     }
+  }
+
+  # Check if at least 1 memory slots exists
+  if ($nindex == 0) {
+   printf("ERROR: No memory slots found");
+   $session->close;
+   exit $ERRORS{"UNKNOWN"};
+  }
+
+  # Consolidate the datas
+  my ($total,$free)=(0,0);
+  my ($c_output,$prct_free)=(undef,undef);
+  foreach (@index) {
+    $c_output .="," if defined ($c_output);
+    $total += $$resultat{$hp_mem_total . "." . $_};
+    $free += $$resultat{$hp_mem_free . "." . $_};
+    $c_output .= "Slot " . $$resultat{$hp_mem_index . "." . $_} . ":"
+ 		 .round(
+		   100 - ($$resultat{$hp_mem_free . "." . $_} *100 /
+                        $$resultat{$hp_mem_total . "." . $_}) ,0)
+		 . "%";
+  }
+  my $used = $total - $free;
+  $prct_free=round($used*100/($total),0);
+  verb("Used : $used, Free: $free, Output : $c_output");
+
+  ##
+  ## RRD management
+  ##
+
+	if ($o_g) {
+		$start=time;
+		 if (! -e $rrd) {
+	        create_rrd($rrd,1,$start,$step,0,100,"GAUGE");
+	     }
+	     update_rrd($rrd,$start,$prct_free);
+	}
+
+  my $c_status="OK";
+  $c_output .=" : " . $prct_free ."% : ";
+  if (($o_crit!=0)&&($o_crit <= $prct_free)) {
+    $c_output .= " > " . $o_crit ;
+    $c_status="CRITICAL";
+  } else {
+    if (($o_warn!=0)&&($o_warn <= $prct_free)) {
+      $c_output.=" > " . $o_warn;
+      $c_status="WARNING";
+    }
+  }
+  $c_output .= " ; ".$c_status;
+  if (defined ($o_perf)) {
+    $c_output .= " | ram_used=" . $used.";";
+    $c_output .= ($o_warn ==0)? ";" : round($o_warn * $total/100,0).";";
+    $c_output .= ($o_crit ==0)? ";" : round($o_crit * $total/100,0).";";
+    $c_output .= "0;" . $total ;
+  }
+  $session->close;
+  print "$c_output \n";
+  exit $ERRORS{$c_status};
+}
+
+########### Net snmp memory check ############
+if (defined ($o_netsnmp)) {
+
+  # Get NetSNMP memory values
+  $resultat = (Net::SNMP->VERSION < 4) ?
+		$session->get_request(@nets_oids)
+		:$session->get_request(-varbindlist => \@nets_oids);
+
+  if (!defined($resultat)) {
+    printf("ERROR: netsnmp : %s.\n", $session->error);
+    $session->close;
+    exit $ERRORS{"UNKNOWN"};
+  }
+
+  my ($realused,$swapused)=(undef,undef);
+
+  $realused= ($$resultat{$nets_ram_total} == 0) ? 0 :
+		($$resultat{$nets_ram_total}-$$resultat{$nets_ram_free})/$$resultat{$nets_ram_total};
+  $swapused= ($$resultat{$nets_swap_total} == 0) ? 0 :
+		($$resultat{$nets_swap_total}-$$resultat{$nets_swap_free})/$$resultat{$nets_swap_total};
+  $realused=round($realused*100,0);
+  $swapused=round($swapused*100,0);
+  verb ("Ram : $$resultat{$nets_ram_free} / $$resultat{$nets_ram_total} : $realused");
+  verb ("Swap : $$resultat{$nets_swap_free} / $$resultat{$nets_swap_total} : $swapused");
+
+  ##
+  ## RRD management
+  ##
+
+	if ($o_g) {
+		$start=time;
+		 if (! -e $rrd) {
+	        create_rrd($rrd,2,$start,$step,0,100,"GAUGE");
+	     }
+	     update_rrd($rrd,$start,$realused, $swapused );
+	}
+
+
+
+  my $n_status="OK";
+  my $n_output="Ram : " . $realused . "%, Swap : " . $swapused . "% :";
+  if ((($o_critR!=0)&&($o_critR <= $realused)) || (($o_critS!=0)&&($o_critS <= $swapused))) {
+    $n_output .= " > " . $o_critR . ", " . $o_critS;
+    $n_status="CRITICAL";
+  } else {
+    if ((($o_warnR!=0)&&($o_warnR <= $realused)) || (($o_warnS!=0)&&($o_warnS <= $swapused))) {
+      $n_output.=" > " . $o_warnR . ", " . $o_warnS;
+      $n_status="WARNING";
+    }
+  }
+  $n_output .= " ; ".$n_status;
+  if (defined ($o_perf)) {
+    $n_output .= " | ram_used=" . ($$resultat{$nets_ram_total}-$$resultat{$nets_ram_free}).";";
+    $n_output .= ($o_warnR ==0)? ";" : round($o_warnR * $$resultat{$nets_ram_total}/100,0).";";
+    $n_output .= ($o_critR ==0)? ";" : round($o_critR * $$resultat{$nets_ram_total}/100,0).";";
+    $n_output .= "0;" . $$resultat{$nets_ram_total}. " ";
+    $n_output .= "swap_used=" . ($$resultat{$nets_swap_total}-$$resultat{$nets_swap_free}).";";
+    $n_output .= ($o_warnS ==0)? ";" : round($o_warnS * $$resultat{$nets_swap_total}/100,0).";";
+    $n_output .= ($o_critS ==0)? ";" : round($o_critS * $$resultat{$nets_swap_total}/100,0).";";
+    $n_output .= "0;" . $$resultat{$nets_swap_total};
+  }
+  $session->close;
+  print "$n_output \n";
+  exit $ERRORS{$n_status};
+
+}
diff --git a/plugins/src/check_snmp_process.pl b/plugins/src/check_snmp_process.pl
new file mode 100644
index 0000000000000000000000000000000000000000..b669ad954ba688e49bf8c7f4d3e443ade7076be4
--- /dev/null
+++ b/plugins/src/check_snmp_process.pl
@@ -0,0 +1,602 @@
+#!/usr/bin/perl -w
+############################## check_snmp_process ##############
+# Version : 1.2.1
+# Date : Dec 12 2004
+# Author  : Patrick Proy (patrick at proy.org)
+# Help : http://www.manubulon.com/nagios/
+# Licence : GPL - http://www.fsf.org/licenses/gpl.txt
+# TODO : put $o_delta as an option
+###############################################################
+#
+# help : ./check_snmp_process -h
+
+############### BASE DIRECTORY FOR TEMP FILE ########
+my $o_base_dir="/tmp/tmp_Nagios_proc.";
+my $file_history=200;   # number of data to keep in files.
+my $delta_of_time_to_make_average=300;  # 5minutes by default
+
+use strict;
+use Net::SNMP;
+use Getopt::Long;
+
+# Nagios specific
+
+use lib "@NAGIOS_PLUGINS@";
+use utils qw(%ERRORS $TIMEOUT);
+#my $TIMEOUT = 5;
+#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+# Oreon specific
+
+#use lib "@NAGIOS_PLUGINS@";
+if (eval "require oreon" ) {
+  use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+  use vars qw($VERSION %oreon);
+  %oreon=get_parameters();
+} else {
+  print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+
+
+# SNMP Datas
+my $process_table= '1.3.6.1.2.1.25.4.2.1';
+my $index_table = '1.3.6.1.2.1.25.4.2.1.1';
+my $run_name_table = '1.3.6.1.2.1.25.4.2.1.2';
+my $run_path_table = '1.3.6.1.2.1.25.4.2.1.4';
+my $proc_mem_table = '1.3.6.1.2.1.25.5.1.1.2'; # Kbytes
+my $proc_cpu_table = '1.3.6.1.2.1.25.5.1.1.1'; # Centi sec of CPU
+my $proc_run_state = '1.3.6.1.2.1.25.4.2.1.7';
+
+# Globals
+
+my $Version='1.2.1';
+
+my $o_host = 	undef; 		# hostname
+my $o_community =undef; 	# community
+my $o_port = 	161; 		# port
+my $o_descr = 	undef; 		# description filter
+my $o_warn = 	0; 		# warning limit
+my @o_warnL=	undef;		# warning limits (min,max)
+my $o_crit=	0; 		# critical limit
+my @o_critL=	undef;		# critical limits (min,max)
+my $o_help=	undef; 		# wan't some help ?
+my $o_verb=	undef;		# verbose mode
+my $o_version=   undef;         # print version
+my $o_noreg=	undef;		# Do not use Regexp for name
+my $o_path=	undef;		# check path instead of name
+my $o_inverse=	undef;		# checks max instead of min number of process
+my $o_timeout=  5;            	# Default 5s Timeout
+# SNMP V3 specific
+my $o_login=	undef;		# snmp v3 login
+my $o_passwd=	undef;		# snmp v3 passwd
+# Memory & CPU
+my $o_mem=	undef;		# checks memory (max)
+my @o_memL=	undef;		# warn and crit level for mem
+my $o_mem_avg=	undef;		# cheks memory average
+my $o_cpu=	undef;		# checks CPU usage
+my @o_cpuL=	undef;		# warn and crit level for cpu
+my $o_delta=	$delta_of_time_to_make_average;		# delta time for CPU check
+# Oreon specific
+my $o_step=	undef;
+my $o_g=	undef;
+my $o_S=	undef;
+my $step=	undef;
+my $rrd=	undef;
+my $start=	undef;
+my $ServiceId=	undef;
+my @rrd_data= undef;
+
+# functions
+
+sub p_version { print "check_snmp_process version : $Version\n"; }
+
+sub print_usage {
+    print "Usage: $0 [-v] -H <host> -C <snmp_community> | (-l login -x passwd) [-p <port>] -n <name> [-w <min_proc>[,<max_proc>] -c <min_proc>[,max_proc] ] [-m<warn Mb>,<crit Mb> -a -u<warn %>,<crit%> ] [-t <timeout>] [-f ] [-r] [-V]\n";
+}
+
+sub isnotnum { # Return true if arg is not a number
+  my $num = shift;
+  if ( $num =~ /^(\d+\.?\d*)|(^\.\d+)$/ ) { return 0 ;}
+  return 1;
+}
+
+# Get the alarm signal (just in case snmp timout screws up)
+$SIG{'ALRM'} = sub {
+     print ("ERROR: Alarm signal (Nagios time-out)\n");
+     exit $ERRORS{"UNKNOWN"};
+};
+
+sub read_file {
+        # Input : File, items_number
+        # Returns : array of value : [line][item]
+  my ($traffic_file,$items_number)=@_;
+  my ($ligne,$n_rows)=(undef,0);
+  my (@last_values,@file_values,$i);
+  open(FILE,"<".$traffic_file) || return (1,0,0);
+
+  while($ligne = <FILE>)
+  {
+    chomp($ligne);
+    @file_values = split(":",$ligne);
+    #verb("@file_values");
+    if ($#file_values >= ($items_number-1)) {
+        # check if there is enough data, else ignore line
+      for ( $i=0 ; $i< $items_number ; $i++ ) {$last_values[$n_rows][$i]=$file_values[$i]; }
+      $n_rows++;
+    }
+  }
+  close FILE;
+  if ($n_rows != 0) {
+    return (0,$n_rows,@last_values);
+  } else {
+    return (1,0,0);
+  }
+}
+
+sub write_file {
+        # Input : file , rows, items, array of value : [line][item]
+        # Returns : 0 / OK, 1 / error
+  my ($file_out,$rows,$item,@file_values)=@_;
+  my $start_line= ($rows > $file_history) ? $rows -  $file_history : 0;
+  if ( open(FILE2,">".$file_out) ) {
+    for (my $i=$start_line;$i<$rows;$i++) {
+      for (my $j=0;$j<$item;$j++) {
+        print FILE2 $file_values[$i][$j];
+        if ($j != ($item -1)) { print FILE2 ":" };
+      }
+      print FILE2 "\n";
+    }
+    close FILE2;
+    return 0;
+  } else {
+    return 1;
+  }
+}
+
+sub help {
+   print "\nSNMP Process Monitor for Nagios version ",$Version,"\n";
+   print "(c)2004 to my cat Ratoune - Author: Patrick Proy\n\n";
+   print_usage();
+   print <<EOT;
+-v, --verbose
+   print extra debugging information (and lists all storages)
+-h, --help
+   print this help message
+-H, --hostname=HOST
+   name or IP address of host to check
+-C, --community=COMMUNITY NAME
+   community name for the host's SNMP agent (implies SNMP v1)
+-l, --login=LOGIN
+   Login for snmpv3 authentication (implies v3 protocol with MD5)
+-x, --passwd=PASSWD
+   Password for snmpv3 authentication
+-p, --port=PORT
+   SNMP port (Default 161)
+-n, --name=NAME
+   Name of the process (regexp)
+   No trailing slash !
+-r, --noregexp
+   Do not use regexp to match NAME in description OID
+-f, --fullpath
+   Use full path name instead of process name
+   (Windows doesn't provide full path name)
+-w, --warn=MIN[,MAX]
+   Number of process that will cause a warning
+-c, --critical=MIN[,MAX]
+   number of process that will cause an error
+Notes on warning and critical :
+   with the following options : -w m1,x1 -c m2,x2
+   you must have : m2 <= m1 < x1 <= x2
+   you can omit x1 or x2 or both
+-m, --memory=WARN,CRIT
+   checks memory usage (default max of all process)
+   values are warning and critical values in Mb
+-a, --average
+   makes an average of memory used by process instead of max
+-u, --cpu=WARN,CRIT
+   checks cpu usage of all process
+   values are warning and critical values in % of CPU usage
+   if more than one CPU, value can be > 100% : 100%=1 CPU
+-t, --timeout=INTEGER
+   timeout for SNMP in seconds (Default: 5)
+-V, --version
+   prints version number
+-g (--rrdgraph)   Create a rrd base if necessary and add datas into this one
+--rrd_step	     Specifies the base interval in seconds with which data will be fed into the RRD (300 by default)
+-S (--ServiceId)  Oreon Service Id
+
+Note :
+  CPU usage is in % of one cpu, so maximum can be 100% * number of CPU
+  example :
+  Browse process list : <script> -C <community> -H <host> -n <anything> -v
+  the -n option allows regexp in perl format :
+  All process of /opt/soft/bin  	: -n /opt/soft/bin/ -f
+  All 'named' process			: -n named
+
+EOT
+}
+
+sub verb { my $t=shift; print $t,"\n" if defined($o_verb) ; }
+
+sub check_options {
+    my $compat_o_cpu_sum;
+    Getopt::Long::Configure ("bundling");
+    GetOptions(
+   	'v'	=> \$o_verb,		'verbose'	=> \$o_verb,
+        'h'     => \$o_help,    	'help'        	=> \$o_help,
+        'H:s'   => \$o_host,		'hostname:s'	=> \$o_host,
+        'p:i'   => \$o_port,   		'port:i'	=> \$o_port,
+        'C:s'   => \$o_community,	'community:s'	=> \$o_community,
+        'l:s'   => \$o_login,           'login:s'       => \$o_login,
+        'x:s'   => \$o_passwd,          'passwd:s'      => \$o_passwd,
+        'c:s'   => \$o_crit,    	'critical:s'	=> \$o_crit,
+        'w:s'   => \$o_warn,    	'warn:s'	=> \$o_warn,
+	't:i'   => \$o_timeout,       	'timeout:i'     => \$o_timeout,
+        'n:s'   => \$o_descr,		'name:s'	=> \$o_descr,
+        'r'     => \$o_noreg,           'noregexp'      => \$o_noreg,
+        'f'     => \$o_path,           	'fullpath'      => \$o_path,
+        'm:s'   => \$o_mem,           	'memory:s'    	=> \$o_mem,
+        'a'     => \$o_mem_avg,       	'average'      	=> \$o_mem_avg,
+        'u:s'   => \$o_cpu,       	'cpu'      	=> \$o_cpu,
+	#### To be compatible with version 1.2, will be removed... ####
+	's'     => \$compat_o_cpu_sum,  'cpusum'        => \$compat_o_cpu_sum,
+	##########
+	'V'     => \$o_version,         'version'       => \$o_version,
+		# For Oreon rrdtool graph
+  "rrd_step:s" => \$o_step,
+  "g"   => \$o_g, "rrdgraph"     => \$o_g,
+  "S=s" => \$o_S, "ServiceId=s"  => \$o_S
+    );
+    if (defined ($o_help)) { help(); exit $ERRORS{"UNKNOWN"}};
+    if (defined($o_version)) { p_version(); exit $ERRORS{"UNKNOWN"}};
+    # check snmp information
+    if ( !defined($o_community) && (!defined($o_login) || !defined($o_passwd)) )
+        { print "Put snmp login info!\n"; print_usage(); exit $ERRORS{"UNKNOWN"}}
+    # Check compulsory attributes
+    if ( ! defined($o_descr) ||  ! defined($o_host) ) { print_usage(); exit $ERRORS{"UNKNOWN"}};
+    @o_warnL=split(/,/,$o_warn);
+    @o_critL=split(/,/,$o_crit);
+    verb("$#o_warnL $#o_critL");
+    if ( isnotnum($o_warnL[0]) || isnotnum($o_critL[0]))
+       { print "Numerical values for warning and critical\n";print_usage(); exit $ERRORS{"UNKNOWN"};}
+    if ((defined($o_warnL[1]) && isnotnum($o_warnL[1])) || (defined($o_critL[1]) && isnotnum($o_critL[1])))
+       { print "Numerical values for warning and critical\n";print_usage(); exit $ERRORS{"UNKNOWN"};}
+    # Check for positive numbers
+    if (($o_warnL[0] < 0) || ($o_critL[0] < 0))
+      { print " warn and critical > 0 \n";print_usage(); exit $ERRORS{"UNKNOWN"}};
+    if ((defined($o_warnL[1]) && ($o_warnL[1] < 0)) || (defined($o_critL[1]) && ($o_critL[1] < 0)))
+      { print " warn and critical > 0 \n";print_usage(); exit $ERRORS{"UNKNOWN"}};
+    # Check min_crit < min warn < max warn < crit warn
+    if ($o_warnL[0] < $o_critL[0]) { print " warn minimum must be >= crit minimum\n";print_usage(); exit $ERRORS{"UNKNOWN"}};
+    if (defined($o_warnL[1])) {
+      if ($o_warnL[1] <= $o_warnL[0])
+        { print "warn minimum must be < warn maximum\n";print_usage(); exit $ERRORS{"UNKNOWN"}};
+    } elsif ( defined($o_critL[1]) && ($o_critL[1] <= $o_warnL[0]))
+       { print "warn minimum must be < crit maximum when no crit warning defined\n";print_usage(); exit $ERRORS{"UNKNOWN"};}
+    if ( defined($o_critL[1]) && defined($o_warnL[1]) && ($o_critL[1]<$o_warnL[1]))
+       { print "warn max must be <= crit maximum\n";print_usage(); exit $ERRORS{"UNKNOWN"};}
+    #### Memory checks
+    if (defined ($o_mem)) {
+      @o_memL=split(/,/,$o_mem);
+      if ($#o_memL != 1)
+        {print "2 values (warning,critical) for memory\n";print_usage(); exit $ERRORS{"UNKNOWN"}};
+      if (isnotnum($o_memL[0]) || isnotnum($o_memL[1]))
+       {print "Numeric values for memory!\n";print_usage(); exit $ERRORS{"UNKNOWN"}};
+      if ($o_memL[0]>$o_memL[1])
+       {print "Warning must be <= Critical for memory!\n";print_usage(); exit $ERRORS{"UNKNOWN"}};
+    }
+    #### CPU checks
+    if (defined ($o_cpu)) {
+      @o_cpuL=split(/,/,$o_cpu);
+      if ($#o_cpuL != 1)
+        {print "2 values (warning,critical) for cpu\n";print_usage(); exit $ERRORS{"UNKNOWN"}};
+      if (isnotnum($o_cpuL[0]) || isnotnum($o_cpuL[1]))
+       {print "Numeric values for cpu!\n";print_usage(); exit $ERRORS{"UNKNOWN"}};
+      if ($o_cpuL[0]>$o_cpuL[1])
+       {print "Warning must be <= Critical for cpu!\n";print_usage(); exit $ERRORS{"UNKNOWN"}};
+    }
+	 ###### Oreon #######
+
+	if (!defined($o_S)) { $o_S="1_1" }
+	$ServiceId = is_valid_serviceid($o_S);
+
+	if (!defined($o_step)) { $o_step="300" }
+	$step = $1 if ($o_step =~ /(\d+)/);
+
+}
+
+########## MAIN #######
+
+check_options();
+
+$rrd = $pathtorrdbase.$ServiceId.".rrd";
+$start=time;
+
+# Check gobal timeout if snmp screws up
+if (defined($TIMEOUT)) {
+  verb("Alarm at $TIMEOUT");
+  alarm($TIMEOUT);
+} else {
+  verb("no timeout defined : $o_timeout + 10");
+  alarm ($o_timeout+10);
+}
+
+# Connect to host
+my ($session,$error);
+if ( defined($o_login) && defined($o_passwd)) {
+  # SNMPv3 login
+  verb("SNMPv3 login");
+  ($session, $error) = Net::SNMP->session(
+      -hostname         => $o_host,
+      -version          => '3',
+      -username         => $o_login,
+      -authpassword     => $o_passwd,
+      -authprotocol     => 'md5',
+      -privpassword     => $o_passwd,
+      -timeout          => $o_timeout
+   );
+} else {
+  # SNMPV1 login
+  ($session, $error) = Net::SNMP->session(
+     -hostname  => $o_host,
+     -community => $o_community,
+     -port      => $o_port,
+     -timeout   => $o_timeout
+  );
+}
+
+if (!defined($session)) {
+   printf("ERROR: %s.\n", $error);
+   exit $ERRORS{"UNKNOWN"};
+}
+
+# Look for process in name or path name table
+my $resultat=undef;
+if ( !defined ($o_path) ) {
+  $resultat = $session->get_table(
+	Baseoid => $run_name_table
+  );
+} else {
+  $resultat = $session->get_table(
+	Baseoid => $run_path_table
+  );
+}
+
+if (!defined($resultat)) {
+   printf("ERROR: Process name table : %s.\n", $session->error);
+   $session->close;
+   exit $ERRORS{"UNKNOWN"};
+}
+
+my @tindex = undef;
+my @oids = undef;
+my @descr = undef;
+my $num_int = 0;
+my $count_oid = 0;
+# Select storage by regexp of exact match
+# and put the oid to query in an array
+
+verb("Filter : $o_descr");
+
+foreach my $key ( keys %$resultat) {
+   verb("OID : $key, Desc : $$resultat{$key}");
+   # test by regexp or exact match
+   my $test = defined($o_noreg)
+                ? $$resultat{$key} eq $o_descr
+                : $$resultat{$key} =~ /$o_descr/;
+  if ($test) {
+     # get the index number of the interface
+     my @oid_list = split (/\./,$key);
+     $tindex[$num_int] = pop (@oid_list);
+     # get the full description
+     $descr[$num_int]=$$resultat{$key};
+     # put the oid of running and mem (check this maybe ?) in an array.
+     $oids[$count_oid++]=$proc_mem_table . "." . $tindex[$num_int];
+     $oids[$count_oid++]=$proc_cpu_table . "." . $tindex[$num_int];
+     $oids[$count_oid++]=$proc_run_state . "." . $tindex[$num_int];
+     #verb("Name : $descr[$num_int], Index : $tindex[$num_int]");
+     verb($oids[$count_oid-1]);
+     $num_int++;
+  }
+}
+
+if ( $num_int == 0) {
+   print "No process ",(defined ($o_noreg)) ? "named " : "matching ", $o_descr, " found : CRITICAL\n";
+   exit $ERRORS{"CRITICAL"};
+}
+
+my $result=undef;
+my $num_int_ok=0;
+my %result_cons=();
+#$session->max_msg_size([214748]);
+if ( $count_oid >= 50) {
+  my @toid=undef;
+  my $tmp_num=0;
+  my $tmp_index=0;
+  my $tmp_count=$count_oid;
+  my $tmp_result=undef;
+  verb("More than 50 oid, splitting");
+  while ( $tmp_count != 0 ) {
+    $tmp_num = ($tmp_count >=50) ? 50 : $tmp_count;
+    for (my $i=0; $i<$tmp_num;$i++) {
+       $toid[$i]=$oids[$i+$tmp_index];
+       #verb("$i :  $toid[$i] : $oids[$i+$tmp_index]");
+    }
+    $tmp_result = $session->get_request(
+	Varbindlist => \@toid
+    );
+    if (!defined($tmp_result)) { printf("ERROR: running table : %s.\n", $session->error); $session->close;
+        exit $ERRORS{"UNKNOWN"};
+    }
+    foreach (@toid) { $result_cons{$_}=$$tmp_result{$_}; }
+    $tmp_count-=$tmp_num;
+    $tmp_index+=$tmp_num;
+  }
+
+} else {
+  $result = $session->get_request(
+     Varbindlist => \@oids
+  );
+  if (!defined($result)) { printf("ERROR: running table : %s.\n", $session->error); $session->close;
+   exit $ERRORS{"UNKNOWN"};
+  }
+  foreach (@oids) {$result_cons{$_}=$$result{$_};}
+}
+
+#Check if process are in running or runnable state
+for (my $i=0; $i< $num_int; $i++) {
+   my $state=$result_cons{$proc_run_state . "." . $tindex[$i]};
+   my $tmpmem=$result_cons{$proc_mem_table . "." . $tindex[$i]};
+   my $tmpcpu=$result_cons{$proc_cpu_table . "." . $tindex[$i]};
+   verb ("Process $tindex[$i] in state $state using $tmpmem, and $tmpcpu CPU");
+   $num_int_ok++ if (($state == 1) || ($state ==2));
+}
+
+$session->close;
+
+$rrd_data[0] = $num_int_ok;
+
+my $final_status=0;
+my ($res_memory,$res_cpu)=(0,0);
+my $memory_print="";
+my $cpu_print="";
+###### Checks memory usage
+if (defined ($o_mem) ) {
+ if (defined ($o_mem_avg)) {
+   for (my $i=0; $i< $num_int; $i++) { $res_memory += $result_cons{$proc_mem_table . "." . $tindex[$i]};}
+   $res_memory /= ($num_int_ok*1024);
+   verb("Memory average : $res_memory");
+ } else {
+   for (my $i=0; $i< $num_int; $i++) {
+     $res_memory = ($result_cons{$proc_mem_table . "." . $tindex[$i]} > $res_memory) ? $result_cons{$proc_mem_table . "." . $tindex[$i]} : $res_memory;
+   }
+   $res_memory /=1024;
+   verb("Memory max : $res_memory");
+ }
+ if ($res_memory > $o_memL[1]) {
+   $final_status=2;
+   $memory_print=", Mem : ".sprintf("%.1f",$res_memory)."Mb > ".$o_memL[1]." CRITICAL";
+ } elsif ( $res_memory > $o_memL[0]) {
+   $final_status=1;
+   $memory_print=", Mem : ".sprintf("%.1f",$res_memory)."Mb > ".$o_memL[0]." WARNING";
+ } else {
+   $memory_print=", Mem : ".sprintf("%.1f",$res_memory)."Mb OK";
+ }
+
+push @rrd_data, $res_memory;
+
+}
+
+######## Checks CPU usage
+
+if (defined ($o_cpu) ) {
+  my $timenow=time;
+  my $temp_file_name;
+  my ($return,@file_values)=(undef,undef);
+  my $n_rows=0;
+  my $n_items_check=2;
+  my $trigger=$timenow - ($o_delta - ($o_delta/10));
+  my $trigger_low=$timenow - 3*$o_delta;
+  my ($old_value,$old_time)=undef;
+  my $found_value=undef;
+
+  #### Get the current values
+  for (my $i=0; $i< $num_int; $i++) { $res_cpu += $result_cons{$proc_cpu_table . "." . $tindex[$i]};}
+
+  verb("Time: $timenow , cpu (centiseconds) : $res_cpu");
+
+  #### Read file
+  $temp_file_name=$o_descr;
+  $temp_file_name =~ s/ /_/g;
+  $temp_file_name = $o_base_dir . $o_host ."." . $temp_file_name;
+  # First, read entire file
+  my @ret_array=read_file($temp_file_name,$n_items_check);
+  $return = shift(@ret_array);
+  $n_rows = shift(@ret_array);
+  if ($n_rows != 0) { @file_values = @ret_array };
+  verb ("File read returns : $return with $n_rows rows");
+  #make the checks if the file is OK
+  if ($return ==0) {
+    my $j=$n_rows-1;
+    do {
+      if ($file_values[$j][0] < $trigger) {
+        if ($file_values[$j][0] > $trigger_low) {
+          # found value = centiseconds / seconds = %cpu
+          $found_value= ($res_cpu-$file_values[$j][1]) / ($timenow - $file_values[$j][0] );
+        }
+      }
+      $j--;
+    } while ( ($j>=0) && (!defined($found_value)) );
+  }
+  ###### Write file
+  $file_values[$n_rows][0]=$timenow;
+  $file_values[$n_rows][1]=$res_cpu;
+  $n_rows++;
+  $return=write_file($temp_file_name,$n_rows,$n_items_check,@file_values);
+  if ($return != 0) { $cpu_print.="! ERROR writing file $temp_file_name !";$final_status=3;}
+  ##### Check values (if something to check...)
+  if (defined($found_value)) {
+    if ($found_value > $o_cpuL[1]) {
+      $final_status=2;
+      $cpu_print.=", Cpu : ".sprintf("%.0f",$found_value)."% > ".$o_cpuL[1]." CRITICAL";
+    } elsif ( $found_value > $o_cpuL[0]) {
+      $final_status=($final_status==2)?2:1;
+      $cpu_print.=", Cpu : ".sprintf("%.0f",$found_value)."% > ".$o_cpuL[0]." WARNING";
+    } else {
+      $cpu_print.=", Cpu : ".sprintf("%.0f",$found_value)."% OK";
+    }
+	push @rrd_data, $found_value;
+  } else {
+    if ($final_status==0) { $final_status=3 };
+    $cpu_print.=", No data for CPU (".$n_rows." line(s)):UNKNOWN";
+  }
+
+}
+
+
+  ##
+  ## RRD management
+  ##
+
+	if ($o_g) {
+		$start=time;
+		 if (! -e $rrd) {
+	        create_rrd($rrd,$#rrd_data+1,$start,$step,0,"U","GAUGE");
+	     }
+	     update_rrd($rrd,$start,@rrd_data);
+	}
+
+
+
+print $num_int_ok, " process ", (defined ($o_noreg)) ? "named " : "matching ", $o_descr, " ";
+
+#### Check for min and max number of process
+if ( $num_int_ok <= $o_critL[0] ) {
+   print "(<= ",$o_critL[0]," : CRITICAL)";
+   $final_status=2;
+} elsif ( $num_int_ok <= $o_warnL[0] ) {
+   print "(<= ",$o_warnL[0]," : WARNING)";
+   $final_status=($final_status==2)?2:1;
+} else {
+   print "(> ",$o_warnL[0],")";
+}
+if (defined($o_critL[1]) && ($num_int_ok > $o_critL[1])) {
+  print " (> ",$o_critL[1]," : CRITICAL)";
+  $final_status=2;
+} elsif (defined($o_warnL[1]) && ($num_int_ok > $o_warnL[1])) {
+   print " (> ",$o_warnL[1]," : WARNING)";
+   $final_status=($final_status==2)?2:1;
+} elsif (defined($o_warnL[1])) {
+   print " (<= ",$o_warnL[1],"):OK";
+}
+
+print $memory_print,$cpu_print,"\n";
+
+if ($final_status==2) { exit $ERRORS{"CRITICAL"};}
+if ($final_status==1) { exit $ERRORS{"WARNING"};}
+if ($final_status==3) { exit $ERRORS{"UNKNOWN"};}
+exit $ERRORS{"OK"};
+
diff --git a/plugins/src/check_snmp_storage.pl b/plugins/src/check_snmp_storage.pl
new file mode 100644
index 0000000000000000000000000000000000000000..7bb5b3d3db26968e78487dfb6846d7dd1ee642db
--- /dev/null
+++ b/plugins/src/check_snmp_storage.pl
@@ -0,0 +1,662 @@
+#!/usr/bin/perl -w
+############################## check_snmp_storage ##############
+# Version : 1.1.1.4 - DEV
+# Date :  Aug 2 2005
+# Author  : Patrick Proy ( patrick at proy.org)
+# Help : http://www.manubulon.com/nagios/
+# Licence : GPL - http://www.fsf.org/licenses/gpl.txt
+# TODO : better options in snmpv3
+#################################################################
+#
+# help : ./check_snmp_storage -h
+
+use strict;
+use Net::SNMP;
+use Getopt::Long;
+
+# Nagios specific
+
+use lib "@NAGIOS_PLUGINS@";
+use utils qw(%ERRORS $TIMEOUT);
+#my $TIMEOUT = 15;
+#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+# Oreon specific
+
+#use lib "@NAGIOS_PLUGINS@";
+if (eval "require oreon" ) {
+  use oreon qw(get_parameters create_rrd update_rrd &is_valid_serviceid);
+  use vars qw($VERSION %oreon);
+  %oreon=get_parameters();
+} else {
+  print "Unable to load oreon perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+my $pathtorrdbase = $oreon{GLOBAL}{DIR_RRDTOOL};
+
+# SNMP Datas
+my $storage_table= '1.3.6.1.2.1.25.2.3.1';
+my $storagetype_table = '1.3.6.1.2.1.25.2.3.1.2';
+my $index_table = '1.3.6.1.2.1.25.2.3.1.1';
+my $descr_table = '1.3.6.1.2.1.25.2.3.1.3';
+my $size_table = '1.3.6.1.2.1.25.2.3.1.5.';
+my $used_table = '1.3.6.1.2.1.25.2.3.1.6.';
+my $alloc_units = '1.3.6.1.2.1.25.2.3.1.4.';
+
+#Storage types definition  - from /usr/share/snmp/mibs/HOST-RESOURCES-TYPES.txt
+my %hrStorage;
+$hrStorage{"Other"} = '1.3.6.1.2.1.25.2.1.1';
+$hrStorage{"1.3.6.1.2.1.25.2.1.1"} = 'Other';
+$hrStorage{"Ram"} = '1.3.6.1.2.1.25.2.1.2';
+$hrStorage{"1.3.6.1.2.1.25.2.1.2"} = 'Ram';
+$hrStorage{"VirtualMemory"} = '1.3.6.1.2.1.25.2.1.3';
+$hrStorage{"1.3.6.1.2.1.25.2.1.3"} = 'VirtualMemory';
+$hrStorage{"FixedDisk"} = '1.3.6.1.2.1.25.2.1.4';
+$hrStorage{"1.3.6.1.2.1.25.2.1.4"} = 'FixedDisk';
+$hrStorage{"RemovableDisk"} = '1.3.6.1.2.1.25.2.1.5';
+$hrStorage{"1.3.6.1.2.1.25.2.1.5"} = 'RemovableDisk';
+$hrStorage{"FloppyDisk"} = '1.3.6.1.2.1.25.2.1.6';
+$hrStorage{"1.3.6.1.2.1.25.2.1.6"} = 'FloppyDisk';
+$hrStorage{"CompactDisk"} = '1.3.6.1.2.1.25.2.1.7';
+$hrStorage{"1.3.6.1.2.1.25.2.1.7"} = 'CompactDisk';
+$hrStorage{"RamDisk"} = '1.3.6.1.2.1.25.2.1.8';
+$hrStorage{"1.3.6.1.2.1.25.2.1.8"} = 'RamDisk';
+$hrStorage{"FlashMemory"} = '1.3.6.1.2.1.25.2.1.9';
+$hrStorage{"1.3.6.1.2.1.25.2.1.9"} = 'FlashMemory';
+$hrStorage{"NetworkDisk"} = '1.3.6.1.2.1.25.2.1.10';
+$hrStorage{"1.3.6.1.2.1.25.2.1.10"} = 'NetworkDisk';
+
+# Globals
+
+my $Name='check_snmp_storage';
+my $Version='1.1.1.3';
+
+my $o_host = 	undef; 		# hostname
+my $o_community = undef; 	# community
+my $o_port = 	161; 		# port
+my $o_version2	= undef;	#use snmp v2c
+my $o_descr = 	undef; 		# description filter
+my $o_storagetype = undef;    # parse storage type also
+my $o_warn = 	undef; 		# warning limit
+my $o_crit=	undef; 		# critical limit
+my $o_help=	undef; 		# wan't some help ?
+my $o_type=	undef;		# pl, pu, mbl, mbu
+my @o_typeok=   ("pu","pl","bu","bl"); # valid values for o_type
+my $o_verb=	undef;		# verbose mode
+my $o_version=  undef;          # print version
+my $o_noreg=	undef;		# Do not use Regexp for name
+my $o_sum=	undef;		# add all storage before testing
+my $o_index=	undef;		# Parse index instead of description
+my $o_negate=	undef;		# Negate the regexp if set
+my $o_timeout=  5;            	# Default 5s Timeout
+my $o_perf=	undef;		# Output performance data
+my $o_short=	undef;	# Short output parameters
+my @o_shortL=	undef;		# output type,where,cut
+# SNMP V3 specific
+my $o_login=	undef;		# snmp v3 login
+my $o_passwd=	undef;		# snmp v3 passwd
+# Oreon specific
+my $o_step=	undef;
+my $o_g=	undef;
+my $o_S=	undef;
+my $step=	undef;
+my $rrd=	undef;
+my $rrd_max=	undef;
+my $start=	undef;
+my $ServiceId=	undef;
+my @rrd_data= undef;
+
+# functions
+
+sub p_version { print "$Name version : $Version\n"; }
+
+sub print_usage {
+    print "Usage: $Name [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd) [-p <port>] -m <name in desc_oid> [-q storagetype] -w <warn_level> -c <crit_level> [-t <timeout>] [-T pl|pu|bl|bu ] [-r] [-s] [-i] [-e] [-S 0|1[,1,<car>]]\n";
+}
+
+sub round ($$) {
+    sprintf "%.$_[1]f", $_[0];
+}
+
+sub is_pattern_valid { # Test for things like "<I\s*[^>" or "+5-i"
+ my $pat = shift;
+ if (!defined($pat)) { $pat=" ";} # Just to get rid of compilation time warnings
+ return eval { "" =~ /$pat/; 1 } || 0;
+}
+
+# Get the alarm signal (just in case snmp timout screws up)
+$SIG{'ALRM'} = sub {
+     print ("ERROR: General time-out (Alarm signal)\n");
+     exit $ERRORS{"UNKNOWN"};
+};
+
+sub isnnum { # Return true if arg is not a number
+  my $num = shift;
+  if ( $num =~ /^-?(\d+\.?\d*)|(^\.\d+)$/ ) { return 0 ;}
+  return 1;
+}
+
+sub help {
+   print "\nSNMP Disk Monitor for Nagios version ",$Version,"\n";
+   print "(c)2004 to my cat Ratoune - Author : Patrick Proy\n\n";
+   print_usage();
+   print <<EOT;
+By default, plugin will monitor %used on drives :
+warn if %used > warn and critical if %used > crit
+-v, --verbose
+   print extra debugging information (and lists all storages)
+-h, --help
+   print this help message
+-H, --hostname=HOST
+   name or IP address of host to check
+-C, --community=COMMUNITY NAME
+   community name for the host's SNMP agent (implies SNMP v1)
+-2, --v2c
+   Use snmp v2c
+-l, --login=LOGIN
+   Login for snmpv3 authentication (implies v3 protocol with MD5)
+-x, --passwd=PASSWD
+   Password for snmpv3 authentication
+-p, --port=PORT
+   SNMP port (Default 161)
+-m, --name=NAME
+   Name in description OID (can be mounpoints '/home' or 'Swap Space'...)
+   This is treated as a regexp : -m /var will match /var , /var/log, /opt/var ...
+   Test it before, because there are known bugs (ex : trailling /)
+   No trailing slash for mountpoints !
+-q, --storagetype=[Other|Ram|VirtualMemory|FixedDisk|RemovableDisk|FloppyDisk
+                    CompactDisk|RamDisk|FlashMemory|NetworkDisk]
+   Also check the storage type in addition of the name
+   It is possible to use regular expressions ( "FixedDisk|FloppyDisk" )
+-r, --noregexp
+   Do not use regexp to match NAME in description OID
+-s, --sum
+   Add all storages that match NAME (used space and total space)
+   THEN make the tests.
+-i, --index
+   Parse index table instead of description table to select storage
+-e, --exclude
+   Select all storages except the one(s) selected by -m
+   No action on storage type selection
+-T, --type=TYPE
+   pl : calculate percent left
+   pu : calculate percent used (Default)
+   bl : calculate MegaBytes left
+   bu : calculate MegaBytes used
+-w, --warn=INTEGER
+   percent / MB of disk used to generate WARNING state
+   you can add the % sign
+-c, --critical=INTEGER
+   percent / MB of disk used to generate CRITICAL state
+   you can add the % sign
+-f, --perfparse
+   Perfparse compatible output
+-S, --short=<type>[,<where>,<cut>]
+   <type>: Make the output shorter :
+     0 : only print the global result except the disk in warning or critical
+         ex: "< 80% : OK"
+     1 : Don't print all info for every disk
+         ex : "/ : 66 %used  (<  80) : OK"
+   <where>: (optional) if = 1, put the OK/WARN/CRIT at the beginning
+   <cut>: take the <n> first caracters or <n> last if n<0
+-t, --timeout=INTEGER
+   timeout for SNMP in seconds (Default: 5)
+-V, --version
+   prints version number
+-g (--rrdgraph)   Create a rrd base if necessary and add datas into this one
+--rrd_step	     Specifies the base interval in seconds with which data will be fed into the RRD (300 by default)
+-S (--ServiceId)  Oreon Service Id
+
+Note :
+  with T=pu or T=bu : OK < warn < crit
+  with T=pl ot T=bl : crit < warn < OK
+
+  If multiple storage are selected, the worse condition will be returned
+  i.e if one disk is critical, the return is critical
+
+  example :
+  Browse storage list : <script> -C <community> -H <host> -m <anything> -w 1 -c 2 -v
+  the -m option allows regexp in perl format :
+  Test drive C,F,G,H,I on Windows 	: -m ^[CFGHI]:
+  Test all mounts containing /var      	: -m /var
+  Test all mounts under /var      	: -m ^/var
+  Test only /var                 	: -m /var -r
+  Test all swap spaces			: -m ^Swap
+  Test all but swap spaces		: -m ^Swap -e
+
+EOT
+}
+
+sub verb { my $t=shift; print $t,"\n" if defined($o_verb) ; }
+
+sub check_options {
+    Getopt::Long::Configure ("bundling");
+    GetOptions(
+		'v'	=> \$o_verb,		'verbose'	=> \$o_verb,
+        'h'     => \$o_help,    	'help'        	=> \$o_help,
+        'H:s'   => \$o_host,		'hostname:s'	=> \$o_host,
+        'p:i'   => \$o_port,   		'port:i'	=> \$o_port,
+        'C:s'   => \$o_community,	'community:s'	=> \$o_community,
+        'l:s'   => \$o_login,           'login:s'       => \$o_login,
+        'x:s'   => \$o_passwd,          'passwd:s'      => \$o_passwd,
+        'c:s'   => \$o_crit,    	'critical:s'	=> \$o_crit,
+        'w:s'   => \$o_warn,    	'warn:s'	=> \$o_warn,
+	't:i'   => \$o_timeout,       	'timeout:i'     => \$o_timeout,
+        'm:s'   => \$o_descr,		'name:s'	=> \$o_descr,
+	'T:s'	=> \$o_type,		'type:s'	=> \$o_type,
+        'r'     => \$o_noreg,           'noregexp'      => \$o_noreg,
+        's'     => \$o_sum,           	'sum'      	=> \$o_sum,
+        'i'     => \$o_index,          	'index'      	=> \$o_index,
+        'e'     => \$o_negate,         	'exclude'    	=> \$o_negate,
+        'V'     => \$o_version,         'version'       => \$o_version,
+		'q:s'  	=> \$o_storagetype,	'storagetype:s'=> \$o_storagetype,
+	'2'	=> \$o_version2,	'v2c'		=> \$o_version2,
+	'S:s'   => \$o_short,         	'short:s'       => \$o_short,
+	'f'	=> \$o_perf,		'perfparse'	=> \$o_perf,
+	# For Oreon rrdtool graph
+  "rrd_step:s" => \$o_step,
+  "g"   => \$o_g, "rrdgraph"     => \$o_g,
+#  "S=s" => \$o_S,
+  "ServiceId=s"  => \$o_S
+    );
+    if (defined($o_help) ) { help(); exit $ERRORS{"UNKNOWN"}};
+    if (defined($o_version) ) { p_version(); exit $ERRORS{"UNKNOWN"}};
+    # check mount point regexp
+    if (!is_pattern_valid($o_descr))
+	{ print "Bad pattern for mount point !\n"; print_usage(); exit $ERRORS{"UNKNOWN"}}
+    # check snmp information
+    if ( !defined($o_community) && (!defined($o_login) || !defined($o_passwd)) )
+        { print "Put snmp login info!\n"; print_usage(); exit $ERRORS{"UNKNOWN"}}
+    # Check types
+    if ( !defined($o_type) ) { $o_type="pu" ;}
+    if ( ! grep( /^$o_type$/ ,@o_typeok) ) { print_usage(); exit $ERRORS{"UNKNOWN"}};
+    # Check compulsory attributes
+    if ( ! defined($o_descr) ||  ! defined($o_host) || !defined($o_warn) ||
+	!defined($o_crit)) { print_usage(); exit $ERRORS{"UNKNOWN"}};
+    # Check for positive numbers
+
+    # check if warn or crit  in % and MB is tested
+    if (  ( ( $o_warn =~ /%/ ) || ($o_crit =~ /%/)) && ( ( $o_type eq 'bu' ) || ( $o_type eq 'bl' ) ) ) {
+	print "warning or critical cannot be in % when MB are tested\n";
+	print_usage(); exit $ERRORS{"UNKNOWN"};
+    }
+    # Get rid of % sign
+    $o_warn =~ s/\%//;
+    $o_crit =~ s/\%//;
+    if (($o_warn < 0) || ($o_crit < 0)) { print " warn and critical > 0 \n";print_usage(); exit $ERRORS{"UNKNOWN"}};
+    # Check warning and critical values
+    if ( ( $o_type eq 'pu' ) || ( $o_type eq 'bu' )) {
+	if ($o_warn >= $o_crit) { print " warn < crit if type=",$o_type,"\n";print_usage(); exit $ERRORS{"UNKNOWN"}};
+    }
+    if ( ( $o_type eq 'pl' ) || ( $o_type eq 'bl' )) {
+	if ($o_warn <= $o_crit) { print " warn > crit if type=",$o_type,"\n";print_usage(); exit $ERRORS{"UNKNOWN"}};
+    }
+    if ( ($o_warn < 0 ) || ($o_crit < 0 )) { print "warn and crit must be > 0\n";print_usage(); exit $ERRORS{"UNKNOWN"}};
+    if ( ( $o_type eq 'pl' ) || ( $o_type eq 'pu' )) {
+        if ( ($o_warn > 100 ) || ($o_crit > 100 )) { print "percent must be < 100\n";print_usage(); exit $ERRORS{"UNKNOWN"}};
+    }
+	# Check short values
+	if ( defined ($o_short)) {
+ 	  @o_shortL=split(/,/,$o_short);
+	  if ((isnnum($o_shortL[0])) || ($o_shortL[0] !=0) && ($o_shortL[0]!=1)) {
+	    print "-S first option must be 0 or 1\n";print_usage(); exit $ERRORS{"UNKNOWN"};
+	  }
+	  if (defined ($o_shortL[1])&& $o_shortL[1] eq "") {$o_shortL[1]=undef};
+	  if (defined ($o_shortL[2]) && isnnum($o_shortL[2]))
+	    {print "-S last option must be an integer\n";print_usage(); exit $ERRORS{"UNKNOWN"};}
+	}
+	 ###### Oreon #######
+
+	if (!defined($o_S)) { $o_S="1_1" }
+	$ServiceId = is_valid_serviceid($o_S);
+
+	if (!defined($o_step)) { $o_step="300" }
+	$step = $1 if ($o_step =~ /(\d+)/);
+
+
+}
+
+########## MAIN #######
+
+check_options();
+
+$rrd = $pathtorrdbase.$ServiceId.".rrd";
+$start=time;
+
+# Check gobal timeout
+if (defined($TIMEOUT)) {
+  verb("Alarm at $TIMEOUT");
+  alarm($TIMEOUT);
+} else {
+  verb("no timeout defined : $o_timeout + 10");
+  alarm ($o_timeout+10);
+}
+
+# Connect to host
+my ($session,$error);
+if ( defined($o_login) && defined($o_passwd)) {
+  # SNMPv3 login
+  verb("SNMPv3 login");
+  ($session, $error) = Net::SNMP->session(
+      -hostname         => $o_host,
+      -version          => '3',
+      -username         => $o_login,
+      -authpassword     => $o_passwd,
+      -authprotocol     => 'md5',
+      -privpassword     => $o_passwd,
+      -timeout   	=> $o_timeout
+   );
+} else {
+  if (defined ($o_version2)) {
+    # SNMPv2 Login
+	($session, $error) = Net::SNMP->session(
+       -hostname  => $o_host,
+	   -version   => 2,
+       -community => $o_community,
+       -port      => $o_port,
+       -timeout   => $o_timeout
+    );
+  } else {  # SNMPV1 login
+    ($session, $error) = Net::SNMP->session(
+     -hostname  => $o_host,
+     -community => $o_community,
+     -port      => $o_port,
+     -timeout   => $o_timeout
+    );
+  }
+}
+
+if (!defined($session)) {
+   printf("ERROR: %s.\n", $error);
+   exit $ERRORS{"UNKNOWN"};
+}
+
+my $resultat=undef;
+my $stype=undef;
+if (defined ($o_index)){
+  if (Net::SNMP->VERSION < 4) {
+    $resultat = $session->get_table($index_table);
+  } else {
+	$resultat = $session->get_table(Baseoid => $index_table);
+  }
+} else {
+  if (Net::SNMP->VERSION < 4) {
+    $resultat = $session->get_table($descr_table);
+  } else {
+    $resultat = $session->get_table(Baseoid => $descr_table);
+  }
+}
+#get storage typetable for reference
+if (defined($o_storagetype)){
+  if (Net::SNMP->VERSION < 4) {
+    $stype = $session->get_table($storagetype_table);
+  } else {
+    $stype = $session->get_table(Baseoid => $storagetype_table);
+  }
+}
+if (!defined($resultat) | (!defined($stype) && defined($o_storagetype))) {
+   printf("ERROR: Description/Type table : %s.\n", $session->error);
+   $session->close;
+   exit $ERRORS{"UNKNOWN"};
+}
+
+my @tindex = undef;
+my @oids = undef;
+my @descr = undef;
+my $num_int = 0;
+my $count_oid = 0;
+my $test = undef;
+my $perf_out=	undef;
+# Select storage by regexp of exact match
+# and put the oid to query in an array
+
+verb("Filter : $o_descr");
+
+foreach my $key ( keys %$resultat) {
+   verb("OID : $key, Desc : $$resultat{$key}");
+   # test by regexp or exact match / include or exclude
+   if (defined($o_negate)) {
+     $test = defined($o_noreg)
+                ? $$resultat{$key} ne $o_descr
+                : $$resultat{$key} !~ /$o_descr/;
+   } else {
+     $test = defined($o_noreg)
+                ? $$resultat{$key} eq $o_descr
+                : $$resultat{$key} =~ /$o_descr/;
+   }
+  if ($test) {
+    # get the index number of the interface
+    my @oid_list = split (/\./,$key);
+    $tindex[$num_int] = pop (@oid_list);
+       # Check if storage type is OK
+       if (defined($o_storagetype)) {
+	   my($skey)=$storagetype_table.".".$tindex[$num_int];
+ 	   verb("   OID : $skey, Storagetype: $hrStorage{$$stype{$skey}} ?= $o_storagetype");
+           if ( $hrStorage{$$stype{$skey}} !~ $o_storagetype) {
+	     $test=undef;
+	   }
+	}
+	if ($test) {
+       # get the full description
+       $descr[$num_int]=$$resultat{$key};
+       # put the oid in an array
+       $oids[$count_oid++]=$size_table . $tindex[$num_int];
+       $oids[$count_oid++]=$used_table . $tindex[$num_int];
+       $oids[$count_oid++]=$alloc_units . $tindex[$num_int];
+
+       verb("   Name : $descr[$num_int], Index : $tindex[$num_int]");
+       $num_int++;
+    }
+  }
+}
+verb("storages selected : $num_int");
+if ( $num_int == 0 ) { print "Unknown storage : $o_descr : ERROR\n" ; exit $ERRORS{"UNKNOWN"};}
+
+my $result=undef;
+
+if (Net::SNMP->VERSION < 4) {
+  $result = $session->get_request(@oids);
+} else {
+  if ($session->version == 0) {
+    # snmpv1
+    $result = $session->get_request(Varbindlist => \@oids);
+  } else {
+    # snmp v2c or v3 : get_bulk_request is not really good for this, so do simple get
+    $result = $session->get_request(Varbindlist => \@oids);
+    foreach my $key ( keys %$result) { verb("$key  : $$result{$key}"); }
+  }
+}
+
+if (!defined($result)) { printf("ERROR: Size table :%s.\n", $session->error); $session->close;
+   exit $ERRORS{"UNKNOWN"};
+}
+
+$session->close;
+
+# Only a few ms left...
+alarm(0);
+
+# Sum everything if -s and more than one storage
+if ( defined ($o_sum) && ($num_int > 1) ) {
+  verb("Adding all entries");
+  $$result{$size_table . $tindex[0]} *= $$result{$alloc_units . $tindex[0]};
+  $$result{$used_table . $tindex[0]} *= $$result{$alloc_units . $tindex[0]};
+  $$result{$alloc_units . $tindex[0]} = 1;
+  for (my $i=1;$i<$num_int;$i++) {
+    $$result{$size_table . $tindex[0]} += ($$result{$size_table . $tindex[$i]}
+					  * $$result{$alloc_units . $tindex[$i]});
+    $$result{$used_table . $tindex[0]} += ($$result{$used_table . $tindex[$i]}
+					  * $$result{$alloc_units . $tindex[$i]});
+  }
+  $num_int=1;
+  $descr[0]="Sum of all $o_descr";
+}
+
+my $i=undef;
+my $warn_state=0;
+my $crit_state=0;
+my ($p_warn,$p_crit);
+my $output=undef;
+for ($i=0;$i<$num_int;$i++) {
+  verb("Descr : $descr[$i]");
+  verb("Size :  $$result{$size_table . $tindex[$i]}");
+  verb("Used : $$result{$used_table . $tindex[$i]}");
+  verb("Alloc : $$result{$alloc_units . $tindex[$i]}");
+  my $to = $$result{$size_table . $tindex[$i]} * $$result{$alloc_units . $tindex[$i]} / 1024**2;
+  my $pu=undef;
+  if ( $$result{$used_table . $tindex[$i]} != 0 ) {
+    $pu = $$result{$used_table . $tindex[$i]}*100 / $$result{$size_table . $tindex[$i]};
+  }else {
+    $pu=0;
+  }
+  my $bu = $$result{$used_table . $tindex[$i]} *  $$result{$alloc_units . $tindex[$i]} / 1024**2;
+  my $pl = 100 - $pu;
+  my $bl = ($$result{$size_table . $tindex[$i]}- $$result{$used_table . $tindex[$i]}) * $$result{$alloc_units . $tindex[$i]} / 1024**2;
+  # add a ' ' if some data exists in $perf_out
+  $perf_out .= " " if (defined ($perf_out)) ;
+  ##### Ouputs and checks
+  # Keep complete description fot performance output (in MB)
+  my $Pdescr=$descr[$i];
+  $Pdescr =~ s/'/_/g;
+  ##### TODO : subs "," with something
+ if (defined($o_shortL[2])) {
+   if ($o_shortL[2] < 0) {$descr[$i]=substr($descr[$i],$o_shortL[2]);}
+   else {$descr[$i]=substr($descr[$i],0,$o_shortL[2]);}
+ }
+ if ($o_type eq "pu") { # Checks % used
+    my $locstate=0;
+	$p_warn=$o_warn*$to/100;$p_crit=$o_crit*$to/100;
+        (($pu >= $o_crit) && ($locstate=$crit_state=1))
+	   || (($pu >= $o_warn) && ($locstate=$warn_state=1));
+	if (defined($o_shortL[2])) {}
+	if (!defined($o_shortL[0]) || ($locstate==1)) { # print full output if warn or critical state
+	  $output.=sprintf ("%s: %.0f%%used(%.0fMB/%.0fMB) ",$descr[$i],$pu,$bu,$to);
+    } elsif ($o_shortL[0] == 1) {
+	  $output.=sprintf ("%s: %.0f%% ",$descr[$i],$pu);
+	}
+  	$rrd_max = 100;
+  	if (defined($rrd_data[0])) {
+  		push @rrd_data, $pu;
+  	} else {
+  		$rrd_data[0]= $pu ;
+  	}
+  }
+
+  if ($o_type eq 'bu') { # Checks MBytes used
+    my $locstate=0;
+	$p_warn=$o_warn;$p_crit=$o_crit;
+    ( ($bu >= $o_crit) && ($locstate=$crit_state=1) )
+	  || ( ($bu >= $o_warn) && ($locstate=$warn_state=1) );
+	if (!defined($o_shortL[0]) || ($locstate==1)) { # print full output if warn or critical state
+      $output.=sprintf("%s: %.0fMBused/%.0fMB (%.0f%%) ",$descr[$i],$bu,$to,$pu);
+    } elsif ($o_shortL[0] == 1) {
+	  $output.=sprintf("%s: %.0fMB ",$descr[$i],$bu);
+    }
+ 	$rrd_max = "U";
+ 	if (defined($rrd_data[0])) {
+  		push @rrd_data, $bu;
+  	} else {
+  		$rrd_data[0]= $bu ;
+  	}
+
+ }
+
+  if ($o_type eq 'bl') {
+    my $locstate=0;
+    $p_warn=$to-$o_warn;$p_crit=$to-$o_crit;
+    ( ($bl <= $o_crit) && ($locstate=$crit_state=1) )
+	  || ( ($bl <= $o_warn) && ($locstate=$warn_state=1) );
+	if (!defined($o_shortL[0]) || ($locstate==1)) { # print full output if warn or critical state
+      $output.=sprintf ("%s: %.0fMBleft/%.0fMB (%.0f%%) ",$descr[$i],$bl,$to,$pl);
+    } elsif ($o_shortL[0] == 1) {
+	  $output.=sprintf ("%s: %.0fMB ",$descr[$i],$bl);
+    }
+ 	$rrd_max = "U";
+   	if (defined($rrd_data[0])) {
+  		push @rrd_data, $pl;
+  	} else {
+  		$rrd_data[0]= $pl ;
+  	}
+ }
+
+  if ($o_type eq 'pl') {  # Checks % left
+    my $locstate=0;
+    $p_warn=(100-$o_warn)*$to/100;$p_crit=(100-$o_crit)*$to/100;
+    ( ($pl <= $o_crit) && ($locstate=$crit_state=1) )
+	  || ( ($pl <= $o_warn) && ($locstate=$warn_state=1) );
+	if (!defined($o_shortL[0]) || ($locstate==1)) { # print full output if warn or critical state
+      $output.=sprintf ("%s: %.0f%%left(%.0fMB/%.0fMB) ",$descr[$i],$pl,$bl,$to);
+    } elsif ($o_shortL[0] == 1) {
+	  $output.=sprintf ("%s: %.0f%% ",$descr[$i],$pl);
+    }
+   	$rrd_max = 100;
+   	if (defined($rrd_data[0])) {
+  		push @rrd_data, $pl;
+  	} else {
+  		$rrd_data[0]= $pl ;
+  	}
+
+  }
+
+
+  # Performance output (in MB)
+  $perf_out .= "'".$Pdescr. "'=" . round($bu,0) . "MB;" . round($p_warn,0)
+	       . ";" . round($p_crit,0) . ";0;" . round($to,0);
+}
+
+
+ ##
+  ## RRD management
+  ##
+
+	if ($o_g) {
+		$start=time;
+		 if (! -e $rrd) {
+	        create_rrd($rrd,$#rrd_data+1,$start,$step,0,$rrd_max,"GAUGE");
+	     }
+	     update_rrd($rrd,$start,@rrd_data);
+	}
+
+
+
+verb ("Perf data : $perf_out");
+
+my $comp_oper=undef;
+my $comp_unit=undef;
+($o_type eq "pu") && ($comp_oper ="<") && ($comp_unit ="%");
+($o_type eq "pl") && ($comp_oper =">") && ($comp_unit ="%");
+($o_type eq "bu") && ($comp_oper ="<") && ($comp_unit ="MB");
+($o_type eq 'bl') && ($comp_oper =">") && ($comp_unit ="MB");
+
+if (!defined ($output)) { $output="All selected storages "; }
+
+if ( $crit_state == 1) {
+    $comp_oper = ($comp_oper eq "<") ? ">" : "<";  # Inverse comp operator
+    if (defined($o_shortL[1])) {
+	  print "CRITICAL : (",$comp_oper,$o_crit,$comp_unit,") ",$output;
+	} else {
+	  print $output,"(",$comp_oper,$o_crit,$comp_unit,") : CRITICAL";
+	}
+	(defined($o_perf)) ?  print " | ",$perf_out,"\n" : print "\n";
+     exit $ERRORS{"CRITICAL"};
+    }
+if ( $warn_state == 1) {
+    $comp_oper = ($comp_oper eq "<") ? ">" : "<";  # Inverse comp operator
+    if (defined($o_shortL[1])) {
+       print "WARNING : (",$comp_oper,$o_warn,$comp_unit,") ",$output;
+	} else {
+       print $output,"(",$comp_oper,$o_warn,$comp_unit,") : WARNING";
+	}
+	(defined($o_perf)) ?  print " | ",$perf_out,"\n" : print "\n";
+     exit $ERRORS{"WARNING"};
+   }
+if (defined($o_shortL[1])) {
+  print "OK : (",$comp_oper,$o_warn,$comp_unit,") ",$output;
+} else {
+  print $output,"(",$comp_oper,$o_warn,$comp_unit,") : OK";
+}
+(defined($o_perf)) ? print " | ",$perf_out,"\n" : print "\n";
+
+exit $ERRORS{"OK"};
+
diff --git a/plugins/src/check_snmp_win.pl b/plugins/src/check_snmp_win.pl
new file mode 100644
index 0000000000000000000000000000000000000000..c170f50d0597ec20b0d1d2aa00bf3ddd42ce4ab7
--- /dev/null
+++ b/plugins/src/check_snmp_win.pl
@@ -0,0 +1,381 @@
+#!/usr/bin/perl -w
+############################## check_snmp_win ##############
+# Version : 0.5
+# Date : Aug 22 2005
+# Author  : Patrick Proy (patrick at proy.org)
+# Help : http://www.manubulon.com/nagios/
+# Licence : GPL - http://www.fsf.org/licenses/gpl.txt
+# TODO :
+###############################################################
+#
+# help : ./check_snmp_win.pl -h
+
+use strict;
+use Net::SNMP;
+use Getopt::Long;
+
+# Nagios specific
+
+use lib "@NAGIOS_PLUGINS@";
+use utils qw(%ERRORS $TIMEOUT);
+#my $TIMEOUT = 5;
+#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+# SNMP Datas for processes (MIB II)
+my $process_table= '1.3.6.1.2.1.25.4.2.1';
+my $index_table = '1.3.6.1.2.1.25.4.2.1.1';
+my $run_name_table = '1.3.6.1.2.1.25.4.2.1.2';
+my $run_path_table = '1.3.6.1.2.1.25.4.2.1.4';
+my $proc_mem_table = '1.3.6.1.2.1.25.5.1.1.2'; # Kbytes
+my $proc_cpu_table = '1.3.6.1.2.1.25.5.1.1.1'; # Centi sec of CPU
+my $proc_run_state = '1.3.6.1.2.1.25.4.2.1.7';
+
+# Windows SNMP DATA
+
+my $win_serv_table = '1.3.6.1.4.1.77.1.2.3.1'; # Windows services table
+my $win_serv_name = '1.3.6.1.4.1.77.1.2.3.1.1'; # Name of the service
+# Install state : uninstalled(1), install-pending(2), uninstall-pending(3), installed(4)
+my $win_serv_inst = '1.3.6.1.4.1.77.1.2.3.1.2';
+# Operating state : active(1),  continue-pending(2),  pause-pending(3),  paused(4)
+my $win_serv_state = '1.3.6.1.4.1.77.1.2.3.1.3';
+my %win_serv_state_label = ( 1 => 'active', 2=> 'continue-pending', 3=> 'pause-pending', 4=> 'paused');
+# Can be uninstalled : cannot-be-uninstalled(1), can-be-uninstalled(2)
+my $win_serv_uninst = '1.3.6.1.4.1.77.1.2.3.1.4';
+
+# Globals
+
+my $Version='0.5';
+my $Name='check_snmp_win';
+
+my $o_host = 	undef; 		# hostname
+my $o_community =undef; 	# community
+my $o_port = 	161; 		# port
+my $o_version2	= undef;	#use snmp v2c
+my $o_descr = 	undef; 		# description filter
+my @o_descrL = 	undef;		# Service descriprion list.
+my $o_showall = undef;	# Show all services even if OK
+my $o_type = "service";	# Check type (service, ...)
+my $o_number = undef;  # Number of service for warn and crit levels
+my $o_help=	undef; 		# wan't some help ?
+my $o_verb=	undef;		# verbose mode
+my $o_version=   undef;         # print version
+my $o_noreg=	undef;		# Do not use Regexp for name
+my $o_timeout=  5;            	# Default 5s Timeout
+# SNMP V3 specific
+my $o_login=	undef;		# snmp v3 login
+my $o_passwd=	undef;		# snmp v3 passwd
+
+# functions
+
+sub p_version { print "$Name version : $Version\n"; }
+
+sub print_usage {
+    print "Usage: $Name [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd) [-p <port>] -n <name>[,<name2] [-T=service] [-r] [-s] [-N=<n>] [-t <timeout>] [-V]\n";
+}
+
+sub isnotnum { # Return true if arg is not a number
+  my $num = shift;
+  if ( $num =~ /^-?(\d+\.?\d*)|(^\.\d+)$/ ) { return 0 ;}
+  return 1;
+}
+
+sub is_pattern_valid { # Test for things like "<I\s*[^>" or "+5-i"
+ my $pat = shift;
+ if (!defined($pat)) { $pat=" ";} # Just to get rid of compilation time warnings
+ return eval { "" =~ /$pat/; 1 } || 0;
+}
+
+# Get the alarm signal (just in case snmp timout screws up)
+$SIG{'ALRM'} = sub {
+     print ("ERROR: Alarm signal (Nagios time-out)\n");
+     exit $ERRORS{"UNKNOWN"};
+};
+
+sub help {
+   print "\nSNMP Windows Monitor for Nagios version ",$Version,"\n";
+   print "GPL licence, (c)2004-2005 Patrick Proy\n\n";
+   print_usage();
+   print <<EOT;
+-v, --verbose
+   print extra debugging information (and lists all services)
+-h, --help
+   print this help message
+-H, --hostname=HOST
+   name or IP address of host to check
+-C, --community=COMMUNITY NAME
+   community name for the host's SNMP agent (implies SNMP v1 or v2c with option)
+-2, --v2c
+   Use snmp v2c
+-l, --login=LOGIN
+   Login for snmpv3 authentication (implies v3 protocol with MD5)
+-x, --passwd=PASSWD
+   Password for snmpv3 authentication
+-p, --port=PORT
+   SNMP port (Default 161)
+-T, --type=service
+   Check type :
+     - service (default) checks service
+-n, --name=NAME[,NAME2...]
+   Comma separated names of services (perl regular expressions can be used for every one).
+   By default, it is not case sensitive.
+-N, --number=<n>
+   Compare matching services with <n> instead of the number of names provided.
+-s, --showall
+   Show all services in the output, instead of only the non-active ones.
+-r, --noregexp
+   Do not use regexp to match NAME in service description.
+-t, --timeout=INTEGER
+   timeout for SNMP in seconds (Default: 5)
+-V, --version
+   prints version number
+Note :
+  The script will return
+    OK if ALL services are in active state,
+    WARNING if there is more than specified (ex 2 service specified, 3 active services matching),
+    CRITICAL if at least one of them is non active.
+  The -n option will allows regexp in perl format
+  -n "service" will match 'service WINS' 'sevice DNS' etc...
+  It is not case sensitive by default : WINS = wins
+EOT
+}
+
+sub verb { my $t=shift; print $t,"\n" if defined($o_verb) ; }
+
+sub decode_utf8 { # just replaces UFT8 caracters by "."
+  my $utfstr=shift;
+  if (substr($utfstr,0,2) ne "0x") { return $utfstr; }
+  my @stringL=split(//,$utfstr);
+  my $newstring="";
+  for (my $i=2;$i<$#stringL;$i+=2) {
+    if ( ($stringL[$i] . $stringL[$i+1]) eq "c3") {
+	  $i+=2;$newstring .= ".";
+	} else {
+	  $newstring .= chr(hex($stringL[$i] . $stringL[$i+1]));
+	}
+  }
+  return $newstring;
+}
+
+sub check_options {
+    Getopt::Long::Configure ("bundling");
+    GetOptions(
+   	'v'	=> \$o_verb,		'verbose'	=> \$o_verb,
+        'h'     => \$o_help,    	'help'        	=> \$o_help,
+        'H:s'   => \$o_host,		'hostname:s'	=> \$o_host,
+        'p:i'   => \$o_port,   		'port:i'	=> \$o_port,
+        'C:s'   => \$o_community,	'community:s'	=> \$o_community,
+        'l:s'   => \$o_login,           'login:s'       => \$o_login,
+        'x:s'   => \$o_passwd,          'passwd:s'      => \$o_passwd,
+	't:i'   => \$o_timeout,       	'timeout:i'     => \$o_timeout,
+        'n:s'   => \$o_descr,		'name:s'	=> \$o_descr,
+        'r'     => \$o_noreg,           'noregexp'      => \$o_noreg,
+        'T:s'   => \$o_type,           	'type:s'      	=> \$o_type,
+        'N:i'   => \$o_number,          'number:i'      => \$o_number,
+	'2'	=> \$o_version2,	'v2c'		=> \$o_version2,
+	's'     => \$o_showall,  	'showall'       => \$o_showall,
+	'V'     => \$o_version,         'version'       => \$o_version
+    );
+    if (defined ($o_help)) { help(); exit $ERRORS{"UNKNOWN"}};
+    if (defined($o_version)) { p_version(); exit $ERRORS{"UNKNOWN"}};
+    # check snmp information
+    if ( !defined($o_community) && (!defined($o_login) || !defined($o_passwd)) )
+        { print "Put snmp login info!\n"; print_usage(); exit $ERRORS{"UNKNOWN"}}
+    # Check compulsory attributes
+    if ( $o_type ne "service" ) {
+      print "Invalid check type !\n"; print_usage(); exit $ERRORS{"UNKNOWN"}
+    }
+    if ( ! defined($o_descr) ||  ! defined($o_host) ) { print_usage(); exit $ERRORS{"UNKNOWN"}};
+    @o_descrL=split(/,/,$o_descr);
+    foreach my $List (@o_descrL) {
+      if ( ! is_pattern_valid ($List) ) { print "Invalid pattern ! ";print_usage(); exit $ERRORS{"UNKNOWN"} }
+    }
+    if (defined ($o_number)) {
+      if (isnotnum($o_number) || ($o_number<0) )
+        { print "Invalid number of services!\n";print_usage(); exit $ERRORS{"UNKNOWN"}}
+    }
+
+}
+
+########## MAIN #######
+
+check_options();
+
+# Check gobal timeout if snmp screws up
+if (defined($TIMEOUT)) {
+  verb("Alarm at $TIMEOUT");
+  alarm($TIMEOUT);
+} else {
+  verb("no timeout defined : $o_timeout + 10");
+  alarm ($o_timeout+10);
+}
+
+# Connect to host
+my ($session,$error);
+if ( defined($o_login) && defined($o_passwd)) {
+  # SNMPv3 login
+  verb("SNMPv3 login");
+  ($session, $error) = Net::SNMP->session(
+      -hostname         => $o_host,
+      -version          => '3',
+      -username         => $o_login,
+      -authpassword     => $o_passwd,
+      -authprotocol     => 'md5',
+      -privpassword     => $o_passwd,
+      -timeout          => $o_timeout
+   );
+} else {
+  if (defined ($o_version2)) {
+    # SNMPv2 Login
+	($session, $error) = Net::SNMP->session(
+       -hostname  => $o_host,
+	   -version   => 2,
+       -community => $o_community,
+       -port      => $o_port,
+       -timeout   => $o_timeout
+    );
+  } else {
+  # SNMPV1 login
+    ($session, $error) = Net::SNMP->session(
+       -hostname  => $o_host,
+       -community => $o_community,
+       -port      => $o_port,
+       -timeout   => $o_timeout
+    );
+  }
+}
+
+$session->max_msg_size(5000);
+verb($session->max_msg_size);
+#print $session->max_msg_size(),"\n";
+
+if (!defined($session)) {
+   printf("ERROR: %s.\n", $error);
+   exit $ERRORS{"UNKNOWN"};
+}
+
+# Look for process in name or path name table
+my $resultat=undef;
+
+$resultat = (Net::SNMP->VERSION < 4) ?
+		$session->get_table($win_serv_name)
+		: $session->get_table(Baseoid => $win_serv_name);
+
+if (!defined($resultat)) {
+   printf("ERROR: Process name table : %s.\n", $session->error);
+   $session->close;
+   exit $ERRORS{"UNKNOWN"};
+}
+
+my @tindex = undef;
+my @oids = undef;
+my @descr = undef;
+my $num_int = 0;
+my $count_oid = 0;
+# Select storage by regexp of exact match
+# and put the oid to query in an array
+
+verb("Filter : $o_descr");
+
+foreach my $key ( keys %$resultat) {
+   my $descr_d=decode_utf8($$resultat{$key});
+   verb("Desc : $descr_d");
+   # test by regexp or exact match
+   my $test=undef;
+   foreach my $List (@o_descrL) {
+     if (!($test)) {
+  	    $test = defined($o_noreg)
+			 ? $descr_d eq $List
+			 : $descr_d =~ /$List/i;
+     }
+  }
+  if ($test) {
+      # get the full description
+     $descr[$num_int]=$descr_d;
+	 # get the index number of the process
+	 $key =~ s/$win_serv_name\.//;
+     $tindex[$num_int] = $key;
+     # put the oid of running state in an array.
+     $oids[$count_oid++]=$win_serv_state . "." . $tindex[$num_int];
+     verb("Name : $descr[$num_int], Index : $tindex[$num_int]");
+     $num_int++;
+  }
+}
+
+if ( $num_int == 0) {
+   if (defined ($o_number) && ($o_number ==0)) {
+    print "No services ",(defined ($o_noreg)) ? "named \"" : "matching \"", $o_descr, "\" found : OK\n";
+    exit $ERRORS{"OK"};
+  } else  {
+    print "No services ",(defined ($o_noreg)) ? "named \"" : "matching \"", $o_descr, "\" found : CRITICAL\n";
+    exit $ERRORS{"CRITICAL"};
+  }
+}
+
+my $result=undef;
+my $num_int_ok=0;
+
+$result = (Net::SNMP->VERSION < 4) ?
+    $session->get_request(@oids)
+  : $session->get_request(Varbindlist => \@oids);
+
+if (!defined($result)) { printf("ERROR: running table : %s.\n", $session->error); $session->close;
+   exit $ERRORS{"UNKNOWN"};
+}
+
+$session->close;
+
+my $output=undef;
+#Check if service are in active state
+for (my $i=0; $i< $num_int; $i++) {
+   my $state=$$result{$win_serv_state . "." . $tindex[$i]};
+   verb ("Process $tindex[$i] in state $state");
+   if ($state == 1) {
+     $num_int_ok++
+   } else {
+     $output .= ", " if defined($output);
+     $output .= $descr[$i] . " : " . $win_serv_state_label{$state};
+   }
+}
+
+my $force_critical=0;
+
+# Show the services that are not present
+# Or all of them with -s option
+foreach my $List (@o_descrL) {
+  my $test=0;
+  for (my $i=0; $i< $num_int; $i++) {
+    if ( $descr[$i] =~ /$List/i  ) { $test++; }
+  }
+  if ($test==0) {
+    $output .= ", " if defined($output);
+    $output .= "\"" . $List . "\" not active";
+    # Force a critical state (could otherwise lead to false OK)
+    $force_critical=1;
+  } elsif ( defined ($o_showall) ) {
+    $output .= ", " if defined($output);
+    $output .= "\"" . $List . "\" active";
+    if ($test != 1) {
+      $output .= "(" .$test . " services)";
+    }
+  }
+}
+
+if (defined ($output) ) {
+  print $output, " : ";
+} else {
+  print $num_int_ok, " services active (", (defined ($o_noreg)) ? "named \"" : "matching \"", $o_descr, "\") : ";
+}
+
+$o_number = $#o_descrL+1 if (!defined($o_number));
+
+if (($num_int_ok < $o_number)||($force_critical == 1)) {
+	print "CRITICAL\n";
+	exit $ERRORS{"CRITICAL"};
+} elsif ($num_int_ok > $o_number) {
+  print "WARNING\n";
+  exit $ERRORS{"WARNING"};
+}
+print "OK\n";
+exit $ERRORS{"OK"};
+
+
diff --git a/plugins/src/oreon.conf b/plugins/src/oreon.conf
new file mode 100644
index 0000000000000000000000000000000000000000..945f3a342da0c5e17cb891df01cc93dc07382e4a
--- /dev/null
+++ b/plugins/src/oreon.conf
@@ -0,0 +1,47 @@
+[GLOBAL]
+DIR_OREON=@INSTALL_DIR_OREON@/
+DIR_TRAFFICMAP=@INSTALL_DIR_OREON@/include/trafficMap/average/
+DIR_NAGIOS=@INSTALL_DIR_NAGIOS@/
+DIR_RRDTOOL=@INSTALL_DIR_OREON@/rrd/
+NAGIOS_LIBEXEC=@NAGIOS_PLUGINS@/
+NAGIOS_ETC=@NAGIOS_ETC@/
+
+[NT]
+CPU=.1.3.6.1.2.1.25.3.3.1.2
+HD_USED=.1.3.6.1.2.1.25.2.3.1.6
+HD_NAME=.1.3.6.1.2.1.25.2.3.1.3
+
+[CISCO]
+NB_CONNECT=.1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40.6
+
+[UNIX]
+CPU_USER=.1.3.6.1.4.1.2021.11.50.0
+CPU_SYSTEM=.1.3.6.1.4.1.2021.11.52.0
+CPU_LOAD_1M =.1.3.6.1.4.1.2021.10.1.3.1
+CPU_LOAD_5M =.1.3.6.1.4.1.2021.10.1.3.2
+CPU_LOAD_15M =.1.3.6.1.4.1.2021.10.1.3.3
+
+[DELL]
+TEMP=.1.3.6.1.4.1.674.10892.1.700.20.1.6.1
+
+[ALTEON]
+VIRT=1.3.6.1.4.1.1872.2.1.8.2.7.1.3.1
+FRONT=1.3.6.1.4.1.1872.2.1.8.2.5.1.3.1
+
+[MIB2]
+SW_RUNNAME=.1.3.6.1.2.1.25.4.2.1.2
+SW_RUNINDEX=.1.3.6.1.2.1.25.4.2.1.1
+SW_RUNSTATUS=.1.3.6.1.2.1.25.4.2.1.7
+HR_STORAGE_DESCR=.1.3.6.1.2.1.25.2.3.1.3
+HR_STORAGE_ALLOCATION_UNITS=.1.3.6.1.2.1.25.2.3.1.4
+HR_STORAGE_SIZE=.1.3.6.1.2.1.25.2.3.1.5
+HR_STORAGE_USED=.1.3.6.1.2.1.25.2.3.1.6
+OBJECTID=.1.3.6.1.2.1.1.1.0
+UPTIME_WINDOWS=.1.3.6.1.2.1.1.3.0
+UPTIME_OTHER=.1.3.6.1.2.1.25.1.1.0
+IF_IN_OCTET=.1.3.6.1.2.1.2.2.1.10
+IF_OUT_OCTET=.1.3.6.1.2.1.2.2.1.16
+IF_SPEED=.1.3.6.1.2.1.2.2.1.5
+IF_DESC=.1.3.6.1.2.1.2.2.1.2
+
+
diff --git a/plugins/src/oreon.pm b/plugins/src/oreon.pm
new file mode 100644
index 0000000000000000000000000000000000000000..3c76a6113636c25b2a2357c5557879f0221be175
--- /dev/null
+++ b/plugins/src/oreon.pm
@@ -0,0 +1,218 @@
+#
+# $Id: check_graph_ping.pl,v 1.2 2005/07/27 22:21:49 wistof Exp $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Developped by : Mathieu Chateau - Christophe Coraboeuf
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+package	oreon;
+
+use Exporter   ();
+use FindBin qw($Bin);
+use lib "$FindBin::Bin";
+use lib "@NAGIOS_PLUGINS@";
+
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use utils qw($TIMEOUT %ERRORS &print_revision &support);
+
+if (eval "require Config::IniFiles" ) {
+	use Config::IniFiles;
+} else {
+	print "Unable to load Config::IniFiles\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+### RRDTOOL Module
+use lib qw(@RRDTOOL_PERL_LIB@ ../lib/perl);
+if (eval "require RRDs" ) {
+	use RRDs;
+} else {
+	print "Unable to load RRDs perl module\n";
+    exit $ERRORS{'UNKNOWN'};
+}
+
+# On d�fini une version pour les v�rifications
+#$VERSION = do { my @r = (q$Revision: XXX $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+
+our @ISA = qw(Exporter);
+our @EXPORT_OK = qw(get_parameters create_rrd update_rrd fetch_rrd &is_valid_serviceid);
+our @EXPORT = @EXPORT_OK;
+
+my $params_file="oreon.conf";
+my @ds = ("a","b","c","d","e","f","g","h","i","j","k","l");
+
+###############################################################################
+#  Get all parameters from the ini file
+###############################################################################
+sub get_parameters
+{
+
+	$params_file = "@NAGIOS_PLUGINS@/$params_file";
+		 unless (-e $params_file)
+        {
+            print "Unknown - In oreon.pm :: $params_file :: $!\n";
+            exit $ERRORS{'UNKNOWN'};
+        }
+    my %oreon;
+    tie %oreon, 'Config::IniFiles', ( -file => $params_file );
+    return %oreon;
+}
+
+
+###############################################################################
+#  Create RRD file
+###############################################################################
+sub create_rrd($$$$$$$)
+{
+	my @rrd_arg;
+	my ($rrd, $nb_ds ,$start, $step, $min, $max, $type) = @_;
+	$nb_ds = 1 unless($nb_ds);
+	$start = time unless($start);
+	$step = 300 unless($step);
+	$min = "U" unless($min);
+	$max = "U" unless($max);
+	$type = "GAUGE" unless($type);
+
+	my $ERROR = RRDs::error;
+
+	@rrd_arg=($rrd,
+			  "--start",
+			  $start-1,
+			  "--step",
+			  $step);
+
+	for ($i = 0; $i < $nb_ds; $i++) {
+        push(@rrd_arg,"DS:".$ds[$i].":$type:".($step * 2).":".$min.":".$max);
+     }
+	push(@rrd_arg,"RRA:AVERAGE:0.5:1:8640",
+             	  "RRA:MIN:0.5:12:8640",
+             	  "RRA:MAX:0.5:12:8640");
+	RRDs::create (@rrd_arg);
+        $ERROR = RRDs::error;
+        if ($ERROR) {
+            print "unable to create '$rrd' : $ERROR\n" ;
+            exit 3;
+        }
+}
+
+###############################################################################
+#  Update RRD file
+###############################################################################
+sub update_rrd($$@)
+{
+	my @rrd_arg;
+	my ($rrd, $start,@values) = @_;
+	$start = time unless($start);
+
+	my $ERROR = RRDs::error;
+	for (@values) {
+		s/,/\./ ;
+		$str_value .= ":" . $_;
+		}
+	RRDs::update ($rrd, "$start$str_value");
+    $ERROR = RRDs::error;
+    if ($ERROR) {
+    	print "unable to update '$rrd' : $ERROR\n" ;
+        exit 3;
+     }
+}
+
+###############################################################################
+#  Fetch RRD file
+###############################################################################
+sub fetch_rrd($$)
+{
+	my ($line, $val, @valeurs, $update_time, $step, $ds_names, $data, $i) ;
+	my ($rrd, $CF,@values) = @_;
+	$start = time unless($start);
+
+	my $ERROR = RRDs::error;
+
+	($update_time,$step,$ds_names,$data) = RRDs::fetch($rrd, "--resolution=300","--start=now-5min","--end=now",$CF);
+
+
+    $ERROR = RRDs::error;
+    if ($ERROR) {
+    	print "unable to update '$rrd' : $ERROR\n" ;
+        exit 3;
+     }
+     foreach $line (@$data) {
+        foreach $val (@$line) {
+	        if ( defined $val ) { $valeur[$i]=$val; } else { $valeur[$i]="undef"; }
+	        $i++;
+     	}
+    }
+    return @valeur;
+}
+
+
+
+
+###############################################################################
+#  Is a valid ServiceId
+###############################################################################
+sub is_valid_serviceid {
+	my $ServiceId = shift;
+	if ($ServiceId && $ServiceId =~ m/^([0-9_]+)$/) {
+		return $ServiceId;
+	}else{
+		print "Unknown -S Service ID expected... or it doesn't exist, try another id - number\n";
+		exit $ERRORS{'UNKNOWN'};
+	}
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+Oreon - shared module for Oreon plugins
+
+=head1 SYNOPSIS
+
+  use oreon;
+  oreon::get_parameters()
+  oreon::create_rrd( )
+  oreon::update_rrd( )
+
+=head1 DESCRIPTION
+
+=head2 Functions
+
+B<oreon::create_rrd> create a rrd database.
+
+  create_rrd($rrd, $nb_ds ,$start, $step, $min, $max, $type );
+
+	  $rrd : RRD filename
+	  $nb_ds : Number of Data Sources to create
+	  $start : Start time of RRD
+	  $step : RRD step
+	  $min : Minimum value in RRD
+	  $max : Maximum value in RRD
+	  $type : GAUGE or COUNTER
+
+  update_rrd($rrd, $start,@values);
+
+  	  $rrd : RRD filename to update
+	  $start :
+	  @values : update RRD with list values
+
+=head1 AUTHOR
+
+Mathieu Chateau E<lt>mathieu.chateau@lsafrance.comE<gt>
+Christophe Coraboeuf E<lt>ccoraboeuf@oreon-project.orgE<gt>
+
+=cut
+
+
+
+
diff --git a/plugins/src/traps/trap_common.pm b/plugins/src/traps/trap_common.pm
new file mode 100644
index 0000000000000000000000000000000000000000..5732a5dfb8f9ec21c74fd37450e92eeb1de27d6e
--- /dev/null
+++ b/plugins/src/traps/trap_common.pm
@@ -0,0 +1,128 @@
+#
+# $Id: trap_common.pm,v 1.0 2006/06/30 12:30:00 Nicolas Cordier for Merethis $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Developped by : Nicolas Cordier for Merethis
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+package trap_common;
+
+use strict;
+use warnings;
+use DBI;
+
+use Exporter();
+
+our @ISA = qw(Exporter);
+our @EXPORT_OK = qw(submit_res getTrapsInfos);
+our @EXPORT = @EXPORT_OK;
+
+#
+## configuration for oreon db access
+#
+## /!\ you may have to edit this
+#
+sub set_db
+{
+## part that should be modified
+    my $db_name = "oreondb";	## name of your database for oreon
+    my $login = "root";		## user of your database
+    my $mdp   = "";		## password for this user
+## end of part that should be modified
+
+    my $dsn   = "dbi:mysql:$db_name";
+    return $dsn, $login, $mdp;
+}
+
+#
+## send result to nagios using nagios.cmd
+#
+## /!\ you may have to edit this
+#
+sub submit_res($)
+{
+## part that should be modified
+    open(FILE, ">>/var/run/nagios/nagios.cmd") or die ("Can't open"); ## modify this for your nagios.cmd location
+## end of part that should be modified
+    print FILE $_[0];
+    close(FILE);
+}
+
+#
+## remove useless things to get a good ip
+#
+sub epur_ip($)
+{
+    (my $ip) = split(/:/, $_[0]);
+    $ip = substr($ip, 1, -1);
+
+    return $ip;
+}
+
+#
+## retrieve hostname and hostid from db using the ip
+#
+sub get_hostinfos($$)
+{
+    my $requete = "SELECT host_name, host_id FROM host WHERE host_address='$_[1]' ";
+    my $sth = $_[0]->prepare($requete);
+    $sth->execute();
+    my @host = $sth -> fetchrow_array;
+    $sth -> finish;
+    return @host;
+}
+
+#
+## retrieve servicedescription from db using the ip and host_id
+#
+sub get_servicename($$$)
+{
+    my $requete = "SELECT service_description FROM service WHERE service_id IN";
+    $requete .= " (SELECT service_id FROM traps_service_relation WHERE traps_id='$_[1]')";
+    $requete .= " AND service_id IN";
+    $requete .= " (SELECT service_service_id FROM host_service_relation WHERE host_host_id='$_[2]')";
+    my $sth = $_[0]->prepare($requete);
+    if ($sth->execute() == 0)
+    {
+	$sth -> finish;
+	$requete = "SELECT service_description FROM service WHERE service_id IN";
+	$requete .= " (SELECT service_id FROM traps_service_relation WHERE traps_id='$_[1]')";
+	$requete .= " AND service_id IN";
+	$requete .= " (SELECT service_service_id FROM host_service_relation WHERE hostgroup_hg_id IN";
+	$requete .= " (SELECT hostgroup_hg_id FROM hostgroup_relation WHERE host_host_id='$_[2]')";
+	$requete .= ")";
+	$sth = $_[0]->prepare($requete);
+	$sth->execute();
+    }
+    my $service = $sth -> fetchrow_array;
+    $sth -> finish;
+    return $service;
+}
+
+#
+## return informations about the trap for the generation of the result sent to nagios
+#
+sub getTrapsInfos(@)
+{
+    shift;
+    my $ip = epur_ip($_[0]);
+    shift;
+    my $trap_id = $_[0];
+    shift;
+
+    my @db = set_db();
+    my $dbh = DBI->connect($db[0], $db[1], $db[2]) or die "Echec de la connexion\n";
+    my @host = get_hostinfos($dbh, $ip);
+    my $servicename = get_servicename($dbh, $trap_id, $host[1]);
+    $dbh -> disconnect;
+    return $host[0], $servicename, @_;
+}
diff --git a/plugins/src/traps/trap_handler.sh b/plugins/src/traps/trap_handler.sh
new file mode 100644
index 0000000000000000000000000000000000000000..e46a4a6d403f97db38f7a8c77ec5885f29282892
--- /dev/null
+++ b/plugins/src/traps/trap_handler.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# $Id: trap_handler.sh,v 1.0 2006/06/30 12:30:00 Nicolas Cordier for Merethis $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Developped by : Nicolas Cordier for Merethis
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+read host
+read ip
+vars=""
+
+while read oid val
+do
+vars="$vars, $oid = $val"
+done
+
+exec=$1
+shift
+while [ "$1" != "" ]
+do
+args="$args $1"
+shift
+done
+
+args="$ip $args $vars"
+
+$exec $args 
diff --git a/plugins/src/traps/trap_link.pl b/plugins/src/traps/trap_link.pl
new file mode 100644
index 0000000000000000000000000000000000000000..fea12894244ee05a4194a24433c528282840ec58
--- /dev/null
+++ b/plugins/src/traps/trap_link.pl
@@ -0,0 +1,61 @@
+#!/usr/bin/perl -w
+#
+# $Id: trap_link.pl,v 1.0 2006/06/30 12:30:00 Nicolas Cordier for Merethis $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Developped by : Nicolas Cordier for Merethis
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+#
+## to use the common.pm including usefull functions
+#
+use DBI;
+use lib '/usr/lib/nagios/plugins/traps';
+use trap_common;
+
+#
+## get informations about the trap for the generation of the result sent to nagios
+#
+(my $hostname, my $servicename, my @args) = getTrapsInfos(@ARGV);
+
+#
+## set state for the resul (OK (0)/WARNING (1)/CRITICAL (2)/UNKNOWN (3))
+#
+my $state = ($args[0] eq "up" ? 0 : 2);
+
+#
+## set the text output of the service check
+#
+my $plugin = "";
+$plugin .= $args[0];
+
+# parse trap to obtain more information
+my $i = 0;
+while ($args[$i])
+{
+    submit_res("$args[$i]\n");
+    if ("$args[$i]" eq "IF-MIB::ifDescr")
+    {
+	$plugin .= " on $args[$i + 2]";
+    }
+    $i++;
+}
+
+#
+## set the result
+#
+$res = "[".time."] PROCESS_SERVICE_CHECK_RESULT;".$hostname.";".$servicename.";".$state.";".$plugin."\n";
+
+#
+## send the result
+#
+submit_res($res);
diff --git a/truetype/arial.ttf b/truetype/arial.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..886789b85b4b4e662519fcb7fe4d88ddf2205c5b
Binary files /dev/null and b/truetype/arial.ttf differ
diff --git a/truetype/fontmap.txt b/truetype/fontmap.txt
new file mode 100644
index 0000000000000000000000000000000000000000..22b71fe73a81ed7ddf262619611af8b06a3a19ae
--- /dev/null
+++ b/truetype/fontmap.txt
@@ -0,0 +1,25 @@
+Arial,arial.ttf
+Arial Bold,arialbd.ttf
+Arial Bold Italic,arialbi.ttf
+Arial Italic,ariali.ttf
+Courier New,cour.ttf
+Courier New Bold,courbd.ttf
+Courier New Bold Italic,courbi.ttf
+Courier New Italic,couri.ttf
+Garamond,gara.ttf
+Garamond Bold,garabd.ttf
+Garamond Italic,garait.ttf
+Gothic,gothic.ttf
+Gothic Bold,gothicb.ttf
+Gothic Bold Italic,gothicbi.ttf
+Gothic Italic,gothici.ttf
+Sans Serif,micross.ttf
+Reference Sans Serif,refsan.ttf
+Times New Roman,times.ttf
+Times New Roman Bold,timesbd.ttf
+Times New Roman Bold Italic,timesbi.ttf
+Times New Roman Italic,timesi.ttf
+Verdana,verdana.ttf
+Verdana Bold,verdanab.ttf
+Verdana Bold Italic,verdanaz.ttf
+Verdana Italic,verdanai.ttf
\ No newline at end of file
diff --git a/truetype/verdanab.ttf b/truetype/verdanab.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..51d6111d722981a86766cc99c53f1956e5c0a229
Binary files /dev/null and b/truetype/verdanab.ttf differ
diff --git a/www/DBPerfparseConnect.php b/www/DBPerfparseConnect.php
new file mode 100644
index 0000000000000000000000000000000000000000..d18b9094a1af4bc0b648c037c9ba66a9a1f88384
--- /dev/null
+++ b/www/DBPerfparseConnect.php
@@ -0,0 +1,55 @@
+<?php
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	
+	if (!isset($oreon))
+		exit();
+	
+	// This file have to be included whenever we want to connect to the DB Perfparse, according to params fill in perfparse cfg
+	
+	require_once("DB.php");
+	
+	$pp = array("DB_User"=>NULL, "DB_Pass"=>NULL, "DB_Name"=>NULL, "DB_Host"=>NULL);
+	$res =& $pearDB->query("SELECT * FROM cfg_perfparse WHERE perfparse_activate = '1' LIMIT 1");
+	$pp =& $res->fetchRow();
+	
+	// Pear connection
+	$debug = 0;
+	$dsn = array(
+	    'phptype'  => 'mysql',
+	    'username' => $pp["DB_User"],
+	    'password' => $pp["DB_Pass"],
+	    'hostspec' => $pp["DB_Host"],
+	    'database' => $pp["DB_Name"],
+	);
+	
+	$options = array(
+	    'debug'       => 2,
+	    'portability' => DB_PORTABILITY_ALL ^ DB_PORTABILITY_LOWERCASE, 
+	);
+	
+	global $pearDBpp;
+	
+	$pearDBpp =& DB::connect($dsn, $options);
+	if (PEAR::isError($pearDBpp))
+	    die("<div class='msg' align='center'>".$lang['not_dbPPConnect']." : ".$pearDBpp->getMessage()."</div>");
+	if (!$pp["DB_User"] || !$pp["DB_Host"] || !$pp["DB_Name"]) 
+	   die("<div class='msg' align='center'>".$lang['not_dbPPConnect']."</div>");
+
+	$pearDBpp->setFetchMode(DB_FETCHMODE_ASSOC);
+	// End of Pear connection
+?>
diff --git a/www/DBconnect.php b/www/DBconnect.php
new file mode 100644
index 0000000000000000000000000000000000000000..f1f66b086fbd3db7c24b435b4acee7f79111baf0
--- /dev/null
+++ b/www/DBconnect.php
@@ -0,0 +1,51 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (isset($oreon))
+		exit();
+
+	// This file have to be included whenever we want to connect to the DB
+		
+	require_once("DB.php");
+	
+	// Pear connection
+	
+	$debug = 0;
+	$dsn = array(
+	    'phptype'  => 'mysql',
+	    'username' => $conf_oreon["user"],
+	    'password' => $conf_oreon["password"],
+	    'hostspec' => $conf_oreon["host"],
+	    'database' => $conf_oreon["db"],
+	);
+	
+	$options = array(
+	    'debug'       => 2,
+	    'portability' => DB_PORTABILITY_ALL ^ DB_PORTABILITY_LOWERCASE, 
+	);
+	
+	global $pearDB;
+	
+	$pearDB =& DB::connect($dsn, $options);
+	if (PEAR::isError($pearDB))
+	    die($pearDB->getMessage());
+	    
+	$pearDB->setFetchMode(DB_FETCHMODE_ASSOC);
+	// End of Pear connection
+?>
diff --git a/www/Themes/Basic/Images/QuickSearch.gif b/www/Themes/Basic/Images/QuickSearch.gif
new file mode 100644
index 0000000000000000000000000000000000000000..44346cf1c7b128f0305529046bcfcbddb9ef64e7
Binary files /dev/null and b/www/Themes/Basic/Images/QuickSearch.gif differ
diff --git a/www/Themes/Basic/Images/bg_banner.gif b/www/Themes/Basic/Images/bg_banner.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1149381ccc8b1d2d3e750386e8bfe6a5e0e6b559
Binary files /dev/null and b/www/Themes/Basic/Images/bg_banner.gif differ
diff --git a/www/Themes/Basic/Images/bg_header.gif b/www/Themes/Basic/Images/bg_header.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9aae4df5f4b02cbf144e22a317ed4670a97f9904
Binary files /dev/null and b/www/Themes/Basic/Images/bg_header.gif differ
diff --git a/www/Themes/Basic/Images/bg_header_blue.gif b/www/Themes/Basic/Images/bg_header_blue.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1f3dba11593dcd644563da5e3e91650444ff3e90
Binary files /dev/null and b/www/Themes/Basic/Images/bg_header_blue.gif differ
diff --git a/www/Themes/Basic/Images/bg_header_grayblue.gif b/www/Themes/Basic/Images/bg_header_grayblue.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6f244b415d49c4c93fa5cffc2bafb2d5dd9cfc15
Binary files /dev/null and b/www/Themes/Basic/Images/bg_header_grayblue.gif differ
diff --git a/www/Themes/Basic/Images/bg_header_green.gif b/www/Themes/Basic/Images/bg_header_green.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9e66d8050aa00ea27957bca49c2ba43fb98d32f5
Binary files /dev/null and b/www/Themes/Basic/Images/bg_header_green.gif differ
diff --git a/www/Themes/Basic/Images/bg_header_maroon.gif b/www/Themes/Basic/Images/bg_header_maroon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4f7e2a5fc70bf6d5992af98b296e1bde05e56866
Binary files /dev/null and b/www/Themes/Basic/Images/bg_header_maroon.gif differ
diff --git a/www/Themes/Basic/Images/bg_header_orange.gif b/www/Themes/Basic/Images/bg_header_orange.gif
new file mode 100644
index 0000000000000000000000000000000000000000..55e2db78afba24c94ebcbbebc656549b2e18dc38
Binary files /dev/null and b/www/Themes/Basic/Images/bg_header_orange.gif differ
diff --git a/www/Themes/Basic/Images/bg_header_pink.gif b/www/Themes/Basic/Images/bg_header_pink.gif
new file mode 100644
index 0000000000000000000000000000000000000000..940fde73a1e318fc49e3f762e016659a655689c4
Binary files /dev/null and b/www/Themes/Basic/Images/bg_header_pink.gif differ
diff --git a/www/Themes/Basic/Images/bg_header_red.gif b/www/Themes/Basic/Images/bg_header_red.gif
new file mode 100644
index 0000000000000000000000000000000000000000..98bced7424c49a36f11f9fdc58006f6754765259
Binary files /dev/null and b/www/Themes/Basic/Images/bg_header_red.gif differ
diff --git a/www/Themes/Basic/Images/bg_header_yellow.gif b/www/Themes/Basic/Images/bg_header_yellow.gif
new file mode 100644
index 0000000000000000000000000000000000000000..14587227e0a99ffc50c0d76aab1f5bb2bf86f49e
Binary files /dev/null and b/www/Themes/Basic/Images/bg_header_yellow.gif differ
diff --git a/www/Themes/Basic/Images/bg_input_blue.gif b/www/Themes/Basic/Images/bg_input_blue.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4ff87b1cbdb69566a9bc29a40510f25d6083f1c3
Binary files /dev/null and b/www/Themes/Basic/Images/bg_input_blue.gif differ
diff --git a/www/Themes/Basic/Images/bg_input_gray.gif b/www/Themes/Basic/Images/bg_input_gray.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4c7acafa2b0652acf7ad1b393927d95a747f8c8e
Binary files /dev/null and b/www/Themes/Basic/Images/bg_input_gray.gif differ
diff --git a/www/Themes/Basic/Images/bg_input_green.gif b/www/Themes/Basic/Images/bg_input_green.gif
new file mode 100644
index 0000000000000000000000000000000000000000..65bda771808a455c9174b339471b36701f2305d9
Binary files /dev/null and b/www/Themes/Basic/Images/bg_input_green.gif differ
diff --git a/www/Themes/Basic/Images/bg_input_maroon.gif b/www/Themes/Basic/Images/bg_input_maroon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..64139d730da5788f8009d038565995bd2d303fc5
Binary files /dev/null and b/www/Themes/Basic/Images/bg_input_maroon.gif differ
diff --git a/www/Themes/Basic/Images/bg_input_orange.gif b/www/Themes/Basic/Images/bg_input_orange.gif
new file mode 100644
index 0000000000000000000000000000000000000000..02a5f1c1ffd4e145062701e02f76b4930a820ec3
Binary files /dev/null and b/www/Themes/Basic/Images/bg_input_orange.gif differ
diff --git a/www/Themes/Basic/Images/bg_input_purple.gif b/www/Themes/Basic/Images/bg_input_purple.gif
new file mode 100644
index 0000000000000000000000000000000000000000..decfb226cb275403f5a3c8623ed8b19571cf77c2
Binary files /dev/null and b/www/Themes/Basic/Images/bg_input_purple.gif differ
diff --git a/www/Themes/Basic/Images/bg_input_red.gif b/www/Themes/Basic/Images/bg_input_red.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4b738616018ee782d61ca6fe286da81e5c48f453
Binary files /dev/null and b/www/Themes/Basic/Images/bg_input_red.gif differ
diff --git a/www/Themes/Basic/Images/blank.gif b/www/Themes/Basic/Images/blank.gif
new file mode 100644
index 0000000000000000000000000000000000000000..35d42e808f0a8017b8d52a06be2f8fec0b466a66
Binary files /dev/null and b/www/Themes/Basic/Images/blank.gif differ
diff --git a/www/Themes/Basic/Images/bottom_menu.gif b/www/Themes/Basic/Images/bottom_menu.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a5fd6052d0cf848a6c8008e4d0369ac44ce6e089
Binary files /dev/null and b/www/Themes/Basic/Images/bottom_menu.gif differ
diff --git a/www/Themes/Basic/Images/bottomleft.gif b/www/Themes/Basic/Images/bottomleft.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0efa0286cbea5ea7f81355c0aaa8c3e38b6036c4
Binary files /dev/null and b/www/Themes/Basic/Images/bottomleft.gif differ
diff --git a/www/Themes/Basic/Images/bottomright.gif b/www/Themes/Basic/Images/bottomright.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9ebeaf4672d666560af44adceadb6ff8d278eac3
Binary files /dev/null and b/www/Themes/Basic/Images/bottomright.gif differ
diff --git a/www/Themes/Basic/Images/favicon.ico b/www/Themes/Basic/Images/favicon.ico
new file mode 100644
index 0000000000000000000000000000000000000000..ed8b91eec83115de4e4eca62d24547a3c4658ec9
Binary files /dev/null and b/www/Themes/Basic/Images/favicon.ico differ
diff --git a/www/Themes/Basic/Images/footer/button-donate.gif b/www/Themes/Basic/Images/footer/button-donate.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ec682c6b15e2d7cbc4b85f6497da45108ad65cea
Binary files /dev/null and b/www/Themes/Basic/Images/footer/button-donate.gif differ
diff --git a/www/Themes/Basic/Images/footer/button-gpl.gif b/www/Themes/Basic/Images/footer/button-gpl.gif
new file mode 100644
index 0000000000000000000000000000000000000000..05133808cd920b79481714dd3389afa363e2aa4d
Binary files /dev/null and b/www/Themes/Basic/Images/footer/button-gpl.gif differ
diff --git a/www/Themes/Basic/Images/footer/button-php.gif b/www/Themes/Basic/Images/footer/button-php.gif
new file mode 100644
index 0000000000000000000000000000000000000000..28f329aaa2367c4b2b41e353acb26aae979ce6ed
Binary files /dev/null and b/www/Themes/Basic/Images/footer/button-php.gif differ
diff --git a/www/Themes/Basic/Images/footer/colophon_css.png b/www/Themes/Basic/Images/footer/colophon_css.png
new file mode 100644
index 0000000000000000000000000000000000000000..44d3ead2838611d410b249b771a457b7d7fb6a37
Binary files /dev/null and b/www/Themes/Basic/Images/footer/colophon_css.png differ
diff --git a/www/Themes/Basic/Images/line.gif b/www/Themes/Basic/Images/line.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2e10cb879a1b63cf34139001afa0c23ef9d69277
Binary files /dev/null and b/www/Themes/Basic/Images/line.gif differ
diff --git a/www/Themes/Basic/Images/logo_oreon.gif b/www/Themes/Basic/Images/logo_oreon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..414e66d537c30cbde29cac9ac4580a3122e84bfe
Binary files /dev/null and b/www/Themes/Basic/Images/logo_oreon.gif differ
diff --git a/www/Themes/Basic/Images/menu_bg.gif b/www/Themes/Basic/Images/menu_bg.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6bfc38011af79404963dd9fadd2d2652cb01345a
Binary files /dev/null and b/www/Themes/Basic/Images/menu_bg.gif differ
diff --git a/www/Themes/Basic/Images/menu_bg_blue.gif b/www/Themes/Basic/Images/menu_bg_blue.gif
new file mode 100644
index 0000000000000000000000000000000000000000..aa5aaaf7b024bc1bd6c8ae235dbced20f23bbf5f
Binary files /dev/null and b/www/Themes/Basic/Images/menu_bg_blue.gif differ
diff --git a/www/Themes/Basic/Images/menu_bg_blue2.gif b/www/Themes/Basic/Images/menu_bg_blue2.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b8056c54a5449fc5c22c2a1e53fbe0bc36c96cf3
Binary files /dev/null and b/www/Themes/Basic/Images/menu_bg_blue2.gif differ
diff --git a/www/Themes/Basic/Images/menu_bg_grayblue.gif b/www/Themes/Basic/Images/menu_bg_grayblue.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d06eb65b2a798ad98b0d6385f7e2cd0774a8f7e1
Binary files /dev/null and b/www/Themes/Basic/Images/menu_bg_grayblue.gif differ
diff --git a/www/Themes/Basic/Images/menu_bg_green.gif b/www/Themes/Basic/Images/menu_bg_green.gif
new file mode 100644
index 0000000000000000000000000000000000000000..021bc8dde9e063a579bbef4517720194bc7cb098
Binary files /dev/null and b/www/Themes/Basic/Images/menu_bg_green.gif differ
diff --git a/www/Themes/Basic/Images/menu_bg_maroon.gif b/www/Themes/Basic/Images/menu_bg_maroon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..bdaeee797d6d053b95d2c70799ef89cdf27d1273
Binary files /dev/null and b/www/Themes/Basic/Images/menu_bg_maroon.gif differ
diff --git a/www/Themes/Basic/Images/menu_bg_orange.gif b/www/Themes/Basic/Images/menu_bg_orange.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9f6dbaf95bff9223e481ad42e41413c3c37d20a7
Binary files /dev/null and b/www/Themes/Basic/Images/menu_bg_orange.gif differ
diff --git a/www/Themes/Basic/Images/menu_bg_pink.gif b/www/Themes/Basic/Images/menu_bg_pink.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b81213e58158f85c1de46506a4218497bf0e0285
Binary files /dev/null and b/www/Themes/Basic/Images/menu_bg_pink.gif differ
diff --git a/www/Themes/Basic/Images/menu_bg_purple.gif b/www/Themes/Basic/Images/menu_bg_purple.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4551843a69711b6267c455afc16eabf1e5cb6887
Binary files /dev/null and b/www/Themes/Basic/Images/menu_bg_purple.gif differ
diff --git a/www/Themes/Basic/Images/menu_bg_red.gif b/www/Themes/Basic/Images/menu_bg_red.gif
new file mode 100644
index 0000000000000000000000000000000000000000..18a034303c94bcfdf7129aaa13b31829618b2dd7
Binary files /dev/null and b/www/Themes/Basic/Images/menu_bg_red.gif differ
diff --git a/www/Themes/Basic/Images/menu_bg_yellow.gif b/www/Themes/Basic/Images/menu_bg_yellow.gif
new file mode 100644
index 0000000000000000000000000000000000000000..aa4f46efa1e93f678bc2bae2004ba7a2dc201183
Binary files /dev/null and b/www/Themes/Basic/Images/menu_bg_yellow.gif differ
diff --git a/www/Themes/Basic/Images/menu_r.gif b/www/Themes/Basic/Images/menu_r.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6bfc5c0d30d2bbe85aee6be6edf1cf2ba4ac4a0e
Binary files /dev/null and b/www/Themes/Basic/Images/menu_r.gif differ
diff --git a/www/Themes/Basic/Images/test_bg_biseau.gif b/www/Themes/Basic/Images/test_bg_biseau.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0a4ce19e5d546f8fce7dc903fa57df3dd098cfd7
Binary files /dev/null and b/www/Themes/Basic/Images/test_bg_biseau.gif differ
diff --git a/www/Themes/Basic/Images/test_bg_center.gif b/www/Themes/Basic/Images/test_bg_center.gif
new file mode 100644
index 0000000000000000000000000000000000000000..993eed0ed68033319dffd123bd48ba0949067d89
Binary files /dev/null and b/www/Themes/Basic/Images/test_bg_center.gif differ
diff --git a/www/Themes/Basic/Images/test_bg_leftbottom.gif b/www/Themes/Basic/Images/test_bg_leftbottom.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6a7453e5f7eb9d37e690b571b2fde6b1891fd0ed
Binary files /dev/null and b/www/Themes/Basic/Images/test_bg_leftbottom.gif differ
diff --git a/www/Themes/Basic/Images/top_menu.gif b/www/Themes/Basic/Images/top_menu.gif
new file mode 100644
index 0000000000000000000000000000000000000000..36d81f3e00b50f5d6474def537163b42dfa97305
Binary files /dev/null and b/www/Themes/Basic/Images/top_menu.gif differ
diff --git a/www/Themes/Basic/Images/topleft.gif b/www/Themes/Basic/Images/topleft.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a32495d0e9fa4eb1db022a97c9b82e0f08093fc2
Binary files /dev/null and b/www/Themes/Basic/Images/topleft.gif differ
diff --git a/www/Themes/Basic/Images/topright.gif b/www/Themes/Basic/Images/topright.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5c434ab5138da1b7df6b33efbe8c75cd738a2569
Binary files /dev/null and b/www/Themes/Basic/Images/topright.gif differ
diff --git a/www/Themes/Basic/color1.css b/www/Themes/Basic/color1.css
new file mode 100644
index 0000000000000000000000000000000000000000..832a13506562900d80a4833645f16da045911430
--- /dev/null
+++ b/www/Themes/Basic/color1.css
@@ -0,0 +1,67 @@
+#outer{    border-left-color:#F2F2F2;   /* left column colour */}
+body{				background-color:#F2F2F2;}
+
+/* Form  */
+.ListTable, #ListTable a:link		{color:#666666;}
+.ListTable, #ListTable a:visited		{color:#666666;}
+.ListTable, #ListTable a:hover		{color:#E3A385;}
+
+.list_lvl_1{	background-color:#fada83;}
+.list_lvl_2{	background-color:#faeaa3;}
+.ListHeader{	background: #fada83 url("./Images/bg_header_orange.gif") left repeat-x 0px;text-align:center;}
+
+
+#ResumeHeader{	background: #fada83 url("./Images/bg_header_orange.gif") left repeat-x 0px;}
+#ResumeHeader td{padding-left:1px;padding-right:1px; color: #525252; font-family: Verdana, Arial, sans-serif; font-size: 9px;	white-space: nowrap;}
+
+#ResumeTable    {    width:100%;}
+#ResumeTable td	{    padding-top:2px;padding-bottom:2px; border: 0.5px solid gray}
+#ResumeTable a	{color:#666666;}
+
+
+/*.list_one{		background-color:#f8c160;}*/
+.list_one {		background-color:#FFF2AD;}
+.list_one td{	padding-left:1px;padding-right:1px; color: #525252; font-family: Verdana, Arial, sans-serif; font-size: 9px;	white-space: nowrap;}
+
+/* .list_two {		background-color:#ffe3a1;}*/
+.list_two {		background-color:#FEE8AD;}
+.list_three{	background-color:#ffe0d1;}
+.list_four {	background-color:#ffecd1;}
+#page {			color:#592bed;}
+#page a{		color:#592bed;}
+
+/*Menu*/
+#menu1_bgimg{	background: url("Images/menu_bg_orange.gif") right repeat-x 0px;}
+#menu1_bgcolor{	background: #fdc11e;}
+#menu2_bgcolor{	background: #fff3bb;}
+
+
+#menu_2{		background: #fdc11e;}
+.Tmenu3 .top .left { background-color:  #F2F2F2;}
+.Tmenu3 .top .right {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .left {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .right { background-color:  #F2F2F2;}
+/* General */
+#contener{		background:#F2F2F2;}
+#Tmenu{		background:#F2F2F2;
+border-right: 1px solid #fdc11e;
+}
+#footerline1{	background-color:#fdc11e;}
+#footerline2{	background-color:#dedede;}
+
+#MainPage textarea, #MainPage input, #MainPage select{    color:#242af6;}
+
+#formulary input{ border-style:inset;border:1px solid #DDDDDD;}
+
+/* w3c */
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background: url("./Images/bg_input_gray.gif") ;
+}
+
+/* IE */
+.oreonbutton input{
+    background: url("./Images/bg_input_gray.gif") ;
+}
+
+
+.quick_search{	border-color:#eff1f4;	background: #BFD0E2 url("Images/bg_header_orange.gif") left repeat-x 0px;	color:#fff;}
diff --git a/www/Themes/Basic/color2.css b/www/Themes/Basic/color2.css
new file mode 100644
index 0000000000000000000000000000000000000000..bea0c66a6a7409384e6c1ebe0f48c8cb5c4a9721
--- /dev/null
+++ b/www/Themes/Basic/color2.css
@@ -0,0 +1,56 @@
+#outer{    border-left-color:#F2F2F2;   /* left column colour */}
+body{				background-color:#F2F2F2;}
+.ListTable, #ListTable a:link		{color:#666666;}
+.ListTable, #ListTable a:visited		{color:#666666;}
+.ListTable, #ListTable a:hover		{color:#E3A385;}
+/* Form */
+.list_lvl_1{	background-color:#fada83;}
+.list_lvl_2{	background-color:#faeaa3;}
+.ListHeader{	background: #fada83 url("./Images/bg_header_orange.gif") left repeat-x 0px;}
+
+
+.list_one {		background-color:#FFF2AD;}
+.list_two {		background-color:#FEE8AD;}
+.list_three{	background-color:#ffbbbb;}
+.list_four {	background-color:#ffecd1;}
+#page {			color:#592bed;}
+#page a{		color:#592bed;}
+
+/*Menu*/
+#menu1_bgimg{	background: url("Images/menu_bg_orange.gif") right repeat-x 0px;}
+#menu1_bgcolor{	background: #fdc11e;}
+#menu2_bgcolor{	background: #FEF7DB;}
+
+
+#menu_2{		background: #fdc11e;}
+.Tmenu3 .top .left { background-color:  #FEF7DB;}
+.Tmenu3 .top .right {  background-color:  #FEF7DB;}
+.Tmenu3 .bottom .left {  background-color:  #FEF7DB;}
+.Tmenu3 .bottom .right { background-color:  #FEF7DB;}
+
+
+/* General */
+#contener{		background:#F2F2F2;}
+#Tmenu{		background:#F2F2F2;
+border-right: 1px solid #fdc11e;;
+}
+
+#footerline1{	background-color:#fdc11e;}
+#footerline2{	background-color:#dedede;}
+
+#MainPage textarea, #MainPage input, #MainPage select{    color:#242af6;}
+#mainnav li{	background: url("./Images/bg_header_orange.gif");}
+
+#formulary input{ border-style:inset;border:1px solid #DDDDDD;}
+ 
+/* w3c */
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background: url("./Images/bg_input_orange.gif") ;
+}
+/* IE */
+.oreonbutton input{
+    background: url("./Images/bg_input_orange.gif") ;
+}
+
+
+.quick_search{	border-color:#eff1f4;	background: #BFD0E2 url("Images/bg_header_orange.gif") left repeat-x 0px;	color:#fff;}
diff --git a/www/Themes/Basic/color3.css b/www/Themes/Basic/color3.css
new file mode 100644
index 0000000000000000000000000000000000000000..10e0efb60873558277dbc0948ac6794ee902cb8c
--- /dev/null
+++ b/www/Themes/Basic/color3.css
@@ -0,0 +1,53 @@
+#outer{    border-left-color:#F2F2F2;   /* left column colour */}
+body{			background-color:#F2F2F2;}
+.ListTable, #ListTable a:link		{color:#666666;}
+.ListTable, #ListTable a:visited		{color:#666666;}
+.ListTable, #ListTable a:hover		{color:#E3A385;}
+/* Form */
+.list_lvl_1{	background-color:#DDFFDD;}
+.list_lvl_2{	background-color:#CCFFCC;}
+.ListHeader{	background: #BFD0E2 url("./Images/bg_header_green.gif") left repeat-x 0px;}
+.list_one{		background-color:#AAEEAA;}
+.list_two {		background-color:#BBFFBB;}
+.list_three{	background-color:#fada83;}
+.list_four {	background-color:#fdc11e;}
+#page {			color:#592bed;}
+#page a{		color:#592bed;}
+
+/*Menu*/
+#menu1_bgimg{	background: url("Images/menu_bg_green.gif") right repeat-x 0px;}
+#menu1_bgcolor{	background: #ADC7A1;}
+#menu2_bgcolor{	background: #DFF9E0;}
+
+#menu_2{		background:#ADC7A1;}
+
+.Tmenu3 .top .left { background-color:  #F2F2F2;}
+.Tmenu3 .top .right {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .left {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .right { background-color:  #F2F2F2;}
+/* General */
+#contener{		background:#F2F2F2;}
+#Tmenu{		background:#F2F2F2;
+border-right: 1px solid #ADC7A1;;
+}
+
+
+
+#footerline1{	background-color:#ADC7A1;}
+#footerline2{	background-color:#dedede;}
+
+#MainPage textarea, #MainPage input, #MainPage select{    color:#242af6;}
+#mainnav li{	background: url("./Images/bg_header_green.gif");}
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background: url("./Images/bg_input_green.gif") ;
+}
+/* w3c */
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background: url("./Images/bg_input_green.gif") ;
+}
+/* IE */
+.oreonbutton input{
+    background: url("./Images/bg_input_green.gif") ;
+}
+
+.quick_search{	border-color:#eff1f4;	background: #BFD0E2 url("Images/bg_header_green.gif") left repeat-x 0px;	color:#fff;}
diff --git a/www/Themes/Basic/color4.css b/www/Themes/Basic/color4.css
new file mode 100644
index 0000000000000000000000000000000000000000..543a138709ab4ca91474a5669aa645a7c1bba444
--- /dev/null
+++ b/www/Themes/Basic/color4.css
@@ -0,0 +1,56 @@
+#outer{    border-left-color:#F2F2F2;   /* left column colour */}
+body{				background-color:#F2F2F2;}
+
+.ListTable, #ListTable a:link		{color:#666666;}
+.ListTable, #ListTable a:visited		{color:#666666;}
+.ListTable, #ListTable a:hover		{color:#E3A385;}
+
+/* Form */
+.list_lvl_1{	background-color:#FF8686;}
+.list_lvl_2{	background-color:#FFBBA2;}
+.ListHeader{	background: #BFD0E2 url("./Images/bg_header_red.gif") left repeat-x 0px;}
+.list_one{		background-color:#FFCCCC;}
+.list_two {		background-color:#FFE2E2;}
+.list_three{	background-color:#fada83;}
+.list_four {	background-color:#fdc11e;}
+#page {			color:#592bed;}
+#page a{		color:#592bed;}
+
+/*Menu*/
+#menu1_bgimg{	background: url("Images/menu_bg_red.gif") right repeat-x 0px;}
+#menu1_bgcolor{	background: #E3858C;}
+#menu2_bgcolor{	background: #F9EDED;}
+
+
+#menu_2{		background: #E3858C;}
+
+.Tmenu3 .top .left { background-color:  #F2F2F2;}
+.Tmenu3 .top .right {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .left {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .right { background-color:  #F2F2F2;}
+
+/* General */
+#contener{		background:#F2F2F2;}
+#Tmenu{		background:#F2F2F2;
+border-right: 1px solid #E3858C;
+}
+
+
+#footerline1{	background-color:#E3858C;}
+#footerline2{	background-color:#dedede;}
+
+#MainPage textarea, #MainPage input, #MainPage select{    color:#242af6;}
+#mainnav li{	background: url("./Images/bg_header_red.gif");}
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background: url("./Images/bg_input_red.gif") ;
+}
+/* w3c */
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background: url("./Images/bg_input_red.gif") ;
+}
+/* IE */
+.oreonbutton input{
+    background: url("./Images/bg_input_red.gif") ;
+}
+
+.quick_search{	border-color:#eff1f4;	background: #BFD0E2 url("Images/bg_header_red.gif") left repeat-x 0px;	color:#fff;}
diff --git a/www/Themes/Basic/color5.css b/www/Themes/Basic/color5.css
new file mode 100644
index 0000000000000000000000000000000000000000..15db652e0cdb3b6c10ff92130b22135a16df0e8a
--- /dev/null
+++ b/www/Themes/Basic/color5.css
@@ -0,0 +1,51 @@
+#outer{    border-left-color:#F2F2F2;   /* left column colour */}
+body{				background-color:#F2F2F2;}
+.ListTable, #ListTable a:link		{color:#666666;}
+.ListTable, #ListTable a:visited		{color:#666666;}
+.ListTable, #ListTable a:hover		{color:#E3A385;}
+/* Form */
+.list_lvl_1{    	background-color:#e7cafa;}
+.list_lvl_2{    	background-color:#e7bafa;}
+.ListHeader{    	background: #BFD0E2 url("./Images/bg_header_pink.gif") left repeat-x 0px;}
+.list_one{    		background-color:#f1e4fa;}
+.list_two {    		background-color:#f8f1fd;}
+.list_three{    	background-color:#fada83;}
+.list_four {    	background-color:#fdc11e;}
+#page {    			color:#c468f9;}
+#page a{    		color:#c468f9;}
+
+/*Menu*/
+#menu1_bgimg{    	background: url("Images/menu_bg_purple.gif") right repeat-x 0px;}
+#menu1_bgcolor{		background: #9C85E3;}
+#menu2_bgcolor{		background: #ECE5F9;}
+
+
+#menu_2{			background: #9C85E3;}
+
+.Tmenu3 .top .left { background-color:  #F2F2F2;}
+.Tmenu3 .top .right {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .left {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .right { background-color:  #F2F2F2;}
+
+/* General */
+#contener{		background:#F2F2F2;}
+#Tmenu{		background:#F2F2F2;
+border-right: 1px solid #9C85E3;;
+}
+
+#footerline1{background-color:#9C85E3;}
+#footerline2{background-color:#dedede;}
+
+#MainPage textarea, #MainPage input, #MainPage select{    color:#a42ab6;}
+#mainnav li{	background: url("./Images/bg_header_pink.gif");}
+
+/* w3c */
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background: url("./Images/bg_input_purple.gif") ;
+}
+/* IE */
+.oreonbutton input{
+    background: url("./Images/bg_input_purple.gif") ;
+}
+
+.quick_search{	border-color:#eff1f4;	background: #BFD0E2 url("Images/bg_header_pink.gif") left repeat-x 0px;	color:#fff;}
diff --git a/www/Themes/Basic/color6.css b/www/Themes/Basic/color6.css
new file mode 100644
index 0000000000000000000000000000000000000000..cfd343dbc6aa70730f54d48ecd583b529bd48627
--- /dev/null
+++ b/www/Themes/Basic/color6.css
@@ -0,0 +1,58 @@
+#outer{		border-left-color:#F2F2F2;   /* left column colour */}
+body{		background-color:#F2F2F2;}
+
+.ListTable, #ListTable a:link		{color:#666666;}
+.ListTable, #ListTable a:visited		{color:#666666;}
+.ListTable, #ListTable a:hover		{color:#E3A385;}
+
+/* Form */
+.list_lvl_1{	background-color:#d5dfeb;}
+.list_lvl_2{	background-color:#ced3ed;}
+.ListHeader{	background: #BFD0E2 url("./Images/bg_header.gif") left repeat-x 0px;}
+.list_one{		background-color:#C1DDF6;}
+.list_two {		background-color:#e6f2fe;}
+.list_three{	background-color:#fada83;}
+.list_four {	background-color:#fdc11e;}
+#page {			color:#592bed;}
+#page a{		color:#592bed;}
+
+/*Menu*/
+#menu1_bgimg{	background: url("Images/menu_bg_blue.gif") right repeat-x 0px;}
+#menu1_bgcolor{	background: #6056e8;}
+#menu2_bgcolor{	background: #ebf5ff;}
+
+
+#menu_2{		background:	#6056e8;}
+
+.Tmenu3 .top .left { background-color:  #F2F2F2;}
+.Tmenu3 .top .right {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .left {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .right { background-color:  #F2F2F2;}
+/* General */
+#contener{		background:#F2F2F2;}
+#Tmenu{		background:#F2F2F2;
+border-right: 1px solid #6056e8;
+}
+
+#footerline1{	background-color:#6056e8;}
+#footerline2{	background-color:#dedede;}
+
+#MainPage textarea, #MainPage input, #MainPage select{    color:#242af6;}
+#mainnav li{	background: url("./Images/bg_header.gif");}
+
+
+/* w3c */
+input[type="submit"],input[type="button"],input[type="reset"]{
+background: #ebf5ff url("./Images/bg_input_blue.gif") bottom right no-repeat;
+}
+/* IE */
+.oreonbutton input{
+background: #ebf5ff url("./Images/bg_input_blue.gif") bottom right no-repeat;
+}
+
+.quick_search{	border-color:#eff1f4;	background: #BFD0E2 url("./Images/bg_header.gif") left repeat-x 0px;	color:#fff;}
+.limitPage{
+background: #BFD0E2 url("./Images/bg_header.gif") left repeat-x 0px;
+}
+.pageNumber{background: #BFD0E2 url("./Images/bg_header.gif") left repeat-x;
+background-position:0px 0px;}
diff --git a/www/Themes/Basic/color7.css b/www/Themes/Basic/color7.css
new file mode 100644
index 0000000000000000000000000000000000000000..f564598ac569aafda0a0a4dcad3498a72ec77d65
--- /dev/null
+++ b/www/Themes/Basic/color7.css
@@ -0,0 +1,55 @@
+#outer{		border-left-color:#F2F2F2;   /* left column colour */}
+body{		background-color:#F2F2F2;}
+
+.ListTable, #ListTable a:link		{}
+.ListTable, #ListTable a:visited		{}
+.ListTable, #ListTable a:hover		{}
+
+/* Form */
+.list_lvl_1{	background-color:#7B8DFF;}
+.list_lvl_2{	background-color:#6479FF;}
+.ListHeader{	background: #DFE3FF url("./Images/bg_header_grayblue.gif") left repeat-x 0px;}
+.list_one{		background-color:#DEE7F4;}
+.list_two {		background-color:#C2D1E9;}
+.list_three{	background-color:#B2F867;}
+.list_four {	background-color:#FD8B46;}
+.quick_search{	border-color:#eff1f4;	background: #F3E9DA url("./Images/bg_header_grayblue.gif") left repeat-x 0px;	color:#fff;}
+#page {			color:#592bed;}
+#page a{		color:#592bed;}
+
+/*Menu*/
+#menu1_bgimg{	background: url("Images/menu_bg_grayblue.gif") right repeat-x 0px;}
+#menu1_bgcolor{	background:#98B2DC;}
+#menu2_bgcolor{	background: #B0C4DE;}
+
+#menu_3{		background: red;}
+#menu_2{		background:	#406FBA;}
+.Tmenu3 .top .left { background-color:  #F2F2F2;}
+.Tmenu3 .top .right {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .left {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .right { background-color:  #F2F2F2;}
+
+/* General */
+#contener{		background:#F2F2F2;}
+#Tmenu{		background:#F2F2F2;
+border-right: 1px solid #98B2DC;
+}
+
+#footerline1{	background-color:#98B2DC;}
+#footerline2{	background-color:#dedede;}
+
+#MainPage textarea, #MainPage input, #MainPage select{    color:#242af6;}
+
+
+#mainnav li{	background: url("./Images/bg_header_grayblue.gif");}
+
+/* w3c */
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background: url("./Images/bg_input_blue.gif") ;
+}
+/* IE */
+.oreonbutton input{
+    background: url("./Images/bg_input_blue.gif") ;
+}
+.quick_search{	border-color:#eff1f4;	background: url("Images/bg_header_grayblue.gif") left repeat-x 0px;	color:#fff;}
+
diff --git a/www/Themes/Basic/configuration_form.css b/www/Themes/Basic/configuration_form.css
new file mode 100644
index 0000000000000000000000000000000000000000..691f2ccd8f0f6403a0fbf8ecd63aae2b78c26b37
--- /dev/null
+++ b/www/Themes/Basic/configuration_form.css
@@ -0,0 +1,255 @@
+
+#lang a:link{	color:#666666;}
+#lang a:visited{color:#666666;}
+#lang a:hover{	color:#E3A385;}
+#lang {			color:#666666;}
+#lang h1 {		font-family:Arial, Helvetica, Sans-Serif;font-size:14px; color:#666666; padding-bottom:15px}
+#lang dt {		font-family:Arial, Helvetica, Sans-Serif;font-size:12px; color:#666666; text-decoration: underline}
+#lang dd {		font-family:Arial, Helvetica, Sans-Serif;font-size:10px; color:#666666;}
+
+.FormHeader{    font-size:12px;}
+.FormFooter{    font-size:12px;    font-weight:bold;    padding-right:10px;}
+
+
+#ListTable td, #ListTableMedium td, #ListTableSmall td,.ListTable td, .ListTableMedium td, .ListTableSmall td{
+	border: 1px solid gray; padding-top:2px; padding-bottom:2px; }
+
+	/* IE BUG ONLY */
+ * html #ListTable td, #ListTableMedium td, #ListTableSmall td,.ListTable td, .ListTableMedium td, .ListTableSmall td{padding:0px;margin:0px;	padding-left:3px; padding-right:3px;}
+
+	
+#ListTable a, #ListTableMedium a, .ListTableSmall a,.ListTable a, .ListTableMedium a, .ListTableSmall a{color:#666666;}
+
+
+
+#ListTable, .ListTable    {    width:100%;z-index: 1;}
+#ListTableMedium, .ListTableMedium    {    width:60%;z-index: 1;}
+#ListTableSmall, .ListTableSmall    {    width:40%;z-index: 1;}
+
+.TableFooter {width:100%; z-index: 1; margin-top:8px;}
+
+.limitPage{text-align:left;
+	border: 1px;
+	border-style: solid;
+    border-color:#eff1f6;
+    background-color:#BFD0E2;
+    color:#fff;
+    font-family:Arial, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:bold;
+	padding-bottom: 3px;
+	padding-left: 3px;
+width:160px;
+}
+
+.pagination{text-align:center;
+}
+.pageNumber{
+	padding-right: 3px;
+text-align:right;
+	border: 1px;
+	border-style: solid;
+    border-color:#eff1f6;
+    background-color:#BFD0E2;
+    color:#fff;
+    font-family:Arial, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:bold;
+	padding-bottom: 3px;
+
+width:80px;
+}
+
+.otherPageNumber{color:#5050FF;}
+.currentPageNumber{color:#ff0a0a;}
+
+
+/*OLD*/
+.ListColHeader1    {    width: 4%;    text-align:center;}
+.ListColHeader2    {        text-align:left;    padding-left:40px;}
+.ListColHeader3    {       text-align:left;    padding-left:10px;}
+.ListColHeader4    {        text-align:left;    padding-left:10px; padding-right:2px;}
+.ListColHeader5    {        text-align:right;    padding-left:10px;	padding-right:20px}
+/**/
+
+/*NEW*/
+.ListColHeaderCenter{text-align:center; padding-left:10px;}
+.ListColHeaderLeft{text-align:left; padding-left:10px;}
+.ListColHeaderRight{text-align:right; padding-left:10px;padding-right:20px}
+.ListColHeaderWrap{text-align:left; padding-left:10px; white-space:normal;}
+/**/
+
+
+
+.ListColFooter1    {  padding:3px;}
+.ListColFooter2    {}
+.ListColFooter3    {}
+.ListColFooter4    {}
+.ListColFooter5, .ListColFooter5 a {    font-size:12px;    font-weight:bold;    padding-right:10px;}
+
+.ListColFooterCenter{text-align:center; font-size:12px;    font-weight:bold;    padding-right:10px;}
+.ListColFooterLeft{text-align: left; font-size:12px;    font-weight:bold;    padding-right:10px;}
+.ListColFooterRight{text-align:right; font-size:12px;    font-weight:bold;    padding-right:10px;}
+
+
+
+/*OLD start indent */
+.ListCol1    {		text-align:center;}
+.ListCol2    {		padding-left:20px;}
+.ListCol3,
+.ListCol4	{padding-left:10px;}
+.ListCol5    {padding-right:10px;}
+/**/
+
+.ListColCenter{text-align:center; padding-left:10px;}
+.ListColLeft{text-align:left; padding-left:10px;}
+.ListColRight{text-align:right; padding-left:10px;padding-right:10px;}
+.ListColNoWrap{text-align:left; padding-left:10px;white-space:normal;}
+
+
+.FormRowField    {padding-left:40px;}
+.FormRowValue    {padding-left:5px;}
+
+.ListColLvl2_name{padding-left:15px;}
+.ListColLvl1_name{padding-left:10px;}
+/* end indent */
+
+.list_lvl_1{    color:#666666; font-family:Arial, Helvetica, Sans-Serif;    font-size:12px;    font-weight:bold;	vertical-align: middle;}
+.list_lvl_2{    color:#666666; font-family:Arial, Helvetica, Sans-Serif;    font-size:11px;    font-weight:bold;	vertical-align: middle;}
+.ListHeader{   font-family:Arial, Helvetica, Sans-Serif; font-size:12px; font-weight:bold;vertical-align: top;}
+.list_one{    color:#666666; font-family:Arial, Helvetica, Sans-Serif; font-size:10px; font-weight:normal; vertical-align: middle;}
+.list_two { color:#666666; font-family:Arial, Helvetica, Sans-Serif; font-size:10px; font-weight:normal; vertical-align: middle;}
+.list_three{ color:#666666; font-family:Arial, Helvetica, Sans-Serif; font-size:10px; font-weight:normal; vertical-align: middle;}
+.list_four {    color:#666666; font-family:Arial, Helvetica, Sans-Serif; font-size:10px; font-weight:normal; vertical-align: middle;}
+
+.list_one a{ color:#666666; font-family:Arial, Helvetica, Sans-Serif; font-size:10px; font-weight:normal;}
+.list_two a{ color:#666666; font-family:Arial, Helvetica, Sans-Serif; font-size:10px; font-weight:normal;}
+
+.ContactSelectOption input   { background-color: transparent;}
+
+
+/* end list menu */
+form{  padding-bottom:10px;}
+
+
+#page {    padding:5px;    text-align:center;}
+#page a{    text-align:center;}
+
+.quick_search{
+	padding-top:4px;
+	border: 1px;
+	border-style: solid;
+	border-color: red;
+	width: 330px;
+	font-family:Arial, Helvetica, Sans-Serif;
+	font-size:12px;
+	font-weight:bold;
+	padding-left: 25px;
+	padding-bottom: 3px;
+	margin:0px;
+}
+
+
+.page_limit{
+	border: 1px;
+	border-style: solid;
+    border-color:#eff1f6;
+    width:80px;
+    background-color:#BFD0E2;
+    color:#fff;
+    font-family:Arial, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:bold;
+	padding-left: 25px;
+	padding-bottom: 3px;
+}
+
+
+/*tab*/
+#mainnav{
+	z-index: 2;
+	clear:both;
+	list-style-type:none;
+	width:100%;
+}
+#mainnav li{
+	padding:3px;
+	float:left;
+	z-index: 2;
+}
+
+.tab{
+	z-index: 1;
+	float:left;
+	display:none;
+}
+
+	
+#tab1{
+	z-index: 1;
+	float:left;
+	display:block;
+
+}
+
+
+.a a, .b a{
+	color:#636363;
+	font-family:Arial, Helvetica, Sans-Serif;    font-size:11px;    font-weight:bold;    text-align:left;
+}
+
+.a{
+	margin-left:5px;
+	margin-top:1px;
+	border: 1px solid gray;	
+	border-bottom:none;
+}
+.b{
+	margin-left:5px;
+	margin-bottom:0px;
+	border: 1px solid gray;
+}
+/*end tab*/
+
+#validForm input	{    color:#666666;  font-family:Arial, Helvetica, Sans-Serif;    font-size:11px;    font-weight:normal;    text-align:left;}
+#validForm{
+	width:98%;
+	float:left;
+	padding:10px;
+	text-align:center;
+}
+#validForm input{
+	margin-top:5px;
+    text-align:center;
+}
+#validForm label{
+	padding:2px;	
+	padding-left:4px;
+	padding-right:4px;
+}
+
+/*CSS2*/
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background-position:0px 0px;
+    color:#000000;
+    font-family:Verdana, Tahoma;
+    font-size:11px;
+    width:86px;
+    height:22px;
+    border: 0.5px solid gray;
+    vertical-align:middle;
+    text-align:center;
+}
+
+/*for IE **/
+.oreonbutton input{
+    background-position:0px 0px;
+    color:#000000;
+    font-family:Verdana, Tahoma;
+    font-size:11px;
+    width:86px;
+    height:22px;
+    border: 0.5px solid gray;
+    vertical-align:middle;
+    text-align:center;
+}
diff --git a/www/Themes/Basic/form.css b/www/Themes/Basic/form.css
new file mode 100644
index 0000000000000000000000000000000000000000..97e84a5941af521da6eee0be23bb5c42c74e2b03
--- /dev/null
+++ b/www/Themes/Basic/form.css
@@ -0,0 +1,43 @@
+
+
+.form_lvl_1{
+    background-color:#6797E3;
+    color:#fff;
+    font-family:Arial, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:bold;
+    text-align:center;
+    border:1px;
+}
+.form_lvl_2{
+    background-color:#9ca3fa;
+    color:#fff;
+    font-family:Arial, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:normal;
+    border:1px;
+}
+.form_lvl_3{
+    background-color:#c0c4fa;
+    color:#fff;
+    font-family:Arial, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:normal;
+    border:1px;
+}
+.form_one{
+    background-color:#fff;
+    color:#fff;
+    font-family:Arial, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:normal;
+    border:1px;
+}
+.form_two{
+    background-color:#fffaab;
+    color:#fff;
+    font-family:Arial, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:normal;
+    border:1px;
+}
diff --git a/www/Themes/Basic/login.css b/www/Themes/Basic/login.css
new file mode 100644
index 0000000000000000000000000000000000000000..0a5597268524b0e9bde46645bae42543f7ae3e0b
--- /dev/null
+++ b/www/Themes/Basic/login.css
@@ -0,0 +1,80 @@
+body{			background-color:#fff9eb;font-family: Verdana;	font-size: 11px;
+			margin: 0; /* pour viter les marges */
+			text-align: center; /* pour corriger le bug de centrage IE */
+}
+/* General */ 
+img {					border:0;}
+table{					empty-cells: show; border-spacing:0px; border-collapse:collapse;}
+input	{				font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal; border-style: none; padding:2px;}
+textarea	{			font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal;}
+checkbox	{			font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal; padding: 2px;}
+select	{ font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: normal; border-style: none;}
+option	{				font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal;}
+td	{    				padding:1px; color: #525252; font-family: Verdana, Arial, sans-serif; font-size: 9px;	white-space: nowrap;}
+tr	{ 					}
+a	{					text-decoration: none;}
+a:hover	{				text-decoration: underline;}
+
+
+ 
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background-position:0px 0px;
+    color:#000000;
+    font-family:Verdana, Tahoma;
+    font-size:11px;
+    width:86px;
+    height:22px;
+    border: 0.5px solid gray;
+    vertical-align:middle;
+    text-align:center;
+}
+
+/*logininvit*/
+#LoginInvit{
+	margin-top: 50px;
+	margin-left: auto;
+	margin-right: auto;
+	width:200px;
+	text-align: center; /* on rtablit l'alignement normal du texte */
+}
+
+#logintab1 {
+	width:200px;
+}
+#logintab2 {
+	width:200px;
+	border:1px solid gray;
+    border-top: 2px solid gray;
+    border-bottom: 2px solid gray;
+}
+#logintab2 td{
+	border:1px;
+	padding:5px;
+	background-color:#eaeaee;
+}
+
+#sublogin{
+	width:200px;
+	text-align:center;
+}
+
+.LoginInvitVersion{
+	text-align:left;
+}
+.LoginInvitDate{
+	text-align:right;
+}
+
+#LoginInvitcpy a,  #LoginInvitcpy{
+	 color:gray;
+	 text-align:center;
+ }
+ 
+ .inputclassic{
+    border: 1px solid gray;
+ }
+
+ input[type="submit"],input[type="reset"]{
+    background: url("./Images/bg_input_orange.gif") ;
+}
+.msg{			font-family: Verdana, Arial, sans-serif; font-size: 12px; font-weight: normal; border: 4px solid white; padding:3px; text-align: center; background-color:red; color:white; margin:5px;}
\ No newline at end of file
diff --git a/www/Themes/Basic/menu.css b/www/Themes/Basic/menu.css
new file mode 100644
index 0000000000000000000000000000000000000000..c1b812334135d83879c5dc6ab1c2f221ccbe8c20
--- /dev/null
+++ b/www/Themes/Basic/menu.css
@@ -0,0 +1,64 @@
+* {margin:0; padding:0}
+ 
+ 
+#menu_1{			background: url("Images/menu_bg.gif") left repeat-x 0px;    height:28px;}
+#menu_1 li {		height:24px;    padding-right:1px;    list-style-type: none;    float: left;    text-align: center;    background: url("Images/menu_r.gif") right no-repeat 0px;}
+#menu_1 li div{		float: left;    padding-top:3px;    padding-left:7px;    padding-right:3px;    height:24px;}
+#menu_1 li a{		font-family:Arial, Helvetica, Sans-Serif;    font-size:12px;    text-decoration: none;    color: #666;}
+
+#logli{
+	float:right;
+}
+
+#menu1_bgimg_{		float:left;}
+#menu1_bgcolor{		height:28px;}
+#menu_2{			padding-bottom:1px; font-family:Arial, Helvetica, Sans-Serif;    color:#666;    word-spacing: 5px;}
+#menu_2 a{			padding-left:5px;    padding-right:2px;    color:#666;    font-family:Arial, Helvetica, Sans-Serif;    font-size:11px;}
+
+.separator_menu{	color:#afafaf;  font-weight:bolder;}
+
+#menu_3 a{			font-family:Arial, Helvetica, Sans-Serif;    font-size:11px;    color:#666;}
+#menu_3 a:hover{    color:#E8AB5C;}
+#menu_3 li{    		padding-left:2px; list-style-type: none;}
+
+#menu_3 {    		padding-bottom:5px;}
+
+
+
+#topright {			float: right;}
+#bottomright {		float: right;}
+
+#bottommiddle {		float: right; background-color: Blue;}
+
+#topleft,
+ #topright,
+ #bottomleft,
+ #bottomright {		padding:0px;	height: 12px;	width: 15px;	background-repeat: no-repeat;	font-size:10px; /* correction d'un bug IE */}
+
+#bottomright{
+	background-color: blue;
+} 
+#bottomleft{
+	background-color: green;
+} 
+ 
+#contenu {	background: url(Images/line.gif) right repeat-y; padding-left: 2px;}
+#topline{			background:  url(Images/line.gif) top right repeat-x;}
+#bottomline{		background:  url(Images/line.gif) bottom right repeat-x;}
+
+
+.Tmenu3 {  border-collapse: collapse; background-color: white}
+.Tmenu3 td {padding: 0px; }
+.Tmenu3 .top .left, .Tmenu3 .top .right, .Tmenu3 .bottom .left, .Tmenu3 .bottom .right {	height: 12px;	width: 15px; }
+
+.Tmenu3 .top .left { background-image: url(Images/topleft.gif);  padding:6px;}
+.Tmenu3 .top .right { background-image: url(Images/topright.gif); padding-right:15px;}
+.Tmenu3 .bottom .left { background-image: url(Images/bottomleft.gif); }
+.Tmenu3 .bottom .right { background-image: url(Images/bottomright.gif); }
+
+
+.Tmenu3 .bottom .center{ background: url(Images/line.gif) bottom right repeat-x; }
+.Tmenu3 .top .center{ background: url(Images/line.gif) top right repeat-x; }
+.Tmenu3 .middle .left{ background: url(Images/line.gif) left repeat-y; }
+.Tmenu3 .middle .right{ background: url(Images/line.gif) right repeat-y; }
+
diff --git a/www/Themes/Basic/style.css b/www/Themes/Basic/style.css
new file mode 100644
index 0000000000000000000000000000000000000000..80adf9a666b8aa42eae99606fd850f1cec34caea
--- /dev/null
+++ b/www/Themes/Basic/style.css
@@ -0,0 +1,57 @@
+* {margin:0;padding:0}
+
+
+body{			background-color:#fff9eb;font-family: Verdana;	font-size: 11px;}
+
+.msg{			font-family: Verdana, Arial, sans-serif; font-size: 12px; font-weight: normal; border: 4px solid white; padding:3px; text-align: center;
+background-color:red; color:white; margin:5px;}
+
+
+#header{		height:83px;	padding-left:20px;	background: url("Images/bg_banner.gif") top repeat-x;}
+#logInfos{		float:right;}
+#logInfos div{		padding:2px;	padding-right:10px;	color: #525252;	font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: bold;}
+#logli{			padding-top:5px;	padding-right:10px;	color: #525252;	font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: bold;}
+#logli a {   		color:#666666;}
+
+
+#footer a{				color:#666666;}
+#footer{				float:left;}
+#footerline1{			height:2px;	width:100%;}
+#footerline2{			height:6px;	width:100%;}
+.footer a img {    		opacity: 0.5;}
+.footer a:hover img {	opacity: 1;}
+
+
+#Tcontener{
+	width:100%;
+}
+#Tmenu{
+
+vertical-align: top;
+}
+#Tmainpage{
+width:100%;
+}
+.TcTD{
+	padding:6px;
+}
+
+img {					border:0; margin:0px; padding:0px; margin-bottom:-4px;}
+table{					empty-cells: show; border-spacing:0px; border-collapse:collapse;}
+input	{				font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal; border-style: none; padding:1px;}
+textarea	{			font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal;}
+checkbox	{			font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal; padding: 2px;}
+select	{ font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: normal; border-style: none; padding-right:1px;padding-left:1px;}
+option	{				font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal;padding-right:1px;padding-left:1px;}
+td	{    				padding:1px; color: #525252; font-family: Verdana, Arial, sans-serif; font-size: 9px;	white-space: nowrap;}
+
+a	{					text-decoration: none;}
+a:hover	{				text-decoration: underline;}
+
+.Small{
+ text-align: center;
+}
+
+.pathWay{
+color:red;
+}
diff --git a/www/Themes/Basic_light/Images/QuickSearch.gif b/www/Themes/Basic_light/Images/QuickSearch.gif
new file mode 100644
index 0000000000000000000000000000000000000000..44346cf1c7b128f0305529046bcfcbddb9ef64e7
Binary files /dev/null and b/www/Themes/Basic_light/Images/QuickSearch.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_banner.gif b/www/Themes/Basic_light/Images/bg_banner.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1149381ccc8b1d2d3e750386e8bfe6a5e0e6b559
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_banner.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_header.gif b/www/Themes/Basic_light/Images/bg_header.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9aae4df5f4b02cbf144e22a317ed4670a97f9904
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_header.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_header_blue.gif b/www/Themes/Basic_light/Images/bg_header_blue.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1f3dba11593dcd644563da5e3e91650444ff3e90
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_header_blue.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_header_grayblue.gif b/www/Themes/Basic_light/Images/bg_header_grayblue.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6f244b415d49c4c93fa5cffc2bafb2d5dd9cfc15
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_header_grayblue.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_header_green.gif b/www/Themes/Basic_light/Images/bg_header_green.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9e66d8050aa00ea27957bca49c2ba43fb98d32f5
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_header_green.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_header_maroon.gif b/www/Themes/Basic_light/Images/bg_header_maroon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4f7e2a5fc70bf6d5992af98b296e1bde05e56866
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_header_maroon.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_header_orange.gif b/www/Themes/Basic_light/Images/bg_header_orange.gif
new file mode 100644
index 0000000000000000000000000000000000000000..55e2db78afba24c94ebcbbebc656549b2e18dc38
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_header_orange.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_header_pink.gif b/www/Themes/Basic_light/Images/bg_header_pink.gif
new file mode 100644
index 0000000000000000000000000000000000000000..940fde73a1e318fc49e3f762e016659a655689c4
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_header_pink.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_header_red.gif b/www/Themes/Basic_light/Images/bg_header_red.gif
new file mode 100644
index 0000000000000000000000000000000000000000..98bced7424c49a36f11f9fdc58006f6754765259
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_header_red.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_header_yellow.gif b/www/Themes/Basic_light/Images/bg_header_yellow.gif
new file mode 100644
index 0000000000000000000000000000000000000000..14587227e0a99ffc50c0d76aab1f5bb2bf86f49e
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_header_yellow.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_input_blue.gif b/www/Themes/Basic_light/Images/bg_input_blue.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4ff87b1cbdb69566a9bc29a40510f25d6083f1c3
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_input_blue.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_input_gray.gif b/www/Themes/Basic_light/Images/bg_input_gray.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4c7acafa2b0652acf7ad1b393927d95a747f8c8e
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_input_gray.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_input_green.gif b/www/Themes/Basic_light/Images/bg_input_green.gif
new file mode 100644
index 0000000000000000000000000000000000000000..65bda771808a455c9174b339471b36701f2305d9
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_input_green.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_input_maroon.gif b/www/Themes/Basic_light/Images/bg_input_maroon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..64139d730da5788f8009d038565995bd2d303fc5
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_input_maroon.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_input_orange.gif b/www/Themes/Basic_light/Images/bg_input_orange.gif
new file mode 100644
index 0000000000000000000000000000000000000000..02a5f1c1ffd4e145062701e02f76b4930a820ec3
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_input_orange.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_input_purple.gif b/www/Themes/Basic_light/Images/bg_input_purple.gif
new file mode 100644
index 0000000000000000000000000000000000000000..decfb226cb275403f5a3c8623ed8b19571cf77c2
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_input_purple.gif differ
diff --git a/www/Themes/Basic_light/Images/bg_input_red.gif b/www/Themes/Basic_light/Images/bg_input_red.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4b738616018ee782d61ca6fe286da81e5c48f453
Binary files /dev/null and b/www/Themes/Basic_light/Images/bg_input_red.gif differ
diff --git a/www/Themes/Basic_light/Images/blank.gif b/www/Themes/Basic_light/Images/blank.gif
new file mode 100644
index 0000000000000000000000000000000000000000..35d42e808f0a8017b8d52a06be2f8fec0b466a66
Binary files /dev/null and b/www/Themes/Basic_light/Images/blank.gif differ
diff --git a/www/Themes/Basic_light/Images/bottom_menu.gif b/www/Themes/Basic_light/Images/bottom_menu.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a5fd6052d0cf848a6c8008e4d0369ac44ce6e089
Binary files /dev/null and b/www/Themes/Basic_light/Images/bottom_menu.gif differ
diff --git a/www/Themes/Basic_light/Images/bottomleft.gif b/www/Themes/Basic_light/Images/bottomleft.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0efa0286cbea5ea7f81355c0aaa8c3e38b6036c4
Binary files /dev/null and b/www/Themes/Basic_light/Images/bottomleft.gif differ
diff --git a/www/Themes/Basic_light/Images/bottomright.gif b/www/Themes/Basic_light/Images/bottomright.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9ebeaf4672d666560af44adceadb6ff8d278eac3
Binary files /dev/null and b/www/Themes/Basic_light/Images/bottomright.gif differ
diff --git a/www/Themes/Basic_light/Images/favicon.ico b/www/Themes/Basic_light/Images/favicon.ico
new file mode 100644
index 0000000000000000000000000000000000000000..ed8b91eec83115de4e4eca62d24547a3c4658ec9
Binary files /dev/null and b/www/Themes/Basic_light/Images/favicon.ico differ
diff --git a/www/Themes/Basic_light/Images/footer/button-donate.gif b/www/Themes/Basic_light/Images/footer/button-donate.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ec682c6b15e2d7cbc4b85f6497da45108ad65cea
Binary files /dev/null and b/www/Themes/Basic_light/Images/footer/button-donate.gif differ
diff --git a/www/Themes/Basic_light/Images/footer/button-gpl.gif b/www/Themes/Basic_light/Images/footer/button-gpl.gif
new file mode 100644
index 0000000000000000000000000000000000000000..05133808cd920b79481714dd3389afa363e2aa4d
Binary files /dev/null and b/www/Themes/Basic_light/Images/footer/button-gpl.gif differ
diff --git a/www/Themes/Basic_light/Images/footer/button-php.gif b/www/Themes/Basic_light/Images/footer/button-php.gif
new file mode 100644
index 0000000000000000000000000000000000000000..28f329aaa2367c4b2b41e353acb26aae979ce6ed
Binary files /dev/null and b/www/Themes/Basic_light/Images/footer/button-php.gif differ
diff --git a/www/Themes/Basic_light/Images/footer/colophon_css.png b/www/Themes/Basic_light/Images/footer/colophon_css.png
new file mode 100644
index 0000000000000000000000000000000000000000..44d3ead2838611d410b249b771a457b7d7fb6a37
Binary files /dev/null and b/www/Themes/Basic_light/Images/footer/colophon_css.png differ
diff --git a/www/Themes/Basic_light/Images/line.gif b/www/Themes/Basic_light/Images/line.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2e10cb879a1b63cf34139001afa0c23ef9d69277
Binary files /dev/null and b/www/Themes/Basic_light/Images/line.gif differ
diff --git a/www/Themes/Basic_light/Images/logo_oreon.gif b/www/Themes/Basic_light/Images/logo_oreon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..414e66d537c30cbde29cac9ac4580a3122e84bfe
Binary files /dev/null and b/www/Themes/Basic_light/Images/logo_oreon.gif differ
diff --git a/www/Themes/Basic_light/Images/menu_bg.gif b/www/Themes/Basic_light/Images/menu_bg.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6bfc38011af79404963dd9fadd2d2652cb01345a
Binary files /dev/null and b/www/Themes/Basic_light/Images/menu_bg.gif differ
diff --git a/www/Themes/Basic_light/Images/menu_bg_blue.gif b/www/Themes/Basic_light/Images/menu_bg_blue.gif
new file mode 100644
index 0000000000000000000000000000000000000000..aa5aaaf7b024bc1bd6c8ae235dbced20f23bbf5f
Binary files /dev/null and b/www/Themes/Basic_light/Images/menu_bg_blue.gif differ
diff --git a/www/Themes/Basic_light/Images/menu_bg_blue2.gif b/www/Themes/Basic_light/Images/menu_bg_blue2.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b8056c54a5449fc5c22c2a1e53fbe0bc36c96cf3
Binary files /dev/null and b/www/Themes/Basic_light/Images/menu_bg_blue2.gif differ
diff --git a/www/Themes/Basic_light/Images/menu_bg_grayblue.gif b/www/Themes/Basic_light/Images/menu_bg_grayblue.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d06eb65b2a798ad98b0d6385f7e2cd0774a8f7e1
Binary files /dev/null and b/www/Themes/Basic_light/Images/menu_bg_grayblue.gif differ
diff --git a/www/Themes/Basic_light/Images/menu_bg_green.gif b/www/Themes/Basic_light/Images/menu_bg_green.gif
new file mode 100644
index 0000000000000000000000000000000000000000..021bc8dde9e063a579bbef4517720194bc7cb098
Binary files /dev/null and b/www/Themes/Basic_light/Images/menu_bg_green.gif differ
diff --git a/www/Themes/Basic_light/Images/menu_bg_maroon.gif b/www/Themes/Basic_light/Images/menu_bg_maroon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..bdaeee797d6d053b95d2c70799ef89cdf27d1273
Binary files /dev/null and b/www/Themes/Basic_light/Images/menu_bg_maroon.gif differ
diff --git a/www/Themes/Basic_light/Images/menu_bg_orange.gif b/www/Themes/Basic_light/Images/menu_bg_orange.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9f6dbaf95bff9223e481ad42e41413c3c37d20a7
Binary files /dev/null and b/www/Themes/Basic_light/Images/menu_bg_orange.gif differ
diff --git a/www/Themes/Basic_light/Images/menu_bg_pink.gif b/www/Themes/Basic_light/Images/menu_bg_pink.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b81213e58158f85c1de46506a4218497bf0e0285
Binary files /dev/null and b/www/Themes/Basic_light/Images/menu_bg_pink.gif differ
diff --git a/www/Themes/Basic_light/Images/menu_bg_purple.gif b/www/Themes/Basic_light/Images/menu_bg_purple.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4551843a69711b6267c455afc16eabf1e5cb6887
Binary files /dev/null and b/www/Themes/Basic_light/Images/menu_bg_purple.gif differ
diff --git a/www/Themes/Basic_light/Images/menu_bg_red.gif b/www/Themes/Basic_light/Images/menu_bg_red.gif
new file mode 100644
index 0000000000000000000000000000000000000000..18a034303c94bcfdf7129aaa13b31829618b2dd7
Binary files /dev/null and b/www/Themes/Basic_light/Images/menu_bg_red.gif differ
diff --git a/www/Themes/Basic_light/Images/menu_bg_yellow.gif b/www/Themes/Basic_light/Images/menu_bg_yellow.gif
new file mode 100644
index 0000000000000000000000000000000000000000..aa4f46efa1e93f678bc2bae2004ba7a2dc201183
Binary files /dev/null and b/www/Themes/Basic_light/Images/menu_bg_yellow.gif differ
diff --git a/www/Themes/Basic_light/Images/menu_r.gif b/www/Themes/Basic_light/Images/menu_r.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6bfc5c0d30d2bbe85aee6be6edf1cf2ba4ac4a0e
Binary files /dev/null and b/www/Themes/Basic_light/Images/menu_r.gif differ
diff --git a/www/Themes/Basic_light/Images/test_bg_biseau.gif b/www/Themes/Basic_light/Images/test_bg_biseau.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0a4ce19e5d546f8fce7dc903fa57df3dd098cfd7
Binary files /dev/null and b/www/Themes/Basic_light/Images/test_bg_biseau.gif differ
diff --git a/www/Themes/Basic_light/Images/test_bg_center.gif b/www/Themes/Basic_light/Images/test_bg_center.gif
new file mode 100644
index 0000000000000000000000000000000000000000..993eed0ed68033319dffd123bd48ba0949067d89
Binary files /dev/null and b/www/Themes/Basic_light/Images/test_bg_center.gif differ
diff --git a/www/Themes/Basic_light/Images/test_bg_leftbottom.gif b/www/Themes/Basic_light/Images/test_bg_leftbottom.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6a7453e5f7eb9d37e690b571b2fde6b1891fd0ed
Binary files /dev/null and b/www/Themes/Basic_light/Images/test_bg_leftbottom.gif differ
diff --git a/www/Themes/Basic_light/Images/top_menu.gif b/www/Themes/Basic_light/Images/top_menu.gif
new file mode 100644
index 0000000000000000000000000000000000000000..36d81f3e00b50f5d6474def537163b42dfa97305
Binary files /dev/null and b/www/Themes/Basic_light/Images/top_menu.gif differ
diff --git a/www/Themes/Basic_light/Images/topleft.gif b/www/Themes/Basic_light/Images/topleft.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a32495d0e9fa4eb1db022a97c9b82e0f08093fc2
Binary files /dev/null and b/www/Themes/Basic_light/Images/topleft.gif differ
diff --git a/www/Themes/Basic_light/Images/topright.gif b/www/Themes/Basic_light/Images/topright.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5c434ab5138da1b7df6b33efbe8c75cd738a2569
Binary files /dev/null and b/www/Themes/Basic_light/Images/topright.gif differ
diff --git a/www/Themes/Basic_light/color1.css b/www/Themes/Basic_light/color1.css
new file mode 100644
index 0000000000000000000000000000000000000000..df8019190052e9d28eabff9619cb68e94a04171f
--- /dev/null
+++ b/www/Themes/Basic_light/color1.css
@@ -0,0 +1,183 @@
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+#outer	{border-left-color:#F2F2F2;   /* left column colour */}
+
+body	{background-color:#F2F2F2;}
+
+
+
+/* Form  */
+
+.ListTable, #ListTable a:link		{color:#666666;}
+.ListTable, #ListTable a:visited	{color:#666666;}
+.ListTable, #ListTable a:hover		{color:#E3A385;}
+
+.list_lvl_1		{background-color:#fada83;}
+.list_lvl_2		{background-color:#faeaa3;}
+
+.ListHeader		{
+	background-image: url("./Images/bg_header_orange.gif");
+	text-align:center;
+	background-position:top left;
+	background-repeat:repeat-x;
+	background-color:#fada83 ;
+}
+
+#ResumeHeader	{	
+	background-image: #fada83 url("./Images/bg_header_orange.gif")
+	background-position:top left;
+	background-repeat:repeat-x;
+	background-color:#fada83 ;
+}
+#ResumeHeader td	{
+	padding-left:1px;
+	padding-right:1px; 
+	color: #525252; 
+	font-family: Verdana, Arial, sans-serif; 
+	font-size: 9px;	
+	white-space: nowrap;
+}
+
+#ResumeTable    {width:100%;}
+#ResumeTable a	{color:#666666;}
+#ResumeTable td	{
+	padding-top:2px;
+	padding-bottom:2px;
+	border: 0.5px solid gray;
+}
+#ListTable, #ListTableMedium, #ListTableSmall {
+border-color: #fada83;
+}
+
+.list_lvl_2 td, .list_lvl_1 td{
+	border-top-color: #AAAAAA;
+	border-left-color: #AAAAAA;
+	border-bottom-color: #AAAAAA;
+	border-right-color: #AAAAAA;
+}
+.list_one td, .list_two td, .list_three td, .list_four td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+	border-bottom-color: #FFFFFF;
+	border-right-color: #FFFFFF;
+}
+.tab .list_one td, .tab .list_two td, .tab .list_three td, .tab .list_four td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+	border-bottom-color: #FFFFFF;
+	border-right-color: #FFFFFF;
+}
+.tab .list_lvl_2 td, .tab .list_lvl_1 td{
+	border-top-color: #AAAAAA;
+	border-left-color: #AAAAAA;
+	border-bottom-color: #AAAAAA;
+	border-right-color: #AAAAAA;
+}
+.ListHeader td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+}
+
+
+.ListHeader td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+}
+
+.ListColFooterRight, .ListColFooterLeft, .ListColFooterCenter{
+	border-top-color: #AAAAEE;
+}
+
+
+/*.list_one{		background-color:#f8c160;}*/
+.list_one 		{background-color:#FFF2AD;}
+.list_one td	{
+	padding-left:1px;
+	padding-right:1px; 
+	color: #525252; 
+	font-family: Verdana, Arial, sans-serif; 
+	font-size: 9px;	
+	white-space: nowrap;
+}
+
+/* .list_two {		background-color:#ffe3a1;}*/
+.list_two 		{background-color:#FEE8AD;}
+.list_three		{background-color:#ffe0d1;}
+.list_four 		{background-color:#ffecd1;}
+
+
+#page 		{color:#592bed;}
+#page a		{color:#592bed;}
+
+/*Menu*/
+
+#menu1_bgimg	{	
+	background-image: url("Images/menu_bg_orange.gif");
+	background-position:top right;
+	background-repeat:repeat-x;
+}
+#menu1_bgcolor	{background: #fdc11e;}
+#menu2_bgcolor	{background: #fff3bb;}
+
+
+#menu_2	{background: #fdc11e;}
+.Tmenu3 .top .left 		{background-color:  #F2F2F2;}
+.Tmenu3 .top .right 	{background-color:  #F2F2F2;}
+.Tmenu3 .bottom .left 	{background-color:  #F2F2F2;}
+.Tmenu3 .bottom .right 	{background-color:  #F2F2F2;}
+
+
+/* General */
+
+#contener	{background:#F2F2F2;}
+#Tmenu		{
+	background:#F2F2F2;
+	border-right: 1px solid #fdc11e;
+}
+
+#footerline1	{background-color:#fdc11e;}
+#footerline2	{background-color:#dedede;}
+
+#MainPage textarea, #MainPage input, #MainPage select	{color:#242af6;}
+
+#formulary input	{ 
+	border-style:inset;
+	border:1px solid #DDDDDD;
+}
+
+/* w3c */
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background-image: url("./Images/bg_input_gray.gif") ;
+}
+
+/* IE */
+.oreonbutton input{
+    background-image: url("./Images/bg_input_gray.gif") ;
+}
+
+
+.quick_search{	
+	border-color:#eff1f4;	
+	background-image:  url("Images/bg_header_orange.gif");	
+	color:#fff;
+	background-position:top left;
+	background-repeat:repeat-x;
+	background-color:#BFD0E2 ;
+}
diff --git a/www/Themes/Basic_light/color2.css b/www/Themes/Basic_light/color2.css
new file mode 100644
index 0000000000000000000000000000000000000000..746533024b7dab068c7488cbf95f0f5bf2e8fc4b
--- /dev/null
+++ b/www/Themes/Basic_light/color2.css
@@ -0,0 +1,155 @@
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+#outer{    border-left-color:#F2F2F2;   /* left column colour */}
+body{				background-color:#F2F2F2;}
+.ListTable, #ListTable a:link		{color:#666666;}
+.ListTable, #ListTable a:visited		{color:#666666;}
+.ListTable, #ListTable a:hover		{color:#E3A385;}
+/* Form */
+.list_lvl_1{	background-color:#fada83;}
+.list_lvl_2{	background-color:#faeaa3;}
+.ListHeader{	background-image: url("./Images/bg_header_orange.gif");
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#fada83 ;
+}
+#ListTable, #ListTableMedium, #ListTableSmall {
+border-color: #fada83;
+}
+.list_lvl_2 td, .list_lvl_1 td{
+	border-top-color: #AAAAAA;
+	border-left-color: #AAAAAA;
+	border-bottom-color: #AAAAAA;
+	border-right-color: #AAAAAA;
+}
+.list_one td, .list_two td, .list_three td, .list_four td{
+	border-top-color: #fada83;
+	border-left-color: #fada83;
+	border-bottom-color: #fada83;
+	border-right-color: #fada83;
+}
+.tab .list_one td, .tab .list_two td, .tab .list_three td, .tab .list_four td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+	border-bottom-color: #FFFFFF;
+	border-right-color: #FFFFFF;
+}
+.tab .list_lvl_2 td, .tab .list_lvl_1 td{
+	border-top-color: #AAAAAA;
+	border-left-color: #AAAAAA;
+	border-bottom-color: #AAAAAA;
+	border-right-color: #AAAAAA;
+}
+.ListHeader td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+}
+
+
+.ListHeader td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+}
+
+.ListColFooterRight, .ListColFooterLeft, .ListColFooterCenter{
+	border-top-color: #fada83;
+}
+
+
+.list_one {		background-color:#F8FABE;} /*D1ECFD D6E5F0;}*/
+
+table tr.list_one:hover{		background-color:#D8FABE;} /*D1ECFD D6E5F0;}*/
+
+
+.list_two {		background-color:#F2F4B3 ;} /*BEE1F8 DCEDF8;}*/
+.list_two:hover {		background-color:#D2F4B3 ;} /*BEE1F8 DCEDF8;}*/
+
+.list_three{	background-color:#ffbbbb;}
+.list_three:hover{	background-color:#dfbbbb;}
+.list_four {	background-color:#ffecd1;}
+.list_four:hover {	background-color:#dfecd1;}
+#page {			color:#592bed;}
+#page a{		color:#592bed;}
+
+/*Menu*/
+
+#menu1_bgimg{	background-image: url("Images/menu_bg_orange.gif");
+background-position:top right;
+background-repeat:repeat-x;
+}
+
+
+#menu1_bgcolor{	background: #fdc11e;}
+#menu2_bgcolor{	background: #FEF7DB;}
+
+
+#menu_2{		background: #fdc11e;}
+.Tmenu3 .top .left { background-color:  #FEF7DB;}
+.Tmenu3 .top .right {  background-color:  #FEF7DB;}
+.Tmenu3 .bottom .left {  background-color:  #FEF7DB;}
+.Tmenu3 .bottom .right { background-color:  #FEF7DB;}
+
+
+/* General */
+#contener{		background:#F2F2F2;}
+#Tmenu{		background:#F2F2F2;
+border-right: 1px solid #fdc11e;
+}
+
+#footerline1{	background-color:#fdc11e;}
+#footerline2{	background-color:#dedede;}
+
+#MainPage textarea, #MainPage input, #MainPage select{    color:#242af6;}
+#mainnav li{	background-image: url("./Images/bg_header_orange.gif");}
+
+#formulary input{ border-style:inset;border:1px solid #DDDDDD;}
+ 
+/* w3c */
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background-image: url("./Images/bg_input_orange.gif") ;
+}
+/* IE */
+.oreonbutton input{
+    background-image: url("./Images/bg_input_orange.gif") ;
+}
+
+
+.quick_search{	border-color:#eff1f4;	
+background-image:  url("Images/bg_header_orange.gif");	color:#fff;
+background-color:#BFD0E2;
+background-position:top left;
+background-repeat:repeat-x;
+}
+.limitPage{
+background: url("Images/bg_header_orange.gif");
+background-color:#BFD0E2;
+background-position:top left;
+background-repeat:repeat-x;
+
+}
+.pageNumber{background: url("Images/bg_header_orange.gif");
+background-color:#BFD0E2;
+background-position:top left;
+background-repeat:repeat-x;
+}
+
+.a, .b{
+border-color:#fada83;
+}
diff --git a/www/Themes/Basic_light/color3.css b/www/Themes/Basic_light/color3.css
new file mode 100644
index 0000000000000000000000000000000000000000..9626270f9c18150ab253a6714d89abf8400c06ea
--- /dev/null
+++ b/www/Themes/Basic_light/color3.css
@@ -0,0 +1,150 @@
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+#outer{    border-left-color:#F2F2F2;   /* left column colour */}
+body{			background-color:#F2F2F2;}
+.ListTable, #ListTable a:link		{color:#666666;}
+.ListTable, #ListTable a:visited		{color:#666666;}
+.ListTable, #ListTable a:hover		{color:#E3A385;}
+/* Form */
+.list_lvl_1{	background-color:#DDFFDD;}
+.list_lvl_2{	background-color:#CCFFCC;}
+.ListHeader{	background-image:  url("./Images/bg_header_green.gif");
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#BFD0E2 ;
+}
+#ListTable, #ListTableMedium, #ListTableSmall {
+border-color: #BFD0E2;
+}
+.ListTable, .ListTableMedium, .ListTableSmall {
+border-color: #BFD0E2;
+}
+.list_lvl_2 td, .list_lvl_1 td{
+	border-top-color: #AAAAAA;
+	border-left-color: #AAAAAA;
+	border-bottom-color: #AAAAAA;
+	border-right-color: #AAAAAA;
+}
+.list_one td, .list_two td, .list_three td, .list_four td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+	border-bottom-color: #FFFFFF;
+	border-right-color: #FFFFFF;
+}
+.tab .list_one td, .tab .list_two td, .tab .list_three td, .tab .list_four td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+	border-bottom-color: #FFFFFF;
+	border-right-color: #FFFFFF;
+}
+.tab .list_lvl_2 td, .tab .list_lvl_1 td{
+	border-top-color: #AAAAAA;
+	border-left-color: #AAAAAA;
+	border-bottom-color: #AAAAAA;
+	border-right-color: #AAAAAA;
+}
+.ListHeader td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+}
+.list_one td, .list_two td, .list_three td, .list_four td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+}
+
+.ListHeader td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+}
+
+.ListColFooterRight, .ListColFooterLeft, .ListColFooterCenter{
+	border-top-color: #BFD0E2;
+}
+
+.list_one{		background-color:#AAEEAA;}
+.list_two {		background-color:#BBFFBB;}
+.list_three{	background-color:#fada83;}
+.list_four {	background-color:#fdc11e;}
+#page {			color:#592bed;}
+#page a{		color:#592bed;}
+
+/*Menu*/
+#menu1_bgimg{	background-image: url("Images/menu_bg_green.gif");
+background-position:top right;
+background-repeat:repeat-x;
+background-color:#BFD0E2;
+}
+
+#menu1_bgcolor{	background-color: #ADC7A1;}
+#menu2_bgcolor{	background-color: #DFF9E0;}
+
+#menu_2{		background-color:#ADC7A1;}
+
+.Tmenu3 .top .left { background-color:  #F2F2F2;}
+.Tmenu3 .top .right {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .left {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .right { background-color:  #F2F2F2;}
+/* General */
+#contener{		background-color:#F2F2F2;}
+#Tmenu{		background-color:#F2F2F2;
+border-right: 1px solid #ADC7A1;
+}
+
+
+
+#footerline1{	background-color:#ADC7A1;}
+#footerline2{	background-color:#dedede;}
+
+#MainPage textarea, #MainPage input, #MainPage select{    color:#242af6;}
+#mainnav li{	background-image: url("./Images/bg_header_green.gif");}
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background-image: url("./Images/bg_input_green.gif") ;
+}
+/* w3c */
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background-image: url("./Images/bg_input_green.gif") ;
+}
+/* IE */
+.oreonbutton input{
+    background-image: url("./Images/bg_input_green.gif") ;
+}
+
+.quick_search{	border-color:#eff1f4;	
+background-image: url("Images/bg_header_green.gif");	color:#fff;
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#BFD0E2 ;
+
+}
+.limitPage{
+background-image: url("Images/bg_header_green.gif");
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#BFD0E2 ;
+
+}
+.pageNumber{background-image: url("Images/bg_header_green.gif");
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#BFD0E2 ;
+}
+.a, .b{
+border-color:#BFD0E2;
+}
\ No newline at end of file
diff --git a/www/Themes/Basic_light/color4.css b/www/Themes/Basic_light/color4.css
new file mode 100644
index 0000000000000000000000000000000000000000..841d03627de90ac7e24055643fe0c4c10defe986
--- /dev/null
+++ b/www/Themes/Basic_light/color4.css
@@ -0,0 +1,151 @@
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+#outer{    border-left-color:#F2F2F2;   /* left column colour */}
+body{				background-color:#F2F2F2;}
+
+.ListTable, #ListTable a:link		{color:#666666;}
+.ListTable, #ListTable a:visited		{color:#666666;}
+.ListTable, #ListTable a:hover		{color:#E3A385;}
+
+/* Form */
+.list_lvl_1{	background-color:#FF8686;}
+.list_lvl_2{	background-color:#FFBBA2;}
+.ListHeader{	background-image: url("./Images/bg_header_red.gif");
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#FF8686 ;
+}
+#ListTable, #ListTableMedium, #ListTableSmall {
+border-color: #FF8686;
+}
+
+.list_lvl_2 td, .list_lvl_1 td{
+	border-top-color: #AAAAAA;
+	border-left-color: #AAAAAA;
+	border-bottom-color: #AAAAAA;
+	border-right-color: #AAAAAA;
+}
+.list_one td, .list_two td, .list_three td, .list_four td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+	border-bottom-color: #FFFFFF;
+	border-right-color: #FFFFFF;
+}
+.tab .list_one td, .tab .list_two td, .tab .list_three td, .tab .list_four td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+	border-bottom-color: #FFFFFF;
+	border-right-color: #FFFFFF;
+}
+.tab .list_lvl_2 td, .tab .list_lvl_1 td{
+	border-top-color: #AAAAAA;
+	border-left-color: #AAAAAA;
+	border-bottom-color: #AAAAAA;
+	border-right-color: #AAAAAA;
+}
+.ListHeader td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+}
+
+
+.ListHeader td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+}
+
+.ListColFooterRight, .ListColFooterLeft, .ListColFooterCenter{
+	border-top-color: #FF8686;
+}
+
+.list_one{		background-color:#FFCCCC;}
+.list_one:hover{		background-color:#DFCCCC;}
+.list_two {		background-color:#FFE2E2;}
+.list_two:hover {		background-color:#DFE2E2;}
+.list_three{	background-color:#fada83;}
+.list_three:hover{	background-color:#dada83;}
+.list_four {	background-color:#fdc11e;}
+.list_four:hover {	background-color:#ddc11e;}
+#page {			color:#592bed;}
+#page a{		color:#592bed;}
+
+/*Menu*/
+#menu1_bgimg{	background-image: url("Images/menu_bg_red.gif");
+background-position:top right;
+background-repeat:repeat-x;
+}
+
+
+#menu1_bgcolor{	background-color: #E3858C;}
+#menu2_bgcolor{	background-color: #F9EDED;}
+
+
+#menu_2{		background-color: #E3858C;}
+
+.Tmenu3 .top .left { background-color:  #F2F2F2;}
+.Tmenu3 .top .right {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .left {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .right { background-color:  #F2F2F2;}
+
+/* General */
+#contener{		background-color:#F2F2F2;}
+#Tmenu{		background-color:#F2F2F2;
+border-right: 1px solid #E3858C;
+}
+
+
+#footerline1{	background-color:#E3858C;}
+#footerline2{	background-color:#dedede;}
+
+#MainPage textarea, #MainPage input, #MainPage select{    color:#242af6;}
+#mainnav li{	background-image: url("./Images/bg_header_red.gif");}
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background-image: url("./Images/bg_input_red.gif") ;
+}
+/* w3c */
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background-image: url("./Images/bg_input_red.gif") ;
+}
+/* IE */
+.oreonbutton input{
+    background-image: url("./Images/bg_input_red.gif") ;
+}
+
+.quick_search{	border-color:#eff1f4;	
+background-image: url("Images/bg_header_red.gif");
+	color:#fff;
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#BFD0E2 ;
+
+}
+
+.limitPage{
+background-image: url("Images/bg_header_red.gif");
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#BFD0E2 ;
+
+}
+.pageNumber{background-image: url("Images/bg_header_red.gif");
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#BFD0E2 ;
+}
\ No newline at end of file
diff --git a/www/Themes/Basic_light/color5.css b/www/Themes/Basic_light/color5.css
new file mode 100644
index 0000000000000000000000000000000000000000..429763ade9a8fa64f37ee46d680877a88f6c2f01
--- /dev/null
+++ b/www/Themes/Basic_light/color5.css
@@ -0,0 +1,144 @@
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+#outer{    border-left-color:#F2F2F2;   /* left column colour */}
+body{				background-color:#F2F2F2;}
+.ListTable, #ListTable a:link		{color:#666666;}
+.ListTable, #ListTable a:visited		{color:#666666;}
+.ListTable, #ListTable a:hover		{color:#E3A385;}
+/* Form */
+.list_lvl_1{    	background-color:#e7cafa;}
+.list_lvl_2{    	background-color:#e7bafa;}
+.ListHeader{    	background-image:url("./Images/bg_header_pink.gif");
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#BFD0E2 ;
+}
+#ListTable, #ListTableMedium, #ListTableSmall {
+border-color: #e7cafa;
+}
+
+.list_lvl_2 td, .list_lvl_1 td{
+	border-top-color: #AAAAAA;
+	border-left-color: #AAAAAA;
+	border-bottom-color: #AAAAAA;
+	border-right-color: #AAAAAA;
+}
+.list_one td, .list_two td, .list_three td, .list_four td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+	border-bottom-color: #FFFFFF;
+	border-right-color: #FFFFFF;
+}
+.tab .list_one td, .tab .list_two td, .tab .list_three td, .tab .list_four td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+	border-bottom-color: #FFFFFF;
+	border-right-color: #FFFFFF;
+}
+.tab .list_lvl_2 td, .tab .list_lvl_1 td{
+	border-top-color: #AAAAAA;
+	border-left-color: #AAAAAA;
+	border-bottom-color: #AAAAAA;
+	border-right-color: #AAAAAA;
+}
+.ListHeader td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+}
+
+.ListHeader td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+}
+
+.ListColFooterRight, .ListColFooterLeft, .ListColFooterCenter{
+	border-top-color: #e7cafa;
+}
+
+.list_one{    		background-color:#f1e4fa;}
+.list_one:hover{    		background-color:#f1e400;}
+.list_two {    		background-color:#f8f1fd;}
+.list_two:hover {    		background-color:#f8f10d;}
+.list_three{    	background-color:#fada83;}
+.list_three:hover{    	background-color:#fada03;}
+.list_four {    	background-color:#fdc11e;}
+.list_four:hover {    	background-color:#fdc11b;}
+#page {    			color:#c468f9;}
+#page a{    		color:#c468f9;}
+
+/*Menu*/
+#menu1_bgimg{    	background-image: url("Images/menu_bg_purple.gif");
+background-position:top right;
+background-repeat:repeat-x;
+}
+
+#menu1_bgcolor{		background-color: #9C85E3;}
+#menu2_bgcolor{		background-color: #ECE5F9;}
+
+
+#menu_2{			background-color: #9C85E3;}
+
+.Tmenu3 .top .left { background-color:  #F2F2F2;}
+.Tmenu3 .top .right {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .left {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .right { background-color:  #F2F2F2;}
+
+/* General */
+#contener{		background-color:#F2F2F2;}
+#Tmenu{		background-color:#F2F2F2;
+border-right: 1px solid #9C85E3;
+}
+
+#footerline1{background-color:#9C85E3;}
+#footerline2{background-color:#dedede;}
+
+#MainPage textarea, #MainPage input, #MainPage select{    color:#a42ab6;}
+#mainnav li{	background-image: url("./Images/bg_header_pink.gif");}
+
+/* w3c */
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background-image: url("./Images/bg_input_purple.gif") ;
+}
+/* IE */
+.oreonbutton input{
+    background-image: url("./Images/bg_input_purple.gif") ;
+}
+
+.quick_search{	
+border-color:#eff1f4;	
+background-image: url("Images/bg_header_pink.gif");
+	color:#fff;
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#BFD0E2 ;
+
+}
+.limitPage{
+background-image: url("Images/bg_header_pink.gif");
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#BFD0E2 ;
+
+}
+.pageNumber{background-image:url("Images/bg_header_pink.gif");
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#BFD0E2 ;
+}
diff --git a/www/Themes/Basic_light/color6.css b/www/Themes/Basic_light/color6.css
new file mode 100644
index 0000000000000000000000000000000000000000..59042a4d3ad91517836056caf862021f397dffbe
--- /dev/null
+++ b/www/Themes/Basic_light/color6.css
@@ -0,0 +1,165 @@
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+
+#outer{		border-left-color:#F2F2F2;   /* left column colour */}
+body{		background-color:#F2F2F2;}
+
+.ListTable, #ListTable a:link		{color:#666666;}
+.ListTable, #ListTable a:visited		{color:#666666;}
+.ListTable, #ListTable a:hover		{color:#E3A385;}
+
+/* Form */
+.list_lvl_1{	background-color:#d5dfeb;}
+.list_lvl_2{	background-color:#ced3ed;}
+.ListHeader{	background-image:url("./Images/bg_header.gif");
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#BFD0E2 ;
+}
+.ListHeader td{
+/*
+color:#FFFFFF;
+*/
+}
+.ListSubHeader{	background-color:#A9C5F2;
+font-weight:bold;
+background-position:top left;
+}
+
+#ListTable, #ListTableMedium, #ListTableSmall {
+border-color: #AAAAFF;
+}
+.list_lvl_2 td, .list_lvl_1 td{
+	border-top-color: #AAAAAA;
+	border-left-color: #AAAAAA;
+	border-bottom-color: #AAAAAA;
+	border-right-color: #AAAAAA;
+}
+.list_one td, .list_two td, .list_three td, .list_four td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+	border-bottom-color: #FFFFFF;
+	border-right-color: #FFFFFF;
+}
+.tab .list_one td, .tab .list_two td, .tab .list_three td, .tab .list_four td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+	border-bottom-color: #FFFFFF;
+	border-right-color: #FFFFFF;
+}
+.tab .list_lvl_2 td, .tab .list_lvl_1 td{
+	border-top-color: #AAAAAA;
+	border-left-color: #AAAAAA;
+	border-bottom-color: #AAAAAA;
+	border-right-color: #AAAAAA;
+}
+.ListHeader td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+}
+
+
+.ListColFooterRight, .ListColFooterLeft, .ListColFooterCenter{
+	border-top-color: #AAAAEE;
+}
+
+
+.list_one{		background-color:#CBE8FB;} /*C1DDF6;}*/
+.list_one:hover {	background-color:#9BE8FB;}
+.list_two {		background-color:#B3DCF8; }/*C4E5FB;} e6f2fe;}*/
+.list_two:hover {		background-color:#93DCF8;} /*e6f2fe;}*/
+.list_three {	background-color:#fada83;}
+.list_three:hover {	background-color:#bada83;}
+.list_four {	background-color:#fdc11e;}
+.list_four:hover {	background-color:#bdc11e;}
+#page {			color:#592bed;}
+#page a{		color:#592bed;}
+
+/*Menu*/
+#menu1_bgimg{	background-image: url("Images/menu_bg_blue.gif");
+background-position:top right;
+background-repeat:repeat-x;
+}
+#menu1_bgcolor{	background-color: #6056e8;}
+#menu2_bgcolor{	background-color: #ebf5ff;}
+
+
+#menu_2{		background-color:	#6056e8;}
+
+.Tmenu3 .top .left { background-color:  #F2F2F2;}
+.Tmenu3 .top .right {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .left {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .right { background-color:  #F2F2F2;}
+/* General */
+#contener{		background-color:#F2F2F2;}
+#Tmenu{		background-color:#F2F2F2;
+border-right: 1px solid #6056e8;
+}
+
+#footerline1{	background-color:#6056e8;}
+#footerline2{	background-color:#dedede;}
+
+#MainPage textarea, #MainPage input, #MainPage select{    color:#242af6;}
+#mainnav li{	background-image: url("./Images/bg_header.gif");}
+
+
+/* w3c */
+input[type="submit"],input[type="button"],input[type="reset"]{
+background-image: url("./Images/bg_input_blue.gif");
+background-position:bottom right;
+background-repeat:no-repeat;
+background-color:#ebf5ff ;
+}
+/* IE */
+.oreonbutton input{
+background: url("./Images/bg_input_blue.gif");
+background-position:bottom right;
+background-repeat:no-repeat;
+background-color:#ebf5ff ;
+}
+
+.quick_search, .quick_search_sub{
+border-color:#eff1f4;
+background-image:url("./Images/bg_header.gif");
+color:#fff;
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#BFD0E2 ;
+}
+
+.limitPage{
+	background-image:url("./Images/bg_header.gif");
+	color:#fff;
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#BFD0E2 ;
+
+}
+.pageNumber{
+	background-image:url("./Images/bg_header.gif");
+	color:#fff;
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#BFD0E2 ;
+}
+
+.a, .b{
+border-color:#aaaaee;
+}
\ No newline at end of file
diff --git a/www/Themes/Basic_light/color7.css b/www/Themes/Basic_light/color7.css
new file mode 100644
index 0000000000000000000000000000000000000000..4ccc4a18b73b95ac236fb6ece8d3ec0ae4356577
--- /dev/null
+++ b/www/Themes/Basic_light/color7.css
@@ -0,0 +1,138 @@
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+#outer{		border-left-color:#F2F2F2;   /* left column colour */}
+body{		background-color:#F2F2F2;}
+
+.ListTable, #ListTable a:link		{}
+.ListTable, #ListTable a:visited		{}
+.ListTable, #ListTable a:hover		{}
+
+/* Form */
+.list_lvl_1{	background-color:#7B8DFF;}
+.list_lvl_2{	background-color:#6479FF;}
+.ListHeader{	background-image: url("./Images/bg_header_grayblue.gif");
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#DFE3FF ;
+}
+#ListTable, #ListTableMedium, #ListTableSmall {
+border-color: #7B8DFF;
+}
+
+.list_lvl_2 td, .list_lvl_1 td{
+	border-top-color: #AAAAAA;
+	border-left-color: #AAAAAA;
+	border-bottom-color: #AAAAAA;
+	border-right-color: #AAAAAA;
+}
+.list_one td, .list_two td, .list_three td, .list_four td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+	border-bottom-color: #FFFFFF;
+	border-right-color: #FFFFFF;
+}
+.tab .list_one td, .tab .list_two td, .tab .list_three td, .tab .list_four td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+	border-bottom-color: #FFFFFF;
+	border-right-color: #FFFFFF;
+}
+.tab .list_lvl_2 td, .tab .list_lvl_1 td{
+	border-top-color: #AAAAAA;
+	border-left-color: #AAAAAA;
+	border-bottom-color: #AAAAAA;
+	border-right-color: #AAAAAA;
+}
+.ListHeader td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+}
+
+
+.ListHeader td{
+	border-top-color: #FFFFFF;
+	border-left-color: #FFFFFF;
+}
+
+.ListColFooterRight, .ListColFooterLeft, .ListColFooterCenter{
+	border-top-color: #7B8DFF;
+}
+
+.list_one{		background-color:#DEE7F4;}/*CBE8FB*/
+.list_one:hover{		background-color:#DEd7F4;}/*CBE8FB*/
+.list_two {		background-color:#C2D1E9;}/*B3DCF8*/
+.list_two:hover {		background-color:#C2c1E9;}/*B3DCF8*/
+.list_three{	background-color:#B2F867;}
+.list_three:hover{	background-color:#B2e867;}
+.list_four {	background-color:#FD8B46;}
+.list_four:hover {	background-color:#FD0B46;}
+.quick_search{	border-color:#eff1f4;	
+background-image: url("./Images/bg_header_grayblue.gif") ;
+background-position:top left;
+background-repeat:repeat-x;
+background-color:#F3E9DA;
+	color:#fff;}
+
+#page {			color:#592bed;}
+#page a{		color:#592bed;}
+
+/*Menu*/
+#menu1_bgimg{	background-image: url("Images/menu_bg_grayblue.gif")
+background-position:top right;
+background-repeat:repeat-x;
+}
+#menu1_bgcolor{	background-color:#98B2DC;}
+#menu2_bgcolor{	background-color: #B0C4DE;}
+
+#menu_3{		background-color: red;}
+#menu_2{		background-color:	#406FBA;}
+.Tmenu3 .top .left { background-color:  #F2F2F2;}
+.Tmenu3 .top .right {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .left {  background-color:  #F2F2F2;}
+.Tmenu3 .bottom .right { background-color:  #F2F2F2;}
+
+/* General */
+#contener{		background-color:#F2F2F2;}
+#Tmenu{		background-color:#F2F2F2;
+border-right: 1px solid #98B2DC;
+}
+
+#footerline1{	background-color:#98B2DC;}
+#footerline2{	background-color:#dedede;}
+
+#MainPage textarea, #MainPage input, #MainPage select{    color:#242af6;}
+
+
+#mainnav li{	background-image: url("./Images/bg_header_grayblue.gif");}
+
+/* w3c */
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background-image: url("./Images/bg_input_blue.gif") ;
+}
+/* IE */
+.oreonbutton input{
+    background-image: url("./Images/bg_input_blue.gif") ;
+}
+.quick_search{	border-color:#eff1f4;	
+background-image: url("Images/bg_header_grayblue.gif");	
+background-position:top left;
+background-repeat:repeat-x;
+color:#fff;}
+
diff --git a/www/Themes/Basic_light/configuration_form.css b/www/Themes/Basic_light/configuration_form.css
new file mode 100644
index 0000000000000000000000000000000000000000..a392878f0c96b321ac488e4bfc38822a1005b0f2
--- /dev/null
+++ b/www/Themes/Basic_light/configuration_form.css
@@ -0,0 +1,373 @@
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+#lang a:link{	color:#666666;}
+#lang a:visited{color:#666666;}
+#lang a:hover{	color:#E3A385;}
+#lang {			color:#666666;}
+#lang h1 {		font-family:Arial, Helvetica, Sans-Serif;font-size:14px; color:#666666; padding-bottom:15px}
+#lang dt {		font-family:Arial, Helvetica, Sans-Serif;font-size:12px; color:#666666; text-decoration: underline}
+#lang dd {		font-family:Arial, Helvetica, Sans-Serif;font-size:10px; color:#666666;}
+
+.FormHeader		{    font-size:12px;}
+.FormHeader .td	{    padding-left:2px;}
+.FormFooter		{    font-size:12px;    font-weight:bold;    padding-right:10px;}
+
+
+	/* IE BUG ONLY */
+ * html #ListTable td, #ListTableMedium td, #ListTableSmall td,.ListTable td, .ListTableMedium td, .ListTableSmall td{padding:0px;margin:0px;	padding-left:3px; padding-right:3px;}
+
+	
+#ListTable a, #ListTableMedium a, .ListTableSmall a,.ListTable a, .ListTableMedium a, .ListTableSmall a{color:#666666;}
+
+#ListTable, .ListTable    {    width:100%;z-index: 1;}
+#ListTableMedium, .ListTableMedium    {    width:60%;z-index: 1;}
+#ListTableSmall, .ListTableSmall    {    width:40%;z-index: 1;}
+
+.TableFooter {width:100%; z-index: 1; margin-top:8px;margin-bottom:4px}
+
+.tab .ListTable, 
+.tab .ListTableMedium,  
+.tab .ListTableSmall,
+.tab #ListTable, 
+.tab #ListTableMedium,  
+.tab #ListTableSmall {
+	margin-top:21px;
+}
+
+
+
+#ListTable, #ListTableMedium, #ListTableSmall,
+.ListTable, .ListTableMedium, .ListTableSmall {
+border-collapse:separate;
+empty-cells: show; 
+border-spacing:0px;
+border-width: 1px;
+border-style:solid;
+}
+
+#ListTable td, #ListTableMedium td, #ListTableSmall td,
+.ListTable td, .ListTableMedium td, .ListTableSmall td{
+	padding-top:2px; padding-bottom:2px;
+}
+
+
+
+.list_one td, .list_two td, .list_three td, .list_four td, .list_lvl_2 td, .list_lvl_1 td{
+	border-top-width: 0.5px;
+	border-top-style:solid;
+	border-left-width: 0.5px;
+	border-left-style:solid;
+}
+
+
+.tab .list_one td, .tab .list_two td, .tab .list_three td, .tab .list_four td{
+	border-top-width: 0.5px;
+	border-top-style:solid;
+	border-left-width: 0.5px;
+	border-left-style:solid;
+	border-right-width: 0px;
+	border-bottom-width: 0px;
+
+}
+.tab .list_lvl_2 td, .tab .list_lvl_1 td{
+	border-bottom-width: 0.5px;
+	border-bottom-style:solid;
+	border-right-width: 0.5px;
+	border-right-style:solid;
+	border-left-width: 0px;
+	border-top-width: 0px;
+}
+
+.ListHeader td{
+padding-top:5px;
+	height:20px;
+	font-family: Verdana, Arial, sans-serif;
+	font-size: 11px;
+	font-weight: blod;
+	border-top-width: 0.1px;
+	border-top-style:solid;
+	border-left-width: 0.1px;
+	border-left-style:solid;
+}
+
+
+.tab table .ListHeader td{
+	border-top-width: 0px;
+}
+
+
+.ListColFooterRight, .ListColFooterLeft, .ListColFooterCenter{
+	border-top-width: 0.1px;
+	border-top-style:solid;
+}
+
+.limitPage{text-align:left;
+	border: 1px;
+	border-style: solid;
+    border-color:#eff1f6;
+    background-color:#BFD0E2;
+    color:#fff;
+    font-family:Verdana, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:bold;
+	padding-bottom: 3px;
+	padding-top: 1px;
+	padding-left: 4px;
+	width:160px;
+}
+
+.pagination{text-align:center;}
+
+.pageNumber{
+	padding-top: 4px;
+	padding-right: 3px;
+	text-align:right;
+	border: 1px;
+	border-style: solid;
+    border-color:#eff1f6;
+    background-color:#BFD0E2;
+    color:#fff;
+    font-family:Verdana, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:bold;
+	padding-bottom: 3px;
+	width:80px;
+}
+
+.otherPageNumber{color:#5050FF;}
+.currentPageNumber{color:#ff0a0a;}
+
+/*OLD*/
+.ListColPicker		{	text-align:center;}
+.ListColHeader1    	{	width: 4%;    		text-align:center;}
+.ListColHeader2    	{   text-align:left;    padding-left:40px;}
+.ListColHeader3    	{   text-align:left;    padding-left:10px;}
+.ListColHeader4    	{   text-align:left;    padding-left:10px; 	padding-right:2px;}
+.ListColHeader5    	{   text-align:right;	padding-left:10px;	padding-right:20px}
+/**/
+
+/*NEW*/
+.ListColHeaderPicker{text-align:center;padding-left:3px;padding-right:3px;width:10px;}
+.ListColHeaderCenter{text-align:center; padding-left:10px;}
+.ListColHeaderLeft{text-align:left; padding-left:10px;}
+.ListColHeaderRight{text-align:right; padding-left:10px;padding-right:20px}
+.ListColHeaderWrap{text-align:left; padding-left:10px; white-space:normal;}
+/**/
+
+.ListColFooter1    {  padding:3px;}
+.ListColFooter2    {}
+.ListColFooter3    {}
+.ListColFooter4    {}
+.ListColFooter5, .ListColFooter5 a {    font-size:12px;    font-weight:bold;    padding-right:10px;}
+
+.ListColFooterCenter{text-align:center; font-size:12px;    font-weight:bold;    padding-right:10px;}
+.ListColFooterLeft{text-align: left; font-size:12px;    font-weight:bold;    padding-right:10px;}
+.ListColFooterRight{text-align:right; font-size:12px;    font-weight:bold;    padding-right:10px;}
+
+
+
+/*OLD start indent */
+.ListCol1    {		text-align:center;}
+.ListCol2    {		padding-left:20px;}
+.ListCol3,
+.ListCol4	{padding-left:10px;}
+.ListCol5    {padding-right:10px;}
+/**/
+
+.ListColCenter{text-align:center; padding-left:10px;}
+.ListColLeft{text-align:left; padding-left:10px;}
+.ListColRight{text-align:right; padding-left:10px;padding-right:10px;}
+.ListColNoWrap{text-align:left; padding-left:10px;white-space:normal;}
+
+
+.FormRowField    {padding-left:40px;white-space: normal;}
+.FormRowValue    {padding-left:5px;}
+
+.ListColLvl2_name{padding-left:15px;}
+.ListColLvl1_name{padding-left:10px;}
+/* end indent */
+
+.list_lvl_1{    color:#666666; font-family:Arial, Helvetica, Sans-Serif;    font-size:12px;    font-weight:bold;	vertical-align: middle;}
+.list_lvl_2{    color:#666666; font-family:Arial, Helvetica, Sans-Serif;    font-size:11px;    font-weight:bold;	vertical-align: middle;}
+.ListHeader{   font-family:Arial, Helvetica, Sans-Serif; font-size:12px; font-weight:bold;vertical-align: top;}
+.list_one{    color:#666666; font-family:Arial, Helvetica, Sans-Serif; font-size:10px; font-weight:normal; vertical-align: middle;}
+.list_two { color:#666666; font-family:Arial, Helvetica, Sans-Serif; font-size:10px; font-weight:normal; vertical-align: middle;}
+.list_three{ color:#666666; font-family:Arial, Helvetica, Sans-Serif; font-size:10px; font-weight:normal; vertical-align: middle;}
+.list_four {    color:#666666; font-family:Arial, Helvetica, Sans-Serif; font-size:10px; font-weight:normal; vertical-align: middle;}
+
+.list_one a{ color:#666666; font-family:Arial, Helvetica, Sans-Serif; font-size:10px; font-weight:normal;}
+.list_two a{ color:#666666; font-family:Arial, Helvetica, Sans-Serif; font-size:10px; font-weight:normal;}
+
+.ContactSelectOption input   { background-color: transparent;}
+
+/* end list menu */
+
+form{  padding-bottom:10px;}
+
+
+#page {    padding:5px;    text-align:center;}
+#page a{    text-align:center;}
+
+.quick_search{
+	padding-top:4px;
+	border: 1px;
+	border-style: solid;
+	border-color: red;
+	width:350px;
+	font-family:Arial, Helvetica, Sans-Serif;
+	font-size:12px;
+	font-weight:bold;
+	padding-left: 5px;
+	padding-right: 5px;
+	padding-bottom: 5px;
+	margin:0px;
+}
+
+
+.page_limit{
+	border: 1px;
+	border-style: solid;
+    border-color:#eff1f6;
+    width:80px;
+    background-color:#BFD0E2;
+    color:#fff;
+    font-family:Arial, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:bold;
+	padding-left: 25px;
+	padding-bottom: 3px;
+}
+
+
+
+#mainnav{
+position:absolute;
+}
+
+/*tab*/
+#mainnav{
+	z-index: 2;
+/*
+	clear:both;
+	*/
+	list-style-type:none;
+/*
+	width:100%;
+*/
+}
+#mainnav li{
+	padding:3px;
+	float:left;
+	z-index: 2;
+}
+
+.tab{
+	z-index: 1;
+	float:left;
+	display:none;
+}
+
+	
+#tab1{
+	z-index: 1;
+	float:left;
+	display:block;
+
+}
+
+
+.a a, .b a{
+	color:#636363;
+	font-family:Arial, Helvetica, Sans-Serif;    font-size:11px;    font-weight:bold;    text-align:left;
+}
+
+
+.a{
+	margin-left:5px;
+	margin-top:1px;
+	border-width: 1px;
+	border-style:solid;
+	border-bottom:none;
+}
+.b{
+	margin-left:5px;
+	margin-bottom:1px;
+	border-width: 1px;
+	border-style:solid;
+}
+/*end tab*/
+
+#validForm input	{    color:#666666;  font-family:Arial, Helvetica, Sans-Serif;    font-size:11px;    font-weight:normal;    text-align:left;}
+#validForm{
+	width:98%;
+	float:right;
+	padding:10px;
+	text-align:center;
+}
+#validForm input{
+	margin-top:5px;
+    text-align:center;
+}
+#validForm label{
+	padding:2px;	
+	padding-left:4px;
+	padding-right:4px;
+}
+
+#validFormTop{
+position:absolute;
+right:6px;
+top:155px;
+z-index: 10;
+}
+
+/*CSS2*/
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background-position:0px 0px;
+    color:#000000;
+    font-family:Verdana, Tahoma;
+    font-size:11px;
+    width:86px;
+    height:22px;
+    border: 0.5px solid gray;
+    vertical-align:middle;
+    text-align:center;
+}
+
+/*for IE **/
+.oreonbutton input{
+    background-position:0px 0px;
+    color:#000000;
+    font-family:Verdana, Tahoma;
+    font-size:11px;
+    width:86px;
+    height:22px;
+    border: 0.5px solid gray;
+    vertical-align:middle;
+    text-align:center;
+}
+.cachediv {
+	visibility: hidden;
+	overflow: hidden;
+	height: 1px;
+	margin-top: -1px;
+	position: absolute;
+}
+
diff --git a/www/Themes/Basic_light/form.css b/www/Themes/Basic_light/form.css
new file mode 100644
index 0000000000000000000000000000000000000000..f2e057975eaa7013f2cec341d4cece89fc1652d6
--- /dev/null
+++ b/www/Themes/Basic_light/form.css
@@ -0,0 +1,60 @@
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+.form_lvl_1{
+    background-color:#6797E3;
+    color:#fff;
+    font-family:Arial, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:bold;
+    text-align:center;
+    border:1px;
+}
+.form_lvl_2{
+    background-color:#9ca3fa;
+    color:#fff;
+    font-family:Arial, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:normal;
+    border:1px;
+}
+.form_lvl_3{
+    background-color:#c0c4fa;
+    color:#fff;
+    font-family:Arial, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:normal;
+    border:1px;
+}
+.form_one{
+    background-color:#fff;
+    color:#fff;
+    font-family:Arial, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:normal;
+    border:1px;
+}
+.form_two{
+    background-color:#fffaab;
+    color:#fff;
+    font-family:Arial, Helvetica, Sans-Serif;
+    font-size:12px;
+    font-weight:normal;
+    border:1px;
+}
diff --git a/www/Themes/Basic_light/login.css b/www/Themes/Basic_light/login.css
new file mode 100644
index 0000000000000000000000000000000000000000..8e20bd192146e04eb621940f0da00ffde26cc2e8
--- /dev/null
+++ b/www/Themes/Basic_light/login.css
@@ -0,0 +1,99 @@
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+body{			background-color:#fff9eb;font-family: Verdana;	font-size: 11px;
+			margin: 0; /* pour viter les marges */
+			text-align: center; /* pour corriger le bug de centrage IE */
+}
+/* General */ 
+img {					border:0;}
+table{					empty-cells: show; border-spacing:0px; border-collapse:collapse;}
+input	{				font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal; border-style: none; padding:2px;}
+textarea	{			font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal;}
+checkbox	{			font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal; padding: 2px;}
+select	{ font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: normal; border-style: none;}
+option	{				font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal;}
+td	{    				padding:1px; color: #525252; font-family: Verdana, Arial, sans-serif; font-size: 9px;	white-space: nowrap;}
+tr	{ 					}
+a	{					text-decoration: none;}
+a:hover	{				text-decoration: underline;}
+
+
+ 
+input[type="submit"],input[type="button"],input[type="reset"]{
+    background-position:0px 0px;
+    color:#000000;
+    font-family:Verdana, Tahoma;
+    font-size:11px;
+    width:86px;
+    height:22px;
+    border: 0.5px solid gray;
+    vertical-align:middle;
+    text-align:center;
+}
+
+/*logininvit*/
+#LoginInvit{
+	margin-top: 50px;
+	margin-left: auto;
+	margin-right: auto;
+	width:200px;
+	text-align: center; /* on rtablit l'alignement normal du texte */
+}
+
+#logintab1 {
+	width:200px;
+}
+#logintab2 {
+	width:200px;
+	border:1px solid gray;
+    border-top: 2px solid gray;
+    border-bottom: 2px solid gray;
+}
+#logintab2 td{
+	border:1px;
+	padding:5px;
+	background-color:#eaeaee;
+}
+
+#sublogin{
+	width:200px;
+	text-align:center;
+}
+
+.LoginInvitVersion{
+	text-align:left;
+}
+.LoginInvitDate{
+	text-align:right;
+}
+
+#LoginInvitcpy a,  #LoginInvitcpy{
+	 color:gray;
+	 text-align:center;
+ }
+ 
+ .inputclassic{
+    border: 1px solid gray;
+ }
+
+ input[type="submit"],input[type="reset"]{
+    background: url("./Images/bg_input_orange.gif") ;
+}
+.msg{			font-family: Verdana, Arial, sans-serif; font-size: 12px; font-weight: normal; border: 4px solid white; padding:3px; text-align: center; background-color:red; color:white; margin:5px;}
\ No newline at end of file
diff --git a/www/Themes/Basic_light/menu.css b/www/Themes/Basic_light/menu.css
new file mode 100644
index 0000000000000000000000000000000000000000..1b336afa892e43e7dd0d7cbaecd0c2e400919444
--- /dev/null
+++ b/www/Themes/Basic_light/menu.css
@@ -0,0 +1,103 @@
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+* {margin:0; padding:0}
+
+#menu_1{			
+	background-image: url("Images/menu_bg.gif");
+	height:28px;
+	background-position:top left;
+	background-repeat:repeat-x;
+}
+
+#menu_1 li {		height:24px;    padding-right:1px;    list-style-type: none;    float: left;    text-align: center;    background: url("Images/menu_r.gif") right no-repeat 0px;}
+#menu_1 li div{		float: left;    padding-top:3px;    padding-left:7px;    padding-right:3px;    height:24px;}
+#menu_1 li a{		font-family:Arial, Helvetica, Sans-Serif;    font-size:12px;    text-decoration: none;    color: #666;}
+
+#logli{	float:right;}
+
+#menu1_bgimg_{		float:left;}
+#menu1_bgcolor{		height:28px;}
+#menu_2{			padding-bottom:1px; font-family:Arial, Helvetica, Sans-Serif;    color:#666;    word-spacing: 5px;}
+#menu_2 a{			padding-left:5px;    padding-right:2px;    color:#666;    font-family:Arial, Helvetica, Sans-Serif;    font-size:11px;}
+
+.separator_menu{	color:#afafaf;  font-weight:bolder;}
+
+#menu_3 a{			font-family:Arial, Helvetica, Sans-Serif;    font-size:11px;    color:#666;}
+#menu_3 a:hover{    color:#E8AB5C;}
+#menu_3 li{    		padding-left:2px; list-style-type: none;}
+
+#menu_3 {    		padding-bottom:5px;}
+
+
+
+#topright {			float: right;}
+#bottomright {		float: right;}
+
+#bottommiddle {		float: right; background-color: Blue;}
+
+#topleft, #topright, #bottomleft, #bottomright {		
+	padding:0px;	
+	height: 12px;	
+	width: 15px;	
+	background-repeat: no-repeat;	
+	font-size:10px; /* correction d'un bug IE */}
+
+#bottomright{
+	background-color: blue;
+} 
+#bottomleft{
+	background-color: green;
+} 
+ 
+#contenu {	background: url(Images/line.gif) right repeat-y; padding-left: 2px;}
+#topline{			background:  url(Images/line.gif) top right repeat-x;}
+#bottomline{		background:  url(Images/line.gif) bottom right repeat-x;}
+
+
+#menu_3{padding:0px;}
+
+.Tmenu3 {  border-collapse: collapse; background-color: white;}
+.Tmenu3 td {padding: 0px; }
+.Tmenu3 .top .left, .Tmenu3 .top .right, .Tmenu3 .bottom .left, .Tmenu3 .bottom .right {height: 12px;	width: 15px; }
+//.Tmenu3 .top .left, .Tmenu3 .top .right, .Tmenu3 .bottom .left, .Tmenu3 .bottom .right {height: 12px;}
+
+.Tmenu3 .top .left{width:15px;padding-left:15px;}
+.Tmenu3 .top .right{width:15px;padding-left:15px;}
+
+.Tmenu3 .right{width:15px;}
+.Tmenu3 .left{width:15px;}
+.Tmenu3 .center{width:100%;}
+
+
+.Tmenu3 .top .left { background-image: url(Images/topleft.gif);}
+.Tmenu3 .top .right { background-image: url(Images/topright.gif);}
+.Tmenu3 .bottom .left { background-image: url(Images/bottomleft.gif); }
+.Tmenu3 .bottom .right { background-image: url(Images/bottomright.gif); }
+
+.Tmenu3 .bottom .center{ background: url(Images/line.gif) bottom right repeat-x; }
+.Tmenu3 .top .center{ background: url(Images/line.gif) top right repeat-x; }
+.Tmenu3 .middle .left{ background: url(Images/line.gif) left repeat-y; }
+.Tmenu3 .middle .right{ background: url(Images/line.gif) right repeat-y; }
+
+.help{
+		position:absolute;
+		right:15px;
+		top:15px;
+}
diff --git a/www/Themes/Basic_light/style.css b/www/Themes/Basic_light/style.css
new file mode 100644
index 0000000000000000000000000000000000000000..bd5ede67ceec3a9976722676442759b53955e1c3
--- /dev/null
+++ b/www/Themes/Basic_light/style.css
@@ -0,0 +1,102 @@
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+* {margin:0;padding:0}
+
+
+body{			background-color:#fff9eb;font-family: Verdana;	font-size: 11px;}
+
+.msg{			font-family: Verdana, Arial, sans-serif; font-size: 12px; font-weight: normal; border: 4px solid white; padding:3px; text-align: center;
+background-color:red; color:white; margin:5px;}
+
+
+#header{		height:83px;	padding-left:20px;	background: url("Images/bg_banner.gif") top repeat-x;}
+#logInfos{		float:right;}
+#logInfos div{		padding:2px;	padding-right:10px;	color: #525252;	font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: bold;}
+#logli{			padding-top:5px;	padding-right:10px;	color: #525252;	font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: bold;}
+#logli a {   		color:#666666;}
+
+
+#footer a{				color:#666666;}
+#footer{				float:left;}
+#footerline1{			height:2px;	width:100%;}
+#footerline2{			height:6px;	width:100%;}
+.footer a img {    		opacity: 0.5;}
+.footer a:hover img {	opacity: 1;}
+
+
+#Tcontener{
+	width:100%;
+}
+#Tmenu{
+
+vertical-align: top;
+}
+#Tmainpage{
+width:100%;
+}
+.TcTD{
+	padding:6px;
+}
+
+img {					border:0; margin:0px; padding:0px; margin-bottom:-4px;}
+table{					empty-cells: show; border-spacing:0px; border-collapse:collapse;}
+input	{				font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal; border-style: none; padding:1px;}
+textarea	{			font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal;}
+checkbox	{			font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal; padding: 2px;}
+select	{ font-family: Verdana, Arial, sans-serif; font-size: 10px; font-weight: normal; border-style: none; padding-right:1px;padding-left:1px;}
+option	{				font-family: Verdana, Arial, sans-serif;	font-size: 10px;	font-weight: normal;padding-right:1px;padding-left:1px;}
+td	{    				padding:1px; color: #525252; font-family: Verdana, Arial, sans-serif; font-size: 9px;	white-space: nowrap;}
+
+a	{					text-decoration: none;}
+a:hover	{				text-decoration: underline;}
+
+.Small{
+ text-align: center;
+}
+.pathWay{
+color:#5a5a5a;
+}
+ hr { 					border:0; color: #CCCCCC; background-color: #CCCCCC; height: 1px; margin-top:3px;}
+.imgPathWay {					border:0; margin:0px; padding:0px; margin-bottom:-2px;}
+
+#legend{
+display:none;
+text-align:left;
+}
+#tabLegend
+{
+width:100%;
+}
+
+#tabLegend td{
+background-color:F7FAFF;
+padding:2px;
+padding-right:5px;
+	BACKGROUND-COLOR: #E1EBFA;
+	BORDER-LEFT: 1px SOLID #F7FAFF;
+	BORDER-TOP: 1px SOLID #F7FAFF;
+	BORDER-RIGHT: 1px SOLID #ACBED8;
+	BORDER-BOTTOM: 1px SOLID #ACBED8;
+	PADDING: 1px;
+	PADDING-right: 3px;
+	PADDING-left: 3px;
+	FONT-SIZE: 11px;
+	COLOR: #454545;
+}
diff --git a/www/alt_error.php b/www/alt_error.php
new file mode 100644
index 0000000000000000000000000000000000000000..f98077b10ff1e0cbc6f53e924d8671f73fae6782
--- /dev/null
+++ b/www/alt_error.php
@@ -0,0 +1,22 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset($oreon))
+		exit();
+	
+	echo "<div class='msg' align='center'>".$lang['not_allowed']."</div>";
+?>
diff --git a/www/alt_main.php b/www/alt_main.php
new file mode 100644
index 0000000000000000000000000000000000000000..78bf81b5de6ca30ef38c1655aefed54dd8aec173
--- /dev/null
+++ b/www/alt_main.php
@@ -0,0 +1,99 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+
+	function return_color_health($h)	{
+		if ($h < 25)
+			return "#F5574C";
+		else if (($h >= 25) && ($h < 50))
+			return "#F5C425";
+		else if (($h >= 50) && ($h <= 75))
+			return "#FABF37";
+		else if ($h > 75)
+			return "#3BF541";
+	}
+	?>
+	<table border=0 width="100%" class="tabTableTitleHome">
+		<tr>
+			<td style="text-align:left;font-family:Arial, Helvetica, Sans-Serif;font-size:13px;padding-left:20px;font-weight: bold;"><? echo $lang['network_health']; ?></td>
+		</tr>
+	</table><!--
+	<table border=0 width="100%" class="tabTableHome" style="padding-top:8px;">
+		<tr>
+			<td width="100%" align="center" colspan="2">
+				<table border=0 width="100%" cellpadding="0" cellspacing="0" align="center">
+					<tr>
+						<td width="150" class="text10b" align="center" style="white-space: nowrap; padding-right: 3px;"><? echo $lang['host_health']; ?></td>
+						<td width="<? print $Logs->Host_health * 1.7 ; ?>" bgcolor="<? print return_color_health($Logs->Host_health); ?>" height="15"><? if ($Logs->Host_health != 0) print "<img src='./img/blank.gif' width='1' height='1'>"; ?></td>
+						<td width="<? print (100 - $Logs->Host_health) * 1.7  ; ?>" bgcolor="#999999"><? if ($Logs->Host_health != 100) print "<img src='./img/blank.gif' width='1' height='1'>"; ?></td>
+						<td width="15">&nbsp;</td>
+						<td width="150" class="text10b" align="center" style="white-space:nowrap; padding-right: 3px;"><? echo $lang['service_health']; ?></td>
+						<td width="<? print $Logs->Service_health * 1.7 ; ?>" bgcolor="<? print return_color_health($Logs->Service_health); ?>" height="15"><? if ($Logs->Service_health != 0) print "<img src='./img/blank.gif' width='1' height='1'>"; ?></td>
+						<td width="<? print (100 - $Logs->Service_health) * 1.7 ; ?>" bgcolor="#999999"><? if ($Logs->Service_health != 100) print "<img src='./img/blank.gif' width='1' height='1'>"; ?></td>
+						<td width="15">&nbsp;</td>
+					</tr>
+				</table><br>
+			</td>
+		</tr>
+		<tr>
+			<td width="100%" align="center" colspan="2">
+			<div style="width:720px;">	
+				<?
+					$total = $Logs->host["UP"] + $Logs->host["DOWN"] + $Logs->host["UNREACHABLE"] + $Logs->host["PENDING"];
+					$total_s = $Logs->sv["OK"] + $Logs->sv["WARNING"] + $Logs->sv["CRITICAL"] + $Logs->sv["PENDING"];
+					if ($total != 0){	
+						$data = array($Logs->host["UP"] * 100 / $total, $Logs->host["DOWN"] * 100 / $total, $Logs->host["UNREACHABLE"] * 100 / $total, $Logs->host["PENDING"] * 100 / $total);
+						$label = array("UP - ".$Logs->host["UP"], "DOWN - ".$Logs->host["DOWN"], "UNREA - ".$Logs->host["UNREACHABLE"], "PENDING - ".$Logs->host["PENDING"]);
+						$color = array($oreon->optGen->get_color_up(),$oreon->optGen->get_color_down(),$oreon->optGen->get_color_unreachable());
+						$x = 320;
+						$y = 150;
+						$sn = "Hosts health";
+						$fontcolor='000000';
+						$theme = "pastel";
+						$str = "<a href='./oreon.php?p=303&o=h'><img src='./include/reports/draw_graph_host.php?sn=$sn&coord_x=$x&coord_y=$y&fontcolor=";
+						$str .= "$fontcolor&theme=$theme&dataA=$data[0]&dataB=$data[1]&dataC=$data[2]&&colorA=$color[0]&colorB=$color[1]&colorC=$color[2]&labelA=$label[0]&labelB=$label[1]&labelC=$label[2]' border=0></a>";
+						print $str."&nbsp;&nbsp;&nbsp;";
+					} 
+					if ($total_s != 0){	
+						$data = array($Logs->sv["OK"] * 100 / $total_s, $Logs->sv["WARNING"] * 100 / $total_s, $Logs->sv["CRITICAL"] * 100 / $total_s, $Logs->sv["PENDING"] * 100 / $total_s, $Logs->sv["UNKNOWN"] * 100 / $total_s);
+						$label = array("OK - ".$Logs->sv["OK"], "WARNING - ".$Logs->sv["WARNING"], "CRITICAL - ".$Logs->sv["CRITICAL"], "PENDING - ".$Logs->sv["PENDING"], "UNKNOWN - ".$Logs->sv["UNKNOWN"]);
+						$color = array($oreon->optGen->get_color_ok(),$oreon->optGen->get_color_warning(),$oreon->optGen->get_color_critical(), $oreon->optGen->get_color_pending(), $oreon->optGen->get_color_unknown());
+						$x = 320;
+						$y = 150;
+						$sn = "Services health";
+						$fontcolor='000000';
+						$theme = "pastel";
+						$str = "<a href='./oreon.php?p=303&o=s'><img src='./include/reports/draw_graph_service.php?sn=$sn&coord_x=$x&coord_y=$y&fontcolor=";
+						$str .= "$fontcolor&theme=$theme&dataA=$data[0]&dataB=$data[1]&dataC=$data[2]&dataD=$data[3]&dataE=$data[4]&colorA=$color[0]&colorB=$color[1]&colorC=$color[2]&colorD=$color[3]&colorE=$color[4]&labelA=$label[0]&labelB=$label[1]&labelC=$label[2]&labelD=$label[3]&labelE=$label[4]' border=0></a>";
+					} else {
+						$str = "Stat not available for the moment.";
+					}
+					print $str;	
+			?>
+			</div>
+			</td>
+		</tr> 
+		<tr>
+			<td valign="top" style="padding-bottom: 15px;">
+					<? include ("./include/Stat/alt_main_hg.php"); ?>			
+					<? include ("./include/Stat/alt_main_sg.php"); ?>
+			</td>
+		</tr>
+	</table>
+	-->
\ No newline at end of file
diff --git a/www/class/Oreon.class.php b/www/class/Oreon.class.php
new file mode 100644
index 0000000000000000000000000000000000000000..1e7e9cdac8692755fcd59551a4677ee284f5e044
--- /dev/null
+++ b/www/class/Oreon.class.php
@@ -0,0 +1,100 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+require_once("User.class.php");
+
+class Oreon	{
+		
+	var $user;
+	var $Nagioscfg;
+	var $optGen;
+	var $redirectTo;
+	var $modules;
+	var $plugins;
+	var $status_graph_service;
+	var $status_graph_host;
+	
+	function Oreon($user = NULL, $pages = array())	{
+		global $pearDB;
+		
+		$this->user = $user;
+		
+		$this->initNagiosCFG($pearDB);
+		$this->initOptGen($pearDB);
+		
+		# Grab Modules
+		$this->modules = array();
+		$handle = opendir("./modules");	
+		while (false !== ($filename = readdir($handle)))	{
+			if ($filename != "." && $filename != "..")	{
+				$this->modules[$filename]["name"] = $filename;
+				if (is_dir("./modules/".$filename."/generate_files/"))
+					$this->modules[$filename]["gen"] = true;
+				else
+					$this->modules[$filename]["gen"] = false;
+				if (is_dir("./modules/".$filename."/sql/"))
+					$oreon->modules[$filename]["sql"] = true;
+				else
+					$this->modules[$filename]["sql"] = false;
+				if (is_dir("./modules/".$filename."/lang/"))
+					$this->modules[$filename]["lang"] = true;
+				else
+					$this->modules[$filename]["lang"] = false;
+			}
+		}
+		closedir($handle);
+		
+		# Grab Plugins Name
+		$this->plugins = array();
+		$handle = array();
+		$handle[0] = opendir($this->optGen["nagios_path_plugins"]);
+		$this->return_plugin($this->optGen["nagios_path_plugins"]);
+		closedir($handle[0]);
+	}
+	
+	function return_plugin($rep){
+		$is_not_a_plugin = array("."=>".", ".."=>"..", "oreon.conf"=>"oreon.conf", "oreon.pm"=>"oreon.pm", "utils.pm"=>"utils.pm", "negate"=>"negate");
+		$handle[$rep] = opendir($rep);
+		while (false !== ($filename = readdir($handle[$rep]))){
+			if ($filename != "." && $filename != ".."){
+				if (is_dir($rep.$filename)){
+					$this->return_plugin($rep."/".$filename, $handle[$rep]);
+				} else if (!array_key_exists($filename, $is_not_a_plugin) && substr($filename, -1)!= "~"){
+					$key = substr($rep."/".$filename, strlen($this->optGen["nagios_path_plugins"]));
+					$this->plugins[$key] = $key;
+				}
+			}
+		}
+		closedir($handle[$rep]);
+	}
+	
+	function initNagiosCFG($pearDB = NULL)	{
+		if (!$pearDB)	return;
+		$this->Nagioscfg = array();
+		$res =& $pearDB->query("SELECT * FROM `cfg_nagios` WHERE `nagios_activate` = '1' LIMIT 1");
+		$this->Nagioscfg = $res->fetchRow();	
+	}
+	
+	function initOptGen($pearDB = NULL)	{
+		if (!$pearDB)	return;
+		$this->optGen = array();
+		$res =& $pearDB->query("SELECT * FROM `general_opt` LIMIT 1");
+		$this->optGen = $res->fetchRow();	
+	}
+}
+?>
\ No newline at end of file
diff --git a/www/class/Session.class.php b/www/class/Session.class.php
new file mode 100644
index 0000000000000000000000000000000000000000..aac45cf467278efa6dd935f41bada549e38c99a8
--- /dev/null
+++ b/www/class/Session.class.php
@@ -0,0 +1,60 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+class Session
+{
+	// Attributes
+	
+	// Associations
+	
+	// Operations
+	
+	function start()
+	{
+		session_start();
+	}
+	
+	function stop()
+	{
+		session_unset();
+		session_destroy();
+	}
+	
+	function restart()
+	{
+		$this->stop();
+		$this->start();
+	}
+	
+	function s_unset()
+	{
+		session_unset();
+	}
+	
+	function unregister_var($register_var)
+	{
+		session_unregister($register_var);
+	}
+  
+	function register_var ($register_var) 
+	{
+		session_register($register_var);
+	}
+	
+} /* end class Session */
+?>
diff --git a/www/class/User.class.php b/www/class/User.class.php
new file mode 100644
index 0000000000000000000000000000000000000000..027cc67d2a8a97f699a76bfa718962a9389f71f1
--- /dev/null
+++ b/www/class/User.class.php
@@ -0,0 +1,227 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+class User	{
+
+  var $user_id;
+  var $name;    
+  var $alias;
+  var $passwd;
+  var $email;
+  var $lang;
+  var $version;
+  var $admin;
+  
+  ## User LCA
+  # Array with elements ID for loop test
+  var $lcaHost;
+  var $lcaHostGroup;
+  var $lcaServiceGroup;
+  var $lcaTopo;
+  # String with elements ID separated by commas for DB requests
+  var $lcaHStr;
+  var $lcaHGStr;
+  var $lcaSGStr;
+  var $lcaTStr;
+  # String with elements Name separated by commas for DB requests
+  var $lcaHStrName;
+  var $lcaHGStrName;
+  var $lcaSGStrName;
+ 
+  function User($user = array(), $nagios_version = NULL)  {
+	$this->user_id = $user["contact_id"];
+	$this->name = html_entity_decode($user["contact_name"], ENT_QUOTES);
+	$this->alias = html_entity_decode($user["contact_alias"], ENT_QUOTES);
+	$this->email = html_entity_decode($user["contact_email"], ENT_QUOTES);
+	$this->lang = $user["contact_lang"];
+	$this->passwd = $user["contact_passwd"];
+	$this->admin = $user["contact_admin"];
+	$this->version = $nagios_version;
+  	$this->lcaHost = array();
+  	$this->lcaHostGroup = array();
+  	$this->lcaServiceGroup = array();
+  	$this->lcaTopo = array();
+  }
+  
+  function createLCA($pearDB = NULL)	{
+  	if(!$pearDB)
+  		return; 
+	if ($this->admin)	{
+		$res3 =& $pearDB->query("SELECT DISTINCT host_id, host_name FROM host");
+		while ($res3->fetchInto($host))
+			$this->lcaHost[$host["host_id"]] = $host["host_name"];
+	 	$res3 =& $pearDB->query("SELECT DISTINCT hg_id, hg_name FROM hostgroup");	
+		while ($res3->fetchInto($hostGroup))
+			$this->lcaHostGroup[$hostGroup["hg_id"]] = $hostGroup["hg_name"];
+		$res3 =& $pearDB->query("SELECT sg_id, sg_name FROM servicegroup");	
+		while ($res3->fetchInto($serviceGroup))
+			$this->lcaServiceGroup[$serviceGroup["sg_id"]] = $serviceGroup["sg_name"];
+		$res3 =& $pearDB->query("SELECT topology_id FROM topology");	
+		while ($res3->fetchInto($topo))
+			$this->lcaTopo[$topo["topology_id"]] = $topo["topology_id"];			
+		unset($res3);
+	}
+	else	{
+		$have_an_lca = false;
+		$res1 =& $pearDB->query("SELECT contactgroup_cg_id FROM contactgroup_contact_relation WHERE contact_contact_id = '".$this->user_id."'");
+		if ($res1->numRows())	{
+			while($res1->fetchInto($contactGroup))	{
+			 	$res2 =& $pearDB->query("SELECT lca.lca_id, lca.lca_hg_childs FROM lca_define_contactgroup_relation ldcgr, lca_define lca WHERE ldcgr.contactgroup_cg_id = '".$contactGroup["contactgroup_cg_id"]."' AND ldcgr.lca_define_lca_id = lca.lca_id AND lca.lca_activate = '1'");	
+				 if ($res2->numRows())	{
+					while ($res2->fetchInto($lca))	{
+						$have_an_lca = true;
+					 	$res3 =& $pearDB->query("SELECT DISTINCT host_id, host_name FROM host, lca_define_host_relation ldr WHERE lca_define_lca_id = '".$lca["lca_id"]."' AND host_id = ldr.host_host_id");
+						while ($res3->fetchInto($host))
+							$this->lcaHost[$host["host_id"]] = $host["host_name"];
+					 	$res3 =& $pearDB->query("SELECT DISTINCT hg_id, hg_name FROM hostgroup, lca_define_hostgroup_relation WHERE lca_define_lca_id = '".$lca["lca_id"]."' AND hg_id = hostgroup_hg_id");	
+						while ($res3->fetchInto($hostGroup))	{
+							$this->lcaHostGroup[$hostGroup["hg_id"]] = $hostGroup["hg_name"];
+							# Apply the LCA to hosts contains in
+							if ($lca["lca_hg_childs"])	{
+								$res4 =& $pearDB->query("SELECT h.host_name, hgr.host_host_id FROM hostgroup_relation hgr, host h WHERE hgr.hostgroup_hg_id = '".$hostGroup["hg_id"]."' AND h.host_id = hgr.host_host_id");	
+								while ($res4->fetchInto($host))	
+									$this->lcaHost[$host["host_host_id"]] = $host["host_name"];
+							}
+						}
+					 	$res3 =& $pearDB->query("SELECT sg_id, sg_name FROM servicegroup, lca_define_servicegroup_relation WHERE lca_define_lca_id = '".$lca["lca_id"]."' AND sg_id = servicegroup_sg_id");	
+						while ($res3->fetchInto($serviceGroup))
+							$this->lcaServiceGroup[$serviceGroup["sg_id"]] = $serviceGroup["sg_name"];
+						unset($res3);
+					 	$res3 =& $pearDB->query("SELECT topology_topology_id FROM lca_define_topology_relation WHERE lca_define_lca_id = '".$lca["lca_id"]."'");	
+						while ($res3->fetchInto($topo))
+							$this->lcaTopo[$topo["topology_topology_id"]] = $topo["topology_topology_id"];
+						unset($res3);
+					}
+				}
+			}
+		}
+		if (!$res1->numRows() || !$have_an_lca) {
+			$res3 =& $pearDB->query("SELECT DISTINCT host_id, host_name FROM host");	
+			while ($res3->fetchInto($host))
+				$this->lcaHost[$host["host_id"]] = $host["host_name"];
+		 	$res3 =& $pearDB->query("SELECT DISTINCT hg_id, hg_name FROM hostgroup");	
+			while ($res3->fetchInto($hostGroup))
+				$this->lcaHostGroup[$hostGroup["hg_id"]] = $hostGroup["hg_name"];
+			$res3 =& $pearDB->query("SELECT sg_id, sg_name FROM servicegroup");	
+			while ($res3->fetchInto($serviceGroup))
+				$this->lcaServiceGroup[$serviceGroup["sg_id"]] = $serviceGroup["sg_name"];
+			$res3 =& $pearDB->query("SELECT topology_id FROM topology");	
+			while ($res3->fetchInto($topo))
+				$this->lcaTopo[$topo["topology_id"]] = $topo["topology_id"];			
+			unset($res3);			
+		}
+		unset($res1);
+	}
+	
+   	# Have the LCA in both format : String or Array
+   	
+  	$this->lcaHStr = NULL;
+  	$this->lcaHStrName = NULL;
+  	foreach ($this->lcaHost as $key=>$value)	{
+  		$this->lcaHStr ? $this->lcaHStr .= ", ".$key : $this->lcaHStr = $key;
+  		$this->lcaHStrName ? $this->lcaHStrName .= ", ".$value : $this->lcaHStrName = $value;
+  	}
+  	if (!$this->lcaHStr) $this->lcaHStr = '\'\'';
+  	if (!$this->lcaHStrName) $this->lcaHStrName = '\'\'';
+ 
+  	$this->lcaHGStr = NULL;
+  	$this->lcaHGStrName = NULL;
+  	foreach ($this->lcaHostGroup as $key=>$value)	{
+  		$this->lcaHGStr ? $this->lcaHGStr .= ", ".$key : $this->lcaHGStr = $key;
+  		$this->lcaHGStrName ? $this->lcaHGStrName .= ", ".$value : $this->lcaHGStrName = $value;
+  	}
+  	if (!$this->lcaHGStr) $this->lcaHGStr = '\'\'';
+  	if (!$this->lcaHGStrName) $this->lcaHGStrName = '\'\'';
+
+ 	$this->lcaSGStr = NULL;
+ 	$this->lcaSGStrName = NULL;
+  	foreach ($this->lcaServiceGroup as $key=>$value)	{
+  		$this->lcaSGStr ? $this->lcaSGStr .= ", ".$key : $this->lcaSGStr = $key;
+  		$this->lcaSGStrName ? $this->lcaSGStrName .= ", ".$value : $this->lcaSGStrName = $value;
+  	}
+  	if (!$this->lcaSGStr) $this->lcaSGStr = '\'\'';
+  	if (!$this->lcaSGStrName) $this->lcaSGStrName = '\'\'';
+  	
+  	$this->lcaTStr = NULL;
+  	foreach ($this->lcaTopo as $tmp)
+  		$this->lcaTStr ? $this->lcaTStr .= ", ".$tmp : $this->lcaTStr = $tmp;
+  	if (!$this->lcaTStr) $this->lcaTStr = '\'\'';
+  }
+  
+  // Get
+  
+  function get_id(){
+  	return $this->user_id;
+  }
+  
+  function get_name(){
+  	return $this->name;
+  }
+    
+  function get_email(){
+  	return $this->email;
+  }
+  
+  function get_alias(){
+  	return $this->alias;
+  }
+  
+  function get_version()	{
+  	return $this->version;
+  } 
+  
+  function get_lang(){
+  	return $this->lang;
+  }
+  
+  function get_passwd(){
+  	return $this->passwd;
+  }
+  
+  function get_admin(){
+  	return $this->admin;
+  }
+   
+  // Set
+  
+  function set_id($id)	{
+  	$this->user_id = $id;
+  }
+  
+  function set_name($name)	{
+  	$this->name = $name;
+  }
+    
+  function set_email($email)	{
+  	$this->email = $email;
+  }
+  
+  function set_lang($lang)	{
+  	$this->lang = $lang;
+  }
+  
+  function set_alias($alias)	{
+  	$this->alias = $alias;
+  }
+  
+  function set_version($version)	{
+  	$this->version = $version;
+  }
+  
+} /* end class User */
+?>
diff --git a/www/class/other.class.php b/www/class/other.class.php
new file mode 100644
index 0000000000000000000000000000000000000000..dfaf992bc88b31339b42b0712c48dc86ac6b3671
--- /dev/null
+++ b/www/class/other.class.php
@@ -0,0 +1,80 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+
+class Duration
+{
+	function toString ($duration, $periods = null)
+    {
+        if (!is_array($duration)) {
+            $duration = Duration::int2array($duration, $periods);
+        }
+        return Duration::array2string($duration);
+    }
+ 
+    function int2array ($seconds, $periods = null)
+    {        
+        // Define time periods
+        if (!is_array($periods)) {
+            $periods = array (
+                    'y'	=> 31556926,
+                    'M' => 2629743,
+                    'w' => 604800,
+                    'd' => 86400,
+                    'h' => 3600,
+                    'm' => 60,
+                    's' => 1
+                    );
+        }
+ 
+        // Loop
+        $seconds = (int) $seconds;
+        foreach ($periods as $period => $value) {
+            $count = floor($seconds / $value);
+ 
+            if ($count == 0) {
+                continue;
+            }
+ 
+            $values[$period] = $count;
+            $seconds = $seconds % $value;
+        }
+ 
+        // Return
+        if (empty($values)) {
+            $values = null;
+        }
+ 
+        return $values;
+    }
+ 
+    function array2string ($duration)
+    {
+        if (!is_array($duration)) {
+            return false;
+        }
+        foreach ($duration as $key => $value) {
+            $segment = $value . '' . $key;
+            $array[] = $segment;
+        }
+        $str = implode(' ', $array);
+        return $str;
+    }
+}
+ 
+?>
+
diff --git a/www/footer.php b/www/footer.php
new file mode 100644
index 0000000000000000000000000000000000000000..6220fe47c7ac3d77d22a723ede3bbbbb7adc6a0a
--- /dev/null
+++ b/www/footer.php
@@ -0,0 +1,57 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+?>
+		<div id="footer">
+		<table cellpadding="0" cellspacing="0" height="1" width='100%'>
+			<tr>
+				<td id="footerline1"></td>
+			</tr>
+			<tr>
+				<td id="footerline2"></td>
+			</tr>
+		</table>
+		<table cellpadding='0' cellspacing='0' width='100%' border='0'>
+			<tr>
+				<td align='center' class='copyRight'>
+					Generated in <? $time_end = microtime_float(); $now = $time_end - $time_start; print round($now,3) . $lang["time_sec"]; ?><br />
+					<a href="mailto:infos@oreon-project.org" class="text10b">Oreon</a> -
+					<a href="http://www.nagios.org" class="text10b">Nagios</a> -
+					&copy; 2004-2006 <a href="http://www.oreon-project.org" target="_blank" class="text10b">Oreon</a> All Rights Reserved.<br />
+				</td>
+			</tr>
+			<tr>
+				<td align="center" style="padding-top:5px;"><div class='footer'>
+				<a href='http://www.oreon-project.org'><img src="<? echo $skin; ?>Images/footer/colophon_css.png"
+				          height="15" width="80" alt="Valid CSS"
+				          title="Oreon was built with valid CSS." />
+				<a href='http://www.php.net'><img src="<? echo $skin; ?>Images/footer/button-php.gif"
+				          height="15" width="80" alt="Powered By PHP"
+				          title="Powered By PHP." /></a>
+				<a href='http://sourceforge.net/donate/index.php?group_id=140316'><img src="<? echo $skin; ?>Images/footer/button-donate.gif"
+				          height="15" width="80" alt="Donate"
+				          title="Donate" /></a>
+				<a href='http://www.gnu.org/licenses/gpl.txt'><img src="<? echo $skin; ?>Images/footer/button-gpl.gif"
+				          height="15" width="80" alt="GPL Licenced"
+				          title="GPL Licenced" /></a>
+				</div>
+				</td>
+			</tr>
+		</table>
+		</div>
+</body>
+</html>
diff --git a/www/header.php b/www/header.php
new file mode 100644
index 0000000000000000000000000000000000000000..3c1e870263cbc4a951646843550e87a8e0785e4a
--- /dev/null
+++ b/www/header.php
@@ -0,0 +1,178 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	# Bench
+	function microtime_float() 	{
+	   list($usec, $sec) = explode(" ", microtime());
+	   return ((float)$usec + (float)$sec);
+	}
+
+	set_time_limit(60);
+
+	$time_start = microtime_float();
+
+	# Define
+	define('SMARTY_DIR', '../GPL_LIB/Smarty/libs/');
+
+	# Include
+	require_once ("./oreon.conf.php");
+	require_once("DBconnect.php");
+	require_once ("$classdir/Session.class.php");
+	require_once ("$classdir/Oreon.class.php");
+	require_once (SMARTY_DIR."Smarty.class.php");
+
+    # Cut Page ID
+	$level1 = NULL;
+	$level2 = NULL;
+	$level3 = NULL;
+	switch (strlen($p))	{
+		case 1 :  $level1= $p; break;
+		case 3 :  $level1 = substr($p, 0, 1); $level2 = substr($p, 1, 2); $level3 = substr($p, 3, 2); break;
+		case 5 :  $level1 = substr($p, 0, 1); $level2 = substr($p, 1, 2); $level3 = substr($p, 3, 2); break;
+		case 6 :  $level1 = substr($p, 0, 2); $level2 = substr($p, 2, 2); $level3 = substr($p, 3, 2); break;
+		default : $level1= $p; break;
+	}
+
+
+   	Session::start();
+	if (version_compare(phpversion(), '5.0') < 0) {
+	    eval('
+	    function clone($object) {
+	      return $object;
+	    }
+	    ');
+	  }  
+
+	if (isset($_POST["export_sub_list"])) {
+		$mime_type = 'text/x-text';
+		if (!strcmp($_GET['p'], "2"))
+			$mime_type .= 'image/jpeg';
+		$filename = "oreon_" . date("Y-m-d") . ".sql";
+		// Send headers
+		header('Content-Type: '.$mime_type);
+		// IE need specific headers
+		if (stristr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
+			header("Content-Disposition: inline; filename=\"".$filename."\"");
+			header('Expires: 0');
+			header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+			header('Pragma: public');
+		} else {
+			header('Content-Disposition: attachment; filename="'.$filename.'"');
+			header('Expires: 0');
+			header('Pragma: no-cache');
+		}
+		if (isset($_POST["s"]) && ($_POST["s"] == 1 || $_POST["s"] == 2 || $_POST["s"] == 4))	{
+			include("./include/options/db/extractDB/extract_sub.php");exit();}
+	} else {
+
+		# Skin path
+		
+		$res =& $pearDB->query("SELECT template FROM general_opt LIMIT 1");
+		$res->fetchInto($data);
+		$skin = "./Themes/".$data["template"]."/";
+		
+		// Delete Session Expired
+
+		$res =& $pearDB->query("SELECT session_expire FROM general_opt LIMIT 1");
+		$session_expire =& $res->fetchRow();
+
+		$time_limit = time() - ($session_expire["session_expire"] * 60);
+
+		$res =& $pearDB->query("SELECT * FROM session WHERE last_reload < '".$time_limit."'");
+		while ($session =& $res->fetchRow())
+			$pearDB->query("DELETE FROM session WHERE session_id = '".$session["session_id"]."'");
+
+		// Get session and Check if session is not expired
+
+		$res =& $pearDB->query("SELECT user_id FROM session WHERE `session_id` = '".session_id()."'");
+
+		if (!$res->numRows())
+			header("Location: index.php?disconnect=2");
+		if (!isset($_SESSION["oreon"]))
+			header("Location: index.php?disconnect=1");
+
+		// Define Oreon var alias
+
+		global $oreon;
+		$oreon =& $_SESSION["oreon"];
+
+		# Init differents elements we need in a lot of pages
+		$oreon->user->createLCA($pearDB);
+		$oreon->initNagiosCFG($pearDB);
+		$oreon->initOptGen($pearDB);
+
+		// Update Session Table For last_reload and current_page row
+		$res =& $pearDB->query("UPDATE `session` SET `current_page` = '".$level1.$level2.$level3."',`last_reload` = '".time()."', `ip_address` = '".$_SERVER["REMOTE_ADDR"]."' WHERE CONVERT( `session_id` USING utf8 ) = '".session_id()."' AND `user_id` = '".$oreon->user->user_id."' LIMIT 1");
+		if (PEAR::isError($res))
+			print ($res->getMessage());
+
+		// Load traduction in the selected language.
+		is_file ("./lang/".$oreon->user->get_lang().".php") ? include_once ("./lang/".$oreon->user->get_lang().".php") : include_once ("./lang/en.php");
+		is_file ("./include/configuration/lang/".$oreon->user->get_lang().".php") ? include_once ("./include/configuration/lang/".$oreon->user->get_lang().".php") : include_once ("./include/configuration/lang/en.php");
+		is_file ("./include/monitoring/lang/".$oreon->user->get_lang().".php") ? include_once ("./include/monitoring/lang/".$oreon->user->get_lang().".php") : include_once ("./include/monitoring/lang/en.php");
+		is_file ("./include/options/lang/".$oreon->user->get_lang().".php") ? include_once ("./include/options/lang/".$oreon->user->get_lang().".php") : include_once ("./include/options/lang/en.php");
+		is_file ("./include/reporting/lang/".$oreon->user->get_lang().".php") ? include_once ("./include/reporting/lang/".$oreon->user->get_lang().".php") : include_once ("./include/reporting/lang/en.php");
+		is_file ("./include/views/lang/".$oreon->user->get_lang().".php") ? include_once ("./include/views/lang/".$oreon->user->get_lang().".php") : include_once ("./include/views/lang/en.php");
+		is_file ("./include/tools/lang/".$oreon->user->get_lang().".php") ? include_once ("./include/tools/lang/".$oreon->user->get_lang().".php") : include_once ("./include/tools/lang/en.php");
+
+		foreach ($oreon->modules as $module)
+			$module["lang"] ? (is_file ("./modules/".$module["name"]."/lang/".$oreon->user->get_lang().".php") ? include_once ("./modules/".$module["name"]."/lang/".$oreon->user->get_lang().".php") : include_once ("./modules/".$module["name"]."/lang/en.php")) : NULL;
+		print "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";
+
+        $mlang = $oreon->user->get_lang();
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<? echo $mlang; ?>" lang="<? echo $mlang; ?>">
+<head>
+<title>Supervision Tool - Powered By Oreon</title>
+<link rel="shortcut icon" href="./img/iconOreon.ico"/>
+<link rel="stylesheet" type="text/css" href="./include/common/javascript/autocompletion.css" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
+<link href="<? echo $skin; ?>style.css" rel="stylesheet" type="text/css"/>
+<link href="<? echo $skin; ?>menu.css" rel="stylesheet" type="text/css"/>
+<link href="<? echo $skin; ?>configuration_form.css" rel="stylesheet" type="text/css"/>
+<link href="<? echo $skin; ?>color<? echo $level1; ?>.css" rel="stylesheet" type="text/css"/>
+<?
+	// Add Template CSS for sysInfos Pages
+
+	if (isset($p) && !strcmp($p, "505") && file_exists("./include/options/sysInfos/templates/classic/classic.css"))
+	  echo "  <link rel=\"stylesheet\" type=\"text/css\" href=\"./include/options/sysInfos/templates/classic/classic.css\">\n";
+
+	if (isset($p) && $p == 310)
+		print "<SCRIPT language='javascript' src='./include/common/javascript/datepicker.js'></SCRIPT>";
+
+	if (isset($p) && $p == 520){?>
+	<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
+		function isAbsRelVisible() {
+		  if (document.graph.timerange[1].checked) showAbsolute();
+		  else showRelative();
+		}
+		function showAbsolute() {
+		   Abs.style.visibility="visible";
+		   Rel.style.visibility="hidden";
+		}
+		function showRelative() {
+		   Abs.style.visibility="hidden";
+		   Rel.style.visibility="visible";
+		}
+	</SCRIPT>
+<?	} ?>
+</head>
+<body>
+<? } ?>
\ No newline at end of file
diff --git a/www/img/LogoOreon.png b/www/img/LogoOreon.png
new file mode 100644
index 0000000000000000000000000000000000000000..facbe1a3c5da95d12b85089768838df169bc4e4c
Binary files /dev/null and b/www/img/LogoOreon.png differ
diff --git a/www/img/bg_banner.gif b/www/img/bg_banner.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1149381ccc8b1d2d3e750386e8bfe6a5e0e6b559
Binary files /dev/null and b/www/img/bg_banner.gif differ
diff --git a/www/img/iconOreon.ico b/www/img/iconOreon.ico
new file mode 100644
index 0000000000000000000000000000000000000000..ed8b91eec83115de4e4eca62d24547a3c4658ec9
Binary files /dev/null and b/www/img/iconOreon.ico differ
diff --git a/www/img/icones/12x12/alert.gif b/www/img/icones/12x12/alert.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2eb7d99ad46625c0ffa274419ac3fb04e5d91a0b
Binary files /dev/null and b/www/img/icones/12x12/alert.gif differ
diff --git a/www/img/icones/12x12/doublearrowsnav.gif b/www/img/icones/12x12/doublearrowsnav.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e70cd9796296c414fe7603990fa2db5d8420f6f4
Binary files /dev/null and b/www/img/icones/12x12/doublearrowsnav.gif differ
diff --git a/www/img/icones/12x12/info.gif b/www/img/icones/12x12/info.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5c864e9d6628bfc04c2adf90d5339473301d3bf4
Binary files /dev/null and b/www/img/icones/12x12/info.gif differ
diff --git a/www/img/icones/12x12/queue.gif b/www/img/icones/12x12/queue.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b41726eadddbdf7a7ab9f949eb3832439a9522ff
Binary files /dev/null and b/www/img/icones/12x12/queue.gif differ
diff --git a/www/img/icones/12x12/recovery.gif b/www/img/icones/12x12/recovery.gif
new file mode 100644
index 0000000000000000000000000000000000000000..274abe0d747157947bcce933943fd48edfe1319a
Binary files /dev/null and b/www/img/icones/12x12/recovery.gif differ
diff --git a/www/img/icones/14x14/gears_pause.gif b/www/img/icones/14x14/gears_pause.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b8bdb3c9da0a11541e968b9cc352cd8ae1913ab1
Binary files /dev/null and b/www/img/icones/14x14/gears_pause.gif differ
diff --git a/www/img/icones/14x14/gears_stop.gif b/www/img/icones/14x14/gears_stop.gif
new file mode 100644
index 0000000000000000000000000000000000000000..193d25ecdf02c402ed51d8093bddbba3df9503ef
Binary files /dev/null and b/www/img/icones/14x14/gears_stop.gif differ
diff --git a/www/img/icones/14x14/noloudspeaker.gif b/www/img/icones/14x14/noloudspeaker.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c46b05bca04b76dc0acab011aaf03d5c752a4900
Binary files /dev/null and b/www/img/icones/14x14/noloudspeaker.gif differ
diff --git a/www/img/icones/14x14/undo.gif b/www/img/icones/14x14/undo.gif
new file mode 100644
index 0000000000000000000000000000000000000000..367954edaa0b47b54a219b06ba0f909e17af3b7a
Binary files /dev/null and b/www/img/icones/14x14/undo.gif differ
diff --git a/www/img/icones/14x14/wrench.gif b/www/img/icones/14x14/wrench.gif
new file mode 100644
index 0000000000000000000000000000000000000000..df9ac2ab6f7f833b4123d98540b40838d9b0098c
Binary files /dev/null and b/www/img/icones/14x14/wrench.gif differ
diff --git a/www/img/icones/16x16/about.gif b/www/img/icones/16x16/about.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3363b4f91feef255625ff6286bd674d57b0d9229
Binary files /dev/null and b/www/img/icones/16x16/about.gif differ
diff --git a/www/img/icones/16x16/alert.gif b/www/img/icones/16x16/alert.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2e5d84dc723d6b6a988a8da1650636300f2cb4ad
Binary files /dev/null and b/www/img/icones/16x16/alert.gif differ
diff --git a/www/img/icones/16x16/application_lock.gif b/www/img/icones/16x16/application_lock.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3f12d804da2143a5297e6cfcab3d59cf10db9246
Binary files /dev/null and b/www/img/icones/16x16/application_lock.gif differ
diff --git a/www/img/icones/16x16/arrow_down_green.gif b/www/img/icones/16x16/arrow_down_green.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e1396602e1c058b7c2d487f71eb313a12752f946
Binary files /dev/null and b/www/img/icones/16x16/arrow_down_green.gif differ
diff --git a/www/img/icones/16x16/arrow_left_blue.png b/www/img/icones/16x16/arrow_left_blue.png
new file mode 100644
index 0000000000000000000000000000000000000000..8b5a2727016bb6814099623250298f4b68fbc936
Binary files /dev/null and b/www/img/icones/16x16/arrow_left_blue.png differ
diff --git a/www/img/icones/16x16/arrow_right_blue.png b/www/img/icones/16x16/arrow_right_blue.png
new file mode 100644
index 0000000000000000000000000000000000000000..3d38d632b835d80dd109c56c0b82e6633816bc30
Binary files /dev/null and b/www/img/icones/16x16/arrow_right_blue.png differ
diff --git a/www/img/icones/16x16/arrow_up_green.gif b/www/img/icones/16x16/arrow_up_green.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2067b82868deb25e788a92574d076e7bcf70510d
Binary files /dev/null and b/www/img/icones/16x16/arrow_up_green.gif differ
diff --git a/www/img/icones/16x16/book_green.gif b/www/img/icones/16x16/book_green.gif
new file mode 100644
index 0000000000000000000000000000000000000000..aaa5448c49cfd22edd5ed98b713d2129f4527895
Binary files /dev/null and b/www/img/icones/16x16/book_green.gif differ
diff --git a/www/img/icones/16x16/book_yellow.gif b/www/img/icones/16x16/book_yellow.gif
new file mode 100644
index 0000000000000000000000000000000000000000..232fb492f172a21882f7681f60ee8855a1aba8d6
Binary files /dev/null and b/www/img/icones/16x16/book_yellow.gif differ
diff --git a/www/img/icones/16x16/bookmark.gif b/www/img/icones/16x16/bookmark.gif
new file mode 100644
index 0000000000000000000000000000000000000000..180710ac09c0594c3e45ba1e93cf77d969dea9d5
Binary files /dev/null and b/www/img/icones/16x16/bookmark.gif differ
diff --git a/www/img/icones/16x16/bookmarks.gif b/www/img/icones/16x16/bookmarks.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b59d883cae96af1a98fe2a370f3614262134e1b5
Binary files /dev/null and b/www/img/icones/16x16/bookmarks.gif differ
diff --git a/www/img/icones/16x16/branch_element.gif b/www/img/icones/16x16/branch_element.gif
new file mode 100644
index 0000000000000000000000000000000000000000..46c27628f450759ab5905cf7d13ad0ce6d26a47a
Binary files /dev/null and b/www/img/icones/16x16/branch_element.gif differ
diff --git a/www/img/icones/16x16/breakpoint_run.gif b/www/img/icones/16x16/breakpoint_run.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a207c7852a9416013ae3de6501fb4a05263ac598
Binary files /dev/null and b/www/img/icones/16x16/breakpoint_run.gif differ
diff --git a/www/img/icones/16x16/businessmen.gif b/www/img/icones/16x16/businessmen.gif
new file mode 100644
index 0000000000000000000000000000000000000000..276c6c9cf6800852aa5052f69f42ede25a4f515c
Binary files /dev/null and b/www/img/icones/16x16/businessmen.gif differ
diff --git a/www/img/icones/16x16/calendar.gif b/www/img/icones/16x16/calendar.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5841f5528b68b0f3c892652209345f52e6d7a2cd
Binary files /dev/null and b/www/img/icones/16x16/calendar.gif differ
diff --git a/www/img/icones/16x16/cd_gold.gif b/www/img/icones/16x16/cd_gold.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9f2a5216a1b17dad0f774cc5b47ba2c281f8074e
Binary files /dev/null and b/www/img/icones/16x16/cd_gold.gif differ
diff --git a/www/img/icones/16x16/chart.gif b/www/img/icones/16x16/chart.gif
new file mode 100644
index 0000000000000000000000000000000000000000..131ea7fa591444f2097bc1c98d8791facdfe3814
Binary files /dev/null and b/www/img/icones/16x16/chart.gif differ
diff --git a/www/img/icones/16x16/client_network.gif b/www/img/icones/16x16/client_network.gif
new file mode 100644
index 0000000000000000000000000000000000000000..84151c4cb57d0b35a67e00e6e9be20df689d708e
Binary files /dev/null and b/www/img/icones/16x16/client_network.gif differ
diff --git a/www/img/icones/16x16/clients.gif b/www/img/icones/16x16/clients.gif
new file mode 100644
index 0000000000000000000000000000000000000000..39f652dc6560e7dec9ea3c75929fd749364a253b
Binary files /dev/null and b/www/img/icones/16x16/clients.gif differ
diff --git a/www/img/icones/16x16/clipboard.gif b/www/img/icones/16x16/clipboard.gif
new file mode 100644
index 0000000000000000000000000000000000000000..61fcd39787bcce412fb24b4e37abf8a9eca8551e
Binary files /dev/null and b/www/img/icones/16x16/clipboard.gif differ
diff --git a/www/img/icones/16x16/column-chart.gif b/www/img/icones/16x16/column-chart.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7d8ee96350a3a310d97bd65484ad9952197e8583
Binary files /dev/null and b/www/img/icones/16x16/column-chart.gif differ
diff --git a/www/img/icones/16x16/component_add.gif b/www/img/icones/16x16/component_add.gif
new file mode 100644
index 0000000000000000000000000000000000000000..8b301cd69ad24a42b4aa0afb7e8e74e4bcdf29ae
Binary files /dev/null and b/www/img/icones/16x16/component_add.gif differ
diff --git a/www/img/icones/16x16/component_green.gif b/www/img/icones/16x16/component_green.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6e4b4e0f5c6b448ab621511e03df9739969d021d
Binary files /dev/null and b/www/img/icones/16x16/component_green.gif differ
diff --git a/www/img/icones/16x16/cookies.gif b/www/img/icones/16x16/cookies.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3fb0074de5e1316284048bf4eaa1bd6d5cf47a96
Binary files /dev/null and b/www/img/icones/16x16/cookies.gif differ
diff --git a/www/img/icones/16x16/data_down.gif b/www/img/icones/16x16/data_down.gif
new file mode 100644
index 0000000000000000000000000000000000000000..af2a70fd25017689a68b0213b216aaca3bc7c75b
Binary files /dev/null and b/www/img/icones/16x16/data_down.gif differ
diff --git a/www/img/icones/16x16/date-time_preferences.gif b/www/img/icones/16x16/date-time_preferences.gif
new file mode 100644
index 0000000000000000000000000000000000000000..bb6fa9e93639fec674c68ee026d9dc957e330c7c
Binary files /dev/null and b/www/img/icones/16x16/date-time_preferences.gif differ
diff --git a/www/img/icones/16x16/delete.gif b/www/img/icones/16x16/delete.gif
new file mode 100644
index 0000000000000000000000000000000000000000..fcb80c6e750c216243daa650f9e3a0f3159114fc
Binary files /dev/null and b/www/img/icones/16x16/delete.gif differ
diff --git a/www/img/icones/16x16/delete2.gif b/www/img/icones/16x16/delete2.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4a9dd334ae638b22845e4f2bd75c0d81376f4022
Binary files /dev/null and b/www/img/icones/16x16/delete2.gif differ
diff --git a/www/img/icones/16x16/document_edit.gif b/www/img/icones/16x16/document_edit.gif
new file mode 100644
index 0000000000000000000000000000000000000000..bc3e818126eb2a9f52fa1ce83eb2bfc76f85117e
Binary files /dev/null and b/www/img/icones/16x16/document_edit.gif differ
diff --git a/www/img/icones/16x16/document_exchange.gif b/www/img/icones/16x16/document_exchange.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5be616e48afeacbd38b3f2c82d376ce49647378b
Binary files /dev/null and b/www/img/icones/16x16/document_exchange.gif differ
diff --git a/www/img/icones/16x16/document_gear.gif b/www/img/icones/16x16/document_gear.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3f698d92792edaf6e04dd13c2690a5264d435bf4
Binary files /dev/null and b/www/img/icones/16x16/document_gear.gif differ
diff --git a/www/img/icones/16x16/document_into.gif b/www/img/icones/16x16/document_into.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f4372f9ee0f746b2443b9d3279d89af69a780176
Binary files /dev/null and b/www/img/icones/16x16/document_into.gif differ
diff --git a/www/img/icones/16x16/document_plain_new.gif b/www/img/icones/16x16/document_plain_new.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0e28e762d54885f4e7d6ab3e1af9acae3aec5580
Binary files /dev/null and b/www/img/icones/16x16/document_plain_new.gif differ
diff --git a/www/img/icones/16x16/document_refresh.gif b/www/img/icones/16x16/document_refresh.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2ade8461b9b47a33a2b46bb899b135b6fd4247be
Binary files /dev/null and b/www/img/icones/16x16/document_refresh.gif differ
diff --git a/www/img/icones/16x16/download.gif b/www/img/icones/16x16/download.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f2edacea2e8a7c7f57f99fbaf3b6ac12533e7f27
Binary files /dev/null and b/www/img/icones/16x16/download.gif differ
diff --git a/www/img/icones/16x16/earth2.gif b/www/img/icones/16x16/earth2.gif
new file mode 100644
index 0000000000000000000000000000000000000000..45ca5cf8564b4ba2508ee4bf8dff315b42b60344
Binary files /dev/null and b/www/img/icones/16x16/earth2.gif differ
diff --git a/www/img/icones/16x16/earth_location.gif b/www/img/icones/16x16/earth_location.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6a81788196efedbe36262f087b225351b097362e
Binary files /dev/null and b/www/img/icones/16x16/earth_location.gif differ
diff --git a/www/img/icones/16x16/element_new_after.gif b/www/img/icones/16x16/element_new_after.gif
new file mode 100644
index 0000000000000000000000000000000000000000..95e5e37acc724ae6e45ff452dce4951464f591d6
Binary files /dev/null and b/www/img/icones/16x16/element_new_after.gif differ
diff --git a/www/img/icones/16x16/element_next.gif b/www/img/icones/16x16/element_next.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c54f79ca60245b01d3a9087083ca26cffcf64649
Binary files /dev/null and b/www/img/icones/16x16/element_next.gif differ
diff --git a/www/img/icones/16x16/element_previous.gif b/www/img/icones/16x16/element_previous.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b656d3fd4f99836a1343ed9f554d684045773cb7
Binary files /dev/null and b/www/img/icones/16x16/element_previous.gif differ
diff --git a/www/img/icones/16x16/element_selection.gif b/www/img/icones/16x16/element_selection.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0e3896b7c124327de32d87549d595058eccb09f7
Binary files /dev/null and b/www/img/icones/16x16/element_selection.gif differ
diff --git a/www/img/icones/16x16/element_template.gif b/www/img/icones/16x16/element_template.gif
new file mode 100644
index 0000000000000000000000000000000000000000..732af1ce79882a4cba8cad46d1c8179fc45b6223
Binary files /dev/null and b/www/img/icones/16x16/element_template.gif differ
diff --git a/www/img/icones/16x16/elements1.gif b/www/img/icones/16x16/elements1.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f2d888f4d6feb6b58473907152e6b709ae1cbb45
Binary files /dev/null and b/www/img/icones/16x16/elements1.gif differ
diff --git a/www/img/icones/16x16/elements_selection.gif b/www/img/icones/16x16/elements_selection.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ce210a14a634d991b2acad12f5dd5cc726b91231
Binary files /dev/null and b/www/img/icones/16x16/elements_selection.gif differ
diff --git a/www/img/icones/16x16/exchange.gif b/www/img/icones/16x16/exchange.gif
new file mode 100644
index 0000000000000000000000000000000000000000..db0f190aea8888c8a88bd5102af42cd82fbd099b
Binary files /dev/null and b/www/img/icones/16x16/exchange.gif differ
diff --git a/www/img/icones/16x16/flag_green.gif b/www/img/icones/16x16/flag_green.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2cc72d9c991e8508152f92e236a15924511a2589
Binary files /dev/null and b/www/img/icones/16x16/flag_green.gif differ
diff --git a/www/img/icones/16x16/flash.gif b/www/img/icones/16x16/flash.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a90fe772638bb85bfb59b86aa5f1efb698295acd
Binary files /dev/null and b/www/img/icones/16x16/flash.gif differ
diff --git a/www/img/icones/16x16/flower_blue.gif b/www/img/icones/16x16/flower_blue.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f41fe9d984b172be37cd3c7609577842add4c023
Binary files /dev/null and b/www/img/icones/16x16/flower_blue.gif differ
diff --git a/www/img/icones/16x16/flower_red.gif b/www/img/icones/16x16/flower_red.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2ee8ccc186166d2f0602a54fe5e80a462452cbca
Binary files /dev/null and b/www/img/icones/16x16/flower_red.gif differ
diff --git a/www/img/icones/16x16/flower_white.gif b/www/img/icones/16x16/flower_white.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d8dd37839a959a125990426255cc4a1a03a90ae1
Binary files /dev/null and b/www/img/icones/16x16/flower_white.gif differ
diff --git a/www/img/icones/16x16/flower_yellow.gif b/www/img/icones/16x16/flower_yellow.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3eab198dc16017476c875ecfe750452d198b3fe3
Binary files /dev/null and b/www/img/icones/16x16/flower_yellow.gif differ
diff --git a/www/img/icones/16x16/form_green.gif b/www/img/icones/16x16/form_green.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ee6e328543df33e875f78914adb009e1eba31ec1
Binary files /dev/null and b/www/img/icones/16x16/form_green.gif differ
diff --git a/www/img/icones/16x16/funnel_new.gif b/www/img/icones/16x16/funnel_new.gif
new file mode 100644
index 0000000000000000000000000000000000000000..94a544163d23c278e6c13d1a1ed68d1d7376be7f
Binary files /dev/null and b/www/img/icones/16x16/funnel_new.gif differ
diff --git a/www/img/icones/16x16/gauge.gif b/www/img/icones/16x16/gauge.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ba96a574933d28935b2bf5c27d8c604da50cd98a
Binary files /dev/null and b/www/img/icones/16x16/gauge.gif differ
diff --git a/www/img/icones/16x16/gears_run.gif b/www/img/icones/16x16/gears_run.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4eccb412fa3b345788064034b0a78f435817a88a
Binary files /dev/null and b/www/img/icones/16x16/gears_run.gif differ
diff --git a/www/img/icones/16x16/guard.gif b/www/img/icones/16x16/guard.gif
new file mode 100644
index 0000000000000000000000000000000000000000..37ea8b42377f224a916d13d601919156f5218b12
Binary files /dev/null and b/www/img/icones/16x16/guard.gif differ
diff --git a/www/img/icones/16x16/hat_gray.gif b/www/img/icones/16x16/hat_gray.gif
new file mode 100644
index 0000000000000000000000000000000000000000..cb567cc653e8d463262494598bf1d026b9190743
Binary files /dev/null and b/www/img/icones/16x16/hat_gray.gif differ
diff --git a/www/img/icones/16x16/hat_green.gif b/www/img/icones/16x16/hat_green.gif
new file mode 100644
index 0000000000000000000000000000000000000000..53f3d3162eae32b60c0d9eddc92bc38e080a2683
Binary files /dev/null and b/www/img/icones/16x16/hat_green.gif differ
diff --git a/www/img/icones/16x16/hat_red.gif b/www/img/icones/16x16/hat_red.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2fb86b3ad48b97e8631ebce53b4b2441eb49f1ef
Binary files /dev/null and b/www/img/icones/16x16/hat_red.gif differ
diff --git a/www/img/icones/16x16/hat_white.gif b/www/img/icones/16x16/hat_white.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7f76fdac96ada421562d7e072f42e9b90914d55a
Binary files /dev/null and b/www/img/icones/16x16/hat_white.gif differ
diff --git a/www/img/icones/16x16/house.gif b/www/img/icones/16x16/house.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2ca4c687e94ac5d973d520dcc5ef9dcc70c87801
Binary files /dev/null and b/www/img/icones/16x16/house.gif differ
diff --git a/www/img/icones/16x16/import2.gif b/www/img/icones/16x16/import2.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c9cee3c35ba02aa3d3a7cedb00302f27e9175da9
Binary files /dev/null and b/www/img/icones/16x16/import2.gif differ
diff --git a/www/img/icones/16x16/index.gif b/www/img/icones/16x16/index.gif
new file mode 100644
index 0000000000000000000000000000000000000000..111fcd0e94bc75577058b0434d3b7a72749fcc26
Binary files /dev/null and b/www/img/icones/16x16/index.gif differ
diff --git a/www/img/icones/16x16/info.gif b/www/img/icones/16x16/info.gif
new file mode 100644
index 0000000000000000000000000000000000000000..95017d022e55919bdb506495c4c22694efe297de
Binary files /dev/null and b/www/img/icones/16x16/info.gif differ
diff --git a/www/img/icones/16x16/layout_horizontal.gif b/www/img/icones/16x16/layout_horizontal.gif
new file mode 100644
index 0000000000000000000000000000000000000000..04fdece2700038c11593609204e2c96742685064
Binary files /dev/null and b/www/img/icones/16x16/layout_horizontal.gif differ
diff --git a/www/img/icones/16x16/layout_vertical.gif b/www/img/icones/16x16/layout_vertical.gif
new file mode 100644
index 0000000000000000000000000000000000000000..55b211d802f2c4848b394ef8370473c0b295b4b4
Binary files /dev/null and b/www/img/icones/16x16/layout_vertical.gif differ
diff --git a/www/img/icones/16x16/lifebelt.gif b/www/img/icones/16x16/lifebelt.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9013c758966bbf1f31d3d7430749d09cc967118c
Binary files /dev/null and b/www/img/icones/16x16/lifebelt.gif differ
diff --git a/www/img/icones/16x16/line-chart.gif b/www/img/icones/16x16/line-chart.gif
new file mode 100644
index 0000000000000000000000000000000000000000..67f4926082fbd458e6ed1a7ed9b69ee2a5f2412e
Binary files /dev/null and b/www/img/icones/16x16/line-chart.gif differ
diff --git a/www/img/icones/16x16/loudspeaker.gif b/www/img/icones/16x16/loudspeaker.gif
new file mode 100644
index 0000000000000000000000000000000000000000..55e920a94ee55250fc807553b7c8a0e7fe4cdcab
Binary files /dev/null and b/www/img/icones/16x16/loudspeaker.gif differ
diff --git a/www/img/icones/16x16/mail_attachment.gif b/www/img/icones/16x16/mail_attachment.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0387fe3d59db95d732dcae0351796f24f56de79e
Binary files /dev/null and b/www/img/icones/16x16/mail_attachment.gif differ
diff --git a/www/img/icones/16x16/mail_write.gif b/www/img/icones/16x16/mail_write.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1a709f4d2a173137f8602df19421f2d03f66d0b8
Binary files /dev/null and b/www/img/icones/16x16/mail_write.gif differ
diff --git a/www/img/icones/16x16/masks.gif b/www/img/icones/16x16/masks.gif
new file mode 100644
index 0000000000000000000000000000000000000000..988bce1a41c2fe94a643f953c7e4f07007219bf8
Binary files /dev/null and b/www/img/icones/16x16/masks.gif differ
diff --git a/www/img/icones/16x16/messages.gif b/www/img/icones/16x16/messages.gif
new file mode 100644
index 0000000000000000000000000000000000000000..cd90abcb79bf428279294406add4850d2405b23d
Binary files /dev/null and b/www/img/icones/16x16/messages.gif differ
diff --git a/www/img/icones/16x16/money_envelope.gif b/www/img/icones/16x16/money_envelope.gif
new file mode 100644
index 0000000000000000000000000000000000000000..024534fb6a7770b7b14ea3e91f902ab370f11f8a
Binary files /dev/null and b/www/img/icones/16x16/money_envelope.gif differ
diff --git a/www/img/icones/16x16/nagios.gif b/www/img/icones/16x16/nagios.gif
new file mode 100644
index 0000000000000000000000000000000000000000..de62aec41c52e886fd925d3615a3629db375851c
Binary files /dev/null and b/www/img/icones/16x16/nagios.gif differ
diff --git a/www/img/icones/16x16/note.gif b/www/img/icones/16x16/note.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7925c4ca9d312c488396a88796ca91e4aaa3898c
Binary files /dev/null and b/www/img/icones/16x16/note.gif differ
diff --git a/www/img/icones/16x16/oreon.gif b/www/img/icones/16x16/oreon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f27c579524073c6620f87b44c2617adabbb7e334
Binary files /dev/null and b/www/img/icones/16x16/oreon.gif differ
diff --git a/www/img/icones/16x16/oszillograph.gif b/www/img/icones/16x16/oszillograph.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e5a0341b583c3e001d5532fd019b3eb1cc6852fc
Binary files /dev/null and b/www/img/icones/16x16/oszillograph.gif differ
diff --git a/www/img/icones/16x16/outbox.gif b/www/img/icones/16x16/outbox.gif
new file mode 100644
index 0000000000000000000000000000000000000000..926c4d876d20705cd4135ff97fbcf3bde72aeba5
Binary files /dev/null and b/www/img/icones/16x16/outbox.gif differ
diff --git a/www/img/icones/16x16/palette_text.gif b/www/img/icones/16x16/palette_text.gif
new file mode 100644
index 0000000000000000000000000000000000000000..42d89363651d250f08c9a77d508ccda404d4a58a
Binary files /dev/null and b/www/img/icones/16x16/palette_text.gif differ
diff --git a/www/img/icones/16x16/pin_red.gif b/www/img/icones/16x16/pin_red.gif
new file mode 100644
index 0000000000000000000000000000000000000000..30e23963b3fd47a790f69a72a257a4259e17cfc8
Binary files /dev/null and b/www/img/icones/16x16/pin_red.gif differ
diff --git a/www/img/icones/16x16/press.gif b/www/img/icones/16x16/press.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9565f0e27ae2283719b0f31f88fea7b399ef997a
Binary files /dev/null and b/www/img/icones/16x16/press.gif differ
diff --git a/www/img/icones/16x16/queue.gif b/www/img/icones/16x16/queue.gif
new file mode 100644
index 0000000000000000000000000000000000000000..29ba4075ad190c03dd070b42998cbe36ce62dbbf
Binary files /dev/null and b/www/img/icones/16x16/queue.gif differ
diff --git a/www/img/icones/16x16/recovery.gif b/www/img/icones/16x16/recovery.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e32de6f699f3490f75a09b6520925ba34a06ce9b
Binary files /dev/null and b/www/img/icones/16x16/recovery.gif differ
diff --git a/www/img/icones/16x16/refresh.gif b/www/img/icones/16x16/refresh.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9aa2b0d5241751762acf8ac146e21c0891ad2ab5
Binary files /dev/null and b/www/img/icones/16x16/refresh.gif differ
diff --git a/www/img/icones/16x16/reporting.gif b/www/img/icones/16x16/reporting.gif
new file mode 100644
index 0000000000000000000000000000000000000000..cdbc1c4588d032392c1548cad4b2481c9a738287
Binary files /dev/null and b/www/img/icones/16x16/reporting.gif differ
diff --git a/www/img/icones/16x16/selection_delete.gif b/www/img/icones/16x16/selection_delete.gif
new file mode 100644
index 0000000000000000000000000000000000000000..06e492f356e7ad5f0ee5d6befc8e70005d450938
Binary files /dev/null and b/www/img/icones/16x16/selection_delete.gif differ
diff --git a/www/img/icones/16x16/server_client.gif b/www/img/icones/16x16/server_client.gif
new file mode 100644
index 0000000000000000000000000000000000000000..51dabb5f3d6d5d87c78e8a35ee2e250d139e8143
Binary files /dev/null and b/www/img/icones/16x16/server_client.gif differ
diff --git a/www/img/icones/16x16/server_client_ext.gif b/www/img/icones/16x16/server_client_ext.gif
new file mode 100644
index 0000000000000000000000000000000000000000..14c9c01f83c8ef1561b2310ef85b7c2c326c4765
Binary files /dev/null and b/www/img/icones/16x16/server_client_ext.gif differ
diff --git a/www/img/icones/16x16/server_document.gif b/www/img/icones/16x16/server_document.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9785d078a5efc9cc54e8a43973b39780b9fa2736
Binary files /dev/null and b/www/img/icones/16x16/server_document.gif differ
diff --git a/www/img/icones/16x16/server_network.gif b/www/img/icones/16x16/server_network.gif
new file mode 100644
index 0000000000000000000000000000000000000000..fffa2f448b38ca325c30b2cda87ea418ce8061be
Binary files /dev/null and b/www/img/icones/16x16/server_network.gif differ
diff --git a/www/img/icones/16x16/server_network_problem.gif b/www/img/icones/16x16/server_network_problem.gif
new file mode 100644
index 0000000000000000000000000000000000000000..620478ab525895dbf77d9ec1921b2fdf2aabcebe
Binary files /dev/null and b/www/img/icones/16x16/server_network_problem.gif differ
diff --git a/www/img/icones/16x16/signpost.gif b/www/img/icones/16x16/signpost.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2455b21acacc37f106d2181a36f2ab30756496bd
Binary files /dev/null and b/www/img/icones/16x16/signpost.gif differ
diff --git a/www/img/icones/16x16/step.gif b/www/img/icones/16x16/step.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c0a91c0fb577e84ce3d8a21062e28779bde0db9d
Binary files /dev/null and b/www/img/icones/16x16/step.gif differ
diff --git a/www/img/icones/16x16/stop.gif b/www/img/icones/16x16/stop.gif
new file mode 100644
index 0000000000000000000000000000000000000000..69b502072b7c2618ebb52bd0c61cfb0310342f91
Binary files /dev/null and b/www/img/icones/16x16/stop.gif differ
diff --git a/www/img/icones/16x16/text_code.gif b/www/img/icones/16x16/text_code.gif
new file mode 100644
index 0000000000000000000000000000000000000000..8582ab8a5384d75c1cd167ce2aca9649f0097bfc
Binary files /dev/null and b/www/img/icones/16x16/text_code.gif differ
diff --git a/www/img/icones/16x16/text_code_c.gif b/www/img/icones/16x16/text_code_c.gif
new file mode 100644
index 0000000000000000000000000000000000000000..fbb9fbd4d51ec9d8e4fc89468cbeeb30ebee0adb
Binary files /dev/null and b/www/img/icones/16x16/text_code_c.gif differ
diff --git a/www/img/icones/16x16/text_code_colored.gif b/www/img/icones/16x16/text_code_colored.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b69bed0e432e8612973f60264273ac6d967fce9a
Binary files /dev/null and b/www/img/icones/16x16/text_code_colored.gif differ
diff --git a/www/img/icones/16x16/text_code_java2.gif b/www/img/icones/16x16/text_code_java2.gif
new file mode 100644
index 0000000000000000000000000000000000000000..40eb2bb256edda697d766369d69b3dfdac2c830d
Binary files /dev/null and b/www/img/icones/16x16/text_code_java2.gif differ
diff --git a/www/img/icones/16x16/thermometer.gif b/www/img/icones/16x16/thermometer.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3bdb617134a318dec6afabfcf565c278204827a6
Binary files /dev/null and b/www/img/icones/16x16/thermometer.gif differ
diff --git a/www/img/icones/16x16/tool.gif b/www/img/icones/16x16/tool.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e112af4bbbf9607401634b7b0847a1dbb9cc231f
Binary files /dev/null and b/www/img/icones/16x16/tool.gif differ
diff --git a/www/img/icones/16x16/trafficlight_on.gif b/www/img/icones/16x16/trafficlight_on.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d41da3c174c448131058813aba92b376ac451ac2
Binary files /dev/null and b/www/img/icones/16x16/trafficlight_on.gif differ
diff --git a/www/img/icones/16x16/undo.gif b/www/img/icones/16x16/undo.gif
new file mode 100644
index 0000000000000000000000000000000000000000..11b940af31cbc7ebfcbdf681959454f2ea5c2730
Binary files /dev/null and b/www/img/icones/16x16/undo.gif differ
diff --git a/www/img/icones/16x16/user1.gif b/www/img/icones/16x16/user1.gif
new file mode 100644
index 0000000000000000000000000000000000000000..49409a5030912ba14b0c64a8bb709c3b6f3d252e
Binary files /dev/null and b/www/img/icones/16x16/user1.gif differ
diff --git a/www/img/icones/16x16/user1_add.gif b/www/img/icones/16x16/user1_add.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6b83fc1bb8d74c3a11109136fa3b109e97872c78
Binary files /dev/null and b/www/img/icones/16x16/user1_add.gif differ
diff --git a/www/img/icones/16x16/user1_delete.gif b/www/img/icones/16x16/user1_delete.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2dd415c32edd92473ce2dc42e4fc5e9ca72e68bb
Binary files /dev/null and b/www/img/icones/16x16/user1_delete.gif differ
diff --git a/www/img/icones/16x16/user1_message.gif b/www/img/icones/16x16/user1_message.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e5920daa900831ab9851fe6f0be2e55c4a906dad
Binary files /dev/null and b/www/img/icones/16x16/user1_message.gif differ
diff --git a/www/img/icones/16x16/user1_refresh.gif b/www/img/icones/16x16/user1_refresh.gif
new file mode 100644
index 0000000000000000000000000000000000000000..fdafdf662e6d3df3faae327932e8dc66bde13a6c
Binary files /dev/null and b/www/img/icones/16x16/user1_refresh.gif differ
diff --git a/www/img/icones/16x16/user1_view.gif b/www/img/icones/16x16/user1_view.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b8404a5f881ac8421733f706f2f597d70bc71a78
Binary files /dev/null and b/www/img/icones/16x16/user1_view.gif differ
diff --git a/www/img/icones/16x16/users_family.gif b/www/img/icones/16x16/users_family.gif
new file mode 100644
index 0000000000000000000000000000000000000000..76b43297b6e97796f37688f38415fc2df242b85d
Binary files /dev/null and b/www/img/icones/16x16/users_family.gif differ
diff --git a/www/img/icones/16x16/view.gif b/www/img/icones/16x16/view.gif
new file mode 100644
index 0000000000000000000000000000000000000000..fb3c2cfe3a42840e7b6d6a2b5f7309616708f131
Binary files /dev/null and b/www/img/icones/16x16/view.gif differ
diff --git a/www/img/icones/16x16/warning.gif b/www/img/icones/16x16/warning.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0d7fe065c7d65469feeb21f614ecf6826a6cf1e9
Binary files /dev/null and b/www/img/icones/16x16/warning.gif differ
diff --git a/www/img/icones/16x16/window_application_delete.gif b/www/img/icones/16x16/window_application_delete.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2f38b739b71aae56d7536b710749ecd178a995f5
Binary files /dev/null and b/www/img/icones/16x16/window_application_delete.gif differ
diff --git a/www/img/icones/16x16/window_environment.gif b/www/img/icones/16x16/window_environment.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ef484fdd6508d2ed4963620c1d4499384075ea96
Binary files /dev/null and b/www/img/icones/16x16/window_environment.gif differ
diff --git a/www/img/icones/16x16/worker.gif b/www/img/icones/16x16/worker.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4e366f0674e2cd2705edbb05f686aa97aa4d61d2
Binary files /dev/null and b/www/img/icones/16x16/worker.gif differ
diff --git a/www/img/icones/16x16/workstation2.gif b/www/img/icones/16x16/workstation2.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a529fbb0dbd31adfd719dd91498ca6e4ebeadcf5
Binary files /dev/null and b/www/img/icones/16x16/workstation2.gif differ
diff --git a/www/img/icones/16x16/wrench.gif b/www/img/icones/16x16/wrench.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d55f62023c8ff14654445f05f9c222df72345afc
Binary files /dev/null and b/www/img/icones/16x16/wrench.gif differ
diff --git a/www/img/icones/16x16/zoom_in.gif b/www/img/icones/16x16/zoom_in.gif
new file mode 100644
index 0000000000000000000000000000000000000000..553ac0acd504fad7b94729de9a103379054d7427
Binary files /dev/null and b/www/img/icones/16x16/zoom_in.gif differ
diff --git a/www/img/icones/1x1/blank.gif b/www/img/icones/1x1/blank.gif
new file mode 100644
index 0000000000000000000000000000000000000000..35d42e808f0a8017b8d52a06be2f8fec0b466a66
Binary files /dev/null and b/www/img/icones/1x1/blank.gif differ
diff --git a/www/img/icones/24x24/check.png b/www/img/icones/24x24/check.png
new file mode 100644
index 0000000000000000000000000000000000000000..940dbce8d1e24741afdbba59599854f68e913c8e
Binary files /dev/null and b/www/img/icones/24x24/check.png differ
diff --git a/www/img/icones/24x24/delete.gif b/www/img/icones/24x24/delete.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ff94119fbf017dcd31136f482d1862cd94a754a4
Binary files /dev/null and b/www/img/icones/24x24/delete.gif differ
diff --git a/www/img/icones/24x24/delete.png b/www/img/icones/24x24/delete.png
new file mode 100644
index 0000000000000000000000000000000000000000..587921026899da7dc8d4ca6517609fb7e9f783aa
Binary files /dev/null and b/www/img/icones/24x24/delete.png differ
diff --git a/www/img/icones/24x24/document_exchange.gif b/www/img/icones/24x24/document_exchange.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f6c79830212291ad3875a32567a78218336f531f
Binary files /dev/null and b/www/img/icones/24x24/document_exchange.gif differ
diff --git a/www/img/icones/24x24/information.png b/www/img/icones/24x24/information.png
new file mode 100644
index 0000000000000000000000000000000000000000..6dbcc2cb306bf7bf667ca774ad2354d06b6c0f37
Binary files /dev/null and b/www/img/icones/24x24/information.png differ
diff --git a/www/img/icones/24x24/oreon.gif b/www/img/icones/24x24/oreon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..34a14fa4c2c9ada239830ee5273efdc7f733d408
Binary files /dev/null and b/www/img/icones/24x24/oreon.gif differ
diff --git a/www/img/icones/24x24/selection_delete.gif b/www/img/icones/24x24/selection_delete.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a8428dcb16445f02dc3a0b3fc09723c292c91aba
Binary files /dev/null and b/www/img/icones/24x24/selection_delete.gif differ
diff --git a/www/img/icones/24x24/unknown.png b/www/img/icones/24x24/unknown.png
new file mode 100644
index 0000000000000000000000000000000000000000..e2755a2726f7444d6f985f6a340f1a36c11abf3e
Binary files /dev/null and b/www/img/icones/24x24/unknown.png differ
diff --git a/www/img/icones/24x24/warning.png b/www/img/icones/24x24/warning.png
new file mode 100644
index 0000000000000000000000000000000000000000..b13468344827f7097bb929e8278925cdb2c29162
Binary files /dev/null and b/www/img/icones/24x24/warning.png differ
diff --git a/www/img/icones/48x48/stopwatch.gif b/www/img/icones/48x48/stopwatch.gif
new file mode 100644
index 0000000000000000000000000000000000000000..133d65e12add97b57a14636ed85687fb2b7dbb09
Binary files /dev/null and b/www/img/icones/48x48/stopwatch.gif differ
diff --git a/www/img/icones/7x7/sort_asc.gif b/www/img/icones/7x7/sort_asc.gif
new file mode 100644
index 0000000000000000000000000000000000000000..8a6b77bc49061fa45f74dee90a7415cb54bfe343
Binary files /dev/null and b/www/img/icones/7x7/sort_asc.gif differ
diff --git a/www/img/icones/7x7/sort_desc.gif b/www/img/icones/7x7/sort_desc.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1681685d00beb900c935a960f476c78bd52961d9
Binary files /dev/null and b/www/img/icones/7x7/sort_desc.gif differ
diff --git a/www/img/icones/8x14/pathWayBlue.png b/www/img/icones/8x14/pathWayBlue.png
new file mode 100644
index 0000000000000000000000000000000000000000..fb1de2c8d483a4fcd4437b6b3e02259cb0ff80bf
Binary files /dev/null and b/www/img/icones/8x14/pathWayBlue.png differ
diff --git a/www/img/icones/8x14/pathWayBlueStart.png b/www/img/icones/8x14/pathWayBlueStart.png
new file mode 100644
index 0000000000000000000000000000000000000000..f866c3b54046020704581aafbc59f52fb3809f20
Binary files /dev/null and b/www/img/icones/8x14/pathWayBlueStart.png differ
diff --git a/www/img/logo_oreon.gif b/www/img/logo_oreon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..414e66d537c30cbde29cac9ac4580a3122e84bfe
Binary files /dev/null and b/www/img/logo_oreon.gif differ
diff --git a/www/img/oldGIF/action_top.gif b/www/img/oldGIF/action_top.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7f05426e2ab0ad30f65c856fe116285b0fb5cab1
Binary files /dev/null and b/www/img/oldGIF/action_top.gif differ
diff --git a/www/img/oldGIF/arrow1.gif b/www/img/oldGIF/arrow1.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a6b82185a547aeb187b2089953ef33924218a857
Binary files /dev/null and b/www/img/oldGIF/arrow1.gif differ
diff --git a/www/img/oldGIF/arrow2.gif b/www/img/oldGIF/arrow2.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6b325637f0f8d5acb689cf8d6029307f085f8089
Binary files /dev/null and b/www/img/oldGIF/arrow2.gif differ
diff --git a/www/img/oldGIF/arrow_ltr.gif b/www/img/oldGIF/arrow_ltr.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d9e9f55100290c5005e0462741acb694145592b8
Binary files /dev/null and b/www/img/oldGIF/arrow_ltr.gif differ
diff --git a/www/img/oldGIF/bg_banner.gif b/www/img/oldGIF/bg_banner.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1149381ccc8b1d2d3e750386e8bfe6a5e0e6b559
Binary files /dev/null and b/www/img/oldGIF/bg_banner.gif differ
diff --git a/www/img/oldGIF/blank.gif b/www/img/oldGIF/blank.gif
new file mode 100644
index 0000000000000000000000000000000000000000..35d42e808f0a8017b8d52a06be2f8fec0b466a66
Binary files /dev/null and b/www/img/oldGIF/blank.gif differ
diff --git a/www/img/oldGIF/check_stop.gif b/www/img/oldGIF/check_stop.gif
new file mode 100644
index 0000000000000000000000000000000000000000..75cfe44e45263bb41673309069216075870fdae6
Binary files /dev/null and b/www/img/oldGIF/check_stop.gif differ
diff --git a/www/img/oldGIF/clear.gif b/www/img/oldGIF/clear.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9ed1269764b890333782a01489c53f5ac896f2aa
Binary files /dev/null and b/www/img/oldGIF/clear.gif differ
diff --git a/www/img/oldGIF/deleted.gif b/www/img/oldGIF/deleted.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3c3f290041bbf48f69356ab5c99f83589bf87f01
Binary files /dev/null and b/www/img/oldGIF/deleted.gif differ
diff --git a/www/img/oldGIF/dir.gif b/www/img/oldGIF/dir.gif
new file mode 100644
index 0000000000000000000000000000000000000000..25bf36251bf266f8187dbeac51b78fc83efd9ca4
Binary files /dev/null and b/www/img/oldGIF/dir.gif differ
diff --git a/www/img/oldGIF/disabled.gif b/www/img/oldGIF/disabled.gif
new file mode 100644
index 0000000000000000000000000000000000000000..fd0e7508581620a1301192e9591b80b9eea85606
Binary files /dev/null and b/www/img/oldGIF/disabled.gif differ
diff --git a/www/img/oldGIF/div.gif b/www/img/oldGIF/div.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3fefc0cd65ee425afaaf644e6bf0bf03e53a46de
Binary files /dev/null and b/www/img/oldGIF/div.gif differ
diff --git a/www/img/oldGIF/down.gif b/www/img/oldGIF/down.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3d47f438523fba5911b4538bf3dd13514bb41386
Binary files /dev/null and b/www/img/oldGIF/down.gif differ
diff --git a/www/img/oldGIF/empty.gif b/www/img/oldGIF/empty.gif
new file mode 100644
index 0000000000000000000000000000000000000000..35d42e808f0a8017b8d52a06be2f8fec0b466a66
Binary files /dev/null and b/www/img/oldGIF/empty.gif differ
diff --git a/www/img/oldGIF/enabled.gif b/www/img/oldGIF/enabled.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1a87c78c45cc28b843ffcade9d800099962aeca9
Binary files /dev/null and b/www/img/oldGIF/enabled.gif differ
diff --git a/www/img/oldGIF/folder.gif b/www/img/oldGIF/folder.gif
new file mode 100644
index 0000000000000000000000000000000000000000..20666b5845f19c5a2df470a2edad6877f803877f
Binary files /dev/null and b/www/img/oldGIF/folder.gif differ
diff --git a/www/img/oldGIF/folderopen.gif b/www/img/oldGIF/folderopen.gif
new file mode 100644
index 0000000000000000000000000000000000000000..20666b5845f19c5a2df470a2edad6877f803877f
Binary files /dev/null and b/www/img/oldGIF/folderopen.gif differ
diff --git a/www/img/oldGIF/graph_properties.gif b/www/img/oldGIF/graph_properties.gif
new file mode 100644
index 0000000000000000000000000000000000000000..62a060a24669b9df809d485e5f3f60ad0101bdab
Binary files /dev/null and b/www/img/oldGIF/graph_properties.gif differ
diff --git a/www/img/oldGIF/graph_zoom.gif b/www/img/oldGIF/graph_zoom.gif
new file mode 100644
index 0000000000000000000000000000000000000000..70158f004f57fd8adbcf065087c4512f4a205063
Binary files /dev/null and b/www/img/oldGIF/graph_zoom.gif differ
diff --git a/www/img/oldGIF/help.gif b/www/img/oldGIF/help.gif
new file mode 100644
index 0000000000000000000000000000000000000000..14d73acad20d4c207c42bd466d0e7f934bfcfb11
Binary files /dev/null and b/www/img/oldGIF/help.gif differ
diff --git a/www/img/oldGIF/iconGraph.gif b/www/img/oldGIF/iconGraph.gif
new file mode 100644
index 0000000000000000000000000000000000000000..afaf9ab85571dd5ce1efb0942344cc95b46a9443
Binary files /dev/null and b/www/img/oldGIF/iconGraph.gif differ
diff --git a/www/img/oldGIF/iconHost.gif b/www/img/oldGIF/iconHost.gif
new file mode 100644
index 0000000000000000000000000000000000000000..606ab9288d6d3d983695e1e01120f92ee4216d03
Binary files /dev/null and b/www/img/oldGIF/iconHost.gif differ
diff --git a/www/img/oldGIF/iconService.gif b/www/img/oldGIF/iconService.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9ec99afa1d1729616b51fc8d7235d4ab22b040bd
Binary files /dev/null and b/www/img/oldGIF/iconService.gif differ
diff --git a/www/img/oldGIF/info.gif b/www/img/oldGIF/info.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4a31ca21d92d97c0abd0167edcfc4f6fbae9399e
Binary files /dev/null and b/www/img/oldGIF/info.gif differ
diff --git a/www/img/oldGIF/info2.gif b/www/img/oldGIF/info2.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f72216964a51f7c5bb2249ff47d0f0b7b9cc36dd
Binary files /dev/null and b/www/img/oldGIF/info2.gif differ
diff --git a/www/img/oldGIF/join.gif b/www/img/oldGIF/join.gif
new file mode 100644
index 0000000000000000000000000000000000000000..18b95690cc4a9350a9321d99ff7ddb075bea5966
Binary files /dev/null and b/www/img/oldGIF/join.gif differ
diff --git a/www/img/oldGIF/joinbottom.gif b/www/img/oldGIF/joinbottom.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4e6d2e22e2f05ccfd670354a35800ba26d20536c
Binary files /dev/null and b/www/img/oldGIF/joinbottom.gif differ
diff --git a/www/img/oldGIF/line.gif b/www/img/oldGIF/line.gif
new file mode 100644
index 0000000000000000000000000000000000000000..efe7e676597895c2a6863bf1ac870af22086b64a
Binary files /dev/null and b/www/img/oldGIF/line.gif differ
diff --git a/www/img/oldGIF/listDel.gif b/www/img/oldGIF/listDel.gif
new file mode 100644
index 0000000000000000000000000000000000000000..464b8c9c41e8684d4cd1d6d4c89a742e29f6cd48
Binary files /dev/null and b/www/img/oldGIF/listDel.gif differ
diff --git a/www/img/oldGIF/listDup.gif b/www/img/oldGIF/listDup.gif
new file mode 100644
index 0000000000000000000000000000000000000000..25201d9ba9482e2cae76de1827fa9adb3243632a
Binary files /dev/null and b/www/img/oldGIF/listDup.gif differ
diff --git a/www/img/oldGIF/listPen.gif b/www/img/oldGIF/listPen.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ae06fc4d93a0dd0ee7be7ceb0e04007de5034ca4
Binary files /dev/null and b/www/img/oldGIF/listPen.gif differ
diff --git a/www/img/oldGIF/listView.gif b/www/img/oldGIF/listView.gif
new file mode 100644
index 0000000000000000000000000000000000000000..540df50e33052b48ecc75ca09907235ef2dfb30d
Binary files /dev/null and b/www/img/oldGIF/listView.gif differ
diff --git a/www/img/oldGIF/logo_oreon.gif b/www/img/oldGIF/logo_oreon.gif
new file mode 100644
index 0000000000000000000000000000000000000000..414e66d537c30cbde29cac9ac4580a3122e84bfe
Binary files /dev/null and b/www/img/oldGIF/logo_oreon.gif differ
diff --git a/www/img/oldGIF/logo_oreon_gd.gif b/www/img/oldGIF/logo_oreon_gd.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d79f553c325b0fa74ca33be715dae10486ec03fa
Binary files /dev/null and b/www/img/oldGIF/logo_oreon_gd.gif differ
diff --git a/www/img/oldGIF/logo_oreon_moyen.gif b/www/img/oldGIF/logo_oreon_moyen.gif
new file mode 100644
index 0000000000000000000000000000000000000000..37919a87998f7cad2c98fb5abae53c8d491b63c3
Binary files /dev/null and b/www/img/oldGIF/logo_oreon_moyen.gif differ
diff --git a/www/img/oldGIF/minus.gif b/www/img/oldGIF/minus.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c6b53e1fc314129563d1494fb3400b21b7d3988d
Binary files /dev/null and b/www/img/oldGIF/minus.gif differ
diff --git a/www/img/oldGIF/minusbottom.gif b/www/img/oldGIF/minusbottom.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d4222dab2dee2fc0222e232956ef15b535752a31
Binary files /dev/null and b/www/img/oldGIF/minusbottom.gif differ
diff --git a/www/img/oldGIF/moins_info.gif b/www/img/oldGIF/moins_info.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b0e0fe8d85ec8a35bc648a0eda920698350732a6
Binary files /dev/null and b/www/img/oldGIF/moins_info.gif differ
diff --git a/www/img/oldGIF/notification.gif b/www/img/oldGIF/notification.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5eff18e05b745d375dd891f756abb457acd8e852
Binary files /dev/null and b/www/img/oldGIF/notification.gif differ
diff --git a/www/img/oldGIF/notifications.gif b/www/img/oldGIF/notifications.gif
new file mode 100644
index 0000000000000000000000000000000000000000..897c8a631a0d4cd36013a849020012267350e6b4
Binary files /dev/null and b/www/img/oldGIF/notifications.gif differ
diff --git a/www/img/oldGIF/page.gif b/www/img/oldGIF/page.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3fef2f1d191cafdf2239a93661eb7505d523bedb
Binary files /dev/null and b/www/img/oldGIF/page.gif differ
diff --git a/www/img/oldGIF/passiveonly.gif b/www/img/oldGIF/passiveonly.gif
new file mode 100644
index 0000000000000000000000000000000000000000..903f61847f91f66a2ff98e1d9460d380644a9aab
Binary files /dev/null and b/www/img/oldGIF/passiveonly.gif differ
diff --git a/www/img/oldGIF/picto1.gif b/www/img/oldGIF/picto1.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4ae525265673f3d9fee23b0c97d832c3302e84cd
Binary files /dev/null and b/www/img/oldGIF/picto1.gif differ
diff --git a/www/img/oldGIF/picto10.gif b/www/img/oldGIF/picto10.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e45bd27437596c0cb15c163d402029b934d597e3
Binary files /dev/null and b/www/img/oldGIF/picto10.gif differ
diff --git a/www/img/oldGIF/picto2.gif b/www/img/oldGIF/picto2.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ca68586e5c2baa90bbc33a06a9caebec2507b3cd
Binary files /dev/null and b/www/img/oldGIF/picto2.gif differ
diff --git a/www/img/oldGIF/picto2_bis.gif b/www/img/oldGIF/picto2_bis.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0bd6663124102b3c671201f50681a08519682e20
Binary files /dev/null and b/www/img/oldGIF/picto2_bis.gif differ
diff --git a/www/img/oldGIF/picto3.gif b/www/img/oldGIF/picto3.gif
new file mode 100644
index 0000000000000000000000000000000000000000..48729c9a45ed3e82d6661822c558546f0d5d7e02
Binary files /dev/null and b/www/img/oldGIF/picto3.gif differ
diff --git a/www/img/oldGIF/picto4.gif b/www/img/oldGIF/picto4.gif
new file mode 100644
index 0000000000000000000000000000000000000000..40ce4a9f7b8b61d2f7e84a61f4eb918c41c087ad
Binary files /dev/null and b/www/img/oldGIF/picto4.gif differ
diff --git a/www/img/oldGIF/picto5.gif b/www/img/oldGIF/picto5.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4b8e7d8188cfb1fd782ba745e80c9745d5897b14
Binary files /dev/null and b/www/img/oldGIF/picto5.gif differ
diff --git a/www/img/oldGIF/picto6.gif b/www/img/oldGIF/picto6.gif
new file mode 100644
index 0000000000000000000000000000000000000000..effa8e619abed53d35ed814f9ebf397d1289442c
Binary files /dev/null and b/www/img/oldGIF/picto6.gif differ
diff --git a/www/img/oldGIF/picto7.gif b/www/img/oldGIF/picto7.gif
new file mode 100644
index 0000000000000000000000000000000000000000..cdfd9610fadcc9486e0462a34794cae1c1c75900
Binary files /dev/null and b/www/img/oldGIF/picto7.gif differ
diff --git a/www/img/oldGIF/picto8.gif b/www/img/oldGIF/picto8.gif
new file mode 100644
index 0000000000000000000000000000000000000000..41c31b9d9bce8a8312390a341af81bb65fc5e192
Binary files /dev/null and b/www/img/oldGIF/picto8.gif differ
diff --git a/www/img/oldGIF/picto9.gif b/www/img/oldGIF/picto9.gif
new file mode 100644
index 0000000000000000000000000000000000000000..46aba079947dbe84a38aabeb748cf34bbfdf1b8a
Binary files /dev/null and b/www/img/oldGIF/picto9.gif differ
diff --git a/www/img/oldGIF/plus.gif b/www/img/oldGIF/plus.gif
new file mode 100644
index 0000000000000000000000000000000000000000..de3f98d60f00166e17f35e2a5e4cf76f0b2f254b
Binary files /dev/null and b/www/img/oldGIF/plus.gif differ
diff --git a/www/img/oldGIF/plus_info.gif b/www/img/oldGIF/plus_info.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5bc7531bd844a625d4bc07eef742404927b826f3
Binary files /dev/null and b/www/img/oldGIF/plus_info.gif differ
diff --git a/www/img/oldGIF/plusbottom.gif b/www/img/oldGIF/plusbottom.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b8bcb3dff06070cfcebf088c8ade33711c3ae2f8
Binary files /dev/null and b/www/img/oldGIF/plusbottom.gif differ
diff --git a/www/img/oldGIF/point.gif b/www/img/oldGIF/point.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b0df9d192f62367fef765eac3c6d8ec57564b64a
Binary files /dev/null and b/www/img/oldGIF/point.gif differ
diff --git a/www/img/oldGIF/reschedule.gif b/www/img/oldGIF/reschedule.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e3d0d2384f9a221d20346854606c1553774ca3b0
Binary files /dev/null and b/www/img/oldGIF/reschedule.gif differ
diff --git a/www/img/oldGIF/text.gif b/www/img/oldGIF/text.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a1e3f561fc893e8714220a4dc3ef9e20c1f83fe9
Binary files /dev/null and b/www/img/oldGIF/text.gif differ
diff --git a/www/img/oldGIF/trash2.gif b/www/img/oldGIF/trash2.gif
new file mode 100644
index 0000000000000000000000000000000000000000..feb34e484192e53f68bbd50257147a830a9f1d75
Binary files /dev/null and b/www/img/oldGIF/trash2.gif differ
diff --git a/www/img/oldGIF/up.gif b/www/img/oldGIF/up.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7e27e203663d1479fd441da69323bc9223351fc8
Binary files /dev/null and b/www/img/oldGIF/up.gif differ
diff --git a/www/img/paris.jpg b/www/img/paris.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..aa3b23fbca3f707e59cfbe4aa248836e1e05ec85
Binary files /dev/null and b/www/img/paris.jpg differ
diff --git a/www/img/ressources/aix.png b/www/img/ressources/aix.png
new file mode 100644
index 0000000000000000000000000000000000000000..ea842cafbc20a04bcbe5c9f06c44accb6d98fe6a
Binary files /dev/null and b/www/img/ressources/aix.png differ
diff --git a/www/img/ressources/amiga.png b/www/img/ressources/amiga.png
new file mode 100644
index 0000000000000000000000000000000000000000..b8ddd1040a180afea0c26b4ea6a7e2aa67e18210
Binary files /dev/null and b/www/img/ressources/amiga.png differ
diff --git a/www/img/ressources/apple.png b/www/img/ressources/apple.png
new file mode 100644
index 0000000000000000000000000000000000000000..fe1e738438bb5e7215e25c499e3b6a8c95aa5d26
Binary files /dev/null and b/www/img/ressources/apple.png differ
diff --git a/www/img/ressources/beos.png b/www/img/ressources/beos.png
new file mode 100644
index 0000000000000000000000000000000000000000..33d408acb5628f37f0d1c6458eea84eae3aa246a
Binary files /dev/null and b/www/img/ressources/beos.png differ
diff --git a/www/img/ressources/caldera.png b/www/img/ressources/caldera.png
new file mode 100644
index 0000000000000000000000000000000000000000..daf6607ab3959c15869aca5460f9e362cc77e7ea
Binary files /dev/null and b/www/img/ressources/caldera.png differ
diff --git a/www/img/ressources/cisco.png b/www/img/ressources/cisco.png
new file mode 100644
index 0000000000000000000000000000000000000000..bd0cfe0b43809e8a72d52d3bdcff0da44817dcf1
Binary files /dev/null and b/www/img/ressources/cisco.png differ
diff --git a/www/img/ressources/debian.png b/www/img/ressources/debian.png
new file mode 100644
index 0000000000000000000000000000000000000000..a30cee976a1130b8a95fcef7a0e0b6a631a007ac
Binary files /dev/null and b/www/img/ressources/debian.png differ
diff --git a/www/img/ressources/freebsd40.png b/www/img/ressources/freebsd40.png
new file mode 100644
index 0000000000000000000000000000000000000000..e26825db08b7c8c48b4c7ce06ccf09994a848a39
Binary files /dev/null and b/www/img/ressources/freebsd40.png differ
diff --git a/www/img/ressources/hp-printer40.png b/www/img/ressources/hp-printer40.png
new file mode 100644
index 0000000000000000000000000000000000000000..f1db0518fdb0c38c4c1e1046c79c4e7f5e6ccffa
Binary files /dev/null and b/www/img/ressources/hp-printer40.png differ
diff --git a/www/img/ressources/hpux.png b/www/img/ressources/hpux.png
new file mode 100644
index 0000000000000000000000000000000000000000..57fc27bc4b2d2a6aea70b809d0a6f667b42cccc2
Binary files /dev/null and b/www/img/ressources/hpux.png differ
diff --git a/www/img/ressources/irix.png b/www/img/ressources/irix.png
new file mode 100644
index 0000000000000000000000000000000000000000..e42070c6e6b6b92705083ebbe141ea419cf5a0e8
Binary files /dev/null and b/www/img/ressources/irix.png differ
diff --git a/www/img/ressources/linux40.png b/www/img/ressources/linux40.png
new file mode 100644
index 0000000000000000000000000000000000000000..55d676408269cab56346d3d04e7f2e3b5b383989
Binary files /dev/null and b/www/img/ressources/linux40.png differ
diff --git a/www/img/ressources/lotus.png b/www/img/ressources/lotus.png
new file mode 100644
index 0000000000000000000000000000000000000000..aff154eea6bf63eefe5a804a78b893aeea579bd2
Binary files /dev/null and b/www/img/ressources/lotus.png differ
diff --git a/www/img/ressources/mac40.png b/www/img/ressources/mac40.png
new file mode 100644
index 0000000000000000000000000000000000000000..47968ae3f3dd0d7302a08081c0f9928bfc44b4e7
Binary files /dev/null and b/www/img/ressources/mac40.png differ
diff --git a/www/img/ressources/mandrake.png b/www/img/ressources/mandrake.png
new file mode 100644
index 0000000000000000000000000000000000000000..b6a90b0177982ace69a62946c1d31086782d5df9
Binary files /dev/null and b/www/img/ressources/mandrake.png differ
diff --git a/www/img/ressources/next.png b/www/img/ressources/next.png
new file mode 100644
index 0000000000000000000000000000000000000000..fdd0c2d15031c9ac430f50be4456a17c6e0220e4
Binary files /dev/null and b/www/img/ressources/next.png differ
diff --git a/www/img/ressources/ng-switch40.png b/www/img/ressources/ng-switch40.png
new file mode 100644
index 0000000000000000000000000000000000000000..f7ca364d3fae39ad79fb7d6efcaea975bed82acb
Binary files /dev/null and b/www/img/ressources/ng-switch40.png differ
diff --git a/www/img/ressources/novell40.png b/www/img/ressources/novell40.png
new file mode 100644
index 0000000000000000000000000000000000000000..596d1a05227c1002dd46cfc23940f5500269cf62
Binary files /dev/null and b/www/img/ressources/novell40.png differ
diff --git a/www/img/ressources/openbsd.png b/www/img/ressources/openbsd.png
new file mode 100644
index 0000000000000000000000000000000000000000..1e05979c12c2e46b15e161c6f28418a25bba837c
Binary files /dev/null and b/www/img/ressources/openbsd.png differ
diff --git a/www/img/ressources/redhat.png b/www/img/ressources/redhat.png
new file mode 100644
index 0000000000000000000000000000000000000000..6cafd9d220b63b8848860c9c3c1410de988fb947
Binary files /dev/null and b/www/img/ressources/redhat.png differ
diff --git a/www/img/ressources/router40.png b/www/img/ressources/router40.png
new file mode 100644
index 0000000000000000000000000000000000000000..64bc5542e8fc0ae0f53b999acb23c2cae9598242
Binary files /dev/null and b/www/img/ressources/router40.png differ
diff --git a/www/img/ressources/slackware.png b/www/img/ressources/slackware.png
new file mode 100644
index 0000000000000000000000000000000000000000..c5cfec9cacc7d98b2e8be66e64cf988c6eee7e31
Binary files /dev/null and b/www/img/ressources/slackware.png differ
diff --git a/www/img/ressources/stampede.png b/www/img/ressources/stampede.png
new file mode 100644
index 0000000000000000000000000000000000000000..668e170afa260c545adf3f1c569693a8077a8178
Binary files /dev/null and b/www/img/ressources/stampede.png differ
diff --git a/www/img/ressources/storm.png b/www/img/ressources/storm.png
new file mode 100644
index 0000000000000000000000000000000000000000..9e9b7625d0475fefcb820deea1c6e66754b6ae65
Binary files /dev/null and b/www/img/ressources/storm.png differ
diff --git a/www/img/ressources/sun40.png b/www/img/ressources/sun40.png
new file mode 100644
index 0000000000000000000000000000000000000000..99617533ed9119ca45a951b5a8591e385367e31e
Binary files /dev/null and b/www/img/ressources/sun40.png differ
diff --git a/www/img/ressources/sunlogo.png b/www/img/ressources/sunlogo.png
new file mode 100644
index 0000000000000000000000000000000000000000..7b84f6fb8673606117dcdfe2ada6944bed376c00
Binary files /dev/null and b/www/img/ressources/sunlogo.png differ
diff --git a/www/img/ressources/switch40.png b/www/img/ressources/switch40.png
new file mode 100644
index 0000000000000000000000000000000000000000..6f5b2cba07772fb893dca687f7fb4fcd9ef66294
Binary files /dev/null and b/www/img/ressources/switch40.png differ
diff --git a/www/img/ressources/turbolinux.png b/www/img/ressources/turbolinux.png
new file mode 100644
index 0000000000000000000000000000000000000000..0ef62895781b6ab3d4687826d837abcdf07339fe
Binary files /dev/null and b/www/img/ressources/turbolinux.png differ
diff --git a/www/img/ressources/ultrapenguin.png b/www/img/ressources/ultrapenguin.png
new file mode 100644
index 0000000000000000000000000000000000000000..76a9cc85f8d0c1c3b51f8fa0c0e927a927456e85
Binary files /dev/null and b/www/img/ressources/ultrapenguin.png differ
diff --git a/www/img/ressources/unicos.png b/www/img/ressources/unicos.png
new file mode 100644
index 0000000000000000000000000000000000000000..8efe4ea5730bf0cc4a27c8af23b6c62b2e91cf39
Binary files /dev/null and b/www/img/ressources/unicos.png differ
diff --git a/www/img/ressources/win40.png b/www/img/ressources/win40.png
new file mode 100644
index 0000000000000000000000000000000000000000..cd34eafb90ebfef06c1552273dbf680dda5813a9
Binary files /dev/null and b/www/img/ressources/win40.png differ
diff --git a/www/img/ressources/yellowdog.png b/www/img/ressources/yellowdog.png
new file mode 100644
index 0000000000000000000000000000000000000000..336322ecc3735c9371adf2062e28f6dc274aa2bb
Binary files /dev/null and b/www/img/ressources/yellowdog.png differ
diff --git a/www/include/common/common-Func.php b/www/include/common/common-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..f854fbc26bd796a3c40f316ae44e6637f3c04751
--- /dev/null
+++ b/www/include/common/common-Func.php
@@ -0,0 +1,518 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function myDecode($arg)	{
+		return html_entity_decode($arg, ENT_QUOTES);
+	}
+
+	#
+	## SMARTY
+	#
+	
+	function initSmartyTpl($path = NULL, $tpl = NULL, $subDir = NULL)	{
+		if (!$tpl)
+			return;
+		$tpl->template_dir = $path . $subDir;
+		$tpl->compile_dir = "../GPL_LIB/SmartyCache/compile";
+		$tpl->config_dir = "../GPL_LIB/SmartyCache/config";
+		$tpl->cache_dir = "../GPL_LIB/SmartyCache/cache";
+
+		$tpl->caching = 0;
+		$tpl->compile_check = true;
+		$tpl->force_compile = true;
+		return $tpl;
+	}
+
+	function initSmartyTplForLogs($path = NULL, $tpl = NULL)	{
+		if (!$tpl)
+			return;
+		$tpl->template_dir = $path;
+		$tpl->compile_dir = "../../../GPL_LIB/SmartyCache/compile";
+		$tpl->config_dir = "../../../GPL_LIB/SmartyCache/config";
+		$tpl->cache_dir = "../../../GPL_LIB/SmartyCache/cache";
+
+		$tpl->caching = 0;
+		$tpl->compile_check = true;
+		$tpl->force_compile = true;
+		return $tpl;
+	}
+
+	#
+	## HOST
+	#
+	
+	function getMyHostName($host_id = NULL)	{
+		if (!$host_id) return;
+		global $pearDB;
+		while(1)	{
+			$res =& $pearDB->query("SELECT host_name, host_template_model_htm_id FROM host WHERE host_id = '".$host_id."' LIMIT 1");
+			$row =& $res->fetchRow();
+			if ($row["host_name"])
+				return $row["host_name"];
+			else if ($row["host_template_model_htm_id"])
+				$host_id = $row["host_template_model_htm_id"];
+			else
+				break;
+		}
+	}
+
+	function getMyHostAddress($host_id = NULL)	{
+		if (!$host_id) return;
+		global $pearDB;
+		while(1)	{
+			$res =& $pearDB->query("SELECT host_address, host_template_model_htm_id FROM host WHERE host_id = '".$host_id."' LIMIT 1");
+			$row =& $res->fetchRow();
+			if ($row["host_address"])
+				return $row["host_address"];
+			else if ($row["host_template_model_htm_id"])
+				$host_id = $row["host_template_model_htm_id"];
+			else
+				break;
+		}
+	}
+
+	function getMyHostAddressByName($host_name = NULL)	{
+		if (!$host_name) return;
+		global $pearDB;
+		while(1)	{
+			$res =& $pearDB->query("SELECT host_address, host_template_model_htm_id FROM host WHERE host_name = '".$host_name."' LIMIT 1");
+			$row =& $res->fetchRow();
+			if ($row["host_address"])
+				return $row["host_address"];
+			else if ($row["host_template_model_htm_id"])
+				$host_id = $row["host_template_model_htm_id"];
+			else
+				break;
+		}
+	}
+
+	function getMyHostParents($host_id = NULL)	{
+		if (!$host_id) return;
+		global $pearDB;
+		while(1)	{
+			$res =& $pearDB->query("SELECT host_template_model_htm_id AS tpl FROM host WHERE host_id = '".$host_id."'");
+			$host = clone($res->fetchRow());
+			$res =& $pearDB->query("SELECT hpr.host_parent_hp_id FROM host_hostparent_relation hpr WHERE hpr.host_host_id = '".$host_id."'");
+			if ($res->numRows())
+				return $res;
+			else if (isset($host["tpl"]) && $host["tpl"])
+				$host_id = $host["tpl"];
+			else
+				return $res;
+		}
+	}
+		
+	function getMySnmpCommunity($host_id = NULL)	{
+		if (!$host_id) return;
+		global $pearDB;
+		while(1)	{
+			$res =& $pearDB->query("SELECT host_snmp_community, host_template_model_htm_id FROM host WHERE host_id = '".$host_id."' LIMIT 1");
+			$row =& $res->fetchRow();
+			if ($row["host_snmp_community"])
+				return $row["host_snmp_community"];
+			else if ($row["host_template_model_htm_id"])
+				$host_id = $row["host_template_model_htm_id"];
+			else
+				break;
+		}
+	}
+
+	function getMySnmpVersion($host_id = NULL)	{
+		if (!$host_id) return;
+		global $pearDB;
+		while(1)	{
+			$res =& $pearDB->query("SELECT host_snmp_version, host_template_model_htm_id FROM host WHERE host_id = '".$host_id."' LIMIT 1");
+			$row =& $res->fetchRow();
+			if ($row["host_snmp_version"])
+				return $row["host_snmp_version"];
+			else if ($row["host_template_model_htm_id"])
+				$host_id = $row["host_template_model_htm_id"];
+			else
+				break;
+		}
+	}
+	
+	#
+	## HOST GROUP
+	#
+	
+	function getMyHostGroupName($hg_id = NULL)	{
+		if (!$hg_id) return;
+		global $pearDB;
+		$res =& $pearDB->query("SELECT hg_name FROM hostgroup WHERE hg_id = '".$hg_id."' LIMIT 1");
+		$row =& $res->fetchRow();
+		if ($row["hg_name"])
+			return $row["hg_name"];
+		return NULL;
+	}
+	
+	#
+	## SERVICE
+	#
+
+	function getMyServiceName($service_id = NULL)	{
+		if (!$service_id) return;
+		global $pearDB;
+		while(1)	{
+			$res =& $pearDB->query("SELECT service_description, service_template_model_stm_id FROM service WHERE service_id = '".$service_id."' LIMIT 1");
+			$row =& $res->fetchRow();
+			if ($row["service_description"])
+				return $row["service_description"];
+			else if ($row["service_template_model_stm_id"])
+				$service_id = $row["service_template_model_stm_id"];
+			else
+				break;
+		}
+	}
+
+	function getMyServiceGraphID($service_id = NULL)	{
+		if (!$service_id) return;
+		global $pearDB;
+		while(1)	{
+			$res =& $pearDB->query("SELECT esi.graph_id, service_template_model_stm_id FROM service, extended_service_information esi WHERE service_id = '".$service_id."' AND esi.service_service_id = service_id LIMIT 1");
+			$row =& $res->fetchRow();
+			if ($row["graph_id"])
+				return $row["graph_id"];
+			else if ($row["service_template_model_stm_id"])
+				$service_id = $row["service_template_model_stm_id"];
+			else
+				break;
+		}
+		return NULL;
+	}
+
+	function getMyServiceID($service_description = NULL, $host_id = NULL, $hg_id = NULL)	{
+		if (!$service_description && (!$host_id || !$hg_id)) return;
+		global $pearDB;
+		if ($host_id)	{
+			$res =& $pearDB->query("SELECT service_id FROM service, host_service_relation hsr " .
+					"WHERE hsr.host_host_id = '".$host_id."' AND hsr.service_service_id = service_id " .
+							"AND service_description = '".$service_description."' LIMIT 1");
+			$row =& $res->fetchRow();
+			# Service is directely link to a host, no problem
+			if ($row["service_id"])
+				return $row["service_id"];
+			# The Service might be link with a HostGroup
+			$res =& $pearDB->query("SELECT service_id FROM hostgroup_relation hgr, service, host_service_relation hsr" .
+					" WHERE hgr.host_host_id = '".$host_id."' AND hsr.hostgroup_hg_id = hgr.hostgroup_hg_id" .
+							" AND service_id = hsr.service_service_id AND service_description = '".$service_description."'");
+			$row =& $res->fetchRow();
+			if ($row["service_id"])
+				return $row["service_id"];
+		}
+		if ($hg_id)	{
+			$res =& $pearDB->query("SELECT service_id FROM service, host_service_relation hsr WHERE hsr.hostgroup_hg_id = '".$hg_id."' AND hsr.service_service_id = service_id AND service_description = '".$service_description."' LIMIT 1");
+			$row =& $res->fetchRow();
+			if ($row["service_id"])
+				return $row["service_id"];
+		}
+		return NULL;
+	}
+
+	function getAllMyServiceHosts($service_id = NULL)	{
+		if (!$service_id) return;
+		global $pearDB;
+		$hosts = array();
+		$res =& $pearDB->query("SELECT host_host_id, hostgroup_hg_id FROM host_service_relation hsr WHERE hsr.service_service_id = '".$service_id."'");
+		while ($res->fetchInto($elem))	{
+			if ($elem["host_host_id"])
+				$hosts[$elem["host_host_id"]] = $elem["host_host_id"];
+			else if ($elem["hostgroup_hg_id"])	{
+				$res2 =& $pearDB->query("SELECT host_host_id FROM hostgroup_relation hgr WHERE hgr.hostgroup_hg_id = '".$elem["hostgroup_hg_id"]."'");
+				while ($res2->fetchInto($elem2))
+					$hosts[$elem2["host_host_id"]] = $elem2["host_host_id"];
+				$res2->free();
+			}
+		}
+		$res->free();
+		return $hosts;
+	}
+
+	function getMyServiceHosts($service_id = NULL)	{
+		if (!$service_id) return;
+		global $pearDB;
+		$hosts = array();
+		$res =& $pearDB->query("SELECT DISTINCT host_host_id FROM host_service_relation hsr WHERE hsr.service_service_id = '".$service_id."'");
+		while ($res->fetchInto($elem))
+			if ($elem["host_host_id"])
+				$hosts[$elem["host_host_id"]] = $elem["host_host_id"];
+		$res->free();
+		return $hosts;
+	}
+
+	function getMyServiceHostGroups($service_id = NULL)	{
+		if (!$service_id) return;
+		global $pearDB;
+		$hgs = array();
+		$res =& $pearDB->query("SELECT DISTINCT hostgroup_hg_id FROM host_service_relation hsr WHERE hsr.service_service_id = '".$service_id."'");
+		while ($res->fetchInto($elem))
+			if ($elem["hostgroup_hg_id"])
+				$hgs[$elem["hostgroup_hg_id"]] = $elem["hostgroup_hg_id"];
+		$res->free();
+		return $hgs;
+	}
+
+	function getMyServiceTPLID($service_description = NULL)	{
+		if (!$service_description) return;
+		global $pearDB;
+		$res =& $pearDB->query("SELECT service_id FROM service WHERE service_description = '".htmlentities($service_description, ENT_QUOTES)."' AND service_register = '0' LIMIT 1");
+		$row =& $res->fetchRow();
+		if ($row["service_id"])
+			return $row["service_id"];
+		return NULL;
+	}
+
+	function isACheckGraphService($service_id = NULL)	{
+		if (!$service_id)	return;
+		global $pearDB;
+		while(1)	{
+			$res =& $pearDB->query("SELECT command_command_id, service_template_model_stm_id FROM service WHERE service_id = '".$service_id."' LIMIT 1");
+			$row =& $res->fetchRow();
+			if ($row["command_command_id"])	{
+				$res2 =& $pearDB->query("SELECT command_name FROM command WHERE command_id = '".$row["command_command_id"]."' LIMIT 1");
+				$row2 =& $res2->fetchRow();
+				if (strstr($row2["command_name"], "check_graph_"))
+					return true;
+				else
+					return false;
+			}
+			else if ($row["service_template_model_stm_id"])
+				$service_id = $row["service_template_model_stm_id"];
+			else
+				return NULL;
+		}
+		return NULL;
+	}
+	
+	#
+	## COMMAND
+	#
+		
+	function getMyCheckCmdGraph($service_id = NULL, $host_id = NULL)	{
+		if (!$service_id)	return;
+		global $pearDB;
+		$i = 0;
+		$host_id ? $host_id = "!".$host_id."_".$service_id : NULL;
+		while(1)	{
+			$res =& $pearDB->query("SELECT command_command_id, command_command_id_arg, service_template_model_stm_id FROM service WHERE service_id = '".$service_id."' LIMIT 1");
+			$row =& $res->fetchRow();
+			if ($row["command_command_id"])	{
+				$res2 =& $pearDB->query("SELECT command_name FROM command WHERE command_id = '".$row["command_command_id"]."' LIMIT 1");
+				$row2 =& $res2->fetchRow();
+				$row["command_command_id_arg"] = str_replace('#BR#', "\\n", $row["command_command_id_arg"]);
+				$row["command_command_id_arg"] = str_replace('#T#', "\\t", $row["command_command_id_arg"]);
+				$row["command_command_id_arg"] = str_replace('#R#', "\\r", $row["command_command_id_arg"]);
+				$row["command_command_id_arg"] = str_replace('#S#', "/", $row["command_command_id_arg"]);
+				$row["command_command_id_arg"] = str_replace('#BS#', "\\", $row["command_command_id_arg"]);
+				if (strstr($row2["command_name"], "check_graph_"))
+					return ($row2["command_name"].$row["command_command_id_arg"].$host_id);
+				else if (!$i)
+					return ($row2["command_name"].$row["command_command_id_arg"]);
+				else
+					return NULL;
+			}
+			else if ($row["service_template_model_stm_id"])
+				$service_id = $row["service_template_model_stm_id"];
+			else
+				return NULL;
+			$i++;
+		}
+		return NULL;
+	}
+
+	#
+	## Upload conf needs
+	#
+
+	function getMyHostID($host_name = NULL)	{
+		if (!$host_name) return;
+		global $pearDB;
+		$res =& $pearDB->query("SELECT host_id FROM host WHERE host_name = '".htmlentities($host_name, ENT_QUOTES)."' LIMIT 1");
+		if ($res->numRows())	{
+			$row =& $res->fetchRow();
+			return $row["host_id"];
+		}
+		return NULL;
+	}
+
+	function getMyHostGroupID($hostgroup_name = NULL)	{
+		if (!$hostgroup_name) return;
+		global $pearDB;
+		$res =& $pearDB->query("SELECT hg_id FROM hostgroup WHERE hg_name = '".htmlentities($hostgroup_name, ENT_QUOTES)."' LIMIT 1");
+		if ($res->numRows())	{
+			$row =& $res->fetchRow();
+			return $row["hg_id"];
+		}
+		return NULL;
+	}
+
+	function getMyServiceGroupID($servicegroup_name = NULL)	{
+		if (!$servicegroup_name) return;
+		global $pearDB;
+		$res =& $pearDB->query("SELECT sg_id FROM servicegroup WHERE sg_name = '".htmlentities($servicegroup_name, ENT_QUOTES)."' LIMIT 1");
+		if ($res->numRows())	{
+			$row =& $res->fetchRow();
+			return $row["sg_id"];
+		}
+		return NULL;
+	}
+
+	function getMyContactID($contact_name = NULL)	{
+		if (!$contact_name) return;
+		global $pearDB;
+		$res =& $pearDB->query("SELECT contact_id FROM contact WHERE contact_name = '".htmlentities($contact_name, ENT_QUOTES)."' LIMIT 1");
+		if ($res->numRows())	{
+			$row =& $res->fetchRow();
+			return $row["contact_id"];
+		}
+		return NULL;
+	}
+
+	function getMyContactGroupID($cg_name = NULL)	{
+		if (!$cg_name) return;
+		global $pearDB;
+		$res =& $pearDB->query("SELECT cg_id FROM contactgroup WHERE cg_name = '".htmlentities($cg_name, ENT_QUOTES)."' LIMIT 1");
+		if ($res->numRows())	{
+			$row =& $res->fetchRow();
+			return $row["cg_id"];
+		}
+		return NULL;
+	}
+
+	function getMyCommandID($command_name = NULL)	{
+		if (!$command_name) return;
+		global $pearDB;
+		$res =& $pearDB->query("SELECT command_id FROM command WHERE command_name = '".htmlentities($command_name, ENT_QUOTES)."' LIMIT 1");
+		if ($res->numRows())	{
+			$row =& $res->fetchRow();
+			return $row["command_id"];
+		}
+		$res->free();
+		return NULL;
+	}
+
+	function getMyTPID($tp_name = NULL)	{
+		if (!$tp_name) return;
+		global $pearDB;
+		$res =& $pearDB->query("SELECT tp_id FROM timeperiod WHERE tp_name = '".htmlentities($tp_name, ENT_QUOTES)."' LIMIT 1");
+		if ($res->numRows())	{
+			$row =& $res->fetchRow();
+			return $row["tp_id"];
+		}
+		return NULL;
+	}
+
+	function copyRrdDB($arg = NULL, $new_id = NULL, $host_id = NULL)	{
+		if (!$arg || !$new_id || !$host_id) return;
+		global $oreon;
+		$evol = explode("_", $arg);
+		if (isset($evol[1]))
+			$service_id = $evol[1];
+		else
+			$service_id = $evol[0];
+		if (is_file($oreon->optGen["oreon_path"]."filesUpload/rrd/".$arg.".rrd"))	{
+			copy($oreon->optGen["oreon_path"]."filesUpload/rrd/".$arg.".rrd", $oreon->optGen["oreon_path"]."rrd/".$host_id."_".$new_id.".rrd");
+		}
+		else if (is_file($oreon->optGen["oreon_path"]."filesUpload/rrd/".$service_id.".rrd"))	{
+			copy( $oreon->optGen["oreon_path"]."filesUpload/rrd/".$service_id.".rrd", $oreon->optGen["oreon_path"]."rrd/".$host_id."_".$new_id.".rrd");
+		}
+	}
+	
+	#
+	## GRAPHS	
+	#
+	
+	function getDefaultGraph ($service_id = NULL, $rrdType = NULL)	{
+		// rrdType = 1 -> Graphs Perfparse
+		// rrdType = 2 -> Graphs Plugins
+		// rrdType = 3 -> Graphs Customs
+		global $pearDB;
+		if (!$rrdType)	$rrdType = 1;
+		if ($rrdType != 3)	{			
+			$gt["graph_id"] = getMyServiceGraphID($service_id);
+			if ($gt["graph_id"])
+				return $gt["graph_id"];
+		}
+		else	{
+			$res =& $pearDB->query("SELECT grapht_graph_id FROM giv_graphs WHERE graph_id = '".$service_id."' LIMIT 1");
+			$gt =& $res->fetchRow();
+			if ($gt["grapht_graph_id"])
+				return $gt["grapht_graph_id"];	
+		}
+		if ($rrdType != 2)	{
+			$res =& $pearDB->query("SELECT graph_id FROM giv_graphs_template WHERE default_tpl1 = '1' LIMIT 1");
+			if ($res->numRows())	{
+				$gt =& $res->fetchRow();
+				return $gt["graph_id"];
+			}
+		}	
+		else	{
+			$res =& $pearDB->query("SELECT graph_id FROM giv_graphs_template WHERE default_tpl2 = '1' LIMIT 1");
+			if ($res->numRows())	{
+				$gt =& $res->fetchRow();
+				return $gt["graph_id"];
+			}
+		}
+		$res =& $pearDB->query("SELECT graph_id FROM giv_graphs_template LIMIT 1");
+		if ($res->numRows())	{
+			$gt =& $res->fetchRow();
+			return $gt["graph_id"];
+		}
+		return NULL;
+	}
+	
+	function getDefaultDS ($graph_id = NULL, $current_ds = NULL, $rrdType = NULL)	{
+		// rrdType = 1 -> Graphs Perfparse
+		// rrdType = 2 -> Graphs Plugins
+		// rrdType = 3 -> Graphs Customs
+		if (!$graph_id) return NULL;
+		global $pearDB;
+		if (!$rrdType)	$rrdType = 1;
+		$ds = array();
+		$res =& $pearDB->query("SELECT gct.compo_id FROM giv_components_template gct, giv_graphT_componentT_relation ggcr WHERE ggcr.gg_graph_id = '".$graph_id."' AND ggcr.gc_compo_id = gct.compo_id ORDER BY gct.ds_order");
+		$cpt = 0;
+		$sum = $res->numRows();
+		while ($res->fetchInto($ds))	{
+			if ($current_ds == $cpt)
+				return $ds["compo_id"];
+			$cpt++;				 
+		}
+		if ($rrdType != 2)	{
+			$res =& $pearDB->query("SELECT compo_id FROM giv_components_template WHERE default_tpl1 = '1' LIMIT 1");
+			if ($res->numRows())	{
+				$ds =& $res->fetchRow();
+				return $ds["compo_id"];
+			}
+		}
+		else	{
+			$res =& $pearDB->query("SELECT compo_id FROM giv_components_template WHERE default_tpl2 = '1' LIMIT 1");
+			if ($res->numRows())	{
+				$ds =& $res->fetchRow();
+				return $ds["compo_id"];
+			}
+		}
+		$res =& $pearDB->query("SELECT compo_id FROM giv_components_template LIMIT 1");
+		if ($res->numRows())	{
+			$ds =& $res->fetchRow();
+			return $ds["compo_id"];
+		}
+		return NULL;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/common/javascript/autoSelectCommandExample.js b/www/include/common/javascript/autoSelectCommandExample.js
new file mode 100644
index 0000000000000000000000000000000000000000..28f5538c65d76feb52518d1496ef9055d8536e15
--- /dev/null
+++ b/www/include/common/javascript/autoSelectCommandExample.js
@@ -0,0 +1,68 @@
+/**
+Oreon is developped with Apache Licence 2.0 :
+http://www.apache.org/licenses/LICENSE-2.0.txt
+Developped by : Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+// JavaScript Document
+function set_arg(e, a) {
+var f = document.forms["Form"];
+	var example    = f.elements[e];
+	var argument    = f.elements[a];
+
+
+	argument.value = example.value;
+}
+
+function setArgument(f, l, a) {
+	var mlist    = f.elements[l];
+	var argument    = f.elements[a];
+
+	var index = mlist.selectedIndex;
+
+	if(argument.value)	
+	argument.value = '';
+
+	if(index > 1) 
+ {
+	   var xhr_object = null; 
+	     
+	   if(window.XMLHttpRequest) // Firefox 
+	      xhr_object = new XMLHttpRequest(); 
+	   else if(window.ActiveXObject) // Internet Explorer 
+	      xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
+	   else { // XMLHttpRequest non supporté par le navigateur 
+	      alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
+	      return; 
+	   } 
+	 
+	   xhr_object.open("POST", "./include/common/javascript/autoSelectCommandExample.php", true);
+
+
+	   xhr_object.onreadystatechange = function() { 
+	      if(xhr_object.readyState == 4) 
+	      {	      
+	          argument.value = xhr_object.responseText; 
+	         }
+	   } 
+	 
+	   xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 
+//	   var data = "family="+escape(l1.options[index].value)+"&form="+f.name+"&select=list2"; 
+
+	   var data = ""; 
+var s1       = mlist.value; 
+if( s1 != "") 
+	   data = "s1="+s1; 
+	   xhr_object.send(data); 
+	} 
+}
\ No newline at end of file
diff --git a/www/include/common/javascript/autoSelectCommandExample.php b/www/include/common/javascript/autoSelectCommandExample.php
new file mode 100644
index 0000000000000000000000000000000000000000..8d803a34de14f47a0d82267c61a2cd2ac5b33a13
--- /dev/null
+++ b/www/include/common/javascript/autoSelectCommandExample.php
@@ -0,0 +1,49 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	# return argument for specific command in txt format
+	# use by ajax
+
+	require_once("../../../oreon.conf.php");
+	require_once("../../../DBconnect.php");
+	
+	
+	header('Content-type: text/html; charset=iso-8859-1'); 
+	 
+	if(count($_POST) > 0) 
+	{ 
+	   foreach($_POST as $v) 
+	      $command_id = utf8_decode($v); 
+	} 
+
+
+	if(!is_null($command_id))
+	{
+		header('Content-Type: text/xml;charset=utf-8');
+
+		$res =& $pearDB->query("SELECT command_example FROM command WHERE" .
+			" command_id = '".$command_id."' ");
+		while($res->fetchInto($arg))
+			echo $arg["command_example"];
+
+		$pearDB->disconnect();
+	}	
+
+?>
diff --git a/www/include/common/javascript/autocomplete-3-2.js b/www/include/common/javascript/autocomplete-3-2.js
new file mode 100644
index 0000000000000000000000000000000000000000..93a798cbe039884c1f7aea6399e9c262a4733f3c
--- /dev/null
+++ b/www/include/common/javascript/autocomplete-3-2.js
@@ -0,0 +1,559 @@
+/**
+Oreon is developped with Apache Licence 2.0 :
+http://www.apache.org/licenses/LICENSE-2.0.txt
+Developped by : Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+// JavaScript Document
+
+// retourne un objet xmlHttpRequest.
+// m�thode compatible entre tous les navigateurs (IE/Firefox/Opera)
+function getXMLHTTP(){
+  var xhr=null;
+  if(window.XMLHttpRequest) // Firefox et autres
+  xhr = new XMLHttpRequest();
+  else if(window.ActiveXObject){ // Internet Explorer
+    try {
+      xhr = new ActiveXObject("Msxml2.XMLHTTP");
+    } catch (e) {
+      try {
+        xhr = new ActiveXObject("Microsoft.XMLHTTP");
+      } catch (e1) {
+        xhr = null;
+      }
+    }
+  }
+  else { // XMLHttpRequest non support� par le navigateur
+    alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
+  }
+  return xhr;
+}
+
+var _documentForm=null; // le formulaire contenant notre champ texte
+var _inputField=null; // le champ texte lui-m�me
+var _submitButton=null; // le bouton submit de notre formulaire
+
+function initAutoComplete(mform,mcity_name,msub){
+
+_documentForm=document.getElementById(mform);
+  _inputField=document.getElementById(mcity_name);
+  _submitButton=document.getElementById(msub);
+
+  _inputField.autocomplete="off";
+  creeAutocompletionDiv();
+  _currentInputFieldValue=_inputField.value;
+  _oldInputFieldValue=_currentInputFieldValue;
+  cacheResults("",new Array())
+  document.onkeydown=onKeyDownHandler;
+  _inputField.onkeyup=onKeyUpHandler;
+  _inputField.onblur=onBlurHandler;
+  window.onresize=onResizeHandler;
+  // Premier d�clenchement de la fonction dans 200 millisecondes
+  setTimeout("mainLoop()",100)
+}
+
+var _oldInputFieldValue=""; // valeur pr�c�dente du champ texte
+var _currentInputFieldValue=""; // valeur actuelle du champ texte
+var _resultCache=new Object(); // m�canisme de cache des requetes
+
+// tourne en permanence pour suggerer suite � un changement du champ texte
+function mainLoop(){
+  if(_oldInputFieldValue!=_currentInputFieldValue){
+    var valeur=escapeURI(_currentInputFieldValue);
+    var country=document.Form.elements['country_id'].options[document.Form.elements['country_id'].selectedIndex].value;
+    var suggestions=_resultCache[_currentInputFieldValue];
+    if(suggestions){ // la r�ponse �tait encore dans le cache
+      metsEnPlace(valeur,suggestions)
+    }else{
+      callSuggestions(valeur, country) // appel distant
+    }
+    _inputField.focus()
+  }
+  _oldInputFieldValue=_currentInputFieldValue;
+  setTimeout("mainLoop()",100); // la fonction se red�clenchera dans 200 ms
+  return true
+}
+
+// echappe les caract�re sp�ciaux
+function escapeURI(La){
+  if(encodeURIComponent) {
+    return encodeURIComponent(La);
+  }
+  if(escape) {
+    return escape(La)
+  }
+}
+
+var _xmlHttp = null; //l'objet xmlHttpRequest utilis� pour contacter le serveur
+var _adresseRecherche = "./include/common/javascript/autocompleteOptions.php" //l'adresse � interroger pour trouver les suggestions
+
+function callSuggestions(valeur, country){
+  if(_xmlHttp&&_xmlHttp.readyState!=0){
+    _xmlHttp.abort()
+  }
+  _xmlHttp=getXMLHTTP();
+  if(_xmlHttp){
+    //appel � l'url distante
+    _xmlHttp.open("GET",_adresseRecherche+"?debut="+valeur+"&country="+country,true);
+    _xmlHttp.onreadystatechange=function() {
+      if(_xmlHttp.readyState==4&&_xmlHttp.responseXML) {
+	      var liste = traiteXmlSuggestions(_xmlHttp.responseXML)
+        cacheResults(valeur,liste)
+        metsEnPlace(valeur,liste)
+      }
+    };
+    // envoi de la requete
+    _xmlHttp.send(null)
+  }
+}
+
+// Mecanisme de caching des r�ponses
+function cacheResults(debut,suggestions){
+  _resultCache[debut]=suggestions
+}
+
+// Transformation XML en tableau
+function traiteXmlSuggestions(xmlDoc) {
+  var options = xmlDoc.getElementsByTagName('option');
+  var optionsListe = new Array();
+  for (var i=0; i < options.length; ++i) {
+    optionsListe.push(options[i].firstChild.data);
+  }
+  return optionsListe;
+}
+
+//ins�re une r�gle avec son nom
+function insereCSS(nom,regle){
+  if (document.styleSheets) {
+    var I=document.styleSheets[0];
+    if(I.addRule){ // m�thode IE
+      I.addRule(nom,regle)
+    }else if(I.insertRule){ // m�thode DOM
+      I.insertRule(nom+" { "+regle+" }",I.cssRules.length)
+    }
+  }
+}
+
+function initStyle(){
+  var AutoCompleteDivListeStyle="font-size: 13px; font-family: arial,sans-serif; word-wrap:break-word; ";
+  var AutoCompleteDivStyle="display: block; padding-left: 3; padding-right: 3; height: 16px; overflow: hidden; background-color: white;";
+  var AutoCompleteDivActStyle="background-color: #3366cc; color: white ! important; ";
+  insereCSS(".AutoCompleteDivListeStyle",AutoCompleteDivListeStyle);
+  insereCSS(".AutoCompleteDiv",AutoCompleteDivStyle);
+  insereCSS(".AutoCompleteDivAct",AutoCompleteDivActStyle);
+}
+
+function setStylePourElement(c,name){
+  c.className=name;
+}
+
+// calcule le d�calage � gauche
+function calculateOffsetLeft(r){
+  return calculateOffset(r,"offsetLeft")
+}
+
+// calcule le d�calage vertical
+function calculateOffsetTop(r){
+  return calculateOffset(r,"offsetTop")
+}
+
+function calculateOffset(r,attr){
+  var kb=0;
+  while(r){
+    kb+=r[attr];
+    r=r.offsetParent
+  }
+  return kb
+}
+
+// calcule la largeur du champ
+function calculateWidth(){
+  return _inputField.offsetWidth
+}
+
+function setCompleteDivSize(){
+  if(_completeDiv){
+    _completeDiv.style.left=calculateOffsetLeft(_inputField)+"px";
+    _completeDiv.style.top=calculateOffsetTop(_inputField)+_inputField.offsetHeight-1+"px";
+    _completeDiv.style.width=calculateWidth()+"px"
+  }
+}
+
+function creeAutocompletionDiv() {
+  initStyle();
+  _completeDiv=document.createElement("DIV");
+  _completeDiv.id="completeDiv";
+  var borderLeftRight=1;
+  var borderTopBottom=1;
+  _completeDiv.style.borderRight="black "+borderLeftRight+"px solid";
+  _completeDiv.style.borderLeft="black "+borderLeftRight+"px solid";
+  _completeDiv.style.borderTop="black "+borderTopBottom+"px solid";
+  _completeDiv.style.borderBottom="black "+borderTopBottom+"px solid";
+  _completeDiv.style.zIndex="1";
+  _completeDiv.style.paddingRight="0";
+  _completeDiv.style.paddingLeft="0";
+  _completeDiv.style.paddingTop="0";
+  _completeDiv.style.paddingBottom="0";
+  setCompleteDivSize();
+  _completeDiv.style.visibility="hidden";
+  _completeDiv.style.position="absolute";
+  _completeDiv.style.backgroundColor="white";
+  document.body.appendChild(_completeDiv);
+  setStylePourElement(_completeDiv,"AutoCompleteDivListeStyle");
+}
+
+function metsEnPlace(valeur, liste){
+  while(_completeDiv.childNodes.length>0) {
+    _completeDiv.removeChild(_completeDiv.childNodes[0]);
+  }
+  // mise en place des suggestions
+  for(var f=0; f<liste.length; ++f){
+    var nouveauDiv=document.createElement("DIV");
+    nouveauDiv.onmousedown=divOnMouseDown;
+    nouveauDiv.onmouseover=divOnMouseOver;
+    nouveauDiv.onmouseout=divOnMouseOut;
+    setStylePourElement(nouveauDiv,"AutoCompleteDiv");
+    var nouveauSpan=document.createElement("SPAN");
+    nouveauSpan.innerHTML=liste[f]; // le texte de la suggestion
+    nouveauDiv.appendChild(nouveauSpan);
+    _completeDiv.appendChild(nouveauDiv)
+  }
+  PressAction();
+  if(_completeDivRows>0) {
+    _completeDiv.height=16*_completeDivRows+4;
+  } else {
+    hideCompleteDiv();
+  }
+
+}
+
+var _lastKeyCode=null;
+
+// Handler pour le keydown du document
+var onKeyDownHandler=function(event){
+  // acc�s evenement compatible IE/Firefox
+  if(!event&&window.event) {
+    event=window.event;
+  }
+  // on enregistre la touche ayant d�clench� l'evenement
+  if(event) {
+    _lastKeyCode=event.keyCode;
+  }
+}
+
+var _eventKeycode = null;
+
+// Handler pour le keyup de lu champ texte
+var onKeyUpHandler=function(event){
+  // acc�s evenement compatible IE/Firefox
+  if(!event&&window.event) {
+    event=window.event;
+  }
+  _eventKeycode=event.keyCode;
+  // Dans les cas touches touche haute(38) ou touche basse (40)
+  if(_eventKeycode==40||_eventKeycode==38) {
+    // on autorise le blur du champ (traitement dans onblur)
+    blurThenGetFocus();
+  }
+  // taille de la selection
+  var N=rangeSize(_inputField);
+  // taille du texte avant la selection (selection = suggestion d'autocompl�tion)
+  var v=beforeRangeSize(_inputField);
+  // contenu du champ texte
+  var V=_inputField.value;
+  if(_eventKeycode!=0){
+    if(N>0&&v!=-1) {
+      // on recupere uniquement le champ texte tap� par l'utilisateur
+      V=V.substring(0,v);
+    }
+    // 13 = touche entr�e
+    if(_eventKeycode==13||_eventKeycode==3){
+      var d=_inputField;
+      // on mets en place l'ensemble du champ texte en repoussant la selection
+      if(_inputField.createTextRange){
+        var t=_inputField.createTextRange();
+        t.moveStart("character",_inputField.value.length);
+        _inputField.select()
+      } else if (d.setSelectionRange){
+        _inputField.setSelectionRange(_inputField.value.length,_inputField.value.length)
+      }
+    } else {
+      // si on a pas pu agrandir le champ non selectionn�, on le mets en place violemment.
+      if(_inputField.value!=V) {
+        _inputField.value=V
+      }
+    }
+  }
+  // si la touche n'est ni haut, ni bas, on stocke la valeur utilisateur du champ
+  if(_eventKeycode!=40&&_eventKeycode!=38) {
+    // le champ courant n est pas change si key Up ou key Down
+  	_currentInputFieldValue=V;
+  }
+  if(handleCursorUpDownEnter(_eventKeycode)&&_eventKeycode!=0) {
+    // si on a pr�ss� une touche autre que haut/bas/enter
+    PressAction();
+  }
+}
+
+// Change la suggestion selectionn�.
+// cette m�thode traite les touches haut, bas et enter
+function handleCursorUpDownEnter(eventCode){
+  if(eventCode==40){
+    highlightNewValue(_highlightedSuggestionIndex+1);
+    return false
+  }else if(eventCode==38){
+    highlightNewValue(_highlightedSuggestionIndex-1);
+    return false
+  }else if(eventCode==13||eventCode==3){
+    return false
+  }
+  return true
+}
+
+var _completeDivRows = 0;
+var _completeDivDivList = null;
+var _highlightedSuggestionIndex = -1;
+var _highlightedSuggestionDiv = null;
+
+// g�re une touche press�e autre que haut/bas/enter
+function PressAction(){
+  _highlightedSuggestionIndex=-1;
+  var suggestionList=_completeDiv.getElementsByTagName("div");
+  var suggestionLongueur=suggestionList.length;
+  // on stocke les valeurs pr�c�dentes
+  // nombre de possibilit�s de compl�tion
+  _completeDivRows=suggestionLongueur;
+  // possiblit�s de compl�tion
+  _completeDivDivList=suggestionList;
+  // si le champ est vide, on cache les propositions de compl�tion
+  if(_currentInputFieldValue==""||suggestionLongueur==0){
+    hideCompleteDiv()
+  }else{
+    showCompleteDiv()
+  }
+  var trouve=false;
+  // si on a du texte sur lequel travailler
+  if(_currentInputFieldValue.length>0){
+    var indice;
+    // T vaut true si on a dans la liste de suggestions un mot commencant comme l'entr�e utilisateur
+    for(indice=0; indice<suggestionLongueur; indice++){
+      if(getSuggestion(suggestionList.item(indice)).toUpperCase().indexOf(_currentInputFieldValue.toUpperCase())==0) {
+        trouve=true;
+        break
+      }
+    }
+  }
+  // on d�s�lectionne toutes les suggestions
+  for(var i=0; i<suggestionLongueur; i++) {
+    setStylePourElement(suggestionList.item(i),"AutoCompleteDiv");
+  }
+  // si l'entr�e utilisateur (n) est le d�but d'une suggestion (n-1) on s�lectionne cette suggestion avant de continuer
+  if(trouve){
+    _highlightedSuggestionIndex=indice;
+    _highlightedSuggestionDiv=suggestionList.item(_highlightedSuggestionIndex);
+  }else{
+    _highlightedSuggestionIndex=-1;
+    _highlightedSuggestionDiv=null
+  }
+  var supprSelection=false;
+  switch(_eventKeycode){
+    // cursor left, cursor right, page up, page down, others??
+    case 8:
+    case 33:
+    case 34:
+    case 35:
+    case 35:
+    case 36:
+    case 37:
+    case 39:
+    case 45:
+    case 46:
+      // on supprime la suggestion du texte utilisateur
+      supprSelection=true;
+      break;
+    default:
+      break
+  }
+  // si on a une suggestion (n-1) s�lectionn�e
+  if(!supprSelection&&_highlightedSuggestionDiv){
+    setStylePourElement(_highlightedSuggestionDiv,"AutoCompleteDivAct");
+    var z;
+    if(trouve) {
+      z=getSuggestion(_highlightedSuggestionDiv).substr(0);
+    } else {
+      z=_currentInputFieldValue;
+    }
+    if(z!=_inputField.value){
+      if(_inputField.value!=_currentInputFieldValue) {
+        return;
+      }
+      // si on peut cr�er des range dans le document
+      if(_inputField.createTextRange||_inputField.setSelectionRange) {
+        _inputField.value=z;
+      }
+      // on s�lectionne la fin de la suggestion
+      if(_inputField.createTextRange){
+        var t=_inputField.createTextRange();
+        t.moveStart("character",_currentInputFieldValue.length);
+        t.select()
+      }else if(_inputField.setSelectionRange){
+        _inputField.setSelectionRange(_currentInputFieldValue.length,_inputField.value.length)
+      }
+    }
+  }else{
+    // sinon, plus aucune suggestion de s�lectionn�e
+    _highlightedSuggestionIndex=-1;
+  }
+}
+
+var _cursorUpDownPressed = null;
+
+// permet le blur du champ texte apr�s que la touche haut/bas ai �t� press�.
+// le focus est r�cup�r� apr�s traitement (via le timeout).
+function blurThenGetFocus(){
+  _cursorUpDownPressed=true;
+  _inputField.blur();
+  setTimeout("_inputField.focus();",10);
+  return
+}
+
+// taille de la selection dans le champ input
+function rangeSize(n){
+  var N=-1;
+  if(n.createTextRange){
+    var fa=document.selection.createRange().duplicate();
+    N=fa.text.length
+  }else if(n.setSelectionRange){
+    N=n.selectionEnd-n.selectionStart
+  }
+  return N
+}
+
+// taille du champ input non selectionne
+function beforeRangeSize(n){
+  var v=0;
+  if(n.createTextRange){
+    var fa=document.selection.createRange().duplicate();
+    fa.moveEnd("textedit",1);
+    v=n.value.length-fa.text.length
+  }else if(n.setSelectionRange){
+    v=n.selectionStart
+  }else{
+    v=-1
+  }
+  return v
+}
+
+// Place le curseur � la fin du champ
+function cursorAfterValue(n){
+  if(n.createTextRange){
+    var t=n.createTextRange();
+    t.moveStart("character",n.value.length);
+    t.select()
+  } else if(n.setSelectionRange) {
+    n.setSelectionRange(n.value.length,n.value.length)
+  }
+}
+
+
+// Retourne la valeur de la possibilite (texte) contenu dans une div de possibilite
+function getSuggestion(uneDiv){
+  if(!uneDiv) {
+    return null;
+  }
+  return trimCR(uneDiv.getElementsByTagName('span')[0].firstChild.data)
+}
+
+// supprime les caract�res retour chariot et line feed d'une chaine de caract�res
+function trimCR(chaine){
+  for(var f=0,nChaine="",zb="\n\r"; f<chaine.length; f++) {
+    if (zb.indexOf(chaine.charAt(f))==-1) {
+      nChaine+=chaine.charAt(f);
+    }
+  }
+  return nChaine
+}
+
+// Cache completement les choix de completion
+function hideCompleteDiv(){
+  _completeDiv.style.visibility="hidden"
+}
+
+// Rends les choix de completion visibles
+function showCompleteDiv(){
+  _completeDiv.style.visibility="visible";
+  setCompleteDivSize()
+}
+
+// Change la suggestion en surbrillance
+function highlightNewValue(C){
+  if(!_completeDivDivList||_completeDivRows<=0) {
+    return;
+  }
+  showCompleteDiv();
+  if(C>=_completeDivRows){
+    C=_completeDivRows-1
+  }
+  if(_highlightedSuggestionIndex!=-1&&C!=_highlightedSuggestionIndex){
+    setStylePourElement(_highlightedSuggestionDiv,"AutoCompleteDiv");
+    _highlightedSuggestionIndex=-1
+  }
+  if(C<0){
+    _highlightedSuggestionIndex=-1;
+    _inputField.focus();
+    return
+  }
+  _highlightedSuggestionIndex=C;
+  _highlightedSuggestionDiv=_completeDivDivList.item(C);
+  setStylePourElement(_highlightedSuggestionDiv,"AutoCompleteDivAct");
+  _inputField.value=getSuggestion(_highlightedSuggestionDiv);
+}
+
+// Handler de resize de la fenetre
+var onResizeHandler=function(event){
+  // recalcule la taille des suggestions
+  setCompleteDivSize();
+}
+
+// Handler de blur sur le champ texte
+var onBlurHandler=function(event){
+  if(!_cursorUpDownPressed){
+    // si le blur n'est pas caus� par la touche haut/bas
+    hideCompleteDiv();
+    // Si la derni�re touche pr�ss� est tab, on passe au bouton de validation
+    if(_lastKeyCode==9){
+      _submitButton.focus();
+      _lastKeyCode=-1
+    }
+  }
+  _cursorUpDownPressed=false
+};
+
+// declenchee quand on clique sur une div contenant une possibilite
+var divOnMouseDown=function(){
+  _inputField.value=getSuggestion(this);
+  _documentForm.submit()
+};
+
+// declenchee quand on passe sur une div de possibilite. La div pr�c�dente est passee en style normal
+var divOnMouseOver=function(){
+  if(_highlightedSuggestionDiv) {
+    setStylePourElement(_highlightedSuggestionDiv,"AutoCompleteDiv");
+  }
+  setStylePourElement(this,"AutoCompleteDivAct")
+};
+
+// declenchee quand la sourie quitte une div de possiblite. La div repasse a l'etat normal
+var divOnMouseOut = function(){
+  setStylePourElement(this,"AutoCompleteDiv");
+};
diff --git a/www/include/common/javascript/autocompleteOptions.php b/www/include/common/javascript/autocompleteOptions.php
new file mode 100644
index 0000000000000000000000000000000000000000..fdb0515b2dfaa729c95769a9b38269e4d1adce62
--- /dev/null
+++ b/www/include/common/javascript/autocompleteOptions.php
@@ -0,0 +1,21 @@
+<?
+	require_once("../../../oreon.conf.php");
+	require_once("../../../DBconnect.php");
+	
+	if (isset($_GET['debut']))
+		$debut = utf8_decode($_GET['debut']);
+	else
+		$debut = "ni";
+	if (isset($_GET['country']))
+		$country = utf8_decode($_GET['country']);
+	else
+		$country = '1';
+	header('Content-Type: text/xml;charset=utf-8');
+	echo(utf8_encode("<?xml version='1.0' encoding='UTF-8' ?><options>"));	
+	$debut = strtolower($debut);
+	$res =& $pearDB->query("SELECT DISTINCT city_name FROM view_city WHERE country_id = '".$country."' AND city_name LIKE '".$debut."%' ORDER BY city_name limit 0,10");
+	while($res->fetchInto($city))
+		echo(utf8_encode("<option>".$city["city_name"]."</option>"));
+	echo("</options>");
+	$pearDB->disconnect();
+?>
diff --git a/www/include/common/javascript/autocompletion.css b/www/include/common/javascript/autocompletion.css
new file mode 100644
index 0000000000000000000000000000000000000000..eee20e4f50e782284dbf4286a3854c3920ccdeb4
--- /dev/null
+++ b/www/include/common/javascript/autocompletion.css
@@ -0,0 +1,2 @@
+body {
+}
\ No newline at end of file
diff --git a/www/include/common/javascript/color_picker.html b/www/include/common/javascript/color_picker.html
new file mode 100644
index 0000000000000000000000000000000000000000..bb7ed3f6c8fea2c1fc42ac92898ba6f9fe81b25c
--- /dev/null
+++ b/www/include/common/javascript/color_picker.html
@@ -0,0 +1,189 @@
+<html>
+<head>
+	<title>Color Picker</title>
+	<style type="text/css">
+	
+		body	{ font-size: 12px; font-family: Verdana, Sans-Serif; text-align:center; background-color:#FFFFFF; color:navy;}
+		td  { font-size: 12px; font-family: Verdana, Sans-Serif; text-align:center; background-color:#FFFFFF}
+		.table_black_border {border-style:solid; border-width:1px; border-color:#000000;}
+
+   </style>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<script type="text/javascript">
+	
+		// D�pos� par Frosty sur www.toutjavascript.com
+		// 27/5/2003 - Ajout compatibilit� IE5 sur MacOS
+		// 5/6/2003  - Ajout compatibilit� Mozilla
+		// 5/9/2005  - Correction d'un bug (clic sur la bordure de la palette principale)
+		// 6/9/2005  - Ajout de la possibilit� de s�lectionner une couleur en d�pla�ant la souris
+		//             sur les palettes (bouton gauche enfonc�)
+
+		/*****************************************************************
+		* Script Color Picker �crit par Frosty (Maxime Pacary) - Mai 2003
+		******************************************************************/
+	
+		// var. globale
+		var detail = 50; // nombre de nuances de couleurs dans la barre de droite
+		
+		// ne pas modifier
+		var strhex = "0123456789ABCDEF";
+		var i;
+		var is_mouse_down = false;
+		var is_mouse_over = false;
+		
+		// conversion decimal (0-255) => hexa
+		function dechex(n) {
+			return strhex.charAt(Math.floor(n/16)) + strhex.charAt(n%16);
+		}
+
+		// d�tection d'un clic/mouvement souris sur la "palette" (� gauche)
+		function compute_color(e)
+		{
+			x = e.offsetX ? e.offsetX : (e.target ? e.clientX-e.target.x : 0);
+			y = e.offsetY ? e.offsetY : (e.target ? e.clientY-e.target.y : 0);
+			
+			// calcul de la couleur � partir des coordonn�es du clic
+			var part_width = document.all ? document.all.color_picker.width/6 : document.getElementById('color_picker').width/6;
+			var part_detail = detail/2;
+			var im_height = document.all ? document.all.color_picker.height : document.getElementById('color_picker').height;
+			
+			
+			var red = (x >= 0)*(x < part_width)*255
+					+ (x >= part_width)*(x < 2*part_width)*(2*255 - x * 255 / part_width)
+					+ (x >= 4*part_width)*(x < 5*part_width)*(-4*255 + x * 255 / part_width)
+					+ (x >= 5*part_width)*(x < 6*part_width)*255;
+			var blue = (x >= 2*part_width)*(x < 3*part_width)*(-2*255 + x * 255 / part_width)
+					+ (x >= 3*part_width)*(x < 5*part_width)*255
+					+ (x >= 5*part_width)*(x < 6*part_width)*(6*255 - x * 255 / part_width);
+			var green = (x >= 0)*(x < part_width)*(x * 255 / part_width)
+					+ (x >= part_width)*(x < 3*part_width)*255
+					+ (x >= 3*part_width)*(x < 4*part_width)*(4*255 - x * 255 / part_width);
+			
+			var coef = (im_height-y)/im_height;
+			
+			// composantes de la couleur choisie sur la "palette"
+			red = 128+(red-128)*coef;
+			green = 128+(green-128)*coef;
+			blue = 128+(blue-128)*coef;
+			
+			// mise � jour de la couleur finale
+			changeFinalColor('#' + dechex(red) + dechex(green) + dechex(blue));
+			
+			// mise � jour de la barre de droite en fonction de cette couleur
+			for(i = 0; i < detail; i++)
+			{
+				if ((i >= 0) && (i < part_detail))
+				{
+					var final_coef = i/part_detail ;
+					var final_red = dechex(255 - (255 - red) * final_coef);
+					var final_green = dechex(255 - (255 - green) * final_coef);
+					var final_blue = dechex(255 - (255 - blue) * final_coef);
+				}
+				else
+				{
+					var final_coef = 2 - i/part_detail ;
+					var final_red = dechex(red * final_coef);
+					var final_green = dechex(green * final_coef);
+					var final_blue = dechex(blue * final_coef);
+				}
+				color = final_red + final_green + final_blue ;
+				document.all ? document.all('gs'+i).style.backgroundColor = '#'+color : document.getElementById('gs'+i).style.backgroundColor = '#'+color;
+			}
+			
+		}
+		
+		// pour afficher la couleur finale choisie
+		function changeFinalColor(color)
+		{
+			document.forms['colpick_form'].elements['btn_choose_color'].style.backgroundColor = color;
+			document.forms['colpick_form'].elements['btn_choose_color'].style.borderColor = color;
+		}
+		
+		// "renvoyer" la couleur en cliquant sur OK
+		function send_color()
+		{
+			if (window.opener)
+			{
+			   var new_color = document.forms['colpick_form'].elements['btn_choose_color'].style.backgroundColor;
+			   exp_rgb = new RegExp("rgb","g");
+			   if (exp_rgb.test(new_color))
+			   {
+			   	exp_extract = new RegExp("[0-9]+","g");
+			   	var tab_rgb = new_color.match(exp_extract);
+			   	
+			      new_color = '#'+dechex(parseInt(tab_rgb[0]))+dechex(parseInt(tab_rgb[1]))+dechex(parseInt(tab_rgb[2]));
+			   }
+                window.opener.document.forms['Form'].elements['couleur'].value = new_color;
+        	     window.opener.document.forms['Form'].elements['exemple'].style.borderColor = new_color;
+			   window.opener.document.forms['Form'].elements['exemple'].style.backgroundColor = new_color;
+				window.opener.focus();
+				window.close();
+			}
+		}
+		
+		window.focus();
+	
+	</script>
+</head>
+
+<body>
+   <form name="colpick_form" action="#" method="post">
+
+	<h2>Choisissez une couleur</h2>
+	<table border="0" cellspacing="0" cellpadding="0" align="center">
+		<tr>
+			<td>
+				<table border="1" cellspacing="0" cellpadding="0" class="table_black_border">
+					<tr>
+						<td style="padding:0px; border-width:0px; border-style:none;">
+							<img id="color_picker" src="colpick.jpg" onclick="compute_color(event)"
+							   onmousedown="is_mouse_down = true; return false;"
+							   onmouseup="is_mouse_down = false;"
+							   onmousemove="if (is_mouse_down && is_mouse_over) compute_color(event); return false;"
+							   onmouseover="is_mouse_over = true;"
+							   onmouseout="is_mouse_over = false;"
+                        style="cursor:crosshair;" /></td>
+
+						</td>
+					</tr>
+				</table>
+			<td style="background-color:#ffffff; width:20px; height:2px; padding:0px;"></td>
+			<td>
+				<table border="1" cellspacing="0" cellpadding="0" class="table_black_border" style="cursor:crosshair">
+					<script type="text/javascript">
+					
+						for(i = 0; i < detail; i++)
+						{
+							document.write('<tr><td id="gs'+i+'" style="background-color:#000000; width:20px; height:3px; border-style:none; border-width:0px;"'
+                        + ' onclick="changeFinalColor(this.style.backgroundColor)"'
+                        + ' onmousedown="is_mouse_down = true; return false;"'
+                        + ' onmouseup="is_mouse_down = false;"'
+                        + ' onmousemove="if (is_mouse_down && is_mouse_over) changeFinalColor(this.style.backgroundColor); return false;"'
+                        + ' onmouseover="is_mouse_over = true;"'
+							   + ' onmouseout="is_mouse_over = false;"'
+                        
+                        + '></td></tr>');
+						}
+					
+					</script>
+				</table>
+
+			</td>
+		</tr>
+	</table>
+	<br>
+	<table align="center">
+		<tr valign="center">
+			<td>R&eacute;sultat :</td>
+			<td><input type="button" name="btn_choose_color" value="&nbsp;" style="background-color:#000000; border-color:#000000; width:100px; height:35px;"></td>
+
+			<td><input type="button" name="btn_ok" value="Ok" style="width:70px" onclick="send_color();"></td>
+		</tr>
+		
+	</table>
+	</form>
+
+</body>
+</html>
+
+
diff --git a/www/include/common/javascript/color_picker.php b/www/include/common/javascript/color_picker.php
new file mode 100644
index 0000000000000000000000000000000000000000..b27c6c61a86bce493e7cd7977a4c712634fbc077
--- /dev/null
+++ b/www/include/common/javascript/color_picker.php
@@ -0,0 +1,202 @@
+<?php
+$n ="";
+$name ="";
+$title ="";
+
+$n = $_GET['n'];
+$name = $_GET['name'];
+$title = $_GET['title'];
+
+$name1 = $n."";
+$name2 = $n."_color";
+?>
+<html>
+<head>
+	<title>Color Picker</title>
+	<style type="text/css">
+	
+		body	{ font-size: 12px; font-family: Verdana, Sans-Serif; text-align:center; background-color:#FFFFFF; color:navy;}
+		td  { font-size: 12px; font-family: Verdana, Sans-Serif; text-align:center; background-color:#FFFFFF}
+		.table_black_border {border-style:solid; border-width:1px; border-color:#000000;}
+
+   </style>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<script type="text/javascript">
+	
+		// D�pos� par Frosty sur www.toutjavascript.com
+		// 27/5/2003 - Ajout compatibilit� IE5 sur MacOS
+		// 5/6/2003  - Ajout compatibilit� Mozilla
+		// 5/9/2005  - Correction d'un bug (clic sur la bordure de la palette principale)
+		// 6/9/2005  - Ajout de la possibilit� de s�lectionner une couleur en d�pla�ant la souris
+		//             sur les palettes (bouton gauche enfonc�)
+
+		/*****************************************************************
+		* Script Color Picker �crit par Frosty (Maxime Pacary) - Mai 2003
+		******************************************************************/
+	
+		// var. globale
+		var detail = 50; // nombre de nuances de couleurs dans la barre de droite
+		
+		// ne pas modifier
+		var strhex = "0123456789ABCDEF";
+		var i;
+		var is_mouse_down = false;
+		var is_mouse_over = false;
+		
+		// conversion decimal (0-255) => hexa
+		function dechex(n) {
+			return strhex.charAt(Math.floor(n/16)) + strhex.charAt(n%16);
+		}
+
+		// d�tection d'un clic/mouvement souris sur la "palette" (� gauche)
+		function compute_color(e)
+		{
+			x = e.offsetX ? e.offsetX : (e.target ? e.clientX-e.target.x : 0);
+			y = e.offsetY ? e.offsetY : (e.target ? e.clientY-e.target.y : 0);
+			
+			// calcul de la couleur � partir des coordonn�es du clic
+			var part_width = document.all ? document.all.color_picker.width/6 : document.getElementById('color_picker').width/6;
+			var part_detail = detail/2;
+			var im_height = document.all ? document.all.color_picker.height : document.getElementById('color_picker').height;
+			
+			
+			var red = (x >= 0)*(x < part_width)*255
+					+ (x >= part_width)*(x < 2*part_width)*(2*255 - x * 255 / part_width)
+					+ (x >= 4*part_width)*(x < 5*part_width)*(-4*255 + x * 255 / part_width)
+					+ (x >= 5*part_width)*(x < 6*part_width)*255;
+			var blue = (x >= 2*part_width)*(x < 3*part_width)*(-2*255 + x * 255 / part_width)
+					+ (x >= 3*part_width)*(x < 5*part_width)*255
+					+ (x >= 5*part_width)*(x < 6*part_width)*(6*255 - x * 255 / part_width);
+			var green = (x >= 0)*(x < part_width)*(x * 255 / part_width)
+					+ (x >= part_width)*(x < 3*part_width)*255
+					+ (x >= 3*part_width)*(x < 4*part_width)*(4*255 - x * 255 / part_width);
+			
+			var coef = (im_height-y)/im_height;
+			
+			// composantes de la couleur choisie sur la "palette"
+			red = 128+(red-128)*coef;
+			green = 128+(green-128)*coef;
+			blue = 128+(blue-128)*coef;
+			
+			// mise � jour de la couleur finale
+			changeFinalColor('#' + dechex(red) + dechex(green) + dechex(blue));
+			
+			// mise � jour de la barre de droite en fonction de cette couleur
+			for(i = 0; i < detail; i++)
+			{
+				if ((i >= 0) && (i < part_detail))
+				{
+					var final_coef = i/part_detail ;
+					var final_red = dechex(255 - (255 - red) * final_coef);
+					var final_green = dechex(255 - (255 - green) * final_coef);
+					var final_blue = dechex(255 - (255 - blue) * final_coef);
+				}
+				else
+				{
+					var final_coef = 2 - i/part_detail ;
+					var final_red = dechex(red * final_coef);
+					var final_green = dechex(green * final_coef);
+					var final_blue = dechex(blue * final_coef);
+				}
+				color = final_red + final_green + final_blue ;
+				document.all ? document.all('gs'+i).style.backgroundColor = '#'+color : document.getElementById('gs'+i).style.backgroundColor = '#'+color;
+			}
+			
+		}
+		
+		// pour afficher la couleur finale choisie
+		function changeFinalColor(color)
+		{
+			document.forms['colpick_form'].elements['btn_choose_color'].style.backgroundColor = color;
+			document.forms['colpick_form'].elements['btn_choose_color'].style.borderColor = color;
+		}
+		
+		// "renvoyer" la couleur en cliquant sur OK
+		function send_color()
+		{
+			if (window.opener)
+			{
+			   var new_color = document.forms['colpick_form'].elements['btn_choose_color'].style.backgroundColor;
+			   exp_rgb = new RegExp("rgb","g");
+			   if (exp_rgb.test(new_color))
+			   {
+			   	exp_extract = new RegExp("[0-9]+","g");
+			   	var tab_rgb = new_color.match(exp_extract);
+			   	
+			      new_color = '#'+dechex(parseInt(tab_rgb[0]))+dechex(parseInt(tab_rgb[1]))+dechex(parseInt(tab_rgb[2]));
+			   }
+
+                window.opener.document.forms['Form'].elements['<? echo $name1; ?>'].value = new_color;
+        	     window.opener.document.forms['Form'].elements['<? echo $name2;?>'].style.borderColor = new_color;
+			   window.opener.document.forms['Form'].elements['<? echo $name2; ?>'].style.backgroundColor = new_color;
+				window.opener.focus();
+				window.close();
+			}
+		}
+		
+		window.focus();
+	
+	</script>
+</head>
+
+<body>
+   <form name="colpick_form" action="#" method="post">
+
+	<h2><? echo $title; ?></h2>
+	<h3><? echo $name; ?></h3>
+	<table border="0" cellspacing="0" cellpadding="0" align="center">
+		<tr>
+			<td>
+				<table border="1" cellspacing="0" cellpadding="0" class="table_black_border">
+					<tr>
+						<td style="padding:0px; border-width:0px; border-style:none;">
+							<img id="color_picker" src="colpick.jpg" onclick="compute_color(event)"
+							   onmousedown="is_mouse_down = true; return false;"
+							   onmouseup="is_mouse_down = false;"
+							   onmousemove="if (is_mouse_down && is_mouse_over) compute_color(event); return false;"
+							   onmouseover="is_mouse_over = true;"
+							   onmouseout="is_mouse_over = false;"
+                        style="cursor:crosshair;" /></td>
+
+						</td>
+					</tr>
+				</table>
+			<td style="background-color:#ffffff; width:20px; height:2px; padding:0px;"></td>
+			<td>
+				<table border="1" cellspacing="0" cellpadding="0" class="table_black_border" style="cursor:crosshair">
+					<script type="text/javascript">
+					
+						for(i = 0; i < detail; i++)
+						{
+							document.write('<tr><td id="gs'+i+'" style="background-color:#000000; width:20px; height:3px; border-style:none; border-width:0px;"'
+                        + ' onclick="changeFinalColor(this.style.backgroundColor)"'
+                        + ' onmousedown="is_mouse_down = true; return false;"'
+                        + ' onmouseup="is_mouse_down = false;"'
+                        + ' onmousemove="if (is_mouse_down && is_mouse_over) changeFinalColor(this.style.backgroundColor); return false;"'
+                        + ' onmouseover="is_mouse_over = true;"'
+				   + ' onmouseout="is_mouse_over = false;"'
+                        
+                        + '></td></tr>');
+						}
+					
+					</script>
+				</table>
+
+			</td>
+		</tr>
+	</table>
+	<br>
+	<table align="center">
+		<tr valign="center">
+			<td><input type="button" name="btn_choose_color" value="&nbsp;" style="background-color:#000000; border-color:#000000; width:100px; height:35px;"></td>
+
+			<td><input type="button" name="btn_ok" value="Ok" style="width:70px" onclick="send_color();"></td>
+		</tr>
+		
+	</table>
+	</form>
+
+</body>
+</html>
+
+
diff --git a/www/include/common/javascript/colpick.html b/www/include/common/javascript/colpick.html
new file mode 100644
index 0000000000000000000000000000000000000000..0ee926fa7f934ebd3a3298ed4e0cdb1de9288468
--- /dev/null
+++ b/www/include/common/javascript/colpick.html
@@ -0,0 +1,42 @@
+<html>
+<head>
+	<title>Color Picker</title>
+	<style type="text/css">
+	
+   	body	{ font-size: 12px; font-family: Verdana, Sans-Serif; text-align:center; background-color:#ffffff; color:navy;}
+		td  { font-size: 12px; font-family: Verdana, Sans-Serif; text-align:center; background-color:#ffffff}
+	
+   </style>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<script type="text/javascript">
+	
+		function popup_color_picker()
+		{
+			var width = 400;
+			var height = 300;
+			window.open('color_picker.html', 'cp', 'resizable=no, location=no, width='
+						+width+', height='+height+', menubar=no, status=yes, scrollbars=no, menubar=no');
+		}
+		
+	</script>
+</head>
+
+<body>
+   <form name="opener_form" action="#" method="post">
+   
+	<h2>Test Color Picker</h2>
+	<table align="center">
+		<tr>
+			<td>Couleur : </td>
+			<td><input type="text" name="couleur" size="7" maxlength="7" value="#000000" style="width:70px;"></td>
+			<td><input type="button" name="exemple" style="width:60px; height:25px; background-color:#000000; border-color:#000000;"></td>
+			<td><input type="button" value="Changer..." onclick="popup_color_picker();"></td>
+      </tr>
+	</table>
+	
+	</form>
+	<p>Cliquer sur le bouton Changer pour choisir une nouvelle couleur.</p>
+	<p>Compatible Internet Explorer 5.0+ et Mozilla.</p>
+   <p>Script �galement disponible sur <a href="www.toutjavascript.com">www.toutjavascript.com</a></p>
+</body>
+</html>
diff --git a/www/include/common/javascript/colpick.jpg b/www/include/common/javascript/colpick.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..b4c542d107b25f68a9d4f9d7a109d0565d1f1437
Binary files /dev/null and b/www/include/common/javascript/colpick.jpg differ
diff --git a/www/include/common/javascript/datePicker.css b/www/include/common/javascript/datePicker.css
new file mode 100644
index 0000000000000000000000000000000000000000..6622fbb3ba2b27204de993cdfd87b86ada5cfed6
--- /dev/null
+++ b/www/include/common/javascript/datePicker.css
@@ -0,0 +1,120 @@
+body {
+	font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
+	font-size: .8em;
+	}
+
+/* the div that holds the date picker calendar */
+.dpDiv {
+	}
+
+
+/* the table (within the div) that holds the date picker calendar */
+.dpTable {
+	font-family: Tahoma, Arial, Helvetica, sans-serif;
+	font-size: 12px;
+	text-align: center;
+	color: #505050;
+	background-color: #ece9d8;
+	border: 1px solid #AAAAAA;
+	}
+
+
+/* a table row that holds date numbers (either blank or 1-31) */
+.dpTR {
+	}
+
+
+/* the top table row that holds the month, year, and forward/backward buttons */
+.dpTitleTR {
+	}
+
+
+/* the second table row, that holds the names of days of the week (Mo, Tu, We, etc.) */
+.dpDayTR {
+	}
+
+
+/* the bottom table row, that has the "This Month" and "Close" buttons */
+.dpTodayButtonTR {
+	}
+
+
+/* a table cell that holds a date number (either blank or 1-31) */
+.dpTD {
+	border: 1px solid #ece9d8;
+	}
+
+
+/* a table cell that holds a highlighted day (usually either today's date or the current date field value) */
+.dpDayHighlightTD {
+	background-color: #CCCCCC;
+	border: 1px solid #AAAAAA;
+	}
+
+
+/* the date number table cell that the mouse pointer is currently over (you can use contrasting colors to make it apparent which cell is being hovered over) */
+.dpTDHover {
+	background-color: #aca998;
+	border: 1px solid #888888;
+	cursor: pointer;
+	color: red;
+	}
+
+
+/* the table cell that holds the name of the month and the year */
+.dpTitleTD {
+	}
+
+
+/* a table cell that holds one of the forward/backward buttons */
+.dpButtonTD {
+	}
+
+
+/* the table cell that holds the "This Month" or "Close" button at the bottom */
+.dpTodayButtonTD {
+	}
+
+
+/* a table cell that holds the names of days of the week (Mo, Tu, We, etc.) */
+.dpDayTD {
+	background-color: #CCCCCC;
+	border: 1px solid #AAAAAA;
+	color: white;
+	}
+
+
+/* additional style information for the text that indicates the month and year */
+.dpTitleText {
+	font-size: 12px;
+	color: gray;
+	font-weight: bold;
+	}
+
+
+/* additional style information for the cell that holds a highlighted day (usually either today's date or the current date field value) */ 
+.dpDayHighlight {
+	color: 4060ff;
+	font-weight: bold;
+	}
+
+
+/* the forward/backward buttons at the top */
+.dpButton {
+	font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
+	font-size: 10px;
+	color: gray;
+	background: #d8e8ff;
+	font-weight: bold;
+	padding: 0px;
+	}
+
+
+/* the "This Month" and "Close" buttons at the bottom */
+.dpTodayButton {
+	font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
+	font-size: 10px;
+	color: gray;
+	background: #d8e8ff;
+	font-weight: bold;
+	}
\ No newline at end of file
diff --git a/www/include/common/javascript/datePicker.js b/www/include/common/javascript/datePicker.js
new file mode 100644
index 0000000000000000000000000000000000000000..f5fb437d5a686cc4140f0479e721f90bb4ea9b5a
--- /dev/null
+++ b/www/include/common/javascript/datePicker.js
@@ -0,0 +1,498 @@
+/**
+This is a JavaScript library that will allow you to easily add some basic DHTML
+drop-down datepicker functionality to your Notes forms. This script is not as
+full-featured as others you may find on the Internet, but it's free, it's easy to
+understand, and it's easy to change.
+
+You'll also want to include a stylesheet that makes the datepicker elements
+look nice. An example one can be found in the database that this script was
+originally released with, at:
+
+http://www.nsftools.com/tips/NotesTips.htm#datepicker
+
+I've tested this lightly with Internet Explorer 6 and Mozilla Firefox. I have no idea
+how compatible it is with other browsers.
+
+version 1.5
+December 4, 2005
+Julian Robichaux -- http://www.nsftools.com
+
+HISTORY
+--  version 1.0 (Sept. 4, 2004):
+Initial release.
+
+--  version 1.1 (Sept. 5, 2004):
+Added capability to define the date format to be used, either globally (using the
+defaultDateSeparator and defaultDateFormat variables) or when the displayDatePicker
+function is called.
+
+--  version 1.2 (Sept. 7, 2004):
+Fixed problem where datepicker x-y coordinates weren't right inside of a table.
+Fixed problem where datepicker wouldn't display over selection lists on a page.
+Added a call to the datePickerClosed function (if one exists) after the datepicker
+is closed, to allow the developer to add their own custom validation after a date
+has been chosen. For this to work, you must have a function called datePickerClosed
+somewhere on the page, that accepts a field object as a parameter. See the
+example in the comments of the updateDateField function for more details.
+
+--  version 1.3 (Sept. 9, 2004)
+Fixed problem where adding the <div> and <iFrame> used for displaying the datepicker
+was causing problems on IE 6 with global variables that had handles to objects on
+the page (I fixed the problem by adding the elements using document.createElement()
+and document.body.appendChild() instead of document.body.innerHTML += ...).
+
+--  version 1.4 (Dec. 20, 2004)
+Added "targetDateField.focus();" to the updateDateField function (as suggested
+by Alan Lepofsky) to avoid a situation where the cursor focus is at the top of the
+form after a date has been picked. Added "padding: 0px;" to the dpButton CSS
+style, to keep the table from being so wide when displayed in Firefox.
+
+-- version 1.5 (Dec 4, 2005)
+Added display=none when datepicker is hidden, to fix problem where cursor is
+not visible on input fields that are beneath the date picker. Added additional null
+date handling for date errors in Safari when the date is empty. Added additional
+error handling for iFrame creation, to avoid reported errors in Opera. Added
+onMouseOver event for day cells, to allow color changes when the mouse hovers
+over a cell (to make it easier to determine what cell you're over). Added comments
+in the style sheet, to make it more clear what the different style elements are for.
+*/
+
+var datePickerDivID = "datepicker";
+var iFrameDivID = "datepickeriframe";
+
+var dayArrayShort = new Array('Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa');
+var dayArrayMed = new Array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
+var dayArrayLong = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
+var monthArrayShort = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
+var monthArrayMed = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec');
+var monthArrayLong = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
+ 
+// these variables define the date formatting we're expecting and outputting.
+// If you want to use a different format by default, change the defaultDateSeparator
+// and defaultDateFormat variables either here or on your HTML page.
+var defaultDateSeparator = "/";        // common values would be "/" or "."
+var defaultDateFormat = "mdy"    // valid values are "mdy", "dmy", and "ymd"
+var dateSeparator = defaultDateSeparator;
+var dateFormat = defaultDateFormat;
+
+/**
+This is the main function you'll call from the onClick event of a button.
+Normally, you'll have something like this on your HTML page:
+
+Start Date: <input name="StartDate">
+<input type=button value="select" onclick="displayDatePicker('StartDate');">
+
+That will cause the datepicker to be displayed beneath the StartDate field and
+any date that is chosen will update the value of that field. If you'd rather have the
+datepicker display beneath the button that was clicked, you can code the button
+like this:
+
+<input type=button value="select" onclick="displayDatePicker('StartDate', this);">
+
+So, pretty much, the first argument (dateFieldName) is a string representing the
+name of the field that will be modified if the user picks a date, and the second
+argument (displayBelowThisObject) is optional and represents an actual node
+on the HTML document that the datepicker should be displayed below.
+
+In version 1.1 of this code, the dtFormat and dtSep variables were added, allowing
+you to use a specific date format or date separator for a given call to this function.
+Normally, you'll just want to set these defaults globally with the defaultDateSeparator
+and defaultDateFormat variables, but it doesn't hurt anything to add them as optional
+parameters here. An example of use is:
+
+<input type=button value="select" onclick="displayDatePicker('StartDate', false, 'dmy', '.');">
+
+This would display the datepicker beneath the StartDate field (because the
+displayBelowThisObject parameter was false), and update the StartDate field with
+the chosen value of the datepicker using a date format of dd.mm.yyyy
+*/
+function displayDatePicker(dateFieldName, displayBelowThisObject, dtFormat, dtSep)
+{
+  var targetDateField = document.getElementsByName (dateFieldName).item(0);
+ 
+  // if we weren't told what node to display the datepicker beneath, just display it
+  // beneath the date field we're updating
+  if (!displayBelowThisObject)
+    displayBelowThisObject = targetDateField;
+ 
+  // if a date separator character was given, update the dateSeparator variable
+  if (dtSep)
+    dateSeparator = dtSep;
+  else
+    dateSeparator = defaultDateSeparator;
+ 
+  // if a date format was given, update the dateFormat variable
+  if (dtFormat)
+    dateFormat = dtFormat;
+  else
+    dateFormat = defaultDateFormat;
+ 
+  var x = displayBelowThisObject.offsetLeft;
+  var y = displayBelowThisObject.offsetTop + displayBelowThisObject.offsetHeight ;
+ 
+  // deal with elements inside tables and such
+  var parent = displayBelowThisObject;
+  while (parent.offsetParent) {
+    parent = parent.offsetParent;
+    x += parent.offsetLeft;
+    y += parent.offsetTop ;
+  }
+ 
+  drawDatePicker(targetDateField, x, y);
+}
+
+
+/**
+Draw the datepicker object (which is just a table with calendar elements) at the
+specified x and y coordinates, using the targetDateField object as the input tag
+that will ultimately be populated with a date.
+
+This function will normally be called by the displayDatePicker function.
+*/
+function drawDatePicker(targetDateField, x, y)
+{
+  var dt = getFieldDate(targetDateField.value );
+ 
+  // the datepicker table will be drawn inside of a <div> with an ID defined by the
+  // global datePickerDivID variable. If such a div doesn't yet exist on the HTML
+  // document we're working with, add one.
+  if (!document.getElementById(datePickerDivID)) {
+    // don't use innerHTML to update the body, because it can cause global variables
+    // that are currently pointing to objects on the page to have bad references
+    //document.body.innerHTML += "<div id='" + datePickerDivID + "' class='dpDiv'></div>";
+    var newNode = document.createElement("div");
+    newNode.setAttribute("id", datePickerDivID);
+    newNode.setAttribute("class", "dpDiv");
+    newNode.setAttribute("style", "visibility: hidden;");
+    document.body.appendChild(newNode);
+  }
+ 
+  // move the datepicker div to the proper x,y coordinate and toggle the visiblity
+  var pickerDiv = document.getElementById(datePickerDivID);
+  pickerDiv.style.position = "absolute";
+  pickerDiv.style.left = x + "px";
+  pickerDiv.style.top = y + "px";
+  pickerDiv.style.visibility = (pickerDiv.style.visibility == "visible" ? "hidden" : "visible");
+  pickerDiv.style.display = (pickerDiv.style.display == "block" ? "none" : "block");
+  pickerDiv.style.zIndex = 10000;
+ 
+  // draw the datepicker table
+  refreshDatePicker(targetDateField.name, dt.getFullYear(), dt.getMonth(), dt.getDate());
+}
+
+
+/**
+This is the function that actually draws the datepicker calendar.
+*/
+function refreshDatePicker(dateFieldName, year, month, day)
+{
+  // if no arguments are passed, use today's date; otherwise, month and year
+  // are required (if a day is passed, it will be highlighted later)
+  var thisDay = new Date();
+ 
+  if ((month >= 0) && (year > 0)) {
+    thisDay = new Date(year, month, 1);
+  } else {
+    day = thisDay.getDate();
+    thisDay.setDate(1);
+  }
+ 
+  // the calendar will be drawn as a table
+  // you can customize the table elements with a global CSS style sheet,
+  // or by hardcoding style and formatting elements below
+  var crlf = "\r\n";
+  var TABLE = "<table cols=7 class='dpTable'>" + crlf;
+  var xTABLE = "</table>" + crlf;
+  var TR = "<tr class='dpTR'>";
+  var TR_title = "<tr class='dpTitleTR'>";
+  var TR_days = "<tr class='dpDayTR'>";
+  var TR_todaybutton = "<tr class='dpTodayButtonTR'>";
+  var xTR = "</tr>" + crlf;
+  var TD = "<td class='dpTD' onMouseOut='this.className=\"dpTD\";' onMouseOver=' this.className=\"dpTDHover\";' ";    // leave this tag open, because we'll be adding an onClick event
+  var TD_title = "<td colspan=5 class='dpTitleTD'>";
+  var TD_buttons = "<td class='dpButtonTD'>";
+  var TD_todaybutton = "<td colspan=7 class='dpTodayButtonTD'>";
+  var TD_days = "<td class='dpDayTD'>";
+  var TD_selected = "<td class='dpDayHighlightTD' onMouseOut='this.className=\"dpDayHighlightTD\";' onMouseOver='this.className=\"dpTDHover\";' ";    // leave this tag open, because we'll be adding an onClick event
+  var xTD = "</td>" + crlf;
+  var DIV_title = "<div class='dpTitleText'>";
+  var DIV_selected = "<div class='dpDayHighlight'>";
+  var xDIV = "</div>";
+ 
+  // start generating the code for the calendar table
+  var html = TABLE;
+ 
+  // this is the title bar, which displays the month and the buttons to
+  // go back to a previous month or forward to the next month
+  html += TR_title;
+  html += TD_buttons + getButtonCode(dateFieldName, thisDay, -1, "&lt;") + xTD;
+  html += TD_title + DIV_title + monthArrayLong[ thisDay.getMonth()] + " " + thisDay.getFullYear() + xDIV + xTD;
+  html += TD_buttons + getButtonCode(dateFieldName, thisDay, 1, "&gt;") + xTD;
+  html += xTR;
+ 
+  // this is the row that indicates which day of the week we're on
+  html += TR_days;
+  for(i = 0; i < dayArrayShort.length; i++)
+    html += TD_days + dayArrayShort[i] + xTD;
+  html += xTR;
+ 
+  // now we'll start populating the table with days of the month
+  html += TR;
+ 
+  // first, the leading blanks
+  for (i = 0; i < thisDay.getDay(); i++)
+    html += TD + "&nbsp;" + xTD;
+ 
+  // now, the days of the month
+  do {
+    dayNum = thisDay.getDate();
+    TD_onclick = " onclick=\"updateDateField('" + dateFieldName + "', '" + getDateString(thisDay) + "');\">";
+    
+    if (dayNum == day)
+      html += TD_selected + TD_onclick + DIV_selected + dayNum + xDIV + xTD;
+    else
+      html += TD + TD_onclick + dayNum + xTD;
+    
+    // if this is a Saturday, start a new row
+    if (thisDay.getDay() == 6)
+      html += xTR + TR;
+    
+    // increment the day
+    thisDay.setDate(thisDay.getDate() + 1);
+  } while (thisDay.getDate() > 1)
+ 
+  // fill in any trailing blanks
+  if (thisDay.getDay() > 0) {
+    for (i = 6; i > thisDay.getDay(); i--)
+      html += TD + "&nbsp;" + xTD;
+  }
+  html += xTR;
+ 
+  // add a button to allow the user to easily return to today, or close the calendar
+  var today = new Date();
+  var todayString = "Today is " + dayArrayMed[today.getDay()] + ", " + monthArrayMed[ today.getMonth()] + " " + today.getDate();
+  html += TR_todaybutton + TD_todaybutton;
+  html += "<button class='dpTodayButton' onClick='refreshDatePicker(\"" + dateFieldName + "\");'>this month</button> ";
+  html += "<button class='dpTodayButton' onClick='updateDateField(\"" + dateFieldName + "\");'>close</button>";
+  html += xTD + xTR;
+ 
+  // and finally, close the table
+  html += xTABLE;
+ 
+  document.getElementById(datePickerDivID).innerHTML = html;
+  // add an "iFrame shim" to allow the datepicker to display above selection lists
+  adjustiFrame();
+}
+
+
+/**
+Convenience function for writing the code for the buttons that bring us back or forward
+a month.
+*/
+function getButtonCode(dateFieldName, dateVal, adjust, label)
+{
+  var newMonth = (dateVal.getMonth () + adjust) % 12;
+  var newYear = dateVal.getFullYear() + parseInt((dateVal.getMonth() + adjust) / 12);
+  if (newMonth < 0) {
+    newMonth += 12;
+    newYear += -1;
+  }
+ 
+  return "<button class='dpButton' onClick='refreshDatePicker(\"" + dateFieldName + "\", " + newYear + ", " + newMonth + ");'>" + label + "</button>";
+}
+
+
+/**
+Convert a JavaScript Date object to a string, based on the dateFormat and dateSeparator
+variables at the beginning of this script library.
+*/
+function getDateString(dateVal)
+{
+  var dayString = "00" + dateVal.getDate();
+  var monthString = "00" + (dateVal.getMonth()+1);
+  dayString = dayString.substring(dayString.length - 2);
+  monthString = monthString.substring(monthString.length - 2);
+ 
+  switch (dateFormat) {
+    case "dmy" :
+      return dayString + dateSeparator + monthString + dateSeparator + dateVal.getFullYear();
+    case "ymd" :
+      return dateVal.getFullYear() + dateSeparator + monthString + dateSeparator + dayString;
+    case "mdy" :
+    default :
+      return monthString + dateSeparator + dayString + dateSeparator + dateVal.getFullYear();
+  }
+}
+
+
+/**
+Convert a string to a JavaScript Date object.
+*/
+function getFieldDate(dateString)
+{
+  var dateVal;
+  var dArray;
+  var d, m, y;
+ 
+  try {
+    dArray = splitDateString(dateString);
+    if (dArray) {
+      switch (dateFormat) {
+        case "dmy" :
+          d = parseInt(dArray[0], 10);
+          m = parseInt(dArray[1], 10) - 1;
+          y = parseInt(dArray[2], 10);
+          break;
+        case "ymd" :
+          d = parseInt(dArray[2], 10);
+          m = parseInt(dArray[1], 10) - 1;
+          y = parseInt(dArray[0], 10);
+          break;
+        case "mdy" :
+        default :
+          d = parseInt(dArray[1], 10);
+          m = parseInt(dArray[0], 10) - 1;
+          y = parseInt(dArray[2], 10);
+          break;
+      }
+      dateVal = new Date(y, m, d);
+    } else if (dateString) {
+      dateVal = new Date(dateString);
+    } else {
+      dateVal = new Date();
+    }
+  } catch(e) {
+    dateVal = new Date();
+  }
+ 
+  return dateVal;
+}
+
+
+/**
+Try to split a date string into an array of elements, using common date separators.
+If the date is split, an array is returned; otherwise, we just return false.
+*/
+function splitDateString(dateString)
+{
+  var dArray;
+  if (dateString.indexOf("/") >= 0)
+    dArray = dateString.split("/");
+  else if (dateString.indexOf(".") >= 0)
+    dArray = dateString.split(".");
+  else if (dateString.indexOf("-") >= 0)
+    dArray = dateString.split("-");
+  else if (dateString.indexOf("\\") >= 0)
+    dArray = dateString.split("\\");
+  else
+    dArray = false;
+ 
+  return dArray;
+}
+
+/**
+Update the field with the given dateFieldName with the dateString that has been passed,
+and hide the datepicker. If no dateString is passed, just close the datepicker without
+changing the field value.
+
+Also, if the page developer has defined a function called datePickerClosed anywhere on
+the page or in an imported library, we will attempt to run that function with the updated
+field as a parameter. This can be used for such things as date validation, setting default
+values for related fields, etc. For example, you might have a function like this to validate
+a start date field:
+
+function datePickerClosed(dateField)
+{
+  var dateObj = getFieldDate(dateField.value);
+  var today = new Date();
+  today = new Date(today.getFullYear(), today.getMonth(), today.getDate());
+ 
+  if (dateField.name == "StartDate") {
+    if (dateObj < today) {
+      // if the date is before today, alert the user and display the datepicker again
+      alert("Please enter a date that is today or later");
+      dateField.value = "";
+      document.getElementById(datePickerDivID).style.visibility = "visible";
+      adjustiFrame();
+    } else {
+      // if the date is okay, set the EndDate field to 7 days after the StartDate
+      dateObj.setTime(dateObj.getTime() + (7 * 24 * 60 * 60 * 1000));
+      var endDateField = document.getElementsByName ("EndDate").item(0);
+      endDateField.value = getDateString(dateObj);
+    }
+  }
+}
+
+*/
+function updateDateField(dateFieldName, dateString)
+{
+  var targetDateField = document.getElementsByName (dateFieldName).item(0);
+  if (dateString)
+    targetDateField.value = dateString;
+ 
+  var pickerDiv = document.getElementById(datePickerDivID);
+  pickerDiv.style.visibility = "hidden";
+  pickerDiv.style.display = "none";
+ 
+  adjustiFrame();
+  targetDateField.focus();
+ 
+  // after the datepicker has closed, optionally run a user-defined function called
+  // datePickerClosed, passing the field that was just updated as a parameter
+  // (note that this will only run if the user actually selected a date from the datepicker)
+  if ((dateString) && (typeof(datePickerClosed) == "function"))
+    datePickerClosed(targetDateField);
+}
+
+
+/**
+Use an "iFrame shim" to deal with problems where the datepicker shows up behind
+selection list elements, if they're below the datepicker. The problem and solution are
+described at:
+
+http://dotnetjunkies.com/WebLog/jking/archive/2003/07/21/488.aspx
+http://dotnetjunkies.com/WebLog/jking/archive/2003/10/30/2975.aspx
+*/
+function adjustiFrame(pickerDiv, iFrameDiv)
+{
+  // we know that Opera doesn't like something about this, so if we
+  // think we're using Opera, don't even try
+  var is_opera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
+  if (is_opera)
+    return;
+  
+  // put a try/catch block around the whole thing, just in case
+  try {
+    if (!document.getElementById(iFrameDivID)) {
+      // don't use innerHTML to update the body, because it can cause global variables
+      // that are currently pointing to objects on the page to have bad references
+      //document.body.innerHTML += "<iframe id='" + iFrameDivID + "' src='javascript:false;' scrolling='no' frameborder='0'>";
+      var newNode = document.createElement("iFrame");
+      newNode.setAttribute("id", iFrameDivID);
+      newNode.setAttribute("src", "javascript:false;");
+      newNode.setAttribute("scrolling", "no");
+      newNode.setAttribute ("frameborder", "0");
+      document.body.appendChild(newNode);
+    }
+    
+    if (!pickerDiv)
+      pickerDiv = document.getElementById(datePickerDivID);
+    if (!iFrameDiv)
+      iFrameDiv = document.getElementById(iFrameDivID);
+    
+    try {
+      iFrameDiv.style.position = "absolute";
+      iFrameDiv.style.width = pickerDiv.offsetWidth;
+      iFrameDiv.style.height = pickerDiv.offsetHeight ;
+      iFrameDiv.style.top = pickerDiv.style.top;
+      iFrameDiv.style.left = pickerDiv.style.left;
+      iFrameDiv.style.zIndex = pickerDiv.style.zIndex - 1;
+      iFrameDiv.style.visibility = pickerDiv.style.visibility ;
+      iFrameDiv.style.display = pickerDiv.style.display;
+    } catch(e) {
+    }
+ 
+  } catch (ee) {
+  }
+ 
+}
\ No newline at end of file
diff --git a/www/include/common/javascript/functions.js b/www/include/common/javascript/functions.js
new file mode 100644
index 0000000000000000000000000000000000000000..fc38069121e28130baf232df4cb156a2fe7c0224
--- /dev/null
+++ b/www/include/common/javascript/functions.js
@@ -0,0 +1,72 @@
+/**
+Oreon is developped with Apache Licence 2.0 :
+http://www.apache.org/licenses/LICENSE-2.0.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+// JavaScript Document
+
+
+function getXMLHTTP(){
+  var xhr=null;
+  if(window.XMLHttpRequest) // Firefox et autres
+  xhr = new XMLHttpRequest();
+  else if(window.ActiveXObject){ // Internet Explorer
+    try {
+      xhr = new ActiveXObject('Msxml2.XMLHTTP');
+    } catch (e) {
+      try {
+        xhr = new ActiveXObject('Microsoft.XMLHTTP');
+      } catch (e1) {
+        xhr = null;
+      }
+    }
+  }
+  else { // XMLHttpRequest non support� par le navigateur
+    alert('Votre navigateur ne supporte pas les objets XMLHTTPRequest...');
+  }
+  return xhr;
+}
+
+var _xmlHttp = null; //l'objet xmlHttpRequest utilis� pour contacter le serveur
+
+function loadXMLDoc(url,div) {
+if(_xmlHttp&&_xmlHttp.readyState!=0){
+    _xmlHttp.abort()
+  }
+  _xmlHttp=getXMLHTTP();
+  if(_xmlHttp){
+    //appel � l'url distante
+    _xmlHttp.open('GET',url,true);
+    _xmlHttp.onreadystatechange=function() {
+      if(_xmlHttp.readyState==4&&_xmlHttp.responseText) {
+	      display(_xmlHttp.responseText,div)
+      }
+    };
+    // envoi de la requete
+    _xmlHttp.send(null)
+  }
+}
+
+
+function display(str,div)
+{
+	if (document.layers) {
+		document.layers[div].document.write(str);
+	}
+	if (document.all) {
+		document.all[div].innerHTML=str;
+	} else if (document.getElementById) {
+		document.getElementById(div).innerHTML=str;
+	}
+}
diff --git a/www/include/common/javascript/hidden_div.js b/www/include/common/javascript/hidden_div.js
new file mode 100644
index 0000000000000000000000000000000000000000..ce8563cf3f8a3dceac9dda0481a9f3998e82e4f1
--- /dev/null
+++ b/www/include/common/javascript/hidden_div.js
@@ -0,0 +1,21 @@
+
+	function DivStatus( nom, numero ){
+		var divID = nom + numero;
+		if ( document.getElementById && document.getElementById( divID ) ){ // Pour les navigateurs r�cents			
+			Pdiv = document.getElementById( divID );
+			PcH = true;
+	 	} else if ( document.all && document.all[ divID ] ){ // Pour les veilles versions
+			Pdiv = document.all[ divID ];
+			PcH = true;
+		} else if ( document.layers && document.layers[ divID ] ){ // Pour les tr�s veilles versions
+			Pdiv = document.layers[ divID ];
+			PcH = true;
+		} else {
+			PcH = false;
+		}
+		if ( PcH ){
+			Pdiv.className = ( Pdiv.className == 'cachediv' ) ? '' : 'cachediv';
+		}
+	}
+		
+		
\ No newline at end of file
diff --git a/www/include/common/javascript/tool.js b/www/include/common/javascript/tool.js
new file mode 100644
index 0000000000000000000000000000000000000000..d199e1449b321b8354a7a361b4350cc7b6a7c00d
--- /dev/null
+++ b/www/include/common/javascript/tool.js
@@ -0,0 +1,53 @@
+/**
+Oreon is developped with Apache Licence 2.0 :
+http://www.apache.org/licenses/LICENSE-2.0.txt
+Developped by : Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+// JavaScript Document
+
+<!-- Begin
+	
+	function checkUncheckAll(theElement) {
+   
+     var theForm = theElement.form, z = 0;
+	 for(z=0; z<theForm.length;z++){	 
+      if(theForm[z].type == 'checkbox'){
+      
+	  if(theForm[z].checked)
+	  {
+	   theForm[z].checked = false;
+	   }
+	  else{
+	  theForm[z].checked = true;}
+	  
+	  }
+     }
+   }
+
+
+	function DisplayHidden(id) {
+		var d = document.getElementById(id);
+
+
+	if (d.style.display == 'block') {	
+	d.style.display='none';
+	}
+	else
+	{
+	d.style.display='block';
+	}	
+}	
+	
+
+//  End -->
diff --git a/www/include/common/legend.ihtml b/www/include/common/legend.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..dc338fbcd0366a3e761a12474717352fff5a7885
--- /dev/null
+++ b/www/include/common/legend.ihtml
@@ -0,0 +1,79 @@
+
+<div id="legend" align="center">
+
+<table id="tabLegend">
+
+<tr>
+<td>
+<img src="./img/icones/16x16/document_exchange.gif" border="0" alt="{$lang.duplicate}">
+&nbsp;=&nbsp;
+{$lang.lgd_duplicate}
+</td>
+
+<td>
+<img src="./img/icones/16x16/element_next.gif" border="0" alt="{$lang.duplicate}">
+&nbsp;=&nbsp;
+{$lang.lgd_on}
+</td>
+
+<td>
+<img src="./img/icones/16x16/delete.gif" border="0" alt="{$lang.delete}">
+&nbsp;=&nbsp;
+{$lang.lgd_delOne}
+
+</td>
+<td>
+<img src='img/icones/16x16/document_edit.gif' border="0" alt="{$lang.duplicate}">
+&nbsp;=&nbsp;
+{$lang.lgd_edit}
+</td>
+
+
+<td>
+<img src="./img/icones/16x16/arrow_left_blue.png" border="0" alt="{$lang.duplicate}">
+&nbsp;=&nbsp;
+{$lang.lgd_prev}
+
+</td>
+
+
+
+</tr>
+<tr>
+
+
+
+
+<td>
+<img src="./img/icones/16x16/selection_delete.gif" border="0" alt="{$lang.delete}">
+&nbsp;=&nbsp;
+{$lang.lgd_delAll}
+</td>
+
+
+<td>
+<img src='img/icones/16x16/element_previous.gif' border="0" alt="{$lang.delete}">
+&nbsp;=&nbsp;
+{$lang.lgd_off}
+</td>
+<td>
+<img src="./img/icones/16x16/signpost.gif" border="0" alt="{$lang.duplicate}">
+&nbsp;=&nbsp;
+{$lang.lgd_signpost}
+
+</td>
+
+
+<td>
+<img src='img/icones/16x16/view.gif' border="0" alt="{$lang.delete}">
+&nbsp;=&nbsp;
+{$lang.lgd_view}
+</td>
+<td>
+<img src="./img/icones/16x16/arrow_right_blue.png" border="0" alt="{$lang.duplicate}">
+&nbsp;=&nbsp;
+{$lang.lgd_next}
+</td>
+</tr>
+</table>
+</div>
\ No newline at end of file
diff --git a/www/include/common/pagination.ihtml b/www/include/common/pagination.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..5a31f80cbc3b5db4f43b174e5d4d99861181a419
--- /dev/null
+++ b/www/include/common/pagination.ihtml
@@ -0,0 +1,24 @@
+	<table class="TableFooter">
+	<tr>
+	<td class="limitPage">{$form.limit.label}</b>&nbsp;&nbsp;{$form.limit.html}</td>
+	<td class="pagination">
+		{if $pagePrev}
+		&nbsp;<a href="{$pagePrev}"><img src="./img/icones/16x16/arrow_left_blue.png"  alt='{$previous}' title='{$previous}'></a>
+		{/if}
+	
+		{foreach key=key item=item from=$pageArr }
+				{if $pageArr[$key].num != $num}
+				&nbsp;&nbsp;<a href="{$pageArr[$key].url_page}" class="otherPageNumber">{$pageArr[$key].label_page}</a>&nbsp;
+				{else}
+				&nbsp;&nbsp;<b class="currentPageNumber">{$pageArr[$key].label_page}</b>&nbsp;
+				{/if}
+		{/foreach}
+	
+		{if $pageNext}
+		&nbsp;<a href="{$pageNext}"><img src="./img/icones/16x16/arrow_right_blue.png"  alt='{$next}' title='{$next}'></a>
+		{/if}	
+	</td>
+	<td class="pageNumber">Page {$pageNumber}</td>
+	</tr>
+	</table>
+	{$form.hidden}
\ No newline at end of file
diff --git a/www/include/common/pagination.php b/www/include/common/pagination.php
new file mode 100644
index 0000000000000000000000000000000000000000..0df3e254ffcbae9c240de80a5d62d72d90964026
--- /dev/null
+++ b/www/include/common/pagination.php
@@ -0,0 +1,132 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+
+global $oreon;
+global $num;
+global $search;
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+
+
+global $rows;
+global $limit;
+global $p;
+global $lang;
+global $limit;
+global $gopt;
+global $pagination;
+
+
+$url_var = ""; 
+if(isset($_GET["order"]))
+{
+	$url_var .= "&order=".$_GET["order"];
+	$order = $_GET["order"];
+}
+if(isset($_GET["sort_types"]))
+{
+	$url_var .= "&sort_types=".$_GET["sort_types"];
+	$sort_type = $_GET["sort_types"];
+}
+
+	if (!isset($oreon))
+		exit();
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "./include/common/");
+
+
+	$pageArr = array();
+	$istart = 0;
+	for($i = 5, $istart = $num; $istart && $i > 0; $i--)
+		$istart--;		
+	for($i2 = 0, $iend = $num; ( $iend <  ($rows / $limit -1)) && ( $i2 < (5 + $i)); $i2++)
+		$iend++;
+
+	for ($i = $istart; $i <= $iend; $i++)
+	{
+		$pageArr[$i] = array("url_page"=>"./oreon.php?p=".$p."&num=$i&limit=".$limit."&search=".$search."&o=svc".$url_var,
+							"label_page"=>"<b>".($i +1)."</b>",
+							"num"=> $i);
+	}
+	if($i > 1)							
+	$tpl->assign("pageArr", $pageArr);
+
+	$tpl->assign("num", $num);
+	$tpl->assign("previous", $lang["previous"]);
+	$tpl->assign("next", $lang["next"]);
+
+	if(($prev = $num - 1) >= 0)
+	$tpl->assign('pagePrev', ("./oreon.php?p=".$p."&num=$prev&limit=".$limit."&search=".$search."&o=svc".$url_var));
+	if(($next = $num + 1) < ($rows/$limit))
+	$tpl->assign('pageNext', ("./oreon.php?p=".$p."&num=$next&limit=".$limit."&search=".$search."&o=svc".$url_var));
+	$tpl->assign('pageNumber', ($num +1)."/".ceil($rows / $limit));
+
+
+	#Select field to change the number of row on the page
+
+
+	for ($i = 10; $i <= 100; $i = $i +10)
+		$select[$i]=$i;
+	$select[$gopt[$pagination]]=$gopt[$pagination];
+	$select[$rows]=$rows;
+	ksort($select);
+
+
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	$selLim =& $form->addElement('select', 'limit', $lang['nbr_per_page'], $select, array("onChange" => "this.form.submit('')"));
+	$selLim->setSelected($limit);
+
+	#Element we need when we reload the page
+
+	$form->addElement('hidden', 'p');
+	$form->addElement('hidden', 'search');
+	$form->addElement('hidden', 'num');
+	$form->addElement('hidden', 'order');
+	$form->addElement('hidden', 'sort_types');
+	$tab = array ("p" => $p, "search" => $search, "num"=>$num);
+	$form->setDefaults($tab);
+
+
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);
+	
+	isset($_GET["host_name"]) ? $host_name = $_GET["host_name"] : $host_name = NULL;
+	$tpl->assign("host_name", $host_name);
+	isset($_GET["status"]) ? $status = $_GET["status"] : $status = NULL;
+	$tpl->assign("status", $status);
+
+
+	$tpl->assign("begin", $num);
+	$tpl->assign("end", $limit);
+	$tpl->assign("lang", $lang);
+	$tpl->assign("order", $_GET["order"]);
+	$tab_order = array("sort_asc" => "sort_desc", "sort_desc" => "sort_asc"); 
+
+	$tpl->assign("tab_order", $tab_order);
+	
+	
+
+	$tpl->assign('form', $renderer->toArray());
+
+
+
+	$tpl->display("pagination.ihtml");
+
+?>
\ No newline at end of file
diff --git a/www/include/common/quickSearch.ihtml b/www/include/common/quickSearch.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..9f83603c0cb6d5304a1c84baa34a571e6a808426
--- /dev/null
+++ b/www/include/common/quickSearch.ihtml
@@ -0,0 +1,12 @@
+<form {$form_search_attributes}>
+	<span class="quick_search">
+		{$form_search.search.label}&nbsp;&nbsp;{$form_search.search.html}
+	</span>
+	{if $p == 602 || $p == 60201}
+	<span class="quick_search">
+		&nbsp;&nbsp;{$form_search.search_type_host.html}&nbsp;&nbsp;{$form_search.search_type_host.label}
+		&nbsp;&nbsp;{$form_search.search_type_service.html}&nbsp;&nbsp;{$form_search.search_type_service.label}
+	</span>
+	{/if}
+	{$form_search.hidden}
+</form>
diff --git a/www/include/common/quickSearch.php b/www/include/common/quickSearch.php
new file mode 100644
index 0000000000000000000000000000000000000000..d44e62976c4bd039191d6ab02dbf4a249a92bf8a
--- /dev/null
+++ b/www/include/common/quickSearch.php
@@ -0,0 +1,47 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	/* start quickSearch form*/
+	
+	$form_search = new HTML_QuickForm('quickSearchForm', 'GET', "?p=".$p);
+	
+	$tab = array ("search" => $search, "p"=>$p, "limit"=>$limit, "search_type_host"=>1, "search_type_service"=>1);
+	$form_search->addElement('text', 'search', $lang["quicksearch"]);
+	$form_search->addElement('hidden', 'p');
+	$form_search->addElement('hidden', 'limit');
+	$form_search->addElement('hidden', 'list');
+	if ($p == 602 || $p == 60201) {
+		$form_search->addElement('advcheckbox', 'search_type_host', 'host');
+		$form_search->addElement('advcheckbox', 'search_type_service', 'service');
+	}
+
+	$form_search->setDefaults($tab);
+	
+	# Render with a smarty template
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./include/common/", $tpl);
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form_search->accept($renderer);	
+	$tpl->assign('form_search', $renderer->toArray());
+	$tpl->assign('p', $p);
+	$tpl->display("quickSearch.ihtml");
+
+	/* end quickSearch form*/	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/changetab.js b/www/include/configuration/changetab.js
new file mode 100644
index 0000000000000000000000000000000000000000..b8695e16c9191d59700877cee5c6d3a07f806375
--- /dev/null
+++ b/www/include/configuration/changetab.js
@@ -0,0 +1,24 @@
+/*
+**Change Tab
+*/
+
+function init(){
+
+		for (var i = 2; document.getElementById('tab'+i); i++) {
+			document.getElementById('tab'+i).style.display='none';
+		}
+	}
+	function montre(id) {
+		for (var i = 1; document.getElementById('c'+i); i++) {
+				document.getElementById('c'+i).className='b';
+		}
+		document.getElementById('c'+id).className='a';
+
+		var d = document.getElementById('tab'+id);
+		for (var i = 1; document.getElementById('tab'+i); i++) {
+			document.getElementById('tab'+i).style.display='none';
+		}
+	if (d) {
+	d.style.display='block';
+	}
+}		
diff --git a/www/include/configuration/configCGI/CGI.php b/www/include/configuration/configCGI/CGI.php
new file mode 100644
index 0000000000000000000000000000000000000000..7b7e0c6b9add35194b72b2ded15d796a757d5bc1
--- /dev/null
+++ b/www/include/configuration/configCGI/CGI.php
@@ -0,0 +1,49 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["cgi_id"]) ? $cG = $_GET["cgi_id"] : $cG = NULL;
+	isset($_POST["cgi_id"]) ? $cP = $_POST["cgi_id"] : $cP = NULL;
+	$cG ? $cgi_id = $cG : $cgi_id = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configCGI/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formCGI.php"); break; #Add CGI.cfg
+		case "w" : require_once($path."formCGI.php"); break; #Watch CGI.cfg
+		case "c" : require_once($path."formCGI.php"); break; #Modify CGI.cfg
+		case "s" : enableCGIInDB($cgi_id); require_once($path."listCGI.php"); break; #Activate a CGI CFG
+		case "u" : disableCGIInDB($cgi_id); require_once($path."listCGI.php"); break; #Desactivate a CGI CFG
+		case "m" : multipleCGIInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listCGI.php"); break; #Duplicate n CGI CFGs
+		case "d" : deleteCGIInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listCGI.php"); break; #Delete n CGI CFG
+		default : require_once($path."listCGI.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configCGI/DB-Func.php b/www/include/configuration/configCGI/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..f40509c5ed163abf8bf1d22a5915112d57e27e6d
--- /dev/null
+++ b/www/include/configuration/configCGI/DB-Func.php
@@ -0,0 +1,193 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	function testCgiExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('cgi_id');
+		$res =& $pearDB->query("SELECT cgi_name, cgi_id FROM cfg_cgi WHERE cgi_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$cgi =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $cgi["cgi_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $cgi["cgi_id"] != $id)
+			return false;
+		else
+			return true;
+	}	
+	
+	function enableCGIInDB ($cgi_id = null)	{
+		if (!$cgi_id) return;
+		global $pearDB;
+		global $oreon;
+		$pearDB->query("UPDATE cfg_cgi SET cgi_activate = '0'");
+		$pearDB->query("UPDATE cfg_cgi SET cgi_activate = '1' WHERE cgi_id = '".$cgi_id."'");
+	}
+	
+	function disableCGIInDB ($cgi_id = null)	{
+		if (!$cgi_id) return;
+		global $pearDB;
+		global $oreon;
+		$pearDB->query("UPDATE cfg_cgi SET cgi_activate = '0' WHERE cgi_id = '".$cgi_id."'");
+		$res =& $pearDB->query("SELECT MAX(cgi_id) FROM cfg_cgi WHERE cgi_id != '".$cgi_id."'");
+		$maxId =& $res->fetchRow();
+		if (isset($maxId["MAX(cgi_id)"]))
+			$pearDB->query("UPDATE cfg_cgi SET cgi_activate = '1' WHERE cgi_id = '".$maxId["MAX(cgi_id)"]."'");
+	}
+	
+	function deleteCGIInDB ($cgi = array())	{
+		global $pearDB;
+		foreach($cgi as $key=>$value)
+			$pearDB->query("DELETE FROM cfg_cgi WHERE cgi_id = '".$key."'");
+		$res =& $pearDB->query("SELECT cgi_id FROM cfg_cgi WHERE cgi_activate = '1'");		  
+		if (!$res->numRows())	{
+			$res =& $pearDB->query("SELECT MAX(cgi_id) FROM cfg_cgi");
+			$cgi_id = $res->fetchRow();
+			$pearDB->query("UPDATE cfg_cgi SET cgi_activate = '1' WHERE cgi_id = '".$cgi_id["MAX(cgi_id)"]."'");
+		}
+	}
+	
+	function multipleCGIInDB ($cgi = array(), $nbrDup = array())	{
+		foreach($cgi as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM cfg_cgi WHERE cgi_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["cgi_id"] = '';
+			$row["cgi_activate"] = '0';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "cgi_name" ? ($cgi_name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testCgiExistence($cgi_name))	{
+					$val ? $rq = "INSERT INTO cfg_cgi VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+				}
+			}
+		}
+	}
+	
+	function updateCGIInDB ($cgi_id = NULL)	{
+		if (!$cgi_id) return;
+		updateCGI($cgi_id);
+	}	
+	
+	function insertCGIInDB ($ret = array())	{
+		$cgi_id = insertCGI($ret);
+		return ($cgi_id);
+	}
+	
+	function insertCGI($ret = array())	{
+		global $form;
+		global $pearDB;
+		global $oreon;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO `cfg_cgi` ( `cgi_id` , `cgi_name` , `main_config_file` , `physical_html_path` , `url_html_path` , " .
+				"`nagios_check_command` , `use_authentication` , `default_user_name` , `authorized_for_system_information` , " .
+				"`authorized_for_system_commands` , `authorized_for_configuration_information` , `authorized_for_all_hosts` , " .
+				"`authorized_for_all_host_commands` , `authorized_for_all_services` , `authorized_for_all_service_commands` , " .
+				"`statusmap_background_image` , `default_statusmap_layout` , `statuswrl_include` , `default_statuswrl_layout` , " .
+				"`refresh_rate` , `host_unreachable_sound` , `host_down_sound` , `service_critical_sound` , `service_warning_sound` , " .
+				"`service_unknown_sound` , `ping_syntax` , `cgi_comment` , `cgi_activate` )" .
+				" VALUES (";
+		$rq .= "NULL, ";
+        isset($ret["cgi_name"]) && $ret["cgi_name"] != NULL ? $rq .= "'".htmlentities($ret["cgi_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["main_config_file"]) && $ret["main_config_file"] != NULL ? $rq .= "'".htmlentities($ret["main_config_file"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["physical_html_path"]) && $ret["physical_html_path"] != NULL ? $rq .= "'".htmlentities($ret["physical_html_path"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["url_html_path"]) && $ret["url_html_path"] != NULL ? $rq .= "'".htmlentities($ret["url_html_path"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["nagios_check_command"]) && $ret["nagios_check_command"] != NULL ? $rq .= "'".htmlentities($ret["nagios_check_command"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["use_authentication"]["use_authentication"]) && $ret["use_authentication"]["use_authentication"] != NULL ? $rq .= "'".$ret["use_authentication"]["use_authentication"]."', " : $rq .= "NULL, ";
+        isset($ret["default_user_name"]) && $ret["default_user_name"] != NULL ? $rq .= "'".htmlentities($ret["default_user_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["authorized_for_system_information"]) && $ret["authorized_for_system_information"] != NULL ? $rq .= "'".htmlentities($ret["authorized_for_system_information"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["authorized_for_system_commands"]) && $ret["authorized_for_system_commands"] != NULL ? $rq .= "'".htmlentities($ret["authorized_for_system_commands"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["authorized_for_configuration_information"]) && $ret["authorized_for_configuration_information"] != NULL ? $rq .= "'".htmlentities($ret["authorized_for_configuration_information"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["authorized_for_all_hosts"]) && $ret["authorized_for_all_hosts"] != NULL ? $rq .= "'".htmlentities($ret["authorized_for_all_hosts"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["authorized_for_all_host_commands"]) && $ret["authorized_for_all_host_commands"] != NULL ? $rq .= "'".htmlentities($ret["authorized_for_all_host_commands"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["authorized_for_all_services"]) && $ret["authorized_for_all_services"] != NULL ? $rq .= "'".htmlentities($ret["authorized_for_all_services"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["authorized_for_all_service_commands"]) && $ret["authorized_for_all_service_commands"] != NULL ? $rq .= "'".htmlentities($ret["authorized_for_all_service_commands"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["statusmap_background_image"]) && $ret["statusmap_background_image"] != NULL ? $rq .= "'".htmlentities($ret["statusmap_background_image"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["default_statusmap_layout"]) && $ret["default_statusmap_layout"] != NULL ? $rq .= "'".htmlentities($ret["default_statusmap_layout"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["statuswrl_include"]) && $ret["statuswrl_include"] != NULL ? $rq .= "'".htmlentities($ret["statuswrl_include"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["default_statuswrl_layout"]) && $ret["default_statuswrl_layout"] != NULL ? $rq .= "'".htmlentities($ret["default_statuswrl_layout"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["refresh_rate"]) && $ret["refresh_rate"] != NULL ? $rq .= "'".htmlentities($ret["refresh_rate"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["host_unreachable_sound"]) && $ret["host_unreachable_sound"] != NULL ? $rq .= "'".htmlentities($ret["host_unreachable_sound"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["host_down_sound"]) && $ret["host_down_sound"] != NULL ? $rq .= "'".htmlentities($ret["host_down_sound"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["service_critical_sound"]) && $ret["service_critical_sound"] != NULL ? $rq .= "'".htmlentities($ret["service_critical_sound"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["service_warning_sound"]) && $ret["service_warning_sound"] != NULL ? $rq .= "'".htmlentities($ret["service_warning_sound"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["service_unknown_sound"]) && $ret["service_unknown_sound"] != NULL ? $rq .= "'".htmlentities($ret["service_unknown_sound"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["ping_syntax"]) && $ret["ping_syntax"] != NULL ? $rq .= "'".htmlentities($ret["ping_syntax"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["cgi_comment"]) && $ret["cgi_comment"] != NULL ? $rq .= "'".htmlentities($ret["cgi_comment"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["cgi_activate"]["cgi_activate"]) && $ret["cgi_activate"]["cgi_activate"] != NULL ? $rq .= "'".$ret["cgi_activate"]["cgi_activate"]."')" : $rq .= "'0')";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(cgi_id) FROM cfg_cgi");
+		$cgi_id = $res->fetchRow();
+		if (isset($ret["cgi_activate"]["cgi_activate"]) && $ret["cgi_activate"]["cgi_activate"])	{
+			$pearDB->query("UPDATE cfg_cgi SET cgi_activate = '0' WHERE cgi_id != '".$cgi_id["MAX(cgi_id)"]."'");
+			$oreon->CGIcfg = array();
+			$res =& $pearDB->query("SELECT * FROM `cfg_cgi` WHERE `cgi_activate` = '1' LIMIT 1");
+			$oreon->CGIcfg = $res->fetchRow();
+		}
+		return ($cgi_id["MAX(cgi_id)"]);
+	}
+	
+	function updateCGI($cgi_id = null)	{
+		if (!$cgi_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE cfg_cgi SET ";
+        isset($ret["cgi_name"]) && $ret["cgi_name"] != NULL ? $rq .= "cgi_name = '".htmlentities($ret["cgi_name"], ENT_QUOTES)."', " : $rq .= "cgi_name = NULL, ";
+        isset($ret["main_config_file"]) && $ret["main_config_file"] != NULL ? $rq .= "main_config_file = '".htmlentities($ret["main_config_file"], ENT_QUOTES)."', " : $rq .= "main_config_file = NULL, ";
+        isset($ret["physical_html_path"]) && $ret["physical_html_path"] != NULL ? $rq .= "physical_html_path = '".htmlentities($ret["physical_html_path"], ENT_QUOTES)."', " : $rq .= "physical_html_path = NULL, ";
+        isset($ret["url_html_path"]) && $ret["url_html_path"] != NULL ? $rq .= "url_html_path = '".htmlentities($ret["url_html_path"], ENT_QUOTES)."', " : $rq .= "url_html_path = NULL, ";
+        isset($ret["nagios_check_command"]) && $ret["nagios_check_command"] != NULL ? $rq .= "nagios_check_command = '".htmlentities($ret["nagios_check_command"], ENT_QUOTES)."', " : $rq .= "nagios_check_command = NULL, ";
+        isset($ret["use_authentication"]["use_authentication"]) && $ret["use_authentication"]["use_authentication"] != NULL ? $rq .= "use_authentication = '".$ret["use_authentication"]["use_authentication"]."', " : $rq .= "use_authentication = NULL, ";
+        isset($ret["default_user_name"]) && $ret["default_user_name"] != NULL ? $rq .= "default_user_name = '".htmlentities($ret["default_user_name"], ENT_QUOTES)."', " : $rq .= "default_user_name = NULL, ";
+        isset($ret["authorized_for_system_information"]) && $ret["authorized_for_system_information"] != NULL ? $rq .= "authorized_for_system_information = '".htmlentities($ret["authorized_for_system_information"], ENT_QUOTES)."', " : $rq .= "authorized_for_system_information = NULL, ";
+        isset($ret["authorized_for_system_commands"]) && $ret["authorized_for_system_commands"] != NULL ? $rq .= "authorized_for_system_commands = '".htmlentities($ret["authorized_for_system_commands"], ENT_QUOTES)."', " : $rq .= "authorized_for_system_commands = NULL, ";
+        isset($ret["authorized_for_configuration_information"]) && $ret["authorized_for_configuration_information"] != NULL ? $rq .= "authorized_for_configuration_information = '".htmlentities($ret["authorized_for_configuration_information"], ENT_QUOTES)."', " : $rq .= "authorized_for_configuration_information = NULL, ";
+        isset($ret["authorized_for_all_hosts"]) && $ret["authorized_for_all_hosts"] != NULL ? $rq .= "authorized_for_all_hosts = '".htmlentities($ret["authorized_for_all_hosts"], ENT_QUOTES)."', " : $rq .= "authorized_for_all_hosts = NULL, ";
+        isset($ret["authorized_for_all_host_commands"]) && $ret["authorized_for_all_host_commands"] != NULL ? $rq .= "authorized_for_all_host_commands = '".htmlentities($ret["authorized_for_all_host_commands"], ENT_QUOTES)."', " : $rq .= "authorized_for_all_host_commands = NULL, ";
+        isset($ret["authorized_for_all_services"]) && $ret["authorized_for_all_services"] != NULL ? $rq .= "authorized_for_all_services = '".htmlentities($ret["authorized_for_all_services"], ENT_QUOTES)."', " : $rq .= "authorized_for_all_services = NULL, ";
+        isset($ret["authorized_for_all_service_commands"]) && $ret["authorized_for_all_service_commands"] != NULL ? $rq .= "authorized_for_all_service_commands = '".htmlentities($ret["authorized_for_all_service_commands"], ENT_QUOTES)."', " : $rq .= "authorized_for_all_service_commands = NULL, ";
+        isset($ret["statusmap_background_image"]) && $ret["statusmap_background_image"] != NULL ? $rq .= "statusmap_background_image = '".htmlentities($ret["statusmap_background_image"], ENT_QUOTES)."', " : $rq .= "statusmap_background_image = NULL, ";
+        isset($ret["default_statusmap_layout"]) && $ret["default_statusmap_layout"] != NULL ? $rq .= "default_statusmap_layout = '".htmlentities($ret["default_statusmap_layout"], ENT_QUOTES)."', " : $rq .= "default_statusmap_layout = NULL, ";
+        isset($ret["statuswrl_include"]) && $ret["statuswrl_include"] != NULL ? $rq .= "statuswrl_include = '".htmlentities($ret["statuswrl_include"], ENT_QUOTES)."', " : $rq .= "statuswrl_include = NULL, ";
+        isset($ret["default_statuswrl_layout"]) && $ret["default_statuswrl_layout"] != NULL ? $rq .= "default_statuswrl_layout = '".htmlentities($ret["default_statuswrl_layout"], ENT_QUOTES)."', " : $rq .= "default_statuswrl_layout = NULL, ";
+        isset($ret["refresh_rate"]) && $ret["refresh_rate"] != NULL ? $rq .= "refresh_rate = '".htmlentities($ret["refresh_rate"], ENT_QUOTES)."', " : $rq .= "refresh_rate = NULL, ";
+        isset($ret["host_unreachable_sound"]) && $ret["host_unreachable_sound"] != NULL ? $rq .= "host_unreachable_sound = '".htmlentities($ret["host_unreachable_sound"], ENT_QUOTES)."', " : $rq .= "host_unreachable_sound = NULL, ";
+        isset($ret["host_down_sound"]) && $ret["host_down_sound"] != NULL ? $rq .= "host_down_sound = '".htmlentities($ret["host_down_sound"], ENT_QUOTES)."', " : $rq .= "host_down_sound = NULL, ";
+        isset($ret["service_critical_sound"]) && $ret["service_critical_sound"] != NULL ? $rq .= "service_critical_sound = '".htmlentities($ret["service_critical_sound"], ENT_QUOTES)."', " : $rq .= "service_critical_sound = NULL, ";
+        isset($ret["service_warning_sound"]) && $ret["service_warning_sound"] != NULL ? $rq .= "service_warning_sound = '".htmlentities($ret["service_warning_sound"], ENT_QUOTES)."', " : $rq .= "service_warning_sound = NULL, ";
+        isset($ret["service_unknown_sound"]) && $ret["service_unknown_sound"] != NULL ? $rq .= "service_unknown_sound = '".htmlentities($ret["service_unknown_sound"], ENT_QUOTES)."', " : $rq .= "service_unknown_sound = NULL, ";
+        isset($ret["ping_syntax"]) && $ret["ping_syntax"] != NULL ? $rq .= "ping_syntax = '".htmlentities($ret["ping_syntax"], ENT_QUOTES)."', " : $rq .= "ping_syntax = NULL, ";
+        isset($ret["cgi_comment"]) && $ret["cgi_comment"] != NULL ? $rq .= "cgi_comment = '".htmlentities($ret["cgi_comment"], ENT_QUOTES)."', " : $rq .= "cgi_comment = NULL, ";
+		isset($ret["cgi_activate"]["cgi_activate"]) && $ret["cgi_activate"]["cgi_activate"] != NULL ? $rq .= "cgi_activate = '".$ret["cgi_activate"]["cgi_activate"]."' " : $rq .= "cgi_activate = '0' ";
+		$rq .= "WHERE cgi_id = '".$cgi_id."'";
+		$pearDB->query($rq);
+		if ($ret["cgi_activate"]["cgi_activate"])
+			enableCGIInDB($cgi_id);
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configCGI/formCGI.ihtml b/www/include/configuration/configCGI/formCGI.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..085d04d698aa99a7d847aa4b165a705bf0da8f2a
--- /dev/null
+++ b/www/include/configuration/configCGI/formCGI.ihtml
@@ -0,0 +1,66 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/text_code_c.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.cgi_name.label}</td><td class="FormRowValue">{$form.cgi_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.cgi_comment.label}</td><td class="FormRowValue">{$form.cgi_comment.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.cgi_activate.label}</td><td class="FormRowValue">{$form.cgi_activate.html}</td></tr>
+		
+		<!-- Part 1 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.main_config_file.label}</td><td class="FormRowValue">{$form.main_config_file.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.physical_html_path.label}</td><td class="FormRowValue">{$form.physical_html_path.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.url_html_path.label}</td><td class="FormRowValue">{$form.url_html_path.html}</td></tr>
+		
+		<!-- Part 2 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>
+		{if $nagios == 1}
+			<tr class="list_one"><td class="FormRowField">{$form.nagios_check_command.label}</td><td class="FormRowValue">{$form.nagios_check_command.html}</td></tr>
+		{/if}
+		<tr class="list_two"><td class="FormRowField">{$form.use_authentication.label}</td><td class="FormRowValue">{$form.use_authentication.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.default_user_name.label}</td><td class="FormRowValue">{$form.default_user_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.authorized_for_system_information.label}</td><td class="FormRowValue">{$form.authorized_for_system_information.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.authorized_for_system_commands.label}</td><td class="FormRowValue">{$form.authorized_for_system_commands.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.authorized_for_configuration_information.label}</td><td class="FormRowValue">{$form.authorized_for_configuration_information.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.authorized_for_all_hosts.label}</td><td class="FormRowValue">{$form.authorized_for_all_hosts.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.authorized_for_all_host_commands.label}</td><td class="FormRowValue">{$form.authorized_for_all_host_commands.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.authorized_for_all_services.label}</td><td class="FormRowValue">{$form.authorized_for_all_services.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.authorized_for_all_service_commands.label}</td><td class="FormRowValue">{$form.authorized_for_all_service_commands.html}</td></tr>
+
+		<!-- Part 3 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.statusmap_background_image.label}</td><td class="FormRowValue">{$form.statusmap_background_image.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.default_statusmap_layout.label}</td><td class="FormRowValue">{$form.default_statusmap_layout.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.statuswrl_include.label}</td><td class="FormRowValue">{$form.statuswrl_include.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.default_statuswrl_layout.label}</td><td class="FormRowValue">{$form.default_statuswrl_layout.html}</td></tr>
+
+		<!-- Part 4 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.refresh_rate.label}</td><td class="FormRowValue">{$form.refresh_rate.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.host_unreachable_sound.label}</td><td class="FormRowValue">{$form.host_unreachable_sound.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.host_down_sound.label}</td><td class="FormRowValue">{$form.host_down_sound.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.service_critical_sound.label}</td><td class="FormRowValue">{$form.service_critical_sound.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_warning_sound.label}</td><td class="FormRowValue">{$form.service_warning_sound.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.service_unknown_sound.label}</td><td class="FormRowValue">{$form.service_unknown_sound.html}</td></tr>
+
+		<!-- Part 5 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.ping_syntax.label}</td><td class="FormRowValue">{$form.ping_syntax.html}</td></tr>
+		
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>	
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
+
diff --git a/www/include/configuration/configCGI/formCGI.php b/www/include/configuration/configCGI/formCGI.php
new file mode 100644
index 0000000000000000000000000000000000000000..4293fe99cdbd1b5545851e34b8c88371ebb75d9b
--- /dev/null
+++ b/www/include/configuration/configCGI/formCGI.php
@@ -0,0 +1,208 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Nagios
+	#
+	$cgi = array();
+	if (($o == "c" || $o == "w") && $cgi_id)	{	
+		$res =& $pearDB->query("SELECT * FROM cfg_cgi WHERE cgi_id = '".$cgi_id."' LIMIT 1");
+		# Set base value
+		$cgi = array_map("myDecode", $res->fetchRow());
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Check commands comes from DB -> Store in $checkCmds Array
+	$checkCmds = array();
+	$res =& $pearDB->query("SELECT command_id, command_name FROM command ORDER BY command_name");
+	$checkCmds = array(NULL=>NULL);
+	while($res->fetchInto($checkCmd))
+		$checkCmds[$checkCmd["command_id"]] = $checkCmd["command_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText		= array("size"=>"30");
+	$attrsText2 	= array("size"=>"50");
+	$attrsText3 	= array("size"=>"10");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["cgi_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["cgi_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["cgi_view"]);
+
+	#
+	## CGI Configuration basic information
+	#
+	$form->addElement('header', 'information', $lang['cgi_infos']);
+	$form->addElement('text', 'cgi_name', $lang["cgi_name"], $attrsText);
+	$form->addElement('textarea', 'cgi_comment', $lang["cgi_comment"], $attrsTextarea);
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'cgi_activate', null, $lang["enable"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'cgi_activate', null, $lang["disable"], '0');
+	$form->addGroup($nagTab, 'cgi_activate', $lang["status"], '&nbsp;');	
+	
+	## Part 1
+	$form->addElement('text', 'main_config_file', $lang["cgi_mainConfFile"], $attrsText2);
+	$form->addElement('text', 'physical_html_path', $lang["cgi_phyHtmlPath"], $attrsText2);
+	$form->addElement('text', 'url_html_path', $lang["cgi_urlHtmlPath"], $attrsText2);
+	
+	## Part 2
+	if ($oreon->user->get_version() == 1)
+		$form->addElement('text', 'nagios_check_command', $lang["cgi_nagCheckCmd"], $attrsText2);
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_authentication', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_authentication', null, $lang["no"], '0');
+	$form->addGroup($nagTab, 'use_authentication', $lang["cgi_authUsage"], '&nbsp;');
+	$form->addElement('text', 'default_user_name', $lang["cgi_defUserName"], $attrsText);
+	$form->addElement('textarea', 'authorized_for_system_information', $lang["cgi_authFSysInfo"], $attrsTextarea);
+	$form->addElement('textarea', 'authorized_for_system_commands', $lang["cgi_authFSysCmd"], $attrsTextarea);
+	$form->addElement('textarea', 'authorized_for_configuration_information', $lang["cgi_authFConfInf"], $attrsTextarea);
+	$form->addElement('textarea', 'authorized_for_all_hosts', $lang["cgi_authFAllHosts"], $attrsTextarea);
+	$form->addElement('textarea', 'authorized_for_all_host_commands', $lang["cgi_authFAllHostCmds"], $attrsTextarea);
+	$form->addElement('textarea', 'authorized_for_all_services', $lang["cgi_authFAllSv"], $attrsTextarea);
+	$form->addElement('textarea', 'authorized_for_all_service_commands', $lang["cgi_authFAllSvCmds"], $attrsTextarea);
+	
+	## Part 3
+	$form->addElement('text', 'statusmap_background_image', $lang["cgi_smBckImg"], $attrsText2);
+	$form->addElement('select', 'default_statusmap_layout', $lang["cgi_defSMLayMet"], array(0=>"User-defined coordinates", 1=>"Depth layers", 2=>"Collapsed tree", 3=>"Balanced tree", 4=>"Circular", 5=>"Circular (Marked Up)", 6=>"Circular (Balloon)"));
+	$form->addElement('text', 'statuswrl_include', $lang["cgi_statCGIIncWld"], $attrsText2);
+	$form->addElement('select', 'default_statuswrl_layout', $lang["cgi_defStatWRLLay"], array(0=>"User-defined coordinates", 1=>"Depth layers", 2=>"Collapsed tree", 3=>"Balanced tree", 4=>"Circular"));
+
+	## Part 4
+	$form->addElement('text', 'refresh_rate', $lang["cgi_cgIRefRate"], $attrsText3);
+	$form->addElement('text', 'host_unreachable_sound', $lang["cgi_hus"], $attrsText2);
+	$form->addElement('text', 'host_down_sound', $lang["cgi_hdu"], $attrsText2);
+	$form->addElement('text', 'service_critical_sound', $lang["cgi_scs"], $attrsText2);
+	$form->addElement('text', 'service_warning_sound', $lang["cgi_sws"], $attrsText2);
+	$form->addElement('text', 'service_unknown_sound', $lang["cgi_sus"], $attrsText2);
+
+	## Part 5
+	$form->addElement('textarea', 'ping_syntax', $lang["cgi_pingSyntax"], $attrsTextarea);
+		
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	
+	$form->setDefaults(array(
+	"cgi_activate"=>'0',
+	"main_config_file"=>'/usr/local/nagios/etc/nagios.cfg',
+	"physical_html_path"=>'/usr/local/nagios/share',
+	"use_authentication"=>array("use_authentication"=>1),
+	"default_user_name"=>'guest',
+	"authorized_for_system_information"=>'nagiosadmin',
+	"authorized_for_system_commands"=>'nagiosadmin',
+	"authorized_for_configuration_information"=>'nagiosadmin',
+	"authorized_for_all_hosts"=>'nagiosadmin',
+	"authorized_for_all_host_commands"=>'nagiosadmin',
+	"authorized_for_all_services"=>'nagiosadmin',
+	"authorized_for_all_service_commands"=>'nagiosadmin',
+	"default_statusmap_layout"=>'4',
+	"default_statuswrl_layout"=>'4',
+	"refresh_rate"=>'90',
+	"ping_syntax"=>'/bin/ping -n -U -c 5 $HOSTADDRESS$',
+	'action'=>'1'
+	));
+		
+	$form->addElement('hidden', 'cgi_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	function slash($elem = NULL)	{
+		if ($elem)
+			return rtrim($elem, "/");
+	}
+	$form->applyFilter('physical_html_path', 'slash');
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('cgi_name', $lang['ErrName'], 'required');
+	$form->addRule('cgi_comment', $lang['ErrRequired'], 'required');
+	$form->registerRule('exist', 'callback', 'testCgiExistence');
+	$form->addRule('cgi_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+	
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	# Just watch a CGI information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&cgi_id=".$cgi_id."'"));
+	    $form->setDefaults($cgi);
+		$form->freeze();
+	}
+	# Modify a CGI information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($cgi);
+	}
+	# Add a CGI information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	
+	$tpl->assign("nagios", $oreon->user->get_version());
+	$valid = false;
+	if ($form->validate())	{
+		$cgiObj =& $form->getElement('cgi_id');
+		if ($form->getSubmitValue("submitA"))
+			$cgiObj->setValue(insertCGIInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateCGIInDB($cgiObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&cgi_id=".$cgiObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listCGI.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("formCGI.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configCGI/listCGI.ihtml b/www/include/configuration/configCGI/listCGI.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..150085da685bf5ff47529e5d3cf185f0c81dd4d8
--- /dev/null
+++ b/www/include/configuration/configCGI/listCGI.ihtml
@@ -0,0 +1,41 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="2"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
\ No newline at end of file
diff --git a/www/include/configuration/configCGI/listCGI.php b/www/include/configuration/configCGI/listCGI.php
new file mode 100644
index 0000000000000000000000000000000000000000..310e9660c89edd07af30bca91f77f95ef16a8aeb
--- /dev/null
+++ b/www/include/configuration/configCGI/listCGI.php
@@ -0,0 +1,97 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM cfg_cgi WHERE cgi_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM cfg_cgi");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Nagios list
+	if ($search)
+		$rq = "SELECT cgi_id, cgi_name, cgi_comment, cgi_activate FROM cfg_cgi WHERE cgi_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' ORDER BY cgi_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT cgi_id, cgi_name, cgi_comment, cgi_activate FROM cfg_cgi ORDER BY cgi_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($cgi); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$cgi['cgi_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&cgi_id=".$cgi['cgi_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&cgi_id=".$cgi['cgi_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&cgi_id=".$cgi['cgi_id']."&o=d&select[".$cgi['cgi_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($cgi["cgi_activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&cgi_id=".$cgi['cgi_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&cgi_id=".$cgi['cgi_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$cgi['cgi_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$cgi["cgi_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&cgi_id=".$cgi['cgi_id'],
+						"RowMenu_desc"=>substr($cgi["cgi_comment"], 0, 40),
+						"RowMenu_status"=>$cgi["cgi_activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listCGI.ihtml");
+	
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/DB-Func.php b/www/include/configuration/configGenerate/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..21d9d195300bcff64cd8d513e07ea91e8ac1e1b4
--- /dev/null
+++ b/www/include/configuration/configGenerate/DB-Func.php
@@ -0,0 +1,452 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function manageDependencies()	{
+		global $pearDB;
+		global $form;
+		$gbArr = array();	
+		$ret = $form->getSubmitValues();
+		if ($ret["level"]["level"] == 1)
+			$gbArr =& checkDependenciesStrong();
+		else if ($ret["level"]["level"] == 2)
+			$gbArr =& checkDependenciesLite();
+		else if (($ret["level"]["level"] == 3) && $ret["xml"]["xml"])
+			$gbArr =& checkNoDependencies();
+		else
+			$gbArr = NULL;
+		return ($gbArr);
+	}
+	
+	function checkDependenciesStrong()	{
+		global $pearDB;
+		global $oreon;
+		$cctEnb = array();
+		$cgEnb = array();
+		$hostEnb = array();
+		$hgEnb = array();
+		$svEnb = array();
+		$sgEnb = array();
+		$oslEnb = array();
+		$omsEnb = array();
+		$gbEnb = array(0=>&$cctEnb, 1=>&$cgEnb, 2=>&$hostEnb, 3=>&$hgEnb, 4=>&$svEnb, 5=>&$sgEnb, 6=>&$oslEnb, 7=>&$omsEnb);
+		
+		# Contact
+		$contact = array();
+		$res =& $pearDB->query("SELECT contact_id FROM contact WHERE contact_activate ='1'");
+		while($res->fetchInto($contact))	{
+			$res2 =& $pearDB->query("SELECT DISTINCT cg.cg_activate FROM contactgroup_contact_relation cgcr, contactgroup cg WHERE cgcr.contact_contact_id = '".$contact["contact_id"]."' AND cg.cg_id = cgcr.contactgroup_cg_id");
+			while($res2->fetchInto($contactGroup))	{
+				if ($contactGroup["cg_activate"])
+					$cctEnb[$contact["contact_id"]] = 1;
+				unset($contactGroup);
+			}
+			unset($contact);
+		}
+		$res->free();
+		# ContactGroup
+		$contactGroup = array();
+		$res =& $pearDB->query("SELECT DISTINCT cgcr.contactgroup_cg_id, cgcr.contact_contact_id FROM contactgroup cg, contactgroup_contact_relation cgcr WHERE cg.cg_activate ='1' AND cgcr.contactgroup_cg_id = cg.cg_id");
+		while($res->fetchInto($contactGroup))
+			array_key_exists($contactGroup["contact_contact_id"], $cctEnb) ? $cgEnb[$contactGroup["contactgroup_cg_id"]] = 1 : NULL;
+		unset($contactGroup);
+		$res->free();
+		# Host Template Model
+		$host = array();
+		$res =& $pearDB->query("SELECT host_id FROM host WHERE host.host_register = '0' AND host.host_activate = '1'");
+		while($res->fetchInto($host))
+			$hostEnb[$host["host_id"]] = 1;
+		$res->free();
+		# Host
+		$host = array();
+		# In Nagios V2 -> Contact Group are obligatory
+		if ($oreon->user->get_version() == 2)	{
+			$res =& $pearDB->query("SELECT host_template_model_htm_id, host_id FROM host WHERE host.host_register = '1' AND host.host_activate = '1'");
+			while($res->fetchInto($host))	{
+				# If the Host is link to a Template, we think that the dependencies are manage in the template			
+				if ($host["host_template_model_htm_id"])	{
+					if (array_key_exists($host["host_template_model_htm_id"], $hostEnb))
+						$hostEnb[$host["host_id"]] = 1;
+				}
+				else	{
+					$res2 =& $pearDB->query("SELECT DISTINCT cghr.contactgroup_cg_id FROM contactgroup_host_relation cghr WHERE cghr.host_host_id = '".$host["host_id"]."'");
+					while($res2->fetchInto($valid))
+						array_key_exists($valid["contactgroup_cg_id"], $cgEnb) ? $hostEnb[$host["host_id"]] = 1 : NULL;
+					$res2->free();
+					unset($valid);
+				}
+				$res2 =& $pearDB->query("SELECT DISTINCT hg.hg_activate FROM hostgroup_relation hgr, hostgroup hg WHERE hgr.host_host_id = '".$host["host_id"]."' AND hg.hg_id = hgr.hostgroup_hg_id");
+				while($res2->fetchInto($hostGroup))	{
+					if ($hostGroup["hg_activate"])
+						$hostEnb[$host["host_id"]] = 1;
+				}
+			}
+			$res->free();
+		}	
+		else	{
+			$res =& $pearDB->query("SELECT DISTINCT host_template_model_htm_id, host.host_id FROM host WHERE host.host_register = '1' AND host.host_activate = '1'");
+			while($res->fetchInto($host))	{/*
+				# If the Host is link to a Template, we think that the dependencies are manage in the template			
+				if ($host["host_template_model_htm_id"])	{
+					if (array_key_exists($host["host_template_model_htm_id"], $hostEnb))
+						$hostEnb[$host["host_id"]] = 1;
+				}*/
+				$res2 =& $pearDB->query("SELECT DISTINCT hg.hg_activate FROM hostgroup_relation hgr, hostgroup hg WHERE hgr.host_host_id = '".$host["host_id"]."' AND hg.hg_id = hgr.hostgroup_hg_id");
+				if ($res2->numRows())	{
+					while($res2->fetchInto($hostGroup))
+						if ($hostGroup["hg_activate"])
+							$hostEnb[$host["host_id"]] = 1;
+				}
+				else
+					$hostEnb[$host["host_id"]] = 1;
+			}
+			$res->free();
+		}
+		unset($host);
+		# Host Group
+		$hostGroup = array();
+		if ($oreon->user->get_version() == 1)	{
+			$res =& $pearDB->query("SELECT hg.hg_id FROM hostgroup hg WHERE hg.hg_activate = '1'");
+			while($res->fetchInto($hostGroup))	{
+				$h = false;
+				$cg = false;
+				$res2 =& $pearDB->query("SELECT DISTINCT hgr.host_host_id, cghgr.contactgroup_cg_id FROM hostgroup_relation hgr, contactgroup_hostgroup_relation cghgr WHERE hgr.hostgroup_hg_id = '".$hostGroup["hg_id"]."' AND cghgr.hostgroup_hg_id = '".$hostGroup["hg_id"]."'");
+				while($res2->fetchInto($valid))	{
+					array_key_exists($valid["host_host_id"], $hostEnb) ? $h = true : NULL;
+					array_key_exists($valid["contactgroup_cg_id"], $cgEnb) ? $cg = true : NULL;
+				}
+				$h && $cg ? $hgEnb[$hostGroup["hg_id"]] = 1 : NULL;
+				$res2->free();
+				unset($valid);
+			}
+			$res->free();
+		}
+		else if ($oreon->user->get_version() == 2)	{
+			$res =& $pearDB->query("SELECT DISTINCT hg.hg_id FROM hostgroup hg WHERE hg.hg_activate = '1'");
+			while($res->fetchInto($hostGroup))	{						
+				$res2 =& $pearDB->query("SELECT DISTINCT hgr.host_host_id, hgr.hostgroup_hg_id FROM hostgroup_relation hgr WHERE hgr.hostgroup_hg_id = '".$hostGroup["hg_id"]."'");
+				while($res2->fetchInto($hostGroup))
+					array_key_exists($hostGroup["host_host_id"], $hostEnb) ? $hgEnb[$hostGroup["hostgroup_hg_id"]] = 1 : NULL;
+				$res2->free();
+			}
+			$res->free();
+		}
+		unset($hostGroup);
+		# Service Template Model
+		$service = array();
+		$res =& $pearDB->query("SELECT DISTINCT sv.service_id FROM service sv WHERE sv.service_activate = '1' AND service_register = '0'");
+		while ($res->fetchInto($service))
+			$svEnb[$service["service_id"]] = 1;
+		$res->free();
+		# Service
+		$service = array();
+		$res =& $pearDB->query("SELECT DISTINCT sv.service_id, sv.service_template_model_stm_id FROM service sv WHERE sv.service_activate = '1' AND service_register = '1'");
+		while ($res->fetchInto($service))	{
+			# If the Service is link to a Template, we think that the dependencies are manage in the template			
+			if ($service["service_template_model_stm_id"] && array_key_exists($service["service_template_model_stm_id"], $svEnb))
+				$svEnb[$service["service_id"]] = 1;
+			else	{
+				$h = false;
+				$hg = false;
+				$cg = false;
+				$res2 =& $pearDB->query("SELECT DISTINCT hsr.host_host_id, hsr.hostgroup_hg_id, cgsr.contactgroup_cg_id FROM contactgroup_service_relation cgsr, host_service_relation hsr WHERE cgsr.service_service_id = '".$service["service_id"]."' AND hsr.service_service_id = '".$service["service_id"]."'");
+				while ($res2->fetchInto($valid))	{
+					array_key_exists($valid["host_host_id"], $hostEnb) ? $h = true : NULL;
+					array_key_exists($valid["hostgroup_hg_id"], $hgEnb) ? $hg = true : NULL;
+					array_key_exists($valid["contactgroup_cg_id"], $cgEnb) ? $cg = true : NULL;		
+				}
+				($h || $hg) && $cg ? $svEnb[$service["service_id"]] = 1 : NULL;
+				$res2->free();
+				unset($valid);
+			}
+		}
+		$res->free();
+		# Service Group		
+		$serviceGroup = array();
+		$res =& $pearDB->query("SELECT sg_id FROM servicegroup sg WHERE sg.sg_activate = '1'");
+		while($res->fetchInto($serviceGroup))	{
+			$res2 =& $pearDB->query("SELECT sgr.service_service_id FROM servicegroup_relation sgr WHERE sgr.servicegroup_sg_id = '".$serviceGroup["sg_id"]."'");
+			while ($res2->fetchInto($valid))
+				array_key_exists($valid["service_service_id"], $svEnb) ? $sgEnb[$serviceGroup["sg_id"]] = 1 : NULL;
+			$res2->free();
+		}
+		unset($serviceGroup);
+		$res->free();
+		# OSL		
+		if (isset($oreon->modules["osl"]))	{
+			$osl = array();
+			$res =& $pearDB->query("SELECT osl_id FROM osl WHERE osl_activate = '1'");
+			while($res->fetchInto($osl))
+				$oslEnb[$osl["osl_id"]] = 1;
+			unset($osl);
+			$res->free();
+		}
+		# Meta Service		
+		$oms = array();
+		$res =& $pearDB->query("SELECT meta_id FROM meta_service WHERE meta_activate = '1'");
+		while($res->fetchInto($oms))
+			$omsEnb[$oms["meta_id"]] = 1;
+		unset($oms);
+		$res->free();
+		return ($gbEnb);
+	}
+	
+	function checkDependenciesLite()	{
+		global $pearDB;
+		global $oreon;
+		$cctEnb = array();
+		$cgEnb = array();
+		$hostEnb = array();
+		$hgEnb = array();
+		$svEnb = array();
+		$sgEnb = array();
+		$oslEnb = array();
+		$omsEnb = array();
+		$gbEnb = array(0=>&$cctEnb, 1=>&$cgEnb, 2=>&$hostEnb, 3=>&$hgEnb, 4=>&$svEnb, 5=>&$sgEnb, 6=>&$oslEnb, 7=>&$omsEnb);
+		
+		# Contact
+		$contact = array();
+		$res =& $pearDB->query("SELECT contact_id FROM contact WHERE contact_activate ='1'");
+		while($res->fetchInto($contact))
+			$cctEnb[$contact["contact_id"]] = 1;
+		unset($contact);
+		$res->free();
+		# ContactGroup
+		$contactGroup = array();
+		$res =& $pearDB->query("SELECT cg_id FROM contactgroup WHERE cg_activate ='1'");
+		while($res->fetchInto($contactGroup))
+			$cgEnb[$contactGroup["cg_id"]] = 1;
+		unset($contactGroup);
+		$res->free();
+		# Host Template Model
+		$host = array();
+		$res =& $pearDB->query("SELECT host_id FROM host WHERE host_activate = '1' AND host_register = '0'");
+		while($res->fetchInto($host))
+			$hostEnb[$host["host_id"]] = 1;
+		$res->free();
+		unset($host);
+		# Host
+		$host = array();
+		$res =& $pearDB->query("SELECT host_id, host_template_model_htm_id FROM host WHERE host_activate = '1' AND host_register = '1'");
+		while($res->fetchInto($host))	{
+			if ($host["host_template_model_htm_id"])	{ 
+				if (array_key_exists($host["host_template_model_htm_id"], $hostEnb))
+					$hostEnb[$host["host_id"]] = 1;
+			}
+			else
+				$hostEnb[$host["host_id"]] = 1;
+		}
+		$res->free();
+		unset($host);
+		# Host Group
+		$hostGroup = array();
+		$res =& $pearDB->query("SELECT hg.hg_id FROM hostgroup hg WHERE hg.hg_activate = '1'");
+		while($res->fetchInto($hostGroup))
+			$hgEnb[$hostGroup["hg_id"]] = 1;
+		$res->free();
+		unset($hostGroup);
+		# Service Template Model
+		$service = array();
+		$res =& $pearDB->query("SELECT service_id FROM service WHERE service_activate = '1' AND service_register = '0'");
+		while ($res->fetchInto($service))
+			$svEnb[$service["service_id"]] = 1;
+		$res->free();
+		# Service
+		$service = array();
+		$res =& $pearDB->query("SELECT service_id, service_template_model_stm_id FROM service WHERE service_activate = '1' AND service_register = '1'");
+		while ($res->fetchInto($service))	{
+			if ($service["service_template_model_stm_id"])	{
+				if (array_key_exists($service["service_template_model_stm_id"], $svEnb))
+					$svEnb[$service["service_id"]] = 1;
+			}
+			else
+				$svEnb[$service["service_id"]] = 1;	
+		}
+		$res->free();
+		# Service Group		
+		$serviceGroup = array();
+		$res =& $pearDB->query("SELECT sg_id FROM servicegroup WHERE sg_activate = '1'");
+		while($res->fetchInto($serviceGroup))
+			$sgEnb[$serviceGroup["sg_id"]] = 1;
+		unset($serviceGroup);
+		$res->free();
+		# OSL		
+		if (isset($oreon->modules["osm"]))	{
+			$osl = array();
+			$res =& $pearDB->query("SELECT osl_id FROM osl WHERE osl_activate = '1'");
+			while($res->fetchInto($osl))
+				$oslEnb[$osl["osl_id"]] = 1;
+			unset($osl);
+			$res->free();
+		}
+		# Meta Service		
+		$oms = array();
+		$res =& $pearDB->query("SELECT meta_id FROM meta_service WHERE meta_activate = '1'");
+		while($res->fetchInto($oms))
+			$omsEnb[$oms["meta_id"]] = 1;
+		unset($oms);
+		$res->free();
+		return ($gbEnb);
+	}
+	
+	function checkNoDependencies()	{
+		global $pearDB;
+		global $oreon;
+		$cctEnb = array();
+		$cgEnb = array();
+		$hostEnb = array();
+		$hgEnb = array();
+		$svEnb = array();
+		$sgEnb = array();
+		$oslEnb = array();
+		$omsEnb = array();
+		$gbEnb = array(0=>&$cctEnb, 1=>&$cgEnb, 2=>&$hostEnb, 3=>&$hgEnb, 4=>&$svEnb, 5=>&$sgEnb, 6=>&$oslEnb, 7=>&$omsEnb);
+		
+		# Contact
+		$contact = array();
+		$res =& $pearDB->query("SELECT contact_id FROM contact");
+		while($res->fetchInto($contact))
+			$cctEnb[$contact["contact_id"]] = 1;
+		unset($contact);
+		$res->free();
+		# ContactGroup
+		$contactGroup = array();
+		$res =& $pearDB->query("SELECT cg_id FROM contactgroup");
+		while($res->fetchInto($contactGroup))
+			$cgEnb[$contactGroup["cg_id"]] = 1;
+		unset($contactGroup);
+		$res->free();
+		# Host
+		$host = array();
+		$res =& $pearDB->query("SELECT host_id FROM host");
+		while($res->fetchInto($host))
+			$hostEnb[$host["host_id"]] = 1;
+		$res->free();
+		unset($host);
+		# Host Group
+		$hostGroup = array();
+		$res =& $pearDB->query("SELECT hg.hg_id FROM hostgroup hg");
+		while($res->fetchInto($hostGroup))
+			$hgEnb[$hostGroup["hg_id"]] = 1;
+		$res->free();
+		unset($hostGroup);
+		# Service
+		$service = array();
+		$res =& $pearDB->query("SELECT service_id FROM service");
+		while ($res->fetchInto($service))
+			$svEnb[$service["service_id"]] = 1;
+		$res->free();
+		# Service Group		
+		$serviceGroup = array();
+		$res =& $pearDB->query("SELECT sg_id FROM servicegroup");
+		while($res->fetchInto($serviceGroup))
+			$sgEnb[$serviceGroup["sg_id"]] = 1;
+		unset($serviceGroup);
+		$res->free();
+		# OSL		
+		if (isset($oreon->modules["osm"]))	{
+			$osl = array();
+			$res =& $pearDB->query("SELECT osl_id FROM osl");
+			while($res->fetchInto($osl))
+				$oslEnb[$osl["osl_id"]] = 1;
+			unset($osl);
+			$res->free();
+		}
+		# Meta Service		
+		$oms = array();
+		$res =& $pearDB->query("SELECT meta_id FROM meta_service");
+		while($res->fetchInto($oms))
+			$omsEnb[$oms["meta_id"]] = 1;
+		unset($oms);
+		$res->free();
+		return ($gbEnb);
+	}
+	
+	function print_header($handle, $name)	{
+		$time = date("F j, Y, g:i a");
+		$by = $name;
+		$str  = "###################################################################\n";
+		$len = strlen($str); // Get line lenght
+		$str .= "#                                                                 #\n";
+		$str .= "#                       GENERATED BY OREON                        #\n";
+		$str .= "#                                                                 #\n";
+		$str .= "#               Developped by :                                   #\n";
+		$str .= "#                   - Julien Mathis                               #\n";
+		$str .= "#                   - Romain Le Merlus                            #\n";
+		$str .= "#                                                                 #\n";
+		$str .= "#                          www.oreon-project.org                  #\n";
+		$str .= "#                For information : contact@oreon-project.org      #\n";
+		$str .= "###################################################################\n\n";
+		$str .= "###################################################################\n";
+		$str .= "#                                                                 #\n";
+		$str .= "#         Last modification " . $time;
+		
+		$len_time = strlen($time);
+		$res = $len - 28 - $len_time - 2;
+		
+		// Add space to put text on center
+		for ($i = 0; $i != $res; $i++)
+			$str  .= " ";
+		
+		$str .= "#\n";
+		$str .= "#         By " . $by;
+		$len_by = strlen($by);
+		$res = $len - 13 - $len_by - 2;
+		
+		// Add space to put text on center
+		for ($i = 0; $i != $res; $i++)
+			$str  .= " ";
+		$str .= "#\n";
+		$str .= "#                                                                 #\n";
+		$str .= "###################################################################\n\n";
+		fwrite($handle, $str);
+	}
+	
+	// Create File, print header and return handle. 	
+	function create_file($filename, $name, $header = true)	{
+		global $lang;
+		if (!$handle = fopen($filename, 'w')) {         
+	    	echo $lang['ErrGenFileProb'].$filename;         
+	    	exit;
+		}
+		$header ? print_header($handle, $name) : NULL;
+	   	return $handle;
+	}
+	
+	// write data into the file	
+	function write_in_file($handle, $content, $filename)	{
+		if (strcmp($content, "") && !fwrite($handle, $content)) {
+			echo $lang['ErrGenFileProb'].$filename; 
+			exit();
+		}
+	}
+	
+	// Put text in good format	
+	function print_line($data1, $data2)	{
+	  $len = strlen($data1);
+	  if ($len <= 9)
+	    return "\t" . $data1 . "\t\t\t\t" . $data2 . "\n";
+	  else if ($len > 9 && $len <= 18)
+	    return "\t" . $data1 . "\t\t\t" . $data2 . "\n";
+	  else if ($len >= 19 && $len <= 27)
+	    return "\t" . $data1 . "\t\t" . $data2 . "\n";
+	  else if ($len > 27)
+	    return "\t" . $data1 . "\t" . $data2 . "\n";
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/formGenerateFiles.ihtml b/www/include/configuration/configGenerate/formGenerateFiles.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..e5713053c6c47d2acf51433d9451ada57741280a
--- /dev/null
+++ b/www/include/configuration/configGenerate/formGenerateFiles.ihtml
@@ -0,0 +1,42 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/component_green.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/server_network.gif'>&nbsp;&nbsp;{$form.header.infos}</td></tr>	 	
+		<tr class="list_one"><td class="FormRowField">{$form.host.label}</td><td class="FormRowValue">{$form.host.html}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/nagios.gif'>&nbsp;&nbsp;{$form.header.opt}</td></tr>	 	
+		<tr class="list_one"><td class="FormRowField">{$form.generate.label}</td><td class="FormRowValue">{$form.generate.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.level.label}</td><td class="FormRowValue">{$form.level.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.comment.label}</td><td class="FormRowValue">{$form.comment.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.xml.label}</td><td class="FormRowValue">{$form.xml.html}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./modules/traps/img/icones/16x16/funnel_new.gif'>&nbsp;&nbsp;{$form.header.traps}</td></tr>	 	
+		<tr class="list_one"><td class="FormRowField">{$form.genTraps.label}</td><td class="FormRowValue">{$form.genTraps.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.restartTrapd.label}</td><td class="FormRowValue">{$form.restartTrapd.html}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/breakpoint_run.gif'>&nbsp;&nbsp;{$form.header.result}</td></tr>	 	
+		<tr class="list_one"><td class="FormRowField">{$form.debug.label}</td><td class="FormRowValue">{$form.debug.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.move.label}</td><td class="FormRowValue">{$form.move.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.restart.label}</td><td class="FormRowValue">{$form.restart.html}</td></tr>
+
+	</table>
+	<br><br>
+	{if $msg}
+	 <table id="ListTable">
+	 	<tr class="ListHeader">
+	 		<td class="FormHeader" colspan="2">
+	 			<img src='./img/icones/16x16/component_green.gif'>&nbsp;&nbsp;{$form.header.status}
+	 		</td>
+	 	</tr>
+	 	<tr class="list_lvl_1">
+	 		<td class="ListColLvl1_name" colspan="2">
+	 			{$msg}
+	 		</td>
+	 	</tr>	 	
+	 </table>
+	{/if}
+	<div align="center" id="validForm"><p  class="oreonbutton">{$form.submit.html}</p></div>
+	{$form.hidden}
+</form>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/formGenerateFiles.php b/www/include/configuration/configGenerate/formGenerateFiles.php
new file mode 100644
index 0000000000000000000000000000000000000000..bdcc6da745d22529fe0f4c5d3e77f3c344817968
--- /dev/null
+++ b/www/include/configuration/configGenerate/formGenerateFiles.php
@@ -0,0 +1,184 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();	
+	
+	#
+	## Form begin
+	#
+	$attrSelect = array("style" => "width: 100px;");
+	
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	$form->addElement('header', 'title', $lang["gen_name"]);
+	
+	$form->addElement('header', 'infos', $lang["gen_infos"]);
+    $form->addElement('select', 'host', $lang["gen_host"], array(0=>"localhost"), $attrSelect);
+    
+	$form->addElement('header', 'opt', $lang["gen_opt"]);
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'generate', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'generate', null, $lang["no"], '0');
+	$form->addGroup($tab, 'generate', $lang["gen_ok"], '&nbsp;');
+	$form->setDefaults(array('generate' => '1'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'level', null, $lang["gen_level1"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'level', null, $lang["gen_level2"], '2');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'level', null, $lang["gen_level3"], '3');
+	$form->addGroup($tab, 'level', $lang["gen_level"], '<br>');
+	$form->setDefaults(array('level' => '1'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'comment', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'comment', null, $lang["no"], '0');
+	$form->addGroup($tab, 'comment', $lang["gen_comment"], '&nbsp;');
+	$form->setDefaults(array('comment' => '0'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'xml', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'xml', null, $lang["no"], '0');
+	$form->addGroup($tab, 'xml', $lang["gen_xml"], '&nbsp;');
+	$form->setDefaults(array('xml' => '0'));
+		
+	$form->addElement('header', 'traps', $lang['gen_trapd']);
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'genTraps', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'genTraps', null, $lang["no"], '0');
+	$form->addGroup($tab, 'genTraps', $lang['gen_genTrap'], '&nbsp;');
+	$form->setDefaults(array('genTraps' => '0'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'restartTrapd', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'restartTrapd', null, $lang["no"], '0');
+	$form->addGroup($tab, 'restartTrapd', $lang['gen_trapRestart'], '&nbsp;');
+	$form->setDefaults(array('restartTrapd' => '0'));
+		
+	$form->addElement('header', 'result', $lang["gen_result"]);
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'debug', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'debug', null, $lang["no"], '0');
+	$form->addGroup($tab, 'debug', $lang["gen_debug"], '&nbsp;');
+	$form->setDefaults(array('debug' => '1'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'move', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'move', null, $lang["no"], '0');
+	$form->addGroup($tab, 'move', $lang["gen_move"], '&nbsp;');
+	$form->setDefaults(array('move' => '0'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'restart', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'restart', null, $lang["no"], '0');
+	$form->addGroup($tab, 'restart', $lang["gen_restart"], '&nbsp;');
+	$form->setDefaults(array('restart' => '0'));
+		
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	$sub =& $form->addElement('submit', 'submit', $lang["gen_butOK"]);
+	$msg = NULL;
+	if ($form->validate())	{
+		$ret = $form->getSubmitValues();
+		if ($ret["generate"]["generate"])	{
+			$gbArr =& manageDependencies();
+			require_once($path."genCGICFG.php");
+			require_once($path."genNagiosCFG.php");
+			require_once($path."genResourceCFG.php");
+			if($oreon->optGen["perfparse_installed"])
+				require_once($path."genPerfparseCFG.php");
+			require_once($path."genTimeperiods.php");
+			require_once($path."genCommands.php");
+			require_once($path."genContacts.php");
+			require_once($path."genContactGroups.php");
+			require_once($path."genHosts.php");
+			require_once($path."genExtendedInfos.php");
+			require_once($path."genHostGroups.php");
+			require_once($path."genServices.php");
+			if ($oreon->user->get_version() == 2)
+				require_once($path."genServiceGroups.php");
+			require_once($path."genEscalations.php");
+			require_once($path."genDependencies.php");
+			require_once($path."oreon_pm.php");
+			# Meta Module
+			if($oreon->optGen["perfparse_installed"])
+				if ($files = glob("./include/configuration/configGenerate/metaService/*.php"))
+					foreach ($files as $filename)
+						require_once($filename);
+			# Oreon Modules
+			foreach ($oreon->modules as $key=>$value)
+				if ($value["gen"] && $files = glob("./modules/".$key."/generate_files/*.php"))
+					foreach ($files as $filename)
+						require_once($filename);
+		}
+		if ($ret["xml"]["xml"])	{
+			require_once($path."genXMLList.php");
+			$pearDB->query("UPDATE `nagios_server` SET `last_restart` = '".time()."' WHERE `id` =1 LIMIT 1");
+		}
+		if ($ret["debug"]["debug"])	{
+			require_once($path."genNagiosCFG-DEBUG.php");
+			$stdout = shell_exec($oreon->optGen["nagios_path_bin"] . " -v ".$nagiosCFGPath."nagiosCFG.DEBUG");
+			$msg .= str_replace ("\n", "<br>", $stdout);
+		}
+		if ($ret["move"]["move"])	{
+			$msg .= "<br>";
+			foreach (glob($nagiosCFGPath ."*.cfg") as $filename) {
+				$bool = copy($filename , $oreon->Nagioscfg["cfg_dir"].basename($filename));
+				$filename = array_pop(explode("/", $filename));
+				$bool ? $msg .= $filename.$lang['gen_mvOk']."<br>" :  $msg .= $filename.$lang['gen_mvKo']."<br>";
+			}
+		}
+		if ($ret["genTraps"]["genTraps"])	{
+			require_once($path."genTraps.php");
+			$msg .= "<br>".$i." Traps generated<br>";
+		}
+		if ($ret["restartTrapd"]["restartTrapd"])	{
+			$res =& $pearDB->query('SELECT snmp_trapd_path_daemon FROM `general_opt` LIMIT 1');
+			if ($res->numRows())	{
+				$trap_daemon = $res->fetchRow();
+				$stdout = shell_exec("sudo ".$trap_daemon["snmp_trapd_path_daemon"]." restart");
+				$msg .= "<br>".str_replace ("\n", "<br>", $stdout);
+			}
+		}
+		if ($ret["restart"]["restart"])	{
+			$stdout = shell_exec("sudo /etc/init.d/nagios restart");
+			$pearDB->query("UPDATE `nagios_server` SET `last_restart` = '".time()."' WHERE `id` =1 LIMIT 1");
+			$msg .= "<br>".str_replace ("\n", "<br>", $stdout);
+		}
+	}
+	
+	$form->addElement('header', 'status', $lang["gen_status"]);
+	if ($msg)
+		$tpl->assign('msg', $msg);
+	
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+	$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());	
+	$tpl->assign('o', $o);		
+	$tpl->display("formGenerateFiles.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genCGICFG.php b/www/include/configuration/configGenerate/genCGICFG.php
new file mode 100644
index 0000000000000000000000000000000000000000..7ef5eac1cef2cc483088e4048b7b877b8c73e1d5
--- /dev/null
+++ b/www/include/configuration/configGenerate/genCGICFG.php
@@ -0,0 +1,53 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	$handle = create_file($nagiosCFGPath."cgi.cfg", $oreon->user->get_name());
+	$res =& $pearDB->query("SELECT cfg_dir FROM `cfg_nagios` WHERE `nagios_activate` = '1' LIMIT 1");
+	$nagios = $res->fetchRow();	
+	$res =& $pearDB->query("SELECT * FROM `cfg_cgi` WHERE `cgi_activate` = '1' LIMIT 1");
+	if ($res->numRows())
+		$cgi = $res->fetchRow();
+	else
+		$cgi = array();
+	$str = NULL;
+	$ret["comment"]["comment"] ? ($str .= "# '".$cgi["cgi_name"]."'\n") : NULL;
+	if ($ret["comment"]["comment"] && $cgi["cgi_comment"])	{
+		$comment = array();
+		$comment = explode("\n", $cgi["cgi_comment"]);
+		foreach ($comment as $cmt)
+			$str .= "# ".$cmt."\n";
+	}
+	foreach ($cgi as $key=>$value)	{
+		if ($value && $key != "cgi_id" && $key != "cgi_name" && $key != "cgi_comment" && $key != "cgi_activate")	{	
+			$str .= $key."=".$value."\n";
+		}
+	}
+	if ($oreon->user->get_version() == 1)	{
+		$str .= "xedtemplate_config_file=".$nagios["cfg_dir"]."hostextinfo.cfg\n";
+		$str .= "xedtemplate_config_file=".$nagios["cfg_dir"]."serviceextinfo.cfg\n";
+	}
+	write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $nagiosCFGPath."cgi.cfg");
+	fclose($handle);
+	$res->free();
+	unset($str);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genCommands.php b/www/include/configuration/configGenerate/genCommands.php
new file mode 100644
index 0000000000000000000000000000000000000000..cef2902142e2fbfe751b0e2c4372c0d56bf359e5
--- /dev/null
+++ b/www/include/configuration/configGenerate/genCommands.php
@@ -0,0 +1,64 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	
+	if (!isset($oreon))
+		exit();
+
+	$handle1 = create_file($nagiosCFGPath."misccommands.cfg", $oreon->user->get_name());
+	$handle2 = create_file($nagiosCFGPath."checkcommands.cfg", $oreon->user->get_name());
+	$res =& $pearDB->query('SELECT * FROM `command` ORDER BY `command_type`,`command_name`');
+	$command = array();
+	$i1 = 1;
+	$i2 = 1;
+	$str1 = NULL;
+	$str2 = NULL;
+	while($res->fetchInto($command))	{
+		$command["command_line"] = str_replace('#BR#', "\\n", $command["command_line"]);
+		$command["command_line"] = str_replace('#T#', "\\t", $command["command_line"]);
+		$command["command_line"] = str_replace('#R#', "\\r", $command["command_line"]);
+		$command["command_line"] = str_replace('#S#', "/", $command["command_line"]);
+		$command["command_line"] = str_replace('#BS#', "\\", $command["command_line"]);
+		# Notification Command case -> command_type == 1
+		if ($command["command_type"] == 1)	{
+			$ret["comment"]["comment"] ? ($str1 .= "# '" . $command["command_name"] . "' command definition " . $i1 . "\n") : NULL;
+			$str1 .= "define command{\n";
+			$str1 .= print_line("command_name", $command["command_name"]);
+			$str1 .= print_line("command_line", str_replace("@MAILER@", $oreon->optGen["mailer_path_bin"], $command["command_line"]));
+			$str1 .= "}\n\n";
+			$i1++;
+		}	
+		# Check Command case -> command_type == 2
+		else if ($command["command_type"] == 2)	{
+			$ret["comment"]["comment"] ? ($str2 .= "# '" . $command["command_name"] . "' command definition " . $i2 . "\n") : NULL;
+			$str2 .= "define command{\n";
+			if ($command["command_name"]) $str2 .= print_line("command_name", $command["command_name"]);
+			if ($command["command_line"]) $str2 .= print_line("command_line", str_replace("@MAILER@", $oreon->optGen["mailer_path_bin"], $command["command_line"]));
+			$str2 .= "}\n\n";
+			$i2++;
+		}
+	}
+	write_in_file($handle1, html_entity_decode($str1, ENT_QUOTES), $nagiosCFGPath."misccommands.cfg");
+	write_in_file($handle2, html_entity_decode($str2, ENT_QUOTES), $nagiosCFGPath."checkcommands.cfg");
+	fclose($handle1);
+	fclose($handle2);
+	$res->free();
+	unset($str1);
+	unset($str2);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genContactGroups.php b/www/include/configuration/configGenerate/genContactGroups.php
new file mode 100644
index 0000000000000000000000000000000000000000..6d7a007a10d55ad97cff1d4c4bbffd653aa44b3b
--- /dev/null
+++ b/www/include/configuration/configGenerate/genContactGroups.php
@@ -0,0 +1,76 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	$handle = create_file($nagiosCFGPath."contactgroups.cfg", $oreon->user->get_name());
+	$res =& $pearDB->query("SELECT * FROM contactgroup ORDER BY `cg_name`");
+	$contactGroup = array();
+	$i = 1;
+	$str = NULL;
+	while($res->fetchInto($contactGroup))	{
+		$BP = false;
+		if ($ret["level"]["level"] == 1)
+			array_key_exists($contactGroup["cg_id"], $gbArr[1]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 2)
+			array_key_exists($contactGroup["cg_id"], $gbArr[1]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 3)
+			$BP = true;
+		if ($BP)	{
+			$ret["comment"]["comment"] ? ($str .= "# '" . $contactGroup["cg_name"] . "' contactgroup definition " . $i . "\n") : NULL ;
+			if ($ret["comment"]["comment"] && $contactGroup["cg_comment"])	{
+				$comment = array();
+				$comment = explode("\n", $contactGroup["cg_comment"]);
+				foreach ($comment as $cmt)
+					$str .= "# ".$cmt."\n";
+			}
+			$str .= "define contactgroup{\n";
+			if ($contactGroup["cg_name"]) $str .= print_line("contactgroup_name", $contactGroup["cg_name"]);
+			if ($contactGroup["cg_alias"]) $str .= print_line("alias", $contactGroup["cg_alias"]);
+			$contact = array();
+			$strTemp = NULL;
+			$res2 =& $pearDB->query("SELECT cct.contact_id, cct.contact_name FROM contactgroup_contact_relation ccr, contact cct WHERE ccr.contactgroup_cg_id = '".$contactGroup["cg_id"]."' AND ccr.contact_contact_id = cct.contact_id ORDER BY `contact_name`");
+			while($res2->fetchInto($contact))	{
+				$BP = false;				
+				if ($ret["level"]["level"] == 1)
+					array_key_exists($contact["contact_id"], $gbArr[0]) ? $BP = true : $BP = false;
+				else if ($ret["level"]["level"] == 2)
+					array_key_exists($contact["contact_id"], $gbArr[0]) ? $BP = true : $BP = false;
+				else if ($ret["level"]["level"] == 3)
+					$BP = true;
+				if ($BP)
+					$strTemp != NULL ? $strTemp .= ", ".$contact["contact_name"] : $strTemp = $contact["contact_name"];
+			}
+			$res2->free();
+			$str .= print_line("members", $strTemp);
+			unset($contact);
+			unset($strTemp);
+			$str .= "}\n\n";
+			$i++;
+		}
+		unset($contactGroup);
+	}
+	write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $nagiosCFGPath."contactgroups.cfg");
+	fclose($handle);
+	$res->free();
+	unset($str);
+	unset($i);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genContacts.php b/www/include/configuration/configGenerate/genContacts.php
new file mode 100644
index 0000000000000000000000000000000000000000..c7402a85b46061936b1a391509b11f2b88d5b9e0
--- /dev/null
+++ b/www/include/configuration/configGenerate/genContacts.php
@@ -0,0 +1,112 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	$handle = create_file($nagiosCFGPath."contacts.cfg", $oreon->user->get_name());
+	$res =& $pearDB->query("SELECT * FROM contact ORDER BY `contact_name`");
+	$contact = array();
+	$i = 1;
+	$str = NULL;
+	for(;$res->fetchInto($contact);)	{
+		$BP = false;
+		if ($ret["level"]["level"] == 1)
+			array_key_exists($contact["contact_id"], $gbArr[0]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 2)
+			array_key_exists($contact["contact_id"], $gbArr[0]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 3)
+			$BP = true;
+		if ($BP)	{
+			$ret["comment"]["comment"] ? ($str .= "# '".$contact["contact_name"]."' contact definition ".$i."\n") : NULL;
+			if ($ret["comment"]["comment"] && $contact["contact_comment"])	{
+				$comment = array();
+				$comment = explode("\n", $contact["contact_comment"]);
+				foreach ($comment as $cmt)
+					$str .= "# ".$cmt."\n";
+			}
+			$str .= "define contact{\n";
+			if ($contact["contact_name"]) $str .= print_line("contact_name", $contact["contact_name"]);
+			if ($contact["contact_alias"]) $str .= print_line("alias", $contact["contact_alias"]);
+			// Nagios 2 : Contact Groups in Contact
+			if ($oreon->user->get_version() == 2)	{
+				$contactGroup = array();
+				$strTemp = NULL;
+				$res2 =& $pearDB->query("SELECT cg.cg_name, cg.cg_id FROM contactgroup_contact_relation ccr, contactgroup cg WHERE ccr.contact_contact_id = '".$contact["contact_id"]."' AND ccr.contactgroup_cg_id = cg.cg_id ORDER BY `cg_name`");
+				while($res2->fetchInto($contactGroup))	{
+					$BP = false;
+					if ($ret["level"]["level"] == 1)
+						array_key_exists($contactGroup["cg_id"], $gbArr[1]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 2)
+						array_key_exists($contactGroup["cg_id"], $gbArr[1]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)
+						$strTemp != NULL ? $strTemp .= ", ".$contactGroup["cg_name"] : $strTemp = $contactGroup["cg_name"];
+				}
+				$res2->free();
+				if ($strTemp) $str .= print_line("contactgroups", $strTemp);
+				unset($contactGroup);
+				unset($strTemp);
+			}
+			// Timeperiod for host & service
+			$timeperiod = array();
+			$res2 =& $pearDB->query("SELECT cct.timeperiod_tp_id AS cctTP1, cct.timeperiod_tp_id2 AS cctTP2, tp.tp_id, tp.tp_name FROM contact cct, timeperiod tp WHERE cct.contact_id = '".$contact["contact_id"]."' AND (tp.tp_id = cct.timeperiod_tp_id OR tp.tp_id = cct.timeperiod_tp_id2) ORDER BY `cctTP1`");
+			while($res2->fetchInto($timeperiod))	{
+				$timeperiod["cctTP1"] == $timeperiod["tp_id"] ? $str .= print_line("host_notification_period", $timeperiod["tp_name"]) : NULL;
+				$timeperiod["cctTP2"] == $timeperiod["tp_id"] ? $str .= print_line("service_notification_period", $timeperiod["tp_name"]) : NULL;
+			}
+			$res2->free();
+			unset($timeperiod);
+			if ($contact["contact_host_notification_options"]) $str .= print_line("host_notification_options", $contact["contact_host_notification_options"]);
+			if ($contact["contact_service_notification_options"]) $str .= print_line("service_notification_options", $contact["contact_service_notification_options"]);
+			// Host & Service notification command
+			$command = array();
+			$strTemp = NULL;
+			$res2 =& $pearDB->query("SELECT cmd.command_name FROM contact_hostcommands_relation chr, command cmd WHERE chr.contact_contact_id = '".$contact["contact_id"]."' AND chr.command_command_id = cmd.command_id ORDER BY `command_name`");
+			while($res2->fetchInto($command))
+				$strTemp != NULL ? $strTemp .= ", ".$command["command_name"] : $strTemp = $command["command_name"];
+			$res2->free();
+			if ($strTemp) $str .= print_line("host_notification_commands", $strTemp);
+			unset($command);
+			unset($strTemp);
+			$command = array();
+			$strTemp = NULL;
+			$res2 =& $pearDB->query("SELECT cmd.command_name FROM contact_servicecommands_relation csr, command cmd WHERE csr.contact_contact_id = '".$contact["contact_id"]."' AND csr.command_command_id = cmd.command_id ORDER BY `command_name`");
+			while($res2->fetchInto($command))
+				$strTemp != NULL ? $strTemp .= ", ".$command["command_name"] : $strTemp = $command["command_name"];
+			$res2->free();
+			if ($strTemp) $str .= print_line("service_notification_commands", $strTemp);
+			unset($command);
+			unset($strTemp);
+			// Misc
+			if ($contact["contact_email"]) $str .= print_line("email", $contact["contact_email"]);
+			if ($contact["contact_pager"]) $str .= print_line("pager", $contact["contact_pager"]);
+			$str .= "}\n\n";
+			$i++;
+		}
+	}
+	write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $nagiosCFGPath."contacts.cfg");
+	fclose($handle);
+	$res->free();
+	unset($contact);
+	unset($str);
+	unset($i);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genDependencies.php b/www/include/configuration/configGenerate/genDependencies.php
new file mode 100644
index 0000000000000000000000000000000000000000..09e6de00b89da8c3833a468ab6a3c0fc61f3a8d5
--- /dev/null
+++ b/www/include/configuration/configGenerate/genDependencies.php
@@ -0,0 +1,283 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	$handle = create_file($nagiosCFGPath."dependencies.cfg", $oreon->user->get_name());
+	$rq = "SELECT * FROM dependency dep WHERE (SELECT DISTINCT COUNT(*) FROM dependency_hostParent_relation dhpr WHERE dhpr.dependency_dep_id = dep.dep_id) > 0 AND (SELECT DISTINCT COUNT(*) FROM dependency_hostChild_relation dhcr WHERE dhcr.dependency_dep_id = dep.dep_id) > 0";
+	$res =& $pearDB->query($rq);
+	$dependency = array();
+	$i = 1;
+	$str = NULL;
+	while($res->fetchInto($dependency))	{
+		$BP = false;
+		$res2 =& $pearDB->query("SELECT DISTINCT host.host_id, host.host_name FROM dependency_hostParent_relation dhpr, host WHERE dhpr.dependency_dep_id = '".$dependency["dep_id"]."' AND host.host_id = dhpr.host_host_id");
+		$host = array();
+		$strTemp1 = NULL;
+		while ($res2->fetchInto($host))	{
+			$BP = false;
+			if ($ret["level"]["level"] == 1)
+				array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 2)
+				array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 3)
+				$BP = true;
+			if ($BP)	
+				$strTemp1 != NULL ? $strTemp1 .= ", ".$host["host_name"] : $strTemp1 = $host["host_name"];
+		}
+		$res2 =& $pearDB->query("SELECT DISTINCT host.host_id, host.host_name FROM dependency_hostChild_relation dhcr, host WHERE dhcr.dependency_dep_id = '".$dependency["dep_id"]."' AND host.host_id = dhcr.host_host_id");
+		$host = array();
+		$strTemp2 = NULL;
+		while ($res2->fetchInto($host))	{
+			$BP = false;
+			if ($ret["level"]["level"] == 1)
+				array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 2)
+				array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 3)
+				$BP = true;
+			if ($BP)	
+				$strTemp2 != NULL ? $strTemp2 .= ", ".$host["host_name"] : $strTemp2 = $host["host_name"];
+		}
+		$res2->free();			
+		if ($strTemp1 && $strTemp2)	{
+			$ret["comment"]["comment"] ? ($str .= "# '".$dependency["dep_name"]."' host dependency definition ".$i."\n") : NULL;
+			if ($ret["comment"]["comment"] && $dependency["dep_comment"])	{
+				$comment = array();
+				$comment = explode("\n", $dependency["dep_comment"]);
+				foreach ($comment as $cmt)
+					$str .= "# ".$cmt."\n";
+			}
+			$str .= "define hostdependency{\n";
+			$str .= print_line("dependent_host_name", $strTemp2);
+			$str .= print_line("host_name", $strTemp1);
+			if ($oreon->user->get_version() == 2)	{
+				if (isset($dependency["inherits_parent"]["inherits_parent"]) && $dependency["inherits_parent"]["inherits_parent"] != NULL) $str .= print_line("inherits_parent", $dependency["inherits_parent"]["inherits_parent"]);
+				if (isset($dependency["execution_failure_criteria"]) && $dependency["execution_failure_criteria"] != NULL) $str .= print_line("execution_failure_criteria", $dependency["execution_failure_criteria"]);
+			}
+			if (isset($dependency["notification_failure_criteria"]) && $dependency["notification_failure_criteria"] != NULL) $str .= print_line("notification_failure_criteria", $dependency["notification_failure_criteria"]);
+			$str .= "}\n\n";
+			$i++;
+		}
+	}
+	unset($dependency);
+	$res->free();
+
+	$rq = "SELECT * FROM dependency dep WHERE (SELECT DISTINCT COUNT(*) FROM dependency_hostgroupParent_relation dhgpr WHERE dhgpr.dependency_dep_id = dep.dep_id) > 0 AND (SELECT DISTINCT COUNT(*) FROM dependency_hostgroupChild_relation dhgcr WHERE dhgcr.dependency_dep_id = dep.dep_id) > 0";
+	$res =& $pearDB->query($rq);
+	$dependency = array();
+	while($res->fetchInto($dependency))	{
+		$BP = false;
+		$res2 =& $pearDB->query("SELECT DISTINCT hostgroup.hg_id, hostgroup.hg_name FROM dependency_hostgroupParent_relation dhgpr, hostgroup WHERE dhgpr.dependency_dep_id = '".$dependency["dep_id"]."' AND hostgroup.hg_id = dhgpr.hostgroup_hg_id");
+		$hg = array();
+		$strTemp1 = NULL;
+		while ($res2->fetchInto($hg))	{
+			$BP = false;
+			if ($ret["level"]["level"] == 1)
+				array_key_exists($hg["hg_id"], $gbArr[3]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 2)
+				array_key_exists($host["hg_id"], $gbArr[3]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 3)
+				$BP = true;
+			if ($BP)	
+				$strTemp1 != NULL ? $strTemp1 .= ", ".$hg["hg_name"] : $strTemp1 = $hg["hg_name"];
+		}
+		$res2 =& $pearDB->query("SELECT DISTINCT hostgroup.hg_id, hostgroup.hg_name FROM dependency_hostgroupChild_relation dhgcr, hostgroup WHERE dhgcr.dependency_dep_id = '".$dependency["dep_id"]."' AND hostgroup.hg_id = dhgcr.hostgroup_hg_id");
+		$hg= array();
+		$strTemp2 = NULL;
+		while ($res2->fetchInto($hg))	{
+			$BP = false;
+			if ($ret["level"]["level"] == 1)
+				array_key_exists($hg["hg_id"], $gbArr[3]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 2)
+				array_key_exists($hg["hg_id"], $gbArr[3]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 3)
+				$BP = true;
+			if ($BP)	
+				$strTemp2 != NULL ? $strTemp2 .= ", ".$hg["hg_name"] : $strTemp2 = $hg["hg_name"];
+		}
+		$res2->free();			
+		if ($strTemp1 && $strTemp2)	{
+			$ret["comment"]["comment"] ? ($str .= "# '".$dependency["dep_name"]."' host dependency definition ".$i."\n") : NULL;
+			if ($ret["comment"]["comment"] && $dependency["dep_comment"])	{
+				$comment = array();
+				$comment = explode("\n", $dependency["dep_comment"]);
+				foreach ($comment as $cmt)
+					$str .= "# ".$cmt."\n";
+			}
+			$str .= "define hostdependency{\n";
+			$str .= print_line("dependent_hostgroup_name", $strTemp2);
+			$str .= print_line("hostgroup_name", $strTemp1);
+			if ($oreon->user->get_version() == 2)	{
+				if (isset($dependency["inherits_parent"]["inherits_parent"]) && $dependency["inherits_parent"]["inherits_parent"] != NULL) $str .= print_line("inherits_parent", $dependency["inherits_parent"]["inherits_parent"]);
+				if (isset($dependency["execution_failure_criteria"]) && $dependency["execution_failure_criteria"] != NULL) $str .= print_line("execution_failure_criteria", $dependency["execution_failure_criteria"]);
+			}
+			if (isset($dependency["notification_failure_criteria"]) && $dependency["notification_failure_criteria"] != NULL) $str .= print_line("notification_failure_criteria", $dependency["notification_failure_criteria"]);
+			$str .= "}\n\n";
+			$i++;
+		}
+	}
+	unset($dependency);
+	$res->free();
+
+	$res2 =& $pearDB->query("SELECT * FROM dependency_serviceParent_relation dspr, dependency WHERE dependency.dep_id = dspr.dependency_dep_id");
+	while ($res2->fetchInto($svPar))	{
+		$BP = false;
+		if ($ret["level"]["level"] == 1)
+			array_key_exists($svPar["service_service_id"], $gbArr[4]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 2)
+			array_key_exists($svPar["service_service_id"], $gbArr[4]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 3)
+			$BP = true;
+		if ($BP)	{
+			$res3 =& $pearDB->query("SELECT DISTINCT * FROM host_service_relation hsr WHERE service_service_id = '".$svPar["service_service_id"]."'");
+			while ($res3->fetchInto($rowPar))	{
+				$hPar = NULL;
+				$hgPar = NULL;
+				if ($rowPar["host_host_id"])	{
+					$BP = false;
+					if ($ret["level"]["level"] == 1)
+						array_key_exists($rowPar["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 2)
+						array_key_exists($rowPar["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)	{
+						$res4 =& $pearDB->query("SELECT DISTINCT host_name FROM host WHERE host_id = '".$rowPar["host_host_id"]."'");
+						$host =& $res4->fetchRow();						
+						$hPar = $host["host_name"];
+					}
+				}
+				else if ($rowPar["hostgroup_hg_id"])	{
+					$BP = false;
+					if ($ret["level"]["level"] == 1)
+						array_key_exists($rowPar["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 2)
+						array_key_exists($rowPar["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)	{
+						$res4 =& $pearDB->query("SELECT DISTINCT hg_name FROM hostgroup WHERE hg_id = '".$rowPar["hostgroup_hg_id"]."'");
+						$hg =& $res4->fetchRow();
+						$hgPar = $hg["hg_name"];
+					}			
+				}
+				# Service Child
+				$res4 =& $pearDB->query("SELECT * FROM dependency_serviceChild_relation WHERE dependency_dep_id = '".$svPar["dependency_dep_id"]."'");
+				while ($res4->fetchInto($svCh))	{
+					$BP = false;
+					if ($ret["level"]["level"] == 1)
+						array_key_exists($svCh["service_service_id"], $gbArr[4]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 2)
+						array_key_exists($svCh["service_service_id"], $gbArr[4]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)	{
+						$res5 =& $pearDB->query("SELECT DISTINCT * FROM host_service_relation hsr WHERE service_service_id = '".$svCh["service_service_id"]."'");
+						while ($res5->fetchInto($rowCh))	{
+							$hCh = NULL;
+							$hgCh = NULL;
+							if ($rowCh["host_host_id"])	{
+								$BP = false;
+								if ($ret["level"]["level"] == 1)
+									array_key_exists($rowCh["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+								else if ($ret["level"]["level"] == 2)
+									array_key_exists($rowCh["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+								else if ($ret["level"]["level"] == 3)
+									$BP = true;
+								if ($BP)	{
+									$res6 =& $pearDB->query("SELECT DISTINCT host_name FROM host WHERE host_id = '".$rowCh["host_host_id"]."'");
+									$host =& $res6->fetchRow();						
+									$hCh = $host["host_name"];
+									$res6->free();
+								}
+							}
+							else if ($rowCh["hostgroup_hg_id"])	{
+								$BP = false;
+								if ($ret["level"]["level"] == 1)
+									array_key_exists($rowCh["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+								else if ($ret["level"]["level"] == 2)
+									array_key_exists($rowCh["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+								else if ($ret["level"]["level"] == 3)
+									$BP = true;
+								if ($BP)	{
+									$res6 =& $pearDB->query("SELECT DISTINCT hg_name FROM hostgroup WHERE hg_id = '".$rowCh["hostgroup_hg_id"]."'");
+									$hg =& $res6->fetchRow();
+									$hgCh = $hg["hg_name"];
+									$res6->free();
+								}			
+							}
+							if ($hPar && $hCh)	{
+								$ret["comment"]["comment"] ? ($str .= "# '".$svPar["dep_name"]."' host dependency definition ".$i."\n") : NULL;
+								if ($ret["comment"]["comment"] && $svPar["dep_comment"])	{
+									$comment = array();
+									$comment = explode("\n", $svPar["dep_comment"]);
+									foreach ($comment as $cmt)
+										$str .= "# ".$cmt."\n";
+								}
+								$str .= "define servicedependency{\n";
+								$str .= print_line("dependent_host_name", $hCh);
+								$str .= print_line("host_name", $hPar);
+								$str .= print_line("dependent_service_description", getMyServiceName($svCh["service_service_id"]));
+								$str .= print_line("service_description", getMyServiceName($svPar["service_service_id"]));
+								if ($oreon->user->get_version() == 2)
+									if (isset($svPar["inherits_parent"]["inherits_parent"]) && $svPar["inherits_parent"]["inherits_parent"] != NULL) $str .= print_line("inherits_parent", $svPar["inherits_parent"]["inherits_parent"]);
+								if (isset($svPar["execution_failure_criteria"]) && $svPar["execution_failure_criteria"] != NULL) $str .= print_line("execution_failure_criteria", $svPar["execution_failure_criteria"]);
+								if (isset($svPar["notification_failure_criteria"]) && $svPar["notification_failure_criteria"] != NULL) $str .= print_line("notification_failure_criteria", $svPar["notification_failure_criteria"]);
+								$str .= "}\n\n";
+								$i++;
+							}
+							else if ($hgPar && $hgCh)	{
+								$ret["comment"]["comment"] ? ($str .= "# '".$dependency["dep_name"]."' host dependency definition ".$i."\n") : NULL;
+								if ($ret["comment"]["comment"] && $dependency["dep_comment"])	{
+									$comment = array();
+									$comment = explode("\n", $dependency["dep_comment"]);
+									foreach ($comment as $cmt)
+										$str .= "# ".$cmt."\n";
+								}
+								$str .= "define servicedependency{\n";
+								$str .= print_line("dependent_hostgroup_name", $hgCh);
+								$str .= print_line("hostgroup_name", $hgPar);
+								$str .= print_line("dependent_service_description", getMyServiceName($svCh["service_service_id"]));
+								$str .= print_line("service_description", getMyServiceName($svPar["service_service_id"]));
+								if ($oreon->user->get_version() == 2)
+									if (isset($svPar["inherits_parent"]["inherits_parent"]) && $svPar["inherits_parent"]["inherits_parent"] != NULL) $str .= print_line("inherits_parent", $svPar["inherits_parent"]["inherits_parent"]);
+								if (isset($svPar["execution_failure_criteria"]) && $svPar["execution_failure_criteria"] != NULL) $str .= print_line("execution_failure_criteria", $svPar["execution_failure_criteria"]);
+								if (isset($svPar["notification_failure_criteria"]) && $svPar["notification_failure_criteria"] != NULL) $str .= print_line("notification_failure_criteria", $svPar["notification_failure_criteria"]);
+								$str .= "}\n\n";
+								$i++;
+							}
+						}
+						$res5->free();		
+					}		
+				}
+				$res4->free();	
+			}		
+			$res3->free();	
+		}
+	}
+	$res2->free();
+	
+	write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $path ."dependencies.cfg");
+	fclose($handle);
+	unset($str);
+	unset($i);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genEscalations.php b/www/include/configuration/configGenerate/genEscalations.php
new file mode 100644
index 0000000000000000000000000000000000000000..1d2ef60810a7f101364b4717d889e7c494315462
--- /dev/null
+++ b/www/include/configuration/configGenerate/genEscalations.php
@@ -0,0 +1,253 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	$handle = create_file($nagiosCFGPath."escalations.cfg", $oreon->user->get_name());
+	$res =& $pearDB->query("SELECT DISTINCT esc.* FROM escalation_host_relation ehr, escalation esc WHERE ehr.escalation_esc_id = esc.esc_id ORDER BY esc.esc_name");
+	$escalation = array();
+	$i = 1;
+	$str = NULL;
+	while($res->fetchInto($escalation))	{
+		$BP = false;
+		$res2 =& $pearDB->query("SELECT DISTINCT host.host_id, host.host_name FROM escalation_host_relation ehr, host WHERE ehr.escalation_esc_id = '".$escalation["esc_id"]."' AND host.host_id = ehr.host_host_id");
+		$host = array();
+		$strTemp = NULL;
+		while ($res2->fetchInto($host))	{
+			$BP = false;
+			if ($ret["level"]["level"] == 1)
+				array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 2)
+				array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 3)
+				$BP = true;
+			if ($BP)	
+				$strTemp != NULL ? $strTemp .= ", ".$host["host_name"] : $strTemp = $host["host_name"];
+		}
+		$res2->free();			
+		if ($strTemp)	{
+			$ret["comment"]["comment"] ? ($str .= "# '".$escalation["esc_name"]."' host escalation definition ".$i."\n") : NULL;
+			if ($ret["comment"]["comment"] && $escalation["esc_comment"])	{
+				$comment = array();
+				$comment = explode("\n", $escalation["esc_comment"]);
+				foreach ($comment as $cmt)
+					$str .= "# ".$cmt."\n";
+			}
+			$str .= "define hostescalation{\n";
+			$str .= print_line("host_name", $strTemp);			
+			$cg = array();
+			$strTemp = NULL;
+			$res2 =& $pearDB->query("SELECT DISTINCT cg.cg_id, cg.cg_name FROM escalation_contactgroup_relation ecgr, contactgroup cg WHERE ecgr.escalation_esc_id = '".$escalation["esc_id"]."' AND ecgr.contactgroup_cg_id = cg.cg_id ORDER BY cg.cg_name");
+			while($res2->fetchInto($cg))	{
+				$BP = false;				
+				if ($ret["level"]["level"] == 1)
+					array_key_exists($cg["cg_id"], $gbArr[1]) ? $BP = true : $BP = false;
+				else if ($ret["level"]["level"] == 2)
+					array_key_exists($cg["cg_id"], $gbArr[1]) ? $BP = true : $BP = false;
+				else if ($ret["level"]["level"] == 3)
+					$BP = true;
+				if ($BP)
+					$strTemp != NULL ? $strTemp .= ", ".$cg["cg_name"] : $strTemp = $cg["cg_name"];
+			}
+			$res2->free();
+			if ($strTemp) $str .= print_line("contact_groups", $strTemp);			
+			if ($escalation["first_notification"] != NULL) $str .= print_line("first_notification", $escalation["first_notification"]);
+			if ($escalation["last_notification"] != NULL) $str .= print_line("last_notification", $escalation["last_notification"]);
+			if ($escalation["notification_interval"]!= NULL) $str .= print_line("notification_interval", $escalation["notification_interval"]);
+			// Nagios 2
+			if ($oreon->user->get_version() == 2)	{
+				$res2 =& $pearDB->query("SELECT tp_name FROM timeperiod WHERE tp_id = '".$escalation["escalation_period"]."'");
+				$tp =& $res2->fetchRow();				
+				if ($tp["tp_name"]) $str .= print_line("escalation_period", $tp["tp_name"]);
+				if ($escalation["escalation_options1"]) $str .= print_line("escalation_options", $escalation["escalation_options1"]);
+			}
+			$str .= "}\n\n";
+			$i++;
+		}
+	}
+	unset($escalation);
+	$res->free();
+	
+	$res =& $pearDB->query("SELECT DISTINCT esc.* FROM escalation_hostgroup_relation ehgr, escalation esc WHERE ehgr.escalation_esc_id = esc.esc_id ORDER BY esc.esc_name");
+	$escalation = array();
+	while($res->fetchInto($escalation))	{
+		$BP = false;
+		$res2 =& $pearDB->query("SELECT DISTINCT hg.hg_id, hg.hg_name FROM escalation_hostgroup_relation ehgr, hostgroup hg WHERE ehgr.escalation_esc_id = '".$escalation["esc_id"]."' AND hg.hg_id = ehgr.hostgroup_hg_id");
+		$hg = array();
+		$strTemp = NULL;
+		while ($res2->fetchInto($hg))	{
+			$BP = false;
+			if ($ret["level"]["level"] == 1)
+				array_key_exists($hg["hg_id"], $gbArr[3]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 2)
+				array_key_exists($hg["hg_id"], $gbArr[3]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 3)
+				$BP = true;
+			if ($BP)	
+				$strTemp != NULL ? $strTemp .= ", ".$hg["hg_name"] : $strTemp = $hg["hg_name"];
+		}
+		$res2->free();			
+		if ($strTemp)	{
+			$ret["comment"]["comment"] ? ($str .= "# '".$escalation["esc_name"]."' host (group) escalation definition ".$i."\n") : NULL;
+			if ($ret["comment"]["comment"] && $escalation["esc_comment"])	{
+				$comment = array();
+				$comment = explode("\n", $escalation["esc_comment"]);
+				foreach ($comment as $cmt)
+					$str .= "# ".$cmt."\n";
+			}
+			$str .= "define hostescalation{\n";
+			$str .= print_line("hostgroup_name", $strTemp);			
+			$cg = array();
+			$strTemp = NULL;
+			$res2 =& $pearDB->query("SELECT DISTINCT cg.cg_id, cg.cg_name FROM escalation_contactgroup_relation ecgr, contactgroup cg WHERE ecgr.escalation_esc_id = '".$escalation["esc_id"]."' AND ecgr.contactgroup_cg_id = cg.cg_id ORDER BY cg.cg_name");
+			while($res2->fetchInto($cg))	{
+				$BP = false;				
+				if ($ret["level"]["level"] == 1)
+					array_key_exists($cg["cg_id"], $gbArr[1]) ? $BP = true : $BP = false;
+				else if ($ret["level"]["level"] == 2)
+					array_key_exists($cg["cg_id"], $gbArr[1]) ? $BP = true : $BP = false;
+				else if ($ret["level"]["level"] == 3)
+					$BP = true;
+				if ($BP)
+					$strTemp != NULL ? $strTemp .= ", ".$cg["cg_name"] : $strTemp = $cg["cg_name"];
+			}
+			$res2->free();
+			if ($strTemp) $str .= print_line("contact_groups", $strTemp);			
+			if ($escalation["first_notification"] != NULL) $str .= print_line("first_notification", $escalation["first_notification"]);
+			if ($escalation["last_notification"] != NULL) $str .= print_line("last_notification", $escalation["last_notification"]);
+			if ($escalation["notification_interval"] != NULL) $str .= print_line("notification_interval", $escalation["notification_interval"]);
+			// Nagios 2
+			if ($oreon->user->get_version() == 2)	{
+				$res2 =& $pearDB->query("SELECT tp_name FROM timeperiod WHERE tp_id = '".$escalation["escalation_period"]."'");
+				$tp =& $res2->fetchRow();				
+				if ($tp["tp_name"]) $str .= print_line("escalation_period", $tp["tp_name"]);
+				if ($escalation["escalation_options1"]) $str .= print_line("escalation_options", $escalation["escalation_options1"]);
+			}
+			$str .= "}\n\n";
+			$i++;
+		}
+	}
+	unset($escalation);
+	$res->free();	
+	
+	$res =& $pearDB->query("SELECT DISTINCT service.service_activate, service.service_description, esr.service_service_id FROM service, escalation_service_relation esr WHERE esr.service_service_id = service.service_id ORDER BY service.service_description");
+	while($res->fetchInto($service))	{
+		$BP = false;
+		if ($ret["level"]["level"] == 1)
+			array_key_exists($service["service_service_id"], $gbArr[4]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 2)
+			array_key_exists($service["service_service_id"], $gbArr[4]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 3)
+			$BP = true;
+		if ($BP)	{
+			$res2 =& $pearDB->query("SELECT esc.* FROM escalation esc, escalation_service_relation esr WHERE esr.service_service_id = '".$service["service_service_id"]."' AND esc.esc_id = esr.escalation_esc_id ORDER BY esc.esc_name");
+			$escalation = array();
+			while($res2->fetchInto($escalation))	{
+				//HostGroup Relation
+				$hostGroup = array();
+				$strTemp1 = NULL;
+				$strTemp2 = NULL;
+				$res3 =& $pearDB->query("SELECT DISTINCT hg.hg_id, hg.hg_name FROM host_service_relation hsr, hostgroup hg WHERE hsr.service_service_id = '".$service["service_service_id"]."' AND hsr.hostgroup_hg_id = hg.hg_id");
+				while($res3->fetchInto($hostGroup))	{
+					$BP = false;
+					if ($ret["level"]["level"] == 1)
+						array_key_exists($hostGroup["hg_id"], $gbArr[3]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 2)
+						array_key_exists($hostGroup["hg_id"], $gbArr[3]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)
+						$strTemp1 != NULL ? $strTemp1 .= ", ".$hostGroup["hg_name"] : $strTemp1 = $hostGroup["hg_name"];
+				}
+				$res3->free();
+				unset($hostGroup);
+				//Host Relation
+				$host = array();
+				$strTMPTemp = NULL;
+				$res3 =& $pearDB->query("SELECT DISTINCT host.host_id, host.host_name FROM host_service_relation hsr, host WHERE hsr.service_service_id = '".$service["service_service_id"]."' AND hsr.host_host_id = host.host_id");
+				while($res3->fetchInto($host))	{
+					$BP = false;
+					if ($ret["level"]["level"] == 1)
+						array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 2)
+						array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)
+						$strTemp2 != NULL ? $strTemp2 .= ", ".$host["host_name"] : $strTemp2 = $host["host_name"];
+				}
+				$res3->free();
+				unset($host);
+				if ($strTemp1 || $strTemp2)	{
+					$ret["comment"]["comment"] ? ($str .= "# '".$escalation["esc_name"]."' service escalation definition ".$i."\n") : NULL;
+					if ($ret["comment"]["comment"] && $escalation["esc_comment"])	{
+						$comment = array();
+						$comment = explode("\n", $escalation["esc_comment"]);
+						foreach ($comment as $cmt)
+							$str .= "# ".$cmt."\n";
+					}
+					$str .= "define serviceescalation{\n";			
+					if ($strTemp1) $str .= print_line("hostgroup_name", $strTemp1);
+					if ($strTemp2) $str .= print_line("host_name", $strTemp2);
+					if ($service["service_description"]) $str .= print_line("service_description", $service["service_description"]);
+					$cg = array();
+					$strTemp = NULL;
+					$res3 =& $pearDB->query("SELECT DISTINCT cg.cg_id, cg.cg_name FROM escalation_contactgroup_relation ecgr, contactgroup cg WHERE ecgr.escalation_esc_id = '".$escalation["esc_id"]."' AND ecgr.contactgroup_cg_id = cg.cg_id ORDER BY cg.cg_name");
+					while($res3->fetchInto($cg))	{
+						$BP = false;				
+						if ($ret["level"]["level"] == 1)
+							array_key_exists($cg["cg_id"], $gbArr[1]) ? $BP = true : $BP = false;
+						else if ($ret["level"]["level"] == 2)
+							array_key_exists($cg["cg_id"], $gbArr[1]) ? $BP = true : $BP = false;
+						else if ($ret["level"]["level"] == 3)
+							$BP = true;
+						if ($BP)
+							$strTemp != NULL ? $strTemp .= ", ".$cg["cg_name"] : $strTemp = $cg["cg_name"];
+					}
+					$res3->free();
+					if ($strTemp) $str .= print_line("contact_groups", $strTemp);			
+					if ($escalation["first_notification"] != NULL) $str .= print_line("first_notification", $escalation["first_notification"]);
+					if ($escalation["last_notification"] != NULL) $str .= print_line("last_notification", $escalation["last_notification"]);
+					if ($escalation["notification_interval"] != NULL) $str .= print_line("notification_interval", $escalation["notification_interval"]);
+					// Nagios 2
+					if ($oreon->user->get_version() == 2)	{
+						$res4 =& $pearDB->query("SELECT tp_name FROM timeperiod WHERE tp_id = '".$escalation["escalation_period"]."'");
+						$tp =& $res4->fetchRow();
+						$res4->free();		
+						if ($tp["tp_name"]) $str .= print_line("escalation_period", $tp["tp_name"]);
+						if ($escalation["escalation_options2"]) $str .= print_line("escalation_options", $escalation["escalation_options2"]);
+					}
+					$str .= "}\n\n";
+					$i++;
+				}
+			}
+			unset($escalation);
+			$res2->free();
+		}
+	}
+	unset($service);
+	$res->free();
+	
+	write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $nagiosCFGPath."escalations.cfg");
+	fclose($handle);
+	unset($str);
+	unset($i);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genExtendedInfos.php b/www/include/configuration/configGenerate/genExtendedInfos.php
new file mode 100644
index 0000000000000000000000000000000000000000..e05560a95bf3ecda980e701fed6bc0bbd09c4b9d
--- /dev/null
+++ b/www/include/configuration/configGenerate/genExtendedInfos.php
@@ -0,0 +1,140 @@
+<?php
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	// Host Extended Information
+	$handle = create_file($nagiosCFGPath."hostextinfo.cfg", $oreon->user->get_name());
+	$res =& $pearDB->query("SELECT host.host_name, ehi.* FROM host, extended_host_information ehi WHERE host.host_id = ehi.host_host_id AND host.host_register = '1' ORDER BY `host_name`");
+	$ehi = array();
+	$i = 1;
+	$str = NULL;
+	while($res->fetchInto($ehi))	{
+		$BP = false;
+		if ($ret["level"]["level"] == 1)
+			array_key_exists($ehi["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 2)
+			array_key_exists($ehi["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 3)
+			$BP = true;
+		if ($BP)	{
+			$ret["comment"]["comment"] ? ($str .= "# '" . $ehi["host_name"] . "' Host Extended Information definition " . $i . "\n") : NULL ;
+			$str .= "define hostextinfo{\n";
+			if ($ehi["host_name"]) $str .= print_line("host_name", $ehi["host_name"]);
+			if ($oreon->user->get_version() == 2)
+				if ($ehi["ehi_notes"]) $str .= print_line("notes", $ehi["ehi_notes"]);
+			if ($ehi["ehi_notes_url"]) $str .= print_line("notes_url", $ehi["ehi_notes_url"]);
+			if ($oreon->user->get_version() == 2)
+				if ($ehi["ehi_action_url"]) $str .= print_line("action_url", $ehi["ehi_action_url"]);
+			if ($ehi["ehi_icon_image"]) $str .= print_line("icon_image", $ehi["ehi_icon_image"]);
+			if ($ehi["ehi_icon_image_alt"]) $str .= print_line("icon_image_alt", $ehi["ehi_icon_image_alt"]);
+			if ($ehi["ehi_vrml_image"]) $str .= print_line("vrml_image", $ehi["ehi_vrml_image"]);
+			if ($ehi["ehi_statusmap_image"]) $str .= print_line("statusmap_image", $ehi["ehi_statusmap_image"]);
+			if ($ehi["ehi_2d_coords"]) $str .= print_line("2d_coords", $ehi["ehi_2d_coords"]);
+			if ($ehi["ehi_3d_coords"]) $str .= print_line("3d_coords", $ehi["ehi_3d_coords"]);
+			$str .= "}\n\n";
+			$i++;
+		}
+	}
+	write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $nagiosCFGPath."hostextinfo.cfg");
+	fclose($handle);
+	$res->free();
+	unset($ehi);
+	unset($str);
+	unset($i);
+	
+	// Service Extended Information 
+	$handle = create_file($nagiosCFGPath."serviceextinfo.cfg", $oreon->user->get_name());
+	$esi = array();
+	$i = 1;
+	$str = NULL;	
+
+	$res =& $pearDB->query("SELECT * FROM extended_service_information");
+	while($res->fetchInto($esi))	{
+		$BP = false;
+		if ($ret["level"]["level"] == 1)
+			array_key_exists($esi["service_service_id"], $gbArr[4]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 2)
+			array_key_exists($esi["service_service_id"], $gbArr[4]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 3)
+			$BP = true;
+		if ($BP)	{
+			$hosts = getMyServiceHosts($esi["service_service_id"]);
+			foreach ($hosts as $key=>$value)	{
+				$BP = false;
+				if ($ret["level"]["level"] == 1)
+					array_key_exists($value, $gbArr[2]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 2)
+					array_key_exists($value, $gbArr[2]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 3)
+					$BP = true;
+				if ($BP)	{
+					$host_name = getMyHostName($value);
+					$service_description = getMyServiceName($esi["service_service_id"]);
+					$str .= "# '" . $host_name . "'/'" . $service_description . "' Service Extended Information definition " . $i . "\n";
+					$str .= "define serviceextinfo{\n";
+					if ($host_name) $str .= print_line("host_name", $host_name);
+					if ($service_description) $str .= print_line("service_description", $service_description);
+					if ($oreon->user->get_version() == 2)
+						if ($esi["esi_notes"]) $str .= print_line("notes", $esi["esi_notes"]);
+					if ($esi["esi_notes_url"]) $str .= print_line("notes_url", $esi["esi_notes_url"]);
+					if ($oreon->user->get_version() == 2)
+						if ($esi["esi_action_url"]) $str .= print_line("action_url", $esi["esi_action_url"]);
+					if ($esi["esi_icon_image"]) $str .= print_line("icon_image", $esi["esi_icon_image"]);
+					if ($esi["esi_icon_image_alt"]) $str .= print_line("icon_image_alt", $esi["esi_icon_image_alt"]);;
+					$str .= "}\n\n";
+					$i++;
+				}
+			}
+			$hgs = getMyServiceHostGroups($esi["service_service_id"]);
+			foreach ($hgs as $key=>$value)	{		
+				$BP = false;
+				if ($ret["level"]["level"] == 1)
+					array_key_exists($value, $gbArr[3]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 2)
+					array_key_exists($value, $gbArr[3]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 3)
+					$BP = true;
+				if ($BP)	{
+					$hostgroup_name = getMyHostGroupName($value);
+					$service_description = getMyServiceName($esi["service_service_id"]);
+					$str .= "# '" . $hostgroup_name . "'/'" . $service_description . "' Service Extended Information definition " . $i . "\n";
+					$str .= "define serviceextinfo{\n";
+					if ($hostgroup_name) $str .= print_line("hostgroup_name", $hostgroup_name);
+					if ($service_description) $str .= print_line("service_description", $service_description);
+					if ($oreon->user->get_version() == 2)
+						if ($esi["esi_notes"]) $str .= print_line("notes", $esi["esi_notes"]);
+					if ($esi["esi_notes_url"]) $str .= print_line("notes_url", $esi["esi_notes_url"]);
+					if ($oreon->user->get_version() == 2)
+						if ($esi["esi_action_url"]) $str .= print_line("action_url", $esi["esi_action_url"]);
+					if ($esi["esi_icon_image"]) $str .= print_line("icon_image", $esi["esi_icon_image"]);
+					if ($esi["esi_icon_image_alt"]) $str .= print_line("icon_image_alt", $esi["esi_icon_image_alt"]);;
+					$str .= "}\n\n";
+					$i++;
+				}
+			}
+		}
+	}
+	write_in_file($handle, $str, $nagiosCFGPath."serviceextinfo.cfg");
+	fclose($handle);
+	$res->free();
+	unset($esi);
+	unset($str);
+	unset($i);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genHostGroups.php b/www/include/configuration/configGenerate/genHostGroups.php
new file mode 100644
index 0000000000000000000000000000000000000000..5dc27804773ee09eb40526477055238da03e7833
--- /dev/null
+++ b/www/include/configuration/configGenerate/genHostGroups.php
@@ -0,0 +1,98 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	$handle = create_file($nagiosCFGPath."hostgroups.cfg", $oreon->user->get_name());
+	$res =& $pearDB->query("SELECT * FROM hostgroup ORDER BY `hg_name`");
+	$hostGroup = array();
+	$i = 1;
+	$str = NULL;
+	while($res->fetchInto($hostGroup))	{
+		$BP = false;
+		if ($ret["level"]["level"] == 1)
+			array_key_exists($hostGroup["hg_id"], $gbArr[3]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 2)
+			array_key_exists($hostGroup["hg_id"], $gbArr[3]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 3)
+			$BP = true;
+		if ($BP)	{
+			$ret["comment"]["comment"] ? ($str .= "# '" . $hostGroup["hg_name"] . "' hostgroup definition " . $i . "\n") : NULL;
+			if ($ret["comment"]["comment"] && $hostGroup["hg_comment"])	{
+				$comment = array();
+				$comment = explode("\n", $hostGroup["hg_comment"]);
+				foreach ($comment as $cmt)
+					$str .= "# ".$cmt."\n";
+			}
+			$str .= "define hostgroup{\n";
+			if ($hostGroup["hg_name"]) $str .= print_line("hostgroup_name", $hostGroup["hg_name"]);
+			if ($hostGroup["hg_alias"]) $str .= print_line("alias", $hostGroup["hg_alias"]);
+			// Host members
+			$host = array();
+			$strTemp = NULL;
+			$res2 =& $pearDB->query("SELECT host.host_id, host.host_name FROM hostgroup_relation hgr, host WHERE hgr.hostgroup_hg_id = '".$hostGroup["hg_id"]."' AND hgr.host_host_id = host.host_id ORDER BY `host_name`");
+			while($res2->fetchInto($host))	{
+				$BP = false;
+				if ($ret["level"]["level"] == 1)
+					array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 2)
+					array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 3)
+					$BP = true;
+				if ($BP)
+					$strTemp != NULL ? $strTemp .= ", ".$host["host_name"] : $strTemp = $host["host_name"];
+			}
+			$res2->free();
+			unset($host);
+			if ($strTemp) $str .= print_line("members", $strTemp);
+			unset($strTemp);
+			// Nagios V1 : Contactgroups
+			if ($oreon->user->get_version() == 1)	{
+				$contactGroup = array();
+				$strTemp = NULL;
+				$res2 =& $pearDB->query("SELECT cg.cg_name, cg.cg_id FROM contactgroup_hostgroup_relation cghgr, contactgroup cg WHERE cghgr.hostgroup_hg_id = '".$hostGroup["hg_id"]."' AND cghgr.contactgroup_cg_id = cg.cg_id ORDER BY `cg_name`");
+				while($res2->fetchInto($contactGroup))	{
+					$BP = false;
+					if ($ret["level"]["level"] == 1)
+						array_key_exists($contactGroup["cg_id"], $gbArr[1]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 2)
+						array_key_exists($contactGroup["cg_id"], $gbArr[1]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)
+						$strTemp != NULL ? $strTemp .= ", ".$contactGroup["cg_name"] : $strTemp = $contactGroup["cg_name"];
+				}
+				$res2->free();
+				unset($contactGroup);
+				if ($strTemp) $str .= print_line("contact_groups", $strTemp);
+				unset($strTemp);
+			}
+			$str .= "}\n\n";
+			$i++;
+		}
+		unset($hostGroup);
+	}
+	write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $nagiosCFGPath."hostgroups.cfg");
+	fclose($handle);
+	$res->free();
+	unset($str);
+	unset($i);
+	?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genHosts.php b/www/include/configuration/configGenerate/genHosts.php
new file mode 100644
index 0000000000000000000000000000000000000000..369a1bf5506eecd579ae475b3fac3303f1c8c036
--- /dev/null
+++ b/www/include/configuration/configGenerate/genHosts.php
@@ -0,0 +1,191 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	$handle = create_file($nagiosCFGPath."hosts.cfg", $oreon->user->get_name());
+	$res =& $pearDB->query("SELECT * FROM host ORDER BY `host_register`, `host_name`");
+	$host = array();
+	$i = 1;
+	$str = NULL;
+	while($res->fetchInto($host))	{
+		$BP = false;
+		if ($ret["level"]["level"] == 1)
+			array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 2)
+			array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 3)
+			$BP = true;
+		if (!$host["host_register"])
+			$BP = true;
+		if ($BP)	{
+			$ret["comment"]["comment"] ? ($str .= "# '" . $host["host_name"]."' host definition ".$i."\n") : NULL;
+			if ($ret["comment"]["comment"] && $host["host_comment"])	{
+				$comment = array();
+				$comment = explode("\n", $host["host_comment"]);
+				foreach ($comment as $cmt)
+					$str .= "# ".$cmt."\n";
+			}
+			$str .= "define host{\n";
+			if (!$host["host_register"] && $host["host_name"])	
+				$str .= print_line("name", $host["host_name"]);
+			else
+				if ($host["host_name"]) $str .= print_line("host_name", $host["host_name"]);
+			//Template Model Relation
+			if ($host["host_template_model_htm_id"]) {
+				$hostTemplate = array();
+				$res2 =& $pearDB->query("SELECT host.host_name FROM host WHERE host.host_id = '".$host["host_template_model_htm_id"]."'");
+				while($res2->fetchInto($hostTemplate))
+					$str .= print_line("use", $hostTemplate["host_name"]);
+				$res2->free();
+				unset($hostTemplate);		
+			}
+			//
+			if ($host["host_alias"]) $str .= print_line("alias", $host["host_alias"]);
+			if ($host["host_address"]) $str .= print_line("address", $host["host_address"]);
+			//Parents relation
+			$hostParent = array();
+			$strTemp = NULL;
+			$res2 =& $pearDB->query("SELECT host.host_id, host.host_name FROM host_hostparent_relation hhr, host WHERE hhr.host_host_id = '".$host["host_id"]."' AND hhr.host_parent_hp_id = host.host_id ORDER BY `host_name`");
+			while($res2->fetchInto($hostParent))	{
+				$BP = false;
+				if ($ret["level"]["level"] == 1)
+					array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 2)
+					array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 3)
+					$BP = true;
+				if ($BP)
+					$strTemp != NULL ? $strTemp .= ", ".$hostParent["host_name"] : $strTemp = $hostParent["host_name"];
+			}
+			$res2->free();
+			unset($hostParent);
+			if ($strTemp) $str .= print_line("parents", $strTemp);
+			unset($strTemp);
+			// Nagios V2 : Hostgroups relation
+			if ($oreon->user->get_version() == 2)	{
+				$hostGroup = array();
+				$strTemp = NULL;
+				$res2 =& $pearDB->query("SELECT hg.hg_id, hg.hg_name FROM hostgroup_relation hgr, hostgroup hg WHERE hgr.host_host_id = '".$host["host_id"]."' AND hgr.hostgroup_hg_id = hg.hg_id ORDER BY `hg_name`");
+				while($res2->fetchInto($hostGroup))	{
+					$BP = false;
+					if ($ret["level"]["level"] == 1)
+						array_key_exists($hostGroup["hg_id"], $gbArr[3]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 2)
+						array_key_exists($hostGroup["hg_id"], $gbArr[3]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)
+						$strTemp != NULL ? $strTemp .= ", ".$hostGroup["hg_name"] : $strTemp = $hostGroup["hg_name"];
+				}
+				$res2->free();
+				unset($hostGroup);
+				if ($strTemp) $str .= print_line("hostgroups", $strTemp);
+				unset($strTemp);
+			}
+			//Check Command
+			$command = array();
+			$res2 =& $pearDB->query("SELECT cmd.command_name FROM command cmd WHERE cmd.command_id = '".$host["command_command_id"]."' LIMIT 1");
+			while($res2->fetchInto($command))
+				$str .= print_line("check_command", $command["command_name"]);
+			$res2->free();
+			unset($command);
+			//
+			if ($host["host_max_check_attempts"] != NULL) $str .= print_line("max_check_attempts", $host["host_max_check_attempts"]);
+			if ($host["host_check_interval"] != NULL) $str .= print_line("check_interval", $host["host_check_interval"]);
+			if ($oreon->user->get_version() == 1)
+				if ($host["host_checks_enabled"] != 2) $str .= print_line("checks_enabled", $host["host_checks_enabled"] == 1 ? "1" : "0");
+			if ($oreon->user->get_version() == 2)	{
+				if ($host["host_active_checks_enabled"] != 2) $str .= print_line("active_checks_enabled", $host["host_active_checks_enabled"] == 1 ? "1": "0");
+				if ($host["host_passive_checks_enabled"] != 2) $str .= print_line("passive_checks_enabled", $host["host_passive_checks_enabled"] == 1 ? "1": "0");
+				//Check Period
+				$timePeriod = array();
+				$res2 =& $pearDB->query("SELECT tp.tp_name FROM timeperiod tp WHERE tp.tp_id = '".$host["timeperiod_tp_id"]."' LIMIT 1");
+				while($res2->fetchInto($timePeriod))
+					$str .= print_line("check_period", $timePeriod["tp_name"]);
+				$res2->free();
+				unset($timePeriod);
+				//
+				if ($host["host_obsess_over_host"] != 2) $str .= print_line("obsess_over_host", $host["host_obsess_over_host"] == 1 ? "1": "0");
+				if ($host["host_check_freshness"] != 2) $str .= print_line("check_freshness", $host["host_check_freshness"] == 1 ? "1": "0");
+				if ($host["host_freshness_threshold"]) $str .= print_line("freshness_threshold", $host["host_freshness_threshold"]);
+			}
+			//Event_handler
+			$command = array();
+			$res2 =& $pearDB->query("SELECT cmd.command_name FROM command cmd WHERE cmd.command_id = '".$host["command_command_id2"]."' LIMIT 1");
+			while($res2->fetchInto($command))
+				$str .= print_line("event_handler", $command["command_name"]);
+			$res2->free();
+			unset($command);
+			//
+			if ($host["host_event_handler_enabled"] != 2) $str .= print_line("event_handler_enabled", $host["host_event_handler_enabled"] == 1 ? "1": "0");
+			if ($host["host_low_flap_threshold"]) $str .= print_line("low_flap_threshold", $host["host_low_flap_threshold"]);
+			if ($host["host_high_flap_threshold"]) $str .= print_line("high_flap_threshold", $host["host_high_flap_threshold"]);
+			if ($host["host_flap_detection_enabled"] != 2) $str .= print_line("flap_detection_enabled", $host["host_flap_detection_enabled"] == 1 ? "1": "0");
+			if ($host["host_process_perf_data"] != 2) $str .= print_line("process_perf_data", $host["host_process_perf_data"] == 1 ? "1": "0");
+			if ($host["host_retain_status_information"] != 2) $str .= print_line("retain_status_information", $host["host_retain_status_information"] == 1 ? "1": "0");
+			if ($host["host_retain_nonstatus_information"] != 2) $str .= print_line("retain_nonstatus_information", $host["host_retain_nonstatus_information"] == 1 ? "1": "0");
+			//Nagios V2 : contactGroups relation
+			if ($oreon->user->get_version() == 2)	{
+				$contactGroup = array();
+				$strTemp = NULL;
+				$res2 =& $pearDB->query("SELECT cg.cg_id, cg.cg_name FROM contactgroup_host_relation chr, contactgroup cg WHERE chr.host_host_id = '".$host["host_id"]."' AND chr.contactgroup_cg_id = cg.cg_id ORDER BY `cg_name`");
+				while($res2->fetchInto($contactGroup))	{				
+					$BP = false;
+					if ($ret["level"]["level"] == 1)
+						array_key_exists($contactGroup["cg_id"], $gbArr[1]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 2)
+						array_key_exists($contactGroup["cg_id"], $gbArr[1]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)
+						$strTemp != NULL ? $strTemp .= ", ".$contactGroup["cg_name"] : $strTemp = $contactGroup["cg_name"];
+				}
+				$res2->free();
+				unset($contactGroup);
+				if ($strTemp) $str .= print_line("contact_groups", $strTemp);
+				unset($strTemp);
+			}
+			//
+			if ($host["host_notification_interval"] != NULL) $str .= print_line("notification_interval", $host["host_notification_interval"]);
+			// Timeperiod name
+			$timePeriod = array();
+			$res2 =& $pearDB->query("SELECT tp.tp_name FROM timeperiod tp WHERE tp.tp_id = '".$host["timeperiod_tp_id2"]."' LIMIT 1");
+			while($res2->fetchInto($timePeriod))
+				$str .= print_line("notification_period", $timePeriod["tp_name"]);
+			$res2->free();
+			unset($timePeriod);
+			//
+			if ($host["host_notification_options"]) $str .= print_line("notification_options", $host["host_notification_options"]);
+			if ($host["host_notifications_enabled"] != 2) $str .= print_line("notifications_enabled", $host["host_notifications_enabled"] == 1 ? "1": "0");
+			if ($host["host_stalking_options"]) $str .= print_line("stalking_options", $host["host_stalking_options"]);
+			if (!$host["host_register"]) $str .= print_line("register", "0");
+			$str .= "}\n\n";
+			$i++;
+		}
+		unset($host);
+	}
+	write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $nagiosCFGPath."hosts.cfg");
+	fclose($handle);
+	$res->free();
+	unset($str);
+	unset($i);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genNagiosCFG-DEBUG.php b/www/include/configuration/configGenerate/genNagiosCFG-DEBUG.php
new file mode 100644
index 0000000000000000000000000000000000000000..1581b38317b6620177781bb1cdeedb0361f9ca26
--- /dev/null
+++ b/www/include/configuration/configGenerate/genNagiosCFG-DEBUG.php
@@ -0,0 +1,159 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	$handle = create_file($nagiosCFGPath."nagiosCFG.DEBUG", $oreon->user->get_name(), false);
+	$res =& $pearDB->query("SELECT * FROM `cfg_nagios` WHERE `nagios_activate` = '1' LIMIT 1");
+	$nagios = $res->fetchRow();
+	$str = NULL;
+	$ret["comment"]["comment"] ? ($str .= "# '".$nagios["nagios_name"]."'\n") : NULL;
+	if ($ret["comment"]["comment"] && $nagios["nagios_comment"])	{
+		$comment = array();
+		$comment = explode("\n", $nagios["nagios_comment"]);
+		foreach ($comment as $cmt)
+			$str .= "# ".$cmt."\n";
+	}
+	$str .= "cfg_file=".$oreon->optGen["oreon_path"].$DebugPath."hosts.cfg\n";
+	$str .= "cfg_file=".$oreon->optGen["oreon_path"].$DebugPath."services.cfg\n";
+	$str .= "cfg_file=".$oreon->optGen["oreon_path"].$DebugPath."misccommands.cfg\n";
+	$str .= "cfg_file=".$oreon->optGen["oreon_path"].$DebugPath."checkcommands.cfg\n";
+	$str .= "cfg_file=".$oreon->optGen["oreon_path"].$DebugPath."contactgroups.cfg\n";
+	$str .= "cfg_file=".$oreon->optGen["oreon_path"].$DebugPath."contacts.cfg\n";
+	$str .= "cfg_file=".$oreon->optGen["oreon_path"].$DebugPath."hostgroups.cfg\n";
+	if ($oreon->user->get_version() == 2)
+		$str .= "cfg_file=".$oreon->optGen["oreon_path"].$DebugPath."servicegroups.cfg\n";
+	$str .= "cfg_file=".$oreon->optGen["oreon_path"].$DebugPath."timeperiods.cfg\n";
+	$str .= "cfg_file=".$oreon->optGen["oreon_path"].$DebugPath."escalations.cfg\n";
+	$str .= "cfg_file=".$oreon->optGen["oreon_path"].$DebugPath."dependencies.cfg\n";	
+	if ($oreon->user->get_version() == 2)	{
+		$str .= "cfg_file=".$oreon->optGen["oreon_path"].$DebugPath."hostextinfo.cfg\n";
+		$str .= "cfg_file=".$oreon->optGen["oreon_path"].$DebugPath."serviceextinfo.cfg\n";
+	}
+	# Include for Meta Service the cfg file
+	if ($oreon->optGen["perfparse_installed"] && ($files = glob("./include/configuration/configGenerate/metaService/*.php")))
+		foreach ($files as $filename)	{
+			$cfg = NULL;
+			$file =& basename($filename);
+			$file = explode(".", $file);
+			$cfg .= $file[0];
+			$str .= "cfg_file=".$oreon->optGen["oreon_path"].$DebugPath.$cfg.".cfg\n";
+		}
+	# Include for Module the cfg file
+	if (isset($oreon->modules["osl"]))
+		if ($oreon->modules["osl"]["gen"] && $files = glob("./modules/osl/generate_files/*.php"))
+			foreach ($files as $filename)	{
+				$cfg = NULL;
+				$file =& basename($filename);
+				$file = explode(".", $file);
+				$cfg .= $file[0];
+				$str .= "cfg_file=".$oreon->optGen["oreon_path"].$DebugPath.$cfg.".cfg\n";
+			}
+	$str .= "resource_file=".$oreon->optGen["oreon_path"].$DebugPath."resource.cfg\n";
+	$nagios["cfg_dir"] = NULL;
+	foreach ($nagios as $key=>$value)	{
+		if ($value != NULL && $key != "nagios_id" && $key != "nagios_name" && $key != "nagios_comment" && $key != "nagios_activate")	{	
+			if ($key == "aggregate_status_updates" && $value == 2);
+			else if ($key == "enable_notifications" && $value == 2);	
+			else if ($key == "execute_service_checks" && $value == 2);	
+			else if ($key == "accept_passive_service_checks" && $value == 2);	
+			else if ($key == "execute_host_checks" && $value == 2);	
+			else if ($key == "accept_passive_host_checks" && $value == 2);	
+			else if ($key == "enable_event_handlers" && $value == 2);
+			else if ($key == "check_external_commands" && $value == 2);
+			else if ($key == "retain_state_information" && $value == 2);
+			else if ($key == "use_retained_program_state" && $value == 2);
+			else if ($key == "use_retained_scheduling_info" && $value == 2);
+			else if ($key == "use_syslog" && $value == 2);
+			else if ($key == "log_notifications" && $value == 2);
+			else if ($key == "log_service_retries" && $value == 2);
+			else if ($key == "log_host_retries" && $value == 2);
+			else if ($key == "log_event_handlers" && $value == 2);
+			else if ($key == "log_initial_states" && $value == 2);
+			else if ($key == "log_external_commands" && $value == 2);
+			else if ($key == "log_passive_service_checks" && ($value == 2 || $oreon->user->get_version() == 2));
+			else if ($key == "log_passive_checks" && ($value == 2 || $oreon->user->get_version() == 1));
+			else if ($key == "auto_reschedule_checks" && $value == 2);
+			else if ($key == "use_agressive_host_checking" && $value == 2);
+			else if ($key == "enable_flap_detection" && $value == 2);
+			else if ($key == "soft_state_dependencies" && $value == 2);
+			else if ($key == "obsess_over_services" && $value == 2);
+			else if ($key == "obsess_over_hosts" && $value == 2);
+			else if ($key == "process_performance_data" && $value == 2);
+			else if ($key == "max_service_check_spread" && $oreon->user->get_version() == 1);
+			else if ($key == "max_host_check_spread" && $oreon->user->get_version() == 1);
+			else if ($key == "check_for_orphaned_services" && $value == 2);
+			else if ($key == "check_service_freshness" && $value == 2);
+			else if ($key == "check_host_freshness" && $value == 2);
+			else if ($key == "use_regexp_matching" && $value == 2);
+			else if ($key == "use_true_regexp_matching" && $value == 2);
+			else if ($key == "service_inter_check_delay_method" && ($value == 2 || $oreon->user->get_version() == 1));
+			else if ($key == "host_inter_check_delay_method" && ($value == 2 || $oreon->user->get_version() == 1));
+			else if ($key == "inter_check_delay_method" && ($value == 2 || $oreon->user->get_version() == 2));
+			else if ($key == "global_host_event_handler" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else if ($key == "global_service_event_handler" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else if ($key == "ocsp_command" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else if ($key == "ochp_command" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else if ($key == "host_perfdata_command`" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else if ($key == "service_perfdata_command" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else if ($key == "host_perfdata_file_processing_command" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else if ($key == "service_perfdata_file_processing_command" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else
+				$str .= $key."=".$value."\n";
+		}
+	}
+	write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $nagiosCFGPath."nagiosCFG.DEBUG");
+	fclose($handle);
+	$res->free();
+	unset($str);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genNagiosCFG.php b/www/include/configuration/configGenerate/genNagiosCFG.php
new file mode 100644
index 0000000000000000000000000000000000000000..cec13a5991861341176b49efe9d56b44c71ca2b8
--- /dev/null
+++ b/www/include/configuration/configGenerate/genNagiosCFG.php
@@ -0,0 +1,159 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	
+	if (!isset($oreon))
+		exit();	
+	
+	$handle = create_file($nagiosCFGPath."nagios.cfg", $oreon->user->get_name());
+	$res =& $pearDB->query("SELECT * FROM `cfg_nagios` WHERE `nagios_activate` = '1' LIMIT 1");
+	$nagios = $res->fetchRow();
+	$str = NULL;
+	$ret["comment"]["comment"] ? ($str .= "# '".$nagios["nagios_name"]."'\n") : NULL;
+	if ($ret["comment"]["comment"] && $nagios["nagios_comment"])	{
+		$comment = array();
+		$comment = explode("\n", $nagios["nagios_comment"]);
+		foreach ($comment as $cmt)
+			$str .= "# ".$cmt."\n";
+	}
+	$str .= "cfg_file=".$nagios["cfg_dir"]."hosts.cfg\n";
+	$str .= "cfg_file=".$nagios["cfg_dir"]."services.cfg\n";
+	$str .= "cfg_file=".$nagios["cfg_dir"]."misccommands.cfg\n";
+	$str .= "cfg_file=".$nagios["cfg_dir"]."checkcommands.cfg\n";
+	$str .= "cfg_file=".$nagios["cfg_dir"]."contactgroups.cfg\n";
+	$str .= "cfg_file=".$nagios["cfg_dir"]."contacts.cfg\n";
+	$str .= "cfg_file=".$nagios["cfg_dir"]."hostgroups.cfg\n";
+	if ($oreon->user->get_version() == 2)
+		$str .= "cfg_file=".$nagios["cfg_dir"]."servicegroups.cfg\n";
+	$str .= "cfg_file=".$nagios["cfg_dir"]."timeperiods.cfg\n";
+	$str .= "cfg_file=".$nagios["cfg_dir"]."escalations.cfg\n";
+	$str .= "cfg_file=".$nagios["cfg_dir"]."dependencies.cfg\n";	
+	if ($oreon->user->get_version() == 2)	{
+		$str .= "cfg_file=".$nagios["cfg_dir"]."hostextinfo.cfg\n";
+		$str .= "cfg_file=".$nagios["cfg_dir"]."serviceextinfo.cfg\n";
+	}
+	# Include for Meta Service the cfg file
+	if ($oreon->optGen["perfparse_installed"] && ($files = glob("./include/configuration/configGenerate/metaService/*.php")))
+		foreach ($files as $filename)	{
+			$cfg = NULL;
+			$file =& basename($filename);
+			$file = explode(".", $file);
+			$cfg .= $file[0];
+			$str .= "cfg_file=".$nagios["cfg_dir"].$cfg.".cfg\n";
+		}
+	# Include for Module the cfg file
+	if (isset($oreon->modules["osl"]))
+		if ($oreon->modules["osl"]["gen"] && $files = glob("./modules/osl/generate_files/*.php"))
+			foreach ($files as $filename)	{
+				$cfg = NULL;
+				$file =& basename($filename);
+				$file = explode(".", $file);
+				$cfg .= $file[0];
+				$str .= "cfg_file=".$nagios["cfg_dir"].$cfg.".cfg\n";
+			}
+	$str .= "resource_file=".$nagios["cfg_dir"]."resource.cfg\n";
+	$nagios["cfg_dir"] = NULL;
+	foreach ($nagios as $key=>$value)	{
+		if ($value != NULL && $key != "nagios_id" && $key != "nagios_name" && $key != "nagios_comment" && $key != "nagios_activate")	{	
+			if ($key == "aggregate_status_updates" && $value == 2);
+			else if ($key == "enable_notifications" && $value == 2);	
+			else if ($key == "execute_service_checks" && $value == 2);	
+			else if ($key == "accept_passive_service_checks" && $value == 2);	
+			else if ($key == "execute_host_checks" && $value == 2);	
+			else if ($key == "accept_passive_host_checks" && $value == 2);	
+			else if ($key == "enable_event_handlers" && $value == 2);
+			else if ($key == "check_external_commands" && $value == 2);
+			else if ($key == "retain_state_information" && $value == 2);
+			else if ($key == "use_retained_program_state" && $value == 2);
+			else if ($key == "use_retained_scheduling_info" && $value == 2);
+			else if ($key == "use_syslog" && $value == 2);
+			else if ($key == "log_notifications" && $value == 2);
+			else if ($key == "log_service_retries" && $value == 2);
+			else if ($key == "log_host_retries" && $value == 2);
+			else if ($key == "log_event_handlers" && $value == 2);
+			else if ($key == "log_initial_states" && $value == 2);
+			else if ($key == "log_external_commands" && $value == 2);
+			else if ($key == "log_passive_service_checks" && ($value == 2 || $oreon->user->get_version() == 2));
+			else if ($key == "log_passive_checks" && ($value == 2 || $oreon->user->get_version() == 1));
+			else if ($key == "auto_reschedule_checks" && $value == 2);
+			else if ($key == "use_agressive_host_checking" && $value == 2);
+			else if ($key == "enable_flap_detection" && $value == 2);
+			else if ($key == "soft_state_dependencies" && $value == 2);
+			else if ($key == "obsess_over_services" && $value == 2);
+			else if ($key == "obsess_over_hosts" && $value == 2);
+			else if ($key == "process_performance_data" && $value == 2);
+			else if ($key == "max_service_check_spread" && $oreon->user->get_version() == 1);
+			else if ($key == "max_host_check_spread" && $oreon->user->get_version() == 1);
+			else if ($key == "check_for_orphaned_services" && $value == 2);
+			else if ($key == "check_service_freshness" && $value == 2);
+			else if ($key == "check_host_freshness" && $value == 2);
+			else if ($key == "use_regexp_matching" && $value == 2);
+			else if ($key == "use_true_regexp_matching" && $value == 2);
+			else if ($key == "service_inter_check_delay_method" && ($value == 2 || $oreon->user->get_version() == 1));
+			else if ($key == "host_inter_check_delay_method" && ($value == 2 || $oreon->user->get_version() == 1));
+			else if ($key == "inter_check_delay_method" && ($value == 2 || $oreon->user->get_version() == 2));
+			else if ($key == "global_host_event_handler" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else if ($key == "global_service_event_handler" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else if ($key == "ocsp_command" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else if ($key == "ochp_command" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else if ($key == "host_perfdata_command`" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else if ($key == "service_perfdata_command" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else if ($key == "host_perfdata_file_processing_command" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else if ($key == "service_perfdata_file_processing_command" && $value)	{
+				$res2 =& $pearDB->query("SELECT command_name FROM `command` WHERE command_id = '".$value."'");
+				$row = $res2->fetchRow();
+				$str .= $key."=".$row["command_name"]."\n";
+			}
+			else
+				$str .= $key."=".$value."\n";
+		}
+	}
+	write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $nagiosCFGPath."nagios.cfg");
+	fclose($handle);
+	$res->free();
+	unset($str);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genPerfparseCFG.php b/www/include/configuration/configGenerate/genPerfparseCFG.php
new file mode 100644
index 0000000000000000000000000000000000000000..61d18a4df1b13d20f67053a82f4b5e6dee86ee74
--- /dev/null
+++ b/www/include/configuration/configGenerate/genPerfparseCFG.php
@@ -0,0 +1,129 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	$handle = create_file($nagiosCFGPath."perfparse.cfg", $oreon->user->get_name());
+	$res =& $pearDB->query("SELECT * FROM `cfg_perfparse` WHERE `perfparse_activate` = '1' LIMIT 1");
+	if ($res->numRows())
+		$perfparse = $res->fetchRow();
+	else
+		$perfparse = array();
+	$str = NULL;
+	$ret["comment"]["comment"] ? ($str .= "# '".$perfparse["perfparse_name"]."'\n") : NULL;
+	if ($ret["comment"]["comment"] && $perfparse["perfparse_comment"])	{
+		$comment = array();
+		$comment = explode("\n", $perfparse["perfparse_comment"]);
+		foreach ($comment as $cmt)
+			$str .= "# ".$cmt."\n";
+	}
+	foreach ($perfparse as $key=>$value)	{
+		if ($key != "perfparse_id" && $key != "perfparse_name" && $key != "perfparse_comment" && $key != "perfparse_activate")	{	
+			if ($key == "Error_Log_Rotate")
+				switch ($value)	{
+					case "0" : $str .= $key." = \"No\"\n"; break;
+					case "1" : $str .= $key." = \"Yes\"\n"; break;
+					default : break;
+				}
+			else if ($key == "Drop_File_Rotate")
+				switch ($value)	{
+					case "0" : $str .= $key." = \"No\"\n"; break;
+					case "1" : $str .= $key." = \"Yes\"\n"; break;
+					default : break;
+				}
+			else if ($key == "Show_Status_Bar")
+				switch ($value)	{
+					case "0" : $str .= $key." = \"No\"\n"; break;
+					case "1" : $str .= $key." = \"Yes\"\n"; break;
+					default : break;
+				}
+			else if ($key == "Do_Report")
+				switch ($value)	{
+					case "0" : $str .= $key." = \"No\"\n"; break;
+					case "1" : $str .= $key." = \"Yes\"\n"; break;
+					default : break;
+				}
+			else if ($key == "Output_Log_File")
+				switch ($value)	{
+					case "0" : $str .= $key." = \"No\"\n"; break;
+					case "1" : $str .= $key." = \"Yes\"\n"; break;
+					default : break;
+				}
+			else if ($key == "Output_Log_Rotate")
+				switch ($value)	{
+					case "0" : $str .= $key." = \"No\"\n"; break;
+					case "1" : $str .= $key." = \"Yes\"\n"; break;
+					default : break;
+				}
+			else if ($key == "Use_Storage_Socket_Output")
+				switch ($value)	{
+					case "0" : $str .= $key." = \"No\"\n"; break;
+					case "1" : $str .= $key." = \"Yes\"\n"; break;
+					default : break;
+				}
+			else if ($key == "Use_Storage_Mysql")
+				switch ($value)	{
+					case "0" : $str .= $key." = \"No\"\n"; break;
+					case "1" : $str .= $key." = \"Yes\"\n"; break;
+					default : break;
+				}
+			else if ($key == "No_Raw_Data")
+				switch ($value)	{
+					case "0" : $str .= $key." = \"No\"\n"; break;
+					case "1" : $str .= $key." = \"Yes\"\n"; break;
+					default : break;
+				}
+			else if ($key == "No_Bin_Data")
+				switch ($value)	{
+					case "0" : $str .= $key." = \"No\"\n"; break;
+					case "1" : $str .= $key." = \"Yes\"\n"; break;
+					default : break;
+				}
+			else if ($key == "Default_user_permissions_Policy")
+				switch ($value)	{
+					case "1" : $str .= $key." = \"ro\"\n"; break;
+					case "2" : $str .= $key." = \"rw\"\n"; break;
+					case "3" : $str .= $key." = \"hide\"\n"; break;
+					default : break;
+				}
+			else if ($key == "Default_user_permissions_Host_groups")
+				switch ($value)	{
+					case "1" : $str .= $key." = \"ro\"\n"; break;
+					case "2" : $str .= $key." = \"rw\"\n"; break;
+					case "3" : $str .= $key." = \"hide\"\n"; break;
+					default : break;
+				}
+			else if ($key == "Default_user_permissions_Summary")
+				switch ($value)	{
+					case "1" : $str .= $key." = \"ro\"\n"; break;
+					case "2" : $str .= $key." = \"rw\"\n"; break;
+					case "3" : $str .= $key." = \"hide\"\n"; break;
+					default : break;
+				}
+			else
+				$str .= $key." = \"".$value."\"\n";
+		}
+	}
+	write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $nagiosCFGPath."perfparse.cfg");
+	fclose($handle);
+	$res->free();
+	unset($str);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genResourceCFG.php b/www/include/configuration/configGenerate/genResourceCFG.php
new file mode 100644
index 0000000000000000000000000000000000000000..6db87bdd51a0da7d1f8c84dcfa1ec871a8628913
--- /dev/null
+++ b/www/include/configuration/configGenerate/genResourceCFG.php
@@ -0,0 +1,41 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	
+	if (!isset($oreon))
+		exit();
+	
+	$handle = create_file($nagiosCFGPath."resource.cfg", $oreon->user->get_name());
+	$res =& $pearDB->query("SELECT * FROM `cfg_resource` WHERE `resource_activate` = '1'");
+	$str = NULL;
+	while ($res->fetchInto($resource))	{
+		$ret["comment"]["comment"] ? ($str .= "# '".$resource["resource_name"]."'\n") : NULL;
+		if ($ret["comment"]["comment"] && $resource["resource_comment"])	{
+			$comment = array();
+			$comment = explode("\n", $resource["resource_comment"]);
+			foreach ($comment as $cmt)
+				$str .= "# ".$cmt."\n";
+		}
+		$str .= $resource["resource_line"]."\n";
+	}
+	write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $nagiosCFGPath."resource.cfg");
+	fclose($handle);
+	$res->free();
+	unset($str);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genServiceGroups.php b/www/include/configuration/configGenerate/genServiceGroups.php
new file mode 100644
index 0000000000000000000000000000000000000000..d9a90ebf01bd9722bb28b7a03891bfb6ffb557fb
--- /dev/null
+++ b/www/include/configuration/configGenerate/genServiceGroups.php
@@ -0,0 +1,114 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	$handle = create_file($nagiosCFGPath."servicegroups.cfg", $oreon->user->get_name());
+	$res =& $pearDB->query("SELECT * FROM servicegroup ORDER BY `sg_name`");
+	$serviceGroup = array();
+	$i = 1;
+	$str = NULL;
+	while($res->fetchInto($serviceGroup))	{
+		$BP = false;
+		if ($ret["level"]["level"] == 1)
+			array_key_exists($serviceGroup["sg_id"], $gbArr[5]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 2)
+			array_key_exists($serviceGroup["sg_id"], $gbArr[5]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 3)
+			$BP = true;
+		if ($BP)	{
+			$ret["comment"]["comment"] ? ($str .= "# '" . $serviceGroup["sg_name"] . "' servicegroup definition " . $i . "\n") : NULL;
+			if ($ret["comment"]["comment"] && $serviceGroup["sg_comment"])	{
+				$comment = array();
+				$comment = explode("\n", $serviceGroup["sg_comment"]);
+				foreach ($comment as $cmt)
+					$str .= "# ".$cmt."\n";
+			}
+			$str .= "define servicegroup{\n";
+			if ($serviceGroup["sg_name"]) $str .= print_line("servicegroup_name", $serviceGroup["sg_name"]);
+			if ($serviceGroup["sg_alias"]) $str .= print_line("alias", $serviceGroup["sg_alias"]);
+			// Service members
+			$service = array();
+			$strTemp = NULL;
+			$res2 =& $pearDB->query("SELECT service.service_id, service.service_description, hsr.hostgroup_hg_id, hsr.host_host_id FROM servicegroup_relation sgr, service, host_service_relation hsr WHERE sgr.servicegroup_sg_id = '".$serviceGroup["sg_id"]."' AND sgr.service_service_id = service.service_id AND hsr.service_service_id = sgr.service_service_id");
+			while($res2->fetchInto($service))	{
+				$BP = false;
+				if ($ret["level"]["level"] == 1)
+					array_key_exists($service["service_id"], $gbArr[4]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 2)
+					array_key_exists($service["service_id"], $gbArr[4]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"]	 == 3)
+					$BP = true;
+				if ($BP)	{				
+					if ($service["host_host_id"])	{
+						$BP = false;
+						if ($ret["level"]["level"] == 1)
+							array_key_exists($service["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+						else if ($ret["level"]["level"] == 2)
+							array_key_exists($service["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+						else if ($ret["level"]["level"]	 == 3)
+							$BP = true;
+						if ($BP)
+							$strTemp != NULL ? $strTemp .= ", ".getMyHostName($service["host_host_id"]).", ".$service["service_description"] : $strTemp = getMyHostName($service["host_host_id"]).", ".$service["service_description"];
+					}
+					else if ($service["hostgroup_hg_id"])	{
+						$BP = false;
+						if ($ret["level"]["level"] == 1)
+							array_key_exists($service["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+						else if ($ret["level"]["level"] == 2)
+							array_key_exists($service["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+						else if ($ret["level"]["level"]	 == 3)
+							$BP = true;
+						if ($BP)	{
+							$res3 =& $pearDB->query("SELECT host_host_id FROM hostgroup_relation WHERE hostgroup_hg_id = '".$service["hostgroup_hg_id"]."'");
+							while($res3->fetchInto($host))	{
+								$BP = false;
+								if ($ret["level"]["level"] == 1)
+									array_key_exists($host["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+								else if ($ret["level"]["level"] == 2)
+									array_key_exists($host["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+								else if ($ret["level"]["level"]	 == 3)
+									$BP = true;
+								if ($BP)
+									$strTemp != NULL ? $strTemp .= ", ".getMyHostName($host["host_host_id"]).", ".$service["service_description"] : $strTemp = getMyHostName($host["host_host_id"]).", ".$service["service_description"];
+							}
+							unset($host);
+							$res3->free();
+						}
+					}
+					
+				}				
+			}
+			$res2->free();
+			unset($service);
+			if ($strTemp) $str .= print_line("members", $strTemp);
+			unset($strTemp);
+			$str .= "}\n\n";
+			$i++;
+		}
+		unset($serviceGroup);
+	}
+	write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $nagiosCFGPath."servicegroups.cfg");
+	fclose($handle);
+	$res->free();
+	unset($str);
+	unset($i);
+	?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genServices.php b/www/include/configuration/configGenerate/genServices.php
new file mode 100644
index 0000000000000000000000000000000000000000..9377275cf2946e83118b536dd189334ab8a6fab4
--- /dev/null
+++ b/www/include/configuration/configGenerate/genServices.php
@@ -0,0 +1,415 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	$handle = create_file($nagiosCFGPath."services.cfg", $oreon->user->get_name());
+	$res =& $pearDB->query("SELECT * FROM service ORDER BY `service_register`, `service_description`");
+	$service = array();
+	$i = 1;
+	$str = NULL;
+	while($res->fetchInto($service))	{
+		$BP = false;
+		if ($ret["level"]["level"] == 1)
+			array_key_exists($service["service_id"], $gbArr[4]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 2)
+			array_key_exists($service["service_id"], $gbArr[4]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 3)
+			$BP = true;
+		if ($BP)	{
+			if ($service["service_register"] && isACheckGraphService($service["service_id"]))	{
+				#
+				## Create a definition for each Service (need to put the service ID)
+				#
+				$parent = false;
+				$hostArr = array();
+				//HostGroup Relation
+				$hostGroup = array();
+				$res2 =& $pearDB->query("SELECT hostgroup_hg_id FROM host_service_relation hsr WHERE hsr.service_service_id ='".$service["service_id"]."'");
+				while($res2->fetchInto($hostGroup))	{
+					$BP = false;
+					if ($ret["level"]["level"] == 1)
+						array_key_exists($hostGroup["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 2)
+						array_key_exists($hostGroup["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)	{
+						$res3 =& $pearDB->query("SELECT host.host_id, host.host_name FROM hostgroup_relation hgr, host WHERE hgr.hostgroup_hg_id ='".$hostGroup["hostgroup_hg_id"]."' AND hgr.host_host_id = host.host_id");
+						while($res3->fetchInto($host))	{
+							$BP = false;
+							if ($ret["level"]["level"] == 1)
+								array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+							else if ($ret["level"]["level"] == 2)
+								array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+							else if ($ret["level"]["level"] == 3)
+								$BP = true;
+							if ($BP)	{
+								$parent = true;
+								$hostArr[$host["host_id"]] = $host["host_name"];
+							}
+						}
+					}
+				}
+				$res2->free();
+				unset($hostGroup);
+				if (!$parent)	{
+					//Host Relation
+					$host = array();
+					$res2 =& $pearDB->query("SELECT host.host_id, host.host_name FROM host_service_relation hsr, host WHERE hsr.service_service_id ='".$service["service_id"]."' AND hsr.host_host_id = host.host_id");
+					while($res2->fetchInto($host))	{
+						$BP = false;
+						if ($ret["level"]["level"] == 1)
+							array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+						else if ($ret["level"]["level"] == 2)
+							array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+						else if ($ret["level"]["level"] == 3)
+							$BP = true;
+						if ($BP)	{
+							$parent = true;
+							$hostArr[$host["host_id"]] = $host["host_name"];
+						}
+					}
+					$res2->free();
+					unset($host);
+				}
+				foreach ($hostArr as $key=>$value)	{
+					$strTMP = NULL;
+					$ret["comment"]["comment"] ? ($strTMP .= "# '" . $service["service_description"] . "' service definition " . $i . "\n") : NULL;
+					$ret["comment"]["comment"] ? ($strTMP .= "# ID_OREON:'" . $service["service_id"] . "'\n") : NULL;
+					if ($ret["comment"]["comment"] && $service["service_comment"])	{
+						$comment = array();
+						$comment = explode("\n", $service["service_comment"]);
+						foreach ($comment as $cmt)
+							$strTMP .= "# ".$cmt."\n";
+					}
+					$strTMP .= "define service{\n";
+					$strTMP .= print_line("host_name", $value);
+					if (!$service["service_register"] && $service["service_description"])	{
+						$strTMP .= print_line("name", $service["service_description"]);
+						$strTMP .= print_line("service_description", $service["service_description"]);
+					}
+					else if ($service["service_description"]) 
+						$strTMP .= print_line("service_description", $service["service_description"]);
+					//Template Model Relation
+					if ($service["service_template_model_stm_id"]) {
+						$serviceTemplate = array();
+						$res2 =& $pearDB->query("SELECT service.service_description FROM service WHERE service.service_id = '".$service["service_template_model_stm_id"]."'");
+						while($res2->fetchInto($serviceTemplate))
+							$strTMP .= print_line("use", $serviceTemplate["service_description"]);
+						$res2->free();
+						unset($serviceTemplate);		
+					}
+					// Nagios V2 : Servicegroups relation
+					if ($oreon->user->get_version() == 2)	{
+						$serviceGroup = array();
+						$strTMPTemp = NULL;
+						$res2 =& $pearDB->query("SELECT sg.sg_id, sg.sg_name FROM servicegroup_relation sgr, servicegroup sg WHERE sgr.service_service_id = '".$service["service_id"]."' AND sgr.servicegroup_sg_id = sg.sg_id ORDER BY `sg_name`");
+						while($res2->fetchInto($serviceGroup))	{
+							$BP = false;
+							if ($ret["level"]["level"] == 1)
+								array_key_exists($serviceGroup["sg_id"], $gbArr[5]) ? $BP = true : NULL;
+							else if ($ret["level"]["level"] == 2)
+								array_key_exists($serviceGroup["sg_id"], $gbArr[5]) ? $BP = true : NULL;
+							else if ($ret["level"]["level"] == 3)
+								$BP = true;
+							if ($BP)
+								$strTMPTemp != NULL ? $strTMPTemp .= ", ".$serviceGroup["sg_name"] : $strTMPTemp = $serviceGroup["sg_name"];
+						}
+						$res2->free();
+						if ($strTMPTemp) $strTMP .= print_line("servicegroups", $strTMPTemp);
+						unset($serviceGroup);
+						unset($strTMPTemp);
+					}
+					if ($service["service_is_volatile"] != 2) $strTMP .= print_line("is_volatile", $service["service_is_volatile"] == 1 ? "1": "0");
+					//Check Command
+					$command = NULL;
+					$command = getMyCheckCmdGraph($service["service_id"], $key);
+					if ($command)
+						$strTMP .= print_line("check_command", $command);
+					//
+					if ($service["service_max_check_attempts"] != NULL) $strTMP .= print_line("max_check_attempts", $service["service_max_check_attempts"]);
+					if ($service["service_normal_check_interval"] != NULL) $strTMP .= print_line("normal_check_interval", $service["service_normal_check_interval"]);
+					if ($service["service_retry_check_interval"] != NULL) $strTMP .= print_line("retry_check_interval", $service["service_retry_check_interval"]);
+					if ($service["service_active_checks_enabled"] != 2) $strTMP .= print_line("active_checks_enabled", $service["service_active_checks_enabled"] == 1 ? "1": "0");
+					if ($service["service_passive_checks_enabled"] != 2) $strTMP .= print_line("passive_checks_enabled", $service["service_passive_checks_enabled"] == 1 ? "1": "0");
+					//Check Period
+					$timePeriod = array();
+					$res2 =& $pearDB->query("SELECT tp.tp_name FROM timeperiod tp WHERE tp.tp_id = '".$service["timeperiod_tp_id"]."' LIMIT 1");
+					while($res2->fetchInto($timePeriod))
+						$strTMP .= print_line("check_period", $timePeriod["tp_name"]);
+					$res2->free();
+					unset($timePeriod);
+					//
+					if ($service["service_parallelize_check"] != 2) $strTMP .= print_line("parallelize_check", $service["service_parallelize_check"] == 1 ? "1": "0");
+					if ($service["service_obsess_over_service"] != 2) $strTMP .= print_line("obsess_over_service", $service["service_obsess_over_service"] == 1 ? "1": "0");
+					if ($service["service_check_freshness"] != 2) $strTMP .= print_line("check_freshness", $service["service_check_freshness"] == 1 ? "1": "0");
+					if ($service["service_freshness_threshold"] != NULL) $strTMP .= print_line("freshness_threshold", $service["service_freshness_threshold"]);
+					//Event_handler
+					$command = array();
+					$service["command_command_id_arg2"] = str_replace('#BR#', "\\n", $service["command_command_id_arg2"]);
+					$service["command_command_id_arg2"] = str_replace('#T#', "\\t", $service["command_command_id_arg2"]);
+					$service["command_command_id_arg2"] = str_replace('#R#', "\\r", $service["command_command_id_arg2"]);
+					$service["command_command_id_arg2"] = str_replace('#S#', "/", $service["command_command_id_arg2"]);
+					$service["command_command_id_arg2"] = str_replace('#BS#', "\\", $service["command_command_id_arg2"]);
+					$res2 =& $pearDB->query("SELECT cmd.command_name FROM command cmd WHERE cmd.command_id = '".$service["command_command_id2"]."' LIMIT 1");
+					while($res2->fetchInto($command))
+						$strTMP .= print_line("event_handler", strstr($command["command_name"], "check_graph_") ? $command["command_name"].$service["command_command_id_arg2"]."!".$service["service_id"] : $command["command_name"].$service["command_command_id_arg2"]);
+					$res2->free();
+					unset($command);
+					//
+					if ($service["service_event_handler_enabled"] != 2) $strTMP .= print_line("event_handler_enabled", $service["service_event_handler_enabled"] == 1 ? "1": "0");
+					if ($service["service_low_flap_threshold"] != NULL) $strTMP .= print_line("low_flap_threshold", $service["service_low_flap_threshold"]);
+					if ($service["service_high_flap_threshold"] != NULL) $strTMP .= print_line("high_flap_threshold", $service["service_high_flap_threshold"]);
+					if ($service["service_flap_detection_enabled"] != 2) $strTMP .= print_line("flap_detection_enabled", $service["service_flap_detection_enabled"] == 1 ? "1": "0");
+					if ($service["service_process_perf_data"] != 2) $strTMP .= print_line("process_perf_data", $service["service_process_perf_data"] == 1 ? "1": "0");
+					if ($service["service_retain_status_information"] != 2) $strTMP .= print_line("retain_status_information", $service["service_retain_status_information"] == 1 ? "1": "0");
+					if ($service["service_retain_nonstatus_information"] != 2) $strTMP .= print_line("retain_nonstatus_information", $service["service_retain_nonstatus_information"] == 1 ? "1": "0");
+					if ($service["service_notification_interval"] != NULL) $strTMP .= print_line("notification_interval", $service["service_notification_interval"]);
+					// Timeperiod name
+					$timePeriod = array();
+					$res2 =& $pearDB->query("SELECT tp.tp_name FROM timeperiod tp WHERE tp.tp_id = '".$service["timeperiod_tp_id2"]."' LIMIT 1");
+					while($res2->fetchInto($timePeriod))
+						$strTMP .= print_line("notification_period", $timePeriod["tp_name"]);
+					$res2->free();
+					unset($timePeriod);
+					//
+					if ($service["service_notification_options"]) $strTMP .= print_line("notification_options", $service["service_notification_options"]);
+					if ($service["service_notifications_enabled"] != 2) $strTMP .= print_line("notifications_enabled", $service["service_notifications_enabled"] == 1 ? "1": "0");
+					// Contact Group Relation
+					$contactGroup = array();
+					$strTMPTemp = NULL;
+					$res2 =& $pearDB->query("SELECT cg.cg_id, cg.cg_name FROM contactgroup_service_relation csr, contactgroup cg WHERE csr.service_service_id = '".$service["service_id"]."' AND csr.contactgroup_cg_id = cg.cg_id ORDER BY `cg_name`");
+					while($res2->fetchInto($contactGroup))	{
+						$BP = false;
+						if ($ret["level"]["level"] == 1)
+							array_key_exists($contactGroup["cg_id"], $gbArr[1]) ? $BP = true : NULL;
+						else if ($ret["level"]["level"] == 2)
+							array_key_exists($contactGroup["cg_id"], $gbArr[1]) ? $BP = true : NULL;
+						else if ($ret["level"]["level"] == 3)
+							$BP = true;
+						if ($BP)
+							$strTMPTemp != NULL ? $strTMPTemp .= ", ".$contactGroup["cg_name"] : $strTMPTemp = $contactGroup["cg_name"];
+					}
+					$res2->free();
+					if ($strTMPTemp) $strTMP .= print_line("contact_groups", $strTMPTemp);
+					unset($contactGroup);
+					//
+					if ($service["service_stalking_options"]) $strTMP .= print_line("stalking_options", $service["service_stalking_options"]);
+					if (!$service["service_register"]) $strTMP .= print_line("register", "0");
+					$strTMP .= "}\n\n";
+					$i++;
+					$str .= $strTMP;
+					unset($parent);
+					unset($strTMPTemp);					
+				}
+			}
+			else	{
+				#
+				## Can merge multiple Host or HostGroup Definition
+				#
+				$strTMP = NULL;
+				$parent = false;
+				$ret["comment"]["comment"] ? ($strTMP .= "# '" . $service["service_description"] . "' service definition " . $i . "\n") : NULL;
+				$ret["comment"]["comment"] ? ($strTMP .= "# ID_OREON:'" . $service["service_id"] . "'\n") : NULL;
+				if ($ret["comment"]["comment"] && $service["service_comment"])	{
+					$comment = array();
+					$comment = explode("\n", $service["service_comment"]);
+					foreach ($comment as $cmt)
+						$strTMP .= "# ".$cmt."\n";
+				}
+				$strTMP .= "define service{\n";
+				if ($service["service_register"])	{
+					//HostGroup Relation
+					$hostGroup = array();
+					$strTMPTemp = NULL;
+					$res2 =& $pearDB->query("SELECT hg.hg_id, hg.hg_name FROM host_service_relation hsr, hostgroup hg WHERE hsr.service_service_id ='".$service["service_id"]."' AND hsr.hostgroup_hg_id = hg.hg_id");
+					while($res2->fetchInto($hostGroup))	{
+						$BP = false;
+						if ($ret["level"]["level"] == 1)
+							array_key_exists($hostGroup["hg_id"], $gbArr[3]) ? $BP = true : NULL;
+						else if ($ret["level"]["level"] == 2)
+							array_key_exists($hostGroup["hg_id"], $gbArr[3]) ? $BP = true : NULL;
+						else if ($ret["level"]["level"] == 3)
+							$BP = true;
+						if ($BP)	{
+							$parent = true;
+							$strTMPTemp != NULL ? $strTMPTemp .= ", ".$hostGroup["hg_name"] : $strTMPTemp = $hostGroup["hg_name"];
+						}
+					}
+					$res2->free();
+					if ($strTMPTemp) $strTMP .= print_line("hostgroup_name", $strTMPTemp);
+					unset($hostGroup);
+					unset($strTMPTemp);
+					if (!$parent)	{
+						//Host Relation
+						$host = array();
+						$strTMPTemp = NULL;
+						$res2 =& $pearDB->query("SELECT host.host_id, host.host_name FROM host_service_relation hsr, host WHERE hsr.service_service_id ='".$service["service_id"]."' AND hsr.host_host_id = host.host_id");
+						while($res2->fetchInto($host))	{
+							$BP = false;
+							if ($ret["level"]["level"] == 1)
+								array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+							else if ($ret["level"]["level"] == 2)
+								array_key_exists($host["host_id"], $gbArr[2]) ? $BP = true : NULL;
+							else if ($ret["level"]["level"] == 3)
+								$BP = true;
+							if ($BP)	{
+								$parent = true;
+								$strTMPTemp != NULL ? $strTMPTemp .= ", ".$host["host_name"] : $strTMPTemp = $host["host_name"];
+							}
+						}
+						$res2->free();
+						if ($strTMPTemp) $strTMP .= print_line("host_name", $strTMPTemp);
+						unset($host);
+					}
+					unset($strTMPTemp);
+				//
+				}
+				if (!$service["service_register"] && $service["service_description"])	{
+					$strTMP .= print_line("name", $service["service_description"]);
+					$strTMP .= print_line("service_description", $service["service_description"]);
+				}
+				else if ($service["service_description"]) 
+					$strTMP .= print_line("service_description", $service["service_description"]);
+				//Template Model Relation
+				if ($service["service_template_model_stm_id"]) {
+					$serviceTemplate = array();
+					$res2 =& $pearDB->query("SELECT service.service_description FROM service WHERE service.service_id = '".$service["service_template_model_stm_id"]."'");
+					while($res2->fetchInto($serviceTemplate))
+						$strTMP .= print_line("use", $serviceTemplate["service_description"]);
+					$res2->free();
+					unset($serviceTemplate);		
+				}
+				// Nagios V2 : Servicegroups relation
+				if ($oreon->user->get_version() == 2)	{
+					$serviceGroup = array();
+					$strTMPTemp = NULL;
+					$res2 =& $pearDB->query("SELECT sg.sg_id, sg.sg_name FROM servicegroup_relation sgr, servicegroup sg WHERE sgr.service_service_id = '".$service["service_id"]."' AND sgr.servicegroup_sg_id = sg.sg_id ORDER BY `sg_name`");
+					while($res2->fetchInto($serviceGroup))	{
+						$BP = false;
+						if ($ret["level"]["level"] == 1)
+							array_key_exists($serviceGroup["sg_id"], $gbArr[5]) ? $BP = true : NULL;
+						else if ($ret["level"]["level"] == 2)
+							array_key_exists($serviceGroup["sg_id"], $gbArr[5]) ? $BP = true : NULL;
+						else if ($ret["level"]["level"] == 3)
+							$BP = true;
+						if ($BP)
+							$strTMPTemp != NULL ? $strTMPTemp .= ", ".$serviceGroup["sg_name"] : $strTMPTemp = $serviceGroup["sg_name"];
+					}
+					$res2->free();
+					if ($strTMPTemp) $strTMP .= print_line("servicegroups", $strTMPTemp);
+					unset($serviceGroup);
+					unset($strTMPTemp);
+				}
+				if ($service["service_is_volatile"] != 2) $strTMP .= print_line("is_volatile", $service["service_is_volatile"] == 1 ? "1": "0");
+				//Check Command
+				$command = NULL;
+				$command = getMyCheckCmdGraph($service["service_id"]);
+				if ($command)
+					$strTMP .= print_line("check_command", $command);
+				//
+				if ($service["service_max_check_attempts"] != NULL) $strTMP .= print_line("max_check_attempts", $service["service_max_check_attempts"]);
+				if ($service["service_normal_check_interval"] != NULL) $strTMP .= print_line("normal_check_interval", $service["service_normal_check_interval"]);
+				if ($service["service_retry_check_interval"] != NULL) $strTMP .= print_line("retry_check_interval", $service["service_retry_check_interval"]);
+				if ($service["service_active_checks_enabled"] != 2) $strTMP .= print_line("active_checks_enabled", $service["service_active_checks_enabled"] == 1 ? "1": "0");
+				if ($service["service_passive_checks_enabled"] != 2) $strTMP .= print_line("passive_checks_enabled", $service["service_passive_checks_enabled"] == 1 ? "1": "0");
+				//Check Period
+				$timePeriod = array();
+				$res2 =& $pearDB->query("SELECT tp.tp_name FROM timeperiod tp WHERE tp.tp_id = '".$service["timeperiod_tp_id"]."' LIMIT 1");
+				while($res2->fetchInto($timePeriod))
+					$strTMP .= print_line("check_period", $timePeriod["tp_name"]);
+				$res2->free();
+				unset($timePeriod);
+				//
+				if ($service["service_parallelize_check"] != 2) $strTMP .= print_line("parallelize_check", $service["service_parallelize_check"] == 1 ? "1": "0");
+				if ($service["service_obsess_over_service"] != 2) $strTMP .= print_line("obsess_over_service", $service["service_obsess_over_service"] == 1 ? "1": "0");
+				if ($service["service_check_freshness"] != 2) $strTMP .= print_line("check_freshness", $service["service_check_freshness"] == 1 ? "1": "0");
+				if ($service["service_freshness_threshold"] != NULL) $strTMP .= print_line("freshness_threshold", $service["service_freshness_threshold"]);
+				//Event_handler
+				$command = array();
+				$service["command_command_id_arg2"] = str_replace('#BR#', "\\n", $service["command_command_id_arg2"]);
+				$service["command_command_id_arg2"] = str_replace('#T#', "\\t", $service["command_command_id_arg2"]);
+				$service["command_command_id_arg2"] = str_replace('#R#', "\\r", $service["command_command_id_arg2"]);
+				$service["command_command_id_arg2"] = str_replace('#S#', "/", $service["command_command_id_arg2"]);
+				$service["command_command_id_arg2"] = str_replace('#BS#', "\\", $service["command_command_id_arg2"]);
+				$res2 =& $pearDB->query("SELECT cmd.command_name FROM command cmd WHERE cmd.command_id = '".$service["command_command_id2"]."' LIMIT 1");
+				while($res2->fetchInto($command))
+					$strTMP .= print_line("event_handler", strstr($command["command_name"], "check_graph_") ? $command["command_name"].$service["command_command_id_arg2"]."!".$service["service_id"] : $command["command_name"].$service["command_command_id_arg2"]);
+				$res2->free();
+				unset($command);
+				//
+				if ($service["service_event_handler_enabled"] != 2) $strTMP .= print_line("event_handler_enabled", $service["service_event_handler_enabled"] == 1 ? "1": "0");
+				if ($service["service_low_flap_threshold"] != NULL) $strTMP .= print_line("low_flap_threshold", $service["service_low_flap_threshold"]);
+				if ($service["service_high_flap_threshold"] != NULL) $strTMP .= print_line("high_flap_threshold", $service["service_high_flap_threshold"]);
+				if ($service["service_flap_detection_enabled"] != 2) $strTMP .= print_line("flap_detection_enabled", $service["service_flap_detection_enabled"] == 1 ? "1": "0");
+				if ($service["service_process_perf_data"] != 2) $strTMP .= print_line("process_perf_data", $service["service_process_perf_data"] == 1 ? "1": "0");
+				if ($service["service_retain_status_information"] != 2) $strTMP .= print_line("retain_status_information", $service["service_retain_status_information"] == 1 ? "1": "0");
+				if ($service["service_retain_nonstatus_information"] != 2) $strTMP .= print_line("retain_nonstatus_information", $service["service_retain_nonstatus_information"] == 1 ? "1": "0");
+				if ($service["service_notification_interval"] != NULL) $strTMP .= print_line("notification_interval", $service["service_notification_interval"]);
+				// Timeperiod name
+				$timePeriod = array();
+				$res2 =& $pearDB->query("SELECT tp.tp_name FROM timeperiod tp WHERE tp.tp_id = '".$service["timeperiod_tp_id2"]."' LIMIT 1");
+				while($res2->fetchInto($timePeriod))
+					$strTMP .= print_line("notification_period", $timePeriod["tp_name"]);
+				$res2->free();
+				unset($timePeriod);
+				//
+				if ($service["service_notification_options"]) $strTMP .= print_line("notification_options", $service["service_notification_options"]);
+				if ($service["service_notifications_enabled"] != 2) $strTMP .= print_line("notifications_enabled", $service["service_notifications_enabled"] == 1 ? "1": "0");
+				// Contact Group Relation
+				$contactGroup = array();
+				$strTMPTemp = NULL;
+				$res2 =& $pearDB->query("SELECT cg.cg_id, cg.cg_name FROM contactgroup_service_relation csr, contactgroup cg WHERE csr.service_service_id = '".$service["service_id"]."' AND csr.contactgroup_cg_id = cg.cg_id ORDER BY `cg_name`");
+				while($res2->fetchInto($contactGroup))	{
+					$BP = false;
+					if ($ret["level"]["level"] == 1)
+						array_key_exists($contactGroup["cg_id"], $gbArr[1]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 2)
+						array_key_exists($contactGroup["cg_id"], $gbArr[1]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)
+						$strTMPTemp != NULL ? $strTMPTemp .= ", ".$contactGroup["cg_name"] : $strTMPTemp = $contactGroup["cg_name"];
+				}
+				$res2->free();
+				if ($strTMPTemp) $strTMP .= print_line("contact_groups", $strTMPTemp);
+				unset($contactGroup);
+				//
+				if ($service["service_stalking_options"]) $strTMP .= print_line("stalking_options", $service["service_stalking_options"]);
+				if (!$service["service_register"]) $strTMP .= print_line("register", "0");
+				$strTMP .= "}\n\n";
+				if ($parent || !$service["service_register"])	{
+					$i++;
+					$str .= $strTMP;
+				}
+				unset($parent);
+				unset($strTMPTemp);
+			}
+		}
+	}
+	unset($service);
+	write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $nagiosCFGPath."services.cfg");
+	fclose($handle);
+	$res->free();
+	unset($str);
+	unset($i);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genTimeperiods.php b/www/include/configuration/configGenerate/genTimeperiods.php
new file mode 100644
index 0000000000000000000000000000000000000000..012e3d363ca1d6a10a1e39d058290fb65b284f0a
--- /dev/null
+++ b/www/include/configuration/configGenerate/genTimeperiods.php
@@ -0,0 +1,50 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	
+	if (!isset($oreon))
+		exit();
+
+	$handle = create_file($nagiosCFGPath."timeperiods.cfg", $oreon->user->get_name());
+	$res =& $pearDB->query("SELECT * FROM `timeperiod` ORDER BY `tp_name`");
+	$timePeriod = array();
+	$i = 1;
+	$str = NULL;
+	while($res->fetchInto($timePeriod))	{
+		$ret["comment"]["comment"] ? ($str .= "# '" . $timePeriod["tp_name"] . "' timeperiod definition " . $i . "\n") : NULL;
+		$str .= "define timeperiod{\n";
+		if ($timePeriod["tp_name"]) $str .= print_line("timeperiod_name", $timePeriod["tp_name"]);
+		if ($timePeriod["tp_alias"]) $str .= print_line("alias", $timePeriod["tp_alias"]);
+		if ($timePeriod["tp_sunday"]) $str .= print_line("sunday", $timePeriod["tp_sunday"]);
+		if ($timePeriod["tp_monday"]) $str .= print_line("monday", $timePeriod["tp_monday"]);
+		if ($timePeriod["tp_tuesday"]) $str .= print_line("tuesday", $timePeriod["tp_tuesday"]);
+		if ($timePeriod["tp_wednesday"]) $str .= print_line("wednesday", $timePeriod["tp_wednesday"]);
+		if ($timePeriod["tp_thursday"]) $str .= print_line("thursday", $timePeriod["tp_thursday"]);
+		if ($timePeriod["tp_friday"]) $str .= print_line("friday", $timePeriod["tp_friday"]);
+		if ($timePeriod["tp_saturday"]) $str .= print_line("saturday", $timePeriod["tp_saturday"]);
+		$str .= "}\n\n";
+		$i++;
+		unset($timePeriod);
+	}
+	write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $nagiosCFGPath."timeperiods.cfg");
+	fclose($handle);
+	$res->free();
+	unset($str);
+	unset($i);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/genTraps.php b/www/include/configuration/configGenerate/genTraps.php
new file mode 100644
index 0000000000000000000000000000000000000000..b04e5752888c0a5d2276aa6d85b1f15d86041bb2
--- /dev/null
+++ b/www/include/configuration/configGenerate/genTraps.php
@@ -0,0 +1,43 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	
+	if (!isset($oreon))
+		exit();
+
+	$i = 0;
+	$res =& $pearDB->query('SELECT snmp_trapd_path_conf FROM `general_opt` LIMIT 1');
+	if ($res->numRows())	{
+		$trap_conf = $res->fetchRow();
+		$handle = create_file($trap_conf["snmp_trapd_path_conf"], $oreon->user->get_name());	
+		$res1 =& $pearDB->query('SELECT * FROM `traps` ORDER BY `traps_name`');
+		$str = "\n";
+		while($res1->fetchInto($trap))	{
+			$trap["traps_comments"] ? $str .= "# ".$trap["traps_comments"]."\n" : NULL;
+			$str .= "traphandle ".$trap["traps_oid"]." ".$trap["traps_handler"]." ".$trap["traps_id"]." ".$trap["traps_args"];
+			$str .= "\n";
+			$i++;
+		}
+		write_in_file($handle, html_entity_decode($str, ENT_QUOTES), $trap_conf);
+		fclose($handle);
+		unset($str);
+		$res1->free();
+	}
+	$res->free();
+?>
diff --git a/www/include/configuration/configGenerate/genXMLList.php b/www/include/configuration/configGenerate/genXMLList.php
new file mode 100644
index 0000000000000000000000000000000000000000..71d83bc172fc382adca3134c210a644265a7276f
--- /dev/null
+++ b/www/include/configuration/configGenerate/genXMLList.php
@@ -0,0 +1,487 @@
+<?php
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Drill Down Map � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	
+	if (!isset($oreon))
+		exit();
+	
+	unlink($XMLConfigPath."osm_list.xml");
+	$handle = create_file($XMLConfigPath."osm_list.xml", $oreon->user->get_name(), false);
+	$str = NULL;
+	$str = "<osm_list>\n";
+	$str .= "<elements>\n";
+	
+	#
+	##	Listing
+	#
+	
+	# Host List
+	foreach($gbArr[2] as $key => $value)	{
+		$res =& $pearDB->query("SELECT host_name, host_template_model_htm_id, host_address, host_register, ehi.city_id FROM host, extended_host_information ehi WHERE host_id = '".$key."' AND ehi.host_host_id = host_id LIMIT 1");
+		$host = $res->fetchRow();
+		if ($host["host_register"])	{
+			if (!$host["host_name"])
+				$host["host_name"] = getMyHostName($host['host_template_model_htm_id']);
+			if (!$host["host_address"])
+				$host["host_address"] = getMyHostAddress($host['host_template_model_htm_id']);
+			$str .= "<h id='".$key."' name='".html_entity_decode($host["host_name"], ENT_QUOTES)."' address='".$host["host_address"]."'";
+			if ($host["city_id"])	{
+				$res2 =& $pearDB->query("SELECT city_lat, city_long FROM view_city WHERE city_id = '".$host["city_id"]."' LIMIT 1");
+				$gps =& $res2->fetchRow();
+				if ($gps["city_lat"] && $gps["city_long"])
+					$str .= " gps='true' lat='".$gps["city_lat"]."' long='".$gps["city_long"]."'";
+				else
+					$str .= " gps='false'";
+				$res2->free();
+			}
+			else
+				$str .= " gps='false'";
+			$str .= "/>\n";
+		}
+		else
+			unset($gbArr[2][$key]);
+	}
+	# Host Group List
+	foreach($gbArr[3] as $key => $value)	{		
+		$res =& $pearDB->query("SELECT * FROM hostgroup WHERE hg_id = '".$key."'");
+		$hostGroup = $res->fetchRow();
+		$str .= "<hg id='".$key."' name='".html_entity_decode($hostGroup["hg_name"], ENT_QUOTES)."'";
+		if ($hostGroup["city_id"])	{
+			$res2 =& $pearDB->query("SELECT city_lat, city_long FROM view_city WHERE city_id = '".$hostGroup["city_id"]."' LIMIT 1");
+			$gps =& $res2->fetchRow();
+			if ($gps["city_lat"] && $gps["city_long"])
+				$str .= " gps='true' lat='".$gps["city_lat"]."' long='".$gps["city_long"]."'";
+			else
+				$str .= " gps='false'";
+			$res2->free();
+		}
+		else
+			$str .= " gps='false'";		
+		$str .= "/>\n";
+	}
+	# Services List
+	foreach($gbArr[4] as $key => $value)	{		
+		$res =& $pearDB->query("SELECT DISTINCT sv.service_description, sv.service_template_model_stm_id, service_register, hsr.host_host_id, hsr.hostgroup_hg_id FROM service sv, host_service_relation hsr WHERE sv.service_id = '".$key."' AND hsr.service_service_id = sv.service_id");
+		while ($res->fetchInto($sv))	{
+			if ($sv["service_register"])	{
+				if (!$sv["service_description"])
+					$sv["service_description"] = getMyServiceName($sv['service_template_model_stm_id']);
+				if ($sv["host_host_id"])
+					$str .= "<sv id='".$sv["host_host_id"]."_".$key."' name='".$sv["service_description"]."'/>\n";
+				else if ($sv["hostgroup_hg_id"])	{
+					$res2 =& $pearDB->query("SELECT DISTINCT host_host_id FROM hostgroup_relation WHERE hostgroup_hg_id = '".$sv["hostgroup_hg_id"]."'");
+					while ($res2->fetchInto($host))
+						if (array_key_exists($host["host_host_id"], $gbArr[2]))
+							$str .= "<sv id='".$host["host_host_id"]."_".$key."' name='".$sv["service_description"]."'/>\n";
+				}
+			}
+			else
+				unset($gbArr[4][$key]);
+		}
+	}
+	# Service Group List
+	foreach($gbArr[5] as $key => $value)	{		
+		$res =& $pearDB->query("SELECT * FROM servicegroup WHERE sg_id = '".$key."'");
+		$serviceGroup = $res->fetchRow();
+		$str .= "<sg id='".$key."' name='".html_entity_decode($serviceGroup["sg_name"], ENT_QUOTES)."'";
+		if ($serviceGroup["city_id"])	{
+			$res2 =& $pearDB->query("SELECT city_lat, city_long FROM view_city WHERE city_id = '".$serviceGroup["city_id"]."' LIMIT 1");
+			$gps =& $res2->fetchRow();
+			if ($gps["city_lat"] && $gps["city_long"])
+				$str .= " gps='true' lat='".$gps["city_lat"]."' long='".$gps["city_long"]."'";
+			else
+				$str .= " gps='false'";
+			$res2->free();
+		}
+		else
+			$str .= " gps='false'";	
+		$str .= "/>\n";
+	}
+	# OSL
+	foreach($gbArr[6] as $key => $value)	{		
+		$res =& $pearDB->query("SELECT name FROM osl WHERE osl_id = '".$key."'");
+		$osl = $res->fetchRow();
+		$str .= "<osl id='".$key."' name='".html_entity_decode($osl["name"], ENT_QUOTES)."'/>\n";
+	}	
+	# Meta Service
+	foreach($gbArr[7] as $key => $value)	{		
+		$res =& $pearDB->query("SELECT meta_name FROM meta_service WHERE meta_id = '".$key."'");
+		$osm = $res->fetchRow();
+		$str .= "<ms id='".$key."' name='".html_entity_decode($osm["meta_name"], ENT_QUOTES)."'/>\n";
+	}
+	$str .= "</elements>\n";
+	
+	#
+	##	Dependencies
+	#
+	$str .= "<dependencies>\n";
+	
+	#	Host
+	foreach($gbArr[2] as $key => $value)	{
+		$res =& $pearDB->query("SELECT host_template_model_htm_id AS tpl, host_register FROM host WHERE host_id = '".$key."'");
+		$host = $res->fetchRow();
+		$str .= "<h id='".$key."'>\n";
+		## Parents
+		$str .= "<prts>\n";
+		# Host Groups
+		$res =& $pearDB->query("SELECT hgr.hostgroup_hg_id FROM hostgroup_relation hgr WHERE hgr.host_host_id = '".$key."'");
+		while($res->fetchInto($hostGroup))	{
+			$BP = false;
+			if ($ret["level"]["level"] == 1)
+				array_key_exists($hostGroup["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 2)
+				array_key_exists($hostGroup["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 3)
+				$BP = true;
+			if ($BP)
+				$str .="<hg id='".$hostGroup["hostgroup_hg_id"]."'/>\n";
+		}
+		# Hosts
+		$res =& $pearDB->query("SELECT hpr.host_parent_hp_id FROM host_hostparent_relation hpr WHERE hpr.host_host_id = '".$key."'");
+		//if (!$res->numRows() && $host["tpl"])
+		//	$res =& getMyHostParents($host["tpl"]);
+		while($res->fetchInto($host))	{
+			$BP = false;
+			if ($ret["level"]["level"] == 1)
+				array_key_exists($host["host_parent_hp_id"], $gbArr[2]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 2)
+				array_key_exists($host["host_parent_hp_id"], $gbArr[2]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 3)
+				$BP = true;
+			if ($BP)
+				$str .= "<h id='".$host["host_parent_hp_id"]."'/>\n";
+		}
+		$str .= "</prts>\n";
+		## Childs
+		$str .= "<chds>\n";
+		# Hosts
+		$res =& $pearDB->query("SELECT host_host_id FROM host_hostparent_relation WHERE host_parent_hp_id = '".$key."'");
+		while($res->fetchInto($host))	{
+			$BP = false;
+			if ($ret["level"]["level"] == 1)
+				array_key_exists($host["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 2)
+				array_key_exists($host["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 3)
+				$BP = true;
+			if ($BP)
+				$str .= "<h id='".$host["host_host_id"]."'/>\n";
+		}
+		# Services from Host
+		$res =& $pearDB->query("SELECT hsr.service_service_id FROM host_service_relation hsr WHERE hsr.host_host_id = '".$key."'");
+		while($res->fetchInto($service))	{
+			$BP = false;
+			if ($ret["level"]["level"] == 1)
+				array_key_exists($service["service_service_id"], $gbArr[4]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 2)
+				array_key_exists($service["service_service_id"], $gbArr[4]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 3)
+				$BP = true;
+			if ($BP)
+				$str .= "<sv id='".$key."_".$service["service_service_id"]."'/>\n";
+		}
+		# Services from Host Group
+		$res =& $pearDB->query("SELECT hgr.hostgroup_hg_id FROM hostgroup_relation hgr WHERE hgr.host_host_id = '".$key."'");
+		while($res->fetchInto($hostGroup))	{
+			$BP = false;
+			if ($ret["level"]["level"] == 1)
+				array_key_exists($hostGroup["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 2)
+				array_key_exists($hostGroup["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 3)
+				$BP = true;
+			if ($BP)	{
+				$res2 =& $pearDB->query("SELECT hsr.service_service_id FROM host_service_relation hsr WHERE hsr.hostgroup_hg_id = '".$hostGroup["hostgroup_hg_id"]."'");
+				while($res2->fetchInto($service))	{
+					$BP = false;
+					if ($ret["level"]["level"] == 1)
+						array_key_exists($service["service_service_id"], $gbArr[4]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 2)
+						array_key_exists($service["service_service_id"], $gbArr[4]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)
+						$str .= "<sv id='".$key."_".$service["service_service_id"]."'/>\n";
+				}			
+			}
+		}		
+		$str .= "</chds>\n";
+		$str .= "</h>\n";
+	}
+	# HostGroup
+	foreach($gbArr[3] as $key => $value)	{
+		$str .= "<hg id='".$key."'>\n";
+		## Parents
+		$str .= "<prts>\n";
+		$str .= "</prts>\n";
+		
+		## Childs
+		$str .= "<chds>\n";		
+		$res =& $pearDB->query("SELECT hgr.host_host_id FROM hostgroup_relation hgr WHERE hgr.hostgroup_hg_id = '".$key."'");
+		while($res->fetchInto($host))	{
+			$BP = false;
+			if ($ret["level"]["level"] == 1)
+				array_key_exists($host["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 2)
+				array_key_exists($host["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 3)
+				$BP = true;
+			if ($BP)
+				$str .= "<h id='".$host["host_host_id"]."'/>\n";
+		}
+		$str .= "</chds>\n";
+		$str .= "</hg>\n";
+	}
+	# Service
+	foreach($gbArr[4] as $key => $value)	{
+		$res =& $pearDB->query("SELECT hsr.host_host_id, hsr.hostgroup_hg_id FROM host_service_relation hsr WHERE hsr.service_service_id = '".$key."'");
+		while ($res->fetchInto($sv))	{
+			if ($sv["host_host_id"])	{
+				$str .= "<sv id='".$sv["host_host_id"]."_".$key."'>\n";								
+				## Parents
+				$str .= "<prts>\n";
+				$str .= "<h id='".$sv["host_host_id"]."'/>\n";
+				$str .= "</prts>\n";						
+				## Childs
+				$str .= "<chds>\n";
+				$str .= "</chds>\n";
+				$str .= "</sv>\n";
+			}
+			else if ($sv["hostgroup_hg_id"])	{
+				$res2 =& $pearDB->query("SELECT DISTINCT host_host_id FROM hostgroup_relation WHERE hostgroup_hg_id = '".$sv["hostgroup_hg_id"]."'");
+				while ($res2->fetchInto($host))
+					if (array_key_exists($host["host_host_id"], $gbArr[2]))	{
+						$str .= "<sv id='".$host["host_host_id"]."_".$key."'>\n";				
+						## Parents
+						$str .= "<prts>\n";
+						$str .= "<h id='".$host["host_host_id"]."'/>\n";
+						$str .= "</prts>\n";						
+						## Childs
+						$str .= "<chds>\n";
+						$str .= "</chds>\n";
+						$str .= "</sv>\n";
+					}
+			}			
+		}
+	}
+	# ServiceGroup
+	foreach($gbArr[5] as $key => $value)	{
+		$str .= "<sg id='".$key."'>\n";
+		## Parents
+		$str .= "<prts>\n";
+		$str .= "</prts>\n";
+		
+		## Childs
+		$str .= "<chds>\n";
+		$res =& $pearDB->query("SELECT sgr.service_service_id FROM servicegroup_relation sgr WHERE sgr.servicegroup_sg_id = '".$key."'");
+		while($res->fetchInto($service))	{
+			$BP = false;
+			if ($ret["level"]["level"] == 1)
+				array_key_exists($service["service_service_id"], $gbArr[4]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 2)
+				array_key_exists($service["service_service_id"], $gbArr[4]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 3)
+				$BP = true;
+			if ($BP)	{
+				$res2 =& $pearDB->query("SELECT hsr.host_host_id, hsr.hostgroup_hg_id FROM host_service_relation hsr WHERE hsr.service_service_id = '".$service["service_service_id"]."'");
+				while($res2->fetchInto($service2))	{
+					$BP = false;
+					if ($ret["level"]["level"] == 1)	{
+						array_key_exists($service2["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+						array_key_exists($service2["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+					}
+					else if ($ret["level"]["level"] == 2)	{
+						array_key_exists($service2["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+						array_key_exists($service2["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+					}
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)	{
+						if ($service2["hostgroup_hg_id"])	{
+							$res3 =& $pearDB->query("SELECT hgr.host_host_id FROM hostgroup_relation hgr WHERE hgr.hostgroup_hg_id = '".$service2["hostgroup_hg_id"]."'");
+							while($res3->fetchInto($service3))	{
+								$BP = false;
+								if ($ret["level"]["level"] == 1)
+									array_key_exists($service3["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+								else if ($ret["level"]["level"] == 2)
+									array_key_exists($service3["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+								else if ($ret["level"]["level"] == 3)
+									$BP = true;
+								if ($BP)
+									$str .= "<sv id='".$service3["host_host_id"]."_".$service["service_service_id"]."'/>\n";
+							}	
+							unset($service3);						
+						}
+						else
+							$str .= "<sv id='".$service2["host_host_id"]."_".$service["service_service_id"]."'/>\n";
+					}
+				}
+				$res2->free();
+			}
+		}
+		$res->free();
+		$str .= "</chds>\n";
+		$str .= "</sg>\n";
+	}
+	# OSL
+	foreach($gbArr[6] as $key => $value)	{
+		$str .= "<osl id='".$key."'>\n";
+		## Parents
+		$str .= "<prts>\n";
+		$res =& $pearDB->query("SELECT id_osl FROM osl_indicator WHERE id_indicator_osl = '".$key."'");
+		while($res->fetchInto($osl))
+			$str .= "<osl id='".$osl["id_osl"]."'/>";
+		$res->free();
+		$str .= "</prts>\n";
+		
+		## Childs
+		$str .= "<chds>\n";
+		$res =& $pearDB->query("SELECT host_id, service_id, id_indicator_osl, meta_id FROM osl_indicator WHERE id_osl = '".$key."' AND activate = '1'");
+		while($res->fetchInto($osl))	{
+			if ($osl["host_id"] && $osl["service_id"])	{
+				$BP = false;
+				if ($ret["level"]["level"] == 1)
+					array_key_exists($osl["host_id"], $gbArr[2]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 2)
+					array_key_exists($osl["host_id"], $gbArr[2]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 3)
+					$BP = true;
+				if ($BP)
+					$str .= "<sv id='".$osl["host_id"]."_".$osl["service_id"]."'/>";
+			}
+			else if ($osl["id_indicator_osl"])	{
+				$BP = false;
+				if ($ret["level"]["level"] == 1)
+					array_key_exists($osl["id_indicator_osl"], $gbArr[6]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 2)
+					array_key_exists($osl["id_indicator_osl"], $gbArr[6]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 3)
+					$BP = true;
+				if ($BP)
+					$str .= "<osl id='".$osl["id_indicator_osl"]."'/>";
+			}
+			else if ($osl["meta_id"])
+				$str .= "<oms id='".$osl["meta_id"]."'/>";
+		}
+		$res->free();
+		$str .= "</chds>\n";		
+		$str .= "</osl>\n";
+	}
+	# Meta Service
+	foreach($gbArr[7] as $key => $value)	{
+		$str .= "<ms id='".$key."'>\n";
+		## Parents
+		$str .= "<prts>\n";
+		$str .= "</prts>\n";
+		
+		## Childs
+		$str .= "<chds>\n";
+		$res =& $pearDB->query("SELECT meta_select_mode, regexp_str FROM meta_service WHERE meta_id = '".$key."'");
+		$meta =& $res->fetchrow();
+		$res->free();
+		# Regexp mode
+		if ($meta["meta_select_mode"] == 2)	{
+			$res =& $pearDB->query("SELECT service_id FROM service WHERE service_description LIKE '".$meta["regexp_str"]."'");
+			while($res->fetchInto($service))	{
+				$BP = false;
+				if ($ret["level"]["level"] == 1)
+					array_key_exists($service["service_id"], $gbArr[4]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 2)
+					array_key_exists($service["service_id"], $gbArr[4]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 3)
+					$BP = true;
+				if ($BP)	{
+					$res2 =& $pearDB->query("SELECT hsr.host_host_id, hsr.hostgroup_hg_id FROM host_service_relation hsr WHERE hsr.service_service_id = '".$service["service_id"]."'");
+					while($res2->fetchInto($service2))	{
+						$BP = false;
+						if ($ret["level"]["level"] == 1)	{
+							array_key_exists($service2["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+							array_key_exists($service2["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+						}
+						else if ($ret["level"]["level"] == 2)	{
+							array_key_exists($service2["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+							array_key_exists($service2["hostgroup_hg_id"], $gbArr[3]) ? $BP = true : NULL;
+						}
+						else if ($ret["level"]["level"] == 3)
+							$BP = true;
+						if ($BP)	{
+							if ($service2["hostgroup_hg_id"])	{
+								$res3 =& $pearDB->query("SELECT hgr.host_host_id FROM hostgroup_relation hgr WHERE hgr.hostgroup_hg_id = '".$service2["hostgroup_hg_id"]."'");
+								while($res3->fetchInto($service3))	{
+									$BP = false;
+									if ($ret["level"]["level"] == 1)
+										array_key_exists($service3["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+									else if ($ret["level"]["level"] == 2)
+										array_key_exists($service3["host_host_id"], $gbArr[2]) ? $BP = true : NULL;
+									else if ($ret["level"]["level"] == 3)
+										$BP = true;
+									if ($BP)
+										$str .= "<sv id='".$service3["host_host_id"]."_".$service["service_id"]."'/>\n";
+								}	
+								unset($service3);						
+							}
+							else
+								$str .= "<sv id='".$service2["host_host_id"]."_".$service["service_id"]."'/>\n";
+						}
+					}
+					$res2->free();
+				}
+			}
+			$res->free();
+		}
+		else if ($meta["meta_select_mode"] == 1)	{
+			require_once("./DBPerfparseConnect.php");
+			$res =& $pearDB->query("SELECT meta_id, host_id, metric_id FROM meta_service_relation msr WHERE meta_id = '".$key."' AND activate = '1'");
+			while($res->fetchInto($metric))	{
+				$BP = false;
+				if ($ret["level"]["level"] == 1)
+					array_key_exists($metric["host_id"], $gbArr[2]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 2)
+					array_key_exists($metric["host_id"], $gbArr[2]) ? $BP = true : NULL;
+				else if ($ret["level"]["level"] == 3)
+					$BP = true;
+				if ($BP)	{
+					$res2 =& $pearDBpp->query("SELECT service_description FROM perfdata_service_metric WHERE metric_id = '".$metric["metric_id"]."'");
+					$ppService =& $res2->fetchRow();
+					$sv_id =& getMyServiceID($ppService["service_description"], $metric["host_id"]);
+					$BP = false;
+					if ($ret["level"]["level"] == 1)
+						array_key_exists($sv_id, $gbArr[4]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 2)
+						array_key_exists($sv_id, $gbArr[4]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)
+						$str .= "<sv id='".$metric["host_id"]."_".$sv_id."'/>\n";
+				}
+			}
+			$res->free();
+		}
+		$str .= "</chds>\n";		
+		$str .= "</ms>\n";
+	}
+	
+	$str .= "</dependencies>\n";
+	$str .= "</osm_list>";
+	write_in_file($handle, $str, $XMLConfigPath."osm_list.xml");
+	fclose($handle);
+	$res->free();
+	unset($str);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/generateFiles.php b/www/include/configuration/configGenerate/generateFiles.php
new file mode 100644
index 0000000000000000000000000000000000000000..d1a49d9bd144046525628fa54ba6860873b2fc97
--- /dev/null
+++ b/www/include/configuration/configGenerate/generateFiles.php
@@ -0,0 +1,41 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the option dir
+	$path = "./include/configuration/configGenerate/";
+	$nagiosCFGPath = "../filesGeneration/nagiosCFG/";
+	$XMLConfigPath = "../filesGeneration/osm/";
+	$DebugPath = "filesGeneration/nagiosCFG/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		default : require_once($path."formGenerateFiles.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/metaService/meta_commands.php b/www/include/configuration/configGenerate/metaService/meta_commands.php
new file mode 100644
index 0000000000000000000000000000000000000000..47966216501dec51ffdf43bc1f214d3df411413f
--- /dev/null
+++ b/www/include/configuration/configGenerate/metaService/meta_commands.php
@@ -0,0 +1,40 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Meta Service � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$str = NULL;
+	$handle = create_file($nagiosCFGPath."meta_commands.cfg", $oreon->user->get_name());
+	
+	$str = "define command{\n";
+	$str .= print_line("command_name", "check_meta");
+	$str .= print_line("command_line", $oreon->optGen["nagios_path_plugins"]."check_meta_service.pl -i \$ARG1\$");
+	$str .= "}\n\n";
+	
+	$str .= "define command{\n";
+	$str .= print_line("command_name", "meta_notify");
+	$cmd = "/usr/bin/printf \"%b\" \"***** Meta Service Oreon *****\\n\\nNotification Type: \$NOTIFICATIONTYPE\$\\n\\nService: \$SERVICEDESC\$\\nState: \$SERVICESTATE\$\\n\\nDate/Time: \$DATETIME\$\\n\\nAdditional Info:\\n\\n\$OUTPUT\$\" | \/bin\/mail -s \"** \$NOTIFICATIONTYPE\$ \$SERVICEDESC\$ is \$SERVICESTATE\$ **\" \$CONTACTEMAIL\$";
+	$str .= print_line("command_line", $cmd);
+	$str .= "}\n\n";
+	
+	write_in_file($handle, $str, $nagiosCFGPath."meta_commands.cfg");
+	
+	fclose($handle);	
+	unset($res);
+	unset($str);	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/metaService/meta_contact.php b/www/include/configuration/configGenerate/metaService/meta_contact.php
new file mode 100644
index 0000000000000000000000000000000000000000..6538b3fb5574917cf5273bf90875271790a21164
--- /dev/null
+++ b/www/include/configuration/configGenerate/metaService/meta_contact.php
@@ -0,0 +1,43 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Meta Service � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	$str = NULL;
+	$handle = create_file($nagiosCFGPath."meta_contact.cfg", $oreon->user->get_name());
+	$str .= "define contact{\n";
+	$str .= print_line("contact_name", "meta_contact");
+	$str .= print_line("alias", "meta_contact");
+	# Nagios 2 : Contact Groups in Contact
+	if ($oreon->user->get_version() == 2)
+		$str .= print_line("contactgroups", "meta_contactgroup");
+	$str .= print_line("host_notification_period", "meta_timeperiod");
+	$str .= print_line("service_notification_period", "meta_timeperiod");
+	$str .= print_line("host_notification_options", "n");
+	$str .= print_line("service_notification_options", "n");
+	# Host & Service notification command
+	$str .= print_line("host_notification_commands", "meta_notify");
+	$str .= print_line("service_notification_commands", "meta_notify");
+	# Misc
+	$str .= print_line("email", "meta_contact_email");
+	$str .= "}\n\n";
+	write_in_file($handle, $str, $nagiosCFGPath."meta_contact.cfg");
+	fclose($handle);
+	unset($str);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/metaService/meta_contactgroup.php b/www/include/configuration/configGenerate/metaService/meta_contactgroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..4faf8a37417286c66ea17a17815abac042e61eae
--- /dev/null
+++ b/www/include/configuration/configGenerate/metaService/meta_contactgroup.php
@@ -0,0 +1,31 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Meta Service � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$handle = create_file($nagiosCFGPath."meta_contactgroup.cfg", $oreon->user->get_name());
+	$str = NULL;
+	$str .= "define contactgroup{\n";
+	$str .= print_line("contactgroup_name", "meta_contactgroup");
+	$str .= print_line("alias", "meta_contactgroup");
+	$str .= print_line("members", "meta_contact");
+	$str .= "}\n\n";
+	write_in_file($handle, $str, $nagiosCFGPath."meta_contactgroup.cfg");
+	fclose($handle);
+	unset($str);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/metaService/meta_dependencies.php b/www/include/configuration/configGenerate/metaService/meta_dependencies.php
new file mode 100644
index 0000000000000000000000000000000000000000..0946211ec00bfdc21dee9235cd9989de76b49ffa
--- /dev/null
+++ b/www/include/configuration/configGenerate/metaService/meta_dependencies.php
@@ -0,0 +1,84 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Meta Service � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	$str = NULL;
+	$i = 1;
+	$handle = create_file($nagiosCFGPath."meta_dependencies.cfg", $oreon->user->get_name());
+
+	$rq = "SELECT * FROM dependency dep WHERE (SELECT DISTINCT COUNT(*) FROM dependency_metaserviceParent_relation dmspr WHERE dmspr.dependency_dep_id = dep.dep_id) > 0 AND (SELECT DISTINCT COUNT(*) FROM dependency_metaserviceChild_relation dmscr WHERE dmscr.dependency_dep_id = dep.dep_id) > 0";
+	$res =& $pearDB->query($rq);
+	$dependency = array();
+	$i = 1;
+	$str = NULL;
+	while($res->fetchInto($dependency))	{
+		$BP = false;
+		$res2 =& $pearDB->query("SELECT meta_service_meta_id FROM dependency_metaserviceParent_relation WHERE dependency_dep_id = '".$dependency["dep_id"]."'");
+		$metaPar = NULL;
+		while ($res2->fetchInto($metaPar))	{
+			$BP = false;
+			if ($ret["level"]["level"] == 1)
+				array_key_exists($metaPar["meta_service_meta_id"], $gbArr[7]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 2)
+				array_key_exists($metaPar["meta_service_meta_id"], $gbArr[7]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 3)
+				$BP = true;
+			if ($BP)	{
+				$res3 =& $pearDB->query("SELECT meta_service_meta_id FROM dependency_metaserviceChild_relation WHERE dependency_dep_id = '".$dependency["dep_id"]."'");
+				$metaCh = NULL;
+				while ($res3->fetchInto($metaCh))	{					
+					$BP = false;
+					if ($ret["level"]["level"] == 1)
+						array_key_exists($metaCh["meta_service_meta_id"], $gbArr[7]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 2)
+						array_key_exists($metaCh["meta_service_meta_id"], $gbArr[7]) ? $BP = true : NULL;
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)	{
+						$ret["comment"]["comment"] ? ($str .= "# '".$dependency["dep_name"]."' host dependency definition ".$i."\n") : NULL;
+						if ($ret["comment"]["comment"] && $dependency["dep_comment"])	{
+							$comment = array();
+							$comment = explode("\n", $dependency["dep_comment"]);
+							foreach ($comment as $cmt)
+								$str .= "# ".$cmt."\n";
+						}
+						$str .= "define servicedependency{\n";
+						$str .= print_line("dependent_host_name", "Meta_Module");
+						$str .= print_line("dependent_service_description", "meta_".$metaCh["meta_service_meta_id"]);
+						$str .= print_line("host_name", "Meta_Module");
+						$str .= print_line("service_description", "meta_".$metaPar["meta_service_meta_id"]);
+						if ($oreon->user->get_version() == 2)
+							if (isset($dependency["inherits_parent"]["inherits_parent"]) && $dependency["inherits_parent"]["inherits_parent"] != NULL) $str .= print_line("inherits_parent", $dependency["inherits_parent"]["inherits_parent"]);
+						if (isset($dependency["execution_failure_criteria"]) && $dependency["execution_failure_criteria"] != NULL) $str .= print_line("execution_failure_criteria", $dependency["execution_failure_criteria"]);
+						if (isset($dependency["notification_failure_criteria"]) && $dependency["notification_failure_criteria"] != NULL) $str .= print_line("notification_failure_criteria", $dependency["notification_failure_criteria"]);
+						$str .= "}\n\n";
+						$i++;
+					}
+				}
+				$res3->free();
+			}
+		}
+	}
+	unset($dependency);
+	$res->free();
+	write_in_file($handle, $str, $nagiosCFGPath."meta_dependencies.cfg");
+	fclose($handle);
+	unset($str);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/metaService/meta_escalations.php b/www/include/configuration/configGenerate/metaService/meta_escalations.php
new file mode 100644
index 0000000000000000000000000000000000000000..df9b13a98f1f549d5e5540a376ba4735a952922b
--- /dev/null
+++ b/www/include/configuration/configGenerate/metaService/meta_escalations.php
@@ -0,0 +1,88 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Meta Service � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	$str = NULL;
+	$i = 1;
+	$handle = create_file($nagiosCFGPath."meta_escalations.cfg", $oreon->user->get_name());
+
+	$res =& $pearDB->query("SELECT DISTINCT meta_service_meta_id FROM escalation_meta_service_relation");
+	while($res->fetchInto($service))	{
+		$BP = false;
+		if ($ret["level"]["level"] == 1)
+			array_key_exists($service["meta_service_meta_id"], $gbArr[7]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 2)
+			array_key_exists($service["meta_service_meta_id"], $gbArr[7]) ? $BP = true : NULL;
+		else if ($ret["level"]["level"] == 3)
+			$BP = true;
+		if ($BP)	{
+			$res2 =& $pearDB->query("SELECT esc.* FROM escalation esc, escalation_meta_service_relation emsr WHERE emsr.meta_service_meta_id = '".$service["meta_service_meta_id"]."' AND esc.esc_id = emsr.escalation_esc_id ORDER BY esc.esc_name");
+			$escalation = array();
+			while($res2->fetchInto($escalation))	{
+				$ret["comment"]["comment"] ? ($str .= "# '".$escalation["esc_name"]."' service escalation definition ".$i."\n") : NULL;
+				if ($ret["comment"]["comment"] && $escalation["esc_comment"])	{
+					$comment = array();
+					$comment = explode("\n", $escalation["esc_comment"]);
+					foreach ($comment as $cmt)
+						$str .= "# ".$cmt."\n";
+				}
+				$str .= "define serviceescalation{\n";
+				$str .= print_line("host_name", "Meta_Module");
+				$str .= print_line("service_description", "meta_".$service["meta_service_meta_id"]);
+				$cg = array();
+				$strTemp = NULL;
+				$res3 =& $pearDB->query("SELECT DISTINCT cg.cg_id, cg.cg_name FROM escalation_contactgroup_relation ecgr, contactgroup cg WHERE ecgr.escalation_esc_id = '".$escalation["esc_id"]."' AND ecgr.contactgroup_cg_id = cg.cg_id ORDER BY cg.cg_name");
+				while($res3->fetchInto($cg))	{
+					$BP = false;				
+					if ($ret["level"]["level"] == 1)
+						array_key_exists($cg["cg_id"], $gbArr[1]) ? $BP = true : $BP = false;
+					else if ($ret["level"]["level"] == 2)
+						array_key_exists($cg["cg_id"], $gbArr[1]) ? $BP = true : $BP = false;
+					else if ($ret["level"]["level"] == 3)
+						$BP = true;
+					if ($BP)
+						$strTemp != NULL ? $strTemp .= ", ".$cg["cg_name"] : $strTemp = $cg["cg_name"];
+				}
+				$res3->free();
+				if ($strTemp) $str .= print_line("contact_groups", $strTemp);			
+				if ($escalation["first_notification"] != NULL) $str .= print_line("first_notification", $escalation["first_notification"]);
+				if ($escalation["last_notification"] != NULL) $str .= print_line("last_notification", $escalation["last_notification"]);
+				if ($escalation["notification_interval"] != NULL) $str .= print_line("notification_interval", $escalation["notification_interval"]);
+				// Nagios 2
+				if ($oreon->user->get_version() == 2)	{
+					$res4 =& $pearDB->query("SELECT tp_name FROM timeperiod WHERE tp_id = '".$escalation["escalation_period"]."'");
+					$tp =& $res4->fetchRow();
+					$res4->free();		
+					if ($tp["tp_name"]) $str .= print_line("escalation_period", $tp["tp_name"]);
+					if ($escalation["escalation_options2"]) $str .= print_line("escalation_options", $escalation["escalation_options2"]);
+				}
+				$str .= "}\n\n";
+				$i++;
+				}
+			unset($escalation);
+			$res2->free();
+		}
+	}
+	unset($service);
+	$res->free();
+	write_in_file($handle, $str, $nagiosCFGPath."meta_escalations.cfg");
+	fclose($handle);
+	unset($str);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/metaService/meta_host.php b/www/include/configuration/configGenerate/metaService/meta_host.php
new file mode 100644
index 0000000000000000000000000000000000000000..989135c9852b40d6c8e0c5a8309d7ceb47dff26f
--- /dev/null
+++ b/www/include/configuration/configGenerate/metaService/meta_host.php
@@ -0,0 +1,52 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Meta Service � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$handle = create_file($nagiosCFGPath."meta_host.cfg", $oreon->user->get_name());
+	$str = NULL;
+	
+	# Host Creation
+	$str .= "define host{\n";
+	$str .= print_line("host_name", "Meta_Module");
+	$str .= print_line("alias", "Meta Service Calculate Module For Oreon");
+	$str .= print_line("address", "127.0.0.1");
+	$str .= print_line("check_command", "check_host_alive");
+	$str .= print_line("max_check_attempts", "3");
+	if ($oreon->user->get_version() == 2)	{
+		$str .= print_line("check_interval", "1");
+		$str .= print_line("active_checks_enabled", "0");
+		$str .= print_line("passive_checks_enabled", "0");
+		$str .= print_line("check_period", "meta_timeperiod");
+	}
+	if ($oreon->user->get_version() == 1)
+		$str .= print_line("checks_enabled", "1");
+	# Contact Group
+	if ($oreon->user->get_version() == 2)
+		$str .= print_line("contact_groups", "meta_contactgroup");
+	$str .= print_line("notification_interval", "60");
+	$str .= print_line("notification_period", "meta_timeperiod");
+	$str .= print_line("notification_options", "d");
+	$str .= print_line("notifications_enabled", "0");
+	$str .= print_line("register", "1");
+	$str .= "\t}\n\n";
+	
+	write_in_file($handle, $str, $nagiosCFGPath."meta_hosts.cfg");
+	fclose($handle);
+	unset($str);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/metaService/meta_hostgroup.php b/www/include/configuration/configGenerate/metaService/meta_hostgroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..68f8342253c44259ce6663e8ed76b26e7deb2717
--- /dev/null
+++ b/www/include/configuration/configGenerate/metaService/meta_hostgroup.php
@@ -0,0 +1,36 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Meta Service � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$handle = create_file($nagiosCFGPath."meta_hostgroup.cfg", $oreon->user->get_name());
+	$str = NULL;
+	
+	$str .= "define hostgroup{\n";
+	$str .= print_line("hostgroup_name", "meta_hostgroup");
+	$str .= print_line("alias", "meta_hostgroup");
+	// Nagios V1 : Contactgroups
+	if ($oreon->user->get_version() == 1)
+		$str .= print_line("contact_groups", "meta_contactgroup");	
+	$str .= print_line("members", "Meta_Module");
+	$str .= "\t}\n\n";
+	
+	write_in_file($handle, $str, $nagiosCFGPath."meta_hostgroup.cfg");
+	fclose($handle);
+	unset($str);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/metaService/meta_services.php b/www/include/configuration/configGenerate/metaService/meta_services.php
new file mode 100644
index 0000000000000000000000000000000000000000..640a3ab0189cbebf4d71bbfc6f40bd249e55b598
--- /dev/null
+++ b/www/include/configuration/configGenerate/metaService/meta_services.php
@@ -0,0 +1,84 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Service Level � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$handle = create_file($nagiosCFGPath."meta_services.cfg", $oreon->user->get_name());
+	$str = NULL;
+	
+	$res =& $pearDB->query("SELECT * FROM meta_service WHERE meta_activate = '1'");
+	# Write Virtual Services For meta 
+	while ($res->fetchInto($meta))	{
+		$strEval = NULL;
+		$strEval .= "define service{\n";
+		$strEval .= print_line("service_description", "meta_".$meta["meta_id"]);
+		$strEval .= print_line("host_name", "Meta_Module");
+		$strEval .= print_line("check_command", "check_meta!" . $meta["meta_id"]);
+		$strEval .= print_line("max_check_attempts", $meta["max_check_attempts"]);
+		$strEval .= print_line("normal_check_interval", $meta["normal_check_interval"]);
+		$strEval .= print_line("retry_check_interval", $meta["retry_check_interval"]);
+		$strEval .= print_line("active_checks_enabled", "1");
+		$strEval .= print_line("passive_checks_enabled", "0");
+		
+		$res2 =& $pearDB->query("SELECT DISTINCT tp_name FROM timeperiod WHERE tp_id = '".$meta["check_period"]."' LIMIT 1");
+		$period =& $res2->fetchRow();
+		if (isset($period) && $period["tp_name"])
+			$strEval .= print_line("check_period", $period["tp_name"]);
+		$res2->free();
+			
+		$strEval .= print_line("notification_interval", $meta["notification_interval"]);
+		
+		$res2 =& $pearDB->query("SELECT DISTINCT tp_name FROM timeperiod WHERE tp_id = '".$meta["notification_period"]."' LIMIT 1");
+		$period =& $res2->fetchRow();
+		if (isset($period) && $period["tp_name"])
+			$strEval .= print_line("notification_period", $period["tp_name"]);
+		$res2->free();
+	
+		$strEval .= print_line("notification_options", $meta["notification_options"]);
+		if ($meta["notifications_enabled"] != 2) print_line("notifications_enabled", $meta["notifications_enabled"] == 1 ? "1": "0");
+		
+		$contactGroup = array();
+		$strTemp = NULL;
+		$res2 =& $pearDB->query("SELECT cg.cg_id, cg.cg_name FROM meta_contactgroup_relation mcgr, contactgroup cg WHERE mcgr.meta_id = '".$meta["meta_id"]."' AND mcgr.cg_cg_id = cg.cg_id ORDER BY `cg_name`");
+		while($res2->fetchInto($contactGroup))	{				
+			$BP = false;
+			if ($ret["level"]["level"] == 1)
+				array_key_exists($contactGroup["cg_id"], $gbArr[1]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 2)
+				array_key_exists($contactGroup["cg_id"], $gbArr[1]) ? $BP = true : NULL;
+			else if ($ret["level"]["level"] == 3)
+				$BP = true;
+			if ($BP)
+				$strTemp != NULL ? $strTemp .= ", ".$contactGroup["cg_name"] : $strTemp = $contactGroup["cg_name"];
+		}
+		$res2->free();
+		unset($contactGroup);
+		if ($strTemp) $strEval .= print_line("contact_groups", $strTemp);
+		$strEval .= print_line("register", "1");
+		$strEval .= "\t}\n\n";
+		if ($strTemp)
+			$str .= $strEval;
+	}
+	
+	write_in_file($handle, $str, $nagiosCFGPath."meta_services.cfg");
+	fclose($handle);
+	unset($str);
+	unset($meta);
+	unset($strEval);
+	unset($str);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/metaService/meta_timeperiod.php b/www/include/configuration/configGenerate/metaService/meta_timeperiod.php
new file mode 100644
index 0000000000000000000000000000000000000000..0b33d8f24455b10c6969113f062458372ccc18e0
--- /dev/null
+++ b/www/include/configuration/configGenerate/metaService/meta_timeperiod.php
@@ -0,0 +1,37 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Service Level � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$str = NULL;
+	$handle = create_file($nagiosCFGPath."meta_timeperiod.cfg", $oreon->user->get_name());
+	$str .= "define timeperiod{\n";
+	$str .= print_line("timeperiod_name", "meta_timeperiod");
+	$str .= print_line("alias", "meta_timeperiod");
+	$str .= print_line("sunday", "00:00-24:00");
+	$str .= print_line("monday", "00:00-24:00");
+	$str .= print_line("wednesday", "00:00-24:00");
+	$str .= print_line("tuesday", "00:00-24:00");
+	$str .= print_line("thursday", "00:00-24:00");
+	$str .= print_line("friday", "00:00-24:00");
+	$str .= print_line("saturday", "00:00-24:00");
+	$str .= "}\n\n";
+	write_in_file($handle, $str, $nagiosCFGPath."meta_timeperiod.cfg");
+	fclose($handle);
+	unset($str);
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configGenerate/oreon_pm.php b/www/include/configuration/configGenerate/oreon_pm.php
new file mode 100644
index 0000000000000000000000000000000000000000..9e95112ebd010c44550a7aaf570df4dee14786d8
--- /dev/null
+++ b/www/include/configuration/configGenerate/oreon_pm.php
@@ -0,0 +1,173 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset($oreon))
+		exit();
+
+	$file = $oreon->optGen["nagios_path_plugins"]."oreon.conf" ;
+	$handle = fopen($file, 'rw');
+	$ini = readINIfile ($file, ";");
+	// We modify [GLOBAL] section
+	$ini["GLOBAL"]["DIR_OREON"] = $oreon->optGen["oreon_path"];
+	$ini["GLOBAL"]["NAGIOS_LIBEXEC"] = $oreon->optGen["nagios_path_plugins"];
+	$ini["GLOBAL"]["NAGIOS_ETC"] = $oreon->Nagioscfg["cfg_dir"];
+	$ini["GLOBAL"]["DIR_RRDTOOL"] = $oreon->optGen["oreon_rrdbase_path"];
+	
+	# other section
+	$ini["NT"]["CPU"] = ".1.3.6.1.2.1.25.3.3.1.2";
+	$ini["NT"]["HD_USED"] = ".1.3.6.1.2.1.25.2.3.1.6";
+	$ini["NT"]["HD_NAME"] = ".1.3.6.1.2.1.25.2.3.1.3";
+	
+	$ini["CISCO"]["NB_CONNECT"] = ".1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40.6";
+	
+	$ini["UNIX"]["CPU_USER"] = ".1.3.6.1.4.1.2021.11.50.0";
+	$ini["UNIX"]["CPU_SYSTEM"] = ".1.3.6.1.4.1.2021.11.52.0";
+	$ini["UNIX"]["CPU_LOAD_1M"] = ".1.3.6.1.4.1.2021.10.1.3.1";
+	$ini["UNIX"]["CPU_LOAD_5M"] = ".1.3.6.1.4.1.2021.10.1.3.2";
+	$ini["UNIX"]["CPU_LOAD_15M"] = ".1.3.6.1.4.1.2021.10.1.3.3";
+	
+	$ini["DELL"]["TEMP"] = ".1.3.6.1.4.1.674.10892.1.700.20.1.6.1";
+	
+	$ini["ALTEON"]["VIRT"] = "1.3.6.1.4.1.1872.2.1.8.2.7.1.3.1";
+	$ini["ALTEON"]["FRONT"] = "1.3.6.1.4.1.1872.2.1.8.2.5.1.3.1";
+	
+	$ini["MIB2"]["SW_RUNNAME"] = ".1.3.6.1.2.1.25.4.2.1.2";
+	$ini["MIB2"]["SW_RUNINDEX"] = ".1.3.6.1.2.1.25.4.2.1.1";
+	$ini["MIB2"]["SW_RUNSTATUS"] = ".1.3.6.1.2.1.25.4.2.1.7";
+	$ini["MIB2"]["HR_STORAGE_DESCR"] = ".1.3.6.1.2.1.25.2.3.1.3";
+	$ini["MIB2"]["HR_STORAGE_ALLOCATION_UNITS"] = ".1.3.6.1.2.1.25.2.3.1.4";
+	$ini["MIB2"]["HR_STORAGE_SIZE"] = ".1.3.6.1.2.1.25.2.3.1.5";
+	$ini["MIB2"]["HR_STORAGE_USED"] = ".1.3.6.1.2.1.25.2.3.1.6";
+	$ini["MIB2"]["OBJECTID"] = ".1.3.6.1.2.1.1.1.0";
+	$ini["MIB2"]["UPTIME_WINDOWS"] = ".1.3.6.1.2.1.1.3.0";
+	$ini["MIB2"]["UPTIME_OTHER"] = ".1.3.6.1.2.1.25.1.1.0";
+	$ini["MIB2"]["IF_IN_OCTET"] = ".1.3.6.1.2.1.2.2.1.10";
+	$ini["MIB2"]["IF_OUT_OCTET"] = ".1.3.6.1.2.1.2.2.1.16";
+	$ini["MIB2"]["IF_SPEED"] = ".1.3.6.1.2.1.2.2.1.5";
+	$ini["MIB2"]["IF_DESC"] = ".1.3.6.1.2.1.2.2.1.2";
+	
+	# We write conf file
+	// We write conf file
+	writeINIfile($file,$ini, "", "");
+	fclose($handle);
+
+/*
+Function to replace PHP's parse_ini_file() with much fewer restritions, and
+a matching function to write to a .INI file, both of which are binary safe.
+
+Version 1.0
+
+Copyright (C) 2005 Justin Frim <phpcoder@cyberpimp.pimpdomain.com>
+
+Sections can use any character excluding ASCII control characters and ASCII
+DEL.  (You may even use [ and ] characters as literals!)
+
+Keys can use any character excluding ASCII control characters, ASCII DEL,
+ASCII equals sign (=), and not start with the user-defined comment
+character.
+
+Values are binary safe (encoded with C-style backslash escape codes) and may
+be enclosed by double-quotes (to retain leading & trailing spaces).
+
+User-defined comment character can be any non-white-space ASCII character
+excluding ASCII opening bracket ([).
+
+readINIfile() is case-insensitive when reading sections and keys, returning
+an array with lower-case keys.
+writeINIfile() writes sections and keys with first character capitalization.
+Invalid characters are converted to ASCII dash / hyphen (-).  Values are
+always enclosed by double-quotes.
+
+writeINIfile() also provides a method to automatically prepend a comment
+header from ASCII text with line breaks, regardless of whether CRLF, LFCR,
+CR, or just LF line break sequences are used!  (All line breaks are
+translated to CRLF)
+
+Modified for Oreon by Christophe Coraboeuf
+*/
+
+function readINIfile ($filename, $commentchar) {
+  $array1 = array();
+  $array2 = array();
+  $array1 = file($filename);
+  $section = '';
+  foreach ($array1 as $filedata) {
+   $dataline = trim($filedata);
+   $firstchar = substr($dataline, 0, 1);
+   if ($firstchar!=$commentchar && $dataline!='') {
+     //It's an entry (not a comment and not a blank line)
+     if ($firstchar == '[' && substr($dataline, -1, 1) == ']') {
+       //It's a section
+       $section = strtoupper(substr($dataline, 1, -1));
+     }else{
+       //It's a key...
+       $delimiter = strpos($dataline, '=');
+       if ($delimiter > 0) {
+         //...with a value
+         $key = strtoupper(trim(substr($dataline, 0, $delimiter)));
+         $value = trim(substr($dataline, $delimiter + 1));
+         if (substr($value, 0, 1) == '"' && substr($value, -1, 1) == '"') { $value = substr($value, 1, -1); }
+         $array2[$section][$key] = stripcslashes($value);
+       }else{
+         //...without a value
+         $array2[$section][strtoupper(trim($dataline))]='';
+       }
+     }
+   }else{
+     //It's a comment or blank line.  Ignore.
+   }
+  }
+  return $array2;
+}
+
+function writeINIfile ($filename, $array1, $commentchar, $commenttext) {
+  $handle = fopen($filename, 'wb');
+  if ($commenttext!='') {
+   $comtext = $commentchar.
+     str_replace($commentchar, "\r\n".$commentchar,
+       str_replace ("\r", $commentchar,
+         str_replace("\n", $commentchar,
+           str_replace("\n\r", $commentchar,
+             str_replace("\r\n", $commentchar, $commenttext)
+           )
+         )
+       )
+     )
+   ;
+   if (substr($comtext, -1, 1)==$commentchar && substr($comtext, -1, 1)!=$commentchar) {
+     $comtext = substr($comtext, 0, -1);
+   }
+   fwrite ($handle, $comtext."\r\n");
+  }
+  foreach ($array1 as $sections => $items) {
+   //Write the section
+   if (isset($section)) { fwrite ($handle, "\r\n"); }
+   //$section = ucfirst(preg_replace('/[\0-\37]|[\177-\377]/', "-", $sections));
+   $section = strtoupper(preg_replace('/[\0-\37]|\177/', "-", $sections));
+   fwrite ($handle, "[".$section."]\r\n");
+   foreach ($items as $keys => $values) {
+     //Write the key/value pairs
+     $key = strtoupper(preg_replace('/[\0-\37]|=|\177/', "-", $keys));
+     if (substr($key, 0, 1)==$commentchar) { $key = '-'.substr($key, 1); }
+   //  if (substr($values, 0, 1) == '"' && substr($values, -1, 1) == '"') { $values = substr($values, 1, -1); }
+     $value = ucfirst(addcslashes($values,''));
+     fwrite ($handle, '    '.$key.'='.$value."\r\n");
+   }
+  }
+  fclose($handle);
+}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configLoad/DB-Func.php b/www/include/configuration/configLoad/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..861779fee2c5197d92c3c74c222ca7cc82160f4f
--- /dev/null
+++ b/www/include/configuration/configLoad/DB-Func.php
@@ -0,0 +1,945 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	function deleteAllConfCFG()	{
+		global $pearDB;
+		global $oreon;
+		//echo "delete all cfg conf<br>";
+		$rq = "DELETE FROM command";
+		$pearDB->query($rq);
+		$rq = "DELETE FROM timeperiod";
+		$pearDB->query($rq);
+		$rq = "DELETE FROM contact WHERE contact_id != '".$oreon->user->get_id()."'";
+		$pearDB->query($rq);
+		$rq = "DELETE FROM contactgroup";
+		$pearDB->query($rq);
+		$rq = "DELETE FROM host";
+		$pearDB->query($rq);
+		$rq = "DELETE FROM service";
+		$pearDB->query($rq);
+		$rq = "DELETE FROM hostgroup";
+		$pearDB->query($rq);
+		$rq = "DELETE FROM servicegroup";
+		$pearDB->query($rq);
+		$rq = "DELETE FROM dependency";
+		$pearDB->query($rq);
+		$rq = "DELETE FROM escalation";
+		$pearDB->query($rq);
+	}
+	
+	function insertResourceCFG(& $buf)	{
+		$i = 0;
+		foreach ($buf as $str)	{
+			$regs = array();
+			$resCFG = array();
+			# Fill with buffer value
+			if (preg_match("/^[ \t]*([0-9a-zA-Z\_ \$#]+)[ \t]*=[ \t]*(.+)/", $str, $regs))	{
+				$resCFG["resource_activate"]["resource_activate"] = "1";
+				$resCFG["resource_name"] = trim($regs[1]);
+				$resCFG["resource_line"] = trim($regs[1])."=".trim($regs[2]);
+				$resCFG["resource_comment"] = trim($regs[1])." ".date("d/m/Y - H:i:s", time());
+				# Add in db
+				require_once("./include/configuration/configResources/DB-Func.php");
+				if (testExistence($resCFG["resource_name"]) && insertResource($resCFG))
+					$i++;
+			}
+			unset($regs);
+		}
+		return $i;
+	}
+		
+	function deleteResourceCFG()	{
+		global $pearDB;
+		//echo "delete all resources<br>";
+		$rq = "DELETE * FROM cfg_resource; ";
+		$pearDB->query($rq);
+	}
+	
+	function insertNagiosCFG(& $buf)	{
+		$nagiosCFG = array();
+		$flag = false;	
+		# Fill with buffer value
+		foreach ($buf as $str)	{
+			$regs = array();
+			if (preg_match("/^[ \t]*([0-9a-zA-Z\_]+)[ \t]*=[ \t]*(.+)/", $str, $regs))	{
+				switch($regs[1])	{
+					case "cfg_file" :
+						if (!$flag)	{
+							$path = explode("/", $regs[2]);
+							array_pop($path);
+							$regs[2] = implode("/", $path);
+							if (!trim($regs[2]))
+								$nagiosCFG["cfg_pwd"] = "/";
+							else
+								$nagiosCFG["cfg_pwd"] = trim($regs[2])."/";
+							$flag = true;
+						}
+						break;
+					case "global_host_event_handler" : $nagiosCFG[trim($regs[1])] = getMyCommandID(trim($regs[2])); break;
+					case "global_service_event_handler" : $nagiosCFG[trim($regs[1])] = getMyCommandID(trim($regs[2])); break;
+					case "ocsp_command" : $nagiosCFG[trim($regs[1])] = getMyCommandID(trim($regs[2])); break;
+					case "ochp_command" : $nagiosCFG[trim($regs[1])] = getMyCommandID(trim($regs[2])); break;
+					case "host_perfdata_command" : $nagiosCFG[trim($regs[1])] = getMyCommandID(trim($regs[2])); break;
+					case "service_perfdata_command" : $nagiosCFG[trim($regs[1])] = getMyCommandID(trim($regs[2])); break;
+					case "host_perfdata_file_processing_command" : $nagiosCFG[trim($regs[1])] = getMyCommandID(trim($regs[2])); break;
+					case "service_perfdata_file_processing_command" : $nagiosCFG[trim($regs[1])] = getMyCommandID(trim($regs[2])); break;
+					default : $nagiosCFG[trim($regs[1])] = trim($regs[2]); break;
+				}
+			}
+			unset($regs);
+		}
+		# Add Oreon comment
+		if ($nagiosCFG)	{
+			$nagiosCFG["nagios_activate"]["nagios_activate"] = "0";
+			$nagiosCFG["nagios_name"] = "nagios.cfg ".date("d m Y - H:i:s", time());
+			$nagiosCFG["nagios_comment"] = "nagios.cfg ".date("d/m/Y - H:i:s", time());
+		}
+		# Add in db
+		require_once("./include/configuration/configNagios/DB-Func.php");
+		if (insertNagios($nagiosCFG))
+			return true;
+		else
+			return false;
+	}
+
+	function deleteNagiosCFG()	{
+		global $pearDB;
+		//echo "delete all nagios<br>";
+		$rq = "DELETE FROM cfg_nagios; "; 	
+		$pearDB->query($rq);
+	}
+		
+	function insertCgiCFG(& $buf)	{
+		$cgiCFG = array();
+		$flag = false;	
+		# Fill with buffer value
+		foreach ($buf as $str)	{
+			$regs = array();
+			if (preg_match("/^[ \t]*([0-9a-zA-Z\_]+)[ \t]*=[ \t]*(.+)/", $str, $regs))
+				$cgiCFG[trim($regs[1])] = trim($regs[2]);
+			unset($regs);
+		}
+		# Add Oreon comment
+		if ($cgiCFG)	{
+			$cgiCFG["cgi_activate"]["cgi_activate"] = "0";
+			$cgiCFG["cgi_name"] = "cgi.cfg ".date("d m Y - H:i:s", time());
+			$cgiCFG["cgi_comment"] = "cgi.cfg ".date("d/m/Y - H:i:s", time());
+		}
+		# Add in db
+		require_once("./include/configuration/configCGI/DB-Func.php");
+		if (insertCGIInDB($cgiCFG))
+			return true;
+		else
+			return false;
+	}
+	
+	function deleteCgiCFG()	{
+		global $pearDB;
+		$rq = "DELETE FROM cfg_cgi; "; 	
+		$pearDB->query($rq);
+	}
+	
+	function deletePerfparseCFG()	{
+		global $pearDB;
+		//echo "delete all perpar<br>";
+		$rq = "DELETE FROM cfg_perfparse; "; 	
+		$pearDB->query($rq);
+	}
+		
+	function insertCFG(& $buf, & $ret)	{
+		$typeDef = NULL;
+		global $nbr;
+		global $oreon;
+		$nbr = array("cmd"=>0, "tp"=>0, "cct"=>0, "cg"=>0, "h"=>0, "hg"=>0, "hd"=>0, "sv"=>0, "svd"=>0, "sg"=>0, "sgd"=>0, "hei"=>0);
+		$tmpConf = array();
+		$get = false;
+		$regexp = "/^[ \t]*(.[^ \t#]+)[ \t]+(.[^;]+)/";
+		# Fill with buffer value
+		# Turn 1 -> Time Period, Commands
+		foreach ($buf as $str)	{
+			$regs = array();
+			if (preg_match("/}/", $str) && $get)	{
+				switch ($typeDef)	{
+					case "command": insertCommandCFG($tmpConf, $ret); break;
+					case "timeperiod": insertTimePeriodCFG($tmpConf); break;						
+					default :; break;
+				}
+				$get = false;
+				$tmpConf = array();
+				$typeDef = NULL;
+			}
+			# Limit only to cfg conf we need
+			if (preg_match("/^[ \t]*define (timeperiod|command)[ \t]*{/", $str, $def))	{
+				$typeDef = $def[1];
+				$get = true;
+			}
+			else if ($get)	{
+				if (preg_match($regexp, $str, $regs))
+					$tmpConf[$regs[1]] = trim($regs[2]);
+			}
+			unset($regs);
+		}
+		# Turn 2 -> contacts
+		reset($buf);
+		foreach ($buf as $str)	{
+			$regs = array();
+			if (preg_match("/}/", $str) && $get)	{
+				insertContactCFG($tmpConf);
+				$get = false;
+				$tmpConf = array();
+			}
+			if (preg_match("/^[ \t]*define contact[ \t]*{/", $str, $def))
+				$get = true;
+			else if ($get)	{
+				if (preg_match($regexp, $str, $regs))
+					$tmpConf[$regs[1]] = trim($regs[2]);
+			}
+			unset($regs);
+		}
+		# Turn 3 -> Contact Groups
+		reset($buf);
+		foreach ($buf as $str)	{
+			$regs = array();
+			if (preg_match("/}/", $str) && $get)	{
+				insertContactGroupCFG($tmpConf);
+				$get = false;
+				$tmpConf = array();
+			}
+			if (preg_match("/^[ \t]*define contactgroup[ \t]*{/", $str, $def))
+				$get = true;
+			else if ($get)	{
+				if (preg_match($regexp, $str, $regs))
+					$tmpConf[$regs[1]] = trim($regs[2]);
+			}
+			unset($regs);
+		}
+		# Turn 4 -> Hosts
+		reset($buf);
+		$useTpl = array();
+		$useTpls = array();
+		$parentsTMP = array();
+		require_once("./include/configuration/configObject/host/DB-Func.php");
+		foreach ($buf as $str)	{
+			$regs = array();
+			if (preg_match("/}/", $str) && $get)	{
+				$useTpl = insertHostCFG($tmpConf);
+				$useTpls[$useTpl[0]] = $useTpl[1];
+				isset($useTpl[2]) ? $parentsTMP[$useTpl[0]] = $useTpl[2] : NULL;
+				$get = false;
+				$tmpConf = array();
+			}
+			if (preg_match("/^[ \t]*define host[ \t]*{/", $str, $def))
+				$get = true;
+			else if ($get)	{
+				if (preg_match($regexp, $str, $regs))
+					$tmpConf[$regs[1]] = trim($regs[2]);
+			}
+			unset($regs);
+		}
+		# Update Host Parents relation when we have record all host definition
+		foreach($parentsTMP as $key=>$value)	{
+			$tmpConf["host_parents"] = explode(",", $value);
+			foreach ($tmpConf["host_parents"] as $key2=>$value2)
+				$tmpConf["host_parents"][$key2] = getMyHostID(trim($value2));
+			updateHostHostParent($key, $tmpConf);
+		}
+		# Update Host Template relation when we have record all host definition
+		updateHostTemplateUsed($useTpls);
+		# Turn 5 -> Host Groups
+		reset($buf);
+		foreach ($buf as $str)	{
+			$regs = array();
+			if (preg_match("/}/", $str) && $get)	{
+				switch ($typeDef)	{
+					case "hostgroup": insertHostGroupCFG($tmpConf); break;
+					case "hostextinfo": insertHostExtInfoCFG($tmpConf); break;					
+					default :; break;
+				}
+				$get = false;
+				$tmpConf = array();
+				$typeDef = NULL;
+			}
+			if (preg_match("/^[ \t]*define (hostgroup|hostextinfo)[ \t]*{/", $str, $def))	{
+				$typeDef = $def[1];
+				$get = true;
+			}
+			else if ($get)	{
+				if (preg_match($regexp, $str, $regs))
+					$tmpConf[$regs[1]] = trim($regs[2]);
+			}
+			unset($regs);
+		}
+		# Turn 6 -> Services
+		reset($buf);
+		$useTpl = array();
+		$useTpls = array();
+		require_once("./include/configuration/configObject/service/DB-Func.php");
+		foreach ($buf as $str)	{
+			$regs = array();
+			if (preg_match("/}/", $str) && $get)	{
+				switch ($typeDef)	{
+					case "service": $useTpl = insertServiceCFG($tmpConf); $useTpls[$useTpl[0]] = $useTpl[1]; break;
+					case "hostdependency": insertHostDependencyCFG($tmpConf); break;	
+				}
+				$get = false;
+				$tmpConf = array();
+				$typeDef = NULL;
+			}
+			if (preg_match("/^[ \t]*define (service|hostdependency)[ \t]*{/", $str, $def))	{
+				$typeDef = $def[1];
+				$get = true;
+			}
+			else if ($get)	{
+				if (preg_match($regexp, $str, $regs))
+					$tmpConf[$regs[1]] = trim($regs[2]);
+			}
+			unset($regs);
+		}
+		# Update Service Template relation when we have record all service definition
+		updateServiceTemplateUsed($useTpls);
+		# Turn 7 -> Service Groups
+		reset($buf);
+		
+		foreach ($buf as $str)	{
+			$regs = array();
+			if (preg_match("/}/", $str) && $get)	{
+				switch ($typeDef)	{
+					case "servicegroup": insertServiceGroupCFG($tmpConf);  break;					
+					default :; break;
+				}
+				$get = false;
+				$tmpConf = array();
+				$typeDef = NULL;
+			}
+			if (preg_match("/^[ \t]*define (servicegroup)[ \t]*{/", $str, $def))	{
+				$typeDef = $def[1];
+				$get = true;
+			}
+			else if ($get)	{
+				if (preg_match($regexp, $str, $regs))
+					$tmpConf[$regs[1]] = trim($regs[2]);
+			}
+			unset($regs);
+		}
+		# Turn 8 -> Service Dependencies
+		reset($buf);
+		foreach ($buf as $str)	{
+			$regs = array();
+			if (preg_match("/}/", $str) && $get)	{
+				switch ($typeDef)	{
+					case "servicedependency": insertServiceDependencyCFG($tmpConf);  break;					
+					default :; break;
+				}
+				$get = false;
+				$tmpConf = array();
+				$typeDef = NULL;
+			}
+			if (preg_match("/^[ \t]*define (servicedependency)[ \t]*{/", $str, $def))	{
+				$typeDef = $def[1];
+				$get = true;
+			}
+			else if ($get)	{
+				if (preg_match($regexp, $str, $regs))
+					$tmpConf[$regs[1]] = trim($regs[2]);
+			}
+			unset($regs);
+		}
+		/*
+		reset($buf);
+		foreach ($buf as $str)	{
+			$regs = array();
+			if (preg_match("/}/", $str))	{
+				switch ($typeDef)	{
+					case "hostgroupescalation": print "hge:"; print_r ($tmpConf);  break;
+					case "hostescalation": print "host esc:"; print_r ($tmpConf);  break;
+					case "serviceescalation": print "sv esc:"; print_r ($tmpConf);  break;
+					default :; break;
+				}
+				$get = false;
+				$tmpConf = array();
+				$typeDef = NULL;
+			}
+			if (preg_match("/^[ \t]*define ([a-zA-Z0-9\_\-]+)[ \t]*{/", $str, $def))	{
+				$typeDef = $def[1];
+				$get = true;
+			}
+			else if ($get)	{
+				if (preg_match($regexp, $str, $regs))
+					$tmpConf[$regs[1]] = trim($regs[2]);
+			}
+			unset($regs);
+		}
+		*/
+		return $nbr;
+	}
+	
+	function insertContactCFG($tmpConf = array())	{
+		global $nbr;
+		require_once("./include/configuration/configObject/contact/DB-Func.php");
+		if (isset($tmpConf["contact_name"]) && testContactExistence($tmpConf["contact_name"]))	{
+			foreach ($tmpConf as $key=>$value)
+				switch($key)	{
+					case "alias" : $tmpConf["contact_alias"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "host_notification_options" : $tmpConf["contact_hostNotifOpts"] = array_flip(explode(",", $tmpConf[$key])); unset ($tmpConf[$key]); break;
+					case "service_notification_options" : $tmpConf["contact_svNotifOpts"] = array_flip(explode(",", $tmpConf[$key])); unset ($tmpConf[$key]); break;
+					case "host_notification_period" : $tmpConf["timeperiod_tp_id"] = getMyTPID(trim($tmpConf[$key])); unset ($tmpConf[$key]); break;
+					case "service_notification_period" : $tmpConf["timeperiod_tp_id2"] = getMyTPID(trim($tmpConf[$key])); unset ($tmpConf[$key]); break;
+					case "email" : $tmpConf["contact_email"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "pager" : $tmpConf["contact_pager"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "host_notification_commands" : 
+						$tmpConf["contact_hostNotifCmds"] = explode(",", $tmpConf[$key]);
+						foreach ($tmpConf["contact_hostNotifCmds"] as $key2=>$value2)
+							$tmpConf["contact_hostNotifCmds"][$key2] = getMyCommandID(trim($value2));
+						unset ($tmpConf[$key]); 
+						break;
+					case "service_notification_commands" : 
+						$tmpConf["contact_svNotifCmds"] = explode(",", $tmpConf[$key]);
+						foreach ($tmpConf["contact_svNotifCmds"] as $key2=>$value2)
+							$tmpConf["contact_svNotifCmds"][$key2] = getMyCommandID(trim($value2));
+						unset ($tmpConf[$key]); 
+						break;
+					case "contactgroups" :
+						$tmpConf["contact_cgNotif"] = explode(",", $tmpConf[$key]);
+						foreach ($tmpConf["contact_cgNotif"] as $key2=>$value2)
+							$tmpConf["contact_cgNotif"][$key2] = getMyContactGroupID(trim($value2));
+						unset ($tmpConf[$key]); 
+						break;
+				}
+			$tmpConf["contact_oreon"]["contact_oreon"] = "0";
+			$tmpConf["contact_admin"]["contact_admin"] = "0";
+			$tmpConf["contact_type_msg"] = "txt";
+			$tmpConf["contact_lang"] = "en";
+			$tmpConf["contact_activate"]["contact_activate"] = "1";
+			$tmpConf["contact_comment"] = date("d/m/Y - H:i:s", time());
+			insertContactInDB($tmpConf);
+			$nbr["cct"] += 1;
+			return true;
+		}
+		return false;
+	}
+	
+	function insertContactGroupCFG($tmpConf = array())	{
+		global $nbr;
+		require_once("./include/configuration/configObject/contactgroup/DB-Func.php");
+		if (isset($tmpConf["contactgroup_name"]) && testContactGroupExistence($tmpConf["contactgroup_name"]))	{
+			foreach ($tmpConf as $key=>$value)
+				switch($key)	{
+					case "contactgroup_name" : $tmpConf["cg_name"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "alias" : $tmpConf["cg_alias"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "members" :
+						$tmpConf["cg_contacts"] = explode(",", $tmpConf[$key]);
+						foreach ($tmpConf["cg_contacts"] as $key2=>$value2)
+							$tmpConf["cg_contacts"][$key2] = getMyContactID(trim($value2));
+						unset ($tmpConf[$key]);
+						break;
+				}
+			$tmpConf["cg_activate"]["cg_activate"] = "1";
+			$tmpConf["cg_comment"] = date("d/m/Y - H:i:s", time());
+			insertContactGroupInDB($tmpConf);
+			$nbr["cg"] += 1;
+			return true;
+		}
+		return false;
+	}
+	
+	function insertHostCFG($tmpConf = array())	{
+		$use = NULL;
+		$useTpl = array();
+		global $nbr;
+		if (isset($tmpConf["host_name"]) && testHostExistence($tmpConf["host_name"]) || isset($tmpConf["name"]) && testHostExistence($tmpConf["name"]))	{
+			foreach ($tmpConf as $key=>$value)	{
+				switch($key)	{
+					case "use" : $use = trim($tmpConf[$key]); unset ($tmpConf[$key]); break;
+					case "name" : $tmpConf["host_name"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "alias" : $tmpConf["host_alias"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "address" : $tmpConf["host_address"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "max_check_attempts" : $tmpConf["host_max_check_attempts"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "check_interval" : $tmpConf["host_check_interval"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "freshness_threshold" : $tmpConf["host_freshness_threshold"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "low_flap_threshold" : $tmpConf["host_low_flap_threshold"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "high_flap_threshold" : $tmpConf["host_high_flap_threshold"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "notification_interval" : $tmpConf["host_notification_interval"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+
+					case "active_checks_enabled" : $tmpConf["host_active_checks_enabled"]["host_active_checks_enabled"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "checks_enabled" : $tmpConf["host_checks_enabled"]["host_checks_enabled"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "passive_checks_enabled" : $tmpConf["host_passive_checks_enabled"]["host_passive_checks_enabled"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "obsess_over_host" : $tmpConf["host_obsess_over_host"]["host_obsess_over_host"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "check_freshness" : $tmpConf["host_check_freshness"]["host_check_freshness"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "event_handler_enabled" : $tmpConf["host_event_handler_enabled"]["host_event_handler_enabled"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "flap_detection_enabled" : $tmpConf["host_flap_detection_enabled"]["host_flap_detection_enabled"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "process_perf_data" : $tmpConf["host_process_perf_data"]["host_process_perf_data"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "retain_status_information" : $tmpConf["host_retain_status_information"]["host_retain_status_information"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "retain_nonstatus_information" : $tmpConf["host_retain_nonstatus_information"]["host_retain_nonstatus_information"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "notifications_enabled" : $tmpConf["host_notifications_enabled"]["host_notifications_enabled"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "register" : $tmpConf["host_register"]["host_register"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+
+					case "notification_options" : $tmpConf["host_notifOpts"] = array_flip(explode(",", $tmpConf[$key])); unset ($tmpConf[$key]); break;
+					case "stalking_options" : $tmpConf["host_stalOpts"] = array_flip(explode(",", $tmpConf[$key])); unset ($tmpConf[$key]); break;
+
+					case "check_command" : 
+						$cmd =& explode("!", trim($tmpConf[$key]));
+						$tmpConf["command_command_id"] = getMyCommandID(array_shift($cmd));
+						if (count($cmd)) 
+							$tmpConf["command_command_id_arg"] = "!".implode("!", $cmd);
+						unset ($tmpConf[$key]);
+						break;
+					case "event_handler" : 
+						$cmd =& explode("!", trim($tmpConf[$key]));
+						$tmpConf["command_command_id2"] = getMyCommandID(array_shift($cmd));
+						if (count($cmd)) 
+							$tmpConf["command_command_id2_arg"] = "!".implode("!", $cmd);
+						unset ($tmpConf[$key]);
+						break;
+					case "parents" : $tmpConf["host_parentsTMP"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "check_period" : $tmpConf["timeperiod_tp_id"] = getMyTPID(trim($tmpConf[$key])); unset ($tmpConf[$key]); break;
+					case "notification_period" : $tmpConf["timeperiod_tp_id2"] = getMyTPID(trim($tmpConf[$key])); unset ($tmpConf[$key]); break;
+					
+					case "contact_groups" :
+						$tmpConf["host_cgs"] = explode(",", $tmpConf[$key]);
+						foreach ($tmpConf["host_cgs"] as $key2=>$value2)
+							$tmpConf["host_cgs"][$key2] = getMyContactGroupID(trim($value2));
+						unset ($tmpConf[$key]);
+						break;					
+					case "hostgroups" :
+						$tmpConf["host_hgs"] = explode(",", $tmpConf[$key]);
+						foreach ($tmpConf["host_hgs"] as $key2=>$value2)
+							$tmpConf["host_hgs"][$key2] = getMyHostGroupID(trim($value2));
+						unset ($tmpConf[$key]);
+						break;
+				}
+			}
+			if (isset($tmpConf["host_register"]["host_register"]))	{
+				if ($tmpConf["host_register"]["host_register"] == '1')
+					$tmpConf["host_register"]["host_register"] = '1';
+				else
+					$tmpConf["host_register"]["host_register"] = '0';
+			}
+			else
+				$tmpConf["host_register"]["host_register"] = '1';
+			$tmpConf["host_activate"]["host_activate"] = "1";
+			$tmpConf["host_comment"] = date("d/m/Y - H:i:s", time());
+			$tmpConf["ehi_notes"] = NULL;
+			$tmpConf["ehi_notes_url"] = NULL;
+			$tmpConf["ehi_action_url"] = NULL;
+			$tmpConf["ehi_icon_image"] = NULL;
+			$tmpConf["ehi_icon_image_alt"] = NULL;
+			$tmpConf["ehi_vrml_image"] = NULL;
+			$tmpConf["ehi_statusmap_image"] = NULL;
+			$tmpConf["ehi_2d_coords"] = NULL;
+			$tmpConf["ehi_3d_coords"] = NULL;
+			$tmpConf["country_id"] = NULL;
+			$tmpConf["city_name"] = NULL;
+			$useTpl[0] = insertHostInDB($tmpConf);
+			$useTpl[1] = $use;
+			isset($tmpConf["host_parentsTMP"]) ? $useTpl[2] = $tmpConf["host_parentsTMP"] : NULL;
+			$nbr["h"] += 1;
+			return $useTpl;
+		}
+	}
+	
+	function insertHostExtInfoCFG($tmpConf = array())	{
+		global $nbr;
+		require_once("./include/configuration/configObject/host/DB-Func.php");
+		foreach ($tmpConf as $key=>$value)
+			switch($key)	{
+				case "notes" : $tmpConf["ehi_notes"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "notes_url" : $tmpConf["ehi_notes_url"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "action_url" : $tmpConf["ehi_action_url"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "icon_image" : $tmpConf["ehi_icon_image"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "icon_image_alt" : $tmpConf["ehi_icon_image_alt"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "vrml_image" : $tmpConf["ehi_vrml_image"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "statusmap_image" : $tmpConf["ehi_statusmap_image"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "2d_coords" : $tmpConf["ehi_2d_coords"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "3d_coords" : $tmpConf["ehi_3d_coords"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+
+				case "host_name" : 
+					$tmpConf["host_names"] = explode(",", $tmpConf[$key]);
+					foreach ($tmpConf["host_names"] as $key2=>$value2)
+						$tmpConf["host_names"][$key2] = getMyHostID(trim($value2));
+					unset ($tmpConf[$key]);
+					break;
+			}
+		foreach($tmpConf["host_names"] as $key=>$value)	{
+			updateHostExtInfos($value, $tmpConf);
+			$nbr["hei"] += 1;
+		}
+		return true;
+	}
+	
+	function insertHostGroupCFG($tmpConf = array())	{
+		global $nbr;
+		require_once("./include/configuration/configObject/hostgroup/DB-Func.php");
+		if (isset($tmpConf["hostgroup_name"]) && testHostGroupExistence($tmpConf["hostgroup_name"]))	{
+			foreach ($tmpConf as $key=>$value)
+				switch($key)	{
+					case "hostgroup_name" : $tmpConf["hg_name"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "alias" : $tmpConf["hg_alias"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "members" :
+						$tmpConf["hg_hosts"] = explode(",", $tmpConf[$key]);
+						foreach ($tmpConf["hg_hosts"] as $key2=>$value2)
+							$tmpConf["hg_hosts"][$key2] = getMyHostID(trim($value2));
+						unset ($tmpConf[$key]);
+						break;
+					case "contact_groups" :
+						$tmpConf["hg_cgs"] = explode(",", $tmpConf[$key]);
+						foreach ($tmpConf["hg_cgs"] as $key2=>$value2)
+							$tmpConf["hg_cgs"][$key2] = getMyContactGroupID(trim($value2));
+						unset ($tmpConf[$key]);
+						break;
+				}
+			$tmpConf["hg_activate"]["hg_activate"] = "1";
+			$tmpConf["hg_comment"] = date("d/m/Y - H:i:s", time());
+			insertHostGroupInDB($tmpConf);
+			$nbr["hg"] += 1;
+			return true;
+		}
+		return false;
+	}
+	
+	function insertHostDependencyCFG($tmpConf = array())	{
+		global $nbr;
+		require_once("./include/configuration/configObject/host_dependency/DB-Func.php");
+		require_once("./include/configuration/configObject/hostgroup_dependency/DB-Func.php");
+		foreach ($tmpConf as $key=>$value)
+			switch($key)	{
+				case "inherits_parent" : $tmpConf["inherits_parent"]["inherits_parent"] = $tmpConf[$key]; break;
+				case "execution_failure_criteria" : $tmpConf["execution_failure_criteria"] = array_flip(explode(",", $tmpConf[$key])); break;
+				case "notification_failure_criteria" : $tmpConf["notification_failure_criteria"] = array_flip(explode(",", $tmpConf[$key])); break;
+				case "dependent_host_name" :
+					$tmpConf["dep_hostChilds"] = explode(",", $tmpConf[$key]);
+					foreach ($tmpConf["dep_hostChilds"] as $key2=>$value2)
+						$tmpConf["dep_hostChilds"][$key2] = getMyHostID(trim($value2));
+					unset ($tmpConf[$key]);
+					break;				
+				case "host_name" :
+					$tmpConf["dep_hostParents"] = explode(",", $tmpConf[$key]);
+					foreach ($tmpConf["dep_hostParents"] as $key2=>$value2)
+						$tmpConf["dep_hostParents"][$key2] = getMyHostID(trim($value2));
+					unset ($tmpConf[$key]);
+					break;
+				case "dependent_hostgroup_name" :
+					$tmpConf["dep_hgChilds"] = explode(",", $tmpConf[$key]);
+					foreach ($tmpConf["dep_hgChilds"] as $key2=>$value2)
+						$tmpConf["dep_hgChilds"][$key2] = getMyHostGroupID(trim($value2));
+					unset ($tmpConf[$key]);
+					break;
+				case "hostgroup_name" :
+					$tmpConf["dep_hgParents"] = explode(",", $tmpConf[$key]);
+					foreach ($tmpConf["dep_hgParents"] as $key2=>$value2)
+						$tmpConf["dep_hgParents"][$key2] = getMyHostGroupID(trim($value2));
+					unset ($tmpConf[$key]);
+					break;
+			}
+		if (isset($tmpConf["dep_hgParents"]) && isset($tmpConf["dep_hgChilds"]))	{
+			$nbr["hd"] += 1;
+			$tmpConf["dep_name"] = "Host Dependency ".$nbr["hd"]." - ".date("d/m/Y - H:i:s", time());
+			$tmpConf["dep_description"] = "Host Dependency ".$nbr["hd"]." - ".date("d/m/Y - H:i:s", time());
+			$tmpConf["dep_comment"] = date("d/m/Y - H:i:s", time());
+			insertHostGroupDependencyInDB($tmpConf);
+		}
+		else if (isset($tmpConf["dep_hostParents"]) && isset($tmpConf["dep_hostChilds"]))	{
+			$nbr["hd"] += 1;
+			$tmpConf["dep_name"] = "Host Dependency ".$nbr["hd"]." - ".date("d/m/Y - H:i:s", time());
+			$tmpConf["dep_description"] = "Host Dependency ".$nbr["hd"]." - ".date("d/m/Y - H:i:s", time());
+			$tmpConf["dep_comment"] = date("d/m/Y - H:i:s", time());
+			insertHostDependencyInDB($tmpConf);	
+		}
+		return true;
+	}
+	
+	function insertServiceDependencyCFG($tmpConf = array())	{
+		global $nbr;
+		require_once("./include/configuration/configObject/service_dependency/DB-Func.php");
+		require_once("./include/configuration/configObject/servicegroup_dependency/DB-Func.php");
+		foreach ($tmpConf as $key=>$value)
+			switch($key)	{
+				case "inherits_parent" : $tmpConf["inherits_parent"]["inherits_parent"] = $tmpConf[$key]; break;
+				case "execution_failure_criteria" : $tmpConf["execution_failure_criteria"] = array_flip(explode(",", $tmpConf[$key])); break;
+				case "notification_failure_criteria" : $tmpConf["notification_failure_criteria"] = array_flip(explode(",", $tmpConf[$key])); break;
+				case "dependent_host_name" :
+					$tmpConf["dep_hChi"] = explode(",", $tmpConf[$key]);
+					foreach ($tmpConf["dep_hChi"] as $key2=>$value2)
+						$tmpConf["dep_hChi"][$key2] = getMyHostID(trim($value2));
+					unset ($tmpConf[$key]);
+					break;				
+				case "host_name" :
+					$tmpConf["dep_hPar"] = explode(",", $tmpConf[$key]);
+					foreach ($tmpConf["dep_hPar"] as $key2=>$value2)
+						$tmpConf["dep_hPar"][$key2] = getMyHostID(trim($value2));
+					unset ($tmpConf[$key]);
+					break;
+				case "dependent_hostgroup_name" :
+					$tmpConf["dep_hgChi"] = explode(",", $tmpConf[$key]);
+					foreach ($tmpConf["dep_hgChi"] as $key2=>$value2)
+						$tmpConf["dep_hgChi"][$key2] = getMyHostGroupID(trim($value2));
+					unset ($tmpConf[$key]);
+					break;
+				case "hostgroup_name" :
+					$tmpConf["dep_hgPar"] = explode(",", $tmpConf[$key]);
+					foreach ($tmpConf["dep_hgPar"] as $key2=>$value2)
+						$tmpConf["dep_hgPar"][$key2] = getMyHostGroupID(trim($value2));
+					unset ($tmpConf[$key]);
+					break;
+				case "dependent_servicegroup_name" :
+					$tmpConf["dep_sgChilds"] = explode(",", $tmpConf[$key]);
+					foreach ($tmpConf["dep_sgChilds"] as $key2=>$value2)
+						$tmpConf["dep_sgChilds"][$key2] = getMyServiceGroupID(trim($value2));
+					unset ($tmpConf[$key]);
+					break;
+				case "servicegroup_name" :
+					$tmpConf["dep_sgParents"] = explode(",", $tmpConf[$key]);
+					foreach ($tmpConf["dep_sgParents"] as $key2=>$value2)
+						$tmpConf["dep_sgParents"][$key2] = getMyServiceGroupID(trim($value2));
+					unset ($tmpConf[$key]);
+					break;
+
+				case "dependent_service_description" :
+					if (isset($tmpConf["dep_hChi"]))	{
+						$tmpConf["dep_hSvChi"] = explode(",", $tmpConf[$key]);
+						foreach ($tmpConf["dep_hSvChi"] as $key2=>$value2)						
+							foreach ($tmpConf["dep_hChi"] as $key3=>$value3)	{
+								if (array_key_exists($key2, $tmpConf["dep_hSvChi"]) && ($tmpConf["dep_hSvChi"][$key2] != getMyServiceID(trim($value2), $value3)))
+									$tmpConf["dep_hSvChi"][count($tmpConf["dep_hSvChi"])] = getMyServiceID(trim($value2), $value3);
+								else
+									$tmpConf["dep_hSvChi"][$key2] = getMyServiceID(trim($value2), $value3);
+							}
+					}
+					else if (isset($tmpConf["dep_hgChi"]))	{
+						$tmpConf["dep_hgSvChi"] = explode(",", $tmpConf[$key]);
+						foreach ($tmpConf["dep_hgSvChi"] as $key2=>$value2)
+							foreach ($tmpConf["dep_hgChi"] as $key3=>$value3)	{
+								if (array_key_exists($key2, $tmpConf["dep_hgSvChi"]) && ($tmpConf["dep_hgSvChi"][$key2] != getMyServiceID(trim($value2), NULL, $value3)))
+									$tmpConf["dep_hgSvChi"][count($tmpConf["dep_hgSvChi"])] = getMyServiceID(trim($value2), NULL, $value3);
+								else
+									$tmpConf["dep_hgSvChi"][$key2] = getMyServiceID(trim($value2), NULL, $value3);
+							}
+					}
+					unset ($tmpConf[$key]);
+					break;				
+				case "service_description" :
+					if (isset($tmpConf["dep_hPar"]))	{
+						$tmpConf["dep_hSvPar"] = explode(",", $tmpConf[$key]);
+						foreach ($tmpConf["dep_hSvPar"] as $key2=>$value2)
+							foreach ($tmpConf["dep_hPar"] as $key3=>$value3)	{
+								if (array_key_exists($key2, $tmpConf["dep_hSvPar"]) && ($tmpConf["dep_hSvPar"][$key2] != getMyServiceID(trim($value2), $value3)))
+									$tmpConf["dep_hSvPar"][count($tmpConf["dep_hSvPar"])] = getMyServiceID(trim($value2), $value3);
+								else
+									$tmpConf["dep_hSvPar"][$key2] = getMyServiceID(trim($value2), $value3);
+							}
+					}
+					else if (isset($tmpConf["dep_hgPar"]))	{
+						$tmpConf["dep_hgSvPar"] = explode(",", $tmpConf[$key]);
+						foreach ($tmpConf["dep_hgSvPar"] as $key2=>$value2)
+							foreach ($tmpConf["dep_hgPar"] as $key3=>$value3)	{
+								if (array_key_exists($key2, $tmpConf["dep_hgSvPar"]) && ($tmpConf["dep_hgSvPar"][$key2] != getMyServiceID(trim($value2), NULL, $value3)))
+									$tmpConf["dep_hgSvPar"][count($tmpConf["dep_hgSvPar"])] = getMyServiceID(trim($value2), NULL, $value3);
+								else
+									$tmpConf["dep_hgSvPar"][$key2] = getMyServiceID(trim($value2), NULL, $value3);
+							}
+					}
+					unset ($tmpConf[$key]);
+					break;
+			}
+		if ((isset($tmpConf["dep_hSvPar"]) && isset($tmpConf["dep_hSvChi"])) || (isset($tmpConf["dep_hgSvPar"]) && isset($tmpConf["dep_hgSvChi"])))	{
+			$nbr["svd"] += 1;
+			$tmpConf["dep_name"] = "Service Dependency ".$nbr["svd"]." - ".date("d/m/Y - H:i:s", time());
+			$tmpConf["dep_description"] = "Service Dependency ".$nbr["svd"]." - ".date("d/m/Y - H:i:s", time());
+			$tmpConf["dep_comment"] = date("d/m/Y - H:i:s", time());
+			insertServiceDependencyInDB($tmpConf);
+		}
+		else if (isset($tmpConf["dep_sgParents"]) && isset($tmpConf["dep_sgChilds"]))	{
+			$nbr["sgd"] += 1;
+			$tmpConf["dep_name"] = "SG Dependency ".$nbr["sgd"]." - ".date("d/m/Y - H:i:s", time());
+			$tmpConf["dep_description"] = "SG Dependency ".$nbr["sgd"]." - ".date("d/m/Y - H:i:s", time());
+			$tmpConf["dep_comment"] = date("d/m/Y - H:i:s", time());
+			insertServiceGroupDependencyInDB($tmpConf);	
+		}
+		return true;
+	}
+	
+	function insertServiceCFG($tmpConf = array())	{
+		$use = NULL;
+		$rrd_host = NULL;
+		$rrd_service = NULL;
+		$useTpl = array();
+		global $nbr;
+		foreach ($tmpConf as $key=>$value)
+			switch($key)	{
+				case "use" : $use = trim($tmpConf[$key]); unset ($tmpConf[$key]); break;
+				case "name" : $tmpConf["service_description"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "description" : $tmpConf["service_description"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "max_check_attempts" : $tmpConf["service_max_check_attempts"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "normal_check_interval" : $tmpConf["service_normal_check_interval"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "retry_check_interval" : $tmpConf["service_retry_check_interval"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "freshness_threshold" : $tmpConf["service_freshness_threshold"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "low_flap_threshold" : $tmpConf["service_low_flap_threshold"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "high_flap_threshold" : $tmpConf["service_high_flap_threshold"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "notification_interval" : $tmpConf["service_notification_interval"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+
+				case "is_volatile" : $tmpConf["service_is_volatile"]["service_is_volatile"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "active_checks_enabled" : $tmpConf["service_active_checks_enabled"]["service_active_checks_enabled"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "checks_enabled" : $tmpConf["service_checks_enabled"]["service_checks_enabled"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "passive_checks_enabled" : $tmpConf["service_passive_checks_enabled"]["service_passive_checks_enabled"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "parallelize_check" : $tmpConf["service_parallelize_check"]["service_parallelize_check"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "obsess_over_service" : $tmpConf["service_obsess_over_service"]["service_obsess_over_service"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "check_freshness" : $tmpConf["service_check_freshness"]["service_check_freshness"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "event_handler_enabled" : $tmpConf["service_event_handler_enabled"]["service_event_handler_enabled"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "flap_detection_enabled" : $tmpConf["service_flap_detection_enabled"]["service_flap_detection_enabled"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "process_perf_data" : $tmpConf["service_process_perf_data"]["service_process_perf_data"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "retain_status_information" : $tmpConf["service_retain_status_information"]["service_retain_status_information"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "retain_nonstatus_information" : $tmpConf["service_retain_nonstatus_information"]["service_retain_nonstatus_information"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "notifications_enabled" : $tmpConf["service_notifications_enabled"]["service_notifications_enabled"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				case "register" : $tmpConf["service_register"]["service_register"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+
+				case "notification_options" : $tmpConf["service_notifOpts"] = array_flip(explode(",", $tmpConf[$key])); unset ($tmpConf[$key]); break;
+				case "stalking_options" : $tmpConf["service_stalOpts"] = array_flip(explode(",", $tmpConf[$key])); unset ($tmpConf[$key]); break;
+
+				case "check_command" : 
+					$cmd =& explode("!", trim($tmpConf[$key]));
+					$cmd_name =& array_shift($cmd);
+					$tmpConf["command_command_id"] = getMyCommandID($cmd_name);
+					if (strstr($cmd_name, "check_graph"))
+						$rrd_service = array_pop($cmd);
+					if (count($cmd))
+						$tmpConf["command_command_id_arg"] = "!".implode("!", $cmd);
+					unset ($tmpConf[$key]);
+					break;
+				case "event_handler" : 
+					$cmd =& explode("!", trim($tmpConf[$key]));
+					$cmd_name =& array_shift($cmd);
+					$tmpConf["command_command_id2"] = getMyCommandID($cmd_name);
+					if (strstr($cmd_name, "check_graph"))
+						$cmd = array_pop($cmd);
+					if (count($cmd)) 
+						$tmpConf["command_command_id2_arg"] = "!".implode("!", $cmd);
+					unset ($tmpConf[$key]);
+					break;
+				case "check_period" : $tmpConf["timeperiod_tp_id"] = getMyTPID(trim($tmpConf[$key])); unset ($tmpConf[$key]); break;
+				case "notification_period" : $tmpConf["timeperiod_tp_id2"] = getMyTPID(trim($tmpConf[$key])); unset ($tmpConf[$key]); break;
+				
+				case "contact_groups" :
+					$tmpConf["service_cgs"] = explode(",", $tmpConf[$key]);
+					foreach ($tmpConf["service_cgs"] as $key2=>$value2)
+						$tmpConf["service_cgs"][$key2] = getMyContactGroupID(trim($value2));
+					unset ($tmpConf[$key]);
+					break;				
+				case "host_name" :
+					$tmpConf["service_hPars"] = explode(",", $tmpConf[$key]);
+					foreach ($tmpConf["service_hPars"] as $key2=>$value2)	{
+						$tmpConf["service_hPars"][$key2] = getMyHostID(trim($value2));
+						$rrd_host = getMyHostID(trim($value2));
+					}
+					unset ($tmpConf[$key]);
+					break;				
+				case "hostgroup_name" :
+					$tmpConf["service_hgPars"] = explode(",", $tmpConf[$key]);
+					foreach ($tmpConf["service_hgPars"] as $key2=>$value2)
+						$tmpConf["service_hgPars"][$key2] = getMyHostGroupID(trim($value2));
+					unset ($tmpConf[$key]);
+					break;
+			}
+		if (isset($tmpConf["service_register"]["service_register"]))	{
+			if ($tmpConf["service_register"]["service_register"] == '1')
+				$tmpConf["service_register"]["service_register"] = '1';
+			else
+				$tmpConf["service_register"]["service_register"] = '0';
+		}
+		else
+			$tmpConf["service_register"]["service_register"] = '1';
+		$tmpConf["service_activate"]["service_activate"] = "1";
+		$tmpConf["service_comment"] = date("d/m/Y - H:i:s", time());
+		$useTpl[0] = insertServiceInDB($tmpConf);
+		$useTpl[1] = $use;
+		if ($rrd_service)
+			copyRrdDB($rrd_service, $useTpl[0], $rrd_host);
+		$nbr["sv"] += 1;
+		return $useTpl;
+	}	
+	
+	function insertServiceGroupCFG($tmpConf = array())	{
+		global $nbr;
+		require_once("./include/configuration/configObject/servicegroup/DB-Func.php");
+		if (isset($tmpConf["servicegroup_name"]) && testServiceGroupExistence($tmpConf["servicegroup_name"]))	{
+			foreach ($tmpConf as $key=>$value)
+				switch($key)	{
+					case "servicegroup_name" : $tmpConf["sg_name"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "alias" : $tmpConf["sg_alias"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "members" :
+						$sg_servicesTMP = explode(",", $tmpConf[$key]);
+						for ($i = 0, $j = 0; $i < count($sg_servicesTMP); $i += 2)	{
+							$tmpConf["sg_hServices"][$j] = getMyServiceID(trim($sg_servicesTMP[$i+1]), getMyHostID(trim($sg_servicesTMP[$i])));
+							$j++;
+						}
+						unset ($tmpConf[$key]);
+						break;
+				}
+			$tmpConf["sg_activate"]["sg_activate"] = "1";
+			$tmpConf["sg_comment"] = date("d/m/Y - H:i:s", time());
+			insertServiceGroupInDB($tmpConf);
+			$nbr["sg"] += 1;
+			return true;
+		}
+		return false;
+	}
+	
+	function insertTimePeriodCFG($tmpConf = array())	{
+		global $nbr;
+		require_once("./include/configuration/configObject/timeperiod/DB-Func.php");
+		if (isset($tmpConf["timeperiod_name"]) && testTPExistence($tmpConf["timeperiod_name"]))	{			
+			foreach ($tmpConf as $key=>$value)
+				switch($key)	{
+					case "timeperiod_name" : $tmpConf["tp_name"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "alias" : $tmpConf["tp_alias"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "sunday" : $tmpConf["tp_sunday"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "monday" : $tmpConf["tp_monday"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "tuesday" : $tmpConf["tp_tuesday"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "wednesday" : $tmpConf["tp_wednesday"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "thursday" : $tmpConf["tp_thursday"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "friday" : $tmpConf["tp_friday"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+					case "saturday" : $tmpConf["tp_saturday"] = $tmpConf[$key]; unset ($tmpConf[$key]); break;
+				}
+			insertTimeperiodInDB($tmpConf);
+			$nbr["tp"] += 1;
+			return true;
+		}
+		return false;
+	}
+	
+	function insertCommandCFG($tmpConf = array(), $ret = array())	{
+		global $nbr;
+		require_once("./include/configuration/configObject/command/DB-Func.php");
+		if (isset($tmpConf["command_name"]) && testCmdExistence($tmpConf["command_name"]))	{
+			$tmpConf["command_type"]["command_type"] = $ret["cmdType"]["cmdType"];
+			$tmpConf["command_example"] = NULL;
+			insertCommandInDB($tmpConf);
+			$nbr["cmd"] += 1;
+			return true;
+		}
+		return false;
+	}
+	
+	function deleteAll()	{
+		deleteAllConfCFG();
+		deleteResourceCFG();
+		deleteNagiosCFG();
+		deleteCgiCFG();
+		deletePerfparseCFG();
+	}
+	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configLoad/formLoadFiles.ihtml b/www/include/configuration/configLoad/formLoadFiles.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..dcf25b1559b1666074454d72c979e93a3addae6b
--- /dev/null
+++ b/www/include/configuration/configLoad/formLoadFiles.ihtml
@@ -0,0 +1,54 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/component_add.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/server_network.gif'>&nbsp;&nbsp;{$form.header.infos}</td></tr>	 	
+		<tr class="list_one"><td class="FormRowField">{$form.host.label}</td><td class="FormRowValue">{$form.host.html}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/document_refresh.gif'>&nbsp;&nbsp;{$form.header.opt}</td></tr>	 	
+		<tr class="list_one"><td class="FormRowField">{$form.del.label}</td><td class="FormRowValue">{$form.del.html}</td></tr>
+<!--	<tr class="list_two"><td class="FormRowField">{$form.overwrite.label}</td><td class="FormRowValue">{$form.overwrite.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.comment.label}</td><td class="FormRowValue">{$form.comment.html}</td></tr>
+-->
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/document_into.gif'>&nbsp;&nbsp;{$form.header.fileType}</td></tr>
+		<tr class="list_one">
+			<td class="FormRowField">
+				<b>{$form.Type.label}</b><br>		
+				{$form.header.fileMis1}
+			</td>
+			<td class="FormRowValue">{$form.Type.html}</td>
+		</tr>
+		<tr class="list_two">
+			<td class="FormRowField">
+				<b>{$form.cmdType.label}</b><br>				
+				{$form.header.fileCmt1}<br>
+				{$form.header.fileCmt2}
+			</td>
+			<td class="FormRowValue">{$form.cmdType.html}</td>
+		</tr>
+		<tr class="list_one"><td class="FormRowField">{$form.filename.label}</td><td class="FormRowValue">{$form.filename.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.manualDef.label}</td><td class="FormRowValue">{$form.manualDef.html}</td></tr>
+		
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/breakpoint_run.gif'>&nbsp;&nbsp;{$form.header.result}</td></tr>	 	
+		<tr class="list_one"><td class="FormRowField">{$form.debug.label}</td><td class="FormRowValue">{$form.debug.html}</td></tr>
+
+	</table>
+	<br><br>
+	{if $msg}
+	 <table id="ListTable">
+	 	<tr class="ListHeader">
+	 		<td class="FormHeader" colspan="2">
+	 			<img src='./img/icones/16x16/component_add.gif'>&nbsp;&nbsp;{$form.header.status}
+	 		</td>
+	 	</tr>
+	 	<tr class="list_lvl_1">
+	 		<td class="ListColLvl1_name" colspan="2">
+	 			{$msg}
+	 		</td>
+	 	</tr>	 	
+	 </table>
+	{/if}
+	<div align="center" id="validForm"><p  class="oreonbutton">{$form.submit.html}</p></div>
+	{$form.hidden}
+</form>
\ No newline at end of file
diff --git a/www/include/configuration/configLoad/formLoadFiles.php b/www/include/configuration/configLoad/formLoadFiles.php
new file mode 100644
index 0000000000000000000000000000000000000000..86a45931baa93c84d8a5100c66f2c1f3943184ec
--- /dev/null
+++ b/www/include/configuration/configLoad/formLoadFiles.php
@@ -0,0 +1,172 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	#
+	## Form begin
+	#
+	$attrSelect = array("style" => "width: 100px;");
+	$attrsTextarea 	= array("rows"=>"12", "cols"=>"90");
+	
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	$form->addElement('header', 'title', $lang["upl_name"]);
+	
+	$form->addElement('header', 'infos', $lang["upl_infos"]);
+    $form->addElement('select', 'host', $lang["upl_host"], array(0=>"localhost"), $attrSelect);
+    
+	$form->addElement('header', 'opt', $lang["upl_opt"]);
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'del', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'del', null, $lang["no"], '0');
+	$form->addGroup($tab, 'del', $lang["upl_del"], '&nbsp;');
+	$form->setDefaults(array('del' => '0'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'overwrite', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'overwrite', null, $lang["no"], '0');
+	$form->addGroup($tab, 'overwrite', $lang["upl_over"], '&nbsp;');
+	$form->setDefaults(array('overwrite' => '1'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'comment', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'comment', null, $lang["no"], '0');
+	$form->addGroup($tab, 'comment', $lang["upl_comment"], '&nbsp;');
+	$form->setDefaults(array('comment' => '0'));
+			
+	$form->addElement('header', 'fileType', $lang["upl_type"]);
+	$form->addElement('header', 'fileMis1', $lang["upl_mis1"]);
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'Type', null, $lang["upl_typeNag"], 'nagios');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'Type', null, $lang["upl_typeCgi"], 'cgi');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'Type', null, $lang["upl_typeRes"], 'res');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'Type', null, $lang["upl_typeCfg"], 'cfg');
+	$form->addGroup($tab, 'Type', $lang["upl_typeName"], '<br>');
+	$form->setDefaults(array('Type' => array("Type"=>"cfg")));
+	
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'cmdType', null, $lang["upl_typeCmdCheck"], '2');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'cmdType', null, $lang["upl_typeCmdNotif"], '1');
+	$form->addGroup($tab, 'cmdType', $lang["upl_typeCmdType"], '&nbsp;');
+	$form->setDefaults(array('cmdType' => array("cmdType"=>"2")));
+	$form->addElement('header', 'fileCmt1', $lang["upl_typeCmdCmt1"]);
+	$form->addElement('header', 'fileCmt2', $lang["upl_typeCmdCmt2"]);
+
+	$file =& $form->addElement('file', 'filename', $lang["upl_file"]);
+	$form->addElement('textarea', 'manualDef', $lang["upl_manualDef"], $attrsTextarea);
+	
+	$form->addElement('header', 'result', $lang["upl_result"]);	
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'debug', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'debug', null, $lang["no"], '0');
+	$form->addGroup($tab, 'debug', $lang["upl_debug"], '&nbsp;');
+	$form->setDefaults(array('debug' => '0'));
+		
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	# 
+	##End of form definition
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	$sub =& $form->addElement('submit', 'submit', $lang["upl_butOK"]);
+	$msg = NULL;  
+	if ($form->validate()) {
+		$ret = $form->getSubmitValues();
+		$fDataz = array();
+		$buf = NULL;
+		$fDataz =& $file->getValue();
+		# File Moving
+		switch ($fDataz["type"])	{
+			case "application/x-zip-compressed" : $msg .= $fDataz["name"]." ".$lang["upl_uplBadType"]."<br>"; break;
+			case "application/x-gzip" : $file->moveUploadedFile($nagiosCFGPath); $msg .= $fDataz["name"]." ".$lang["upl_uplOk"]."<br>"; break; // tar.gz
+			case "application/octet-stream" : $file->moveUploadedFile($nagiosCFGPath); $msg .= $lang["upl_manualDef"]." ".$lang["upl_uplOk"]."<br>"; break; // Text
+			default : $msg .= $lang["upl_uplKo"]."<br>";
+		}
+		# Buffering Data
+		if (is_file($nagiosCFGPath.$fDataz["name"]))	{
+			$buf =& gzfile($nagiosCFGPath.$fDataz["name"]);
+			$buf ? $msg .= $lang["upl_carrOk"]."<br>" :	$msg .= $lang["upl_carrKo"]."<br>";
+		}
+		else if ($ret["manualDef"])	{
+			$msg .= $lang["upl_manualDefOk"]."<br>";
+			$msg .= $lang["upl_carrOk"]."<br>";
+			$buf =& explode("\n", $ret["manualDef"]);
+		}
+		# Enum Object Types
+		if ($buf)	{
+			switch ($ret["Type"]["Type"])	{
+				case "nagios" :
+					if ($ret["del"]["del"])
+						deleteNagiosCFG();
+					if (insertNagiosCFG($buf))
+						$msg .= "1 ".$lang["upl_newEntries"]."<br>";
+					break;
+				case "cgi" :
+					if ($ret["del"]["del"])
+						deleteCgiCFG();
+					if (insertCgiCFG($buf))
+						$msg .= "1 ".$lang["upl_newEntries"]."<br>";
+					break;
+				case "res" :
+					if ($ret["del"]["del"])
+						deleteResourceCFG();
+					$msg .= insertResourceCFG($buf)." ".$lang["upl_newEntries"]."<br>";
+					break;
+				case "cfg" :
+					if ($ret["del"]["del"])
+						deleteAllConfCFG();
+					$nbr =& insertCFG($buf, $ret);
+					$msg .= "Command :".($nbr["cmd"] ? $nbr["cmd"] : "0")." ".$lang["upl_newEntries"]."<br>";
+					$msg .= "Time Period :".($nbr["tp"] ? $nbr["tp"] : "0")." ".$lang["upl_newEntries"]."<br>";
+					$msg .= "Contact :".($nbr["cct"] ? $nbr["cct"] : "0")." ".$lang["upl_newEntries"]."<br>";
+					$msg .= "Contact Group :".($nbr["cg"] ? $nbr["cg"] : "0")." ".$lang["upl_newEntries"]."<br>";
+					$msg .= "Host :".($nbr["h"] ? $nbr["h"] : "0")." ".$lang["upl_newEntries"]."<br>";
+					$msg .= "Host Extended Infos :".($nbr["hei"] ? $nbr["hei"] : "0")." ".$lang["upl_newEntries"]."<br>";
+					$msg .= "Host Group :".($nbr["hg"] ? $nbr["hg"] : "0")." ".$lang["upl_newEntries"]."<br>";
+					$msg .= "Host Dependency :".($nbr["hd"] ? $nbr["hd"] : "0")." ".$lang["upl_newEntries"]."<br>";
+					$msg .= "Service :".($nbr["sv"] ? $nbr["sv"] : "0")." ".$lang["upl_newEntries"]."<br>";
+					$msg .= "Service Dependency :".($nbr["svd"] ? $nbr["svd"] : "0")." ".$lang["upl_newEntries"]."<br>";
+					$msg .= "Service Group :".($nbr["sg"] ? $nbr["sg"] : "0")." ".$lang["upl_newEntries"]."<br>";
+					$msg .= "Service Group Dependency :".($nbr["sgd"] ? $nbr["sgd"] : "0")." ".$lang["upl_newEntries"]."<br>";
+					break;		
+			}
+		}
+		# Delete File Uploaded
+		if (is_file($nagiosCFGPath.$fDataz["name"]))
+			unlink($nagiosCFGPath.$fDataz["name"]);
+	}
+	
+	$form->addElement('header', 'status', $lang["gen_status"]);
+	if ($msg)
+		$tpl->assign('msg', $msg);
+	
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+	$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());	
+	$tpl->assign('o', $o);		
+	$tpl->display("formLoadFiles.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configLoad/loadFiles.php b/www/include/configuration/configLoad/loadFiles.php
new file mode 100644
index 0000000000000000000000000000000000000000..fe3e0b50e40ac9c598db98b7981025d30ca37b3f
--- /dev/null
+++ b/www/include/configuration/configLoad/loadFiles.php
@@ -0,0 +1,39 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the option dir
+	$path = "./include/configuration/configLoad/";
+	$nagiosCFGPath = "../filesUpload/nagiosCFG/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		default : require_once($path."formLoadFiles.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configNagios/DB-Func.php b/www/include/configuration/configNagios/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..c6dc6cb2730234cb08c5ee499086ea55709f9530
--- /dev/null
+++ b/www/include/configuration/configNagios/DB-Func.php
@@ -0,0 +1,362 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	function testExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('nagios_id');
+		$res =& $pearDB->query("SELECT nagios_name, nagios_id FROM cfg_nagios WHERE nagios_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$nagios =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $nagios["nagios_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $nagios["nagios_id"] != $id)
+			return false;
+		else
+			return true;
+	}	
+	
+	function enableNagiosInDB ($nagios_id = null)	{
+		if (!$nagios_id) return;
+		global $pearDB;
+		global $oreon;
+		$pearDB->query("UPDATE cfg_nagios SET nagios_activate = '0'");
+		$pearDB->query("UPDATE cfg_nagios SET nagios_activate = '1' WHERE nagios_id = '".$nagios_id."'");		
+		$oreon->Nagioscfg = array();
+		$res =& $pearDB->query("SELECT * FROM `cfg_nagios` WHERE `nagios_activate` = '1' LIMIT 1");
+		$oreon->Nagioscfg = $res->fetchRow();
+	}
+	
+	function disableNagiosInDB ($nagios_id = null)	{
+		if (!$nagios_id) return;
+		global $pearDB;
+		global $oreon;
+		$pearDB->query("UPDATE cfg_nagios SET nagios_activate = '0' WHERE nagios_id = '".$nagios_id."'");
+		$res =& $pearDB->query("SELECT MAX(nagios_id) FROM cfg_nagios WHERE nagios_id != '".$nagios_id."'");
+		$maxId =& $res->fetchRow();
+		if (isset($maxId["MAX(nagios_id)"]))	{
+			$pearDB->query("UPDATE cfg_nagios SET nagios_activate = '1' WHERE nagios_id = '".$maxId["MAX(nagios_id)"]."'");					
+			$oreon->Nagioscfg = array();
+			$res =& $pearDB->query("SELECT * FROM `cfg_nagios` WHERE `nagios_activate` = '1' LIMIT 1");
+			$oreon->Nagioscfg = $res->fetchRow();
+		}
+	}
+	
+	function deleteNagiosInDB ($nagios = array())	{
+		global $pearDB;
+		foreach($nagios as $key=>$value)
+			$pearDB->query("DELETE FROM cfg_nagios WHERE nagios_id = '".$key."'");
+		$res =& $pearDB->query("SELECT nagios_id FROM cfg_nagios WHERE nagios_activate = '1'");		  
+		if (!$res->numRows())	{
+			$res =& $pearDB->query("SELECT MAX(nagios_id) FROM cfg_nagios");
+			$nagios_id = $res->fetchRow();
+			$pearDB->query("UPDATE cfg_nagios SET nagios_activate = '1' WHERE nagios_id = '".$nagios_id["MAX(nagios_id)"]."'");
+		}
+	}
+	
+	function multipleNagiosInDB ($nagios = array(), $nbrDup = array())	{
+		foreach($nagios as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM cfg_nagios WHERE nagios_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["nagios_id"] = '';
+			$row["nagios_activate"] = '0';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "nagios_name" ? ($nagios_name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testExistence($nagios_name))	{
+					$val ? $rq = "INSERT INTO cfg_nagios VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+				}
+			}
+		}
+	}
+	
+	function updateNagiosInDB ($nagios_id = NULL)	{
+		if (!$nagios_id) return;
+		updateNagios($nagios_id);
+	}	
+	
+	function insertNagiosInDB ()	{
+		$nagios_id = insertNagios();
+		return ($nagios_id);
+	}
+	
+	function insertNagios($ret = array())	{
+		global $form;
+		global $pearDB;
+		global $oreon;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO cfg_nagios (" .
+				"`nagios_id` , `nagios_name` , `log_file` , `cfg_dir` , `object_cache_file` , `temp_file` , " .
+				"`status_file` , `p1_file`, `aggregate_status_updates` , `status_update_interval` , `nagios_user` , `nagios_group` , " .
+				"`enable_notifications` , `execute_service_checks` , `accept_passive_service_checks` , `execute_host_checks` , " .
+				"`accept_passive_host_checks` , `enable_event_handlers` , `log_rotation_method` , `log_archive_path` , " .
+				"`check_external_commands` , `command_check_interval` , `command_file` , `downtime_file` , `comment_file` , " .
+				"`lock_file` , `retain_state_information` , `state_retention_file` , `retention_update_interval` , " .
+				"`use_retained_program_state` , `use_retained_scheduling_info` , `use_syslog` , `log_notifications` , " .
+				"`log_service_retries` , `log_host_retries` , `log_event_handlers` , `log_initial_states` , " .
+				"`log_external_commands` , `log_passive_service_checks` , `log_passive_checks` , `global_host_event_handler` , " .
+				"`global_service_event_handler` , `sleep_time` , `inter_check_delay_method` , `service_inter_check_delay_method` , " .
+				"`host_inter_check_delay_method` , `service_interleave_factor` , `max_concurrent_checks` , `max_service_check_spread` , " .
+				"`max_host_check_spread` , `service_reaper_frequency` , `interval_length` , `auto_reschedule_checks` , `auto_rescheduling_interval` , " .
+				"`auto_rescheduling_window` , `use_agressive_host_checking` , `enable_flap_detection` , `low_service_flap_threshold` , " .
+				"`high_service_flap_threshold` , `low_host_flap_threshold` , `high_host_flap_threshold` , `soft_state_dependencies` , " .
+				"`service_check_timeout` , `host_check_timeout` , `event_handler_timeout` , `notification_timeout` , `ocsp_timeout` , `ochp_timeout` , " .
+				"`perfdata_timeout` , `obsess_over_services` , `ocsp_command` , `obsess_over_hosts` , `ochp_command` , `process_performance_data` , " .
+				"`host_perfdata_command` , `service_perfdata_command` , `host_perfdata_file` , `service_perfdata_file` , `host_perfdata_file_template` , " .
+				"`service_perfdata_file_template` , `host_perfdata_file_mode` , `service_perfdata_file_mode` , `host_perfdata_file_processing_interval` , " .
+				"`service_perfdata_file_processing_interval` , `host_perfdata_file_processing_command` , `service_perfdata_file_processing_command` , " .
+				"`check_for_orphaned_services` , `check_service_freshness` , `service_freshness_check_interval` , `freshness_check_interval` , " .
+				"`check_host_freshness` , `host_freshness_check_interval` , `date_format` , `illegal_object_name_chars` , `illegal_macro_output_chars` , " .
+				"`use_regexp_matching` , `use_true_regexp_matching` , `admin_email` , `admin_pager` , `nagios_comment` , `nagios_activate` ) ";
+		$rq .= "VALUES (";
+		$rq .= "NULL, ";
+        isset($ret["nagios_name"]) && $ret["nagios_name"] != NULL ? $rq .= "'".htmlentities($ret["nagios_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["log_file"]) && $ret["log_file"] != NULL ? $rq .= "'".htmlentities($ret["log_file"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["cfg_dir"]) && $ret["cfg_dir"] != NULL ? $rq .= "'".htmlentities($ret["cfg_dir"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["object_cache_file"]) && $ret["object_cache_file"] != NULL ? $rq .= "'".htmlentities($ret["object_cache_file"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+       	isset($ret["temp_file"]) && $ret["temp_file"] != NULL ? $rq .= "'".htmlentities($ret["temp_file"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["status_file"]) && $ret["status_file"] != NULL ? $rq .= "'".htmlentities($ret["status_file"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["p1_file"]) && $ret["p1_file"] != NULL ? $rq .= "'".htmlentities($ret["p1_file"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["aggregate_status_updates"]["aggregate_status_updates"]) && $ret["aggregate_status_updates"]["aggregate_status_updates"] != 2 ? $rq .= "'".$ret["aggregate_status_updates"]["aggregate_status_updates"]."',  "  : $rq .= "'2', ";
+        isset($ret["status_update_interval"]) && $ret["status_update_interval"] != NULL ? $rq .= "'".htmlentities($ret["status_update_interval"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+ 	    isset($ret["nagios_user"]) && $ret["nagios_user"] != NULL ? $rq .= "'".htmlentities($ret["nagios_user"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["nagios_group"]) && $ret["nagios_group"] != NULL ? $rq .= "'".htmlentities($ret["nagios_group"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["enable_notifications"]["enable_notifications"]) && $ret["enable_notifications"]["enable_notifications"] != 2 ? $rq .= "'".$ret["enable_notifications"]["enable_notifications"]."',  " : $rq .= "'2', ";
+        isset($ret["execute_service_checks"]["execute_service_checks"]) && $ret["execute_service_checks"]["execute_service_checks"] != 2 ? $rq .= "'".$ret["execute_service_checks"]["execute_service_checks"]."',  " : $rq .= "'2', ";
+        isset($ret["accept_passive_service_checks"]["accept_passive_service_checks"]) && $ret["accept_passive_service_checks"]["accept_passive_service_checks"] != 2 ? $rq .= "'".$ret["accept_passive_service_checks"]["accept_passive_service_checks"]."',  " : $rq .= "'2', ";
+        isset($ret["execute_host_checks"]["execute_host_checks"]) && $ret["execute_host_checks"]["execute_host_checks"] != 2 ? $rq .= "'".$ret["execute_host_checks"]["execute_host_checks"]."',  " : $rq .= "'2', ";
+        isset($ret["accept_passive_host_checks"]["accept_passive_host_checks"]) && $ret["accept_passive_host_checks"]["accept_passive_host_checks"] != 2 ? $rq .= "'".$ret["accept_passive_host_checks"]["accept_passive_host_checks"]."',  " : $rq .= "'2', ";
+        isset($ret["enable_event_handlers"]["enable_event_handlers"]) && $ret["enable_event_handlers"]["enable_event_handlers"] != 2 ? $rq .= "'".$ret["enable_event_handlers"]["enable_event_handlers"]."',  " : $rq .= "'2', ";
+        isset($ret["log_rotation_method"]["log_rotation_method"]) && $ret["log_rotation_method"]["log_rotation_method"] != 2 ? $rq .= "'".$ret["log_rotation_method"]["log_rotation_method"]."',  " : $rq .= "'2', ";        
+        isset($ret["log_archive_path"]) && $ret["log_archive_path"] != NULL ? $rq .= "'".htmlentities($ret["log_archive_path"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["check_external_commands"]["check_external_commands"]) && $ret["check_external_commands"]["check_external_commands"] != 2 ? $rq .= "'".$ret["check_external_commands"]["check_external_commands"]."',  " : $rq .= "'2', ";
+        isset($ret["command_check_interval"]) && $ret["command_check_interval"] != NULL ? $rq .= "'".htmlentities($ret["command_check_interval"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["command_file"]) && $ret["command_file"] != NULL ? $rq .= "'".htmlentities($ret["command_file"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["downtime_file"]) && $ret["downtime_file"] != NULL ? $rq .= "'".htmlentities($ret["downtime_file"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["comment_file"]) && $ret["comment_file"] != NULL ? $rq .= "'".htmlentities($ret["comment_file"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["lock_file"]) && $ret["lock_file"] != NULL ? $rq .= "'".htmlentities($ret["lock_file"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["retain_state_information"]["retain_state_information"]) && $ret["retain_state_information"]["retain_state_information"] != 2 ? $rq .= "'".$ret["retain_state_information"]["retain_state_information"]."',  " : $rq .= "'2', ";
+        isset($ret["state_retention_file"]) && $ret["state_retention_file"] != NULL ? $rq .= "'".htmlentities($ret["state_retention_file"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["retention_update_interval"]) && $ret["retention_update_interval"] != NULL ? $rq .= "'".htmlentities($ret["retention_update_interval"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["use_retained_program_state"]["use_retained_program_state"]) && $ret["use_retained_program_state"]["use_retained_program_state"] != 2 ? $rq .= "'".$ret["use_retained_program_state"]["use_retained_program_state"]."',  " : $rq .= "'2', ";
+        isset($ret["use_retained_scheduling_info"]["use_retained_scheduling_info"]) && $ret["use_retained_scheduling_info"]["use_retained_scheduling_info"] != 2 ? $rq .= "'".$ret["use_retained_scheduling_info"]["use_retained_scheduling_info"]."',  " : $rq .= "'2', ";
+        isset($ret["use_syslog"]["use_syslog"]) && $ret["use_syslog"]["use_syslog"] != 2 ? $rq .= "'".$ret["use_syslog"]["use_syslog"]."',  " : $rq .= "'2', ";
+        isset($ret["log_notifications"]["log_notifications"]) && $ret["log_notifications"]["log_notifications"] != 2 ? $rq .= "'".$ret["log_notifications"]["log_notifications"]."',  " : $rq .= "'2', ";
+        isset($ret["log_service_retries"]["log_service_retries"]) && $ret["log_service_retries"]["log_service_retries"] != 2 ? $rq .= "'".$ret["log_service_retries"]["log_service_retries"]."',  " : $rq .= "'2', ";
+        isset($ret["log_host_retries"]["log_host_retries"]) && $ret["log_host_retries"]["log_host_retries"] != 2 ? $rq .= "'".$ret["log_host_retries"]["log_host_retries"]."',  " : $rq .= "'2', ";
+        isset($ret["log_event_handlers"]["log_event_handlers"]) && $ret["log_event_handlers"]["log_event_handlers"] != 2 ? $rq .= "'".$ret["log_event_handlers"]["log_event_handlers"]."',  " : $rq .= "'2', ";
+        isset($ret["log_initial_states"]["log_initial_states"]) && $ret["log_initial_states"]["log_initial_states"] != 2 ? $rq .= "'".$ret["log_initial_states"]["log_initial_states"]."',  " : $rq .= "'2', ";
+        isset($ret["log_external_commands"]["log_external_commands"]) && $ret["log_external_commands"]["log_external_commands"] != 2 ? $rq .= "'".$ret["log_external_commands"]["log_external_commands"]."',  " : $rq .= "'2', ";
+        isset($ret["log_passive_service_checks"]["log_passive_service_checks"]) && $ret["log_passive_service_checks"]["log_passive_service_checks"] != 2 ?$rq .= "'".$ret["log_passive_service_checks"]["log_passive_service_checks"]."',  " : $rq .= "'2', ";
+        isset($ret["log_passive_checks"]["log_passive_checks"]) && $ret["log_passive_checks"]["log_passive_checks"] != 2 ? $rq .= "'".$ret["log_passive_checks"]["log_passive_checks"]."',  " : $rq .= "'2', ";
+        isset($ret["global_host_event_handler"]) && $ret["global_host_event_handler"] != NULL ? $rq .= "'".$ret["global_host_event_handler"]."',  " : $rq .= "NULL, ";
+	    isset($ret["global_service_event_handler"]) && $ret["global_service_event_handler"] != NULL ? $rq .= "'".$ret["global_service_event_handler"]."',  " : $rq .= "NULL, ";
+        isset($ret["sleep_time"]) && $ret["sleep_time"] != NULL ? $rq .= "'".htmlentities($ret["sleep_time"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["inter_check_delay_method"]) && $ret["inter_check_delay_method"] != NULL ? $rq .= "'".$ret["inter_check_delay_method"]."',  " : $rq .= "NULL, ";
+        isset($ret["service_inter_check_delay_method"]) && $ret["service_inter_check_delay_method"] != NULL ? $rq .= "'".$ret["service_inter_check_delay_method"]."',  " : $rq .= "NULL, ";
+        isset($ret["max_service_check_spread"]) && $ret["max_service_check_spread"] != NULL ? $rq .= "max_service_check_spread = '".htmlentities($ret["max_service_check_spread"], ENT_QUOTES)."',  " : $rq .= "max_service_check_spread = NULL, ";
+        isset($ret["service_interleave_factor"]["service_interleave_factor"]) && $ret["service_interleave_factor"]["service_interleave_factor"] != 2 ? $rq .= "'".$ret["service_interleave_factor"]["service_interleave_factor"]."',  " : $rq .= "'2', ";
+  		isset($ret["max_concurrent_checks"]) && $ret["max_concurrent_checks"] != NULL ? $rq .= "'".htmlentities($ret["max_concurrent_checks"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["service_reaper_frequency"]) && $ret["service_reaper_frequency"] != NULL ? $rq .= "'".htmlentities($ret["service_reaper_frequency"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["host_inter_check_delay_method"]) && $ret["host_inter_check_delay_method"] != NULL ? $rq .= "'".$ret["host_inter_check_delay_method"]."',  " : $rq .= "NULL, ";
+        isset($ret["max_host_check_spread"]) && $ret["max_host_check_spread"] != NULL ? $rq .= "'".htmlentities($ret["max_host_check_spread"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["interval_length"]) && $ret["interval_length"] != NULL ? $rq .= "'".htmlentities($ret["interval_length"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["auto_reschedule_checks"]["auto_reschedule_checks"]) && $ret["auto_reschedule_checks"]["auto_reschedule_checks"] != 2 ? $rq .= "'".$ret["auto_reschedule_checks"]["auto_reschedule_checks"]."', " : $rq .= "'2', ";
+        isset($ret["auto_rescheduling_interval"]) && $ret["auto_rescheduling_interval"] != NULL ? $rq .= "'".htmlentities($ret["auto_rescheduling_interval"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["auto_rescheduling_window"]) && $ret["auto_rescheduling_window"] != NULL ? $rq .= "'".htmlentities($ret["auto_rescheduling_window"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["use_agressive_host_checking"]["use_agressive_host_checking"]) && $ret["use_agressive_host_checking"]["use_agressive_host_checking"] != 2 ? $rq .= "'".$ret["use_agressive_host_checking"]["use_agressive_host_checking"]."',  " : $rq .= "'2', ";
+        isset($ret["enable_flap_detection"]["enable_flap_detection"]) && $ret["enable_flap_detection"]["enable_flap_detection"] != 2 ? $rq .= "'".$ret["enable_flap_detection"]["enable_flap_detection"]."',  " : $rq .= "'2', ";
+        isset($ret["low_service_flap_threshold"]) && $ret["low_service_flap_threshold"] != NULL ? $rq .= "'".htmlentities($ret["low_service_flap_threshold"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["high_service_flap_threshold"]) && $ret["high_service_flap_threshold"] != NULL ? $rq .= "'".htmlentities($ret["high_service_flap_threshold"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["low_host_flap_threshold"]) && $ret["low_host_flap_threshold"] != NULL ? $rq .= "'".htmlentities($ret["low_host_flap_threshold"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["high_host_flap_threshold"]) && $ret["high_host_flap_threshold"] != NULL ? $rq .= "'".htmlentities($ret["high_host_flap_threshold"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["soft_state_dependencies"]["soft_state_dependencies"]) && $ret["soft_state_dependencies"]["soft_state_dependencies"] != 2 ? $rq .= "'".$ret["soft_state_dependencies"]["soft_state_dependencies"]."',  " : $rq .= "'2', ";
+        isset($ret["service_check_timeout"]) && $ret["service_check_timeout"] != NULL ? $rq .= "'".htmlentities($ret["service_check_timeout"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["host_check_timeout"]) && $ret["host_check_timeout"] != NULL ? $rq .= "'".htmlentities($ret["host_check_timeout"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["event_handler_timeout"]) && $ret["event_handler_timeout"] != NULL ? $rq .= "'".htmlentities($ret["event_handler_timeout"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["notification_timeout"]) && $ret["notification_timeout"] != NULL ? $rq .= "'".htmlentities($ret["notification_timeout"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["ocsp_timeout"]) && $ret["ocsp_timeout"] != NULL ? $rq .= "'".htmlentities($ret["ocsp_timeout"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["ochp_timeout"]) && $ret["ochp_timeout"] != NULL ? $rq .= "'".htmlentities($ret["ochp_timeout"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["perfdata_timeout"]) && $ret["perfdata_timeout"] != NULL ? $rq .= "'".htmlentities($ret["perfdata_timeout"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["obsess_over_services"]["obsess_over_services"]) && $ret["obsess_over_services"]["obsess_over_services"] != 2 ? $rq .= "'".$ret["obsess_over_services"]["obsess_over_services"]."',  " : $rq .= "'2', ";
+        isset($ret["ocsp_command"]) && $ret["ocsp_command"] != NULL ? $rq .= "'".htmlentities($ret["ocsp_command"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["obsess_over_hosts"]["obsess_over_hosts"]) && $ret["obsess_over_hosts"]["obsess_over_hosts"] != 2 ? $rq .= "'".$ret["obsess_over_hosts"]["obsess_over_hosts"]."',  " : $rq .= "'2', ";
+        isset($ret["ochp_command"]) && $ret["ochp_command"] != NULL ? $rq .= "'".htmlentities($ret["ochp_command"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["process_performance_data"]["process_performance_data"]) && $ret["process_performance_data"]["process_performance_data"] != 2 ? $rq .= "'".$ret["process_performance_data"]["process_performance_data"]."',  " : $rq .= "'2', ";
+        isset($ret["host_perfdata_command"]) && $ret["host_perfdata_command"] != NULL ? $rq .= "'".htmlentities($ret["host_perfdata_command"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["service_perfdata_command"]) && $ret["service_perfdata_command"] != NULL ? $rq .= "'".htmlentities($ret["service_perfdata_command"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["host_perfdata_file"]) && $ret["host_perfdata_file"] != NULL ? $rq .= "'".htmlentities($ret["host_perfdata_file"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["service_perfdata_file"]) && $ret["service_perfdata_file"] != NULL ? $rq .= "'".htmlentities($ret["service_perfdata_file"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["host_perfdata_file_template"]) && $ret["host_perfdata_file_template"] != NULL ? $rq .= "'".htmlentities($ret["host_perfdata_file_template"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["service_perfdata_file_template"]) && $ret["service_perfdata_file_template"] != NULL ? $rq .= "'".htmlentities($ret["service_perfdata_file_template"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["host_perfdata_file_mode"]["host_perfdata_file_mode"]) && $ret["host_perfdata_file_mode"]["host_perfdata_file_mode"] != NULL ? $rq .= "'".$ret["host_perfdata_file_mode"]["host_perfdata_file_mode"]."',  " : $rq .= "NULL, ";
+        isset($ret["service_perfdata_file_mode"]["service_perfdata_file_mode"]) && $ret["service_perfdata_file_mode"]["service_perfdata_file_mode"] != NULL ? $rq .= "'".$ret["service_perfdata_file_mode"]["service_perfdata_file_mode"]."',  " : $rq .= "NULL, ";
+        isset($ret["host_perfdata_file_processing_interval"]) && $ret["host_perfdata_file_processing_interval"] != NULL ? $rq .= "'".htmlentities($ret["host_perfdata_file_processing_interval"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["service_perfdata_file_processing_interval"]) && $ret["service_perfdata_file_processing_interval"] != NULL ? $rq .= "'".htmlentities($ret["service_perfdata_file_processing_interval"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["host_perfdata_file_processing_command"]) && $ret["host_perfdata_file_processing_command"] != NULL ? $rq .= "'".htmlentities($ret["host_perfdata_file_processing_command"])."',  " : $rq .= "NULL, ";
+        isset($ret["service_perfdata_file_processing_command"]) && $ret["service_perfdata_file_processing_command"] != NULL ? $rq .= "'".htmlentities($ret["service_perfdata_file_processing_command"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+		isset($ret["check_for_orphaned_services"]["check_for_orphaned_services"]) && $ret["check_for_orphaned_services"]["check_for_orphaned_services"] != 2 ? $rq .= "'".$ret["check_for_orphaned_services"]["check_for_orphaned_services"]."',  " : $rq .= "'2', ";
+		isset($ret["check_service_freshness"]["check_service_freshness"]) && $ret["check_service_freshness"]["check_service_freshness"] != 2 ? $rq .= "'".$ret["check_service_freshness"]["check_service_freshness"]."',  " : $rq .= "'2', ";
+		isset($ret["service_freshness_check_interval"]) && $ret["service_freshness_check_interval"] != NULL ? $rq .= "'".htmlentities($ret["service_freshness_check_interval"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+	    isset($ret["freshness_check_interval"]) && $ret["freshness_check_interval"] != NULL ? $rq .= "'".htmlentities($ret["freshness_check_interval"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["check_host_freshness"]["check_host_freshness"]) && $ret["check_host_freshness"]["check_host_freshness"] != 2 ? $rq .= "'".$ret["check_host_freshness"]["check_host_freshness"]."',  " : $rq .= "'2', ";
+        isset($ret["host_freshness_check_interval"]) && $ret["host_freshness_check_interval"] != NULL ? $rq .= "'".htmlentities($ret["host_freshness_check_interval"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["date_format"]) && $ret["date_format"] != NULL ? $rq .= "'".htmlentities($ret["date_format"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["illegal_object_name_chars"]) && $ret["illegal_object_name_chars"] != NULL ? $rq .= "'".htmlentities($ret["illegal_object_name_chars"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["illegal_macro_output_chars"]) && $ret["illegal_macro_output_chars"] != NULL ? $rq .= "'".htmlentities($ret["illegal_macro_output_chars"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["use_regexp_matching"]["use_regexp_matching"]) && $ret["use_regexp_matching"]["use_regexp_matching"] != 2 ? $rq .= "'".$ret["use_regexp_matching"]["use_regexp_matching"]."',  " : $rq .= "'2', ";
+        isset($ret["use_true_regexp_matching"]["use_true_regexp_matching"]) && $ret["use_true_regexp_matching"]["use_true_regexp_matching"] != 2 ? $rq .= "'".$ret["use_true_regexp_matching"]["use_true_regexp_matching"]."',  " : $rq .= "'2', ";
+        isset($ret["admin_email"]) && $ret["admin_email"] != NULL ? $rq .= "'".htmlentities($ret["admin_email"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["admin_pager"]) && $ret["admin_pager"] != NULL ? $rq .= "'".htmlentities($ret["admin_pager"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["nagios_comment"]) && $ret["nagios_comment"] != NULL ? $rq .= "'".htmlentities($ret["nagios_comment"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["nagios_activate"]["nagios_activate"]) && $ret["nagios_activate"]["nagios_activate"] != NULL ? $rq .= "'".$ret["nagios_activate"]["nagios_activate"]."')" : $rq .= "'0')";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(nagios_id) FROM cfg_nagios");
+		$nagios_id = $res->fetchRow();
+		if (isset($ret["nagios_activate"]["nagios_activate"]) && $ret["nagios_activate"]["nagios_activate"])	{
+			$pearDB->query("UPDATE cfg_nagios SET nagios_activate = '0' WHERE nagios_id != '".$nagios_id["MAX(nagios_id)"]."'");
+			$oreon->Nagioscfg = array();
+			$res =& $pearDB->query("SELECT * FROM `cfg_nagios` WHERE `nagios_activate` = '1' LIMIT 1");
+			$oreon->Nagioscfg = $res->fetchRow();
+		}
+		return ($nagios_id["MAX(nagios_id)"]);
+	}
+	
+	function updateNagios($nagios_id = null)	{
+		if (!$nagios_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE cfg_nagios SET ";
+        isset($ret["nagios_name"]) && $ret["nagios_name"] != NULL ? $rq .= "nagios_name = '".htmlentities($ret["nagios_name"], ENT_QUOTES)."', " : $rq .= "nagios_name = NULL, ";
+        isset($ret["log_file"]) && $ret["log_file"] != NULL ? $rq .= "log_file = '".htmlentities($ret["log_file"], ENT_QUOTES)."', " : $rq .= "log_file = NULL, ";
+		isset($ret["cfg_dir"]) && $ret["cfg_dir"] != NULL ? $rq .= "cfg_dir = '".htmlentities($ret["cfg_dir"], ENT_QUOTES)."',  " : $rq .= "cfg_dir = NULL, ";
+        isset($ret["object_cache_file"]) && $ret["object_cache_file"] != NULL ? $rq .= "object_cache_file = '".htmlentities($ret["object_cache_file"], ENT_QUOTES)."',  " : $rq .= "object_cache_file = NULL, ";
+       	isset($ret["temp_file"]) && $ret["temp_file"] != NULL ? $rq .= "temp_file = '".htmlentities($ret["temp_file"], ENT_QUOTES)."',  " : $rq .= "temp_file = NULL, ";
+        isset($ret["status_file"]) && $ret["status_file"] != NULL ? $rq .= "status_file = '".htmlentities($ret["status_file"], ENT_QUOTES)."',  " : $rq .= "status_file = NULL, ";
+        isset($ret["p1_file"]) && $ret["p1_file"] != NULL ? $rq .= "p1_file = '".htmlentities($ret["p1_file"], ENT_QUOTES)."',  " : $rq .= "p1_file = NULL, ";
+        isset($ret["aggregate_status_updates"]["aggregate_status_updates"]) && $ret["aggregate_status_updates"]["aggregate_status_updates"] != 2 ? $rq .= "aggregate_status_updates = '".$ret["aggregate_status_updates"]["aggregate_status_updates"]."',  "  : $rq .= "aggregate_status_updates  = '2', ";
+        isset($ret["status_update_interval"]) && $ret["status_update_interval"] != NULL ? $rq .= "status_update_interval = '".htmlentities($ret["status_update_interval"], ENT_QUOTES)."',  " : $rq .= "status_update_interval = NULL, ";
+ 	    isset($ret["nagios_user"]) && $ret["nagios_user"] != NULL ? $rq .= "nagios_user = '".htmlentities($ret["nagios_user"], ENT_QUOTES)."',  " : $rq .= "nagios_user = NULL, ";
+        isset($ret["nagios_group"]) && $ret["nagios_group"] != NULL ? $rq .= "nagios_group = '".htmlentities($ret["nagios_group"], ENT_QUOTES)."',  " : $rq .= "nagios_group = NULL, ";
+        isset($ret["enable_notifications"]["enable_notifications"]) && $ret["enable_notifications"]["enable_notifications"] != 2 ? $rq .= "enable_notifications = '".$ret["enable_notifications"]["enable_notifications"]."',  " : $rq .= "enable_notifications = '2', ";
+        isset($ret["execute_service_checks"]["execute_service_checks"]) && $ret["execute_service_checks"]["execute_service_checks"] != 2 ? $rq .= "execute_service_checks = '".$ret["execute_service_checks"]["execute_service_checks"]."',  " : $rq .= "execute_service_checks = '2', ";
+        isset($ret["accept_passive_service_checks"]["accept_passive_service_checks"]) && $ret["accept_passive_service_checks"]["accept_passive_service_checks"] != 2 ? $rq .= "accept_passive_service_checks = '".$ret["accept_passive_service_checks"]["accept_passive_service_checks"]."',  " : $rq .= "accept_passive_service_checks = '2', ";
+        isset($ret["execute_host_checks"]["execute_host_checks"]) && $ret["execute_host_checks"]["execute_host_checks"] != 2 ? $rq .= "execute_host_checks = '".$ret["execute_host_checks"]["execute_host_checks"]."',  " : $rq .= "execute_host_checks = '2', ";
+        isset($ret["accept_passive_host_checks"]["accept_passive_host_checks"]) && $ret["accept_passive_host_checks"]["accept_passive_host_checks"] != 2 ? $rq .= "accept_passive_host_checks = '".$ret["accept_passive_host_checks"]["accept_passive_host_checks"]."',  " : $rq .= "accept_passive_host_checks = '2', ";
+        isset($ret["enable_event_handlers"]["enable_event_handlers"]) && $ret["enable_event_handlers"]["enable_event_handlers"] != 2 ? $rq .= "enable_event_handlers = '".$ret["enable_event_handlers"]["enable_event_handlers"]."',  " : $rq .= "enable_event_handlers = '2', ";
+        isset($ret["log_rotation_method"]["log_rotation_method"]) && $ret["log_rotation_method"]["log_rotation_method"] != 2 ? $rq .= "log_rotation_method = '".$ret["log_rotation_method"]["log_rotation_method"]."',  " : $rq .= "log_rotation_method = '2', ";        
+        isset($ret["log_archive_path"]) && $ret["log_archive_path"] != NULL ? $rq .= "log_archive_path = '".htmlentities($ret["log_archive_path"], ENT_QUOTES)."',  " : $rq .= "log_archive_path = NULL, ";
+        isset($ret["check_external_commands"]["check_external_commands"]) && $ret["check_external_commands"]["check_external_commands"] != 2 ? $rq .= "check_external_commands = '".$ret["check_external_commands"]["check_external_commands"]."',  " : $rq .= "check_external_commands = '2', ";
+        isset($ret["command_check_interval"]) && $ret["command_check_interval"] != NULL ? $rq .= "command_check_interval = '".htmlentities($ret["command_check_interval"], ENT_QUOTES)."',  " : $rq .= "command_check_interval = NULL, ";
+        isset($ret["command_file"]) && $ret["command_file"] != NULL ? $rq .= "command_file = '".htmlentities($ret["command_file"], ENT_QUOTES)."',  " : $rq .= "command_file = NULL, ";
+        isset($ret["downtime_file"]) && $ret["downtime_file"] != NULL ? $rq .= "downtime_file = '".htmlentities($ret["downtime_file"], ENT_QUOTES)."',  " : $rq .= "downtime_file = NULL, ";
+        isset($ret["comment_file"]) && $ret["comment_file"] != NULL ? $rq .= "comment_file = '".htmlentities($ret["comment_file"], ENT_QUOTES)."',  " : $rq .= "comment_file = NULL, ";
+        isset($ret["lock_file"]) && $ret["lock_file"] != NULL ? $rq .= "lock_file = '".htmlentities($ret["lock_file"], ENT_QUOTES)."',  " : $rq .= "lock_file = NULL, ";
+        isset($ret["retain_state_information"]["retain_state_information"]) && $ret["retain_state_information"]["retain_state_information"] != 2 ? $rq .= "retain_state_information = '".$ret["retain_state_information"]["retain_state_information"]."',  " : $rq .= "retain_state_information = '2', ";
+        isset($ret["state_retention_file"]) && $ret["state_retention_file"] != NULL ? $rq .= "state_retention_file = '".htmlentities($ret["state_retention_file"], ENT_QUOTES)."',  " : $rq .= "state_retention_file = NULL, ";
+        isset($ret["retention_update_interval"]) && $ret["retention_update_interval"] != NULL ? $rq .= "retention_update_interval = '".htmlentities($ret["retention_update_interval"], ENT_QUOTES)."',  " : $rq .= "retention_update_interval = NULL, ";
+        isset($ret["use_retained_program_state"]["use_retained_program_state"]) && $ret["use_retained_program_state"]["use_retained_program_state"] != 2 ? $rq .= "use_retained_program_state = '".$ret["use_retained_program_state"]["use_retained_program_state"]."',  " : $rq .= "use_retained_program_state = '2', ";
+        isset($ret["use_retained_scheduling_info"]["use_retained_scheduling_info"]) && $ret["use_retained_scheduling_info"]["use_retained_scheduling_info"] != 2 ? $rq .= "use_retained_scheduling_info = '".$ret["use_retained_scheduling_info"]["use_retained_scheduling_info"]."',  " : $rq .= "use_retained_scheduling_info = '2', ";
+        isset($ret["use_syslog"]["use_syslog"]) && $ret["use_syslog"]["use_syslog"] != 2 ? $rq .= "use_syslog = '".$ret["use_syslog"]["use_syslog"]."',  " : $rq .= "use_syslog = '2', ";
+        isset($ret["log_notifications"]["log_notifications"]) && $ret["log_notifications"]["log_notifications"] != 2 ? $rq .= "log_notifications = '".$ret["log_notifications"]["log_notifications"]."',  " : $rq .= "log_notifications = '2', ";
+        isset($ret["log_service_retries"]["log_service_retries"]) && $ret["log_service_retries"]["log_service_retries"] != 2 ? $rq .= "log_service_retries = '".$ret["log_service_retries"]["log_service_retries"]."',  " : $rq .= "log_service_retries = '2', ";
+        isset($ret["log_host_retries"]["log_host_retries"]) && $ret["log_host_retries"]["log_host_retries"] != 2 ? $rq .= "log_host_retries = '".$ret["log_host_retries"]["log_host_retries"]."',  " : $rq .= "log_host_retries = '2', ";
+        isset($ret["log_event_handlers"]["log_event_handlers"]) && $ret["log_event_handlers"]["log_event_handlers"] != 2 ? $rq .= "log_event_handlers = '".$ret["log_event_handlers"]["log_event_handlers"]."',  " : $rq .= "log_event_handlers = '2', ";
+        isset($ret["log_initial_states"]["log_initial_states"]) && $ret["log_initial_states"]["log_initial_states"] != 2 ? $rq .= "log_initial_states = '".$ret["log_initial_states"]["log_initial_states"]."',  " : $rq .= "log_initial_states = '2', ";
+        isset($ret["log_external_commands"]["log_external_commands"]) && $ret["log_external_commands"]["log_external_commands"] != 2 ? $rq .= "log_external_commands = '".$ret["log_external_commands"]["log_external_commands"]."',  " : $rq .= "log_external_commands = '2', ";
+        isset($ret["log_passive_service_checks"]["log_passive_service_checks"]) && $ret["log_passive_service_checks"]["log_passive_service_checks"] != 2 ?$rq .= "log_passive_service_checks = '".$ret["log_passive_service_checks"]["log_passive_service_checks"]."',  " : $rq .= "log_passive_service_checks = '2', ";
+        isset($ret["log_passive_checks"]["log_passive_checks"]) && $ret["log_passive_checks"]["log_passive_checks"] != 2 ? $rq .= "log_passive_checks = '".$ret["log_passive_checks"]["log_passive_checks"]."',  " : $rq .= "log_passive_checks = '2', ";
+        isset($ret["global_host_event_handler"]) && $ret["global_host_event_handler"] != NULL ? $rq .= "global_host_event_handler = '".$ret["global_host_event_handler"]."',  " : $rq .= "global_host_event_handler = NULL, ";
+	    isset($ret["global_service_event_handler"]) && $ret["global_service_event_handler"] != NULL ? $rq .= "global_service_event_handler = '".$ret["global_service_event_handler"]."',  " : $rq .= "global_service_event_handler = NULL, ";
+        isset($ret["sleep_time"]) && $ret["sleep_time"] != NULL ? $rq .= "sleep_time = '".htmlentities($ret["sleep_time"], ENT_QUOTES)."',  " : $rq .= "sleep_time = NULL, ";
+        isset($ret["inter_check_delay_method"]) && $ret["inter_check_delay_method"] != NULL ? $rq .= "inter_check_delay_method = '".$ret["inter_check_delay_method"]."',  " : $rq .= "inter_check_delay_method = NULL, ";
+        isset($ret["service_inter_check_delay_method"]) && $ret["service_inter_check_delay_method"] != NULL ? $rq .= "service_inter_check_delay_method = '".$ret["service_inter_check_delay_method"]."',  " : $rq .= "service_inter_check_delay_method = NULL, ";
+        isset($ret["max_service_check_spread"]) && $ret["max_service_check_spread"] != NULL ? $rq .= "max_service_check_spread = '".htmlentities($ret["max_service_check_spread"], ENT_QUOTES)."',  " : $rq .= "max_service_check_spread = NULL, ";
+        isset($ret["service_interleave_factor"]["service_interleave_factor"]) && $ret["service_interleave_factor"]["service_interleave_factor"] != 2 ? $rq .= "service_interleave_factor = '".$ret["service_interleave_factor"]["service_interleave_factor"]."',  " : $rq .= "service_interleave_factor = '2', ";
+  		isset($ret["max_concurrent_checks"]) && $ret["max_concurrent_checks"] != NULL ? $rq .= "max_concurrent_checks = '".htmlentities($ret["max_concurrent_checks"], ENT_QUOTES)."',  " : $rq .= "max_concurrent_checks = NULL, ";
+        isset($ret["service_reaper_frequency"]) && $ret["service_reaper_frequency"] != NULL ? $rq .= "service_reaper_frequency = '".htmlentities($ret["service_reaper_frequency"], ENT_QUOTES)."',  " : $rq .= "service_reaper_frequency = NULL, ";
+        isset($ret["host_inter_check_delay_method"]) && $ret["host_inter_check_delay_method"] != NULL ? $rq .= "host_inter_check_delay_method  = '".$ret["host_inter_check_delay_method"]."',  " : $rq .= "host_inter_check_delay_method  = NULL, ";
+        isset($ret["max_host_check_spread"]) && $ret["max_host_check_spread"] != NULL ? $rq .= "max_host_check_spread = '".htmlentities($ret["max_host_check_spread"], ENT_QUOTES)."',  " : $rq .= "max_host_check_spread = NULL, ";
+        isset($ret["interval_length"]) && $ret["interval_length"] != NULL ? $rq .= "interval_length = '".htmlentities($ret["interval_length"], ENT_QUOTES)."',  " : $rq .= "interval_length = NULL, ";
+        isset($ret["auto_reschedule_checks"]["auto_reschedule_checks"]) && $ret["auto_reschedule_checks"]["auto_reschedule_checks"] != 2 ? $rq .= "auto_reschedule_checks = '".$ret["auto_reschedule_checks"]["auto_reschedule_checks"]."', " : $rq .= "auto_reschedule_checks = '2', ";
+        isset($ret["auto_rescheduling_interval"]) && $ret["auto_rescheduling_interval"] != NULL ? $rq .= "auto_rescheduling_interval = '".htmlentities($ret["auto_rescheduling_interval"], ENT_QUOTES)."', " : $rq .= "auto_rescheduling_interval = NULL, ";
+        isset($ret["auto_rescheduling_window"]) && $ret["auto_rescheduling_window"] != NULL ? $rq .= "auto_rescheduling_window = '".htmlentities($ret["auto_rescheduling_window"], ENT_QUOTES)."', " : $rq .= "auto_rescheduling_window = NULL, ";
+        isset($ret["use_agressive_host_checking"]["use_agressive_host_checking"]) && $ret["use_agressive_host_checking"]["use_agressive_host_checking"] != 2 ? $rq .= "use_agressive_host_checking   = '".$ret["use_agressive_host_checking"]["use_agressive_host_checking"]."',  " : $rq .= "use_agressive_host_checking   = '2', ";
+        isset($ret["enable_flap_detection"]["enable_flap_detection"]) && $ret["enable_flap_detection"]["enable_flap_detection"] != 2 ? $rq .= "enable_flap_detection = '".$ret["enable_flap_detection"]["enable_flap_detection"]."',  " : $rq .= "enable_flap_detection = '2', ";
+        isset($ret["low_service_flap_threshold"]) && $ret["low_service_flap_threshold"] != NULL ? $rq .= "low_service_flap_threshold = '".htmlentities($ret["low_service_flap_threshold"], ENT_QUOTES)."',  " : $rq .= "low_service_flap_threshold = NULL, ";
+        isset($ret["high_service_flap_threshold"]) && $ret["high_service_flap_threshold"] != NULL ? $rq .= "high_service_flap_threshold = '".htmlentities($ret["high_service_flap_threshold"], ENT_QUOTES)."',  " : $rq .= "high_service_flap_threshold = NULL, ";
+        isset($ret["low_host_flap_threshold"]) && $ret["low_host_flap_threshold"] != NULL ? $rq .= "low_host_flap_threshold = '".htmlentities($ret["low_host_flap_threshold"], ENT_QUOTES)."',  " : $rq .= "low_host_flap_threshold = NULL, ";
+        isset($ret["high_host_flap_threshold"]) && $ret["high_host_flap_threshold"] != NULL ? $rq .= "high_host_flap_threshold = '".htmlentities($ret["high_host_flap_threshold"], ENT_QUOTES)."',  " : $rq .= "high_host_flap_threshold = NULL, ";
+        isset($ret["soft_state_dependencies"]["soft_state_dependencies"]) && $ret["soft_state_dependencies"]["soft_state_dependencies"] != 2 ? $rq .= "soft_state_dependencies   = '".$ret["soft_state_dependencies"]["soft_state_dependencies"]."',  " : $rq .= "soft_state_dependencies   = '2', ";
+        isset($ret["service_check_timeout"]) && $ret["service_check_timeout"] != NULL ? $rq .= "service_check_timeout = '".htmlentities($ret["service_check_timeout"], ENT_QUOTES)."',  " : $rq .= "service_check_timeout = NULL, ";
+        isset($ret["host_check_timeout"]) && $ret["host_check_timeout"] != NULL ? $rq .= "host_check_timeout = '".htmlentities($ret["host_check_timeout"], ENT_QUOTES)."',  " : $rq .= "host_check_timeout = NULL, ";
+        isset($ret["event_handler_timeout"]) && $ret["event_handler_timeout"] != NULL ? $rq .= "event_handler_timeout = '".htmlentities($ret["event_handler_timeout"], ENT_QUOTES)."',  " : $rq .= "event_handler_timeout = NULL, ";
+        isset($ret["notification_timeout"]) && $ret["notification_timeout"] != NULL ? $rq .= "notification_timeout = '".htmlentities($ret["notification_timeout"], ENT_QUOTES)."',  " : $rq .= "notification_timeout = NULL, ";
+        isset($ret["ocsp_timeout"]) && $ret["ocsp_timeout"] != NULL ? $rq .= "ocsp_timeout = '".htmlentities($ret["ocsp_timeout"], ENT_QUOTES)."',  " : $rq .= "ocsp_timeout = NULL, ";
+        isset($ret["ochp_timeout"]) && $ret["ochp_timeout"] != NULL ? $rq .= "ochp_timeout = '".htmlentities($ret["ochp_timeout"], ENT_QUOTES)."',  " : $rq .= "ochp_timeout = NULL, ";
+        isset($ret["perfdata_timeout"]) && $ret["perfdata_timeout"] != NULL ? $rq .= "perfdata_timeout = '".htmlentities($ret["perfdata_timeout"], ENT_QUOTES)."',  " : $rq .= "perfdata_timeout = NULL, ";
+        isset($ret["obsess_over_services"]["obsess_over_services"]) && $ret["obsess_over_services"]["obsess_over_services"] != 2 ? $rq .= "obsess_over_services  = '".$ret["obsess_over_services"]["obsess_over_services"]."',  " : $rq .= "obsess_over_services  = '2', ";
+        isset($ret["ocsp_command"]) && $ret["ocsp_command"] != NULL ? $rq .= "ocsp_command = '".htmlentities($ret["ocsp_command"], ENT_QUOTES)."',  " : $rq .= "ocsp_command = NULL, ";
+        isset($ret["obsess_over_hosts"]["obsess_over_hosts"]) && $ret["obsess_over_hosts"]["obsess_over_hosts"] != 2 ? $rq .= "obsess_over_hosts = '".$ret["obsess_over_hosts"]["obsess_over_hosts"]."',  " : $rq .= "obsess_over_hosts = '2', ";
+        isset($ret["ochp_command"]) && $ret["ochp_command"] != NULL ? $rq .= "ochp_command  = '".htmlentities($ret["ochp_command"], ENT_QUOTES)."',  " : $rq .= "ochp_command  = NULL, ";
+        isset($ret["process_performance_data"]["process_performance_data"]) && $ret["process_performance_data"]["process_performance_data"] != 2 ? $rq .= "process_performance_data   = '".$ret["process_performance_data"]["process_performance_data"]."',  " : $rq .= "process_performance_data   = '2', ";
+        isset($ret["host_perfdata_command"]) && $ret["host_perfdata_command"] != NULL ? $rq .= "host_perfdata_command = '".htmlentities($ret["host_perfdata_command"], ENT_QUOTES)."',  " : $rq .= "host_perfdata_command = NULL, ";
+        isset($ret["service_perfdata_command"]) && $ret["service_perfdata_command"] != NULL ? $rq .= "service_perfdata_command = '".htmlentities($ret["service_perfdata_command"], ENT_QUOTES)."',  " : $rq .= "service_perfdata_command = NULL, ";
+        isset($ret["host_perfdata_file"]) && $ret["host_perfdata_file"] != NULL ? $rq .= "host_perfdata_file = '".htmlentities($ret["host_perfdata_file"], ENT_QUOTES)."',  " : $rq .= "host_perfdata_file = NULL, ";
+        isset($ret["service_perfdata_file"]) && $ret["service_perfdata_file"] != NULL ? $rq .= "service_perfdata_file = '".htmlentities($ret["service_perfdata_file"], ENT_QUOTES)."',  " : $rq .= "service_perfdata_file = NULL, ";
+        isset($ret["host_perfdata_file_template"]) && $ret["host_perfdata_file_template"] != NULL ? $rq .= "host_perfdata_file_template = '".htmlentities($ret["host_perfdata_file_template"], ENT_QUOTES)."',  " : $rq .= "host_perfdata_file_template = NULL, ";
+        isset($ret["service_perfdata_file_template"]) && $ret["service_perfdata_file_template"] != NULL ? $rq .= "service_perfdata_file_template = '".htmlentities($ret["service_perfdata_file_template"], ENT_QUOTES)."',  " : $rq .= "service_perfdata_file_template = NULL, ";
+        isset($ret["host_perfdata_file_mode"]["host_perfdata_file_mode"]) && $ret["host_perfdata_file_mode"]["host_perfdata_file_mode"] != NULL ? $rq .= "host_perfdata_file_mode  = '".$ret["host_perfdata_file_mode"]["host_perfdata_file_mode"]."',  " : $rq .= "host_perfdata_file_mode  = NULL, ";
+        isset($ret["service_perfdata_file_mode"]["service_perfdata_file_mode"]) && $ret["service_perfdata_file_mode"]["service_perfdata_file_mode"] != NULL ? $rq .= "service_perfdata_file_mode  = '".$ret["service_perfdata_file_mode"]["service_perfdata_file_mode"]."',  " : $rq .= "service_perfdata_file_mode  = NULL, ";
+        isset($ret["host_perfdata_file_processing_interval"]) && $ret["host_perfdata_file_processing_interval"] != NULL ? $rq .= "host_perfdata_file_processing_interval  = '".htmlentities($ret["host_perfdata_file_processing_interval"], ENT_QUOTES)."',  " : $rq .= "host_perfdata_file_processing_interval  = NULL, ";
+        isset($ret["service_perfdata_file_processing_interval"]) && $ret["service_perfdata_file_processing_interval"] != NULL ? $rq .= "service_perfdata_file_processing_interval  = '".htmlentities($ret["service_perfdata_file_processing_interval"], ENT_QUOTES)."',  " : $rq .= "service_perfdata_file_processing_interval  = NULL, ";
+        isset($ret["host_perfdata_file_processing_command"]) && $ret["host_perfdata_file_processing_command"] != NULL ? $rq .= "host_perfdata_file_processing_command  = '".htmlentities($ret["host_perfdata_file_processing_command"])."',  " : $rq .= "host_perfdata_file_processing_command  = NULL, ";
+        isset($ret["service_perfdata_file_processing_command"]) && $ret["service_perfdata_file_processing_command"] != NULL ? $rq .= "service_perfdata_file_processing_command  = '".htmlentities($ret["service_perfdata_file_processing_command"], ENT_QUOTES)."',  " : $rq .= "service_perfdata_file_processing_command  = NULL, ";
+		isset($ret["check_for_orphaned_services"]["check_for_orphaned_services"]) && $ret["check_for_orphaned_services"]["check_for_orphaned_services"] != 2 ? $rq .= "check_for_orphaned_services  = '".$ret["check_for_orphaned_services"]["check_for_orphaned_services"]."',  " : $rq .= "check_for_orphaned_services  = '2', ";
+		isset($ret["check_service_freshness"]["check_service_freshness"]) && $ret["check_service_freshness"]["check_service_freshness"] != 2 ? $rq .= "check_service_freshness  = '".$ret["check_service_freshness"]["check_service_freshness"]."',  " : $rq .= "check_service_freshness   = '2', ";
+		isset($ret["service_freshness_check_interval"]) && $ret["service_freshness_check_interval"] != NULL ? $rq .= "service_freshness_check_interval   = '".htmlentities($ret["service_freshness_check_interval"], ENT_QUOTES)."',  " : $rq .= "service_freshness_check_interval   = NULL, ";
+	    isset($ret["freshness_check_interval"]) && $ret["freshness_check_interval"] != NULL ? $rq .= "freshness_check_interval = '".htmlentities($ret["freshness_check_interval"], ENT_QUOTES)."',  " : $rq .= "freshness_check_interval = NULL, ";
+        isset($ret["check_host_freshness"]["check_host_freshness"]) && $ret["check_host_freshness"]["check_host_freshness"] != 2 ? $rq .= "check_host_freshness = '".$ret["check_host_freshness"]["check_host_freshness"]."',  " : $rq .= "check_host_freshness = '2', ";
+        isset($ret["host_freshness_check_interval"]) && $ret["host_freshness_check_interval"] != NULL ? $rq .= "host_freshness_check_interval = '".htmlentities($ret["host_freshness_check_interval"], ENT_QUOTES)."',  " : $rq .= "host_freshness_check_interval = NULL, ";
+        isset($ret["date_format"]) && $ret["date_format"] != NULL ? $rq .= "date_format = '".htmlentities($ret["date_format"], ENT_QUOTES)."',  " : $rq .= "date_format = NULL, ";
+        isset($ret["illegal_object_name_chars"]) && $ret["illegal_object_name_chars"] != NULL ? $rq .= "illegal_object_name_chars  = '".htmlentities($ret["illegal_object_name_chars"], ENT_QUOTES)."',  " : $rq .= "illegal_object_name_chars  = NULL, ";
+        isset($ret["illegal_macro_output_chars"]) && $ret["illegal_macro_output_chars"] != NULL ? $rq .= "illegal_macro_output_chars  = '".htmlentities($ret["illegal_macro_output_chars"], ENT_QUOTES)."',  " : $rq .= "illegal_macro_output_chars  = NULL, ";
+        isset($ret["use_regexp_matching"]["use_regexp_matching"]) && $ret["use_regexp_matching"]["use_regexp_matching"] != 2 ? $rq .= "use_regexp_matching = '".$ret["use_regexp_matching"]["use_regexp_matching"]."',  " : $rq .= "use_regexp_matching = '2', ";
+        isset($ret["use_true_regexp_matching"]["use_true_regexp_matching"]) && $ret["use_true_regexp_matching"]["use_true_regexp_matching"] != 2 ? $rq .= "use_true_regexp_matching = '".$ret["use_true_regexp_matching"]["use_true_regexp_matching"]."',  " : $rq .= "use_true_regexp_matching = '2', ";
+        isset($ret["admin_email"]) && $ret["admin_email"] != NULL ? $rq .= "admin_email = '".htmlentities($ret["admin_email"], ENT_QUOTES)."',  " : $rq .= "admin_email = NULL, ";
+        isset($ret["admin_pager"]) && $ret["admin_pager"] != NULL ? $rq .= "admin_pager = '".htmlentities($ret["admin_pager"], ENT_QUOTES)."', " : $rq .= "admin_pager = NULL, ";
+        isset($ret["nagios_comment"]) && $ret["nagios_comment"] != NULL ? $rq .= "nagios_comment = '".htmlentities($ret["nagios_comment"], ENT_QUOTES)."', " : $rq .= "nagios_comment = NULL, ";
+		$rq .= "nagios_activate = '".$ret["nagios_activate"]["nagios_activate"]."' ";
+		$rq .= "WHERE nagios_id = '".$nagios_id."'";
+		$pearDB->query($rq);
+		if ($ret["nagios_activate"]["nagios_activate"])
+			enableNagiosInDB($nagios_id);
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configNagios/comments.php b/www/include/configuration/configNagios/comments.php
new file mode 100644
index 0000000000000000000000000000000000000000..6f06b255e2a365aaa60e16cc819ab38415a001c5
--- /dev/null
+++ b/www/include/configuration/configNagios/comments.php
@@ -0,0 +1,479 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Jean Baptiste Gouret - Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+
+$nagios_comment = array();
+
+$nagios_comment["log_file"] = "This is the main log file where service and host events are logged for historical purposes.  This should be the first option specified in the config file!!!";
+
+$nagios_comment["cfg_file"]=" This is the configuration file in which you define hosts, host groups, contacts, contact groups, services, etc.  I guess it would "
+ . "be better called an object definition file, but for historical reasons it isn\'t.  You can split object definitions into several "
+ . "different config files by using multiple cfg_file statements here. Nagios will read and process all the config files you define. "
+ . "This can be very useful if you want to keep command definitions  separate from host and contact definitions... "
+ . "Plugin commands (service and host check commands) Arguments are likely to change between different releases of the "
+ . "plugins, so you should use the same config file provided with the plugin release rather than the one provided with Nagios. ";
+
+$nagios_comment["status_file"]="This is where the current status of all monitored services and "
+ . "hosts is stored.  Its contents are read and processed by the CGIs. "
+ . "The contentsof the status file are deleted every time Nagios "
+ . "restarts. ";
+ 
+$nagios_comment["object_cache_file"] = "This directive is used to specify a file in which a cached copy of object definitions should be stored."
+. "The cache file is (re)created every time Nagios is (re)started and is used by the CGIs."
+. "It is intended to speed up config file caching in the CGIs and allow you to edit the source object config files while Nagios is running without affecting the output displayed in the CGIs."; 
+
+$nagios_comment["nagios_user"]=" NAGIOS USER "
+ . "This determines the effective user that Nagios should run as.   "
+ . "You can either supply a username or a UID. ";
+
+$nagios_comment["nagios_group"]=" NAGIOS GROUP "
+ . "This determines the effective group that Nagios should run as.  " 
+ . "You can either supply a group name or a GID. ";
+
+$nagios_comment["check_external_commands"]="This option allows you to specify whether or not Nagios should check "
+ . "for external commands (in the command file defined below).  By default "
+ . "Nagios will *not* check for external commands, just to be on the "
+ . "cautious side.  If you want to be able to use the CGI command interface "
+ . "you will have to enable this.  Setting this value to 0 disables command "
+ . "checking (the default), other values enable it. ";
+
+$nagios_comment["command_check_interval"]="This is the interval at which Nagios should check for external commands. "
+ . "This value works of the interval_length you specify later.  If you leave "
+ . "that at its default value of 60 (seconds), a value of 1 here will cause "
+ . "Nagios to check for external commands every minute.  If you specify a "
+ . "number followed by an &laquo;s&raquo; (i.e. 15s), this will be interpreted to mean "
+ . "actual seconds rather than a multiple of the interval_length variable. "
+ . "Note: In addition to reading the external command file at regularly  "
+ . "scheduled intervals, Nagios will also check for external commands after "
+ . "event handlers are executed. "
+ . "NOTE: Setting this value to -1 causes Nagios to check the external "
+ . "command file as often as possible. ";
+
+
+
+$nagios_comment["command_file"]="This is the file that Nagios checks for external command requests. "
+  . "It is also where the command CGI will write commands that are submitted "
+  . "by users, so it must be writeable by the user that the web server "
+  . "is running as (usually &laquo;nobody&raquo;).  Permissions should be set at the  "
+  . "directory level instead of on the file, as the file is deleted every "
+  . "time its contents are processed. ";
+
+
+
+$nagios_comment["comment_file"]="This is the file that Nagios will use for storing host and service "
+  . "comments. ";
+
+$nagios_comment["downtime_file"]="This is the file that Nagios will use for storing host and service "
+  . "downtime data. ";
+
+
+$nagios_comment["lock_file"]="This is the lockfile that Nagios will use to store its PID number "
+  . "in when it is running in daemon mode. ";
+
+$nagios_comment["temp_file"]="This is a temporary file< that is used as scratch space when Nagios "
+  . "updates the status log, cleans the comment file, etc.  This file "
+  . "is created, used, and deleted throughout the time that Nagios is "
+  . "running. ";
+
+
+$nagios_comment["log_rotation_method"]="This is the log rotation method that Nagios should use to rotate "
+  . "the main log file. Values are as follows..<br> "
+ 	. "n	= None - don\'t rotate the log <br>"
+ 	. "h	= Hourly rotation (top of the hour) <br>"
+ 	. "d	= Daily rotation (midnight every day)<br> "
+ 	. "w	= Weekly rotation (midnight on Saturday evening)<br> "
+ 	. "m	= Monthly rotation (midnight last day of month)<br> ";
+
+$nagios_comment["log_archive_path"]="This is the directory where archived (rotated) log files should be  "
+  . "placed (assuming you\'ve chosen to do log rotation). ";
+
+$nagios_comment["use_syslog"]="If you want messages logged to the syslog facility, as well as the "
+  . "NetAlarm log file set this option to 1.  If not, set it to 0. ";
+
+$nagios_comment["log_notifications"]="If you don\'t want notifications to be logged, set this value to 0. "
+  . "If notifications should be logged, set the value to 1. ";
+
+$nagios_comment["log_service_retries"]="If you don\'t want service check retries to be logged, set this value "
+  . "to 0.  If retries should be logged, set the value to 1. ";
+
+$nagios_comment["log_host_retries"]="If you don\'t want host check retries to be logged, set this value to "
+  . "0.  If retries should be logged, set the value to 1. ";
+
+$nagios_comment["log_event_handlers"]="If you don\'t want host and service event handlers to be logged, set "
+  . "this value to 0.  If event handlers should be logged, set the value "
+  . "to 1.";
+
+$nagios_comment["log_initial_states"]="If you want Nagios to log all initial host and service states to "
+  . "the main log file (the first time the service or host is checked) "
+  . "you can enable this option by setting this value to 1.  If you "
+  . "are not using an external application that does long term state "
+  . "statistics reporting, you do not need to enable this option.  In "
+  . "this case, set the value to 0. ";
+
+$nagios_comment["log_external_commands"]="If you don\'t want Nagios to log external commands, set this value "
+  . "to 0.  If external commands should be logged, set this value to 1. "
+  . "Note: This option does not include logging of passive service "
+  . "checks - see the option below for controlling whether or not "
+  . "passive checks are logged. ";
+
+$nagios_comment["log_passive_service_checks"]="If you don\'t want Nagios to log passive service checks, set this "
+  . "value to 0.  If passive service checks should be logged, set this "
+  . "value to 1. ";
+
+$nagios_comment["inter_check"]="This is the method that Nagios should use when initially "
+  . "&laquo;spreading out&raquo; service checks when it starts monitoring.  The "
+  . "default is to use smart delay calculation, which will try to "
+  . "space all service checks out evenly to minimize CPU load. "
+  . "Using the dumb setting will cause all checks to be scheduled "
+  . "at the same time (with no delay between them)!  This is not a "
+  . "good thing for production, but is useful when testing the "
+  . "parallelization functionality. <br>"
+ 	. "n	= None - don\'t use any delay between checks <br>"
+ 	. "d	= Use a &laquo;dumb&raquo; delay of 1 second between checks <br>"
+ 	. "s	= Use &laquo;smart&raquo; inter-check delay calculation <br>"
+    . "   x.xx    = Use an inter-check delay of x.xx seconds ";
+
+$nagios_comment["service_inter_check"]="This option allows you to control how service checks are initially &laquo;spread out&laquo; in the event queue.<br>"
+  . "Using a &laquo;smart&laquo; delay calculation (the default) will cause Nagios to calculate an average check interval and spread initial checks of all services out over that interval, thereby helping to eliminate CPU load spikes.<br>"
+  . "Using no delay is generally not recommended unless you are testing the service check parallelization functionality.<br>"
+  . "no delay will cause all service checks to be scheduled for execution at the same time.<br>"
+  . "This means that you will generally have large CPU spikes when the services are all executed in parallel.<br>"
+  . "Values are as follows :<br> "
+ 	. "n	= None - don\'t use any delay between checks to run immediately (i.e. at the same time!) <br>"
+ 	. "d	= Use a &laquo;dumb&raquo; delay of 1 second between checks <br>"
+ 	. "s	= Use &laquo;smart&raquo; inter-check delay calculation to spread service checks out evenly (default)<br>"
+    . "   x.xx    = Use a user-supplied inter-check delay of x.xx seconds";
+
+
+$nagios_comment["host_inter_check"]="This option allows you to control how host checks that are scheduled to be checked on a regular basis are initially &laquo;spread out&laquo; in the event queue.<br>"
+  . "Using a &laquo;smart&laquo; delay calculation (the default) will cause Nagios to calculate an average check interval and spread initial checks of all hosts out over that interval, thereby helping to eliminate CPU load spikes.<br>"
+  . "Using no delay is generally not recommended.<br>"
+  . "Using no delay will cause all host checks to be scheduled for execution at the same time.<br>"
+  . "Values are as follows :<br> "
+ 	. "n	= None - don\'t use any delay - schedule all host checks to run immediately (i.e. at the same time!) <br>"
+ 	. "d	= Use a &laquo;dumb&raquo; delay of 1 second between host checks <br>"
+ 	. "s	= Use &laquo;smart&raquo; delay calculation to spread host checks out evenly (default) <br>"
+    . "   x.xx    = Use a user-supplied inter-check delay of x.xx seconds";
+
+$nagios_comment["service_interleave_factor"]="This variable determines how service checks are interleaved. "
+  . "Interleaving the service checks allows for a more even "
+  . "distribution of service checks and reduced load on remote"
+  . "hosts.  Setting this value to 1 is equivalent to how versions "
+  . "of Nagios previous to 0.0.5 did service checks.  Set this "
+  . "value to s (smart) for automatic calculation of the interleave "
+  . "factor unless you have a specific reason to change it.<br> "
+  . "      s       = Use &laquo;smart&raquo; interleave factor calculation<br> "
+  . "      x       = Use an interleave factor of x, where x is a <br>"
+  . "               number greater than or equal to 1. ";
+
+$nagios_comment["max_concurrent_checks"]="This option allows you to specify the maximum number of  "
+  . "service checks that can be run in parallel at any given time. "
+  . "Specifying a value of 1 for this variable essentially prevents "
+  . "any service checks from being parallelized.  A value of 0 "
+  . "will not restrict the number of concurrent checks that are "
+  . "being executed. ";
+ 
+$nagios_comment["max_service_check_spread"]="This option determines the maximum number of minutes from when Nagios starts that all services (that are scheduled to be regularly checked) are checked.<br>"
+  . "This option will automatically adjust the service inter-check delay (if necessary) to ensure that the initial checks of all services occur within the timeframe you specify.<br>"
+  . "In general, this option will not have an affect on service check scheduling if scheduling information is being retained using the use_retained_scheduling_info option.<br>"
+  . "Default value is 30 (minutes). ";
+
+$nagios_comment["max_host_check_spread"]="This option determines the maximum number of minutes from when Nagios starts that all hosts (that are scheduled to be regularly checked) are checked.<br>"
+  . "This option will automatically adjust the host inter-check delay (if necessary) to ensure that the initial checks of all hosts occur within the timeframe you specify.<br>"
+  . "In general, this option will not have an affect on host check scheduling if scheduling information is being retained using the use_retained_scheduling_info option.<br>"
+  . "Default value is 30 (minutes). ";
+ 
+$nagios_comment["service_reaper_frequency"]="This is the frequency (in seconds!) that Nagios will process "
+  . "the results of services that have been checked. ";
+
+$nagios_comment["sleep_time"]="This is the number of seconds to sleep between checking for system "
+  . "events and service checks that need to be run.  I would recommend "
+  . "*not* changing this from its default value of 1 second. ";
+
+$nagios_comment["timeout"]="These options control how much time Nagios will allow various "
+  . "types of commands to execute before killing them off.  Options "
+  . "are available for controlling maximum time allotted for "
+  . "service checks, host checks, event handlers, notifications, the "
+  . "ocsp command, and performance data commands.  All values are in "
+  . "seconds. ";
+
+$nagios_comment["retain_state_information"]="This setting determines whether or not Nagios will save state "
+  . "information for services and hosts before it shuts down.  Upon "
+  . "startup Nagios will reload all saved service and host state "
+  . "information before starting to monitor.  This is useful for  "
+  . "maintaining long-term data on state statistics, etc, but will "
+  . "slow Nagios down a bit when it re starts.  Since its only "
+  . "a one-time penalty, I think its well worth the additional "
+  . "startup delay. ";
+
+$nagios_comment["state_retention_file"]="This is the file that Nagios should use to store host and "
+  . "service state information before it shuts down. The state  "
+  . "information in this file is also read immediately prior to "
+  . "starting to monitor the network when Nagios is restarted. "
+  . "This file is used only if the preserve_state_information "
+  . "variable is set to 1. ";
+
+$nagios_comment["retention_update_interval"]="This setting determines how often (in minutes) that Nagios "
+  . "will automatically save retention data during normal operation. "
+  . "If you set this value to 0, Nagios will not save retention "
+  . "data at regular interval, but it will still save retention "
+  . "data before shutting down or restarting.  If you have disabled "
+  . "state retention, this option has no effect. ";
+
+$nagios_comment["use_retained_program_state"]="This setting determines whether or not Nagios will set  "
+  . "program status variables based on the values saved in the "
+  . "retention file. If you want to use retained program status "
+  . "information, set this value to 1.  If not, set this value "
+  . "to 0. ";
+  
+$nagios_comment["use_retained_scheduling_info"]="This setting determines whether or not Nagios will retain scheduling info (next check times) for hosts and services when it restarts.<br>"
+  . "If you are adding a large number (or percentage) of hosts and services, I would recommend disabling this option when you first restart Nagios, as it can adversely skew the spread of initial checks.<br>"
+  . "Otherwise you will probably want to leave it enabled.";
+
+$nagios_comment["interval_length"]="This is the seconds per unit interval as used in the "
+  . "host/contact/service configuration files.  Setting this to 60 means "
+  . "that each interval is one minute long (60 seconds).  Other settings "
+  . "have not been tested much, so your mileage is likely to vary... ";
+
+$nagios_comment["use_agressive_host_checking"]="If you don\'t want to turn on agressive host checking features, set "
+  . "this value to 0 (the default).  Otherwise set this value to 1 to "
+  . "enable the agressive check option.  Read the docs for more info "
+  . "on what agressive host check is or check out the source code in "
+  . "base/checks.c ";
+
+$nagios_comment["execute_service_checks"]="This determines whether or not Nagios will actively execute "
+  . "service checks when it initially starts.  If this option is  "
+  . "disabled, checks are not actively made, but Nagios can still "
+  . "receive and process passive check results that come in.  Unless "
+  . "you\'re implementing redundant hosts or have a special need for "
+  . "disabling the execution of service checks, leave this enabled! "
+  . "Values: 1 = enable checks, 0 = disable checks ";
+
+$nagios_comment["accept_passive_service_checks"]="This determines whether or not Nagios will accept passive "
+  . "service checks results when it initially (re)starts. "
+  . "Values: 1 = accept passive checks, 0 = reject passive checks ";
+  
+$nagios_comment["log_passive_checks"]="This variable determines whether or not Nagios will log passive host and service checks that it receives from the external command file.<br>"
+  . "If you are setting up a distributed monitoring environment or plan on handling a large number of passive checks on a regular basis, you may wish to disable this option so your log file doesn\'t get too large.";
+
+$nagios_comment["execute_host_checks"]="This option determines whether or not Nagios will execute on-demand and regularly scheduled host checks when it initially (re)starts. "
+  . "If this option is disabled, Nagios will not actively execute any host checks, although it can still accept passive host checks unless you\'ve disabled them).<br>"
+ . "This option is most often used when configuring backup monitoring servers, as described in the documentation on redundancy, or when setting up a distributed monitoring environment.";
+
+$nagios_comment["accept_passive_host_checks"]= "This option determines whether or not Nagios will accept passive host checks when it initially (re)starts.<br>"
+  . "If this option is disabled, Nagios will not accept any passive host checks.";
+
+$nagios_comment["enable_notifications"]="This determines whether or not Nagios will sent out any host or "
+  . "service notifications when it is initially (re)started. "
+  . "Values: 1 = enable notifications, 0 = disable notifications ";
+
+$nagios_comment["enable_event_handlers"]="This determines whether or not Nagios will run any host or "
+  . "service event handlers when it is initially (re)started.  Unless "
+  . "you\'re implementing redundant hosts, leave this option enabled. "
+  . "Values: 1 = enable event handlers, 0 = disable event handlers ";
+
+$nagios_comment["process_performance_data"]="This determines whether or not Nagios will process performance "
+  . "data returned from service and host checks.  If this option is "
+  . "enabled, host performance data will be processed using the "
+  . "host_perfdata_command (defined below) and service performance "
+  . "data will be processed using the service_perfdata_command (also "
+  . "defined below).  Read the HTML docs for more information on "
+  . "performance data. "
+  . "Values: 1 = process performance data, 0 = do not process performance data ";
+
+ $nagios_comment["host_perfdata_command"]="This option allows you to specify a command to be run after every host check to process host performance data that may be returned from the check.<br>"
+  . "The command argument is the short name of a command definition that you define in your object configuration file.<br>"
+  . "This command is only executed if the process_performance_data option is enabled globally and if the process_perf_data directive in the host definition is enabled.";
+
+ $nagios_comment["service_perfdata_command"]="This option allows you to specify a command to be run after every service check to process service performance data that may be returned from the check.<br>"
+  . "The command argument is the short name of a command definition that you define in your object configuration file.<br>"
+  . "This command is only executed if the process_performance_data option is enabled globally and if the process_perf_data directive in the service definition is enabled.";
+ 
+  $nagios_comment["host_perfdata_file"]="This option allows you to specify a file to which host performance data will be written after every host check.<br>"
+  . "Data will be written to the performance file as specified by the host_perfdata_file_template option.<br>"
+  . "Performance data is only written to this file if the process_performance_data option is enabled globally and if the process_perf_data directive in the host definition is enabled.";
+
+ $nagios_comment["service_perfdata_file"]="This option allows you to specify a file to which service performance data will be written after every service check.<br>"
+  . "Data will be written to the performance file as specified by the service_perfdata_file_template option. <br>"
+  . "Performance data is only written to this file if the process_performance_data option is enabled globally and if the process_perf_data directive in the service definition is enabled.";
+  
+  $nagios_comment["host_perfdata_file_template"]="This option determines what (and how) data is written to the host performance data file.<br>"
+  . "The template may contain macros, special characters ( t for tab, r for carriage return, n for newline) and plain text.<br>"
+  . "A newline is automatically added after each write to the performance data file.";
+
+ $nagios_comment["service_perfdata_file_template"]="This option determines what (and how) data is written to the service performance data file.<br>"
+  . "The template may contain macros, special characters (t for tab, r for carriage return, n for newline) and plain text.<br>"
+  . "A newline is automatically added after each write to the performance data file.";
+  
+  $nagios_comment["host_perfdata_file_mode"]="This option determines whether the host performance data file is opened in write or append mode.<br>"
+  . "Unless the file is a named pipe, you will probably want to use the default mode of append.<br>"
+  . "a = Open file in append mode (default)<br>w = Open file in write mode ";
+
+ $nagios_comment["service_perfdata_file_mode"]="This option determines whether the service performance data file is opened in write or append mode.<br>"
+  . "Unless the file is a named pipe, you will probably want to use the default mode of append.<br>"
+  . "a = Open file in append mode (default)<br>w = Open file in write mode ";
+ 
+  $nagios_comment["host_perfdata_file_processing_interval"]="This option allows you to specify the interval (in seconds) at which the host performance data file is processed using the host performance data file processing command.<br>"
+  . "A value of 0 indicates that the performance data file should not be processed at regular intervals.";
+
+ $nagios_comment["service_perfdata_file_processing_interval"]="This option allows you to specify the interval (in seconds) at which the service performance data file is processed using the service performance data file processing command.<br>"
+  . "A value of 0 indicates that the performance data file should not be processed at regular intervals.";
+  
+ $nagios_comment["host_perfdata_file_processing_command"]="This option allows you to specify the command that should be executed to process the host performance data file.<br>"
+ . "The command argument is the short name of a command definition that you define in your object configuration file.<br>"
+  . "The interval at which this command is executed is determined by the host_perfdata_file_processing_interval directive.";
+
+ $nagios_comment["service_perfdata_file_processing_command"]="This option allows you to specify the command that should be executed to process the service performance data file.<br>"
+ . "The command argument is the short name of a command definition that you define in your object configuration file.<br>"
+  . "The interval at which this command is executed is determined by the service_perfdata_file_processing_interval directive.";
+ 
+$nagios_comment["obsess_over_services"]="This determines whether or not Nagios will obsess over service "
+  . "checks and run the ocsp_command defined below.  Unless you\'re "
+  . "planning on implementing distributed monitoring, do not enable "
+  . "this option.  Read the HTML docs for more information on "
+  . "implementing distributed monitoring. "
+  . "Values: 1 = obsess over services, 0 = do not obsess (default) ";
+  
+$nagios_comment["obsess_over_hosts"]="This value determines whether or not Nagios will &laquo;obsess&laquo; over host checks results and run the obsessive compulsive host processor command you define.<br>"
+  . "I know - funny name, but it was all I could think of.<br>"
+  . "This option is useful for performing distributed monitoring.<br>"
+  . "If you're not doing distributed monitoring, don't enable this option.";
+
+$nagios_comment["ocsp_command"]="This is the command that is run for every service check that is "
+  . "processed by Nagios.  This command is executed only if the "
+  . "obsess_over_service option (above) is set to 1.  The command  "
+  . "argument is the short name of a command definition that you "
+  . "define in your host configuration file. Read the HTML docs for "
+  . "more information on implementing distributed monitoring. ";
+
+$nagios_comment["ochp_command"]="This option allows you to specify a command to be run after every host check, which can be useful in distributed monitoring.<br>"
+  . "This command is executed after any event handler or notification commands.<br>"
+  . "The command argument is the short name of a command definition that you define in your object configuration file.<br>"
+  . "The maximum amount of time that this command can run is controlled by the ochp_timeout option.<br>"
+  . "This command is only executed if the obsess_over_hosts option is enabled globally and if the obsess_over_host directive in the host definition is enabled.";
+  
+$nagios_comment["check_for_orphaned_services"]="This determines whether or not Nagios will periodically  "
+  . "check for orphaned services.  Since service checks are not "
+  . "rescheduled until the results of their previous execution  "
+  . "instance are processed, there exists a possibility that some "
+  . "checks may never get rescheduled.  This seems to be a rare "
+  . "problem and should not happen under normal circumstances. "
+  . "If you have problems with service checks never getting "
+  . "rescheduled, you might want to try enabling this option. "
+  . "Values: 1 = enable checks, 0 = disable checks ";
+
+$nagios_comment["check_service_freshness"]="This option determines whether or not Nagios will periodically "
+  . "check the freshness of service results.  Enabling this option "
+  . "is useful for ensuring passive checks are received in a timely "
+  . "manner. "
+  . "Values: 1 = enabled freshness checking, 0 = disable freshness checking ";
+
+$nagios_comment["service_freshness_check_interval"]="This setting determines how often (in seconds) Nagios will periodically check the &laquo;freshness&laquo; of service check results.<br>"
+  . "If you have disabled service freshness checking (with the check_service_freshness option), this option has no effect.";
+ 
+$nagios_comment["check_host_freshness"]="This option determines whether or not Nagios will periodically check the &laquo;freshness&laquo; of host checks.<br>"
+  . "Enabling this option is useful for helping to ensure that passive host checks are received in a timely manner.";
+
+$nagios_comment["host_freshness_check_interval"]="This setting determines how often (in seconds) Nagios will periodically check the &laquo;freshness&laquo; of host check results.<br>"
+  . "If you have disabled host freshness checking (with the check_host_freshness option), this option has no effect.";
+  
+$nagios_comment["freshness_check_interval"]="This setting determines how often (in seconds) Nagios will "
+  . "check the freshness of service check results.  If you have "
+  . "disabled service freshness checking, this option has no effect. ";
+
+$nagios_comment["aggregate_status_updates"]="This option determines whether or not Nagios will  "
+  . "aggregate updates of host, service, and program status "
+  . "data.  Normally, status data is updated immediately when "
+  . "a change occurs.  This can result in high CPU loads if "
+  . "you are monitoring a lot of services.  If you want Nagios "
+  . "to only refresh status data every few seconds, disable "
+  . "this option. "
+  . "Values: 1 = enable aggregate updates, 0 = disable aggregate updates ";
+
+$nagios_comment["status_update_interval"]="Combined with the aggregate_status_updates option, "
+  . "this option determines the frequency (in seconds!) that "
+  . "Nagios will periodically dump program, host, and  "
+  . "service status data.  If you are not using aggregated "
+  . "status data updates, this option has no effect. ";
+
+$nagios_comment["enable_flap_detection"]="This option determines whether or not Nagios will try "
+  . "and detect hosts and services that are flapping.   "
+  . "Flapping occurs when a host or service changes between "
+  . "states too frequently.  When Nagios detects that a  "
+  . "host or service is flapping, it will temporarily supress "
+  . "notifications for that host/service until it stops "
+  . "flapping.  Flap detection is very experimental, so read "
+  . "the HTML documentation before enabling this feature! "
+  . "Values: 1 = enable flap detection "
+  . "        0 = disable flap detection (default) ";
+
+
+$nagios_comment["flap_threshold"]="Read the HTML documentation on flap detection for "
+  . "an explanation of what this option does.  This option "
+  . "has no effect if flap detection is disabled. ";
+
+$nagios_comment["date_format"]="This option determines how short dates are displayed. Valid options "
+  . "include:<br> "
+  . "us		(MM-DD-YYYY HH:MM:SS) <br>"
+  . "euro    	(DD-MM-YYYY HH:MM:SS) <br>"
+  . "iso8601		(YYYY-MM-DD HH:MM:SS) <br>"
+  . "strict-iso8601	(YYYY-MM-DDTHH:MM:SS) ";
+ 
+$nagios_comment["illegal_object_name_chars"]="This options allows you to specify illegal characters that cannot "
+  . "be used in host names, service descriptions, or names of other "
+  . "object types. ";
+ 
+$nagios_comment["use_regexp_matching"]="If you\'ve enabled regular expression matching of various object directives using the use_regexp_matching option, this option will determine when object directives are treated as regular expressions.<br>"
+  . "If this option is disabled (the default), directives will only be treated as regular expressions if the contain a * or ? wildcard character.<br>"
+  . "If this option is enabled, all appropriate directives will be treated as regular expression - be careful when enabling this!<br>"
+  . "0 = Don\'t use true regular expression matching (default)<br>1 = Use true regular expression matching ";
+ 
+ $nagios_comment["use_true_regexp_matching"]="If you\'ve enabled regular expression matching of various object directives using the use_regexp_matching option, this option will determine when object directives are treated as regular expressions.<br>"
+  . "If this option is disabled (the default), directives will only be treated as regular expressions if the contain a * or ? wildcard character..<br>"
+  . "If this option is enabled, all appropriate directives will be treated as regular expression - be careful when enabling this!<br>"
+  . "0 = Don\'t use regular expression matching (default)<br>1 = Use regular expression matching ";
+  
+$nagios_comment["illegal_macro_output_chars"]="This options allows you to specify illegal characters that are "
+  . "stripped from macros before being used in notifications, event "
+  . "handlers, etc.  This DOES NOT affect macros used in service or "
+  . "host check commands. "
+  . "The following macros are stripped of the characters you specify: "
+  . "	\$OUTPUT\$, \$PERFDATA\$ ";
+
+$nagios_comment["admin_email"]="The email address of the administrator of *this* machine (the one "
+  . "doing the monitoring).  Nagios never uses this value itself, but "
+  . "you can access this value by using the \$ADMINEMAIL\$ macro in your "
+  . "notification commands. ";
+
+$nagios_comment["admin_pager"]="The pager number/address for the administrator of *this* machine. "
+  . "Nagios never uses this value itself, but you can access this "
+  . "value by using the \$ADMINPAGER\$ macro in your notification "
+  . "commands. ";
+  
+$nagios_comment["auto_reschedule_checks"]="This option determines whether or not Nagios will attempt to automatically reschedule active host and service checks to  &laquo;smooth&laquo; them out over time.<br>"
+  . "This can help to balance the load on the monitoring server, as it will attempt to keep the time between consecutive checks consistent, at the expense of executing checks on a more rigid schedule.";
+ 
+$nagios_comment["auto_rescheduling_interval"]="This option determines how often (in seconds) Nagios will attempt to automatically reschedule checks.<br>"
+  . "This option only has an effect if the auto_reschedule_checks option is enabled.<br>"
+  . "Default is 30 seconds.";
+  
+$nagios_comment["auto_rescheduling_window"]="This option determines the &laquo;window&laquo; of time (in seconds) that Nagios will look at when automatically rescheduling checks.<br>"
+  . "Only host and service checks that occur in the next X seconds (determined by this variable) will be rescheduled.<br>"
+  . "This option only has an effect if the auto_reschedule_checks option is enabled.<br>"
+  . "Default is 180 seconds (3 minutes).";
+
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configNagios/formNagios.ihtml b/www/include/configuration/configNagios/formNagios.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..35f06761b261c9c38df587987744a398d26a7627
--- /dev/null
+++ b/www/include/configuration/configNagios/formNagios.ihtml
@@ -0,0 +1,215 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/text_code_colored.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.nagios_name.label}</td><td class="FormRowValue">{$form.nagios_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.nagios_comment.label}</td><td class="FormRowValue">{$form.nagios_comment.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.nagios_activate.label}</td><td class="FormRowValue">{$form.nagios_activate.html}</td></tr>
+		
+		<!-- Part 1 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.log_file.label}</td><td class="FormRowValue">{$form.log_file.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.cfg_dir.label}</td><td class="FormRowValue">{$form.cfg_dir.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.temp_file.label}</td><td class="FormRowValue">{$form.temp_file.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.p1_file.label}</td><td class="FormRowValue">{$form.p1_file.html}</td></tr>
+		{if $msg.nagios == 2}
+			<tr class="list_one"><td class="FormRowField">{$form.object_cache_file.label}</td><td class="FormRowValue">{$form.object_cache_file.html}</td></tr>		
+		{/if}
+		
+		<!-- Part 2 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.status_file.label}</td><td class="FormRowValue">{$form.status_file.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.aggregate_status_updates.label}</td><td class="FormRowValue">{$form.aggregate_status_updates.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.status_update_interval.label}</td><td class="FormRowValue">{$form.status_update_interval.html}</td></tr>
+	
+		<!-- Part 3 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>	
+		<tr class="list_one"><td class="FormRowField">{$form.nagios_user.label}</td><td class="FormRowValue">{$form.nagios_user.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.nagios_group.label}</td><td class="FormRowValue">{$form.nagios_group.html}</td></tr>
+		
+		<!-- Part 4 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>	
+		<tr class="list_one"><td class="FormRowField">{$form.enable_notifications.label}</td><td class="FormRowValue">{$form.enable_notifications.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.execute_service_checks.label}</td><td class="FormRowValue">{$form.execute_service_checks.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.accept_passive_service_checks.label}</td><td class="FormRowValue">{$form.accept_passive_service_checks.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.enable_event_handlers.label}</td><td class="FormRowValue">{$form.enable_event_handlers.html}</td></tr>
+		{if $msg.nagios == 2}
+			<tr class="list_one"><td class="FormRowField">{$form.execute_host_checks.label}</td><td class="FormRowValue">{$form.execute_host_checks.html}</td></tr>
+			<tr class="list_two"><td class="FormRowField">{$form.accept_passive_host_checks.label}</td><td class="FormRowValue">{$form.accept_passive_host_checks.html}</td></tr>
+		{/if}
+		
+		<!-- Part 5 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>	
+		<tr class="list_one"><td class="FormRowField">{$form.log_rotation_method.label}</td><td class="FormRowValue">{$form.log_rotation_method.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.log_archive_path.label}</td><td class="FormRowValue">{$form.log_archive_path.html}</td></tr>
+
+		<!-- Part 6 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>	
+		<tr class="list_one"><td class="FormRowField">{$form.check_external_commands.label}</td><td class="FormRowValue">{$form.check_external_commands.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.command_check_interval.label}</td><td class="FormRowValue">{$form.command_check_interval.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.command_file.label}</td><td class="FormRowValue">{$form.command_file.html}</td></tr>
+
+		<!-- Part 7 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>	
+		<tr class="list_one"><td class="FormRowField">{$form.downtime_file.label}</td><td class="FormRowValue">{$form.downtime_file.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.comment_file.label}</td><td class="FormRowValue">{$form.comment_file.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.lock_file.label}</td><td class="FormRowValue">{$form.lock_file.html}</td></tr>
+
+		<!-- Part 8 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>	
+		<tr class="list_one"><td class="FormRowField">{$form.retain_state_information.label}</td><td class="FormRowValue">{$form.retain_state_information.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.state_retention_file.label}</td><td class="FormRowValue">{$form.state_retention_file.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.retention_update_interval.label}</td><td class="FormRowValue">{$form.retention_update_interval.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.use_retained_program_state.label}</td><td class="FormRowValue">{$form.use_retained_program_state.html}</td></tr>
+		{if $msg.nagios == 2}
+			<tr class="list_one"><td class="FormRowField">{$form.use_retained_scheduling_info.label}</td><td class="FormRowValue">{$form.use_retained_scheduling_info.html}</td></tr>
+		{/if}
+
+		<!-- Part 9 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>	
+		<tr class="list_one"><td class="FormRowField">{$form.use_syslog.label}</td><td class="FormRowValue">{$form.use_syslog.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.log_notifications.label}</td><td class="FormRowValue">{$form.log_notifications.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.log_service_retries.label}</td><td class="FormRowValue">{$form.log_service_retries.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.log_host_retries.label}</td><td class="FormRowValue">{$form.log_host_retries.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.log_event_handlers.label}</td><td class="FormRowValue">{$form.log_event_handlers.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.log_initial_states.label}</td><td class="FormRowValue">{$form.log_initial_states.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.log_external_commands.label}</td><td class="FormRowValue">{$form.log_external_commands.html}</td></tr>
+		{if $msg.nagios == 1}
+		<tr class="list_two"><td class="FormRowField">{$form.log_passive_service_checks.label}</td><td class="FormRowValue">{$form.log_passive_service_checks.html}</td></tr>
+		{/if}
+		{if $msg.nagios == 2}
+			<tr class="list_two"><td class="FormRowField">{$form.log_passive_checks.label}</td><td class="FormRowValue">{$form.log_passive_checks.html}</td></tr>
+		{/if}
+
+		<!-- Part 10 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>	
+		<tr class="list_one"><td class="FormRowField">{$form.global_host_event_handler.label}</td><td class="FormRowValue">{$form.global_host_event_handler.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.global_service_event_handler.label}</td><td class="FormRowValue">{$form.global_service_event_handler.html}</td></tr>
+
+		<!-- Part 11 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>	
+		<tr class="list_one"><td class="FormRowField">{$form.sleep_time.label}</td><td class="FormRowValue">{$form.sleep_time.html}</td></tr>
+		{if $msg.nagios == 1}
+		<tr class="list_two"><td class="FormRowField">{$form.inter_check_delay_method.label}</td><td class="FormRowValue">{$form.inter_check_delay_method.html}</td></tr>
+		{/if}
+		{if $msg.nagios == 2}
+			<tr class="list_two"><td class="FormRowField">{$form.service_inter_check_delay_method.label}</td><td class="FormRowValue">{$form.service_inter_check_delay_method.html}</td></tr>
+			<tr class="list_one"><td class="FormRowField">{$form.max_service_check_spread.label}</td><td class="FormRowValue">{$form.max_service_check_spread.html}</td></tr>
+		{/if}		
+		<tr class="list_one"><td class="FormRowField">{$form.service_interleave_factor.label}</td><td class="FormRowValue">{$form.service_interleave_factor.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.max_concurrent_checks.label}</td><td class="FormRowValue">{$form.max_concurrent_checks.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_reaper_frequency.label}</td><td class="FormRowValue">{$form.service_reaper_frequency.html}</td></tr>
+		{if $msg.nagios == 2}
+			<tr class="list_two"><td class="FormRowField">{$form.host_inter_check_delay_method.label}</td><td class="FormRowValue">{$form.host_inter_check_delay_method.html}</td></tr>
+			<tr class="list_one"><td class="FormRowField">{$form.max_host_check_spread.label}</td><td class="FormRowValue">{$form.max_host_check_spread.html}</td></tr>
+		{/if}
+		<tr class="list_one"><td class="FormRowField">{$form.interval_length.label}</td><td class="FormRowValue">{$form.interval_length.html}</td></tr>
+		{if $msg.nagios == 2}
+			<tr class="list_two"><td class="FormRowField">{$form.auto_reschedule_checks.label}</td><td class="FormRowValue">{$form.auto_reschedule_checks.html}</td></tr>
+			<tr class="list_one"><td class="FormRowField">{$form.auto_rescheduling_interval.label}</td><td class="FormRowValue">{$form.auto_rescheduling_interval.html}</td></tr>
+			<tr class="list_two"><td class="FormRowField">{$form.auto_rescheduling_window.label}</td><td class="FormRowValue">{$form.auto_rescheduling_window.html}</td></tr>
+		{/if}
+		
+		<!-- Part 12 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>	
+		<tr class="list_one"><td class="FormRowField">{$form.use_agressive_host_checking.label}</td><td class="FormRowValue">{$form.use_agressive_host_checking.html}</td></tr>
+
+		<!-- Part 13 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>	
+		<tr class="list_one"><td class="FormRowField">{$form.enable_flap_detection.label}</td><td class="FormRowValue">{$form.enable_flap_detection.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.low_service_flap_threshold.label}</td><td class="FormRowValue">{$form.low_service_flap_threshold.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.high_service_flap_threshold.label}</td><td class="FormRowValue">{$form.high_service_flap_threshold.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.low_host_flap_threshold.label}</td><td class="FormRowValue">{$form.low_host_flap_threshold.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.high_host_flap_threshold.label}</td><td class="FormRowValue">{$form.high_host_flap_threshold.html}</td></tr>
+
+		<!-- Part 14 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.soft_state_dependencies.label}</td><td class="FormRowValue">{$form.soft_state_dependencies.html}</td></tr>
+
+		<!-- Part 15 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_check_timeout.label}</td><td class="FormRowValue">{$form.service_check_timeout.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.host_check_timeout.label}</td><td class="FormRowValue">{$form.host_check_timeout.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.event_handler_timeout.label}</td><td class="FormRowValue">{$form.event_handler_timeout.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.notification_timeout.label}</td><td class="FormRowValue">{$form.notification_timeout.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.perfdata_timeout.label}</td><td class="FormRowValue">{$form.perfdata_timeout.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.ocsp_timeout.label}</td><td class="FormRowValue">{$form.ocsp_timeout.html}</td></tr>
+		{if $msg.nagios == 2}
+			<tr class="list_one"><td class="FormRowField">{$form.ochp_timeout.label}</td><td class="FormRowValue">{$form.ochp_timeout.html}</td></tr>
+		{/if}
+
+		<!-- Part 16 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.obsess_over_services.label}</td><td class="FormRowValue">{$form.obsess_over_services.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.ocsp_command.label}</td><td class="FormRowValue">{$form.ocsp_command.html}</td></tr>
+		{if $msg.nagios == 2}
+			<tr class="list_one"><td class="FormRowField">{$form.obsess_over_hosts.label}</td><td class="FormRowValue">{$form.obsess_over_hosts.html}</td></tr>
+			<tr class="list_two"><td class="FormRowField">{$form.ochp_command.label}</td><td class="FormRowValue">{$form.ochp_command.html}</td></tr>
+		{/if}
+
+		<!-- Part 17 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.process_performance_data.label}</td><td class="FormRowValue">{$form.process_performance_data.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.host_perfdata_command.label}</td><td class="FormRowValue">{$form.host_perfdata_command.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_perfdata_command.label}</td><td class="FormRowValue">{$form.service_perfdata_command.html}</td></tr>
+	{if $msg.nagios == 2}	
+			<tr class="list_two"><td class="FormRowField">{$form.host_perfdata_file.label}</td><td class="FormRowValue">{$form.host_perfdata_file.html}</td></tr>
+			<tr class="list_one"><td class="FormRowField">{$form.service_perfdata_file.label}</td><td class="FormRowValue">{$form.service_perfdata_file.html}</td></tr>
+			<tr class="list_two"><td class="FormRowField">{$form.host_perfdata_file_template.label}</td><td class="FormRowValue">{$form.host_perfdata_file_template.html}</td></tr>
+			<tr class="list_one"><td class="FormRowField">{$form.service_perfdata_file_template.label}</td><td class="FormRowValue">{$form.service_perfdata_file_template.html}</td></tr>
+			<tr class="list_two"><td class="FormRowField">{$form.host_perfdata_file_mode.label}</td><td class="FormRowValue">{$form.host_perfdata_file_mode.html}</td></tr>
+			<tr class="list_one"><td class="FormRowField">{$form.service_perfdata_file_mode.label}</td><td class="FormRowValue">{$form.service_perfdata_file_mode.html}</td></tr>
+			<tr class="list_two"><td class="FormRowField">{$form.host_perfdata_file_processing_interval.label}</td><td class="FormRowValue">{$form.host_perfdata_file_processing_interval.html}</td></tr>
+			<tr class="list_one"><td class="FormRowField">{$form.service_perfdata_file_processing_interval.label}</td><td class="FormRowValue">{$form.service_perfdata_file_processing_interval.html}</td></tr>
+			<tr class="list_two"><td class="FormRowField">{$form.host_perfdata_file_processing_command.label}</td><td class="FormRowValue">{$form.host_perfdata_file_processing_command.html}</td></tr>
+			<tr class="list_one"><td class="FormRowField">{$form.service_perfdata_file_processing_command.label}</td><td class="FormRowValue">{$form.service_perfdata_file_processing_command.html}</td></tr>
+		{/if}
+
+		<!-- Part 18 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.check_for_orphaned_services.label}</td><td class="FormRowValue">{$form.check_for_orphaned_services.html}</td></tr>
+		
+		<!-- Part 19 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.check_service_freshness.label}</td><td class="FormRowValue">{$form.check_service_freshness.html}</td></tr>
+		{if $msg.nagios == 1}
+		<tr class="list_two"><td class="FormRowField">{$form.freshness_check_interval.label}</td><td class="FormRowValue">{$form.freshness_check_interval.html}</td></tr>
+		{/if}
+		{if $msg.nagios == 2}
+			<tr class="list_two"><td class="FormRowField">{$form.service_freshness_check_interval.label}</td><td class="FormRowValue">{$form.service_freshness_check_interval.html}</td></tr>
+			<tr class="list_one"><td class="FormRowField">{$form.check_host_freshness.label}</td><td class="FormRowValue">{$form.check_host_freshness.html}</td></tr>
+			<tr class="list_two"><td class="FormRowField">{$form.host_freshness_check_interval.label}</td><td class="FormRowValue">{$form.host_freshness_check_interval.html}</td></tr>
+		{/if}
+
+		<!-- Part 20 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.date_format.label}</td><td class="FormRowValue">{$form.date_format.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.illegal_object_name_chars.label}</td><td class="FormRowValue">{$form.illegal_object_name_chars.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.illegal_macro_output_chars.label}</td><td class="FormRowValue">{$form.illegal_macro_output_chars.html}</td></tr>
+		{if $msg.nagios == 2}
+			<tr class="list_two"><td class="FormRowField">{$form.use_regexp_matching.label}</td><td class="FormRowValue">{$form.use_regexp_matching.html}</td></tr>
+			<tr class="list_one"><td class="FormRowField">{$form.use_true_regexp_matching.label}</td><td class="FormRowValue">{$form.use_true_regexp_matching.html}</td></tr>
+		{/if}
+		
+		<!-- Part 21 -->
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;</td></tr>		
+		<tr class="list_one"><td class="FormRowField">{$form.admin_email.label}</td><td class="FormRowValue">{$form.admin_email.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.admin_pager.label}</td><td class="FormRowValue">{$form.admin_pager.html}</td></tr>
+		
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>	
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
+
diff --git a/www/include/configuration/configNagios/formNagios.php b/www/include/configuration/configNagios/formNagios.php
new file mode 100644
index 0000000000000000000000000000000000000000..481aa1624722335574c6b981e43857931e239a30
--- /dev/null
+++ b/www/include/configuration/configNagios/formNagios.php
@@ -0,0 +1,521 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Nagios
+	#
+	$nagios = array();
+	if (($o == "c" || $o == "w") && $nagios_id)	{	
+		$res =& $pearDB->query("SELECT * FROM cfg_nagios WHERE nagios_id = '".$nagios_id."' LIMIT 1");
+		# Set base value
+		$nagios = array_map("myDecode", $res->fetchRow());
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Check commands comes from DB -> Store in $checkCmds Array
+	$checkCmds = array();
+	$res =& $pearDB->query("SELECT command_id, command_name FROM command ORDER BY command_name");
+	$checkCmds = array(NULL=>NULL);
+	while($res->fetchInto($checkCmd))
+		$checkCmds[$checkCmd["command_id"]] = $checkCmd["command_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText		= array("size"=>"30");
+	$attrsText2 	= array("size"=>"50");
+	$attrsText3 	= array("size"=>"10");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["nagios_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["nagios_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["nagios_view"]);
+
+	#
+	## Nagios Configuration basic information
+	#
+	$form->addElement('header', 'information', $lang['nagios_infos']);
+	$form->addElement('text', 'nagios_name', $lang["nagios_name"], $attrsText);
+	$form->addElement('textarea', 'nagios_comment', $lang["nagios_comment"], $attrsTextarea);
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'nagios_activate', null, $lang["enable"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'nagios_activate', null, $lang["disable"], '0');
+	$form->addGroup($nagTab, 'nagios_activate', $lang["status"], '&nbsp;');	
+	
+	## Part 1
+	$form->addElement('text', 'log_file', $lang["nag_logFile"], $attrsText2);
+	$form->addElement('text', 'cfg_dir', $lang["nag_objConfDir"], $attrsText2);
+	if ($oreon->user->get_version() == 2)
+		$form->addElement('text', 'object_cache_file', $lang["nag_objCacheFile"], $attrsText2);
+	$form->addElement('text', 'temp_file', $lang["nag_tmpFile"], $attrsText2);
+	$form->addElement('text', 'p1_file', $lang["nag_p1File"], $attrsText2);
+	
+	## Part 2
+	$form->addElement('text', 'status_file', $lang["nag_statusFile"], $attrsText2);
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'aggregate_status_updates', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'aggregate_status_updates', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'aggregate_status_updates', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'aggregate_status_updates', $lang["nag_asuOpt"], '&nbsp;');
+	$form->addElement('text', 'status_update_interval', $lang["nag_asuInt"], $attrsText3);
+	
+	## Part 3
+	$form->addElement('text', 'nagios_user', $lang["nag_nagUser"], $attrsText);
+	$form->addElement('text', 'nagios_group', $lang["nag_nagGroup"], $attrsText);
+	
+	## Part 4
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'enable_notifications', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'enable_notifications', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'enable_notifications', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'enable_notifications', $lang["nag_notifOpt"], '&nbsp;');
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'execute_service_checks', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'execute_service_checks', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'execute_service_checks', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'execute_service_checks', $lang["nag_svCheckExeOpt"], '&nbsp;');
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'accept_passive_service_checks', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'accept_passive_service_checks', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'accept_passive_service_checks', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'accept_passive_service_checks', $lang["nag_pasSvCheckAccOpt"], '&nbsp;');
+	if($oreon->user->get_version() == 2)	{
+		$nagTab = array();
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'execute_host_checks', null, $lang["yes"], '1');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'execute_host_checks', null, $lang["no"], '0');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'execute_host_checks', null, $lang["nothing"], '2');
+		$form->addGroup($nagTab, 'execute_host_checks', $lang["nag_hostCheckExeOpt"], '&nbsp;');
+		$nagTab = array();
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'accept_passive_host_checks', null, $lang["yes"], '1');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'accept_passive_host_checks', null, $lang["no"], '0');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'accept_passive_host_checks', null, $lang["nothing"], '2');
+		$form->addGroup($nagTab, 'accept_passive_host_checks', $lang["nag_pasHostCheckAccOpt"], '&nbsp;');
+	}
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'enable_event_handlers', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'enable_event_handlers', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'enable_event_handlers', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'enable_event_handlers', $lang["nag_eventHandOpt"], '&nbsp;');
+	
+	## Part 5
+	$nagTab = array();
+ 	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_rotation_method', null, 'n', 'n');
+ 	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_rotation_method', null, 'h', 'h');
+ 	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_rotation_method', null, 'd', 'd');
+ 	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_rotation_method', null, 'w', 'w');
+ 	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_rotation_method', null, 'm', 'm');
+	$form->addGroup($nagTab, 'log_rotation_method', $lang["nag_logRotMethod"], '&nbsp;&nbsp;');
+	$form->addElement('text', 'log_archive_path', $lang["nag_logArchPath"], $attrsText2);
+	
+	## Part 6	
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'check_external_commands', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'check_external_commands', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'check_external_commands', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'check_external_commands', $lang["nag_extCmdCheckOpt"], '&nbsp;');
+	$form->addElement('text', 'command_check_interval', $lang["nag_extCmdCheckInt"], $attrsText3);
+	$form->addElement('text', 'command_file', $lang["nag_extCmdFile"], $attrsText2);
+	
+	## Part 7
+	$form->addElement('text', 'downtime_file', $lang["nag_dtFile"], $attrsText2);
+	$form->addElement('text', 'comment_file', $lang["nag_cmtFile"], $attrsText2);
+	$form->addElement('text', 'lock_file', $lang["nag_lockFile"], $attrsText2);
+	
+	## Part 8
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'retain_state_information', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'retain_state_information', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'retain_state_information', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'retain_state_information', $lang["nag_stateRetOpt"], '&nbsp;');
+	$form->addElement('text', 'state_retention_file', $lang["nag_stateRetFile"], $attrsText2);
+	$form->addElement('text', 'retention_update_interval', $lang["nag_autStateRetUpdInt"], $attrsText3);
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_retained_program_state', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_retained_program_state', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_retained_program_state', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'use_retained_program_state', $lang["nag_useRetPgmStateOpt"], '&nbsp;');
+	if($oreon->user->get_version() == 2)	{
+		$nagTab = array();
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_retained_scheduling_info', null, $lang["yes"], '1');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_retained_scheduling_info', null, $lang["no"], '0');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_retained_scheduling_info', null, $lang["nothing"], '2');
+		$form->addGroup($nagTab, 'use_retained_scheduling_info', $lang["nag_useRetSchInfoOpt"], '&nbsp;');
+	}
+	
+	## Part 9
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_syslog', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_syslog', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_syslog', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'use_syslog', $lang["nag_SysLogOpt"], '&nbsp;');
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_notifications', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_notifications', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_notifications', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'log_notifications', $lang["nag_notLogOpt"], '&nbsp;');
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_service_retries', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_service_retries', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_service_retries', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'log_service_retries', $lang["nag_svCheckRtrLogOpt"], '&nbsp;');
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_host_retries', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_host_retries', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_host_retries', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'log_host_retries', $lang["nag_hostRtrLogOpt"], '&nbsp;');
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_event_handlers', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_event_handlers', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_event_handlers', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'log_event_handlers', $lang["nag_eventHandLogOpt"], '&nbsp;');
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_initial_states', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_initial_states', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_initial_states', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'log_initial_states', $lang["nag_iniStateLogOpt"], '&nbsp;');
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_external_commands', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_external_commands', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_external_commands', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'log_external_commands', $lang["nag_extCmdLogOpt"], '&nbsp;');
+	if ($oreon->user->get_version() == 1)	{
+		$nagTab = array();
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_passive_service_checks', null, $lang["yes"], '1');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_passive_service_checks', null, $lang["no"], '0');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_passive_service_checks', null, $lang["nothing"], '2');
+		$form->addGroup($nagTab, 'log_passive_service_checks', $lang["nag_passSvCheckLogOpt"], '&nbsp;');
+	}
+	else if ($oreon->user->get_version() == 2)	{
+		$nagTab = array();
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_passive_checks', null, $lang["yes"], '1');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_passive_checks', null, $lang["no"], '0');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'log_passive_checks', null, $lang["nothing"], '2');
+		$form->addGroup($nagTab, 'log_passive_checks', $lang["nag_passCheckLogOpt"], '&nbsp;');
+	}
+	
+	## Part 10
+	$form->addElement('select', 'global_host_event_handler', $lang["nag_glHostEventHand"], $checkCmds);
+	$form->addElement('select', 'global_service_event_handler', $lang["nag_glSvEventHand"], $checkCmds);
+	
+	## Part 11
+	$form->addElement('text', 'sleep_time', $lang["nag_intCheckSleepTm"], $attrsText3);
+	if ($oreon->user->get_version() == 1)	{
+		/*$nagTab = array();
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'inter_check_delay_method', null, 'n', 'n');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'inter_check_delay_method', null, 'd', 'd');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'inter_check_delay_method', null, 's', 's');	
+		$form->addGroup($nagTab, 'inter_check_delay_method', $lang["nag_intCheckDelMth"], '&nbsp;');*/
+		$form->addElement('text', 'inter_check_delay_method', $lang["nag_intCheckDelMth"], $attrsText3);
+	}
+	else if ($oreon->user->get_version() == 2)	{
+		/*$nagTab = array();
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'service_inter_check_delay_method', null, 'n', 'n');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'service_inter_check_delay_method', null, 'd', 'd');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'service_inter_check_delay_method', null, 's', 's');	
+		$form->addGroup($nagTab, 'service_inter_check_delay_method', $lang["nag_svIntCheckDelMth"], '&nbsp;');*/
+		$form->addElement('text', 'service_inter_check_delay_method', $lang["nag_svIntCheckDelMth"], $attrsText3);
+		$form->addElement('text', 'max_service_check_spread', $lang["nag_maxSvCheckSpread"], $attrsText3);
+	}
+	$form->addElement('text', 'service_interleave_factor', $lang["nag_svInterFac"], $attrsText3);
+	$form->addElement('text', 'max_concurrent_checks', $lang["nag_maxConcSvChecks"], $attrsText3);
+	$form->addElement('text', 'service_reaper_frequency', $lang["nag_svReapFreq"], $attrsText3);
+	if ($oreon->user->get_version() == 2)	{
+		/*$nagTab = array();
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'host_inter_check_delay_method', null, 'n', 'n');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'host_inter_check_delay_method', null, 'd', 'd');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'host_inter_check_delay_method', null, 's', 's');	
+		$form->addGroup($nagTab, 'host_inter_check_delay_method', $lang["nag_hostIntCheckDelMth"], '&nbsp;');*/
+		$form->addElement('text', 'host_inter_check_delay_method', $lang["nag_hostIntCheckDelMth"], $attrsText3);
+		$form->addElement('text', 'max_host_check_spread', $lang["nag_maxHostCheckSpread"], $attrsText3);
+	}
+	$form->addElement('text', 'interval_length', $lang["nag_tmIntLen"], $attrsText3);
+	if ($oreon->user->get_version() == 2)	{
+		$nagTab = array();
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'auto_reschedule_checks', null, $lang["yes"], '1');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'auto_reschedule_checks', null, $lang["no"], '0');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'auto_reschedule_checks', null, $lang["nothing"], '2');
+		$form->addGroup($nagTab, 'auto_reschedule_checks', $lang["nag_autoRescheOpt"], '&nbsp;');
+		$form->addElement('text', 'auto_rescheduling_interval', $lang["nag_autoRescheInt"], $attrsText3);
+		$form->addElement('text', 'auto_rescheduling_window', $lang["nag_autoRescheWnd"], $attrsText3);
+	}
+	
+	## Part 12
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_agressive_host_checking', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_agressive_host_checking', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_agressive_host_checking', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'use_agressive_host_checking', $lang["nag_aggHostCheckOpt"], '&nbsp;');
+	
+	## Part 13
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'enable_flap_detection', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'enable_flap_detection', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'enable_flap_detection', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'enable_flap_detection', $lang["nag_flapDetOpt"], '&nbsp;');
+	$form->addElement('text', 'low_service_flap_threshold', $lang["nag_lowSvFlapThres"], $attrsText3);
+	$form->addElement('text', 'high_service_flap_threshold', $lang["nag_highSvFlapThres"], $attrsText3);
+	$form->addElement('text', 'low_host_flap_threshold', $lang["nag_lowHostFlapThres"], $attrsText3);
+	$form->addElement('text', 'high_host_flap_threshold', $lang["nag_highHostFlapThres"], $attrsText3);
+	
+	## Part 14
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'soft_state_dependencies', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'soft_state_dependencies', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'soft_state_dependencies', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'soft_state_dependencies', $lang["nag_softSvDepOpt"], '&nbsp;');
+	
+	## Part 15
+	$form->addElement('text', 'service_check_timeout', $lang["nag_svCheckTmOut"], $attrsText3);
+	$form->addElement('text', 'host_check_timeout', $lang["nag_hostCheckTmOut"], $attrsText3);
+	$form->addElement('text', 'event_handler_timeout', $lang["nag_eventHandTmOut"], $attrsText3);
+	$form->addElement('text', 'notification_timeout', $lang["nag_notifTmOut"], $attrsText3);
+	$form->addElement('text', 'ocsp_timeout', $lang["nag_obComSvProcTmOut"], $attrsText3);
+	if ($oreon->user->get_version() == 2)
+		$form->addElement('text', 'ochp_timeout', $lang["nag_obComHostProcTmOut"], $attrsText3);
+	$form->addElement('text', 'perfdata_timeout', $lang["nag_perfDataProcCmdTmOut"], $attrsText3);
+	
+	## Part 16
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'obsess_over_services', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'obsess_over_services', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'obsess_over_services', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'obsess_over_services', $lang["nag_obsOverSvOpt"], '&nbsp;');
+	$form->addElement('select', 'ocsp_command', $lang["nag_obsComSvProcCmd"], $checkCmds);
+	if ($oreon->user->get_version() == 2)	{
+		$nagTab = array();
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'obsess_over_hosts', null, $lang["yes"], '1');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'obsess_over_hosts', null, $lang["no"], '0');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'obsess_over_hosts', null, $lang["nothing"], '2');
+		$form->addGroup($nagTab, 'obsess_over_hosts', $lang["nag_obsOverHostOpt"], '&nbsp;');
+		$form->addElement('select', 'ochp_command', $lang["nag_obsComHostProcCmd"], $checkCmds);
+	}
+	
+	## Part 17
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'process_performance_data', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'process_performance_data', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'process_performance_data', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'process_performance_data', $lang["nag_perfDataProcOpt"], '&nbsp;');
+	$form->addElement('select', 'host_perfdata_command', $lang["nag_hostPerfDataProcCmd"], $checkCmds);
+	$form->addElement('select', 'service_perfdata_command', $lang["nag_svPerfDataProcCmd"], $checkCmds);
+	if ($oreon->user->get_version() == 2)	{
+		$form->addElement('text', 'host_perfdata_file', $lang["nag_hostPerfDataFile"], $attrsText2);
+		$form->addElement('text', 'service_perfdata_file', $lang["nag_svPerfDataFile"], $attrsText2);
+		$form->addElement('textarea', 'host_perfdata_file_template', $lang["nag_hostPerfDataFileTmp"], $attrsTextarea);
+		$form->addElement('textarea', 'service_perfdata_file_template', $lang["nag_svPerfDataFileTmp"], $attrsTextarea);
+		$nagTab = array();
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'host_perfdata_file_mode', null, 'a', 'a');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'host_perfdata_file_mode', null, 'w', 'w');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'host_perfdata_file_mode', null, $lang["nothing"], '2');
+		$form->addGroup($nagTab, 'host_perfdata_file_mode', $lang["nag_hostPerfDataFileMode"], '&nbsp;');
+		$nagTab = array();
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'service_perfdata_file_mode', null, 'a', 'a');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'service_perfdata_file_mode', null, 'w', 'w');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'service_perfdata_file_mode', null, $lang["nothing"], '2');
+		$form->addGroup($nagTab, 'service_perfdata_file_mode', $lang["nag_svPerfDataFileMode"], '&nbsp;');
+		$form->addElement('text', 'host_perfdata_file_processing_interval', $lang["nag_hostPerfDataFileProcInt"], $attrsText3);
+		$form->addElement('text', 'service_perfdata_file_processing_interval', $lang["nag_svPerfDataFileProcInt"], $attrsText3);
+		$form->addElement('select', 'host_perfdata_file_processing_command', $lang["nag_hostPerfDataFileProcCmd"], $checkCmds);
+		$form->addElement('select', 'service_perfdata_file_processing_command', $lang["nag_svPerfDataFileProcCmd"], $checkCmds);		
+	}
+	
+	## Part 18
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'check_for_orphaned_services', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'check_for_orphaned_services', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'check_for_orphaned_services', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'check_for_orphaned_services', $lang["nag_OrpSvCheckOpt"], '&nbsp;');
+	
+	## Part 19
+	$nagTab = array();
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'check_service_freshness', null, $lang["yes"], '1');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'check_service_freshness', null, $lang["no"], '0');
+	$nagTab[] = &HTML_QuickForm::createElement('radio', 'check_service_freshness', null, $lang["nothing"], '2');
+	$form->addGroup($nagTab, 'check_service_freshness', $lang["nag_svFreshCheckOpt"], '&nbsp;');
+	if ($oreon->user->get_version() == 1)
+		$form->addElement('text', 'freshness_check_interval', $lang["nag_freshCheckInt"], $attrsText);
+	else if ($oreon->user->get_version() == 2)	{
+		$form->addElement('text', 'service_freshness_check_interval', $lang["nag_svFreshCheckInt"], $attrsText);
+		$nagTab = array();
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'check_host_freshness', null, $lang["yes"], '1');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'check_host_freshness', null, $lang["no"], '0');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'check_host_freshness', null, $lang["nothing"], '2');
+		$form->addGroup($nagTab, 'check_host_freshness', $lang["nag_hostFreshCheckOpt"], '&nbsp;');
+		$form->addElement('text', 'host_freshness_check_interval', $lang["nag_hostFreshCheckInt"], $attrsText);
+	}
+	
+	## Part 20
+	$form->addElement('text', 'date_format', $lang["nag_dateFormat"], $attrsText);
+	$form->addElement('text', 'illegal_object_name_chars', $lang["nag_illObjNameChar"], $attrsText2);
+	$form->addElement('text', 'illegal_macro_output_chars', $lang["nag_illMacOutChar"], $attrsText2);
+	if ($oreon->user->get_version() == 2)	{
+		$nagTab = array();
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_regexp_matching', null, $lang["yes"], '1');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_regexp_matching', null, $lang["no"], '0');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_regexp_matching', null, $lang["nothing"], '2');
+		$form->addGroup($nagTab, 'use_regexp_matching', $lang["nag_regExpMatchOpt"], '&nbsp;');
+		$nagTab = array();
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_true_regexp_matching', null, $lang["yes"], '1');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_true_regexp_matching', null, $lang["no"], '0');
+		$nagTab[] = &HTML_QuickForm::createElement('radio', 'use_true_regexp_matching', null, $lang["nothing"], '2');
+		$form->addGroup($nagTab, 'use_true_regexp_matching', $lang["nag_trueRegExpMatchOpt"], '&nbsp;');
+	}
+	
+	## Part 21
+	$form->addElement('text', 'admin_email', $lang["nag_adminEmail"], $attrsText);
+	$form->addElement('text', 'admin_pager', $lang["nag_adminPager"], $attrsText);
+		
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	
+	$form->setDefaults(array(
+	"nagios_activate"=>'0',
+	"aggregate_status_updates"=>'1',
+	"nagios_user"=>"nagios_user",
+	"nagios_group"=>"nagios",
+	"enable_notifications"=>'1',
+	"execute_service_checks"=>'1',
+	"accept_passive_service_checks"=>'1',
+	"execute_host_checks"=>'1',
+	"accept_passive_host_checks"=>'1',
+	"enable_event_handlers"=>'1',
+	"log_rotation_method"=>'n',
+	"check_external_commands"=>'0',
+	"retain_state_information"=>'0',
+	"use_retained_program_state"=>'1',
+	"use_retained_scheduling_info"=>'1',
+	"use_syslog"=>'2',
+	"log_notifications"=>'2',
+	"log_service_retries"=>'2',
+	"log_host_retries"=>'2',
+	"log_event_handlers"=>'2',
+	"log_initial_states"=>'0',
+	"log_external_commands"=>'1',
+	"log_passive_checks"=>'1',
+	"inter_check_delay_method"=>'s',
+	"service_inter_check_delay_method"=>'s',
+	"service_interleave_factor"=>'s',
+	"host_inter_check_delay_method"=>'s',
+	"auto_reschedule_checks"=>'2',
+	"use_aggressive_host_checking"=>'0',
+	"enable_flap_detection"=>'0',
+	"soft_state_dependencies"=>'0',
+	"obsess_over_services"=>'0',
+	"obsess_over_hosts"=>'0',
+	"process_performance_data"=>'0',
+	"host_perfdata_file_mode"=>'a',
+	"service_perfdata_file_mode"=>'a',
+	"check_for_orphaned_services"=>'0',
+	"check_service_freshness"=>'1',
+	"check_host_freshness"=>'1',
+	"illegal_object_name_chars"=>"~!$%^&*\"|'<>?,()=",
+	"illegal_macro_output_chars"=>"`~$^&\"|'<>",
+	"use_regexp_matching"=>'0',
+	"use_true_regexp_matching"=>'0',
+	'action'=>'1'
+	));
+		
+	$form->addElement('hidden', 'nagios_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	function slash($elem = NULL)	{
+		if ($elem)
+			return rtrim($elem, "/")."/";
+	}
+	$form->applyFilter('cfg_dir', 'slash');
+	$form->applyFilter('log_archive_path', 'slash');
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('nagios_name', $lang['ErrName'], 'required');
+	$form->addRule('nagios_comment', $lang['ErrRequired'], 'required');
+	$form->registerRule('exist', 'callback', 'testExistence');
+	$form->addRule('nagios_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+	
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	# Just watch a nagios information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&nagios_id=".$nagios_id."'"));
+	    $form->setDefaults($nagios);
+		$form->freeze();
+	}
+	# Modify a nagios information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($nagios);
+	}
+	# Add a nagios information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	$tpl->assign('msg', array ("nagios"=>$oreon->user->get_version()));
+	
+	$valid = false;
+	if ($form->validate())	{
+		$nagiosObj =& $form->getElement('nagios_id');
+		if ($form->getSubmitValue("submitA"))
+			$nagiosObj->setValue(insertNagiosInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateNagiosInDB($nagiosObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&nagios_id=".$nagiosObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listNagios.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("formNagios.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configNagios/listNagios.ihtml b/www/include/configuration/configNagios/listNagios.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..150085da685bf5ff47529e5d3cf185f0c81dd4d8
--- /dev/null
+++ b/www/include/configuration/configNagios/listNagios.ihtml
@@ -0,0 +1,41 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="2"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
\ No newline at end of file
diff --git a/www/include/configuration/configNagios/listNagios.php b/www/include/configuration/configNagios/listNagios.php
new file mode 100644
index 0000000000000000000000000000000000000000..2187c0b7d61b0a444d4eb1d7a33377ea4170d60a
--- /dev/null
+++ b/www/include/configuration/configNagios/listNagios.php
@@ -0,0 +1,99 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM cfg_nagios WHERE nagios_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM cfg_nagios");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Nagios list
+	if ($search)
+		$rq = "SELECT nagios_id, nagios_name, nagios_comment, nagios_activate FROM cfg_nagios WHERE nagios_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' ORDER BY nagios_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT nagios_id, nagios_name, nagios_comment, nagios_activate FROM cfg_nagios ORDER BY nagios_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($nagios); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$nagios['nagios_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&nagios_id=".$nagios['nagios_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&nagios_id=".$nagios['nagios_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&nagios_id=".$nagios['nagios_id']."&o=d&select[".$nagios['nagios_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($nagios["nagios_activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&nagios_id=".$nagios['nagios_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&nagios_id=".$nagios['nagios_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$nagios['nagios_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$nagios["nagios_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&nagios_id=".$nagios['nagios_id'],
+						"RowMenu_desc"=>substr($nagios["nagios_comment"], 0, 40),
+						"RowMenu_status"=>$nagios["nagios_activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listNagios.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+
+
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configNagios/nagios.php b/www/include/configuration/configNagios/nagios.php
new file mode 100644
index 0000000000000000000000000000000000000000..0c9258b5f22e51b882e5889eb7b8055da3e47e1a
--- /dev/null
+++ b/www/include/configuration/configNagios/nagios.php
@@ -0,0 +1,49 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["nagios_id"]) ? $cG = $_GET["nagios_id"] : $cG = NULL;
+	isset($_POST["nagios_id"]) ? $cP = $_POST["nagios_id"] : $cP = NULL;
+	$cG ? $nagios_id = $cG : $nagios_id = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configNagios/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formNagios.php"); break; #Add Nagios.cfg
+		case "w" : require_once($path."formNagios.php"); break; #Watch Nagios.cfg
+		case "c" : require_once($path."formNagios.php"); break; #Modify Nagios.cfg
+		case "s" : enableNagiosInDB($nagios_id); require_once($path."listNagios.php"); break; #Activate a nagios CFG
+		case "u" : disableNagiosInDB($nagios_id); require_once($path."listNagios.php"); break; #Desactivate a nagios CFG
+		case "m" : multipleNagiosInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listNagios.php"); break; #Duplicate n nagios CFGs
+		case "d" : deleteNagiosInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listNagios.php"); break; #Delete n nagios CFG
+		default : require_once($path."listNagios.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/command/DB-Func.php b/www/include/configuration/configObject/command/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..3f8057a5f9500610ab165fc3a2b11bd11b9e3c6c
--- /dev/null
+++ b/www/include/configuration/configObject/command/DB-Func.php
@@ -0,0 +1,128 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset ($oreon))
+		exit ();
+
+	function testCmdExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('command_id');
+		$res =& $pearDB->query("SELECT command_name, command_id FROM command WHERE command_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$command =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $command["command_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $command["command_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+
+	function deleteCommandInDB ($commands = array())	{
+		global $pearDB;
+		foreach($commands as $key=>$value)
+			$pearDB->query("DELETE FROM command WHERE command_id = '".$key."'");
+	}
+	
+	function multipleCommandInDB ($commands = array(), $nbrDup = array())	{
+		foreach($commands as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM command WHERE command_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["command_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "command_name" ? ($command_name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2 != NULL?(", '".$value2."'"):", NULL") : $val .= ($value2 != NULL?("'".$value2."'"):"NULL");
+				}
+				if (testCmdExistence($command_name))	{
+					$val ? $rq = "INSERT INTO command VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+				}
+			}
+		}
+	}
+	
+	function updateCommandInDB ($cmd_id = NULL)	{
+		if (!$cmd_id) return;
+		updateCommand($cmd_id);
+	}
+	
+	function updateCommand($cmd_id = null)	{
+		if (!$cmd_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		set_magic_quotes_runtime(1);
+		$ret["command_line"] = str_replace('\n', "#BR#", $ret["command_line"]);
+		$ret["command_line"] = str_replace('\t', "#T#", $ret["command_line"]);
+		$ret["command_line"] = str_replace('\r', "#R#", $ret["command_line"]);
+		$ret["command_line"] = str_replace('/', "#S#", $ret["command_line"]);
+		$ret["command_line"] = str_replace('\\', "#BS#", $ret["command_line"]);
+		$ret["command_example"] = str_replace("\n", "#BR#", $ret["command_example"]);
+		$ret["command_example"] = str_replace("\t", "#T#", $ret["command_example"]);
+		$ret["command_example"] = str_replace("\r", "#R#", $ret["command_example"]);
+		$ret["command_example"] = str_replace('/', "#S#", $ret["command_example"]);
+		$ret["command_example"] = str_replace('\\', "#BS#", $ret["command_example"]);
+		$rq = "UPDATE command ";
+		$rq .= "SET command_name = '".htmlentities($ret["command_name"], ENT_QUOTES)."', " .
+				"command_line = '".htmlentities($ret["command_line"], ENT_QUOTES)."', " .
+				"command_example = '".htmlentities($ret["command_example"], ENT_QUOTES)."', " .
+				"command_type = '".htmlentities($ret["command_type"]["command_type"], ENT_QUOTES)."' " .
+				"WHERE command_id = '".$cmd_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function insertCommandInDB ($ret = array())	{
+		$cmd_id = insertCommand($ret);
+		return ($cmd_id);
+	}
+	
+	function insertCommand($ret = array())	{
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$ret["command_line"] = str_replace("\n", "#BR#", $ret["command_line"]);
+		$ret["command_line"] = str_replace("\t", "#T#", $ret["command_line"]);
+		$ret["command_line"] = str_replace("\r", "#R#", $ret["command_line"]);
+		$ret["command_line"] = str_replace('/', "#S#", $ret["command_line"]);
+		$ret["command_line"] = str_replace('\\', "#BS#", $ret["command_line"]);
+		$ret["command_example"] = str_replace("\n", "#BR#", $ret["command_example"]);
+		$ret["command_example"] = str_replace("\t", "#T#", $ret["command_example"]);
+		$ret["command_example"] = str_replace("\r", "#R#", $ret["command_example"]);
+		$ret["command_example"] = str_replace('/', "#S#", $ret["command_example"]);
+		$ret["command_example"] = str_replace('\\', "#BS#", $ret["command_example"]);
+		$rq = "INSERT INTO command ";
+		$rq .= "(command_name, command_line, command_example, command_type) ";
+		$rq .= "VALUES ";
+		$rq .= "('".htmlentities($ret["command_name"], ENT_QUOTES)."', '".htmlentities($ret["command_line"], ENT_QUOTES)."', '".htmlentities($ret["command_example"], ENT_QUOTES)."', '".$ret["command_type"]["command_type"]."')";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(command_id) FROM command");
+		$cmd_id = $res->fetchRow();
+		return ($cmd_id["MAX(command_id)"]);
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/command/command.php b/www/include/configuration/configObject/command/command.php
new file mode 100644
index 0000000000000000000000000000000000000000..91751cca9a13c59911b095a74c93618a3e6c7721
--- /dev/null
+++ b/www/include/configuration/configObject/command/command.php
@@ -0,0 +1,60 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+
+	isset($_GET["command_id"]) ? $cmdG = $_GET["command_id"] : $cmdG = NULL;
+	isset($_POST["command_id"]) ? $cmdP = $_POST["command_id"] : $cmdP = NULL;
+	$cmdG ? $command_id = $cmdG : $command_id = $cmdP;
+
+	isset($_GET["type"]) ? $typeG = $_GET["type"] : $typeG = NULL;
+	isset($_POST["type"]) ? $typeP = $_POST["type"] : $typeP = NULL;
+	$typeG ? $type = $typeG : $type = $typeP;
+	$type == "C" ? $type = 2 : NULL;
+	$type == "N" ? $type = 1 : NULL;
+	isset($_POST["command_type"]) ? $type = $_POST["command_type"]["command_type"] : null;
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/command/";
+
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+
+	if ($min)
+		switch ($o)	{
+			case "h" : require_once($path."minHelpCommand.php"); break; #Show Help Command	# Wistof
+			default : require_once($path."minCommand.php"); break;
+		}
+
+	else
+	switch ($o)	{
+		case "a" : require_once($path."formCommand.php"); break; #Add a Command
+		case "w" : require_once($path."formCommand.php"); break; #Watch a Command
+		case "c" : require_once($path."formCommand.php"); break; #Modify a Command
+		case "m" : multipleCommandInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listCommand.php"); break; #Duplicate n Commands
+		case "d" : deleteCommandInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listCommand.php"); break; #Delete n Commands
+		default : require_once($path."listCommand.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/command/formCommand.ihtml b/www/include/configuration/configObject/command/formCommand.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..f7ac3398b623b398abe72566a91c249218dd9356
--- /dev/null
+++ b/www/include/configuration/configObject/command/formCommand.ihtml
@@ -0,0 +1,55 @@
+{$form.javascript}
+{$insertValueQuery}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/exchange.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name"  colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.command_name.label}</td><td class="FormRowValue">{$form.command_name.html}</td></tr>
+		<tr class="list_two">
+			<td class="FormRowField">{$form.command_line.label}</td>
+			<td>
+				<table border="0">
+				<tr>
+				<td>
+					&nbsp;{$form.command_line.html}
+				</td>
+				{if $o == "a" || $o == "c"}
+				<td>
+					&nbsp;&nbsp;&nbsp;&nbsp;
+					<input type="button" value="&nbsp;&nbsp;&lt;&nbsp;&lt;&nbsp;&nbsp;" onclick="insertValueQuery(1)" />
+					&nbsp;&nbsp;&nbsp;&nbsp;
+					{$form.resource.html}
+					<br><br>
+					&nbsp;&nbsp;&nbsp;&nbsp;
+					<input type="button" value="&nbsp;&nbsp;&lt;&nbsp;&lt;&nbsp;&nbsp;" onclick="insertValueQuery(2)" />
+					&nbsp;&nbsp;&nbsp;&nbsp;
+					{$form.plugins.html}
+     				&nbsp;<img alt='{$cmd_help}' title='{$cmd_help}' src='./img/icones/16x16/exchange.gif' onClick="window.open('oreon.php?p=60706&command_name='+ document.Form.plugins.value + '&o=h&min=1','','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no, width=700, height=400');">
+					<br><br>
+					&nbsp;&nbsp;&nbsp;&nbsp;
+					<input type="button" value="&nbsp;&nbsp;&lt;&nbsp;&lt;&nbsp;&nbsp;" onclick="insertValueQuery(3)" />
+					&nbsp;&nbsp;&nbsp;&nbsp;
+					{$form.macros.html}
+				</td>
+				{/if}
+				</tr>
+				</table>
+			</td>
+		</tr>
+		<tr class="list_one"><td class="FormRowField">{$form.command_example.label}</td><td class="FormRowValue">{$form.command_example.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.command_type.label}</td><td class="FormRowValue">{$form.command_type.html}</td></tr>
+
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
diff --git a/www/include/configuration/configObject/command/formCommand.php b/www/include/configuration/configObject/command/formCommand.php
new file mode 100644
index 0000000000000000000000000000000000000000..afcdca3ffdc43352b023f5aa3bae33e0e89965e8
--- /dev/null
+++ b/www/include/configuration/configObject/command/formCommand.php
@@ -0,0 +1,233 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Command
+	#
+	
+	function myDecodeCommand($arg)	{
+		$arg = html_entity_decode($arg, ENT_QUOTES);
+		$arg = str_replace('#BR#', "\\n", $arg);
+		$arg = str_replace('#T#', "\\t", $arg);
+		$arg = str_replace('#R#', "\\r", $arg);
+		$arg = str_replace('#S#', "/", $arg);
+		$arg = str_replace('#BS#', "\\", $arg);
+		return($arg);
+	}
+
+	$cmd = array();
+	if (($o == "c" || $o == "w") && $command_id)	{
+		
+		$res =& $pearDB->query("SELECT * FROM command WHERE command_id = '".$command_id."' LIMIT 1");
+		# Set base value
+		$cmd = array_map("myDecodeCommand", $res->fetchRow());
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Resource Macro
+	$resource = array();
+	$res =& $pearDB->query("SELECT DISTINCT resource_line FROM cfg_resource ORDER BY resource_line");
+	while($res->fetchInto($row))	{
+		$row["resource_line"] = explode("=", $row["resource_line"]);
+		$resource[$row["resource_line"][0]] = $row["resource_line"][0];
+	}
+	$res->free();
+	# Nagios Macro
+	$macros = array();
+	$res =& $pearDB->query("SELECT macro_name FROM nagios_macro ORDER BY macro_name");
+	while($res->fetchInto($row))
+		$macros[$row["macro_name"]] = $row["macro_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"35");
+	$attrsTextarea 	= array("rows"=>"9", "cols"=>"80");
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["cmd_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["cmd_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["cmd_view"]);
+
+	#
+	## Command information
+	#
+	if ($type == "1")
+		$form->addElement('header', 'information', $lang['cmd_notif']);
+	else if ($type == "2")
+		$form->addElement('header', 'information', $lang['cmd_check']);
+	else
+		$form->addElement('header', 'information', $lang['cmd_infos']);
+	$cmdType[] = &HTML_QuickForm::createElement('radio', 'command_type', null, $lang['cmd_notif'], '1');
+	$cmdType[] = &HTML_QuickForm::createElement('radio', 'command_type', null, $lang['cmd_check'], '2');
+	$form->addGroup($cmdType, 'command_type', $lang['cmd_type'], '&nbsp;&nbsp;');
+	$form->setDefaults(array('command_type' => '2'));
+	$form->addElement('text', 'command_name', $lang["cmd_name"], $attrsText);
+	$form->addElement('text', 'command_example', $lang["cmd_example"], $attrsText);
+	$form->addElement('textarea', 'command_line', $lang["cmd_line"], $attrsTextarea);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action' => '1'));
+	
+	$form->addElement('select', 'resource', null, $resource);
+	$form->addElement('select', 'macros', null, $macros);
+	
+	ksort($oreon->plugins);
+	$form->addElement('select', 'plugins', null, $oreon->plugins);
+	
+	#
+	## Further informations
+	#
+	$form->addElement('hidden', 'command_id');
+	$redirectType =& $form->addElement('hidden', 'type');
+	$redirectType->setValue($type);
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	function myReplace()	{
+		global $form;
+		$ret = $form->getSubmitValues();
+		return (str_replace(" ", "_", $ret["command_name"]));
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('command_name', 'myReplace');
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('command_name', $lang['ErrName'], 'required');
+	$form->addRule('command_line', $lang['ErrCmdLine'], 'required');
+	$form->registerRule('exist', 'callback', 'testCmdExistence');
+	$form->addRule('command_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Just watch a Command information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&command_id=".$command_id."'"));
+	    $form->setDefaults($cmd);
+		$form->freeze();
+	}
+	# Modify a Command information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($cmd);
+	}
+	# Add a Command information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	$tpl->assign('msg', array ("comment"=>$lang['cmd_comment']));
+	$tpl->assign('cmd_help',$lang['cmd_help']);
+	$tpl->assign("insertValueQuery","
+	<script type='text/javascript'>
+	<!--
+	function insertValueQuery(elem) {
+    var myQuery = document.Form.command_line;
+	if(elem == 1)	{
+		var myListBox = document.Form.resource;
+	}
+	else if (elem == 2)	{
+		var myListBox = document.Form.plugins;
+	}
+	else if (elem == 3)	{
+		var myListBox = document.Form.macros;
+	}
+    if(myListBox.options.length > 0) {
+        var chaineAj = '';
+        var NbSelect = 0;
+        for(var i=0; i<myListBox.options.length; i++) {
+            if (myListBox.options[i].selected){
+                NbSelect++;
+                if (NbSelect > 1)
+                    chaineAj += ', ';
+                chaineAj += myListBox.options[i].value;
+            }
+        }
+        //IE support
+        if (document.selection) {
+            myQuery.focus();
+            sel = document.selection.createRange();
+            sel.text = chaineAj;
+            document.Form.insert.focus();
+        }
+        //MOZILLA/NETSCAPE support
+        else if (document.Form.command_line.selectionStart || document.Form.command_line.selectionStart == '0') {
+            var startPos = document.Form.command_line.selectionStart;
+            var endPos = document.Form.command_line.selectionEnd;
+            var chaineSql = document.Form.command_line.value;
+
+            myQuery.value = chaineSql.substring(0, startPos) + chaineAj + chaineSql.substring(endPos, chaineSql.length);
+        } else {
+            myQuery.value += chaineAj;
+        }
+    }
+}
+	//-->
+	</script>");
+	$valid = false;
+	if ($form->validate())	{
+		$cmdObj =& $form->getElement('command_id');
+		if ($form->getSubmitValue("submitA"))
+			$cmdObj->setValue(insertCommandInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateCommandInDB($cmdObj->getValue());
+		$o = "w";
+		$cmdObj =& $form->getElement('command_id');
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&command_id=".$cmdObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listCommand.php");
+	else	{
+		##Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->display("formCommand.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/command/listCommand.ihtml b/www/include/configuration/configObject/command/listCommand.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..56369fe3574a618fe61ddcca0ce1e7b7efa70013
--- /dev/null
+++ b/www/include/configuration/configObject/command/listCommand.ihtml
@@ -0,0 +1,45 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_type}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_type}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight" align="right">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">				
+			</td>
+			<td class="ListColFooterCenter" colspan="3"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+
+	{$form.hidden}
+	</form>
diff --git a/www/include/configuration/configObject/command/listCommand.php b/www/include/configuration/configObject/command/listCommand.php
new file mode 100644
index 0000000000000000000000000000000000000000..9e5694ce92c18f27313561b578f35b0467844e14
--- /dev/null
+++ b/www/include/configuration/configObject/command/listCommand.php
@@ -0,0 +1,108 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM command WHERE command_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'");
+	else if ($type)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM command WHERE command_type = '".$type."'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM command");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_type", $lang['cmd_type']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+
+	#List of elements - Depends on different criteria
+	if ($search)
+		$rq = "SELECT command_id, command_name, command_line, command_type FROM command WHERE command_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' ORDER BY command_name LIMIT ".$num * $limit.", ".$limit;
+	else if ($type)
+		$rq = "SELECT command_id, command_name, command_line, command_type FROM command WHERE command_type = '".$type."' ORDER BY command_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT command_id, command_name, command_line, command_type FROM command ORDER BY command_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($cmd); $i++) {
+		$selectedElements =& $form->addElement('checkbox', "select[".$cmd['command_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&command_id=".$cmd['command_id']."&o=w&type=".$cmd['command_type']."&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&command_id=".$cmd['command_id']."&o=c&type=".$cmd['command_type']."&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&command_id=".$cmd['command_id']."&o=d&type=".$cmd['command_type']."&select[".$cmd['command_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$cmd['command_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$cmd["command_line"] = str_replace('#BR#', "\\n", $cmd["command_line"]);
+		$cmd["command_line"] = str_replace('#T#', "\\t", $cmd["command_line"]);
+		$cmd["command_line"] = str_replace('#R#', "\\r", $cmd["command_line"]);
+		$cmd["command_line"] = str_replace('#S#', "/", $cmd["command_line"]);
+		$cmd["command_line"] = str_replace('#BS#', "\\", $cmd["command_line"]);
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$cmd["command_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&command_id=".$cmd['command_id']."&type=".$cmd['command_type'],
+						"RowMenu_desc"=>substr($cmd["command_line"], 0, 40)."...",
+						"RowMenu_type"=>$cmd["command_type"] == 2 ? $lang['cmd_checkShort'] : $lang['cmd_notifShort'],
+						"RowMenu_status"=>$lang['enable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";
+	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listCommand.ihtml");
+	
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+?>
diff --git a/www/include/configuration/configObject/command/minCommand.ihtml b/www/include/configuration/configObject/command/minCommand.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..d5709136d5ea84b65c7b2372a76aaedf7abfa0e0
--- /dev/null
+++ b/www/include/configuration/configObject/command/minCommand.ihtml
@@ -0,0 +1,14 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/exchange.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name"  colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.command_name.label}</td><td class="FormRowValue">{$form.command_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.command_line.label}</td><td class="FormRowValue">{$form.command_line.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.command_type.label}</td><td class="FormRowValue">{$form.command_type.html}</td></tr>
+
+		<tr class="list_two"><td class="FormRowField">{$form.command_id1.label}</td><td class="FormRowValue">{$form.command_id1.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.command_id2.label}</td><td class="FormRowValue">{$form.command_id2.html}</td></tr>
+	</table>
+	{$form.hidden}
+</form>
diff --git a/www/include/configuration/configObject/command/minCommand.php b/www/include/configuration/configObject/command/minCommand.php
new file mode 100644
index 0000000000000000000000000000000000000000..b9bcc5c6e718b3d5199028d459f400cc927d2fb0
--- /dev/null
+++ b/www/include/configuration/configObject/command/minCommand.php
@@ -0,0 +1,117 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$cmd = array("command_type"=>null, "command_name"=>null, "command_line"=>null);
+	if (isset($_POST["command_id1"]) && $_POST["command_id1"])
+		$command_id = $_POST["command_id1"];
+	else if (isset($_POST["command_id2"]) && $_POST["command_id2"])
+		$command_id = $_POST["command_id2"];
+
+	if ($o == "w" && $command_id)	{
+		function myDecodeCommand($arg)	{
+			$arg = html_entity_decode($arg, ENT_QUOTES);
+			$arg = str_replace('#BR#', "\\n", $arg);
+			$arg = str_replace('#T#', "\\t", $arg);
+			$arg = str_replace('#R#', "\\r", $arg);
+			$arg = str_replace('#S#', "/", $arg);
+			$arg = str_replace('#BS#', "\\", $arg);
+			return($arg);
+		}
+		$res =& $pearDB->query("SELECT * FROM command WHERE command_id = '".$command_id."' LIMIT 1");
+		# Set base value
+		if ($res->numRows())
+			$cmd = array_map("myDecodeCommand", $res->fetchRow());
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Notification commands comes from DB -> Store in $notifCmds Array
+	$notifCmds = array(null=>null);
+	$res =& $pearDB->query("SELECT command_id, command_name FROM command WHERE command_type = '1' ORDER BY command_name");
+	while($res->fetchInto($notifCmd))
+		$notifCmds[$notifCmd["command_id"]] = $notifCmd["command_name"];
+	$res->free();
+	# Check commands comes from DB -> Store in $checkCmds Array
+	$checkCmds = array(null=>null);
+	$res =& $pearDB->query("SELECT command_id, command_name FROM command WHERE command_type = '2' ORDER BY command_name");
+	while($res->fetchInto($checkCmd))
+		$checkCmds[$checkCmd["command_id"]] = $checkCmd["command_name"];
+	$res->free();
+
+	$attrsText 		= array("size"=>"35");
+	$attrsTextarea 	= array("rows"=>"9", "cols"=>"80");
+
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	$form->addElement('header', 'title', $lang["cmd_view"]);
+
+	#
+	## Command information
+	#
+	if ($cmd["command_type"] == "1")
+		$form->addElement('header', 'information', $lang['cmd_notif']);
+	else if ($cmd["command_type"] == "2")
+		$form->addElement('header', 'information', $lang['cmd_check']);
+	else
+		$form->addElement('header', 'information', $lang['cmd_infos']);
+	$cmdType[] = &HTML_QuickForm::createElement('radio', 'command_type', null, $lang['cmd_notif'], '1');
+	$cmdType[] = &HTML_QuickForm::createElement('radio', 'command_type', null, $lang['cmd_check'], '2');
+	$v1 =& $form->addGroup($cmdType, 'command_type', $lang['cmd_type'], '&nbsp;&nbsp;');
+	$v1->freeze();
+	$v2 =& $form->addElement('text', 'command_name', $lang["cmd_name"], $attrsText);
+	$v2->freeze();
+	$v3 =& $form->addElement('textarea', 'command_line', $lang["cmd_line"], $attrsTextarea);
+	$v3->freeze();
+	#
+	## Command Select
+	#
+    $form->addElement('select', 'command_id1', $lang['cmd_check'], $checkCmds, array("onChange"=>"this.form.submit()"));
+    $form->addElement('select', 'command_id2', $lang['cmd_notif'], $notifCmds, array("onChange"=>"this.form.submit()"));
+    
+    $form->setConstants(array("command_name"=>$cmd["command_name"], "command_line"=>$cmd["command_line"], "command_type"=>$cmd["command_type"]["command_type"]));
+    
+	#
+	## Further informations
+	#
+	
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	$min =& $form->addElement('hidden', 'min');
+	$min->setValue(1);
+	
+	#
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+	$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());	
+	$tpl->assign('o', $o);		
+	
+	$tpl->display("minCommand.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/command/minHelpCommand.ihtml b/www/include/configuration/configObject/command/minHelpCommand.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..134c86614ff80ff34483e25fe2dbb4e3497b80ff
--- /dev/null
+++ b/www/include/configuration/configObject/command/minHelpCommand.ihtml
@@ -0,0 +1,10 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/exchange.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name"  colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.command_line.label}</td><td class="FormRowValue">{$command_line}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.command_help.label}</td><td class="FormRowValue">{$msg}</td></tr>
+	</table>
+	{$form.hidden}
+</form>
diff --git a/www/include/configuration/configObject/command/minHelpCommand.php b/www/include/configuration/configObject/command/minHelpCommand.php
new file mode 100644
index 0000000000000000000000000000000000000000..3a5c97a8c1830a62a1ea04e473fbd6222692c120
--- /dev/null
+++ b/www/include/configuration/configObject/command/minHelpCommand.php
@@ -0,0 +1,71 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (isset($_GET["command_name"]))
+		$command_name = $_GET["command_name"];
+	else if (isset($_POST["command_name"]))
+		$command_name = $_POST["command_name"];
+	else
+		$command_name = NULL;
+
+	$command_name = ltrim($command_name,"/");
+
+	$stdout = shell_exec($oreon->optGen["nagios_path_plugins"]. $command_name . " --help");
+	$msg = str_replace ("\n", "<br>", $stdout);
+
+	$attrsText 		= array("size"=>"25");
+
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	$form->addElement('header', 'title',$lang['cmd_help']);
+
+	#
+	## Command information
+	#
+	$form->addElement('header', 'information', $lang['cmd_help_output']);
+
+	$form->addElement('text', 'command_line', $lang['cmd_line'], $attrsText);
+	$form->addElement('text', 'command_help', $lang['cmd_output'], $attrsText);
+
+	#
+	## Further informations
+	#
+
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	$tpl->assign('command_line', $oreon->optGen["nagios_path_plugins"]. $command_name . " --help");
+	if (isset($msg) && $msg)
+		$tpl->assign('msg', $msg);
+
+	#
+	##Apply a template definition
+	#
+
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->assign('o', $o);
+	$tpl->display("minHelpCommand.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/contact/DB-Func.php b/www/include/configuration/configObject/contact/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..f77deb73ef30563f97e6ff7d15022736a39040ea
--- /dev/null
+++ b/www/include/configuration/configObject/contact/DB-Func.php
@@ -0,0 +1,269 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+
+	function testContactExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('contact_id');
+		$res =& $pearDB->query("SELECT contact_name, contact_id FROM contact WHERE contact_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$contact =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $contact["contact_id"] == $id)
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $contact["contact_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+
+	function testAliasExistence ($alias = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('contact_id');
+		$res =& $pearDB->query("SELECT contact_alias, contact_id FROM contact WHERE contact_alias = '".htmlentities($alias, ENT_QUOTES)."'");
+		$contact =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $contact["contact_id"] == $id)
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $contact["contact_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+
+	function enableContactInDB ($contact_id = null)	{
+		if (!$contact_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE contact SET contact_activate = '1' WHERE contact_id = '".$contact_id."'");
+	}
+
+	function disableContactInDB ($contact_id = null)	{
+		if (!$contact_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE contact SET contact_activate = '0' WHERE contact_id = '".$contact_id."'");
+	}
+
+	function deleteContactInDB ($contacts = array())	{
+		global $pearDB;
+		foreach($contacts as $key=>$value)
+			$pearDB->query("DELETE FROM contact WHERE contact_id = '".$key."'");
+	}
+
+	function multipleContactInDB ($contacts = array(), $nbrDup = array())	{
+		foreach($contacts as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM contact WHERE contact_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["contact_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "contact_name" ? ($contact_name = $value2 = $value2."_".$i) : null;
+					$key2 == "contact_alias" ? ($contact_alias = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2 != NULL?("'".$value2."'"):"NULL");
+				}
+				if (testContactExistence($contact_name) && testAliasExistence($contact_alias))	{
+					$val ? $rq = "INSERT INTO contact VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(contact_id) FROM contact");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(contact_id)"]))	{
+						$res =& $pearDB->query("SELECT DISTINCT command_command_id FROM contact_hostcommands_relation WHERE contact_contact_id = '".$key."'");
+						while($res->fetchInto($hostCmd))
+							$pearDB->query("INSERT INTO contact_hostcommands_relation VALUES ('', '".$maxId["MAX(contact_id)"]."', '".$hostCmd["command_command_id"]."')");
+						$res =& $pearDB->query("SELECT DISTINCT command_command_id FROM contact_servicecommands_relation WHERE contact_contact_id = '".$key."'");
+						while($res->fetchInto($serviceCmd))
+							$pearDB->query("INSERT INTO contact_servicecommands_relation VALUES ('', '".$maxId["MAX(contact_id)"]."', '".$serviceCmd["command_command_id"]."')");
+						$res =& $pearDB->query("SELECT DISTINCT contactgroup_cg_id FROM contactgroup_contact_relation WHERE contact_contact_id = '".$key."'");
+						while($res->fetchInto($Cg))
+							$pearDB->query("INSERT INTO contactgroup_contact_relation VALUES ('', '".$maxId["MAX(contact_id)"]."', '".$Cg["contactgroup_cg_id"]."')");
+					}
+				}
+			}
+		}
+	}
+
+	function updateContactInDB ($contact_id = NULL)	{
+		if (!$contact_id) return;
+		updateContact($contact_id);
+		updateContactHostCommands($contact_id);
+		updateContactServiceCommands($contact_id);
+		updateContactContactGroup($contact_id);
+	}
+
+	function insertContactInDB ($ret = array())	{
+		$contact_id = insertContact($ret);
+		updateContactHostCommands($contact_id, $ret);
+		updateContactServiceCommands($contact_id, $ret);
+		updateContactContactGroup($contact_id, $ret);
+		return ($contact_id);
+	}
+
+	function insertContact($ret = array())	{
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO `contact` ( " .
+				"`contact_id` , `timeperiod_tp_id` , `timeperiod_tp_id2` , `contact_name` , " .
+				"`contact_alias` , `contact_passwd` , `contact_lang` , " .
+				"`contact_host_notification_options` , `contact_service_notification_options` , " .
+				"`contact_email` , `contact_pager` , `contact_comment` , `contact_oreon` , `contact_admin` , `contact_type_msg`, `contact_activate`, `contact_auth_type`, `contact_ldap_dn` )" .
+				"VALUES ( ";
+		$rq .= "NULL, ";
+		isset($ret["timeperiod_tp_id"]) && $ret["timeperiod_tp_id"] != NULL ? $rq .= "'".$ret["timeperiod_tp_id"]."', ": $rq .= "NULL, ";
+		isset($ret["timeperiod_tp_id2"]) && $ret["timeperiod_tp_id2"] != NULL ? $rq .= "'".$ret["timeperiod_tp_id2"]."', ": $rq .= "NULL, ";
+		isset($ret["contact_name"]) && $ret["contact_name"] != NULL ? $rq .= "'".htmlentities($ret["contact_name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["contact_alias"]) && $ret["contact_alias"] != NULL ? $rq .= "'".htmlentities($ret["contact_alias"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["contact_passwd"]) && $ret["contact_passwd"] != NULL ? $rq .= "'".md5($ret["contact_passwd"])."', ": $rq .= "NULL, ";
+		isset($ret["contact_lang"]) && $ret["contact_lang"] != NULL ? $rq .= "'".htmlentities($ret["contact_lang"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["contact_hostNotifOpts"]) && $ret["contact_hostNotifOpts"] != NULL ? $rq .= "'".implode(",", array_keys($ret["contact_hostNotifOpts"]))."', ": $rq .= "NULL, ";
+		isset($ret["contact_svNotifOpts"]) && $ret["contact_svNotifOpts"] != NULL ? $rq .= "'".implode(",", array_keys($ret["contact_svNotifOpts"]))."', ": $rq .= "NULL, ";
+		isset($ret["contact_email"]) && $ret["contact_email"] != NULL ? $rq .= "'".htmlentities($ret["contact_email"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["contact_pager"]) && $ret["contact_pager"] != NULL ? $rq .= "'".htmlentities($ret["contact_pager"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["contact_comment"]) && $ret["contact_comment"] != NULL ? $rq .= "'".htmlentities($ret["contact_comment"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["contact_oreon"]["contact_oreon"]) && $ret["contact_oreon"]["contact_oreon"] != NULL ? $rq .= "'".$ret["contact_oreon"]["contact_oreon"]."', ": $rq .= "NULL, ";
+		isset($ret["contact_admin"]["contact_admin"]) && $ret["contact_admin"]["contact_admin"] != NULL ? $rq .= "'".$ret["contact_admin"]["contact_admin"]."', ": $rq .= "NULL, ";
+		isset($ret["contact_type_msg"]) && $ret["contact_type_msg"] != NULL ? $rq .= "'".$ret["contact_type_msg"]."', ": $rq .= "NULL, ";
+		isset($ret["contact_activate"]["contact_activate"]) && $ret["contact_activate"]["contact_activate"] != NULL ? $rq .= "'".$ret["contact_activate"]["contact_activate"]."', ": $rq .= "NULL, ";
+		isset($ret["contact_auth_type"]) && $ret["contact_auth_type"] != NULL ? $rq .= "'".$ret["contact_auth_type"]."', ": $rq .= "local, ";
+		isset($ret["contact_ldap_dn"]) && $ret["contact_ldap_dn"] != NULL ? $rq .= "'".$ret["contact_ldap_dn"]."' ": $rq .= "NULL ";
+		$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(contact_id) FROM contact");
+		$contact_id = $res->fetchRow();
+		return ($contact_id["MAX(contact_id)"]);
+	}
+
+	function updateContact($contact_id = null)	{
+		if (!$contact_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE contact ";
+		$rq .= "SET timeperiod_tp_id = ";
+		isset($ret["timeperiod_tp_id"]) && $ret["timeperiod_tp_id"] != NULL ? $rq .= "'".$ret["timeperiod_tp_id"]."', ": $rq .= "NULL, ";
+		$rq .= "timeperiod_tp_id2 = ";
+		isset($ret["timeperiod_tp_id2"]) && $ret["timeperiod_tp_id2"] != NULL ? $rq .= "'".$ret["timeperiod_tp_id2"]."', ": $rq .= "NULL, ";
+		$rq .= "contact_name = ";
+		isset($ret["contact_name"]) && $ret["contact_name"] != NULL ? $rq .= "'".htmlentities($ret["contact_name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "contact_alias = ";
+		isset($ret["contact_alias"]) && $ret["contact_alias"] != NULL ? $rq .= "'".htmlentities($ret["contact_alias"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		if (isset($ret["contact_oreon"]["contact_oreon"]) && $ret["contact_oreon"]["contact_oreon"] && isset($ret["contact_passwd"]) && $ret["contact_passwd"])
+			$rq .= "contact_passwd = '".md5($ret["contact_passwd"])."', ";
+		else if (isset($ret["contact_oreon"]["contact_oreon"]) && !$ret["contact_oreon"]["contact_oreon"])
+			$rq .= "contact_passwd = NULL, ";
+		$rq .=	"contact_lang = ";
+		isset($ret["contact_lang"]) && $ret["contact_lang"] != NULL ? $rq .= "'".htmlentities($ret["contact_lang"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= 	"contact_host_notification_options = ";
+		isset($ret["contact_hostNotifOpts"]) && $ret["contact_hostNotifOpts"] != NULL ? $rq .= "'".implode(",", array_keys($ret["contact_hostNotifOpts"]))."', ": $rq .= "NULL, ";
+		$rq .= "contact_service_notification_options = ";
+		isset($ret["contact_svNotifOpts"]) && $ret["contact_svNotifOpts"] != NULL ? $rq .= "'".implode(",", array_keys($ret["contact_svNotifOpts"]))."', ": $rq .= "NULL, ";
+		$rq .= "contact_email = ";
+		isset($ret["contact_email"]) && $ret["contact_email"] != NULL ? $rq .= "'".htmlentities($ret["contact_email"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "contact_pager = ";
+		isset($ret["contact_pager"]) && $ret["contact_pager"] != NULL ? $rq .= "'".htmlentities($ret["contact_pager"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "contact_comment = ";
+		isset($ret["contact_comment"]) && $ret["contact_comment"] != NULL ? $rq .= "'".htmlentities($ret["contact_comment"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "contact_oreon = ";
+		isset($ret["contact_oreon"]["contact_oreon"]) && $ret["contact_oreon"]["contact_oreon"] != NULL ? $rq .= "'".$ret["contact_oreon"]["contact_oreon"]."', ": $rq .= "NULL, ";
+		$rq .= "contact_admin = ";
+		isset($ret["contact_admin"]["contact_admin"]) && $ret["contact_admin"]["contact_admin"] != NULL ? $rq .= "'".$ret["contact_admin"]["contact_admin"]."', ": $rq .= "NULL, ";
+		$rq .= "contact_type_msg = ";
+		isset($ret["contact_type_msg"]) && $ret["contact_type_msg"] != NULL ? $rq .= "'".$ret["contact_type_msg"]."', ": $rq .= "NULL, ";
+		$rq .= "contact_activate = ";
+		isset($ret["contact_activate"]["contact_activate"]) && $ret["contact_activate"]["contact_activate"] != NULL ? $rq .= "'".$ret["contact_activate"]["contact_activate"]."', ": $rq .= "NULL, ";
+		$rq .= "contact_auth_type = ";
+		isset($ret["contact_auth_type"]) && $ret["contact_auth_type"] != NULL ? $rq .= "'".$ret["contact_auth_type"]."', ": $rq .= "local, ";
+		$rq .= "contact_ldap_dn = ";
+		isset($ret["contact_ldap_dn"]) && $ret["contact_ldap_dn"] != NULL ? $rq .= "'".$ret["contact_ldap_dn"]."' ": $rq .= "NULL ";
+		$rq .= "WHERE contact_id = '".$contact_id."'";
+		$pearDB->query($rq);
+	}
+
+	function updateContactHostCommands($contact_id = null, $ret = array())	{
+		if (!$contact_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM contact_hostcommands_relation ";
+		$rq .= "WHERE contact_contact_id = '".$contact_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["contact_hostNotifCmds"]))
+			$ret = $ret["contact_hostNotifCmds"];
+		else
+			$ret = $form->getSubmitValue("contact_hostNotifCmds");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO contact_hostcommands_relation ";
+			$rq .= "(contact_contact_id, command_command_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$contact_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+
+	function updateContactServiceCommands($contact_id = null, $ret = array())	{
+		if (!$contact_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM contact_servicecommands_relation ";
+		$rq .= "WHERE contact_contact_id = '".$contact_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["contact_svNotifCmds"]))
+			$ret = $ret["contact_svNotifCmds"];
+		else
+			$ret = $form->getSubmitValue("contact_svNotifCmds");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO contact_servicecommands_relation ";
+			$rq .= "(contact_contact_id, command_command_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$contact_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+
+	function updateContactContactGroup($contact_id = null, $ret = array())	{
+		if (!$contact_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM contactgroup_contact_relation ";
+		$rq .= "WHERE contact_contact_id = '".$contact_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["contact_cgNotif"]))
+			$ret = $ret["contact_cgNotif"];
+		else
+			$ret = $form->getSubmitValue("contact_cgNotif");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO contactgroup_contact_relation ";
+			$rq .= "(contact_contact_id, contactgroup_cg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$contact_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/contact/contact.php b/www/include/configuration/configObject/contact/contact.php
new file mode 100644
index 0000000000000000000000000000000000000000..6bf459f7e65d7e5ead202e5f86c664abfd8e5d29
--- /dev/null
+++ b/www/include/configuration/configObject/contact/contact.php
@@ -0,0 +1,49 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["contact_id"]) ? $cG = $_GET["contact_id"] : $cG = NULL;
+	isset($_POST["contact_id"]) ? $cP = $_POST["contact_id"] : $cP = NULL;
+	$cG ? $contact_id = $cG : $contact_id = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/contact/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formContact.php"); break; #Add a contact
+		case "w" : require_once($path."formContact.php"); break; #Watch a contact
+		case "c" : require_once($path."formContact.php"); break; #Modify a contact
+		case "s" : enableContactInDB($contact_id); require_once($path."listContact.php"); break; #Activate a contact
+		case "u" : disableContactInDB($contact_id); require_once($path."listContact.php"); break; #Desactivate a contact
+		case "m" : multipleContactInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listContact.php"); break; #Duplicate n contacts
+		case "d" : deleteContactInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listContact.php"); break; #Delete n contacts
+		default : require_once($path."listContact.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/contact/formContact.ihtml b/www/include/configuration/configObject/contact/formContact.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..53d419d45df195a0f8312b639a18957d6ad8c59e
--- /dev/null
+++ b/www/include/configuration/configObject/contact/formContact.ihtml
@@ -0,0 +1,54 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/user1.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/house.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_name.label}</td><td class="FormRowValue">{$form.contact_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.contact_alias.label}</td><td class="FormRowValue">{$form.contact_alias.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_email.label}</td><td class="FormRowValue">{$form.contact_email.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.contact_pager.label}</td><td class="FormRowValue">{$form.contact_pager.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_cgNotif.label}</td><td class="FormRowValue"><p  class="oreonbutton">{$form.contact_cgNotif.html}</p></td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/oreon.gif'>&nbsp;&nbsp;{$form.header.oreon}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_oreon.label}</td><td class="FormRowValue">{$form.contact_oreon.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.contact_passwd.label}</td><td class="FormRowValue">{$form.contact_passwd.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_passwd2.label}</td><td class="FormRowValue">{$form.contact_passwd2.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.contact_lang.label}</td><td class="FormRowValue">{$form.contact_lang.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_type_msg.label}</td><td class="FormRowValue">{$form.contact_type_msg.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.contact_admin.label}</td><td class="FormRowValue">{$form.contact_admin.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_auth_type.label}</td><td class="FormRowValue">{$form.contact_auth_type.html}</td></tr>
+		{if $ldap == "1" }
+			<tr class="list_two"><td class="FormRowField">{$form.contact_ldap_dn.label}</td><td class="FormRowValue">{$form.contact_ldap_dn.html}</td></tr>
+		{/if}
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/mail_write.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+
+	 	<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2"><img src='./img/icones/16x16/server_client.gif'>&nbsp;&nbsp;{$form.header.hostNotification}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_hostNotifOpts.label}</td><td class="FormRowValue">{$form.contact_hostNotifOpts.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.timeperiod_tp_id.label}</td><td class="FormRowValue">{$form.timeperiod_tp_id.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_hostNotifCmds.label}</td><td class="FormRowValue"><p  class="oreonbutton">{$form.contact_hostNotifCmds.html}</p></td></tr>
+
+	 	<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2"><img src='./img/icones/16x16/element_new_after.gif'>&nbsp;&nbsp;{$form.header.serviceNotification}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_svNotifOpts.label}</td><td class="FormRowValue">{$form.contact_svNotifOpts.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.timeperiod_tp_id2.label}</td><td class="FormRowValue">{$form.timeperiod_tp_id2.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_svNotifCmds.label}</td><td class="FormRowValue"><p  class="oreonbutton">{$form.contact_svNotifCmds.html}</p></td></tr>
+
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/cookies.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_activate.label}</td><td class="FormRowValue">{$form.contact_activate.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.contact_comment.label}</td><td class="FormRowValue">{$form.contact_comment.html}</td></tr>
+
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
+
diff --git a/www/include/configuration/configObject/contact/formContact.php b/www/include/configuration/configObject/contact/formContact.php
new file mode 100644
index 0000000000000000000000000000000000000000..f28664b7fd3a25c7310dc2d6faa00504e23c6f7c
--- /dev/null
+++ b/www/include/configuration/configObject/contact/formContact.php
@@ -0,0 +1,299 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Contact
+	#
+	$cct = array();
+	if (($o == "c" || $o == "w") && $contact_id)	{
+		$cct["contact_hostNotifCmds"] = array();
+		$cct["contact_svNotifCmds"] = array();
+		$cct["contact_cgNotif"] = array();
+		$res =& $pearDB->query("SELECT * FROM contact WHERE contact_id = '".$contact_id."' LIMIT 1");
+		# Set base value
+		$cct = array_map("myDecode", $res->fetchRow());
+		$cct["contact_passwd"] = NULL;
+		# Set Host Notification Options
+		$tmp = explode(',', $cct["contact_host_notification_options"]);
+		foreach ($tmp as $key => $value)
+			$cct["contact_hostNotifOpts"][trim($value)] = 1;
+		# Set Service Notification Options
+		$tmp = explode(',', $cct["contact_service_notification_options"]);
+		foreach ($tmp as $key => $value)
+			$cct["contact_svNotifOpts"][trim($value)] = 1;
+		$res->free();
+		# Set Contact Group Parents
+		$res =& $pearDB->query("SELECT DISTINCT contactgroup_cg_id FROM contactgroup_contact_relation WHERE contact_contact_id = '".$contact_id."'");
+		for($i = 0; $res->fetchInto($notifCg); $i++)
+			$cct["contact_cgNotif"][$i] = $notifCg["contactgroup_cg_id"];
+		$res->free();
+		# Set Host Notification Commands
+		$res =& $pearDB->query("SELECT DISTINCT command_command_id FROM contact_hostcommands_relation WHERE contact_contact_id = '".$contact_id."'");
+		for($i = 0; $res->fetchInto($notifCmd); $i++)
+			$cct["contact_hostNotifCmds"][$i] = $notifCmd["command_command_id"];
+		$res->free();
+		# Set Service Notification Commands
+		$res =& $pearDB->query("SELECT DISTINCT command_command_id FROM contact_servicecommands_relation WHERE contact_contact_id = '".$contact_id."'");
+		for($i = 0; $res->fetchInto($notifCmd); $i++)
+			$cct["contact_svNotifCmds"][$i] = $notifCmd["command_command_id"];
+		$res->free();
+		$res =& $pearDB->query("SELECT ldap_auth_enable FROM general_opt LIMIT 1");
+		$res->fetchInto($ldap_auth);
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Langs -> $langs Array
+	$langs = array();
+	 $chemintotal = "./lang/";
+	if ($handle  = opendir($chemintotal))   {
+	    while ($file = readdir($handle))
+	    	if (!is_dir("$chemintotal/$file") && strcmp($file, "index.php")) {
+				$tab = split('\.', $file);
+	      		$langs[$tab[0]] = $tab[0];
+	      	}
+		closedir($handle);
+	}
+	# Timeperiods comes from DB -> Store in $notifsTps Array
+	$notifTps = array();
+	$res =& $pearDB->query("SELECT tp_id, tp_name FROM timeperiod ORDER BY tp_name");
+	while($res->fetchInto($notifTp))
+		$notifTps[$notifTp["tp_id"]] = $notifTp["tp_name"];
+	$res->free();
+	# Notification commands comes from DB -> Store in $notifsCmds Array
+	$notifCmds = array();
+	$res =& $pearDB->query("SELECT command_id, command_name FROM command WHERE command_type = '1' ORDER BY command_name");
+	while($res->fetchInto($notifCmd))
+		$notifCmds[$notifCmd["command_id"]] = $notifCmd["command_name"];
+	$res->free();
+	# Contact Groups comes from DB -> Store in $notifCcts Array
+	$notifCgs = array();
+	$res =& $pearDB->query("SELECT cg_id, cg_name FROM contactgroup ORDER BY cg_name");
+	while($res->fetchInto($notifCg))
+		$notifCgs[$notifCg["cg_id"]] = $notifCg["cg_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsText2 		= array("size"=>"60");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["cct_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["cct_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["cct_view"]);
+
+	#
+	## Contact basic information
+	#
+	$form->addElement('header', 'information', $lang['cct_infos']);
+	$form->addElement('text', 'contact_name', $lang["cct_name"], $attrsText);
+	$form->addElement('text', 'contact_alias', $lang["alias"], $attrsText);
+	$form->addElement('text', 'contact_email', $lang["cct_mail"], $attrsText);
+	$form->addElement('text', 'contact_pager', $lang["cct_pager"], $attrsText);
+    $ams3 =& $form->addElement('advmultiselect', 'contact_cgNotif', $lang["cct_cgNotif"], $notifCgs, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+
+
+	#
+	## Contact Oreon information
+	#
+	$form->addElement('header', 'oreon', $lang['cct_oreon']);
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'contact_oreon', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'contact_oreon', null, $lang["no"], '0');
+	$form->addGroup($tab, 'contact_oreon', $lang['cct_oreon_text'], '&nbsp;');
+	$form->setDefaults(array('contact_oreon' => '1'));
+	$form->addElement('password', 'contact_passwd', $lang['cct_passwd'], $attrsText);
+	$form->addElement('password', 'contact_passwd2', $lang['cct_passwd2'], $attrsText);
+    $form->addElement('select', 'contact_lang', $lang["cct_lang"], $langs);
+    $form->addElement('select', 'contact_type_msg', $lang['cct_mailType'], array("txt"=>"txt", "html"=>"html", "pdf"=>"pdf"));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'contact_admin', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'contact_admin', null, $lang["no"], '0');
+	$form->addGroup($tab, 'contact_admin', $lang['cct_admin'], '&nbsp;');
+	$form->setDefaults(array('contact_admin' => '1'));
+
+   $auth_type = array();
+   $auth_type["local"] = "local";
+	if (isset($ldap_auth['ldap_auth_enable']) && $ldap_auth['ldap_auth_enable'] == 1) {
+		$auth_type["ldap"] = "ldap";
+		$form->addElement('text', 'contact_ldap_dn', $lang["cct_ldap_dn"], $attrsText2);
+	}
+
+   	$form->addElement('select', 'contact_auth_type', $lang["cct_contact_auth_type"], $auth_type);
+
+	##
+	## Notification informations
+	##
+	$form->addElement('header', 'notification', $lang['cct_notif']);
+
+	# Host notif
+	$form->addElement('header', 'hostNotification', $lang['h']);
+ 	$hostNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'd', '&nbsp;', 'Down');
+	$hostNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unreachable');
+	$hostNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'r', '&nbsp;', 'Recovery');
+	if ($oreon->user->get_version() == 2)
+		$hostNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'f', '&nbsp;', 'Flapping');
+	$hostNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'n', '&nbsp;', 'None');
+	$form->addGroup($hostNotifOpt, 'contact_hostNotifOpts', $lang["cct_hostNotifOpt"], '&nbsp;&nbsp;');
+    $form->addElement('select', 'timeperiod_tp_id', $lang["cct_hostNotifTp"], $notifTps);
+    $ams1 =& $form->addElement('advmultiselect', 'contact_hostNotifCmds', $lang["cct_hostNotifCmd"], $notifCmds, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+	# Service notif
+	$form->addElement('header', 'serviceNotification', $lang['sv']);
+ 	$svNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'w', '&nbsp;', 'Warning');
+	$svNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unknown');
+	$svNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'c', '&nbsp;', 'Critical');
+	$svNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'r', '&nbsp;', 'Recovery');
+	if ($oreon->user->get_version() == 2)
+		$svNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'f', '&nbsp;', 'Flapping');
+	$svNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'n', '&nbsp;', 'None');
+	$form->addGroup($svNotifOpt, 'contact_svNotifOpts', $lang["cct_svNotifOpt"], '&nbsp;&nbsp;');
+    $form->addElement('select', 'timeperiod_tp_id2', $lang["cct_svNotifTp"], $notifTps);
+    $ams2 =& $form->addElement('advmultiselect', 'contact_svNotifCmds', $lang["cct_svNotifCmd"], $notifCmds, $attrsAdvSelect);
+	$ams2->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams2->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams2->setElementTemplate($template);
+	echo $ams2->getElementJs(false);
+
+	#
+	## Further informations
+	#
+	$form->addElement('header', 'furtherInfos', $lang['further_infos']);
+	$cctActivation[] = &HTML_QuickForm::createElement('radio', 'contact_activate', null, $lang["enable"], '1');
+	$cctActivation[] = &HTML_QuickForm::createElement('radio', 'contact_activate', null, $lang["disable"], '0');
+	$form->addGroup($cctActivation, 'contact_activate', $lang["status"], '&nbsp;');
+	$form->setDefaults(array('contact_activate' => '1'));
+	$form->addElement('textarea', 'contact_comment', $lang["cmt_comment"], $attrsTextarea);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+
+	$form->addElement('hidden', 'contact_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+
+	#
+	## Form Rules
+	#
+	function myReplace()	{
+		global $form;
+		$ret = $form->getSubmitValues();
+		return (str_replace(" ", "_", $ret["contact_name"]));
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('contact_name', 'myReplace');
+	$form->addRule('contact_name', $lang['ErrName'], 'required');
+	$form->addRule('contact_alias', $lang['ErrAlias'], 'required');
+	$form->addRule('contact_email', $lang['ErrEmail'], 'required');
+	$form->addRule('contact_hostNotifOpts', $lang['ErrOpt'], 'required');
+	$form->addRule('timeperiod_tp_id', $lang['ErrTp'], 'required');
+	$form->addRule('contact_hostNotifCmds', $lang['ErrCmd'], 'required');
+	$form->addRule('contact_svNotifOpts', $lang['ErrOpt'], 'required');
+	$form->addRule('timeperiod_tp_id2', $lang['ErrTp'], 'required');
+	$form->addRule('contact_svNotifCmds', $lang['ErrCmd'], 'required');
+	$form->addRule(array('contact_passwd', 'contact_passwd2'), $lang['ErrCctPasswd'], 'compare');
+	$form->registerRule('exist', 'callback', 'testContactExistence');
+	$form->addRule('contact_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->registerRule('existAlias', 'callback', 'testAliasExistence');
+	$form->addRule('contact_alias', $lang['ErrAlreadyExist'], 'existAlias');
+
+
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Just watch a contact information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&contact_id=".$contact_id."'"));
+	    $form->setDefaults($cct);
+		$form->freeze();
+	}
+	# Modify a contact information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($cct);
+	}
+	# Add a contact information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+
+	$valid = false;
+	if ($form->validate())	{
+		$cctObj =& $form->getElement('contact_id');
+		if ($form->getSubmitValue("submitA"))
+			$cctObj->setValue(insertContactInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateContactInDB($cctObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&contact_id=".$cctObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listContact.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		if (isset($ldap_auth['ldap_auth_enable']))
+			$tpl->assign('ldap', $ldap_auth['ldap_auth_enable'] );
+		$tpl->display("formContact.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/contact/listContact.ihtml b/www/include/configuration/configObject/contact/listContact.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..5f3e5067a580524468cad59d0cf0d13b19d1d1f7
--- /dev/null
+++ b/www/include/configuration/configObject/contact/listContact.ihtml
@@ -0,0 +1,42 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="2"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/contact/listContact.php b/www/include/configuration/configObject/contact/listContact.php
new file mode 100644
index 0000000000000000000000000000000000000000..47504c17c75b6be3a2348c21484eb749f8995598
--- /dev/null
+++ b/www/include/configuration/configObject/contact/listContact.php
@@ -0,0 +1,99 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM contact WHERE contact_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM contact");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Contact list
+	if ($search)
+		$rq = "SELECT contact_id, contact_name, contact_alias, contact_activate  FROM contact WHERE contact_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' ORDER BY contact_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT contact_id, contact_name, contact_alias, contact_activate FROM contact ORDER BY contact_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($contact); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$contact['contact_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&contact_id=".$contact['contact_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&contact_id=".$contact['contact_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&contact_id=".$contact['contact_id']."&o=d&select[".$contact['contact_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($contact["contact_activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&contact_id=".$contact['contact_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&contact_id=".$contact['contact_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$contact['contact_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$contact["contact_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&contact_id=".$contact['contact_id'],
+						"RowMenu_desc"=>$contact["contact_alias"],
+						"RowMenu_status"=>$contact["contact_activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listContact.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/contactgroup/DB-Func.php b/www/include/configuration/configObject/contactgroup/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..2698b15d75b6b3430f0650cc880a87c712586d43
--- /dev/null
+++ b/www/include/configuration/configObject/contactgroup/DB-Func.php
@@ -0,0 +1,147 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	function testContactGroupExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('cg_id');
+		$res =& $pearDB->query("SELECT cg_name, cg_id FROM contactgroup WHERE cg_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$cg =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $cg["cg_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $cg["cg_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+
+	function enableContactGroupInDB ($cg_id = null)	{
+		if (!$cg_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE contactgroup SET cg_activate = '1' WHERE cg_id = '".$cg_id."'");
+	}
+	
+	function disableContactGroupInDB ($cg_id = null)	{
+		if (!$cg_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE contactgroup SET cg_activate = '0' WHERE cg_id = '".$cg_id."'");
+	}
+	
+	function deleteContactGroupInDB ($contactGroups = array())	{
+		global $pearDB;
+		foreach($contactGroups as $key=>$value)
+			$pearDB->query("DELETE FROM contactgroup WHERE cg_id = '".$key."'");
+	}
+	
+	function multipleContactGroupInDB ($contactGroups = array(), $nbrDup = array())	{
+		foreach($contactGroups as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM contactgroup WHERE cg_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["cg_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "cg_name" ? ($cg_name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ", '".$value2."'" : $val .= "'".$value2."'";
+				}
+				if (testContactGroupExistence($cg_name))	{
+					$val ? $rq = "INSERT INTO contactgroup VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(cg_id) FROM contactgroup");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(cg_id)"]))	{
+						$res =& $pearDB->query("SELECT DISTINCT cgcr.contact_contact_id FROM contactgroup_contact_relation cgcr WHERE cgcr.contactgroup_cg_id = '".$key."'");
+						while($res->fetchInto($cct))
+							$pearDB->query("INSERT INTO contactgroup_contact_relation VALUES ('', '".$cct["contact_contact_id"]."', '".$maxId["MAX(cg_id)"]."')");
+					}
+				}
+			}
+		}
+	}	
+	
+	function insertContactGroupInDB ($ret = array())	{
+		$cg_id = insertContactGroup($ret);
+		updateContactGroupContacts($cg_id, $ret);
+		return $cg_id;
+	}
+	
+	function insertContactGroup($ret)	{
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO contactgroup ";
+		$rq .= "(cg_name, cg_alias, cg_comment, cg_activate) ";
+		$rq .= "VALUES ";
+		$rq .= "('".htmlentities($ret["cg_name"], ENT_QUOTES)."', '".htmlentities($ret["cg_alias"], ENT_QUOTES)."', '".htmlentities($ret["cg_comment"], ENT_QUOTES)."', '".$ret["cg_activate"]["cg_activate"]."')";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(cg_id) FROM contactgroup");
+		$cg_id = $res->fetchRow();
+		return ($cg_id["MAX(cg_id)"]);
+	}
+	
+	function updateContactGroupInDB ($cg_id = NULL)	{
+		if (!$cg_id) return;
+		updateContactGroup($cg_id);
+		updateContactGroupContacts($cg_id);
+	}
+	
+	function updateContactGroup($cg_id = null)	{
+		if (!$cg_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE contactgroup ";
+		$rq .= "SET cg_name = '".htmlentities($ret["cg_name"], ENT_QUOTES)."', " .
+				"cg_alias = '".htmlentities($ret["cg_alias"], ENT_QUOTES)."', " .
+				"cg_comment = '".htmlentities($ret["cg_comment"], ENT_QUOTES)."', " .
+				"cg_activate = '".$ret["cg_activate"]["cg_activate"]."' " .
+				"WHERE cg_id = '".$cg_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function updateContactGroupContacts($cg_id, $ret = array())	{
+		if (!$cg_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM contactgroup_contact_relation ";
+		$rq .= "WHERE contactgroup_cg_id = '".$cg_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["cg_contacts"]))
+			$ret = $ret["cg_contacts"];
+		else
+			$ret = $form->getSubmitValue("cg_contacts");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO contactgroup_contact_relation ";
+			$rq .= "(contact_contact_id, contactgroup_cg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$ret[$i]."', '".$cg_id."')";
+			$pearDB->query($rq);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/contactgroup/contactGroup.php b/www/include/configuration/configObject/contactgroup/contactGroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..6389241e2e09f94f557ed25ec9cb423102e97efc
--- /dev/null
+++ b/www/include/configuration/configObject/contactgroup/contactGroup.php
@@ -0,0 +1,49 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["cg_id"]) ? $cG = $_GET["cg_id"] : $cG = NULL;
+	isset($_POST["cg_id"]) ? $cP = $_POST["cg_id"] : $cP = NULL;
+	$cG ? $cg_id = $cG : $cg_id = $cP;
+	
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/contactgroup/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formContactGroup.php"); break; #Add a contactgroup
+		case "w" : require_once($path."formContactGroup.php"); break; #Watch a contactgroup
+		case "c" : require_once($path."formContactGroup.php"); break; #Modify a contactgroup
+		case "s" : enableContactGroupInDB($cg_id); require_once($path."listContactGroup.php"); break; #Activate a contactgroup
+		case "u" : disableContactGroupInDB($cg_id); require_once($path."listContactGroup.php"); break; #Desactivate a contactgroup
+		case "m" : multipleContactGroupInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listContactGroup.php"); break; #Duplicate n contact grou
+		case "d" : deleteContactGroupInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listContactGroup.php"); break; #Delete n contact group
+		default : require_once($path."listContactGroup.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/contactgroup/formContactGroup.ihtml b/www/include/configuration/configObject/contactgroup/formContactGroup.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..a683d4e05d13836720fbf3eb7efe7dcbe3d1fca6
--- /dev/null
+++ b/www/include/configuration/configObject/contactgroup/formContactGroup.ihtml
@@ -0,0 +1,31 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/users_family.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/clipboard.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.cg_name.label}</td><td class="FormRowValue">{$form.cg_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.cg_alias.label}</td><td class="FormRowValue">{$form.cg_alias.html}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/businessmen.gif'>&nbsp;&nbsp;{$form.header.notification}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.cg_contacts.label}</td><td class="FormRowValue"><p  class="oreonbutton">{$form.cg_contacts.html}</p></td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/cookies.gif'>&nbsp;&nbsp;{$form.header.furtherInfos}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.cg_activate.label}</td><td class="FormRowValue">{$form.cg_activate.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.cg_comment.label}</td><td class="FormRowValue">{$form.cg_comment.html}</td></tr>
+		
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
+
diff --git a/www/include/configuration/configObject/contactgroup/formContactGroup.php b/www/include/configuration/configObject/contactgroup/formContactGroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..12cefe7aea54edc88fd4d04982eb04c0cb8eeaac
--- /dev/null
+++ b/www/include/configuration/configObject/contactgroup/formContactGroup.php
@@ -0,0 +1,172 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Contact
+	#
+	$cg = array();
+	if (($o == "c" || $o == "w") && $cg_id)	{	
+		$res =& $pearDB->query("SELECT * FROM contactgroup WHERE cg_id = '".$cg_id."' LIMIT 1");
+		# Set base value
+		$cg = array_map("myDecode", $res->fetchRow());
+		# Set Contact Childs
+		$res =& $pearDB->query("SELECT DISTINCT contact_contact_id FROM contactgroup_contact_relation WHERE contactgroup_cg_id = '".$cg_id."'");
+		for($i = 0; $res->fetchInto($contacts); $i++)
+			$cg["cg_contacts"][$i] = $contacts["contact_contact_id"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Contacts comes from DB -> Store in $contacts Array
+	$contacts = array();
+	$res =& $pearDB->query("SELECT contact_id, contact_name FROM contact ORDER BY contact_name");
+	while($res->fetchInto($contact))
+		$contacts[$contact["contact_id"]] = $contact["contact_name"];
+	unset($contact);
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["cg_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["cg_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["cg_view"]);
+
+	#
+	## Contact basic information
+	#
+	$form->addElement('header', 'information', $lang['cg_infos']);
+	$form->addElement('text', 'cg_name', $lang["cg_name"], $attrsText);
+	$form->addElement('text', 'cg_alias', $lang["cg_alias"], $attrsText);
+	
+	##
+	## Contacts Selection
+	##
+	$form->addElement('header', 'notification', $lang['cg_notif']);
+	
+    $ams1 =& $form->addElement('advmultiselect', 'cg_contacts', $lang["cg_members"], $contacts, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+	
+	#
+	## Further informations
+	#
+	$form->addElement('header', 'furtherInfos', $lang['further_infos']);
+	$cgActivation[] = &HTML_QuickForm::createElement('radio', 'cg_activate', null, $lang["enable"], '1');
+	$cgActivation[] = &HTML_QuickForm::createElement('radio', 'cg_activate', null, $lang["disable"], '0');
+	$form->addGroup($cgActivation, 'cg_activate', $lang["status"], '&nbsp;');
+	$form->setDefaults(array('cg_activate' => '1'));
+	$form->addElement('textarea', 'cg_comment', $lang["comment"], $attrsTextarea);
+	
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');	
+	$form->setDefaults(array('action' => '1'));
+	
+	$form->addElement('hidden', 'cg_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	function myReplace()	{
+		global $form;
+		$ret = $form->getSubmitValues();
+		return (str_replace(" ", "_", $ret["cg_name"]));
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('cg_name', 'myReplace');
+	$form->addRule('cg_name', $lang['ErrName'], 'required');
+	$form->addRule('cg_alias', $lang['ErrAlias'], 'required');
+	$form->registerRule('exist', 'callback', 'testContactGroupExistence');
+	$form->addRule('cg_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	# Just watch a Contact Group information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&cg_id=".$cg_id."'"));
+	    $form->setDefaults($cg);
+		$form->freeze();
+	}
+	# Modify a Contact Group information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($cg);
+	}
+	# Add a Contact Group information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	
+	$valid = false;
+	if ($form->validate())	{
+		$cgObj =& $form->getElement('cg_id');
+		if ($form->getSubmitValue("submitA"))
+			$cgObj->setValue(insertContactGroupInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateContactGroupInDB($cgObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&cg_id=".$cgObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listContactGroup.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("formContactGroup.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/contactgroup/listContactGroup.ihtml b/www/include/configuration/configObject/contactgroup/listContactGroup.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..a81be8964acb9d06dd58437df5f0f6be7e93a34d
--- /dev/null
+++ b/www/include/configuration/configObject/contactgroup/listContactGroup.ihtml
@@ -0,0 +1,42 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight" align="right">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">				
+			</td>
+			<td class="ListColFooterCenter" colspan="2"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+	{php}
+	   include('./include/common/pagination.php');
+	{/php}
+	{$form.hidden}
+</form>
diff --git a/www/include/configuration/configObject/contactgroup/listContactGroup.php b/www/include/configuration/configObject/contactgroup/listContactGroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..3a2dd4595be72f801cdb181eb8a8e4c0267a3ace
--- /dev/null
+++ b/www/include/configuration/configObject/contactgroup/listContactGroup.php
@@ -0,0 +1,97 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM contactgroup WHERE cg_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM contactgroup");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Contactgroup list
+	if ($search)
+		$rq = "SELECT cg_id, cg_name, cg_alias, cg_activate  FROM contactgroup WHERE cg_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' ORDER BY cg_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT cg_id, cg_name, cg_alias, cg_activate FROM contactgroup ORDER BY cg_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($cg); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$cg['cg_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&cg_id=".$cg['cg_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&cg_id=".$cg['cg_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&cg_id=".$cg['cg_id']."&o=d&select[".$cg['cg_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($cg["cg_activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&cg_id=".$cg['cg_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&cg_id=".$cg['cg_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$cg['cg_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$cg["cg_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&contact_id=".$cg['cg_id'],
+						"RowMenu_desc"=>$cg["cg_alias"],
+						"RowMenu_status"=>$cg["cg_activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listContactGroup.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/escalation/DB-Func.php b/www/include/configuration/configObject/escalation/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..532fb1b5619bb55f713d71895e5ffce6e523af41
--- /dev/null
+++ b/www/include/configuration/configObject/escalation/DB-Func.php
@@ -0,0 +1,254 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	function testExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('esc_id');
+		$res =& $pearDB->query("SELECT esc_name, esc_id FROM escalation WHERE esc_name = '".$name."'");
+		$esc =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $esc["esc_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $esc["esc_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+		
+	function deleteEscalationInDB ($escalations = array())	{
+		global $pearDB;
+		foreach($escalations as $key=>$value)
+			$pearDB->query("DELETE FROM escalation WHERE esc_id = '".$key."'");
+	}
+	
+	function multipleEscalationInDB ($escalations = array(), $nbrDup = array())	{
+		foreach($escalations as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM escalation WHERE esc_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["esc_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "esc_name" ? ($esc_name = $value2 = $value2." ".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testExistence($esc_name))	{
+					$val ? $rq = "INSERT INTO escalation VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(esc_id) FROM escalation");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(esc_id)"]))	{
+						$res =& $pearDB->query("SELECT DISTINCT contactgroup_cg_id FROM escalation_contactgroup_relation WHERE escalation_esc_id = '".$key."'");
+						while($res->fetchInto($cg))
+							$pearDB->query("INSERT INTO escalation_contactgroup_relation VALUES ('', '".$maxId["MAX(esc_id)"]."', '".$cg["contactgroup_cg_id"]."')");
+						$res =& $pearDB->query("SELECT DISTINCT host_host_id FROM escalation_host_relation WHERE escalation_esc_id = '".$key."'");
+						while($res->fetchInto($host))
+							$pearDB->query("INSERT INTO escalation_host_relation VALUES ('', '".$maxId["MAX(esc_id)"]."', '".$host["host_host_id"]."')");
+						$res =& $pearDB->query("SELECT DISTINCT hostgroup_hg_id FROM escalation_hostgroup_relation WHERE escalation_esc_id = '".$key."'");
+						while($res->fetchInto($hg))
+							$pearDB->query("INSERT INTO escalation_hostgroup_relation VALUES ('', '".$maxId["MAX(esc_id)"]."', '".$hg["hostgroup_hg_id"]."')");
+						$res =& $pearDB->query("SELECT DISTINCT service_service_id FROM escalation_service_relation WHERE escalation_esc_id = '".$key."'");
+						while($res->fetchInto($sv))
+							$pearDB->query("INSERT INTO escalation_service_relation VALUES ('', '".$maxId["MAX(esc_id)"]."', '".$sv["service_service_id"]."')");
+						$res =& $pearDB->query("SELECT DISTINCT meta_service_meta_id FROM escalation_meta_service_relation WHERE escalation_esc_id = '".$key."'");
+						while($res->fetchInto($sv))
+							$pearDB->query("INSERT INTO escalation_meta_service_relation VALUES ('', '".$maxId["MAX(esc_id)"]."', '".$sv["meta_service_meta_id"]."')");
+					}
+				}
+			}
+		}
+	}
+	
+	function updateEscalationInDB ($esc_id = NULL)	{
+		if (!$esc_id) exit();
+		updateEscalation($esc_id);
+		updateEscalationContactGroups($esc_id);
+		updateEscalationHosts($esc_id);
+		updateEscalationHostGroups($esc_id);
+		updateEscalationServices($esc_id);
+		updateEscalationMetaServices($esc_id);
+	}	
+	
+	function insertEscalationInDB ()	{
+		$esc_id = insertEscalation();
+		updateEscalationContactGroups($esc_id);
+		updateEscalationHosts($esc_id);
+		updateEscalationHostGroups($esc_id);
+		updateEscalationServices($esc_id);
+		updateEscalationMetaServices($esc_id);
+		return ($esc_id);
+	}
+	
+	function insertEscalation()	{
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO escalation ";
+		$rq .= "(esc_name, first_notification, last_notification, notification_interval, escalation_period, escalation_options1, escalation_options2, esc_comment) ";
+		$rq .= "VALUES (";
+		isset($ret["esc_name"]) && $ret["esc_name"] != NULL ? $rq .= "'".htmlentities($ret["esc_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["first_notification"]) && $ret["first_notification"] != NULL ? $rq .= "'".htmlentities($ret["first_notification"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["last_notification"]) && $ret["last_notification"] != NULL ? $rq .= "'".htmlentities($ret["last_notification"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["notification_interval"]) && $ret["notification_interval"] != NULL ? $rq .= "'".htmlentities($ret["notification_interval"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["escalation_period"]) && $ret["escalation_period"] != NULL ? $rq .= "'".htmlentities($ret["escalation_period"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["escalation_options1"]) && $ret["escalation_options1"] != NULL ? $rq .= "'".implode(",", array_keys($ret["escalation_options1"]))."', " : $rq .= "NULL, ";
+		isset($ret["escalation_options2"]) && $ret["escalation_options2"] != NULL ? $rq .= "'".implode(",", array_keys($ret["escalation_options2"]))."', " : $rq .= "NULL, ";
+		isset($ret["esc_comment"]) && $ret["esc_comment"] != NULL ? $rq .= "'".htmlentities($ret["esc_comment"], ENT_QUOTES)."' " : $rq .= "NULL ";
+		$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(esc_id) FROM escalation");
+		$esc_id = $res->fetchRow();
+		return ($esc_id["MAX(esc_id)"]);
+	}
+	
+	function updateEscalation($esc_id = null)	{
+		if (!$esc_id) exit();
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE escalation SET ";
+		$rq .= "esc_name = ";
+		isset($ret["esc_name"]) && $ret["esc_name"] != NULL ? $rq .= "'".htmlentities($ret["esc_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "first_notification = ";
+		isset($ret["first_notification"]) && $ret["first_notification"] != NULL ? $rq .= "'".htmlentities($ret["first_notification"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "last_notification = ";
+		isset($ret["last_notification"]) && $ret["last_notification"] != NULL ? $rq .= "'".htmlentities($ret["last_notification"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "notification_interval = ";
+		isset($ret["notification_interval"]) && $ret["notification_interval"] != NULL ? $rq .= "'".htmlentities($ret["notification_interval"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "escalation_period = ";
+		isset($ret["escalation_period"]) && $ret["escalation_period"] != NULL ? $rq .= "'".htmlentities($ret["escalation_period"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "escalation_options1 = ";
+		isset($ret["escalation_options1"]) && $ret["escalation_options1"] != NULL ? $rq .= "'".implode(",", array_keys($ret["escalation_options1"]))."', " : $rq .= "NULL, ";
+		$rq .= "escalation_options2 = ";
+		isset($ret["escalation_options2"]) && $ret["escalation_options2"] != NULL ? $rq .= "'".implode(",", array_keys($ret["escalation_options2"]))."', " : $rq .= "NULL, ";
+		$rq .= "esc_comment = ";
+		isset($ret["esc_comment"]) && $ret["esc_comment"] != NULL ? $rq .= "'".htmlentities($ret["esc_comment"], ENT_QUOTES)."' " : $rq .= "NULL ";
+		$rq .= "WHERE esc_id = '".$esc_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function updateEscalationContactGroups($esc_id = null)	{
+		if (!$esc_id) exit();
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM escalation_contactgroup_relation ";
+		$rq .= "WHERE escalation_esc_id = '".$esc_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("esc_cgs");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO escalation_contactgroup_relation ";
+			$rq .= "(escalation_esc_id, contactgroup_cg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$esc_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateEscalationHosts($esc_id = null)	{
+		if (!$esc_id) exit();
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM escalation_host_relation ";
+		$rq .= "WHERE escalation_esc_id = '".$esc_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("esc_hosts");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO escalation_host_relation ";
+			$rq .= "(escalation_esc_id, host_host_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$esc_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateEscalationHostGroups($esc_id = null)	{
+		if (!$esc_id) exit();
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM escalation_hostgroup_relation ";
+		$rq .= "WHERE escalation_esc_id = '".$esc_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("esc_hgs");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO escalation_hostgroup_relation ";
+			$rq .= "(escalation_esc_id, hostgroup_hg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$esc_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateEscalationServices($esc_id = null)	{
+		if (!$esc_id) exit();
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM escalation_service_relation ";
+		$rq .= "WHERE escalation_esc_id = '".$esc_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("esc_hServices");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO escalation_service_relation ";
+			$rq .= "(escalation_esc_id, service_service_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$esc_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+		$ret = array();
+		$ret = $form->getSubmitValue("esc_hgServices");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO escalation_service_relation ";
+			$rq .= "(escalation_esc_id, service_service_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$esc_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateEscalationMetaServices($esc_id = null)	{
+		if (!$esc_id) exit();
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM escalation_meta_service_relation ";
+		$rq .= "WHERE escalation_esc_id = '".$esc_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("esc_metas");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO escalation_meta_service_relation ";
+			$rq .= "(escalation_esc_id, meta_service_meta_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$esc_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/escalation/escalation.php b/www/include/configuration/configObject/escalation/escalation.php
new file mode 100644
index 0000000000000000000000000000000000000000..78bb9198283b2440fab78eebd9b823a1a7b27c58
--- /dev/null
+++ b/www/include/configuration/configObject/escalation/escalation.php
@@ -0,0 +1,47 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["esc_id"]) ? $cG = $_GET["esc_id"] : $cG = NULL;
+	isset($_POST["esc_id"]) ? $cP = $_POST["esc_id"] : $cP = NULL;
+	$cG ? $esc_id = $cG : $esc_id = $cP;
+	
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/escalation/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formEscalation.php"); break; #Add a Escalation
+		case "w" : require_once($path."formEscalation.php"); break; #Watch a Escalation
+		case "c" : require_once($path."formEscalation.php"); break; #Modify a Escalation
+		case "m" : multipleEscalationInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listEscalation.php"); break; #Duplicate n Escalations
+		case "d" : deleteEscalationInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listEscalation.php"); break; #Delete n Escalation
+		default : require_once($path."listEscalation.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/escalation/formEscalation.ihtml b/www/include/configuration/configObject/escalation/formEscalation.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..16b466a838970a09ee302475ca256b3983d5668e
--- /dev/null
+++ b/www/include/configuration/configObject/escalation/formEscalation.ihtml
@@ -0,0 +1,81 @@
+<script type="text/javascript" src="include/configuration/changetab.js"></script>
+{$form.javascript}
+<form {$form.attributes}>
+<div>
+<ul id="mainnav">
+	<li class="a" id='c1'><a href="#"  onclick="javascript:montre('1');">{$sort1}</a></li>
+	<li class="b" id='c2'><a href="#" onclick="javascript:montre('2');">{$sort2}</a></li>
+	<li class="b" id='c3'><a href="#" onclick="javascript:montre('3');">{$sort3}</a></li>
+	<li class="b" id='c4'><a href="#" onclick="javascript:montre('4');">{$sort4}</a></li>
+	<li class="b" id='c5'><a href="#" onclick="javascript:montre('5');">{$sort5}</a></li>
+</ul>
+</div>
+<div id="validFormTop">
+{if $o == "a" || $o == "c"}
+	<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+{else if $o == "w"}
+	<p class="oreonbutton">{$form.change.html}</p>
+{/if}
+</div>
+<div id='tab1' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/bookmark.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/house.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.esc_name.label}</td><td class="FormRowValue">{$form.esc_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.first_notification.label}</td><td class="FormRowValue">{$form.first_notification.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.last_notification.label}</td><td class="FormRowValue">{$form.last_notification.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.notification_interval.label}</td><td class="FormRowValue">{$form.notification_interval.html}{$time_unit}</td></tr>
+		{if $nagios == 2}
+		<tr class="list_one"><td class="FormRowField">{$form.escalation_period.label}</td><td class="FormRowValue">{$form.escalation_period.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.escalation_options1.label}</td><td class="FormRowValue">{$form.escalation_options1.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.escalation_options2.label}</td><td class="FormRowValue">{$form.escalation_options2.html}</td></tr>
+		{/if}
+		<tr class="list_one"><td class="FormRowField">{$form.esc_cgs.label}</td><td class="FormRowValue">{$form.esc_cgs.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.esc_comment.label}</td><td class="FormRowValue">{$form.esc_comment.html}</td></tr>
+	</table>
+</div>
+<div id='tab2' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/bookmarks.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/server_network.gif'>&nbsp;&nbsp;{$form.header.hosts}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.esc_hosts.label}</td><td class="FormRowValue">{$form.esc_hosts.html}</td></tr>
+	</table>
+</div>
+<div id='tab3' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/bookmarks.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/element_new_after.gif'>&nbsp;&nbsp;{$form.header.services}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.esc_hServices.label}</td><td class="FormRowValue">{$form.esc_hServices.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.esc_hgServices.label}</td><td class="FormRowValue">{$form.esc_hgServices.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField" colspan="2">{$legend1}</td></tr>
+	</table>
+</div>
+<div id='tab4' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/bookmarks.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/clients.gif'>&nbsp;&nbsp;{$form.header.hgs}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.esc_hgs.label}</td><td class="FormRowValue">{$form.esc_hgs.html}</td></tr>
+	</table>
+</div>
+<div id='tab5' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/bookmarks.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/clients.gif'>&nbsp;&nbsp;{$form.header.metas}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.esc_metas.label}</td><td class="FormRowValue">{$form.esc_metas.html}</td></tr>
+	</table>
+</div>
+<div id="validForm">
+{if $o == "a" || $o == "c"}
+	<p>{$form.action.html}</p>
+	<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+{else if $o == "w"}
+	<p class="oreonbutton">{$form.change.html}</p>
+{/if}
+</div>
+{$form.hidden}
+</form>
+
diff --git a/www/include/configuration/configObject/escalation/formEscalation.php b/www/include/configuration/configObject/escalation/formEscalation.php
new file mode 100644
index 0000000000000000000000000000000000000000..0cdab8f8742c957006e665fc45caeee7c2bd1995
--- /dev/null
+++ b/www/include/configuration/configObject/escalation/formEscalation.php
@@ -0,0 +1,315 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Escalation
+	#
+	$esc = array();
+	if (($o == "c" || $o == "w") && $esc_id)	{	
+		$res =& $pearDB->query("SELECT * FROM escalation WHERE esc_id = '".$esc_id."' LIMIT 1");
+		# Set base value
+		$esc = array_map("myDecode", $res->fetchRow());
+		# Set Host Options
+		$esc["escalation_options1"] =& explode(',', $esc["escalation_options1"]);
+		foreach ($esc["escalation_options1"] as $key => $value)
+			$esc["escalation_options1"][trim($value)] = 1;
+		# Set Service Options
+		$esc["escalation_options2"] =& explode(',', $esc["escalation_options2"]);
+		foreach ($esc["escalation_options2"] as $key => $value)
+			$esc["escalation_options2"][trim($value)] = 1;
+		# Set Host Groups relations
+		$res =& $pearDB->query("SELECT DISTINCT hostgroup_hg_id FROM escalation_hostgroup_relation WHERE escalation_esc_id = '".$esc_id."'");
+		for($i = 0; $res->fetchInto($hg); $i++)
+			$esc["esc_hgs"][$i] = $hg["hostgroup_hg_id"];
+		$res->free();
+		# Set Host relations
+		$res =& $pearDB->query("SELECT DISTINCT host_host_id FROM escalation_host_relation WHERE escalation_esc_id = '".$esc_id."'");
+		for($i = 0; $res->fetchInto($host); $i++)
+			$esc["esc_hosts"][$i] = $host["host_host_id"];
+		$res->free();
+		# Set Meta Service
+		$res =& $pearDB->query("SELECT DISTINCT emsr.meta_service_meta_id FROM escalation_meta_service_relation emsr WHERE emsr.escalation_esc_id = '".$esc_id."'");
+		for($i = 0; $res->fetchInto($metas); $i++)
+			$esc["esc_metas"][$i] = $metas["meta_service_meta_id"];
+		$res->free();
+		# Set Host Service
+		$res =& $pearDB->query("SELECT DISTINCT esr.service_service_id FROM escalation_service_relation esr, host_service_relation hsr WHERE esr.escalation_esc_id = '".$esc_id."' AND hsr.service_service_id = esr.service_service_id AND hsr.host_host_id IS NOT NULL GROUP BY service_service_id");
+		for($i = 0; $res->fetchInto($services); $i++)
+			$esc["esc_hServices"][$i] = $services["service_service_id"];
+		$res->free();
+		# Set HostGroup Service
+		$res =& $pearDB->query("SELECT DISTINCT esr.service_service_id FROM escalation_service_relation esr, host_service_relation hsr WHERE esr.escalation_esc_id = '".$esc_id."' AND hsr.service_service_id = esr.service_service_id AND hsr.hostgroup_hg_id IS NOT NULL GROUP BY service_service_id");
+		for($i = 0; $res->fetchInto($services); $i++)
+			$esc["esc_hgServices"][$i] = $services["service_service_id"];
+		$res->free();
+		# Set Contact Groups relations
+		$res =& $pearDB->query("SELECT DISTINCT contactgroup_cg_id FROM escalation_contactgroup_relation WHERE escalation_esc_id = '".$esc_id."'");
+		for($i = 0; $res->fetchInto($cg); $i++)
+			$esc["esc_cgs"][$i] = $cg["contactgroup_cg_id"];
+		$res->free();		
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Host Groups comes from DB -> Store in $hgs Array
+	$hgs = array();
+	$res =& $pearDB->query("SELECT hg_id, hg_name FROM hostgroup WHERE hg_id IN (".$oreon->user->lcaHGStr.") ORDER BY hg_name");
+	while($res->fetchInto($hg))
+		$hgs[$hg["hg_id"]] = $hg["hg_name"];
+	$res->free();
+	#
+	# Host comes from DB -> Store in $hosts Array
+	$hosts = array();
+	$res =& $pearDB->query("SELECT host_id, host_name FROM host WHERE host_register = '1' AND host_id IN (".$oreon->user->lcaHStr.") ORDER BY host_name");
+	while($res->fetchInto($host))
+		$hosts[$host["host_id"]] = $host["host_name"];
+	$res->free();
+	#
+	# Services comes from DB -> Store in $hServices Array and $hgServices
+	$hServices = array();
+	$hgServices = array();
+	$initName = NULL;
+	$res =& $pearDB->query("SELECT DISTINCT h.host_name, sv.service_description, sv.service_template_model_stm_id, sv.service_id FROM host_service_relation hsr, service sv, host h WHERE sv.service_register = '1' AND hsr.service_service_id = sv.service_id AND h.host_id = hsr.host_host_id AND h.host_id IN (".$oreon->user->lcaHStr.") ORDER BY h.host_name, sv.service_description");
+	while($res->fetchInto($elem))	{
+		# If the description of our Service is in the Template definition, we have to catch it, whatever the level of it :-)
+		if (!$elem["service_description"])
+			$elem["service_description"] = getMyServiceName($elem['service_template_model_stm_id']);
+		if (isset($hServices[$elem["service_id"]]))
+			$hServices[$elem["service_id"]] = $elem["host_name"]."&nbsp;&nbsp;&nbsp;&nbsp;(*)".$elem["service_description"];
+		else
+			$hServices[$elem["service_id"]] = $elem["host_name"]."&nbsp;&nbsp;&nbsp;&nbsp;".$elem["service_description"];
+	}
+	$res->free();
+	$res =& $pearDB->query("SELECT DISTINCT hg.hg_name, sv.service_description, sv.service_template_model_stm_id, sv.service_id FROM host_service_relation hsr, service sv, hostgroup hg WHERE sv.service_register = '1' AND hsr.service_service_id = sv.service_id AND hg.hg_id = hsr.hostgroup_hg_id AND hg.hg_id IN (".$oreon->user->lcaHGStr.") ORDER BY hg.hg_name, sv.service_description");
+	while($res->fetchInto($elem))	{
+		# If the description of our Service is in the Template definition, we have to catch it, whatever the level of it :-)
+		if (!$elem["service_description"])
+			$elem["service_description"] = getMyServiceName($elem['service_template_model_stm_id']);
+		$hgServices[$elem["service_id"]] = $elem["hg_name"]."&nbsp;&nbsp;&nbsp;&nbsp;".$elem["service_description"];
+	}
+	$res->free();
+	# Meta Services comes from DB -> Store in $metas Array
+	$metas = array();
+	$res =& $pearDB->query("SELECT meta_id, meta_name FROM meta_service ORDER BY meta_name");
+	while($res->fetchInto($meta))
+		$metas[$meta["meta_id"]] = $meta["meta_name"];
+	$res->free();
+	# Contact Groups comes from DB -> Store in $cgs Array
+	$cgs = array();
+	$res =& $pearDB->query("SELECT cg_id, cg_name FROM contactgroup ORDER BY cg_name");
+	while($res->fetchInto($cg))
+		$cgs[$cg["cg_id"]] = $cg["cg_name"];
+	$res->free();
+	#
+	# TimePeriods comes from DB -> Store in $tps Array
+	$tps = array();
+	$res =& $pearDB->query("SELECT tp_id, tp_name FROM timeperiod ORDER BY tp_name");
+	while($res->fetchInto($tp))
+		$tps[$tp["tp_id"]] = $tp["tp_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsText2 	= array("size"=>"10");
+	$attrsAdvSelect = array("style" => "width: 250px; height: 150px;");
+	$attrsTextarea 	= array("rows"=>"3", "cols"=>"30");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["esc_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["esc_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["esc_view"]);
+
+	#
+	## Escalation basic information
+	#
+	$form->addElement('header', 'information', $lang['esc_infos']);
+	$form->addElement('text', 'esc_name', $lang["esc_name"], $attrsText);
+	$form->addElement('text', 'first_notification', $lang["esc_firstNotif"], $attrsText2);
+	$form->addElement('text', 'last_notification', $lang["esc_lastNotif"], $attrsText2);
+	$form->addElement('text', 'notification_interval', $lang["esc_notifInt"], $attrsText2);
+	if ($oreon->user->get_version() == 2)	{
+		$form->addElement('select', 'escalation_period', $lang["esc_escPeriod"], $tps);
+		$tab = array();
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'd', '&nbsp;', 'd');
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'u');
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'r', '&nbsp;', 'r');
+		$form->addGroup($tab, 'escalation_options1', $lang['esc_hOpt'], '&nbsp;&nbsp;');
+		$tab = array();
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'w', '&nbsp;', 'w');
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'u');
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'c', '&nbsp;', 'c');
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'r', '&nbsp;', 'r');
+		$form->addGroup($tab, 'escalation_options2', $lang['esc_sOpt'], '&nbsp;&nbsp;');
+	}
+	$form->addElement('textarea', 'esc_comment', $lang["esc_comment"], $attrsTextarea);
+	
+    $ams1 =& $form->addElement('advmultiselect', 'esc_cgs', $lang['esc_appCG'], $cgs, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+	
+	#
+	## Sort 2
+	#
+	$form->addElement('header', 'hosts', $lang['esc_sortHosts']);
+	
+    $ams1 =& $form->addElement('advmultiselect', 'esc_hosts', $lang['h'], $hosts, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+	
+	#
+	## Sort 3
+	#
+	$form->addElement('header', 'services', $lang['esc_sortSv']);
+	
+    $ams1 =& $form->addElement('advmultiselect', 'esc_hServices', $lang['esc_hostServiceMembers'], $hServices, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+	
+    $ams1 =& $form->addElement('advmultiselect', 'esc_hgServices', $lang['esc_hostGroupServiceMembers'], $hgServices, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+	
+	#
+	## Sort 4
+	#
+	$form->addElement('header', 'hgs', $lang['esc_sortHg']);
+	
+    $ams1 =& $form->addElement('advmultiselect', 'esc_hgs', $lang['hg'], $hgs, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+	
+	#
+	## Sort 5
+	#
+	$form->addElement('header', 'metas', $lang['esc_sortMs']);
+	
+    $ams1 =& $form->addElement('advmultiselect', 'esc_metas', $lang['ms'], $metas, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+	
+	$form->addElement('hidden', 'esc_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('esc_name', $lang['ErrName'], 'required');
+	$form->addRule('first_notification', $lang['ErrRequired'], 'required');
+	$form->addRule('last_notification', $lang['ErrRequired'], 'required');
+	$form->addRule('notification_interval', $lang['ErrRequired'], 'required');
+	$form->addRule('esc_cgs', $lang['ErrRequired'], 'required');
+	$form->addRule('dep_hostChilds', $lang['ErrRequired'], 'required');
+	$form->registerRule('exist', 'callback', 'testExistence');
+	$form->addRule('esc_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+	
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+		
+	# Just watch a Escalation information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&esc_id=".$esc_id."'"));
+	    $form->setDefaults($esc);
+		$form->freeze();
+	}
+	# Modify a Escalation information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($esc);
+	}
+	# Add a Escalation information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	$tpl->assign("nagios", $oreon->user->get_version());
+	
+	$tpl->assign("sort1", $lang['esc_infos']);
+	$tpl->assign("sort2", $lang['esc_sort2']);
+	$tpl->assign("sort3", $lang['esc_sort3']);
+	$tpl->assign("sort4", $lang['esc_sort4']);
+	$tpl->assign("sort5", $lang['esc_sort5']);
+	
+	$tpl->assign("legend1", $lang['legend1']);
+	$tpl->assign('time_unit', " * ".$oreon->Nagioscfg["interval_length"]." ".$lang["time_sec"]);
+	
+	$valid = false;
+	if ($form->validate())	{
+		$escObj =& $form->getElement('esc_id');
+		if ($form->getSubmitValue("submitA"))
+			$escObj->setValue(insertEscalationInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateEscalationInDB($escObj->getValue("esc_id"));
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&esc_id=".$escObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once("listEscalation.php");
+	else	{
+		#Apply a template definition	
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("formEscalation.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/escalation/listEscalation.ihtml b/www/include/configuration/configObject/escalation/listEscalation.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..3d8691a2e115287c100a2834ac9d88310c35c7df
--- /dev/null
+++ b/www/include/configuration/configObject/escalation/listEscalation.ihtml
@@ -0,0 +1,39 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter"></td>
+			<td class="ListColFooterRight" align="right" colpan="2"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
\ No newline at end of file
diff --git a/www/include/configuration/configObject/escalation/listEscalation.php b/www/include/configuration/configObject/escalation/listEscalation.php
new file mode 100644
index 0000000000000000000000000000000000000000..68f6b6c855114ee743aeb1c6031402dd5b7d9d19
--- /dev/null
+++ b/www/include/configuration/configObject/escalation/listEscalation.php
@@ -0,0 +1,114 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	isset($_GET["list"]) ? $list = $_GET["list"] : $list = NULL;
+	$rq = "SELECT COUNT(*) FROM escalation esc";
+	if ($list && $list == "h")
+		$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM escalation_host_relation ehr WHERE ehr.escalation_esc_id = esc.esc_id AND ehr.host_host_id IN (".$oreon->user->lcaHStr.")) > 0";
+	else if ($list && $list == "sv")
+		$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM escalation_service_relation esr WHERE esr.escalation_esc_id = esc.esc_id) > 0";
+	else if ($list && $list == "hg")
+		$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM escalation_hostgroup_relation ehgr WHERE ehgr.escalation_esc_id = esc.esc_id AND ehgr.hostgroup_hg_id IN (".$oreon->user->lcaHGStr.")) > 0";
+	else if ($list && $list == "ms")
+		$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM escalation_meta_service_relation emsr WHERE emsr.escalation_esc_id = esc.esc_id) > 0";
+	if ($search && $list)
+		$rq .= " AND esc.esc_name LIKE '%".$search."%'";
+	else if ($search)
+		$rq .= " WHERE esc.esc_name LIKE '%".$search."%'";
+	$res = & $pearDB->query($rq);
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Escalation list
+	$rq = "SELECT esc_id, esc_name, esc_comment FROM escalation esc";
+	if ($list && $list == "h")
+		$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM escalation_host_relation ehr WHERE ehr.escalation_esc_id = esc.esc_id AND ehr.host_host_id IN (".$oreon->user->lcaHStr.")) > 0";
+	else if ($list && $list == "sv")
+		$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM escalation_service_relation esr WHERE esr.escalation_esc_id = esc.esc_id) > 0";
+	else if ($list && $list == "hg")
+		$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM escalation_hostgroup_relation ehgr WHERE ehgr.escalation_esc_id = esc.esc_id AND ehgr.hostgroup_hg_id IN (".$oreon->user->lcaHGStr.")) > 0";
+	else if ($list && $list == "ms")
+		$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM escalation_meta_service_relation emsr WHERE emsr.escalation_esc_id = esc.esc_id) > 0";
+	if ($search && $list)
+		$rq .= " AND esc.esc_name LIKE '%".$search."%'";
+	else if ($search)
+		$rq .= " WHERE esc.esc_name LIKE '%".$search."%'";
+	$rq .= " ORDER BY esc_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($esc); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$esc['esc_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&esc_id=".$esc['esc_id']."&o=w&search=".$search."&list=".$list."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&esc_id=".$esc['esc_id']."&o=c&search=".$search."&list=".$list."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&esc_id=".$esc['esc_id']."&o=d&select[".$esc['esc_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."&list=".$list."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$esc['esc_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$esc["esc_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&esc_id=".$esc['esc_id'],
+						"RowMenu_desc"=>substr($esc["esc_comment"], 0, 40),
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listEscalation.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/host/DB-Func.php b/www/include/configuration/configObject/host/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..dd87027652377f067bce7fb60cffec8402015043
--- /dev/null
+++ b/www/include/configuration/configObject/host/DB-Func.php
@@ -0,0 +1,536 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();	
+		
+	function testHostExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('host_id');
+		$res =& $pearDB->query("SELECT host_name, host_id FROM host WHERE host_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$host =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $host["host_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $host["host_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function enableHostInDB ($host_id = null)	{
+		if (!$host_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE host SET host_activate = '1' WHERE host_id = '".$host_id."'");
+	}
+	
+	function disableHostInDB ($host_id = null)	{
+		if (!$host_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE host SET host_activate = '0' WHERE host_id = '".$host_id."'");
+	}
+	
+	function deleteHostInDB ($hosts = array())	{
+		global $pearDB;
+		foreach($hosts as $key=>$value)	{
+			$rq = "SELECT @nbr := (SELECT COUNT( * ) FROM host_service_relation WHERE service_service_id = hsr.service_service_id GROUP BY service_service_id ) AS nbr, hsr.service_service_id FROM host_service_relation hsr WHERE hsr.host_host_id = '".$key."'";
+			$res = & $pearDB->query($rq);
+			while ($res->fetchInto($row))
+				if ($row["nbr"] == 1)
+					$pearDB->query("DELETE FROM service WHERE service_id = '".$row["service_service_id"]."'");
+			$pearDB->query("DELETE FROM host WHERE host_id = '".$key."'");
+		}
+	}
+	
+	function multipleHostInDB ($hosts = array(), $nbrDup = array())	{
+		foreach($hosts as $key=>$value)	{
+			global $pearDB;
+			global $path;
+			global $oreon;
+			$res =& $pearDB->query("SELECT * FROM host WHERE host_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["host_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "host_name" ? ($host_name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testHostExistence($host_name))	{
+					$val ? $rq = "INSERT INTO host VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(host_id) FROM host");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(host_id)"]))	{
+						# Update LCA
+						$oreon->user->lcaHost[$maxId["MAX(host_id)"]] = $host_name;
+						$oreon->user->lcaHStr != '\'\''? $oreon->user->lcaHStr .= ",".$maxId["MAX(host_id)"] : $oreon->user->lcaHStr = $maxId["MAX(host_id)"];
+						$oreon->user->lcaHStrName != '\'\''? $oreon->user->lcaHStrName .= ",".$host_name : $oreon->user->lcaHStrName = $host_name;
+						$res1 =& $pearDB->query("SELECT contactgroup_cg_id FROM contactgroup_contact_relation WHERE contact_contact_id = '".$oreon->user->get_id()."'");
+						while($res1->fetchInto($contactGroup))	{
+						 	$res2 =& $pearDB->query("SELECT lca_define_lca_id FROM lca_define_contactgroup_relation ldcgr WHERE ldcgr.contactgroup_cg_id = '".$contactGroup["contactgroup_cg_id"]."'");	
+							while ($res2->fetchInto($lca))	{
+								$rq = "INSERT INTO lca_define_host_relation ";
+								$rq .= "(lca_define_lca_id, host_host_id) ";
+								$rq .= "VALUES ";
+								$rq .= "('".$lca["lca_define_lca_id"]."', '".$maxId["MAX(host_id)"]."')";
+								$pearDB->query($rq);
+							}
+						}
+						#
+						$res =& $pearDB->query("SELECT DISTINCT host_parent_hp_id FROM host_hostparent_relation WHERE host_host_id = '".$key."'");
+						while($res->fetchInto($host))
+							$pearDB->query("INSERT INTO host_hostparent_relation VALUES ('', '".$host["host_parent_hp_id"]."', '".$maxId["MAX(host_id)"]."')");	
+						# We need to duplicate the entire Service and not only create a new relation for it in the DB / Need Service functions
+						require_once($path."../service/DB-Func.php");
+						$hostInf = $maxId["MAX(host_id)"];
+						$serviceArr = array();
+						$serviceNbr = array();
+						# Get all Services link to the Host
+						$res =& $pearDB->query("SELECT DISTINCT service_service_id FROM host_service_relation WHERE host_host_id = '".$key."'");
+						while($res->fetchInto($service))	{
+							# If the Service is link with several Host, we keep this property and don't duplicate it, just create a new relation with the new Host
+							$res2 =& $pearDB->query("SELECT COUNT(*) FROM host_service_relation WHERE service_service_id = '".$service["service_service_id"]."'");
+							$mulHostSv = $res2->fetchrow();
+							if ($mulHostSv["COUNT(*)"] > 1)
+								$pearDB->query("INSERT INTO host_service_relation VALUES ('', NULL, '".$maxId["MAX(host_id)"]."', NULL, '".$service["service_service_id"]."')");
+							else	{
+								$serviceArr[$service["service_service_id"]] = $service["service_service_id"];
+								$serviceNbr[$service["service_service_id"]] = 1;
+							}
+						}
+						# Duplicate the Service list
+						multipleServiceInDB($serviceArr, $serviceNbr, $hostInf);							
+						$res =& $pearDB->query("SELECT DISTINCT contactgroup_cg_id FROM contactgroup_host_relation WHERE host_host_id = '".$key."'");
+						while($res->fetchInto($Cg))
+							$pearDB->query("INSERT INTO contactgroup_host_relation VALUES ('', '".$maxId["MAX(host_id)"]."', '".$Cg["contactgroup_cg_id"]."')");
+						$res =& $pearDB->query("SELECT DISTINCT hostgroup_hg_id FROM hostgroup_relation WHERE host_host_id = '".$key."'");
+						while($res->fetchInto($Hg))
+							$pearDB->query("INSERT INTO hostgroup_relation VALUES ('', '".$Hg["hostgroup_hg_id"]."', '".$maxId["MAX(host_id)"]."')");
+						$res =& $pearDB->query("SELECT * FROM extended_host_information WHERE host_host_id = '".$key."'");
+						while($res->fetchInto($ehi))	{
+							$val = null;
+							$ehi["host_host_id"] = $maxId["MAX(host_id)"];
+							$ehi["ehi_id"] = NULL;
+							foreach ($ehi as $key2=>$value2)
+								$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+							$val ? $rq = "INSERT INTO extended_host_information VALUES (".$val.")" : $rq = null;
+							$pearDB->query($rq);
+						}
+					}
+				}
+			}
+		}
+	}
+	
+	function updateHostInDB ($host_id = NULL)	{
+		if (!$host_id) return;
+		updateHost($host_id);
+		updateHostHostParent($host_id);
+		updateHostHostChild($host_id);
+		updateHostContactGroup($host_id);
+		updateHostHostGroup($host_id);
+		updateHostTemplateService($host_id);
+		global $form;
+		$ret = $form->getSubmitValues();
+		if (isset($ret["dupSvTplAssoc"]["dupSvTplAssoc"]) && $ret["dupSvTplAssoc"]["dupSvTplAssoc"] && $ret["host_template_model_htm_id"])
+			createHostTemplateService($host_id, $ret["host_template_model_htm_id"]);
+		updateHostExtInfos($host_id);
+	}	
+	
+	function insertHostInDB ($ret = array())	{
+		$host_id = insertHost($ret);
+		updateHostHostParent($host_id, $ret);
+		updateHostHostChild($host_id, $ret);
+		updateHostContactGroup($host_id, $ret);
+		updateHostHostGroup($host_id, $ret);
+		updateHostTemplateService($host_id, $ret);
+		global $form;
+		$ret = $form->getSubmitValues();
+		if (isset($ret["dupSvTplAssoc"]["dupSvTplAssoc"]) && $ret["dupSvTplAssoc"]["dupSvTplAssoc"] && $ret["host_template_model_htm_id"])
+			createHostTemplateService($host_id, $ret["host_template_model_htm_id"]);
+		insertHostExtInfos($host_id, $ret);
+		return ($host_id);
+	}
+	
+	function insertHost($ret)	{
+		global $form;
+		global $pearDB;
+		global $oreon;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO host " .
+				"(host_template_model_htm_id, command_command_id, timeperiod_tp_id, timeperiod_tp_id2, purge_policy_id, command_command_id2, " .
+				"host_name, host_alias, host_address, host_max_check_attempts, host_check_interval, host_active_checks_enabled, " .
+				"host_passive_checks_enabled, host_checks_enabled, host_obsess_over_host, host_check_freshness, host_freshness_threshold, " .
+				"host_event_handler_enabled, host_low_flap_threshold, host_high_flap_threshold, host_flap_detection_enabled, " .
+				"host_process_perf_data, host_retain_status_information, host_retain_nonstatus_information, host_notification_interval, " .
+				"host_notification_options, host_notifications_enabled, host_stalking_options, host_snmp_community, host_snmp_version, host_comment, host_register, host_activate) " .
+				"VALUES ( ";
+				isset($ret["host_template_model_htm_id"]) && $ret["host_template_model_htm_id"] != NULL ? $rq .= "'".$ret["host_template_model_htm_id"]."', ": $rq .= "NULL, ";
+				isset($ret["command_command_id"]) && $ret["command_command_id"] != NULL ? $rq .= "'".$ret["command_command_id"]."', ": $rq .= "NULL, ";
+				isset($ret["timeperiod_tp_id"]) && $ret["timeperiod_tp_id"] != NULL ? $rq .= "'".$ret["timeperiod_tp_id"]."', ": $rq .= "NULL, ";
+				isset($ret["timeperiod_tp_id2"]) && $ret["timeperiod_tp_id2"] != NULL ? $rq .= "'".$ret["timeperiod_tp_id2"]."', ": $rq .= "NULL, ";
+				isset($ret["purge_policy_id"]) && $ret["purge_policy_id"] != NULL ? $rq .= "'".$ret["purge_policy_id"]."', ": $rq .= "NULL, ";
+				isset($ret["command_command_id2"]) && $ret["command_command_id2"] != NULL ? $rq .= "'".$ret["command_command_id2"]."', ": $rq .= "NULL, ";
+				isset($ret["host_name"]) && $ret["host_name"] != NULL ? $rq .= "'".htmlentities($ret["host_name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+				isset($ret["host_alias"]) && $ret["host_alias"] != NULL ? $rq .= "'".htmlentities($ret["host_alias"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+				isset($ret["host_address"]) && $ret["host_address"] != NULL ? $rq .= "'".htmlentities($ret["host_address"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+				isset($ret["host_max_check_attempts"]) && $ret["host_max_check_attempts"] != NULL ? $rq .= "'".$ret["host_max_check_attempts"]."', " : $rq .= "NULL, ";
+				isset($ret["host_check_interval"]) && $ret["host_check_interval"] != NULL ? $rq .= "'".$ret["host_check_interval"]."', ": $rq .= "NULL, ";
+				isset($ret["host_active_checks_enabled"]["host_active_checks_enabled"]) && $ret["host_active_checks_enabled"]["host_active_checks_enabled"] != 2 ? $rq .= "'".$ret["host_active_checks_enabled"]["host_active_checks_enabled"]."', ": $rq .= "'2', ";
+				isset($ret["host_passive_checks_enabled"]["host_passive_checks_enabled"]) && $ret["host_passive_checks_enabled"]["host_passive_checks_enabled"] != 2 ? $rq .= "'".$ret["host_passive_checks_enabled"]["host_passive_checks_enabled"]."', ": $rq .= "'2', ";
+				isset($ret["host_checks_enabled"]["host_checks_enabled"]) && $ret["host_checks_enabled"]["host_checks_enabled"] != 2 ? $rq .= "'".$ret["host_checks_enabled"]["host_checks_enabled"]."', ": $rq .= "'2', ";
+				isset($ret["host_obsess_over_host"]["host_obsess_over_host"]) && $ret["host_obsess_over_host"]["host_obsess_over_host"] != 2 ? $rq .= "'".$ret["host_obsess_over_host"]["host_obsess_over_host"]."', ": $rq .= "'2', ";
+				isset($ret["host_check_freshness"]["host_check_freshness"]) && $ret["host_check_freshness"]["host_check_freshness"] != 2 ? $rq .= "'".$ret["host_check_freshness"]["host_check_freshness"]."', ": $rq .= "'2', ";
+				isset($ret["host_freshness_threshold"]) && $ret["host_freshness_threshold"] != NULL ? $rq .= "'".$ret["host_freshness_threshold"]."', ": $rq .= "NULL, ";
+				isset($ret["host_event_handler_enabled"]["host_event_handler_enabled"]) && $ret["host_event_handler_enabled"]["host_event_handler_enabled"] != 2 ? $rq .= "'".$ret["host_event_handler_enabled"]["host_event_handler_enabled"]."', ": $rq .= "'2', ";
+				isset($ret["host_low_flap_threshold"]) && $ret["host_low_flap_threshold"] != NULL ? $rq .= "'".$ret["host_low_flap_threshold"]."', " : $rq .= "NULL, ";
+				isset($ret["host_high_flap_threshold"]) && $ret["host_high_flap_threshold"] != NULL ? $rq .= "'".$ret["host_high_flap_threshold"]."', " : $rq .= "NULL, ";
+				isset($ret["host_flap_detection_enabled"]["host_flap_detection_enabled"]) && $ret["host_flap_detection_enabled"]["host_flap_detection_enabled"] != 2 ? $rq .= "'".$ret["host_flap_detection_enabled"]["host_flap_detection_enabled"]."', " : $rq .= "'2', ";
+				isset($ret["host_process_perf_data"]["host_process_perf_data"]) && $ret["host_process_perf_data"]["host_process_perf_data"] != 2 ? $rq .= "'".$ret["host_process_perf_data"]["host_process_perf_data"]."', " : $rq .= "'2', ";
+				isset($ret["host_retain_status_information"]["host_retain_status_information"]) && $ret["host_retain_status_information"]["host_retain_status_information"] != 2 ? $rq .= "'".$ret["host_retain_status_information"]["host_retain_status_information"]."', " : $rq .= "'2', ";
+				isset($ret["host_retain_nonstatus_information"]["host_retain_nonstatus_information"]) && $ret["host_retain_nonstatus_information"]["host_retain_nonstatus_information"] != 2 ? $rq .= "'".$ret["host_retain_nonstatus_information"]["host_retain_nonstatus_information"]."', " : $rq .= "'2', ";
+				isset($ret["host_notification_interval"]) && $ret["host_notification_interval"] != NULL ? $rq .= "'".$ret["host_notification_interval"]."', " : $rq .= "NULL, ";
+				isset($ret["host_notifOpts"]) && $ret["host_notifOpts"] != NULL ? $rq .= "'".implode(",", array_keys($ret["host_notifOpts"]))."', " : $rq .= "NULL, ";
+				isset($ret["host_notifications_enabled"]["host_notifications_enabled"]) && $ret["host_notifications_enabled"]["host_notifications_enabled"] != 2 ? $rq .= "'".$ret["host_notifications_enabled"]["host_notifications_enabled"]."', " : $rq .= "'2', ";
+				isset($ret["host_stalOpts"]) && $ret["host_stalOpts"] != NULL ? $rq .= "'".implode(",", array_keys($ret["host_stalOpts"]))."', " : $rq .= "NULL, ";
+				isset($ret["host_snmp_community"]) && $ret["host_snmp_community"] != NULL ? $rq .= "'".htmlentities($ret["host_snmp_community"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+				isset($ret["host_snmp_version"]) && $ret["host_snmp_version"] != NULL ? $rq .= "'".htmlentities($ret["host_snmp_version"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+				isset($ret["host_comment"]) && $ret["host_comment"] != NULL ? $rq .= "'".htmlentities($ret["host_comment"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+				isset($ret["host_register"]["host_register"]) && $ret["host_register"]["host_register"] != NULL ? $rq .= "'".$ret["host_register"]["host_register"]."', " : $rq .= "NULL, ";
+				isset($ret["host_activate"]["host_activate"]) && $ret["host_activate"]["host_activate"] != NULL ? $rq .= "'".$ret["host_activate"]["host_activate"]."'" : $rq .= "NULL";
+				$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(host_id) FROM host");
+		$host_id = $res->fetchRow();		
+		# Update LCA
+		$oreon->user->lcaHost[$host_id["MAX(host_id)"]] = $ret["host_name"];
+		$oreon->user->lcaHStr != '\'\'' ? $oreon->user->lcaHStr .= ",".$host_id["MAX(host_id)"] : $oreon->user->lcaHStr = $host_id["MAX(host_id)"];
+		$oreon->user->lcaHStrName != '\'\'' ? $oreon->user->lcaHStrName .= ",".$ret["host_name"] : $oreon->user->lcaHStrName = $ret["host_name"];
+		$res1 =& $pearDB->query("SELECT contactgroup_cg_id FROM contactgroup_contact_relation WHERE contact_contact_id = '".$oreon->user->get_id()."'");
+		while($res1->fetchInto($contactGroup))	{
+		 	$res2 =& $pearDB->query("SELECT lca_define_lca_id FROM lca_define_contactgroup_relation ldcgr WHERE ldcgr.contactgroup_cg_id = '".$contactGroup["contactgroup_cg_id"]."'");	
+			while ($res2->fetchInto($lca))	{
+				$rq = "INSERT INTO lca_define_host_relation ";
+				$rq .= "(lca_define_lca_id, host_host_id) ";
+				$rq .= "VALUES ";
+				$rq .= "('".$lca["lca_define_lca_id"]."', '".$host_id["MAX(host_id)"]."')";
+				$pearDB->query($rq);
+			}
+		}
+		#
+		return ($host_id["MAX(host_id)"]);
+	}	
+	
+	function insertHostExtInfos($host_id = null, $ret)	{
+		if (!$host_id) return;
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = 	"INSERT INTO `extended_host_information` " .
+				"( `ehi_id` , `host_host_id` , `ehi_notes` , `ehi_notes_url` , " .
+				"`ehi_action_url` , `ehi_icon_image` , `ehi_icon_image_alt` , " .
+				"`ehi_vrml_image` , `ehi_statusmap_image` , `ehi_2d_coords` , " .
+				"`ehi_3d_coords`, `country_id`, `city_id` )" .
+				"VALUES ( ";
+		$rq .= "NULL, ".$host_id.", ";
+		isset($ret["ehi_notes"]) && $ret["ehi_notes"] != NULL ? $rq .= "'".htmlentities($ret["ehi_notes"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ehi_notes_url"]) && $ret["ehi_notes_url"] != NULL ? $rq .= "'".htmlentities($ret["ehi_notes_url"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ehi_action_url"]) && $ret["ehi_action_url"] != NULL ? $rq .= "'".htmlentities($ret["ehi_action_url"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ehi_icon_image"]) && $ret["ehi_icon_image"] != NULL ? $rq .= "'".htmlentities($ret["ehi_icon_image"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ehi_icon_image_alt"]) && $ret["ehi_icon_image_alt"] != NULL ? $rq .= "'".htmlentities($ret["ehi_icon_image_alt"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ehi_vrml_image"]) && $ret["ehi_vrml_image"] != NULL ? $rq .= "'".htmlentities($ret["ehi_vrml_image"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ehi_statusmap_image"]) && $ret["ehi_statusmap_image"] != NULL ? $rq .= "'".htmlentities($ret["ehi_statusmap_image"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ehi_2d_coords"]) && $ret["ehi_2d_coords"] != NULL ? $rq .= "'".htmlentities($ret["ehi_2d_coords"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ehi_3d_coords"]) && $ret["ehi_3d_coords"] != NULL ? $rq .= "'".htmlentities($ret["ehi_3d_coords"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["country_id"]) && $ret["country_id"] != NULL ? $rq .= "'".$ret["country_id"]."', ": $rq .= "NULL, ";
+		if (isset($ret["city_name"]) && $ret["city_name"])	{
+			$res =& $pearDB->query("SELECT city_id, city_date FROM view_city WHERE city_name = '".$ret["city_name"]."' AND country_id = '".$ret["country_id"]."'");
+			$date = 0;
+			$city_id = NULL;
+			while($res->fetchInto($city))
+				if ($city["city_date"] > $date)	{
+					 $city_id = $city["city_id"];
+					 $date = $city["city_date"];
+				}
+			$city_id ? $rq .= "'".$city_id."' ": $rq .= "NULL ";
+		}	
+		else
+			$rq .= "NULL ";
+		$rq .= ")";
+		$pearDB->query($rq);
+	}
+	
+	function updateHost($host_id = null)	{
+		if (!$host_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE host SET " ;
+		$rq .= "host_template_model_htm_id = ";
+		isset($ret["host_template_model_htm_id"]) && $ret["host_template_model_htm_id"] != NULL ? $rq .= "'".$ret["host_template_model_htm_id"]."', ": $rq .= "NULL, ";
+		$rq .= "command_command_id = ";		
+		isset($ret["command_command_id"]) && $ret["command_command_id"] != NULL ? $rq .= "'".$ret["command_command_id"]."', ": $rq .= "NULL, ";
+		$rq .= "timeperiod_tp_id = ";
+		isset($ret["timeperiod_tp_id"]) && $ret["timeperiod_tp_id"] != NULL ? $rq .= "'".$ret["timeperiod_tp_id"]."', ": $rq .= "NULL, ";
+		$rq .= "timeperiod_tp_id2 = ";
+		isset($ret["timeperiod_tp_id2"]) && $ret["timeperiod_tp_id2"] != NULL ? $rq .= "'".$ret["timeperiod_tp_id2"]."', ": $rq .= "NULL, ";
+		$rq .= "purge_policy_id = ";
+		isset($ret["purge_policy_id"]) && $ret["purge_policy_id"] != NULL ? $rq .= "'".$ret["purge_policy_id"]."', ": $rq .= "NULL, ";
+		$rq .= "command_command_id2 = ";
+		isset($ret["command_command_id2"]) && $ret["command_command_id2"] != NULL ? $rq .= "'".$ret["command_command_id2"]."', ": $rq .= "NULL, ";
+		$rq .= "host_name = ";
+		isset($ret["host_name"]) && $ret["host_name"] != NULL ? $rq .= "'".htmlentities($ret["host_name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "host_alias = ";
+		isset($ret["host_alias"]) && $ret["host_alias"] != NULL ? $rq .= "'".htmlentities($ret["host_alias"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "host_address = ";
+		isset($ret["host_address"]) && $ret["host_address"] != NULL ? $rq .= "'".htmlentities($ret["host_address"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "host_max_check_attempts = ";
+		isset($ret["host_max_check_attempts"]) && $ret["host_max_check_attempts"] != NULL ? $rq .= "'".$ret["host_max_check_attempts"]."', " : $rq .= "NULL, ";
+		$rq .= "host_check_interval = ";
+		isset($ret["host_check_interval"]) && $ret["host_check_interval"]!= NULL ? $rq .= "'".$ret["host_check_interval"]."', ": $rq .= "NULL, ";
+		$rq .= "host_active_checks_enabled = ";
+		isset($ret["host_active_checks_enabled"]["host_active_checks_enabled"]) && $ret["host_active_checks_enabled"]["host_active_checks_enabled"] != 2 ? $rq .= "'".$ret["host_active_checks_enabled"]["host_active_checks_enabled"]."', ": $rq .= "'2', ";
+		$rq .= "host_passive_checks_enabled = ";
+		isset($ret["host_passive_checks_enabled"]["host_passive_checks_enabled"]) && $ret["host_passive_checks_enabled"]["host_passive_checks_enabled"] != 2 ? $rq .= "'".$ret["host_passive_checks_enabled"]["host_passive_checks_enabled"]."', ": $rq .= "'2', ";
+		$rq .= "host_checks_enabled = ";
+		isset($ret["host_checks_enabled"]["host_checks_enabled"]) && $ret["host_checks_enabled"]["host_checks_enabled"] != 2 ? $rq .= "'".$ret["host_checks_enabled"]["host_checks_enabled"]."', ": $rq .= "'2', ";
+		$rq .= "host_obsess_over_host = ";
+		isset($ret["host_obsess_over_host"]["host_obsess_over_host"]) && $ret["host_obsess_over_host"]["host_obsess_over_host"] != 2 ? $rq .= "'".$ret["host_obsess_over_host"]["host_obsess_over_host"]."', ": $rq .= "'2', ";
+		$rq .= "host_check_freshness = ";
+		isset($ret["host_check_freshness"]["host_check_freshness"]) && $ret["host_check_freshness"]["host_check_freshness"] != 2 ? $rq .= "'".$ret["host_check_freshness"]["host_check_freshness"]."', ": $rq .= "'2', ";
+		$rq .= "host_freshness_threshold = ";
+		isset($ret["host_freshness_threshold"]) && $ret["host_freshness_threshold"] != NULL ? $rq .= "'".$ret["host_freshness_threshold"]."', ": $rq .= "NULL, ";
+		$rq .= "host_event_handler_enabled = ";
+		isset($ret["host_event_handler_enabled"]["host_event_handler_enabled"]) && $ret["host_event_handler_enabled"]["host_event_handler_enabled"] != 2 ? $rq .= "'".$ret["host_event_handler_enabled"]["host_event_handler_enabled"]."', ": $rq .= "'2', ";
+		$rq .= "host_low_flap_threshold = ";
+		isset($ret["host_low_flap_threshold"]) && $ret["host_low_flap_threshold"]!= NULL ? $rq .= "'".$ret["host_low_flap_threshold"]."', " : $rq .= "NULL, ";
+		$rq .= "host_high_flap_threshold = ";
+		isset($ret["host_high_flap_threshold"]) && $ret["host_high_flap_threshold"] != NULL ? $rq .= "'".$ret["host_high_flap_threshold"]."', " : $rq .= "NULL, ";
+		$rq .= "host_flap_detection_enabled = ";
+		isset($ret["host_flap_detection_enabled"]["host_flap_detection_enabled"]) && $ret["host_flap_detection_enabled"]["host_flap_detection_enabled"] != 2 ? $rq .= "'".$ret["host_flap_detection_enabled"]["host_flap_detection_enabled"]."', " : $rq .= "'2', ";
+		$rq .= "host_process_perf_data = ";
+		isset($ret["host_process_perf_data"]["host_process_perf_data"]) && $ret["host_process_perf_data"]["host_process_perf_data"] != 2 ? $rq .= "'".$ret["host_process_perf_data"]["host_process_perf_data"]."', " : $rq .= "'2', ";
+		$rq .= "host_retain_status_information = ";
+		isset($ret["host_retain_status_information"]["host_retain_status_information"]) && $ret["host_retain_status_information"]["host_retain_status_information"] != 2 ? $rq .= "'".$ret["host_retain_status_information"]["host_retain_status_information"]."', " : $rq .= "'2', ";
+		$rq .= "host_retain_nonstatus_information = ";
+		isset($ret["host_retain_nonstatus_information"]["host_retain_nonstatus_information"]) && $ret["host_retain_nonstatus_information"]["host_retain_nonstatus_information"] != 2 ? $rq .= "'".$ret["host_retain_nonstatus_information"]["host_retain_nonstatus_information"]."', " : $rq .= "'2', ";
+		$rq .= "host_notification_interval = ";
+		isset($ret["host_notification_interval"]) && $ret["host_notification_interval"] != NULL ? $rq .= "'".$ret["host_notification_interval"]."', " : $rq .= "NULL, ";
+		$rq .= "host_notification_options = ";
+		isset($ret["host_notifOpts"]) && $ret["host_notifOpts"] != NULL ? $rq .= "'".implode(",", array_keys($ret["host_notifOpts"]))."', " : $rq .= "NULL, ";
+		$rq .= "host_notifications_enabled = ";
+		isset($ret["host_notifications_enabled"]["host_notifications_enabled"]) && $ret["host_notifications_enabled"]["host_notifications_enabled"] != 2 ? $rq .= "'".$ret["host_notifications_enabled"]["host_notifications_enabled"]."', " : $rq .= "'2', ";
+		$rq .= "host_stalking_options = ";
+		isset($ret["host_stalOpts"]) && $ret["host_stalOpts"] != NULL ? $rq .= "'".implode(",", array_keys($ret["host_stalOpts"]))."', " : $rq .= "NULL, ";
+		$rq .= "host_snmp_community = ";
+		isset($ret["host_snmp_community"]) && $ret["host_snmp_community"] != NULL ? $rq .= "'".htmlentities($ret["host_snmp_community"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "host_snmp_version = ";
+		isset($ret["host_snmp_version"]) && $ret["host_snmp_version"] != NULL ? $rq .= "'".htmlentities($ret["host_snmp_version"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "host_comment = ";
+		isset($ret["host_comment"]) && $ret["host_comment"] != NULL ? $rq .= "'".htmlentities($ret["host_comment"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "host_register = ";
+		isset($ret["host_register"]["host_register"]) && $ret["host_register"]["host_register"] != NULL ? $rq .= "'".$ret["host_register"]["host_register"]."', " : $rq .= "NULL, ";
+		$rq .= "host_activate = ";
+		isset($ret["host_activate"]["host_activate"]) && $ret["host_activate"]["host_activate"] != NULL ? $rq .= "'".$ret["host_activate"]["host_activate"]."'" : $rq .= "NULL ";
+		$rq .= "WHERE host_id = '".$host_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function updateHostHostParent($host_id = null, $ret = array())	{
+		if (!$host_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM host_hostparent_relation ";
+		$rq .= "WHERE host_host_id = '".$host_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["host_parents"]))
+			$ret = $ret["host_parents"];
+		else
+			$ret = $form->getSubmitValue("host_parents");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO host_hostparent_relation ";
+			$rq .= "(host_parent_hp_id, host_host_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$ret[$i]."', '".$host_id."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateHostHostChild($host_id = null)	{
+		if (!$host_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM host_hostparent_relation ";
+		$rq .= "WHERE host_parent_host_id = '".$host_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("host_childs");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO host_hostparent_relation ";
+			$rq .= "(host_parent_hp_id, host_host_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$host_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+
+
+	function updateHostExtInfos($host_id = null, $ret = array())	{
+		if (!$host_id) return;
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "UPDATE extended_host_information ";		
+		$rq .= "SET ehi_notes = ";
+		isset($ret["ehi_notes"]) && $ret["ehi_notes"] != NULL ? $rq .= "'".htmlentities($ret["ehi_notes"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "ehi_notes_url = ";
+		isset($ret["ehi_notes_url"]) && $ret["ehi_notes_url"] != NULL ? $rq .= "'".htmlentities($ret["ehi_notes_url"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "ehi_action_url = ";
+		isset($ret["ehi_action_url"]) && $ret["ehi_action_url"] != NULL ? $rq .= "'".htmlentities($ret["ehi_action_url"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "ehi_icon_image = ";
+		isset($ret["ehi_icon_image"]) && $ret["ehi_icon_image"] != NULL ? $rq .= "'".htmlentities($ret["ehi_icon_image"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "ehi_icon_image_alt = ";
+		isset($ret["ehi_icon_image_alt"]) && $ret["ehi_icon_image_alt"] != NULL ? $rq .= "'".htmlentities($ret["ehi_icon_image_alt"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "ehi_vrml_image = ";
+		isset($ret["ehi_vrml_image"]) && $ret["ehi_vrml_image"] != NULL ? $rq .= "'".htmlentities($ret["ehi_vrml_image"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "ehi_statusmap_image = ";
+		isset($ret["ehi_statusmap_image"]) && $ret["ehi_statusmap_image"] != NULL ? $rq .= "'".htmlentities($ret["ehi_statusmap_image"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "ehi_2d_coords = ";
+		isset($ret["ehi_2d_coords"]) && $ret["ehi_2d_coords"] != NULL ? $rq .= "'".htmlentities($ret["ehi_2d_coords"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "ehi_3d_coords = ";
+		isset($ret["ehi_3d_coords"]) && $ret["ehi_3d_coords"] != NULL ? $rq .= "'".htmlentities($ret["ehi_3d_coords"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "country_id = ";
+		isset($ret["country_id"]) && $ret["country_id"] != NULL ? $rq .= "'".$ret["country_id"]."', ": $rq .= "NULL, ";
+		$rq .= "city_id = ";
+		if (isset($ret["city_name"]) && $ret["city_name"])	{
+			$res =& $pearDB->query("SELECT city_id, city_date FROM view_city WHERE city_name = '".$ret["city_name"]."' AND country_id = '".$ret["country_id"]."'");			
+			$date = 0;
+			$city_id = NULL;
+			while($res->fetchInto($city))	{
+				if ($city["city_date"] > $date)	{
+					 $city_id = $city["city_id"];
+					 $date = $city["city_date"];
+				}
+			}
+			$city_id ? $rq .= "'".$city_id."' ": $rq .= "NULL ";
+		}	
+		else
+			$rq .= "NULL ";
+		$rq .= "WHERE host_host_id = '".$host_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function updateHostContactGroup($host_id, $ret = array())	{
+		if (!$host_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM contactgroup_host_relation ";
+		$rq .= "WHERE host_host_id = '".$host_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["host_cgs"]))
+			$ret = $ret["host_cgs"];
+		else
+			$ret = $form->getSubmitValue("host_cgs");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO contactgroup_host_relation ";
+			$rq .= "(host_host_id, contactgroup_cg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$host_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateHostHostGroup($host_id, $ret = array())	{
+		if (!$host_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM hostgroup_relation ";
+		$rq .= "WHERE host_host_id = '".$host_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["host_hgs"]))
+			$ret = $ret["host_hgs"];
+		else
+			$ret = $form->getSubmitValue("host_hgs");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO hostgroup_relation ";
+			$rq .= "(hostgroup_hg_id, host_host_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$ret[$i]."', '".$host_id."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function createHostTemplateService($host_id = null, $htm_id = NULL)	{
+		if (!$host_id || !$htm_id) return;
+		global $pearDB;
+		global $path;
+		require_once($path."../service/DB-Func.php");
+		$res =& $pearDB->query("SELECT service_service_id FROM host_service_relation WHERE host_host_id = '".$htm_id."'");
+		while ($res->fetchInto($row))	{
+			$desc =& getMyServiceName($row["service_service_id"]);
+			$service = array("service_template_model_stm_id" => $row["service_service_id"], "service_description"=> $desc, "service_register"=>array("service_register"=> 1), "service_activate"=>array("service_activate" => 1));
+			$service_id = insertService($service);		
+			$rq = "INSERT INTO host_service_relation ";
+			$rq .= "(hostgroup_hg_id, host_host_id, servicegroup_sg_id, service_service_id) ";
+			$rq .= "VALUES ";
+			$rq .= "(NULL, '".$host_id."', NULL, '".$service_id."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateHostTemplateService($host_id = null)	{
+		if (!$host_id) return;
+		global $form;
+		global $pearDB;
+		$res =& $pearDB->query("SELECT host_register FROM host WHERE host_id = '".$host_id."'");
+		$row =& $res->fetchRow();
+		if ($row["host_register"] == 0) 	{
+			$rq = "DELETE FROM host_service_relation ";
+			$rq .= "WHERE host_host_id = '".$host_id."'";
+			$pearDB->query($rq);
+			$ret = array();
+			$ret = $form->getSubmitValue("host_svTpls");
+			for($i = 0; $i < count($ret); $i++)	{
+				$rq = "INSERT INTO host_service_relation ";
+				$rq .= "(hostgroup_hg_id, host_host_id, servicegroup_sg_id, service_service_id) ";
+				$rq .= "VALUES ";
+				$rq .= "(NULL, '".$host_id."', NULL, '".$ret[$i]."')";
+				$pearDB->query($rq);
+			}
+		}
+	}
+
+	function updateHostTemplateUsed($useTpls = array())	{
+		if(!count($useTpls)) return;
+		global $pearDB;
+		require_once "./include/common/common-Func.php";
+		foreach ($useTpls as $key=>$value)
+			$pearDB->query("UPDATE host SET host_template_model_htm_id = '".getMyHostID($value)."' WHERE host_id = '".$key."'");
+			
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/host/formHost.ihtml b/www/include/configuration/configObject/host/formHost.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..0779f613af65c7427ff3468be584934dbc621fea
--- /dev/null
+++ b/www/include/configuration/configObject/host/formHost.ihtml
@@ -0,0 +1,188 @@
+<script type="text/javascript" src="./include/common/javascript/autocomplete-3-2.js"></script>
+<script type="text/javascript" src="include/configuration/changetab.js"></script>
+
+{$initJS}
+{$form.javascript}
+<form {$form.attributes}>
+<div>
+<ul id="mainnav">
+	<li class="a" id='c1'><a href="#"  onclick="javascript:montre('1');">{$sort1}</a></li>
+	<li class="b" id='c2'><a href="#" onclick="javascript:montre('2');">{$sort2}</a></li>
+	<li class="b" id='c3'><a href="#" onclick="javascript:montre('3');">{$sort3}</a></li>
+	<li class="b" id='c4'><a href="#" onclick="javascript:montre('4');">{$sort4}</a></li>
+</ul>
+</div>
+<div id="validFormTop">
+{if $o == "a" || $o == "c"}
+	<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+{else if $o == "w"}
+	<p class="oreonbutton">{$form.change.html}</p>
+{/if}
+</div>
+
+<div id='tab1' class='tab'>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/server_network.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/house.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.host_name.label}</td><td class="FormRowValue">{$form.host_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.host_alias.label}</td><td class="FormRowValue">{$form.host_alias.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.host_address.label}</td><td class="FormRowValue">{$form.host_address.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.host_snmp_community.label} && {$form.host_snmp_version.label}</td><td class="FormRowValue">{$form.host_snmp_community.html}&nbsp;&nbsp;{$form.host_snmp_version.html}</td></tr>
+		<tr class="list_one">
+			<td class="FormRowField">
+				<div style="text-decoration: underline">{$form.host_template_model_htm_id.label}</div>
+				{$form.tplText.label}
+			</td>
+			<td class="FormRowValue"> 
+				{$form.host_template_model_htm_id.html}
+				{if $o == "a" || $o == "c"}
+					&nbsp;<img src='./img/icones/16x16/server_network.gif' onClick="window.open('oreon.php?p=60601&host_id='+ document.Form.elements['host_template_model_htm_id'].options[document.Form.elements['host_template_model_htm_id'].selectedIndex].value + '&o=w&min=1','','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no, width=800, height=600');">
+				{/if}
+			</td>
+		</tr>		
+		<tr class="list_two">
+			<td class="FormRowField">{$form.dupSvTplAssocText.label}</td>
+			<td class="FormRowValue">{$form.dupSvTplAssoc.html}</td>
+		</tr>
+		
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/gauge.gif'>&nbsp;&nbsp;{$form.header.check}</td></tr>
+	 	{if $msg.nagios == 1}
+		<tr class="list_one"><td class="FormRowField">{$form.host_checks_enabled.label}</td><td class="FormRowValue">{$form.host_checks_enabled.html}</td></tr>
+	 	{/if}
+	 	{if $msg.nagios == 2}
+		<tr class="list_two"><td class="FormRowField">{$form.timeperiod_tp_id.label}</td><td class="FormRowValue">{$form.timeperiod_tp_id.html}</td></tr>
+	 	{/if}
+		<tr class="list_one">
+			<td class="FormRowField">{$form.command_command_id.label}</td>
+			<td class="FormRowValue">
+				{$form.command_command_id.html}			
+				{if $o == "a" || $o == "c"}
+				&nbsp;<img src='./img/icones/16x16/exchange.gif' onClick="window.open('oreon.php?p=60706&command_id='+ document.Form.elements['command_command_id'].options[document.Form.elements['command_command_id'].selectedIndex].value + '&o=w&min=1','','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no, width=1000, height=200');">
+				{/if}
+			</td>
+		</tr>
+		<tr class="list_two"><td class="FormRowField">{$form.host_max_check_attempts.label}</td><td class="FormRowValue">{$form.host_max_check_attempts.html}</td></tr>
+		{if $msg.nagios == 2}
+		<tr class="list_one"><td class="FormRowField">{$form.host_check_interval.label}</td><td class="FormRowValue">{$form.host_check_interval.html}</td></tr>
+		{/if}
+		<tr class="list_one"><td class="FormRowField">{$form.host_event_handler_enabled.label}</td><td class="FormRowValue">{$form.host_event_handler_enabled.html}</td></tr>
+		<tr class="list_two">
+			<td class="FormRowField">{$form.command_command_id2.label}</td>
+			<td class="FormRowValue">
+				{$form.command_command_id2.html}
+				{if $o == "a" || $o == "c"}
+					&nbsp;<img src='./img/icones/16x16/exchange.gif' onClick="window.open('oreon.php?p=60706&command_id='+ document.Form.elements['command_command_id2'].options[document.Form.elements['command_command_id2'].selectedIndex].value + '&o=w&min=1','','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no, width=1000, height=200');">
+				{/if}
+			</td>
+		</tr>
+		{if $msg.nagios == 2}
+		<tr class="list_one"><td class="FormRowField">{$form.host_active_checks_enabled.label}</td><td class="FormRowValue">{$form.host_active_checks_enabled.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.host_passive_checks_enabled.label}</td><td class="FormRowValue">{$form.host_passive_checks_enabled.html}</td></tr>
+	 	{/if}
+		
+	 			
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/mail_write.gif'>&nbsp;&nbsp;{$form.header.notification}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.host_notifications_enabled.label}</td><td class="FormRowValue">{$form.host_notifications_enabled.html}</td></tr>
+	 	{if $msg.nagios == 2}
+		<tr class="list_two"><td class="FormRowField">{$form.host_cgs.label}</td><td class="FormRowValue">{$form.host_cgs.html}</td></tr>
+	 	{/if}
+		<tr class="list_one"><td class="FormRowField">{$form.host_notification_interval.label}</td><td class="FormRowValue">{$form.host_notification_interval.html}{$time_unit}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.timeperiod_tp_id2.label}</td><td class="FormRowValue">{$form.timeperiod_tp_id2.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.host_notifOpts.label}</td><td class="FormRowValue">{$form.host_notifOpts.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.host_stalOpts.label}</td><td class="FormRowValue">{$form.host_stalOpts.html}</td></tr>
+		
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/cookies.gif'>&nbsp;&nbsp;{$form.header.furtherInfos}</td></tr>
+		{if !$msg.tpl}
+		<tr class="list_one"><td class="FormRowField">{$form.host_activate.label}</td><td class="FormRowValue">{$form.host_activate.html}</td></tr>
+		{/if}
+		<tr class="list_two"><td class="FormRowField">{$form.host_comment.label}</td><td class="FormRowValue">{$form.host_comment.html}</td></tr>
+		
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required_note}</td></tr>
+		{/if}
+	</table>
+</div>
+<div id='tab2' class='tab'>
+	 <table id="ListTable">
+		<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/server_network.gif'>&nbsp;&nbsp;{$form.header.title2}</td></tr>
+
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/server_client.gif'>&nbsp;&nbsp;{$form.header.links}</td></tr>
+		{if !$msg.tpl}
+		<tr class="list_one"><td class="FormRowField">{$form.host_hgs.label}</td><td class="FormRowValue">{$form.host_hgs.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.host_parents.label}</td><td class="FormRowValue">{$form.host_parents.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.host_childs.label}</td><td class="FormRowValue">{$form.host_childs.html}</td></tr>
+		{else}
+		<tr class="list_one"><td class="FormRowField">{$form.host_svTpls.label}</td><td class="FormRowValue">{$form.host_svTpls.html}</td></tr>
+		{/if}		
+	 </table>
+</div>
+<div id='tab3' class='tab'>
+	 <table id="ListTable">
+		<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/server_network.gif'>&nbsp;&nbsp;{$form.header.title3}</td></tr>
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/import2.gif'>&nbsp;&nbsp;{$form.header.treatment}</td></tr>
+	 	{if $msg.nagios == 2}
+		<tr class="list_one"><td class="FormRowField">{$form.host_obsess_over_host.label}</td><td class="FormRowValue">{$form.host_obsess_over_host.html}</td></tr>
+		{/if}
+	 	{if $msg.nagios == 2}
+		<tr class="list_two"><td class="FormRowField">{$form.host_check_freshness.label}</td><td class="FormRowValue">{$form.host_check_freshness.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.host_freshness_threshold.label}</td><td class="FormRowValue">{$form.host_freshness_threshold.html}</td></tr>
+		{/if}		
+		<tr class="list_two"><td class="FormRowField">{$form.host_flap_detection_enabled.label}</td><td class="FormRowValue">{$form.host_flap_detection_enabled.html}</td></tr>		
+		<tr class="list_one"><td class="FormRowField">{$form.host_low_flap_threshold.label}</td><td class="FormRowValue">{$form.host_low_flap_threshold.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.host_high_flap_threshold.label}</td><td class="FormRowValue">{$form.host_high_flap_threshold.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.host_process_perf_data.label}</td><td class="FormRowValue">{$form.host_process_perf_data.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.host_retain_status_information.label}</td><td class="FormRowValue">{$form.host_retain_status_information.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.host_retain_nonstatus_information.label}</td><td class="FormRowValue">{$form.host_retain_nonstatus_information.html}</td></tr>
+	
+		{if $msg.perfparse}
+			<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/data_down.gif'>&nbsp;&nbsp;{$form.header.purge_policy}</td></tr>
+			<tr class="list_one"><td class="FormRowField">{$form.purge_policy_id.label}</td><td class="FormRowValue">{$form.purge_policy_id.html}</td></tr>
+		{/if}
+	 </table>
+</div>
+
+<div id='tab4' class='tab'>
+	 <table id="ListTable">
+		<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/server_network.gif'>&nbsp;&nbsp;{$form.header.title4}</td></tr>
+
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/oreon.gif'>&nbsp;&nbsp;{$form.header.oreon}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.country_id.label}</td><td class="FormRowValue">
+		{$form.country_id.html}</td></tr>
+		<tr class="list_two">
+			<td class="FormRowField">
+				{$form.city_name.label}
+			</td>
+			<td class="FormRowValue">
+				{$form.city_name.html}
+				<!--	{if $o == "a" || $o == "c"}
+				&nbsp;<img src='./img/icones/16x16/flower_yellow.gif' onClick="window.open('oreon.php?p=60101&country_id='+ document.Form.elements['country_id'].options[document.Form.elements['country_id'].selectedIndex].value + '&o=w&min=1','','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no, width=350, height=230');">
+				{/if} -->
+			</td>
+		</tr>
+
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/nagios.gif'>&nbsp;&nbsp;{$form.header.nagios}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.ehi_notes_url.label}</td><td class="FormRowValue">{$form.ehi_notes_url.html}</td></tr>
+	 	{if $msg.nagios == 2}
+		<tr class="list_two"><td class="FormRowField">{$form.ehi_notes.label}</td><td class="FormRowValue">{$form.ehi_notes.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.ehi_action_url.label}</td><td class="FormRowValue">{$form.ehi_action_url.html}</td></tr>
+	 	{/if}
+		<tr class="list_two"><td class="FormRowField">{$form.ehi_icon_image.label}</td><td class="FormRowValue">{$form.ehi_icon_image.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.ehi_icon_image_alt.label}</td><td class="FormRowValue">{$form.ehi_icon_image_alt.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.ehi_vrml_image.label}</td><td class="FormRowValue">{$form.ehi_vrml_image.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.ehi_statusmap_image.label}</td><td class="FormRowValue">{$form.ehi_statusmap_image.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.ehi_2d_coords.label}</td><td class="FormRowValue">{$form.ehi_2d_coords.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.ehi_3d_coords.label}</td><td class="FormRowValue">{$form.ehi_3d_coords.html}</td></tr>
+	 </table>
+</div>
+<div id="validForm">
+{if $o == "a" || $o == "c"}
+	<p>{$form.action.html}</p>
+	<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+{else if $o == "w"}
+	<p class="oreonbutton">{$form.change.html}</p>
+{/if}
+</div>
+{$form.hidden}
+</form>
+
diff --git a/www/include/configuration/configObject/host/formHost.php b/www/include/configuration/configObject/host/formHost.php
new file mode 100644
index 0000000000000000000000000000000000000000..b2599cda3deac4e07c41844df485e607ad50b07d
--- /dev/null
+++ b/www/include/configuration/configObject/host/formHost.php
@@ -0,0 +1,469 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	#
+	## Database retrieve information for Host
+	#
+
+	$host = array();
+	if (($o == "c" || $o == "w") && $host_id)	{
+		$res =& $pearDB->query("SELECT * FROM host, extended_host_information ehi WHERE host_id = '".$host_id."' AND ehi.host_host_id = host.host_id AND host_id IN (".$oreon->user->lcaHStr.") LIMIT 1");
+		# Set base value
+		$host = array_map("myDecode", $res->fetchRow());
+		# Set Host Notification Options
+		$tmp = explode(',', $host["host_notification_options"]);
+		foreach ($tmp as $key => $value)
+			$host["host_notifOpts"][trim($value)] = 1;
+		# Set Stalking Options
+		$tmp = explode(',', $host["host_stalking_options"]);
+		foreach ($tmp as $key => $value)
+			$host["host_stalOpts"][trim($value)] = 1;
+		$res->free();
+		# Set Contact Group
+		$res =& $pearDB->query("SELECT DISTINCT contactgroup_cg_id FROM contactgroup_host_relation WHERE host_host_id = '".$host_id."'");
+		for($i = 0; $res->fetchInto($notifCg); $i++)
+			$host["host_cgs"][$i] = $notifCg["contactgroup_cg_id"];
+		$res->free();
+		# Set Host Parents
+		$res =& $pearDB->query("SELECT DISTINCT host_parent_hp_id FROM host_hostparent_relation WHERE host_host_id = '".$host_id."'");
+		for($i = 0; $res->fetchInto($parent); $i++)
+			$host["host_parents"][$i] = $parent["host_parent_hp_id"];
+		$res->free();
+		# Set Host Childs
+		$res =& $pearDB->query("SELECT DISTINCT host_host_id FROM host_hostparent_relation WHERE host_parent_hp_id = '".$host_id."'");
+		for($i = 0; $res->fetchInto($child); $i++)
+			$host["host_childs"][$i] = $child["host_host_id"];
+		$res->free();
+		# Set Host Group Parents
+		$res =& $pearDB->query("SELECT DISTINCT hostgroup_hg_id FROM hostgroup_relation WHERE host_host_id = '".$host_id."'");
+		for($i = 0; $res->fetchInto($hg); $i++)
+			$host["host_hgs"][$i] = $hg["hostgroup_hg_id"];
+		$res->free();
+		# Set City name
+		$res =& $pearDB->query("SELECT DISTINCT cny.country_id, cty.city_name FROM view_city cty, view_country cny WHERE cty.city_id = '".$host["city_id"]."' AND cny.country_id = '".$host["country_id"]."'");
+		$city = $res->fetchRow();
+		$host["city_name"] = $city["city_name"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Host Templates comes from DB -> Store in $hTpls Array
+	$hTpls = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT host_id, host_name, host_template_model_htm_id FROM host WHERE host_register = '0' AND host_id != '".$host_id."' AND host_id IN (".$oreon->user->lcaHStr.") ORDER BY host_name");
+	while($res->fetchInto($hTpl))	{
+		if (!$hTpl["host_name"])
+			$hTpl["host_name"] = getMyHostName($hTpl["host_template_model_htm_id"])."'";
+		$hTpls[$hTpl["host_id"]] = $hTpl["host_name"];
+	}
+	$res->free();
+	# Timeperiods comes from DB -> Store in $tps Array
+	$tps = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT tp_id, tp_name FROM timeperiod ORDER BY tp_name");
+	while($res->fetchInto($tp))
+		$tps[$tp["tp_id"]] = $tp["tp_name"];
+	$res->free();
+	# Check commands comes from DB -> Store in $checkCmds Array
+	$checkCmds = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT command_id, command_name FROM command WHERE command_type = '2' ORDER BY command_name");
+	while($res->fetchInto($checkCmd))
+		$checkCmds[$checkCmd["command_id"]] = $checkCmd["command_name"];
+	$res->free();
+	# Contact Groups comes from DB -> Store in $notifCcts Array
+	$notifCgs = array();
+	$res =& $pearDB->query("SELECT cg_id, cg_name FROM contactgroup ORDER BY cg_name");
+	while($res->fetchInto($notifCg))
+		$notifCgs[$notifCg["cg_id"]] = $notifCg["cg_name"];
+	$res->free();
+	# Host Groups comes from DB -> Store in $hgs Array
+	$hgs = array();
+	$res =& $pearDB->query("SELECT hg_id, hg_name FROM hostgroup WHERE hg_id IN (".$oreon->user->lcaHGStr.") ORDER BY hg_name");
+	while($res->fetchInto($hg))
+		$hgs[$hg["hg_id"]] = $hg["hg_name"];
+	$res->free();
+	# Host Parents comes from DB -> Store in $hostPs Array
+	$hostPs = array();
+	$res =& $pearDB->query("SELECT host_id, host_name, host_template_model_htm_id FROM host WHERE host_id != '".$host_id."' AND host_id IN (".$oreon->user->lcaHStr.") AND host_register = '1' ORDER BY host_name");
+	while($res->fetchInto($hostP))	{
+		if (!$hostP["host_name"])
+			$hostP["host_name"] = getMyHostName($hostP["host_template_model_htm_id"])."'";
+		$hostPs[$hostP["host_id"]] = $hostP["host_name"];
+	}
+	$res->free();
+	# Countries comes from DB -> Store in $countries Array
+	$countries = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT country_id, country_name FROM view_country ORDER BY country_name");
+	while($res->fetchInto($country))
+		$countries[$country["country_id"]] = $country["country_name"];
+	$res->free();
+	# Deletion Policy definition comes from DB -> Store in $ppols Array
+	$ppols = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT purge_policy_id, purge_policy_name FROM purge_policy ORDER BY purge_policy_name");
+	while($res->fetchInto($ppol))
+		$ppols[$ppol["purge_policy_id"]] = $ppol["purge_policy_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsText2		= array("size"=>"6");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["h_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["h_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["h_view"]);
+
+	## Sort 1 - Host Configuration
+	#
+	## Host basic information
+	#
+	$form->addElement('header', 'information', $lang['h_infos']);
+	$form->addElement('text', 'host_name', $lang["h_name"], $attrsText);
+	$form->addElement('text', 'host_alias', $lang["h_alias"], $attrsText);
+	$form->addElement('text', 'host_address', $lang["h_address"], $attrsText);
+	$form->addElement('select', 'host_snmp_version', $lang['h_snmpVer'], array(0=>null, 1=>"1", 2=>"2c", 3=>"3"));
+	$form->addElement('text', 'host_snmp_community', $lang['h_snmpCom'], $attrsText);
+
+	$form->addElement('select', 'host_template_model_htm_id', $lang['htm_template'], $hTpls);
+	$form->addElement('static', 'tplText', $lang['h_templateText']);
+	$dupSvTpl[] = &HTML_QuickForm::createElement('radio', 'dupSvTplAssoc', null, $lang["yes"], '1');
+	$dupSvTpl[] = &HTML_QuickForm::createElement('radio', 'dupSvTplAssoc', null, $lang["no"], '0');
+	$form->addGroup($dupSvTpl, 'dupSvTplAssoc', $lang['h_checksEnabled'], '&nbsp;');
+	$form->setDefaults(array('dupSvTplAssoc' => '0'));
+	$form->addElement('static', 'dupSvTplAssocText', $lang['h_dupSvTplAssocText']);
+
+	#
+	## Check information
+	#
+	$form->addElement('header', 'check', $lang['h_head_state']);
+	#Nagios 1
+	if ($oreon->user->get_version() == 1)	{
+	$hostCE[] = &HTML_QuickForm::createElement('radio', 'host_checks_enabled', null, $lang["yes"], '1');
+	$hostCE[] = &HTML_QuickForm::createElement('radio', 'host_checks_enabled', null, $lang["no"], '0');
+	$hostCE[] = &HTML_QuickForm::createElement('radio', 'host_checks_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($hostCE, 'host_checks_enabled', $lang['h_checksEnabled'], '&nbsp;');
+	$form->setDefaults(array('host_checks_enabled' => '2'));
+	}
+	$form->addElement('select', 'command_command_id', $lang['h_checkCmd'], $checkCmds);
+	$form->addElement('text', 'host_max_check_attempts', $lang['h_checkMca'], $attrsText2);
+
+	$hostEHE[] = &HTML_QuickForm::createElement('radio', 'host_event_handler_enabled', null, $lang["yes"], '1');
+	$hostEHE[] = &HTML_QuickForm::createElement('radio', 'host_event_handler_enabled', null, $lang["no"], '0');
+	$hostEHE[] = &HTML_QuickForm::createElement('radio', 'host_event_handler_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($hostEHE, 'host_event_handler_enabled', $lang['h_eventHandlerE'], '&nbsp;');
+	$form->setDefaults(array('host_event_handler_enabled' => '2'));
+	$form->addElement('select', 'command_command_id2', $lang['h_eventHandler'], $checkCmds);
+
+	# Nagios 2
+	if ($oreon->user->get_version() == 2)	{
+	$form->addElement('text', 'host_check_interval', $lang['h_checkInterval'], $attrsText2);
+
+	$hostACE[] = &HTML_QuickForm::createElement('radio', 'host_active_checks_enabled', null, $lang["yes"], '1');
+	$hostACE[] = &HTML_QuickForm::createElement('radio', 'host_active_checks_enabled', null, $lang["no"], '0');
+	$hostACE[] = &HTML_QuickForm::createElement('radio', 'host_active_checks_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($hostACE, 'host_active_checks_enabled', $lang['h_activeCE'], '&nbsp;');
+	$form->setDefaults(array('host_active_checks_enabled' => '2'));
+
+	$hostPCE[] = &HTML_QuickForm::createElement('radio', 'host_passive_checks_enabled', null, $lang["yes"], '1');
+	$hostPCE[] = &HTML_QuickForm::createElement('radio', 'host_passive_checks_enabled', null, $lang["no"], '0');
+	$hostPCE[] = &HTML_QuickForm::createElement('radio', 'host_passive_checks_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($hostPCE, 'host_passive_checks_enabled', $lang['h_passiveCE'], '&nbsp;');
+	$form->setDefaults(array('host_passive_checks_enabled' => '2'));
+
+	$form->addElement('select', 'timeperiod_tp_id', $lang['h_checkPeriod'], $tps);
+	}
+
+	##
+	## Notification informations
+	##
+	$form->addElement('header', 'notification', $lang['h_head_notif']);
+	$hostNE[] = &HTML_QuickForm::createElement('radio', 'host_notifications_enabled', null, $lang["yes"], '1');
+	$hostNE[] = &HTML_QuickForm::createElement('radio', 'host_notifications_enabled', null, $lang["no"], '0');
+	$hostNE[] = &HTML_QuickForm::createElement('radio', 'host_notifications_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($hostNE, 'host_notifications_enabled', $lang['h_notifEnabled'], '&nbsp;');
+	$form->setDefaults(array('host_notifications_enabled' => '2'));
+	#Nagios 2
+	if ($oreon->user->get_version() == 2)	{
+    $ams3 =& $form->addElement('advmultiselect', 'host_cgs', $lang['h_CgMembers'], $notifCgs, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+	}
+
+	$form->addElement('text', 'host_notification_interval', $lang['h_notifInt'], $attrsText2);
+	$form->addElement('select', 'timeperiod_tp_id2', $lang['h_notifTp'], $tps);
+
+ 	$hostNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'd', '&nbsp;', 'Down');
+	$hostNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unreachable');
+	$hostNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'r', '&nbsp;', 'Recovery');
+	if ($oreon->user->get_version() == 2)
+		$hostNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'f', '&nbsp;', 'Flapping');
+	$form->addGroup($hostNotifOpt, 'host_notifOpts', $lang['h_notifOpts'], '&nbsp;&nbsp;');
+
+ 	$hostStalOpt[] = &HTML_QuickForm::createElement('checkbox', 'o', '&nbsp;', 'Ok/Up');
+	$hostStalOpt[] = &HTML_QuickForm::createElement('checkbox', 'd', '&nbsp;', 'Down');
+	$hostStalOpt[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unreachable');
+	$form->addGroup($hostStalOpt, 'host_stalOpts', $lang['h_stalOpts'], '&nbsp;&nbsp;');
+
+	#
+	## Further informations
+	#
+	$form->addElement('header', 'furtherInfos', $lang['further_infos']);
+	$hostActivation[] = &HTML_QuickForm::createElement('radio', 'host_activate', null, $lang["enable"], '1');
+	$hostActivation[] = &HTML_QuickForm::createElement('radio', 'host_activate', null, $lang["disable"], '0');
+	$form->addGroup($hostActivation, 'host_activate', $lang["status"], '&nbsp;');
+	$form->setDefaults(array('host_activate' => '1'));
+	$form->addElement('textarea', 'host_comment', $lang["cmt_comment"], $attrsTextarea);
+
+	#
+	## Sort 2 - Host Relations
+	#
+	if ($o == "a")
+		$form->addElement('header', 'title2', $lang["h_Links_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title2', $lang["h_Links_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title2', $lang["h_Links_view"]);
+
+	$form->addElement('header', 'links', $lang['h_head_links']);
+    $ams3 =& $form->addElement('advmultiselect', 'host_parents', $lang['h_HostParents'], $hostPs, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+
+    $ams3 =& $form->addElement('advmultiselect', 'host_childs', $lang['h_HostChilds'], $hostPs, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+
+    $ams3 =& $form->addElement('advmultiselect', 'host_hgs', $lang['h_HostGroupMembers'], $hgs, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+
+
+	#
+	## Sort 3 - Data treatment
+	#
+	if ($o == "a")
+		$form->addElement('header', 'title3', $lang["h_add_treat"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title3', $lang["h_modify_treat"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title3', $lang["h_view_treat"]);
+
+
+	$form->addElement('header', 'treatment', $lang['h_head_treat']);
+	# Nagios 2
+	if ($oreon->user->get_version() == 2)	{
+	$hostOOH[] = &HTML_QuickForm::createElement('radio', 'host_obsess_over_host', null, $lang["yes"], '1');
+	$hostOOH[] = &HTML_QuickForm::createElement('radio', 'host_obsess_over_host', null, $lang["no"], '0');
+	$hostOOH[] = &HTML_QuickForm::createElement('radio', 'host_obsess_over_host', null, $lang["nothing"], '2');
+	$form->addGroup($hostOOH, 'host_obsess_over_host', $lang['h_ObsessOH'], '&nbsp;');
+	$form->setDefaults(array('host_obsess_over_host' => '2'));
+
+	$hostCF[] = &HTML_QuickForm::createElement('radio', 'host_check_freshness', null, $lang["yes"], '1');
+	$hostCF[] = &HTML_QuickForm::createElement('radio', 'host_check_freshness', null, $lang["no"], '0');
+	$hostCF[] = &HTML_QuickForm::createElement('radio', 'host_check_freshness', null, $lang["nothing"], '2');
+	$form->addGroup($hostCF, 'host_check_freshness', $lang['h_checkFreshness'], '&nbsp;');
+	$form->setDefaults(array('host_check_freshness' => '2'));
+	}
+	$hostFDE[] = &HTML_QuickForm::createElement('radio', 'host_flap_detection_enabled', null, $lang["yes"], '1');
+	$hostFDE[] = &HTML_QuickForm::createElement('radio', 'host_flap_detection_enabled', null, $lang["no"], '0');
+	$hostFDE[] = &HTML_QuickForm::createElement('radio', 'host_flap_detection_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($hostFDE, 'host_flap_detection_enabled', $lang['h_flapDetect'], '&nbsp;');
+	$form->setDefaults(array('host_flap_detection_enabled' => '2'));
+	# Nagios 2
+	if ($oreon->user->get_version() == 2)	{
+		$form->addElement('text', 'host_freshness_threshold', $lang['h_FreshnessThreshold'], $attrsText2);
+	}
+	$form->addElement('text', 'host_low_flap_threshold', $lang['h_lowFT'], $attrsText2);
+	$form->addElement('text', 'host_high_flap_threshold', $lang['h_highFT'], $attrsText2);
+
+	$hostPPD[] = &HTML_QuickForm::createElement('radio', 'host_process_perf_data', null, $lang["yes"], '1');
+	$hostPPD[] = &HTML_QuickForm::createElement('radio', 'host_process_perf_data', null, $lang["no"], '0');
+	$hostPPD[] = &HTML_QuickForm::createElement('radio', 'host_process_perf_data', null, $lang["nothing"], '2');
+	$form->addGroup($hostPPD, 'host_process_perf_data', $lang['h_processPD'], '&nbsp;');
+	$form->setDefaults(array('host_process_perf_data' => '2'));
+
+	$hostRSI[] = &HTML_QuickForm::createElement('radio', 'host_retain_status_information', null, $lang["yes"], '1');
+	$hostRSI[] = &HTML_QuickForm::createElement('radio', 'host_retain_status_information', null, $lang["no"], '0');
+	$hostRSI[] = &HTML_QuickForm::createElement('radio', 'host_retain_status_information', null, $lang["nothing"], '2');
+	$form->addGroup($hostRSI, 'host_retain_status_information', $lang['h_retainSI'], '&nbsp;');
+	$form->setDefaults(array('host_retain_status_information' => '2'));
+
+	$hostRNI[] = &HTML_QuickForm::createElement('radio', 'host_retain_nonstatus_information', null, $lang["yes"], '1');
+	$hostRNI[] = &HTML_QuickForm::createElement('radio', 'host_retain_nonstatus_information', null, $lang["no"], '0');
+	$hostRNI[] = &HTML_QuickForm::createElement('radio', 'host_retain_nonstatus_information', null, $lang["nothing"], '2');
+	$form->addGroup($hostRNI, 'host_retain_nonstatus_information', $lang['h_retainNI'], '&nbsp;');
+	$form->setDefaults(array('host_retain_nonstatus_information' => '2'));
+
+	if ($oreon->optGen["perfparse_installed"])	{
+		$form->addElement('header', 'purge_policy', $lang["mod_purgePolicy"]);
+		$form->addElement('select', 'purge_policy_id', $lang["mod_purgePolicy_name"], $ppols);
+	}
+	
+	#
+	## Sort 4 - Extended Infos
+	#
+	if ($o == "a")
+		$form->addElement('header', 'title4', $lang["h_ExtInf_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title4', $lang["h_ExtInf_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title4', $lang["h_ExtInf_view"]);
+
+	$form->addElement('header', 'nagios', $lang['h_nagios']);
+	if ($oreon->user->get_version() == 2)
+		$form->addElement('text', 'ehi_notes', $lang['h_notes'], $attrsText);
+	$form->addElement('text', 'ehi_notes_url', $lang['h_notesUrl'], $attrsText);
+	if ($oreon->user->get_version() == 2)
+		$form->addElement('text', 'ehi_action_url', $lang['h_actionUrl'], $attrsText);
+	$form->addElement('text', 'ehi_icon_image', $lang['h_iconImg'], $attrsText);
+	$form->addElement('text', 'ehi_icon_image_alt', $lang['h_iconImgAlt'], $attrsText);
+	$form->addElement('text', 'ehi_vrml_image', $lang['h_vrmlImg'], $attrsText);
+	$form->addElement('text', 'ehi_statusmap_image', $lang['h_nagStatImg'], $attrsText);
+	$form->addElement('text', 'ehi_2d_coords', $lang['h_nag2dCoords'], $attrsText2);
+	$form->addElement('text', 'ehi_3d_coords', $lang['h_nag3dCoords'], $attrsText2);
+
+	$form->addElement('header', 'oreon', $lang['h_oreon']);
+	$form->addElement('select', 'country_id', $lang['h_country'], $countries);
+	$form->addElement('text', 'city_name', $lang['h_city'], array("id"=>"city_name", "size"=>"35", "autocomplete"=>"off"));
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action' => '1'));
+
+	$form->addElement('hidden', 'host_id');
+	$reg =& $form->addElement('hidden', 'host_register');
+	$reg->setValue("1");
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	function myReplace()	{
+		global $form;
+		return (str_replace(" ", "_", $form->getSubmitValue("host_name")));
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('host_name', 'myReplace');
+	$form->addRule('host_name', $lang['ErrName'], 'required');
+	# If we are using a Template, no need to check the value, we hope there are in the Template
+	if (!$form->getSubmitValue("host_template_model_htm_id"))	{
+		$form->addRule('host_alias', $lang['ErrAlias'], 'required');
+		$form->addRule('host_address', $lang['ErrAddress'], 'required');
+		$form->addRule('host_max_check_attempts', $lang['ErrRequired'], 'required');
+		if ($oreon->user->get_version() == 2)	{
+		$form->addRule('timeperiod_tp_id', $lang['ErrTp'], 'required');
+		$form->addRule('host_cgs', $lang['ErrCg'], 'required');
+		}
+		$form->addRule('host_notification_interval', $lang['ErrRequired'], 'required');
+		$form->addRule('timeperiod_tp_id2', $lang['ErrTp'], 'required');
+		$form->addRule('host_notifOpts', $lang['ErrOpt'], 'required');
+
+		$form->registerRule('exist', 'callback', 'testHostExistence');
+		$form->addRule('host_name', $lang['ErrAlreadyExist'], 'exist');
+	}
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Just watch a host information
+	if ($o == "w")	{
+		if (!$min)
+			$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&host_id=".$host_id."'"));
+	    $form->setDefaults($host);
+		$form->freeze();
+	}
+	# Modify a host information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($host);
+	}
+	# Add a host information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	$tpl->assign('msg', array ("nagios"=>$oreon->user->get_version(), "tpl"=>0, "perfparse"=>$oreon->optGen["perfparse_installed"]));
+	$tpl->assign('min', $min);
+	$tpl->assign("sort1", $lang['h_conf']);
+	$tpl->assign("sort2", $lang['h_head_links']);
+	$tpl->assign("sort3", $lang['h_head_treat']);
+	$tpl->assign("sort4", $lang['h_extInf']);
+	$tpl->assign("initJS", "<script type='text/javascript'>
+							window.onload = function () {
+							init();
+							initAutoComplete('Form','city_name','sub');
+							};</script>");
+	$tpl->assign('time_unit', " * ".$oreon->Nagioscfg["interval_length"]." ".$lang["time_sec"]);
+
+	$valid = false;
+	if ($form->validate())	{
+		$hostObj =& $form->getElement('host_id');
+		if ($form->getSubmitValue("submitA"))
+			$hostObj->setValue(insertHostInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateHostInDB($hostObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&host_id=".$hostObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listHost.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->display("formHost.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/host/host.php b/www/include/configuration/configObject/host/host.php
new file mode 100644
index 0000000000000000000000000000000000000000..01f29b680e804b8ef8a4a0d5f6c55656cd41a122
--- /dev/null
+++ b/www/include/configuration/configObject/host/host.php
@@ -0,0 +1,50 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["host_id"]) ? $hG = $_GET["host_id"] : $hG = NULL;
+	isset($_POST["host_id"]) ? $hP = $_POST["host_id"] : $hP = NULL;
+	$hG ? $host_id = $hG : $host_id = $hP;
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	global $path;
+	$path = "./include/configuration/configObject/host/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formHost.php"); break; #Add a host
+		case "w" : require_once($path."formHost.php"); break; #Watch a host
+		case "c" : require_once($path."formHost.php"); break; #Modify a host
+		case "s" : enableHostInDB($host_id); require_once($path."listHost.php"); break; #Activate a host
+		case "u" : disableHostInDB($host_id); require_once($path."listHost.php"); break; #Desactivate a host
+		case "m" : multipleHostInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listHost.php"); break; #Duplicate n hosts
+		case "d" : deleteHostInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listHost.php"); break; #Delete n hosts
+		default : require_once($path."listHost.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/host/listHost.ihtml b/www/include/configuration/configObject/host/listHost.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..014810343284959125500c3563b3f2a272aa859f
--- /dev/null
+++ b/www/include/configuration/configObject/host/listHost.ihtml
@@ -0,0 +1,56 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+
+<form {$form_attributes}>
+
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker">
+				<input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/>
+			
+			</td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_address}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_parent}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_address}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_parent}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="4"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+
+
+	
+{$form.hidden}
+</form>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/host/listHost.php b/www/include/configuration/configObject/host/listHost.php
new file mode 100644
index 0000000000000000000000000000000000000000..8e70b362a965560d577e53cf661d8bf941eed33e
--- /dev/null
+++ b/www/include/configuration/configObject/host/listHost.php
@@ -0,0 +1,112 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	$pagination = "maxViewConfiguration";		
+
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM host WHERE host_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' AND host_id IN (".$oreon->user->lcaHStr.") AND host_register = '1'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM host WHERE host_id IN (".$oreon->user->lcaHStr.") AND host_register = '1'");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_address", $lang["h_address"]);
+	$tpl->assign("headerMenu_parent", $lang['h_parent']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Host list
+	if ($search)
+		$rq = "SELECT @hTpl:=(SELECT host_name FROM host WHERE host_id = h.host_template_model_htm_id) AS hTpl, h.host_id, h.host_name, h.host_alias, h.host_address, h.host_activate, h.host_template_model_htm_id FROM host h WHERE h.host_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' AND host_id IN (".$oreon->user->lcaHStr.") AND host_register = '1' ORDER BY h.host_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT @hTpl:=(SELECT host_name FROM host WHERE host_id = h.host_template_model_htm_id) AS hTpl, h.host_id, h.host_name, h.host_alias, h.host_address, h.host_activate, h.host_template_model_htm_id FROM host h WHERE host_id IN (".$oreon->user->lcaHStr.") AND h.host_register = '1' ORDER BY h.host_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($host); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$host['host_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&host_id=".$host['host_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&host_id=".$host['host_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&host_id=".$host['host_id']."&o=d&select[".$host['host_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($host["host_activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&host_id=".$host['host_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&host_id=".$host['host_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$host['host_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		# If the name of our Host is in the Template definition, we have to catch it, whatever the level of it :-)
+		if (!$host["host_name"])
+			$host["host_name"] = getMyHostName($host["host_template_model_htm_id"]);
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$host["host_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&host_id=".$host['host_id'],
+						"RowMenu_desc"=>$host["host_alias"],
+						"RowMenu_address"=>$host["host_address"],
+						"RowMenu_parent"=>$host["host_template_model_htm_id"] ? $host["hTpl"] : $lang["no"],
+						"RowMenu_status"=>$host["host_activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+
+
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);
+
+
+
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listHost.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+
diff --git a/www/include/configuration/configObject/host_dependency/DB-Func.php b/www/include/configuration/configObject/host_dependency/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..50c00fd3697fb7aab10615acad7fee48469c22bd
--- /dev/null
+++ b/www/include/configuration/configObject/host_dependency/DB-Func.php
@@ -0,0 +1,193 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset ($oreon))
+		exit ();
+
+	function testHostDependencyExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('dep_id');
+		$res =& $pearDB->query("SELECT dep_name, dep_id FROM dependency WHERE dep_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$dep =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $dep["dep_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $dep["dep_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function testHostDependencyCycle ($childs = NULL)	{
+		global $pearDB;
+		global $form;
+		$parents = array();
+		$childs = array();
+		if (isset($form))	{
+			$parents = $form->getSubmitValue('dep_hostParents');
+			$childs = $form->getSubmitValue('dep_hostChilds');
+			$childs =& array_flip($childs);
+		}
+		foreach ($parents as $parent)
+			if (array_key_exists($parent, $childs))
+				return false;
+		return true;
+	}
+
+	function deleteHostDependencyInDB ($dependencies = array())	{
+		global $pearDB;
+		foreach($dependencies as $key=>$value)
+			$pearDB->query("DELETE FROM dependency WHERE dep_id = '".$key."'");
+	}
+	
+	function multipleHostDependencyInDB ($dependencies = array(), $nbrDup = array())	{
+		foreach($dependencies as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM dependency WHERE dep_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["dep_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "dep_name" ? ($dep_name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testHostDependencyExistence($dep_name))	{
+					$val ? $rq = "INSERT INTO dependency VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(dep_id) FROM dependency");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(dep_id)"]))	{
+						$res =& $pearDB->query("SELECT DISTINCT host_host_id FROM dependency_hostParent_relation WHERE dependency_dep_id = '".$key."'");
+						while($res->fetchInto($host))
+							$pearDB->query("INSERT INTO dependency_hostParent_relation VALUES ('', '".$maxId["MAX(dep_id)"]."', '".$host["host_host_id"]."')");
+						$res->free();
+						$res =& $pearDB->query("SELECT DISTINCT host_host_id FROM dependency_hostChild_relation WHERE dependency_dep_id = '".$key."'");
+						while($res->fetchInto($host))
+							$pearDB->query("INSERT INTO dependency_hostChild_relation VALUES ('', '".$maxId["MAX(dep_id)"]."', '".$host["host_host_id"]."')");
+						$res->free();
+					}
+				}
+			}
+		}
+	}
+	
+	function updateHostDependencyInDB ($dep_id = NULL)	{
+		if (!$dep_id) exit();
+		updateHostDependency($dep_id);
+		updateHostDependencyHostParents($dep_id);
+		updateHostDependencyHostChilds($dep_id);
+	}	
+	
+	function insertHostDependencyInDB ($ret = array())	{
+		$dep_id = insertHostDependency($ret);
+		updateHostDependencyHostParents($dep_id, $ret);
+		updateHostDependencyHostChilds($dep_id, $ret);
+		return ($dep_id);
+	}
+	
+	function insertHostDependency($ret = array())	{
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO dependency ";
+		$rq .= "(dep_name, dep_description, inherits_parent, execution_failure_criteria, notification_failure_criteria, dep_comment) ";
+		$rq .= "VALUES (";
+		isset($ret["dep_name"]) && $ret["dep_name"] != NULL ? $rq .= "'".htmlentities($ret["dep_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["dep_description"]) && $ret["dep_description"] != NULL ? $rq .= "'".htmlentities($ret["dep_description"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["inherits_parent"]["inherits_parent"]) && $ret["inherits_parent"]["inherits_parent"] != NULL ? $rq .= "'".$ret["inherits_parent"]["inherits_parent"]."', " : $rq .= "NULL, ";
+		isset($ret["execution_failure_criteria"]) && $ret["execution_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["execution_failure_criteria"]))."', " : $rq .= "NULL, ";
+		isset($ret["notification_failure_criteria"]) && $ret["notification_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["notification_failure_criteria"]))."', " : $rq .= "NULL, ";
+		isset($ret["dep_comment"]) && $ret["dep_comment"] != NULL ? $rq .= "'".htmlentities($ret["dep_comment"], ENT_QUOTES)."' " : $rq .= "NULL ";
+		$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(dep_id) FROM dependency");
+		$dep_id = $res->fetchRow();
+		return ($dep_id["MAX(dep_id)"]);
+	}
+	
+	function updateHostDependency($dep_id = null)	{
+		if (!$dep_id) exit();
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE dependency SET ";
+		$rq .= "dep_name = ";
+		isset($ret["dep_name"]) && $ret["dep_name"] != NULL ? $rq .= "'".htmlentities($ret["dep_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "dep_description = ";
+		isset($ret["dep_description"]) && $ret["dep_description"] != NULL ? $rq .= "'".htmlentities($ret["dep_description"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "inherits_parent = ";
+		isset($ret["inherits_parent"]["inherits_parent"]) && $ret["inherits_parent"]["inherits_parent"] != NULL ? $rq .= "'".$ret["inherits_parent"]["inherits_parent"]."', " : $rq .= "NULL, ";
+		$rq .= "execution_failure_criteria = ";
+		isset($ret["execution_failure_criteria"]) && $ret["execution_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["execution_failure_criteria"]))."', " : $rq .= "NULL, ";
+		$rq .= "notification_failure_criteria = ";
+		isset($ret["notification_failure_criteria"]) && $ret["notification_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["notification_failure_criteria"]))."', " : $rq .= "NULL, ";
+		$rq .= "dep_comment = ";
+		isset($ret["dep_comment"]) && $ret["dep_comment"] != NULL ? $rq .= "'".htmlentities($ret["dep_comment"], ENT_QUOTES)."' " : $rq .= "NULL ";
+		$rq .= "WHERE dep_id = '".$dep_id."'";
+		$pearDB->query($rq);
+	}
+		
+	function updateHostDependencyHostParents($dep_id = null, $ret = array())	{
+		if (!$dep_id) exit();
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM dependency_hostParent_relation ";
+		$rq .= "WHERE dependency_dep_id = '".$dep_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["dep_hostParents"]))
+			$ret = $ret["dep_hostParents"];
+		else
+			$ret = $form->getSubmitValue("dep_hostParents");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO dependency_hostParent_relation ";
+			$rq .= "(dependency_dep_id, host_host_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$dep_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+		
+	function updateHostDependencyHostChilds($dep_id = null, $ret = array())	{
+		if (!$dep_id) exit();
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM dependency_hostChild_relation ";
+		$rq .= "WHERE dependency_dep_id = '".$dep_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["dep_hostChilds"]))
+			$ret = $ret["dep_hostChilds"];
+		else
+			$ret = $form->getSubmitValue("dep_hostChilds");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO dependency_hostChild_relation ";
+			$rq .= "(dependency_dep_id, host_host_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$dep_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/host_dependency/formHostDependency.ihtml b/www/include/configuration/configObject/host_dependency/formHostDependency.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..2549b916d18e6798df2a5207957c203e7286270a
--- /dev/null
+++ b/www/include/configuration/configObject/host_dependency/formHostDependency.ihtml
@@ -0,0 +1,27 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/server_network.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/gauge.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.dep_name.label}</td><td class="FormRowValue">{$form.dep_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.dep_description.label}</td><td class="FormRowValue">{$form.dep_description.html}</td></tr>
+		{if $nagios == 2}
+			<tr class="list_one"><td class="FormRowField">{$form.inherits_parent.label}</td><td class="FormRowValue">{$form.inherits_parent.html}</td></tr>
+			<tr class="list_two"><td class="FormRowField">{$form.execution_failure_criteria.label}</td><td class="FormRowValue">{$form.execution_failure_criteria.html}</td></tr>
+		{/if}
+		<tr class="list_one"><td class="FormRowField">{$form.notification_failure_criteria.label}</td><td class="FormRowValue">{$form.notification_failure_criteria.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.dep_hostParents.label}</td><td class="FormRowValue">{$form.dep_hostParents.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.dep_hostChilds.label}</td><td class="FormRowValue">{$form.dep_hostChilds.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.dep_comment.label}</td><td class="FormRowValue">{$form.dep_comment.html}</td></tr>
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+{$form.hidden}
+</form>
+
diff --git a/www/include/configuration/configObject/host_dependency/formHostDependency.php b/www/include/configuration/configObject/host_dependency/formHostDependency.php
new file mode 100644
index 0000000000000000000000000000000000000000..312260be0f9c354553a778a06a5b11b5bd079ff2
--- /dev/null
+++ b/www/include/configuration/configObject/host_dependency/formHostDependency.php
@@ -0,0 +1,204 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Dependency
+	#
+	
+	$dep = array();
+	if (($o == "c" || $o == "w") && $dep_id)	{
+		
+		$res =& $pearDB->query("SELECT * FROM dependency WHERE dep_id = '".$dep_id."' LIMIT 1");
+		# Set base value
+		$dep = array_map("myDecode", $res->fetchRow());
+		# Set Notification Failure Criteria
+		$dep["notification_failure_criteria"] =& explode(',', $dep["notification_failure_criteria"]);
+		foreach ($dep["notification_failure_criteria"] as $key => $value)
+			$dep["notification_failure_criteria"][trim($value)] = 1;
+		# Set Execution Failure Criteria
+		$dep["execution_failure_criteria"] =& explode(',', $dep["execution_failure_criteria"]);
+		foreach ($dep["execution_failure_criteria"] as $key => $value)
+			$dep["execution_failure_criteria"][trim($value)] = 1;
+		# Set Host Parents
+		$res =& $pearDB->query("SELECT DISTINCT host_host_id FROM dependency_hostParent_relation WHERE dependency_dep_id = '".$dep_id."'");
+		for($i = 0; $res->fetchInto($hostP); $i++)
+			$dep["dep_hostParents"][$i] = $hostP["host_host_id"];
+		$res->free();
+		# Set Host Childs
+		$res =& $pearDB->query("SELECT DISTINCT host_host_id FROM dependency_hostChild_relation WHERE dependency_dep_id = '".$dep_id."'");
+		for($i = 0; $res->fetchInto($hostC); $i++)
+			$dep["dep_hostChilds"][$i] = $hostC["host_host_id"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Host comes from DB -> Store in $hosts Array
+	$hosts = array();
+	$res =& $pearDB->query("SELECT host_id, host_name FROM host WHERE host_register = '1' AND host_id IN (".$oreon->user->lcaHStr.") ORDER BY host_name");
+	while($res->fetchInto($host))
+		$hosts[$host["host_id"]] = $host["host_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsText2 	= array("size"=>"10");
+	$attrsAdvSelect = array("style" => "width: 250px; height: 150px;");
+	$attrsTextarea 	= array("rows"=>"3", "cols"=>"30");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["dep_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["dep_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["dep_view"]);
+
+	#
+	## Dependency basic information
+	#
+	$form->addElement('header', 'information', $lang['dep_infos']);
+	$form->addElement('text', 'dep_name', $lang["dep_name"], $attrsText);
+	$form->addElement('text', 'dep_description', $lang["dep_description"], $attrsText);
+	if ($oreon->user->get_version() == 2)	{
+		$tab = array();
+		$tab[] = &HTML_QuickForm::createElement('radio', 'inherits_parent', null, $lang['yes'], '1');
+		$tab[] = &HTML_QuickForm::createElement('radio', 'inherits_parent', null, $lang['no'], '0');
+		$form->addGroup($tab, 'inherits_parent', $lang["dep_inheritsP"], '&nbsp;');
+	}
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'o', '&nbsp;', 'Ok/Up');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'd', '&nbsp;', 'Down');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unreachable');
+	if ($oreon->user->get_version() == 2)
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'p', '&nbsp;', 'Pending');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'n', '&nbsp;', 'None');
+	$form->addGroup($tab, 'notification_failure_criteria', $lang["dep_notifFC"], '&nbsp;&nbsp;');
+	if ($oreon->user->get_version() == 2)	{
+		$tab = array();
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'o', '&nbsp;', 'Ok/Up');
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'd', '&nbsp;', 'Down');
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unreachable');
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'p', '&nbsp;', 'Pending');
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'n', '&nbsp;', 'None');
+		$form->addGroup($tab, 'execution_failure_criteria', $lang["dep_exeFC"], '&nbsp;&nbsp;');
+	}
+
+	$ams1 =& $form->addElement('advmultiselect', 'dep_hostParents', $lang['dep_hPar'], $hosts, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+    $ams1 =& $form->addElement('advmultiselect', 'dep_hostChilds', $lang['dep_hChi'], $hosts, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+	$form->addElement('textarea', 'dep_comment', $lang["dep_comment"], $attrsTextarea);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+
+	$form->addElement('hidden', 'dep_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('dep_name', $lang['ErrName'], 'required');
+	$form->addRule('dep_description', $lang['ErrRequired'], 'required');
+	$form->addRule('dep_hostParents', $lang['ErrRequired'], 'required');
+	$form->addRule('dep_hostChilds', $lang['ErrRequired'], 'required');
+	if ($oreon->user->get_version() == 1)
+		$form->addRule('notification_failure_criteria', $lang['ErrRequired'], 'required');
+	$form->registerRule('cycle', 'callback', 'testHostDependencyCycle');
+	$form->addRule('dep_hostChilds', $lang['ErrCycleDef'], 'cycle');
+	$form->registerRule('exist', 'callback', 'testHostDependencyExistence');
+	$form->addRule('dep_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Just watch a Dependency information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&dep_id=".$dep_id."'"));
+	    $form->setDefaults($dep);
+		$form->freeze();
+	}
+	# Modify a Dependency information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($dep);
+	}
+	# Add a Dependency information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	$tpl->assign("nagios", $oreon->user->get_version());
+
+	$valid = false;
+	if ($form->validate())	{
+		$depObj =& $form->getElement('dep_id');
+		if ($form->getSubmitValue("submitA"))
+			$depObj->setValue(insertHostDependencyInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateHostDependencyInDB($depObj->getValue("dep_id"));
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&dep_id=".$depObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once("listHostDependency.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->display("formHostDependency.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/host_dependency/hostDependency.php b/www/include/configuration/configObject/host_dependency/hostDependency.php
new file mode 100644
index 0000000000000000000000000000000000000000..0e6958c5aae853d3abc2d996ac0c7b56cdef0b38
--- /dev/null
+++ b/www/include/configuration/configObject/host_dependency/hostDependency.php
@@ -0,0 +1,47 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["dep_id"]) ? $cG = $_GET["dep_id"] : $cG = NULL;
+	isset($_POST["dep_id"]) ? $cP = $_POST["dep_id"] : $cP = NULL;
+	$cG ? $dep_id = $cG : $dep_id = $cP;
+	
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/host_dependency/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formHostDependency.php"); break; #Add a Dependency
+		case "w" : require_once($path."formHostDependency.php"); break; #Watch a Dependency
+		case "c" : require_once($path."formHostDependency.php"); break; #Modify a Dependency
+		case "m" : multipleHostDependencyInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listHostDependency.php"); break; #Duplicate n Dependencys
+		case "d" : deleteHostDependencyInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listHostDependency.php"); break; #Delete n Dependency
+		default : require_once($path."listHostDependency.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/host_dependency/listHostDependency.ihtml b/www/include/configuration/configObject/host_dependency/listHostDependency.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..7db74a21fdfa3aecc122ca34e392dff8107ed1e3
--- /dev/null
+++ b/www/include/configuration/configObject/host_dependency/listHostDependency.ihtml
@@ -0,0 +1,40 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_description}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_description}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter"></td>
+			<td class="ListColFooterRight" align="right" colpan="2"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+
+{$form.hidden}
\ No newline at end of file
diff --git a/www/include/configuration/configObject/host_dependency/listHostDependency.php b/www/include/configuration/configObject/host_dependency/listHostDependency.php
new file mode 100644
index 0000000000000000000000000000000000000000..93eff67b65c3b2447e5081bdeb874ed613692ed2
--- /dev/null
+++ b/www/include/configuration/configObject/host_dependency/listHostDependency.php
@@ -0,0 +1,97 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	isset($_GET["list"]) ? $list = $_GET["list"] : $list = NULL;
+	$rq = "SELECT COUNT(*) FROM dependency dep";
+	$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM dependency_hostParent_relation dhpr WHERE dhpr.dependency_dep_id = dep.dep_id AND dhpr.host_host_id IN (".$oreon->user->lcaHStr.")) > 0 AND (SELECT DISTINCT COUNT(*) FROM dependency_hostChild_relation dhpr WHERE dhpr.dependency_dep_id = dep.dep_id AND dhpr.host_host_id IN (".$oreon->user->lcaHStr.")) > 0";
+	if ($search)
+		$rq .= " AND dep_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'";
+	$res = & $pearDB->query($rq);
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_description", $lang['description']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Dependcy list
+	$rq = "SELECT dep_id, dep_name, dep_description FROM dependency dep";
+	$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM dependency_hostParent_relation dhpr WHERE dhpr.dependency_dep_id = dep.dep_id AND dhpr.host_host_id IN (".$oreon->user->lcaHStr.")) > 0 AND (SELECT DISTINCT COUNT(*) FROM dependency_hostChild_relation dhpr WHERE dhpr.dependency_dep_id = dep.dep_id AND dhpr.host_host_id IN (".$oreon->user->lcaHStr.")) > 0";
+	if ($search)
+		$rq .= " AND dep_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'";
+	$rq .= " LIMIT ".$num * $limit.", ".$limit;
+	$res =& $pearDB->query($rq);	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($dep); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$dep['dep_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&dep_id=".$dep['dep_id']."&o=w&search=".$search."&list=".$list."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&dep_id=".$dep['dep_id']."&o=c&search=".$search."&list=".$list."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&dep_id=".$dep['dep_id']."&o=d&select[".$dep['dep_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."&list=".$list."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$dep['dep_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$dep["dep_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&dep_id=".$dep['dep_id'],
+						"RowMenu_description"=>$dep["dep_description"],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listHostDependency.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/host_template_model/formHostTemplateModel.php b/www/include/configuration/configObject/host_template_model/formHostTemplateModel.php
new file mode 100644
index 0000000000000000000000000000000000000000..1d758eab903e8e72eeaa2c0a075b8679473bb56a
--- /dev/null
+++ b/www/include/configuration/configObject/host_template_model/formHostTemplateModel.php
@@ -0,0 +1,435 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	#
+	## Database retrieve information for Host
+	#
+	$host = array();
+	if (($o == "c" || $o == "w") && $host_id)	{
+		$res =& $pearDB->query("SELECT * FROM host, extended_host_information ehi WHERE host_id = '".$host_id."' AND ehi.host_host_id = host.host_id LIMIT 1");
+		# Set base value
+		if ($res->numRows())	{
+			$host = array_map("myDecode", $res->fetchRow());
+			# Set Host Notification Options
+			$tmp = explode(',', $host["host_notification_options"]);
+			foreach ($tmp as $key => $value)
+				$host["host_notifOpts"][trim($value)] = 1;
+			# Set Stalking Options
+			$tmp = explode(',', $host["host_stalking_options"]);
+			foreach ($tmp as $key => $value)
+				$host["host_stalOpts"][trim($value)] = 1;
+			$res->free();
+			# Set Contact Group
+			$res =& $pearDB->query("SELECT DISTINCT contactgroup_cg_id FROM contactgroup_host_relation WHERE host_host_id = '".$host_id."'");
+			for($i = 0; $res->fetchInto($notifCg); $i++)
+				$host["host_cgs"][$i] = $notifCg["contactgroup_cg_id"];
+			$res->free();
+			# Set Host Parents
+			$res =& $pearDB->query("SELECT DISTINCT host_parent_hp_id FROM host_hostparent_relation WHERE host_host_id = '".$host_id."'");
+			for($i = 0; $res->fetchInto($parent); $i++)
+				$host["host_parents"][$i] = $parent["host_parent_hp_id"];
+			$res->free();
+			# Set Service Templates Childs
+			$res =& $pearDB->query("SELECT DISTINCT service_service_id FROM host_service_relation WHERE host_host_id = '".$host_id."'");
+			for($i = 0; $res->fetchInto($svTpl); $i++)
+				$host["host_svTpls"][$i] = $svTpl["service_service_id"];
+			$res->free();
+			# Set City name
+			$res =& $pearDB->query("SELECT DISTINCT cny.country_id, cty.city_name FROM view_city cty, view_country cny WHERE cty.city_id = '".$host["city_id"]."' AND cny.country_id = '".$host["country_id"]."'");
+			$city = $res->fetchRow();
+			$host["city_name"] = $city["city_name"];
+			$host["country_id"] = $city["country_id"];
+			$res->free();
+		}
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Host Templates comes from DB -> Store in $hTpls Array
+	$hTpls = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT host_id, host_name, host_template_model_htm_id FROM host WHERE host_register = '0' AND host_id != '".$host_id."' ORDER BY host_name");
+	while($res->fetchInto($hTpl))	{
+		if (!$hTpl["host_name"])
+			$hTpl["host_name"] = getMyHostName($hTpl["host_template_model_htm_id"])."'";
+		$hTpls[$hTpl["host_id"]] = $hTpl["host_name"];
+	}
+	$res->free();
+	# Service Templates comes from DB -> Store in $svTpls Array
+	$svTpls = array();
+	$res =& $pearDB->query("SELECT service_id, service_description, service_template_model_stm_id FROM service WHERE service_register = '0' ORDER BY service_description");
+	while($res->fetchInto($svTpl))	{
+		if (!$svTpl["service_description"])
+			$svTpl["service_description"] = getMyServiceName($svTpl["service_template_model_stm_id"])."'";
+		$svTpls[$svTpl["service_id"]] = $svTpl["service_description"];
+	}
+	$res->free();
+	# Timeperiods comes from DB -> Store in $tps Array
+	$tps = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT tp_id, tp_name FROM timeperiod ORDER BY tp_name");
+	while($res->fetchInto($tp))
+		$tps[$tp["tp_id"]] = $tp["tp_name"];
+	$res->free();
+	# Check commands comes from DB -> Store in $checkCmds Array
+	$checkCmds = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT command_id, command_name FROM command WHERE command_type = '2' ORDER BY command_name");
+	while($res->fetchInto($checkCmd))
+		$checkCmds[$checkCmd["command_id"]] = $checkCmd["command_name"];
+	$res->free();
+	# Contact Groups comes from DB -> Store in $notifCcts Array
+	$notifCgs = array();
+	$res =& $pearDB->query("SELECT cg_id, cg_name FROM contactgroup ORDER BY cg_name");
+	while($res->fetchInto($notifCg))
+		$notifCgs[$notifCg["cg_id"]] = $notifCg["cg_name"];
+	$res->free();
+	# Host Parents comes from DB -> Store in $hostPs Array
+	/*$hostPs = array();
+	$res =& $pearDB->query("SELECT host_id, host_name, host_template_model_htm_id FROM host WHERE host_id != '".$host_id."' AND host_register = '1' ORDER BY host_name");
+	while($res->fetchInto($hostP))	{
+		if (!$hostP["host_name"])
+			$hostP["host_name"] = getMyHostName($hostP["host_template_model_htm_id"])."'";
+		$hostPs[$hostP["host_id"]] = $hostP["host_name"];
+	}
+	$res->free();*/
+	# Countries comes from DB -> Store in $countries Array
+	$countries = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT country_id, country_name FROM view_country ORDER BY country_name");
+	while($res->fetchInto($country))
+		$countries[$country["country_id"]] = $country["country_name"];
+	$res->free();
+	# Deletion Policy definition comes from DB -> Store in $ppols Array
+	$ppols = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT purge_policy_id, purge_policy_name FROM purge_policy ORDER BY purge_policy_name");
+	while($res->fetchInto($ppol))
+		$ppols[$ppol["purge_policy_id"]] = $ppol["purge_policy_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsText2		= array("size"=>"6");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["htm_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["htm_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["htm_view"]);
+
+	## Sort 1 - Host Template Configuration
+	#
+	## Host basic information
+	#
+	$form->addElement('header', 'information', $lang['h_infos']);
+	$form->addElement('text', 'host_name', $lang["h_name"], $attrsText);
+	$form->addElement('text', 'host_alias', $lang["h_alias"], $attrsText);
+	$form->addElement('text', 'host_address', $lang["h_address"], $attrsText);
+	$form->addElement('select', 'host_snmp_version', $lang['h_snmpVer'], array(0=>null, 1=>"1", 2=>"2c", 3=>"3"));
+	$form->addElement('text', 'host_snmp_community', $lang['h_snmpCom'], $attrsText);
+
+	$form->addElement('select', 'host_template_model_htm_id', $lang['htm_template'], $hTpls);
+	$form->addElement('static', 'tplText', $lang['htm_templateText']);
+
+	#
+	## Check information
+	#
+	$form->addElement('header', 'check', $lang['h_head_state']);
+	#Nagios 1
+	if ($oreon->user->get_version() == 1)	{
+	$hostCE[] = &HTML_QuickForm::createElement('radio', 'host_checks_enabled', null, $lang["yes"], '1');
+	$hostCE[] = &HTML_QuickForm::createElement('radio', 'host_checks_enabled', null, $lang["no"], '0');
+	$hostCE[] = &HTML_QuickForm::createElement('radio', 'host_checks_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($hostCE, 'host_checks_enabled', $lang['h_checksEnabled'], '&nbsp;');
+	$form->setDefaults(array('host_checks_enabled' => '2'));
+	}
+	$form->addElement('select', 'command_command_id', $lang['h_checkCmd'], $checkCmds);
+	$form->addElement('text', 'host_max_check_attempts', $lang['h_checkMca'], $attrsText2);
+
+	$hostEHE[] = &HTML_QuickForm::createElement('radio', 'host_event_handler_enabled', null, $lang["yes"], '1');
+	$hostEHE[] = &HTML_QuickForm::createElement('radio', 'host_event_handler_enabled', null, $lang["no"], '0');
+	$hostEHE[] = &HTML_QuickForm::createElement('radio', 'host_event_handler_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($hostEHE, 'host_event_handler_enabled', $lang['h_eventHandlerE'], '&nbsp;');
+	$form->setDefaults(array('host_event_handler_enabled' => '2'));
+	$form->addElement('select', 'command_command_id2', $lang['h_eventHandler'], $checkCmds);
+
+	# Nagios 2
+	if ($oreon->user->get_version() == 2)	{
+	$form->addElement('text', 'host_check_interval', $lang['h_checkInterval'], $attrsText2);
+
+	$hostACE[] = &HTML_QuickForm::createElement('radio', 'host_active_checks_enabled', null, $lang["yes"], '1');
+	$hostACE[] = &HTML_QuickForm::createElement('radio', 'host_active_checks_enabled', null, $lang["no"], '0');
+	$hostACE[] = &HTML_QuickForm::createElement('radio', 'host_active_checks_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($hostACE, 'host_active_checks_enabled', $lang['h_activeCE'], '&nbsp;');
+	$form->setDefaults(array('host_active_checks_enabled' => '2'));
+
+	$hostPCE[] = &HTML_QuickForm::createElement('radio', 'host_passive_checks_enabled', null, $lang["yes"], '1');
+	$hostPCE[] = &HTML_QuickForm::createElement('radio', 'host_passive_checks_enabled', null, $lang["no"], '0');
+	$hostPCE[] = &HTML_QuickForm::createElement('radio', 'host_passive_checks_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($hostPCE, 'host_passive_checks_enabled', $lang['h_passiveCE'], '&nbsp;');
+	$form->setDefaults(array('host_passive_checks_enabled' => '2'));
+
+	$form->addElement('select', 'timeperiod_tp_id', $lang['h_checkPeriod'], $tps);
+	}
+
+	##
+	## Notification informations
+	##
+	$form->addElement('header', 'notification', $lang['h_head_notif']);
+	$hostNE[] = &HTML_QuickForm::createElement('radio', 'host_notifications_enabled', null, $lang["yes"], '1');
+	$hostNE[] = &HTML_QuickForm::createElement('radio', 'host_notifications_enabled', null, $lang["no"], '0');
+	$hostNE[] = &HTML_QuickForm::createElement('radio', 'host_notifications_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($hostNE, 'host_notifications_enabled', $lang['h_notifEnabled'], '&nbsp;');
+	$form->setDefaults(array('host_notifications_enabled' => '2'));
+	#Nagios 2
+	if ($oreon->user->get_version() == 2)	{
+    $ams3 =& $form->addElement('advmultiselect', 'host_cgs', $lang['h_CgMembers'], $notifCgs, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+	}
+
+	$form->addElement('text', 'host_notification_interval', $lang['h_notifInt'], $attrsText2);
+	$form->addElement('select', 'timeperiod_tp_id2', $lang['h_notifTp'], $tps);
+
+ 	$hostNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'd', '&nbsp;', 'Down');
+	$hostNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unreachable');
+	$hostNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'r', '&nbsp;', 'Recovery');
+	if ($oreon->user->get_version() == 2)
+		$hostNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'f', '&nbsp;', 'Flapping');
+	$form->addGroup($hostNotifOpt, 'host_notifOpts', $lang['h_notifOpts'], '&nbsp;&nbsp;');
+
+ 	$hostStalOpt[] = &HTML_QuickForm::createElement('checkbox', 'o', '&nbsp;', 'Ok/Up');
+	$hostStalOpt[] = &HTML_QuickForm::createElement('checkbox', 'd', '&nbsp;', 'Down');
+	$hostStalOpt[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unreachable');
+	$form->addGroup($hostStalOpt, 'host_stalOpts', $lang['h_stalOpts'], '&nbsp;&nbsp;');
+
+	#
+	## Further informations
+	#
+	$form->addElement('header', 'furtherInfos', $lang['further_infos']);
+	$form->addElement('textarea', 'host_comment', $lang["cmt_comment"], $attrsTextarea);
+
+	#
+	## Sort 2 - Host Relations
+	#
+	if ($o == "a")
+		$form->addElement('header', 'title2', $lang["h_Links_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title2', $lang["h_Links_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title2', $lang["h_Links_view"]);
+
+	$form->addElement('header', 'links', $lang['h_head_links']);
+
+    $ams3 =& $form->addElement('advmultiselect', 'host_svTpls', $lang['htm_childs'], $svTpls, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+
+
+
+	#
+	## Sort 3 - Data treatment
+	#
+	if ($o == "a")
+		$form->addElement('header', 'title3', $lang["h_add_treat"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title3', $lang["h_modify_treat"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title3', $lang["h_view_treat"]);
+
+	$form->addElement('header', 'treatment', $lang['h_head_treat']);
+	# Nagios 2
+	if ($oreon->user->get_version() == 2)	{
+	$hostOOH[] = &HTML_QuickForm::createElement('radio', 'host_obsess_over_host', null, $lang["yes"], '1');
+	$hostOOH[] = &HTML_QuickForm::createElement('radio', 'host_obsess_over_host', null, $lang["no"], '0');
+	$hostOOH[] = &HTML_QuickForm::createElement('radio', 'host_obsess_over_host', null, $lang["nothing"], '2');
+	$form->addGroup($hostOOH, 'host_obsess_over_host', $lang['h_ObsessOH'], '&nbsp;');
+	$form->setDefaults(array('host_obsess_over_host' => '2'));
+
+	$hostCF[] = &HTML_QuickForm::createElement('radio', 'host_check_freshness', null, $lang["yes"], '1');
+	$hostCF[] = &HTML_QuickForm::createElement('radio', 'host_check_freshness', null, $lang["no"], '0');
+	$hostCF[] = &HTML_QuickForm::createElement('radio', 'host_check_freshness', null, $lang["nothing"], '2');
+	$form->addGroup($hostCF, 'host_check_freshness', $lang['h_checkFreshness'], '&nbsp;');
+	$form->setDefaults(array('host_check_freshness' => '2'));
+	}
+	$hostFDE[] = &HTML_QuickForm::createElement('radio', 'host_flap_detection_enabled', null, $lang["yes"], '1');
+	$hostFDE[] = &HTML_QuickForm::createElement('radio', 'host_flap_detection_enabled', null, $lang["no"], '0');
+	$hostFDE[] = &HTML_QuickForm::createElement('radio', 'host_flap_detection_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($hostFDE, 'host_flap_detection_enabled', $lang['h_flapDetect'], '&nbsp;');
+	$form->setDefaults(array('host_flap_detection_enabled' => '2'));
+	# Nagios 2
+	if ($oreon->user->get_version() == 2)	{
+		$form->addElement('text', 'host_freshness_threshold', $lang['h_FreshnessThreshold'], $attrsText2);
+	}
+	$form->addElement('text', 'host_low_flap_threshold', $lang['h_lowFT'], $attrsText2);
+	$form->addElement('text', 'host_high_flap_threshold', $lang['h_highFT'], $attrsText2);
+
+	$hostPPD[] = &HTML_QuickForm::createElement('radio', 'host_process_perf_data', null, $lang["yes"], '1');
+	$hostPPD[] = &HTML_QuickForm::createElement('radio', 'host_process_perf_data', null, $lang["no"], '0');
+	$hostPPD[] = &HTML_QuickForm::createElement('radio', 'host_process_perf_data', null, $lang["nothing"], '2');
+	$form->addGroup($hostPPD, 'host_process_perf_data', $lang['h_processPD'], '&nbsp;');
+	$form->setDefaults(array('host_process_perf_data' => '2'));
+
+	$hostRSI[] = &HTML_QuickForm::createElement('radio', 'host_retain_status_information', null, $lang["yes"], '1');
+	$hostRSI[] = &HTML_QuickForm::createElement('radio', 'host_retain_status_information', null, $lang["no"], '0');
+	$hostRSI[] = &HTML_QuickForm::createElement('radio', 'host_retain_status_information', null, $lang["nothing"], '2');
+	$form->addGroup($hostRSI, 'host_retain_status_information', $lang['h_retainSI'], '&nbsp;');
+	$form->setDefaults(array('host_retain_status_information' => '2'));
+
+	$hostRNI[] = &HTML_QuickForm::createElement('radio', 'host_retain_nonstatus_information', null, $lang["yes"], '1');
+	$hostRNI[] = &HTML_QuickForm::createElement('radio', 'host_retain_nonstatus_information', null, $lang["no"], '0');
+	$hostRNI[] = &HTML_QuickForm::createElement('radio', 'host_retain_nonstatus_information', null, $lang["nothing"], '2');
+	$form->addGroup($hostRNI, 'host_retain_nonstatus_information', $lang['h_retainNI'], '&nbsp;');
+	$form->setDefaults(array('host_retain_nonstatus_information' => '2'));
+
+	if ($oreon->optGen["perfparse_installed"])	{
+		$form->addElement('header', 'purge_policy', $lang["mod_purgePolicy"]);
+		$form->addElement('select', 'purge_policy_id', $lang["mod_purgePolicy_name"], $ppols);
+	}
+	
+	#
+	## Sort 4 - Extended Infos
+	#
+	if ($o == "a")
+		$form->addElement('header', 'title4', $lang["h_ExtInf_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title4', $lang["h_ExtInf_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title4', $lang["h_ExtInf_view"]);
+
+	$form->addElement('header', 'nagios', $lang['h_nagios']);
+	if ($oreon->user->get_version() == 2)
+		$form->addElement('text', 'ehi_notes', $lang['h_notes'], $attrsText);
+	$form->addElement('text', 'ehi_notes_url', $lang['h_notesUrl'], $attrsText);
+	if ($oreon->user->get_version() == 2)
+		$form->addElement('text', 'ehi_action_url', $lang['h_actionUrl'], $attrsText);
+	$form->addElement('text', 'ehi_icon_image', $lang['h_iconImg'], $attrsText);
+	$form->addElement('text', 'ehi_icon_image_alt', $lang['h_iconImgAlt'], $attrsText);
+	$form->addElement('text', 'ehi_vrml_image', $lang['h_vrmlImg'], $attrsText);
+	$form->addElement('text', 'ehi_statusmap_image', $lang['h_nagStatImg'], $attrsText);
+	$form->addElement('text', 'ehi_2d_coords', $lang['h_nag2dCoords'], $attrsText2);
+	$form->addElement('text', 'ehi_3d_coords', $lang['h_nag3dCoords'], $attrsText2);
+
+	$form->addElement('header', 'oreon', $lang['h_oreon']);
+	$form->addElement('select', 'country_id', $lang['h_country'], $countries);
+	$form->addElement('text', 'city_name', $lang['h_city'], array("id"=>"city_name", "size"=>"35", "autocomplete"=>"off"));
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action' => '1'));
+
+	$form->addElement('hidden', 'host_id');
+	$reg =& $form->addElement('hidden', 'host_register');
+	$reg->setValue("0");
+	$act =& $form->addElement('hidden', 'host_activate');
+	$act->setValue("1");
+	$assoc =& $form->addElement('hidden', 'dupSvTplAssoc');
+	$assoc->setValue("0");
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	function myReplace()	{
+		global $form;
+		return (str_replace(" ", "_", $form->getSubmitValue("host_name")));
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('host_name', 'myReplace');
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path2, $tpl);
+
+	# Just watch a host information
+	if ($o == "w")	{
+		if (!$min)
+			$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&host_id=".$host_id."'"));
+	    $form->setDefaults($host);
+		$form->freeze();
+	}
+	# Modify a host information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($host);
+	}
+	# Add a host information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	$tpl->assign('msg', array ("nagios"=>$oreon->user->get_version(), "tpl"=>1, "min"=>$min, "perfparse"=>$oreon->optGen["perfparse_installed"]));
+	$tpl->assign('min', $min);
+	$tpl->assign("sort1", $lang['h_conf']);
+	$tpl->assign("sort2", $lang['h_head_links']);
+	$tpl->assign("sort3", $lang['h_head_treat']);
+	$tpl->assign("sort4", $lang['h_extInf']);	
+	$tpl->assign("initJS", "<script type='text/javascript'>
+							window.onload = function () {
+							init();
+							initAutoComplete('Form','city_name','sub');
+							};</script>");
+	$tpl->assign('time_unit', " * ".$oreon->Nagioscfg["interval_length"]." ".$lang["time_sec"]);
+
+	$valid = false;
+	if ($form->validate())	{
+		$hostObj =& $form->getElement('host_id');
+		if ($form->getSubmitValue("submitA"))
+			$hostObj->setValue(insertHostInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateHostInDB($hostObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&host_id=".$hostObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listHostTemplateModel.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->display("formHost.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/host_template_model/hostTemplateModel.php b/www/include/configuration/configObject/host_template_model/hostTemplateModel.php
new file mode 100644
index 0000000000000000000000000000000000000000..4e920ff9dfc772b0e9a124fc372d5a92504f3cef
--- /dev/null
+++ b/www/include/configuration/configObject/host_template_model/hostTemplateModel.php
@@ -0,0 +1,50 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["host_id"]) ? $hG = $_GET["host_id"] : $hG = NULL;
+	isset($_POST["host_id"]) ? $hP = $_POST["host_id"] : $hP = NULL;
+	$hG ? $host_id = $hG : $host_id = $hP;
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/host_template_model/";
+	$path2 = "./include/configuration/configObject/host/";
+	
+	#PHP functions
+	require_once $path2."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formHostTemplateModel.php"); break; #Add a host template model
+		case "w" : require_once($path."formHostTemplateModel.php"); break; #Watch a host template model
+		case "c" : require_once($path."formHostTemplateModel.php"); break; #Modify a host template model
+		case "s" : enableHostInDB($host_id); require_once($path."listHostTemplateModel.php"); break; #Activate a host template model
+		case "u" : disableHostInDB($host_id); require_once($path."listHostTemplateModel.php"); break; #Desactivate a host template model
+		case "m" : multipleHostInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listHostTemplateModel.php"); break; #Duplicate n host template model
+		case "d" : deleteHostInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listHostTemplateModel.php"); break; #Delete n host template models
+		default : require_once($path."listHostTemplateModel.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/host_template_model/listHostTemplateModel.ihtml b/www/include/configuration/configObject/host_template_model/listHostTemplateModel.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..7172d0849ccba1dff8f5af1fe3b853a1503fe4fa
--- /dev/null
+++ b/www/include/configuration/configObject/host_template_model/listHostTemplateModel.ihtml
@@ -0,0 +1,47 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_svChilds}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_parent}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListCol2Left"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_svChilds}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_parent}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight" align="right">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="4"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+
+{$form.hidden}
+</form>
diff --git a/www/include/configuration/configObject/host_template_model/listHostTemplateModel.php b/www/include/configuration/configObject/host_template_model/listHostTemplateModel.php
new file mode 100644
index 0000000000000000000000000000000000000000..edada3e3fdb3d1e2bb13ade74bfc254c5328c294
--- /dev/null
+++ b/www/include/configuration/configObject/host_template_model/listHostTemplateModel.php
@@ -0,0 +1,107 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM host WHERE host_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' AND host_register = '0'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM host WHERE host_register = '0'");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['htm']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_svChilds", $lang['htm_childs']);
+	$tpl->assign("headerMenu_parent", $lang['htm_parent']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Host Template list
+	if ($search)
+		$rq = "SELECT @nbr:=(SELECT COUNT(service_service_id) FROM host_service_relation hsr WHERE hsr.host_host_id = host_id) AS nbr, host_id, host_name, host_alias, host_activate, host_template_model_htm_id FROM host WHERE host_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' AND host_register = '0' ORDER BY host_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT @nbr:=(SELECT COUNT(service_service_id) FROM host_service_relation hsr WHERE hsr.host_host_id = host_id) AS nbr, host_id, host_name, host_alias, host_activate, host_template_model_htm_id FROM host WHERE host_register = '0' ORDER BY host_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($host); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$host['host_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&host_id=".$host['host_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&host_id=".$host['host_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&host_id=".$host['host_id']."&o=d&select[".$host['host_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($host["host_activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&host_id=".$host['host_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&host_id=".$host['host_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$host['host_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		# If the name of our Host Model is in the Template definition, we have to catch it, whatever the level of it :-)
+		if (!$host["host_name"])
+			$host["host_name"] = getMyHostName($host["host_template_model_htm_id"]);
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$host["host_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&host_id=".$host['host_id'],
+						"RowMenu_desc"=>$host["host_alias"],
+						"RowMenu_svChilds"=>$host["nbr"],
+						"RowMenu_parent"=>$host["host_template_model_htm_id"] ? $lang["yes"] : $lang["no"],
+						"RowMenu_status"=>$host["host_activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listHostTemplateModel.ihtml");
+	
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/hostgroup/DB-Func.php b/www/include/configuration/configObject/hostgroup/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..b9ad42cac53e1956587d74b0c4d58e90e34306aa
--- /dev/null
+++ b/www/include/configuration/configObject/hostgroup/DB-Func.php
@@ -0,0 +1,235 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset ($oreon))
+		exit ();
+
+	function testHostGroupExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('hg_id');
+		$res =& $pearDB->query("SELECT hg_name, hg_id FROM hostgroup WHERE hg_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$hg =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $hg["hg_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $hg["hg_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+
+	function enableHostGroupInDB ($hg_id = null)	{
+		if (!$hg_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE hostgroup SET hg_activate = '1' WHERE hg_id = '".$hg_id."'");
+	}
+	
+	function disableHostGroupInDB ($hg_id = null)	{
+		if (!$hg_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE hostgroup SET hg_activate = '0' WHERE hg_id = '".$hg_id."'");
+	}
+	
+	function deleteHostGroupInDB ($hostGroups = array())	{
+		global $pearDB;
+		foreach($hostGroups as $key=>$value)	{
+			$rq = "SELECT @nbr := (SELECT COUNT( * ) FROM host_service_relation WHERE service_service_id = hsr.service_service_id GROUP BY service_service_id ) AS nbr, hsr.service_service_id FROM host_service_relation hsr WHERE hsr.hostgroup_hg_id = '".$key."'";
+			$res = & $pearDB->query($rq);
+			while ($res->fetchInto($row))
+				if ($row["nbr"] == 1)
+					$pearDB->query("DELETE FROM service WHERE service_id = '".$row["service_service_id"]."'");
+			$pearDB->query("DELETE FROM hostgroup WHERE hg_id = '".$key."'");
+		}
+	}
+	
+	function multipleHostGroupInDB ($hostGroups = array(), $nbrDup = array())	{
+		global $pearDB;
+		global $oreon;
+		foreach($hostGroups as $key=>$value)	{
+			$res =& $pearDB->query("SELECT * FROM hostgroup WHERE hg_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["hg_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = NULL;
+				$rq = NULL;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "hg_name" ? ($hg_name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testHostGroupExistence($hg_name))	{
+					$val ? $rq = "INSERT INTO hostgroup VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(hg_id) FROM hostgroup");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(hg_id)"]))	{
+						# Update LCA
+						$oreon->user->lcaHostGroup[$maxId["MAX(hg_id)"]] = $hg_name;
+						$oreon->user->lcaHGStr != '\'\''? $oreon->user->lcaHGStr .= ",".$maxId["MAX(hg_id)"] : $oreon->user->lcaHGStr = $maxId["MAX(hg_id)"];
+						$oreon->user->lcaHGStrName != '\'\''? $oreon->user->lcaHGStrName .= ",".$hg_name : $oreon->user->lcaHGStrName = $hg_name;
+						$res1 =& $pearDB->query("SELECT contactgroup_cg_id FROM contactgroup_contact_relation WHERE contact_contact_id = '".$oreon->user->get_id()."'");
+						while($res1->fetchInto($contactGroup))	{
+						 	$res2 =& $pearDB->query("SELECT lca_define_lca_id FROM lca_define_contactgroup_relation ldcgr WHERE ldcgr.contactgroup_cg_id = '".$contactGroup["contactgroup_cg_id"]."'");	
+							while ($res2->fetchInto($lca))	{
+								$rq = "INSERT INTO lca_define_hostgroup_relation ";
+								$rq .= "(lca_define_lca_id, hostgroup_hg_id) ";
+								$rq .= "VALUES ";
+								$rq .= "('".$lca["lca_define_lca_id"]."', '".$maxId["MAX(hg_id)"]."')";
+								$pearDB->query($rq);
+							}
+						}
+						#
+						$res =& $pearDB->query("SELECT DISTINCT hgr.host_host_id FROM hostgroup_relation hgr WHERE hgr.hostgroup_hg_id = '".$key."'");
+						while($res->fetchInto($host))
+							$pearDB->query("INSERT INTO hostgroup_relation VALUES ('', '".$maxId["MAX(hg_id)"]."', '".$host["host_host_id"]."')");
+						$res =& $pearDB->query("SELECT DISTINCT cghgr.contactgroup_cg_id FROM contactgroup_hostgroup_relation cghgr WHERE cghgr.hostgroup_hg_id = '".$key."'");
+						while($res->fetchInto($cg))
+							$pearDB->query("INSERT INTO contactgroup_hostgroup_relation VALUES ('', '".$cg["contactgroup_cg_id"]."', '".$maxId["MAX(hg_id)"]."')");
+					}
+				}
+			}
+		}
+	}
+		
+	function insertHostGroupInDB ($ret = array())	{
+		$hg_id = insertHostGroup($ret);
+		updateHostGroupHosts($hg_id, $ret);
+		updateHostGroupContactGroups($hg_id, $ret);
+		return $hg_id;
+	}
+	
+	function updateHostGroupInDB ($hg_id = NULL)	{
+		if (!$hg_id) return;
+		updateHostGroup($hg_id);
+		updateHostGroupHosts($hg_id);
+		updateHostGroupContactGroups($hg_id);
+	}
+		
+	function insertHostGroup($ret = array())	{
+		global $form;
+		global $pearDB;
+		global $oreon;
+		if (!count($ret))
+		$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO hostgroup ";
+		$rq .= "(hg_name, hg_alias, `country_id`, `city_id`, hg_comment, hg_activate) ";
+		$rq .= "VALUES (";
+		isset($ret["hg_name"]) && $ret["hg_name"] ? $rq .= "'".htmlentities($ret["hg_name"], ENT_QUOTES)."', " : $rq .= "NULL,";
+		isset($ret["hg_alias"]) && $ret["hg_alias"] ? $rq .= "'".htmlentities($ret["hg_alias"], ENT_QUOTES)."', " : $rq .= "NULL,";
+		isset($ret["country_id"]) && $ret["country_id"] != NULL ? $rq .= "'".$ret["country_id"]."', ": $rq .= "NULL, ";
+		if (isset($ret["city_name"]) && $ret["city_name"])	{
+			$res =& $pearDB->query("SELECT city_id FROM view_city WHERE city_name = '".$ret["city_name"]."' LIMIT 1");
+			$city =& $res->fetchRow();
+			isset($city["city_id"]) ? $rq .= "'".$city["city_id"]."', ": $rq .= "NULL, ";
+		}	
+		else
+			$rq .= "NULL, ";
+		isset($ret["hg_comment"]) && $ret["hg_comment"] ? $rq .= "'".htmlentities($ret["hg_comment"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["hg_activate"]["hg_activate"]) && $ret["hg_activate"]["hg_activate"] ? $rq .= "'".$ret["hg_activate"]["hg_activate"]."'" : $rq .= "'0'";
+		$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(hg_id) FROM hostgroup");
+		$hg_id = $res->fetchRow();
+		# Update LCA
+		$oreon->user->lcaHostGroup[$hg_id["MAX(hg_id)"]] = $ret["hg_name"];
+		$oreon->user->lcaHGStr != '\'\''? $oreon->user->lcaHGStr .= ",".$hg_id["MAX(hg_id)"] : $oreon->user->lcaHGStr = $hg_id["MAX(hg_id)"];
+		$oreon->user->lcaHGStrName != '\'\''? $oreon->user->lcaHGStrName .= ",".$ret["hg_name"] : $oreon->user->lcaHGStrName = $ret["hg_name"];
+		$res1 =& $pearDB->query("SELECT contactgroup_cg_id FROM contactgroup_contact_relation WHERE contact_contact_id = '".$oreon->user->get_id()."'");
+		while($res1->fetchInto($contactGroup))	{
+		 	$res2 =& $pearDB->query("SELECT lca_define_lca_id FROM lca_define_contactgroup_relation ldcgr WHERE ldcgr.contactgroup_cg_id = '".$contactGroup["contactgroup_cg_id"]."'");	
+			while ($res2->fetchInto($lca))	{
+				$rq = "INSERT INTO lca_define_hostgroup_relation ";
+				$rq .= "(lca_define_lca_id, hostgroup_hg_id) ";
+				$rq .= "VALUES ";
+				$rq .= "('".$lca["lca_define_lca_id"]."', '".$hg_id["MAX(hg_id)"]."')";
+				$pearDB->query($rq);
+			}
+		}
+		#
+		return ($hg_id["MAX(hg_id)"]);
+	}
+	
+	function updateHostGroup($hg_id)	{
+		if (!$hg_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE hostgroup SET ";
+		isset($ret["hg_name"]) && $ret["hg_name"] ? $rq .= "hg_name = '".htmlentities($ret["hg_name"], ENT_QUOTES)."', " : "hg_name = NULL,";
+		isset($ret["hg_alias"]) && $ret["hg_alias"] ? $rq .= "hg_alias = '".htmlentities($ret["hg_alias"], ENT_QUOTES)."', " : "hg_alias = NULL,";
+		isset($ret["country_id"]) && $ret["country_id"] != NULL ? $rq .= "country_id = '".$ret["country_id"]."', ": $rq .= "country_id = NULL, ";
+		$rq .= "city_id = ";
+		if (isset($ret["city_name"]) && $ret["city_name"])	{
+			$res =& $pearDB->query("SELECT city_id FROM view_city WHERE city_name = '".$ret["city_name"]."' LIMIT 1");
+			$city =& $res->fetchRow();
+			isset($city["city_id"]) ? $rq .= "'".$city["city_id"]."', ": $rq .= "NULL, ";
+		}	
+		else
+			$rq .= "NULL, ";
+		isset($ret["hg_comment"]) && $ret["hg_comment"] ? $rq .= "hg_comment = '".htmlentities($ret["hg_comment"], ENT_QUOTES)."', " : $rq .= "hg_comment = NULL, ";
+		isset($ret["hg_activate"]["hg_activate"]) && $ret["hg_activate"]["hg_activate"] ? $rq .= "hg_activate = '".$ret["hg_activate"]["hg_activate"]."' " : $rq .= "hg_activate = '0' ";
+		$rq .= "WHERE hg_id = '".$hg_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function updateHostGroupHosts($hg_id, $ret = array())	{
+		if (!$hg_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM hostgroup_relation ";
+		$rq .= "WHERE hostgroup_hg_id = '".$hg_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["hg_hosts"]))
+			$ret = $ret["hg_hosts"];
+		else
+			$ret = $form->getSubmitValue("hg_hosts");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO hostgroup_relation ";
+			$rq .= "(hostgroup_hg_id, host_host_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$hg_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateHostGroupContactGroups($hg_id, $ret = array())	{
+		if (!$hg_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM contactgroup_hostgroup_relation ";
+		$rq .= "WHERE hostgroup_hg_id = '".$hg_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["hg_cgs"]))
+			$ret = $ret["hg_cgs"];
+		else
+			$ret = $form->getSubmitValue("hg_cgs");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO contactgroup_hostgroup_relation ";
+			$rq .= "(contactgroup_cg_id, hostgroup_hg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$ret[$i]."', '".$hg_id."')";
+			$pearDB->query($rq);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/hostgroup/formHostGroup.ihtml b/www/include/configuration/configObject/hostgroup/formHostGroup.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..22b59c9110135e4900cd5e74b07240783c4f09a3
--- /dev/null
+++ b/www/include/configuration/configObject/hostgroup/formHostGroup.ihtml
@@ -0,0 +1,40 @@
+<script type="text/javascript" src="./include/common/javascript/autocomplete-3-2.js"></script>
+
+{$initJS}
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/clients.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/clipboard.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.hg_name.label}</td><td class="FormRowValue">{$form.hg_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.hg_alias.label}</td><td class="FormRowValue">{$form.hg_alias.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.country_id.label}</td><td class="FormRowValue">{$form.country_id.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.city_name.label}</td><td class="FormRowValue">{$form.city_name.html}</td></tr>
+			 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/server_client.gif'>&nbsp;&nbsp;{$form.header.relation}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.hg_hosts.label}</td><td class="FormRowValue"><p  class="oreonbutton">{$form.hg_hosts.html}</p></td></tr>
+		
+		{if $nagios == 1}
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/businessmen.gif'>&nbsp;&nbsp;{$form.header.notification}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.hg_cgs.label}</td><td class="FormRowValue"><p  class="oreonbutton">{$form.hg_cgs.html}</p></td></tr>
+	 	{/if}
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/cookies.gif'>&nbsp;&nbsp;{$form.header.furtherInfos}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.hg_activate.label}</td><td class="FormRowValue">{$form.hg_activate.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.hg_comment.label}</td><td class="FormRowValue">{$form.hg_comment.html}</td></tr>
+		
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
diff --git a/www/include/configuration/configObject/hostgroup/formHostGroup.php b/www/include/configuration/configObject/hostgroup/formHostGroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..e5cf6a869dcf35e4cd474cada994c158c22dde64
--- /dev/null
+++ b/www/include/configuration/configObject/hostgroup/formHostGroup.php
@@ -0,0 +1,216 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for HostGroup
+	#
+	$hg = array();
+	if (($o == "c" || $o == "w") && $hg_id)	{	
+		$res =& $pearDB->query("SELECT * FROM hostgroup WHERE hg_id = '".$hg_id."' AND hg_id IN (".$oreon->user->lcaHGStr.") LIMIT 1");
+		# Set base value
+		$hg = array_map("myDecode", $res->fetchRow());
+		# Set HostGroup Childs
+		$res =& $pearDB->query("SELECT DISTINCT host_host_id FROM hostgroup_relation WHERE hostgroup_hg_id = '".$hg_id."'");
+		for($i = 0; $res->fetchInto($hosts); $i++)
+			$hg["hg_hosts"][$i] = $hosts["host_host_id"];
+		$res->free();
+		# Nagios 1 - Set Contact Group Childs
+		$res =& $pearDB->query("SELECT DISTINCT contactgroup_cg_id FROM contactgroup_hostgroup_relation WHERE hostgroup_hg_id = '".$hg_id."'");
+		for($i = 0; $res->fetchInto($cgs); $i++)
+			$hg["hg_cgs"][$i] = $cgs["contactgroup_cg_id"];
+		$res->free();
+		# Set City name
+		$res =& $pearDB->query("SELECT DISTINCT cny.country_id, cty.city_name FROM view_city cty, view_country cny WHERE cty.city_id = '".$hg["city_id"]."' AND cny.country_id = '".$hg["country_id"]."'");
+		$city = $res->fetchRow();
+		$hg["city_name"] = $city["city_name"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Hosts comes from DB -> Store in $hosts Array
+	$hosts = array();
+	$res =& $pearDB->query("SELECT host_id, host_name FROM host WHERE host_id IN (".$oreon->user->lcaHStr.") AND host_register = '1' ORDER BY host_name");
+	while($res->fetchInto($host))
+		$hosts[$host["host_id"]] = $host["host_name"];
+	$res->free();
+	# Contact Groups comes from DB -> Store in $cgs Array
+	$cgs = array();
+	$res =& $pearDB->query("SELECT cg_id, cg_name FROM contactgroup ORDER BY cg_name");
+	while($res->fetchInto($cg))
+		$cgs[$cg["cg_id"]] = $cg["cg_name"];
+	$res->free();
+	# Countries comes from DB -> Store in $countries Array
+	$countries = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT country_id, country_name FROM view_country ORDER BY country_name");
+	while($res->fetchInto($country))
+		$countries[$country["country_id"]] = $country["country_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["hg_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["hg_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["hg_view"]);
+
+	#
+	## Contact basic information
+	#
+	$form->addElement('header', 'information', $lang['hg_infos']);
+	$form->addElement('text', 'hg_name', $lang["hg_name"], $attrsText);
+	$form->addElement('text', 'hg_alias', $lang["hg_alias"], $attrsText);
+	$form->addElement('select', 'country_id', $lang['h_country'], $countries);
+	$form->addElement('text', 'city_name', $lang['h_city'], array("id"=>"city_name", "size"=>"35", "autocomplete"=>"off"));
+	
+	##
+	## Hosts Selection
+	##
+	$form->addElement('header', 'relation', $lang['hg_links']);
+	
+    $ams1 =& $form->addElement('advmultiselect', 'hg_hosts', $lang['hg_HostMembers'], $hosts, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+	
+	##
+	## Contact Groups Selection
+	##
+	$form->addElement('header', 'notification', $lang['hg_notif']);
+	
+    $ams1 =& $form->addElement('advmultiselect', 'hg_cgs', $lang['hg_CgMembers'], $cgs, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+	
+	#
+	## Further informations
+	#
+	$form->addElement('header', 'furtherInfos', $lang['further_infos']);
+	$hgActivation[] = &HTML_QuickForm::createElement('radio', 'hg_activate', null, $lang["enable"], '1');
+	$hgActivation[] = &HTML_QuickForm::createElement('radio', 'hg_activate', null, $lang["disable"], '0');
+	$form->addGroup($hgActivation, 'hg_activate', $lang["status"], '&nbsp;');
+	$form->setDefaults(array('hg_activate' => '1'));
+	$form->addElement('textarea', 'hg_comment', $lang["comment"], $attrsTextarea);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action' => '1'));
+	
+	$form->addElement('hidden', 'hg_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	function myReplace()	{
+		global $form;
+		$ret = $form->getSubmitValues();
+		return (str_replace(" ", "_", $ret["hg_name"]));
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('hg_name', 'myReplace');
+	$form->addRule('hg_name', $lang['ErrName'], 'required');
+	$form->addRule('hg_alias', $lang['ErrAlias'], 'required');
+	//$form->addRule('hg_hosts', $lang['ErrCct'], 'required');
+	if ($oreon->user->get_version() == 1)
+		$form->addRule('hg_cgs', $lang['ErrCg'], 'required');
+	$form->registerRule('exist', 'callback', 'testHostGroupExistence');
+	$form->addRule('hg_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	# Just watch a HostGroup information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&hg_id=".$hg_id."'"));
+	    $form->setDefaults($hg);
+		$form->freeze();
+	}
+	# Modify a HostGroup information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($hg);
+	}
+	# Add a HostGroup information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	
+	$tpl->assign('nagios', $oreon->user->get_version());
+	$tpl->assign("initJS", "<script type='text/javascript'>
+							window.onload = function () {
+							initAutoComplete('Form','city_name','sub');
+							};</script>");
+		
+	$valid = false;
+	if ($form->validate())	{
+		$hgObj =& $form->getElement('hg_id');
+		if ($form->getSubmitValue("submitA"))
+			$hgObj->setValue(insertHostGroupInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateHostGroupInDB($hgObj->getValue());
+		$o = "w";
+		$hgObj =& $form->getElement('hg_id');
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&hg_id=".$hgObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listHostGroup.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("formHostGroup.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/hostgroup/hostGroup.php b/www/include/configuration/configObject/hostgroup/hostGroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..dc002372c4a08a53b0bda48702ba215907268192
--- /dev/null
+++ b/www/include/configuration/configObject/hostgroup/hostGroup.php
@@ -0,0 +1,49 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["hg_id"]) ? $hG = $_GET["hg_id"] : $hG = NULL;
+	isset($_POST["hg_id"]) ? $hP = $_POST["hg_id"] : $hP = NULL;
+	$hG ? $hg_id = $hG : $hg_id = $hP;
+	
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/hostgroup/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formHostGroup.php"); break; #Add a Hostgroup
+		case "w" : require_once($path."formHostGroup.php"); break; #Watch a Hostgroup
+		case "c" : require_once($path."formHostGroup.php"); break; #Modify a Hostgroup
+		case "s" : enableHostGroupInDB($hg_id); require_once($path."listHostGroup.php"); break; #Activate a Hostgroup
+		case "u" : disableHostGroupInDB($hg_id); require_once($path."listHostGroup.php"); break; #Desactivate a Hostgroup
+		case "m" : multipleHostGroupInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listHostGroup.php"); break; #Duplicate n Host grou
+		case "d" : deleteHostGroupInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listHostGroup.php"); break; #Delete n Host group
+		default : require_once($path."listHostGroup.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/hostgroup/listHostGroup.ihtml b/www/include/configuration/configObject/hostgroup/listHostGroup.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..d8b7a8ce400b1af5243f42781f2b3e338d2132c0
--- /dev/null
+++ b/www/include/configuration/configObject/hostgroup/listHostGroup.ihtml
@@ -0,0 +1,43 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight" align="right">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="2"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+
+
+{$form.hidden}
diff --git a/www/include/configuration/configObject/hostgroup/listHostGroup.php b/www/include/configuration/configObject/hostgroup/listHostGroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..a71d152faadbd7aa1da222eeb09a39e7543a0a01
--- /dev/null
+++ b/www/include/configuration/configObject/hostgroup/listHostGroup.php
@@ -0,0 +1,99 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM hostgroup WHERE hg_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' AND hg_id IN (".$oreon->user->lcaHGStr.")");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM hostgroup WHERE hg_id IN (".$oreon->user->lcaHGStr.")");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Hostgroup list
+	if ($search)
+		$rq = "SELECT hg_id, hg_name, hg_alias, hg_activate FROM hostgroup WHERE hg_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' AND hg_id IN (".$oreon->user->lcaHGStr.") ORDER BY hg_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT hg_id, hg_name, hg_alias, hg_activate FROM hostgroup WHERE hg_id IN (".$oreon->user->lcaHGStr.") ORDER BY hg_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($hg); $i++) {
+		$selectedElements =& $form->addElement('checkbox', "select[".$hg['hg_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&hg_id=".$hg['hg_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&hg_id=".$hg['hg_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&hg_id=".$hg['hg_id']."&o=d&select[".$hg['hg_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($hg["hg_activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&hg_id=".$hg['hg_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&hg_id=".$hg['hg_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$hg['hg_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$hg["hg_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&hg_id=".$hg['hg_id'],
+						"RowMenu_desc"=>$hg["hg_alias"],
+						"RowMenu_status"=>$hg["hg_activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listHostGroup.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/hostgroup_dependency/DB-Func.php b/www/include/configuration/configObject/hostgroup_dependency/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..f68e9b675f41b78778942409cb2eec42e31ebc10
--- /dev/null
+++ b/www/include/configuration/configObject/hostgroup_dependency/DB-Func.php
@@ -0,0 +1,192 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	function testHostGroupDependencyExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('dep_id');
+		$res =& $pearDB->query("SELECT dep_name, dep_id FROM dependency WHERE dep_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$dep =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $dep["dep_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $dep["dep_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function testHostGroupDependencyCycle ($childs = NULL)	{
+		global $pearDB;
+		global $form;
+		$parents = array();
+		$childs = array();
+		if (isset($form))	{
+			$parents = $form->getSubmitValue('dep_hgParents');
+			$childs = $form->getSubmitValue('dep_hgChilds');
+			$childs =& array_flip($childs);
+		}
+		foreach ($parents as $parent)
+			if (array_key_exists($parent, $childs))
+				return false;
+		return true;
+	}
+
+	function deleteHostGroupDependencyInDB ($dependencies = array())	{
+		global $pearDB;
+		foreach($dependencies as $key=>$value)
+			$pearDB->query("DELETE FROM dependency WHERE dep_id = '".$key."'");
+	}
+	
+	function multipleHostGroupDependencyInDB ($dependencies = array(), $nbrDup = array())	{
+		foreach($dependencies as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM dependency WHERE dep_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["dep_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "dep_name" ? ($dep_name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testHostGroupDependencyExistence($dep_name))	{
+					$val ? $rq = "INSERT INTO dependency VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(dep_id) FROM dependency");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(dep_id)"]))	{
+						$res =& $pearDB->query("SELECT DISTINCT hostgroup_hg_id FROM dependency_hostgroupParent_relation WHERE dependency_dep_id = '".$key."'");
+						while($res->fetchInto($hg))
+							$pearDB->query("INSERT INTO dependency_hostgroupParent_relation VALUES ('', '".$maxId["MAX(dep_id)"]."', '".$hg["hostgroup_hg_id"]."')");
+						$res->free();
+						$res =& $pearDB->query("SELECT DISTINCT hostgroup_hg_id FROM dependency_hostgroupChild_relation WHERE dependency_dep_id = '".$key."'");
+						while($res->fetchInto($hg))
+							$pearDB->query("INSERT INTO dependency_hostgroupChild_relation VALUES ('', '".$maxId["MAX(dep_id)"]."', '".$hg["hostgroup_hg_id"]."')");
+						$res->free();
+					}
+				}
+			}
+		}
+	}
+	
+	function updateHostGroupDependencyInDB ($dep_id = NULL)	{
+		if (!$dep_id) exit();
+		updateHostGroupDependency($dep_id);
+		updateHostGroupDependencyHostGroupParents($dep_id);
+		updateHostGroupDependencyHostGroupChilds($dep_id);
+	}	
+	
+	function insertHostGroupDependencyInDB ($ret = array())	{
+		$dep_id = insertHostGroupDependency($ret);
+		updateHostGroupDependencyHostGroupParents($dep_id, $ret);
+		updateHostGroupDependencyHostGroupChilds($dep_id, $ret);
+		return ($dep_id);
+	}
+	
+	function insertHostGroupDependency($ret = array())	{
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO dependency ";
+		$rq .= "(dep_name, dep_description, inherits_parent, execution_failure_criteria, notification_failure_criteria, dep_comment) ";
+		$rq .= "VALUES (";
+		isset($ret["dep_name"]) && $ret["dep_name"] != NULL ? $rq .= "'".htmlentities($ret["dep_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["dep_description"]) && $ret["dep_description"] != NULL ? $rq .= "'".htmlentities($ret["dep_description"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["inherits_parent"]["inherits_parent"]) && $ret["inherits_parent"]["inherits_parent"] != NULL ? $rq .= "'".$ret["inherits_parent"]["inherits_parent"]."', " : $rq .= "NULL, ";
+		isset($ret["execution_failure_criteria"]) && $ret["execution_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["execution_failure_criteria"]))."', " : $rq .= "NULL, ";
+		isset($ret["notification_failure_criteria"]) && $ret["notification_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["notification_failure_criteria"]))."', " : $rq .= "NULL, ";
+		isset($ret["dep_comment"]) && $ret["dep_comment"] != NULL ? $rq .= "'".htmlentities($ret["dep_comment"], ENT_QUOTES)."' " : $rq .= "NULL ";
+		$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(dep_id) FROM dependency");
+		$dep_id = $res->fetchRow();
+		return ($dep_id["MAX(dep_id)"]);
+	}
+	
+	function updateHostGroupDependency($dep_id = null)	{
+		if (!$dep_id) exit();
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE dependency SET ";
+		$rq .= "dep_name = ";
+		isset($ret["dep_name"]) && $ret["dep_name"] != NULL ? $rq .= "'".htmlentities($ret["dep_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "dep_description = ";
+		isset($ret["dep_description"]) && $ret["dep_description"] != NULL ? $rq .= "'".htmlentities($ret["dep_description"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "inherits_parent = ";
+		isset($ret["inherits_parent"]["inherits_parent"]) && $ret["inherits_parent"]["inherits_parent"] != NULL ? $rq .= "'".$ret["inherits_parent"]["inherits_parent"]."', " : $rq .= "NULL, ";
+		$rq .= "execution_failure_criteria = ";
+		isset($ret["execution_failure_criteria"]) && $ret["execution_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["execution_failure_criteria"]))."', " : $rq .= "NULL, ";
+		$rq .= "notification_failure_criteria = ";
+		isset($ret["notification_failure_criteria"]) && $ret["notification_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["notification_failure_criteria"]))."', " : $rq .= "NULL, ";
+		$rq .= "dep_comment = ";
+		isset($ret["dep_comment"]) && $ret["dep_comment"] != NULL ? $rq .= "'".htmlentities($ret["dep_comment"], ENT_QUOTES)."' " : $rq .= "NULL ";
+		$rq .= "WHERE dep_id = '".$dep_id."'";
+		$pearDB->query($rq);
+	}
+		
+	function updateHostGroupDependencyHostGroupParents($dep_id = null, $ret = array())	{
+		if (!$dep_id) exit();
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM dependency_hostgroupParent_relation ";
+		$rq .= "WHERE dependency_dep_id = '".$dep_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["dep_hgParents"]))
+			$ret = $ret["dep_hgParents"];
+		else
+			$ret = $form->getSubmitValue("dep_hgParents");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO dependency_hostgroupParent_relation ";
+			$rq .= "(dependency_dep_id, hostgroup_hg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$dep_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+		
+	function updateHostGroupDependencyHostGroupChilds($dep_id = null, $ret = array())	{
+		if (!$dep_id) exit();
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM dependency_hostgroupChild_relation ";
+		$rq .= "WHERE dependency_dep_id = '".$dep_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["dep_hgChilds"]))
+			$ret = $ret["dep_hgChilds"];
+		else
+			$ret = $form->getSubmitValue("dep_hgChilds");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO dependency_hostgroupChild_relation ";
+			$rq .= "(dependency_dep_id, hostgroup_hg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$dep_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/hostgroup_dependency/formHostGroupDependency.ihtml b/www/include/configuration/configObject/hostgroup_dependency/formHostGroupDependency.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..d1408fdbcea8473031cd0af980a5b360754181c2
--- /dev/null
+++ b/www/include/configuration/configObject/hostgroup_dependency/formHostGroupDependency.ihtml
@@ -0,0 +1,27 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/clients.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/gauge.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.dep_name.label}</td><td class="FormRowValue">{$form.dep_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.dep_description.label}</td><td class="FormRowValue">{$form.dep_description.html}</td></tr>
+		{if $nagios == 2}
+			<tr class="list_one"><td class="FormRowField">{$form.inherits_parent.label}</td><td class="FormRowValue">{$form.inherits_parent.html}</td></tr>
+			<tr class="list_two"><td class="FormRowField">{$form.execution_failure_criteria.label}</td><td class="FormRowValue">{$form.execution_failure_criteria.html}</td></tr>
+		{/if}
+		<tr class="list_one"><td class="FormRowField">{$form.notification_failure_criteria.label}</td><td class="FormRowValue">{$form.notification_failure_criteria.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.dep_hgParents.label}</td><td class="FormRowValue">{$form.dep_hgParents.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.dep_hgChilds.label}</td><td class="FormRowValue">{$form.dep_hgChilds.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.dep_comment.label}</td><td class="FormRowValue">{$form.dep_comment.html}</td></tr>
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+{$form.hidden}
+</form>
+
diff --git a/www/include/configuration/configObject/hostgroup_dependency/formHostGroupDependency.php b/www/include/configuration/configObject/hostgroup_dependency/formHostGroupDependency.php
new file mode 100644
index 0000000000000000000000000000000000000000..f5f7717cc7d76ce7e6aa996e01c13a041b6d9ac6
--- /dev/null
+++ b/www/include/configuration/configObject/hostgroup_dependency/formHostGroupDependency.php
@@ -0,0 +1,202 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Dependency
+	#
+	$dep = array();
+	if (($o == "c" || $o == "w") && $dep_id)	{
+		$res =& $pearDB->query("SELECT * FROM dependency WHERE dep_id = '".$dep_id."' LIMIT 1");
+		# Set base value
+		$dep = array_map("myDecode", $res->fetchRow());
+		# Set Notification Failure Criteria
+		$dep["notification_failure_criteria"] =& explode(',', $dep["notification_failure_criteria"]);
+		foreach ($dep["notification_failure_criteria"] as $key => $value)
+			$dep["notification_failure_criteria"][trim($value)] = 1;
+		# Set Execution Failure Criteria
+		$dep["execution_failure_criteria"] =& explode(',', $dep["execution_failure_criteria"]);
+		foreach ($dep["execution_failure_criteria"] as $key => $value)
+			$dep["execution_failure_criteria"][trim($value)] = 1;
+		# Set HostGroup Parents
+		$res =& $pearDB->query("SELECT DISTINCT hostgroup_hg_id FROM dependency_hostgroupParent_relation WHERE dependency_dep_id = '".$dep_id."'");
+		for($i = 0; $res->fetchInto($hgP); $i++)
+			$dep["dep_hgParents"][$i] = $hgP["hostgroup_hg_id"];
+		$res->free();
+		# Set HostGroup Childs
+		$res =& $pearDB->query("SELECT DISTINCT hostgroup_hg_id FROM dependency_hostgroupChild_relation WHERE dependency_dep_id = '".$dep_id."'");
+		for($i = 0; $res->fetchInto($hgC); $i++)
+			$dep["dep_hgChilds"][$i] = $hgC["hostgroup_hg_id"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# HostGroup comes from DB -> Store in $hgs Array
+	$hgs = array();
+	$res =& $pearDB->query("SELECT hg_id, hg_name FROM hostgroup WHERE hg_id IN (".$oreon->user->lcaHGStr.") ORDER BY hg_name");
+	while($res->fetchInto($hg))
+		$hgs[$hg["hg_id"]] = $hg["hg_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsText2 	= array("size"=>"10");
+	$attrsAdvSelect = array("style" => "width: 250px; height: 150px;");
+	$attrsTextarea 	= array("rows"=>"3", "cols"=>"30");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["dep_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["dep_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["dep_view"]);
+
+	#
+	## Dependency basic information
+	#
+	$form->addElement('header', 'information', $lang['dep_infos']);
+	$form->addElement('text', 'dep_name', $lang["dep_name"], $attrsText);
+	$form->addElement('text', 'dep_description', $lang["dep_description"], $attrsText);
+	if ($oreon->user->get_version() == 2)	{
+		$tab = array();
+		$tab[] = &HTML_QuickForm::createElement('radio', 'inherits_parent', null, $lang['yes'], '1');
+		$tab[] = &HTML_QuickForm::createElement('radio', 'inherits_parent', null, $lang['no'], '0');
+		$form->addGroup($tab, 'inherits_parent', $lang["dep_inheritsP"], '&nbsp;');
+	}
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'o', '&nbsp;', 'Ok/Up');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'd', '&nbsp;', 'Down');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unreachable');
+	if ($oreon->user->get_version() == 2)
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'p', '&nbsp;', 'Pending');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'n', '&nbsp;', 'None');
+	$form->addGroup($tab, 'notification_failure_criteria', $lang["dep_notifFC"], '&nbsp;&nbsp;');
+	if ($oreon->user->get_version() == 2)	{
+		$tab = array();
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'o', '&nbsp;', 'Ok/Up');
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'd', '&nbsp;', 'Down');
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unreachable');
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'p', '&nbsp;', 'Pending');
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'n', '&nbsp;', 'None');
+		$form->addGroup($tab, 'execution_failure_criteria', $lang["dep_exeFC"], '&nbsp;&nbsp;');
+	}
+
+	$ams1 =& $form->addElement('advmultiselect', 'dep_hgParents', $lang['dep_hgPar'], $hgs, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+    $ams1 =& $form->addElement('advmultiselect', 'dep_hgChilds', $lang['dep_hgChi'], $hgs, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+	$form->addElement('textarea', 'dep_comment', $lang["dep_comment"], $attrsTextarea);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+
+	$form->addElement('hidden', 'dep_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('dep_name', $lang['ErrName'], 'required');
+	$form->addRule('dep_description', $lang['ErrRequired'], 'required');
+	$form->addRule('dep_hgParents', $lang['ErrRequired'], 'required');
+	$form->addRule('dep_hgChilds', $lang['ErrRequired'], 'required');
+	if ($oreon->user->get_version() == 1)
+		$form->addRule('notification_failure_criteria', $lang['ErrRequired'], 'required');
+	$form->registerRule('cycle', 'callback', 'testHostGroupDependencyCycle');
+	$form->addRule('dep_hgChilds', $lang['ErrCycleDef'], 'cycle');
+	$form->registerRule('exist', 'callback', 'testHostGroupDependencyExistence');
+	$form->addRule('dep_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Just watch a Dependency information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&dep_id=".$dep_id."'"));
+	    $form->setDefaults($dep);
+		$form->freeze();
+	}
+	# Modify a Dependency information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($dep);
+	}
+	# Add a Dependency information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	$tpl->assign("nagios", $oreon->user->get_version());
+
+	$valid = false;
+	if ($form->validate())	{
+		$depObj =& $form->getElement('dep_id');
+		if ($form->getSubmitValue("submitA"))
+			$depObj->setValue(insertHostGroupDependencyInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateHostGroupDependencyInDB($depObj->getValue("dep_id"));
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&dep_id=".$depObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once("listHostGroupDependency.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->display("formHostGroupDependency.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/hostgroup_dependency/hostGroupDependency.php b/www/include/configuration/configObject/hostgroup_dependency/hostGroupDependency.php
new file mode 100644
index 0000000000000000000000000000000000000000..3b79f1d6751112fca37a9278df6b8b1e9c4d6ebe
--- /dev/null
+++ b/www/include/configuration/configObject/hostgroup_dependency/hostGroupDependency.php
@@ -0,0 +1,47 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["dep_id"]) ? $cG = $_GET["dep_id"] : $cG = NULL;
+	isset($_POST["dep_id"]) ? $cP = $_POST["dep_id"] : $cP = NULL;
+	$cG ? $dep_id = $cG : $dep_id = $cP;
+	
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/hostgroup_dependency/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formHostGroupDependency.php"); break; #Add a Dependency
+		case "w" : require_once($path."formHostGroupDependency.php"); break; #Watch a Dependency
+		case "c" : require_once($path."formHostGroupDependency.php"); break; #Modify a Dependency
+		case "m" : multipleHostGroupDependencyInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listHostGroupDependency.php"); break; #Duplicate n Dependencys
+		case "d" : deleteHostGroupDependencyInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listHostGroupDependency.php"); break; #Delete n Dependency
+		default : require_once($path."listHostGroupDependency.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/hostgroup_dependency/listHostGroupDependency.ihtml b/www/include/configuration/configObject/hostgroup_dependency/listHostGroupDependency.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..7db74a21fdfa3aecc122ca34e392dff8107ed1e3
--- /dev/null
+++ b/www/include/configuration/configObject/hostgroup_dependency/listHostGroupDependency.ihtml
@@ -0,0 +1,40 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_description}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_description}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter"></td>
+			<td class="ListColFooterRight" align="right" colpan="2"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+
+{$form.hidden}
\ No newline at end of file
diff --git a/www/include/configuration/configObject/hostgroup_dependency/listHostGroupDependency.php b/www/include/configuration/configObject/hostgroup_dependency/listHostGroupDependency.php
new file mode 100644
index 0000000000000000000000000000000000000000..96e1e008794b290df16f72c6e804582be14d0b89
--- /dev/null
+++ b/www/include/configuration/configObject/hostgroup_dependency/listHostGroupDependency.php
@@ -0,0 +1,95 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	isset($_GET["list"]) ? $list = $_GET["list"] : $list = NULL;
+	$rq = "SELECT COUNT(*) FROM dependency dep";
+	$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM dependency_hostgroupParent_relation dhgpr WHERE dhgpr.dependency_dep_id = dep.dep_id AND dhgpr.hostgroup_hg_id IN (".$oreon->user->lcaHGStr.")) > 0 AND (SELECT DISTINCT COUNT(*) FROM dependency_hostgroupChild_relation dhgpr WHERE dhgpr.dependency_dep_id = dep.dep_id AND dhgpr.hostgroup_hg_id IN (".$oreon->user->lcaHGStr.")) > 0";
+	if ($search)
+		$rq .= " AND dep_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'";
+	$res = & $pearDB->query($rq);
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_description", $lang['description']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Dependcy list
+	$rq = "SELECT dep_id, dep_name, dep_description FROM dependency dep";
+	$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM dependency_hostgroupParent_relation dhgpr WHERE dhgpr.dependency_dep_id = dep.dep_id AND dhgpr.hostgroup_hg_id IN (".$oreon->user->lcaHGStr.")) > 0 AND (SELECT DISTINCT COUNT(*) FROM dependency_hostgroupChild_relation dhgpr WHERE dhgpr.dependency_dep_id = dep.dep_id AND dhgpr.hostgroup_hg_id IN (".$oreon->user->lcaHGStr.")) > 0";
+	if ($search)
+		$rq .= " AND dep_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'";
+	$rq .= " LIMIT ".$num * $limit.", ".$limit;
+	$res =& $pearDB->query($rq);
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($dep); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$dep['dep_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&dep_id=".$dep['dep_id']."&o=w&search=".$search."&list=".$list."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&dep_id=".$dep['dep_id']."&o=c&search=".$search."&list=".$list."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&dep_id=".$dep['dep_id']."&o=d&select[".$dep['dep_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."&list=".$list."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$dep['dep_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$dep["dep_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&dep_id=".$dep['dep_id'],
+						"RowMenu_description"=>$dep["dep_description"],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listHostGroupDependency.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/meta_service/DB-Func.php b/www/include/configuration/configObject/meta_service/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..ae1c173e84cdf4c3a4a89aac32228c613f5fcf2a
--- /dev/null
+++ b/www/include/configuration/configObject/meta_service/DB-Func.php
@@ -0,0 +1,302 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Meta Service � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+			
+	function testExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('meta_id');
+		$res =& $pearDB->query("SELECT meta_id FROM meta_service WHERE meta_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$meta =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $meta["meta_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $meta["meta_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function enableMetaServiceInDB ($meta_id = null)	{
+		if (!$meta_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE meta_service SET meta_activate = '1' WHERE meta_id = '".$meta_id."'");
+	}
+	
+	function disableMetaServiceInDB ($meta_id = null)	{
+		if (!$meta_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE meta_service SET meta_activate = '0' WHERE meta_id = '".$meta_id."'");
+	}
+	
+	function deleteMetaServiceInDB ($metas = array())	{
+		global $pearDB;
+		foreach($metas as $key=>$value)
+			$pearDB->query("DELETE FROM meta_service WHERE meta_id = '".$key."'");
+	}
+	
+	function enableMetricInDB ($msr_id = null)	{
+		if (!$msr_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE meta_service_relation SET activate = '1' WHERE msr_id = '".$msr_id."'");
+	}
+	
+	function disableMetricInDB ($msr_id = null)	{
+		if (!$msr_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE meta_service_relation SET activate = '0' WHERE msr_id = '".$msr_id."'");
+	}
+	
+	function deleteMetricInDB ($metrics = array())	{
+		global $pearDB;
+		foreach($metrics as $key=>$value)
+			$pearDB->query("DELETE FROM meta_service_relation WHERE msr_id = '".$key."'");
+	}	
+	
+	function multipleMetaServiceInDB ($metas = array(), $nbrDup = array())	{
+		# Foreach Meta Service
+		foreach($metas as $key=>$value)	{
+			global $pearDB;
+			# Get all information about it
+			$res =& $pearDB->query("SELECT * FROM meta_service WHERE meta_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["meta_id"] = '';
+			# Loop on the number of MetaService we want to duplicate
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				# Create a sentence which contains all the value
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "meta_name" ? ($meta_name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testExistence($meta_name))	{
+					$val ? $rq = "INSERT INTO meta_service VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(meta_id) FROM meta_service");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(meta_id)"]))	{
+						$res =& $pearDB->query("SELECT DISTINCT cg_cg_id FROM meta_contactgroup_relation WHERE meta_id = '".$key."'");
+						while($res->fetchInto($Cg))
+							$pearDB->query("INSERT INTO meta_contactgroup_relation VALUES ('', '".$maxId["MAX(meta_id)"]."', '".$Cg["cg_cg_id"]."')");
+						$res =& $pearDB->query("SELECT * FROM meta_service_relation WHERE meta_id = '".$key."'");
+						while($res->fetchInto($metric))	{
+							$val = null;
+							$metric["msr_id"] = '';
+							foreach ($metric as $key2=>$value2)	{
+								$key2 == "meta_id" ? $value2 = $maxId["MAX(meta_id)"] : null;
+								$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+							}
+							$pearDB->query("INSERT INTO meta_service_relation VALUES (".$val.")");
+						}
+					}
+				}
+			}
+		}
+	}
+	
+	function updateMetaServiceInDB ($meta_id = NULL)	{
+		if (!$meta_id) return;
+		updateMetaService($meta_id);
+		updateMetaServiceContactGroup($meta_id);
+	}	
+	
+	function insertMetaServiceInDB ()	{
+		$meta_id = insertMetaService();
+		updateMetaServiceContactGroup($meta_id);
+		return ($meta_id);
+	}
+	
+	function multipleMetricInDB ($metrics = array(), $nbrDup = array())	{
+		# Foreach Meta Service
+		foreach($metrics as $key=>$value)	{
+			global $pearDB;
+			# Get all information about it
+			$res =& $pearDB->query("SELECT * FROM meta_service_relation WHERE msr_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["msr_id"] = '';
+			# Loop on the number of Metric we want to duplicate
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				# Create a sentence which contains all the value
+				foreach ($row as $key2=>$value2)
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				$val ? $rq = "INSERT INTO meta_service_relation VALUES (".$val.")" : $rq = null;
+				$pearDB->query($rq);
+			}
+		}
+	}
+		
+	function insertMetaService($ret = array())	{
+		global $form;
+		global $pearDB;
+		if (count($ret))
+			;	
+		else
+			$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO meta_service " .
+				"(meta_name, check_period, max_check_attempts, normal_check_interval, retry_check_interval, notification_interval, " .
+				"notification_period, notification_options, notifications_enabled, calcul_type, meta_select_mode, regexp_str, metric, warning, critical, " .
+				"meta_comment, meta_activate) " .
+				"VALUES ( ";
+				isset($ret["meta_name"]) && $ret["meta_name"] != NULL ? $rq .= "'".htmlentities($ret["meta_name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+				isset($ret["check_period"]) && $ret["check_period"] != NULL ? $rq .= "'".$ret["check_period"]."', ": $rq .= "NULL, ";
+				isset($ret["max_check_attempts"]) && $ret["max_check_attempts"] != NULL ? $rq .= "'".$ret["max_check_attempts"]."', " : $rq .= "NULL, ";
+				isset($ret["normal_check_interval"]) && $ret["normal_check_interval"] != NULL ? $rq .= "'".$ret["normal_check_interval"]."', ": $rq .= "NULL, ";
+				isset($ret["retry_check_interval"]) && $ret["retry_check_interval"] != NULL ? $rq .= "'".$ret["retry_check_interval"]."', ": $rq .= "NULL, ";
+				isset($ret["notification_interval"]) && $ret["notification_interval"] != NULL ? $rq .= "'".$ret["notification_interval"]."', " : $rq .= "NULL, ";
+				isset($ret["notification_period"]) && $ret["notification_period"] != NULL ? $rq .= "'".$ret["notification_period"]."', ": $rq .= "NULL, ";
+				isset($ret["ms_notifOpts"]) && $ret["ms_notifOpts"] != NULL ? $rq .= "'".implode(",", array_keys($ret["ms_notifOpts"]))."', " : $rq .= "NULL, ";
+				isset($ret["notifications_enabled"]["notifications_enabled"]) && $ret["notifications_enabled"]["notifications_enabled"] != 2 ? $rq .= "'".$ret["notifications_enabled"]["notifications_enabled"]."', " : $rq .= "'2', ";
+				isset($ret["calcul_type"]) ? $rq .= "'".$ret["calcul_type"]."', " : $rq .= "NULL, ";
+				isset($ret["meta_select_mode"]["meta_select_mode"]) ? $rq .= "'".$ret["meta_select_mode"]["meta_select_mode"]."', " : $rq .= "NULL, ";
+				isset($ret["regexp_str"]) && $ret["regexp_str"] != NULL ? $rq .= "'".htmlentities($ret["regexp_str"])."', " : $rq .= "NULL, ";
+				isset($ret["metric"]) && $ret["metric"] != NULL ? $rq .= "'".htmlentities($ret["metric"])."', " : $rq .= "NULL, ";
+				isset($ret["warning"]) && $ret["warning"] != NULL ? $rq .= "'".htmlentities($ret["warning"])."', " : $rq .= "NULL, ";
+				isset($ret["critical"]) && $ret["critical"] != NULL ? $rq .= "'".htmlentities($ret["critical"])."', " : $rq .= "NULL, ";
+				isset($ret["meta_comment"]) && $ret["meta_comment"] != NULL ? $rq .= "'".htmlentities($ret["meta_comment"])."', " : $rq .= "NULL, ";
+				isset($ret["meta_activate"]["meta_activate"]) && $ret["meta_activate"]["meta_activate"] != NULL ? $rq .= "'".$ret["meta_activate"]["meta_activate"]."'" : $rq .= "NULL";
+				$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(meta_id) FROM meta_service");
+		$meta_id = $res->fetchRow();
+		return ($meta_id["MAX(meta_id)"]);
+	}
+	
+	function updateMetaService($meta_id = null)	{
+		if (!$meta_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE meta_service SET " ;
+		$rq .= "meta_name = ";
+		$ret["meta_name"] != NULL ? $rq .= "'".htmlentities($ret["meta_name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "check_period = ";
+		$ret["check_period"] != NULL ? $rq .= "'".$ret["check_period"]."', ": $rq .= "NULL, ";
+		$rq .= "max_check_attempts = ";
+		$ret["max_check_attempts"] != NULL ? $rq .= "'".$ret["max_check_attempts"]."', " : $rq .= "NULL, ";
+		$rq .= "normal_check_interval = ";
+		$ret["normal_check_interval"] != NULL ? $rq .= "'".$ret["normal_check_interval"]."', ": $rq .= "NULL, ";
+		$rq .= "retry_check_interval = ";
+		$ret["retry_check_interval"] != NULL ? $rq .= "'".$ret["retry_check_interval"]."', ": $rq .= "NULL, ";
+		$rq .= "notification_interval = ";
+		$ret["notification_interval"] != NULL ? $rq .= "'".$ret["notification_interval"]."', " : $rq .= "NULL, ";
+		$rq .= "notification_period = ";
+		$ret["notification_period"] != NULL ? $rq .= "'".$ret["notification_period"]."', " : $rq .= "NULL, ";
+		$rq .= "notification_options = ";
+		isset($ret["ms_notifOpts"]) && $ret["ms_notifOpts"] != NULL ? $rq .= "'".implode(",", array_keys($ret["ms_notifOpts"]))."', " : $rq .= "NULL, ";
+		$rq .= "notifications_enabled = ";
+		$ret["notifications_enabled"]["notifications_enabled"] != 2 ? $rq .= "'".$ret["notifications_enabled"]["notifications_enabled"]."', " : $rq .= "'2', ";
+		$rq .= "calcul_type = ";
+		$ret["calcul_type"] ? $rq .= "'".$ret["calcul_type"]."', " : $rq .= "NULL, ";
+		$rq .= "meta_select_mode = ";
+		$ret["meta_select_mode"]["meta_select_mode"] != NULL ? $rq .= "'".$ret["meta_select_mode"]["meta_select_mode"]."', " : $rq .= "NULL, ";
+		$rq .= "regexp_str = ";
+		$ret["regexp_str"] != NULL ? $rq .= "'".htmlentities($ret["regexp_str"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "metric = ";
+		$ret["metric"] != NULL ? $rq .= "'".htmlentities($ret["metric"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "warning = ";
+		$ret["warning"] != NULL ? $rq .= "'".htmlentities($ret["warning"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "critical = ";
+		$ret["critical"] != NULL ? $rq .= "'".htmlentities($ret["critical"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "meta_comment = ";
+		$ret["meta_comment"] != NULL ? $rq .= "'".htmlentities($ret["meta_comment"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "meta_activate = ";
+		$ret["meta_activate"]["meta_activate"] != NULL ? $rq .= "'".$ret["meta_activate"]["meta_activate"]."' " : $rq .= "NULL ";
+		$rq .= " WHERE meta_id = '".$meta_id."'";
+		$pearDB->query($rq);
+	}
+		
+	function updateMetaServiceContactGroup($meta_id = null)	{
+		if (!$meta_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM meta_contactgroup_relation ";
+		$rq .= "WHERE meta_id = '".$meta_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("ms_cgs");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO meta_contactgroup_relation ";
+			$rq .= "(meta_id, cg_cg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$meta_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateMetricInDB ($msr_id = NULL)	{
+		if (!$msr_id) return;
+		updateMetric($msr_id);
+	}	
+	
+	function insertMetricInDB ()	{
+		$msr_id = insertMetric();
+		updateMetricContactGroup($msr_id);
+		return ($msr_id);
+	}
+	
+	function insertMetric($ret = array())	{
+		global $form;
+		global $pearDB;
+		global $oreon;
+		$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO meta_service_relation " .
+				"(meta_id, host_id, metric_id, msr_comment, activate) " .
+				"VALUES ( ";
+				isset($ret["meta_id"]) && $ret["meta_id"] != NULL ? $rq .= "'".$ret["meta_id"]."', ": $rq .= "NULL, ";
+				isset($ret["host_name"]) && $ret["host_name"] != NULL ? $rq .= "'".array_search($ret["host_name"], $oreon->user->lcaHost)."', ": $rq .= "NULL, ";
+				isset($ret["metric_sel"][1]) && $ret["metric_sel"][1] != NULL ? $rq .= "'".$ret["metric_sel"][1]."', ": $rq .= "NULL, ";
+				isset($ret["msr_comment"]) && $ret["msr_comment"] != NULL ? $rq .= "'".htmlentities($ret["msr_comment"])."', " : $rq .= "NULL, ";
+				isset($ret["activate"]["activate"]) && $ret["activate"]["activate"] != NULL ? $rq .= "'".$ret["activate"]["activate"]."'" : $rq .= "NULL";
+				$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(msr_id) FROM meta_service_relation");
+		$msr_id = $res->fetchRow();
+		return ($msr_id["MAX(msr_id)"]);
+	}
+	
+	function updateMetric($msr_id = null)	{
+		if (!$msr_id) return;
+		global $form;
+		global $pearDB;
+		global $oreon;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE meta_service_relation SET " ;
+		$rq .= "meta_id = ";
+		$ret["meta_id"] != NULL ? $rq .= "'".$ret["meta_id"]."', ": $rq .= "NULL, ";
+		$rq .= "host_id = ";
+		$ret["host_name"] != NULL ? $rq .= "'".array_search($ret["host_name"], $oreon->user->lcaHost)."', ": $rq .= "NULL, ";
+		$rq .= "metric_id = ";
+		$ret["metric_id"] != NULL ? $rq .= "'".$ret["metric_id"]."', ": $rq .= "NULL, ";
+		$rq .= "msr_comment = ";
+		$ret["msr_comment"] != NULL ? $rq .= "'".htmlentities($ret["msr_comment"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "activate = ";
+		$ret["activate"]["activate"] != NULL ? $rq .= "'".$ret["activate"]["activate"]."' " : $rq .= "NULL ";
+		$rq .= " WHERE msr_id = '".$msr_id."'";
+		$pearDB->query($rq);
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/meta_service/formMetaService.ihtml b/www/include/configuration/configObject/meta_service/formMetaService.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..c7954d946ed9b114b768617cd81c6d0afca32992
--- /dev/null
+++ b/www/include/configuration/configObject/meta_service/formMetaService.ihtml
@@ -0,0 +1,47 @@
+{$form.javascript}
+<form {$form.attributes}>
+<div>
+	<table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/workstation2.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.meta_name.label}</td><td class="FormRowValue">{$form.meta_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.warning.label}</td><td class="FormRowValue">{$form.warning.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.critical.label}</td><td class="FormRowValue">{$form.critical.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.calcul_type.label}</td><td class="FormRowValue">{$form.calcul_type.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.meta_select_mode.label}</td><td class="FormRowValue">{$form.meta_select_mode.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.regexp_str.label}</td><td class="FormRowValue">{$form.regexp_str.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.metric.label}</td><td class="FormRowValue">{$form.metric.html}</td></tr>
+
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/gauge.gif'>&nbsp;&nbsp;{$form.header.check}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.check_period.label}</td><td class="FormRowValue">{$form.check_period.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.max_check_attempts.label}</td><td class="FormRowValue">{$form.max_check_attempts.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.normal_check_interval.label}</td><td class="FormRowValue">{$form.normal_check_interval.html}{$time_unit}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.retry_check_interval.label}</td><td class="FormRowValue">{$form.retry_check_interval.html}{$time_unit}</td></tr>
+		
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/mail_write.gif'>&nbsp;&nbsp;{$form.header.notification}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.notifications_enabled.label}</td><td class="FormRowValue">{$form.notifications_enabled.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.ms_cgs.label}</td><td class="FormRowValue">{$form.ms_cgs.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.notification_interval.label}</td><td class="FormRowValue">{$form.notification_interval.html}{$time_unit}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.notification_period.label}</td><td class="FormRowValue">{$form.notification_period.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.ms_notifOpts.label}</td><td class="FormRowValue">{$form.ms_notifOpts.html}</td></tr>
+		
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/cookies.gif'>&nbsp;&nbsp;{$form.header.furtherInfos}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.meta_activate.label}</td><td class="FormRowValue">{$form.meta_activate.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.meta_comment.label}</td><td class="FormRowValue">{$form.meta_comment.html}</td></tr>
+		
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+</div>
+<div id="validForm">
+{if $o == "a" || $o == "c"}
+	<p>{$form.action.html}</p>
+	<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+{else if $o == "w"}
+	<p class="oreonbutton">{$form.change.html}</p>
+{/if}
+</div>
+{$form.hidden}	
+</form>
diff --git a/www/include/configuration/configObject/meta_service/formMetaService.php b/www/include/configuration/configObject/meta_service/formMetaService.php
new file mode 100644
index 0000000000000000000000000000000000000000..8fbb8ae285e7ccd2a4008b94a7c4c27506fa9fa4
--- /dev/null
+++ b/www/include/configuration/configObject/meta_service/formMetaService.php
@@ -0,0 +1,266 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Meta Service � is developped by Merethis company for Lafarge Group,
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	#
+	## Database retrieve information for Service
+	#
+
+	$ms = array();
+	if (($o == "c" || $o == "w") && $meta_id)	{
+		$res =& $pearDB->query("SELECT * FROM meta_service WHERE meta_id = '".$meta_id."' LIMIT 1");
+		# Set base value
+		$ms = array_map("myDecode", $res->fetchRow());
+		# Set Service Notification Options
+		$tmp = explode(',', $ms["notification_options"]);
+		foreach ($tmp as $key => $value)
+			$ms["ms_notifOpts"][trim($value)] = 1;
+		# Set Contact Group
+		$res =& $pearDB->query("SELECT DISTINCT cg_cg_id FROM meta_contactgroup_relation WHERE meta_id = '".$meta_id."'");
+		for($i = 0; $res->fetchInto($notifCg); $i++)
+			$ms["ms_cgs"][$i] = $notifCg["cg_cg_id"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Perfparse Metric comes from DB -> Store in $metrics Array
+	require_once("./DBPerfparseConnect.php");
+	$metrics = array(NULL=>NULL);
+	$res =& $pearDBpp->query("SELECT DISTINCT metric FROM perfdata_service_metric ORDER BY metric");
+	while($res->fetchInto($metric))
+		$metrics[$metric["metric"]] = $metric["metric"];
+	$res->free();
+	# Timeperiods comes from DB -> Store in $tps Array
+	$res =& $pearDB->query("SELECT tp_id, tp_name FROM timeperiod ORDER BY tp_name");
+	while($res->fetchInto($tp))
+		$tps[$tp["tp_id"]] = $tp["tp_name"];
+	$res->free();
+	# Check commands comes from DB -> Store in $checkCmds Array
+	$checkCmds = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT command_id, command_name FROM command WHERE command_type = '2' ORDER BY command_name");
+	while($res->fetchInto($checkCmd))
+		$checkCmds[$checkCmd["command_id"]] = $checkCmd["command_name"];
+	$res->free();
+	# Contact Groups comes from DB -> Store in $notifCcts Array
+	$notifCgs = array();
+	$res =& $pearDB->query("SELECT cg_id, cg_name FROM contactgroup ORDER BY cg_name");
+	while($res->fetchInto($notifCg))
+		$notifCgs[$notifCg["cg_id"]] = $notifCg["cg_name"];
+	$res->free();
+	# Escalations comes from DB -> Store in $escs Array
+	$escs = array();
+	$res =& $pearDB->query("SELECT esc_id, esc_name FROM escalation ORDER BY esc_name");
+	while($res->fetchInto($esc))
+		$escs[$esc["esc_id"]] = $esc["esc_name"];
+	$res->free();
+	# Meta Service Dependencies comes from DB -> Store in $deps Array
+	$deps = array();
+	$res =& $pearDB->query("SELECT meta_id, meta_name FROM meta_service WHERE meta_id != '".$meta_id."' ORDER BY meta_name");
+	while($res->fetchInto($dep))
+		$deps[$dep["meta_id"]] = $dep["meta_name"];
+	$res->free();
+	# Calc Type
+	$calType = array("AVE"=>$lang['ms_selAvr'], "SOM"=>$lang['ms_selSum'], "MIN"=>$lang['ms_selMin'], "MAX"=>$lang['ms_selMax']);
+
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsText2		= array("size"=>"6");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["ms_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["ms_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["ms_view"]);
+
+	# Sort 1
+	#
+	## Service basic information
+	#
+	$form->addElement('header', 'information', $lang['ms_infos']);
+
+	$form->addElement('text', 'meta_name', $lang['ms_name'], $attrsText);
+	$form->addElement('text', 'warning', $lang['ms_levelw'], $attrsText2);
+	$form->addElement('text', 'critical', $lang['ms_levelc'], $attrsText2);
+	$form->addElement('select', 'calcul_type', $lang['ms_calType'], $calType);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'meta_select_mode', null, $lang['ms_selList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'meta_select_mode', null, $lang['ms_regexp'], '2');
+	$form->addGroup($tab, 'meta_select_mode', $lang['ms_selMod'], '<br>');
+	$form->setDefaults(array('meta_select_mode' => array('meta_select_mode'=>'1')));
+
+	$form->addElement('text', 'regexp_str', $lang['ms_exp'], $attrsText);
+	$form->addElement('select', 'metric', $lang['ms_metric'], $metrics);
+
+	#
+	## Check information
+	#
+	$form->addElement('header', 'check', $lang['ms_head_state']);
+
+	$form->addElement('select', 'check_period', $lang['ms_checkPeriod'], $tps);
+	$form->addElement('text', 'max_check_attempts', $lang['ms_checkMca'], $attrsText2);
+	$form->addElement('text', 'normal_check_interval', $lang['ms_normalCheckInterval'], $attrsText2);
+	$form->addElement('text', 'retry_check_interval', $lang['ms_retryCheckInterval'], $attrsText2);
+
+	##
+	## Notification informations
+	##
+	$form->addElement('header', 'notification', $lang['ms_head_notif']);
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'notifications_enabled', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'notifications_enabled', null, $lang["no"], '0');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'notifications_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($tab, 'notifications_enabled', $lang['ms_notifEnabled'], '&nbsp;');
+	$form->setDefaults(array('notifications_enabled' => '2'));
+
+    $ams3 =& $form->addElement('advmultiselect', 'ms_cgs', $lang['ms_CgMembers'], $notifCgs, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+
+	$form->addElement('text', 'notification_interval', $lang['ms_notifInt'], $attrsText2);
+	$form->addElement('select', 'notification_period', $lang['ms_notifTp'], $tps);
+
+ 	$msNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'w', '&nbsp;', 'Warning');
+	$msNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unknown');
+	$msNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'c', '&nbsp;', 'Critical');
+	$msNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'r', '&nbsp;', 'Recovery');
+	if ($oreon->user->get_version() == 2)
+		$msNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'f', '&nbsp;', 'Flapping');
+	$form->addGroup($msNotifOpt, 'ms_notifOpts', $lang['ms_notifOpts'], '&nbsp;&nbsp;');
+
+	#
+	## Further informations
+	#
+	$form->addElement('header', 'furtherInfos', $lang['further_infos']);
+	$msActivation[] = &HTML_QuickForm::createElement('radio', 'meta_activate', null, $lang["enable"], '1');
+	$msActivation[] = &HTML_QuickForm::createElement('radio', 'meta_activate', null, $lang["disable"], '0');
+	$form->addGroup($msActivation, 'meta_activate', $lang["status"], '&nbsp;');
+	$form->setDefaults(array('meta_activate' => '1'));
+	$form->addElement('textarea', 'meta_comment', $lang["cmt_comment"], $attrsTextarea);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action' => '1'));
+
+	$form->addElement('hidden', 'meta_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	function myReplace()	{
+		global $form;
+		return (str_replace(" ", "_", $form->getSubmitValue("meta_name")));
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('meta_name', 'myReplace');
+	$form->addRule('meta_name', $lang['ErrName'], 'required');
+	$form->addRule('max_check_attempts', $lang['ErrRequired'], 'required');
+	$form->addRule('calcul_type', $lang['ErrRequired'], 'required');
+	$form->addRule('meta_select_mode', $lang['ErrRequired'], 'required');
+	$form->addRule('warning', $lang['ErrRequired'], 'required');
+	$form->addRule('critical', $lang['ErrRequired'], 'required');
+	$form->addRule('normal_check_interval', $lang['ErrRequired'], 'required');
+	$form->addRule('retry_check_interval', $lang['ErrRequired'], 'required');
+	$form->addRule('check_period', $lang['ErrTp'], 'required');
+	$form->addRule('ms_cgs', $lang['ErrCg'], 'required');
+	$form->addRule('notification_interval', $lang['ErrRequired'], 'required');
+	$form->addRule('notification_period', $lang['ErrTp'], 'required');
+	$form->addRule('notifications_enabled', $lang['ErrRequired'], 'required');
+	$form->addRule('ms_notifOpts', $lang['ErrRequired'], 'required');
+	$form->addRule('notifOpts', $lang['ErrOpt'], 'required');
+	$form->registerRule('exist', 'callback', 'testExistence');
+	$form->addRule('meta_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Just watch a host information
+	if ($o == "w")	{
+		if (!$min)
+			$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&meta_id=".$meta_id."'"));
+	    $form->setDefaults($ms);
+		$form->freeze();
+	}
+	# Modify a service information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($ms);
+	}
+	# Add a service information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+
+	$tpl->assign('msg', array ("nagios"=>$oreon->user->get_version()));
+	$tpl->assign('time_unit', " * ".$oreon->Nagioscfg["interval_length"]." ".$lang["time_sec"]);
+
+	$valid = false;
+	if ($form->validate())	{
+		$msObj =& $form->getElement('meta_id');
+		if ($form->getSubmitValue("submitA"))
+			$msObj->setValue(insertMetaServiceInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateMetaServiceInDB($msObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&meta_id=".$msObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listMetaService.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->display("formMetaService.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/meta_service/listMetaService.ihtml b/www/include/configuration/configObject/meta_service/listMetaService.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..293d053a3ae551f382d573603736b4c0cf9625c2
--- /dev/null
+++ b/www/include/configuration/configObject/meta_service/listMetaService.ihtml
@@ -0,0 +1,48 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	{$osl_osl_name}
+	<table id="ListTable">
+		<tr class='ListHeader'>			
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_type}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_levelw}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_levelc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_type}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_levelw}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_levelc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">				
+			</td>
+			<td class="ListColFooterCenter" colspan="4"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+
+	{$form.hidden}
+</form>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/meta_service/listMetaService.php b/www/include/configuration/configObject/meta_service/listMetaService.php
new file mode 100644
index 0000000000000000000000000000000000000000..e40413a6d15a6be11ffffb0ebafc3715ed146f9b
--- /dev/null
+++ b/www/include/configuration/configObject/meta_service/listMetaService.php
@@ -0,0 +1,113 @@
+<?php
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Meta Service � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM meta_service WHERE meta_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM meta_service");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['ms_name']);
+	$tpl->assign("headerMenu_type", $lang['ms_calType']);
+	$tpl->assign("headerMenu_levelw", $lang['ms_levelw']);
+	$tpl->assign("headerMenu_levelc", $lang['ms_levelc']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# End header menu
+	
+	$calcType = array("AVE"=>$lang['ms_selAvr'], "SOM"=>$lang['ms_selSum'], "MIN"=>$lang['ms_selMin'], "MAX"=>$lang['ms_selMax']);
+	
+	#Meta Service list
+	if ($search)
+		$rq = "SELECT *  FROM meta_service WHERE meta_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' ORDER BY meta_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT * FROM meta_service ORDER BY meta_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($ms); $i++) {
+		$selectedElements =& $form->addElement('checkbox', "select[".$ms['meta_id']."]");	
+		if ($ms["meta_select_mode"] == 1)
+			$moptions = "<a href='oreon.php?p=".$p."&meta_id=".$ms['meta_id']."&o=ci&search=".$search."'><img src='img/icones/16x16/signpost.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions = "";
+		$moptions .= "<a href='oreon.php?p=".$p."&meta_id=".$ms['meta_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&meta_id=".$ms['meta_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&meta_id=".$ms['meta_id']."&o=d&select[".$ms['meta_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($ms["meta_activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&meta_id=".$ms['meta_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&meta_id=".$ms['meta_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$ms['meta_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$ms["meta_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&meta_id=".$ms['meta_id'],
+						"RowMenu_type"=>$calcType[$ms["calcul_type"]],
+						"RowMenu_levelw"=>$ms["warning"],
+						"RowMenu_levelc"=>$ms["critical"],
+						"RowMenu_status"=>$ms["meta_activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";
+	}	
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listMetaService.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/meta_service/listMetric.ihtml b/www/include/configuration/configObject/meta_service/listMetric.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..74b92f837ea984c759d69c7ef2a1896379eab76d
--- /dev/null
+++ b/www/include/configuration/configObject/meta_service/listMetric.ihtml
@@ -0,0 +1,38 @@
+<table id="ListTable">
+	<tr class="ListHeader">
+	<td class="ListColCenter">
+		<img src='./img/icones/16x16/workstation2.gif'>&nbsp;{$meta.meta} -	{$meta.name}&nbsp;({$meta.calc_type})
+	</td>
+	</tr>		
+</table>
+<br>
+<form {$form1_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColPicker">{$headerMenu_icone}</td>
+			<td class="ListColLeft">{$headerMenu_host}</td>
+			<td class="ListColLeft">{$headerMenu_service}</td>
+			<td class="ListColCenter">{$headerMenu_metric}</td>
+			<td class="ListColCenter">{$headerMenu_status}</td>
+			<td class="ListColRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr1}
+		<tr class={$elemArr1[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr1[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr1[elem].RowMenu_link}">{$elemArr1[elem].RowMenu_host}</a></td>
+			<td class="ListColLeft"><a href="{$elemArr1[elem].RowMenu_link}">{$elemArr1[elem].RowMenu_service}</a></td>
+			<td class="ListColCenter">{$elemArr1[elem].RowMenu_metric}</td>
+			<td class="ListColCenter">{$elemArr1[elem].RowMenu_status}</td>
+			<td class="ListColRight">{$elemArr1[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				<input type="image" name="o" value="ds" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="3"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL1}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{$form1.hidden}
+</form>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/meta_service/listMetric.php b/www/include/configuration/configObject/meta_service/listMetric.php
new file mode 100644
index 0000000000000000000000000000000000000000..e1beae15f629835683a719de5e9fc0551fbce20d
--- /dev/null
+++ b/www/include/configuration/configObject/meta_service/listMetric.php
@@ -0,0 +1,94 @@
+<?php
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Meta Service � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$calcType = array("AVE"=>$lang['ms_selAvr'], "SOM"=>$lang['ms_selSum'], "MIN"=>$lang['ms_selMin'], "MAX"=>$lang['ms_selMax']);
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	require_once("./DBPerfparseConnect.php");
+	
+	$res = & $pearDB->query("SELECT * FROM meta_service WHERE meta_id = '".$meta_id."'");	
+	$meta =& $res->fetchRow();
+	$tpl->assign("meta", 
+			array("meta"=>$lang["ms"],
+				"name"=>$meta["meta_name"],
+				"calc_type"=>$calcType[$meta["calcul_type"]]));
+	$res->free();
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_host", $lang["h"]);
+	$tpl->assign("headerMenu_service", $lang["sv"]);
+	$tpl->assign("headerMenu_metric", $lang["ms_metric"]);
+	$tpl->assign("headerMenu_status", $lang["status"]);
+	$tpl->assign("headerMenu_options", $lang["options"]);
+	# end header menu
+
+	$rq = "SELECT * FROM `meta_service_relation` WHERE host_id IN (".$oreon->user->lcaHStr.") AND meta_id = '".$meta_id."' ORDER BY host_id";
+	$res = & $pearDB->query($rq);
+	$form1 = new HTML_QuickForm('Form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr1 = array();
+	for ($i = 0; $res->fetchInto($metric); $i++) {
+		$selectedElements =& $form1->addElement('checkbox', "select[".$metric['msr_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&msr_id=".$metric['msr_id']."&metric_id=".$metric['metric_id']."&meta_id=".$meta_id."&o=ws'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&msr_id=".$metric['msr_id']."&metric_id=".$metric['metric_id']."&meta_id=".$meta_id."&o=cs'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&msr_id=".$metric['msr_id']."&metric_id=".$metric['metric_id']."&meta_id=".$meta_id."&o=ds&select[".$metric['msr_id']."]=1' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($metric["activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&msr_id=".$metric['msr_id']."&o=us&meta_id=".$meta_id."&metric_id=".$metric['metric_id']."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&msr_id=".$metric['msr_id']."&o=ss&meta_id=".$meta_id."&metric_id=".$metric['metric_id']."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$resPp =& $pearDBpp->query("SELECT * FROM perfdata_service_metric WHERE metric_id = '".$metric['metric_id']."'");
+		$row =& $resPp->fetchRow();
+		$elemArr1[$i] = array("MenuClass"=>"list_".$style, 
+					"RowMenu_select"=>$selectedElements->toHtml(),
+					"RowMenu_host"=>htmlentities($row["host_name"], ENT_QUOTES),
+					"RowMenu_link"=>"?p=".$p."&o=ws&msr_id=".$metric['msr_id'],
+					"RowMenu_service"=>htmlentities($row["service_description"], ENT_QUOTES),
+					"RowMenu_metric"=>$row["metric"]." (".$row["unit"].")",
+					"RowMenu_status"=>$metric["activate"] ? $lang['enable'] : $lang['disable'],
+					"RowMenu_options"=>$moptions);
+		$resPp->free();
+		$style != "two" ? $style = "two" : $style = "one";
+	}
+	$tpl->assign("elemArr1", $elemArr1);	
+
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL1"=>"?p=".$p."&o=as&meta_id=".$meta_id, "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+		
+	#Element we need when we reload the page
+	$form1->addElement('hidden', 'p');
+	$form1->addElement('hidden', 'meta_id');
+	$tab = array ("p" => $p, "meta_id"=>$meta_id);
+	$form1->setDefaults($tab);
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form1->accept($renderer);
+	$tpl->assign('form1', $renderer->toArray());
+	$tpl->display("listMetric.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/meta_service/metaService.php b/www/include/configuration/configObject/meta_service/metaService.php
new file mode 100644
index 0000000000000000000000000000000000000000..d15aef68d541b3021b47b5af061b141edcb45f49
--- /dev/null
+++ b/www/include/configuration/configObject/meta_service/metaService.php
@@ -0,0 +1,69 @@
+<?php
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Meta Service � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+
+	isset($_GET["meta_id"]) ? $cG = $_GET["meta_id"] : $cG = NULL;
+	isset($_POST["meta_id"]) ? $cP = $_POST["meta_id"] : $cP = NULL;
+	$cG ? $meta_id = $cG : $meta_id = $cP;
+	
+	isset($_GET["host_name"]) ? $cG = $_GET["host_name"] : $cG = NULL;
+	isset($_POST["host_name"]) ? $cP = $_POST["host_name"] : $cP = NULL;
+	$cG ? $host_name = $cG : $host_name = $cP;
+
+	isset($_GET["metric_id"]) ? $cG = $_GET["metric_id"] : $cG = NULL;
+	isset($_POST["metric_id"]) ? $cP = $_POST["metric_id"] : $cP = NULL;
+	$cG ? $metric_id = $cG : $metric_id = $cP;
+
+	isset($_GET["msr_id"]) ? $cG = $_GET["msr_id"] : $cG = NULL;
+	isset($_POST["msr_id"]) ? $cP = $_POST["msr_id"] : $cP = NULL;
+	$cG ? $msr_id = $cG : $msr_id = $cP;
+			
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir	
+	$path = "./include/configuration/configObject/meta_service/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formMetaService.php"); break; #Add an Meta Service
+		case "w" : require_once($path."formMetaService.php"); break; #Watch an Meta Service
+		case "c" : require_once($path."formMetaService.php"); break; #Modify an Meta Service		
+		case "s" : enableMetaServiceInDB($meta_id); require_once($path."listMetaService.php"); break; #Activate a Meta Service
+		case "u" : disableMetaServiceInDB($meta_id); require_once($path."listMetaService.php"); break; #Desactivate a Meta Service
+		case "d" : deleteMetaServiceInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listMetaService.php"); break; #Delete n Meta Servive		
+		case "m" : multipleMetaServiceInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listMetaService.php"); break; #Duplicate n Meta Service
+		case "ci" : require_once($path."listMetric.php"); break; #Manage Service of the MS
+		case "as" : require_once($path."metric.php"); break; # Add Service to a MS
+		case "cs" : require_once($path."metric.php"); break; # Change Service to a MS
+		case "ss" : enableMetricInDB($msr_id); require_once($path."listMetric.php"); break; #Activate a Metric
+		case "us" : disableMetricInDB($msr_id); require_once($path."listMetric.php"); break; #Desactivate a Metric
+		case "ws" : require_once($path."metric.php"); break; # View Service to a MS
+		case "ds" : deleteMetricInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listMetric.php"); break; #Delete n Metric		
+		default : require_once($path."listMetaService.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/meta_service/metric.ihtml b/www/include/configuration/configObject/meta_service/metric.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..299aaf7baac15c5357afa017a8506dd50882d2ab
--- /dev/null
+++ b/www/include/configuration/configObject/meta_service/metric.ihtml
@@ -0,0 +1,35 @@
+{$form.javascript}
+<div>
+    <form {$form.attributes}>
+            <table id="ListTable">
+                    <tr class="ListHeader">
+                    	<td class="FormHeader" colspan="2">{$form.header.title}</td>
+                    <tr>
+                    <tr class="list_one">
+                		<td>{$form.host_name.label}</td>
+                		<td>{$form.host_name.html}</td>
+                    </tr>
+	                <tr class="list_two">
+                        <td>{$form.metric_sel.label}</td>                   	 	
+                        <td>{$form.metric_sel.html}</td>
+	                </tr>
+                    <tr class="list_one">
+                        <td>{$form.msr_comment.label}</td>
+                        <td>{$form.msr_comment.html}</td>
+                    </tr>
+                    <tr class="list_two">
+                        <td>{$form.activate.label}</td>
+                        <td>{$form.activate.html}</td>
+                    </tr>
+            </table>
+            <div id="validForm">
+            {if $o == "as" || $o == "cs"}
+                    <p>{$form.action.html}</p>
+                    <p>{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+            {else if $o == "ws"}
+                    <p>{$form.change.html}</p>
+            {/if}
+            </div>
+            {$form.hidden}
+    </form>
+</div>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/meta_service/metric.php b/www/include/configuration/configObject/meta_service/metric.php
new file mode 100644
index 0000000000000000000000000000000000000000..277c269c3ae7e801e12957274a8273ead3c48c82
--- /dev/null
+++ b/www/include/configuration/configObject/meta_service/metric.php
@@ -0,0 +1,167 @@
+<?php
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Meta Service � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information
+	#
+	require_once("./DBPerfparseConnect.php");
+	
+	$metric = array();
+	if (($o == "cs" || $o == "ws") && $msr_id)	{	
+		# Set base value
+		$res =& $pearDB->query("SELECT * FROM meta_service_relation WHERE msr_id = '".$msr_id."'");
+		# Set base value
+		$metric1 = array_map("myDecode", $res->fetchRow());
+		$res =& $pearDBpp->query("SELECT * FROM perfdata_service_metric WHERE metric_id = '".$metric1["metric_id"]."'");		
+		$metric2 = array_map("myDecode", $res->fetchRow());
+		$metric = array_merge($metric1, $metric2);
+		$host_name =& $metric["host_name"];
+		$metric["metric_sel"][0] = $metric["service_description"];
+		$metric["metric_sel"][1] = $metric["metric_id"];
+	}
+	
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#	
+	# Perfparse Host comes from DB -> Store in $ppHosts Array
+	$ppHosts = array(NULL=>NULL);
+	$res =& $pearDBpp->query("SELECT DISTINCT host_name FROM perfdata_service_metric ORDER BY host_name");
+	while($res->fetchInto($ppHost))
+		if (array_search($ppHost["host_name"], $oreon->user->lcaHost))
+			$ppHosts[$ppHost["host_name"]] = $ppHost["host_name"]; 
+	$res->free();
+	$ppServices1 = array();
+	$ppServices2 = array();
+	if ($host_name)	{
+		# Perfparse Host comes from DB -> Store in $ppHosts Array
+		$ppServices = array(NULL=>NULL);
+		$res =& $pearDBpp->query("SELECT DISTINCT metric_id, service_description, metric, unit FROM perfdata_service_metric WHERE host_name = '".$host_name."' ORDER BY host_name");
+		while($res->fetchInto($ppService))	{
+			$ppServices1[$ppService["service_description"]] = $ppService["service_description"];
+			$ppServices2[$ppService["service_description"]][$ppService["metric_id"]] = $ppService["metric"]."  (".$ppService["unit"].")";
+		}
+		$res->free();
+	}
+	
+	$debug = 0;
+	$attrsTextI		= array("size"=>"3");
+	$attrsText 		= array("size"=>"30");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	
+	#
+	## Form begin
+	#
+	
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "as")
+		$form->addElement('header', 'title', $lang["mss_add"]);
+	else if ($o == "cs")
+		$form->addElement('header', 'title', $lang["mss_change"]);
+	else if ($o == "ws")
+		$form->addElement('header', 'title', $lang["mss_view"]);
+	#
+	## Indicator basic information
+	#
+	
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	$formMsrId =& $form->addElement('hidden', 'msr_id');
+	$formMsrId->setValue($msr_id);
+	$formMetaId =& $form->addElement('hidden', 'meta_id');
+	$formMetaId->setValue($meta_id);
+	$formMetricId =& $form->addElement('hidden', 'metric_id');
+	$formMetricId->setValue($metric_id);
+   
+	$hn =& $form->addElement('select', 'host_name', $lang["h"], $ppHosts, array("onChange"=>"this.form.submit()"));
+	$sel =& $form->addElement('hierselect', 'metric_sel', $lang["sv"]);
+	$sel->setOptions(array($ppServices1, $ppServices2));
+	
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'activate', null, $lang["enable"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'activate', null, $lang["disable"], '0');
+	$form->addGroup($tab, 'activate', $lang["status"], '&nbsp;');
+	$form->setDefaults(array('activate' => '1'));
+	$form->addElement('textarea', 'msr_comment', $lang["cmt_comment"], $attrsTextarea);
+	
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+/*	
+	if ($o == "as")	{
+		$form->addRule('host_name', $lang['ErrRequired'], 'required');
+		$form->addRule('metric_sel', $lang['ErrRequired'], 'required');
+		$form->addRule('meta_id', $lang['ErrRequired'], 'required');
+	}
+*/		
+	# Just watch
+	if ($o == "ws")	{		
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=cs&msr_id=".$msr_id."'"));
+	    $form->setDefaults($metric);
+		$form->freeze();
+	}
+	# Modify
+	else if ($o == "cs")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($metric);
+	    $hn->freeze();
+	    $sel->freeze();
+	}
+	# Add
+	else if ($o == "as")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+  
+  	$valid = false;
+	if (((isset($_POST["submitA"]) && $_POST["submitA"]) || (isset($_POST["submitC"]) && $_POST["submitC"])) && $form->validate())	{
+		$msrObj =& $form->getElement('msr_id');
+		if ($form->getSubmitValue("submitA"))
+			$msrObj->setValue(insertMetric($meta_id));
+		else if ($form->getSubmitValue("submitC"))
+			updateMetric($msrObj->getValue());
+		$o = "ws";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=cs&msr_id=".$msrObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+    }
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listMetric.php");
+	else	{	
+		# Smarty template Init
+		$tpl = new Smarty();
+		$tpl = initSmartyTpl($path, $tpl);
+			
+		#Apply a template definition	
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);
+		$tpl->assign('valid', $valid);
+		$tpl->display("metric.ihtml");
+    }
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/metaservice_dependency/DB-Func.php b/www/include/configuration/configObject/metaservice_dependency/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..ca8c3a543e1c11cc51213a457b406f302c78f6e6
--- /dev/null
+++ b/www/include/configuration/configObject/metaservice_dependency/DB-Func.php
@@ -0,0 +1,188 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+		
+	function testExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('dep_id');
+		$res =& $pearDB->query("SELECT dep_name, dep_id FROM dependency WHERE dep_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$dep =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $dep["dep_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $dep["dep_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function testCycle ($childs = NULL)	{
+		global $pearDB;
+		global $form;
+		$parents = array();
+		$childs = array();
+		if (isset($form))	{
+			$parents = $form->getSubmitValue('dep_msParents');
+			$childs = $form->getSubmitValue('dep_msChilds');
+			$childs =& array_flip($childs);
+		}
+		foreach ($parents as $parent)
+			if (array_key_exists($parent, $childs))
+				return false;
+		return true;
+	}
+
+	function deleteMetaServiceDependencyInDB ($dependencies = array())	{
+		global $pearDB;
+		foreach($dependencies as $key=>$value)
+			$pearDB->query("DELETE FROM dependency WHERE dep_id = '".$key."'");
+	}
+	
+	function multipleMetaServiceDependencyInDB ($dependencies = array(), $nbrDup = array())	{
+		foreach($dependencies as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM dependency WHERE dep_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["dep_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "dep_name" ? ($dep_name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testExistence($dep_name))	{
+					$val ? $rq = "INSERT INTO dependency VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(dep_id) FROM dependency");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(dep_id)"]))	{
+						$res =& $pearDB->query("SELECT DISTINCT meta_service_meta_id FROM dependency_metaserviceParent_relation WHERE dependency_dep_id = '".$key."'");
+						while($res->fetchInto($ms))
+							$pearDB->query("INSERT INTO dependency_metaserviceParent_relation VALUES ('', '".$maxId["MAX(dep_id)"]."', '".$ms["meta_service_meta_id"]."')");
+						$res->free();
+						$res =& $pearDB->query("SELECT DISTINCT meta_service_meta_id FROM dependency_metaserviceChild_relation WHERE dependency_dep_id = '".$key."'");
+						while($res->fetchInto($ms))
+							$pearDB->query("INSERT INTO dependency_metaserviceChild_relation VALUES ('', '".$maxId["MAX(dep_id)"]."', '".$ms["meta_service_meta_id"]."')");
+						$res->free();
+					}
+				}
+			}
+		}
+	}
+	
+	function updateMetaServiceDependencyInDB ($dep_id = NULL)	{
+		if (!$dep_id) exit();
+		updateMetaServiceDependency($dep_id);
+		updateMetaServiceDependencyMetaServiceParents($dep_id);
+		updateMetaServiceDependencyMetaServiceChilds($dep_id);
+	}	
+	
+	function insertMetaServiceDependencyInDB ()	{
+		$dep_id = insertMetaServiceDependency();
+		updateMetaServiceDependencyMetaServiceParents($dep_id);
+		updateMetaServiceDependencyMetaServiceChilds($dep_id);
+		return ($dep_id);
+	}
+	
+	function insertMetaServiceDependency()	{
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO dependency ";
+		$rq .= "(dep_name, dep_description, inherits_parent, execution_failure_criteria, notification_failure_criteria, dep_comment) ";
+		$rq .= "VALUES (";
+		isset($ret["dep_name"]) && $ret["dep_name"] != NULL ? $rq .= "'".htmlentities($ret["dep_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["dep_description"]) && $ret["dep_description"] != NULL ? $rq .= "'".htmlentities($ret["dep_description"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["inherits_parent"]["inherits_parent"]) && $ret["inherits_parent"]["inherits_parent"] != NULL ? $rq .= "'".$ret["inherits_parent"]["inherits_parent"]."', " : $rq .= "NULL, ";
+		isset($ret["execution_failure_criteria"]) && $ret["execution_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["execution_failure_criteria"]))."', " : $rq .= "NULL, ";
+		isset($ret["notification_failure_criteria"]) && $ret["notification_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["notification_failure_criteria"]))."', " : $rq .= "NULL, ";
+		isset($ret["dep_comment"]) && $ret["dep_comment"] != NULL ? $rq .= "'".htmlentities($ret["dep_comment"], ENT_QUOTES)."' " : $rq .= "NULL ";
+		$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(dep_id) FROM dependency");
+		$dep_id = $res->fetchRow();
+		return ($dep_id["MAX(dep_id)"]);
+	}
+	
+	function updateMetaServiceDependency($dep_id = null)	{
+		if (!$dep_id) exit();
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE dependency SET ";
+		$rq .= "dep_name = ";
+		isset($ret["dep_name"]) && $ret["dep_name"] != NULL ? $rq .= "'".htmlentities($ret["dep_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "dep_description = ";
+		isset($ret["dep_description"]) && $ret["dep_description"] != NULL ? $rq .= "'".htmlentities($ret["dep_description"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "inherits_parent = ";
+		isset($ret["inherits_parent"]["inherits_parent"]) && $ret["inherits_parent"]["inherits_parent"] != NULL ? $rq .= "'".$ret["inherits_parent"]["inherits_parent"]."', " : $rq .= "NULL, ";
+		$rq .= "execution_failure_criteria = ";
+		isset($ret["execution_failure_criteria"]) && $ret["execution_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["execution_failure_criteria"]))."', " : $rq .= "NULL, ";
+		$rq .= "notification_failure_criteria = ";
+		isset($ret["notification_failure_criteria"]) && $ret["notification_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["notification_failure_criteria"]))."', " : $rq .= "NULL, ";
+		$rq .= "dep_comment = ";
+		isset($ret["dep_comment"]) && $ret["dep_comment"] != NULL ? $rq .= "'".htmlentities($ret["dep_comment"], ENT_QUOTES)."' " : $rq .= "NULL ";
+		$rq .= "WHERE dep_id = '".$dep_id."'";
+		$pearDB->query($rq);
+	}
+		
+	function updateMetaServiceDependencyMetaServiceParents($dep_id = null)	{
+		if (!$dep_id) exit();
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM dependency_metaserviceParent_relation ";
+		$rq .= "WHERE dependency_dep_id = '".$dep_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("dep_msParents");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO dependency_metaserviceParent_relation ";
+			$rq .= "(dependency_dep_id, meta_service_meta_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$dep_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+		
+	function updateMetaServiceDependencyMetaServiceChilds($dep_id = null)	{
+		if (!$dep_id) exit();
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM dependency_metaserviceChild_relation ";
+		$rq .= "WHERE dependency_dep_id = '".$dep_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("dep_msChilds");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO dependency_metaserviceChild_relation ";
+			$rq .= "(dependency_dep_id, meta_service_meta_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$dep_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/metaservice_dependency/MetaServiceDependency.php b/www/include/configuration/configObject/metaservice_dependency/MetaServiceDependency.php
new file mode 100644
index 0000000000000000000000000000000000000000..c513792683af296f4d4632126e97db58441c066c
--- /dev/null
+++ b/www/include/configuration/configObject/metaservice_dependency/MetaServiceDependency.php
@@ -0,0 +1,47 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["dep_id"]) ? $cG = $_GET["dep_id"] : $cG = NULL;
+	isset($_POST["dep_id"]) ? $cP = $_POST["dep_id"] : $cP = NULL;
+	$cG ? $dep_id = $cG : $dep_id = $cP;
+	
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/metaservice_dependency/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formMetaServiceDependency.php"); break; #Add a Meta Service
+		case "w" : require_once($path."formMetaServiceDependency.php"); break; #Watch a Meta Service
+		case "c" : require_once($path."formMetaServiceDependency.php"); break; #Modify a Meta Service
+		case "m" : multipleMetaServiceDependencyInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listMetaServiceDependency.php"); break; #Duplicate n Meta Services
+		case "d" : deleteMetaServiceDependencyInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listMetaServiceDependency.php"); break; #Delete n Meta Service
+		default : require_once($path."listMetaServiceDependency.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/metaservice_dependency/formMetaServiceDependency.ihtml b/www/include/configuration/configObject/metaservice_dependency/formMetaServiceDependency.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..3cf071c3812934d9ac26b4870504278ac0dec29c
--- /dev/null
+++ b/www/include/configuration/configObject/metaservice_dependency/formMetaServiceDependency.ihtml
@@ -0,0 +1,27 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/workstation2.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/gauge.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.dep_name.label}</td><td class="FormRowValue">{$form.dep_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.dep_description.label}</td><td class="FormRowValue">{$form.dep_description.html}</td></tr>
+		{if $nagios == 2}
+			<tr class="list_one"><td class="FormRowField">{$form.inherits_parent.label}</td><td class="FormRowValue">{$form.inherits_parent.html}</td></tr>
+		{/if}
+		<tr class="list_one"><td class="FormRowField">{$form.execution_failure_criteria.label}</td><td class="FormRowValue">{$form.execution_failure_criteria.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.notification_failure_criteria.label}</td><td class="FormRowValue">{$form.notification_failure_criteria.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.dep_msParents.label}</td><td class="FormRowValue">{$form.dep_msParents.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.dep_msChilds.label}</td><td class="FormRowValue">{$form.dep_msChilds.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.dep_comment.label}</td><td class="FormRowValue">{$form.dep_comment.html}</td></tr>
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+{$form.hidden}
+</form>
+
diff --git a/www/include/configuration/configObject/metaservice_dependency/formMetaServiceDependency.php b/www/include/configuration/configObject/metaservice_dependency/formMetaServiceDependency.php
new file mode 100644
index 0000000000000000000000000000000000000000..d3aee088acfb1be19686e17939a7e39f3424ea8e
--- /dev/null
+++ b/www/include/configuration/configObject/metaservice_dependency/formMetaServiceDependency.php
@@ -0,0 +1,201 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Dependency
+	#
+	$dep = array();
+	if (($o == "c" || $o == "w") && $dep_id)	{
+		$res =& $pearDB->query("SELECT * FROM dependency WHERE dep_id = '".$dep_id."' LIMIT 1");
+		# Set base value
+		$dep = array_map("myDecode", $res->fetchRow());
+		# Set Notification Failure Criteria
+		$dep["notification_failure_criteria"] =& explode(',', $dep["notification_failure_criteria"]);
+		foreach ($dep["notification_failure_criteria"] as $key => $value)
+			$dep["notification_failure_criteria"][trim($value)] = 1;
+		# Set Execution Failure Criteria
+		$dep["execution_failure_criteria"] =& explode(',', $dep["execution_failure_criteria"]);
+		foreach ($dep["execution_failure_criteria"] as $key => $value)
+			$dep["execution_failure_criteria"][trim($value)] = 1;
+		# Set Meta Service Parents
+		$res =& $pearDB->query("SELECT DISTINCT meta_service_meta_id FROM dependency_metaserviceParent_relation WHERE dependency_dep_id = '".$dep_id."'");
+		for($i = 0; $res->fetchInto($msP); $i++)
+			$dep["dep_msParents"][$i] = $msP["meta_service_meta_id"];
+		$res->free();
+		# Set Meta Service Childs
+		$res =& $pearDB->query("SELECT DISTINCT meta_service_meta_id FROM dependency_metaserviceChild_relation WHERE dependency_dep_id = '".$dep_id."'");
+		for($i = 0; $res->fetchInto($msC); $i++)
+			$dep["dep_msChilds"][$i] = $msC["meta_service_meta_id"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Meta Service comes from DB -> Store in $metas Array
+	$metas = array();
+	$res =& $pearDB->query("SELECT meta_id, meta_name FROM meta_service ORDER BY meta_name");
+	while($res->fetchInto($meta))
+		$metas[$meta["meta_id"]] = $meta["meta_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsText2 	= array("size"=>"10");
+	$attrsAdvSelect = array("style" => "width: 250px; height: 150px;");
+	$attrsTextarea 	= array("rows"=>"3", "cols"=>"30");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["dep_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["dep_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["dep_view"]);
+
+	#
+	## Dependency basic information
+	#
+	$form->addElement('header', 'information', $lang['dep_infos']);
+	$form->addElement('text', 'dep_name', $lang["dep_name"], $attrsText);
+	$form->addElement('text', 'dep_description', $lang["dep_description"], $attrsText);
+	if ($oreon->user->get_version() == 2)	{
+		$tab = array();
+		$tab[] = &HTML_QuickForm::createElement('radio', 'inherits_parent', null, $lang['yes'], '1');
+		$tab[] = &HTML_QuickForm::createElement('radio', 'inherits_parent', null, $lang['no'], '0');
+		$form->addGroup($tab, 'inherits_parent', $lang["dep_inheritsP"], '&nbsp;');
+	}
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'o', '&nbsp;', 'Ok');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'w', '&nbsp;', 'Warning');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unknown');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'c', '&nbsp;', 'Critical');
+	if ($oreon->user->get_version() == 2)
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'p', '&nbsp;', 'Pending');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'n', '&nbsp;', 'None');
+	$form->addGroup($tab, 'notification_failure_criteria', $lang["dep_notifFC"], '&nbsp;&nbsp;');
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'o', '&nbsp;', 'Ok');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'w', '&nbsp;', 'Warning');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unknown');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'c', '&nbsp;', 'Critical');
+	if ($oreon->user->get_version() == 2)
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'p', '&nbsp;', 'Pending');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'n', '&nbsp;', 'None');
+	$form->addGroup($tab, 'execution_failure_criteria', $lang["dep_exeFC"], '&nbsp;&nbsp;');
+
+	$ams1 =& $form->addElement('advmultiselect', 'dep_msParents', $lang['dep_msPar'], $metas, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+    $ams1 =& $form->addElement('advmultiselect', 'dep_msChilds', $lang['dep_msChi'], $metas, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+	$form->addElement('textarea', 'dep_comment', $lang["dep_comment"], $attrsTextarea);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+
+	$form->addElement('hidden', 'dep_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('dep_name', $lang['ErrName'], 'required');
+	$form->addRule('dep_description', $lang['ErrRequired'], 'required');
+	$form->addRule('dep_msParents', $lang['ErrRequired'], 'required');
+	$form->addRule('dep_msChilds', $lang['ErrRequired'], 'required');
+	$form->registerRule('cycle', 'callback', 'testCycle');
+	$form->addRule('dep_msChilds', $lang['ErrCycleDef'], 'cycle');
+	$form->registerRule('exist', 'callback', 'testExistence');
+	$form->addRule('dep_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Just watch a Dependency information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&dep_id=".$dep_id."'"));
+	    $form->setDefaults($dep);
+		$form->freeze();
+	}
+	# Modify a Dependency information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($dep);
+	}
+	# Add a Dependency information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	$tpl->assign("nagios", $oreon->user->get_version());
+
+	$valid = false;
+	if ($form->validate())	{
+		$depObj =& $form->getElement('dep_id');
+		if ($form->getSubmitValue("submitA"))
+			$depObj->setValue(insertMetaServiceDependencyInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateMetaServiceDependencyInDB($depObj->getValue("dep_id"));
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&dep_id=".$depObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once("listMetaServiceDependency.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->display("formMetaServiceDependency.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/metaservice_dependency/listMetaServiceDependency.ihtml b/www/include/configuration/configObject/metaservice_dependency/listMetaServiceDependency.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..7db74a21fdfa3aecc122ca34e392dff8107ed1e3
--- /dev/null
+++ b/www/include/configuration/configObject/metaservice_dependency/listMetaServiceDependency.ihtml
@@ -0,0 +1,40 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_description}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_description}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter"></td>
+			<td class="ListColFooterRight" align="right" colpan="2"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+
+{$form.hidden}
\ No newline at end of file
diff --git a/www/include/configuration/configObject/metaservice_dependency/listMetaServiceDependency.php b/www/include/configuration/configObject/metaservice_dependency/listMetaServiceDependency.php
new file mode 100644
index 0000000000000000000000000000000000000000..e5f1388da94207836ebc6ed188462e3f24b91918
--- /dev/null
+++ b/www/include/configuration/configObject/metaservice_dependency/listMetaServiceDependency.php
@@ -0,0 +1,132 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	isset($_GET["list"]) ? $list = $_GET["list"] : $list = NULL;
+	# HostGroup LCA
+	$oreon->user->lcaHGStr ? $lcaHGStr = $oreon->user->lcaHGStr : $lcaHGStr =  '\'\'';
+	$rq = "SELECT COUNT(*) FROM dependency dep";
+	$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM dependency_metaserviceParent_relation dmspr WHERE dmspr.dependency_dep_id = dep.dep_id) > 0 AND (SELECT DISTINCT COUNT(*) FROM dependency_metaserviceChild_relation dmspr WHERE dmspr.dependency_dep_id = dep.dep_id) > 0";
+	if ($search)
+		$rq .= " AND dep_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'";
+	$res = & $pearDB->query($rq);
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_description", $lang['description']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Dependcy list
+	$rq = "SELECT dep_id, dep_name, dep_description FROM dependency dep";
+	$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM dependency_metaserviceParent_relation dmspr WHERE dmspr.dependency_dep_id = dep.dep_id) > 0 AND (SELECT DISTINCT COUNT(*) FROM dependency_metaserviceChild_relation dmspr WHERE dmspr.dependency_dep_id = dep.dep_id) > 0";
+	if ($search)
+		$rq .= " AND dep_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'";
+	$rq .= " LIMIT ".$num * $limit.", ".$limit;
+	$res =& $pearDB->query($rq);
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($dep); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$dep['dep_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&dep_id=".$dep['dep_id']."&o=w&search=".$search."&list=".$list."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&dep_id=".$dep['dep_id']."&o=c&search=".$search."&list=".$list."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&dep_id=".$dep['dep_id']."&o=d&select[".$dep['dep_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."&list=".$list."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$dep['dep_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$dep["dep_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&dep_id=".$dep['dep_id'],
+						"RowMenu_description"=>$dep["dep_description"],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+	#Fill a tab with different page numbers and link
+	$pageArr = array();
+	for ($i = 0; $i < ($rows / $limit); $i++)
+		$pageArr[$i] = array("url_page"=>"./oreon.php?p=".$p."&num=$i&limit=".$limit."&search=".$search."&list=".$list,
+														"label_page"=>"<b>".($i +1)."</b>",
+"num"=> $i);
+	if($i > 1)							
+	$tpl->assign("pageArr", $pageArr);
+
+	$tpl->assign("num", $num);
+	$tpl->assign("previous", $lang["previous"]);
+	$tpl->assign("next", $lang["next"]);
+
+	if(($prev = $num - 1) >= 0)
+	$tpl->assign('pagePrev', ("./oreon.php?p=".$p."&num=$prev&limit=".$limit."&search=".$search));
+	if(($next = $num + 1) < ($rows/$limit))
+	$tpl->assign('pageNext', ("./oreon.php?p=".$p."&num=$next&limit=".$limit."&search=".$search));
+	$tpl->assign('pageNumber', ($num +1)."/".ceil($rows / $limit));
+	
+	#Select field to change the number of row on the page
+	for ($i = 10; $i <= 100; $i = $i +10)
+		$select[$i]=$i;
+	$select[$gopt["maxViewConfiguration"]]=$gopt["maxViewConfiguration"];
+	ksort($select);
+
+	$selLim =& $form->addElement('select', 'limit', $lang['nbr_per_page'], $select, array("onChange" => "this.form.submit('')"));
+	$selLim->setSelected($limit);
+	
+	#Element we need when we reload the page
+	$form->addElement('hidden', 'p');
+	$form->addElement('hidden', 'search');
+	$form->addElement('hidden', 'num');
+	$form->addElement('hidden', 'list');
+	$tab = array ("p" => $p, "search" => $search, "num"=>$num, "list"=>$list);
+	$form->setDefaults($tab);	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listMetaServiceDependency.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/purgePolicy/DB-Func.php b/www/include/configuration/configObject/purgePolicy/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..33648dbe1b7df41189483cc6f2682456b8083853
--- /dev/null
+++ b/www/include/configuration/configObject/purgePolicy/DB-Func.php
@@ -0,0 +1,132 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+
+	function testPurgePolicyExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('purge_policy_id');
+		$res =& $pearDB->query("SELECT purge_policy_name, purge_policy_id FROM purge_policy WHERE purge_policy_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$pp =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $pp["purge_policy_id"] == $id)
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $pp["purge_policy_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function deletePurgePolicyInDB ($ppols = array())	{
+		global $pearDB;
+		foreach($ppols as $key=>$value)
+			$pearDB->query("DELETE FROM purge_policy WHERE purge_policy_id = '".$key."'");
+	}
+
+	function multiplePurgePolicyInDB ($ppols = array(), $nbrDup = array())	{
+		foreach($ppols as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM purge_policy WHERE purge_policy_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["purge_policy_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "purge_policy_name" ? ($purge_policy_name = $value2 = $value2." ".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2 != NULL?("'".$value2."'"):"NULL");
+				}
+				if (testPurgePolicyExistence($purge_policy_name))	{
+					$val ? $rq = "INSERT INTO purge_policy VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+				}
+			}
+		}
+	}
+
+	function updatePurgePolicyInDB ($purge_policy_id = NULL)	{
+		if (!$purge_policy_id) return;
+		updatePurgePolicy($purge_policy_id);
+	}
+
+	function insertPurgePolicyInDB ($ret = array())	{
+		$purge_policy_id = insertPurgePolicy($ret);
+		return ($purge_policy_id);
+	}
+
+	function insertPurgePolicy($ret = array())	{
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO `purge_policy` " .
+				"( `purge_policy_id` , `purge_policy_name` , `purge_policy_alias` , " .
+				"`purge_policy_retention` , `purge_policy_raw` , `purge_policy_bin` , " .
+				"`purge_policy_metric` , `purge_policy_service` , `purge_policy_host` , " .
+				"`purge_policy_comment` )" .
+				"VALUES ('', ";
+		isset($ret["purge_policy_name"]) && $ret["purge_policy_name"] != NULL ? $rq .= "'".htmlentities($ret["purge_policy_name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["purge_policy_alias"]) && $ret["purge_policy_alias"] != NULL ? $rq .= "'".htmlentities($ret["purge_policy_alias"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["purge_policy_retention"]) && $ret["purge_policy_retention"] != NULL ? $rq .= "'".$ret["purge_policy_retention"]."', ": $rq .= "NULL, ";
+		isset($ret["purge_policy_raw"]["purge_policy_raw"]) && $ret["purge_policy_raw"]["purge_policy_raw"] != NULL ? $rq .= "'".$ret["purge_policy_raw"]["purge_policy_raw"]."', ": $rq .= "NULL, ";
+		isset($ret["purge_policy_bin"]["purge_policy_bin"]) && $ret["purge_policy_bin"]["purge_policy_bin"] != NULL ? $rq .= "'".$ret["purge_policy_bin"]["purge_policy_bin"]."', ": $rq .= "NULL, ";
+		isset($ret["purge_policy_metric"]["purge_policy_metric"]) && $ret["purge_policy_metric"]["purge_policy_metric"] != NULL ? $rq .= "'".$ret["purge_policy_metric"]["purge_policy_metric"]."', ": $rq .= "NULL, ";
+		isset($ret["purge_policy_service"]["purge_policy_service"]) && $ret["purge_policy_service"]["purge_policy_service"] != NULL ? $rq .= "'".$ret["purge_policy_service"]["purge_policy_service"]."', ": $rq .= "NULL, ";
+		isset($ret["purge_policy_host"]["purge_policy_host"]) && $ret["purge_policy_host"]["purge_policy_host"] != NULL ? $rq .= "'".$ret["purge_policy_host"]["purge_policy_host"]."', ": $rq .= "NULL, ";
+		isset($ret["purge_policy_comment"]) && $ret["purge_policy_comment"] != NULL ? $rq .= "'".htmlentities($ret["purge_policy_comment"], ENT_QUOTES)."'": $rq .= "NULL";
+		$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(purge_policy_id) FROM purge_policy");
+		$purge_policy_id = $res->fetchRow();
+		return ($purge_policy_id["MAX(purge_policy_id)"]);
+	}
+
+	function updatePurgePolicy($purge_policy_id = null)	{
+		if (!$purge_policy_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE purge_policy ";
+		$rq .= "SET  purge_policy_name = ";
+		isset($ret["purge_policy_name"]) && $ret["purge_policy_name"] != NULL ? $rq .= "'".htmlentities($ret["purge_policy_name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "purge_policy_alias = ";
+		isset($ret["purge_policy_alias"]) && $ret["purge_policy_alias"] != NULL ? $rq .= "'".htmlentities($ret["purge_policy_alias"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "purge_policy_retention = ";
+		isset($ret["purge_policy_retention"]) && $ret["purge_policy_retention"] != NULL ? $rq .= "'".htmlentities($ret["purge_policy_retention"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "purge_policy_raw = ";
+		isset($ret["purge_policy_raw"]["purge_policy_raw"]) && $ret["purge_policy_raw"]["purge_policy_raw"] != NULL ? $rq .= "'".$ret["purge_policy_raw"]["purge_policy_raw"]."', ": $rq .= "NULL, ";
+		$rq .= "purge_policy_bin = ";
+		isset($ret["purge_policy_bin"]["purge_policy_bin"]) && $ret["purge_policy_bin"]["purge_policy_bin"] != NULL ? $rq .= "'".$ret["purge_policy_bin"]["purge_policy_bin"]."', ": $rq .= "NULL, ";
+		$rq .= "purge_policy_metric = ";
+		isset($ret["purge_policy_metric"]["purge_policy_metric"]) && $ret["purge_policy_metric"]["purge_policy_metric"] != NULL ? $rq .= "'".$ret["purge_policy_metric"]["purge_policy_metric"]."', ": $rq .= "NULL, ";
+		$rq .= "purge_policy_service = ";
+		isset($ret["purge_policy_service"]["purge_policy_service"]) && $ret["purge_policy_service"]["purge_policy_service"] != NULL ? $rq .= "'".$ret["purge_policy_service"]["purge_policy_service"]."', ": $rq .= "NULL, ";
+		$rq .= "purge_policy_host = ";
+		isset($ret["purge_policy_host"]["purge_policy_host"]) && $ret["purge_policy_host"]["purge_policy_host"] != NULL ? $rq .= "'".$ret["purge_policy_host"]["purge_policy_host"]."', ": $rq .= "NULL, ";
+		$rq .= "purge_policy_comment = ";
+		isset($ret["purge_policy_comment"]) && $ret["purge_policy_comment"] != NULL ? $rq .= "'".htmlentities($ret["purge_policy_comment"], ENT_QUOTES)."' ": $rq .= "NULL ";
+		$rq .= "WHERE purge_policy_id = '".$purge_policy_id."'";
+		$pearDB->query($rq);
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/purgePolicy/formPurgePolicy.ihtml b/www/include/configuration/configObject/purgePolicy/formPurgePolicy.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..d694fc2a4185f1f59c301a3b56d47c6627c38201
--- /dev/null
+++ b/www/include/configuration/configObject/purgePolicy/formPurgePolicy.ihtml
@@ -0,0 +1,33 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./modules/img/icones/16x16/data_down.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/house.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.purge_policy_name.label}</td><td class="FormRowValue">{$form.purge_policy_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.purge_policy_alias.label}</td><td class="FormRowValue">{$form.purge_policy_alias.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.purge_policy_retention.label}</td><td class="FormRowValue">{$form.purge_policy_retention.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.purge_policy_host.label}</td><td class="FormRowValue">{$form.purge_policy_host.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.purge_policy_service.label}</td><td class="FormRowValue">{$form.purge_policy_service.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.purge_policy_metric.label}</td><td class="FormRowValue">{$form.purge_policy_metric.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.purge_policy_raw.label}</td><td class="FormRowValue">{$form.purge_policy_raw.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.purge_policy_bin.label}</td><td class="FormRowValue">{$form.purge_policy_bin.html}</td></tr>
+		
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/cookies.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.purge_policy_comment.label}</td><td class="FormRowValue">{$form.purge_policy_comment.html}</td></tr>
+
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
+
diff --git a/www/include/configuration/configObject/purgePolicy/formPurgePolicy.php b/www/include/configuration/configObject/purgePolicy/formPurgePolicy.php
new file mode 100644
index 0000000000000000000000000000000000000000..1f67ea75235497456badd78f355437a4e72fc8e3
--- /dev/null
+++ b/www/include/configuration/configObject/purgePolicy/formPurgePolicy.php
@@ -0,0 +1,176 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Contact
+	#
+	$ppol = array();
+	if (($o == "c" || $o == "w") && $purge_policy_id)	{
+		$res =& $pearDB->query("SELECT * FROM purge_policy WHERE purge_policy_id = '".$purge_policy_id."' LIMIT 1");
+		# Set base value
+		$ppol = array_map("myDecode", $res->fetchRow());
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["mod_purgePolicy_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["mod_purgePolicy_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["mod_purgePolicy_view"]);
+
+	#
+	## Purge Policy basic information
+	#
+	$form->addElement('header', 'information', $lang["mod_purgePolicy_infos"]);
+	$form->addElement('text', 'purge_policy_name', $lang["mod_purgePolicy_name"], $attrsText);
+	$form->addElement('text', 'purge_policy_alias', $lang["mod_purgePolicy_alias"], $attrsText);
+	$form->addElement('text', 'purge_policy_alias', $lang["mod_purgePolicy_alias"], $attrsText);
+	$periods = array(	"86400"=>$lang["giv_sr_p24h"],
+						"172800"=>$lang["giv_sr_p2d"],
+						"302400"=>$lang["giv_sr_p4d"],	
+						"604800"=>$lang["giv_sr_p7d"],
+						"1209600"=>$lang["giv_sr_p14d"],
+						"2419200"=>$lang["giv_sr_p28d"],
+						"2592000"=>$lang["giv_sr_p30d"],
+						"2678400"=>$lang["giv_sr_p31d"],
+						"5184000"=>$lang["giv_sr_p2m"],
+						"10368000"=>$lang["giv_sr_p4m"],
+						"15552000"=>$lang["giv_sr_p6m"],
+						"31104000"=>$lang["giv_sr_p1y"]);	
+	$sel =& $form->addElement('select', 'purge_policy_retention', $lang["mod_purgePolicy_retain"], $periods);
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'purge_policy_host', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'purge_policy_host', null, $lang["no"], '0');
+	$form->addGroup($tab, 'purge_policy_host', $lang["mod_purgePolicy_host"], '&nbsp;');
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'purge_policy_service', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'purge_policy_service', null, $lang["no"], '0');
+	$form->addGroup($tab, 'purge_policy_service', $lang["mod_purgePolicy_service"], '&nbsp;');
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'purge_policy_metric', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'purge_policy_metric', null, $lang["no"], '0');
+	$form->addGroup($tab, 'purge_policy_metric', $lang["mod_purgePolicy_metric"], '&nbsp;');
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'purge_policy_bin', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'purge_policy_bin', null, $lang["no"], '0');
+	$form->addGroup($tab, 'purge_policy_bin', $lang["mod_purgePolicy_bin"], '&nbsp;');
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'purge_policy_raw', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'purge_policy_raw', null, $lang["no"], '0');
+	$form->addGroup($tab, 'purge_policy_raw', $lang["mod_purgePolicy_raw"], '&nbsp;');
+	
+	$form->setDefaults(array('purge_policy_bin'=>'1', 'purge_policy_raw'=>'1', 'purge_policy_metric'=>'0', 'purge_policy_service'=>'0', 'purge_policy_host'=>'0', ));
+	
+	$form->addElement('textarea', 'purge_policy_comment', $lang["mod_purgePolicy_comment"], $attrsTextarea);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+
+	$form->addElement('hidden', 'purge_policy_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('purge_policy_name', $lang['ErrName'], 'required');
+	$form->addRule('purge_policy_alias', $lang['ErrAlias'], 'required');
+	$form->addRule('purge_policy_host', $lang['ErrRequired'], 'required');
+	$form->addRule('purge_policy_service', $lang['ErrRequired'], 'required');
+	$form->addRule('purge_policy_metric', $lang['ErrRequired'], 'required');
+	$form->addRule('purge_policy_raw', $lang['ErrRequired'], 'required');
+	$form->addRule('purge_policy_bin', $lang['ErrRequired'], 'required');
+	$form->registerRule('exist', 'callback', 'testPurgePolicyExistence');
+	$form->addRule('purge_policy_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Just watch a contact information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&purge_policy_id=".$purge_policy_id."'"));
+	    $form->setDefaults($ppol);
+		$form->freeze();
+	}
+	# Modify a contact information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($ppol);
+	}
+	# Add a contact information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+
+	$valid = false;
+	if ($form->validate())	{
+		$ppolObj =& $form->getElement('purge_policy_id');
+		if ($form->getSubmitValue("submitA"))
+			$ppolObj->setValue(insertPurgePolicyInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updatePurgePolicyInDB($ppolObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&purge_policy_id=".$ppolObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listPurgePolicy.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->display("formPurgePolicy.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/purgePolicy/listPurgePolicy.ihtml b/www/include/configuration/configObject/purgePolicy/listPurgePolicy.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..ea1526c69c44ab119adfa3889bf862ace6f4ab40
--- /dev/null
+++ b/www/include/configuration/configObject/purgePolicy/listPurgePolicy.ihtml
@@ -0,0 +1,50 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_host}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_service}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_metric}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_raw}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_bin}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_host}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_service}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_metric}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_raw}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_bin}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="6"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/purgePolicy/listPurgePolicy.php b/www/include/configuration/configObject/purgePolicy/listPurgePolicy.php
new file mode 100644
index 0000000000000000000000000000000000000000..1b21fa85a4be28d1f9c3e44e76d7c084127253c1
--- /dev/null
+++ b/www/include/configuration/configObject/purgePolicy/listPurgePolicy.php
@@ -0,0 +1,102 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM purge_policy WHERE purge_policy_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM purge_policy");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_raw", $lang["mod_purgePolicy_listRaw"]);
+	$tpl->assign("headerMenu_bin", $lang["mod_purgePolicy_listBin"]);
+	$tpl->assign("headerMenu_metric", $lang["mod_purgePolicy_listMetric"]);
+	$tpl->assign("headerMenu_service", $lang["mod_purgePolicy_listService"]);
+	$tpl->assign("headerMenu_host", $lang["mod_purgePolicy_listHost"]);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Contact list
+	if ($search)
+		$rq = "SELECT *  FROM purge_policy WHERE purge_policy_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' ORDER BY purge_policy_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT * FROM purge_policy ORDER BY purge_policy_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($purgePolicy); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$purgePolicy['purge_policy_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&purge_policy_id=".$purgePolicy['purge_policy_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&purge_policy_id=".$purgePolicy['purge_policy_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&purge_policy_id=".$purgePolicy['purge_policy_id']."&o=d&select[".$purgePolicy['purge_policy_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$purgePolicy['purge_policy_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$purgePolicy["purge_policy_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&purge_policy_id=".$purgePolicy['purge_policy_id'],
+						"RowMenu_desc"=>$purgePolicy["purge_policy_alias"],
+						"RowMenu_host"=>$purgePolicy["purge_policy_host"] ? "x" : NULL,
+						"RowMenu_service"=>$purgePolicy["purge_policy_service"] ? "x" : NULL,
+						"RowMenu_metric"=>$purgePolicy["purge_policy_metric"] ? "x" : NULL,
+						"RowMenu_raw"=>$purgePolicy["purge_policy_raw"] ? "x" : NULL,
+						"RowMenu_bin"=>$purgePolicy["purge_policy_bin"] ? "x" : NULL,
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listPurgePolicy.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/purgePolicy/purgePolicy.php b/www/include/configuration/configObject/purgePolicy/purgePolicy.php
new file mode 100644
index 0000000000000000000000000000000000000000..f12fc23f939bc29a905239bf9ce173a15d6d7414
--- /dev/null
+++ b/www/include/configuration/configObject/purgePolicy/purgePolicy.php
@@ -0,0 +1,47 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["purge_policy_id"]) ? $cG = $_GET["purge_policy_id"] : $cG = NULL;
+	isset($_POST["purge_policy_id"]) ? $cP = $_POST["purge_policy_id"] : $cP = NULL;
+	$cG ? $purge_policy_id = $cG : $purge_policy_id = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/purgePolicy/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formPurgePolicy.php"); break; #Add a purge_policy
+		case "w" : require_once($path."formPurgePolicy.php"); break; #Watch a purge_policy
+		case "c" : require_once($path."formPurgePolicy.php"); break; #Modify a purge_policy
+		case "m" : multiplePurgePolicyInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listPurgePolicy.php"); break; #Duplicate n purge_policys
+		case "d" : deletePurgePolicyInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listPurgePolicy.php"); break; #Delete n purge_policys
+		default : require_once($path."listPurgePolicy.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/service/DB-Func.php b/www/include/configuration/configObject/service/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..a59662f024f643a50ebbe92b5f37cab99fbe7908
--- /dev/null
+++ b/www/include/configuration/configObject/service/DB-Func.php
@@ -0,0 +1,448 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+		
+	function testServiceExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('service_id');
+		$res =& $pearDB->query("SELECT service_id FROM service WHERE service_description = '".htmlentities($name, ENT_QUOTES)."'");
+		$service =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $service["service_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $service["service_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function enableServiceInDB ($service_id = null)	{
+		if (!$service_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE service SET service_activate = '1' WHERE service_id = '".$service_id."'");
+	}
+	
+	function disableServiceInDB ($service_id = null)	{
+		if (!$service_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE service SET service_activate = '0' WHERE service_id = '".$service_id."'");
+	}
+	
+	function deleteServiceInDB ($services = array())	{
+		global $pearDB;
+		global $oreon;
+		foreach($services as $key=>$value)	{
+			$res =& $pearDB->query("SELECT service_id FROM service WHERE service_template_model_stm_id = '".$key."'");
+			while ($res->fetchInto($row))
+				$pearDB->query("UPDATE service SET service_template_model_stm_id = NULL WHERE service_id = '".$row["service_id"]."'");
+			$pearDB->query("DELETE FROM service WHERE service_id = '".$key."'");
+			$files = glob($oreon->optGen["oreon_rrdbase_path"]."*_".$key.".rrd");
+			foreach ($files as $filename)
+				unlink ($filename);
+		}
+	}
+	
+	function multipleServiceInDB ($services = array(), $nbrDup = array(), $host = NULL)	{
+		# Foreach Service
+		foreach($services as $key=>$value)	{
+			global $pearDB;
+			# Get all information about it
+			$res =& $pearDB->query("SELECT * FROM service WHERE service_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["service_id"] = '';
+			# Loop on the number of Service we want to duplicate
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				# Create a sentence which contains all the value
+				foreach ($row as $key2=>$value2)	{
+					if (!$host) # Not put an '_nbr' when it's a duplication for another Host
+						$key2 == "service_description" ? ($service_description = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				$val ? $rq = "INSERT INTO service VALUES (".$val.")" : $rq = null;
+				$pearDB->query($rq);
+				$res =& $pearDB->query("SELECT MAX(service_id) FROM service");
+				$maxId =& $res->fetchRow();
+				if (isset($maxId["MAX(service_id)"]))	{
+					# Host duplication case -> Duplicate the Service for the Host we create
+					if ($host)
+						$pearDB->query("INSERT INTO host_service_relation VALUES ('', NULL, '".$host."', NULL, '".$maxId["MAX(service_id)"]."')");
+					else	{
+					# Service duplication case -> Duplicate the Service for each relation the base Service have
+						$res =& $pearDB->query("SELECT DISTINCT host_host_id, hostgroup_hg_id FROM host_service_relation WHERE service_service_id = '".$key."'");
+						while($res->fetchInto($service))	{
+							if ($service["host_host_id"])				
+								$pearDB->query("INSERT INTO host_service_relation VALUES ('', NULL, '".$service["host_host_id"]."', NULL, '".$maxId["MAX(service_id)"]."')");
+							else if ($service["hostgroup_hg_id"])	
+								$pearDB->query("INSERT INTO host_service_relation VALUES ('', '".$service["hostgroup_hg_id"]."', NULL, NULL, '".$maxId["MAX(service_id)"]."')");
+						}
+					}
+					$res =& $pearDB->query("SELECT DISTINCT contactgroup_cg_id FROM contactgroup_service_relation WHERE service_service_id = '".$key."'");
+					while($res->fetchInto($Cg))
+						$pearDB->query("INSERT INTO contactgroup_service_relation VALUES ('', '".$Cg["contactgroup_cg_id"]."', '".$maxId["MAX(service_id)"]."')");
+					$res =& $pearDB->query("SELECT DISTINCT servicegroup_sg_id FROM servicegroup_relation WHERE service_service_id = '".$key."'");
+					while($res->fetchInto($Sg))
+						$pearDB->query("INSERT INTO servicegroup_relation VALUES ('', '".$maxId["MAX(service_id)"]."', '".$Sg["servicegroup_sg_id"]."')");
+					$res =& $pearDB->query("SELECT * FROM extended_service_information WHERE service_service_id = '".$key."'");
+					while($res->fetchInto($esi))	{
+						$val = null;
+						$esi["service_service_id"] = $maxId["MAX(service_id)"];
+						$esi["esi_id"] = NULL;
+						foreach ($esi as $key2=>$value2)
+							$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+						$val ? $rq = "INSERT INTO extended_service_information VALUES (".$val.")" : $rq = null;
+						$pearDB->query($rq);
+					}
+				}
+			}
+		}
+	}
+	
+	function updateServiceInDB ($service_id = NULL)	{
+		if (!$service_id) return;
+		updateService($service_id);
+		updateServiceContactGroup($service_id);
+		updateServiceHost($service_id);
+		updateServiceServiceGroup($service_id);
+		updateServiceExtInfos($service_id);
+		updateServiceTrap($service_id);
+	}	
+	
+	function insertServiceInDB ($ret = array())	{
+		$service_id = insertService($ret);
+		updateServiceContactGroup($service_id, $ret);
+		updateServiceHost($service_id, $ret);
+		updateServiceServiceGroup($service_id, $ret);
+		insertServiceExtInfos($service_id, $ret);
+		updateServiceTrap($service_id, $ret);
+		return ($service_id);
+	}
+	
+	function insertService($ret = array())	{
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		if (isset($ret["command_command_id_arg"]) && $ret["command_command_id_arg"] != NULL)		{
+			$ret["command_command_id_arg"] = str_replace("\n", "#BR#", $ret["command_command_id_arg"]);
+			$ret["command_command_id_arg"] = str_replace("\t", "#T#", $ret["command_command_id_arg"]);
+			$ret["command_command_id_arg"] = str_replace("\r", "#R#", $ret["command_command_id_arg"]);
+			$ret["command_command_id_arg"] = str_replace('/', "#S#", $ret["command_command_id_arg"]);
+			$ret["command_command_id_arg"] = str_replace('\\', "#BS#", $ret["command_command_id_arg"]);
+		}
+		if (isset($ret["command_command_id_arg2"]) && $ret["command_command_id_arg2"] != NULL)		{
+			$ret["command_command_id_arg2"] = str_replace("\n", "#BR#", $ret["command_command_id_arg2"]);
+			$ret["command_command_id_arg2"] = str_replace("\t", "#T#", $ret["command_command_id_arg2"]);
+			$ret["command_command_id_arg2"] = str_replace("\r", "#R#", $ret["command_command_id_arg2"]);
+			$ret["command_command_id_arg2"] = str_replace('/', "#S#", $ret["command_command_id_arg2"]);
+			$ret["command_command_id_arg2"] = str_replace('\\', "#BS#", $ret["command_command_id_arg2"]);
+		}
+		$rq = "INSERT INTO service " .
+				"(service_template_model_stm_id, command_command_id, timeperiod_tp_id, command_command_id2, timeperiod_tp_id2, purge_policy_id, " .
+				"service_description, service_is_volatile, service_max_check_attempts, service_normal_check_interval, service_retry_check_interval, service_active_checks_enabled, " .
+				"service_passive_checks_enabled, service_parallelize_check, service_obsess_over_service, service_check_freshness, service_freshness_threshold, " .
+				"service_event_handler_enabled, service_low_flap_threshold, service_high_flap_threshold, service_flap_detection_enabled, " .
+				"service_process_perf_data, service_retain_status_information, service_retain_nonstatus_information, service_notification_interval, " .
+				"service_notification_options, service_notifications_enabled, service_stalking_options, service_comment, command_command_id_arg, command_command_id_arg2, service_register, service_activate) " .
+				"VALUES ( ";
+				isset($ret["service_template_model_stm_id"]) && $ret["service_template_model_stm_id"] != NULL ? $rq .= "'".$ret["service_template_model_stm_id"]."', ": $rq .= "NULL, ";
+				isset($ret["command_command_id"]) && $ret["command_command_id"] != NULL ? $rq .= "'".$ret["command_command_id"]."', ": $rq .= "NULL, ";
+				isset($ret["timeperiod_tp_id"]) && $ret["timeperiod_tp_id"] != NULL ? $rq .= "'".$ret["timeperiod_tp_id"]."', ": $rq .= "NULL, ";
+				isset($ret["command_command_id2"]) && $ret["command_command_id2"] != NULL ? $rq .= "'".$ret["command_command_id2"]."', ": $rq .= "NULL, ";
+				isset($ret["timeperiod_tp_id2"]) && $ret["timeperiod_tp_id2"] != NULL ? $rq .= "'".$ret["timeperiod_tp_id2"]."', ": $rq .= "NULL, ";
+				isset($ret["purge_policy_id"]) && $ret["purge_policy_id"] != NULL ? $rq .= "'".$ret["purge_policy_id"]."', ": $rq .= "NULL, ";
+				isset($ret["service_description"]) && $ret["service_description"] != NULL ? $rq .= "'".htmlentities($ret["service_description"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+				isset($ret["service_is_volatile"]) && $ret["service_is_volatile"]["service_is_volatile"] != 2 ? $rq .= "'".$ret["service_is_volatile"]["service_is_volatile"]."', ": $rq .= "'2', ";
+				isset($ret["service_max_check_attempts"]) && $ret["service_max_check_attempts"] != NULL ? $rq .= "'".$ret["service_max_check_attempts"]."', " : $rq .= "NULL, ";
+				isset($ret["service_normal_check_interval"]) && $ret["service_normal_check_interval"] != NULL ? $rq .= "'".$ret["service_normal_check_interval"]."', ": $rq .= "NULL, ";
+				isset($ret["service_retry_check_interval"]) && $ret["service_retry_check_interval"] != NULL ? $rq .= "'".$ret["service_retry_check_interval"]."', ": $rq .= "NULL, ";
+				isset($ret["service_active_checks_enabled"]["service_active_checks_enabled"]) && $ret["service_active_checks_enabled"]["service_active_checks_enabled"] != 2 ? $rq .= "'".$ret["service_active_checks_enabled"]["service_active_checks_enabled"]."', ": $rq .= "'2', ";
+				isset($ret["service_passive_checks_enabled"]["service_passive_checks_enabled"]) && $ret["service_passive_checks_enabled"]["service_passive_checks_enabled"] != 2 ? $rq .= "'".$ret["service_passive_checks_enabled"]["service_passive_checks_enabled"]."', ": $rq .= "'2', ";
+				isset($ret["service_parallelize_check"]["service_parallelize_check"]) && $ret["service_parallelize_check"]["service_parallelize_check"] != 2 ? $rq .= "'".$ret["service_parallelize_check"]["service_parallelize_check"]."', ": $rq .= "'2', ";
+				isset($ret["service_obsess_over_service"]["service_obsess_over_service"]) && $ret["service_obsess_over_service"]["service_obsess_over_service"] != 2 ? $rq .= "'".$ret["service_obsess_over_service"]["service_obsess_over_service"]."', ": $rq .= "'2', ";
+				isset($ret["service_check_freshness"]["service_check_freshness"]) && $ret["service_check_freshness"]["service_check_freshness"] != 2 ? $rq .= "'".$ret["service_check_freshness"]["service_check_freshness"]."', ": $rq .= "'2', ";
+				isset($ret["service_freshness_threshold"]) && $ret["service_freshness_threshold"] != NULL ? $rq .= "'".$ret["service_freshness_threshold"]."', ": $rq .= "NULL, ";
+				isset($ret["service_event_handler_enabled"]["service_event_handler_enabled"]) && $ret["service_event_handler_enabled"]["service_event_handler_enabled"] != 2 ? $rq .= "'".$ret["service_event_handler_enabled"]["service_event_handler_enabled"]."', ": $rq .= "'2', ";
+				isset($ret["service_low_flap_threshold"]) && $ret["service_low_flap_threshold"] != NULL ? $rq .= "'".$ret["service_low_flap_threshold"]."', " : $rq .= "NULL, ";
+				isset($ret["service_high_flap_threshold"]) && $ret["service_high_flap_threshold"] != NULL ? $rq .= "'".$ret["service_high_flap_threshold"]."', " : $rq .= "NULL, ";
+				isset($ret["service_flap_detection_enabled"]["service_flap_detection_enabled"]) && $ret["service_flap_detection_enabled"]["service_flap_detection_enabled"] != 2 ? $rq .= "'".$ret["service_flap_detection_enabled"]["service_flap_detection_enabled"]."', " : $rq .= "'2', ";
+				isset($ret["service_process_perf_data"]["service_process_perf_data"]) && $ret["service_process_perf_data"]["service_process_perf_data"] != 2 ? $rq .= "'".$ret["service_process_perf_data"]["service_process_perf_data"]."', " : $rq .= "'2', ";
+				isset($ret["service_retain_status_information"]["service_retain_status_information"]) && $ret["service_retain_status_information"]["service_retain_status_information"] != 2 ? $rq .= "'".$ret["service_retain_status_information"]["service_retain_status_information"]."', " : $rq .= "'2', ";
+				isset($ret["service_retain_nonstatus_information"]["service_retain_nonstatus_information"]) && $ret["service_retain_nonstatus_information"]["service_retain_nonstatus_information"] != 2 ? $rq .= "'".$ret["service_retain_nonstatus_information"]["service_retain_nonstatus_information"]."', " : $rq .= "'2', ";
+				isset($ret["service_notification_interval"]) && $ret["service_notification_interval"] != NULL ? $rq .= "'".$ret["service_notification_interval"]."', " : $rq .= "NULL, ";
+				isset($ret["service_notifOpts"]) && $ret["service_notifOpts"] != NULL ? $rq .= "'".implode(",", array_keys($ret["service_notifOpts"]))."', " : $rq .= "NULL, ";
+				isset($ret["service_notifications_enabled"]["service_notifications_enabled"]) && $ret["service_notifications_enabled"]["service_notifications_enabled"] != 2 ? $rq .= "'".$ret["service_notifications_enabled"]["service_notifications_enabled"]."', " : $rq .= "'2', ";
+				isset($ret["service_stalOpts"]) && $ret["service_stalOpts"] != NULL ? $rq .= "'".implode(",", array_keys($ret["service_stalOpts"]))."', " : $rq .= "NULL, ";
+				isset($ret["service_comment"]) && $ret["service_comment"] != NULL ? $rq .= "'".htmlentities($ret["service_comment"])."', " : $rq .= "NULL, ";
+				isset($ret["command_command_id_arg"]) && $ret["command_command_id_arg"] != NULL ? $rq .= "'".htmlentities($ret["command_command_id_arg"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+				isset($ret["command_command_id_arg2"]) && $ret["command_command_id_arg2"] != NULL ? $rq .= "'".htmlentities($ret["command_command_id_arg2"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+				isset($ret["service_register"]["service_register"]) && $ret["service_register"]["service_register"] != NULL ? $rq .= "'".$ret["service_register"]["service_register"]."', " : $rq .= "NULL, ";
+				isset($ret["service_activate"]["service_activate"]) && $ret["service_activate"]["service_activate"] != NULL ? $rq .= "'".$ret["service_activate"]["service_activate"]."'" : $rq .= "NULL";
+				$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(service_id) FROM service");
+		$service_id = $res->fetchRow();
+		return ($service_id["MAX(service_id)"]);
+	}
+	
+	function insertServiceExtInfos($service_id = null, $ret)	{
+		if (!$service_id) return;
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = 	"INSERT INTO `extended_service_information` " .
+				"( `esi_id` , `service_service_id`, `esi_notes` , `esi_notes_url` , " .
+				"`esi_action_url` , `esi_icon_image` , `esi_icon_image_alt`, `graph_id` )" .
+				"VALUES ( ";
+		$rq .= "NULL, ".$service_id.", ";
+		isset($ret["esi_notes"]) && $ret["esi_notes"] != NULL ? $rq .= "'".htmlentities($ret["esi_notes"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["esi_notes_url"]) && $ret["esi_notes_url"] != NULL ? $rq .= "'".htmlentities($ret["esi_notes_url"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["esi_action_url"]) && $ret["esi_action_url"] != NULL ? $rq .= "'".htmlentities($ret["esi_action_url"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["esi_icon_image"]) && $ret["esi_icon_image"] != NULL ? $rq .= "'".htmlentities($ret["esi_icon_image"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["esi_icon_image_alt"]) && $ret["esi_icon_image_alt"] != NULL ? $rq .= "'".htmlentities($ret["esi_icon_image_alt"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["graph_id"]) && $ret["graph_id"] != NULL ? $rq .= "'".$ret["graph_id"]."'": $rq .= "NULL";
+		$rq .= ")";
+		$pearDB->query($rq);
+	}
+	
+	function updateService($service_id = null)	{
+		if (!$service_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		if (isset($ret["command_command_id_arg"]) && $ret["command_command_id_arg"] != NULL)		{
+			$ret["command_command_id_arg"] = str_replace("\n", "#BR#", $ret["command_command_id_arg"]);
+			$ret["command_command_id_arg"] = str_replace("\t", "#T#", $ret["command_command_id_arg"]);
+			$ret["command_command_id_arg"] = str_replace("\r", "#R#", $ret["command_command_id_arg"]);
+			$ret["command_command_id_arg"] = str_replace('/', "#S#", $ret["command_command_id_arg"]);
+			$ret["command_command_id_arg"] = str_replace('\\', "#BS#", $ret["command_command_id_arg"]);
+		}		
+		if (isset($ret["command_command_id_arg2"]) && $ret["command_command_id_arg2"] != NULL)		{
+			$ret["command_command_id_arg2"] = str_replace("\n", "#BR#", $ret["command_command_id_arg2"]);
+			$ret["command_command_id_arg2"] = str_replace("\t", "#T#", $ret["command_command_id_arg2"]);
+			$ret["command_command_id_arg2"] = str_replace("\r", "#R#", $ret["command_command_id_arg2"]);
+			$ret["command_command_id_arg2"] = str_replace('/', "#S#", $ret["command_command_id_arg2"]);
+			$ret["command_command_id_arg2"] = str_replace('\\', "#BS#", $ret["command_command_id_arg2"]);
+		}
+		$rq = "UPDATE service SET " ;
+		$rq .= "service_template_model_stm_id = ";
+		$ret["service_template_model_stm_id"] != NULL ? $rq .= "'".$ret["service_template_model_stm_id"]."', ": $rq .= "NULL, ";
+		$rq .= "command_command_id = ";		
+		$ret["command_command_id"] != NULL ? $rq .= "'".$ret["command_command_id"]."', ": $rq .= "NULL, ";
+		$rq .= "timeperiod_tp_id = ";
+		$ret["timeperiod_tp_id"] != NULL ? $rq .= "'".$ret["timeperiod_tp_id"]."', ": $rq .= "NULL, ";
+		$rq .= "command_command_id2 = ";
+		$ret["command_command_id2"] != NULL ? $rq .= "'".$ret["command_command_id2"]."', ": $rq .= "NULL, ";
+		$rq .= "timeperiod_tp_id2 = ";
+		$ret["timeperiod_tp_id2"] != NULL ? $rq .= "'".$ret["timeperiod_tp_id2"]."', ": $rq .= "NULL, ";
+		$rq .= "purge_policy_id = ";
+		$ret["purge_policy_id"] != NULL ? $rq .= "'".$ret["purge_policy_id"]."', ": $rq .= "NULL, ";
+		$rq .= "service_description = ";
+		$ret["service_description"] != NULL ? $rq .= "'".htmlentities($ret["service_description"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "service_is_volatile = ";
+		$ret["service_is_volatile"]["service_is_volatile"] != 2 ? $rq .= "'".$ret["service_is_volatile"]["service_is_volatile"]."', ": $rq .= "'2', ";
+		$rq .= "service_max_check_attempts = ";
+		$ret["service_max_check_attempts"] != NULL ? $rq .= "'".$ret["service_max_check_attempts"]."', " : $rq .= "NULL, ";
+		$rq .= "service_normal_check_interval = ";
+		$ret["service_normal_check_interval"] != NULL ? $rq .= "'".$ret["service_normal_check_interval"]."', ": $rq .= "NULL, ";
+		$rq .= "service_retry_check_interval = ";
+		$ret["service_retry_check_interval"] != NULL ? $rq .= "'".$ret["service_retry_check_interval"]."', ": $rq .= "NULL, ";
+		$rq .= "service_active_checks_enabled = ";
+		$ret["service_active_checks_enabled"]["service_active_checks_enabled"] != 2 ? $rq .= "'".$ret["service_active_checks_enabled"]["service_active_checks_enabled"]."', ": $rq .= "'2', ";
+		$rq .= "service_passive_checks_enabled = ";
+		$ret["service_passive_checks_enabled"]["service_passive_checks_enabled"] != 2 ? $rq .= "'".$ret["service_passive_checks_enabled"]["service_passive_checks_enabled"]."', ": $rq .= "'2', ";
+		$rq .= "service_parallelize_check = ";
+		$ret["service_parallelize_check"]["service_parallelize_check"] != 2 ? $rq .= "'".$ret["service_parallelize_check"]["service_parallelize_check"]."', ": $rq .= "'2', ";
+		$rq .= "service_obsess_over_service = ";
+		$ret["service_obsess_over_service"]["service_obsess_over_service"] != 2 ? $rq .= "'".$ret["service_obsess_over_service"]["service_obsess_over_service"]."', ": $rq .= "'2', ";
+		$rq .= "service_check_freshness = ";
+		$ret["service_check_freshness"]["service_check_freshness"] != 2 ? $rq .= "'".$ret["service_check_freshness"]["service_check_freshness"]."', ": $rq .= "'2', ";
+		$rq .= "service_freshness_threshold = ";
+		$ret["service_freshness_threshold"] != NULL ? $rq .= "'".$ret["service_freshness_threshold"]."', ": $rq .= "NULL, ";
+		$rq .= "service_event_handler_enabled = ";
+		$ret["service_event_handler_enabled"]["service_event_handler_enabled"] != 2 ? $rq .= "'".$ret["service_event_handler_enabled"]["service_event_handler_enabled"]."', ": $rq .= "'2', ";
+		$rq .= "service_low_flap_threshold = ";
+		$ret["service_low_flap_threshold"] != NULL ? $rq .= "'".$ret["service_low_flap_threshold"]."', " : $rq .= "NULL, ";
+		$rq .= "service_high_flap_threshold = ";
+		$ret["service_high_flap_threshold"] != NULL ? $rq .= "'".$ret["service_high_flap_threshold"]."', " : $rq .= "NULL, ";
+		$rq .= "service_flap_detection_enabled = ";
+		$ret["service_flap_detection_enabled"]["service_flap_detection_enabled"] != 2 ? $rq .= "'".$ret["service_flap_detection_enabled"]["service_flap_detection_enabled"]."', " : $rq .= "'2', ";
+		$rq .= "service_process_perf_data = ";
+		$ret["service_process_perf_data"]["service_process_perf_data"] != 2 ? $rq .= "'".$ret["service_process_perf_data"]["service_process_perf_data"]."', " : $rq .= "'2', ";
+		$rq .= "service_retain_status_information = ";
+		$ret["service_retain_status_information"]["service_retain_status_information"] != 2 ? $rq .= "'".$ret["service_retain_status_information"]["service_retain_status_information"]."', " : $rq .= "'2', ";
+		$rq .= "service_retain_nonstatus_information = ";
+		$ret["service_retain_nonstatus_information"]["service_retain_nonstatus_information"] != 2 ? $rq .= "'".$ret["service_retain_nonstatus_information"]["service_retain_nonstatus_information"]."', " : $rq .= "'2', ";
+		$rq .= "service_notification_interval = ";
+		$ret["service_notification_interval"] != NULL ? $rq .= "'".$ret["service_notification_interval"]."', " : $rq .= "NULL, ";
+		$rq .= "service_notification_options = ";
+		isset($ret["service_notifOpts"]) && $ret["service_notifOpts"] != NULL ? $rq .= "'".implode(",", array_keys($ret["service_notifOpts"]))."', " : $rq .= "NULL, ";
+		$rq .= "service_notifications_enabled = ";
+		$ret["service_notifications_enabled"]["service_notifications_enabled"] != 2 ? $rq .= "'".$ret["service_notifications_enabled"]["service_notifications_enabled"]."', " : $rq .= "'2', ";
+		$rq .= "service_stalking_options = ";
+		isset($ret["service_stalOpts"]) && $ret["service_stalOpts"] != NULL ? $rq .= "'".implode(",", array_keys($ret["service_stalOpts"]))."', " : $rq .= "NULL, ";
+		$rq .= "service_comment = ";
+		$ret["service_comment"] != NULL ? $rq .= "'".htmlentities($ret["service_comment"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "command_command_id_arg = ";
+		isset($ret["command_command_id_arg"]) && $ret["command_command_id_arg"] != NULL ? $rq .= "'".htmlentities($ret["command_command_id_arg"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "command_command_id_arg2 = ";
+		isset($ret["command_command_id_arg2"]) && $ret["command_command_id_arg2"] != NULL ? $rq .= "'".htmlentities($ret["command_command_id_arg2"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "service_register = ";
+		$ret["service_register"]["service_register"] != NULL ? $rq .= "'".$ret["service_register"]["service_register"]."', " : $rq .= "NULL, ";
+		$rq .= "service_activate = ";
+		$ret["service_activate"]["service_activate"] != NULL ? $rq .= "'".$ret["service_activate"]["service_activate"]."'" : $rq .= "NULL ";
+		$rq .= "WHERE service_id = '".$service_id."'";
+		$pearDB->query($rq);
+	}
+		
+	function updateServiceContactGroup($service_id = null, $ret = array())	{
+		if (!$service_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM contactgroup_service_relation ";
+		$rq .= "WHERE service_service_id = '".$service_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["service_cgs"]))
+			$ret = $ret["service_cgs"];
+		else
+			$ret = $form->getSubmitValue("service_cgs");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO contactgroup_service_relation ";
+			$rq .= "(contactgroup_cg_id, service_service_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$ret[$i]."', '".$service_id."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateServiceServiceGroup($service_id = null, $ret = array())	{
+		if (!$service_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM servicegroup_relation ";
+		$rq .= "WHERE service_service_id = '".$service_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["service_sgs"]))
+			$ret = $ret["service_sgs"];
+		else
+			$ret = $form->getSubmitValue("service_sgs");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO servicegroup_relation ";
+			$rq .= "(service_service_id, servicegroup_sg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$service_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}	
+	
+	function updateServiceTrap($service_id = null, $ret = array())	{
+		if (!$service_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM traps_service_relation ";
+		$rq .= "WHERE service_id = '".$service_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["service_traps"]))
+			$ret = $ret["service_traps"];
+		else
+			$ret = $form->getSubmitValue("service_traps");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO traps_service_relation ";
+			$rq .= "(traps_id, service_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$ret[$i]."', '".$service_id."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateServiceHost($service_id = null, $ret = array())	{
+		if (!$service_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM host_service_relation ";
+		$rq .= "WHERE service_service_id = '".$service_id."'";
+		$pearDB->query($rq);
+		$ret1 = array();
+		$ret2 = array();
+		if (isset($ret["service_hPars"]))
+			$ret1 = $ret["service_hPars"];
+		else
+			$ret1 = $form->getSubmitValue("service_hPars");
+		if (isset($ret["service_hgPars"]))
+			$ret2 = $ret["service_hgPars"];
+		else
+			$ret2 = $form->getSubmitValue("service_hgPars");
+		 if (count($ret2))
+			for($i = 0; $i < count($ret2); $i++)	{
+				$rq = "INSERT INTO host_service_relation ";
+				$rq .= "(hostgroup_hg_id, host_host_id, servicegroup_sg_id, service_service_id) ";
+				$rq .= "VALUES ";
+				$rq .= "('".$ret2[$i]."', NULL, NULL, '".$service_id."')";
+				$pearDB->query($rq);
+			}
+		else if (count($ret1))
+			for($i = 0; $i < count($ret1); $i++)	{
+				$rq = "INSERT INTO host_service_relation ";
+				$rq .= "(hostgroup_hg_id, host_host_id, servicegroup_sg_id, service_service_id) ";
+				$rq .= "VALUES ";
+				$rq .= "(NULL, '".$ret1[$i]."', NULL, '".$service_id."')";
+				$pearDB->query($rq);
+			}
+	}
+	
+	function updateServiceExtInfos($service_id = null, $ret = array())	{
+		if (!$service_id) return;
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "UPDATE extended_service_information ";		
+		$rq .= "SET esi_notes = ";
+		isset($ret["esi_notes"]) && $ret["esi_notes"] != NULL ? $rq .= "'".htmlentities($ret["esi_notes"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "esi_notes_url = ";
+		isset($ret["esi_notes_url"]) && $ret["esi_notes_url"] != NULL ? $rq .= "'".htmlentities($ret["esi_notes_url"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "esi_action_url = ";
+		isset($ret["esi_action_url"]) && $ret["esi_action_url"] != NULL ? $rq .= "'".htmlentities($ret["esi_action_url"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "esi_icon_image = ";
+		isset($ret["esi_icon_image"]) && $ret["esi_icon_image"] != NULL ? $rq .= "'".htmlentities($ret["esi_icon_image"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "esi_icon_image_alt = ";
+		isset($ret["esi_icon_image_alt"]) && $ret["esi_icon_image_alt"] != NULL ? $rq .= "'".htmlentities($ret["esi_icon_image_alt"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "graph_id = ";
+		isset($ret["graph_id"]) && $ret["graph_id"] != NULL ? $rq .= "'".htmlentities($ret["graph_id"], ENT_QUOTES)."' ": $rq .= "NULL ";
+		$rq .= "WHERE service_service_id = '".$service_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function updateServiceTemplateUsed($useTpls = array())	{
+		if(!count($useTpls)) return;
+		global $pearDB;
+		require_once "./include/common/common-Func.php";
+		foreach ($useTpls as $key=>$value)
+			$pearDB->query("UPDATE service SET service_template_model_stm_id = '".getMyServiceTPLID($value)."' WHERE service_id = '".$key."'");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/service/formService.ihtml b/www/include/configuration/configObject/service/formService.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..3a48dea7e8e86a44677d4fcbc02d7ac59114006b
--- /dev/null
+++ b/www/include/configuration/configObject/service/formService.ihtml
@@ -0,0 +1,161 @@
+<script type="text/javascript" src="include/configuration/changetab.js"></script>
+<script type="text/javascript" src="./include/common/javascript/autoSelectCommandExample.js"></script>
+
+{$form.javascript}
+<form {$form.attributes}>
+<div>
+	<ul id="mainnav">
+		<li class="a" id='c1'><a href="#"  onclick="javascript:montre('1');">{$sort1}</a></li>
+		<li class="b" id='c2'><a href="#" onclick="javascript:montre('2');">{$sort2}</a></li>
+		<li class="b" id='c3'><a href="#" onclick="javascript:montre('3');">{$sort3}</a></li>
+		<li class="b" id='c4'><a href="#" onclick="javascript:montre('4');">{$sort4}</a></li>
+	</ul>
+</div>
+<div id="validFormTop">
+{if $o == "a" || $o == "c"}
+	<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+{else if $o == "w"}
+	<p class="oreonbutton">{$form.change.html}</p>
+{/if}
+</div>
+<div id="tab1" class="tab">
+	<table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/element_new_after.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_description.label}</td><td class="FormRowValue">{$form.service_description.html}</td></tr>
+		<tr class="list_two">
+			<td class="FormRowField">
+				<div style='text-decoration: underline;'>{$form.service_template_model_stm_id.label}</div>
+				{$form.tplText.label}
+			</td>
+			<td class="FormRowValue">
+				{$form.service_template_model_stm_id.html}
+				{if $o == "a" || $o == "c"}
+					&nbsp;<img src='./img/icones/16x16/element_new_after.gif' onClick="window.open('oreon.php?p=60602&service_id='+ document.Form.elements['service_template_model_stm_id'].options[document.Form.elements['service_template_model_stm_id'].selectedIndex].value + '&o=w&min=1','','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no, width=800, height=600');">
+				{/if}
+			</td>
+		</tr>
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/gauge.gif'>&nbsp;&nbsp;{$form.header.check}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_is_volatile.label}</td><td class="FormRowValue">{$form.service_is_volatile.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.timeperiod_tp_id.label}</td><td class="FormRowValue">{$form.timeperiod_tp_id.html}</td></tr>
+		<tr class="list_two">
+			<td class="FormRowField">{$form.command_command_id.label}</td>
+			<td class="FormRowValue">
+				{$form.command_command_id.html}
+				{if $o == "a" || $o == "c"}
+				&nbsp;<img src='./img/icones/16x16/exchange.gif' onClick="window.open('oreon.php?p=60706&command_id='+ document.Form.elements['command_command_id'].options[document.Form.elements['command_command_id'].selectedIndex].value + '&o=w&min=1','','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no, width=1000, height=200');">
+				{/if}
+								
+			</td>
+		</tr>
+		<tr class="list_one"><td class="FormRowField">{$form.command_command_id_arg.label}</td><td class="FormRowValue">{$form.command_command_id_arg.html}
+		{if $o == "a" || $o == "c"}
+		&nbsp;<img src="./img/icones/16x16/arrow_left_blue.png" alt="*"  onClick="set_arg('example1','command_command_id_arg');"></a><input type="text" name="example1" disabled>
+		{/if}
+		</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.service_max_check_attempts.label}</td><td class="FormRowValue">{$form.service_max_check_attempts.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_normal_check_interval.label}</td><td class="FormRowValue">{$form.service_normal_check_interval.html}{$time_unit}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.service_retry_check_interval.label}</td><td class="FormRowValue">{$form.service_retry_check_interval.html}{$time_unit}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_event_handler_enabled.label}</td><td class="FormRowValue">{$form.service_event_handler_enabled.html}</td></tr>
+		<tr class="list_two">
+			<td class="FormRowField">{$form.command_command_id2.label}</td>
+			<td class="FormRowValue">
+				{$form.command_command_id2.html}
+				{if $o == "a" || $o == "c"}
+				&nbsp;<img src='./img/icones/16x16/exchange.gif' onClick="window.open('oreon.php?p=60706&command_id='+ document.Form.elements['command_command_id2'].options[document.Form.elements['command_command_id2'].selectedIndex].value + '&o=w&min=1','','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no, width=1000, height=200');">
+				{/if}
+			</td>
+		</tr>
+		{if $v > "1"}		
+			<tr class="list_one"><td class="FormRowField">{$form.command_command_id_arg2.label}</td><td class="FormRowValue">{$form.command_command_id_arg2.html}
+			{if $o == "a" || $o == "c"}
+			&nbsp;<img src="./img/icones/16x16/arrow_left_blue.png" alt="*" onClick="set_arg('example2','command_command_id_arg2');"><input type="text" name="example2" disabled>
+			{/if}
+			</td></tr>
+		{/if}
+		<tr class="list_two"><td class="FormRowField">{$form.service_active_checks_enabled.label}</td><td class="FormRowValue">{$form.service_active_checks_enabled.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_passive_checks_enabled.label}</td><td class="FormRowValue">{$form.service_passive_checks_enabled.html}</td></tr>
+			 			
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/mail_write.gif'>&nbsp;&nbsp;{$form.header.notification}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_notifications_enabled.label}</td><td class="FormRowValue">{$form.service_notifications_enabled.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.service_cgs.label}</td><td class="FormRowValue">{$form.service_cgs.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_notification_interval.label}</td><td class="FormRowValue">{$form.service_notification_interval.html}{$time_unit}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.timeperiod_tp_id2.label}</td><td class="FormRowValue">{$form.timeperiod_tp_id2.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_notifOpts.label}</td><td class="FormRowValue">{$form.service_notifOpts.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.service_stalOpts.label}</td><td class="FormRowValue">{$form.service_stalOpts.html}</td></tr>
+		
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/cookies.gif'>&nbsp;&nbsp;{$form.header.furtherInfos}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_activate.label}</td><td class="FormRowValue">{$form.service_activate.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.service_comment.label}</td><td class="FormRowValue">{$form.service_comment.html}</td></tr>
+		
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+</div>
+
+<div id="tab2" class="tab">
+	<table id="ListTable">	 	
+		<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/element_new_after.gif'>&nbsp;&nbsp;{$form.header.title2}</td></tr>
+		{if !$msg.tpl}
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/branch_element.gif'>&nbsp;&nbsp;{$form.header.links}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_hPars.label}</td><td class="FormRowValue"><p  class="oreonbutton">{$form.service_hPars.html}</p></td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.service_hgPars.label}</td><td class="FormRowValue"><p  class="oreonbutton">{$form.service_hgPars.html}</p></td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_sgs.label}</td><td class="FormRowValue"><p  class="oreonbutton">{$form.service_sgs.html}</p></td></tr>
+	 	{/if}
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./modules/traps/img/icones/16x16/funnel_new.gif'>&nbsp;&nbsp;{$form.header.traps}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_traps.label}</td><td class="FormRowValue"><p  class="oreonbutton">{$form.service_traps.html}</p></td></tr>
+	 </table>
+</div>
+
+
+<div id="tab3" class="tab">
+	<table id="ListTable">
+		<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/element_new_after.gif'>&nbsp;&nbsp;{$form.header.title3}</td></tr>
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/import2.gif'>&nbsp;&nbsp;{$form.header.treatment}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_parallelize_check.label}</td><td class="FormRowValue">{$form.service_parallelize_check.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.service_obsess_over_service.label}</td><td class="FormRowValue">{$form.service_obsess_over_service.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_check_freshness.label}</td><td class="FormRowValue">{$form.service_check_freshness.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.service_freshness_threshold.label}</td><td class="FormRowValue">{$form.service_freshness_threshold.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_flap_detection_enabled.label}</td><td class="FormRowValue">{$form.service_flap_detection_enabled.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.service_low_flap_threshold.label}</td><td class="FormRowValue">{$form.service_low_flap_threshold.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_high_flap_threshold.label}</td><td class="FormRowValue">{$form.service_high_flap_threshold.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.service_process_perf_data.label}</td><td class="FormRowValue">{$form.service_process_perf_data.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_retain_status_information.label}</td><td class="FormRowValue">{$form.service_retain_status_information.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.service_retain_nonstatus_information.label}</td><td class="FormRowValue">{$form.service_retain_nonstatus_information.html}</td></tr>
+
+		{if $msg.perfparse}
+			<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/data_down.gif'>&nbsp;&nbsp;{$form.header.purge_policy}</td></tr>
+			<tr class="list_one"><td class="FormRowField">{$form.purge_policy_id.label}</td><td class="FormRowValue">{$form.purge_policy_id.html}</td></tr>
+		{/if}
+	 </table>
+</div>
+
+<div id='tab4' class='tab'>
+	 <table id="ListTable">
+		<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/element_new_after.gif'>&nbsp;&nbsp;{$form.header.title4}</td></tr>
+
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/oreon.gif'>&nbsp;&nbsp;{$form.header.oreon}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.graph_id.label}</td><td class="FormRowValue">{$form.graph_id.html}</td></tr>
+
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/nagios.gif'>&nbsp;&nbsp;{$form.header.nagios}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.esi_notes_url.label}</td><td class="FormRowValue">{$form.esi_notes_url.html}</td></tr>
+	 	{if $msg.nagios == 2}
+		<tr class="list_two"><td class="FormRowField">{$form.esi_notes.label}</td><td class="FormRowValue">{$form.esi_notes.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.esi_action_url.label}</td><td class="FormRowValue">{$form.esi_action_url.html}</td></tr>
+	 	{/if}
+		<tr class="list_two"><td class="FormRowField">{$form.esi_icon_image.label}</td><td class="FormRowValue">{$form.esi_icon_image.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.esi_icon_image_alt.label}</td><td class="FormRowValue">{$form.esi_icon_image_alt.html}</td></tr>
+	 </table>
+</div>
+<div id="validForm">
+{if $o == "a" || $o == "c"}
+	<p>{$form.action.html}</p>
+	<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+{else if $o == "w"}
+	<p class="oreonbutton">{$form.change.html}</p>
+{/if}
+</div>
+{$form.hidden}	
+</form>
diff --git a/www/include/configuration/configObject/service/formService.php b/www/include/configuration/configObject/service/formService.php
new file mode 100644
index 0000000000000000000000000000000000000000..987c29a19e13c8f230921739052577f42def795e
--- /dev/null
+++ b/www/include/configuration/configObject/service/formService.php
@@ -0,0 +1,489 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	#
+	## Database retrieve information for Service
+	#
+
+	function myDecodeService($arg)	{
+		$arg = str_replace('#BR#', "\\n", $arg);
+		$arg = str_replace('#T#', "\\t", $arg);
+		$arg = str_replace('#R#', "\\r", $arg);
+		$arg = str_replace('#S#', "/", $arg);
+		$arg = str_replace('#BS#', "\\", $arg);
+		return html_entity_decode($arg, ENT_QUOTES);
+	}
+	
+	$service = array();
+	if (($o == "c" || $o == "w") && $service_id)	{
+		$res =& $pearDB->query("SELECT * FROM service, extended_service_information esi WHERE service_id = '".$service_id."' AND esi.service_service_id = service_id LIMIT 1");
+		# Set base value
+		$service = array_map("myDecodeService", $res->fetchRow());
+		# Grab hostgroup || host
+		$res =& $pearDB->query("SELECT * FROM host_service_relation hsr WHERE hsr.service_service_id = '".$service_id."'");
+		while ($res->fetchInto($parent))	{
+			if ($parent["host_host_id"])
+				$service["service_hPars"][$parent["host_host_id"]] = $parent["host_host_id"];
+			else if ($parent["hostgroup_hg_id"])
+				$service["service_hgPars"][$parent["hostgroup_hg_id"]] = $parent["hostgroup_hg_id"];
+		}
+		# Set Service Notification Options
+		$tmp = explode(',', $service["service_notification_options"]);
+		foreach ($tmp as $key => $value)
+			$service["service_notifOpts"][trim($value)] = 1;
+		# Set Stalking Options
+		$tmp = explode(',', $service["service_stalking_options"]);
+		foreach ($tmp as $key => $value)
+			$service["service_stalOpts"][trim($value)] = 1;
+		$res->free();
+		# Set Contact Group
+		$res =& $pearDB->query("SELECT DISTINCT contactgroup_cg_id FROM contactgroup_service_relation WHERE service_service_id = '".$service_id."'");
+		for($i = 0; $res->fetchInto($notifCg); $i++)
+			$service["service_cgs"][$i] = $notifCg["contactgroup_cg_id"];
+		$res->free();
+		# Set Service Group Parents
+		$res =& $pearDB->query("SELECT DISTINCT servicegroup_sg_id FROM servicegroup_relation WHERE service_service_id = '".$service_id."'");
+		for($i = 0; $res->fetchInto($sg); $i++)
+			$service["service_sgs"][$i] = $sg["servicegroup_sg_id"];
+		$res->free();
+		# Set Traps
+		$res =& $pearDB->query("SELECT DISTINCT traps_id FROM traps_service_relation WHERE service_id = '".$service_id."'");
+		for($i = 0; $res->fetchInto($trap); $i++)
+			$service["service_traps"][$i] = $trap["traps_id"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Hosts comes from DB -> Store in $hosts Array
+	$hosts = array();
+	$res =& $pearDB->query("SELECT host_id, host_name FROM host WHERE host.host_id IN (".$oreon->user->lcaHStr.") AND host_register = '1' ORDER BY host_name");
+	while($res->fetchInto($host))
+		$hosts[$host["host_id"]] = $host["host_name"];
+	$res->free();
+	# Service Templates comes from DB -> Store in $svTpls Array
+	$svTpls = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT service_id, service_description, service_template_model_stm_id FROM service WHERE service_register = '0' AND service_id != '".$service_id."' ORDER BY service_description");
+	while($res->fetchInto($svTpl))	{
+		if (!$svTpl["service_description"])
+			$svTpl["service_description"] = getMyServiceName($svTpl["service_template_model_stm_id"])."'";
+		$svTpls[$svTpl["service_id"]] = $svTpl["service_description"];
+	}
+	$res->free();
+	# HostGroups comes from DB -> Store in $hgs Array
+	$hgs = array();
+	$res =& $pearDB->query("SELECT hg_id, hg_name FROM hostgroup WHERE hg_id IN (".$oreon->user->lcaHGStr.") ORDER BY hg_name");
+	while($res->fetchInto($hg))
+		$hgs[$hg["hg_id"]] = $hg["hg_name"];
+	$res->free();
+	# Timeperiods comes from DB -> Store in $tps Array
+	$tps = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT tp_id, tp_name FROM timeperiod ORDER BY tp_name");
+	while($res->fetchInto($tp))
+		$tps[$tp["tp_id"]] = $tp["tp_name"];
+	$res->free();
+	# Check commands comes from DB -> Store in $checkCmds Array
+	$checkCmds = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT command_id, command_name FROM command WHERE command_type = '2' ORDER BY command_name");
+	while($res->fetchInto($checkCmd))
+		$checkCmds[$checkCmd["command_id"]] = $checkCmd["command_name"];
+	$res->free();
+	# Contact Groups comes from DB -> Store in $notifCcts Array
+	$notifCgs = array();
+	$res =& $pearDB->query("SELECT cg_id, cg_name FROM contactgroup ORDER BY cg_name");
+	while($res->fetchInto($notifCg))
+		$notifCgs[$notifCg["cg_id"]] = $notifCg["cg_name"];
+	$res->free();
+	# Service Groups comes from DB -> Store in $sgs Array
+	$sgs = array();
+	$res =& $pearDB->query("SELECT sg_id, sg_name FROM servicegroup WHERE sg_id IN (".$oreon->user->lcaSGStr.") ORDER BY sg_name");
+	while($res->fetchInto($sg))
+		$sgs[$sg["sg_id"]] = $sg["sg_name"];
+	$res->free();
+	# Graphs Template comes from DB -> Store in $graphTpls Array
+	$graphTpls = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT graph_id, name FROM giv_graphs_template ORDER BY name");
+	while($res->fetchInto($graphTpl))
+		$graphTpls[$graphTpl["graph_id"]] = $graphTpl["name"];
+	$res->free();
+	# Traps definition comes from DB -> Store in $traps Array
+	$traps = array();
+	$res =& $pearDB->query("SELECT traps_id, traps_name FROM traps ORDER BY traps_name");
+	while($res->fetchInto($trap))
+		$traps[$trap["traps_id"]] = $trap["traps_name"];
+	$res->free();
+	# Deletion Policy definition comes from DB -> Store in $ppols Array
+	$ppols = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT purge_policy_id, purge_policy_name FROM purge_policy ORDER BY purge_policy_name");
+	while($res->fetchInto($ppol))
+		$ppols[$ppol["purge_policy_id"]] = $ppol["purge_policy_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsText2		= array("size"=>"6");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["sv_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["sv_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["sv_view"]);
+
+	# Sort 1
+	#
+	## Service basic information
+	#
+	$form->addElement('header', 'information', $lang['sv_infos']);
+
+	$form->addElement('text', 'service_description', $lang["sv_description"], $attrsText);
+
+	$form->addElement('select', 'service_template_model_stm_id', $lang['sv_template'], $svTpls);
+	$form->addElement('static', 'tplText', $lang['sv_templateText']);
+	
+	#
+	## Check information
+	#
+	$form->addElement('header', 'check', $lang['sv_head_state']);
+
+	$serviceIV[] = &HTML_QuickForm::createElement('radio', 'service_is_volatile', null, $lang["yes"], '1');
+	$serviceIV[] = &HTML_QuickForm::createElement('radio', 'service_is_volatile', null, $lang["no"], '0');
+	$serviceIV[] = &HTML_QuickForm::createElement('radio', 'service_is_volatile', null, $lang["nothing"], '2');
+	$form->addGroup($serviceIV, 'service_is_volatile', $lang['sv_isVolatile'], '&nbsp;');
+	$form->setDefaults(array('service_is_volatile' => '2'));
+
+
+	$form->addElement('select', 'command_command_id', $lang['sv_checkCmd'], $checkCmds, 'onchange=setArgument(this.form,"command_command_id","example1")');	
+	$form->addElement('text', 'command_command_id_arg', $lang['sv_args'], $attrsText);
+	$form->addElement('text', 'service_max_check_attempts', $lang['sv_checkMca'], $attrsText2);
+	$form->addElement('text', 'service_normal_check_interval', $lang['sv_normalCheckInterval'], $attrsText2);
+	$form->addElement('text', 'service_retry_check_interval', $lang['sv_retryCheckInterval'], $attrsText2);
+
+	$serviceEHE[] = &HTML_QuickForm::createElement('radio', 'service_event_handler_enabled', null, $lang["yes"], '1');
+	$serviceEHE[] = &HTML_QuickForm::createElement('radio', 'service_event_handler_enabled', null, $lang["no"], '0');
+	$serviceEHE[] = &HTML_QuickForm::createElement('radio', 'service_event_handler_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($serviceEHE, 'service_event_handler_enabled', $lang['sv_eventHandlerE'], '&nbsp;');
+	$form->setDefaults(array('service_event_handler_enabled' => '2'));
+	$form->addElement('select', 'command_command_id2', $lang['sv_eventHandler'], $checkCmds, 'onchange=setArgument(this.form,"command_command_id2","example2")');
+	$form->addElement('text', 'command_command_id_arg2', $lang['sv_args'], $attrsText);
+
+
+	$serviceACE[] = &HTML_QuickForm::createElement('radio', 'service_active_checks_enabled', null, $lang["yes"], '1');
+	$serviceACE[] = &HTML_QuickForm::createElement('radio', 'service_active_checks_enabled', null, $lang["no"], '0');
+	$serviceACE[] = &HTML_QuickForm::createElement('radio', 'service_active_checks_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($serviceACE, 'service_active_checks_enabled', $lang['sv_activeCE'], '&nbsp;');
+	$form->setDefaults(array('service_active_checks_enabled' => '2'));
+
+	$servicePCE[] = &HTML_QuickForm::createElement('radio', 'service_passive_checks_enabled', null, $lang["yes"], '1');
+	$servicePCE[] = &HTML_QuickForm::createElement('radio', 'service_passive_checks_enabled', null, $lang["no"], '0');
+	$servicePCE[] = &HTML_QuickForm::createElement('radio', 'service_passive_checks_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($servicePCE, 'service_passive_checks_enabled', $lang['sv_passiveCE'], '&nbsp;');
+	$form->setDefaults(array('service_passive_checks_enabled' => '2'));
+
+	$form->addElement('select', 'timeperiod_tp_id', $lang['sv_checkPeriod'], $tps);
+
+	##
+	## Notification informations
+	##
+	$form->addElement('header', 'notification', $lang['sv_head_notif']);
+	$serviceNE[] = &HTML_QuickForm::createElement('radio', 'service_notifications_enabled', null, $lang["yes"], '1');
+	$serviceNE[] = &HTML_QuickForm::createElement('radio', 'service_notifications_enabled', null, $lang["no"], '0');
+	$serviceNE[] = &HTML_QuickForm::createElement('radio', 'service_notifications_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($serviceNE, 'service_notifications_enabled', $lang['sv_notifEnabled'], '&nbsp;');
+	$form->setDefaults(array('service_notifications_enabled' => '2'));
+
+    $ams3 =& $form->addElement('advmultiselect', 'service_cgs', $lang['sv_CgMembers'], $notifCgs, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+
+	$form->addElement('text', 'service_notification_interval', $lang['sv_notifInt'], $attrsText2);
+	$form->addElement('select', 'timeperiod_tp_id2', $lang['sv_notifTp'], $tps);
+
+ 	$serviceNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'w', '&nbsp;', 'Warning');
+	$serviceNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unknown');
+	$serviceNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'c', '&nbsp;', 'Critical');
+	$serviceNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'r', '&nbsp;', 'Recovery');
+	if ($oreon->user->get_version() == 2)
+		$serviceNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'f', '&nbsp;', 'Flapping');
+	$form->addGroup($serviceNotifOpt, 'service_notifOpts', $lang['sv_notifOpts'], '&nbsp;&nbsp;');
+
+ 	$serviceStalOpt[] = &HTML_QuickForm::createElement('checkbox', 'o', '&nbsp;', 'Ok');
+	$serviceStalOpt[] = &HTML_QuickForm::createElement('checkbox', 'w', '&nbsp;', 'Warning');
+	$serviceStalOpt[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unknown');
+	$serviceStalOpt[] = &HTML_QuickForm::createElement('checkbox', 'c', '&nbsp;', 'Critical');
+	$form->addGroup($serviceStalOpt, 'service_stalOpts', $lang['sv_stalOpts'], '&nbsp;&nbsp;');
+
+	#
+	## Further informations
+	#
+	$form->addElement('header', 'furtherInfos', $lang['further_infos']);
+	$serviceActivation[] = &HTML_QuickForm::createElement('radio', 'service_activate', null, $lang["enable"], '1');
+	$serviceActivation[] = &HTML_QuickForm::createElement('radio', 'service_activate', null, $lang["disable"], '0');
+	$form->addGroup($serviceActivation, 'service_activate', $lang["status"], '&nbsp;');
+	$form->setDefaults(array('service_activate' => '1'));
+	$form->addElement('textarea', 'service_comment', $lang["cmt_comment"], $attrsTextarea);
+	
+	#
+	## Sort 2 - Service Relations
+	#
+	if ($o == "a")
+		$form->addElement('header', 'title2', $lang["sv_Links_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title2', $lang["sv_Links_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title2', $lang["sv_Links_view"]);
+
+    $ams3 =& $form->addElement('advmultiselect', 'service_hPars', $lang['sv_hPars'], $hosts, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+
+    $ams3 =& $form->addElement('advmultiselect', 'service_hgPars', $lang['sv_hgPars'], $hgs, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+	
+	# Service relations
+	$form->addElement('header', 'links', $lang['sv_head_links']);
+    $ams3 =& $form->addElement('advmultiselect', 'service_sgs', $lang['sv_ServiceGroupMembers'], $sgs, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+
+	$form->addElement('header', 'traps', $lang['gen_trapd']);
+    $ams3 =& $form->addElement('advmultiselect', 'service_traps', $lang['sv_traps'], $traps, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+	
+	#
+	## Sort 3 - Data treatment
+	#
+	if ($o == "a")
+		$form->addElement('header', 'title3', $lang["h_add_treat"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title3', $lang["h_modify_treat"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title3', $lang["h_view_treat"]);
+
+	$form->addElement('header', 'treatment', $lang['sv_head_treat']);
+
+	$servicePC[] = &HTML_QuickForm::createElement('radio', 'service_parallelize_check', null, $lang["yes"], '1');
+	$servicePC[] = &HTML_QuickForm::createElement('radio', 'service_parallelize_check', null, $lang["no"], '0');
+	$servicePC[] = &HTML_QuickForm::createElement('radio', 'service_parallelize_check', null, $lang["nothing"], '2');
+	$form->addGroup($servicePC, 'service_parallelize_check', $lang['sv_paraCheck'], '&nbsp;');
+	$form->setDefaults(array('service_parallelize_check' => '2'));
+
+	$serviceOOS[] = &HTML_QuickForm::createElement('radio', 'service_obsess_over_service', null, $lang["yes"], '1');
+	$serviceOOS[] = &HTML_QuickForm::createElement('radio', 'service_obsess_over_service', null, $lang["no"], '0');
+	$serviceOOS[] = &HTML_QuickForm::createElement('radio', 'service_obsess_over_service', null, $lang["nothing"], '2');
+	$form->addGroup($serviceOOS, 'service_obsess_over_service', $lang['sv_ObsessOS'], '&nbsp;');
+	$form->setDefaults(array('service_obsess_over_service' => '2'));
+
+	$serviceCF[] = &HTML_QuickForm::createElement('radio', 'service_check_freshness', null, $lang["yes"], '1');
+	$serviceCF[] = &HTML_QuickForm::createElement('radio', 'service_check_freshness', null, $lang["no"], '0');
+	$serviceCF[] = &HTML_QuickForm::createElement('radio', 'service_check_freshness', null, $lang["nothing"], '2');
+	$form->addGroup($serviceCF, 'service_check_freshness', $lang['sv_checkFreshness'], '&nbsp;');
+	$form->setDefaults(array('service_check_freshness' => '2'));
+
+	$serviceFDE[] = &HTML_QuickForm::createElement('radio', 'service_flap_detection_enabled', null, $lang["yes"], '1');
+	$serviceFDE[] = &HTML_QuickForm::createElement('radio', 'service_flap_detection_enabled', null, $lang["no"], '0');
+	$serviceFDE[] = &HTML_QuickForm::createElement('radio', 'service_flap_detection_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($serviceFDE, 'service_flap_detection_enabled', $lang['sv_flapDetect'], '&nbsp;');
+	$form->setDefaults(array('service_flap_detection_enabled' => '2'));
+
+	$form->addElement('text', 'service_freshness_threshold', $lang['sv_FreshnessThreshold'], $attrsText2);
+	$form->addElement('text', 'service_low_flap_threshold', $lang['sv_lowFT'], $attrsText2);
+	$form->addElement('text', 'service_high_flap_threshold', $lang['sv_highFT'], $attrsText2);
+
+	$servicePPD[] = &HTML_QuickForm::createElement('radio', 'service_process_perf_data', null, $lang["yes"], '1');
+	$servicePPD[] = &HTML_QuickForm::createElement('radio', 'service_process_perf_data', null, $lang["no"], '0');
+	$servicePPD[] = &HTML_QuickForm::createElement('radio', 'service_process_perf_data', null, $lang["nothing"], '2');
+	$form->addGroup($servicePPD, 'service_process_perf_data', $lang['sv_processPD'], '&nbsp;');
+	$form->setDefaults(array('service_process_perf_data' => '2'));
+
+	$serviceRSI[] = &HTML_QuickForm::createElement('radio', 'service_retain_status_information', null, $lang["yes"], '1');
+	$serviceRSI[] = &HTML_QuickForm::createElement('radio', 'service_retain_status_information', null, $lang["no"], '0');
+	$serviceRSI[] = &HTML_QuickForm::createElement('radio', 'service_retain_status_information', null, $lang["nothing"], '2');
+	$form->addGroup($serviceRSI, 'service_retain_status_information', $lang['sv_retainSI'], '&nbsp;');
+	$form->setDefaults(array('service_retain_status_information' => '2'));
+
+	$serviceRNI[] = &HTML_QuickForm::createElement('radio', 'service_retain_nonstatus_information', null, $lang["yes"], '1');
+	$serviceRNI[] = &HTML_QuickForm::createElement('radio', 'service_retain_nonstatus_information', null, $lang["no"], '0');
+	$serviceRNI[] = &HTML_QuickForm::createElement('radio', 'service_retain_nonstatus_information', null, $lang["nothing"], '2');
+	$form->addGroup($serviceRNI, 'service_retain_nonstatus_information', $lang['sv_retainNI'], '&nbsp;');
+	$form->setDefaults(array('service_retain_nonstatus_information' => '2'));
+
+	if ($oreon->optGen["perfparse_installed"])	{
+		$form->addElement('header', 'purge_policy', $lang["mod_purgePolicy"]);
+		$form->addElement('select', 'purge_policy_id', $lang["mod_purgePolicy_name"], $ppols);
+	}
+	
+	#
+	## Sort 4 - Extended Infos
+	#
+	if ($o == "a")
+		$form->addElement('header', 'title4', $lang["sv_ExtInf_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title4', $lang["sv_ExtInf_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title4', $lang["sv_ExtInf_view"]);
+
+	$form->addElement('header', 'nagios', $lang['h_nagios']);
+	if ($oreon->user->get_version() == 2)
+		$form->addElement('text', 'esi_notes', $lang['h_notes'], $attrsText);
+	$form->addElement('text', 'esi_notes_url', $lang['h_notesUrl'], $attrsText);
+	if ($oreon->user->get_version() == 2)
+		$form->addElement('text', 'esi_action_url', $lang['h_actionUrl'], $attrsText);
+	$form->addElement('text', 'esi_icon_image', $lang['h_iconImg'], $attrsText);
+	$form->addElement('text', 'esi_icon_image_alt', $lang['h_iconImgAlt'], $attrsText);
+
+	$form->addElement('header', 'oreon', $lang['h_oreon']);
+	$form->addElement('select', 'graph_id', $lang['sv_graphTpl'], $graphTpls);
+
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action' => '1'));
+
+	$form->addElement('hidden', 'service_id');
+	$reg =& $form->addElement('hidden', 'service_register');
+	$reg->setValue("1");
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	function myReplace()	{
+		global $form;
+		return (str_replace(" ", "_", $form->getSubmitValue("service_description")));
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('service_description', 'myReplace');
+	$form->addRule('service_description', $lang['ErrName'], 'required');
+	# If we are using a Template, no need to check the value, we hope there are in the Template
+	if (!$form->getSubmitValue("service_template_model_stm_id"))	{
+		$form->addRule('command_command_id', $lang['ErrCmd'], 'required');
+		$form->addRule('service_max_check_attempts', $lang['ErrRequired'], 'required');
+		$form->addRule('service_normal_check_interval', $lang['ErrRequired'], 'required');
+		$form->addRule('service_retry_check_interval', $lang['ErrRequired'], 'required');
+		$form->addRule('timeperiod_tp_id', $lang['ErrTp'], 'required');
+		$form->addRule('service_cgs', $lang['ErrCg'], 'required');
+		$form->addRule('service_notification_interval', $lang['ErrRequired'], 'required');
+		$form->addRule('timeperiod_tp_id2', $lang['ErrTp'], 'required');
+		$form->addRule('service_notifOpts', $lang['ErrOpt'], 'required');
+		if (!$form->getSubmitValue("service_hPars"))
+		$form->addRule('service_hgPars', $lang['ErrSvLeast'], 'required');
+		if (!$form->getSubmitValue("service_hgPars"))
+		$form->addRule('service_hPars', $lang['ErrSvLeast'], 'required');
+	}
+	if (!$form->getSubmitValue("service_hPars"))
+	$form->addRule('service_hgPars', $lang['ErrSvLeast'], 'required');
+	if (!$form->getSubmitValue("service_hgPars"))
+	$form->addRule('service_hPars', $lang['ErrSvLeast'], 'required');
+	//$form->registerRule('exist', 'callback', 'testExistence');
+	//$form->addRule('service_description', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Just watch a host information
+	if ($o == "w")	{
+		if (!$min)
+			$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&service_id=".$service_id."'"));
+	    $form->setDefaults($service);
+		$form->freeze();
+	}
+	# Modify a service information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($service);
+	}
+	# Add a service information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+
+	$tpl->assign('msg', array ("nagios"=>$oreon->user->get_version(), "tpl"=>0, "perfparse"=>$oreon->optGen["perfparse_installed"]));
+	$tpl->assign("sort1", $lang['sv_conf']);
+	$tpl->assign("sort2", $lang['sv_head_links']);
+	$tpl->assign("sort3", $lang['sv_head_links']);
+	$tpl->assign("sort3", $lang['sv_head_treat']);
+	$tpl->assign("sort4", $lang['sv_extInf']);
+	$tpl->assign('time_unit', " * ".$oreon->Nagioscfg["interval_length"]." ".$lang["time_sec"]);
+
+	$valid = false;
+	if ($form->validate())	{
+		$serviceObj =& $form->getElement('service_id');
+		if ($form->getSubmitValue("submitA"))
+			$serviceObj->setValue(insertServiceInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateServiceInDB($serviceObj->getValue());
+		if (count($form->getSubmitValue("service_hgPars")))	{
+			$hPars =& $form->getElement('service_hPars');
+			$hPars->setValue(array());
+		}		
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&service_id=".$serviceObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listServiceByHost.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->assign('v', $oreon->user->get_version());		
+		$tpl->display("formService.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/service/listService.ihtml b/www/include/configuration/configObject/service/listService.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..df4a13c52648a6afe8c79e2367059da12a9e9ab8
--- /dev/null
+++ b/www/include/configuration/configObject/service/listService.ihtml
@@ -0,0 +1,44 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_parent}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link2}">{$elemArr[elem].RowMenu_desc}</a></td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_parent}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight" align="right">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="3"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}	
+</form>
diff --git a/www/include/configuration/configObject/service/listServiceByHost.php b/www/include/configuration/configObject/service/listServiceByHost.php
new file mode 100644
index 0000000000000000000000000000000000000000..cce4c7f8d414d25d0b3e3f7c77c62f1c41f51f0f
--- /dev/null
+++ b/www/include/configuration/configObject/service/listServiceByHost.php
@@ -0,0 +1,139 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	isset ($_GET["search_type_service"]) ? $search_type_service = $_GET["search_type_service"] : $search_type_service = NULL;
+	isset ($_GET["search_type_host"]) ? $search_type_host = $_GET["search_type_host"] : $search_type_host = NULL;
+
+	$rows = 0;
+	$tmp = NULL;
+	# Due to Description maybe in the Template definition, we have to search if the description could match for each service with a Template.
+	if ($search)	{
+		if ($search_type_service) {
+			$res = & $pearDB->query("SELECT service_id, service_description, service_template_model_stm_id FROM service sv, host_service_relation hsr WHERE sv.service_register = '1' AND hsr.service_service_id = sv.service_id AND hsr.hostgroup_hg_id IS NULL AND hsr.host_host_id IN (".$oreon->user->lcaHStr.")");
+			while ($res->fetchInto($service))
+				if (!$service["service_description"])	{
+					$service["service_description"] = getMyServiceName($service['service_template_model_stm_id']);
+					if (stristr($service["service_description"], htmlentities($search, ENT_QUOTES)))	{
+						$rows++;
+						$tmp ? $tmp .= ", ".$service["service_id"] : $tmp = $service["service_id"];
+					}
+				}
+				else if (stristr($service["service_description"], htmlentities($search, ENT_QUOTES)))	{
+					$rows++;
+					$tmp ? $tmp .= ", ".$service["service_id"] : $tmp = $service["service_id"];
+				}
+		}
+		if ($search_type_host)	{
+			$locale_query = "SELECT service_id, service_description, service_template_model_stm_id FROM service sv, host_service_relation hsr, host WHERE host_name like '%".$search."%' AND hsr.host_host_id=host.host_id AND sv.service_register = '1' AND hsr.service_service_id = sv.service_id AND hsr.hostgroup_hg_id IS NULL AND hsr.host_host_id IN (".$oreon->user->lcaHStr.")";
+			$res = & $pearDB->query($locale_query);
+			while ($res->fetchInto($service)) {			         
+				$tmp ? $tmp .= ", ".$service["service_id"] : $tmp = $service["service_id"];			          
+				$rows++;				
+			}
+		}
+    }
+	else	{
+		$res =& $pearDB->query("SELECT service_description FROM service sv, host_service_relation hsr WHERE service_register = '1' AND hsr.service_service_id = sv.service_id AND hsr.host_host_id IN (".$oreon->user->lcaHStr.") AND hsr.hostgroup_hg_id IS NULL");
+		$rows = $res->numRows();
+	}
+	
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['h']);
+	$tpl->assign("headerMenu_desc", $lang['sv']);
+	$tpl->assign("headerMenu_parent", $lang['sv_parent']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Host/service list
+	if ($search)
+		$rq = "SELECT @nbr:=(SELECT COUNT(*) FROM host_service_relation WHERE service_service_id = sv.service_id GROUP BY service_id) AS nbr, sv.service_id, sv.service_description, sv.service_activate, sv.service_template_model_stm_id, host.host_id, host.host_name, host.host_template_model_htm_id FROM service sv, host, host_service_relation hsr WHERE sv.service_id IN (".($tmp ? $tmp : 'NULL').") AND sv.service_register = '1' AND hsr.service_service_id = sv.service_id AND host.host_id = hsr.host_host_id AND host.host_id IN (".$oreon->user->lcaHStr.") AND host.host_register = '1' ORDER BY host.host_name, service_description LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT @nbr:=(SELECT COUNT(*) FROM host_service_relation WHERE service_service_id = sv.service_id GROUP BY service_id) AS nbr, sv.service_id, sv.service_description, sv.service_activate, sv.service_template_model_stm_id, host.host_id, host.host_name, host.host_template_model_htm_id FROM service sv, host, host_service_relation hsr WHERE sv.service_register = '1' AND hsr.service_service_id = sv.service_id AND host.host_id = hsr.host_host_id AND host.host_id IN (".$oreon->user->lcaHStr.") AND host.host_register = '1' ORDER BY host.host_name, service_description LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	$fgHost = array("value"=>NULL, "print"=>NULL);
+	for ($i = 0; $res->fetchInto($service); $i++) {
+		# If the name of our Host is in the Template definition, we have to catch it, whatever the level of it :-)
+		if (!$service["host_name"])
+			$service["host_name"] = getMyHostName($service['host_template_model_htm_id']);
+		$fgHost["value"] != $service["host_name"] ? ($fgHost["print"] = true && $fgHost["value"] = $service["host_name"]) : $fgHost["print"] = false;
+		$selectedElements =& $form->addElement('checkbox', "select[".$service['service_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&service_id=".$service['service_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&service_id=".$service['service_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&service_id=".$service['service_id']."&o=d&select[".$service['service_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($service["service_activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&service_id=".$service['service_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&service_id=".$service['service_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$service['service_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		# If the description of our Service is in the Template definition, we have to catch it, whatever the level of it :-)
+		if (!$service["service_description"])
+			$service["service_description"] = getMyServiceName($service['service_template_model_stm_id']);
+		$elemArr[$i] = array("MenuClass"=>"list_".($service["nbr"]>1 ? "three" : $style), 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$service["host_name"],
+						"RowMenu_link"=>"?p=60101&o=w&host_id=".$service['host_id'],
+						"RowMenu_link2"=>"?p=".$p."&o=w&service_id=".$service['service_id'],
+						"RowMenu_parent"=>$service["service_template_model_stm_id"] ? $lang["yes"] : $lang["no"],
+						"RowMenu_desc"=>$service["service_description"],
+						"RowMenu_status"=>$service["service_activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$fgHost["print"] ? NULL : $elemArr[$i]["RowMenu_name"] = NULL;
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listService.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/service/listServiceByHostGroup.php b/www/include/configuration/configObject/service/listServiceByHostGroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..de87306244a73107756371007db566a2ae8518f4
--- /dev/null
+++ b/www/include/configuration/configObject/service/listServiceByHostGroup.php
@@ -0,0 +1,123 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	$rows = 0;
+	$tmp = NULL;
+	# Due to Description maybe in the Template definition, we have to search if the description could match for each service with a Template.
+	if ($search)	{
+		$res = & $pearDB->query("SELECT service_id, service_description, service_template_model_stm_id FROM service sv, host_service_relation hsr WHERE sv.service_register = '1' AND hsr.service_service_id = sv.service_id AND hsr.host_host_id IS NULL AND hsr.hostgroup_hg_id IN (".$oreon->user->lcaHGStr.")");
+		while ($res->fetchInto($service))
+			if (!$service["service_description"])	{
+				$service["service_description"] = getMyServiceName($service['service_template_model_stm_id']);
+				if (stristr($service["service_description"], htmlentities($search, ENT_QUOTES)))	{
+					$rows++;
+					$tmp ? $tmp .= ", ".$service["service_id"] : $tmp = $service["service_id"];
+				}
+			}
+			else if (stristr($service["service_description"], htmlentities($search, ENT_QUOTES)))	{
+				$rows++;
+				$tmp ? $tmp .= ", ".$service["service_id"] : $tmp = $service["service_id"];
+			}
+	}
+	else	{
+		$res = $pearDB->query("SELECT service_description FROM service sv, host_service_relation hsr WHERE service_register = '1' AND hsr.service_service_id = sv.service_id AND hsr.host_host_id IS NULL AND hsr.hostgroup_hg_id IN (".$oreon->user->lcaHGStr.")");
+		$rows = $res->numRows();
+	}
+	
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['hg']);
+	$tpl->assign("headerMenu_desc", $lang['sv']);
+	$tpl->assign("headerMenu_parent", $lang['sv_parent']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#HostGroup/service list
+	if ($search)
+		$rq = "SELECT @nbr:=(SELECT COUNT(*) FROM host_service_relation WHERE service_service_id = sv.service_id GROUP BY service_id ) AS nbr, sv.service_id, sv.service_description, sv.service_activate, sv.service_template_model_stm_id, hg.hg_id, hg.hg_name FROM service sv, hostgroup hg, host_service_relation hsr WHERE sv.service_id IN (".($tmp ? $tmp : 'NULL').") AND sv.service_register = '1' AND hsr.service_service_id = sv.service_id AND hg.hg_id = hsr.hostgroup_hg_id AND hsr.hostgroup_hg_id IN (".$oreon->user->lcaHGStr.") ORDER BY hg.hg_name, service_description LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT @nbr:=(SELECT COUNT(*) FROM host_service_relation WHERE service_service_id = sv.service_id GROUP BY service_id ) AS nbr, sv.service_id, sv.service_description, sv.service_activate, sv.service_template_model_stm_id, hg.hg_id, hg.hg_name FROM service sv, hostgroup hg, host_service_relation hsr WHERE sv.service_register = '1' AND hsr.service_service_id = sv.service_id AND hg.hg_id = hsr.hostgroup_hg_id AND hsr.hostgroup_hg_id IN (".$oreon->user->lcaHGStr.") ORDER BY hg.hg_name, service_description LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	$fgHostgroup = array("value"=>NULL, "print"=>NULL);
+	for ($i = 0; $res->fetchInto($service); $i++) {
+		$fgHostgroup["value"] != $service["hg_name"] ? ($fgHostgroup["print"] = true && $fgHostgroup["value"] = $service["hg_name"]) : $fgHostgroup["print"] = false;
+		$selectedElements =& $form->addElement('checkbox', "select[".$service['service_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&service_id=".$service['service_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&service_id=".$service['service_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&service_id=".$service['service_id']."&o=d&select[".$service['service_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($service["service_activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&service_id=".$service['service_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&service_id=".$service['service_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$service['service_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		# If the description of our Service is in the Template definition, we have to catch it, whatever the level of it :-)
+		if (!$service["service_description"])
+			$service["service_description"] = getMyServiceName($service['service_template_model_stm_id']);
+		$elemArr[$i] = array("MenuClass"=>"list_".($service["nbr"]>1 ? "three" : $style), 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$service["hg_name"],
+						"RowMenu_link"=>"?p=60102&o=w&hg_id=".$service['hg_id'],
+						"RowMenu_link2"=>"?p=".$p."&o=w&service_id=".$service['service_id'],
+						"RowMenu_parent"=>$service["service_template_model_stm_id"] ? $lang["yes"] : $lang["no"],
+						"RowMenu_desc"=>$service["service_description"],
+						"RowMenu_status"=>$service["service_activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$fgHostgroup["print"] ? NULL : $elemArr[$i]["RowMenu_name"] = NULL;
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listService.ihtml");
+	
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/service/serviceByHost.php b/www/include/configuration/configObject/service/serviceByHost.php
new file mode 100644
index 0000000000000000000000000000000000000000..bbd40ce1a3cacefa85d13b4dc584a228d82ffa83
--- /dev/null
+++ b/www/include/configuration/configObject/service/serviceByHost.php
@@ -0,0 +1,49 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+
+	isset($_GET["service_id"]) ? $sG = $_GET["service_id"] : $sG = NULL;
+	isset($_POST["service_id"]) ? $sP = $_POST["service_id"] : $sP = NULL;
+	$sG ? $service_id = $sG : $service_id = $sP;
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/service/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formService.php"); break; #Add a service
+		case "w" : require_once($path."formService.php"); break; #Watch a service
+		case "c" : require_once($path."formService.php"); break; #Modify a service
+		case "s" : enableServiceInDB($service_id); require_once($path."listServiceByHost.php"); break; #Activate a service
+		case "u" : disableServiceInDB($service_id); require_once($path."listServiceByHost.php"); break; #Desactivate a service
+		case "m" : multipleServiceInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listServiceByHost.php"); break; #Duplicate n services
+		case "d" : deleteServiceInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listServiceByHost.php"); break; #Delete n services
+		default : require_once($path."listServiceByHost.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/service/serviceByHostGroup.php b/www/include/configuration/configObject/service/serviceByHostGroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..6f8109ef47932e7615ac18767e412f24eab1b93d
--- /dev/null
+++ b/www/include/configuration/configObject/service/serviceByHostGroup.php
@@ -0,0 +1,49 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+
+	isset($_GET["service_id"]) ? $sG = $_GET["service_id"] : $sG = NULL;
+	isset($_POST["service_id"]) ? $sP = $_POST["service_id"] : $sP = NULL;
+	$sG ? $service_id = $sG : $service_id = $sP;
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/service/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formService.php"); break; #Add a service
+		case "w" : require_once($path."formService.php"); break; #Watch a service
+		case "c" : require_once($path."formService.php"); break; #Modify a service
+		case "s" : enableServiceInDB($service_id); require_once($path."listServiceByHostGroup.php"); break; #Activate a service
+		case "u" : disableServiceInDB($service_id); require_once($path."listServiceByHostGroup.php"); break; #Desactivate a service
+		case "m" : multipleServiceInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listServiceByHostGroup.php"); break; #Duplicate n services
+		case "d" : deleteServiceInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listServiceByHostGroup.php"); break; #Delete n services
+		default : require_once($path."listServiceByHostGroup.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/service_dependency/DB-Func.php b/www/include/configuration/configObject/service_dependency/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..b8f8fa53aeea2b1edab7f35ce1eda09d07cb221a
--- /dev/null
+++ b/www/include/configuration/configObject/service_dependency/DB-Func.php
@@ -0,0 +1,231 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+
+	function testServiceDependencyExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('dep_id');
+		$res =& $pearDB->query("SELECT dep_name, dep_id FROM dependency WHERE dep_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$dep =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $dep["dep_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $dep["dep_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function testCycleH ($childs = NULL)	{
+		global $pearDB;
+		global $form;
+		$parents = array();
+		$childs = array();
+		if (isset($form))	{
+			$parents = $form->getSubmitValue('dep_hSvPar');
+			$childs = $form->getSubmitValue('dep_hSvChi');
+			$childs =& array_flip($childs);
+		}
+		foreach ($parents as $parent)
+			if (array_key_exists($parent, $childs))
+				return false;
+		return true;
+	}
+	
+	function testCycleHg ($childs = NULL)	{
+		global $pearDB;
+		global $form;
+		$parents = array();
+		$childs = array();
+		if (isset($form))	{
+			$parents = $form->getSubmitValue('dep_hgSvPar');
+			$childs = $form->getSubmitValue('dep_hgSvChi');
+			$childs =& array_flip($childs);
+		}
+		foreach ($parents as $parent)
+			if (array_key_exists($parent, $childs))
+				return false;
+		return true;
+	}
+
+	function deleteServiceDependencyInDB ($dependencies = array())	{
+		global $pearDB;
+		foreach($dependencies as $key=>$value)
+			$pearDB->query("DELETE FROM dependency WHERE dep_id = '".$key."'");
+	}
+	
+	function multipleServiceDependencyInDB ($dependencies = array(), $nbrDup = array())	{
+		foreach($dependencies as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM dependency WHERE dep_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["dep_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "dep_name" ? ($dep_name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testServiceDependencyExistence($dep_name))	{
+					$val ? $rq = "INSERT INTO dependency VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(dep_id) FROM dependency");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(dep_id)"]))	{
+						$res =& $pearDB->query("SELECT DISTINCT service_service_id FROM dependency_serviceParent_relation WHERE dependency_dep_id = '".$key."'");
+						while($res->fetchInto($service))
+							$pearDB->query("INSERT INTO dependency_serviceParent_relation VALUES ('', '".$maxId["MAX(dep_id)"]."', '".$service["service_service_id"]."')");
+						$res->free();
+						$res =& $pearDB->query("SELECT DISTINCT service_service_id FROM dependency_serviceChild_relation WHERE dependency_dep_id = '".$key."'");
+						while($res->fetchInto($service))
+							$pearDB->query("INSERT INTO dependency_serviceChild_relation VALUES ('', '".$maxId["MAX(dep_id)"]."', '".$service["service_service_id"]."')");
+						$res->free();
+					}
+				}
+			}
+		}
+	}
+	
+	function updateServiceDependencyInDB ($dep_id = NULL)	{
+		if (!$dep_id) exit();
+		updateServiceDependency($dep_id);
+		updateServiceDependencyServiceParents($dep_id);
+		updateServiceDependencyServiceChilds($dep_id);
+	}	
+	
+	function insertServiceDependencyInDB ($ret = array())	{
+		$dep_id = insertServiceDependency($ret);
+		updateServiceDependencyServiceParents($dep_id, $ret);
+		updateServiceDependencyServiceChilds($dep_id, $ret);
+		return ($dep_id);
+	}
+	
+	function insertServiceDependency($ret = array())	{
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO dependency ";
+		$rq .= "(dep_name, dep_description, inherits_parent, execution_failure_criteria, notification_failure_criteria, dep_comment) ";
+		$rq .= "VALUES (";
+		isset($ret["dep_name"]) && $ret["dep_name"] != NULL ? $rq .= "'".htmlentities($ret["dep_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["dep_description"]) && $ret["dep_description"] != NULL ? $rq .= "'".htmlentities($ret["dep_description"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["inherits_parent"]["inherits_parent"]) && $ret["inherits_parent"]["inherits_parent"] != NULL ? $rq .= "'".$ret["inherits_parent"]["inherits_parent"]."', " : $rq .= "NULL, ";
+		isset($ret["execution_failure_criteria"]) && $ret["execution_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["execution_failure_criteria"]))."', " : $rq .= "NULL, ";
+		isset($ret["notification_failure_criteria"]) && $ret["notification_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["notification_failure_criteria"]))."', " : $rq .= "NULL, ";
+		isset($ret["dep_comment"]) && $ret["dep_comment"] != NULL ? $rq .= "'".htmlentities($ret["dep_comment"], ENT_QUOTES)."' " : $rq .= "NULL ";
+		$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(dep_id) FROM dependency");
+		$dep_id = $res->fetchRow();
+		return ($dep_id["MAX(dep_id)"]);
+	}
+	
+	function updateServiceDependency($dep_id = null)	{
+		if (!$dep_id) exit();
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE dependency SET ";
+		$rq .= "dep_name = ";
+		isset($ret["dep_name"]) && $ret["dep_name"] != NULL ? $rq .= "'".htmlentities($ret["dep_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "dep_description = ";
+		isset($ret["dep_description"]) && $ret["dep_description"] != NULL ? $rq .= "'".htmlentities($ret["dep_description"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "inherits_parent = ";
+		isset($ret["inherits_parent"]["inherits_parent"]) && $ret["inherits_parent"]["inherits_parent"] != NULL ? $rq .= "'".$ret["inherits_parent"]["inherits_parent"]."', " : $rq .= "NULL, ";
+		$rq .= "execution_failure_criteria = ";
+		isset($ret["execution_failure_criteria"]) && $ret["execution_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["execution_failure_criteria"]))."', " : $rq .= "NULL, ";
+		$rq .= "notification_failure_criteria = ";
+		isset($ret["notification_failure_criteria"]) && $ret["notification_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["notification_failure_criteria"]))."', " : $rq .= "NULL, ";
+		$rq .= "dep_comment = ";
+		isset($ret["dep_comment"]) && $ret["dep_comment"] != NULL ? $rq .= "'".htmlentities($ret["dep_comment"], ENT_QUOTES)."' " : $rq .= "NULL ";
+		$rq .= "WHERE dep_id = '".$dep_id."'";
+		$pearDB->query($rq);
+	}
+		
+	function updateServiceDependencyServiceParents($dep_id = null, $ret = array())	{
+		if (!$dep_id) exit();
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM dependency_serviceParent_relation ";
+		$rq .= "WHERE dependency_dep_id = '".$dep_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["dep_hSvPar"]))
+			$ret1 = $ret["dep_hSvPar"]; 
+		else
+			$ret1 = $form->getSubmitValue("dep_hSvPar");
+		for($i = 0; $i < count($ret1); $i++)	{
+			$rq = "INSERT INTO dependency_serviceParent_relation ";
+			$rq .= "(dependency_dep_id, service_service_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$dep_id."', '".$ret1[$i]."')";
+			$pearDB->query($rq);
+		}
+		if (isset($ret["dep_hgSvPar"]))
+			$ret2 = $ret["dep_hgSvPar"]; 
+		else
+			$ret2 = $form->getSubmitValue("dep_hgSvPar");
+		for($i = 0; $i < count($ret2); $i++)	{
+			$rq = "INSERT INTO dependency_serviceParent_relation ";
+			$rq .= "(dependency_dep_id, service_service_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$dep_id."', '".$ret2[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+		
+	function updateServiceDependencyServiceChilds($dep_id = null, $ret = array())	{
+		if (!$dep_id) exit();
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM dependency_serviceChild_relation ";
+		$rq .= "WHERE dependency_dep_id = '".$dep_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["dep_hSvChi"]))
+			$ret1 = $ret["dep_hSvChi"];
+		else
+			$ret1 = $form->getSubmitValue("dep_hSvChi");
+		for($i = 0; $i < count($ret1); $i++)	{
+			$rq = "INSERT INTO dependency_serviceChild_relation ";
+			$rq .= "(dependency_dep_id, service_service_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$dep_id."', '".$ret1[$i]."')";
+			$pearDB->query($rq);
+		}
+		if (isset($ret["dep_hgSvChi"]))
+			$ret2 = $ret["dep_hgSvChi"];
+		else
+			$ret2 = $form->getSubmitValue("dep_hgSvChi");
+		for($i = 0; $i < count($ret2); $i++)	{
+			$rq = "INSERT INTO dependency_serviceChild_relation ";
+			$rq .= "(dependency_dep_id, service_service_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$dep_id."', '".$ret2[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/service_dependency/formServiceDependency.ihtml b/www/include/configuration/configObject/service_dependency/formServiceDependency.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..2c2e4886190f185056a74606172867f711b22279
--- /dev/null
+++ b/www/include/configuration/configObject/service_dependency/formServiceDependency.ihtml
@@ -0,0 +1,58 @@
+<script type="text/javascript" src="include/configuration/changetab.js"></script>
+{$form.javascript}
+<form {$form.attributes}>
+<div>
+<ul id="mainnav">
+	<li class="a" id='c1'><a href="#tab1"  onclick="javascript:montre('1');">{$sort1}</a></li>
+	<li class="b" id='c2'><a href="#tab2" onclick="javascript:montre('2');">{$sort2}</a></li>
+	<li class="b" id='c3'><a href="#tab3" onclick="javascript:montre('3');">{$sort3}</a></li>
+</ul>
+</div>
+<div id="validFormTop">
+{if $o == "a" || $o == "c"}
+	<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+{else if $o == "w"}
+	<p class="oreonbutton">{$form.change.html}</p>
+{/if}
+</div>
+<div id='tab1' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/element_new_after.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/gauge.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.dep_name.label}</td><td class="FormRowValue">{$form.dep_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.dep_description.label}</td><td class="FormRowValue">{$form.dep_description.html}</td></tr>
+		{if $nagios == 2}
+			<tr class="list_one"><td class="FormRowField">{$form.inherits_parent.label}</td><td class="FormRowValue">{$form.inherits_parent.html}</td></tr>
+		{/if}
+		<tr class="list_one"><td class="FormRowField">{$form.execution_failure_criteria.label}</td><td class="FormRowValue">{$form.execution_failure_criteria.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.notification_failure_criteria.label}</td><td class="FormRowValue">{$form.notification_failure_criteria.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.dep_comment.label}</td><td class="FormRowValue">{$form.dep_comment.html}</td></tr>
+	</table>
+</div>
+<div id='tab2' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/element_new_after.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.dep_hSvPar.label}</td><td class="FormRowValue">{$form.dep_hSvPar.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.dep_hSvChi.label}</td><td class="FormRowValue">{$form.dep_hSvChi.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField" colspan="2">{$legend1}</td></tr>
+	</table>
+</div>
+<div id='tab3' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/element_new_after.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.dep_hgSvPar.label}</td><td class="FormRowValue">{$form.dep_hgSvPar.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.dep_hgSvChi.label}</td><td class="FormRowValue">{$form.dep_hgSvChi.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField" colspan="2">{$legend1}</td></tr>
+	</table>
+</div>
+<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+</div>
+{$form.hidden}
+</form>
+
diff --git a/www/include/configuration/configObject/service_dependency/formServiceDependency.php b/www/include/configuration/configObject/service_dependency/formServiceDependency.php
new file mode 100644
index 0000000000000000000000000000000000000000..d62917249ccf4d65fa9e79d09907d58fc3492cde
--- /dev/null
+++ b/www/include/configuration/configObject/service_dependency/formServiceDependency.php
@@ -0,0 +1,253 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Dependency
+	#
+	$dep = array();
+	if (($o == "c" || $o == "w") && $dep_id)	{
+		$res =& $pearDB->query("SELECT * FROM dependency WHERE dep_id = '".$dep_id."' LIMIT 1");
+		# Set base value
+		$dep = array_map("myDecode", $res->fetchRow());
+		# Set Notification Failure Criteria
+		$dep["notification_failure_criteria"] =& explode(',', $dep["notification_failure_criteria"]);
+		foreach ($dep["notification_failure_criteria"] as $key => $value)
+			$dep["notification_failure_criteria"][trim($value)] = 1;
+		# Set Execution Failure Criteria
+		$dep["execution_failure_criteria"] =& explode(',', $dep["execution_failure_criteria"]);
+		foreach ($dep["execution_failure_criteria"] as $key => $value)
+			$dep["execution_failure_criteria"][trim($value)] = 1;
+		# Set Host Service Childs
+		$res =& $pearDB->query("SELECT DISTINCT dscr.service_service_id FROM dependency_serviceChild_relation dscr, host_service_relation hsr WHERE dscr.dependency_dep_id = '".$dep_id."' AND hsr.service_service_id = dscr.service_service_id AND hsr.host_host_id IS NOT NULL GROUP BY service_service_id");
+		for($i = 0; $res->fetchInto($service); $i++)
+			$dep["dep_hSvChi"][$i] = $service["service_service_id"];
+		$res->free();
+		# Set HostGroup Service Childs
+		$res =& $pearDB->query("SELECT DISTINCT dscr.service_service_id FROM dependency_serviceChild_relation dscr, host_service_relation hsr WHERE dscr.dependency_dep_id = '".$dep_id."' AND hsr.service_service_id = dscr.service_service_id AND hsr.hostgroup_hg_id IS NOT NULL GROUP BY service_service_id");
+		for($i = 0; $res->fetchInto($service); $i++)
+			$dep["dep_hgSvChi"][$i] = $service["service_service_id"];
+		$res->free();
+		# Set Host Service Parents
+		$res =& $pearDB->query("SELECT DISTINCT dspr.service_service_id FROM dependency_serviceParent_relation dspr, host_service_relation hsr WHERE dspr.dependency_dep_id = '".$dep_id."' AND hsr.service_service_id = dspr.service_service_id AND hsr.host_host_id IS NOT NULL GROUP BY service_service_id");
+		for($i = 0; $res->fetchInto($service); $i++)
+			$dep["dep_hSvPar"][$i] = $service["service_service_id"];
+		$res->free();
+		# Set HostGroup Service Parents
+		$res =& $pearDB->query("SELECT DISTINCT dspr.service_service_id FROM dependency_serviceParent_relation dspr, host_service_relation hsr WHERE dspr.dependency_dep_id = '".$dep_id."' AND hsr.service_service_id = dspr.service_service_id AND hsr.hostgroup_hg_id IS NOT NULL GROUP BY service_service_id");
+		for($i = 0; $res->fetchInto($service); $i++)
+			$dep["dep_hgSvPar"][$i] = $service["service_service_id"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Services comes from DB -> Store in $hServices Array and $hgServices
+	$hServices = array();
+	$hgServices = array();
+	$res =& $pearDB->query("SELECT DISTINCT h.host_name, sv.service_description, sv.service_template_model_stm_id, sv.service_id FROM host_service_relation hsr, service sv, host h WHERE sv.service_register = '1' AND hsr.service_service_id = sv.service_id AND h.host_id = hsr.host_host_id AND h.host_id IN (".$oreon->user->lcaHStr.") ORDER BY sv.service_description, h.host_name");
+	while($res->fetchInto($elem))	{
+		# If the description of our Service is in the Template definition, we have to catch it, whatever the level of it :-)
+		if (!$elem["service_description"])
+			$elem["service_description"] = getMyServiceName($elem['service_template_model_stm_id']);
+		if (isset($hServices[$elem["service_id"]]))
+			$hServices[$elem["service_id"]] = $elem["host_name"]."&nbsp;&nbsp;&nbsp;&nbsp;(*)".$elem["service_description"];
+		else
+			$hServices[$elem["service_id"]] = $elem["host_name"]."&nbsp;&nbsp;&nbsp;&nbsp;".$elem["service_description"];
+	}
+	$res->free();
+	$res =& $pearDB->query("SELECT DISTINCT hg.hg_name, sv.service_description, sv.service_template_model_stm_id, sv.service_id FROM host_service_relation hsr, service sv, hostgroup hg WHERE sv.service_register = '1' AND hsr.service_service_id = sv.service_id AND hg.hg_id = hsr.hostgroup_hg_id AND hg.hg_id IN (".$oreon->user->lcaHGStr.") ORDER BY sv.service_description, hg.hg_name");
+	while($res->fetchInto($elem))	{
+		# If the description of our Service is in the Template definition, we have to catch it, whatever the level of it :-)
+		if (!$elem["service_description"])
+			$elem["service_description"] = getMyServiceName($elem['service_template_model_stm_id']);
+		if (isset($hgServices[$elem["service_id"]]))
+			$hgServices[$elem["service_id"]] = $elem["hg_name"]."&nbsp;&nbsp;&nbsp;&nbsp;(*)".$elem["service_description"];
+		else
+			$hgServices[$elem["service_id"]] = $elem["hg_name"]."&nbsp;&nbsp;&nbsp;&nbsp;".$elem["service_description"];
+	}
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsText2 	= array("size"=>"10");
+	$attrsAdvSelect = array("style" => "width: 250px; height: 150px;");
+	$attrsTextarea 	= array("rows"=>"3", "cols"=>"30");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["dep_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["dep_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["dep_view"]);
+
+	#
+	## Dependency basic information
+	#
+	$form->addElement('header', 'information', $lang['dep_infos']);
+	$form->addElement('text', 'dep_name', $lang["dep_name"], $attrsText);
+	$form->addElement('text', 'dep_description', $lang["dep_description"], $attrsText);
+	if ($oreon->user->get_version() == 2)	{
+		$tab = array();
+		$tab[] = &HTML_QuickForm::createElement('radio', 'inherits_parent', null, $lang['yes'], '1');
+		$tab[] = &HTML_QuickForm::createElement('radio', 'inherits_parent', null, $lang['no'], '0');
+		$form->addGroup($tab, 'inherits_parent', $lang["dep_inheritsP"], '&nbsp;');
+	}
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'o', '&nbsp;', 'Ok');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'w', '&nbsp;', 'Warning');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unknown');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'c', '&nbsp;', 'Critical');
+	if ($oreon->user->get_version() == 2)
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'p', '&nbsp;', 'Pending');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'n', '&nbsp;', 'None');
+	$form->addGroup($tab, 'notification_failure_criteria', $lang["dep_notifFC"], '&nbsp;&nbsp;');
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'o', '&nbsp;', 'Ok');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'w', '&nbsp;', 'Warning');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unknown');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'c', '&nbsp;', 'Critical');
+	if ($oreon->user->get_version() == 2)
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'p', '&nbsp;', 'Pending');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'n', '&nbsp;', 'None');
+	$form->addGroup($tab, 'execution_failure_criteria', $lang["dep_exeFC"], '&nbsp;&nbsp;');
+
+	$form->addElement('textarea', 'dep_comment', $lang["dep_comment"], $attrsTextarea);
+	#
+	## Sort 2 Host Service Dependencies
+	#
+	$ams1 =& $form->addElement('advmultiselect', 'dep_hSvPar', $lang['dep_hSvPar'], $hServices, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+    $ams1 =& $form->addElement('advmultiselect', 'dep_hSvChi', $lang['dep_hSvChi'], $hServices, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+	#
+	## Sort 3 HostGroup Service Dependencies
+	#
+	$ams1 =& $form->addElement('advmultiselect', 'dep_hgSvPar', $lang['dep_hgSvPar'], $hgServices, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+    $ams1 =& $form->addElement('advmultiselect', 'dep_hgSvChi', $lang['dep_hgSvChi'], $hgServices, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+
+	$form->addElement('hidden', 'dep_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('dep_name', $lang['ErrName'], 'required');
+	$form->addRule('dep_description', $lang['ErrRequired'], 'required');
+	$form->registerRule('cycleH', 'callback', 'testCycleH');
+	$form->registerRule('cycleHg', 'callback', 'testCycleHg');
+	$form->addRule('dep_hSvChi', $lang['ErrCycleDef'], 'cycleH');
+	$form->addRule('dep_hgSvChi', $lang['ErrCycleDef'], 'cycleHg');
+	$form->registerRule('exist', 'callback', 'testServiceDependencyExistence');
+	$form->addRule('dep_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	$tpl->assign("sort1", $lang['dep_infos']);
+	$tpl->assign("sort2", $lang['dep_sort2']);
+	$tpl->assign("sort3", $lang['dep_sort3']);
+
+	$tpl->assign("legend1", $lang['legend1']);
+
+	# Just watch a Dependency information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&dep_id=".$dep_id."'"));
+	    $form->setDefaults($dep);
+		$form->freeze();
+	}
+	# Modify a Dependency information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($dep);
+	}
+	# Add a Dependency information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	$tpl->assign("nagios", $oreon->user->get_version());
+
+	$valid = false;
+	if ($form->validate())	{
+		$depObj =& $form->getElement('dep_id');
+		if ($form->getSubmitValue("submitA"))
+			$depObj->setValue(insertServiceDependencyInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateServiceDependencyInDB($depObj->getValue("dep_id"));
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&dep_id=".$depObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once("listServiceDependency.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->display("formServiceDependency.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/service_dependency/listServiceDependency.ihtml b/www/include/configuration/configObject/service_dependency/listServiceDependency.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..bb58fb747e5b99b2258856c39b4dcd8356f0493d
--- /dev/null
+++ b/www/include/configuration/configObject/service_dependency/listServiceDependency.ihtml
@@ -0,0 +1,39 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_description}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_description}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter"></td>
+			<td class="ListColFooterRight" align="right" colpan="2"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
\ No newline at end of file
diff --git a/www/include/configuration/configObject/service_dependency/listServiceDependency.php b/www/include/configuration/configObject/service_dependency/listServiceDependency.php
new file mode 100644
index 0000000000000000000000000000000000000000..b0d24ecc06e3be0a8af6b03953286bc5069409cb
--- /dev/null
+++ b/www/include/configuration/configObject/service_dependency/listServiceDependency.php
@@ -0,0 +1,98 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	isset($_GET["list"]) ? $list = $_GET["list"] : $list = NULL;
+	$rq = "SELECT COUNT(*) FROM dependency dep";
+	$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM dependency_serviceChild_relation dscr WHERE dscr.dependency_dep_id = dep.dep_id) > 0 ";
+	$rq .= " AND (SELECT DISTINCT COUNT(*) FROM dependency_serviceParent_relation dspr WHERE dspr.dependency_dep_id = dep.dep_id) > 0 ";
+	if ($search)
+		$rq .= " AND dep_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'";
+	$res = & $pearDB->query($rq);
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+	
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_description", $lang['description']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Dependency list
+	$rq = "SELECT dep_id, dep_name, dep_description FROM dependency dep";
+	$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM dependency_serviceChild_relation dscr WHERE dscr.dependency_dep_id = dep.dep_id) > 0 ";
+	$rq .= " AND (SELECT DISTINCT COUNT(*) FROM dependency_serviceParent_relation dspr WHERE dspr.dependency_dep_id = dep.dep_id) > 0 ";
+	if ($search)
+		$rq .= " AND dep_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'";
+	$rq .= " LIMIT ".$num * $limit.", ".$limit;
+	$res =& $pearDB->query($rq);	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($dep); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$dep['dep_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&dep_id=".$dep['dep_id']."&o=w&search=".$search."&list=".$list."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&dep_id=".$dep['dep_id']."&o=c&search=".$search."&list=".$list."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&dep_id=".$dep['dep_id']."&o=d&select[".$dep['dep_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."&list=".$list."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$dep['dep_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$dep["dep_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&dep_id=".$dep['dep_id'],
+						"RowMenu_description"=>$dep["dep_description"],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listServiceDependency.ihtml");
+	
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+	?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/service_dependency/serviceDependency.php b/www/include/configuration/configObject/service_dependency/serviceDependency.php
new file mode 100644
index 0000000000000000000000000000000000000000..293bd5f923616842e7b0be967c1afb04984d777f
--- /dev/null
+++ b/www/include/configuration/configObject/service_dependency/serviceDependency.php
@@ -0,0 +1,47 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["dep_id"]) ? $cG = $_GET["dep_id"] : $cG = NULL;
+	isset($_POST["dep_id"]) ? $cP = $_POST["dep_id"] : $cP = NULL;
+	$cG ? $dep_id = $cG : $dep_id = $cP;
+	
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/service_dependency/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formServiceDependency.php"); break; #Add a Dependency
+		case "w" : require_once($path."formServiceDependency.php"); break; #Watch a Dependency
+		case "c" : require_once($path."formServiceDependency.php"); break; #Modify a Dependency
+		case "m" : multipleServiceDependencyInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listServiceDependency.php"); break; #Duplicate n Dependencys
+		case "d" : deleteServiceDependencyInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listServiceDependency.php"); break; #Delete n Dependency
+		default : require_once($path."listServiceDependency.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/service_template_model/formServiceTemplateModel.php b/www/include/configuration/configObject/service_template_model/formServiceTemplateModel.php
new file mode 100644
index 0000000000000000000000000000000000000000..c2403459a22333c468fdef70035ef19779fa7d07
--- /dev/null
+++ b/www/include/configuration/configObject/service_template_model/formServiceTemplateModel.php
@@ -0,0 +1,436 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Service
+	#
+	
+	function myDecodeSvTP($arg)	{
+		$arg = str_replace('#BR#', "\\n", $arg);
+		$arg = str_replace('#T#', "\\t", $arg);
+		$arg = str_replace('#R#', "\\r", $arg);
+		$arg = str_replace('#S#', "/", $arg);
+		$arg = str_replace('#BS#', "\\", $arg);
+		return html_entity_decode($arg, ENT_QUOTES);
+	}
+	
+	$service = array();
+	if (($o == "c" || $o == "w") && $service_id)	{
+		
+		$res =& $pearDB->query("SELECT * FROM service, extended_service_information esi WHERE service_id = '".$service_id."' AND esi.service_service_id = service_id LIMIT 1");
+		# Set base value
+		$service = array_map("myDecodeSvTP", $res->fetchRow());
+		# Grab hostgroup || host
+		$res =& $pearDB->query("SELECT * FROM host_service_relation hsr WHERE hsr.service_service_id = '".$service_id."'");
+		while ($res->fetchInto($parent))	{
+			if ($parent["host_host_id"])
+				$service["service_hPars"][$parent["host_host_id"]] = $parent["host_host_id"];
+			else if ($parent["hostgroup_hg_id"])
+				$service["service_hgPars"][$parent["hostgroup_hg_id"]] = $parent["hostgroup_hg_id"];
+		}
+		# Set Service Notification Options
+		$tmp = explode(',', $service["service_notification_options"]);
+		foreach ($tmp as $key => $value)
+			$service["service_notifOpts"][trim($value)] = 1;
+		# Set Stalking Options
+		$tmp = explode(',', $service["service_stalking_options"]);
+		foreach ($tmp as $key => $value)
+			$service["service_stalOpts"][trim($value)] = 1;
+		$res->free();
+		# Set Contact Group
+		$res =& $pearDB->query("SELECT DISTINCT contactgroup_cg_id FROM contactgroup_service_relation WHERE service_service_id = '".$service_id."'");
+		for($i = 0; $res->fetchInto($notifCg); $i++)
+			$service["service_cgs"][$i] = $notifCg["contactgroup_cg_id"];
+		$res->free();
+		# Set Service Group Parents
+		$res =& $pearDB->query("SELECT DISTINCT servicegroup_sg_id FROM servicegroup_relation WHERE service_service_id = '".$service_id."'");
+		for($i = 0; $res->fetchInto($sg); $i++)
+			$service["service_sgs"][$i] = $sg["servicegroup_sg_id"];
+		$res->free();
+		# Set Traps
+		$res =& $pearDB->query("SELECT DISTINCT traps_id FROM traps_service_relation WHERE service_id = '".$service_id."'");
+		for($i = 0; $res->fetchInto($trap); $i++)
+			$service["service_traps"][$i] = $trap["traps_id"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Host Templates comes from DB -> Store in $hosts Array
+	$hosts = array();
+	$res =& $pearDB->query("SELECT host_id, host_name FROM host WHERE host_register = '0' ORDER BY host_name");
+	while($res->fetchInto($host))
+		$hosts[$host["host_id"]] = $host["host_name"];
+	$res->free();
+	# Service Templates comes from DB -> Store in $svTpls Array
+	$svTpls = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT service_id, service_description, service_template_model_stm_id FROM service WHERE service_register = '0' AND service_id != '".$service_id."' ORDER BY service_description");
+	while($res->fetchInto($svTpl))	{
+		if (!$svTpl["service_description"])
+			$svTpl["service_description"] = getMyServiceName($svTpl["service_template_model_stm_id"])."'";
+		$svTpls[$svTpl["service_id"]] = $svTpl["service_description"];
+	}
+	$res->free();
+	# Timeperiods comes from DB -> Store in $tps Array
+	$tps = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT tp_id, tp_name FROM timeperiod ORDER BY tp_name");
+	while($res->fetchInto($tp))
+		$tps[$tp["tp_id"]] = $tp["tp_name"];
+	$res->free();
+	# Check commands comes from DB -> Store in $checkCmds Array
+	$checkCmds = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT command_id, command_name FROM command WHERE command_type = '2' ORDER BY command_name");
+	while($res->fetchInto($checkCmd))
+		$checkCmds[$checkCmd["command_id"]] = $checkCmd["command_name"];
+	$res->free();
+	# Contact Groups comes from DB -> Store in $notifCcts Array
+	$notifCgs = array();
+	$res =& $pearDB->query("SELECT cg_id, cg_name FROM contactgroup ORDER BY cg_name");
+	while($res->fetchInto($notifCg))
+		$notifCgs[$notifCg["cg_id"]] = $notifCg["cg_name"];
+	$res->free();
+	# Service Groups comes from DB -> Store in $hgs Array
+	$sgs = array();
+	$res =& $pearDB->query("SELECT sg_id, sg_name FROM servicegroup ORDER BY sg_name");
+	while($res->fetchInto($sg))
+		$sgs[$sg["sg_id"]] = $sg["sg_name"];
+	$res->free();
+	# Graphs Template comes from DB -> Store in $graphTpls Array
+	$graphTpls = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT graph_id, name FROM giv_graphs_template ORDER BY name");
+	while($res->fetchInto($graphTpl))
+		$graphTpls[$graphTpl["graph_id"]] = $graphTpl["name"];
+	$res->free();
+	# Traps definition comes from DB -> Store in $traps Array
+	$traps = array();
+	$res =& $pearDB->query("SELECT traps_id, traps_name FROM traps ORDER BY traps_name");
+	while($res->fetchInto($trap))
+		$traps[$trap["traps_id"]] = $trap["traps_name"];
+	$res->free();
+	# Deletion Policy definition comes from DB -> Store in $ppols Array
+	$ppols = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT purge_policy_id, purge_policy_name FROM purge_policy ORDER BY purge_policy_name");
+	while($res->fetchInto($ppol))
+		$ppols[$ppol["purge_policy_id"]] = $ppol["purge_policy_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsText2		= array("size"=>"6");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["stm_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["stm_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["stm_view"]);
+
+	#
+	## Service basic information
+	#
+	$form->addElement('header', 'information', $lang['sv_infos']);
+
+	$form->addElement('text', 'service_description', $lang["sv_description"], $attrsText);
+
+	$form->addElement('select', 'service_template_model_stm_id', $lang['stm_template'], $svTpls);
+	$form->addElement('static', 'tplText', $lang['stm_templateText']);
+
+    $ams3 =& $form->addElement('advmultiselect', 'service_hPars', $lang['sv_hPars'], $hosts, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+
+	#
+	## Check information
+	#
+	$form->addElement('header', 'check', $lang['sv_head_state']);
+
+	$serviceIV[] = &HTML_QuickForm::createElement('radio', 'service_is_volatile', null, $lang["yes"], '1');
+	$serviceIV[] = &HTML_QuickForm::createElement('radio', 'service_is_volatile', null, $lang["no"], '0');
+	$serviceIV[] = &HTML_QuickForm::createElement('radio', 'service_is_volatile', null, $lang["nothing"], '2');
+	$form->addGroup($serviceIV, 'service_is_volatile', $lang['sv_isVolatile'], '&nbsp;');
+	$form->setDefaults(array('service_is_volatile' => '2'));
+
+	$form->addElement('select', 'command_command_id', $lang['sv_checkCmd'], $checkCmds);
+	$form->addElement('text', 'command_command_id_arg', $lang['sv_args'], $attrsText);
+	$form->addElement('text', 'service_max_check_attempts', $lang['sv_checkMca'], $attrsText2);
+	$form->addElement('text', 'service_normal_check_interval', $lang['sv_normalCheckInterval'], $attrsText2);
+	$form->addElement('text', 'service_retry_check_interval', $lang['sv_retryCheckInterval'], $attrsText2);
+
+	$serviceEHE[] = &HTML_QuickForm::createElement('radio', 'service_event_handler_enabled', null, $lang["yes"], '1');
+	$serviceEHE[] = &HTML_QuickForm::createElement('radio', 'service_event_handler_enabled', null, $lang["no"], '0');
+	$serviceEHE[] = &HTML_QuickForm::createElement('radio', 'service_event_handler_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($serviceEHE, 'service_event_handler_enabled', $lang['sv_eventHandlerE'], '&nbsp;');
+	$form->setDefaults(array('service_event_handler_enabled' => '2'));
+	$form->addElement('select', 'command_command_id2', $lang['sv_eventHandler'], $checkCmds);
+	$form->addElement('text', 'command_command_id_arg2', $lang['sv_args'], $attrsText);
+
+
+	$serviceACE[] = &HTML_QuickForm::createElement('radio', 'service_active_checks_enabled', null, $lang["yes"], '1');
+	$serviceACE[] = &HTML_QuickForm::createElement('radio', 'service_active_checks_enabled', null, $lang["no"], '0');
+	$serviceACE[] = &HTML_QuickForm::createElement('radio', 'service_active_checks_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($serviceACE, 'service_active_checks_enabled', $lang['sv_activeCE'], '&nbsp;');
+	$form->setDefaults(array('service_active_checks_enabled' => '2'));
+
+	$servicePCE[] = &HTML_QuickForm::createElement('radio', 'service_passive_checks_enabled', null, $lang["yes"], '1');
+	$servicePCE[] = &HTML_QuickForm::createElement('radio', 'service_passive_checks_enabled', null, $lang["no"], '0');
+	$servicePCE[] = &HTML_QuickForm::createElement('radio', 'service_passive_checks_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($servicePCE, 'service_passive_checks_enabled', $lang['sv_passiveCE'], '&nbsp;');
+	$form->setDefaults(array('service_passive_checks_enabled' => '2'));
+
+	$form->addElement('select', 'timeperiod_tp_id', $lang['sv_checkPeriod'], $tps);
+
+	##
+	## Notification informations
+	##
+	$form->addElement('header', 'notification', $lang['sv_head_notif']);
+	$serviceNE[] = &HTML_QuickForm::createElement('radio', 'service_notifications_enabled', null, $lang["yes"], '1');
+	$serviceNE[] = &HTML_QuickForm::createElement('radio', 'service_notifications_enabled', null, $lang["no"], '0');
+	$serviceNE[] = &HTML_QuickForm::createElement('radio', 'service_notifications_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($serviceNE, 'service_notifications_enabled', $lang['sv_notifEnabled'], '&nbsp;');
+	$form->setDefaults(array('service_notifications_enabled' => '2'));
+
+    $ams3 =& $form->addElement('advmultiselect', 'service_cgs', $lang['sv_CgMembers'], $notifCgs, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+
+	$form->addElement('text', 'service_notification_interval', $lang['sv_notifInt'], $attrsText2);
+	$form->addElement('select', 'timeperiod_tp_id2', $lang['sv_notifTp'], $tps);
+
+ 	$serviceNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'w', '&nbsp;', 'Warning');
+	$serviceNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unknown');
+	$serviceNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'c', '&nbsp;', 'Critical');
+	$serviceNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'r', '&nbsp;', 'Recovery');
+	if ($oreon->user->get_version() == 2)
+		$serviceNotifOpt[] = &HTML_QuickForm::createElement('checkbox', 'f', '&nbsp;', 'Flapping');
+	$form->addGroup($serviceNotifOpt, 'service_notifOpts', $lang['sv_notifOpts'], '&nbsp;&nbsp;');
+
+ 	$serviceStalOpt[] = &HTML_QuickForm::createElement('checkbox', 'o', '&nbsp;', 'Ok');
+	$serviceStalOpt[] = &HTML_QuickForm::createElement('checkbox', 'w', '&nbsp;', 'Warning');
+	$serviceStalOpt[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'unknown');
+	$serviceStalOpt[] = &HTML_QuickForm::createElement('checkbox', 'c', '&nbsp;', 'Critical');
+	$form->addGroup($serviceStalOpt, 'service_stalOpts', $lang['sv_stalOpts'], '&nbsp;&nbsp;');
+
+	#
+	## Further informations
+	#
+	$form->addElement('header', 'furtherInfos', $lang['further_infos']);
+	$serviceActivation[] = &HTML_QuickForm::createElement('radio', 'service_activate', null, $lang["enable"], '1');
+	$serviceActivation[] = &HTML_QuickForm::createElement('radio', 'service_activate', null, $lang["disable"], '0');
+	$form->addGroup($serviceActivation, 'service_activate', $lang["status"], '&nbsp;');
+	$form->setDefaults(array('service_activate' => '1'));
+	$form->addElement('textarea', 'service_comment', $lang["cmt_comment"], $attrsTextarea);
+
+	#
+	## Sort 2 - Service relations
+	#
+	$form->addElement('header', 'links', $lang['sv_head_links']);
+
+	$form->addElement('header', 'traps', $lang['gen_trapd']);
+    $ams3 =& $form->addElement('advmultiselect', 'service_traps', $lang['sv_traps'], $traps, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+	
+	##
+	## Sort 3 - Data treatment
+	##
+	$form->addElement('header', 'treatment', $lang['sv_head_treat']);
+
+	$servicePC[] = &HTML_QuickForm::createElement('radio', 'service_parallelize_check', null, $lang["yes"], '1');
+	$servicePC[] = &HTML_QuickForm::createElement('radio', 'service_parallelize_check', null, $lang["no"], '0');
+	$servicePC[] = &HTML_QuickForm::createElement('radio', 'service_parallelize_check', null, $lang["nothing"], '2');
+	$form->addGroup($servicePC, 'service_parallelize_check', $lang['sv_paraCheck'], '&nbsp;');
+	$form->setDefaults(array('service_parallelize_check' => '2'));
+
+	$serviceOOS[] = &HTML_QuickForm::createElement('radio', 'service_obsess_over_service', null, $lang["yes"], '1');
+	$serviceOOS[] = &HTML_QuickForm::createElement('radio', 'service_obsess_over_service', null, $lang["no"], '0');
+	$serviceOOS[] = &HTML_QuickForm::createElement('radio', 'service_obsess_over_service', null, $lang["nothing"], '2');
+	$form->addGroup($serviceOOS, 'service_obsess_over_service', $lang['sv_ObsessOS'], '&nbsp;');
+	$form->setDefaults(array('service_obsess_over_service' => '2'));
+
+	$serviceCF[] = &HTML_QuickForm::createElement('radio', 'service_check_freshness', null, $lang["yes"], '1');
+	$serviceCF[] = &HTML_QuickForm::createElement('radio', 'service_check_freshness', null, $lang["no"], '0');
+	$serviceCF[] = &HTML_QuickForm::createElement('radio', 'service_check_freshness', null, $lang["nothing"], '2');
+	$form->addGroup($serviceCF, 'service_check_freshness', $lang['sv_checkFreshness'], '&nbsp;');
+	$form->setDefaults(array('service_check_freshness' => '2'));
+
+	$serviceFDE[] = &HTML_QuickForm::createElement('radio', 'service_flap_detection_enabled', null, $lang["yes"], '1');
+	$serviceFDE[] = &HTML_QuickForm::createElement('radio', 'service_flap_detection_enabled', null, $lang["no"], '0');
+	$serviceFDE[] = &HTML_QuickForm::createElement('radio', 'service_flap_detection_enabled', null, $lang["nothing"], '2');
+	$form->addGroup($serviceFDE, 'service_flap_detection_enabled', $lang['sv_flapDetect'], '&nbsp;');
+	$form->setDefaults(array('service_flap_detection_enabled' => '2'));
+
+	$form->addElement('text', 'service_freshness_threshold', $lang['sv_FreshnessThreshold'], $attrsText2);
+	$form->addElement('text', 'service_low_flap_threshold', $lang['sv_lowFT'], $attrsText2);
+	$form->addElement('text', 'service_high_flap_threshold', $lang['sv_highFT'], $attrsText2);
+
+	$servicePPD[] = &HTML_QuickForm::createElement('radio', 'service_process_perf_data', null, $lang["yes"], '1');
+	$servicePPD[] = &HTML_QuickForm::createElement('radio', 'service_process_perf_data', null, $lang["no"], '0');
+	$servicePPD[] = &HTML_QuickForm::createElement('radio', 'service_process_perf_data', null, $lang["nothing"], '2');
+	$form->addGroup($servicePPD, 'service_process_perf_data', $lang['sv_processPD'], '&nbsp;');
+	$form->setDefaults(array('service_process_perf_data' => '2'));
+
+	$serviceRSI[] = &HTML_QuickForm::createElement('radio', 'service_retain_status_information', null, $lang["yes"], '1');
+	$serviceRSI[] = &HTML_QuickForm::createElement('radio', 'service_retain_status_information', null, $lang["no"], '0');
+	$serviceRSI[] = &HTML_QuickForm::createElement('radio', 'service_retain_status_information', null, $lang["nothing"], '2');
+	$form->addGroup($serviceRSI, 'service_retain_status_information', $lang['sv_retainSI'], '&nbsp;');
+	$form->setDefaults(array('service_retain_status_information' => '2'));
+
+	$serviceRNI[] = &HTML_QuickForm::createElement('radio', 'service_retain_nonstatus_information', null, $lang["yes"], '1');
+	$serviceRNI[] = &HTML_QuickForm::createElement('radio', 'service_retain_nonstatus_information', null, $lang["no"], '0');
+	$serviceRNI[] = &HTML_QuickForm::createElement('radio', 'service_retain_nonstatus_information', null, $lang["nothing"], '2');
+	$form->addGroup($serviceRNI, 'service_retain_nonstatus_information', $lang['sv_retainNI'], '&nbsp;');
+	$form->setDefaults(array('service_retain_nonstatus_information' => '2'));
+
+	if ($oreon->optGen["perfparse_installed"])	{
+		$form->addElement('header', 'purge_policy', $lang["mod_purgePolicy"]);
+		$form->addElement('select', 'purge_policy_id', $lang["mod_purgePolicy_name"], $ppols);
+	}
+	
+	#
+	## Sort 4 - Extended Infos
+	#
+	if ($o == "a")
+		$form->addElement('header', 'title4', $lang["sv_ExtInf_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title4', $lang["sv_ExtInf_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title4', $lang["sv_ExtInf_view"]);
+
+	$form->addElement('header', 'nagios', $lang['h_nagios']);
+	if ($oreon->user->get_version() == 2)
+		$form->addElement('text', 'esi_notes', $lang['h_notes'], $attrsText);
+	$form->addElement('text', 'esi_notes_url', $lang['h_notesUrl'], $attrsText);
+	if ($oreon->user->get_version() == 2)
+		$form->addElement('text', 'esi_action_url', $lang['h_actionUrl'], $attrsText);
+	$form->addElement('text', 'esi_icon_image', $lang['h_iconImg'], $attrsText);
+	$form->addElement('text', 'esi_icon_image_alt', $lang['h_iconImgAlt'], $attrsText);
+
+	$form->addElement('header', 'oreon', $lang['h_oreon']);
+	$form->addElement('select', 'graph_id', $lang['sv_graphTpl'], $graphTpls);
+	
+	$serviceActivation[] = &HTML_QuickForm::createElement('radio', 'service_activate', null, $lang["enable"], '1');
+	$serviceActivation[] = &HTML_QuickForm::createElement('radio', 'service_activate', null, $lang["disable"], '0');
+	$form->addGroup($serviceActivation, 'service_activate', $lang["status"], '&nbsp;');
+	$form->setDefaults(array('service_activate' => '1'));
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action' => '1'));
+
+	$form->addElement('hidden', 'service_id');
+	$reg =& $form->addElement('hidden', 'service_register');
+	$reg->setValue("0");
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	function myReplace()	{
+		global $form;
+		return (str_replace(" ", "_", $form->getSubmitValue("service_description")));
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('service_description', 'myReplace');
+	$form->addRule('service_description', $lang['ErrName'], 'required');
+
+	//$form->registerRule('exist', 'callback', 'testExistence');
+	//$form->addRule('service_description', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path2, $tpl);
+
+	# Just watch a host information
+	if ($o == "w")	{
+		if (!$min)
+			$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&service_id=".$service_id."'"));
+	    $form->setDefaults($service);
+		$form->freeze();
+	}
+	# Modify a service information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($service);
+	}
+	# Add a service information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	$tpl->assign('msg', array ("nagios"=>$oreon->user->get_version(), "tpl"=>1, "perfparse"=>$oreon->optGen["perfparse_installed"]));
+	$tpl->assign("sort1", $lang['sv_conf']);
+	$tpl->assign("sort2", $lang['sv_head_links']);
+	$tpl->assign("sort3", $lang['sv_head_treat']);
+	$tpl->assign("sort4", $lang['sv_extInf']);
+	$tpl->assign('time_unit', " * ".$oreon->Nagioscfg["interval_length"]." ".$lang["time_sec"]);
+
+	$valid = false;
+	if ($form->validate())	{
+		$serviceObj =& $form->getElement('service_id');
+		if ($form->getSubmitValue("submitA"))
+			$serviceObj->setValue(insertServiceInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateServiceInDB($serviceObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&service_id=".$serviceObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listServiceTemplateModel.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->assign('v', $oreon->user->get_version());
+		$tpl->display("formService.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/service_template_model/listServiceTemplateModel.ihtml b/www/include/configuration/configObject/service_template_model/listServiceTemplateModel.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..7472991453fd4e4a6d23e6e3244d686a7c801f62
--- /dev/null
+++ b/www/include/configuration/configObject/service_template_model/listServiceTemplateModel.ihtml
@@ -0,0 +1,43 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_parent}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_desc}</a></td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_parent}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight" align="right">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="2"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+
+	{$form.hidden}
+</form>
diff --git a/www/include/configuration/configObject/service_template_model/listServiceTemplateModel.php b/www/include/configuration/configObject/service_template_model/listServiceTemplateModel.php
new file mode 100644
index 0000000000000000000000000000000000000000..ab51ec0b0ece8e6b1155c89c053b1c1abcd32f9e
--- /dev/null
+++ b/www/include/configuration/configObject/service_template_model/listServiceTemplateModel.php
@@ -0,0 +1,101 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM service sv WHERE sv.service_description LIKE '%".htmlentities($search, ENT_QUOTES)."%' AND sv.service_register = '0'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM service sv WHERE service_register = '0'");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+	
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_desc", $lang['stm']);
+	$tpl->assign("headerMenu_parent", $lang['stm_parent']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Service Template Model list
+	if ($search)
+		$rq = "SELECT @tplPar:=(SELECT service_description FROM service WHERE service_id = sv.service_template_model_stm_id) AS tplPar, sv.service_id, sv.service_description, sv.service_activate, sv.service_template_model_stm_id FROM service sv WHERE sv.service_description LIKE '%".htmlentities($search, ENT_QUOTES)."%' AND sv.service_register = '0' ORDER BY service_description LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT @tplPar:=(SELECT service_description FROM service WHERE service_id = sv.service_template_model_stm_id) AS tplPar, sv.service_id, sv.service_description, sv.service_activate, sv.service_template_model_stm_id FROM service sv WHERE sv.service_register = '0' ORDER BY service_description LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($service); $i++) {
+		$selectedElements =& $form->addElement('checkbox', "select[".$service['service_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&service_id=".$service['service_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&service_id=".$service['service_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&service_id=".$service['service_id']."&o=d&select[".$service['service_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($service["service_activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&service_id=".$service['service_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&service_id=".$service['service_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$service['service_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		# If the description of our Service Model is in the Template definition, we have to catch it, whatever the level of it :-)
+		if (!$service["service_description"])
+			$service["service_description"] = getMyServiceName($service['service_template_model_stm_id']);
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_desc"=>$service["service_description"],
+						"RowMenu_parent"=>$service["service_template_model_stm_id"] ? $service["tplPar"] :  $lang["no"],
+						"RowMenu_link"=>"?p=".$p."&o=w&service_id=".$service['service_id'],
+						"RowMenu_status"=>$service["service_activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listServiceTemplateModel.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/service_template_model/serviceTemplateModel.php b/www/include/configuration/configObject/service_template_model/serviceTemplateModel.php
new file mode 100644
index 0000000000000000000000000000000000000000..69746f7975ab9861e8c75870ac0d9ef455f949d3
--- /dev/null
+++ b/www/include/configuration/configObject/service_template_model/serviceTemplateModel.php
@@ -0,0 +1,50 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["service_id"]) ? $sG = $_GET["service_id"] : $sG = NULL;
+	isset($_POST["service_id"]) ? $sP = $_POST["service_id"] : $sP = NULL;
+	$sG ? $service_id = $sG : $service_id = $sP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/service_template_model/";
+	$path2 = "./include/configuration/configObject/service/";
+	
+	#PHP functions
+	require_once $path2."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formServiceTemplateModel.php"); break; #Add a Service Template Model
+		case "w" : require_once($path."formServiceTemplateModel.php"); break; #Watch a Service Template Model
+		case "c" : require_once($path."formServiceTemplateModel.php"); break; #Modify a Service Template Model
+		case "s" : enableServiceInDB($service_id); require_once($path."listServiceTemplateModel.php"); break; #Activate a Service Template Model
+		case "u" : disableServiceInDB($service_id); require_once($path."listServiceTemplateModel.php"); break; #Desactivate a Service Template Model
+		case "m" : multipleServiceInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listServiceTemplateModel.php"); break; #Duplicate n Service Template Models
+		case "d" : deleteServiceInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listServiceTemplateModel.php"); break; #Delete n Service Template Models
+		default : require_once($path."listServiceTemplateModel.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/servicegroup/DB-Func.php b/www/include/configuration/configObject/servicegroup/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..dd5921a83d9bc5f4e11a8754e1c0bd5195f77f63
--- /dev/null
+++ b/www/include/configuration/configObject/servicegroup/DB-Func.php
@@ -0,0 +1,215 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset ($oreon))
+		exit ();
+	
+	function testServiceGroupExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('sg_id');
+		$res =& $pearDB->query("SELECT sg_name, sg_id FROM servicegroup WHERE sg_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$sg =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $sg["sg_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $sg["sg_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+
+	function enableServiceGroupInDB ($sg_id = null)	{
+		if (!$sg_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE servicegroup SET sg_activate = '1' WHERE sg_id = '".$sg_id."'");
+	}
+	
+	function disableServiceGroupInDB ($sg_id = null)	{
+		if (!$sg_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE servicegroup SET sg_activate = '0' WHERE sg_id = '".$sg_id."'");
+	}
+	
+	function deleteServiceGroupInDB ($serviceGroups = array())	{
+		global $pearDB;
+		foreach($serviceGroups as $key=>$value)
+			$pearDB->query("DELETE FROM servicegroup WHERE sg_id = '".$key."'");
+	}
+	
+	function multipleServiceGroupInDB ($serviceGroups = array(), $nbrDup = array())	{
+		global $pearDB;
+		global $oreon;
+		foreach($serviceGroups as $key=>$value)	{
+			$res =& $pearDB->query("SELECT * FROM servicegroup WHERE sg_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["sg_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = NULL;
+				$rq = NULL;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "sg_name" ? ($sg_name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testServiceGroupExistence($sg_name))	{
+					$val ? $rq = "INSERT INTO servicegroup VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(sg_id) FROM servicegroup");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(sg_id)"]))	{
+						# Update LCA
+						$oreon->user->lcaServiceGroup[$maxId["MAX(sg_id)"]] = $sg_name;
+						$oreon->user->lcaSGStr != '\'\''? $oreon->user->lcaSGStr .= ",".$maxId["MAX(sg_id)"] : $oreon->user->lcaSGStr = $maxId["MAX(sg_id)"];
+						$oreon->user->lcaSGStrName != '\'\''? $oreon->user->lcaSGStrName .= ",".$sg_name : $oreon->user->lcaSGStrName = $sg_name;
+						$res1 =& $pearDB->query("SELECT contactgroup_cg_id FROM contactgroup_contact_relation WHERE contact_contact_id = '".$oreon->user->get_id()."'");
+						while($res1->fetchInto($contactGroup))	{
+						 	$res2 =& $pearDB->query("SELECT lca_define_lca_id FROM lca_define_contactgroup_relation ldcgr WHERE ldcgr.contactgroup_cg_id = '".$contactGroup["contactgroup_cg_id"]."'");	
+							while ($res2->fetchInto($lca))	{
+								$rq = "INSERT INTO lca_define_servicegroup_relation ";
+								$rq .= "(lca_define_lca_id, servicegroup_sg_id) ";
+								$rq .= "VALUES ";
+								$rq .= "('".$lca["lca_define_lca_id"]."', '".$maxId["MAX(sg_id)"]."')";
+								$pearDB->query($rq);
+							}
+						}
+						#
+						$res =& $pearDB->query("SELECT DISTINCT sgr.service_service_id FROM servicegroup_relation sgr WHERE sgr.servicegroup_sg_id = '".$key."'");
+						while($res->fetchInto($service))
+							$pearDB->query("INSERT INTO servicegroup_relation VALUES ('', '".$service["service_service_id"]."', '".$maxId["MAX(sg_id)"]."')");
+					}
+				}
+			}
+		}
+	}
+		
+	function insertServiceGroupInDB ($ret = array())	{
+		$sg_id = insertServiceGroup($ret);
+		updateServiceGroupServices($sg_id, $ret);
+		return $sg_id;
+	}
+	
+	function updateServiceGroupInDB ($sg_id = NULL)	{
+		if (!$sg_id) return;
+		updateServiceGroup($sg_id);
+		updateServiceGroupServices($sg_id);
+	}
+		
+	function insertServiceGroup($ret = array())	{
+		global $form;
+		global $pearDB;
+		global $oreon;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO servicegroup ";
+		$rq .= "(sg_name, sg_alias, country_id, city_id, sg_comment, sg_activate) ";
+		$rq .= "VALUES (";
+		isset($ret["sg_name"]) && $ret["sg_name"] != NULL ? $rq .= "'".htmlentities($ret["sg_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["sg_alias"]) && $ret["sg_alias"] != NULL ? $rq .= "'".htmlentities($ret["sg_alias"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["country_id"]) && $ret["country_id"] != NULL ? $rq .= "'".$ret["country_id"]."', ": $rq .= "NULL, ";
+		if (isset($ret["city_name"]) && $ret["city_name"])	{
+			$res =& $pearDB->query("SELECT city_id FROM view_city WHERE city_name = '".$ret["city_name"]."' LIMIT 1");
+			$city =& $res->fetchRow();
+			isset($city["city_id"]) ? $rq .= "'".$city["city_id"]."', ": $rq .= "NULL, ";
+		}	
+		else
+			$rq .= "NULL, ";
+		isset($ret["sg_comment"]) && $ret["sg_comment"] != NULL ? $rq .= "'".htmlentities($ret["sg_comment"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["sg_activate"]["sg_activate"]) && $ret["sg_activate"]["sg_activate"] != NULL ? $rq .= "'".$ret["sg_activate"]["sg_activate"]."'" : $rq .= "'0'";
+		$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(sg_id) FROM servicegroup");
+		$sg_id = $res->fetchRow();
+		# Update LCA
+		$oreon->user->lcaServiceGroup[$sg_id["MAX(sg_id)"]] = $ret["sg_name"];
+		$oreon->user->lcaSGStr != '\'\''? $oreon->user->lcaSGStr .= ",".$sg_id["MAX(sg_id)"] : $oreon->user->lcaSGStr = $sg_id["MAX(sg_id)"];
+		$oreon->user->lcaSGStrName != '\'\''? $oreon->user->lcaSGStrName .= ",".$ret["sg_name"] : $oreon->user->lcaSGStrName = $ret["sg_name"];
+		$res1 =& $pearDB->query("SELECT contactgroup_cg_id FROM contactgroup_contact_relation WHERE contact_contact_id = '".$oreon->user->get_id()."'");
+		while($res1->fetchInto($contactGroup))	{
+		 	$res2 =& $pearDB->query("SELECT lca_define_lca_id FROM lca_define_contactgroup_relation ldcgr WHERE ldcgr.contactgroup_cg_id = '".$contactGroup["contactgroup_cg_id"]."'");	
+			while ($res2->fetchInto($lca))	{
+				$rq = "INSERT INTO lca_define_servicegroup_relation ";
+				$rq .= "(lca_define_lca_id, servicegroup_sg_id) ";
+				$rq .= "VALUES ";
+				$rq .= "('".$lca["lca_define_lca_id"]."', '".$sg_id["MAX(sg_id)"]."')";
+				$pearDB->query($rq);
+			}
+		}
+		#
+		return ($sg_id["MAX(sg_id)"]);
+	}
+	
+	function updateServiceGroup($sg_id)	{
+		if (!$sg_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE servicegroup SET ";
+		isset($ret["sg_name"]) && $ret["sg_name"] != NULL ? $rq .= "sg_name = '".htmlentities($ret["sg_name"], ENT_QUOTES)."', " : $rq .= "sg_name = NULL,";
+		isset($ret["sg_alias"]) && $ret["sg_alias"] != NULL ? $rq.=	"sg_alias = '".htmlentities($ret["sg_alias"], ENT_QUOTES)."', " : $rq .= "sg_alias = NULL";
+		isset($ret["country_id"]) && $ret["country_id"] != NULL ? $rq .= "country_id = '".$ret["country_id"]."', ": $rq .= "country_id = NULL, ";
+		$rq .= "city_id = ";
+		if (isset($ret["city_name"]) && $ret["city_name"])	{
+			$res =& $pearDB->query("SELECT city_id FROM view_city WHERE city_name = '".$ret["city_name"]."' LIMIT 1");
+			$city =& $res->fetchRow();
+			isset($city["city_id"]) ? $rq .= "'".$city["city_id"]."', ": $rq .= "NULL, ";
+		}	
+		else
+			$rq .= "NULL, ";
+		isset($ret["sg_comment"]) && $ret["sg_comment"] != NULL ? $rq .= "sg_comment = '".htmlentities($ret["sg_comment"], ENT_QUOTES)."', " : $rq .= "sg_comment = NULL,";
+		isset($ret["sg_activate"]["sg_activate"]) && $ret["sg_activate"]["sg_activate"] != NULL ? $rq .= "sg_activate = '".$ret["sg_activate"]["sg_activate"]."' " : $rq .= "sg_activate = '0'";
+		$rq .= "WHERE sg_id = '".$sg_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function updateServiceGroupServices($sg_id, $ret = array())	{
+		if (!$sg_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM servicegroup_relation ";
+		$rq .= "WHERE servicegroup_sg_id = '".$sg_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["sg_hServices"]))
+			$ret = $ret["sg_hServices"];
+		else
+			$ret = $form->getSubmitValue("sg_hServices");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO servicegroup_relation ";
+			$rq .= "(service_service_id, servicegroup_sg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$ret[$i]."', '".$sg_id."')";
+			$pearDB->query($rq);
+		}
+		if (isset($ret["sg_hgServices"]))
+			$ret = $ret["sg_hgServices"];
+		else
+			$ret = $form->getSubmitValue("sg_hgServices");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO servicegroup_relation ";
+			$rq .= "(service_service_id, servicegroup_sg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$ret[$i]."', '".$sg_id."')";
+			$pearDB->query($rq);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/servicegroup/formServiceGroup.ihtml b/www/include/configuration/configObject/servicegroup/formServiceGroup.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..e279c1a78689f234165effcbae5e8bc527629928
--- /dev/null
+++ b/www/include/configuration/configObject/servicegroup/formServiceGroup.ihtml
@@ -0,0 +1,37 @@
+<script type="text/javascript" src="./include/common/javascript/autocomplete-3-2.js"></script>
+
+{$initJS}
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/branch_element.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/clipboard.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.sg_name.label}</td><td class="FormRowValue">{$form.sg_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.sg_alias.label}</td><td class="FormRowValue">{$form.sg_alias.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.country_id.label}</td><td class="FormRowValue">{$form.country_id.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.city_name.label}</td><td class="FormRowValue">{$form.city_name.html}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/element_new_after.gif'>&nbsp;&nbsp;{$form.header.relation}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.sg_hServices.label}</td><td class="FormRowValue">{$form.sg_hServices.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.sg_hgServices.label}</td><td class="FormRowValue">{$form.sg_hgServices.html}</td></tr>
+		
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/cookies.gif'>&nbsp;&nbsp;{$form.header.furtherInfos}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.sg_activate.label}</td><td class="FormRowValue">{$form.sg_activate.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.sg_comment.label}</td><td class="FormRowValue">{$form.sg_comment.html}</td></tr>
+		
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
+
diff --git a/www/include/configuration/configObject/servicegroup/formServiceGroup.php b/www/include/configuration/configObject/servicegroup/formServiceGroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..61cb5b942185b19272755f748c8070917dcc51c1
--- /dev/null
+++ b/www/include/configuration/configObject/servicegroup/formServiceGroup.php
@@ -0,0 +1,216 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for ServiceGroup
+	#
+	$sg = array();
+	if (($o == "c" || $o == "w") && $sg_id)	{	
+		$res =& $pearDB->query("SELECT * FROM servicegroup WHERE sg_id = '".$sg_id."' AND sg_id IN (".$oreon->user->lcaSGStr.") LIMIT 1");
+		# Set base value
+		$sg = array_map("myDecode", $res->fetchRow());
+		# Set ServiceGroup Childs
+		$res =& $pearDB->query("SELECT DISTINCT hsr.host_host_id, sgr.service_service_id FROM servicegroup_relation sgr, host_service_relation hsr WHERE sgr.servicegroup_sg_id = '".$sg_id."' AND hsr.service_service_id = sgr.service_service_id AND hsr.host_host_id IS NOT NULL GROUP BY service_service_id");
+		for($i = 0; $res->fetchInto($services); $i++)
+			$sg["sg_hServices"][$i] = $services["service_service_id"];
+		$res->free();
+		$res =& $pearDB->query("SELECT DISTINCT hsr.hostgroup_hg_id, sgr.service_service_id FROM servicegroup_relation sgr, host_service_relation hsr WHERE sgr.servicegroup_sg_id = '".$sg_id."' AND hsr.service_service_id = sgr.service_service_id AND hsr.hostgroup_hg_id IS NOT NULL GROUP BY service_service_id");
+		for($i = 0; $res->fetchInto($services); $i++)
+			$sg["sg_hgServices"][$i] = $services["service_service_id"];
+		$res->free();
+		# Set City name
+		$res =& $pearDB->query("SELECT DISTINCT cny.country_id, cty.city_name FROM view_city cty, view_country cny WHERE cty.city_id = '".$sg["city_id"]."' AND cny.country_id = '".$sg["country_id"]."'");
+		$city = $res->fetchRow();
+		$sg["city_name"] = $city["city_name"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Services comes from DB -> Store in $hServices Array and $hgServices
+	$hServices = array();
+	$hgServices = array();
+	$initName = NULL;
+	$res =& $pearDB->query("SELECT DISTINCT h.host_name, sv.service_description, sv.service_template_model_stm_id, sv.service_id FROM host_service_relation hsr, service sv, host h WHERE sv.service_register = '1' AND hsr.service_service_id = sv.service_id AND h.host_id = hsr.host_host_id AND h.host_id IN (".$oreon->user->lcaHStr.") ORDER BY h.host_name, sv.service_description");
+	while($res->fetchInto($elem))	{
+		# If the description of our Service is in the Template definition, we have to catch it, whatever the level of it :-)
+		if (!$elem["service_description"])
+			$elem["service_description"] = getMyServiceName($elem['service_template_model_stm_id']);
+		$hServices[$elem["service_id"]] = $elem["host_name"]."&nbsp;&nbsp;&nbsp;&nbsp;".$elem["service_description"];		
+	}
+	$res->free();
+	# Host Group LCA
+	$oreon->user->lcaHGStr ? $lcaHGStr = $oreon->user->lcaHGStr : $lcaHGStr =  '\'\'';
+	$res =& $pearDB->query("SELECT DISTINCT hg.hg_name, sv.service_description, sv.service_template_model_stm_id, sv.service_id FROM host_service_relation hsr, service sv, hostgroup hg WHERE sv.service_register = '1' AND hsr.service_service_id = sv.service_id AND hg.hg_id = hsr.hostgroup_hg_id AND hg.hg_id IN (".$oreon->user->lcaHGStr.") ORDER BY hg.hg_name, sv.service_description");
+	while($res->fetchInto($elem))	{
+		# If the description of our Service is in the Template definition, we have to catch it, whatever the level of it :-)
+		if (!$elem["service_description"])
+			$elem["service_description"] = getMyServiceName($elem['service_template_model_stm_id']);
+		$hgServices[$elem["service_id"]] = $elem["hg_name"]."&nbsp;&nbsp;&nbsp;&nbsp;".$elem["service_description"];
+	}
+	$res->free();
+	# Countries comes from DB -> Store in $countries Array
+	$countries = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT country_id, country_name FROM view_country ORDER BY country_name");
+	while($res->fetchInto($country))
+		$countries[$country["country_id"]] = $country["country_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsAdvSelect = array("style" => "width: 250px; height: 150px;");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["sg_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["sg_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["sg_view"]);
+
+	#
+	## Contact basic information
+	#
+	$form->addElement('header', 'information', $lang['sg_infos']);
+	$form->addElement('text', 'sg_name', $lang["sg_name"], $attrsText);
+	$form->addElement('text', 'sg_alias', $lang["sg_alias"], $attrsText);
+	$form->addElement('select', 'country_id', $lang['h_country'], $countries);
+	$form->addElement('text', 'city_name', $lang['h_city'], array("id"=>"city_name", "size"=>"35", "autocomplete"=>"off"));
+	
+	##
+	## Services Selection
+	##
+	$form->addElement('header', 'relation', $lang['sg_links']);
+    $ams1 =& $form->addElement('advmultiselect', 'sg_hServices', $lang['sg_hostServiceMembers'], $hServices, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+	
+	$form->addElement('header', 'relation', $lang['sg_links']);
+    $ams1 =& $form->addElement('advmultiselect', 'sg_hgServices', $lang['sg_hostGroupServiceMembers'], $hgServices, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+		
+	#
+	## Further informations
+	#
+	$form->addElement('header', 'furtherInfos', $lang['further_infos']);
+	$sgActivation[] = &HTML_QuickForm::createElement('radio', 'sg_activate', null, $lang["enable"], '1');
+	$sgActivation[] = &HTML_QuickForm::createElement('radio', 'sg_activate', null, $lang["disable"], '0');
+	$form->addGroup($sgActivation, 'sg_activate', $lang["status"], '&nbsp;');
+	$form->setDefaults(array('sg_activate' => '1'));
+	$form->addElement('textarea', 'sg_comment', $lang["comment"], $attrsTextarea);
+	
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');	
+	$form->setDefaults(array('action' => '1'));
+	
+	$form->addElement('hidden', 'sg_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	function myReplace()	{
+		global $form;
+		$ret = $form->getSubmitValues();
+		return (str_replace(" ", "_", $ret["sg_name"]));
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('sg_name', 'myReplace');
+	$form->addRule('sg_name', $lang['ErrName'], 'required');
+	$form->addRule('sg_alias', $lang['ErrAlias'], 'required');
+	$form->registerRule('exist', 'callback', 'testServiceGroupExistence');
+	$form->addRule('sg_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	# Just watch a Service Group information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&sg_id=".$sg_id."'"));
+	    $form->setDefaults($sg);
+		$form->freeze();
+	}
+	# Modify a Service Group information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($sg);
+	}
+	# Add a Service Group information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+
+	$tpl->assign('nagios', $oreon->user->get_version());
+	$tpl->assign("initJS", "<script type='text/javascript'>
+							window.onload = function () {
+							initAutoComplete('Form','city_name','sub');
+							};</script>");
+	
+	$valid = false;
+	if ($form->validate())	{
+		$sgObj =& $form->getElement('sg_id');
+		if ($form->getSubmitValue("submitA"))
+			$sgObj->setValue(insertServiceGroupInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateServiceGroupInDB($sgObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&sg_id=".$sgObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listServiceGroup.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("formServiceGroup.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/servicegroup/listServiceGroup.ihtml b/www/include/configuration/configObject/servicegroup/listServiceGroup.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..ea4184ea1167c19c5b72420c2fe770a65cc7424b
--- /dev/null
+++ b/www/include/configuration/configObject/servicegroup/listServiceGroup.ihtml
@@ -0,0 +1,42 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="2"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+	{$form.hidden}
+	</form>
diff --git a/www/include/configuration/configObject/servicegroup/listServiceGroup.php b/www/include/configuration/configObject/servicegroup/listServiceGroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..bfe32697f96a53cfc7e0afa8497751aaad7d2a95
--- /dev/null
+++ b/www/include/configuration/configObject/servicegroup/listServiceGroup.php
@@ -0,0 +1,99 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM servicegroup WHERE sg_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' AND sg_id IN (".$oreon->user->lcaSGStr.")");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM servicegroup WHERE sg_id IN (".$oreon->user->lcaSGStr.")");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Servicegroup list
+	if ($search)
+		$rq = "SELECT sg_id, sg_name, sg_alias, sg_activate FROM servicegroup WHERE sg_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' AND sg_id IN (".$oreon->user->lcaSGStr.") ORDER BY sg_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT sg_id, sg_name, sg_alias, sg_activate FROM servicegroup WHERE sg_id IN (".$oreon->user->lcaSGStr.") ORDER BY sg_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($sg); $i++) {
+		$selectedElements =& $form->addElement('checkbox', "select[".$sg['sg_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&sg_id=".$sg['sg_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&sg_id=".$sg['sg_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&sg_id=".$sg['sg_id']."&o=d&select[".$sg['sg_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($sg["sg_activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&sg_id=".$sg['sg_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&sg_id=".$sg['sg_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$sg['sg_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$sg["sg_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&sg_id=".$sg['sg_id'],
+						"RowMenu_desc"=>$sg["sg_alias"],
+						"RowMenu_status"=>$sg["sg_activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listServiceGroup.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/servicegroup/serviceGroup.php b/www/include/configuration/configObject/servicegroup/serviceGroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..898c4c316127fb62c5296139069928f373ac7561
--- /dev/null
+++ b/www/include/configuration/configObject/servicegroup/serviceGroup.php
@@ -0,0 +1,49 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["sg_id"]) ? $sG = $_GET["sg_id"] : $sG = NULL;
+	isset($_POST["sg_id"]) ? $sP = $_POST["sg_id"] : $sP = NULL;
+	$sG ? $sg_id = $sG : $sg_id = $sP;
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/servicegroup/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formServiceGroup.php"); break; #Add a Servicegroup
+		case "w" : require_once($path."formServiceGroup.php"); break; #Watch a Servicegroup
+		case "c" : require_once($path."formServiceGroup.php"); break; #Modify a Servicegroup
+		case "s" : enableServiceGroupInDB($sg_id); require_once($path."listServiceGroup.php"); break; #Activate a Servicegroup
+		case "u" : disableServiceGroupInDB($sg_id); require_once($path."listServiceGroup.php"); break; #Desactivate a Servicegroup
+		case "m" : multipleServiceGroupInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listServiceGroup.php"); break; #Duplicate n Service grou
+		case "d" : deleteServiceGroupInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listServiceGroup.php"); break; #Delete n Service group
+		default : require_once($path."listServiceGroup.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/servicegroup_dependency/DB-Func.php b/www/include/configuration/configObject/servicegroup_dependency/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..42b1ca0015a5c89340d63b1dd6a8a4eccaab1924
--- /dev/null
+++ b/www/include/configuration/configObject/servicegroup_dependency/DB-Func.php
@@ -0,0 +1,193 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	
+	function testServiceGroupDependencyExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('dep_id');
+		$res =& $pearDB->query("SELECT dep_name, dep_id FROM dependency WHERE dep_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$dep =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $dep["dep_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $dep["dep_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function testServiceGroupDependencyCycle ($childs = NULL)	{
+		global $pearDB;
+		global $form;
+		$parents = array();
+		$childs = array();
+		if (isset($form))	{
+			$parents = $form->getSubmitValue('dep_sgParents');
+			$childs = $form->getSubmitValue('dep_sgChilds');
+			$childs =& array_flip($childs);
+		}
+		foreach ($parents as $parent)
+			if (array_key_exists($parent, $childs))
+				return false;
+		return true;
+	}
+
+	function deleteServiceGroupDependencyInDB ($dependencies = array())	{
+		global $pearDB;
+		foreach($dependencies as $key=>$value)
+			$pearDB->query("DELETE FROM dependency WHERE dep_id = '".$key."'");
+	}
+	
+	function multipleServiceGroupDependencyInDB ($dependencies = array(), $nbrDup = array())	{
+		foreach($dependencies as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM dependency WHERE dep_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["dep_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "dep_name" ? ($dep_name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testServiceGroupDependencyExistence($dep_name))	{
+					$val ? $rq = "INSERT INTO dependency VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(dep_id) FROM dependency");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(dep_id)"]))	{
+						$res =& $pearDB->query("SELECT DISTINCT servicegroup_sg_id FROM dependency_servicegroupParent_relation WHERE dependency_dep_id = '".$key."'");
+						while($res->fetchInto($sg))
+							$pearDB->query("INSERT INTO dependency_servicegroupParent_relation VALUES ('', '".$maxId["MAX(dep_id)"]."', '".$sg["servicegroup_sg_id"]."')");
+						$res->free();
+						$res =& $pearDB->query("SELECT DISTINCT servicegroup_sg_id FROM dependency_servicegroupChild_relation WHERE dependency_dep_id = '".$key."'");
+						while($res->fetchInto($sg))
+							$pearDB->query("INSERT INTO dependency_servicegroupChild_relation VALUES ('', '".$maxId["MAX(dep_id)"]."', '".$sg["servicegroup_sg_id"]."')");
+						$res->free();
+					}
+				}
+			}
+		}
+	}
+	
+	function updateServiceGroupDependencyInDB ($dep_id = NULL)	{
+		if (!$dep_id) exit();
+		updateServiceGroupDependency($dep_id);
+		updateServiceGroupDependencyServiceGroupParents($dep_id);
+		updateServiceGroupDependencyServiceGroupChilds($dep_id);
+	}	
+	
+	function insertServiceGroupDependencyInDB ($ret = array())	{
+		$dep_id = insertServiceGroupDependency($ret);
+		updateServiceGroupDependencyServiceGroupParents($dep_id, $ret);
+		updateServiceGroupDependencyServiceGroupChilds($dep_id, $ret);
+		return ($dep_id);
+	}
+	
+	function insertServiceGroupDependency($ret = array())	{
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO dependency ";
+		$rq .= "(dep_name, dep_description, inherits_parent, execution_failure_criteria, notification_failure_criteria, dep_comment) ";
+		$rq .= "VALUES (";
+		isset($ret["dep_name"]) && $ret["dep_name"] != NULL ? $rq .= "'".htmlentities($ret["dep_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["dep_description"]) && $ret["dep_description"] != NULL ? $rq .= "'".htmlentities($ret["dep_description"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["inherits_parent"]["inherits_parent"]) && $ret["inherits_parent"]["inherits_parent"] != NULL ? $rq .= "'".$ret["inherits_parent"]["inherits_parent"]."', " : $rq .= "NULL, ";
+		isset($ret["execution_failure_criteria"]) && $ret["execution_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["execution_failure_criteria"]))."', " : $rq .= "NULL, ";
+		isset($ret["notification_failure_criteria"]) && $ret["notification_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["notification_failure_criteria"]))."', " : $rq .= "NULL, ";
+		isset($ret["dep_comment"]) && $ret["dep_comment"] != NULL ? $rq .= "'".htmlentities($ret["dep_comment"], ENT_QUOTES)."' " : $rq .= "NULL ";
+		$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(dep_id) FROM dependency");
+		$dep_id = $res->fetchRow();
+		return ($dep_id["MAX(dep_id)"]);
+	}
+	
+	function updateServiceGroupDependency($dep_id = null)	{
+		if (!$dep_id) exit();
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE dependency SET ";
+		$rq .= "dep_name = ";
+		isset($ret["dep_name"]) && $ret["dep_name"] != NULL ? $rq .= "'".htmlentities($ret["dep_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "dep_description = ";
+		isset($ret["dep_description"]) && $ret["dep_description"] != NULL ? $rq .= "'".htmlentities($ret["dep_description"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		$rq .= "inherits_parent = ";
+		isset($ret["inherits_parent"]["inherits_parent"]) && $ret["inherits_parent"]["inherits_parent"] != NULL ? $rq .= "'".$ret["inherits_parent"]["inherits_parent"]."', " : $rq .= "NULL, ";
+		$rq .= "execution_failure_criteria = ";
+		isset($ret["execution_failure_criteria"]) && $ret["execution_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["execution_failure_criteria"]))."', " : $rq .= "NULL, ";
+		$rq .= "notification_failure_criteria = ";
+		isset($ret["notification_failure_criteria"]) && $ret["notification_failure_criteria"] != NULL ? $rq .= "'".implode(",", array_keys($ret["notification_failure_criteria"]))."', " : $rq .= "NULL, ";
+		$rq .= "dep_comment = ";
+		isset($ret["dep_comment"]) && $ret["dep_comment"] != NULL ? $rq .= "'".htmlentities($ret["dep_comment"], ENT_QUOTES)."' " : $rq .= "NULL ";
+		$rq .= "WHERE dep_id = '".$dep_id."'";
+		$pearDB->query($rq);
+	}
+		
+	function updateServiceGroupDependencyServiceGroupParents($dep_id = null, $ret = array())	{
+		if (!$dep_id) exit();
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM dependency_servicegroupParent_relation ";
+		$rq .= "WHERE dependency_dep_id = '".$dep_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["dep_sgParents"]))
+			$ret = $ret["dep_sgParents"];
+		else
+			$ret = $form->getSubmitValue("dep_sgParents");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO dependency_servicegroupParent_relation ";
+			$rq .= "(dependency_dep_id, servicegroup_sg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$dep_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+		
+	function updateServiceGroupDependencyServiceGroupChilds($dep_id = null, $ret = array())	{
+		if (!$dep_id) exit();
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM dependency_servicegroupChild_relation ";
+		$rq .= "WHERE dependency_dep_id = '".$dep_id."'";
+		$pearDB->query($rq);
+		if (isset($ret["dep_sgChilds"]))
+			$ret = $ret["dep_sgChilds"];
+		else
+			$ret = $form->getSubmitValue("dep_sgChilds");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO dependency_servicegroupChild_relation ";
+			$rq .= "(dependency_dep_id, servicegroup_sg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$dep_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/servicegroup_dependency/formServiceGroupDependency.ihtml b/www/include/configuration/configObject/servicegroup_dependency/formServiceGroupDependency.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..ce2bc78d4cf50e717ab91ce5216b3e74f0088fa2
--- /dev/null
+++ b/www/include/configuration/configObject/servicegroup_dependency/formServiceGroupDependency.ihtml
@@ -0,0 +1,28 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/branch_element.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/gauge.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.dep_name.label}</td><td class="FormRowValue">{$form.dep_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.dep_description.label}</td><td class="FormRowValue">{$form.dep_description.html}</td></tr>
+		{if $nagios == 2}
+			<tr class="list_one"><td class="FormRowField">{$form.inherits_parent.label}</td><td class="FormRowValue">{$form.inherits_parent.html}</td></tr>
+		{/if}	
+		<tr class="list_one"><td class="FormRowField">{$form.execution_failure_criteria.label}</td><td class="FormRowValue">{$form.execution_failure_criteria.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.notification_failure_criteria.label}</td><td class="FormRowValue">{$form.notification_failure_criteria.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.dep_sgParents.label}</td><td class="FormRowValue">{$form.dep_sgParents.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.dep_sgChilds.label}</td><td class="FormRowValue">{$form.dep_sgChilds.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.dep_comment.label}</td><td class="FormRowValue">{$form.dep_comment.html}</td></tr>
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+{$form.hidden}
+</form>
+
diff --git a/www/include/configuration/configObject/servicegroup_dependency/formServiceGroupDependency.php b/www/include/configuration/configObject/servicegroup_dependency/formServiceGroupDependency.php
new file mode 100644
index 0000000000000000000000000000000000000000..23af5630151120cdc96627a870551478eb5635dc
--- /dev/null
+++ b/www/include/configuration/configObject/servicegroup_dependency/formServiceGroupDependency.php
@@ -0,0 +1,203 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Dependency
+	#
+	$dep = array();
+	if (($o == "c" || $o == "w") && $dep_id)	{
+		$res =& $pearDB->query("SELECT * FROM dependency WHERE dep_id = '".$dep_id."' LIMIT 1");
+		# Set base value
+		$dep = array_map("myDecode", $res->fetchRow());
+		# Set Notification Failure Criteria
+		$dep["notification_failure_criteria"] =& explode(',', $dep["notification_failure_criteria"]);
+		foreach ($dep["notification_failure_criteria"] as $key => $value)
+			$dep["notification_failure_criteria"][trim($value)] = 1;
+		# Set Execution Failure Criteria
+		$dep["execution_failure_criteria"] =& explode(',', $dep["execution_failure_criteria"]);
+		foreach ($dep["execution_failure_criteria"] as $key => $value)
+			$dep["execution_failure_criteria"][trim($value)] = 1;
+		# Set ServiceGroup Parents
+		$res =& $pearDB->query("SELECT DISTINCT servicegroup_sg_id FROM dependency_servicegroupParent_relation WHERE dependency_dep_id = '".$dep_id."'");
+		for($i = 0; $res->fetchInto($sgP); $i++)
+			$dep["dep_sgParents"][$i] = $sgP["servicegroup_sg_id"];
+		$res->free();
+		# Set ServiceGroup Childs
+		$res =& $pearDB->query("SELECT DISTINCT servicegroup_sg_id FROM dependency_servicegroupChild_relation WHERE dependency_dep_id = '".$dep_id."'");
+		for($i = 0; $res->fetchInto($sgC); $i++)
+			$dep["dep_sgChilds"][$i] = $sgC["servicegroup_sg_id"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# ServiceGroup comes from DB -> Store in $sgs Array
+	$sgs = array();
+	$res =& $pearDB->query("SELECT sg_id, sg_name FROM servicegroup WHERE sg_id IN (".$oreon->user->lcaSGStr.") ORDER BY sg_name");
+	while($res->fetchInto($sg))
+		$sgs[$sg["sg_id"]] = $sg["sg_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsText2 	= array("size"=>"10");
+	$attrsAdvSelect = array("style" => "width: 250px; height: 150px;");
+	$attrsTextarea 	= array("rows"=>"3", "cols"=>"30");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["dep_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["dep_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["dep_view"]);
+
+	#
+	## Dependency basic information
+	#
+	$form->addElement('header', 'information', $lang['dep_infos']);
+	$form->addElement('text', 'dep_name', $lang["dep_name"], $attrsText);
+	$form->addElement('text', 'dep_description', $lang["dep_description"], $attrsText);
+	if ($oreon->user->get_version() == 2)	{
+		$tab = array();
+		$tab[] = &HTML_QuickForm::createElement('radio', 'inherits_parent', null, $lang['yes'], '1');
+		$tab[] = &HTML_QuickForm::createElement('radio', 'inherits_parent', null, $lang['no'], '0');
+		$form->addGroup($tab, 'inherits_parent', $lang["dep_inheritsP"], '&nbsp;');
+	}
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'o', '&nbsp;', 'Ok');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'w', '&nbsp;', 'Warning');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unknown');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'c', '&nbsp;', 'Critical');
+	if ($oreon->user->get_version() == 2)
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'p', '&nbsp;', 'Pending');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'n', '&nbsp;', 'None');
+	$form->addGroup($tab, 'notification_failure_criteria', $lang["dep_notifFC"], '&nbsp;&nbsp;');
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'o', '&nbsp;', 'Ok');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'w', '&nbsp;', 'Warning');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'u', '&nbsp;', 'Unknown');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'c', '&nbsp;', 'Critical');
+	if ($oreon->user->get_version() == 2)
+		$tab[] = &HTML_QuickForm::createElement('checkbox', 'p', '&nbsp;', 'Pending');
+	$tab[] = &HTML_QuickForm::createElement('checkbox', 'n', '&nbsp;', 'None');
+	$form->addGroup($tab, 'execution_failure_criteria', $lang["dep_exeFC"], '&nbsp;&nbsp;');
+
+	$ams1 =& $form->addElement('advmultiselect', 'dep_sgParents', $lang['dep_sgPar'], $sgs, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+    $ams1 =& $form->addElement('advmultiselect', 'dep_sgChilds', $lang['dep_sgChi'], $sgs, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+	$form->addElement('textarea', 'dep_comment', $lang["dep_comment"], $attrsTextarea);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+
+	$form->addElement('hidden', 'dep_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('dep_name', $lang['ErrName'], 'required');
+	$form->addRule('dep_description', $lang['ErrRequired'], 'required');
+	$form->addRule('dep_sgParents', $lang['ErrRequired'], 'required');
+	$form->addRule('dep_shgChilds', $lang['ErrRequired'], 'required');
+	if ($oreon->user->get_version() == 1)
+		$form->addRule('notification_failure_criteria', $lang['ErrRequired'], 'required');
+	$form->registerRule('cycle', 'callback', 'testServiceGroupDependencyCycle');
+	$form->addRule('dep_sgChilds', $lang['ErrCycleDef'], 'cycle');
+	$form->registerRule('exist', 'callback', 'testServiceGroupDependencyExistence');
+	$form->addRule('dep_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Just watch a Dependency information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&dep_id=".$dep_id."'"));
+	    $form->setDefaults($dep);
+		$form->freeze();
+	}
+	# Modify a Dependency information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($dep);
+	}
+	# Add a Dependency information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	$tpl->assign("nagios", $oreon->user->get_version());
+
+	$valid = false;
+	if ($form->validate())	{
+		$depObj =& $form->getElement('dep_id');
+		if ($form->getSubmitValue("submitA"))
+			$depObj->setValue(insertServiceGroupDependencyInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateServiceGroupDependencyInDB($depObj->getValue("dep_id"));
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&dep_id=".$depObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once("listServiceGroupDependency.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->display("formServiceGroupDependency.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/servicegroup_dependency/listServiceGroupDependency.ihtml b/www/include/configuration/configObject/servicegroup_dependency/listServiceGroupDependency.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..bb58fb747e5b99b2258856c39b4dcd8356f0493d
--- /dev/null
+++ b/www/include/configuration/configObject/servicegroup_dependency/listServiceGroupDependency.ihtml
@@ -0,0 +1,39 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_description}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_description}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter"></td>
+			<td class="ListColFooterRight" align="right" colpan="2"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
\ No newline at end of file
diff --git a/www/include/configuration/configObject/servicegroup_dependency/listServiceGroupDependency.php b/www/include/configuration/configObject/servicegroup_dependency/listServiceGroupDependency.php
new file mode 100644
index 0000000000000000000000000000000000000000..7640f19e28644cf979b52249460a5b3a4e8d3e4e
--- /dev/null
+++ b/www/include/configuration/configObject/servicegroup_dependency/listServiceGroupDependency.php
@@ -0,0 +1,96 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	isset($_GET["list"]) ? $list = $_GET["list"] : $list = NULL;
+	$rq = "SELECT COUNT(*) FROM dependency dep";
+	$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM dependency_servicegroupParent_relation dsgpr WHERE dsgpr.dependency_dep_id = dep.dep_id AND dsgpr.servicegroup_sg_id IN (".$oreon->user->lcaSGStr.")) > 0 AND (SELECT DISTINCT COUNT(*) FROM dependency_servicegroupChild_relation dsgpr WHERE dsgpr.dependency_dep_id = dep.dep_id AND dsgpr.servicegroup_sg_id IN (".$oreon->user->lcaSGStr.")) > 0";
+	if ($search)
+		$rq .= " AND dep_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'";
+	$res = & $pearDB->query($rq);
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+	
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_description", $lang['description']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Dependcy list
+	$rq = "SELECT dep_id, dep_name, dep_description FROM dependency dep";
+	$rq .= " WHERE (SELECT DISTINCT COUNT(*) FROM dependency_servicegroupParent_relation dsgpr WHERE dsgpr.dependency_dep_id = dep.dep_id AND dsgpr.servicegroup_sg_id IN (".$oreon->user->lcaSGStr.")) > 0 AND (SELECT DISTINCT COUNT(*) FROM dependency_servicegroupChild_relation dsgpr WHERE dsgpr.dependency_dep_id = dep.dep_id AND dsgpr.servicegroup_sg_id IN (".$oreon->user->lcaSGStr.")) > 0";
+	if ($search)
+		$rq .= " AND dep_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'";
+	$rq .= " LIMIT ".$num * $limit.", ".$limit;
+	$res =& $pearDB->query($rq);
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($dep); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$dep['dep_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&dep_id=".$dep['dep_id']."&o=w&search=".$search."&list=".$list."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&dep_id=".$dep['dep_id']."&o=c&search=".$search."&list=".$list."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&dep_id=".$dep['dep_id']."&o=d&select[".$dep['dep_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."&list=".$list."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$dep['dep_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$dep["dep_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&dep_id=".$dep['dep_id'],
+						"RowMenu_description"=>$dep["dep_description"],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listServiceGroupDependency.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/servicegroup_dependency/serviceGroupDependency.php b/www/include/configuration/configObject/servicegroup_dependency/serviceGroupDependency.php
new file mode 100644
index 0000000000000000000000000000000000000000..550dbd738017e5937ac2a98e791656e682a6a61a
--- /dev/null
+++ b/www/include/configuration/configObject/servicegroup_dependency/serviceGroupDependency.php
@@ -0,0 +1,47 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["dep_id"]) ? $cG = $_GET["dep_id"] : $cG = NULL;
+	isset($_POST["dep_id"]) ? $cP = $_POST["dep_id"] : $cP = NULL;
+	$cG ? $dep_id = $cG : $dep_id = $cP;
+	
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/servicegroup_dependency/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formServiceGroupDependency.php"); break; #Add a Dependency
+		case "w" : require_once($path."formServiceGroupDependency.php"); break; #Watch a Dependency
+		case "c" : require_once($path."formServiceGroupDependency.php"); break; #Modify a Dependency
+		case "m" : multipleServiceGroupDependencyInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listServiceGroupDependency.php"); break; #Duplicate n Dependencys
+		case "d" : deleteServiceGroupDependencyInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listServiceGroupDependency.php"); break; #Delete n Dependency
+		default : require_once($path."listServiceGroupDependency.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/timeperiod/DB-Func.php b/www/include/configuration/configObject/timeperiod/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..14359a41d487ea494137ce1960aa2cd37c8aaf6b
--- /dev/null
+++ b/www/include/configuration/configObject/timeperiod/DB-Func.php
@@ -0,0 +1,119 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset ($oreon))
+		exit ();
+
+	function testTPExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('tp_id');
+		$res =& $pearDB->query("SELECT tp_name, tp_id FROM timeperiod WHERE tp_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$tp =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $tp["tp_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $tp["tp_id"] != $id)	
+			return false;
+		else
+			return true;
+	}
+
+	function deleteTimeperiodInDB ($timeperiods = array())	{
+		global $pearDB;
+		foreach($timeperiods as $key=>$value)
+			$pearDB->query("DELETE FROM timeperiod WHERE tp_id = '".$key."'");
+	}
+	
+	function multipleTimeperiodInDB ($timeperiods = array(), $nbrDup = array())	{
+		foreach($timeperiods as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM timeperiod WHERE tp_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["tp_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "tp_name" ? ($tp_name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testTPExistence($tp_name))
+					$pearDB->query($val ? $rq = "INSERT INTO timeperiod VALUES (".$val.")" : $rq = null);
+			}
+		}
+	}
+	
+	function updateTimeperiodInDB ($tp_id = NULL)	{
+		if (!$tp_id) return;
+		updateTimeperiod($tp_id);
+	}
+	
+	function updateTimeperiod($tp_id)	{
+		if (!$tp_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE timeperiod ";
+		$rq .= "SET tp_name = '".htmlentities($ret["tp_name"], ENT_QUOTES)."', " .
+				"tp_alias = '".htmlentities($ret["tp_alias"], ENT_QUOTES)."', " .
+				"tp_sunday = '".htmlentities($ret["tp_sunday"], ENT_QUOTES)."', " .
+				"tp_monday = '".htmlentities($ret["tp_monday"], ENT_QUOTES)."', " .
+				"tp_tuesday = '".htmlentities($ret["tp_tuesday"], ENT_QUOTES)."', " .
+				"tp_wednesday = '".htmlentities($ret["tp_wednesday"], ENT_QUOTES)."', " .
+				"tp_thursday = '".htmlentities($ret["tp_thursday"], ENT_QUOTES)."', " .
+				"tp_friday = '".htmlentities($ret["tp_friday"], ENT_QUOTES)."', " .
+				"tp_saturday = '".htmlentities($ret["tp_saturday"], ENT_QUOTES)."' " .
+				"WHERE tp_id = '".$tp_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function insertTimeperiodInDB ($ret = array())	{
+		$tp_id = insertTimeperiod($ret);
+		return ($tp_id);
+	}
+	
+	function insertTimeperiod($ret = array())	{
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO timeperiod ";
+		$rq .= "(tp_name, tp_alias, tp_sunday, tp_monday, tp_tuesday, tp_wednesday, tp_thursday, tp_friday, tp_saturday) ";
+		$rq .= "VALUES (";
+		isset($ret["tp_name"]) && $ret["tp_name"] != NULL ? $rq .= "'".htmlentities($ret["tp_name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["tp_alias"]) && $ret["tp_alias"] != NULL ? $rq .= "'".htmlentities($ret["tp_alias"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["tp_sunday"]) && $ret["tp_sunday"] != NULL ? $rq .= "'".htmlentities($ret["tp_sunday"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["tp_monday"]) && $ret["tp_monday"] != NULL ? $rq .= "'".htmlentities($ret["tp_monday"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["tp_tuesday"]) && $ret["tp_tuesday"] != NULL ? $rq .= "'".htmlentities($ret["tp_tuesday"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["tp_wednesday"]) && $ret["tp_wednesday"] != NULL ? $rq .= "'".htmlentities($ret["tp_wednesday"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["tp_thursday"]) && $ret["tp_thursday"] != NULL ? $rq .= "'".htmlentities($ret["tp_thursday"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["tp_friday"]) && $ret["tp_friday"] != NULL ? $rq .= "'".htmlentities($ret["tp_friday"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["tp_saturday"]) && $ret["tp_saturday"] != NULL ? $rq .= "'".htmlentities($ret["tp_saturday"], ENT_QUOTES)."'": $rq .= "NULL";
+		$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(tp_id) FROM timeperiod");
+		$tp_id = $res->fetchRow();
+		return ($tp_id["MAX(tp_id)"]);
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/timeperiod/formTimeperiod.ihtml b/www/include/configuration/configObject/timeperiod/formTimeperiod.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..02f3cff37c4aaf3ed31901d60c15820cb8e4264a
--- /dev/null
+++ b/www/include/configuration/configObject/timeperiod/formTimeperiod.ihtml
@@ -0,0 +1,32 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/calendar.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.tp_name.label}</td><td class="FormRowValue">{$form.tp_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.tp_alias.label}</td><td class="FormRowValue">{$form.tp_alias.html}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/date-time_preferences.gif'>&nbsp;&nbsp;{$form.header.notification}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.tp_sunday.label}</td><td class="FormRowValue">{$form.tp_sunday.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.tp_monday.label}</td><td class="FormRowValue">{$form.tp_monday.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.tp_tuesday.label}</td><td class="FormRowValue">{$form.tp_tuesday.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.tp_wednesday.label}</td><td class="FormRowValue">{$form.tp_wednesday.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.tp_thursday.label}</td><td class="FormRowValue">{$form.tp_thursday.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.tp_friday.label}</td><td class="FormRowValue">{$form.tp_friday.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.tp_saturday.label}</td><td class="FormRowValue">{$form.tp_saturday.html}</td></tr>
+		
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
diff --git a/www/include/configuration/configObject/timeperiod/formTimeperiod.php b/www/include/configuration/configObject/timeperiod/formTimeperiod.php
new file mode 100644
index 0000000000000000000000000000000000000000..bb3d4c9e6266d69b5d11c9ee44e40e37cd8b6ee8
--- /dev/null
+++ b/www/include/configuration/configObject/timeperiod/formTimeperiod.php
@@ -0,0 +1,154 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Time Period
+	#
+	$tp = array();
+	if (($o == "c" || $o == "w") && $tp_id)	{	
+		$res =& $pearDB->query("SELECT * FROM timeperiod WHERE tp_id = '".$tp_id."' LIMIT 1");
+		# Set base value
+		$tp = array_map("myDecode", $res->fetchRow());
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"35");
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["tp_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["tp_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["tp_view"]);
+
+	#
+	## Time Period basic information
+	#
+	$form->addElement('header', 'information', $lang['tp_infos']);
+	$form->addElement('text', 'tp_name', $lang["tp_name"], $attrsText);
+	$form->addElement('text', 'tp_alias', $lang["tp_alias"], $attrsText);
+	
+	##
+	## Notification informations
+	##
+	$form->addElement('header', 'notification', $lang['tp_notif']);
+	
+	$form->addElement('text', 'tp_sunday', $lang["tp_sunday"], $attrsText);
+	$form->addElement('text', 'tp_monday', $lang["tp_monday"], $attrsText);
+	$form->addElement('text', 'tp_tuesday', $lang["tp_tuesday"], $attrsText);
+	$form->addElement('text', 'tp_wednesday', $lang["tp_wednesday"], $attrsText);
+	$form->addElement('text', 'tp_thursday', $lang["tp_thursday"], $attrsText);
+	$form->addElement('text', 'tp_friday', $lang["tp_friday"], $attrsText);
+	$form->addElement('text', 'tp_saturday', $lang["tp_saturday"], $attrsText);
+	
+	#
+	## Further informations
+	#
+	
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');	
+	$form->setDefaults(array('action' => '1'));
+	
+	$form->addElement('hidden', 'tp_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	function myReplace()	{
+		global $form;
+		$ret = $form->getSubmitValues();
+		return (str_replace(" ", "_", $ret["tp_name"]));
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('tp_name', 'myReplace');
+	$form->addRule('tp_name', $lang['ErrName'], 'required');
+	$form->addRule('tp_alias', $lang['ErrAlias'], 'required');
+	$form->registerRule('exist', 'callback', 'testTPExistence');
+	$form->addRule('tp_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	# Just watch a Time Period information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&tp_id=".$tp_id."'"));
+	    $form->setDefaults($tp);
+		$form->freeze();
+	}
+	# Modify a Time Period information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($tp);
+	}
+	# Add a Time Period information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	
+	$valid = false;
+	if ($form->validate())	{
+		$tpObj =& $form->getElement('tp_id');
+		if ($form->getSubmitValue("submitA"))
+			$tpObj->setValue(insertTimeperiodInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateTimeperiodInDB($tpObj->getValue());
+		$o = "w";		
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&tp_id=".$tpObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listTimeperiod.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("formTimeperiod.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/timeperiod/listTimeperiod.ihtml b/www/include/configuration/configObject/timeperiod/listTimeperiod.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..0d10cbea2a9d7ef06a67dbb2cc0f6c75e1106d9b
--- /dev/null
+++ b/www/include/configuration/configObject/timeperiod/listTimeperiod.ihtml
@@ -0,0 +1,44 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight" align="right">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">				
+			</td>
+			<td class="ListColFooterCenter" colspan="2"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+
+{php}
+   include('./include/common/pagination.php');
+{/php}
+
+{$form.hidden}
+</form>
diff --git a/www/include/configuration/configObject/timeperiod/listTimeperiod.php b/www/include/configuration/configObject/timeperiod/listTimeperiod.php
new file mode 100644
index 0000000000000000000000000000000000000000..45a8cbc8d38ee2244f175563d2a9819e43f5e859
--- /dev/null
+++ b/www/include/configuration/configObject/timeperiod/listTimeperiod.php
@@ -0,0 +1,95 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM timeperiod WHERE tp_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM timeperiod");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	# Timeperiod list
+	if ($search)
+		$rq = "SELECT tp_id, tp_name, tp_alias FROM timeperiod WHERE tp_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' ORDER BY tp_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT tp_id, tp_name, tp_alias FROM timeperiod ORDER BY tp_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();	for ($i = 0; $res->fetchInto($timeperiod); $i++) {
+		$selectedElements =& $form->addElement('checkbox', "select[".$timeperiod['tp_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&tp_id=".$timeperiod['tp_id']."&o=w&&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&tp_id=".$timeperiod['tp_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&tp_id=".$timeperiod['tp_id']."&o=d&select[".$timeperiod['tp_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$timeperiod['tp_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$timeperiod["tp_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&tp_id=".$timeperiod['tp_id'],
+						"RowMenu_desc"=>$timeperiod["tp_alias"],
+						"RowMenu_status"=>$lang['enable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listTimeperiod.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/timeperiod/timeperiod.php b/www/include/configuration/configObject/timeperiod/timeperiod.php
new file mode 100644
index 0000000000000000000000000000000000000000..d4b2affc142a5429720a452408f03052bd610a20
--- /dev/null
+++ b/www/include/configuration/configObject/timeperiod/timeperiod.php
@@ -0,0 +1,46 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["tp_id"]) ? $tpG = $_GET["tp_id"] : $tpG = NULL;
+	isset($_POST["tp_id"]) ? $tpP = $_POST["tp_id"] : $tpP = NULL;
+	$tpG ? $tp_id = $tpG : $tp_id = $tpP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/timeperiod/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+
+	switch ($o)	{
+		case "a" : require_once($path."formTimeperiod.php"); break; #Add a Timeperiod
+		case "w" : require_once($path."formTimeperiod.php"); break; #Watch a Timeperiod
+		case "c" : require_once($path."formTimeperiod.php"); break; #Modify a Timeperiod
+		case "m" : multipleTimeperiodInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listTimeperiod.php"); break; #Duplicate n Timeperiods
+		case "d" : deleteTimeperiodInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listTimeperiod.php"); break; #Delete n Timeperiods
+		default : require_once($path."listTimeperiod.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/traps/DB-Func.php b/www/include/configuration/configObject/traps/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..671485c91e522ee62da05effbc06b7b1e076809a
--- /dev/null
+++ b/www/include/configuration/configObject/traps/DB-Func.php
@@ -0,0 +1,109 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Traps unit developped by Nicolas Cordier for Merethis company. <ncordier@merethis.com>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function testTrapExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('traps_id');
+		$res =& $pearDB->query("SELECT traps_name, traps_id FROM traps WHERE traps_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$trap =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $trap["traps_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $trap["traps_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+
+	function deleteTrapInDB ($traps = array())	{
+		global $pearDB;
+		foreach($traps as $key=>$value)
+			$pearDB->query("DELETE FROM traps WHERE traps_id = '".$key."'");
+	}
+	
+	function multipleTrapInDB ($traps = array(), $nbrDup = array())	{
+		foreach($traps as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM traps WHERE traps_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["traps_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "traps_name" ? ($traps_name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testTrapExistence($traps_name))	{
+					$val ? $rq = "INSERT INTO traps VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+				}
+			}
+		}
+	}
+	
+	function updateTrapInDB ($traps_id = NULL)	{
+		if (!$traps_id) return;
+		updateTrap($traps_id);
+	}
+	
+	function updateTrap($traps_id = null)	{
+		if (!$traps_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE traps ";
+		$rq .= "SET traps_name = '".htmlentities($ret["traps_name"], ENT_QUOTES)."', ";
+		$rq .= "traps_oid = '".htmlentities($ret["traps_oid"], ENT_QUOTES)."', ";
+		$rq .= "traps_handler = '".htmlentities($ret["traps_handler"], ENT_QUOTES)."', ";
+		$rq .= "traps_args = '".htmlentities($ret["traps_args"], ENT_QUOTES)."', ";
+		$rq .= "traps_comments = '".htmlentities($ret["traps_comments"], ENT_QUOTES)."' ";
+		$rq .= "WHERE traps_id = '".$traps_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function insertTrapInDB ($ret = array())	{
+		$traps_id = insertTrap($ret);
+		return ($traps_id);
+	}
+	
+	function insertTrap($ret = array())	{
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO traps ";
+		$rq .= "(traps_name, traps_oid, traps_handler, traps_args, traps_comments) ";
+		$rq .= "VALUES ";
+		$rq .= "('".htmlentities($ret["traps_name"], ENT_QUOTES)."',";
+		$rq .= "'".htmlentities($ret["traps_oid"], ENT_QUOTES)."', ";
+		$rq .= "'".htmlentities($ret["traps_handler"], ENT_QUOTES)."', ";
+		$rq .= "'".htmlentities($ret["traps_args"], ENT_QUOTES)."', ";
+		$rq .= "'".htmlentities($ret["traps_comments"], ENT_QUOTES)."')";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(traps_id) FROM traps");
+		$traps_id = $res->fetchRow();
+		return ($traps_id["MAX(traps_id)"]);
+	}
+?>
diff --git a/www/include/configuration/configObject/traps/formTraps.ihtml b/www/include/configuration/configObject/traps/formTraps.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..000cba1a9eceddc3fd6694814f62fe5f57ab01fd
--- /dev/null
+++ b/www/include/configuration/configObject/traps/formTraps.ihtml
@@ -0,0 +1,23 @@
+{$form.javascript}
+{$insertValueQuery}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/exchange.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+
+		<tr class="list_one"><td class="FormRowField">{$form.traps_name.label}</td><td class="FormRowValue">{$form.traps_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.traps_oid.label}</td><td class="FormRowValue">{$form.traps_oid.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.traps_handler.label}</td><td class="FormRowValue">{$form.traps_handler.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.traps_args.label}</td><td class="FormRowValue">{$form.traps_args.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.traps_comments.label}</td><td class="FormRowValue">{$form.traps_comments.html}</td></tr>
+
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
diff --git a/www/include/configuration/configObject/traps/formTraps.php b/www/include/configuration/configObject/traps/formTraps.php
new file mode 100644
index 0000000000000000000000000000000000000000..7a87d89c2d523cda87fd33013a6ca6b9451e54a5
--- /dev/null
+++ b/www/include/configuration/configObject/traps/formTraps.php
@@ -0,0 +1,148 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Traps unit developped by Nicolas Cordier for Merethis company. <ncordier@merethis.com>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Command
+	#
+	
+	function myDecodeTrap($arg)	{
+		$arg = html_entity_decode($arg, ENT_QUOTES);
+		return($arg);
+	}
+
+	$trap = array();
+	if (($o == "c" || $o == "w") && $traps_id)	{
+		
+		$res =& $pearDB->query("SELECT * FROM traps WHERE traps_id = '".$traps_id."' LIMIT 1");
+		# Set base value
+		$trap = array_map("myDecodeTrap", $res->fetchRow());
+	}
+
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"50");
+	$attrsTextarea 	= array("rows"=>"9", "cols"=>"80");
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["m_traps_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["m_traps_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["m_traps_view"]);
+
+	#
+	## Command information
+	#
+
+	$form->addElement('text', 'traps_name', $lang["m_traps_name"], $attrsText);
+	$form->addElement('text', 'traps_oid', $lang["m_traps_oid"], $attrsText);
+	$form->addElement('text', 'traps_handler', $lang["m_traps_handler"], $attrsText);
+	$form->addElement('text', 'traps_args', $lang["m_traps_args"], $attrsText);
+	$form->addElement('textarea', 'traps_comments', $lang["m_traps_comments"], $attrsTextarea);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+        $form->setDefaults(array('action'=>'1'));
+
+
+	#
+	## Further informations
+	#
+	$form->addElement('hidden', 'traps_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	function myReplace()	{
+		global $form;
+		return (str_replace(" ", "_", $form->getSubmitValue("traps_name")));
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('traps_name', 'myReplace');
+	$form->addRule('traps_name', $lang['ErrName'], 'required');
+	$form->addRule('traps_oid', $lang['ErrName'], 'required');
+	$form->addRule('traps_handler', $lang['ErrName'], 'required');
+	$form->addRule('traps_args', $lang['ErrName'], 'required');
+	$form->registerRule('exist', 'callback', 'testTrapExistence');
+	$form->addRule('traps_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Just watch a Command information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&traps_id=".$traps_id."'"));
+	    $form->setDefaults($trap);
+		$form->freeze();
+	}
+	# Modify a Command information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($trap);
+	}
+	# Add a Command information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+
+	$valid = false;
+	if ($form->validate())	{
+		$trapObj =& $form->getElement('traps_id');
+		if ($form->getSubmitValue("submitA")) 
+			$trapObj->setValue(insertTrapInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateTrapInDB($trapObj->getValue());
+		$o = "w";
+		//$trapObj =& $form->getElement('traps_id');
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&traps_id=".$trapObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action =& $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listTraps.php");
+	else	{
+		##Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->display("formTraps.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configObject/traps/listTraps.ihtml b/www/include/configuration/configObject/traps/listTraps.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..fbffc9d94b71bf3e4705fecb65f616d75816a41e
--- /dev/null
+++ b/www/include/configuration/configObject/traps/listTraps.ihtml
@@ -0,0 +1,44 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_handler}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_args}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_handler}</td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_args}</td>
+			<td class="ListColRight" align="right">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">				
+			</td>
+			<td class="ListColFooterCenter" colspan="3"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+	{php}
+	   include('./include/common/pagination.php');
+	{/php}
+	{$form.hidden}
+</form>
diff --git a/www/include/configuration/configObject/traps/listTraps.php b/www/include/configuration/configObject/traps/listTraps.php
new file mode 100644
index 0000000000000000000000000000000000000000..b17101d8c98e1af1074e9b07a72d9f5d1b40b07d
--- /dev/null
+++ b/www/include/configuration/configObject/traps/listTraps.php
@@ -0,0 +1,98 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Traps unit developped by Nicolas Cordier for Merethis company. <ncordier@merethis.com>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM traps WHERE traps_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM traps");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['m_traps_oid']);
+	$tpl->assign("headerMenu_handler", $lang['m_traps_handler']);
+	$tpl->assign("headerMenu_args", $lang['m_traps_args']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+
+	#List of elements - Depends on different criteria
+	if ($search)
+		$rq = "SELECT * FROM traps WHERE traps_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' ORDER BY traps_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT * FROM traps ORDER BY traps_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($trap); $i++) {
+		$selectedElements =& $form->addElement('checkbox', "select[".$trap['traps_id']."]");
+		$moptions = "<a href='oreon.php?p=".$p."&traps_id=".$trap['traps_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&traps_id=".$trap['traps_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&traps_id=".$trap['traps_id']."&o=d&select[".$trap['traps_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$trap['traps_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$trap["traps_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&traps_id=".$trap['traps_id'],
+						"RowMenu_desc"=>substr($trap["traps_oid"], 0, 40),
+						"RowMenu_args"=>$trap["traps_args"],
+						"RowMenu_handler"=>$trap["traps_handler"],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";
+	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listTraps.ihtml");
+	
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+?>
diff --git a/www/include/configuration/configObject/traps/traps.php b/www/include/configuration/configObject/traps/traps.php
new file mode 100644
index 0000000000000000000000000000000000000000..163722bfc23d9dc0b29373db1c979580d81be357
--- /dev/null
+++ b/www/include/configuration/configObject/traps/traps.php
@@ -0,0 +1,46 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Traps unit developped by Nicolas Cordier for Merethis company. <ncordier@merethis.com>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+
+	isset($_GET["traps_id"]) ? $trapG = $_GET["traps_id"] : $trapG = NULL;
+	isset($_POST["traps_id"]) ? $trapP = $_POST["traps_id"] : $trapP = NULL;
+	$trapG ? $traps_id = $trapG : $traps_id = $trapP;
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+
+	#Path to the configuration dir
+	$path = "./include/configuration/configObject/traps/";
+
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+
+	switch ($o)	{
+		case "a" : require_once($path."formTraps.php"); break; #Add a Trap
+		case "w" : require_once($path."formTraps.php"); break; #Watch a Trap
+		case "c" : require_once($path."formTraps.php"); break; #Modify a Trap
+		case "m" : multipleTrapInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listTraps.php"); break; #Duplicate n Traps
+		case "d" : deleteTrapInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listTraps.php"); break; #Delete n Traps
+		default : require_once($path."listTraps.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configPerfparse/DB-Func.php b/www/include/configuration/configPerfparse/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..1c624cc8b0443974783d5f58b58ccbbb877dd59c
--- /dev/null
+++ b/www/include/configuration/configPerfparse/DB-Func.php
@@ -0,0 +1,201 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	function testExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('perfparse_id');
+		$res =& $pearDB->query("SELECT perfparse_name, perfparse_id FROM cfg_perfparse WHERE perfparse_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$perfparse =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $perfparse["perfparse_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $perfparse["perfparse_id"] != $id)
+			return false;
+		else
+			return true;
+	}	
+	
+	function enablePerfparseInDB ($perfparse_id = null)	{
+		if (!$perfparse_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE cfg_perfparse SET perfparse_activate = '0'");
+		$pearDB->query("UPDATE cfg_perfparse SET perfparse_activate = '1' WHERE perfparse_id = '".$perfparse_id."'");
+	}
+	
+	function disablePerfparseInDB ($perfparse_id = null)	{
+		if (!$perfparse_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE cfg_perfparse SET perfparse_activate = '0' WHERE perfparse_id = '".$perfparse_id."'");
+		$res =& $pearDB->query("SELECT MAX(perfparse_id) FROM cfg_perfparse WHERE perfparse_id != '".$perfparse_id."'");
+		$maxId =& $res->fetchRow();
+		if (isset($maxId["MAX(perfparse_id)"]))
+			$pearDB->query("UPDATE cfg_perfparse SET perfparse_activate = '1' WHERE perfparse_id = '".$maxId["MAX(perfparse_id)"]."'");
+	}
+	
+	function deletePerfparseInDB ($perfparse = array())	{
+		global $pearDB;
+		foreach($perfparse as $key=>$value)
+			$pearDB->query("DELETE FROM cfg_perfparse WHERE perfparse_id = '".$key."'");
+		$res =& $pearDB->query("SELECT perfparse_id FROM cfg_perfparse WHERE perfparse_activate = '1'");		  
+		if (!$res->numRows())	{
+			$res =& $pearDB->query("SELECT MAX(perfparse_id) FROM cfg_perfparse");
+			$perfparse_id = $res->fetchRow();
+			$pearDB->query("UPDATE cfg_perfparse SET perfparse_activate = '1' WHERE perfparse_id = '".$perfparse_id["MAX(perfparse_id)"]."'");
+		}
+	}
+	
+	function multiplePerfparseInDB ($perfparse = array(), $nbrDup = array())	{
+		foreach($perfparse as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM cfg_perfparse WHERE perfparse_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["perfparse_id"] = '';
+			$row["perfparse_activate"] = '0';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "perfparse_name" ? ($perfparse_name = clone($value2 = $value2."_".$i)) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testExistence($perfparse_name))	{
+					$val ? $rq = "INSERT INTO cfg_perfparse VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+				}
+			}
+		}
+	}
+	
+	function updatePerfparseInDB ($perfparse_id = NULL)	{
+		if (!$perfparse_id) return;
+		updatePerfparse($perfparse_id);
+	}	
+	
+	function insertPerfparseInDB ()	{
+		$perfparse_id = insertPerfparse();
+		return ($perfparse_id);
+	}
+	
+	function insertPerfparse()	{
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO `cfg_perfparse` ( `perfparse_id` , `perfparse_name` , `Server_Port` , `Service_Log` , " .
+				"`Service_Log_Position_Mark_Path` , `Error_Log` , `Error_Log_Rotate` , `Error_Log_Keep_N_Days` , " .
+				"`Drop_File` , `Drop_File_Rotate` , `Drop_File_Keep_N_Days` , `Lock_File` , `Show_Status_Bar` , " .
+				"`Do_Report` , `Default_user_permissions_Policy` , `Default_user_permissions_Host_groups` , " .
+				"`Default_user_permissions_summary` , `Output_Log_File` , `Output_Log_Filename` , `Output_Log_Rotate` , " .
+				"`Output_Log_Keep_N_Days` , `Use_Storage_Socket_Output` , `Storage_Socket_Output_Host_Name` , " .
+				"`Storage_Socket_Output_Port` , `Use_Storage_Mysql` , `No_Raw_Data` , `No_Bin_Data` , `DB_User` , " .
+				"`DB_Pass` , `DB_Name` , `DB_Host` , `Dummy_Hostname` , `Storage_Modules_Load` , `perfparse_comment` , " .
+				"`perfparse_activate` ) VALUES (";
+		$rq .= "NULL, ";
+        isset($ret["perfparse_name"]) && $ret["perfparse_name"] != NULL ? $rq .= "'".htmlentities($ret["perfparse_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+        isset($ret["server_port"]) && $ret["server_port"] != NULL ? $rq .= "'".htmlentities($ret["server_port"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["service_log"]) && $ret["service_log"] != NULL ? $rq .= "'".htmlentities($ret["service_log"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["service_log_position_mark_path"]) && $ret["service_log_position_mark_path"] != NULL ? $rq .= "'".htmlentities($ret["service_log_position_mark_path"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+       	isset($ret["error_log"]) && $ret["error_log"] != NULL ? $rq .= "'".htmlentities($ret["error_log"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["error_log_rotate"]["error_log_rotate"]) && $ret["error_log_rotate"]["error_log_rotate"] != NULL ? $rq .= "'".$ret["error_log_rotate"]["error_log_rotate"]."',  " : $rq .= "NULL, ";
+        isset($ret["error_log_keep_n_days"]) && $ret["error_log_keep_n_days"] != NULL ? $rq .= "'".htmlentities($ret["error_log_keep_n_days"], ENT_QUOTES)."',  "  : $rq .= "NULL, ";
+        isset($ret["drop_file"]) && $ret["drop_file"] != NULL ? $rq .= "'".htmlentities($ret["drop_file"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["drop_file_rotate"]["drop_file_rotate"]) && $ret["drop_file_rotate"]["drop_file_rotate"] != NULL ? $rq .= "'".$ret["drop_file_rotate"]["drop_file_rotate"]."',  " : $rq .= "NULL, ";
+ 	    isset($ret["drop_file_keep_n_days"]) && $ret["drop_file_keep_n_days"] != NULL ? $rq .= "'".htmlentities($ret["drop_file_keep_n_days"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["lock_file"]) && $ret["lock_file"] != NULL ? $rq .= "'".htmlentities($ret["lock_file"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["show_status_bar"]["show_status_bar"]) && $ret["show_status_bar"]["show_status_bar"] != NULL ? $rq .= "'".$ret["show_status_bar"]["show_status_bar"]."',  " : $rq .= "NULL, ";
+        isset($ret["do_report"]["do_report"]) && $ret["do_report"]["do_report"] != NULL ? $rq .= "'".$ret["do_report"]["do_report"]."',  " : $rq .= "NULL, ";
+        isset($ret["default_user_permissions_policy"]["default_user_permissions_policy"]) && $ret["default_user_permissions_policy"]["default_user_permissions_policy"] != NULL ? $rq .= "'".$ret["default_user_permissions_policy"]["default_user_permissions_policy"]."',  " : $rq .= "NULL, ";
+        isset($ret["default_user_permissions_host_groups"]["default_user_permissions_host_groups"]) && $ret["default_user_permissions_host_groups"]["default_user_permissions_host_groups"] != NULL ? $rq .= "'".$ret["default_user_permissions_host_groups"]["default_user_permissions_host_groups"]."',  " : $rq .= "NULL, ";
+        isset($ret["default_user_permissions_summary"]["default_user_permissions_summary"]) && $ret["default_user_permissions_summary"]["default_user_permissions_summary"] != NULL ? $rq .= "'".$ret["default_user_permissions_summary"]["default_user_permissions_summary"]."',  " : $rq .= "NULL, ";
+        isset($ret["output_log_file"]["output_log_file"]) && $ret["output_log_file"]["output_log_file"] != NULL ? $rq .= "'".$ret["output_log_file"]["output_log_file"]."',  " : $rq .= "NULL, ";
+        isset($ret["output_log_filename"]) && $ret["output_log_filename"] != NULL ? $rq .= "'".htmlentities($ret["output_log_filename"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["output_log_rotate"]["output_log_rotate"]) && $ret["output_log_rotate"]["output_log_rotate"] != NULL ? $rq .= "'".$ret["output_log_rotate"]["output_log_rotate"]."',  " : $rq .= "NULL, ";
+        isset($ret["output_log_keep_n_days"]) && $ret["output_log_keep_n_days"] != NULL ? $rq .= "'".htmlentities($ret["output_log_keep_n_days"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["use_storage_socket_output"]["use_storage_socket_output"]) && $ret["use_storage_socket_output"]["use_storage_socket_output"] != NULL ? $rq .= "'".$ret["use_storage_socket_output"]["use_storage_socket_output"]."',  " : $rq .= "NULL, ";
+        isset($ret["storage_socket_output_host_name"]) && $ret["storage_socket_output_host_name"] != NULL ? $rq .= "'".htmlentities($ret["storage_socket_output_host_name"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["storage_socket_output_port"]) && $ret["storage_socket_output_port"] != NULL ? $rq .= "'".htmlentities($ret["storage_socket_output_port"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["use_storage_mysql"]["use_storage_mysql"]) && $ret["use_storage_mysql"]["use_storage_mysql"] != NULL ? $rq .= "'".$ret["use_storage_mysql"]["use_storage_mysql"]."',  " : $rq .= "NULL, ";
+        isset($ret["no_raw_data"]["no_raw_data"]) && $ret["no_raw_data"]["no_raw_data"] != NULL ? $rq .= "'".$ret["no_raw_data"]["no_raw_data"]."',  " : $rq .= "NULL, ";
+        isset($ret["no_bin_data"]["no_bin_data"]) && $ret["no_bin_data"]["no_bin_data"] != NULL ? $rq .= "'".$ret["no_bin_data"]["no_bin_data"]."',  " : $rq .= "NULL, ";
+        isset($ret["db_user"]) && $ret["db_user"] != NULL ? $rq .= "'".htmlentities($ret["db_user"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["db_pass"]) && $ret["db_pass"] != NULL ? $rq .= "'".htmlentities($ret["db_pass"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["db_name"]) && $ret["db_name"] != NULL ? $rq .= "'".htmlentities($ret["db_name"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["db_host"]) && $ret["db_host"] != NULL ? $rq .= "'".htmlentities($ret["db_host"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["dummy_hostname"]) && $ret["dummy_hostname"] != NULL ? $rq .= "'".htmlentities($ret["dummy_hostname"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["storage_modules_load"]) && $ret["storage_modules_load"] != NULL ? $rq .= "'".htmlentities($ret["storage_modules_load"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+        isset($ret["perfparse_comment"]) && $ret["perfparse_comment"] != NULL ? $rq .= "'".htmlentities($ret["perfparse_comment"], ENT_QUOTES)."',  " : $rq .= "NULL, ";
+		$rq .= "'".$ret["perfparse_activate"]["perfparse_activate"]."')";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(perfparse_id) FROM cfg_perfparse");
+		$perfparse_id = $res->fetchRow();
+		if ($ret["perfparse_activate"]["perfparse_activate"])
+			$pearDB->query("UPDATE cfg_perfparse SET perfparse_activate = '0' WHERE perfparse_id != '".$perfparse_id["MAX(perfparse_id)"]."'");
+		return ($perfparse_id["MAX(perfparse_id)"]);
+	}
+	
+	function updatePerfparse($perfparse_id = null)	{
+		if (!$perfparse_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE cfg_perfparse SET ";
+	    isset($ret["perfparse_name"]) && $ret["perfparse_name"] != NULL ? $rq .= "perfparse_name = '".htmlentities($ret["perfparse_name"], ENT_QUOTES)."', " : $rq .= "perfparse_name = NULL, ";
+        isset($ret["server_port"]) && $ret["server_port"] != NULL ? $rq .= "Server_Port = '".htmlentities($ret["server_port"], ENT_QUOTES)."', " : $rq .= "Server_Port = NULL, ";
+		isset($ret["service_log"]) && $ret["service_log"] != NULL ? $rq .= "Service_Log = '".htmlentities($ret["service_log"], ENT_QUOTES)."',  " : $rq .= "Service_Log = NULL, ";
+        isset($ret["service_log_position_mark_path"]) && $ret["service_log_position_mark_path"] != NULL ? $rq .= "Service_Log_Position_Mark_Path = '".htmlentities($ret["service_log_position_mark_path"], ENT_QUOTES)."',  " : $rq .= "Service_Log_Position_Mark_Path = NULL, ";
+       	isset($ret["error_log"]) && $ret["error_log"] != NULL ? $rq .= "Error_Log = '".htmlentities($ret["error_log"], ENT_QUOTES)."',  " : $rq .= "Error_Log = NULL, ";
+        isset($ret["error_log_rotate"]["error_log_rotate"]) && $ret["error_log_rotate"]["error_log_rotate"] != NULL ? $rq .= "Error_Log_Rotate = '".$ret["error_log_rotate"]["error_log_rotate"]."',  " : $rq .= "Error_Log_Rotate = NULL, ";
+        isset($ret["error_log_keep_n_days"]) && $ret["error_log_keep_n_days"] != NULL ? $rq .= "Error_Log_Keep_N_Days = '".htmlentities($ret["error_log_keep_n_days"], ENT_QUOTES)."',  "  : $rq .= "Error_Log_Keep_N_Days = NULL, ";
+        isset($ret["drop_file"]) && $ret["drop_file"] != NULL ? $rq .= "Drop_File = '".htmlentities($ret["drop_file"], ENT_QUOTES)."',  " : $rq .= "Drop_File = NULL, ";
+        isset($ret["drop_file_rotate"]["drop_file_rotate"]) && $ret["drop_file_rotate"]["drop_file_rotate"] != NULL ? $rq .= "Drop_File_Rotate = '".$ret["drop_file_rotate"]["drop_file_rotate"]."',  " : $rq .= "Drop_File_Rotate = NULL, ";
+ 	    isset($ret["drop_file_keep_n_days"]) && $ret["drop_file_keep_n_days"] != NULL ? $rq .= "Drop_File_Keep_N_Days = '".htmlentities($ret["drop_file_keep_n_days"], ENT_QUOTES)."',  " : $rq .= "Drop_File_Keep_N_Days = NULL, ";
+        isset($ret["lock_file"]) && $ret["lock_file"] != NULL ? $rq .= "Lock_File = '".htmlentities($ret["lock_file"], ENT_QUOTES)."',  " : $rq .= "Lock_File = NULL, ";
+        isset($ret["show_status_bar"]["show_status_bar"]) && $ret["show_status_bar"]["show_status_bar"] != NULL ? $rq .= "Show_Status_Bar = '".$ret["show_status_bar"]["show_status_bar"]."',  " : $rq .= "Show_Status_Bar = NULL, ";
+        isset($ret["do_report"]["do_report"]) && $ret["do_report"]["do_report"] != NULL ? $rq .= "Do_Report = '".$ret["do_report"]["do_report"]."',  " : $rq .= "Do_Report = NULL, ";
+        isset($ret["default_user_permissions_policy"]["default_user_permissions_policy"]) && $ret["default_user_permissions_policy"]["default_user_permissions_policy"] != NULL ? $rq .= "Default_user_permissions_Policy = '".$ret["default_user_permissions_policy"]["default_user_permissions_policy"]."',  " : $rq .= "Default_user_permissions_Policy = NULL, ";
+        isset($ret["default_user_permissions_host_groups"]["default_user_permissions_host_groups"]) && $ret["default_user_permissions_host_groups"]["default_user_permissions_host_groups"] != NULL ? $rq .= "Default_user_permissions_Host_groups = '".$ret["default_user_permissions_host_groups"]["default_user_permissions_host_groups"]."',  " : $rq .= "Default_user_permissions_Host_groups = NULL, ";
+        isset($ret["default_user_permissions_summary"]["default_user_permissions_summary"]) && $ret["default_user_permissions_summary"]["default_user_permissions_summary"] != NULL ? $rq .= "Default_user_permissions_Summary = '".$ret["default_user_permissions_summary"]["default_user_permissions_summary"]."',  " : $rq .= "Default_user_permissions_Summary = NULL, ";
+        isset($ret["output_log_file"]["output_log_file"]) && $ret["output_log_file"]["output_log_file"] != NULL ? $rq .= "Output_Log_File = '".$ret["output_log_file"]["output_log_file"]."',  " : $rq .= "Output_Log_File = NULL, ";
+        isset($ret["output_log_filename"]) && $ret["output_log_filename"] != NULL ? $rq .= "Output_Log_Filename = '".htmlentities($ret["output_log_filename"], ENT_QUOTES)."',  " : $rq .= "Output_Log_Filename = NULL, ";
+        isset($ret["output_log_rotate"]["output_log_rotate"]) && $ret["output_log_rotate"]["output_log_rotate"] != NULL ? $rq .= "Output_Log_Rotate = '".$ret["output_log_rotate"]["output_log_rotate"]."',  " : $rq .= "Output_Log_Rotate = NULL, ";
+        isset($ret["output_log_keep_n_days"]) && $ret["output_log_keep_n_days"] != NULL ? $rq .= "Output_Log_Keep_N_Days = '".htmlentities($ret["output_log_keep_n_days"], ENT_QUOTES)."',  " : $rq .= "Output_Log_Keep_N_Days = NULL, ";
+        isset($ret["use_storage_socket_output"]["use_storage_socket_output"]) && $ret["use_storage_socket_output"]["use_storage_socket_output"] != NULL ? $rq .= "Use_Storage_Socket_Output = '".$ret["use_storage_socket_output"]["use_storage_socket_output"]."',  " : $rq .= "Use_Storage_Socket_Output = NULL, ";
+        isset($ret["storage_socket_output_host_name"]) && $ret["storage_socket_output_host_name"] != NULL ? $rq .= "Storage_Socket_Output_Host_Name = '".htmlentities($ret["storage_socket_output_host_name"], ENT_QUOTES)."',  " : $rq .= "Storage_Socket_Output_Host_Name = NULL, ";
+        isset($ret["storage_socket_output_port"]) && $ret["storage_socket_output_port"] != NULL ? $rq .= "Storage_Socket_Output_Port = '".htmlentities($ret["storage_socket_output_port"], ENT_QUOTES)."',  " : $rq .= "Storage_Socket_Output_Port = NULL, ";
+        isset($ret["use_storage_mysql"]["use_storage_mysql"]) && $ret["use_storage_mysql"]["use_storage_mysql"] != NULL ? $rq .= "Use_Storage_Mysql = '".$ret["use_storage_mysql"]["use_storage_mysql"]."',  " : $rq .= "Use_Storage_Mysql = NULL, ";
+        isset($ret["no_raw_data"]["no_raw_data"]) && $ret["no_raw_data"]["no_raw_data"] != NULL ? $rq .= "No_Raw_Data = '".$ret["no_raw_data"]["no_raw_data"]."',  " : $rq .= "No_Raw_Data = NULL, ";
+        isset($ret["no_bin_data"]["no_bin_data"]) && $ret["no_bin_data"]["no_bin_data"] != NULL ? $rq .= "No_Bin_Data = '".$ret["no_bin_data"]["no_bin_data"]."',  " : $rq .= "No_Bin_Data = NULL, ";
+        isset($ret["db_user"]) && $ret["db_user"] != NULL ? $rq .= "DB_User = '".htmlentities($ret["db_user"], ENT_QUOTES)."',  " : $rq .= "DB_user = NULL, ";
+        isset($ret["db_pass"]) && $ret["db_pass"] != NULL ? $rq .= "DB_Pass = '".htmlentities($ret["db_pass"], ENT_QUOTES)."',  " : $rq .= "DB_Pass = NULL, ";
+        isset($ret["db_name"]) && $ret["db_name"] != NULL ? $rq .= "DB_Name = '".htmlentities($ret["db_name"], ENT_QUOTES)."',  " : $rq .= "DB_Name = NULL, ";
+        isset($ret["db_host"]) && $ret["db_host"] != NULL ? $rq .= "DB_Host = '".htmlentities($ret["db_host"], ENT_QUOTES)."',  " : $rq .= "DB_Host = NULL, ";
+        isset($ret["dummy_hostname"]) && $ret["dummy_hostname"] != NULL ? $rq .= "Dummy_Hostname = '".htmlentities($ret["dummy_hostname"], ENT_QUOTES)."',  " : $rq .= "Dummy_Hostname = NULL, ";
+        isset($ret["storage_modules_load"]) && $ret["storage_modules_load"] != NULL ? $rq .= "Storage_Modules_Load = '".htmlentities($ret["storage_modules_load"], ENT_QUOTES)."',  " : $rq .= "Storage_Modules_Load = NULL, ";
+        isset($ret["perfparse_comment"]) && $ret["perfparse_comment"] != NULL ? $rq .= "perfparse_comment = '".htmlentities($ret["perfparse_comment"], ENT_QUOTES)."',  " : $rq .= "perfparse_comment = NULL, ";
+		$rq .= "perfparse_activate = '".$ret["perfparse_activate"]["perfparse_activate"]."' ";
+		$rq .= "WHERE perfparse_id = '".$perfparse_id."'";
+		$pearDB->query($rq);
+		if ($ret["perfparse_activate"]["perfparse_activate"])
+			enablePerfparseInDB($perfparse_id);
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configPerfparse/formPerfparse.ihtml b/www/include/configuration/configPerfparse/formPerfparse.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..563e5aec5ff4fe1dcf0fdba21a28620d20bb7f11
--- /dev/null
+++ b/www/include/configuration/configPerfparse/formPerfparse.ihtml
@@ -0,0 +1,73 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/text_code_java2.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.perfparse_name.label}</td><td class="FormRowValue">{$form.perfparse_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.perfparse_comment.label}</td><td class="FormRowValue">{$form.perfparse_comment.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.perfparse_activate.label}</td><td class="FormRowValue">{$form.perfparse_activate.html}</td></tr>
+		
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;{$form.header.sManagement}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.server_port.label}</td><td class="FormRowValue">{$form.server_port.html}</td></tr>
+		
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">{$form.header.pManagement}</td></tr>
+	 	<tr class="list_lvl_2"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;{$form.header.perfDLF}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.service_log.label}</td><td class="FormRowValue">{$form.service_log.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.service_log_position_mark_path.label}</td><td class="FormRowValue">{$form.service_log_position_mark_path.html}</td></tr>
+	 	<tr class="list_lvl_2"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;{$form.header.errHandling}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.error_log.label}</td><td class="FormRowValue">{$form.error_log.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.error_log_rotate.label}</td><td class="FormRowValue">{$form.error_log_rotate.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.error_log_keep_n_days.label}</td><td class="FormRowValue">{$form.error_log_keep_n_days.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.drop_file.label}</td><td class="FormRowValue">{$form.drop_file.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.drop_file_rotate.label}</td><td class="FormRowValue">{$form.drop_file_rotate.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.drop_file_keep_n_days.label}</td><td class="FormRowValue">{$form.drop_file_keep_n_days.html}</td></tr>
+	 	<tr class="list_lvl_2"><td class="ListColLvl1_name" colspan="2">&nbsp;&nbsp;{$form.header.lockFileTxt}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.lock_file.label}</td><td class="FormRowValue">{$form.lock_file.html}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">{$form.header.reportOpt}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.show_status_bar.label}</td><td class="FormRowValue">{$form.show_status_bar.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.do_report.label}</td><td class="FormRowValue">{$form.do_report.html}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">{$form.header.cgiMan}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.default_user_permissions_policy.label}</td><td class="FormRowValue">{$form.default_user_permissions_policy.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.default_user_permissions_host_groups.label}</td><td class="FormRowValue">{$form.default_user_permissions_host_groups.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.default_user_permissions_summary.label}</td><td class="FormRowValue">{$form.default_user_permissions_summary.html}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">{$form.header.outLog}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.output_log_file.label}</td><td class="FormRowValue">{$form.output_log_file.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.output_log_filename.label}</td><td class="FormRowValue">{$form.output_log_filename.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.output_log_rotate.label}</td><td class="FormRowValue">{$form.output_log_rotate.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.output_log_keep_n_days.label}</td><td class="FormRowValue">{$form.output_log_keep_n_days.html}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">{$form.header.SockOutMan}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.use_storage_socket_output.label}</td><td class="FormRowValue">{$form.use_storage_socket_output.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.storage_socket_output_host_name.label}</td><td class="FormRowValue">{$form.storage_socket_output_host_name.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.storage_socket_output_port.label}</td><td class="FormRowValue">{$form.storage_socket_output_port.html}</td></tr>
+		
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2">{$form.header.dbMan}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.use_storage_mysql.label}</td><td class="FormRowValue">{$form.use_storage_mysql.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.no_raw_data.label}</td><td class="FormRowValue">{$form.no_raw_data.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.no_bin_data.label}</td><td class="FormRowValue">{$form.no_bin_data.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.db_name.label}</td><td class="FormRowValue">{$form.db_name.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.db_user.label}</td><td class="FormRowValue">{$form.db_user.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.db_pass.label}</td><td class="FormRowValue">{$form.db_pass.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.db_host.label}</td><td class="FormRowValue">{$form.db_host.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.dummy_hostname.label}</td><td class="FormRowValue">{$form.dummy_hostname.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.storage_modules_load.label}</td><td class="FormRowValue">{$form.storage_modules_load.html}</td></tr>
+	
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
+
diff --git a/www/include/configuration/configPerfparse/formPerfparse.php b/www/include/configuration/configPerfparse/formPerfparse.php
new file mode 100644
index 0000000000000000000000000000000000000000..929e4ad30fe4f0e22d2cfb3868df89ecec750b89
--- /dev/null
+++ b/www/include/configuration/configPerfparse/formPerfparse.php
@@ -0,0 +1,249 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Nagios
+	#
+	$pp = array();
+	$ppTemp = array();
+	if (($o == "c" || $o == "w") && $perfparse_id)	{	
+		$res =& $pearDB->query("SELECT * FROM cfg_perfparse WHERE perfparse_id = '".$perfparse_id."' LIMIT 1");
+		# Set base value
+		$ppTemp = array_map("myDecode", $res->fetchRow());
+		foreach ($ppTemp as $key=>$value)
+			$pp[strtolower($key)] = $value;
+	}
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText		= array("size"=>"30");
+	$attrsText2 	= array("size"=>"50");
+	$attrsText3 	= array("size"=>"10");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["pp_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["pp_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["pp_view"]);
+
+	#
+	## Perfparse Configuration basic information
+	#
+	$form->addElement('header', 'information', $lang['pp_infos']);
+	$form->addElement('text', 'perfparse_name', $lang["pp_name"], $attrsText);
+	$form->addElement('textarea', 'perfparse_comment', $lang["pp_comment"], $attrsTextarea);
+	$ppTab = array();
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'perfparse_activate', null, $lang["enable"], '1');
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'perfparse_activate', null, $lang["disable"], '0');
+	$form->addGroup($ppTab, 'perfparse_activate', $lang["status"], '&nbsp;');	
+	
+	## Part 1
+	$form->addElement('header', 'sManagement', $lang['pp_sMan']);
+	$form->addElement('text', 'server_port', $lang['pp_serPort'], $attrsText3);
+
+	## Part 2
+	$form->addElement('header', 'pManagement', $lang['pp_pMan']);
+	$form->addElement('header', 'perfDLF', $lang['pp_perfDLF']);
+	$form->addElement('text', 'service_log', $lang['pp_serLog'], $attrsText2);	
+	$form->addElement('text', 'service_log_position_mark_path', $lang['pp_svLPMP'], $attrsText2);
+	
+	$form->addElement('header', 'errHandling', $lang['pp_errHandling']);
+	$form->addElement('text', 'error_log', $lang['pp_errLog'], $attrsText2);
+	$ppTab = array();
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'error_log_rotate', null, $lang["yes"], '1');
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'error_log_rotate', null, $lang["no"], '0');
+	$form->addGroup($ppTab, 'error_log_rotate', $lang['pp_errLogRot'], '&nbsp;');
+	$form->addElement('text', 'error_log_keep_n_days', $lang['pp_errLKND'], $attrsText3);	
+	$form->addElement('text', 'drop_file', $lang['pp_dropFile'], $attrsText2);
+	$ppTab = array();
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'drop_file_rotate', null, $lang["yes"], '1');
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'drop_file_rotate', null, $lang["no"], '0');
+	$form->addGroup($ppTab, 'drop_file_rotate', $lang['pp_dropFileRot'], '&nbsp;');
+	$form->addElement('text', 'drop_file_keep_n_days', $lang['pp_dropFKND'], $attrsText3);
+	
+	$form->addElement('header', 'lockFileTxt', $lang['pp_lockFileTxt']);	
+	$form->addElement('text', 'lock_file', $lang['pp_lockFile'], $attrsText2);
+	
+	## Part 3
+	$form->addElement('header', 'reportOpt', $lang['pp_reportOpt']);
+	$ppTab = array();
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'show_status_bar', null, $lang["yes"], '1');
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'show_status_bar', null, $lang["no"], '0');
+	$form->addGroup($ppTab, 'show_status_bar', $lang['pp_showSB'], '&nbsp;');
+	$ppTab = array();
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'do_report', null, $lang["yes"], '1');
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'do_report', null, $lang["no"], '0');
+	$form->addGroup($ppTab, 'do_report', $lang['pp_doReport'], '&nbsp;');
+	
+	## Part 4
+	$form->addElement('header', 'cgiMan', $lang['pp_cgiMan']);	
+    $form->addElement('select', 'default_user_permissions_policy', $lang['pp_defUPP'], array(1=>"ro", 2=>"rw", 3=>"hide"));
+    $form->addElement('select', 'default_user_permissions_host_groups', $lang['pp_defUPHG'], array(1=>"ro", 2=>"rw", 3=>"hide"));
+    $form->addElement('select', 'default_user_permissions_summary', $lang['pp_defUPS'], array(1=>"ro", 2=>"rw", 3=>"hide"));
+	
+	## Part 5
+	$form->addElement('header', 'outLog', $lang['pp_outLog']);
+	$ppTab = array();
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'output_log_file', null, $lang["yes"], '1');
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'output_log_file', null, $lang["no"], '0');
+	$form->addGroup($ppTab, 'output_log_file', $lang['pp_outLogFile'], '&nbsp;');
+	$form->addElement('text', 'output_log_filename', $lang['pp_outLogFileName'], $attrsText2);
+	$ppTab = array();
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'output_log_rotate', null, $lang["yes"], '1');
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'output_log_rotate', null, $lang["no"], '0');
+	$form->addGroup($ppTab, 'output_log_rotate', $lang['pp_outLogRot'], '&nbsp;');
+	$form->addElement('text', 'output_log_keep_n_days', $lang['pp_outLKND'], $attrsText3);
+	
+	## Part 6
+	$form->addElement('header', 'SockOutMan', $lang['pp_SockOutMan']);
+	$ppTab = array();
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'use_storage_socket_output', null, $lang["yes"], '1');
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'use_storage_socket_output', null, $lang["no"], '0');
+	$form->addGroup($ppTab, 'use_storage_socket_output', $lang['pp_useStoSockOut'], '&nbsp;');
+	$form->addElement('text', 'storage_socket_output_host_name', $lang['pp_stoSockOutHName'], $attrsText3);
+	$form->addElement('text', 'storage_socket_output_port', $lang['pp_stoSockOutPort'], $attrsText3);
+	
+	## Part 7
+	$form->addElement('header', 'dbMan', $lang['pp_dbMan']);
+	$ppTab = array();
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'use_storage_mysql', null, $lang["yes"], '1');
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'use_storage_mysql', null, $lang["no"], '0');
+	$form->addGroup($ppTab, 'use_storage_mysql', $lang['pp_useStorMySQL'], '&nbsp;');
+	$ppTab = array();
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'no_raw_data', null, $lang["yes"], '1');
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'no_raw_data', null, $lang["no"], '0');
+	$form->addGroup($ppTab, 'no_raw_data', $lang['pp_noRawData'], '&nbsp;');
+	$ppTab = array();
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'no_bin_data', null, $lang["yes"], '1');
+	$ppTab[] = &HTML_QuickForm::createElement('radio', 'no_bin_data', null, $lang["no"], '0');
+	$form->addGroup($ppTab, 'no_bin_data', $lang['pp_noBinData'], '&nbsp;');
+	$form->addElement('text', 'db_user', $lang['pp_dbUser'], $attrsText3);
+	$form->addElement('text', 'db_name', $lang['pp_dbName'], $attrsText3);
+	$form->addElement('password', 'db_pass', $lang['pp_dbPass'], $attrsText3);
+	$form->addElement('text', 'db_host', $lang['pp_dbHost'], $attrsText3);
+	$form->addElement('text', 'dummy_hostname', $lang['pp_dumHN'], $attrsText3);
+	$form->addElement('text', 'storage_modules_load', $lang['pp_stoModLoad'], $attrsText3);
+		
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	
+	$form->setDefaults(array(
+	"perfparse_activate"=>'1',
+	"service_log"=>"-",
+	"error_log_rotate"=>'1',
+	"drop_file"=>"/tmp/perfparse.drop",
+	"drop_file_rotate"=>'1',
+	"lock_file"=>"/var/lock/perfparse.lock",
+	"show_status_bar"=>'0',
+	"do_report"=>'0',
+	"default_user_permissions_policy"=>0,
+	"default_user_permissions_host_groups"=>0,
+	"default_user_permissions_summary"=>0,
+	"output_log_file"=>'1',
+	"output_log_rotate"=>'1',
+	"use_storage_socket_output"=>'0',
+	"use_storage_mysql"=>'1',
+	"no_raw_data"=>'1',
+	"no_bin_data"=>'0',
+	"dummy_hostname"=>"dummy",
+	"storage_modules_load"=>"mysql",
+	"action"=>'1'
+	));
+		
+	$form->addElement('hidden', 'perfparse_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	function slash($elem = NULL)	{
+		if ($elem)
+			return rtrim($elem, "/")."/";
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('perfparse_name', $lang['ErrName'], 'required');
+	$form->addRule('perfparse_comment', $lang['ErrRequired'], 'required');
+	$form->registerRule('exist', 'callback', 'testExistence');
+	$form->addRule('perfparse_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+	
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	# Just watch a nagios information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&perfparse_id=".$perfparse_id."'"));
+	    $form->setDefaults($pp);
+		$form->freeze();
+	}
+	# Modify a nagios information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($pp);
+	}
+	# Add a nagios information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	$tpl->assign('msg', array ("nagios"=>$oreon->user->get_version()));
+	
+	$valid = false;
+	if ($form->validate())	{
+		$ppObj =& $form->getElement('perfparse_id');
+		if ($form->getSubmitValue("submitA"))
+			$ppObj->setValue(insertPerfparseInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updatePerfparseInDB($ppObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&perfparse_id=".$ppObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listPerfparse.php");
+	else	{
+		#Apply a template definition	
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("formPerfparse.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configPerfparse/listPerfparse.ihtml b/www/include/configuration/configPerfparse/listPerfparse.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..37e0b4120c7b9cd7e5f350951906ed77b2b72671
--- /dev/null
+++ b/www/include/configuration/configPerfparse/listPerfparse.ihtml
@@ -0,0 +1,43 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="2"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+
+	{$form.hidden}
+</form>
\ No newline at end of file
diff --git a/www/include/configuration/configPerfparse/listPerfparse.php b/www/include/configuration/configPerfparse/listPerfparse.php
new file mode 100644
index 0000000000000000000000000000000000000000..9eb2d6fbcd3c60519c9b78660ae702bcffb1da26
--- /dev/null
+++ b/www/include/configuration/configPerfparse/listPerfparse.php
@@ -0,0 +1,99 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/	$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM cfg_perfparse WHERE perfparse_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM cfg_perfparse");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Nagios list
+	if ($search)
+		$rq = "SELECT perfparse_id, perfparse_name, perfparse_comment, perfparse_activate FROM cfg_perfparse WHERE perfparse_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' ORDER BY perfparse_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT perfparse_id, perfparse_name, perfparse_comment, perfparse_activate FROM cfg_perfparse ORDER BY perfparse_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($perfparse); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$perfparse['perfparse_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&perfparse_id=".$perfparse['perfparse_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&perfparse_id=".$perfparse['perfparse_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&perfparse_id=".$perfparse['perfparse_id']."&o=d&select[".$perfparse['perfparse_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($perfparse["perfparse_activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&perfparse_id=".$perfparse['perfparse_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&perfparse_id=".$perfparse['perfparse_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$perfparse['perfparse_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$perfparse["perfparse_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&perfparse_id=".$perfparse['perfparse_id'],
+						"RowMenu_desc"=>substr($perfparse["perfparse_comment"], 0, 40),
+						"RowMenu_status"=>$perfparse["perfparse_activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listPerfparse.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configPerfparse/perfparse.php b/www/include/configuration/configPerfparse/perfparse.php
new file mode 100644
index 0000000000000000000000000000000000000000..c5c95f6767fa3a4f874572b1d3f1a62d4edf0fc5
--- /dev/null
+++ b/www/include/configuration/configPerfparse/perfparse.php
@@ -0,0 +1,49 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["perfparse_id"]) ? $cG = $_GET["perfparse_id"] : $cG = NULL;
+	isset($_POST["perfparse_id"]) ? $cP = $_POST["perfparse_id"] : $cP = NULL;
+	$cG ? $perfparse_id = $cG : $perfparse_id = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configPerfparse/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formPerfparse.php"); break; #Add Perfparse.cfg
+		case "w" : require_once($path."formPerfparse.php"); break; #Watch Perfparse.cfg
+		case "c" : require_once($path."formPerfparse.php"); break; #Modify Perfparse.cfg
+		case "s" : enablePerfparseInDB($perfparse_id); require_once($path."listPerfparse.php"); break; #Activate a perfparse CFG
+		case "u" : disablePerfparseInDB($perfparse_id); require_once($path."listPerfparse.php"); break; #Desactivate a perfparse CFG
+		case "m" : multiplePerfparseInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listPerfparse.php"); break; #Duplicate n perfparse CFGs
+		case "d" : deletePerfparseInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listPerfparse.php"); break; #Delete n perfparse CFG
+		default : require_once($path."listPerfparse.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configResources/DB-Func.php b/www/include/configuration/configResources/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..b0d26be8d01c416ac7f773c3d1079c783448a6a3
--- /dev/null
+++ b/www/include/configuration/configResources/DB-Func.php
@@ -0,0 +1,118 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function testExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('resource_id');
+		$res =& $pearDB->query("SELECT resource_name, resource_id FROM cfg_resource WHERE resource_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$resource =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $resource["resource_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $resource["resource_id"] != $id)	
+			return false;
+		else
+			return true;
+	}
+
+	function deleteResourceInDB ($resources = array())	{
+		global $pearDB;
+		foreach($resources as $key=>$value)
+			$pearDB->query("DELETE FROM cfg_resource WHERE resource_id = '".$key."'");
+	}
+	
+	function enableResourceInDB ($resource_id = null)	{
+		if (!$resource_id) exit();
+		global $pearDB;
+		$pearDB->query("UPDATE cfg_resource SET resource_activate = '1' WHERE resource_id = '".$resource_id."'");
+	}
+	
+	function disableResourceInDB ($resource_id = null)	{
+		if (!$resource_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE cfg_resource SET resource_activate = '0' WHERE resource_id = '".$resource_id."'");
+	}
+	
+	function multipleResourceInDB ($resources = array(), $nbrDup = array())	{
+		foreach($resources as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM cfg_resource WHERE resource_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["resource_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "resource_name" ? ($resource_name = clone($value2 = $value2."_".$i)) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testExistence($resource_name))
+					$pearDB->query($val ? $rq = "INSERT INTO cfg_resource VALUES (".$val.")" : $rq = null);
+			}
+		}
+	}
+	
+	function updateResourceInDB ($resource_id = NULL)	{
+		if (!$resource_id) return;
+		updateResource($resource_id);
+	}
+	
+	function updateResource($resource_id)	{
+		if (!$resource_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE cfg_resource ";
+		$rq .= "SET resource_name = '".htmlentities($ret["resource_name"], ENT_QUOTES)."', " .
+				"resource_line = '".htmlentities($ret["resource_line"], ENT_QUOTES)."', " .
+				"resource_comment= '".htmlentities($ret["resource_comment"], ENT_QUOTES)."', " .
+				"resource_activate= '".$ret["resource_activate"]["resource_activate"]."' " .
+				"WHERE resource_id = '".$resource_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function insertResourceInDB ()	{
+		$resource_id = insertResource();
+		return ($resource_id);
+	}
+	
+	function insertResource($ret = array())	{
+		global $form;
+		global $pearDB;
+		if (!count($ret))
+			$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO cfg_resource ";
+		$rq .= "(resource_name, resource_line, resource_comment, resource_activate) ";
+		$rq .= "VALUES (";
+		isset($ret["resource_name"]) && $ret["resource_name"] != NULL ? $rq .= "'".htmlentities($ret["resource_name"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["resource_line"]) && $ret["resource_line"] != NULL ? $rq .= "'".htmlentities($ret["resource_line"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["resource_comment"]) && $ret["resource_comment"] != NULL ? $rq .= "'".htmlentities($ret["resource_comment"], ENT_QUOTES)."', " : $rq .= "NULL, ";
+		isset($ret["resource_activate"]["resource_activate"]) && $ret["resource_activate"]["resource_activate"] != NULL ? $rq .= "'".$ret["resource_activate"]["resource_activate"]."'" : $rq .= "NULL";
+		$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(resource_id) FROM cfg_resource");
+		$resource_id = $res->fetchRow();
+		return ($resource_id["MAX(resource_id)"]);
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configResources/formResources.ihtml b/www/include/configuration/configResources/formResources.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..cf257c2a3718bc7974ce05b8fd5c69a8ecb575dc
--- /dev/null
+++ b/www/include/configuration/configResources/formResources.ihtml
@@ -0,0 +1,27 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/text_code.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.resource_name.label}</td><td class="FormRowValue">{$form.resource_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.resource_line.label}</td><td class="FormRowValue">{$form.resource_line.html}</td></tr>
+	 	
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/cookies.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.resource_activate.label}</td><td class="FormRowValue">{$form.resource_activate.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.resource_comment.label}</td><td class="FormRowValue">{$form.resource_comment.html}</td></tr>
+		
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p class="oreonbutton">{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p class="oreonbutton">{$form.change.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
diff --git a/www/include/configuration/configResources/formResources.php b/www/include/configuration/configResources/formResources.php
new file mode 100644
index 0000000000000000000000000000000000000000..8c8d2722a256aaff19decae6b701755d54e250fb
--- /dev/null
+++ b/www/include/configuration/configResources/formResources.php
@@ -0,0 +1,147 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Resources CFG
+	#
+	if (($o == "c" || $o == "w") && $resource_id)	{	
+		$res =& $pearDB->query("SELECT * FROM cfg_resource WHERE resource_id = '".$resource_id."' LIMIT 1");
+		# Set base value
+		$rs = array_map("myDecode", $res->fetchRow());
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"35");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["rs_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["rs_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["rs_view"]);
+
+	#
+	## Resources CFG basic information
+	#
+	$form->addElement('header', 'information', $lang['rs_infos']);
+	$form->addElement('text', 'resource_name', $lang["rs_name"], $attrsText);
+	$form->addElement('text', 'resource_line', $lang["rs_line"], $attrsText);
+	
+	#
+	## Further informations
+	#
+	$form->addElement('header', 'furtherInfos', $lang['further_infos']);
+	$rsActivation[] = &HTML_QuickForm::createElement('radio', 'resource_activate', null, $lang["enable"], '1');
+	$rsActivation[] = &HTML_QuickForm::createElement('radio', 'resource_activate', null, $lang["disable"], '0');
+	$form->addGroup($rsActivation, 'resource_activate', $lang["status"], '&nbsp;');
+	$form->setDefaults(array('resource_activate' => '1'));
+	$form->addElement('textarea', 'resource_comment', $lang["cmt_comment"], $attrsTextarea);
+		
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action' => '1'));
+	
+	$form->addElement('hidden', 'resource_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	function myReplace()	{
+		global $form;
+		$ret = $form->getSubmitValues();
+		return (str_replace(" ", "_", $ret["resource_name"]));
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('resource_name', 'myReplace');
+	$form->addRule('resource_name', $lang['ErrName'], 'required');
+	$form->addRule('resource_line', $lang['ErrAlias'], 'required');
+	$form->registerRule('exist', 'callback', 'testExistence');
+	$form->addRule('resource_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	# Just watch a Resources CFG information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&resource_id=".$resource_id."'"));
+	    $form->setDefaults($rs);
+		$form->freeze();
+	}
+	# Modify a Resources CFG information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($rs);
+	}
+	# Add a Resources CFG information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	
+	$valid = false;
+	if ($form->validate())	{
+		$rsObj =& $form->getElement('resource_id');
+		if ($form->getSubmitValue("submitA"))
+			$rsObj->setValue(insertResourceInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateResourceInDB($rsObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&resource_id=".$rsObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listResources.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("formResources.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configResources/listResources.ihtml b/www/include/configuration/configResources/listResources.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..257dd07baf700040bf50aaaa4a507a7a7047885c
--- /dev/null
+++ b/www/include/configuration/configResources/listResources.ihtml
@@ -0,0 +1,43 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight" align="right">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">				
+			</td>
+			<td class="ListColFooterCenter" colspan="2"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+
+	{$form.hidden}
+</form>
diff --git a/www/include/configuration/configResources/listResources.php b/www/include/configuration/configResources/listResources.php
new file mode 100644
index 0000000000000000000000000000000000000000..a839013a705f1300d0e0722a1e90c11b7a97f6e5
--- /dev/null
+++ b/www/include/configuration/configResources/listResources.php
@@ -0,0 +1,97 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	$pagination = "maxViewConfiguration";	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM cfg_resource WHERE resource_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM cfg_resource");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	# Timeperiod list
+	if ($search)
+		$rq = "SELECT resource_id, resource_name, resource_line, resource_activate FROM cfg_resource WHERE resource_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' ORDER BY resource_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT resource_id, resource_name, resource_line, resource_activate FROM cfg_resource ORDER BY resource_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();	for ($i = 0; $res->fetchInto($resource); $i++) {
+		$selectedElements =& $form->addElement('checkbox', "select[".$resource['resource_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&resource_id=".$resource['resource_id']."&o=w&&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&resource_id=".$resource['resource_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&resource_id=".$resource['resource_id']."&o=d&select[".$resource['resource_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($resource["resource_activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&resource_id=".$resource['resource_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&resource_id=".$resource['resource_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$resource['resource_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$resource["resource_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&resource_id=".$resource['resource_id'],
+						"RowMenu_desc"=>substr($resource["resource_line"], 0, 40),
+						"RowMenu_status"=>$resource["resource_activate"] ? $lang['enable'] :  $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listResources.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/configuration/configResources/resources.php b/www/include/configuration/configResources/resources.php
new file mode 100644
index 0000000000000000000000000000000000000000..ef2f50b9d3a96249a83553b99fd3f57bd3293a8e
--- /dev/null
+++ b/www/include/configuration/configResources/resources.php
@@ -0,0 +1,48 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["resource_id"]) ? $resourceG = $_GET["resource_id"] : $resourceG = NULL;
+	isset($_POST["resource_id"]) ? $resourceP = $_POST["resource_id"] : $resourceP = NULL;
+	$resourceG ? $resource_id = $resourceG : $resource_id = $resourceP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/configuration/configResources/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+
+	switch ($o)	{
+		case "a" : require_once($path."formResources.php"); break; #Add a Resource
+		case "w" : require_once($path."formResources.php"); break; #Watch a Resource
+		case "c" : require_once($path."formResources.php"); break; #Modify a Resource
+		case "s" : enableResourceInDB($resource_id); require_once($path."listResources.php"); break; #Activate a Resource
+		case "u" : disableResourceInDB($resource_id); require_once($path."listResources.php"); break; #Desactivate a Resource
+		case "m" : multipleResourceInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listResources.php"); break; #Duplicate n Resources
+		case "d" : deleteResourceInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listResources.php"); break; #Delete n Resources
+		default : require_once($path."listResources.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/configuration/lang/en.php b/www/include/configuration/lang/en.php
new file mode 100644
index 0000000000000000000000000000000000000000..5d1ec352cec0583f7c97d37b7611611fb9185a49
--- /dev/null
+++ b/www/include/configuration/lang/en.php
@@ -0,0 +1,1419 @@
+<?
+/* Configuration Error */
+
+$lang['requiredFields'] = "<font style='color: red;'>*</font> Champs requis";
+$lang['ErrName'] = "Compulsory Name";
+$lang['ErrAlias'] = "Compulsory Alias";
+$lang['ErrEmail'] = "Valid Email";
+$lang['ErrOpt'] = "Compulsory Option";
+$lang['ErrTp'] = "Compulsory Period";
+$lang['ErrCmd'] = "Compulsory Command";
+$lang['ErrCct'] = "Compulsory Contact";
+$lang['ErrCg'] = "Compulsory Contact Group";
+$lang['ErrCmdLine'] = "Compulsory Command Line";
+$lang['ErrCmdType'] = "Compulsory  Command Type";
+$lang['ErrAlreadyExist'] = "A same Name element already exist";
+$lang['ErrAddress'] = "Compulsory Adress";
+$lang['ErrRequired'] = "Require Field";
+$lang['ErrSvLeast'] = "HostGroup or Host Require";
+$lang['ErrCctPasswd'] = "Passwords are not the same";
+$lang['ErrGenFileProb'] = "Can't access to file needed";
+$lang['ErrCycleDef'] = "Circular Definition";
+
+/* Configuration Menu */
+
+$lang['quicksearch'] = "Quick Search";
+$lang['available'] = "Available";
+$lang['selected'] = "Selected";
+$lang['further_infos'] = "Additional Information";
+$lang['comment'] = "Comments";
+$lang['nothing'] = "Empty";
+$lang['formObjMatch'] = "Impacted Elements : ";
+$lang['action'] = "Post Validation";
+$lang['actionList'] = "List";
+$lang['actionForm'] = "Form";
+$lang['legend1'] = "(*) This Service is used by many Host";
+$lang['previous'] = "previous";
+$lang['next'] = "next";
+
+/* host */
+
+$lang['h'] = "Host";
+$lang['h_conf'] = "Host Configuration";
+$lang['h_add'] = "Add a Host";
+$lang['h_change'] = "Modify a Host";
+$lang['h_view'] = "View a Host";
+
+$lang['h_extInf'] = "Host Extended Infos";
+$lang["h_ExtInf_add"] = "Add an Host Extended Info";
+$lang["h_ExtInf_change"] = "Modify an Host Extended Info";
+$lang["h_ExtInf_view"] = "View an Host Extended Info";
+
+$lang['h_childs'] = "Linked Services";
+$lang['h_parent'] = "Template parent";
+
+$lang['h_infos'] = "General Informations";
+$lang['h_name'] = "Host Name";
+$lang['h_alias'] = "Alias";
+$lang['h_address'] = "Adress";
+$lang['h_snmpCom'] = "SNMP Community";
+$lang['h_snmpVer'] = "Version";
+$lang['h_template'] = "Host Template";
+$lang['h_templateText'] = "Use a Template exempt you to fill require fields";
+$lang['h_dupSvTplAssocText'] = "Create Services linked to the Template too";
+
+$lang['h_head_links'] = "Relations";
+$lang["h_Links_add"] = "Add relations";
+$lang["h_Links_change"] = "Modify relations";
+$lang["h_Links_view"] = "View relations";
+$lang['h_HostGroupMembers'] = "HostGroups Parents";
+$lang['h_HostParents'] = "Hosts Parents";
+$lang['h_HostChilds'] = "Hosts Childs";
+
+$lang['h_head_state'] = "Host state";
+$lang['h_checkCmd'] = "Check Command";
+$lang['h_checkMca'] = "Max Check Attempts";
+$lang['h_checkInterval'] = "Normal Check Interval";
+$lang['h_checksEnabled'] = "Checks Enabled";
+$lang['h_checkPeriod'] = "Check Period";
+$lang['h_activeCE'] = "Active Checks Enabled";
+$lang['h_passiveCE'] = "Passive Checks Enabled";
+$lang['h_eventHandlerE'] = "Event Handler Enabled";
+$lang['h_eventHandler'] = "Event Handler";
+
+$lang['h_head_treat'] = "Data Treatment";
+$lang['h_add_treat'] = "Add Data Treatment";
+$lang['h_modify_treat'] = "Modify Data Treatment";
+$lang['h_view_treat'] = "View Data Treatment";
+
+$lang['h_ObsessOH'] = "Obsess Over Host";
+$lang['h_checkFreshness'] = "Check Freshness";
+$lang['h_FreshnessThreshold'] = "Freshness Threshold";
+$lang['h_flapDetect'] = "Flap Detection Enabled";
+$lang['h_lowFT'] = "Low Flap threshold";
+$lang['h_highFT'] = "High Flap Threshold";
+$lang['h_processPD'] = "Process Perf Data";
+$lang['h_retainSI'] = "Retain Satatus Information";
+$lang['h_retainNI'] = "Retain Non Status Information";
+
+$lang['h_head_notif'] = "Notification";
+$lang['h_CgMembers'] = "ContactGroups Linked";
+$lang['h_notifInt'] = "Notification Interval";
+$lang['h_notifTp'] = "Notification Period";
+$lang['h_notifOpts'] = "Notification Options";
+$lang['h_notifEnabled'] = "Notification Enabled";
+$lang['h_stalOpts'] = "Stalking Options";
+
+$lang['h_nagios'] = "Nagios";
+$lang['h_notes'] = "Note";
+$lang['h_notesUrl'] = "URL";
+$lang['h_actionUrl'] = "Action URL";
+$lang['h_iconImg'] = "Icon";
+$lang['h_iconImgAlt'] = "Alt icon";
+$lang['h_vrmlImg'] = "VRML Image";
+$lang['h_nagStatImg'] = "Nagios Statuts Map Image";
+$lang['h_nag2dCoords'] = "Nagios 2d Coords";
+$lang['h_nag3dCoords'] = "Nagios 3d Coords";
+
+$lang['h_oreon'] = "Oreon";
+$lang['h_country'] = "Country";
+$lang['h_city'] = "City";
+$lang['h_popCityTitle'] = "Choose a country";
+$lang['h_popCityAlpha'] = "Alphabetic Sort";
+
+/* host group */
+
+$lang['hg'] = "HostGroup";
+$lang['hg_name'] = "HostGroup Name";
+$lang['hg_alias'] = "Alias";
+$lang['hg_add'] = "Add a HostGroup";
+$lang['hg_change'] = "Modify a HostGroup";
+$lang['hg_view'] = "View a HostGroup";
+$lang['hg_CgMembers'] = "ContactGroups linked";
+$lang['hg_HostMembers'] = "Hosts linked";
+$lang['hg_infos'] = "General Informations";
+$lang['hg_links'] = "Relations";
+$lang['hg_notif'] = "Notification";
+
+/* Escalation  */
+
+$lang['esc'] = "Escalation";
+$lang['esc_name'] = "Escalation Name";
+$lang['esc_add'] = "Add an Escalation";
+$lang['esc_change'] = "Modify an Escalation";
+$lang['esc_view'] = "View an Escalation";
+$lang['esc_infos'] = "Informations";
+$lang['esc_sort2'] = "Hosts Escalation";
+$lang['esc_sort3'] = "Services Escalation";
+$lang['esc_sort4'] = "Hostgroups Escalation";
+$lang['esc_sort5'] = "Meta Services Escalation";
+$lang["esc_firstNotif"] = "First Notification";
+$lang["esc_lastNotif"] = "Last Notification";
+$lang["esc_notifInt"] = "Notification Interval";
+$lang["esc_escPeriod"] = "Escalation Period";
+$lang["esc_hOpt"] = "Hosts Escalation Options";
+$lang["esc_sOpt"] = "Services Escalation Options";
+$lang["esc_comment"] = "Comment";
+$lang['esc_appCG'] = "implied Contact Groups";
+$lang['esc_sortHosts'] = "Implied Hosts";
+$lang['esc_sortSv'] = "Implied Services";
+$lang['esc_sortHg'] = "Implied HostGroups";
+$lang['esc_sortMs'] = "Implied Meta Services";
+$lang['esc_hostServiceMembers'] = "Services by Hosts";
+$lang['esc_hostGroupServiceMembers'] = "Services by Host Groups";
+
+/* Dependencies */
+
+$lang['dep'] = "Dependencies";
+$lang['dep_add'] = "Add a Dependency";
+$lang['dep_change'] = "Modify a Dependency";
+$lang['dep_view'] = "View a Dependency";
+$lang['dep_infos'] = "Informations";
+$lang["dep_inheritsP"] = "Parent relationship";
+$lang["dep_exeFC"] = "Execution Failure Criteria";
+$lang["dep_notifFC"] = "Notification Failure Criteria";
+$lang["dep_comment"] = "Comment";
+$lang['dep_hPar'] = "Hosts Name";
+$lang['dep_hChi'] = "Dependent Hosts Name";
+$lang['dep_hgPar'] = "HostGroups Name";
+$lang['dep_hgChi'] = "Dependent HostGroups Name";
+$lang['dep_hSvPar'] = "Hosts Services Description";
+$lang['dep_hSvChi'] = "Dependent Hosts Services Description";
+$lang['dep_hgSvPar'] = "HostGroups Services Description";
+$lang['dep_hgSvChi'] = "Dependent HostGroups Services Description";
+$lang['dep_sgPar'] = "ServiceGroups Name";
+$lang['dep_sgChi'] = "Dependent ServiceGroups Name";
+$lang['dep_msPar'] = "Meta Services Name";
+$lang['dep_msChi'] = "Dependent Meta Services Name";
+$lang['dep_name'] = "Name";
+$lang['dep_description'] = "Description";
+$lang['dep_sort2'] = "Host Service Description";
+$lang['dep_sort3'] = "Dependent HostGroup Service Description";
+
+/* host template model */
+
+$lang['htm'] = "Host Template Model";
+$lang['htm_childs'] = "Services Template linked";
+$lang['htm_parent'] = "Template parent";
+$lang['htm_add'] = "Add a Host Template Model";
+$lang['htm_change'] = "Modify a Host Template Model";
+$lang['htm_view'] = "View a Host Template Model";
+$lang['htm_template'] = "Host Model Template";
+$lang['htm_templateText'] = "Use a Template Model allow you to have multi level Template relationship";
+
+/* service */
+
+$lang['sv'] = "Service";
+$lang['sv_conf'] = "Service Configuration";
+$lang['sv_add'] = "Add a Service";
+$lang['sv_change'] = "Modify a Service";
+$lang['sv_view'] = "View a Service";
+$lang['sv_parent'] = "Template parent";
+
+$lang['sv_extInf'] = "Service Extended Infos";
+$lang["sv_ExtInf_add"] = "Add an Extended Info";
+$lang["sv_ExtInf_change"] = "Modify an Extended Info";
+$lang["sv_ExtInf_view"] = "View an Extended Info";
+
+$lang['sv_infos'] = "General Informations";
+$lang['sv_hPars'] = "Linked with Hosts";
+$lang['sv_hgPars'] = "Linked with HostGroups";
+$lang['sv_description'] = "Description";
+$lang['sv_template'] = "Service Template";
+$lang['sv_templateText'] = "Use a Template exempt you to fill require fields";
+$lang['sv_traps'] = "Service Trap Relation";
+
+$lang['sv_head_links'] = "Relations";
+$lang["sv_Links_add"] = "Add relations";
+$lang["sv_Links_change"] = "Modify relations";
+$lang["sv_Links_view"] = "View relations";
+$lang['sv_ServiceGroupMembers'] = "ServiceGroups parents";
+
+$lang['sv_head_state'] = "Service State";
+$lang['sv_isVolatile'] = "Is Volatile";
+$lang['sv_checkCmd'] = "Check Command";
+$lang['sv_checkMca'] = "Max Check Attempts";
+$lang['sv_normalCheckInterval'] = "Normal Check Interval";
+$lang['sv_retryCheckInterval'] = "Retry Check Interval";
+$lang['sv_checkPeriod'] = "Check Period";
+$lang['sv_activeCE'] = "Active Checks Enabled";
+$lang['sv_passiveCE'] = "Passive Checks Enabled";
+$lang['sv_eventHandlerE'] = "Event Handler Enabled";
+$lang['sv_eventHandler'] = "Event Handler";
+$lang['sv_args'] = "Args";
+
+$lang['sv_head_treat'] = "Data Treatment";
+$lang['sv_paraCheck'] = "Parallelize Check";
+$lang['sv_ObsessOS'] = "Obsess Over Service";
+$lang['sv_checkFreshness'] = "Check Freshness";
+$lang['sv_FreshnessThreshold'] = "Freshness Threshold";
+$lang['sv_flapDetect'] = "Flap Detection Enabled";
+$lang['sv_lowFT'] = "Low Flap Threshold";
+$lang['sv_highFT'] = "High Flap Threshold";
+$lang['sv_processPD'] = "Process Perf Data";
+$lang['sv_retainSI'] = "Retain Status Information";
+$lang['sv_retainNI'] = "Retain Non Status Information";
+
+$lang['sv_head_notif'] = "Notification";
+$lang['sv_CgMembers'] = "ContactGroups implied";
+$lang['sv_notifInt'] = "Notification Interval";
+$lang['sv_notifTp'] = "Notification Period";
+$lang['sv_notifOpts'] = "Notification Type";
+$lang['sv_notifEnabled'] = "Notification Enabled";
+$lang['sv_stalOpts'] = "Stalking Options";
+
+$lang['sv_oreon'] = "Oreon";
+$lang['sv_graphTpl'] = "Graph Template";
+
+/* Meta Service */
+
+$lang['ms'] = "Meta Service";
+$lang['ms_conf'] = "Configuration";
+$lang['ms_infos'] = "General Informations";
+$lang["ms_add"] = "Add a Meta Service";
+$lang["ms_change"] = "Modify a Meta Service";
+$lang["ms_view"] = "View a Meta Service";
+$lang['ms_name'] = "Meta Service Name";
+$lang['ms_comment'] = "Comment";
+$lang['ms_levelw'] = "Warning Level";
+$lang['ms_levelc'] = "Critical Level";
+$lang['ms_calType'] = "Calcul Type";
+$lang['ms_selSum'] = "Sum";
+$lang['ms_selAvr'] = "Average";
+$lang['ms_selMin'] = "Min";
+$lang['ms_selMax'] = "Max";
+$lang['ms_selMod'] = "Selection Mode";
+$lang['ms_selList'] = "Services List";
+$lang['ms_regexp'] = "Regular Expression";
+$lang['ms_exp'] = "Expression";
+$lang['ms_metric'] = "Metric";
+
+$lang['ms_head_state'] = "Meta Service State";
+$lang['ms_checkMca'] = "Max Check Attempts";
+$lang['ms_normalCheckInterval'] = "Normal Check Interval";
+$lang['ms_retryCheckInterval'] = "Retry Check Interval";
+$lang['ms_checkPeriod'] = "Check Period";
+
+$lang['ms_head_notif'] = "Notification";
+$lang['ms_CgMembers'] = "ContactGroups linked";
+$lang['ms_notifInt'] = "Notification Interval";
+$lang['ms_notifTp'] = "Notification Period";
+$lang['ms_notifOpts'] = "Notification Type";
+$lang['ms_notifEnabled'] = "Notification Enabled";
+
+$lang['mss_add'] = "Add a Service";
+$lang['mss_change'] = "Modify a Service";
+$lang['mss_view'] = "View a Service";
+
+/* extended service infos */
+
+$lang['esi'] = "Extended Service Information";
+$lang['esi_available'] = "Extended Service Information Available ";
+$lang['esi_notes'] = "Notes";
+$lang['esi_notes_url'] = "Notes url";
+$lang['esi_action_url'] = "Action url";
+$lang['esi_icon_image'] = "Icon";
+$lang['esi_icon_image_alt'] = "Icon alt";
+
+/* service template model*/
+
+$lang['stm'] = "Service Template Model";
+$lang['stm_parent'] = "Template parent";
+$lang['stm_add'] = "Add a Service Template Model";
+$lang['stm_change'] = "Modify a Service Template Model";
+$lang['stm_view'] = "View a Service Template Model";
+$lang['stm_template'] = "Template Service Model";
+$lang['stm_templateText'] = "Use a Template Model allow you to have multi level Template relationship";
+
+/* service group*/
+
+$lang['sg'] = "ServiceGroup";
+$lang['sg_name'] = "ServiceGroup Name";
+$lang['sg_alias'] = "Alias";
+$lang['sg_add'] = "Add a ServiceGroup";
+$lang['sg_change'] = "Modify a ServiceGroup";
+$lang['sg_view'] = "View a ServiceGroup";
+$lang['sg_hostServiceMembers'] = "Host Services linked";
+$lang['sg_hostGroupServiceMembers'] = "Host Group Services linked";
+$lang['sg_infos'] = "General Informations";
+$lang['sg_links'] = "Relations";
+$lang['sg_notif'] = "Notification";
+
+/* contact */
+
+$lang['cct_add'] = "Add an User";
+$lang['cct_change'] = "Modify an User";
+$lang['cct_view'] = "View an User";
+$lang['cct_infos'] = "General Informations";
+$lang['cct_notif'] = "Notifications Type";
+$lang['cct_name'] = "Full Name";
+$lang['cct_mail'] = "Email";
+$lang['cct_mailType'] = "Mail Type";
+$lang['cct_pager'] = "Pager";
+$lang['cct_hostNotifOpt'] = "Hosts Notification Options";
+$lang['cct_hostNotifTp'] = "Host Notification Period";
+$lang['cct_hostNotifCmd'] = "Host Notification Commands";
+$lang['cct_svNotifOpt'] = "Services Notification Options";
+$lang['cct_svNotifTp'] = "Services Notification Period";
+$lang['cct_svNotifCmd'] = "Services Notification Commands";
+$lang['cct_cgNotif'] = "Contact Groups parents";
+$lang['cct_passwd'] = "Password";
+$lang['cct_passwd2'] = "Confirmation";
+$lang['cct_lang'] = "Default Lang";
+$lang['cct_oreon'] = "Oreon";
+$lang['cct_oreon_text'] = "AReach Oreon Frontend";
+$lang['cct_admin'] = "Admin";
+$lang["cct_contact_auth_type"] = "Authentification Type";
+$lang["cct_ldap_dn"] = "Ldap DN (Distinguished Name)";
+
+/* contact group */
+
+$lang['cg_infos'] = "General Informations";
+$lang['cg_name'] = "Contact Group Name";
+$lang['cg_alias'] = "Alias";
+$lang['cg_members'] = "Contacts linked";
+$lang['cg_notif'] = "Notification";
+$lang["cg_add"] = "Add a Contact Group";
+$lang["cg_change"] = "Modify a Contact Group";
+$lang["cg_view"] = "View a Contact Group";
+
+/* time period */
+
+$lang['tp_name'] = "Time Period Name";
+$lang['tp_alias'] = "Alias";
+$lang['tp_sunday'] = "Sunday";
+$lang['tp_monday'] = "Monday";
+$lang['tp_tuesday'] = "Tuesday";
+$lang['tp_wednesday'] = "Wednesday";
+$lang['tp_thursday'] = "Thursday";
+$lang['tp_friday'] = "Friday";
+$lang['tp_saturday'] = "Saturday";
+$lang['tp_infos'] = "General Informations";
+$lang['tp_notif'] = "Notification Slice Time";
+$lang["tp_add"] = "Add a Time Period";
+$lang["tp_change"] = "Modify a Time Period";
+$lang["tp_view"] = "View a Time Period";
+
+/* command */
+
+$lang['cmd_type'] = "Command Type";
+$lang['cmd_infos'] = "Informations";
+$lang['cmd_check'] = "Check Command";
+$lang['cmd_notif'] = "Notification Command";
+$lang['cmd_checkShort'] = "Check";
+$lang['cmd_notifShort'] = "Notification";
+$lang["cmd_add"] = "Add a Command";
+$lang["cmd_change"] = "Modify a Command";
+$lang["cmd_view"] = "View a Command";
+$lang['cmd_name'] = "Command Name";
+$lang['cmd_line'] = "Command Line";
+$lang['cmd_type'] = "Command Type";
+$lang['cmd_comment'] = "Commands definitions can contain Macros but you have to be sure that they are well validate for the case they'll be used";
+$lang['cmd_help'] = "Plugin Help";
+$lang['cmd_help_output'] = "Help";
+$lang['cmd_output'] = "Output";
+$lang['cmd_example'] = "Argument Example";
+
+/* Nagios CFG */
+
+$lang["nagios_add"] = "Add a Nagios Configuration File";
+$lang["nagios_change"] = "Modify a Nagios Configuration File";
+$lang["nagios_view"] = "View a Nagios Configuration File";
+$lang['nagios_infos'] = "Informations";
+$lang["nagios_name"] = "Configuration Name";
+$lang["nagios_comment"] = "Comments";
+
+$lang["nag_logFile"] = "Log file";
+$lang["nag_objConfFile"] = "Object Configuration File";
+$lang["nag_objConfDir"] = "Object Configuration Directory";
+$lang["nag_objCacheFile"] = "Object Cache File";
+$lang["nag_resFile"] = "Resource File";
+$lang["nag_tmpFile"] = "Temp File";
+$lang["nag_p1File"] = "P1 File";
+
+$lang["nag_statusFile"] = "Status File";
+$lang["nag_asuOpt"] = "Aggregated Status Updates Option";
+$lang["nag_asuInt"] = "Aggregated Status Data Update Interval";
+
+$lang["nag_nagUser"] = "Nagios User";
+$lang["nag_nagGroup"] = "Nagios Group";
+
+$lang["nag_notifOpt"] = "Notification Option";
+$lang["nag_svCheckExeOpt"] = "Service Check Execution Option";
+$lang["nag_pasSvCheckAccOpt"] = "Passive Service Check Acceptance Option";
+$lang["nag_hostCheckExeOpt"] = "Host Check Execution Option";
+$lang["nag_pasHostCheckAccOpt"] = "Passive Host Check Acceptance Option";
+$lang["nag_eventHandOpt"] = "Event Handler Option";
+
+$lang["nag_logRotMethod"] = "Log Rotation Method";
+$lang["nag_logArchPath"] = "Log Archive Path";
+
+$lang["nag_extCmdCheckOpt"] = "External Command Check Option";
+$lang["nag_extCmdCheckInt"] = "External Command Check Interval";
+$lang["nag_extCmdFile"] = "External Command File";
+
+$lang["nag_cmtFile"] = "Comment File";
+$lang["nag_dtFile"] = "Downtime File";
+$lang["nag_lockFile"] = "Lock File";
+
+$lang["nag_stateRetOpt"] = "State Retention Option";
+$lang["nag_stateRetFile"] = "State Retention File";
+$lang["nag_autStateRetUpdInt"] = "Automatic State Retention Update Interval";
+$lang["nag_useRetPgmStateOpt"] = "Use Retained Program State Option";
+$lang["nag_useRetSchInfoOpt"] = "Use Retained Scheduling Info Option";
+
+$lang["nag_SysLogOpt"] = "Syslog Logging Option";
+$lang["nag_notLogOpt"] = "Notification Logging Option";
+$lang["nag_svCheckRtrLogOpt"] = "Service Check Retry Logging Option";
+$lang["nag_hostRtrLogOpt"] = "Host Retry Logging Option";
+$lang["nag_eventHandLogOpt"] = "Event Handler Logging Option";
+$lang["nag_iniStateLogOpt"] = "Initial State Logging Option";
+$lang["nag_extCmdLogOpt"] = "External Command Logging Option";
+$lang["nag_passSvCheckLogOpt"] = "Passive Service Check Logging Option";
+$lang["nag_passCheckLogOpt"] = "Passive Check Logging Option";
+
+$lang["nag_glHostEventHand"] = "Global Host Event Handler";
+$lang["nag_glSvEventHand"] = "Global Service Event Handler";
+
+$lang["nag_intCheckSleepTm"] = "Inter-Check Sleep Time";
+$lang["nag_intCheckDelMth"] = "Inter-Check Delay Method";
+$lang["nag_svIntCheckDelMth"] = "Service Inter-Check Delay Method";
+$lang["nag_maxSvCheckSpread"] = "Maximum Service Check Spread";
+$lang["nag_svInterFac"] = "Service Interleave Factor";
+$lang["nag_maxConcSvChecks"] = "Maximum Concurrent Service Checks";
+$lang["nag_svReapFreq"] = "Service Repear Frequency";
+$lang["nag_hostIntCheckDelMth"] = "Host Inter-Check Delay Method";
+$lang["nag_maxHostCheckSpread"] = "Maximum Host Check Spread";
+$lang["nag_tmIntLen"] = "Timing Interval Length";
+$lang["nag_autoRescheOpt"] = "Auto-Rescheduling Option";
+$lang["nag_autoRescheInt"] = "Auto-Rescheduling Interval";
+$lang["nag_autoRescheWnd"] = "Auto-Rescheduling Window";
+
+$lang["nag_aggHostCheckOpt"] = "Aggressive Host Checking Option";
+
+$lang["nag_flapDetOpt"] = "Flap Detection Option";
+$lang["nag_lowSvFlapThres"] = "Low Service Flap Threshold";
+$lang["nag_highSvFlapThres"] = "High Service Flap Threshold";
+$lang["nag_lowHostFlapThres"] = "Low Host Flap Threshold";
+$lang["nag_highHostFlapThres"] = "High Host Flap Threshold";
+
+$lang["nag_softSvDepOpt"] = "Soft Service Dependencies Option";
+
+$lang["nag_svCheckTmOut"] = "Service Check Timeout";
+$lang["nag_hostCheckTmOut"] = "Host Check Timeout";
+$lang["nag_eventHandTmOut"] = "Event Handler Timeout";
+$lang["nag_notifTmOut"] = "Notification Timeout";
+$lang["nag_obComSvProcTmOut"] = "Obsessive Compulsive Service Processor Timeout";
+$lang["nag_obComHostProcTmOut"] = "Obsessive Compulsive Host Processor Timeout";
+$lang["nag_perfDataProcCmdTmOut"] = "Performance Data Processor Command Timeout";
+
+$lang["nag_obsOverSvOpt"] = "Obsess Over Services Option";
+$lang["nag_obsComSvProcCmd"] = "Obsessive Compulsive Service Processor Command";
+$lang["nag_obsOverHostOpt"] = "Obsess Over Hosts Option";
+$lang["nag_obsComHostProcCmd"] = "Obsessive Compulsive Host Processor Command";
+
+$lang["nag_perfDataProcOpt"] = "Performance Data Processing Option";
+$lang["nag_hostPerfDataProcCmd"] = "Host Performance Data Processing Command";
+$lang["nag_svPerfDataProcCmd"] = "Service Performance Data Processing Command";
+$lang["nag_hostPerfDataFile"] = "Host Performance Data File";
+$lang["nag_svPerfDataFile"] = "Service Performance Data File";
+$lang["nag_hostPerfDataFileTmp"] = "Host Performance Data File Template";
+$lang["nag_svPerfDataFileTmp"] = "Service Performance Data File Template";
+$lang["nag_hostPerfDataFileMode"] = "Host Performance Data File Mode";
+$lang["nag_svPerfDataFileMode"] = "Service Performance Data File Mode";
+$lang["nag_hostPerfDataFileProcInt"] = "Host Performance Data File Processing Interval";
+$lang["nag_svPerfDataFileProcInt"] = "Service Performance Data File Processing Interval";
+$lang["nag_hostPerfDataFileProcCmd"] = "Host Performance Data File Processing Command";
+$lang["nag_svPerfDataFileProcCmd"] = "Service Performance Data File Processing Command";
+
+$lang["nag_OrpSvCheckOpt"] = "Orphaned Service Check Option";
+
+$lang["nag_svFreshCheckOpt"] = "Service Freshness Checking Option";
+$lang["nag_svFreshCheckInt"] = "Service Freshness Check Interval";
+$lang["nag_freshCheckInt"] = "Freshness Check Interval";
+$lang["nag_hostFreshCheckOpt"] = "Host Freshness Checking Option";
+$lang["nag_hostFreshCheckInt"] = "Host Freshness Check Interval";
+
+$lang["nag_dateFormat"] = "Date Format";
+
+$lang["nag_illObjNameChar"] = "Illegal Object Name Characters";
+$lang["nag_illMacOutChar"] = "Illegal Macro Output Characters";
+
+$lang["nag_regExpMatchOpt"] = "Regular Expression Matching Option";
+$lang["nag_trueRegExpMatchOpt"] = "True Regular Expression Matching Option";
+
+$lang["nag_adminEmail"] = "Administrator Email Address";
+$lang["nag_adminPager"] = "Administrator Pager";
+
+/* Resource CFG */
+$lang['rs_add'] = "Add a Resource";
+$lang['rs_change'] = "Modify a Resource";
+$lang['rs_view'] = "View Resource";
+$lang['rs_infos'] = "General Informations";
+$lang['rs_name'] = "Resource Name";
+$lang['rs_line'] = "MACRO Expression";
+
+/* Perfparse CFG */
+$lang['pp_add'] = "Add a Perfparse Configuration File";
+$lang['pp_change'] = "Modify a Perfparse Configuration File";
+$lang['pp_view'] = "View a Perfparse Configuration File";
+$lang['pp_infos'] = "General Informations";
+$lang['pp_name'] = "Perfparse File Name";
+$lang['pp_comment'] = "Comments";
+$lang['pp_sMan'] = "Server Management";
+$lang['pp_serPort'] = "Server Port";
+$lang['pp_pMan'] = "Parser Management";
+$lang['pp_perfDLF'] = "Performance Data Log Files ('-' for stdin)";
+$lang['pp_serLog'] = "Service Log";
+$lang['pp_svLPMP'] = "Service Log Position Mark Path";
+$lang['pp_errHandling'] = "Error handling";
+$lang['pp_errLog'] = "Error Log File";
+$lang['pp_errLogRot'] = "Error Log Rotate";
+$lang['pp_errLKND'] = "Error Log Keep N Days";
+$lang['pp_dropFile'] = "Drop File";
+$lang['pp_dropFileRot'] = "Drop File Rotate";
+$lang['pp_dropFKND'] = "Drop File Keep N Days";
+$lang['pp_lockFileTxt'] = "Lock file for only one perfparse running at the same time";
+$lang['pp_lockFile'] = "Lock File";
+$lang['pp_reportOpt'] = "Reporting Options";
+$lang['pp_showSB'] = "Show Status Bar";
+$lang['pp_doReport'] = "Do_Report";
+$lang['pp_cgiMan'] = "CGI Management";
+$lang['pp_defUPP'] = "Default user permissions Policy";
+$lang['pp_defUPHG'] = "Default user permissions Hostgroups";
+$lang['pp_defUPS'] = "Default user permissions Summary";
+$lang['pp_outLog'] = "Output Logger";
+$lang['pp_outLogFile'] = "Output Log File";
+$lang['pp_outLogFileName'] = "Output Log Filename";
+$lang['pp_outLogRot'] = "Output Log Rotate";
+$lang['pp_outLKND'] = "Output Log Keep N Days";
+$lang['pp_SockOutMan'] = "Socket_output managment";
+$lang['pp_useStoSockOut'] = "Use Storage Socket Output";
+$lang['pp_stoSockOutHName'] = "Storage Socket Output Host Name";
+$lang['pp_stoSockOutPort'] = "Storage Socket Output Port";
+$lang['pp_dbMan'] = "Database managment";
+$lang['pp_useStorMySQL'] = "Use Storage Mysql";
+$lang['pp_noRawData'] = "No Raw Data";
+$lang['pp_noBinData'] = "No Bin Data";
+$lang['pp_dbUser'] = "DB User";
+$lang['pp_dbName'] = "DB Name";
+$lang['pp_dbPass'] = "DP Pass";
+$lang['pp_dbHost'] = "DB_Host";
+$lang['pp_dumHN'] = "Dummy Hostname";
+$lang['pp_stoModLoad'] = "Storage Modules Load";
+
+/* CGI cfg */
+$lang['cgi_name'] = "CGI File Name";
+$lang['cgi_comment'] = "Comments";
+$lang['cgi_add'] = "Add a CGI Configuration File";
+$lang['cgi_change'] = "Modify a CGI Configuration File";
+$lang['cgi_view'] = "View a CGI Configuration File";
+$lang['cgi_infos'] = "General Informations";
+$lang["cgi_mainConfFile"] = "Main Configuration File Location";
+$lang["cgi_phyHtmlPath"] = "Physical HTML Path";
+$lang["cgi_urlHtmlPath"] = "URL HTML Path";
+$lang["cgi_nagCheckCmd"] = "Nagios Process Check Command";
+$lang["cgi_authUsage"] = "Authentication Usage";
+$lang["cgi_defUserName"] = "Default User Name";
+$lang["cgi_authFSysInfo"] = "System/Process Information Access";
+$lang["cgi_authFSysCmd"] = "System/Process Command Access";
+$lang["cgi_authFConfInf"] = "Configuration Information Access";
+$lang["cgi_authFAllHosts"] = "Global Host Information Access";
+$lang["cgi_authFAllHostCmds"] = "Global Host Command Access";
+$lang["cgi_authFAllSv"] = "Global Service Information Access";
+$lang["cgi_authFAllSvCmds"] = "Global Service Command Access";
+$lang["cgi_smBckImg"] = "Statusmap CGI Background Image";
+$lang["cgi_defSMLayMet"] = "Default Statusmap Layout Method";
+$lang["cgi_statCGIIncWld"] = "Statuswrl CGI Include World";
+$lang["cgi_defStatWRLLay"] = "Default Statuswrl Layout Method";
+$lang["cgi_cgIRefRate"] = "CGI Refresh Rate";
+$lang["cgi_hus"] = "Host Unreachable Sound";
+$lang["cgi_hdu"] = "Host Down Sound";
+$lang["cgi_scs"] = "Service Critical Sound";
+$lang["cgi_sws"] = "Service Warning Sound";
+$lang["cgi_sus"] = "Service Unknown Sound";
+$lang["cgi_pingSyntax"] = "Ping Syntax";
+
+/* Generate File */
+$lang["gen_name"] = "Nagios Configuration Files Export";
+$lang["gen_infos"] = "Serveur implied";
+$lang["gen_host"] = "Nagios/Oreon Server";
+$lang["gen_opt"] = "Export Options";
+$lang["gen_ok"] = "Generate Files";
+$lang["gen_level"] = "Relations between Elements";
+$lang["gen_level1"] = "Dependencies Management";
+$lang["gen_level2"] = "Current Activation";
+$lang["gen_level3"] = "None";
+$lang["gen_comment"] = "Include Comments";
+$lang["gen_xml"] = "Export in XML too";
+$lang["gen_result"] = "Result";
+$lang["gen_debug"] = "Run Nagios debug (-v)";
+$lang["gen_move"] = "Move Export Files";
+$lang["gen_restart"] = "Restart Nagios";
+$lang["gen_butOK"] = "Export";
+$lang["gen_status"] = "State";
+$lang['gen_mvOk'] = " - movement OK";
+$lang['gen_mvKo'] = " - movement KO";
+
+/* Upload File */
+
+$lang["upl_name"] = "Nagios Configuration Upload";
+$lang["upl_infos"] = "Serveur implied";
+$lang["upl_host"] = "Nagios/Oreon Server";
+$lang["upl_opt"] = "Upload Options";
+$lang["upl_del"] = "Delete all configuration for kind of files choose";
+$lang["upl_over"] = "Update definition in same dual definition";
+$lang["upl_comment"] = "Include comments";
+$lang["upl_type"] = "File Type";
+$lang["upl_mis1"] = "For archive upload, be sure that the first line of each file have no importance because it's doesn't manage.<br>Avoid to begin with a definition.";
+$lang["upl_typeNag"] = "nagios.cfg";
+$lang["upl_typeCgi"] = "cgi.cfg";
+$lang["upl_typePerfparse"] = "perfparse.cfg";
+$lang["upl_typeRes"] = "resource.cfg";
+$lang["upl_typeCfg"] = "Template based method file";
+$lang["upl_typeManual"] = "Manual Filling";
+$lang["upl_format"] = "File Type";
+$lang["upl_typeName"] = "Type";
+$lang["upl_typeCmdType"] = "Command Type";
+$lang["upl_typeCmdCheck"] = "Check Command";
+$lang["upl_typeCmdNotif"] = "Notification Command";
+$lang["upl_typeCmdCmt1"] = "You should upload before all the Commands definitions while specifying their type.";
+$lang["upl_typeCmdCmt2"] = "Indeed, it's the only way to make difference between Check or Notification Commands.";
+$lang["upl_file"] = "File (zip, tar or cfg)";
+$lang["upl_manualDef"] = "Manual Filling";
+$lang["upl_result"] = "Result";
+$lang["upl_debug"] = "Run Nagios debug (-v)";
+$lang["upl_butOK"] = "Load";
+$lang["upl_uplOk"] = "File loading OK";
+$lang["upl_uplKo"] = "File loading KO";
+$lang["upl_carrOk"] = "Data recovery OK";
+$lang["upl_carrKo"] = "Data recovery KO";
+$lang["upl_manualDefOk"] = "Manual filling OK";
+$lang["upl_uplBadType"] = "Not supported extension";
+$lang["upl_newEntries"] = "recorded entrie(s)";
+?>
+<?
+/* Configuration Error */
+
+$lang['requiredFields'] = "<font style='color: red;'>*</font> Champs requis";
+$lang['ErrName'] = "Compulsory Name";
+$lang['ErrAlias'] = "Compulsory Alias";
+$lang['ErrEmail'] = "Valid Email";
+$lang['ErrOpt'] = "Compulsory Option";
+$lang['ErrTp'] = "Compulsory Period";
+$lang['ErrCmd'] = "Compulsory Command";
+$lang['ErrCct'] = "Compulsory Contact";
+$lang['ErrCg'] = "Compulsory Contact Group";
+$lang['ErrCmdLine'] = "Compulsory Command Line";
+$lang['ErrCmdType'] = "Compulsory  Command Type";
+$lang['ErrAlreadyExist'] = "A same Name element already exist";
+$lang['ErrAddress'] = "Compulsory Adress";
+$lang['ErrRequired'] = "Require Field";
+$lang['ErrSvLeast'] = "HostGroup or Host Require";
+$lang['ErrCctPasswd'] = "Passwords are not the same";
+$lang['ErrGenFileProb'] = "Can't access to file needed";
+$lang['ErrCycleDef'] = "Circular Definition";
+
+/* Configuration Menu */
+
+$lang['quicksearch'] = "Quick Search";
+$lang['available'] = "Available";
+$lang['selected'] = "Selected";
+$lang['further_infos'] = "Additional Information";
+$lang['comment'] = "Comments";
+$lang['nothing'] = "Empty";
+$lang['formObjMatch'] = "Impacted Elements : ";
+$lang['action'] = "Post Validation";
+$lang['actionList'] = "List";
+$lang['actionForm'] = "Form";
+$lang['legend1'] = "(*) This Service is used by many Host";
+$lang['previous'] = "previous";
+$lang['next'] = "next";
+
+/* host */
+
+$lang['h'] = "Host";
+$lang['h_conf'] = "Host Configuration";
+$lang['h_add'] = "Add a Host";
+$lang['h_change'] = "Modify a Host";
+$lang['h_view'] = "View a Host";
+
+$lang['h_extInf'] = "Host Extended Infos";
+$lang["h_ExtInf_add"] = "Add an Host Extended Info";
+$lang["h_ExtInf_change"] = "Modify an Host Extended Info";
+$lang["h_ExtInf_view"] = "View an Host Extended Info";
+
+$lang['h_childs'] = "Linked Services";
+$lang['h_parent'] = "Template parent";
+
+$lang['h_infos'] = "General Informations";
+$lang['h_name'] = "Host Name";
+$lang['h_alias'] = "Alias";
+$lang['h_address'] = "Adress";
+$lang['h_snmpCom'] = "SNMP Community";
+$lang['h_snmpVer'] = "Version";
+$lang['h_template'] = "Host Template";
+$lang['h_templateText'] = "Use a Template exempt you to fill require fields";
+$lang['h_dupSvTplAssocText'] = "Create Services linked to the Template too";
+
+$lang['h_head_links'] = "Relations";
+$lang["h_Links_add"] = "Add relations";
+$lang["h_Links_change"] = "Modify relations";
+$lang["h_Links_view"] = "View relations";
+$lang['h_HostGroupMembers'] = "HostGroups Parents";
+$lang['h_HostParents'] = "Hosts Parents";
+$lang['h_HostChilds'] = "Hosts Childs";
+
+$lang['h_head_state'] = "Host state";
+$lang['h_checkCmd'] = "Check Command";
+$lang['h_checkMca'] = "Max Check Attempts";
+$lang['h_checkInterval'] = "Normal Check Interval";
+$lang['h_checksEnabled'] = "Checks Enabled";
+$lang['h_checkPeriod'] = "Check Period";
+$lang['h_activeCE'] = "Active Checks Enabled";
+$lang['h_passiveCE'] = "Passive Checks Enabled";
+$lang['h_eventHandlerE'] = "Event Handler Enabled";
+$lang['h_eventHandler'] = "Event Handler";
+
+$lang['h_head_treat'] = "Data Treatment";
+$lang['h_add_treat'] = "Add Data Treatment";
+$lang['h_modify_treat'] = "Modify Data Treatment";
+$lang['h_view_treat'] = "View Data Treatment";
+
+
+
+$lang['h_ObsessOH'] = "Obsess Over Host";
+$lang['h_checkFreshness'] = "Check Freshness";
+$lang['h_FreshnessThreshold'] = "Freshness Threshold";
+$lang['h_flapDetect'] = "Flap Detection Enabled";
+$lang['h_lowFT'] = "Low Flap threshold";
+$lang['h_highFT'] = "High Flap Threshold";
+$lang['h_processPD'] = "Process Perf Data";
+$lang['h_retainSI'] = "Retain Satatus Information";
+$lang['h_retainNI'] = "Retain Non Status Information";
+
+$lang['h_head_notif'] = "Notification";
+$lang['h_CgMembers'] = "ContactGroups Linked";
+$lang['h_notifInt'] = "Notification Interval";
+$lang['h_notifTp'] = "Notification Period";
+$lang['h_notifOpts'] = "Notification Options";
+$lang['h_notifEnabled'] = "Notification Enabled";
+$lang['h_stalOpts'] = "Stalking Options";
+
+$lang['h_nagios'] = "Nagios";
+$lang['h_notes'] = "Note";
+$lang['h_notesUrl'] = "URL";
+$lang['h_actionUrl'] = "Action URL";
+$lang['h_iconImg'] = "Icon";
+$lang['h_iconImgAlt'] = "Alt icon";
+$lang['h_vrmlImg'] = "VRML Image";
+$lang['h_nagStatImg'] = "Nagios Statuts Map Image";
+$lang['h_nag2dCoords'] = "Nagios 2d Coords";
+$lang['h_nag3dCoords'] = "Nagios 3d Coords";
+
+$lang['h_oreon'] = "Oreon";
+$lang['h_country'] = "Country";
+$lang['h_city'] = "City";
+$lang['h_popCityTitle'] = "Choose a country";
+$lang['h_popCityAlpha'] = "Alphabetic Sort";
+
+/* host group */
+
+$lang['hg'] = "HostGroup";
+$lang['hg_name'] = "HostGroup Name";
+$lang['hg_alias'] = "Alias";
+$lang['hg_add'] = "Add a HostGroup";
+$lang['hg_change'] = "Modify a HostGroup";
+$lang['hg_view'] = "View a HostGroup";
+$lang['hg_CgMembers'] = "ContactGroups linked";
+$lang['hg_HostMembers'] = "Hosts linked";
+$lang['hg_infos'] = "General Informations";
+$lang['hg_links'] = "Relations";
+$lang['hg_notif'] = "Notification";
+
+/* Escalation  */
+
+$lang['esc'] = "Escalation";
+$lang['esc_name'] = "Escalation Name";
+$lang['esc_add'] = "Add an Escalation";
+$lang['esc_change'] = "Modify an Escalation";
+$lang['esc_view'] = "View an Escalation";
+$lang['esc_infos'] = "Informations";
+$lang['esc_sort2'] = "Hosts Escalation";
+$lang['esc_sort3'] = "Services Escalation";
+$lang['esc_sort4'] = "Hostgroups Escalation";
+$lang['esc_sort5'] = "Meta Services Escalation";
+$lang["esc_firstNotif"] = "First Notification";
+$lang["esc_lastNotif"] = "Last Notification";
+$lang["esc_notifInt"] = "Notification Interval";
+$lang["esc_escPeriod"] = "Escalation Period";
+$lang["esc_hOpt"] = "Hosts Escalation Options";
+$lang["esc_sOpt"] = "Services Escalation Options";
+$lang["esc_comment"] = "Comment";
+$lang['esc_appCG'] = "implied Contact Groups";
+$lang['esc_sortHosts'] = "Implied Hosts";
+$lang['esc_sortSv'] = "Implied Services";
+$lang['esc_sortHg'] = "Implied HostGroups";
+$lang['esc_sortMs'] = "Implied Meta Services";
+$lang['esc_hostServiceMembers'] = "Services by Hosts";
+$lang['esc_hostGroupServiceMembers'] = "Services by Host Groups";
+
+/* Dependencies */
+
+$lang['dep'] = "Dependencies";
+$lang['dep_add'] = "Add a Dependency";
+$lang['dep_change'] = "Modify a Dependency";
+$lang['dep_view'] = "View a Dependency";
+$lang['dep_infos'] = "Informations";
+$lang["dep_inheritsP"] = "Parent relationship";
+$lang["dep_exeFC"] = "Execution Failure Criteria";
+$lang["dep_notifFC"] = "Notification Failure Criteria";
+$lang["dep_comment"] = "Comment";
+$lang['dep_hPar'] = "Hosts Name";
+$lang['dep_hChi'] = "Dependent Hosts Name";
+$lang['dep_hgPar'] = "HostGroups Name";
+$lang['dep_hgChi'] = "Dependent HostGroups Name";
+$lang['dep_hSvPar'] = "Hosts Services Description";
+$lang['dep_hSvChi'] = "Dependent Hosts Services Description";
+$lang['dep_hgSvPar'] = "HostGroups Services Description";
+$lang['dep_hgSvChi'] = "Dependent HostGroups Services Description";
+$lang['dep_sgPar'] = "ServiceGroups Name";
+$lang['dep_sgChi'] = "Dependent ServiceGroups Name";
+$lang['dep_msPar'] = "Meta Services Name";
+$lang['dep_msChi'] = "Dependent Meta Services Name";
+$lang['dep_name'] = "Name";
+$lang['dep_description'] = "Description";
+$lang['dep_sort2'] = "Host Service Description";
+$lang['dep_sort3'] = "Dependent HostGroup Service Description";
+
+/* host template model */
+
+$lang['htm'] = "Host Template Model";
+$lang['htm_childs'] = "Services Template linked";
+$lang['htm_parent'] = "Template parent";
+$lang['htm_add'] = "Add a Host Template Model";
+$lang['htm_change'] = "Modify a Host Template Model";
+$lang['htm_view'] = "View a Host Template Model";
+$lang['htm_template'] = "Host Model Template";
+$lang['htm_templateText'] = "Use a Template Model allow you to have multi level Template relationship";
+
+/* service */
+
+$lang['sv'] = "Service";
+$lang['sv_conf'] = "Service Configuration";
+$lang['sv_add'] = "Add a Service";
+$lang['sv_change'] = "Modify a Service";
+$lang['sv_view'] = "View a Service";
+$lang['sv_parent'] = "Template parent";
+
+$lang['sv_infos'] = "General Informations";
+$lang['sv_hPars'] = "Linked with Hosts";
+$lang['sv_hgPars'] = "Linked with HostGroups";
+$lang['sv_description'] = "Description";
+$lang['sv_template'] = "Service Template";
+$lang['sv_templateText'] = "Use a Template exempt you to fill require fields";
+
+$lang['sv_head_links'] = "Relations";
+$lang["sv_Links_add"] = "Add relations";
+$lang["sv_Links_change"] = "Modify relations";
+$lang["sv_Links_view"] = "View relations";
+$lang['sv_ServiceGroupMembers'] = "ServiceGroups parents";
+
+$lang['sv_head_state'] = "Service State";
+$lang['sv_isVolatile'] = "Is Volatile";
+$lang['sv_checkCmd'] = "Check Command";
+$lang['sv_checkMca'] = "Max Check Attempts";
+$lang['sv_normalCheckInterval'] = "Normal Check Interval";
+$lang['sv_retryCheckInterval'] = "Retry Check Interval";
+$lang['sv_checkPeriod'] = "Check Period";
+$lang['sv_activeCE'] = "Active Checks Enabled";
+$lang['sv_passiveCE'] = "Passive Checks Enabled";
+$lang['sv_eventHandlerE'] = "Event Handler Enabled";
+$lang['sv_eventHandler'] = "Event Handler";
+$lang['sv_args'] = "Args";
+
+$lang['sv_head_treat'] = "Data Treatment";
+$lang['sv_paraCheck'] = "Parallelize Check";
+$lang['sv_ObsessOS'] = "Obsess Over Service";
+$lang['sv_checkFreshness'] = "Check Freshness";
+$lang['sv_FreshnessThreshold'] = "Freshness Threshold";
+$lang['sv_flapDetect'] = "Flap Detection Enabled";
+$lang['sv_lowFT'] = "Low Flap Threshold";
+$lang['sv_highFT'] = "High Flap Threshold";
+$lang['sv_processPD'] = "Process Perf Data";
+$lang['sv_retainSI'] = "Retain Status Information";
+$lang['sv_retainNI'] = "Retain Non Status Information";
+
+$lang['sv_head_notif'] = "Notification";
+$lang['sv_CgMembers'] = "ContactGroups implied";
+$lang['sv_notifInt'] = "Notification Interval";
+$lang['sv_notifTp'] = "Notification Period";
+$lang['sv_notifOpts'] = "Notification Type";
+$lang['sv_notifEnabled'] = "Notification Enabled";
+$lang['sv_stalOpts'] = "Stalking Options";
+
+/* Meta Service */
+
+$lang['ms'] = "Meta Service";
+$lang['ms_conf'] = "Configuration";
+$lang['ms_infos'] = "General Informations";
+$lang["ms_add"] = "Add a Meta Service";
+$lang["ms_change"] = "Modify a Meta Service";
+$lang["ms_view"] = "View a Meta Service";
+$lang['ms_name'] = "Meta Service Name";
+$lang['ms_comment'] = "Comment";
+$lang['ms_levelw'] = "Warning Level";
+$lang['ms_levelc'] = "Critical Level";
+$lang['ms_calType'] = "Calcul Type";
+$lang['ms_selSum'] = "Sum";
+$lang['ms_selAvr'] = "Average";
+$lang['ms_selMin'] = "Min";
+$lang['ms_selMax'] = "Max";
+$lang['ms_selMod'] = "Selection Mode";
+$lang['ms_selList'] = "Services List";
+$lang['ms_regexp'] = "Regular Expression";
+$lang['ms_exp'] = "Expression";
+$lang['ms_metric'] = "Metric";
+
+$lang['ms_head_state'] = "Meta Service State";
+$lang['ms_checkMca'] = "Max Check Attempts";
+$lang['ms_normalCheckInterval'] = "Normal Check Interval";
+$lang['ms_retryCheckInterval'] = "Retry Check Interval";
+$lang['ms_checkPeriod'] = "Check Period";
+
+$lang['ms_head_notif'] = "Notification";
+$lang['ms_CgMembers'] = "ContactGroups linked";
+$lang['ms_notifInt'] = "Notification Interval";
+$lang['ms_notifTp'] = "Notification Period";
+$lang['ms_notifOpts'] = "Notification Type";
+$lang['ms_notifEnabled'] = "Notification Enabled";
+
+$lang['mss_add'] = "Add a Service";
+$lang['mss_change'] = "Modify a Service";
+$lang['mss_view'] = "View a Service";
+
+/* extended service infos */
+
+$lang['esi'] = "Extended Service Information";
+$lang['esi_available'] = "Extended Service Information Available ";
+$lang['esi_notes'] = "Notes";
+$lang['esi_notes_url'] = "Notes url";
+$lang['esi_action_url'] = "Action url";
+$lang['esi_icon_image'] = "Icon";
+$lang['esi_icon_image_alt'] = "Icon alt";
+
+/* service template model*/
+
+$lang['stm'] = "Service Template Model";
+$lang['stm_parent'] = "Template parent";
+$lang['stm_add'] = "Add a Service Template Model";
+$lang['stm_change'] = "Modify a Service Template Model";
+$lang['stm_view'] = "View a Service Template Model";
+$lang['stm_template'] = "Template Service Model";
+$lang['stm_templateText'] = "Use a Template Model allow you to have multi level Template relationship";
+
+/* service group*/
+
+$lang['sg'] = "ServiceGroup";
+$lang['sg_name'] = "ServiceGroup Name";
+$lang['sg_alias'] = "Alias";
+$lang['sg_add'] = "Add a ServiceGroup";
+$lang['sg_change'] = "Modify a ServiceGroup";
+$lang['sg_view'] = "View a ServiceGroup";
+$lang['sg_hostServiceMembers'] = "Host Services linked";
+$lang['sg_hostGroupServiceMembers'] = "Host Group Services linked";
+$lang['sg_infos'] = "General Informations";
+$lang['sg_links'] = "Relations";
+$lang['sg_notif'] = "Notification";
+
+/* contact */
+
+$lang['cct_add'] = "Add an User";
+$lang['cct_change'] = "Modify an User";
+$lang['cct_view'] = "View an User";
+$lang['cct_infos'] = "General Informations";
+$lang['cct_notif'] = "Notifications Type";
+$lang['cct_name'] = "Full Name";
+$lang['cct_mail'] = "Email";
+$lang['cct_mailType'] = "Mail Type";
+$lang['cct_pager'] = "Pager";
+$lang['cct_hostNotifOpt'] = "Hosts Notification Options";
+$lang['cct_hostNotifTp'] = "Hosts Notification Period";
+$lang['cct_hostNotifCmd'] = "Hosts Notification Commands";
+$lang['cct_svNotifOpt'] = "Services Notification Options";
+$lang['cct_svNotifTp'] = "Services Notification Period";
+$lang['cct_svNotifCmd'] = "Services Notification Commands";
+$lang['cct_cgNotif'] = "Contact Groups parents";
+$lang['cct_passwd'] = "Password";
+$lang['cct_passwd2'] = "Confirmation";
+$lang['cct_lang'] = "Default Lang";
+$lang['cct_oreon'] = "Oreon";
+$lang['cct_oreon_text'] = "Access to Oreon Frontend";
+$lang['cct_admin'] = "Admin";
+
+/* contact group */
+
+$lang['cg_infos'] = "General Informations";
+$lang['cg_name'] = "Contact Group Name";
+$lang['cg_alias'] = "Alias";
+$lang['cg_members'] = "Contacts linked";
+$lang['cg_notif'] = "Notification";
+$lang["cg_add"] = "Add a Contact Group";
+$lang["cg_change"] = "Modify a Contact Group";
+$lang["cg_view"] = "View a Contact Group";
+
+/* time period */
+
+$lang['tp_name'] = "Time Period Name";
+$lang['tp_alias'] = "Alias";
+$lang['tp_sunday'] = "Sunday";
+$lang['tp_monday'] = "Monday";
+$lang['tp_tuesday'] = "Tuesday";
+$lang['tp_wednesday'] = "Wednesday";
+$lang['tp_thursday'] = "Thursday";
+$lang['tp_friday'] = "Friday";
+$lang['tp_saturday'] = "Saturday";
+$lang['tp_infos'] = "General Informations";
+$lang['tp_notif'] = "Notification Slice Time";
+$lang["tp_add"] = "Add a Time Period";
+$lang["tp_change"] = "Modify a Time Period";
+$lang["tp_view"] = "View a Time Period";
+
+/* command */
+
+$lang['cmd_type'] = "Command Type";
+$lang['cmd_infos'] = "Informations";
+$lang['cmd_check'] = "Check Command";
+$lang['cmd_notif'] = "Notification Command";
+$lang['cmd_checkShort'] = "Check";
+$lang['cmd_notifShort'] = "Notification";
+$lang["cmd_add"] = "Add a Command";
+$lang["cmd_change"] = "Modify a Command";
+$lang["cmd_view"] = "View a Command";
+$lang['cmd_name'] = "Command Name";
+$lang['cmd_line'] = "Command Line";
+$lang['cmd_type'] = "Command Type";
+$lang['cmd_comment'] = "Commands definitions can contain Macros but you have to be sure that they are well validate for the case they'll be used";
+$lang['cmd_help'] = "Plugin Help";
+$lang['cmd_help_output'] = "Help";
+$lang['cmd_output'] = "Output";
+$lang['cmd_example'] = "Argument Example";
+
+/* Nagios CFG */
+
+$lang["nagios_add"] = "Add a Nagios Configuration File";
+$lang["nagios_change"] = "Modify a Nagios Configuration File";
+$lang["nagios_view"] = "View a Nagios Configuration File";
+$lang['nagios_infos'] = "Informations";
+$lang["nagios_name"] = "Configuration Name";
+$lang["nagios_comment"] = "Comments";
+
+$lang["nag_logFile"] = "Log file";
+$lang["nag_objConfFile"] = "Object Configuration File";
+$lang["nag_objConfDir"] = "Object Configuration Directory";
+$lang["nag_objCacheFile"] = "Object Cache File";
+$lang["nag_resFile"] = "Resource File";
+$lang["nag_tmpFile"] = "Temp File";
+$lang["nag_p1File"] = "P1 File";
+
+$lang["nag_statusFile"] = "Status File";
+$lang["nag_asuOpt"] = "Aggregated Status Updates Option";
+$lang["nag_asuInt"] = "Aggregated Status Data Update Interval";
+
+$lang["nag_nagUser"] = "Nagios User";
+$lang["nag_nagGroup"] = "Nagios Group";
+
+$lang["nag_notifOpt"] = "Notification Option";
+$lang["nag_svCheckExeOpt"] = "Service Check Execution Option";
+$lang["nag_pasSvCheckAccOpt"] = "Passive Service Check Acceptance Option";
+$lang["nag_hostCheckExeOpt"] = "Host Check Execution Option";
+$lang["nag_pasHostCheckAccOpt"] = "Passive Host Check Acceptance Option";
+$lang["nag_eventHandOpt"] = "Event Handler Option";
+
+$lang["nag_logRotMethod"] = "Log Rotation Method";
+$lang["nag_logArchPath"] = "Log Archive Path";
+
+$lang["nag_extCmdCheckOpt"] = "External Command Check Option";
+$lang["nag_extCmdCheckInt"] = "External Command Check Interval";
+$lang["nag_extCmdFile"] = "External Command File";
+
+$lang["nag_cmtFile"] = "Comment File";
+$lang["nag_dtFile"] = "Downtime File";
+$lang["nag_lockFile"] = "Lock File";
+
+$lang["nag_stateRetOpt"] = "State Retention Option";
+$lang["nag_stateRetFile"] = "State Retention File";
+$lang["nag_autStateRetUpdInt"] = "Automatic State Retention Update Interval";
+$lang["nag_useRetPgmStateOpt"] = "Use Retained Program State Option";
+$lang["nag_useRetSchInfoOpt"] = "Use Retained Scheduling Info Option";
+
+$lang["nag_SysLogOpt"] = "Syslog Logging Option";
+$lang["nag_notLogOpt"] = "Notification Logging Option";
+$lang["nag_svCheckRtrLogOpt"] = "Service Check Retry Logging Option";
+$lang["nag_hostRtrLogOpt"] = "Host Retry Logging Option";
+$lang["nag_eventHandLogOpt"] = "Event Handler Logging Option";
+$lang["nag_iniStateLogOpt"] = "Initial State Logging Option";
+$lang["nag_extCmdLogOpt"] = "External Command Logging Option";
+$lang["nag_passSvCheckLogOpt"] = "Passive Service Check Logging Option";
+$lang["nag_passCheckLogOpt"] = "Passive Check Logging Option";
+
+$lang["nag_glHostEventHand"] = "Global Host Event Handler";
+$lang["nag_glSvEventHand"] = "Global Service Event Handler";
+
+$lang["nag_intCheckSleepTm"] = "Inter-Check Sleep Time";
+$lang["nag_intCheckDelMth"] = "Inter-Check Delay Method";
+$lang["nag_svIntCheckDelMth"] = "Service Inter-Check Delay Method";
+$lang["nag_maxSvCheckSpread"] = "Maximum Service Check Spread";
+$lang["nag_svInterFac"] = "Service Interleave Factor";
+$lang["nag_maxConcSvChecks"] = "Maximum Concurrent Service Checks";
+$lang["nag_svReapFreq"] = "Service Repear Frequency";
+$lang["nag_hostIntCheckDelMth"] = "Host Inter-Check Delay Method";
+$lang["nag_maxHostCheckSpread"] = "Maximum Host Check Spread";
+$lang["nag_tmIntLen"] = "Timing Interval Length";
+$lang["nag_autoRescheOpt"] = "Auto-Rescheduling Option";
+$lang["nag_autoRescheInt"] = "Auto-Rescheduling Interval";
+$lang["nag_autoRescheWnd"] = "Auto-Rescheduling Window";
+
+$lang["nag_aggHostCheckOpt"] = "Aggressive Host Checking Option";
+
+$lang["nag_flapDetOpt"] = "Flap Detection Option";
+$lang["nag_lowSvFlapThres"] = "Low Service Flap Threshold";
+$lang["nag_highSvFlapThres"] = "High Service Flap Threshold";
+$lang["nag_lowHostFlapThres"] = "Low Host Flap Threshold";
+$lang["nag_highHostFlapThres"] = "High Host Flap Threshold";
+
+$lang["nag_softSvDepOpt"] = "Soft Service Dependencies Option";
+
+$lang["nag_svCheckTmOut"] = "Service Check Timeout";
+$lang["nag_hostCheckTmOut"] = "Host Check Timeout";
+$lang["nag_eventHandTmOut"] = "Event Handler Timeout";
+$lang["nag_notifTmOut"] = "Notification Timeout";
+$lang["nag_obComSvProcTmOut"] = "Obsessive Compulsive Service Processor Timeout";
+$lang["nag_obComHostProcTmOut"] = "Obsessive Compulsive Host Processor Timeout";
+$lang["nag_perfDataProcCmdTmOut"] = "Performance Data Processor Command Timeout";
+
+$lang["nag_obsOverSvOpt"] = "Obsess Over Services Option";
+$lang["nag_obsComSvProcCmd"] = "Obsessive Compulsive Service Processor Command";
+$lang["nag_obsOverHostOpt"] = "Obsess Over Hosts Option";
+$lang["nag_obsComHostProcCmd"] = "Obsessive Compulsive Host Processor Command";
+
+$lang["nag_perfDataProcOpt"] = "Performance Data Processing Option";
+$lang["nag_hostPerfDataProcCmd"] = "Host Performance Data Processing Command";
+$lang["nag_svPerfDataProcCmd"] = "Service Performance Data Processing Command";
+$lang["nag_hostPerfDataFile"] = "Host Performance Data File";
+$lang["nag_svPerfDataFile"] = "Service Performance Data File";
+$lang["nag_hostPerfDataFileTmp"] = "Host Performance Data File Template";
+$lang["nag_svPerfDataFileTmp"] = "Service Performance Data File Template";
+$lang["nag_hostPerfDataFileMode"] = "Host Performance Data File Mode";
+$lang["nag_svPerfDataFileMode"] = "Service Performance Data File Mode";
+$lang["nag_hostPerfDataFileProcInt"] = "Host Performance Data File Processing Interval";
+$lang["nag_svPerfDataFileProcInt"] = "Service Performance Data File Processing Interval";
+$lang["nag_hostPerfDataFileProcCmd"] = "Host Performance Data File Processing Command";
+$lang["nag_svPerfDataFileProcCmd"] = "Service Performance Data File Processing Command";
+
+$lang["nag_OrpSvCheckOpt"] = "Orphaned Service Check Option";
+
+$lang["nag_svFreshCheckOpt"] = "Service Freshness Checking Option";
+$lang["nag_svFreshCheckInt"] = "Service Freshness Check Interval";
+$lang["nag_freshCheckInt"] = "Freshness Check Interval";
+$lang["nag_hostFreshCheckOpt"] = "Host Freshness Checking Option";
+$lang["nag_hostFreshCheckInt"] = "Host Freshness Check Interval";
+
+$lang["nag_dateFormat"] = "Date Format";
+
+$lang["nag_illObjNameChar"] = "Illegal Object Name Characters";
+$lang["nag_illMacOutChar"] = "Illegal Macro Output Characters";
+
+$lang["nag_regExpMatchOpt"] = "Regular Expression Matching Option";
+$lang["nag_trueRegExpMatchOpt"] = "True Regular Expression Matching Option";
+
+$lang["nag_adminEmail"] = "Administrator Email Address";
+$lang["nag_adminPager"] = "Administrator Pager";
+
+/* Resource CFG */
+$lang['rs_add'] = "Add a Resource";
+$lang['rs_change'] = "Modify a Resource";
+$lang['rs_view'] = "View Resource";
+$lang['rs_infos'] = "General Informations";
+$lang['rs_name'] = "Resource Name";
+$lang['rs_line'] = "MACRO Expression";
+
+/* Perfparse CFG */
+$lang['pp_add'] = "Add a Perfparse Configuration File";
+$lang['pp_change'] = "Modify a Perfparse Configuration File";
+$lang['pp_view'] = "View a Perfparse Configuration File";
+$lang['pp_infos'] = "General Informations";
+$lang['pp_name'] = "Perfparse File Name";
+$lang['pp_comment'] = "Comments";
+$lang['pp_sMan'] = "Server Management";
+$lang['pp_serPort'] = "Server Port";
+$lang['pp_pMan'] = "Parser Management";
+$lang['pp_perfDLF'] = "Performance Data Log Files ('-' for stdin)";
+$lang['pp_serLog'] = "Service Log";
+$lang['pp_svLPMP'] = "Service Log Position Mark Path";
+$lang['pp_errHandling'] = "Error handling";
+$lang['pp_errLog'] = "Error Log File";
+$lang['pp_errLogRot'] = "Error Log Rotate";
+$lang['pp_errLKND'] = "Error Log Keep N Days";
+$lang['pp_dropFile'] = "Drop File";
+$lang['pp_dropFileRot'] = "Drop File Rotate";
+$lang['pp_dropFKND'] = "Drop File Keep N Days";
+$lang['pp_lockFileTxt'] = "Lock file for only one perfparse running at the same time";
+$lang['pp_lockFile'] = "Lock File";
+$lang['pp_reportOpt'] = "Reporting Options";
+$lang['pp_showSB'] = "Show Status Bar";
+$lang['pp_doReport'] = "Do_Report";
+$lang['pp_cgiMan'] = "CGI Management";
+$lang['pp_defUPP'] = "Default user permissions Policy";
+$lang['pp_defUPHG'] = "Default user permissions Hostgroups";
+$lang['pp_defUPS'] = "Default user permissions Summary";
+$lang['pp_outLog'] = "Output Logger";
+$lang['pp_outLogFile'] = "Output Log File";
+$lang['pp_outLogFileName'] = "Output Log Filename";
+$lang['pp_outLogRot'] = "Output Log Rotate";
+$lang['pp_outLKND'] = "Output Log Keep N Days";
+$lang['pp_SockOutMan'] = "Socket_output managment";
+$lang['pp_useStoSockOut'] = "Use Storage Socket Output";
+$lang['pp_stoSockOutHName'] = "Storage Socket Output Host Name";
+$lang['pp_stoSockOutPort'] = "Storage Socket Output Port";
+$lang['pp_dbMan'] = "Database managment";
+$lang['pp_useStorMySQL'] = "Use Storage Mysql";
+$lang['pp_noRawData'] = "No Raw Data";
+$lang['pp_noBinData'] = "No Bin Data";
+$lang['pp_dbUser'] = "DB User";
+$lang['pp_dbName'] = "DB Name";
+$lang['pp_dbPass'] = "DP Pass";
+$lang['pp_dbHost'] = "DB_Host";
+$lang['pp_dumHN'] = "Dummy Hostname";
+$lang['pp_stoModLoad'] = "Storage Modules Load";
+
+/* CGI cfg */
+$lang['cgi_name'] = "CGI File Name";
+$lang['cgi_comment'] = "Comments";
+$lang['cgi_add'] = "Add a CGI Configuration File";
+$lang['cgi_change'] = "Modify a CGI Configuration File";
+$lang['cgi_view'] = "View a CGI Configuration File";
+$lang['cgi_infos'] = "General Informations";
+$lang["cgi_mainConfFile"] = "Main Configuration File Location";
+$lang["cgi_phyHtmlPath"] = "Physical HTML Path";
+$lang["cgi_urlHtmlPath"] = "URL HTML Path";
+$lang["cgi_nagCheckCmd"] = "Nagios Process Check Command";
+$lang["cgi_authUsage"] = "Authentication Usage";
+$lang["cgi_defUserName"] = "Default User Name";
+$lang["cgi_authFSysInfo"] = "System/Process Information Access";
+$lang["cgi_authFSysCmd"] = "System/Process Command Access";
+$lang["cgi_authFConfInf"] = "Configuration Information Access";
+$lang["cgi_authFAllHosts"] = "Global Host Information Access";
+$lang["cgi_authFAllHostCmds"] = "Global Host Command Access";
+$lang["cgi_authFAllSv"] = "Global Service Information Access";
+$lang["cgi_authFAllSvCmds"] = "Global Service Command Access";
+$lang["cgi_smBckImg"] = "Statusmap CGI Background Image";
+$lang["cgi_defSMLayMet"] = "Default Statusmap Layout Method";
+$lang["cgi_statCGIIncWld"] = "Statuswrl CGI Include World";
+$lang["cgi_defStatWRLLay"] = "Default Statuswrl Layout Method";
+$lang["cgi_cgIRefRate"] = "CGI Refresh Rate";
+$lang["cgi_hus"] = "Host Unreachable Sound";
+$lang["cgi_hdu"] = "Host Down Sound";
+$lang["cgi_scs"] = "Service Critical Sound";
+$lang["cgi_sws"] = "Service Warning Sound";
+$lang["cgi_sus"] = "Service Unknown Sound";
+$lang["cgi_pingSyntax"] = "Ping Syntax";
+
+/* Generate File */
+$lang["gen_name"] = "Nagios Configuration Files Export";
+$lang["gen_infos"] = "Serveur implied";
+$lang["gen_host"] = "Nagios/Oreon Server";
+$lang["gen_opt"] = "Export Options";
+$lang["gen_ok"] = "Generate Files";
+$lang["gen_level"] = "Relations between Elements";
+$lang["gen_level1"] = "Dependencies Management";
+$lang["gen_level2"] = "Current Activation";
+$lang["gen_level3"] = "None";
+$lang["gen_comment"] = "Include Comments";
+$lang["gen_xml"] = "Export in XML too";
+$lang["gen_result"] = "Result";
+$lang["gen_debug"] = "Run Nagios debug (-v)";
+$lang["gen_move"] = "Moove Export Files";
+$lang["gen_restart"] = "Restart Nagios";
+$lang["gen_butOK"] = "Export";
+$lang["gen_status"] = "State";
+$lang['gen_mvOk'] = " - movement OK";
+$lang['gen_mvKo'] = " - movement KO";
+$lang['gen_trapd'] = "Traps SNMP";
+$lang['gen_genTrap'] = "Export Traps";
+$lang['gen_trapRestart'] = "Restart snmptrad";
+
+/* Upload File */
+$lang["upl_name"] = "Nagios Configuration Upload";
+$lang["upl_infos"] = "Serveur implied";
+$lang["upl_host"] = "Nagios/Oreon Server";
+$lang["upl_opt"] = "Upload Options";
+$lang["upl_del"] = "Delete all configuration for kind of files choose";
+$lang["upl_over"] = "Update definition in same dual definition";
+$lang["upl_comment"] = "Include comments";
+$lang["upl_type"] = "File Type";
+$lang["upl_mis1"] = "For archive upload, be sure that the first line of each file have no importance because it's doesn't manage.<br>Avoid to begin with a definition.";
+$lang["upl_typeNag"] = "nagios.cfg";
+$lang["upl_typeCgi"] = "cgi.cfg";
+$lang["upl_typePerfparse"] = "perfparse.cfg";
+$lang["upl_typeRes"] = "resource.cfg";
+$lang["upl_typeCfg"] = "Template based method file";
+$lang["upl_typeManual"] = "Manual Filling";
+$lang["upl_format"] = "File Type";
+$lang["upl_typeName"] = "Type";
+$lang["upl_typeCmdType"] = "Command Type";
+$lang["upl_typeCmdCheck"] = "Check Command";
+$lang["upl_typeCmdNotif"] = "Notification Command";
+$lang["upl_typeCmdCmt1"] = "You should upload before all the Commands definitions while specifying their type.";
+$lang["upl_typeCmdCmt2"] = "Indeed, it's the only way to make difference between Check or Notification Commands.";
+$lang["upl_file"] = "File (zip, tar or cfg)";
+$lang["upl_manualDef"] = "Manual Filling";
+$lang["upl_result"] = "Result";
+$lang["upl_debug"] = "Run Nagios debug (-v)";
+$lang["upl_butOK"] = "Load";
+$lang["upl_uplOk"] = "File loading OK";
+$lang["upl_uplKo"] = "File loading KO";
+$lang["upl_carrOk"] = "Data recovery OK";
+$lang["upl_carrKo"] = "Data recovery KO";
+$lang["upl_manualDefOk"] = "Manual filling OK";
+$lang["upl_uplBadType"] = "Not supported extension";
+$lang["upl_newEntries"] = "recorded entrie(s)";
+
+/* Purge Policy Template */
+
+$lang["mod_purgePolicy"] = "Template Deletion Policy";
+$lang["mod_purgePolicy_add"] = "Add a Template Deletion Policy";
+$lang["mod_purgePolicy_change"] = "Modify a Template Deletion Policy";
+$lang["mod_purgePolicy_view"] = "View a Template Deletion Policy";
+
+$lang["mod_purgePolicy_infos"] = "General informations";
+$lang["mod_purgePolicy_name"] = "Policy Name";
+$lang["mod_purgePolicy_alias"] = "Alias";
+$lang["mod_purgePolicy_retain"] = "Retention Period";
+$lang["mod_purgePolicy_raw"] = "Raw Deletion";
+$lang["mod_purgePolicy_bin"] = "Bin Deletion";
+$lang["mod_purgePolicy_metric"] = "Metric Definition Deletion";
+$lang["mod_purgePolicy_service"] = "Service Definition Deletion";
+$lang["mod_purgePolicy_host"] = "Host Definition Deletion";
+$lang["mod_purgePolicy_comment"] = "Comments";
+
+$lang["mod_purgePolicy_listRaw"] = "Raw";
+$lang["mod_purgePolicy_listBin"] = "Bin";
+$lang["mod_purgePolicy_listMetric"] = "Metric";
+$lang["mod_purgePolicy_listService"] = "Service";
+$lang["mod_purgePolicy_listHost"] = "Host";
+
+/* Traps SNMP */
+
+$lang['m_traps_command'] = "SNMP Traps";
+$lang['m_traps_name'] = "Trap name";
+$lang['m_traps_oid'] = "OID";
+$lang['m_traps_handler'] = "Handler";
+$lang['m_traps_args'] = "Arguments";
+$lang['m_traps_comments'] = "Comments";
+
+$lang['m_traps_add'] = "Add a Trap definition";
+$lang['m_traps_change'] = "Modify a Trap definition";
+$lang['m_traps_view'] = "View a Trap definition";
+
+?>
\ No newline at end of file
diff --git a/www/include/configuration/lang/fr.php b/www/include/configuration/lang/fr.php
new file mode 100644
index 0000000000000000000000000000000000000000..1ffa398555f8c4d5f0df4293c168cda58746210a
--- /dev/null
+++ b/www/include/configuration/lang/fr.php
@@ -0,0 +1,734 @@
+<?
+/* Configuration Error */
+
+$lang['requiredFields'] = "<font style='color: red;'>*</font> Champs requis";
+$lang['ErrName'] = "Nom obligatoire";
+$lang['ErrAlias'] = "Alias obligatoire";
+$lang['ErrEmail'] = "Email valide";
+$lang['ErrOpt'] = "Option obligatoire";
+$lang['ErrTp'] = "P&eacute;riode obligatoire";
+$lang['ErrCmd'] = "Commande obligatoire";
+$lang['ErrCct'] = "Contact obligatoire";
+$lang['ErrCg'] = "ContactGroup obligatoire";
+$lang['ErrCmdLine'] = "Ligne de Commande obligatoire";
+$lang['ErrCmdType'] = "Type de Commande obligatoire";
+$lang['ErrAlreadyExist'] = "Un &eacute;l&eacute;ment portant le m&ecirc;me nom existe d&eacute;ja";
+$lang['ErrAddress'] = "Adresse obligatoire";
+$lang['ErrRequired'] = "Champ requis";
+$lang['ErrSvLeast'] = "HostGroup ou Host requis";
+$lang['ErrCctPasswd'] = "Les mots de passe ne correspondent pas";
+$lang['ErrGenFileProb'] = "Probl&egrave;me d'acc&egrave;s aux fichiers";
+$lang['ErrCycleDef'] = "La d&eacute;finition est redondante";
+
+/* Configuration Menu */
+
+$lang['quicksearch'] = "Recherche rapide";
+$lang['available'] = "Disponible";
+$lang['selected'] = "S&eacute;lectionn&eacute;";
+$lang['further_infos'] = "Informations compl&eacute;mentaires";
+$lang['comment'] = "Commentaires";
+$lang['nothing'] = "Vide";
+$lang['formObjMatch'] = "El&eacute;ment impact&eacute; : ";
+$lang['action'] = "Post Validation";
+$lang['actionList'] = "Liste";
+$lang['actionForm'] = "Formulaire";
+$lang['legend1'] = "(*) Ce service est utilis&eacute; par plusieurs Hosts";
+$lang['previous'] = "previous";
+$lang['next'] = "next";
+
+/* host */
+
+$lang['h'] = "Host";
+$lang['h_conf'] = "Host Configuration";
+$lang['h_add'] = "Ajouter un Host";
+$lang['h_change'] = "Modifier un Host";
+$lang['h_view'] = "Afficher un Host";
+
+$lang['h_extInf'] = "Host Extended Infos";
+$lang["h_ExtInf_add"] = "Ajouter une Information Etendue";
+$lang["h_ExtInf_change"] = "Modifier une Information Etendue";
+$lang["h_ExtInf_view"] = "Voir une Information Etendue";
+
+$lang['h_childs'] = "Services li&eacute;s";
+$lang['h_parent'] = "Template parent";
+
+$lang['h_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang['h_name'] = "Nom de l'Host";
+$lang['h_alias'] = "Alias";
+$lang['h_address'] = "Adresse";
+$lang['h_snmpCom'] = "Communaut&eacute; SNMP";
+$lang['h_snmpVer'] = "Version";
+$lang['h_template'] = "Template de Host";
+$lang['h_templateText'] = "Utiliser un Template vous dispense des &eacute;l&eacute;ments de configuration obligatoires";
+$lang['h_dupSvTplAssocText'] = "Cr&eacute;er les services li&eacute;s au Template";
+
+$lang['h_head_links'] = "Relations";
+$lang["h_Links_add"] = "Ajouter des relations";
+$lang["h_Links_change"] = "Modifier les relations";
+$lang["h_Links_view"] = "Voir les relations";
+$lang['h_HostGroupMembers'] = "HostGroups parents";
+$lang['h_HostParents'] = "Hosts parents";
+$lang['h_HostChilds'] = "Hosts enfants";
+
+$lang['h_head_state'] = "Status de l'Host";
+$lang['h_checkCmd'] = "Commande de check";
+$lang['h_checkMca'] = "Nombre maximum d'essais";
+$lang['h_checkInterval'] = "Ordonnancement r&eacute;gulier";
+$lang['h_checksEnabled'] = "Activation des controles de l'Host";
+$lang['h_checkPeriod'] = "P&eacute;riode de controle";
+$lang['h_activeCE'] = "Controles actifs";
+$lang['h_passiveCE'] = "Controles passifs";
+$lang['h_eventHandlerE'] = "Activation du gestionnaire d'&eacute;v&egrave;nements";
+$lang['h_eventHandler'] = "Commande associ&eacute;e";
+
+$lang['h_head_treat'] = "Traitement des donn&eacute;es";
+$lang['h_add_treat'] = "Ajouter le Traitement des donn&eacute;es";
+$lang['h_modify_treat'] = "Modifier le Traitement des donn&eacute;es";
+$lang['h_view_treat'] = "Afficher le Traitement des donn&eacute;es";
+
+$lang['h_ObsessOH'] = "Commande post check";
+$lang['h_checkFreshness'] = "Controle de validit&eacute; des donn&eacute;es";
+$lang['h_FreshnessThreshold'] = "Seuil de controle de validit&eacute;";
+$lang['h_flapDetect'] = "D&eacute;tection des oscillations";
+$lang['h_lowFT'] = "Seuil de d&eacute;tection bas";
+$lang['h_highFT'] = "Seuil de d&eacute;tection haut";
+$lang['h_processPD'] = "Traitement des donn&eacute;es de performance";
+$lang['h_retainSI'] = "M&eacute;morisation des informations li&eacute;es &agrave; l'Host";
+$lang['h_retainNI'] = "M&eacute;morisation des informations non li&eacute;es &agrave; l'Host";
+
+$lang['h_head_notif'] = "Notification";
+$lang['h_CgMembers'] = "ContactGroups rattach&eacute;s";
+$lang['h_notifInt'] = "Interval de notification";
+$lang['h_notifTp'] = "P&eacute;riode de notification";
+$lang['h_notifOpts'] = "Type de notification";
+$lang['h_notifEnabled'] = "Activer la notification";
+$lang['h_stalOpts'] = "Etats de suivi pr&eacute;cis";
+
+$lang['h_nagios'] = "Nagios";
+$lang['h_notes'] = "Note";
+$lang['h_notesUrl'] = "URL";
+$lang['h_actionUrl'] = "Action URL";
+$lang['h_iconImg'] = "Ic&ocirc;ne";
+$lang['h_iconImgAlt'] = "Ic&ocirc;ne alt";
+$lang['h_vrmlImg'] = "VRML Image";
+$lang['h_nagStatImg'] = "Nagios Statuts Map Image";
+$lang['h_nag2dCoords'] = "Nagios 2d Coords";
+$lang['h_nag3dCoords'] = "Nagios 3d Coords";
+
+$lang['h_oreon'] = "Oreon";
+$lang['h_country'] = "Pays";
+$lang['h_city'] = "Ville";
+$lang['h_popCityTitle'] = "Choisir une Ville";
+$lang['h_popCityAlpha'] = "Classement Alphab&eacute;tique";
+
+/* host group */
+
+$lang['hg'] = "HostGroup";
+$lang['hg_name'] = "Nom du HostGroup";
+$lang['hg_alias'] = "Alias";
+$lang['hg_add'] = "Ajouter un HostGroup";
+$lang['hg_change'] = "Modifier un HostGroup";
+$lang['hg_view'] = "Afficher un HostGroup";
+$lang['hg_CgMembers'] = "ContactGroups rattach&eacute;s";
+$lang['hg_HostMembers'] = "Hosts rattach&eacute;s";
+$lang['hg_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang['hg_links'] = "Relations";
+$lang['hg_notif'] = "Notification";
+
+/* Escalation  */
+
+$lang['esc'] = "Escalade";
+$lang['esc_name'] = "Nom de l'Escalade";
+$lang['esc_add'] = "Ajouter une Escalade";
+$lang['esc_change'] = "Modifier une Escalade";
+$lang['esc_view'] = "Afficher une Escalade";
+$lang['esc_infos'] = "Informations";
+$lang['esc_sort2'] = "Escalade d'Hosts";
+$lang['esc_sort3'] = "Escalade de Services";
+$lang['esc_sort4'] = "Escalade de Hostgroups";
+$lang['esc_sort5'] = "Escalade de Meta Services";
+$lang["esc_firstNotif"] = "Premi&egrave;re notification";
+$lang["esc_lastNotif"] = "Derni&egrave;re notification";
+$lang["esc_notifInt"] = "Interval de notification";
+$lang["esc_escPeriod"] = "P&eacute;riode d'escalade";
+$lang["esc_hOpt"] = "Options d'escalade des Hosts";
+$lang["esc_sOpt"] = "Options d'escalade des Services";
+$lang["esc_comment"] = "Commentaire";
+$lang['esc_appCG'] = "Contact Groups concern&eacute;s";
+$lang['esc_sortHosts'] = "Hosts concern&eacute;s";
+$lang['esc_sortSv'] = "Services  concern&eacute;es";
+$lang['esc_sortHg'] = "HostGroups concern&eacute;s";
+$lang['esc_sortMs'] = "Meta Services concern&eacute;s";
+$lang['esc_hostServiceMembers'] = "Services par Hosts";
+$lang['esc_hostGroupServiceMembers'] = "Services par Host Groups";
+
+/* Dependencies */
+
+$lang['dep'] = "D&eacute;pendance";
+$lang['dep_add'] = "Ajouter une D&eacute;pendance";
+$lang['dep_change'] = "Modifier une D&eacute;pendance";
+$lang['dep_view'] = "Afficher une D&eacute;pendance";
+$lang['dep_infos'] = "Informations";
+$lang["dep_inheritsP"] = "Liaison Parente";
+$lang["dep_exeFC"] = "Options de d&eacute;pendance d'execution";
+$lang["dep_notifFC"] = "Options de d&eacute;pendance de notification";
+$lang["dep_comment"] = "Commentaire";
+$lang['dep_hPar'] = "Hosts dont nous d&eacute;pendons";
+$lang['dep_hChi'] = "Hosts D&eacute;pendants";
+$lang['dep_hgPar'] = "HostGroups dont nous d&eacute;pendons";
+$lang['dep_hgChi'] = "HostGroups D&eacute;pendants";
+$lang['dep_hSvPar'] = "Hosts Services dont nous d&eacute;pendons";
+$lang['dep_hSvChi'] = "Hosts Services D&eacute;pendants";
+$lang['dep_hgSvPar'] = "HostGroups Services dont nous d&eacute;pendons";
+$lang['dep_hgSvChi'] = "HostGroups Services D&eacute;pendants";
+$lang['dep_sgPar'] = "ServiceGroups dont nous d&eacute;pendons";
+$lang['dep_sgChi'] = "ServiceGroups D&eacute;pendants";
+$lang['dep_msPar'] = "Meta Services dont nous d&eacute;pendons";
+$lang['dep_msChi'] = "Meta Services D&eacute;pendants";
+$lang['dep_name'] = "Nom";
+$lang['dep_description'] = "Description";
+$lang['dep_sort2'] = "Host Service D&eacute;pendance";
+$lang['dep_sort3'] = "HostGroup Service D&eacute;pendance";
+
+/* host template model */
+
+$lang['htm'] = "Host Template Model";
+$lang['htm_childs'] = "Services Template li&eacute;s";
+$lang['htm_parent'] = "Template parent";
+$lang['htm_add'] = "Ajouter un Host Template Model";
+$lang['htm_change'] = "Modifier un Host Template Model";
+$lang['htm_view'] = "Afficher un Host Template Model";
+$lang['htm_template'] = "Template de Host Model";
+$lang['htm_templateText'] = "Utiliser un Template Model vous permet d'avoir plusieurs niveaux de Template";
+
+/* service */
+
+$lang['sv'] = "Service";
+$lang['sv_conf'] = "Service Configuration";
+$lang['sv_add'] = "Ajouter un Service";
+$lang['sv_change'] = "Modifier un Service";
+$lang['sv_view'] = "Afficher un Service";
+$lang['sv_parent'] = "Template parent";
+
+$lang['sv_extInf'] = "Service Extended Infos";
+$lang["sv_ExtInf_add"] = "Ajouter une Information Etendue";
+$lang["sv_ExtInf_change"] = "Modifier une Information Etendue";
+$lang["sv_ExtInf_view"] = "Voir une Information Etendue";
+
+$lang['sv_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang['sv_hPars'] = "Li&eacute; aux Hosts";
+$lang['sv_hgPars'] = "Li&eacute; aux HostGroups";
+$lang['sv_description'] = "Description";
+$lang['sv_template'] = "Template de Service";
+$lang['sv_templateText'] = "Utiliser un Template vous dispense des &eacute;l&eacute;ments de configuration obligatoires";
+$lang['sv_traps'] = "Service Trap Relation";
+
+$lang['sv_head_links'] = "Relations";
+$lang["sv_Links_add"] = "Ajouter des relations";
+$lang["sv_Links_change"] = "Modifier les relations";
+$lang["sv_Links_view"] = "Voir les relations";
+$lang['sv_ServiceGroupMembers'] = "ServiceGroups parents";
+
+$lang['sv_head_state'] = "Status du Service";
+$lang['sv_isVolatile'] = "Service volatil";
+$lang['sv_checkCmd'] = "Commande de check";
+$lang['sv_checkMca'] = "Nombre maximum d'essais";
+$lang['sv_normalCheckInterval'] = "Ordonnancement r&eacute;gulier";
+$lang['sv_retryCheckInterval'] = "Ordonnancement non r&eacute;gulier";
+$lang['sv_checkPeriod'] = "P&eacute;riode de controle";
+$lang['sv_activeCE'] = "Controles actifs";
+$lang['sv_passiveCE'] = "Controles passifs";
+$lang['sv_eventHandlerE'] = "Activation du gestionnaire d'&eacute;v&egrave;nements";
+$lang['sv_eventHandler'] = "Commande associ&eacute;e";
+$lang['sv_args'] = "Arguments";
+
+$lang['sv_head_treat'] = "Traitement des donn&eacute;es";
+$lang['sv_paraCheck'] = "Controle parall&egrave;le";
+$lang['sv_ObsessOS'] = "Commande post check";
+$lang['sv_checkFreshness'] = "Controle de validit&eacute; des donn&eacute;es";
+$lang['sv_FreshnessThreshold'] = "Seuil de controle de validit&eacute;";
+$lang['sv_flapDetect'] = "D&eacute;tection des oscillations";
+$lang['sv_lowFT'] = "Seuil de d&eacute;tection bas";
+$lang['sv_highFT'] = "Seuil de d&eacute;tection haut";
+$lang['sv_processPD'] = "Traitement des donn&eacute;es de performance";
+$lang['sv_retainSI'] = "M&eacute;morisation des informations li&eacute;es au Service";
+$lang['sv_retainNI'] = "M&eacute;morisation des informations non li&eacute;es au Service";
+
+$lang['sv_head_notif'] = "Notification";
+$lang['sv_CgMembers'] = "ContactGroups rattach&eacute;s";
+$lang['sv_notifInt'] = "Interval de notification";
+$lang['sv_notifTp'] = "P&eacute;riode de notification";
+$lang['sv_notifOpts'] = "Type de notification";
+$lang['sv_notifEnabled'] = "Activer la notification";
+$lang['sv_stalOpts'] = "Etats de suivi pr&eacute;cis";
+
+$lang['sv_oreon'] = "Oreon";
+$lang['sv_graphTpl'] = "Graph Mod&egrave;le";
+
+/* Meta Service */
+
+$lang['ms'] = "Meta Service";
+$lang['ms_conf'] = "Configuration";
+$lang['ms_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang["ms_add"] = "Ajouter un Meta Service";
+$lang["ms_change"] = "Modifier un Meta Service";
+$lang["ms_view"] = "Afficher un Meta Service";
+$lang['ms_name'] = "Nom du Meta Service";
+$lang['ms_comment'] = "Commentaire";
+$lang['ms_levelw'] = "Niveau Warning";
+$lang['ms_levelc'] = "Niveau Critical";
+$lang['ms_calType'] = "Type de Calcul";
+$lang['ms_selSum'] = "Somme";
+$lang['ms_selAvr'] = "Moyenne";
+$lang['ms_selMin'] = "Minimum";
+$lang['ms_selMax'] = "Maximum";
+$lang['ms_selMod'] = "Mode de s&eacute;lection";
+$lang['ms_selList'] = "Liste de Services";
+$lang['ms_regexp'] = "Expression R&eacute;guli&egrave;re";
+$lang['ms_exp'] = "Expression";
+$lang['ms_metric'] = "Metric";
+
+$lang['ms_head_state'] = "Status du Meta Service";
+$lang['ms_checkMca'] = "Nombre maximum d'essais";
+$lang['ms_normalCheckInterval'] = "Ordonnancement r&eacute;gulier";
+$lang['ms_retryCheckInterval'] = "Ordonnancement non r&eacute;gulier";
+$lang['ms_checkPeriod'] = "P&eacute;riode de controle";
+
+$lang['ms_head_notif'] = "Notification";
+$lang['ms_CgMembers'] = "ContactGroups rattach&eacute;s";
+$lang['ms_notifInt'] = "Interval de notification";
+$lang['ms_notifTp'] = "P&eacute;riode de notification";
+$lang['ms_notifOpts'] = "Type de notification";
+$lang['ms_notifEnabled'] = "Activer la notification";
+
+$lang['mss_add'] = "Ajouter un Service";
+$lang['mss_change'] = "Modifier un Service";
+$lang['mss_view'] = "Voir un Service";
+
+/* extended service infos */
+
+$lang['esi'] = "Informations &eacute;tendues de Service";
+$lang['esi_available'] = "Informations &eacute;tendues disponibles des Services ";
+$lang['esi_notes'] = "Note";
+$lang['esi_notes_url'] = "Adresse de la note";
+$lang['esi_action_url'] = "Action url";
+$lang['esi_icon_image'] = "Ic&ocirc;ne";
+$lang['esi_icon_image_alt'] = "Ic&ocirc;ne alt";
+
+/* service template model*/
+
+$lang['stm'] = "Service Template Model";
+$lang['stm_parent'] = "Template parent";
+$lang['stm_add'] = "Ajouter un Service Template Model";
+$lang['stm_change'] = "Modifier un Service Template Model";
+$lang['stm_view'] = "Afficher un Service Template Model";
+$lang['stm_template'] = "Template de Service Model";
+$lang['stm_templateText'] = "Utiliser un Template Model vous permet d'avoir plusieurs niveaux de Template";
+
+/* service group*/
+
+$lang['sg'] = "ServiceGroup";
+$lang['sg_name'] = "Nom du ServiceGroup";
+$lang['sg_alias'] = "Alias";
+$lang['sg_add'] = "Ajouter un ServiceGroup";
+$lang['sg_change'] = "Modifier un ServiceGroup";
+$lang['sg_view'] = "Afficher un ServiceGroup";
+$lang['sg_hostServiceMembers'] = "Host Services rattach&eacute;s";
+$lang['sg_hostGroupServiceMembers'] = "Host Group Services rattach&eacute;s";
+$lang['sg_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang['sg_links'] = "Relations";
+$lang['sg_notif'] = "Notification";
+
+/* contact */
+
+$lang['cct_add'] = "Ajouter un utilisateur";
+$lang['cct_change'] = "Modifier un utilisateur";
+$lang['cct_view'] = "Afficher un utilisateur";
+$lang['cct_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang['cct_notif'] = "Types de notifications";
+$lang['cct_name'] = "Nom complet";
+$lang['cct_mail'] = "Email";
+$lang['cct_mailType'] = "Format du Mail";
+$lang['cct_pager'] = "Pager";
+$lang['cct_hostNotifOpt'] = "Choix de notifications pour les Hosts";
+$lang['cct_hostNotifTp'] = "P&eacute;riode de notification pour les Hosts";
+$lang['cct_hostNotifCmd'] = "Commandes de notifications pour les Hosts";
+$lang['cct_svNotifOpt'] = "Choix de notifications pour les Services";
+$lang['cct_svNotifTp'] = "P&eacute;riode de notification pour les Services";
+$lang['cct_svNotifCmd'] = "Commandes de notifications pour les Services";
+$lang['cct_cgNotif'] = "Contact Groups parent(s)";
+$lang['cct_passwd'] = "Mot de passe";
+$lang['cct_passwd2'] = "Confirmation";
+$lang['cct_lang'] = "Langue principale";
+$lang['cct_oreon'] = "Oreon";
+$lang['cct_oreon_text'] = "Acc&egrave;de &agrave; l'interface";
+$lang['cct_admin'] = "Administrateur";
+$lang["cct_contact_auth_type"] = "Type d'authentification";
+$lang["cct_ldap_dn"] = "Ldap DN (Distinguished Name)";
+
+/* contact group */
+
+$lang['cg_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang['cg_name'] = "Nom du Contact Group";
+$lang['cg_alias'] = "Alias";
+$lang['cg_members'] = "Contacts rattach&eacute;s";
+$lang['cg_notif'] = "Notification";
+$lang["cg_add"] = "Ajouter un Contact Group";
+$lang["cg_change"] = "Modifier un Contact Group";
+$lang["cg_view"] = "Afficher un Contact Group";
+
+/* time period */
+
+$lang['tp_name'] = "Nom de la plage horaire";
+$lang['tp_alias'] = "Alias";
+$lang['tp_sunday'] = "Dimanche";
+$lang['tp_monday'] = "Lundi";
+$lang['tp_tuesday'] = "Mardi";
+$lang['tp_wednesday'] = "Mercredi";
+$lang['tp_thursday'] = "Jeudi";
+$lang['tp_friday'] = "Vendredi";
+$lang['tp_saturday'] = "Samedi";
+$lang['tp_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang['tp_notif'] = "Tranche horaire de notification";
+$lang["tp_add"] = "Ajouter une Time Period";
+$lang["tp_change"] = "Modifier une Time Period";
+$lang["tp_view"] = "Afficher une Time Period";
+
+/* command */
+
+$lang['cmd_type'] = "Type de Commande";
+$lang['cmd_infos'] = "Informations";
+$lang['cmd_check'] = "Commande de Check";
+$lang['cmd_notif'] = "Commande de notification";
+$lang['cmd_checkShort'] = "Check";
+$lang['cmd_notifShort'] = "Notification";
+$lang["cmd_add"] = "Ajouter une Commande";
+$lang["cmd_change"] = "Modifier une Commande";
+$lang["cmd_view"] = "Afficher une Commande";
+$lang['cmd_name'] = "Nom de la Commande";
+$lang['cmd_line'] = "Ligne de Commande ";
+$lang['cmd_type'] = "Type de Commande";
+$lang['cmd_comment'] = "Les d&eacute;finitions de Commande peuvent contenir des macros mais vous devez vous assurez pr&eacute;alablement que ces macros sont valides dans les circonstances ou la macro sera utilis&eacute;e.";
+$lang['cmd_help'] = "Aide du Plugin";
+$lang['cmd_help_output'] = "Aide";
+$lang['cmd_output'] = "Sortie";
+$lang['cmd_example'] = "Exemple d'argument";
+
+/* Nagios CFG */
+
+$lang["nagios_add"] = "Ajouter un fichier de configuration de Nagios";
+$lang["nagios_change"] = "Modifier un fichier de configuration de Nagios";
+$lang["nagios_view"] = "Afficher un fichier de configuration de Nagios";
+$lang["nagios_infos"] = "Informations";
+$lang["nagios_name"] = "Nom de cette configuration";
+$lang["nagios_comment"] = "Commentaires pour ce fichier";
+
+$lang["nag_logFile"] = "Log file";
+$lang["nag_objConfFile"] = "Object Configuration File";
+$lang["nag_objConfDir"] = "Object Configuration Directory";
+$lang["nag_objCacheFile"] = "Object Cache File";
+$lang["nag_resFile"] = "Resource File";
+$lang["nag_tmpFile"] = "Temp File";
+$lang["nag_p1File"] = "P1 File";
+
+$lang["nag_statusFile"] = "Status File";
+$lang["nag_asuOpt"] = "Aggregated Status Updates Option";
+$lang["nag_asuInt"] = "Aggregated Status Data Update Interval";
+
+$lang["nag_nagUser"] = "Nagios User";
+$lang["nag_nagGroup"] = "Nagios Group";
+
+$lang["nag_notifOpt"] = "Notification Option";
+$lang["nag_svCheckExeOpt"] = "Service Check Execution Option";
+$lang["nag_pasSvCheckAccOpt"] = "Passive Service Check Acceptance Option";
+$lang["nag_hostCheckExeOpt"] = "Host Check Execution Option";
+$lang["nag_pasHostCheckAccOpt"] = "Passive Host Check Acceptance Option";
+$lang["nag_eventHandOpt"] = "Event Handler Option";
+
+$lang["nag_logRotMethod"] = "Log Rotation Method";
+$lang["nag_logArchPath"] = "Log Archive Path";
+
+$lang["nag_extCmdCheckOpt"] = "External Command Check Option";
+$lang["nag_extCmdCheckInt"] = "External Command Check Interval";
+$lang["nag_extCmdFile"] = "External Command File";
+
+$lang["nag_cmtFile"] = "Comment File";
+$lang["nag_dtFile"] = "Downtime File";
+$lang["nag_lockFile"] = "Lock File";
+
+$lang["nag_stateRetOpt"] = "State Retention Option";
+$lang["nag_stateRetFile"] = "State Retention File";
+$lang["nag_autStateRetUpdInt"] = "Automatic State Retention Update Interval";
+$lang["nag_useRetPgmStateOpt"] = "Use Retained Program State Option";
+$lang["nag_useRetSchInfoOpt"] = "Use Retained Scheduling Info Option";
+
+$lang["nag_SysLogOpt"] = "Syslog Logging Option";
+$lang["nag_notLogOpt"] = "Notification Logging Option";
+$lang["nag_svCheckRtrLogOpt"] = "Service Check Retry Logging Option";
+$lang["nag_hostRtrLogOpt"] = "Host Retry Logging Option";
+$lang["nag_eventHandLogOpt"] = "Event Handler Logging Option";
+$lang["nag_iniStateLogOpt"] = "Initial State Logging Option";
+$lang["nag_extCmdLogOpt"] = "External Command Logging Option";
+$lang["nag_passSvCheckLogOpt"] = "Passive Service Check Logging Option";
+$lang["nag_passCheckLogOpt"] = "Passive Check Logging Option";
+
+$lang["nag_glHostEventHand"] = "Global Host Event Handler";
+$lang["nag_glSvEventHand"] = "Global Service Event Handler";
+
+$lang["nag_intCheckSleepTm"] = "Inter-Check Sleep Time";
+$lang["nag_intCheckDelMth"] = "Inter-Check Delay Method";
+$lang["nag_svIntCheckDelMth"] = "Service Inter-Check Delay Method";
+$lang["nag_maxSvCheckSpread"] = "Maximum Service Check Spread";
+$lang["nag_svInterFac"] = "Service Interleave Factor";
+$lang["nag_maxConcSvChecks"] = "Maximum Concurrent Service Checks";
+$lang["nag_svReapFreq"] = "Service Repear Frequency";
+$lang["nag_hostIntCheckDelMth"] = "Host Inter-Check Delay Method";
+$lang["nag_maxHostCheckSpread"] = "Maximum Host Check Spread";
+$lang["nag_tmIntLen"] = "Timing Interval Length";
+$lang["nag_autoRescheOpt"] = "Auto-Rescheduling Option";
+$lang["nag_autoRescheInt"] = "Auto-Rescheduling Interval";
+$lang["nag_autoRescheWnd"] = "Auto-Rescheduling Window";
+
+$lang["nag_aggHostCheckOpt"] = "Aggressive Host Checking Option";
+
+$lang["nag_flapDetOpt"] = "Flap Detection Option";
+$lang["nag_lowSvFlapThres"] = "Low Service Flap Threshold";
+$lang["nag_highSvFlapThres"] = "High Service Flap Threshold";
+$lang["nag_lowHostFlapThres"] = "Low Host Flap Threshold";
+$lang["nag_highHostFlapThres"] = "High Host Flap Threshold";
+
+$lang["nag_softSvDepOpt"] = "Soft Service Dependencies Option";
+
+$lang["nag_svCheckTmOut"] = "Service Check Timeout";
+$lang["nag_hostCheckTmOut"] = "Host Check Timeout";
+$lang["nag_eventHandTmOut"] = "Event Handler Timeout";
+$lang["nag_notifTmOut"] = "Notification Timeout";
+$lang["nag_obComSvProcTmOut"] = "Obsessive Compulsive Service Processor Timeout";
+$lang["nag_obComHostProcTmOut"] = "Obsessive Compulsive Host Processor Timeout";
+$lang["nag_perfDataProcCmdTmOut"] = "Performance Data Processor Command Timeout";
+
+$lang["nag_obsOverSvOpt"] = "Obsess Over Services Option";
+$lang["nag_obsComSvProcCmd"] = "Obsessive Compulsive Service Processor Command";
+$lang["nag_obsOverHostOpt"] = "Obsess Over Hosts Option";
+$lang["nag_obsComHostProcCmd"] = "Obsessive Compulsive Host Processor Command";
+
+$lang["nag_perfDataProcOpt"] = "Performance Data Processing Option";
+$lang["nag_hostPerfDataProcCmd"] = "Host Performance Data Processing Command";
+$lang["nag_svPerfDataProcCmd"] = "Service Performance Data Processing Command";
+$lang["nag_hostPerfDataFile"] = "Host Performance Data File";
+$lang["nag_svPerfDataFile"] = "Service Performance Data File";
+$lang["nag_hostPerfDataFileTmp"] = "Host Performance Data File Template";
+$lang["nag_svPerfDataFileTmp"] = "Service Performance Data File Template";
+$lang["nag_hostPerfDataFileMode"] = "Host Performance Data File Mode";
+$lang["nag_svPerfDataFileMode"] = "Service Performance Data File Mode";
+$lang["nag_hostPerfDataFileProcInt"] = "Host Performance Data File Processing Interval";
+$lang["nag_svPerfDataFileProcInt"] = "Service Performance Data File Processing Interval";
+$lang["nag_hostPerfDataFileProcCmd"] = "Host Performance Data File Processing Command";
+$lang["nag_svPerfDataFileProcCmd"] = "Service Performance Data File Processing Command";
+
+$lang["nag_OrpSvCheckOpt"] = "Orphaned Service Check Option";
+
+$lang["nag_svFreshCheckOpt"] = "Service Freshness Checking Option";
+$lang["nag_svFreshCheckInt"] = "Service Freshness Check Interval";
+$lang["nag_freshCheckInt"] = "Freshness Check Interval";
+$lang["nag_hostFreshCheckOpt"] = "Host Freshness Checking Option";
+$lang["nag_hostFreshCheckInt"] = "Host Freshness Check Interval";
+
+$lang["nag_dateFormat"] = "Date Format";
+
+$lang["nag_illObjNameChar"] = "Illegal Object Name Characters";
+$lang["nag_illMacOutChar"] = "Illegal Macro Output Characters";
+
+$lang["nag_regExpMatchOpt"] = "Regular Expression Matching Option";
+$lang["nag_trueRegExpMatchOpt"] = "True Regular Expression Matching Option";
+
+$lang["nag_adminEmail"] = "Administrator Email Address";
+$lang["nag_adminPager"] = "Administrator Pager";
+
+/* Resource CFG */
+$lang['rs_add'] = "Ajouter une Ressource";
+$lang['rs_change'] = "Modifier une Ressource";
+$lang['rs_view'] = "Afficher une Ressource";
+$lang['rs_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang['rs_name'] = "Nom de la Ressource";
+$lang['rs_line'] = "Expression de la MACRO";
+
+/* Perfparse CFG */
+$lang['pp_add'] = "Ajouter un fichier de configuration Perfparse";
+$lang['pp_change'] = "Modifier un fichier de configuration Perfparse";
+$lang['pp_view'] = "Afficher un fichier de configuration Perfparse";
+$lang['pp_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang['pp_name'] = "Nom du fichier Perfparse";
+$lang['pp_comment'] = "Commentaires sur ce fichier";
+$lang['pp_sMan'] = "Server Management";
+$lang['pp_serPort'] = "Server Port";
+$lang['pp_pMan'] = "Parser Management";
+$lang['pp_perfDLF'] = "Performance Data Log Files ('-' for stdin)";
+$lang['pp_serLog'] = "Service Log";
+$lang['pp_svLPMP'] = "Service Log Position Mark Path";
+$lang['pp_errHandling'] = "Error handling";
+$lang['pp_errLog'] = "Error Log File";
+$lang['pp_errLogRot'] = "Error Log Rotate";
+$lang['pp_errLKND'] = "Error Log Keep N Days";
+$lang['pp_dropFile'] = "Drop File";
+$lang['pp_dropFileRot'] = "Drop File Rotate";
+$lang['pp_dropFKND'] = "Drop File Keep N Days";
+$lang['pp_lockFileTxt'] = "Lock file for only one perfparse running at the same time";
+$lang['pp_lockFile'] = "Lock File";
+$lang['pp_reportOpt'] = "Reporting Options";
+$lang['pp_showSB'] = "Show Status Bar";
+$lang['pp_doReport'] = "Do_Report";
+$lang['pp_cgiMan'] = "CGI Management";
+$lang['pp_defUPP'] = "Default user permissions Policy";
+$lang['pp_defUPHG'] = "Default user permissions Hostgroups";
+$lang['pp_defUPS'] = "Default user permissions Summary";
+$lang['pp_outLog'] = "Output Logger";
+$lang['pp_outLogFile'] = "Output Log File";
+$lang['pp_outLogFileName'] = "Output Log Filename";
+$lang['pp_outLogRot'] = "Output Log Rotate";
+$lang['pp_outLKND'] = "Output Log Keep N Days";
+$lang['pp_SockOutMan'] = "Socket_output managment";
+$lang['pp_useStoSockOut'] = "Use Storage Socket Output";
+$lang['pp_stoSockOutHName'] = "Storage Socket Output Host Name";
+$lang['pp_stoSockOutPort'] = "Storage Socket Output Port";
+$lang['pp_dbMan'] = "Database managment";
+$lang['pp_useStorMySQL'] = "Use Storage Mysql";
+$lang['pp_noRawData'] = "No Raw Data";
+$lang['pp_noBinData'] = "No Bin Data";
+$lang['pp_dbUser'] = "DB User";
+$lang['pp_dbName'] = "DB Name";
+$lang['pp_dbPass'] = "DP Pass";
+$lang['pp_dbHost'] = "DB_Host";
+$lang['pp_dumHN'] = "Dummy Hostname";
+$lang['pp_stoModLoad'] = "Storage Modules Load";
+
+/* CGI cfg */
+$lang['cgi_name'] = "Nom du fichier CGI";
+$lang['cgi_comment'] = "Commentaires sur ce fichier";
+$lang['cgi_add'] = "Ajouter un fichier de configuration CGI";
+$lang['cgi_change'] = "Modifier un fichier de configuration CGI";
+$lang['cgi_view'] = "Afficher un fichier de configuration CGI";
+$lang['cgi_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang["cgi_mainConfFile"] = "Main Configuration File Location";
+$lang["cgi_phyHtmlPath"] = "Physical HTML Path";
+$lang["cgi_urlHtmlPath"] = "URL HTML Path";
+$lang["cgi_nagCheckCmd"] = "Nagios Process Check Command";
+$lang["cgi_authUsage"] = "Authentication Usage";
+$lang["cgi_defUserName"] = "Default User Name";
+$lang["cgi_authFSysInfo"] = "System/Process Information Access";
+$lang["cgi_authFSysCmd"] = "System/Process Command Access";
+$lang["cgi_authFConfInf"] = "Configuration Information Access";
+$lang["cgi_authFAllHosts"] = "Global Host Information Access";
+$lang["cgi_authFAllHostCmds"] = "Global Host Command Access";
+$lang["cgi_authFAllSv"] = "Global Service Information Access";
+$lang["cgi_authFAllSvCmds"] = "Global Service Command Access";
+$lang["cgi_smBckImg"] = "Statusmap CGI Background Image";
+$lang["cgi_defSMLayMet"] = "Default Statusmap Layout Method";
+$lang["cgi_statCGIIncWld"] = "Statuswrl CGI Include World";
+$lang["cgi_defStatWRLLay"] = "Default Statuswrl Layout Method";
+$lang["cgi_cgIRefRate"] = "CGI Refresh Rate";
+$lang["cgi_hus"] = "Host Unreachable Sound";
+$lang["cgi_hdu"] = "Host Down Sound";
+$lang["cgi_scs"] = "Service Critical Sound";
+$lang["cgi_sws"] = "Service Warning Sound";
+$lang["cgi_sus"] = "Service Unknown Sound";
+$lang["cgi_pingSyntax"] = "Ping Syntax";
+
+/* Generate File */
+$lang["gen_name"] = "G&eacute;n&eacute;ration des fichiers de configuration de Nagios";
+$lang["gen_infos"] = "Serveur concern&eacute;";
+$lang["gen_host"] = "Serveur Nagios / Oreon";
+$lang["gen_opt"] = "Options de g&eacute;n&eacute;ration";
+$lang["gen_ok"] = "G&eacute;n&eacute;rer les fichiers";
+$lang["gen_level"] = "Int&eacute;raction des &eacute;l&eacute;ments";
+$lang["gen_level1"] = "Gestion des d&eacute;pendances";
+$lang["gen_level2"] = "Activation courante";
+$lang["gen_level3"] = "Aucune";
+$lang["gen_comment"] = "Inclure les commentaires";
+$lang["gen_xml"] = "G&eacute;n&eacute;rer aussi au format XML";
+$lang["gen_result"] = "R&eacute;sultat";
+$lang["gen_debug"] = "Lancer le debug de Nagios (-v)";
+$lang["gen_move"] = "D&eacute;placer les fichiers";
+$lang["gen_restart"] = "Red&eacute;marrer Nagios";
+$lang["gen_butOK"] = "Generer";
+$lang["gen_status"] = "Statuts";
+$lang['gen_mvOk'] = " - d&eacute;placement OK";
+$lang['gen_mvKo'] = " - d&eacute;placement KO";
+$lang['gen_trapd'] = "Traps SNMP";
+$lang['gen_genTrap'] = "G&eacute;n&eacute;rer les Traps";
+$lang['gen_trapRestart'] = "Red&eacute;marrer snmptrad";
+
+/* Upload File */
+$lang["upl_name"] = "Upload de configuration Nagios";
+$lang["upl_infos"] = "Serveur concern&eacute;";
+$lang["upl_host"] = "Serveur Nagios / Oreon";
+$lang["upl_opt"] = "Options d'upload";
+$lang["upl_del"] = "Supprimer toute la configuration existante pour le type de fichier choisi";
+$lang["upl_over"] = "Mettre &agrave; jour une d&eacute;finition en cas de doublons";
+$lang["upl_comment"] = "Inclure les commentaires";
+$lang["upl_type"] = "Cat&eacute;gorie du Fichier";
+$lang["upl_mis1"] = "Pour l'upload d'une archive, la premi&egrave;re ligne de chaque fichier doit etre sans importance car elle n'est pas prise en compte.<br>Evitez de faire d&eacute;marrer une d&eacute;finition d&egrave;s le d&eacute;but.";
+$lang["upl_typeNag"] = "nagios.cfg";
+$lang["upl_typeCgi"] = "cgi.cfg";
+$lang["upl_typePerfparse"] = "perfparse.cfg";
+$lang["upl_typeRes"] = "resource.cfg";
+$lang["upl_typeCfg"] = "Template based method file";
+$lang["upl_typeManual"] = "Saisie manuel";
+$lang["upl_format"] = "Format du Fichier";
+$lang["upl_typeName"] = "Fichier";
+$lang["upl_typeCmdType"] = "Type de Commande";
+$lang["upl_typeCmdCheck"] = "Commande de Check";
+$lang["upl_typeCmdNotif"] = "Commande de Notification";
+$lang["upl_typeCmdCmt1"] = "Il est conseill&eacute; d'uploader en premier les fichiers/d&eacute;finitions de Commande en pr&eacute;cisant leurs types.";
+$lang["upl_typeCmdCmt2"] = "La cat&eacute;gorie dans laquelle placer la Commande ne peut &ecirc;tre d&eacute;fini par sa seule d&eacute;finition.";
+$lang["upl_file"] = "Fichier (zip, tar ou cfg)";
+$lang["upl_manualDef"] = "D&eacute;finition Manuelle";
+$lang["upl_result"] = "R&eacute;sultat";
+$lang["upl_debug"] = "Lancer le debug de Nagios (-v)";
+$lang["upl_butOK"] = "Loader";
+$lang["upl_uplOk"] = "Chargement du fichier OK";
+$lang["upl_uplKo"] = "Chargement du fichier KO";
+$lang["upl_carrOk"] = "R&eacute;cup&eacute;ration des donn&eacute;es OK";
+$lang["upl_carrKo"] = "R&eacute;cup&eacute;ration des donn&eacute;es KO";
+$lang["upl_manualDefOk"] = "D&eacute;finition Manuelle OK";
+$lang["upl_uplBadType"] = "Extension non prise en charge";
+$lang["upl_newEntries"] = "entr&eacute;e(s) enregistr&eacute;e(s)";
+
+/* Purge Policy Template */
+
+$lang["mod_purgePolicy"] = "Mod&egrave;le de purge des donn&eacute;es";
+$lang["mod_purgePolicy_add"] = "Ajouter un Template de purge";
+$lang["mod_purgePolicy_change"] = "Modifier un Template de purge";
+$lang["mod_purgePolicy_view"] = "Voir un Template de purge";
+
+$lang["mod_purgePolicy_infos"] = "Informations g&eacute;n&eacute;rales";
+$lang["mod_purgePolicy_name"] = "Nom du Mod&egrave;le";
+$lang["mod_purgePolicy_alias"] = "Alias";
+$lang["mod_purgePolicy_retain"] = "P&eacute;riode de r&eacute;tention";
+$lang["mod_purgePolicy_raw"] = "Suppression des raw";
+$lang["mod_purgePolicy_bin"] = "Suppression des bin";
+$lang["mod_purgePolicy_metric"] = "Suppression des d&eacute;finitions de m&eacute;trics";
+$lang["mod_purgePolicy_service"] = "Suppression des d&eacute;finitions de service";
+$lang["mod_purgePolicy_host"] = "Suppression des d&eacute;finitions d'host";
+$lang["mod_purgePolicy_comment"] = "Commentaires";
+
+$lang["mod_purgePolicy_listRaw"] = "Raw";
+$lang["mod_purgePolicy_listBin"] = "Bin";
+$lang["mod_purgePolicy_listMetric"] = "Metric";
+$lang["mod_purgePolicy_listService"] = "Service";
+$lang["mod_purgePolicy_listHost"] = "Host";
+
+/* Traps SNMP */
+
+$lang['m_traps_command'] = "Traps SNMP";
+$lang['m_traps_name'] = "Nom de la Trap";
+$lang['m_traps_oid'] = "OID";
+$lang['m_traps_handler'] = "Handler";
+$lang['m_traps_args'] = "Arguments";
+$lang['m_traps_comments'] = "Commentaires";
+
+$lang['m_traps_add'] = "Ajouter une d&eacute;finition de Trap";
+$lang['m_traps_change'] = "Modifier une d&eacute;finition de Trap";
+$lang['m_traps_view'] = "Voir une d&eacute;finition de Trap";
+
+?>
\ No newline at end of file
diff --git a/www/include/external_cmd/cmd.php b/www/include/external_cmd/cmd.php
new file mode 100644
index 0000000000000000000000000000000000000000..3444c3d047418d2ac8c4bd8c72037ccf6b407257
--- /dev/null
+++ b/www/include/external_cmd/cmd.php
@@ -0,0 +1,356 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+
+	include_once("./include/external_cmd/comments.php");
+	include_once("./include/external_cmd/downtime.php");
+	
+function send_cmd($oreon, $arg1, $arg2, $arg3, $arg4, $arg5, $arg6)
+{
+	if (isset($arg1) && isset($arg2))
+		$str = "echo '[" . time() . "] " . $arg1 . ";" . $arg2 . "' >> " . $oreon->Nagioscfg->command_file;
+	else if (isset($arg1) && !isset($arg2))
+		$str = "echo '[" . time() . "] " . $arg1 . ";' >> " . $oreon->user->nagios_pwd . "var/rw/nagios.cmd";
+	system($str);
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang['mon_request_submit_host']."</center></div>";
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+
+
+// Re-Schedule for all service of a host
+
+function schedule_host_svc_checks($oreon, $arg, $lang)
+{
+	if (!$oreon->is_accessible($arg)){
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"window.location='./alt_error.php'\",0)</SCRIPT>";
+		return ;
+	}
+	$str = "echo '[" . time() . "] SCHEDULE_HOST_SVC_CHECKS;". $oreon->hosts[$arg]->get_name() .";" . time() . "' >> " . $oreon->Nagioscfg->command_file;
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang["cmd_send"]."</center></div>";
+	system($str);
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+// host check
+
+function host_check($oreon, $arg, $lang, $type)
+{
+	if (!$oreon->is_accessible($arg)){
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"window.location='./alt_error.php'\",0)</SCRIPT>";
+		return ;
+	}
+	$tab["1"] = "ENABLE";
+	$tab["0"] = "DISABLE";
+	$str = "echo '[" . time() . "] ".$tab[$type]."_HOST_CHECK;". $oreon->hosts[$arg]->get_name() ."' >> " . $oreon->Nagioscfg->command_file;
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang["cmd_send"]."</center></div>";
+	system($str);
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+//  host notification
+
+function host_notification($oreon, $arg, $lang, $type)
+{
+	if (!$oreon->is_accessible($arg)){
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"window.location='./alt_error.php'\",0)</SCRIPT>";
+		return ;
+	}
+	$tab["1"] = "ENABLE";
+	$tab["0"] = "DISABLE";
+	$str = "echo '[" . time() . "] ".$tab[$type]."_HOST_NOTIFICATIONS;". $oreon->hosts[$arg]->get_name() ."' >> " . $oreon->Nagioscfg->command_file;
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang["cmd_send"]."</center></div>";
+	system($str);
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+// Enable host flap detection
+
+function host_flap_detection($oreon, $arg, $lang, $type)
+{
+	if (!$oreon->is_accessible($arg)){
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"window.location='./alt_error.php'\",0)</SCRIPT>";
+		return ;
+	}
+	$tab["1"] = "ENABLE";
+	$tab["0"] = "DISABLE";
+	$str = "echo '[" . time() . "] " . $tab[$type] . "_HOST_FLAP_DETECTION;". $oreon->hosts[$arg]->get_name() ."' >> " . $oreon->Nagioscfg->command_file;
+	system($str);
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang['mon_request_submit_host']."</center></div>";
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+// event handler
+
+function host_event_handler($oreon, $arg, $lang, $type)
+{
+	if (!$oreon->is_accessible($arg)){
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"window.location='./alt_error.php'\",0)</SCRIPT>";
+		return ;
+	}
+	$tab["1"] = "ENABLE";
+	$tab["0"] = "DISABLE";
+	$str = "echo '[" . time() . "] ".$tab[$type] ."_HOST_EVENT_HANDLER;". $oreon->hosts[$arg]->get_name() ."' >> " . $oreon->Nagioscfg->command_file;
+	system($str);
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang['mon_request_submit_host']."</center></div>";
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+// ENABLE_HOST_SVC_NOTIFICATIONS
+
+function host_svc_notifications($oreon, $arg, $lang, $type)
+{
+	if (!$oreon->is_accessible($arg)){
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"window.location='./alt_error.php'\",0)</SCRIPT>";
+		return ;
+	}
+	$tab["1"] = "ENABLE";
+	$tab["0"] = "DISABLE";
+	$str = "echo '[" . time() . "] " . $tab[$type] . "_HOST_SVC_NOTIFICATIONS;". $oreon->hosts[$arg]->get_name() ."' >> " . $oreon->Nagioscfg->command_file;
+	system($str);
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang['mon_request_submit_host']."</center></div>";
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+// ENABLE_HOST_SVC_CHECKS
+
+function host_svc_checks($oreon, $arg, $lang, $type)
+{
+	if (!$oreon->is_accessible($arg)){
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"window.location='./alt_error.php'\",0)</SCRIPT>";
+		return ;
+	}
+	$tab["1"] = "ENABLE";
+	$tab["0"] = "DISABLE";
+	$str = "echo '[" . time() . "] " . $tab[$type] . "_HOST_SVC_CHECKS;". $oreon->hosts[$arg]->get_name() ."' >> " . $oreon->Nagioscfg->command_file;
+	system($str);
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang['mon_request_submit_host']."</center></div>";
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+// ENABLE_HOST_SVC_CHECKS
+
+function svc_check($oreon, $arg, $lang, $type)
+{
+	if (!$oreon->is_accessible($oreon->services[$arg]->get_host())){
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"window.location='./alt_error.php'\",0)</SCRIPT>";
+		return ;
+	}
+	$tab["1"] = "ENABLE";
+	$tab["0"] = "DISABLE";
+	$str = "echo '[" . time() . "] " . $tab[$type] . "_SVC_CHECK;". $oreon->hosts[$oreon->services[$arg]->get_host()]->get_name() .";" . $oreon->services[$arg]->get_description() . "' >> " . $oreon->Nagioscfg->command_file;
+	system($str);
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang['mon_request_submit_host']."</center></div>";
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+// SCHEDULE_SVC_CHECK
+
+function schedule_svc_check($oreon, $arg, $lang, $type, $forced)
+{
+	if (!$oreon->is_accessible($oreon->services[$arg]->get_host())){
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"window.location='./alt_error.php'\",0)</SCRIPT>";
+		return ;
+	}
+	if ($forced == 1)
+		$str_forced = "_FORCED";
+	else
+		$str_forced = "";
+	$str = "echo '[" . time() . "] SCHEDULE".$str_forced."_SVC_CHECK;". $oreon->hosts[$oreon->services[$arg]->get_host()]->get_name() .";" . $oreon->services[$arg]->get_description() . ";" . time() . "' >> " . $oreon->Nagioscfg->command_file;
+	system($str);
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang['mon_request_submit_host']."</center></div>";
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+// PASSIVE_SVC_CHECKS
+
+function passive_svc_check($oreon, $arg, $lang, $type)
+{
+	if (!$oreon->is_accessible($oreon->services[$arg]->get_host())){
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"window.location='./alt_error.php'\",0)</SCRIPT>";
+		return ;
+	}
+	$tab["1"] = "ENABLE";
+	$tab["0"] = "DISABLE";
+	$str = "echo '[" . time() . "] " . $tab[$type] . "_PASSIVE_SVC_CHECKS;". $oreon->hosts[$oreon->services[$arg]->get_host()]->get_name() .";" . $oreon->services[$arg]->get_description() . "' >> " . $oreon->Nagioscfg->command_file;
+	system($str);
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang['mon_request_submit_host']."</center></div>";
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+// SVC_NOTIFICATIONS
+
+function sv_notifications($oreon, $arg, $lang, $type)
+{
+	if (!$oreon->is_accessible($oreon->services[$arg]->get_host())){
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"window.location='./alt_error.php'\",0)</SCRIPT>";
+		return ;
+	}
+	$tab["1"] = "ENABLE";
+	$tab["0"] = "DISABLE";
+	$str = "echo '[" . time() . "] " . $tab[$type] . "_SVC_NOTIFICATIONS;". $oreon->hosts[$oreon->services[$arg]->get_host()]->get_name() .";" . $oreon->services[$arg]->get_description() . "' >> " . $oreon->Nagioscfg->command_file;
+	system($str);
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang['mon_request_submit_host']."</center></div>";
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+// _SVC_EVENT_HANDLER
+
+function event_handler($oreon, $arg, $lang, $type)
+{
+	if (!$oreon->is_accessible($oreon->services[$arg]->get_host())){
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"window.location='./alt_error.php'\",0)</SCRIPT>";
+		return ;
+	}
+	$tab["1"] = "ENABLE";
+	$tab["0"] = "DISABLE";
+	$str = "echo '[" . time() . "] " . $tab[$type] . "_SVC_EVENT_HANDLER;". $oreon->hosts[$oreon->services[$arg]->get_host()]->get_name() .";" . $oreon->services[$arg]->get_description() . "' >> " . $oreon->Nagioscfg->command_file;
+	system($str);
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang['mon_request_submit_host']."</center></div>";
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+//_SVC_FLAP_DETECTION
+
+function flapping_enable($oreon, $arg, $lang, $type)
+{
+	if (!$oreon->is_accessible($oreon->services[$arg]->get_host())){
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"window.location='./alt_error.php'\",0)</SCRIPT>";
+		return ;
+	}
+	$tab["1"] = "ENABLE";
+	$tab["0"] = "DISABLE";
+	$str = "echo '[" . time() . "] " . $tab[$type] . "_SVC_FLAP_DETECTION;". $oreon->hosts[$oreon->services[$arg]->get_host()]->get_name() .";" . $oreon->services[$arg]->get_description() . "' >> " . $oreon->Nagioscfg->command_file;
+	system($str);
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang['mon_request_submit_host']."</center></div>";
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+function notifi_host_hostgroup($oreon, $arg, $lang, $type)
+{
+	$tab["1"] = "ENABLE";
+	$tab["0"] = "DISABLE";
+	foreach ($oreon->hostGroups[$arg]->hosts as $h){
+		$str = "echo '[" . time() . "] " . $tab[$type] . "_HOST_NOTIFICATIONS;". $h->get_name() ."' >> " . $oreon->Nagioscfg->command_file;
+		system($str);
+		unset($h);
+	}
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang['mon_request_submit_host']."</center></div>";
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+
+function notifi_svc_host_hostgroup($oreon, $arg, $lang, $type)
+{
+	$tab["1"] = "ENABLE";
+	$tab["0"] = "DISABLE";
+	foreach ($oreon->hostGroups[$arg]->hosts as $h){
+		$str = "echo '[" . time() . "] " . $tab[$type] . "_HOST_SVC_NOTIFICATIONS;". $h->get_name() ."' >> " . $oreon->Nagioscfg->command_file;
+		system($str);
+		unset($h);
+	}
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang['mon_request_submit_host']."</center></div>";
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+function checks_svc_host_hostgroup($oreon, $arg, $lang, $type)
+{
+	$tab["1"] = "ENABLE";
+	$tab["0"] = "DISABLE";
+	foreach ($oreon->hostGroups[$arg]->hosts as $h){
+		$str = "echo '[" . time() . "] " . $tab[$type] . "_HOST_SVC_CHECKS;". $h->get_name() ."' >> " . $oreon->Nagioscfg->command_file;
+		system($str);
+		unset($h);
+	}
+	print "<div style='padding-top: 50px' class='text11b'><center>".$lang['mon_request_submit_host']."</center></div>";
+	print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:history.go(-1)\",2000)</SCRIPT>";
+}
+
+///
+if (isset($_GET["cmd"]))
+	switch ($_GET["cmd"]) {
+		case 0: add_host_comment($oreon, $_GET["cmt"], $lang);break;//
+		case 1: add_svc_comment($oreon, $_GET["cmt"], $lang);break;//
+		case 2: del_host_comment($oreon, $_GET["id"], $lang);break;//
+		case 3: del_all_host_comment($oreon, $_GET["host"], $lang);break;//
+		case 4: del_svc_comment($oreon, $_GET["id"], $lang);break;//
+		case 5: send_cmd($oreon, $_GET["host"], $_GET["svc"], $lang);break;
+		case 6: send_cmd($oreon, "DELAY_HOST_NOTIFICATION", "", "", "", "", "");break;
+		case 7: send_cmd($oreon, "DELAY_SVC_NOTIFICATION", "", "", "", "", "");break;
+		case 8: schedule_svc_check($oreon, $_GET["id"], $lang, 1, 0);break;//
+		case 9: schedule_host_svc_checks($oreon, $_GET["id"], $lang);break;//
+		case 10: svc_check($oreon, $_GET["id"], $lang, 1);break;//
+		case 11: svc_check($oreon, $_GET["id"], $lang, 0);break;//
+		case 12: sv_notifications($oreon, $_GET["id"], $lang, 1);break;//
+		case 13: sv_notifications($oreon, $_GET["id"], $lang, 0);break;//
+		case 14: host_svc_notifications($oreon, $_GET["id"], $lang, 1);break;//
+		case 15: host_svc_notifications($oreon, $_GET["id"], $lang, 0);break;//
+		case 16: host_svc_checks($oreon, $_GET["id"], $lang, 1);break;
+		case 17: host_svc_checks($oreon, $_GET["id"], $lang, 0);break;
+		case 18: host_notification($oreon, $_GET["id"], $lang, 1);break;//
+		case 19: host_notification($oreon, $_GET["id"], $lang, 0);break;//
+		case 20: send_cmd($oreon, "ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST", "", "", "", "", "");break;
+		case 21: send_cmd($oreon, "DISABLE_ALL_NOTIFICATIONS_BEYOND_HOST", "", "", "", "", "");break;
+		case 22: send_cmd($oreon, "ENABLE_NOTIFICATIONS", "", "", "", "", "");break;
+		case 23: send_cmd($oreon, "DISABLE_NOTIFICATIONS", "", "", "", "", "");break;
+		case 24: send_cmd($oreon, "SHUTDOWN_PROGRAM", time(), "", "", "", "");break;//
+		case 25: send_cmd($oreon, "RESTART_PROGRAM", time(), "", "", "", "");break;//
+		case 26: send_cmd($oreon, "PROCESS_SERVICE_CHECK_RESULT", "", "", "", "", "");break;//
+		case 27: send_cmd($oreon, "SAVE_STATE_INFORMATION", "", "", "", "", "");break;
+		case 28: send_cmd($oreon, "READ_STATE_INFORMATION", "", "", "", "", "");break;
+		case 29: send_cmd($oreon, "START_EXECUTING_SVC_CHECKS", "", "", "", "", "");break;//
+		case 30: send_cmd($oreon, "STOP_EXECUTING_SVC_CHECKS", "", "", "", "", "");break;//
+		case 31: send_cmd($oreon, "START_ACCEPTING_PASSIVE_SVC_CHECKS", "", "", "", "", "");break;//
+		case 32: send_cmd($oreon, "STOP_ACCEPTING_PASSIVE_SVC_CHECKS", "", "", "", "", "");break;//
+		case 33: send_cmd($oreon, "ENABLE_PASSIVE_SVC_CHECKS", "", "", "", "", "");break;
+		case 34: send_cmd($oreon, "DISABLE_PASSIVE_SVC_CHECKS", "", "", "", "", "");break;
+		case 35: send_cmd($oreon, "ENABLE_EVENT_HANDLERS", "", "", "", "", "");break;//
+		case 36: send_cmd($oreon, "DISABLE_EVENT_HANDLERS", "", "", "", "", "");break;//
+		case 37: send_cmd($oreon, "START_OBSESSING_OVER_SVC_CHECKS", "", "", "", "", "");break;//
+		case 38: send_cmd($oreon, "STOP_OBSESSING_OVER_SVC_CHECKS", "", "", "", "", "");break;//
+		case 39: send_cmd($oreon, "ENABLE_FLAP_DETECTION", "", "", "", "", "");break;//
+		case 40: send_cmd($oreon, "DISABLE_FLAP_DETECTION", "", "", "", "", "");break;//
+		case 41: send_cmd($oreon, "ENABLE_PERFORMANCE_DATA", "", "", "", "", "");break;//
+		case 42: send_cmd($oreon, "DISABLE_PERFORMANCE_DATA", "", "", "", "", "");break;//
+		case 43: add_host_downtime(& $oreon, $_GET["dtm"], $lang);break;//
+		case 44: add_svc_downtime(& $oreon, $_GET["dtm"], $lang);break;//
+		case 45: del_host_downtime(& $oreon, $_GET, $lang);break;//
+		case 46: del_svc_downtime(& $oreon, $_GET, $lang);break;//
+		case 47: host_check(& $oreon, $_GET["id"], $lang, 1);break;//
+		case 48: host_check(& $oreon, $_GET["id"], $lang, 0);break;//
+		case 49: host_flap_detection(& $oreon, $_GET["id"], $lang, 1);break;//
+		case 50: host_flap_detection($oreon, $_GET["id"], $lang, 0);break;//
+		case 51: host_event_handler($oreon, $_GET["id"], $lang, 1);break;//
+		case 52: host_event_handler($oreon, $_GET["id"], $lang, 0);break;//
+		case 53: passive_svc_check($oreon, $_GET["id"], $lang, 1); break;//
+		case 54: passive_svc_check($oreon, $_GET["id"], $lang, 0); break;//
+		case 55: event_handler($oreon, $_GET["id"], $lang, 1); break;//
+		case 56: event_handler($oreon, $_GET["id"], $lang, 0); break;//
+		case 57: flapping_enable($oreon, $_GET["id"], $lang, 1); break;//
+		case 58: flapping_enable($oreon, $_GET["id"], $lang, 0); break;//
+		case 59: add_hostgroup_downtime($oreon, $_GET["dtm"], $lang);break;//
+		case 60: add_svc_hostgroup_downtime($oreon, $_GET["dtm"], $lang);break;//
+		case 61: notifi_host_hostgroup($oreon, $_GET["id"], $lang, 1);break;//
+		case 62: notifi_host_hostgroup($oreon, $_GET["id"], $lang, 0);break;//
+		case 63: notifi_svc_host_hostgroup($oreon, $_GET["id"], $lang, 1);break;//
+		case 64: notifi_svc_host_hostgroup($oreon, $_GET["id"], $lang, 0);break;//
+		case 65: checks_svc_host_hostgroup($oreon, $_GET["id"], $lang, 1);break;//
+		case 66: checks_svc_host_hostgroup($oreon, $_GET["id"], $lang, 0);break;//
+		case 67: schedule_svc_check($oreon, $_GET["id"], $lang, 1, 1);break;//
+	}
+?>
\ No newline at end of file
diff --git a/www/include/external_cmd/comments.php b/www/include/external_cmd/comments.php
new file mode 100644
index 0000000000000000000000000000000000000000..4c6f1bdcc90d842a55b336b12796636a585b9bcc
--- /dev/null
+++ b/www/include/external_cmd/comments.php
@@ -0,0 +1,72 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+
+	// Comments
+
+	function add_host_comment($oreon, $cmt, $lang){
+		$check = array("on" => 1, "off" => 0);
+		if (isset($cmt["pers"]))
+			$str = "echo '[" . time() . "] ADD_HOST_COMMENT;".$cmt["host_name"].";".$check[$cmt["pers"]].";".$cmt["auther"].";".$cmt["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+		else
+			$str = "echo '[" . time() . "] ADD_HOST_COMMENT;".$cmt["host_name"].";0;".$cmt["auther"].";".$cmt["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+		system($str);
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["cmt_added"]."</center></div>";
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=307'\",2000)</SCRIPT>";
+	
+	}
+	
+	function add_svc_comment($oreon, $cmt, $lang)
+	{
+		$check["on"] = 1;
+		$check["off"] = 0;
+		if (isset($cmt["pers"]))
+			$str = "echo '[" . time() . "] ADD_SVC_COMMENT;".$oreon->hosts[$cmt["host_id"]]->get_name().";".$cmt["svc"].";".$check[$cmt["pers"]].";".$cmt["auther"].";".$cmt["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+		else
+			$str = "echo '[" . time() . "] ADD_SVC_COMMENT;".$oreon->hosts[$cmt["host_id"]]->get_name().";".$cmt["svc"].";0;".$cmt["auther"].";".$cmt["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["cmt_added"]."</center></div>";
+		system($str);
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=307'\",2000)</SCRIPT>";
+	}
+	
+	function del_host_comment($oreon, $arg, $lang)
+	{
+		$str = "echo '[" . time() . "] DEL_HOST_COMMENT;".$arg."' >> " . $oreon->Nagioscfg->command_file;
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["cmt_del"]."</center></div>";
+		system($str);
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=307'\",2000)</SCRIPT>";
+	}
+	
+	function del_all_host_comment($oreon, $arg, $lang)
+	{
+		$str = "echo '[" . time() . "] DEL_ALL_HOST_COMMENTS;".$arg."' >> " . $oreon->Nagioscfg->command_file;
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["cmt_del_all"]."</center></div>";
+		system($str);
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=307'\",2000)</SCRIPT>";
+	}
+	
+	function del_svc_comment($oreon, $arg, $lang)
+	{
+		$str = "echo '[" . time() . "] DEL_SVC_COMMENT;".$arg."' >> " . $oreon->Nagioscfg->command_file;
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["cmt_del"]."</center></div>";
+		system($str);
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=307'\",2000)</SCRIPT>";
+	}
+	
+?>	
\ No newline at end of file
diff --git a/www/include/external_cmd/downtime.php b/www/include/external_cmd/downtime.php
new file mode 100644
index 0000000000000000000000000000000000000000..98bbb0290f9e5d544479d1b22e033c3d871a0c2b
--- /dev/null
+++ b/www/include/external_cmd/downtime.php
@@ -0,0 +1,184 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset($oreon))
+		exit();
+		
+	// Downtime
+	
+	function add_host_downtime_in_db($oreon, $dtm, $start_time, $end_time, $duration){
+		$check = array("on" => 1, "off" => 0);
+		global $pearDB;
+		$str =	"INSERT INTO `downtime` (`downtime_id`, `host_id`, `service_id`, `entry_time`, `author`, `comment`, `start_time`, `end_time`, `fixed`, `duration`)".
+				" VALUES ('', '".$dtm["host_name"]."', NULL, NOW( ) , '".$oreon->user->get_alias()."', '".$dtm["comment"]."', '".$start_time."', '".$end_time."', '".$check[$dtm["fixed"]]."', '".$duration."');";
+		$insert =& $pearDB->query($str);
+		if (PEAR::isError($pearDB))
+   			die($pearDB->getMessage());
+	}
+	
+	function add_hostGroup_downtime_in_db($oreon, $dtm, $start_time, $end_time, $duration, $host){
+		$check = array("on" => 1, "off" => 0);
+		global $pearDB;
+		$str = 	"INSERT INTO `downtime` (`downtime_id`, `host_id`, `service_id`, `entry_time`, `author`, `comment`, `start_time`, `end_time`, `fixed`, `duration`)".
+				" VALUES ('', '".$host."', NULL, NOW( ) , '".$oreon->user->get_alias()."', '".$dtm["comment"]."', '".$start_time."', '".$end_time."', '".$check[$dtm["fixed"]]."', '".$duration."');";
+		$insert =& $pearDB->query($str);
+		if (PEAR::isError($pearDB))
+   			die($pearDB->getMessage());
+	}
+	
+	function add_svc_downtime_in_db($oreon, $dtm, $start_time, $end_time, $duration){
+		$check = array("on" => 1, "off" => 0);
+		global $pearDB;
+		$str = 	"INSERT INTO `downtime` (`downtime_id`, `host_id`, `service_id`, `entry_time`, `author`, `comment`, `start_time`, `end_time`, `fixed`, `duration`)".
+				" VALUES ('', '".$dtm["host_id"]."', '".$dtm["service"]."', NOW( ) , '".$oreon->user->get_alias()."', '".$dtm["comment"]."', '".$start_time."', '".$end_time."', '".$check[$dtm["fixed"]]."', '".$duration."');";
+		$insert =& $pearDB->query($str);
+		if (PEAR::isError($pearDB))
+   			die($pearDB->getMessage());
+	}
+	
+	function del_svc_downtime_in_db($start_time, $host, $svc){
+		global $pearDB;
+		$host =& $pearDB->query("SELECT host_id FROM host WHERE `host_name` = '".$host."'");
+		$host_name = $host->fetchRow();				
+		$service =& $pearDB->query("SELECT service_id FROM service WHERE `service_description` = '".$svc."'");
+		$service_desc = $service->fetchRow();				
+		$str = 	"UPDATE `downtime` SET `deleted` = '1' WHERE `service_id` = '".$service_desc["service_id"]."' AND `host_id` = '".$host_name["host_id"]."' AND `start_time` = '".$start_time."' LIMIT 1 ;";
+		$update =& $pearDB->query($str);
+		if (PEAR::isError($pearDB))
+   			die($pearDB->getMessage());
+	}
+	
+	function del_host_downtime_in_db($start_time, $host){
+		global $pearDB;
+		$host =& $pearDB->query("SELECT host_id FROM host WHERE `host_name` = '".$host."'");
+		$host_name = $host->fetchRow();				
+		$str = 	"UPDATE `downtime` SET `deleted` = '1' WHERE `host_id` = '".$host_name["host_id"]."' AND `start_time` = '".$start_time."' LIMIT 1 ;";
+		$update =& $pearDB->query($str);
+		if (PEAR::isError($pearDB))
+   			die($pearDB->getMessage());
+	}
+	
+	function add_host_downtime($oreon, $dtm, $lang){
+		$check = array("on" => 1, "off" => 0);
+		$res = preg_split("/ /", $dtm["strtime"]);
+		$res1 = preg_split("/-/", $res[0]);
+		$res2 = preg_split("/:/", $res[1]);
+		$start_time = mktime($res2[0], $res2[1], $res2[2], $res1[1], $res1[0], $res1[2]);
+		$res = preg_split("/ /", $dtm["endtime"]);
+		$res3 = preg_split("/-/", $res[0]);
+		$res4 = preg_split("/:/", $res[1]);
+		$end_time = mktime($res4[0], $res4[1], $res4[2], $res3[1], $res3[0], $res3[2]);
+		$duration = $end_time - $start_time;
+		if (!isset($dtm["fixed"]))
+			$dtm["fixed"] = "off";
+		add_host_downtime_in_db(&$oreon, $dtm, $start_time, $end_time,$duration);
+		$str = "echo '[" . time() . "] SCHEDULE_HOST_DOWNTIME;".$oreon->hosts[$dtm["host_name"]]->get_name().";".$start_time.";".$end_time.";".$check[$dtm["fixed"]].";".$duration.";".$oreon->user->get_alias().";".$dtm["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+		system($str);
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["dtm_added"]."</center></div>";
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=308'\",2000)</SCRIPT>";
+	}
+	
+	function add_svc_downtime($oreon, $dtm, $lang){
+		$check = array("on" => 1, "off" => 0);
+		$res = preg_split("/ /", $dtm["strtime"]);
+		$res1 = preg_split("/-/", $res[0]);
+		$res2 = preg_split("/:/", $res[1]);
+		$start_time = mktime($res2[0], $res2[1], $res2[2], $res1[1], $res1[0], $res1[2]);
+		$res = preg_split("/ /", $dtm["endtime"]);
+		$res3 = preg_split("/-/", $res[0]);
+		$res4 = preg_split("/:/", $res[1]);
+		$end_time = mktime($res4[0], $res4[1], $res4[2], $res3[1], $res3[0], $res3[2]);
+		$duration = $end_time - $start_time;
+		if (!isset($dtm["fixed"])) $dtm["fixed"] = "off";
+		add_svc_downtime_in_db(&$oreon, $dtm, $start_time, $end_time,$duration);
+		$str = "echo '[" . time() . "] SCHEDULE_SVC_DOWNTIME;".$oreon->hosts[$dtm["host_id"]]->get_name().";".$oreon->services[$dtm["service"]]->get_description().";".$start_time.";".$end_time.";".$check[$dtm["fixed"]].";".$duration.";".$oreon->user->get_alias().";".$dtm["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+		system($str);
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["dtm_added"]."</center></div>";
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=308'\",2000)</SCRIPT>";
+	}
+	
+	function add_svc_hostgroup_downtime($oreon, $dtm, $lang){
+		$check = array("on" => 1, "off" => 0);
+		$res = preg_split("/ /", $dtm["strtime"]);
+		$res1 = preg_split("/-/", $res[0]);
+		$res2 = preg_split("/:/", $res[1]);
+		$start_time = mktime($res2[0], $res2[1], $res2[2], $res1[1], $res1[0], $res1[2]);
+		$res = preg_split("/ /", $dtm["endtime"]);
+		$res3 = preg_split("/-/", $res[0]);
+		$res4 = preg_split("/:/", $res[1]);
+		$end_time = mktime($res4[0], $res4[1], $res4[2], $res3[1], $res3[0], $res3[2]);
+		$duration = $end_time - $start_time;
+		if (!isset($dtm["fixed"]))
+			$dtm["fixed"] = "off";
+		foreach ($oreon->hostGroups[$dtm["host_group"]]->hosts as $h){
+			foreach ($h->services as $s){
+				add_hostGroup_downtime_in_db(&$oreon, $dtm, $start_time, $end_time,$duration, $h->get_id());
+				$str = "echo '[" . time() . "] SCHEDULE_SVC_DOWNTIME;".$h->get_name().";".$s->get_description().";".$start_time.";".$end_time.";".$check[$dtm["fixed"]].";".$duration.";".$oreon->user->get_alias().";".$dtm["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+				system($str);
+				unset($s);
+			}
+			unset($h);
+		}
+		if (isset($dtm["host_too"]))
+			foreach ($oreon->hostGroups[$dtm["host_group"]]->hosts as $h){
+				$str = "echo '[" . time() . "] SCHEDULE_HOST_DOWNTIME;".$h->get_name().";".$start_time.";".$end_time.";".$check[$dtm["fixed"]].";".$duration.";".$oreon->user->get_alias().";".$dtm["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+				system($str);
+				unset($h);
+			}
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["dtm_added"]."</center></div>";
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=308'\",2000)</SCRIPT>";
+	}
+	
+	function add_hostgroup_downtime($oreon, $dtm, $lang){
+		$check = array("on" => 1, "off" => 0);
+		$res = preg_split("/ /", $dtm["strtime"]);
+		$res1 = preg_split("/-/", $res[0]);
+		$res2 = preg_split("/:/", $res[1]);
+		$start_time = mktime($res2[0], $res2[1], $res2[2], $res1[1], $res1[0], $res1[2]);
+		$res = preg_split("/ /", $dtm["endtime"]);
+		$res3 = preg_split("/-/", $res[0]);
+		$res4 = preg_split("/:/", $res[1]);
+		$end_time = mktime($res4[0], $res4[1], $res4[2], $res3[1], $res3[0], $res3[2]);
+		$duration = $end_time - $start_time;
+		if (!isset($dtm["fixed"]))
+			$dtm["fixed"] = "off";
+		foreach ($oreon->hostGroups[$dtm["host_group"]]->hosts as $h){
+			add_hostGroup_downtime_in_db(&$oreon, $dtm, $start_time, $end_time, $duration, $h->get_id());
+			$str = "echo '[" . time() . "] SCHEDULE_HOST_DOWNTIME;".$h->get_name().";".$start_time.";".$end_time.";".$check[$dtm["fixed"]].";".$duration.";".$oreon->user->get_alias().";".$dtm["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+			system($str);
+		}
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["dtm_added"]."</center></div>";
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=308'\",2000)</SCRIPT>";
+	}
+	
+	function del_host_downtime($oreon, $arg, $lang){
+		$str = "echo '[" . time() . "] DEL_HOST_DOWNTIME;".$arg["id"]."' >> " . $oreon->Nagioscfg->command_file;
+		del_host_downtime_in_db($arg["start_time"], $arg["host"]);
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["dtm_del"]."</center></div>";
+		system($str);
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=308'\",2000)</SCRIPT>";
+	}
+	
+	function del_svc_downtime($oreon, $arg, $lang){
+		$str = "echo '[" . time() . "] DEL_SVC_DOWNTIME;".$arg["id"]."' >> " . $oreon->Nagioscfg->command_file;
+		print $arg["svc"];
+		del_svc_downtime_in_db($arg["start_time"], $arg["host"], $arg["svc"]);
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["dtm_del"]."</center></div>";
+		system($str);
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=308'\",2000)</SCRIPT>";
+	}
+?>
\ No newline at end of file
diff --git a/www/include/external_cmd/host_cmd.php b/www/include/external_cmd/host_cmd.php
new file mode 100644
index 0000000000000000000000000000000000000000..ff1bf7bda2320e4a420288e63f4decfd91de3748
--- /dev/null
+++ b/www/include/external_cmd/host_cmd.php
@@ -0,0 +1,58 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Jean Baptiste Gouret - Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+?>
+	<br><br>
+	<table border=0 width="35%" height="50%">
+	<tr>
+		<td>
+		<? include("./tab3Top.php"); ?>
+		<form action="" method="get">
+			<table width="100%" height='100%' border=0>
+			<tr>
+				<td class="text10b">Host Name<font color="red">*</font></td>
+				<td><input name="p" type="hidden" value="306"><input name="cmd" type="hidden" value="0">
+					  <select name="cmt[host_name]">
+						<? 
+						if (isset($oreon->hosts))
+							foreach ($oreon->hosts as $h)
+								if ($h->register != 0)
+									print "<option>".$h->get_name()."</option>";
+					  	?>
+					  </select>
+				</td>
+			</tr>
+			<tr>
+				<td class="text10b">Persistent</td>
+				<td><input name="cmt[pers]" type="checkbox" checked></td>
+			</tr>	
+			<tr>
+				<td class="text10b">Auteur<font color="red">*</font> </td>
+				<td><input name="cmt[auther]" type="text" value="<? print $oreon->user->get_alias(); ?>"></td>
+			</tr>
+			<tr>
+				<td class="text10b" valign="top">Comment<font color="red">*</font></td>
+				<td><textarea name="cmt[comment]" cols="40" rows="7"></textarea></td>
+			</tr>
+			<tr>
+				<td colspan="2" align="center"><br><bR><br> <input name="envoyer" type="submit"></td>
+			</tr>
+			</table>
+		<? include("./tab3Bot.php"); ?></form>
+		</td>
+	</tr>
+	</table>	
\ No newline at end of file
diff --git a/www/include/external_cmd/index.html b/www/include/external_cmd/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/external_cmd/launch_cmd.php b/www/include/external_cmd/launch_cmd.php
new file mode 100644
index 0000000000000000000000000000000000000000..58e81fb603352f6b6cd2b18fc960781191de7214
--- /dev/null
+++ b/www/include/external_cmd/launch_cmd.php
@@ -0,0 +1,76 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Jean Baptiste Gouret - Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+?>
+<td width='85%'>
+<?
+	function reschedule_chk_host($oreon, $id)
+	{
+		?>
+		<br><br>
+		<table border=0 width="35%" height="50%">
+		<tr>
+			<td>
+			<? include("./tab3Top.php"); ?>
+			<form action="" method="get">
+				<table width="100%" height='100%' border=0>
+				<tr>
+					<td class="text10b">Host Name<font color="red">*</font></td>
+					<td><input name="p" type="hidden" value="306"><input name="cmd" type="hidden" value="0">
+						  <select name="cmt[host_name]">
+							<? 
+							if (isset($oreon->hosts))
+								foreach ($oreon->hosts as $h)
+									if ($h->register != 1)
+										print "<option>".$h->get_name()."</option>";
+							?>
+						  </select>
+					</td>
+				</tr>
+				<tr>
+					<td class="text10b">Persistent</td>
+					<td><input name="cmt[pers]" type="checkbox" checked></td>
+				</tr>	
+				<tr>
+					<td class="text10b">Auteur<font color="red">*</font> </td>
+					<td><input name="cmt[auther]" type="text" value="<? print $oreon->user->get_alias(); ?>"></td>
+				</tr>
+				<tr>
+					<td class="text10b" valign="top">Comment<font color="red">*</font></td>
+					<td><textarea name="cmt[comment]" cols="40" rows="7"></textarea></td>
+				</tr>
+				<tr>
+					<td colspan="2" align="center"><br><bR><br> <input name="envoyer" type="submit"></td>
+				</tr>
+				</table>
+			<? include("./tab3Bot.php"); ?></form>
+			</td>
+		</tr>
+		</table>	
+		<?
+	}
+	
+
+
+
+if (isset($_GET["cmd"]))
+	switch ($_GET["cmd"]) {
+		case 1: reschedule_chk_host($oreon, $_GET['id']);break;//
+	}
+?>
+
+</td>
diff --git a/www/include/home/home.ihtml b/www/include/home/home.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..1a6c58f9c5021d9dceff35cfa486c5b4c12479f9
--- /dev/null
+++ b/www/include/home/home.ihtml
@@ -0,0 +1,18 @@
+<div align="center" style="padding-bottom: 20px;margin:1px;">
+	<table>
+		<tr>
+			<td>
+				<table id="ListTable">
+					<tr class='ListHeader'>
+						<td>Host Stats</td>
+					</tr>
+					<tr>
+						<td>
+							<img src='./include/home/pie_chart_host.php'><img src='./include/home/pie_chart_service.php'>
+						</td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+	</table>
+</div>
\ No newline at end of file
diff --git a/www/include/home/home.php b/www/include/home/home.php
new file mode 100644
index 0000000000000000000000000000000000000000..632338328623e1a280b25dd26711e6b359699c47
--- /dev/null
+++ b/www/include/home/home.php
@@ -0,0 +1,49 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick
+Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS. OREON makes no representation
+and gives no warranty whatsoever, whether express or implied, and without limitation, 
+with regard to the quality, safety, contents, performance, merchantability, non-infringement
+or suitability for any particular or intended purpose of the Software found on the OREON web
+site. In no event will OREON be liable for any direct, indirect, punitive, special, incidental
+or consequential damages however they may arise and even if OREON has been previously advised 
+of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit(); 
+	
+	include_once("./include/monitoring/common-Func.php");
+
+?>
+<div align="center" style="padding-bottom: 20px;">
+	<?	include("./include/monitoring/status/resume.php"); ?>
+</div>
+<?	
+	unset($tpl);
+	unset($path);
+
+	$path = "./include/home/";
+		
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "./");	
+	
+	$tpl->assign("ssvc", $statistic_service);
+	$tpl->assign("sh", $statistic_host);
+	if (isset($host_status))
+		$oreon->status_graph_host = $host_status;
+	if (isset($service_status))
+		$oreon->status_graph_service = $service_status;
+	$tpl->assign("session", session_id());
+	$tpl->display("home.ihtml");
+?>
+
diff --git a/www/include/home/odo_host.php b/www/include/home/odo_host.php
new file mode 100644
index 0000000000000000000000000000000000000000..7a3d510db6076b0d80d3b6a5e5da23b5677c650f
--- /dev/null
+++ b/www/include/home/odo_host.php
@@ -0,0 +1,123 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick
+Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS. OREON makes no representation
+and gives no warranty whatsoever, whether express or implied, and without limitation, 
+with regard to the quality, safety, contents, performance, merchantability, non-infringement
+or suitability for any particular or intended purpose of the Software found on the OREON web
+site. In no event will OREON be liable for any direct, indirect, punitive, special, incidental
+or consequential damages however they may arise and even if OREON has been previously advised 
+of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	require_once 'Image/Graph.php';
+	require_once 'Image/Canvas.php';
+	
+
+	// create the graph
+	$driver=& Image_Canvas::factory('png',array('width'=>300,'height'=>250,'antialias' => 'native'));
+	$Graph = & Image_Graph::factory('graph', $driver);
+	// add a TrueType font
+	$Font =& $Graph->addNew('font', 'Arial');
+	// set the font size to 11 pixels
+	$Font->setSize(8);
+	
+	$Graph->setFont($Font);
+	
+	// create the plotarea
+	$Graph->add(
+	    Image_Graph::vertical(
+	        Image_Graph::factory('title', array('Host Status Level', 10)),
+	        Image_Graph::vertical(
+	            $Plotarea = Image_Graph::factory('plotarea'),
+	            $Legend = Image_Graph::factory('legend'),
+	            80
+	        ),
+	        10
+	    )
+	);
+	$Graph->setBackgroundColor('#fff9eb');
+	$Legend->setPlotarea($Plotarea);
+	$Legend->setAlignment(IMAGE_GRAPH_ALIGN_HORIZONTAL);
+	
+	/***************************Arrows************************/
+	$Arrows = & Image_Graph::factory('dataset');
+	
+	$total = $_GET["u"] + $_GET["d"] + $_GET["un"] + $_GET["p"]; 
+	$current_level = $_GET["u"] / $total * 100;
+	$Arrows->addPoint('Hosts Status Level', round($current_level), 'OK');
+	//$Arrows->setFontSize(10);
+	
+	/**************************PARAMATERS for PLOT*******************/
+	// create the plot as odo chart using the dataset
+	$Plot =& $Plotarea->addNew('Image_Graph_Plot_Odo',$Arrows);
+	$Plot->setRange(0,100);
+	$Plot->setAngles(135, 270);
+	$Plot->setRadiusWidth(70);
+	$Plot->setLineColor('gray');
+	
+	//for range and outline
+	$Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_VALUE_Y);
+	$Plot->setArrowMarker($Marker);
+	$Plotarea->hideAxis();
+	
+	/***************************Axis************************/
+	// create a Y data value marker
+	
+	$Marker->setFillColor('transparent');
+	$Marker->setBorderColor('transparent');
+	$Marker->setFontSize(7);
+	$Marker->setFontColor('black');
+	
+	// create a pin-point marker type
+	$Plot->setTickLength(14);
+	$Plot->setAxisTicks(5);
+	/********************************color of arrows*************/
+	$FillArray = & Image_Graph::factory('Image_Graph_Fill_Array');
+	$FillArray->addColor('blue@0.6', 'Current Level');
+	
+	// create a line array
+	$LineArray =& Image_Graph::factory('Image_Graph_Line_Array');
+	$LineArray->addColor('blue', 'Current Level');
+	$Plot->setArrowLineStyle($LineArray);
+	$Plot->setArrowFillStyle($FillArray);
+	
+	/***************************MARKER OR ARROW************************/
+	
+	// create a Y data value marker
+	$Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_VALUE_Y);
+	$Marker->setFillColor('black');
+	$Marker->setBorderColor('blue');
+	$Marker->setFontSize(9);
+	$Marker->setFontColor('white');
+	
+	// create a pin-point marker type
+	$PointingMarker =& $Plot->addNew('Image_Graph_Marker_Pointing_Angular', array(40, &$Marker));
+	
+	// and use the marker on the plot
+	$Plot->setMarker($PointingMarker);
+	/**************************RANGE*******************/
+	
+	// create the dataset
+	$Plot->addRangeMarker(0, 80);
+	$Plot->addRangeMarker(80, 90);
+	$Plot->addRangeMarker(90, 100);
+	
+	// create a fillstyle for the ranges
+	$FillRangeArray = & Image_Graph::factory('Image_Graph_Fill_Array');
+	$FillRangeArray->addColor('#ff0000@0.5');
+	$FillRangeArray->addColor('orange@0.7');
+	$FillRangeArray->addColor('green@0.7');
+	$Plot->setRangeMarkerFillStyle($FillRangeArray);
+	
+	// output the Graph
+	$Graph->done();
+?>
\ No newline at end of file
diff --git a/www/include/home/odo_hostgroup.php b/www/include/home/odo_hostgroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..cebf3b7c5544cb37c2c9576e346ab08c5d874edd
--- /dev/null
+++ b/www/include/home/odo_hostgroup.php
@@ -0,0 +1,126 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick
+Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS. OREON makes no representation
+and gives no warranty whatsoever, whether express or implied, and without limitation, 
+with regard to the quality, safety, contents, performance, merchantability, non-infringement
+or suitability for any particular or intended purpose of the Software found on the OREON web
+site. In no event will OREON be liable for any direct, indirect, punitive, special, incidental
+or consequential damages however they may arise and even if OREON has been previously advised 
+of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit(); 
+		
+	require_once 'Image/Graph.php';
+	require_once 'Image/Canvas.php';
+	
+
+	// create the graph
+	$driver=& Image_Canvas::factory('png',array('width'=>200,'height'=>200,'antialias' => 'native'));
+	$Graph = & Image_Graph::factory('graph', $driver);
+	// add a TrueType font
+	$Font =& $Graph->addNew('font', 'Arial');
+	// set the font size to 11 pixels
+	$Font->setSize(8);
+	
+	$Graph->setFont($Font);
+	
+	// create the plotarea
+	$Graph->add(
+	    Image_Graph::vertical(
+	        Image_Graph::factory('title', array('Host Status Level', 10)),
+	        Image_Graph::vertical(
+	            $Plotarea = Image_Graph::factory('plotarea'),
+	            $Legend = Image_Graph::factory('legend'),
+	            80
+	        ),
+	        10
+	    )
+	);
+	$Graph->setBackgroundColor('#fff9eb');
+	$Legend->setPlotarea($Plotarea);
+	$Legend->setAlignment(IMAGE_GRAPH_ALIGN_HORIZONTAL);
+	
+	/***************************Arrows************************/
+	$Arrows = & Image_Graph::factory('dataset');
+	
+	$total = $_GET["u"] + $_GET["d"] + $_GET["un"] + $_GET["p"]; 
+	$current_level = $_GET["u"] / $total * 100;
+	$Arrows->addPoint('Hosts Status Level', round($current_level), 'OK');
+	//$Arrows->setFontSize(10);
+	
+	/**************************PARAMATERS for PLOT*******************/
+	// create the plot as odo chart using the dataset
+	$Plot =& $Plotarea->addNew('Image_Graph_Plot_Odo',$Arrows);
+	$Plot->setRange(0,100);
+	$Plot->setAngles(135, 270);
+	$Plot->setRadiusWidth(70);
+	$Plot->setLineColor('gray');
+	
+	//for range and outline
+	$Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_VALUE_Y);
+	$Plot->setArrowMarker($Marker);
+	$Plotarea->hideAxis();
+	
+	/***************************Axis************************/
+	// create a Y data value marker
+	
+	$Marker->setFillColor('transparent');
+	$Marker->setBorderColor('transparent');
+	$Marker->setFontSize(7);
+	$Marker->setFontColor('black');
+	
+	// create a pin-point marker type
+	$Plot->setTickLength(14);
+	$Plot->setAxisTicks(5);
+	/********************************color of arrows*************/
+	$FillArray = & Image_Graph::factory('Image_Graph_Fill_Array');
+	$FillArray->addColor('blue@0.6', 'Current Level');
+	
+	// create a line array
+	$LineArray =& Image_Graph::factory('Image_Graph_Line_Array');
+	$LineArray->addColor('blue', 'Current Level');
+	$Plot->setArrowLineStyle($LineArray);
+	$Plot->setArrowFillStyle($FillArray);
+	
+	/***************************MARKER OR ARROW************************/
+	
+	// create a Y data value marker
+	$Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_VALUE_Y);
+	$Marker->setFillColor('black');
+	$Marker->setBorderColor('blue');
+	$Marker->setFontSize(9);
+	$Marker->setFontColor('white');
+	
+	// create a pin-point marker type
+	$PointingMarker =& $Plot->addNew('Image_Graph_Marker_Pointing_Angular', array(40, &$Marker));
+	
+	// and use the marker on the plot
+	$Plot->setMarker($PointingMarker);
+	/**************************RANGE*******************/
+	
+	// create the dataset
+	$Plot->addRangeMarker(0, 80);
+	$Plot->addRangeMarker(80, 90);
+	$Plot->addRangeMarker(90, 100);
+	
+	// create a fillstyle for the ranges
+	$FillRangeArray = & Image_Graph::factory('Image_Graph_Fill_Array');
+	$FillRangeArray->addColor('#ff0000@0.5');
+	$FillRangeArray->addColor('orange@0.7');
+	$FillRangeArray->addColor('green@0.7');
+	$Plot->setRangeMarkerFillStyle($FillRangeArray);
+	
+	// output the Graph
+	$Graph->done();
+?>
\ No newline at end of file
diff --git a/www/include/home/odo_svc.php b/www/include/home/odo_svc.php
new file mode 100644
index 0000000000000000000000000000000000000000..d5ccd22b0de291963e3d9f73747d90e55dc1a902
--- /dev/null
+++ b/www/include/home/odo_svc.php
@@ -0,0 +1,123 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick
+Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS. OREON makes no representation
+and gives no warranty whatsoever, whether express or implied, and without limitation, 
+with regard to the quality, safety, contents, performance, merchantability, non-infringement
+or suitability for any particular or intended purpose of the Software found on the OREON web
+site. In no event will OREON be liable for any direct, indirect, punitive, special, incidental
+or consequential damages however they may arise and even if OREON has been previously advised 
+of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	require_once 'Image/Graph.php';
+	require_once 'Image/Canvas.php';
+	
+
+	// create the graph
+	$driver=& Image_Canvas::factory('png',array('width'=>300,'height'=>250,'antialias' => 'native'));
+	$Graph = & Image_Graph::factory('graph', $driver);
+	// add a TrueType font
+	$Font =& $Graph->addNew('font', 'Arial');
+	// set the font size to 11 pixels
+	$Font->setSize(8);
+	
+	$Graph->setFont($Font);
+	
+	// create the plotarea
+	$Graph->add(
+	    Image_Graph::vertical(
+	        Image_Graph::factory('title', array('Services Status', 10)),
+	        Image_Graph::vertical(
+	            $Plotarea = Image_Graph::factory('plotarea'),
+	            $Legend = Image_Graph::factory('legend'),
+	            80
+	        ),
+	        10
+	    )
+	);
+	$Graph->setBackgroundColor('#fff9eb');
+	$Legend->setPlotarea($Plotarea);
+	$Legend->setAlignment(IMAGE_GRAPH_ALIGN_HORIZONTAL);
+	
+	/***************************Arrows************************/
+	$Arrows = & Image_Graph::factory('dataset');
+	
+	$total = $_GET["o"] + $_GET["c"] + $_GET["w"] + $_GET["p"] + $_GET["un"];
+	$current_level = $_GET["o"] / $total * 100;
+	$Arrows->addPoint('Services Status', round($current_level), 'OK');
+	//$Arrows->setFontSize(10);
+	
+	/**************************PARAMATERS for PLOT*******************/
+	// create the plot as odo chart using the dataset
+	$Plot =& $Plotarea->addNew('Image_Graph_Plot_Odo',$Arrows);
+	$Plot->setRange(0,100);
+	$Plot->setAngles(135, 270);
+	$Plot->setRadiusWidth(70);
+	$Plot->setLineColor('gray');
+	
+	//for range and outline
+	$Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_VALUE_Y);
+	$Plot->setArrowMarker($Marker);
+	$Plotarea->hideAxis();
+	
+	/***************************Axis************************/
+	// create a Y data value marker
+	
+	$Marker->setFillColor('transparent');
+	$Marker->setBorderColor('transparent');
+	$Marker->setFontSize(7);
+	$Marker->setFontColor('black');
+	
+	// create a pin-point marker type
+	$Plot->setTickLength(14);
+	$Plot->setAxisTicks(5);
+	/********************************color of arrows*************/
+	$FillArray = & Image_Graph::factory('Image_Graph_Fill_Array');
+	$FillArray->addColor('blue@0.6', 'Current Level');
+	
+	// create a line array
+	$LineArray =& Image_Graph::factory('Image_Graph_Line_Array');
+	$LineArray->addColor('blue', 'Current Level');
+	$Plot->setArrowLineStyle($LineArray);
+	$Plot->setArrowFillStyle($FillArray);
+	
+	/***************************MARKER OR ARROW************************/
+	
+	// create a Y data value marker
+	$Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_VALUE_Y);
+	$Marker->setFillColor('black');
+	$Marker->setBorderColor('blue');
+	$Marker->setFontSize(9);
+	$Marker->setFontColor('white');
+	
+	// create a pin-point marker type
+	$PointingMarker =& $Plot->addNew('Image_Graph_Marker_Pointing_Angular', array(40, &$Marker));
+	
+	// and use the marker on the plot
+	$Plot->setMarker($PointingMarker);
+	/**************************RANGE*******************/
+	
+	// create the dataset
+	$Plot->addRangeMarker(0, 80);
+	$Plot->addRangeMarker(80, 90);
+	$Plot->addRangeMarker(90, 100);
+	
+	// create a fillstyle for the ranges
+	$FillRangeArray = & Image_Graph::factory('Image_Graph_Fill_Array');
+	$FillRangeArray->addColor('#ff0000@0.5');
+	$FillRangeArray->addColor('orange@0.7');
+	$FillRangeArray->addColor('green@0.7');
+	$Plot->setRangeMarkerFillStyle($FillRangeArray);
+	
+	// output the Graph
+	$Graph->done();
+?>
\ No newline at end of file
diff --git a/www/include/home/pie_chart.php b/www/include/home/pie_chart.php
new file mode 100644
index 0000000000000000000000000000000000000000..67da4fd1fbdf484f4be2a12f81576d3f27e9202f
--- /dev/null
+++ b/www/include/home/pie_chart.php
@@ -0,0 +1,105 @@
+<?php
+/**
+ * Usage example for Image_Graph.
+ * 
+ * Main purpose: 
+ * Show pie chart
+ * 
+ * Other: 
+ * None specific
+ * 
+ * $Id: plot_pie_rest.php,v 1.1 2005/10/13 20:18:27 nosey Exp $
+ * 
+ * @package Image_Graph
+ * @author Jesper Veggerby <pear.nosey@veggerby.dk>
+ */
+
+	require_once 'Image/Graph.php';
+	
+	require_once ("../../class/Session.class.php");
+	require_once ("../../class/Oreon.class.php");
+
+	Session::start();
+	$oreon =& $_SESSION["oreon"];
+
+	// create the graph
+	$Graph =& Image_Graph::factory('graph', array(300, 250));
+	// add a TrueType font
+	$Font =& $Graph->addNew('font', 'Arial');
+	// set the font size to 11 pixels
+	$Font->setSize(7);
+	$Graph->setFont($Font);
+	
+	// setup the plotarea, legend and their layout
+	$Graph->add(
+	   Image_Graph::vertical(
+	      Image_Graph::factory('title', array('Services', 10)),        
+	      Image_Graph::vertical(
+	         $Plotarea = Image_Graph::factory('plotarea'),
+	         $Legend = Image_Graph::factory('legend'),
+	         80
+	      ),
+	      10
+	   )
+	);
+	$Graph->setBackgroundColor('#fff9eb');
+	$Legend->setPlotArea($Plotarea);
+	
+	$Plotarea->hideAxis();
+	$Plotarea->setBackgroundColor('#fff9eb');
+	
+	// create the dataset
+	
+	$tab = array();
+	foreach ($oreon->status_graph_service as $s){
+		if (!isset($tab[strtolower($s["status"])]))
+			$tab[strtolower($s["status"])] = 0;
+		$tab[strtolower($s["status"])]++;
+	}
+	$tab2 = array();
+	foreach ($tab as $key => $value){
+		$tab2[$key . " - ". $value] = $value;
+	}
+
+	$Dataset =& Image_Graph::factory('dataset', array($tab2));
+	
+	// create the 1st plot as smoothed area chart using the 1st dataset
+	$Plot =& $Plotarea->addNew('Image_Graph_Plot_Pie', $Dataset);
+	
+	$Plot->Radius = 2;
+	    
+	// set a line color
+	$Plot->setLineColor('gray');
+	
+	// set a standard fill style
+	
+	
+	
+	$FillArray =& Image_Graph::factory('Image_Graph_Fill_Array');
+	$Plot->setFillStyle($FillArray);
+	
+	foreach ($tab as $key => $value){
+		$FillArray->addColor($oreon->optGen["color_".$key]."@0.2");
+	}
+
+	$Plot->explode(4);
+	
+	
+	// create a Y data value marker
+	$Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_PCT_Y_TOTAL);
+	// fill it with white
+	$Marker->setFillColor('white');
+	// and use black border
+	$Marker->setBorderColor('black');
+	// and format it using a data preprocessor
+	$Marker->setDataPreprocessor(Image_Graph::factory('Image_Graph_DataPreprocessor_Formatted', '%0.1f%%'));
+	$Marker->setFontSize(7);
+	
+	// create a pin-point marker type
+	$PointingMarker =& $Plot->addNew('Image_Graph_Marker_Pointing_Angular', array(20, &$Marker));
+	// and use the marker on the plot
+	$Plot->setMarker($PointingMarker);
+	
+	// output the Graph
+	$Graph->done();
+?>
\ No newline at end of file
diff --git a/www/include/home/pie_chart_host.php b/www/include/home/pie_chart_host.php
new file mode 100644
index 0000000000000000000000000000000000000000..b9952e3105c3c29f6c7181e1253aa98d2ca4af51
--- /dev/null
+++ b/www/include/home/pie_chart_host.php
@@ -0,0 +1,105 @@
+<?php
+/**
+ * Usage example for Image_Graph.
+ * 
+ * Main purpose: 
+ * Show pie chart
+ * 
+ * Other: 
+ * None specific
+ * 
+ * $Id: plot_pie_rest.php,v 1.1 2005/10/13 20:18:27 nosey Exp $
+ * 
+ * @package Image_Graph
+ * @author Jesper Veggerby <pear.nosey@veggerby.dk>
+ */
+
+	require_once 'Image/Graph.php';
+	
+	require_once ("../../class/Session.class.php");
+	require_once ("../../class/Oreon.class.php");
+
+	Session::start();
+	$oreon =& $_SESSION["oreon"];
+
+	// create the graph
+	$Graph =& Image_Graph::factory('graph', array(300, 250));
+	// add a TrueType font
+	$Font =& $Graph->addNew('font', 'Arial');
+	// set the font size to 11 pixels
+	$Font->setSize(7);
+	$Graph->setFont($Font);
+	
+	// setup the plotarea, legend and their layout
+	$Graph->add(
+	   Image_Graph::vertical(
+	      Image_Graph::factory('title', array('Hosts', 10)),        
+	      Image_Graph::vertical(
+	         $Plotarea = Image_Graph::factory('plotarea'),
+	         $Legend = Image_Graph::factory('legend'),
+	         80
+	      ),
+	      10
+	   )
+	);
+	$Graph->setBackgroundColor('#fff9eb');
+	$Legend->setPlotArea($Plotarea);
+	
+	$Plotarea->hideAxis();
+	$Plotarea->setBackgroundColor('#fff9eb');
+	
+	// create the dataset
+	
+	$tab = array();
+	foreach ($oreon->status_graph_host as $s){
+		if (!isset($tab[strtolower($s["status"])]))
+			$tab[strtolower($s["status"])] = 0;
+		$tab[strtolower($s["status"])]++;
+	}
+	$tab2 = array();
+	foreach ($tab as $key => $value){
+		$tab2[$key . " - ". $value] = $value;
+	}
+
+	$Dataset =& Image_Graph::factory('dataset', array($tab2));
+	
+	// create the 1st plot as smoothed area chart using the 1st dataset
+	$Plot =& $Plotarea->addNew('Image_Graph_Plot_Pie', $Dataset);
+	
+	$Plot->Radius = 2;
+	    
+	// set a line color
+	$Plot->setLineColor('gray');
+	
+	// set a standard fill style
+	
+	
+	
+	$FillArray =& Image_Graph::factory('Image_Graph_Fill_Array');
+	$Plot->setFillStyle($FillArray);
+	
+	foreach ($tab as $key => $value){
+		$FillArray->addColor($oreon->optGen["color_".$key]."@0.2");
+	}
+
+	$Plot->explode(4);
+	
+	
+	// create a Y data value marker
+	$Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_PCT_Y_TOTAL);
+	// fill it with white
+	$Marker->setFillColor('white');
+	// and use black border
+	$Marker->setBorderColor('black');
+	// and format it using a data preprocessor
+	$Marker->setDataPreprocessor(Image_Graph::factory('Image_Graph_DataPreprocessor_Formatted', '%0.1f%%'));
+	$Marker->setFontSize(7);
+	
+	// create a pin-point marker type
+	$PointingMarker =& $Plot->addNew('Image_Graph_Marker_Pointing_Angular', array(20, &$Marker));
+	// and use the marker on the plot
+	$Plot->setMarker($PointingMarker);
+	
+	// output the Graph
+	$Graph->done();
+?>
\ No newline at end of file
diff --git a/www/include/home/pie_chart_service.php b/www/include/home/pie_chart_service.php
new file mode 100644
index 0000000000000000000000000000000000000000..67da4fd1fbdf484f4be2a12f81576d3f27e9202f
--- /dev/null
+++ b/www/include/home/pie_chart_service.php
@@ -0,0 +1,105 @@
+<?php
+/**
+ * Usage example for Image_Graph.
+ * 
+ * Main purpose: 
+ * Show pie chart
+ * 
+ * Other: 
+ * None specific
+ * 
+ * $Id: plot_pie_rest.php,v 1.1 2005/10/13 20:18:27 nosey Exp $
+ * 
+ * @package Image_Graph
+ * @author Jesper Veggerby <pear.nosey@veggerby.dk>
+ */
+
+	require_once 'Image/Graph.php';
+	
+	require_once ("../../class/Session.class.php");
+	require_once ("../../class/Oreon.class.php");
+
+	Session::start();
+	$oreon =& $_SESSION["oreon"];
+
+	// create the graph
+	$Graph =& Image_Graph::factory('graph', array(300, 250));
+	// add a TrueType font
+	$Font =& $Graph->addNew('font', 'Arial');
+	// set the font size to 11 pixels
+	$Font->setSize(7);
+	$Graph->setFont($Font);
+	
+	// setup the plotarea, legend and their layout
+	$Graph->add(
+	   Image_Graph::vertical(
+	      Image_Graph::factory('title', array('Services', 10)),        
+	      Image_Graph::vertical(
+	         $Plotarea = Image_Graph::factory('plotarea'),
+	         $Legend = Image_Graph::factory('legend'),
+	         80
+	      ),
+	      10
+	   )
+	);
+	$Graph->setBackgroundColor('#fff9eb');
+	$Legend->setPlotArea($Plotarea);
+	
+	$Plotarea->hideAxis();
+	$Plotarea->setBackgroundColor('#fff9eb');
+	
+	// create the dataset
+	
+	$tab = array();
+	foreach ($oreon->status_graph_service as $s){
+		if (!isset($tab[strtolower($s["status"])]))
+			$tab[strtolower($s["status"])] = 0;
+		$tab[strtolower($s["status"])]++;
+	}
+	$tab2 = array();
+	foreach ($tab as $key => $value){
+		$tab2[$key . " - ". $value] = $value;
+	}
+
+	$Dataset =& Image_Graph::factory('dataset', array($tab2));
+	
+	// create the 1st plot as smoothed area chart using the 1st dataset
+	$Plot =& $Plotarea->addNew('Image_Graph_Plot_Pie', $Dataset);
+	
+	$Plot->Radius = 2;
+	    
+	// set a line color
+	$Plot->setLineColor('gray');
+	
+	// set a standard fill style
+	
+	
+	
+	$FillArray =& Image_Graph::factory('Image_Graph_Fill_Array');
+	$Plot->setFillStyle($FillArray);
+	
+	foreach ($tab as $key => $value){
+		$FillArray->addColor($oreon->optGen["color_".$key]."@0.2");
+	}
+
+	$Plot->explode(4);
+	
+	
+	// create a Y data value marker
+	$Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_PCT_Y_TOTAL);
+	// fill it with white
+	$Marker->setFillColor('white');
+	// and use black border
+	$Marker->setBorderColor('black');
+	// and format it using a data preprocessor
+	$Marker->setDataPreprocessor(Image_Graph::factory('Image_Graph_DataPreprocessor_Formatted', '%0.1f%%'));
+	$Marker->setFontSize(7);
+	
+	// create a pin-point marker type
+	$PointingMarker =& $Plot->addNew('Image_Graph_Marker_Pointing_Angular', array(20, &$Marker));
+	// and use the marker on the plot
+	$Plot->setMarker($PointingMarker);
+	
+	// output the Graph
+	$Graph->done();
+?>
\ No newline at end of file
diff --git a/www/include/home/radar_hg.php b/www/include/home/radar_hg.php
new file mode 100644
index 0000000000000000000000000000000000000000..35003019cef9d9643169e9c9abc58541e637ed47
--- /dev/null
+++ b/www/include/home/radar_hg.php
@@ -0,0 +1,131 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick
+Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS. OREON makes no representation
+and gives no warranty whatsoever, whether express or implied, and without limitation, 
+with regard to the quality, safety, contents, performance, merchantability, non-infringement
+or suitability for any particular or intended purpose of the Software found on the OREON web
+site. In no event will OREON be liable for any direct, indirect, punitive, special, incidental
+or consequential damages however they may arise and even if OREON has been previously advised 
+of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+		
+	require_once 'DB.php';
+
+	require_once 'Image/Graph.php';
+	require_once 'Image/Canvas.php';
+	
+	require_once ("../../class/Session.class.php");
+	require_once ("../../class/Oreon.class.php");
+	
+	Session::start();
+	$oreon =& $_SESSION["oreon"];
+	
+	/* Connect to perfparse DB */
+	
+	include("../../oreon.conf.php");
+	
+	$dsn = array(
+	    'phptype'  => 'mysql',
+	    'username' => $conf_oreon['user'],
+	    'password' => $conf_oreon['password'],
+	    'hostspec' => $conf_oreon['host'],
+	    'database' => $conf_oreon['db'],
+	);
+	
+	$options = array(
+	    'debug'       => 2,
+	    'portability' => DB_PORTABILITY_ALL ^ DB_PORTABILITY_LOWERCASE,
+	);
+	
+	$db =& DB::connect($dsn, $options);
+	if (PEAR::isError($db)) {
+	    die($db->getMessage());
+	}
+	
+	$db->setFetchMode(DB_FETCHMODE_ASSOC);
+	
+	$session =& $db->query("SELECT * FROM `session` WHERE session_id = '".$_GET["session_id"]."'");
+	if (!$session->numRows()){
+		exit;
+	} else {	
+		$Canvas =& Image_Canvas::factory('png',
+		    array(
+		        'width' => 300,
+		        'height' => 300,
+		        'antialias' => 'native'
+		    )
+		);
+		
+		// create the graph
+		$Canvas=& Image_Canvas::factory('png',array('width'=>298,'height'=>250,'antialias' => 'native'));
+		$Graph =& Image_Graph::factory('graph', $Canvas);
+		// add a TrueType font
+		$Font =& $Graph->addNew('font', 'Arial');
+		// set the font size to 11 pixels
+		$Font->setSize(7);
+		
+		$Graph->setFont($Font);
+		$Graph->setBackgroundColor('#fff9eb');
+		
+		$Graph->add(
+		    Image_Graph::vertical(
+		        Image_Graph::factory('title', array('HostGroup Status', 10)),        
+		        Image_Graph::vertical(
+		            $Plotarea = Image_Graph::factory('Image_Graph_Plotarea_Radar'),
+		            $Legend = Image_Graph::factory('legend', array('test', 9)),
+		            90
+		        ),
+		        5
+		    )
+		);   
+		 
+		$Legend->setPlotarea($Plotarea);                
+		    
+		$Plotarea->addNew('Image_Graph_Grid_Polar', IMAGE_GRAPH_AXIS_Y);
+		$Plotarea->setBackgroundColor('#fff9eb');
+
+		// create the dataset
+		
+		$DS1 =& Image_Graph::factory('dataset');
+		
+		
+		$res =& $db->query("SELECT * FROM `hostgroup` WHERE hg_activate = '1'");
+		
+		if (PEAR::isError($res))
+		    die($res->getMessage());
+		else { 
+			$tab_hg = array();
+			while ($hg =& $res->fetchRow()){
+				$tab_hg[$hg["hg_name"]] = array();
+				$resH =& $db->query("SELECT host_host_id, host_name FROM hostgroup_relation, host WHERE hostgroup_relation.hostgroup_hg_id = '".$hg["hg_id"]."' AND host.host_id = hostgroup_relation.host_host_id");
+				for ($total = 0, $up = 0;$rH =& $resH->fetchRow();$total++)
+					if (!strcmp($oreon->status_graph_host[$rH["host_name"]]["status"], "UP"))
+						$up++;
+				if ($total)
+					$tab_hg[$hg["hg_name"]] = $up / $total * 100;
+			}
+		}
+		
+		foreach ($tab_hg as $key => $hg)
+			$DS1->addPoint($key, $hg);
+		
+		$Plot1 =& $Plotarea->addNew('Image_Graph_Plot_Radar', $DS1);
+
+		$Plot1->setTitle('HostGroup Status (%)');	
+		$Plot1->setLineColor('blue@0.4');    
+		$Plot1->setFillColor('blue@0.2');
+		
+		// output the Graph
+		$Graph->done();
+	}
+?> 		
+		
\ No newline at end of file
diff --git a/www/include/home/radar_sg.php b/www/include/home/radar_sg.php
new file mode 100644
index 0000000000000000000000000000000000000000..31eb68d304bc38662072ea2246bc312b9a8236d3
--- /dev/null
+++ b/www/include/home/radar_sg.php
@@ -0,0 +1,132 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick
+Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS. OREON makes no representation
+and gives no warranty whatsoever, whether express or implied, and without limitation, 
+with regard to the quality, safety, contents, performance, merchantability, non-infringement
+or suitability for any particular or intended purpose of the Software found on the OREON web
+site. In no event will OREON be liable for any direct, indirect, punitive, special, incidental
+or consequential damages however they may arise and even if OREON has been previously advised 
+of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+		
+	require_once 'DB.php';
+
+	require_once 'Image/Graph.php';
+	require_once 'Image/Canvas.php';
+	include_once("../monitoring/common-Func.php");
+	require_once ("../../class/Session.class.php");
+	require_once ("../../class/Oreon.class.php");
+	
+	Session::start();
+	$oreon =& $_SESSION["oreon"];
+	
+	/* Connect to perfparse DB */
+	
+	include("../../oreon.conf.php");
+	
+	$dsn = array(
+	    'phptype'  => 'mysql',
+	    'username' => $conf_oreon['user'],
+	    'password' => $conf_oreon['password'],
+	    'hostspec' => $conf_oreon['host'],
+	    'database' => $conf_oreon['db'],
+	);
+	
+	$options = array(
+	    'debug'       => 2,
+	    'portability' => DB_PORTABILITY_ALL ^ DB_PORTABILITY_LOWERCASE,
+	);
+	
+	$pearDB =& DB::connect($dsn, $options);
+	if (PEAR::isError($pearDB)) {
+	    die($pearDB->getMessage());
+	}
+	
+	$pearDB->setFetchMode(DB_FETCHMODE_ASSOC);
+	
+	$session =& $pearDB->query("SELECT * FROM `session` WHERE session_id = '".$_GET["session_id"]."'");
+	if (!$session->numRows()){
+		exit;
+	} else {	
+		$Canvas =& Image_Canvas::factory('png',
+		    array(
+		        'width' => 300,
+		        'height' => 300,
+		        'antialias' => 'native'
+		    )
+		);
+		
+		// create the graph
+		$Canvas=& Image_Canvas::factory('png',array('width'=>298,'height'=>250,'antialias' => 'native'));
+		$Graph =& Image_Graph::factory('graph', $Canvas);
+		// add a TrueType font
+		$Font =& $Graph->addNew('font', 'Arial');
+		// set the font size to 11 pixels
+		$Font->setSize(7);
+		
+		$Graph->setFont($Font);
+		$Graph->setBackgroundColor('#fff9eb');
+		
+		$Graph->add(
+		    Image_Graph::vertical(
+		        Image_Graph::factory('title', array('ServiceGroup Status', 10)),        
+		        Image_Graph::vertical(
+		            $Plotarea = Image_Graph::factory('Image_Graph_Plotarea_Radar'),
+		            $Legend = Image_Graph::factory('legend', array('test', 9)),
+		            90
+		        ),
+		        5
+		    )
+		);   
+		 
+		$Legend->setPlotarea($Plotarea);                
+		    
+		$Plotarea->addNew('Image_Graph_Grid_Polar', IMAGE_GRAPH_AXIS_Y);
+		$Plotarea->setBackgroundColor('#fff9eb');
+
+		// create the dataset
+				
+		$DS1 =& Image_Graph::factory('dataset');
+		
+		$res =& $pearDB->query("SELECT * FROM `servicegroup` WHERE sg_activate = '1'");
+		if (PEAR::isError($res))
+		    die($res->getMessage());
+		else { 
+			$tab_sg = array();
+			while ($sg =& $res->fetchRow()){
+				$tab_sg[$sg["sg_name"]] = array();
+				$resS =& $pearDB->query("SELECT service_service_id, service_description FROM servicegroup_relation, service WHERE servicegroup_relation.servicegroup_sg_id = '".$sg["sg_id"]."' AND service.service_id = servicegroup_relation.service_service_id");
+				for ($total = 0, $ok = 0;$rS =& $resS->fetchRow();$total++){
+					if (!$rS["service_description"])
+						$rS["service_description"] = getMyHostName($rS["service_service_id"]);
+					if (isset($oreon->status_graph_service[$rS["service_description"]]) && !strcmp($oreon->status_graph_service[$rS["service_description"]]["status"], "OK"))
+						$ok++;
+				}
+				if ($total)
+					$tab_sg[$sg["sg_name"]] = $ok / $total * 100;
+			}
+		}
+		
+		foreach ($tab_sg as $key => $sg)
+			$DS1->addPoint($key, $sg);
+		
+		$Plot1 =& $Plotarea->addNew('Image_Graph_Plot_Radar', $DS1);
+
+		$Plot1->setTitle('ServiceGroup Status (%)');	
+		$Plot1->setLineColor('blue@0.4');    
+		$Plot1->setFillColor('blue@0.2');
+		
+		// output the Graph
+		$Graph->done();
+	}
+?> 		
+		
\ No newline at end of file
diff --git a/www/include/monitoring/AddHostComment.php b/www/include/monitoring/AddHostComment.php
new file mode 100644
index 0000000000000000000000000000000000000000..9ae50417261d3d775479d189218de6774c827a5a
--- /dev/null
+++ b/www/include/monitoring/AddHostComment.php
@@ -0,0 +1,96 @@
+<?php
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+		
+	if (isset($_GET["host_name"]))
+		$host_name = $_GET["host_name"];
+	else
+		$host_name = NULL;
+	
+	$data = array("host_id" => array_search($host_name, $oreon->user->lcaHost));
+		
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	
+	$hosts = array(""=>"");
+	$res =& $pearDB->query("SELECT host_id, host_name, host_template_model_htm_id FROM `host` WHERE host_register = '1' ORDER BY host_name");
+	while ($res->fetchInto($host)){
+		if (!$host["host_name"])
+			$host["host_name"] = getMyHostName($host["host_template_model_htm_id"]);
+		$hosts[$host["host_id"]]= $host["host_name"];
+	}
+
+	$debug = 0;
+	$attrsTextI		= array("size"=>"3");
+	$attrsText 		= array("size"=>"30");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	
+	#
+	## Form begin
+	#
+	
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "ah")
+		$form->addElement('header', 'title', $lang["cmt_addH"]);
+	#
+	## Indicator basic information
+	#
+	
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+    $selHost =& $form->addElement('select', 'host_id', $lang["cmt_host_name"], $hosts);
+	$form->addElement('checkbox', 'persistant', $lang["cmt_persistent"]);
+	$form->addElement('textarea', 'comment', $lang["cmt_comment"], $attrsTextarea);
+	
+	$form->addRule('host', $lang['ErrRequired'], 'required');
+	$form->addRule('comment', $lang['ErrRequired'], 'required');	
+	
+	$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+	$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	
+	$form->setDefaults($data);
+  
+  	$valid = false;
+	if ((isset($_POST["submitA"]) && $_POST["submitA"]) && $form->validate())	{
+		if (!isset($_POST["persistant"]))
+			$_POST["persistant"] = 0;
+		if (!isset($_POST["comment"]))
+			$_POST["comment"] = 0;
+		AddHostComment($_POST["host_id"], $_POST["comment"], $_POST["persistant"]);
+		$valid = true;
+    	require_once($path."viewComment.php");
+    } else {	
+		# Smarty template Init
+		$tpl = new Smarty();
+		$tpl = initSmartyTpl($path, $tpl, "templates/");
+			
+		#Apply a template definition	
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("AddHostComment.ihtml");
+    }
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/AddHostDowntime.php b/www/include/monitoring/AddHostDowntime.php
new file mode 100644
index 0000000000000000000000000000000000000000..7651cc7e49086b275dc3db9eb6377976ceca7d83
--- /dev/null
+++ b/www/include/monitoring/AddHostDowntime.php
@@ -0,0 +1,105 @@
+<?php
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Service Level � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+	
+	# Init
+	
+	if (isset($_GET["host_name"]))
+		$host_name = $_GET["host_name"];
+	else
+		$host_name = NULL;
+	
+	$data = array("host_id" => array_search($host_name, $oreon->user->lcaHost), "start" => date("Y/m/d G:i" , time() + 120), "end" => date("Y/m/d G:i", time() + 7320));
+		
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	 
+	$hosts = array(""=>"");
+	$res =& $pearDB->query("SELECT host_id, host_name, host_template_model_htm_id FROM `host` WHERE host_register = '1' ORDER BY host_name");
+	while ($res->fetchInto($host)){
+		if (!$host["host_name"])
+			$host["host_name"] = getMyHostName($host["host_template_model_htm_id"]);
+		$hosts[$host["host_id"]]= $host["host_name"];
+	}
+	
+	$debug = 0;
+	$attrsTextI		= array("size"=>"3");
+	$attrsText 		= array("size"=>"30");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	
+	#
+	## Form begin
+	#
+	
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "ah")
+		$form->addElement('header', 'title', $lang["dtm_addH"]);
+	#
+	## Indicator basic information
+	#
+			
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+    $selHost =& $form->addElement('select', 'host_id', $lang["cmt_host_name"], $hosts);
+    $form->addElement('checkbox', 'persistant', $lang["dtm_fixed"]);
+	$form->addElement('text', 'start', $lang["dtm_start_time"], $attrsText);
+	$form->addElement('text', 'end', $lang["dtm_end_time"], $attrsText);
+	$form->addElement('textarea', 'comment', $lang["cmt_comment"], $attrsTextarea);
+	
+	$form->addRule('host', $lang['ErrRequired'], 'required');
+	$form->addRule('end', $lang['ErrRequired'], 'required');
+	$form->addRule('start', $lang['ErrRequired'], 'required');
+	$form->addRule('comment', $lang['ErrRequired'], 'required');	
+	
+	$form->setDefaults($data);
+	
+	$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+	$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	
+  
+  	if ((isset($_POST["submitA"]) && $_POST["submitA"]) && $form->validate())	{
+		if (!isset($_POST["persistant"]))
+			$_POST["persistant"] = 0;
+		if (!isset($_POST["comment"]))
+			$_POST["comment"] = 0;
+		AddHostDowntime($_POST["host_id"], $_POST["comment"], $_POST["start"], $_POST["end"], $_POST["persistant"]);
+		
+		require_once($path."viewDowntime.php");
+    } else {	
+		# Smarty template Init
+		$tpl = new Smarty();
+		$tpl = initSmartyTpl($path, $tpl, "templates/");
+			
+		#Apply a template definition	
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("AddHostDowntime.ihtml");
+    }
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/AddSvcComment.php b/www/include/monitoring/AddSvcComment.php
new file mode 100644
index 0000000000000000000000000000000000000000..e8bd789a816bb0775253d995ae5b9eaaf946119d
--- /dev/null
+++ b/www/include/monitoring/AddSvcComment.php
@@ -0,0 +1,116 @@
+<?php
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Service Level � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+			
+	isset($_GET["host_id"]) ? $cG = $_GET["host_id"] : $cG = NULL;
+	isset($_POST["host_id"]) ? $cP = $_POST["host_id"] : $cP = NULL;	
+	$cG ? $host_id = $cG : $host_id = $cP;
+	
+	
+	
+	if (isset($_GET["host_name"]) && isset($_GET["service_description"])){
+		$host_id = array_search($_GET["host_name"], $oreon->user->lcaHost);
+		$svc_description = $_GET["service_description"];
+	} else
+		$host_name = NULL;
+	
+	$data = array("host_id" => $host_id, "service_id" => getMyServiceID($svc_description, $host_id));
+	
+	
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	$hosts = array(""=>"");
+	$res =& $pearDB->query("SELECT host_id, host_name, host_template_model_htm_id FROM `host` WHERE host_register = '1' ORDER BY host_name");
+	while ($res->fetchInto($host)){
+		if (!$host["host_name"])
+			$host["host_name"] = getMyHostName($host["host_template_model_htm_id"]);
+		$hosts[$host["host_id"]]= $host["host_name"];
+	}
+
+	$services = array();
+	if (isset($host_id))	{
+		$res =& $pearDB->query("SELECT DISTINCT sv.service_id, sv.service_description FROM service sv, host_service_relation hsr WHERE hsr.host_host_id = '".$host_id."' AND sv.service_id = hsr.service_service_id");
+		while ($res->fetchInto($service)){
+			$services[$service["service_id"]] = $service["service_description"];
+		}
+	}			
+
+	$debug = 0;
+	$attrsTextI		= array("size"=>"3");
+	$attrsText 		= array("size"=>"30");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	
+	#
+	## Form begin
+	#
+	
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	$form->addElement('header', 'title', $lang["cmt_addS"]);
+	
+	#
+	## Indicator basic information
+	#
+	
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+    
+    $selHost =& $form->addElement('select', 'host_id', $lang["cmt_host_name"], $hosts, array("onChange" =>"this.form.submit();"));
+	$selSv =& $form->addElement('select', 'service_id', $lang["cmt_service_descr"], $services);
+    $form->addElement('checkbox', 'persistant', $lang["cmt_persistent"]);
+	$form->addElement('textarea', 'comment', $lang["cmt_comment"], $attrsTextarea);
+	
+	$form->addRule('host', $lang['ErrRequired'], 'required');
+	$form->addRule('service', $lang['ErrRequired'], 'required');
+	$form->addRule('comment', $lang['ErrRequired'], 'required');	
+	
+	$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+	$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+  	
+  	$form->setDefaults($data);
+  
+  	$valid = false;
+	if ((isset($_POST["submitA"]) && $_POST["submitA"]) && $form->validate())	{
+		if (!isset($_POST["persistant"]))
+			$_POST["persistant"] = 0;
+		if (!isset($_POST["comment"]))
+			$_POST["comment"] = 0;
+		AddSvcComment($_POST["host_id"], $_POST["service_id"], $_POST["comment"], $_POST["persistant"]);
+		$valid = true;
+    	require_once($path."viewComment.php");
+	} else {	
+		# Smarty template Init
+		$tpl = new Smarty();
+		$tpl = initSmartyTpl($path, $tpl, "templates/");
+			
+		#Apply a template definition	
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("AddSvcComment.ihtml");
+    }
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/AddSvcDowntime.php b/www/include/monitoring/AddSvcDowntime.php
new file mode 100644
index 0000000000000000000000000000000000000000..494019942f0bc5449935dbcb35ecbaaeaefc1a4b
--- /dev/null
+++ b/www/include/monitoring/AddSvcDowntime.php
@@ -0,0 +1,134 @@
+<?php
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called  Oreon Service Level  is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	isset($_GET["host_id"]) ? $cG = $_GET["host_id"] : $cG = NULL;
+	isset($_POST["host_id"]) ? $cP = $_POST["host_id"] : $cP = NULL;	
+	$cG ? $host_id = $cG : $host_id = $cP;
+
+    $svc_description = NULL;
+	
+	if (isset($_GET["host_name"]) && isset($_GET["service_description"])){
+		$host_id = array_search($_GET["host_name"], $oreon->user->lcaHost);
+		$svc_description = $_GET["service_description"];
+	} else
+		$host_name = NULL;
+	
+	$data = array("host_id" => $host_id, "service_id" => getMyServiceID($svc_description, $host_id),"start" => date("Y/m/d G:i" , time() + 120), "end" => date("Y/m/d G:i", time() + 7320));
+	
+	
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	$hosts = array(""=>"");
+	$res =& $pearDB->query("SELECT host_id, host_name, host_template_model_htm_id FROM `host` WHERE host_register = '1' ORDER BY host_name");
+	while ($res->fetchInto($host)){
+		if (!$host["host_name"])
+			$host["host_name"] = getMyHostName($host["host_template_model_htm_id"]);
+		$hosts[$host["host_id"]]= $host["host_name"];
+	}
+
+	$services = array();
+	if (isset($host_id)){
+		
+	
+		/*$res =& $pearDB->query("SELECT DISTINCT sv.service_id, sv.service_description FROM service sv, host_service_relation hsr WHERE hsr.host_host_id = '".$host_id."' AND sv.service_id = hsr.service_service_id");
+		while ($res->fetchInto($service)){
+			$services[$service["service_id"]] = $service["service_description"];
+		}*/
+
+		$cmd = "SELECT DISTINCT sv.service_id, sv.service_description ";
+		$cmd .= "FROM service sv, host_service_relation hsr, hostgroup_relation hgr ";
+		$cmd .= "WHERE hgr.host_host_id = '".$host_id."' ";
+		$cmd .= "AND ((hgr.hostgroup_hg_id = hsr.hostgroup_hg_id AND hsr.host_host_id IS NULL) OR (hsr.host_host_id = '".$host_id."' AND hsr.hostgroup_hg_id IS NULL))";
+		$cmd .= "AND hsr.service_service_id = sv.service_id";
+
+		$res =& $pearDB->query($cmd);
+		while ($res->fetchInto($service)){
+			$services[$service["service_id"]] = $service["service_description"];
+		}
+
+	}			
+
+	$debug = 0;
+	$attrsTextI		= array("size"=>"3");
+	$attrsText 		= array("size"=>"30");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	
+	#
+	## Form begin
+	#
+	
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	$form->addElement('header', 'title', $lang["dtm_addS"]);
+	
+	#
+	## Indicator basic information
+	#
+	
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+    
+    $selHost =& $form->addElement('select', 'host_id', $lang["cmt_host_name"], $hosts, array("onChange" =>"this.form.submit();"));
+	$selSv =& $form->addElement('select', 'service_id', $lang["cmt_service_descr"], $services);
+    $form->addElement('checkbox', 'persistant', $lang["dtm_fixed"]);
+	$form->addElement('textarea', 'comment', $lang["cmt_comment"], $attrsTextarea);
+	
+	$form->addElement('text', 'start', $lang["dtm_start_time"], $attrsText);
+	$form->addElement('text', 'end', $lang["dtm_end_time"], $attrsText);
+	$form->addElement('textarea', 'comment', $lang["cmt_comment"], $attrsTextarea);
+	
+	$form->addRule('host', $lang['ErrRequired'], 'required');
+	$form->addRule('end', $lang['ErrRequired'], 'required');
+	$form->addRule('start', $lang['ErrRequired'], 'required');
+	$form->addRule('comment', $lang['ErrRequired'], 'required');	
+	
+	$form->setDefaults($data);
+	
+	$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+	$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+  
+  	if ((isset($_POST["submitA"]) && $_POST["submitA"]) && $form->validate())	{
+		if (!isset($_POST["persistant"]))
+			$_POST["persistant"] = 0;
+		if (!isset($_POST["comment"]))
+			$_POST["comment"] = 0;
+			
+		AddSvcDowntime($_POST["host_id"], $_POST["service_id"],  $_POST["comment"], $_POST["start"], $_POST["end"], $_POST["persistant"]);
+    	require_once($path."viewDowntime.php");
+	} else {
+		# Smarty template Init
+		$tpl = new Smarty();
+		$tpl = initSmartyTpl($path, $tpl, "templates/");
+
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);
+		$tpl->display("AddSvcDowntime.ihtml");
+    }
+?>
diff --git a/www/include/monitoring/comments.php b/www/include/monitoring/comments.php
new file mode 100644
index 0000000000000000000000000000000000000000..aa772ab0889a73dc6891a323d9f23f4844677159
--- /dev/null
+++ b/www/include/monitoring/comments.php
@@ -0,0 +1,48 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["contact_id"]) ? $cG = $_GET["contact_id"] : $cG = NULL;
+	isset($_POST["contact_id"]) ? $cP = $_POST["contact_id"] : $cP = NULL;
+	$cG ? $contact_id = $cG : $contact_id = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	
+	#Path to the configuration dir
+	$path = "./include/monitoring/";
+	
+	#PHP functions
+	require_once "./include/common/common-Func.php";
+	require_once "./include/monitoring/common-Func.php";
+	
+	switch ($o)	{
+		case "ah" : require_once($path."AddHostComment.php"); break; 
+		case "as" : require_once($path."AddSvcComment.php"); break;
+		case "ds" : DeleteComment("SVC");require_once($path."viewComment.php"); break; 
+		case "dh" : DeleteComment("HOST");require_once($path."viewComment.php"); break;
+		default : require_once($path."viewComment.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/common-Func.php b/www/include/monitoring/common-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..1a5b313fc26dd653b50e1afbe782f8351998af32
--- /dev/null
+++ b/www/include/monitoring/common-Func.php
@@ -0,0 +1,149 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	function getMyHostRow($host_id = NULL, $rowdata)	{
+		if (!$host_id) exit();
+		global $pearDB;
+		while(1)	{
+			$res =& $pearDB->query("SELECT host_".$rowdata.", host_template_model_htm_id FROM host WHERE host_id = '".$host_id."' LIMIT 1");
+			$row =& $res->fetchRow();
+			if ($row["host_".$rowdata])
+				return $row["host_$rowdata"];
+			else if ($row["host_template_model_htm_id"])
+				$host_id = $row["host_template_model_htm_id"];
+			else
+				break;
+		}
+	}
+
+	function AddSvcComment($host, $service, $comment, $persistant){
+		global $oreon, $pearDB;
+		
+		if (!isset($persistant))
+			$persistant = 0;
+		$res =& $pearDB->query("SELECT host_name FROM host WHERE host_id = '".$host."'");
+		$r =& $res->fetchRow();
+		
+		if (isset($host))	{
+			$res =& $pearDB->query("SELECT DISTINCT sv.service_id, sv.service_description FROM service sv, host_service_relation hsr WHERE hsr.host_host_id = '".$host."' AND sv.service_id = '".$service."'");
+			$res->fetchInto($service);
+		}
+		exec("echo \"[".time()."] ADD_SVC_COMMENT;".$r["host_name"].";".$service["service_description"].";".$persistant.";".$oreon->user->get_alias().";".$comment."\n\" >> " . $oreon->Nagioscfg["command_file"]);
+	}
+
+	function AddHostComment($host, $comment, $persistant){
+		global $oreon, $pearDB;
+		if (!isset($persistant))
+			$persistant = 0;
+		$res =& $pearDB->query("SELECT host_name FROM host WHERE host_id = '".$host."'");
+		$r =& $res->fetchRow();
+		
+		exec("echo \"[".time()."] ADD_HOST_COMMENT;".$r["host_name"].";".$persistant.";".$oreon->user->get_alias().";".$comment."\n\" >> " . $oreon->Nagioscfg["command_file"]) ;
+	}
+
+	function AddHostDowntime($host, $comment, $start, $end, $persistant){
+		global $oreon, $pearDB;
+		if (!isset($persistant))
+			$persistant = 0;
+		$res = preg_split("/ /", $start);
+		$res1 = preg_split("/\//", $res[0]);
+		$res2 = preg_split("/:/", $res[1]);
+		$start_time = mktime($res2[0], $res2[1], "0", $res1[1], $res1[2], $res1[0]);
+		$res = preg_split("/ /", $end);
+		$res3 = preg_split("/\//", $res[0]);
+		$res4 = preg_split("/:/", $res[1]);
+		$end_time = mktime($res4[0], $res4[1], "0", $res3[1], $res3[2], $res3[0]);
+
+		$duration = $end_time - $start_time;
+
+		$res =& $pearDB->query("SELECT host_name FROM host WHERE host_id = '".$host."'");
+		$r =& $res->fetchRow();
+		$timestamp = time();
+		//print("echo \"[".time()."] SCHEDULE_HOST_DOWNTIME;".$r["host_name"].";".$start_time.";".$end_time.";".$persistant.";0;".$duration.";".$oreon->user->get_alias().";".$comment."\n\" >> " . $oreon->Nagioscfg["command_file"]) ;
+		if ($oreon->user->get_version() == 1)
+			exec("echo \"[".$timestamp."] SCHEDULE_HOST_DOWNTIME;".$r["host_name"].";".$start_time.";".$end_time.";".$persistant.";".$duration.";".$oreon->user->get_alias().";".$comment."\n\" >> " . $oreon->Nagioscfg["command_file"]) ;
+		else
+			exec("echo \"[".$timestamp."] SCHEDULE_HOST_DOWNTIME;".$r["host_name"].";".$start_time.";".$end_time.";".$persistant.";0;".$duration.";".$oreon->user->get_alias().";".$comment."\n\" >> " . $oreon->Nagioscfg["command_file"]) ;
+
+		$pearDB->query("INSERT INTO downtime (host_id, entry_time , author , comment , start_time , end_time , fixed , duration , deleted) ".
+									"VALUES ('".$host."', '".$timestamp."', '".$oreon->user->get_id()."', '".$comment."', '".$start."', '".$end."', '".$persistant."', '".$duration."', '0')");
+		if (PEAR::isError($pearDB)) 
+			print $db->getMessage();
+	}
+
+	function AddSvcDowntime($host, $service, $comment, $start, $end, $persistant){
+		global $oreon, $pearDB;
+		
+		if (!isset($persistant))
+			$persistant = 0;
+		$res = preg_split("/ /", $start);
+		$res1 = preg_split("/\//", $res[0]);
+		$res2 = preg_split("/:/", $res[1]);
+
+		$start_time = mktime($res2[0], $res2[1], "0", $res1[1], $res1[2], $res1[0]);
+		$res = preg_split("/ /", $end);
+		$res3 = preg_split("/\//", $res[0]);
+		$res4 = preg_split("/:/", $res[1]);
+		$end_time = mktime($res4[0], $res4[1], "0", $res3[1], $res3[2], $res3[0]);
+
+		$duration = $end_time - $start_time;
+
+		$res =& $pearDB->query("SELECT host_name FROM host WHERE host_id = '".$host."'");
+		$r =& $res->fetchRow();
+
+		if (isset($host))	{
+			$res =& $pearDB->query("SELECT DISTINCT sv.service_id, sv.service_description FROM service sv, host_service_relation hsr WHERE hsr.host_host_id = '".$host."' AND sv.service_id = '".$service."'");
+			$res->fetchInto($service);
+		}
+		//attention timestamp ki peu etre decaler !
+		$timestamp = time();
+		//print("echo \"[".time()."] SCHEDULE_SVC_DOWNTIME;".$r["host_name"].";".$service["service_description"].";".$start_time.";".$end_time.";".$persistant.";0;".$duration.";".$oreon->user->get_alias().";".$comment."\n\" >> " . $oreon->Nagioscfg["command_file"]);
+		if ($oreon->user->get_version() == 1)
+			exec("echo \"[".$timestamp."] SCHEDULE_SVC_DOWNTIME;".$r["host_name"].";".$service["service_description"].";".$start_time.";".$end_time.";".$persistant.";".$duration.";".$oreon->user->get_alias().";".$comment."\n\" >> " . $oreon->Nagioscfg["command_file"]);
+		else
+			exec("echo \"[".$timestamp."] SCHEDULE_SVC_DOWNTIME;".$r["host_name"].";".$service["service_description"].";".$start_time.";".$end_time.";".$persistant.";0;".$duration.";".$oreon->user->get_alias().";".$comment."\n\" >> " . $oreon->Nagioscfg["command_file"]);
+
+		$cmd = "INSERT INTO downtime (host_id , service_id , entry_time , author , comment , start_time , end_time , fixed , duration , deleted) ";
+		$cmd .= "VALUES ('".$host."', '".$service["service_id"]."', '".$timestamp."', '".$oreon->user->get_id()."', '".$comment."', '".$start."', '".$end."', '".$persistant."', '".$duration."', '0')";
+
+		$pearDB->query($cmd);
+		
+	}
+
+	function DeleteComment($type){
+		global $oreon, $_GET;
+		exec ("echo \"[".time()."] DEL_".$type."_COMMENT;".$_GET["id"]."\n\" >> " . $oreon->Nagioscfg["command_file"]);  
+	}
+	
+	function DeleteDowntime($type,$hosts = array()){
+		global $oreon, $_GET, $pearDB;
+		foreach($hosts as $key=>$value)	{
+			$res = explode(";", $key);
+			exec ("echo \"[".time()."] DEL_".$type."_DOWNTIME;".$res[0]."\n\" >> " . $oreon->Nagioscfg["command_file"]);
+			$cmd = "DELETE FROM downtime where downtime_id = ".$res[1];
+			$pearDB->query($cmd);
+		}
+	}
+
+
+?>
diff --git a/www/include/monitoring/downtime.php b/www/include/monitoring/downtime.php
new file mode 100644
index 0000000000000000000000000000000000000000..aae12bb261797d69e7b03260815ab5f9f9bcf96c
--- /dev/null
+++ b/www/include/monitoring/downtime.php
@@ -0,0 +1,44 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	
+	#Path to the configuration dir
+	$path = "./include/monitoring/";
+	
+	#PHP functions
+	require_once "./include/common/common-Func.php";
+	require_once "./include/monitoring/common-Func.php";
+
+	switch ($o)	{
+		case "ah" : require_once($path."AddHostDowntime.php"); break;
+		case "as" : require_once($path."AddSvcDowntime.php"); break;
+		case "ds" : DeleteDowntime("SVC",isset($_GET["select"]) ? $_GET["select"] : array());require_once($path."viewDowntime.php"); break; 
+		case "dh" : DeleteDowntime("HOST",isset($_GET["select"]) ? $_GET["select"] : array());require_once($path."viewDowntime.php"); break;
+		default : require_once($path."viewDowntime.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/external_cmd/cmd.php b/www/include/monitoring/external_cmd/cmd.php
new file mode 100644
index 0000000000000000000000000000000000000000..2fdacdeb475620c4cbc7b88405b44c2f778fd2a4
--- /dev/null
+++ b/www/include/monitoring/external_cmd/cmd.php
@@ -0,0 +1,137 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+
+
+
+
+	include_once("./include/monitoring/external_cmd/functions.php");
+	
+	if (isset($_GET["en"]))
+		$en = $_GET["en"];
+	
+if (isset($_GET["select"]))
+	foreach ($_GET["select"] as $key => $value){
+		if (isset($_GET["cmd"]))
+			switch ($_GET["cmd"]) {
+				
+				/*
+				 * Re-Schedulde SVC Checks
+				 */
+				
+				case 1: 	schedule_host_svc_checks($key, $lang, 0);	break;//
+				case 2: 	schedule_host_svc_checks($key, $lang, 1);	break;//Forced
+				case 3: 	schedule_svc_checks($key, $lang, 0);		break;//
+				case 4: 	schedule_svc_checks($key, $lang, 1);		break;//
+				
+				/*
+				 * Scheduling svc
+				 */
+				
+				case 5: 	host_svc_checks($key, $lang, $en);			break;
+				case 6: 	host_check($key, $lang, $en);				break;//
+				case 7: 	svc_check($key, $lang, $en);				break;//
+				
+				/*
+				 * Delay notification
+				 */
+				 		
+				//case 6: 	send_cmd("DELAY_HOST_NOTIFICATION", "", $lang);break;
+				//case 7: 	send_cmd("DELAY_SVC_NOTIFICATION", "", $lang);break;
+				
+				/*
+				 * Notifications
+				 */
+				
+				case 8: 	host_svc_notifications($key, $lang, $en);	break;//
+				case 9: 	host_notification($key, $lang, $en);		break;//
+				case 10: 	svc_notifications($key, $lang, $en);		break;//
+				
+				/*
+				 * En/Disable passive service check
+				 */
+				
+				case 11: 	passive_svc_check($key, $lang, $en); 		break;//
+				
+				/*
+				 * Acknowledge status
+				 */
+				
+				case 14:	acknowledgeHost($lang); 					break;
+				case 15:	acknowledgeService($lang); 					break;
+				
+				/*
+				 * Submit passiv checks
+				 */
+				//case 16:	submitPassiveCheck($lang);					break;
+				
+				/*
+				 * Configure nagios Core
+				 */
+				 
+				case 20: 	send_cmd("ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST", "", $lang);break;
+				case 21: 	send_cmd("DISABLE_ALL_NOTIFICATIONS_BEYOND_HOST", $lang, "");break;
+				case 22: 	send_cmd("ENABLE_NOTIFICATIONS", $lang, "");break;
+				case 23: 	send_cmd("DISABLE_NOTIFICATIONS", $lang, "");break;
+				case 24: 	send_cmd("SHUTDOWN_PROGRAM", time(), $lang);break;//
+				case 25: 	send_cmd("RESTART_PROGRAM", time(), $lang);break;//
+				case 26: 	send_cmd("PROCESS_SERVICE_CHECK_RESULT", $lang, "");break;//
+				case 27: 	send_cmd("SAVE_STATE_INFORMATION", $lang, "");break;
+				case 28: 	send_cmd("READ_STATE_INFORMATION", $lang, "");break;
+				case 29: 	send_cmd("START_EXECUTING_SVC_CHECKS", $lang, "");break;//
+				case 30: 	send_cmd("STOP_EXECUTING_SVC_CHECKS", $lang, "");break;//
+				case 31: 	send_cmd("START_ACCEPTING_PASSIVE_SVC_CHECKS", $lang, "");break;//
+				case 32: 	send_cmd("STOP_ACCEPTING_PASSIVE_SVC_CHECKS", $lang, "");break;//
+				case 33: 	send_cmd("ENABLE_PASSIVE_SVC_CHECKS", $lang, "");break;
+				case 34: 	send_cmd("DISABLE_PASSIVE_SVC_CHECKS", $lang, "");break;
+				case 35: 	send_cmd("ENABLE_EVENT_HANDLERS", $lang, "");break;//
+				case 36: 	send_cmd("DISABLE_EVENT_HANDLERS", $lang, "");break;//
+				case 37: 	send_cmd("START_OBSESSING_OVER_SVC_CHECKS", $lang, "");break;//
+				case 38:	send_cmd("STOP_OBSESSING_OVER_SVC_CHECKS", $lang, "");break;//
+				case 39: 	send_cmd("ENABLE_FLAP_DETECTION", $lang, "");break;//
+				case 40: 	send_cmd("DISABLE_FLAP_DETECTION", $lang, "");break;//
+				case 41: 	send_cmd("ENABLE_PERFORMANCE_DATA", $lang, "");break;//
+				case 42: 	send_cmd("DISABLE_PERFORMANCE_DATA", $lang, "");break;//
+				
+				/*
+				 * End Configuration Nagios Core
+				 */
+				
+				case 43: host_flapping_enable($key, $lang, $en); break;//
+				case 44: svc_flapping_enable($key, $lang, $en); break;//
+				case 45: host_event_handler($key, $lang, $en); break;//
+				case 46: svc_event_handler($key, $lang, $en); break;//
+				
+				case 49: host_flap_detection($key, $lang, 1);break;//
+				case 50: host_flap_detection($key, $lang, 0);break;//
+				case 51: host_event_handler($key, $lang, 1);break;//
+				case 52: host_event_handler($key, $lang, 0);break;//
+				
+				case 59: add_hostgroup_downtime($_GET["dtm"], $lang);break;//
+				case 60: add_svc_hostgroup_downtime($_GET["dtm"], $lang);break;//
+				case 61: notifi_host_hostgroup($key, $lang, 1);break;//
+				case 62: notifi_host_hostgroup($key, $lang, 0);break;//
+				case 63: notifi_svc_host_hostgroup($key, $lang, 1);break;//
+				case 64: notifi_svc_host_hostgroup($key, $lang, 0);break;//
+				case 65: checks_svc_host_hostgroup($key, $lang, 1);break;//
+				case 66: checks_svc_host_hostgroup($key, $lang, 0);break;//
+				case 67: schedule_svc_check($key, $lang, 1, 1);break;//
+			}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/external_cmd/comments.php b/www/include/monitoring/external_cmd/comments.php
new file mode 100644
index 0000000000000000000000000000000000000000..4c6f1bdcc90d842a55b336b12796636a585b9bcc
--- /dev/null
+++ b/www/include/monitoring/external_cmd/comments.php
@@ -0,0 +1,72 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+
+	// Comments
+
+	function add_host_comment($oreon, $cmt, $lang){
+		$check = array("on" => 1, "off" => 0);
+		if (isset($cmt["pers"]))
+			$str = "echo '[" . time() . "] ADD_HOST_COMMENT;".$cmt["host_name"].";".$check[$cmt["pers"]].";".$cmt["auther"].";".$cmt["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+		else
+			$str = "echo '[" . time() . "] ADD_HOST_COMMENT;".$cmt["host_name"].";0;".$cmt["auther"].";".$cmt["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+		system($str);
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["cmt_added"]."</center></div>";
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=307'\",2000)</SCRIPT>";
+	
+	}
+	
+	function add_svc_comment($oreon, $cmt, $lang)
+	{
+		$check["on"] = 1;
+		$check["off"] = 0;
+		if (isset($cmt["pers"]))
+			$str = "echo '[" . time() . "] ADD_SVC_COMMENT;".$oreon->hosts[$cmt["host_id"]]->get_name().";".$cmt["svc"].";".$check[$cmt["pers"]].";".$cmt["auther"].";".$cmt["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+		else
+			$str = "echo '[" . time() . "] ADD_SVC_COMMENT;".$oreon->hosts[$cmt["host_id"]]->get_name().";".$cmt["svc"].";0;".$cmt["auther"].";".$cmt["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["cmt_added"]."</center></div>";
+		system($str);
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=307'\",2000)</SCRIPT>";
+	}
+	
+	function del_host_comment($oreon, $arg, $lang)
+	{
+		$str = "echo '[" . time() . "] DEL_HOST_COMMENT;".$arg."' >> " . $oreon->Nagioscfg->command_file;
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["cmt_del"]."</center></div>";
+		system($str);
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=307'\",2000)</SCRIPT>";
+	}
+	
+	function del_all_host_comment($oreon, $arg, $lang)
+	{
+		$str = "echo '[" . time() . "] DEL_ALL_HOST_COMMENTS;".$arg."' >> " . $oreon->Nagioscfg->command_file;
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["cmt_del_all"]."</center></div>";
+		system($str);
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=307'\",2000)</SCRIPT>";
+	}
+	
+	function del_svc_comment($oreon, $arg, $lang)
+	{
+		$str = "echo '[" . time() . "] DEL_SVC_COMMENT;".$arg."' >> " . $oreon->Nagioscfg->command_file;
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["cmt_del"]."</center></div>";
+		system($str);
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=307'\",2000)</SCRIPT>";
+	}
+	
+?>	
\ No newline at end of file
diff --git a/www/include/monitoring/external_cmd/downtime.php b/www/include/monitoring/external_cmd/downtime.php
new file mode 100644
index 0000000000000000000000000000000000000000..d0534c542532cdd1f64044c2fa5a7c2c701eb2e2
--- /dev/null
+++ b/www/include/monitoring/external_cmd/downtime.php
@@ -0,0 +1,184 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset($oreon))
+		exit();
+		
+	// Downtime
+	
+	function add_host_downtime_in_db($oreon, $dtm, $start_time, $end_time, $duration){
+		$check = array("on" => 1, "off" => 0);
+		global $pearDB;
+		$str =	"INSERT INTO `downtime` (`downtime_id`, `host_id`, `service_id`, `entry_time`, `author`, `comment`, `start_time`, `end_time`, `fixed`, `duration`)".
+				" VALUES ('', '".$dtm["host_name"]."', NULL, NOW( ) , '".$oreon->user->get_alias()."', '".$dtm["comment"]."', '".$start_time."', '".$end_time."', '".$check[$dtm["fixed"]]."', '".$duration."');";
+		$insert =& $pearDB->query($str);
+		if (PEAR::isError($pearDB))
+   			die($pearDB->getMessage());
+	}
+	
+	function add_hostGroup_downtime_in_db($oreon, $dtm, $start_time, $end_time, $duration, $host){
+		$check = array("on" => 1, "off" => 0);
+		global $pearDB;
+		$str = 	"INSERT INTO `downtime` (`downtime_id`, `host_id`, `service_id`, `entry_time`, `author`, `comment`, `start_time`, `end_time`, `fixed`, `duration`)".
+				" VALUES ('', '".$host."', NULL, NOW( ) , '".$oreon->user->get_alias()."', '".$dtm["comment"]."', '".$start_time."', '".$end_time."', '".$check[$dtm["fixed"]]."', '".$duration."');";
+		$insert =& $pearDB->query($str);
+		if (PEAR::isError($pearDB))
+   			die($pearDB->getMessage());
+	}
+	
+	function add_svc_downtime_in_db($oreon, $dtm, $start_time, $end_time, $duration){
+		$check = array("on" => 1, "off" => 0);
+		global $pearDB;
+		$str = 	"INSERT INTO `downtime` (`downtime_id`, `host_id`, `service_id`, `entry_time`, `author`, `comment`, `start_time`, `end_time`, `fixed`, `duration`)".
+				" VALUES ('', '".$dtm["host_id"]."', '".$dtm["service"]."', NOW( ) , '".$oreon->user->get_alias()."', '".$dtm["comment"]."', '".$start_time."', '".$end_time."', '".$check[$dtm["fixed"]]."', '".$duration."');";
+		$insert =& $pearDB->query($str);
+		if (PEAR::isError($pearDB))
+   			die($pearDB->getMessage());
+	}
+	
+	function del_svc_downtime_in_db($start_time, $host, $svc){
+		global $pearDB;
+		$host =& $pearDB->query("SELECT host_id FROM host WHERE `host_name` = '".$host."'");
+		$host_name = $host->fetchRow();				
+		$service =& $pearDB->query("SELECT service_id FROM service WHERE `service_description` = '".$svc."'");
+		$service_desc = $service->fetchRow();				
+		$str = 	"UPDATE `downtime` SET `deleted` = '1' WHERE `service_id` = '".$service_desc["service_id"]."' AND `host_id` = '".$host_name["host_id"]."' AND `start_time` = '".$start_time."' LIMIT 1 ;";
+		$update =& $pearDB->query($str);
+		if (PEAR::isError($pearDB))
+   			die($pearDB->getMessage());
+	}
+	
+	function del_host_downtime_in_db($start_time, $host){
+		global $pearDB;
+		$host =& $pearDB->query("SELECT host_id FROM host WHERE `host_name` = '".$host."'");
+		$host_name = $host->fetchRow();				
+		$str = 	"UPDATE `downtime` SET `deleted` = '1' WHERE `host_id` = '".$host_name["host_id"]."' AND `start_time` = '".$start_time."' LIMIT 1 ;";
+		$update =& $pearDB->query($str);
+		if (PEAR::isError($pearDB))
+   			die($pearDB->getMessage());
+	}
+	
+	function add_host_downtime($oreon, $dtm, $lang){
+		$check = array("on" => 1, "off" => 0);
+		$res = preg_split("/ /", $dtm["strtime"]);
+		$res1 = preg_split("/-/", $res[0]);
+		$res2 = preg_split("/:/", $res[1]);
+		$start_time = mktime($res2[0], $res2[1], $res2[2], $res1[1], $res1[0], $res1[2]);
+		$res = preg_split("/ /", $dtm["endtime"]);
+		$res3 = preg_split("/-/", $res[0]);
+		$res4 = preg_split("/:/", $res[1]);
+		$end_time = mktime($res4[0], $res4[1], $res4[2], $res3[1], $res3[0], $res3[2]);
+		$duration = $end_time - $start_time;
+		if (!isset($dtm["fixed"]))
+			$dtm["fixed"] = "off";
+		add_host_downtime_in_db(&$oreon, $dtm, $start_time, $end_time,$duration);
+		$str = "echo '[" . time() . "] SCHEDULE_HOST_DOWNTIME;".$oreon->hosts[$dtm["host_name"]]->get_name().";".$start_time.";".$end_time.";".$check[$dtm["fixed"]].";".$duration.";".$oreon->user->get_alias().";".$dtm["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+		system($str);
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["dtm_added"]."</center></div>";
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=308'\",2000)</SCRIPT>";
+	}
+	
+	function add_svc_downtime($oreon, $dtm, $lang){
+		$check = array("on" => 1, "off" => 0);
+		$res = preg_split("/ /", $dtm["strtime"]);
+		$res1 = preg_split("/-/", $res[0]);
+		$res2 = preg_split("/:/", $res[1]);
+		$start_time = mktime($res2[0], $res2[1], "0", $res1[1], $res1[0], $res1[2]);
+		$res = preg_split("/ /", $dtm["endtime"]);
+		$res3 = preg_split("/-/", $res[0]);
+		$res4 = preg_split("/:/", $res[1]);
+		$end_time = mktime($res4[0], $res4[1], "0", $res3[1], $res3[0], $res3[2]);
+		$duration = $end_time - $start_time;
+		if (!isset($dtm["fixed"])) $dtm["fixed"] = "off";
+		add_svc_downtime_in_db(&$oreon, $dtm, $start_time, $end_time,$duration);
+		$str = "echo '[" . time() . "] SCHEDULE_SVC_DOWNTIME;".$oreon->hosts[$dtm["host_id"]]->get_name().";".$oreon->services[$dtm["service"]]->get_description().";".$start_time.";".$end_time.";".$check[$dtm["fixed"]].";".$duration.";".$oreon->user->get_alias().";".$dtm["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+		system($str);
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["dtm_added"]."</center></div>";
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=308'\",2000)</SCRIPT>";
+	}
+	
+	function add_svc_hostgroup_downtime($oreon, $dtm, $lang){
+		$check = array("on" => 1, "off" => 0);
+		$res = preg_split("/ /", $dtm["strtime"]);
+		$res1 = preg_split("/-/", $res[0]);
+		$res2 = preg_split("/:/", $res[1]);
+		$start_time = mktime($res2[0], $res2[1], $res2[2], $res1[1], $res1[0], $res1[2]);
+		$res = preg_split("/ /", $dtm["endtime"]);
+		$res3 = preg_split("/-/", $res[0]);
+		$res4 = preg_split("/:/", $res[1]);
+		$end_time = mktime($res4[0], $res4[1], $res4[2], $res3[1], $res3[0], $res3[2]);
+		$duration = $end_time - $start_time;
+		if (!isset($dtm["fixed"]))
+			$dtm["fixed"] = "off";
+		foreach ($oreon->hostGroups[$dtm["host_group"]]->hosts as $h){
+			foreach ($h->services as $s){
+				add_hostGroup_downtime_in_db(&$oreon, $dtm, $start_time, $end_time,$duration, $h->get_id());
+				$str = "echo '[" . time() . "] SCHEDULE_SVC_DOWNTIME;".$h->get_name().";".$s->get_description().";".$start_time.";".$end_time.";".$check[$dtm["fixed"]].";".$duration.";".$oreon->user->get_alias().";".$dtm["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+				system($str);
+				unset($s);
+			}
+			unset($h);
+		}
+		if (isset($dtm["host_too"]))
+			foreach ($oreon->hostGroups[$dtm["host_group"]]->hosts as $h){
+				$str = "echo '[" . time() . "] SCHEDULE_HOST_DOWNTIME;".$h->get_name().";".$start_time.";".$end_time.";".$check[$dtm["fixed"]].";".$duration.";".$oreon->user->get_alias().";".$dtm["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+				system($str);
+				unset($h);
+			}
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["dtm_added"]."</center></div>";
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=308'\",2000)</SCRIPT>";
+	}
+	
+	function add_hostgroup_downtime($oreon, $dtm, $lang){
+		$check = array("on" => 1, "off" => 0);
+		$res = preg_split("/ /", $dtm["strtime"]);
+		$res1 = preg_split("/-/", $res[0]);
+		$res2 = preg_split("/:/", $res[1]);
+		$start_time = mktime($res2[0], $res2[1], $res2[2], $res1[1], $res1[0], $res1[2]);
+		$res = preg_split("/ /", $dtm["endtime"]);
+		$res3 = preg_split("/-/", $res[0]);
+		$res4 = preg_split("/:/", $res[1]);
+		$end_time = mktime($res4[0], $res4[1], $res4[2], $res3[1], $res3[0], $res3[2]);
+		$duration = $end_time - $start_time;
+		if (!isset($dtm["fixed"]))
+			$dtm["fixed"] = "off";
+		foreach ($oreon->hostGroups[$dtm["host_group"]]->hosts as $h){
+			add_hostGroup_downtime_in_db(&$oreon, $dtm, $start_time, $end_time, $duration, $h->get_id());
+			$str = "echo '[" . time() . "] SCHEDULE_HOST_DOWNTIME;".$h->get_name().";".$start_time.";".$end_time.";".$check[$dtm["fixed"]].";".$duration.";".$oreon->user->get_alias().";".$dtm["comment"]."' >> " . $oreon->Nagioscfg->command_file;
+			system($str);
+		}
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["dtm_added"]."</center></div>";
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=308'\",2000)</SCRIPT>";
+	}
+	
+	function del_host_downtime($oreon, $arg, $lang){
+		$str = "echo '[" . time() . "] DEL_HOST_DOWNTIME;".$arg["id"]."' >> " . $oreon->Nagioscfg->command_file;
+		del_host_downtime_in_db($arg["start_time"], $arg["host"]);
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["dtm_del"]."</center></div>";
+		system($str);
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=308'\",2000)</SCRIPT>";
+	}
+	
+	function del_svc_downtime($oreon, $arg, $lang){
+		$str = "echo '[" . time() . "] DEL_SVC_DOWNTIME;".$arg["id"]."' >> " . $oreon->Nagioscfg->command_file;
+		//print $arg["svc"];
+		del_svc_downtime_in_db($arg["start_time"], $arg["host"], $arg["svc"]);
+		print "<div style='padding-top: 50px' class='text11b'><center>".$lang["dtm_del"]."</center></div>";
+		system($str);
+		print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"javascript:document.location.href='oreon.php?p=308'\",2000)</SCRIPT>";
+	}
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/external_cmd/functions.php b/www/include/monitoring/external_cmd/functions.php
new file mode 100644
index 0000000000000000000000000000000000000000..77f1526dae9f85d52445a34a95f13bc4b08ac0af
--- /dev/null
+++ b/www/include/monitoring/external_cmd/functions.php
@@ -0,0 +1,213 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset($oreon))
+		exit();
+
+	$tab["1"] = "ENABLE";
+	$tab["0"] = "DISABLE";
+
+	function write_command($cmd){
+		global $oreon;
+		$str = NULL;
+		$str = "echo '[" . time() . "]" . $cmd . "\n' >> " . $oreon->Nagioscfg["command_file"];
+		# print $str;
+		return passthru($str);
+	}
+
+	function send_cmd($arg, $lang){
+		if (isset($arg1))
+			$flg = write_command($arg);
+		$flg ? $ret = $lang["cmd_send"] : $ret = "Problem Execution";
+		return $ret;
+	}
+	
+	// Re-Schedule for all service of an host
+	
+	function schedule_host_svc_checks($arg, $lang, $forced){
+		global $pearDB;
+		$tab_forced = array("0" => "", "1" => "_FORCED");
+		$flg = write_command(" SCHEDULE".$tab_forced[$forced]."_HOST_SVC_CHECKS;" . $arg . ";" . time());
+		return $lang["cmd_send"];
+	}
+	
+	// SCHEDULE_SVC_CHECK
+	
+	function schedule_svc_checks($arg, $lang, $forced){
+		global $pearDB;
+		$tab_forced = array("0" => "", "1" => "_FORCED");
+		$tab_data = split(";", $arg);
+		$flg = write_command(" SCHEDULE".$tab_forced[$forced]."_SVC_CHECK;". $tab_data[0] . ";" . $tab_data[1] . ";" . time());
+		return $lang["cmd_send"];
+	}
+	
+	// host check
+	
+	function host_check($arg, $lang, $type){
+		global $tab, $pearDB;
+		$flg = write_command(" ". $tab[$type]."_HOST_CHECK;". $arg);
+		return $lang["cmd_send"];
+	}
+	
+	//  host notification
+	
+	function host_notification($arg, $lang, $type){
+		global $tab, $pearDB;
+		$flg = write_command(" ".$tab[$type]."_HOST_NOTIFICATIONS;". $arg);
+		return $lang["cmd_send"];
+	}
+	
+	// ENABLE_HOST_SVC_NOTIFICATIONS
+	
+	function host_svc_notifications($arg, $lang, $type){
+		global $tab, $pearDB;
+		$flg = write_command(" " . $tab[$type] . "_HOST_SVC_NOTIFICATIONS;". $arg);
+		return $lang["cmd_send"];
+	}
+	
+	// ENABLE_HOST_SVC_CHECKS
+	
+	function host_svc_checks($arg, $lang, $type){
+		global $tab, $pearDB;
+		$flg = write_command(" " . $tab[$type] . "_HOST_SVC_CHECKS;". $arg);
+		return $lang["cmd_send"];
+	}
+	
+	// ENABLE_HOST_SVC_CHECKS
+	
+	function svc_check($arg, $lang, $type){
+		global $tab, $pearDB;
+		$tab_data = split(";", $arg);
+		$flg = write_command(" " . $tab[$type] . "_SVC_CHECK;". $tab_data["0"] .";".$tab_data["1"]);
+		return $lang["cmd_send"];
+	}
+	
+	// PASSIVE_SVC_CHECKS
+	
+	function passive_svc_check($arg, $lang, $type){
+		global $pearDB,$tab;
+		$tab_data = split(";", $arg);
+		$flg = write_command(" " . $tab[$type] . "_PASSIVE_SVC_CHECKS;". $tab_data[0] . ";". $tab_data[1]);
+		return $lang["cmd_send"];
+	}
+	
+	// SVC_NOTIFICATIONS
+	
+	function svc_notifications($arg, $lang, $type){
+		global $pearDB,$tab;
+		$tab_data = split(";", $arg);
+		$flg = write_command(" " . $tab[$type] . "_SVC_NOTIFICATIONS;". $tab_data[0] . ";". $tab_data[1]);
+		return $lang["cmd_send"];
+	}
+	
+	// _SVC_EVENT_HANDLER
+	
+	function svc_event_handler($arg, $lang, $type){
+		global $pearDB,$tab;
+		$tab_data = split(";", $arg);
+		$flg = write_command(" " . $tab[$type] . "_SVC_EVENT_HANDLER;". $tab_data[0] .";".$tab_data[1]);
+		return $lang["cmd_send"];
+	}
+	
+	// _HOST_EVENT_HANDLER
+	
+	function host_event_handler($arg, $lang, $type){
+		global $pearDB,$tab;
+		$tab_data = split(";", $arg);
+		$flg = write_command(" " . $tab[$type] . "_HOST_EVENT_HANDLER;". $arg);
+		return $lang["cmd_send"];
+	}
+	
+	//_SVC_FLAP_DETECTION
+	
+	function svc_flapping_enable($arg, $lang, $type){
+		global $pearDB,$tab;
+		$tab_data = split(";", $arg);
+		$flg = write_command(" " . $tab[$type] . "_SVC_FLAP_DETECTION;". $tab_data[0] .";".$tab_data[1]);
+		return $lang["cmd_send"];
+	}
+	
+	//_HOST_FLAP_DETECTION
+	
+	function host_flapping_enable($arg, $lang, $type){
+		global $pearDB,$tab;
+		$tab_data = split(";", $arg);
+		$flg = write_command(" " . $tab[$type] . "_HOST_FLAP_DETECTION;". $arg);
+		return $lang["cmd_send"];
+	}
+	
+	function notifi_host_hostgroup($arg, $lang, $type){
+		global $pearDB,$tab;
+		$tab_data = split(";", $arg);
+		$flg = write_command(" " . $tab[$type] . "_HOST_NOTIFICATIONS;". $tab_data[0]);
+		return $lang["cmd_send"];
+	}
+	
+	function acknowledgeHost($lang){
+		global $pearDB,$tab, $_GET;
+		$flg = write_command(" ACKNOWLEDGE_HOST_PROBLEM;".$_GET["host_name"].";1;".$_GET["notify"].";".$_GET["persistent"].";".$_GET["author"].";".$_GET["comment"]);
+		return $lang["cmd_send"];
+	}
+	
+	function acknowledgeHostDisable($lang){
+		global $pearDB,$tab, $_GET;
+		$flg = write_command(" REMOVE_HOST_ACKNOWLEDGEMENT;".$_GET["host_name"]);
+		return $lang["cmd_send"];
+	}
+	
+	function acknowledgeServiceDisable($lang){
+		global $pearDB,$tab;
+		$flg = write_command(" REMOVE_SVC_ACKNOWLEDGEMENT;".$_GET["host_name"].";".$_GET["service_description"]);
+		return $lang["cmd_send"];
+	}
+
+	function acknowledgeService($lang){
+		global $pearDB,$tab;
+		$flg = write_command(" ACKNOWLEDGE_SVC_PROBLEM;".$_GET["host_name"].";".$_GET["service_description"].";1;".$_GET["notify"].";".$_GET["persistent"].";".$_GET["author"].";".$_GET["comment"]);
+		return $lang["cmd_send"];
+	}
+
+	function submitPassiveCheck($lang){
+		global $pearDB;
+		$flg = write_command(" PROCESS_SERVICE_CHECK_RESULT;".$_GET["host_name"].";".$_GET["service_description"].";".$_GET["return_code"].";".$_GET["output"]."|".$_GET["dataPerform"]);
+		return $lang["cmd_send"];
+	}
+	
+	
+	function notifi_svc_host_hostgroup($arg, $lang, $type){
+		global $tab, $pearDB;
+	/*	$res =& $pearDB->query("SELECT host_host_id FROM hostgroup_relation WHERE hostgroup_hg_id = '".$arg."'");
+		while ($r =& $res->fetchRow()){
+			$resH =& $pearDB->query("SELECT host_name FROM host WHERE host_id = '".$r["host_host_id"]."'");
+			$rH =& $resH->fetchRow();
+			$flg = write_command(" " . $tab[$type] . "_HOST_NOTIFICATIONS;". $rH["host_name"]);
+		}
+	*/
+		return $lang["cmd_send"];
+	}
+	
+	function checks_svc_host_hostgroup($arg, $lang, $type){
+		global $tab, $pearDB;
+		/*$res =& $pearDB->query("SELECT host_host_id FROM hostgroup_relation WHERE hostgroup_hg_id = '".$arg."'");
+		$r =& $res->fetchRow();
+		$flg = write_command(" " . $tab[$type] . "_HOST_SVC_CHECKS;". $rH["host_name"]);
+		*/
+		return $lang["cmd_send"];
+	}
+	
+	
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/external_cmd/index.html b/www/include/monitoring/external_cmd/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/monitoring/external_cmd/launch_cmd.php b/www/include/monitoring/external_cmd/launch_cmd.php
new file mode 100644
index 0000000000000000000000000000000000000000..58e81fb603352f6b6cd2b18fc960781191de7214
--- /dev/null
+++ b/www/include/monitoring/external_cmd/launch_cmd.php
@@ -0,0 +1,76 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Jean Baptiste Gouret - Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+?>
+<td width='85%'>
+<?
+	function reschedule_chk_host($oreon, $id)
+	{
+		?>
+		<br><br>
+		<table border=0 width="35%" height="50%">
+		<tr>
+			<td>
+			<? include("./tab3Top.php"); ?>
+			<form action="" method="get">
+				<table width="100%" height='100%' border=0>
+				<tr>
+					<td class="text10b">Host Name<font color="red">*</font></td>
+					<td><input name="p" type="hidden" value="306"><input name="cmd" type="hidden" value="0">
+						  <select name="cmt[host_name]">
+							<? 
+							if (isset($oreon->hosts))
+								foreach ($oreon->hosts as $h)
+									if ($h->register != 1)
+										print "<option>".$h->get_name()."</option>";
+							?>
+						  </select>
+					</td>
+				</tr>
+				<tr>
+					<td class="text10b">Persistent</td>
+					<td><input name="cmt[pers]" type="checkbox" checked></td>
+				</tr>	
+				<tr>
+					<td class="text10b">Auteur<font color="red">*</font> </td>
+					<td><input name="cmt[auther]" type="text" value="<? print $oreon->user->get_alias(); ?>"></td>
+				</tr>
+				<tr>
+					<td class="text10b" valign="top">Comment<font color="red">*</font></td>
+					<td><textarea name="cmt[comment]" cols="40" rows="7"></textarea></td>
+				</tr>
+				<tr>
+					<td colspan="2" align="center"><br><bR><br> <input name="envoyer" type="submit"></td>
+				</tr>
+				</table>
+			<? include("./tab3Bot.php"); ?></form>
+			</td>
+		</tr>
+		</table>	
+		<?
+	}
+	
+
+
+
+if (isset($_GET["cmd"]))
+	switch ($_GET["cmd"]) {
+		case 1: reschedule_chk_host($oreon, $_GET['id']);break;//
+	}
+?>
+
+</td>
diff --git a/www/include/monitoring/get_status_data.php b/www/include/monitoring/get_status_data.php
new file mode 100644
index 0000000000000000000000000000000000000000..99fcecdde0dd22aec53a57e6a8057e3b103b1025
--- /dev/null
+++ b/www/include/monitoring/get_status_data.php
@@ -0,0 +1,103 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Developped by Julien Mathis For Merethis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+
+**/
+	require ("../../oreon.conf.php");
+	require ("../../DBconnect.php");
+	
+	function get_status_data($status_file = NULL){
+		/*
+		 * Error
+		 * 1 : No status_file in parameter
+		 * 2 : Status_file is not readable
+		 * 
+		 */  
+		$status_data = array();
+		global $pearDB;
+		
+		$res =& $pearDB->query("SELECT nagios_version FROM general_opt");
+		$res->fetchInto($nagios_version);
+		$version = $nagios_version["nagios_version"];
+		
+		$tab_status_svc = array("0" => "OK", "1" => "WARNING", "2" => "CRITICAL", "3" => "UNKNOWN", "4" => "PENDING");
+		$tab_status_host = array("0" => "UP", "1" => "DOWN", "2" => "UNREACHABLE");
+		
+		
+		if (!$status_file)
+			return $status_data;
+		
+		if (is_readable($status_file))
+			$log_file = fopen($status_file, "r");
+		else
+			return $status_data;
+		
+		$tab = array();
+		
+		// Read 
+		$cpt = 0;
+		if ($log_file)
+			while ($str = fgets($log_file))
+				if ($version == 1){		
+					if (!preg_match("/^\#.*/", $str)){ // Do not get comments
+						if (preg_match("/^[\[\]0-9\ ]* SERVICE[.]*/", $str)){
+							$log = split(";", $str);
+							$status_data[$cpt] = array("0"=>$log["1"], "1"=>$log["3"], "2"=>$log["2"]);
+							$cpt++;
+						}	
+						if (preg_match("/^[\[\]0-9]* HOST[.]*/", $str)){
+							$log = split(";", $str);
+							$status_data[$cpt] = array("0"=>$log["1"], "1"=>$log["2"]);
+							$cpt++;
+						}
+					}
+				} else {
+					if (!preg_match("/^\#.*/", $str)){ // Do not get comments
+						if (preg_match("/^service/", $str)){   
+						  	$log = array();
+						 	 while ($str2 = fgets($log_file))
+				          			if (!strpos($str2, "}")){      
+					      				if (preg_match("/([A-Za-z0-9\_\-]*)\=(.*)[\ \t]*/", $str2, $tab)){
+											$log[$tab[1]] = $tab[2];
+											//print $tab[1] . "->" . $tab[2] . "<br>";
+				          				}
+					    			} else
+					      				break;
+					      			$status_data[$cpt] = array("0"=>$log["host_name"], "1"=>$tab_status_svc[$log['current_state']], "2"=>$log["service_description"]);
+									$cpt++;
+					  				unset($log);
+					  	} else if (preg_match("/^host/", $str)){ // get host stat
+							$log = array();
+						  	while ($str2 = fgets($log_file))
+						    	if (!strpos($str2, "}")){
+						      		if (preg_match("/([A-Za-z0-9\_\-]*)\=(.*)[\ \t]*/", $str2, $tab)){
+										$log[$tab[1]] = $tab[2];
+										//print $tab[1] . "->" . $tab[2] . "<br>";
+						      		} 
+						    	} else
+						      		break;
+						      	$status_data[$cpt] = array("0"=>$log['host_name'], "1"=>$tab_status_host[$log['current_state']]);
+								$cpt++;
+								unset($log);
+						}
+					}
+				}			
+		return ($status_data);
+	}
+	
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/hostAcknowledge.ihtml b/www/include/monitoring/hostAcknowledge.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..48379e79b95c2e33dc4722be79d7c166d556e553
--- /dev/null
+++ b/www/include/monitoring/hostAcknowledge.ihtml
@@ -0,0 +1,66 @@
+{$form.javascript}
+<form {$form.attributes}>
+<div align=center>
+	 <table id="ListTableSmall">
+
+	 	<tr class="ListHeader">
+	 	<td class="FormHeader" colspan="2">
+	 	{$form.header.title}</td>
+	 	</tr>
+	 	
+		<tr class="list_one">
+			<td class="FormRowField">
+				{$hostlabel}
+			</td>
+			<td class="FormRowValue">
+				{$hostname}
+			</td></tr>
+		{if $en == 1}
+		<tr class="list_two">
+			<td class="FormRowField">
+				{$form.notify.label}
+			</td>
+			<td class="FormRowValue">
+				{$form.notify.html}
+			</td>
+		</tr>
+
+		<tr class="list_two">
+			<td class="FormRowField">
+				{$form.persistent.label}
+			</td>
+			<td class="FormRowValue">
+				{$form.persistent.html}
+			</td>
+		</tr>
+
+
+		<tr class="list_one">
+			<td class="FormRowField">
+				{$authorlabel}
+			</td>
+			<td class="FormRowValue">
+				{$authoralias}
+			</td>
+		</tr>
+		<tr class="list_one">
+			<td class="FormRowField">
+				{$form.comment.label}
+			</td>
+			<td class="FormRowValue">
+				{$form.comment.html}
+			</td>
+		</tr>
+		{/if}
+		<tr class="ListFooter">
+			<td class="FormRowValue" colspan="2">
+			<div id="validForm">
+				<p class="oreonbutton">{$form.submit.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+			</div>
+			</td>
+		</tr>
+
+	</table>
+</div>	
+	{$form.hidden}
+</form>
\ No newline at end of file
diff --git a/www/include/monitoring/hostAcknowledge.php b/www/include/monitoring/hostAcknowledge.php
new file mode 100644
index 0000000000000000000000000000000000000000..89a74efeff836bac738d4edc7cfc7fa12b13e8fa
--- /dev/null
+++ b/www/include/monitoring/hostAcknowledge.php
@@ -0,0 +1,85 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset ($oreon))
+		exit ();
+
+	isset($_GET["host_name"]) ? $host_name = $_GET["host_name"] : $host_name = NULL;
+	isset($_GET["cmd"]) ? $cmd = $_GET["cmd"] : $cmd = NULL;
+	isset($_GET["en"]) ? $en = $_GET["en"] : $en = 1;
+	
+	$path = $oreon->optGen["oreon_path"]."www/include/monitoring/";
+
+# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# HOST LCA
+	$key = array_search($host_name, $oreon->user->lcaHost);
+	if ($key != NULL){
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+
+	#
+	## Form begin
+	#
+
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+
+	$form->addElement('header', 'title', 'Command Options');
+
+	$tpl->assign('hostlabel', $lang['h_name']);
+	$tpl->assign('hostname', $host_name);
+	$tpl->assign('en', $en);
+	$tpl->assign('authorlabel', $lang['cg_alias']);
+	$tpl->assign('authoralias', $oreon->user->get_alias());
+
+	$form->addElement('checkbox', 'notify', 'notify');
+	$form->addElement('checkbox', 'persistent', 'persistent');
+
+	$form->addElement('hidden', 'host_name', $host_name);
+	$form->addElement('hidden', 'author', $oreon->user->get_alias());
+	$form->addElement('hidden', 'cmd', $cmd);
+	$form->addElement('hidden', 'p', $p);
+
+	$form->addElement('hidden', 'en', $en);
+	
+	$attr = "size=40";
+	$form->addElement('text', 'comment', 'comment', $attr);
+	
+	$form->addRule('comment', $lang["error_msg"], 'required', '', 'client');
+	$form->setJsWarnings($lang["herror"],$lang["ferror"]);
+	
+	$form->addElement('submit', 'submit', ($en == 1) ? $lang["m_mon_ack_add"] : $lang["m_mon_ack_del"]);
+	$form->addElement('reset', 'reset', $lang["reset"]);
+
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+	$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+
+	$form->accept($renderer);
+	$tpl->assign('form', $renderer->toArray());
+
+	$tpl->assign('o', 'hd');
+	$tpl->display("hostAcknowledge.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/index.html b/www/include/monitoring/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/monitoring/lang/en.php b/www/include/monitoring/lang/en.php
new file mode 100644
index 0000000000000000000000000000000000000000..6634c51c64d98854ca8d968cdb3fe6f90c874cd8
--- /dev/null
+++ b/www/include/monitoring/lang/en.php
@@ -0,0 +1,129 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+$lang ["m_mon_hosts"] = "Hosts";
+$lang ["m_mon_host"] = "Host";
+$lang ["m_mon_host_info"] = "Host Informations";
+$lang ["m_mon_host_status"] = "Host Status";
+$lang ["m_mon_host_status_info"] = "Status Informations";
+$lang ["m_mon_today"] = "Today";
+$lang ["m_mon_host_last_check"] = "Last Check";
+$lang ["m_mon_status_data_age"] = "Status Data Age";
+$lang ["m_mon_last_change"] = "Last State Change";
+$lang ["m_mon_current_state_duration"] = "Current State Duration";
+$lang ["m_mon_last_notification"] = "Last Host Notification";
+$lang ["m_mon_notification_nb"] = "Current Notification Number";
+$lang ["m_mon_host_flapping"] = "Is This Host Flapping?";
+$lang ["m_mon_percent_state_change"] = "Percent State Change";
+$lang ["m_mon_downtime_sc"] = "In Scheduled Downtime?";
+$lang ["m_mon_last_update"] = "Last Update";
+$lang ["m_mon_host_checks"] = "Host Checks";
+$lang ["m_mon_host_notification"] = "Host Notifications";
+$lang ["m_mon_event_handler"] = "Event Handler";
+$lang ["m_mon_flap_detection"] = "Flap Detection";
+$lang ["m_mon_check_this_host"] = "Checks of this host";
+$lang ["m_mon_notify_this_host"] = "Notifications for this host";
+$lang ["m_mon_SCH_downtime"] = "Schedule downtime for this host";
+$lang ["m_mon_disable_not_all_services"] = "Disable notifications for all services on this host";
+$lang ["m_mon_enable_not_all_services"] = "Enable notifications for all services on this host";
+$lang ["m_mon_SCH_immediate_check"] = "Schedule an immediate check of all services on this host";
+$lang ["m_mon_SCH_immediate_check_f"] = "Schedule an immediate check of all services on this host (forced)";
+$lang ["m_mon_diable_check_all_svc"] = "Disable checks of all services on this host";
+$lang ["m_mon_enable_check_all_svc"] = "Enable checks of all services on this host";
+$lang ["m_mon_ed_event_handler"] = "Event handler for this host";
+$lang ["m_mon_ed_flapping_detect"] = "Flap detection for this host";
+$lang ["m_mon_tips"] = "Tips";
+$lang ["m_mon_view_identity_file"] = "View identity file";
+$lang ["hosts_command"] = "Hosts Command";
+$lang ["m_mon_acknoledge_thos_pb"] = "Acknowledge this Host problem";
+$lang ["m_mon_host_statistics"] = "Host statistics";
+$lang ["m_mon_add_comment"] = "Add Comment for this host";
+$lang ["m_mon_enable"] = "Enable";
+$lang ["m_mon_disable"] = "Disable";
+$lang ["m_mon_enabled"] = "Enabled";
+$lang ["m_mon_disabled"] = "Disabled";
+
+$lang ["m_mon_services"] = "Services";
+$lang ["m_mon_status"] = "Status";
+$lang ["m_mon_hosts_status"] = "Hosts Status";
+$lang ["m_mon_services_status"] = "Services Status";
+$lang ["m_mon_informations"] = "Informations";
+$lang ["m_mon_try"] = "Tries";
+$lang ["m_mon_resubmit_im_checks"] = "Verification Check";
+$lang ["m_mon_resubmit_im_checks_f"] = "Verification Check (Forced)";
+$lang ["m_mon_up"] = "Up";
+$lang ["m_mon_down"] = "Down";
+$lang ["m_mon_unreachable"] = "Unreachable";
+$lang ["m_mon_ok"] = "Ok";
+$lang ["m_mon_warning"] = "Warning";
+$lang ["m_mon_critical"] = "Critical";
+$lang ["m_mon_pending"] = "Pending";
+$lang ["m_mon_unknown"] = "Unknown";
+$lang ["m_mon_hostgroup"] = "Host Group ";
+$lang ["m_mon_host_stt_ttl"] = "Hosts Status";
+$lang ["m_mon_svc_stt_ttl"] = "Services Status";
+$lang ["m_mon_address_ip"] = "IP Address";
+$lang ["m_mon_configure"] = "Manage";
+$lang ["m_mon_next_check"] = "Next Check";
+$lang ["m_mon_log_select"] = "Period";
+$lang ["m_mon_only_for"] = "Only for host";
+
+
+/*** service detail ***/
+
+$lang ["m_mon_services"] = "Services";
+$lang ["m_mon_services_status"] = "Current Status";
+$lang ["m_mon_services_attempt"] = "Current Attempt";
+$lang ["m_mon_services_state"] = "State Type";
+$lang ["m_mon_services_last_tcheck"] = "Last Check Type";
+$lang ["m_mon_services_active_check"] = "Next Scheduled Active Check";
+$lang ["m_mon_services_latency"] = "Latency";
+$lang ["m_mon_services_duration"] = "Check Duration";
+$lang ["m_mon_last_notification_serv"] = "Last Service Notification";
+$lang ["m_mon_services_flapping"] = "Is This Service Flapping?";
+
+
+$lang ["m_mon_services_en_check_active"] = "Check Active Enabled :";
+$lang ["m_mon_services_en_check_passif"] = "Check Passive Enabled :";
+$lang ["m_mon_services_en_notification"] = "Notification Enabled :";
+$lang ["m_mon_services_en_handler"] = "Event Handler Enabled : ";
+$lang ["m_mon_services_en_flap"] = "Flap Detection Enabled :";
+$lang ["m_mon_services_en_acknowledge"] = "Acknowledge Enabled :";
+
+
+$lang ["m_mon_service_command"] = "Service Commands";
+$lang ["m_mon_check_this_service"] = "Checks of this service";
+$lang ["m_mon_schedule"] = "Re-schedule the next check of this service";
+$lang ["m_mon_schedule_force"] = "Re-schedule the next check of this service (forced)";
+$lang ["m_mon_submit_passive"] = "Submit passive check result for this service";
+$lang ["m_mon_accept_passive"] = "accepting passive checks for this service";
+$lang ["m_mon_notification_service"] = "notifications for this service";
+$lang ["m_mon_schedule_downtime"] = "Schedule downtime for this service";
+$lang ["m_mon_schedule_comment"] = "Schedule Comment for this service";
+//$lang ["m_mon_acknowledge"] = "Acknowledge this service";
+
+$lang ["m_mon_disack"] = "Delete this Acknowledge";
+$lang ["m_mon_ack"] = "Acknowledge this service";
+$lang["m_mon_ack_add"] = "Add";
+$lang["m_mon_ack_del"] = "Delete";
+
+$lang ["error_msg"] = "comment is required";
+$lang ["herror"] = "Invalid information entered";
+$lang ["ferror"] = "Please correct these fields";
+
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/lang/fr.php b/www/include/monitoring/lang/fr.php
new file mode 100644
index 0000000000000000000000000000000000000000..6779bf5a10482fece4cb703198120c8aa142e0a1
--- /dev/null
+++ b/www/include/monitoring/lang/fr.php
@@ -0,0 +1,127 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+$lang ["m_mon_hosts"] = "Hosts";
+$lang ["m_mon_host"] = "Host";
+$lang ["m_mon_host_info"] = "Informations de l'host ";
+$lang ["m_mon_host_status"] = "Status de l'host ";
+$lang ["m_mon_host_status_info"] = "Information sur le status";
+$lang ["m_mon_today"] = "Aujourd'hui'";
+$lang ["m_mon_host_last_check"] = "Derni&egrave;re v&eacute;rification";
+$lang ["m_mon_status_data_age"] = "Age des informations";
+$lang ["m_mon_last_change"] = "Dernier Changement de status";
+$lang ["m_mon_current_state_duration"] = "Dur&eacute;e du status Courant";
+$lang ["m_mon_last_notification"] = "Derni&egrave;re Notification";
+$lang ["m_mon_notification_nb"] = "Nombre de Notifications";
+$lang ["m_mon_host_flapping"] = "Cet host est Volatile ?";
+$lang ["m_mon_percent_state_change"] = "Pourcentage de Changement de Status";
+$lang ["m_mon_downtime_sc"] = "Cet host est en Downtime";
+$lang ["m_mon_last_update"] = "Dernier rafraichissement";
+$lang ["m_mon_host_checks"] = "V&eacute;rification des Hosts";
+$lang ["m_mon_host_notification"] = "Notification des Hosts";
+$lang ["m_mon_event_handler"] = "Gestionnaire d'&eacute;v&egrave;nements";
+$lang ["m_mon_flap_detection"] = "D&eacute;tection des oscillations";
+$lang ["m_mon_check_this_host"] = "la v&eacute;rification de cet host";
+$lang ["m_mon_notify_this_host"] = "l'envoie de mail pour cet host";
+$lang ["m_mon_SCH_downtime"] = "Plannifier une p&eacute;riode d'arr&ecirc;t";
+$lang ["m_mon_disable_not_all_services"] = "D&eacute;sactiver la notification pour tous les services de cet host";
+$lang ["m_mon_enable_not_all_services"] = "Activer la notification pour tous les services de cet host";
+$lang ["m_mon_SCH_immediate_check"] = "Plannifier une v&eacute;rification im&eacute;diate de cet host";
+$lang ["m_mon_SCH_immediate_check_f"] = "Plannifier une v&eacute;rification im&eacute;diate de cet host(forc&eacute;)";
+$lang ["m_mon_diable_check_all_svc"] = "D&eacute;sactiver la v&eacute;rification pour tous les services de cet host";
+$lang ["m_mon_enable_check_all_svc"] = "Activer la v&eacute;rification pour tous les services de cet host";
+$lang ["m_mon_ed_event_handler"] = "la gestion d'&eacute;v&egrave;nements";
+$lang ["m_mon_ed_flapping_detect"] = "la d&eacute;tection des oscillations";
+$lang ["m_mon_tips"] = "Acc&egrave;s rapide";
+$lang ["m_mon_view_identity_file"] = "Voir la Fiche d'identit&eacute;";
+$lang ["hosts_command"] = "Actions sur cet host";
+$lang ["m_mon_acknoledge_thos_pb"] = "Prendre en Compte le probl&egrave;";
+$lang ["m_mon_host_statistics"] = "Statistiques de l'host";
+$lang ["m_mon_add_comment"] = "Ajouter un commentaire pour cet host";
+$lang ["m_mon_enable"] = "Activer";
+$lang ["m_mon_disable"] = "D&eacute;sactiver ";
+$lang ["m_mon_enabled"] = "Activ&eacute;";
+$lang ["m_mon_disabled"] = "D&eacute;sactive&eacute;";
+
+$lang ["m_mon_services"] = "Services";
+$lang ["m_mon_status"] = "Status";
+$lang ["m_mon_hosts_status"] = "Status des Hotes";
+$lang ["m_mon_services_status"] = "Status des Services";
+$lang ["m_mon_informations"] = "Informations";
+$lang ["m_mon_try"] = "Essais";
+$lang ["m_mon_resubmit_im_checks"] = "Relancer une v&eacute;rification";
+$lang ["m_mon_resubmit_im_checks_f"] = "Relancer une v&eacute;rification (forc&eacute;)";
+$lang ["m_mon_up"] = "Up";
+$lang ["m_mon_down"] = "Down";
+$lang ["m_mon_unreachable"] = "Inaccessible";
+$lang ["m_mon_ok"] = "Ok";
+$lang ["m_mon_warning"] = "Attention";
+$lang ["m_mon_critical"] = "Critique";
+$lang ["m_mon_pending"] = "En Attente";
+$lang ["m_mon_unknown"] = "Inconnu";
+$lang ["m_mon_hostgroup"] = "Groupement d'hotes ";
+$lang ["m_mon_host_stt_ttl"] = "Status des hotes";
+$lang ["m_mon_svc_stt_ttl"] = "Status des services";
+$lang ["m_mon_address_ip"] = "Adresse IP";
+$lang ["m_mon_configure"] = "Configurer";
+$lang ["m_mon_next_check"] = "Prochain Contr&ocirc;le";
+$lang ["m_mon_log_select"] = "P&eacute;riode";
+$lang ["m_mon_only_for"] = "Seulement l'host ";
+
+/*** service detail ***/
+
+$lang ["m_mon_services"] = "Services";
+$lang ["m_mon_services_status"] = "Status Courant";
+$lang ["m_mon_services_attempt"] = "Nombre de v&eacute;rification";
+$lang ["m_mon_services_state"] = "Type d'Etat";
+$lang ["m_mon_services_last_tcheck"] = "Derni&egrave;re v&eacute;rification du Type";
+$lang ["m_mon_services_active_check"] = "Prochain Ordonnancement Actif";
+$lang ["m_mon_services_latency"] = "Latence";
+$lang ["m_mon_services_duration"] = "Dur&eacute;e de la v&eacute;rification";
+$lang ["m_mon_last_notification_serv"] = "Derni&egrave;re notification du service";
+$lang ["m_mon_services_flapping"] = "Ce Service est Volatile ?";
+
+
+$lang ["m_mon_services_en_check_active"] = "V&eacute;rification des Services :";
+$lang ["m_mon_services_en_check_passif"] = "V&eacute;rification Passive :";
+$lang ["m_mon_services_en_notification"] = "Notification des services :";
+$lang ["m_mon_services_en_flap"] = "Detection des oscillations :";
+$lang ["m_mon_services_en_acknowledge"] = "Prise en compte du status courant :";
+
+
+$lang ["m_mon_service_command"] = "Actions sur ce service";
+$lang ["m_mon_check_this_service"] = "la v&eacute;rification de ce service";
+$lang ["m_mon_schedule"] = "Plannifier une v&eacute;rification imm&eacute;diate de ce service";
+$lang ["m_mon_schedule_force"] = "Plannifier une v&eacute;rification imm&eacute;diate de ce service(forc&eacute;)";
+$lang ["m_mon_submit_passive"] = "soumission manuelle d'état pour ce service";
+$lang ["m_mon_accept_passive"] = "la v&eacute;rification du service en passif";
+$lang ["m_mon_notification_service"] = "les notifications pour le service";
+$lang ["m_mon_schedule_downtime"] = "Plannifier une période d'arrêt";
+$lang ["m_mon_schedule_comment"] = "Ajouter un commentaire pour ce service";
+//$lang ["m_mon_acknowledge"] = "en compte du status courant";
+
+$lang ["m_mon_disack"] = "Supprimer la prise en compte du status courant";
+$lang ["m_mon_ack"] = "Prendre en compte le status courant";
+$lang["m_mon_ack_add"] = "Ajouter";
+$lang["m_mon_ack_del"] = "Supprimer";
+
+$lang ["error_msg"] = "le champ comment doit etre renseigné";
+$lang ["herror"] = "Erreur de saisie";
+$lang ["ferror"] = "Veuillez corriger";
+
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/load_status_log.php b/www/include/monitoring/load_status_log.php
new file mode 100644
index 0000000000000000000000000000000000000000..7d93c659f4ebf81ddc6a4f60f6d010812cae04f6
--- /dev/null
+++ b/www/include/monitoring/load_status_log.php
@@ -0,0 +1,304 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	
+if (!isset($oreon)){
+  exit();
+}
+
+$debug = 0;
+
+function get_program_data($log, $status_proc){
+  $pgr_nagios_stat = array();
+  $pgr_nagios_stat["program_start"] = $log['1'];
+  $pgr_nagios_stat["nagios_pid"] = $log['2'];
+  $pgr_nagios_stat["daemon_mode"] = $log['3'];
+  $pgr_nagios_stat["last_command_check"] = $log['4'];
+  $pgr_nagios_stat["last_log_rotation"] = $log['5'];
+  $pgr_nagios_stat["enable_notifications"] = $log['6'];
+  $pgr_nagios_stat["execute_service_checks"] = $log['7'];
+  $pgr_nagios_stat["accept_passive_service_checks"] = $log['8'];
+  $pgr_nagios_stat["enable_event_handlers"] = $log['9'];
+  $pgr_nagios_stat["obsess_over_services"] = $log['10'];
+  $pgr_nagios_stat["enable_flap_detection"] = $log['11'];
+  $pgr_nagios_stat["process_performance_data"] = $log['13'];
+  $pgr_nagios_stat["status_proc"] = $status_proc;
+  return ($pgr_nagios_stat);
+}
+	
+function get_host_data($log){
+  $host_data["host_name"] = $log['1'];
+  $host_data["status"] = $log['2'];
+  $host_data["last_check"] = $log['3'];
+  $host_data["last_stat"] = $log['4'];
+  $host_data["acknowledged"] = $log['5'];
+  $host_data["time_up"] = $log['6'];
+  $host_data["time_down"] = $log['7'];
+  $host_data["time_unrea"] = $log['8'];
+  $host_data["last_notifi"] = $log['9'];
+  $host_data["curr_not_number"] = $log['10'];
+  $host_data["not_en"] = $log['11'];
+  $host_data["ev_handler_en"] = $log['12'];
+  $host_data["checks_en"] = $log['13'];
+  $host_data["flap_detect_en"] = $log['14'];
+  $host_data["flapping"] = $log['15'];
+  $host_data["percent_stat_change"] = $log['16'];
+  $host_data["sch_downtime_death"] = $log['17'];
+  $host_data["failure_prediction_en"] = $log['18'];
+  $host_data["process_performance_data"] = $log['19'];
+  $host_data["output"] = $log['20'];
+  return ($host_data);
+}
+
+function get_service_data($log){
+  $svc_data["host_name"] = $log[1];
+  $svc_data["description"] = $log[2];
+  $svc_data["status"] = $log[3];
+  $svc_data["retry"] = $log[4];
+  $svc_data["stat_type"] = $log[5];
+  $svc_data["last_check"] = $log[6];
+  $svc_data["next_check"] = $log[7];
+  $svc_data["check_type"] = $log[8];
+  $svc_data["checks_en"] = $log[9];
+  $svc_data["accept_passive_check"] = $log[10];
+  $svc_data["ev_handler_en"] = $log[11];
+  $svc_data["last_change"] = $log[12];
+  $svc_data["pb_aknowledged"] = $log[13];
+  $svc_data["last_hard_stat"] = $log[14];
+  $svc_data["ok"] = $log[15];
+  $svc_data["warning"] = $log[16];
+  $svc_data["unknown"] = $log[17];
+  $svc_data["critical"] = $log[18];
+  $svc_data["last_notification"] = $log[19];
+  $svc_data["current_not_nb"] = $log[20];
+  $svc_data["not_en"] = $log[21];
+  $svc_data["latency"] = $log[22];
+  $svc_data["exec_time"] = $log[23];
+  $svc_data["flap_detect_en"] = $log[24];
+  $svc_data["svc_is_flapping"] = $log[25];
+  $svc_data["percent_stat_change"] = $log[26];
+  $svc_data["sch_downtime_death"] = $log[27];
+  $svc_data["failure_prediction_en"] = $log[28];
+  $svc_data["process_perf_date"] = $log[29];
+  $svc_data["obsess_over_service"] = $log[30];
+  $svc_data["output"] = $log[31];
+  // Stat bonus
+  $svc_data["total_running"] = $log[15]+$log[16]+$log[17]+$log[18];
+  return ($svc_data);
+}
+
+//	xdebug_start_trace(); 
+
+$t_begin = microtime_float();
+
+// Open File
+if (file_exists($oreon->Nagioscfg["status_file"])){
+  $log_file = fopen($oreon->Nagioscfg["status_file"], "r");
+  $status_proc = 1;
+} else {
+  $log_file = 0;
+  $status_proc = 0;
+}
+
+// init table
+$service = array();
+$host_status = array();
+$service_status = array();
+$host_services = array();
+$metaService_status = array();
+$tab_host_service = array();
+
+// Read 
+
+$lca =& $oreon->user->lcaHost;
+$version = $oreon->user->get_version();
+
+$tab_status_svc = array("0" => "OK", "1" => "WARNING", "2" => "CRITICAL", "3" => "UNKNOWN", "4" => "PENDING");
+$tab_status_host = array("0" => "UP", "1" => "DOWN", "2" => "UNREACHABLE");
+	    
+if ($version == 1){
+  if ($log_file)
+    while ($str = fgets($log_file))		{
+      	// set last update 
+     	$last_update = date("d-m-Y h:i:s");
+      	if (!preg_match("/^\#.*/", $str)){		// get service stat
+			$log = split(";", $str);
+			if (preg_match("/^[\[\]0-9]* SERVICE[.]*/", $str)){
+	  			if (array_search($log["1"], $lca)){
+					$service_status[$log["1"]."_".$log["2"]] = get_service_data($log);
+		    		$tab_host_service[$log["1"]][$log["2"]] = "1";
+		 		} else if (!strcmp($log[1], "Meta_Module")){
+		    		$metaService_status[$log["2"]] = get_service_data($log);
+	  			}
+			} else if (preg_match("/^[\[\]0-9]* HOST[.]*/", $str)){ // get host stat
+	  			if (array_search($log["1"], $lca)){
+	    			$host_status[$log["1"]] = get_host_data($log);
+	    			$tab_host_service[$log["1"]] = array();
+	  			}
+			} else if (preg_match("/^[\[\]0-9]* PROGRAM[.]*/", $str))
+	  			$program_data = get_program_data($log, $status_proc);
+	  	}
+      	unset($str);
+	}
+} else {
+  if ($log_file)
+    while ($str = fgets($log_file)) {
+      	// set last update
+      	$last_update = date("d-m-Y h:i:s");
+      	if (!preg_match("/^\#.*/", $str)){
+			if (preg_match("/^service/", $str)){   
+			  $log = array();
+			  while ($str2 = fgets($log_file))
+	          	if (!strpos($str2, "}")){      
+		      		if (preg_match("/([A-Za-z0-9\_\-]*)\=(.*)[\ \t]*/", $str2, $tab))
+						$log[$tab[1]] = $tab[2];
+		    	} else
+		      		break;
+				if (isset($log['host_name']) && array_search($log['host_name'], $lca)){
+					$svc_data["host_name"] = $log["host_name"];
+					$svc_data["description"] = $log["service_description"];
+					$svc_data["status"] = $tab_status_svc[$log['current_state']];
+					$svc_data["retry"] = $log["current_attempt"];
+					$svc_data["stat_type"] = $log["state_type"];
+					$svc_data["last_check"] = $log["last_check"];
+					$svc_data["next_check"] = $log["next_check"];
+					$svc_data["check_type"] = $log["check_type"];
+					$svc_data["checks_en"] = $log["active_checks_enabled"];
+					$svc_data["accept_passive_check"] = $log["passive_checks_enabled"];
+					$svc_data["ev_handler_en"] = $log["event_handler_enabled"];
+					$svc_data["last_change"] = $log["last_state_change"];
+					$svc_data["pb_aknowledged"] = $log["problem_has_been_acknowledged"];
+					$svc_data["last_hard_stat"] = $log["last_hard_state_change"];
+					$svc_data["ok"] = "";
+					$svc_data["warning"] = "";
+					$svc_data["unknown"] = "";
+					$svc_data["critical"] = "";
+					$svc_data["last_notification"] = $log["last_notification"];
+					$svc_data["current_not_nb"] = $log["current_notification_number"];
+					$svc_data["not_en"] = $log["notifications_enabled"];
+					$svc_data["latency"] = $log["check_latency"];
+					$svc_data["exec_time"] = $log["check_execution_time"];
+					$svc_data["flap_detect_en"] = $log["flap_detection_enabled"];
+					$svc_data["svc_is_flapping"] = $log["is_flapping"];
+					$svc_data["percent_stat_change"] = $log["percent_state_change"];
+					$svc_data["sch_downtime_death"] = $log["scheduled_downtime_depth"];
+					$svc_data["failure_prediction_en"] = $log["failure_prediction_enabled"];
+					$svc_data["process_perf_date"] = $log["process_performance_data"];
+					$svc_data["obsess_over_service"] = $log["obsess_over_service"];
+					$svc_data["output"] = $log["plugin_output"];
+					$service_status[$svc_data["host_name"] . "_" . $svc_data["description"]] = $svc_data;
+					$tab_host_service[$svc_data["host_name"]][$svc_data["description"]] = "1";
+				} else if (strstr("Meta_Module", $log['host_name'])){
+					$svc_data["host_name"] = $log["host_name"];
+					$svc_data["description"] = $log["service_description"];
+					$svc_data["status"] = $tab_status_svc[$log['current_state']];
+					$svc_data["retry"] = $log["current_attempt"];
+					$svc_data["last_check"] = $log["last_check"];
+					$svc_data["next_check"] = $log["next_check"];
+					$svc_data["check_type"] = $log["check_type"];
+					$svc_data["checks_en"] = $log["active_checks_enabled"];
+					$svc_data["accept_passive_check"] = $log["passive_checks_enabled"];
+					$svc_data["ev_handler_en"] = $log["event_handler_enabled"];
+					$svc_data["last_change"] = $log["last_state_change"];
+					$svc_data["output"] = $log["plugin_output"];
+					$metaService_status[$log["service_description"]] = $svc_data;
+				}
+		  		unset($log);
+		  } else if (preg_match("/^host/", $str)){ // get host stat
+			$log = array();
+		  	while ($str2 = fgets($log_file))
+		    	if (!strpos($str2, "}")){
+		      		if (preg_match("/([A-Za-z0-9\_\-]*)\=(.*)[\ \t]*/", $str2, $tab)){
+						$log [$tab[1]] = $tab[2];
+		      		} 
+		    	} else
+		      		break;
+				if (array_search($log['host_name'], $lca)){
+					$host_data["host_name"] = $log['host_name'];
+					$host_data["status"] = $tab_status_host[$log['current_state']];
+					$host_data["last_check"] = $log['last_check'];
+					$host_data["last_stat"] = $log['last_state_change'];
+					$host_data["acknowledged"] = $log['problem_has_been_acknowledged'];
+					$host_data["time_up"] = "";
+					$host_data["time_down"] = "";
+					$host_data["time_unrea"] = "";
+					$host_data["last_notifi"] = $log['last_notification'];
+					$host_data["curr_not_number"] = $log['current_notification_number'];
+					$host_data["not_en"] = $log['notifications_enabled'];
+					$host_data["ev_handler_en"] = $log['event_handler_enabled'];
+					$host_data["checks_en"] = $log['active_checks_enabled'];
+					$host_data["flap_detect_en"] = $log['flap_detection_enabled'];
+					$host_data["flapping"] = $log['is_flapping'];
+					$host_data["percent_stat_change"] = $log['percent_state_change'];
+					$host_data["sch_downtime_death"] = $log['scheduled_downtime_depth'];
+					$host_data["failure_prediction_en"] = $log['failure_prediction_enabled'];
+					$host_data["process_performance_data"] = $log['process_performance_data'];
+					isset($log['plugin_output']) ? $host_data["output"] = $log['plugin_output']: $host_data["output"] = "";
+					$host_status[$host_data["host_name"]] = $host_data;
+					$tab_host_service[$host_data["host_name"]] = array();
+		  		}	
+				unset($log);
+			} else if (preg_match("/^program/", $str)){
+	          	$log = array();
+	          	while ($str2 = fgets($log_file))
+	            	if (!strpos($str2, "}")){
+	              		if (preg_match("/([A-Za-z0-9\_\-]*)\=([A-Za-z0-9\_\-\.\,\(\)\[\]\ \=\%\;\:]+)/", $str2, $tab)){
+	                		$pgr_nagios_stat[$tab[1]] = $tab[2];
+	              		}
+	            	} else
+	              		break;
+	          	unset($log);
+	        } else if (preg_match("/^info/", $str)){
+	          	$log = array();
+	          	while ($str2 = fgets($log_file))
+	            	if (!strpos($str2, "}")){
+	              		if (preg_match("/([A-Za-z0-9\_\-]*)\=([A-Za-z0-9\_\-\.\,\(\)\[\]\ \=\%\;\:]+)/", $str2, $tab)){
+	                		$pgr_nagios_stat[$tab[1]] = $tab[2];
+	              		}
+	            	} else
+	              		break;
+	          	unset($log);
+	        }
+			unset($str);	
+      	}
+    }
+}
+
+$row_data = array();
+if (isset($_GET["o"]) && $_GET["o"] == "svcSch" && !isset($_GET["sort_types"])){
+	$_GET["sort_types"] = "next_check";
+	$_GET["order"] = "SORT_ASC";
+}
+
+if (isset($_GET["sort_types"]) && $_GET["sort_types"]){
+  foreach ($service_status as $key => $row)
+    $row_data[$key] = $row[$_GET["sort_types"]];
+  !strcmp(strtoupper($_GET["order"]), "SORT_ASC") ? array_multisort($row_data, SORT_ASC, $service_status) : array_multisort($row_data, SORT_DESC, $service_status);
+}
+if (isset($_GET["sort_typeh"]) && $_GET["sort_typeh"]){
+  foreach ($host_status as $key => $row)
+    $row_data[$key] = $row[$_GET["sort_typeh"]];
+  !strcmp(strtoupper($_GET["order"]), "SORT_ASC") ? array_multisort($row_data, SORT_ASC, $host_status) : array_multisort($row_data, SORT_DESC, $host_status);
+}
+
+if ($debug){ ?>
+ <textarea cols='200' rows='50'><? print_r($host_status);print_r($service_status);?></textarea><?	
+}
+
+?> 
\ No newline at end of file
diff --git a/www/include/monitoring/log/choose_log_file.php b/www/include/monitoring/log/choose_log_file.php
new file mode 100644
index 0000000000000000000000000000000000000000..4261990854415d5ebb58d56847a90bffcbf30c31
--- /dev/null
+++ b/www/include/monitoring/log/choose_log_file.php
@@ -0,0 +1,88 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick
+Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the
+quality,
+safety, contents, performance, merchantability, non-infringement or
+suitability for
+any particular or intended purpose of the Software found on the OREON web
+site.
+In no event will OREON be liable for any direct, indirect, punitive,
+special,
+incidental or consequential damages however they may arise and even if OREON
+has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset($oreon))
+		exit();
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	$tableFile2 = array();
+	if ($handle  = @opendir($oreon->Nagioscfg["log_archive_path"]))	{
+		while ($file = @readdir($handle))
+			if (is_file($oreon->Nagioscfg["log_archive_path"]."/$file"))	{
+				preg_match("/nagios\-([0-9]*)\-([0-9]*)\-([0-9]*)\-([0-9]*).log/", $file, $matches);
+				$time = mktime("0", "0", "0", $matches[1], $matches[2], $matches[3]) - 1;
+				$tableFile2[$file] =  "  " . date($lang["date_format"], $time) . " ";
+			}
+		@closedir($handle);
+	}
+	krsort($tableFile2);
+	
+	$tableFile3 = array($oreon->Nagioscfg["log_file"] => " -- " . $lang["m_mon_today"] . " -- ");
+	$tableFile1 = array_merge($tableFile3, $tableFile2);
+
+
+
+	$host = array();
+	
+	$host[""] = "";
+	
+	$res =& $pearDB->query("SELECT host_name FROM host where host_activate = '1' and host_register = '1' ORDER BY host_name");
+	while ($res->fetchInto($h))
+		$host[$h["host_name"]] = $h["host_name"];
+
+	$debug = 0;
+	$attrsTextI		= array("size"=>"3");
+	$attrsText 		= array("size"=>"30");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	
+	#
+	## Form begin
+	#
+	
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	$form->addElement('header', 'title', $lang["dtm_addS"]);
+	
+	#
+	## Indicator basic information
+	#
+	
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+    
+    $selHost =& $form->addElement('select', 'file', $lang["nag_logFile"], $tableFile1, array("onChange" =>"this.form.submit();"));
+	$selHost =& $form->addElement('select', 'host', $lang["h"], $host, array("onChange" =>"this.form.submit();"));
+	
+	if (isset($_POST["host"])){
+		$form->setDefaults(array('file' => $_POST["host"]));
+	} else 
+		$form->setDefaults(array('file' => $oreon->Nagioscfg["log_file"]));
+	
+	$log = NULL;	
+	$tab_log = array();	
+	
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/log/templates/viewAlertLog.ihtml b/www/include/monitoring/log/templates/viewAlertLog.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..72686c1937dba6f0be3e08645ac08e3bbaaba9e4
--- /dev/null
+++ b/www/include/monitoring/log/templates/viewAlertLog.ihtml
@@ -0,0 +1,66 @@
+{$form.javascript}
+<script type="text/javascript" src="include/configuration/changetab.js"></script>
+<div>
+	<form {$form.attributes}>
+	<table id="ListTableSmall" align="right">
+		<tr class='ListHeader'>
+			<td style="padding-left:15px;"><b>{$lang.m_mon_log_select} : {$form.file.html}  -   {$lang.m_mon_only_for}  {$form.host.html}</b></td>
+		</tr>
+	</table>
+	{$form.hidden}
+	</form>
+</div>
+<br><br>
+<div>
+	<ul id="mainnav">
+		<li class="a" id='c1'><a href="#"  onclick="javascript:montre('1');">Hosts Alerts</a></li>
+		<li class="b" id='c2'><a href="#" onclick="javascript:montre('2');">Services Alerts</a></li>
+	</ul>
+</div>
+<div id='tab1' class='tab'>
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderCenter">&nbsp;</td>
+			<td class="ListColHeaderCenter">Date</td>
+			<td class="ListColHeaderCenter">Event</td>
+			<td class="ListColHeaderCenter">Host</td>
+			<td class="ListColHeaderCenter">Informations</td>
+		</tr>
+		{foreach item=tb from=$tab_log}
+		{if $tb.type == "HOST ALERT"}
+		<tr class={cycle values="list_two, list_one"}>
+			<td class="ListColHeaderCenter"><img src='./img/icones/12x12/alert.gif'></td>
+			<td class="ListColLeft">{$tb.time}</td>
+			<td class="ListColLeft">{$tb.type}</td>
+			<td class="ListColLeft">{$tb.host}</td>
+			<td class="ListColNoWrap">{$tb.output}</td>
+		</tr>
+		{/if}
+		{/foreach}
+	</table>
+</div>
+<div id='tab2' class='tab'>
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderCenter">&nbsp;</td>
+			<td class="ListColHeaderCenter">Date</td>
+			<td class="ListColHeaderCenter">Event</td>
+			<td class="ListColHeaderCenter">Host</td>
+			<td class="ListColHeaderCenter">Service</td>
+			<td class="ListColHeaderCenter">Informations</td>
+		</tr>
+		{foreach item=tb1 from=$tab_log}
+		{if $tb1.type == "SERVICE ALERT"}
+		<tr class={cycle values="list_two, list_one"}>
+			<td class="ListColHeaderCenter"><img src='./img/icones/12x12/alert.gif'></td>
+			<td class="ListColLeft">{$tb1.time}</td>
+			<td class="ListColLeft">{$tb1.type}</td>
+			<td class="ListColLeft">{$tb1.host}</td>
+			<td class="ListColLeft">{$tb1.service}</td>
+			<td class="ListColNoWrap">{$tb1.output}</td>
+		</tr>
+		{/if}
+		{/foreach}
+	</table>
+</div>
+<br><br><br>
\ No newline at end of file
diff --git a/www/include/monitoring/log/templates/viewLog.ihtml b/www/include/monitoring/log/templates/viewLog.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..7d61ebfb9b96fb6da5085d567e5fbb9fb99e9642
--- /dev/null
+++ b/www/include/monitoring/log/templates/viewLog.ihtml
@@ -0,0 +1,32 @@
+{$form.javascript}
+<div>
+	<form {$form.attributes}>
+	<table id="ListTableSmall" align="right">
+		<tr class='ListHeader'>
+			<td style="padding-left:15px;"><b>{$lang.m_mon_log_select} : {$form.file.html}</b></td>
+		</tr>
+	</table>
+	{$form.hidden}
+	</form>
+</div>
+	<br><br><br>
+<div>
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderCenter">Date</td>
+			<td class="ListColHeaderCenter">Event</td>
+		</tr>
+		{foreach item=tb from=$tab_log}
+		<tr class={cycle values="list_two, list_one"}>
+			<td class="ListColRight">{$tb.time}</td>
+			<td class="ListColNoWrap"><img src="{$tb.logo}">&nbsp;&nbsp;{$tb.data}</td>
+		</tr>
+		{if $tb.output}
+		<tr class={cycle values="list_one,list_two"}>
+			<td>&nbsp;</td>
+			<td class="ListColLeft" colspan="3">{$tb.output}</td>
+		</tr>
+		{/if}
+		{/foreach}
+	</table>
+</div>
\ No newline at end of file
diff --git a/www/include/monitoring/log/templates/viewNotifyLog.ihtml b/www/include/monitoring/log/templates/viewNotifyLog.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..a6251e6ef937521e0d75092a2e06d8b5792ed510
--- /dev/null
+++ b/www/include/monitoring/log/templates/viewNotifyLog.ihtml
@@ -0,0 +1,74 @@
+<script type="text/javascript" src="include/configuration/changetab.js"></script>
+{$form.javascript}
+<div>
+	<form {$form.attributes}>
+	<table id="ListTableSmall" align="right">
+		<tr class='ListHeader'>
+			<td style="padding-left:15px;"><b>{$lang.m_mon_log_select} : {$form.file.html}  -   {$lang.m_mon_only_for}  {$form.host.html}</b></td>
+		</tr>
+	</table>
+	{$form.hidden}
+	</form>
+</div>
+<br><br>
+<div>
+	<ul id="mainnav">
+		<li class="a" id='c1'><a href="#"  onclick="javascript:montre('1');">Hosts Notifications</a></li>
+		<li class="b" id='c2'><a href="#" onclick="javascript:montre('2');">Services Notifications</a></li>
+	</ul>
+</div>
+<div id='tab1' class='tab'>
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderPicker">&nbsp;</td>
+			<td class="ListColHeaderCenter">Event</td>
+			<td class="ListColHeaderCenter">Date</td>
+			<td class="ListColHeaderCenter">Contact</td>
+			<td class="ListColHeaderCenter">Host</td>
+			<td class="ListColHeaderCenter">Commande</td>
+			<td class="ListColHeaderCenter">Informations</td>
+		</tr>
+		{foreach item=tb from=$tab_log}
+		{if !$tb.service}
+		<tr class={cycle values="list_two, list_one"}>
+			<td class="ListColHeaderPicker"><img src='./img/icones/12x12/info.gif'></td>
+			<td class="ListColLeft">{$tb.type}</td>
+			<td class="ListColLeft">{$tb.time}</td>
+			<td class="ListColLeft">{$tb.contact}</td>
+			<td class="ListColLeft">{$tb.host}</td>
+			<td class="ListColLeft">{$tb.command}</td>
+			<td class="ListColNoWrap">{$tb.output}</td>
+		</tr>
+		{/if}
+		{/foreach}
+	</table>
+</div>
+<div id='tab2' class='tab'>
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderPicker">&nbsp;</td>
+			<td class="ListColHeaderCenter">Event</td>
+			<td class="ListColHeaderCenter">Date</td>
+			<td class="ListColHeaderCenter">contact</td>
+			<td class="ListColHeaderCenter">Host</td>
+			<td class="ListColHeaderCenter">Service</td>
+			<td class="ListColHeaderCenter">Commande</td>
+			<td class="ListColHeaderCenter">Informations</td>
+		</tr>
+		{foreach item=tb1 from=$tab_log}
+		{if $tb1.service}
+		<tr class={cycle values="list_two, list_one"}>
+			<td class="ListColHeaderPicker"><img src='./img/icones/12x12/info.gif'></td>
+			<td class="ListColLeft">{$tb1.type}</td>
+			<td class="ListColLeft">{$tb1.time}</td>
+			<td class="ListColLeft">{$tb1.contact}</td>
+			<td class="ListColLeft">{$tb1.host}</td>
+			<td class="ListColLeft">{$tb1.service}</td>
+			<td class="ListColLeft">{$tb1.command}</td>
+			<td class="ListColNoWrap">{$tb1.output}</td>
+		</tr>
+		{/if}
+		{/foreach}
+	</table>
+</div>
+<br><br><br>
\ No newline at end of file
diff --git a/www/include/monitoring/log/templates/viewWarnLog.ihtml b/www/include/monitoring/log/templates/viewWarnLog.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..b2c78a99d1fa10168f6cac4cf7b524d7e7376e6b
--- /dev/null
+++ b/www/include/monitoring/log/templates/viewWarnLog.ihtml
@@ -0,0 +1,33 @@
+{$form.javascript}
+<div>
+	<form {$form.attributes}>
+	<table id="ListTableSmall" align="right">
+		<tr class='ListHeader'>
+			<td style="padding-left:15px;"><b>{$lang.m_mon_log_select} : {$form.file.html}</b></td>
+		</tr>
+	</table>
+	{$form.hidden}
+	</form>
+</div>
+	<br><br><br>
+<div>
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderCenter">Date</td>
+			<td class="ListColHeaderCenter">Warning</td>
+		</tr>
+		{foreach item=tb from=$tab_log}
+		<tr class={cycle values="list_two, list_one"}>
+			<td class="ListColRight">{$tb.time}</td>
+			<td class="ListColNoWrap">{$tb.warning}</td>
+		</tr>
+		{if $tb.output}
+		<tr class={cycle values="list_one,list_two"}>
+			<td>&nbsp;</td>
+			<td class="ListColLeft" colspan="3">{$tb.output}</td>
+		</tr>
+		{/if}
+		{/foreach}
+	</table>
+</div>
+<br><br><br>
\ No newline at end of file
diff --git a/www/include/monitoring/log/viewAlertLog.php b/www/include/monitoring/log/viewAlertLog.php
new file mode 100644
index 0000000000000000000000000000000000000000..3237c044a0db1f29be7df5e56d5332b5f557e3e9
--- /dev/null
+++ b/www/include/monitoring/log/viewAlertLog.php
@@ -0,0 +1,95 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+	
+	/*
+	 	
+	include_once("./include/monitoring/common-Func.php");			
+	include_once("./include/monitoring/external_cmd/cmd.php");
+	*/
+	
+	function getLogData($time_event, $host, $service, $status, $output, $type){
+		global $lang;
+		$tab["time"] = date($lang["header_format"], $time_event);
+		$tab["host"] = $host;
+		$tab["service"] = $service;
+		$tab["status"] = $status;
+		$tab["output"] = $output;
+		$tab["type"] = $type;
+		return $tab ;
+	}
+
+	include("./include/monitoring/log/choose_log_file.php");
+
+	$log = NULL;	
+	$tab_log = array();	
+	if (isset($_POST["file"]) && is_file($oreon->Nagioscfg["log_archive_path"] . $_POST["file"])){
+		$log = fopen($oreon->Nagioscfg["log_archive_path"] . $_POST["file"], "r");
+	} else {
+		if (file_exists($oreon->Nagioscfg["log_file"]) && !($log = fopen($oreon->Nagioscfg["log_file"], "r")))
+			echo $lang["pel_cant_open"] . $oreon->Nagioscfg["log_file"] . "<br>";
+	}
+	if ($log)
+		for ($i = 0; $str = fgets($log); $i++){
+			if (preg_match("/^\[([0-9]*)\] (.+)/", $str, $matches)){
+				$time_event = $matches[1];
+				$res = preg_split("/:/", $matches[2], 2);
+				if (isset($res[1])) 
+					$res1 = preg_split("/;/", $res[1]);			
+				$type = $res[0];
+				if (isset($_POST["host"]) && strlen($_POST["host"])) {
+					$res1[0] = str_replace(" ", "", $res1[0]);
+					if (!strncmp($type, "HOST ALERT", 10) && !strcmp($_POST["host"], $res1[0]))
+						$tab_log[$i] = getLogData($time_event, $res1[0], "", $res1[1], $res1[4], $type);
+					else if (!strncmp($type, "SERVICE ALERT", 13) && !strcmp($_POST["host"], $res1[0]))
+						$tab_log[$i] = getLogData($time_event, $res1[0], $res1[1], $res1[2], $res1[5], $type);
+				} else {
+					if (!strncmp($type, "HOST ALERT", 10))
+						$tab_log[$i] = getLogData($time_event, $res1[0], "", $res1[1], $res1[4], $type);
+					else if (!strncmp($type, "SERVICE ALERT", 13))
+						$tab_log[$i] = getLogData($time_event, $res1[0], $res1[1], $res1[2], $res1[5], $type);
+				
+				}
+			}
+		}
+
+	if (isset($tab_log) && $tab_log)
+		krsort($tab_log);
+
+	$path = "./include/monitoring/log/";
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "templates/");
+	
+	#Apply a template definition	
+		
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+	$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+	$form->accept($renderer);	
+	
+	//$form->display();
+	
+	$tpl->assign('o', $o);		
+	$tpl->assign('form', $renderer->toArray());	
+	$tpl->assign('lang', $lang);			
+	$tpl->assign("tab_log", $tab_log);
+	$tpl->assign("p", $p);
+	$tpl->display("viewAlertLog.ihtml");
+?>
diff --git a/www/include/monitoring/log/viewLog.php b/www/include/monitoring/log/viewLog.php
new file mode 100644
index 0000000000000000000000000000000000000000..7173b755341b1323b379a5717d8264bbcd4ba553
--- /dev/null
+++ b/www/include/monitoring/log/viewLog.php
@@ -0,0 +1,94 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+	
+	# Init Logo table
+	
+	$tab_logo = array(	"HOST NOTIFICATION" => "./img/icones/16x16/mail_attachment.gif", 
+						"SERVICE NOTIFICATION" => "./img/icones/16x16/mail_attachment.gif",  
+						"HOST ALERT-UP" => "./img/icones/12x12/recovery.gif", 
+						"HOST ALERT-DOWN" => "./img/icones/12x12/alert.gif", 
+						"HOST ALERT-UNREACHABLE" => "./img/icones/12x12/alert.gif", 
+						"SERVICE ALERT-OK" => "./img/icones/12x12/recovery.gif",
+						"SERVICE ALERT-WARNING" => "./img/icones/12x12/alert.gif", 
+						"SERVICE ALERT-UNKNOWN" => "./img/icones/12x12/alert.gif", 
+						"SERVICE ALERT-CRITICAL" => "./img/icones/12x12/alert.gif", 
+						"EXTERNAL COMMAND" => "./img/icones/14x14/undo.gif", 
+						"CURRENT SERVICE STATE" => "./img/icones/12x12/info.gif", 
+						"CURRENT HOST STATE" => "./img/icones/12x12/info.gif");
+	
+	function getLogData($time_event, $data){
+		global $lang, $tab_logo;
+		$tab["time"] = date($lang["header_format"], $time_event);
+		$tab_data = split("\:", $data);
+		if (isset($tab_logo[$tab_data["0"]]))
+			$tab["logo"] = $tab_logo[$tab_data["0"]];
+		else {
+			if (isset($tab_data["1"])){
+				$tab2 = split("\;", $tab_data["1"]);
+				if (isset($tab2[2]) && isset($tab_logo[$tab_data["0"]."-".$tab2[2]]))
+					$tab["logo"] = $tab_logo[$tab_data["0"]."-".$tab2[2]];
+				else if (isset($tab2[1]) && isset($tab_logo[$tab_data["0"]."-".$tab2[1]]))
+					$tab["logo"] = $tab_logo[$tab_data["0"]."-".$tab2[1]];
+				else
+					$tab["logo"] = "";	
+			}
+		}
+		$tab["data"] = $data;
+		return $tab ;
+	}
+	
+	include("./include/monitoring/log/choose_log_file.php");
+	
+	if (isset($_POST["file"]) && is_file($oreon->Nagioscfg["log_archive_path"] . $_POST["file"]))
+		$log = fopen($oreon->Nagioscfg["log_archive_path"] . $_POST["file"], "r");
+	else {
+		if (file_exists($oreon->Nagioscfg["log_file"]) && !($log = fopen($oreon->Nagioscfg["log_file"], "r")))
+			echo $lang["pel_cant_open"] . $oreon->Nagioscfg["log_file"] . "<br>";
+	}
+	
+	for ($i = 0; $str = fgets($log); $i++){
+		if (preg_match("/^\[([0-9]*)\] (.+)/", $str, $matches)){
+			$time_event = $matches[1];
+			$tab_log[$i] = getLogData($time_event, $matches[2]);
+		}
+	}
+
+	if (isset($tab_log) && $tab_log)
+		krsort($tab_log);
+
+	$path = "./include/monitoring/log/";
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "templates/");
+		
+	#Apply a template definition	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+	$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+	$form->accept($renderer);	
+	
+	$tpl->assign('form', $renderer->toArray());	
+	$tpl->assign('o', $o);		
+		
+	$tpl->assign("tab_log", $tab_log);
+	$tpl->assign('lang', $lang);			
+	$tpl->assign("p", $p);
+	$tpl->display("viewLog.ihtml");
+?>
diff --git a/www/include/monitoring/log/viewNotifyLog.php b/www/include/monitoring/log/viewNotifyLog.php
new file mode 100644
index 0000000000000000000000000000000000000000..88c13197b07e56887974a8ce427ee41dc767534e
--- /dev/null
+++ b/www/include/monitoring/log/viewNotifyLog.php
@@ -0,0 +1,90 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+	
+	function getLogData($time_event, $contact, $host, $service, $status, $output, $command, $type){
+		global $lang;
+		$tab["time"] = date($lang["header_format"], $time_event);
+		$tab["contact"] = $contact;
+		$tab["host"] = $host;
+		$tab["service"] = $service;
+		$tab["status"] = $status;
+		$tab["output"] = $output;
+		$tab["command"] = $command;
+		$tab["type"] = $type;
+		return $tab ;
+	}
+	
+	include("./include/monitoring/log/choose_log_file.php");
+	
+	$log = NULL;	
+	$tab_log = array();	
+	if (isset($_POST["file"]) && is_file($oreon->Nagioscfg["log_archive_path"] . $_POST["file"])){
+		$log = fopen($oreon->Nagioscfg["log_archive_path"] . $_POST["file"], "r");
+	} else {
+		if (file_exists($oreon->Nagioscfg["log_file"]) && !($log = fopen($oreon->Nagioscfg["log_file"], "r")))
+			echo $lang["pel_cant_open"] . $oreon->Nagioscfg["log_file"] . "<br>";
+	}
+	if ($log)
+		for ($i = 0; $str = fgets($log); $i++){
+			if (preg_match("/^\[([0-9]*)\] (.*)/", $str, $matches)){
+				$time_event = $matches[1];
+				$res = preg_split("/:/", $matches[2], 2);
+				if (isset($res[1])) 
+					$res1 = preg_split("/;/", $res[1]);			
+				$type = $res[0];
+				if (isset($_POST["host"]) && strlen($_POST["host"])) {
+					if (!strncmp($type, "HOST NOTIFICATION", 17) && !strcmp($res1[1], $_POST["host"]))
+						$tab_log[$i] = getLogData($time_event, $res1[0], $res1[1], "", $res1[2], $res1[4], $res1[3], $type);
+					else if (!strcmp($type, "SERVICE NOTIFICATION") && !strcmp($res1[1], $_POST["host"]))
+						$tab_log[$i] = getLogData($time_event, $res1[0], $res1[1], $res1[2], $res1[3], $res1[5], $res1[4], $type);
+				} else {
+					if (!strncmp($type, "HOST NOTIFICATION", 17))
+						$tab_log[$i] = getLogData($time_event, $res1[0], $res1[1], "", $res1[2], $res1[4], $res1[3], $type);
+					else if (!strcmp($type, "SERVICE NOTIFICATION"))
+						$tab_log[$i] = getLogData($time_event, $res1[0], $res1[1], $res1[2], $res1[3], $res1[5], $res1[4], $type);
+				
+				}
+			}		
+		}
+
+	if (isset($tab_log) && count($tab_log))
+		krsort($tab_log);
+	
+	$path = "./include/monitoring/log/";
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "templates/");
+	
+	#Apply a template definition	
+		
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+	$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+	$form->accept($renderer);	
+	
+	//$form->display();
+	
+	$tpl->assign('o', $o);		
+	$tpl->assign('form', $renderer->toArray());	
+	$tpl->assign('lang', $lang);				
+	$tpl->assign("tab_log", $tab_log);
+	$tpl->assign("p", $p);
+	$tpl->display("viewNotifyLog.ihtml");
+?>
diff --git a/www/include/monitoring/log/viewWarnLog.php b/www/include/monitoring/log/viewWarnLog.php
new file mode 100644
index 0000000000000000000000000000000000000000..77e3c32b376683ffd0dd072d5375d3e7ebfb5d48
--- /dev/null
+++ b/www/include/monitoring/log/viewWarnLog.php
@@ -0,0 +1,75 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+	
+	include_once("./include/monitoring/common-Func.php");			
+	include_once("./include/monitoring/external_cmd/cmd.php");
+
+	function getLogData($time_event, $warning, $type){
+		global $lang;
+		$tab["time"] = date($lang["header_format"], $time_event);
+		$tab["warning"] = $warning;
+		$tab["type"] = $type;
+		return $tab ;
+	}
+	
+	include("./include/monitoring/log/choose_log_file.php");
+
+	$log = NULL;
+	$tab_log = array();	
+	if (isset($_POST["file"]) && is_file($oreon->Nagioscfg["log_archive_path"] . $_POST["file"]))
+		$log = fopen($oreon->Nagioscfg["log_archive_path"] . $_POST["file"], "r");
+	else{
+		if (file_exists($oreon->Nagioscfg["log_file"]) && !($log = fopen($oreon->Nagioscfg["log_file"], "r")))
+			echo $lang["pel_cant_open"] . $oreon->Nagioscfg["log_file"] . "<br>";
+	}
+	if ($log)
+		for ($i = 0; $str = fgets($log); $i++){
+			if (preg_match("/^\[([0-9]*)\] (.+)/", $str, $matches)){
+				$time_event = $matches[1];
+				$res = preg_split("/:/", $matches[2], 2);
+				$type = $res[0];
+				if (!strncmp($type, "Warn", 4))
+					$tab_log[$i] = getLogData($time_event, $res[1], $type);
+			}
+		}
+
+	if (isset($tab_log) && $tab_log)
+		krsort($tab_log);
+
+	$path = "./include/monitoring/log";
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "/templates/");
+	
+	#Apply a template definition	
+		
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+	$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+	$form->accept($renderer);	
+
+	$tpl->assign('o', $o);		
+	$tpl->assign('form', $renderer->toArray());	
+	$tpl->assign('lang', $lang);			
+	$tpl->assign("tab_log", $tab_log);
+	$tpl->assign("p", $p);
+	$tpl->display("viewWarnLog.ihtml");
+?>
diff --git a/www/include/monitoring/monitoring.php b/www/include/monitoring/monitoring.php
new file mode 100644
index 0000000000000000000000000000000000000000..b58bf497e4209885f5ebc2d6182dd7a1b0b0e397
--- /dev/null
+++ b/www/include/monitoring/monitoring.php
@@ -0,0 +1,47 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+
+	$str = "";
+
+	
+	// init value for each included file
+	$i = 0;
+	$old = "";
+	
+
+	if ((isset($_GET["o"]) && !strcmp($_GET['o'], "h")))
+		include("./include/monitoring/status/host.php");
+	else if ((isset($_GET["o"]) && !strcmp($_GET['o'], "hp")))
+		include("./include/monitoring/status/host_probleme.php");
+	else if (!isset($_GET["o"]) || (isset($_GET["o"]) && !strcmp($_GET['o'], "s") || !strcmp($_GET['o'], "")))
+		include("./include/monitoring/status/service.php");
+	else if (!strcmp($_GET['o'], "sp"))
+		include("./include/monitoring/status/service_probleme.php");
+	else if (isset($_GET["o"]) && !strcmp($_GET['o'], "sc"))
+		include("./include/monitoring/status/service_sc.php");
+	else if (isset($_GET["o"]) && !strcmp($_GET['o'], "hg"))
+		include("./include/monitoring/status/hostgroup.php");
+	else if (isset($_GET["o"]) && !strcmp($_GET['o'], "proc"))
+		include("./include/monitoring/status/proc_info.php");
+	else if (isset($_GET["o"]) && !strcmp($_GET['o'], "sg"))
+		include("./include/monitoring/status/status_gird.php");
+	else if (isset($_GET["o"]) && !strcmp($_GET['o'], "sm"))
+		include("./include/monitoring/status/status_summary.php");
+	else if (isset($_GET["o"]) && !strcmp($_GET['o'], "sgr"))
+		include("./include/monitoring/status/status_servicegroup.php");
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/objectDetails/generate_images/pie_chart_service.php b/www/include/monitoring/objectDetails/generate_images/pie_chart_service.php
new file mode 100644
index 0000000000000000000000000000000000000000..2eb19597294e84f4768d2e877f8a9d17bd200461
--- /dev/null
+++ b/www/include/monitoring/objectDetails/generate_images/pie_chart_service.php
@@ -0,0 +1,92 @@
+<?php
+/**
+ * Usage example for Image_Graph.
+ * 
+ * Main purpose: 
+ * Show pie chart
+ * 
+ * Other: 
+ * None specific
+ * 
+ * $Id: plot_pie_rest.php,v 1.1 2005/10/13 20:18:27 nosey Exp $
+ * 
+ * @package Image_Graph
+ * @author Jesper Veggerby <pear.nosey@veggerby.dk>
+ */
+
+	require_once 'Image/Graph.php';
+	
+	require_once ("../../../../class/Session.class.php");
+	require_once ("../../../../class/Oreon.class.php");
+
+	Session::start();
+	$oreon =& $_SESSION["oreon"];
+
+	// create the graph
+	$Graph =& Image_Graph::factory('graph', array(300, 200));
+	// add a TrueType font
+	$Font =& $Graph->addNew('font', 'Arial');
+	// set the font size to 11 pixels
+	$Font->setSize(7);
+	$Graph->setFont($Font);
+	
+	// setup the plotarea, legend and their layout
+	$Graph->add(
+	   Image_Graph::vertical(
+	      Image_Graph::factory('title', array('Host '.$_GET["host_name"].' Services ', 10)),        
+	      Image_Graph::vertical(
+	         $Plotarea = Image_Graph::factory('plotarea'),
+	         $Legend = Image_Graph::factory('legend'),
+	         80
+	      ),10));
+	      
+	$Graph->setBackgroundColor('#F8FABE');
+	$Legend->setPlotArea($Plotarea);
+	
+	$Plotarea->hideAxis();
+	$Plotarea->setBackgroundColor('#F8FABE');
+	
+	$value =& $_GET["value"];
+	$tab2 = array();
+	foreach ($value as $key => $v)	
+		$tab2[strtolower($key) . " - ". $v] = $v;
+	
+	$Dataset =& Image_Graph::factory('dataset', array($value));
+	
+	// create the 1st plot as smoothed area chart using the 1st dataset
+	$Plot =& $Plotarea->addNew('Image_Graph_Plot_Pie', $Dataset);
+	
+	$Plot->Radius = 2;
+	    
+	// set a line color
+	$Plot->setLineColor('gray');
+	
+	// set a standard fill style
+	
+	$FillArray =& Image_Graph::factory('Image_Graph_Fill_Array');
+	$Plot->setFillStyle($FillArray);
+	
+	foreach ($value as $key => $v)
+		$FillArray->addColor($oreon->optGen["color_".strtolower($key)]."@0.2");
+
+	$Plot->explode(4);
+	
+	
+	// create a Y data value marker
+	$Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_PCT_Y_TOTAL);
+	// fill it with white
+	$Marker->setFillColor('white');
+	// and use black border
+	$Marker->setBorderColor('black');
+	// and format it using a data preprocessor
+	$Marker->setDataPreprocessor(Image_Graph::factory('Image_Graph_DataPreprocessor_Formatted', '%0.1f%%'));
+	$Marker->setFontSize(7);
+	
+	// create a pin-point marker type
+	$PointingMarker =& $Plot->addNew('Image_Graph_Marker_Pointing_Angular', array(20, &$Marker));
+	// and use the marker on the plot
+	$Plot->setMarker($PointingMarker);
+	
+	// output the Graph
+	$Graph->done();
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/objectDetails/hostDetails.ihtml b/www/include/monitoring/objectDetails/hostDetails.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..aca858a99d87c066e5633b1eaae473ce15a62c53
--- /dev/null
+++ b/www/include/monitoring/objectDetails/hostDetails.ihtml
@@ -0,0 +1,210 @@
+<div>
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderLeft" colspan="3"><img src='./img/icones/16x16/server_network.gif'>&nbsp;&nbsp;{$lang.m_mon_host} : {$h.host_name} ({$h.host_alias}) - {$h.host_address} </td>
+		</tr>
+	</table>
+	<br>
+	<table width='100%'>
+		<tr>
+			<td style='vertical-align:top;'>
+				<table id="ListTable">
+					<tr class='ListHeader'>
+						<td class="ListColHeaderCenter" colspan="2">{$lang.m_mon_host_info}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_host_status}</td>
+						<td class="ListColLeft" style='background:{$host_data.status_color}'>{$host_data.status}</td>
+					</tr class='list_two'>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_host_status_info}</td>
+						<td class="ListColLeft">{$host_data.output}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_host_last_check}</td>
+						<td class="ListColLeft">{$host_data.last_check}</td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_status_data_age}</td>
+						<td class="ListColLeft"></td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_last_change}</td>
+						<td class="ListColLeft">{$host_data.last_stat}</td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_current_state_duration}</td>
+						<td class="ListColLeft">{$host_data.duration}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_last_notification}</td>
+						<td class="ListColLeft">{$host_data.last_notifi}</td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_notification_nb}</td>
+						<td class="ListColLeft">{$host_data.curr_not_number}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_host_flapping}</td>
+						<td class="ListColLeft">{$host_data.flapping}</td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_percent_state_change}</td>
+						<td class="ListColLeft">{$host_data.percent_stat_change} % </td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_downtime_sc}</td>
+						<td class="ListColLeft" style='background:{$color_onoff_inv[$host_data.sch_downtime_death]}'>{$en[$host_data.sch_downtime_death]}</td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_last_update}</td>
+						<td class="ListColLeft">{$host_data.last_update}</td>
+					</tr>
+				</table>
+				<br><br>
+				<table id="ListTable">
+					<tr class='ListHeader'>
+						<td class="ListColHeaderCenter" colspan="2">{$lang.options}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_host_checks}</td>
+						<td class="ListColLeft"><font style='background-color:{$color_onoff[$host_data.checks_en]};'>&nbsp;{$en_disable[$host_data.checks_en]}&nbsp;</font></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_host_notification}</td>
+						<td class="ListColLeft"><font style='background-color:{$color_onoff[$host_data.not_en]};'>&nbsp;{$en_disable[$host_data.not_en]}&nbsp;</font></td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_event_handler}</td>
+						<td class="ListColLeft"><font style='background-color:{$color_onoff[$host_data.ev_handler_en]};'>&nbsp;{$en_disable[$host_data.ev_handler_en]}&nbsp;</font></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_flap_detection}</td>
+						<td class="ListColLeft"><font style='background-color:{$color_onoff[$host_data.flap_detect_en]};'>&nbsp;{$en_disable[$host_data.flap_detect_en]}&nbsp;</font></td>
+					</tr>
+					{if $host_data.status != UP}
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_services_en_acknowledge}</td>
+						<td class="ListColLeft"><font style='background-color:{$color_onoff[$host_data.acknowledged]};'>&nbsp;{$en_disable[$host_data.acknowledged]}&nbsp;</font></td>
+					</tr>
+					{/if}
+				</table>
+				<br><br>
+				<table id="ListTable">
+					<tr class='ListHeader'>
+						<td class="ListColHeaderCenter">{$lang.m_mon_tips}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft"><a href='./oreon.php?p=6&host_id={$h.host_id}&o=c'>{$lang.m_mon_configure} {$h.host_name}</a></td>
+					</tr>
+					{if $url_id}
+					<tr class='list_one'>
+						<td class="ListColLeft"><a href='./oreon.php?p=7&o=q&host_id={$h.host_id}'>{$lang.m_mon_view_identity_file} {$h.host_name}</a></td>
+					</tr>
+					{/if}
+				</table>
+				<br><br>
+				<table id="ListTable">
+					<tr class='ListHeader'>
+						<td class="ListColHeaderCenter">{$lang.m_mon_tools}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft"><a href='' onClick="window.open('oreon.php?p=201&host_id={$h.host_id}&o=p&min=1','','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no, width=750, height=300');">{$lang.m_mon_tools_ping} {$h.host_name}</a></td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft"><a href='' onClick="window.open('oreon.php?p=201&host_id={$h.host_id}&o=tr&min=1','','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no, width=750, height=300');">{$lang.m_mon_tools_tracert} {$h.host_name}</a></td>
+					</tr>
+				</table>
+			</td>
+			<td style='width:20px;'>&nbsp;</td>
+			<td style='vertical-align:top;'>
+				<table id="ListTable">
+					<tr class='ListHeader'>
+						<td class="ListColHeaderCenter">{$lang.hosts_command}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$img_en[$host_data.checks_en]}&nbsp;<a href='./oreon.php?p={$p}&o=hd&cmd=6&select[{$h.host_name}]=1&en={$en_inv[$host_data.checks_en]}'>{$en_inv_text[$host_data.checks_en]} {$lang.m_mon_check_this_host}</a></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$img_en[$host_data.not_en]}&nbsp;<a href='./oreon.php?p={$p}&o=hd&cmd=9&select[{$h.host_name}]=1&en={$en_inv[$host_data.not_en]}'>{$en_inv_text[$host_data.not_en]} {$lang.m_mon_notify_this_host}</a></td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft"><img src='./img/icones/16x16/warning.gif' border='1'>&nbsp;<a href='oreon.php?p=20305&o=ah&host_name={$h.host_name}'>{$lang.m_mon_SCH_downtime}</a></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft"><img src='./img/icones/16x16/messages.gif' border='1'>&nbsp;<a href='oreon.php?p=20306&o=ah&host_name={$h.host_name}'>{$lang.m_mon_add_comment}</a></td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft"><img src='./img/icones/16x16/element_previous.gif' border='0'>&nbsp;<a href='./oreon.php?p={$p}&o=hd&cmd=8&select[{$h.host_name}]=1&en=0'>{$lang.m_mon_disable_not_all_services}</a></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft"><img src='./img/icones/16x16/element_next.gif' border='0'>&nbsp;<a href='./oreon.php?p={$p}&o=hd&cmd=8&select[{$h.host_name}]=1&en=1'>{$lang.m_mon_enable_not_all_services}</a></td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft"><img src='./img/icones/16x16/undo.gif' border='1'>&nbsp;<a href='./oreon.php?p={$p}&o=hd&cmd=1&select[{$h.host_name}]=1'>{$lang.m_mon_SCH_immediate_check}<a></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft"><img src='./img/icones/16x16/undo.gif' border='1'>&nbsp;<a href='./oreon.php?p={$p}&o=hd&cmd=2&select[{$h.host_name}]=1'>{$lang.m_mon_SCH_immediate_check_f}</a></td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft"><img src='./img/icones/16x16/element_previous.gif' border='0'>&nbsp;<a href='./oreon.php?p={$p}&o=hd&cmd=5&select[{$h.host_name}]=1&en=0'>{$lang.m_mon_diable_check_all_svc}</a></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft"><img src='./img/icones/16x16/element_next.gif' border='0'>&nbsp;<a href='./oreon.php?p={$p}&o=hd&cmd=5&select[{$h.host_name}]=1&en=1'>{$lang.m_mon_enable_check_all_svc}</a></td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$img_en[$host_data.ev_handler_en]}&nbsp;<a href='./oreon.php?p={$p}&o=hd&cmd=45&select[{$h.host_name}]=1&en={$en_inv[$host_data.ev_handler_en]}'>{$en_inv_text[$host_data.ev_handler_en]} {$lang.m_mon_ed_event_handler}</a></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$img_en[$host_data.flap_detect_en]}&nbsp;<a href='./oreon.php?p={$p}&o=hd&cmd=43&select[{$h.host_name}]=1&en={$en_inv[$host_data.flap_detect_en]}'>{$en_inv_text[$host_data.flap_detect_en]} {$lang.m_mon_ed_flapping_detect}</a></td>
+					</tr>
+					{if $host_data.status != UP}
+					<tr class='list_one'>
+						<td class="ListColLeft">{$img_en[$host_data.acknowledged]}&nbsp;<a href='./oreon.php?p={$p}&o=hak&cmd=14&host_name={$h.host_name}&en={$en_acknowledge[$host_data.acknowledged]}'>{$en_acknowledge_text[$host_data.acknowledged]}</a></a></td>
+					</tr>
+					{/if}
+				</table>
+				<br>
+				<table id="ListTable">
+					<tr class='ListHeader'>
+						<td class="ListColHeaderCenter">{$lang.m_mon_host_statistics}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColCenter"><img src='./include/monitoring/objectDetails/generate_images/pie_chart_service.php?o={$o}{$status}&host_name={$h.host_name}'></td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+	</table>
+	<br>
+	{if count($tab_comments_host)}
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderCenter" colspan="3">Comments For this host</td>
+		</tr>
+	</table>
+	<br>
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderCenter"><input type="checkbox" disabled checked></td>
+			<td class="ListColHeaderCenter">{$lang.cmt_host_name}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_entry_time}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_author}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_comment}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_persistent}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_actions}</td>
+		</tr>
+		{foreach item=tch from=$tab_comments_host}
+		<tr class={cycle values="list_two, list_one"}>
+			<td class="ListColHeaderCenter"><input type="checkbox" name='select[{$tcs.id}]'></td>
+			<td class="ListColLeft">{$tch.host_name}</td>
+			<td class="ListColRight">{$tch.time}</td>
+			<td class="ListColCenter">{$tch.author}</td>
+			<td class="ListColLeft">{$tch.comment}</td>
+			<td class="ListColLeft">{$tch.persistent}</td>
+			<td class="ListColCenter"><a href='./oreon.php?p={$p}&o=dh&id={$tch.id}'><img src='./img/icones/16x16/delete.gif'></a></td>
+		</tr>
+		{/foreach}
+	</table>
+	{/if}
+</div>
\ No newline at end of file
diff --git a/www/include/monitoring/objectDetails/hostDetails.php b/www/include/monitoring/objectDetails/hostDetails.php
new file mode 100644
index 0000000000000000000000000000000000000000..eb39df482d69183957b450d330412eb110f74f5f
--- /dev/null
+++ b/www/include/monitoring/objectDetails/hostDetails.php
@@ -0,0 +1,132 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+
+	$lca =& $oreon->user->lcaHost;
+
+	if (isset($_GET["host_name"]) && $_GET["host_name"])
+		$host_name = $_GET["host_name"];
+	else
+		foreach ($_GET["select"] as $key => $value)
+			$host_name = $key;
+
+	$key = array_search($host_name, $lca);
+	if ($key == NULL){
+		include_once("alt_error.php");
+	} else {
+		$res =& $pearDB->query("SELECT * FROM host WHERE host_id = '".$key."'");
+		$res->fetchInto($host);
+
+		$res =& $pearDB->query("SELECT * FROM inventory_index WHERE host_id = '".$key."'");
+		$res->fetchInto($inventory);
+
+		if ($inventory["type_ressources"] == 0){
+			$url_id = "p=7&o=t&host_id=" . $key;
+		} else if ($inventory["type_ressources"] != 0 && $inventory["type_ressources"] != NULL){
+			$url_id = "p=7&o=o&host_id=" . $key;
+		} else
+			$url_id = NULL;
+
+		$path = "./include/monitoring/objectDetails/";
+
+		# Smarty template Init
+		$tpl = new Smarty();
+		$tpl = initSmartyTpl($path, $tpl, "./");
+
+		if (!file_exists($oreon->Nagioscfg["comment_file"]))
+			print ("downtime file not found");
+		else	{
+			$log = fopen($oreon->Nagioscfg["comment_file"], "r");
+			$tab_comments_host = array();
+			$i = 0;
+			while ($str = fgets($log))	{
+				$res = preg_split("/;/", $str);
+				if (preg_match("/^\[([0-9]*)\] HOST_COMMENT;/", $str, $matches)){
+					if (!strcmp($res[2], $host_name)){
+						$tab_comments_host[$i] = array();
+						$tab_comments_host[$i]["id"] = $res[1];
+						$tab_comments_host[$i]["host_name"] = $res[2];
+						$tab_comments_host[$i]["time"] = date("d-m-Y G:i:s", $matches[1]);
+						$tab_comments_host[$i]["author"] = $res[4];
+						$tab_comments_host[$i]["comment"] = $res[5];
+						$tab_comments_host[$i]["persistent"] = $res[3];
+					}
+				}
+				$i++;
+			}
+		}
+
+
+		$en = array("0" => "No", "1" => "Yes");
+		
+		
+		$en_acknowledge_text = array("1" => $lang ["m_mon_disack"], "0" => $lang ["m_mon_ack"]);
+		$en_acknowledge = array("1" => "0", "0" => "1");
+		
+		$en_inv = array("1" => "0", "0" => "1");
+		$en_inv_text = array("1" => $lang ["m_mon_disable"], "0" => $lang ["m_mon_enable"]);
+		$color_onoff = array("1" => "#00ff00", "0" => "#ff0000");
+		$color_onoff_inv = array("0" => "#00ff00", "1" => "#ff0000");
+		$en_disable = array("1" => $lang ["m_mon_enabled"], "0" => $lang ["m_mon_disabled"]);
+
+		$img_en = array("0" => "<img src='./img/icones/16x16/element_next.gif' border='0'>", "1" => "<img src='./img/icones/16x16/element_previous.gif' border='0'>");
+
+		$host_status[$host_name]["status_color"] = $oreon->optGen["color_".strtolower($host_status[$host_name]["status"])];
+		$host_status[$host_name]["last_check"] = date($lang["date_time_format"], $host_status[$host_name]["last_check"]);
+		!$host_status[$host_name]["last_notifi"] ? $host_status[$host_name]["last_notifi"] = "": $host_status[$host_name]["last_notifi"] = date($lang["date_time_format"], $host_status[$host_name]["last_notifi"]);
+		!$host_status[$host_name]["last_stat"] ? $host_status[$host_name]["duration"] = "" : $host_status[$host_name]["duration"] = Duration::toString(time() - $host_status[$host_name]["last_stat"]);
+		!$host_status[$host_name]["last_stat"] ? $host_status[$host_name]["last_stat"] = "": $host_status[$host_name]["last_stat"] = date($lang["date_time_format"],$host_status[$host_name]["last_stat"]);
+		$host_status[$host_name]["last_update"] = date($lang["date_time_format"], time());
+
+		$host_status[$host_name]["flapping"] = $en[$host_status[$host_name]["flapping"]];
+
+		$tab_status = array();
+		foreach ($tab_host_service[$host_name] as $key_name => $s){
+			if (!isset($tab_status[$service_status[$host_name."_".$key_name]["status"]]))
+				$tab_status[$service_status[$host_name."_".$key_name]["status"]] = 0;
+			$tab_status[$service_status[$host_name."_".$key_name]["status"]]++;
+		}
+		$status = NULL;
+		foreach ($tab_status as $key => $value)
+			$status .= "&value[".$key."]=".$value;
+
+
+		$tpl->assign("lang", $lang);
+		$tpl->assign("p", $p);
+		$tpl->assign("en", $en);
+		$tpl->assign("en_inv", $en_inv);
+		$tpl->assign("en_inv_text", $en_inv_text);
+		$tpl->assign("img_en", $img_en);
+		$tpl->assign("color_onoff", $color_onoff);
+		$tpl->assign("color_onoff_inv", $color_onoff_inv);
+		$tpl->assign("en_disable", $en_disable);
+		$tpl->assign("img_en", $img_en);
+		$tpl->assign("status", $status);
+		
+		$tpl->assign("en_acknowledge_text", $en_acknowledge_text);
+		$tpl->assign("en_acknowledge", $en_acknowledge);
+		
+		$tpl->assign("h", $host);
+		$tpl->assign("url_id", $url_id);
+		$tpl->assign("tab_comments_host", $tab_comments_host);
+		$tpl->assign("host_data", $host_status[$host_name]);
+		$tpl->assign("tools", "Tools");
+		$tpl->display("hostDetails.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/objectDetails/hostgroupDetails.ihtml b/www/include/monitoring/objectDetails/hostgroupDetails.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/monitoring/objectDetails/hostgroupDetails.php b/www/include/monitoring/objectDetails/hostgroupDetails.php
new file mode 100644
index 0000000000000000000000000000000000000000..7f1ca23f4aaeba43df65932b422080cdf3505a61
--- /dev/null
+++ b/www/include/monitoring/objectDetails/hostgroupDetails.php
@@ -0,0 +1,24 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+	
+	require_once './class/other.class.php';
+	include_once("./include/monitoring/common-Func.php");			
+	include_once("./include/monitoring/external_cmd/cmd.php");	
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/objectDetails/serviceDetails.ihtml b/www/include/monitoring/objectDetails/serviceDetails.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..36a74e16dba6cb561b0cf421a5020cab1e80a3c1
--- /dev/null
+++ b/www/include/monitoring/objectDetails/serviceDetails.ihtml
@@ -0,0 +1,217 @@
+<div>
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderLeft" colspan="3"><img src='./img/icones/16x16/element_new_after.gif'>&nbsp;&nbsp;Service : {$svc_description} On Host : {$h.host_name} ({$h.host_alias}) </td>
+		</tr>
+	</table>
+	<br>
+	<table width='100%'>
+		<tr>
+			<td style='vertical-align:top;'>
+				<table id="ListTable">
+					<tr class='ListHeader'>
+						<td class="ListColHeaderCenter" colspan="2">{$lang.m_mon_services}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_services_status}</td>
+						<td class="ListColLeft" style='background:{$service_data.status_color}'>{$service_data.status}</td>
+					</tr class='list_two'>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_host_status_info}</td>
+						<td class="ListColLeft">{$service_data.output}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_services_attempt}</td>
+						<td class="ListColLeft">{$service_data.retry}</td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_services_state}</td>
+						<td class="ListColLeft">{$service_data.stat_type}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_services_last_tcheck}</td>
+						<td class="ListColLeft">{$service_data.check_type}</td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_host_last_check}</td>
+						<td class="ListColLeft">{$service_data.last_check}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_status_data_age}</td>
+						<td class="ListColLeft"></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_services_active_check}</td>
+						<td class="ListColLeft">{$service_data.next_check}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_services_latency}</td>
+						<td class="ListColLeft">{$service_data.latency}</td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_services_duration}</td>
+						<td class="ListColLeft">{$service_data.exec_time}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_last_change}</td>
+						<td class="ListColLeft">{$service_data.last_change}</td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_current_state_duration}</td>
+						<td class="ListColLeft">{$service_data.duration}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_last_notification_serv}</td>
+						<td class="ListColLeft">{if $service_data.last_notification}{$service_data.last_notification}{/if}</td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_notification_nb}</td>
+						<td class="ListColLeft">{$service_data.current_not_nb}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_services_flapping}</td>
+						<td class="ListColLeft">{$service_data.svc_is_flapping}</td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_percent_state_change}</td>
+						<td class="ListColLeft">{$service_data.percent_stat_change} % </td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_downtime_sc}</td>
+						<td class="ListColLeft" style='background:{$color_onoff_inv[$service_data.sch_downtime_death]};'>{$en[$service_data.sch_downtime_death]}</td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_last_update}</td>
+						<td class="ListColLeft">{$service_data.last_update}</td>
+					</tr>
+				</table>
+				<br>
+				<table id="ListTable">
+					<tr class='ListHeader'>
+						<td class="ListColHeaderCenter" colspan="2">Options</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_services_en_check_active}</td>
+						<td class="ListColLeft"><font style='background-color:{$color_onoff[$service_data.checks_en]};'>&nbsp;{$en_disable[$service_data.checks_en]}&nbsp;</font></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_services_en_check_passif}</td>
+						<td class="ListColLeft"><font style='background-color:{$color_onoff[$service_data.accept_passive_check]};'>&nbsp;{$en_disable[$service_data.accept_passive_check]}&nbsp;</font></td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_services_en_notification}</td>
+						<td class="ListColLeft"><font style='background-color:{$color_onoff[$service_data.not_en]};'>&nbsp;{$en_disable[$service_data.not_en]}&nbsp;</font></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$lang.m_mon_event_handler}</td>
+						<td class="ListColLeft"><font style='background-color:{$color_onoff[$service_data.ev_handler_en]};'>&nbsp;{$en_disable[$service_data.ev_handler_en]}&nbsp;</font></td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_services_en_flap}</td>
+						<td class="ListColLeft"><font style='background-color:{$color_onoff[$service_data.flap_detect_en]};'>&nbsp;{$en_disable[$service_data.flap_detect_en]}&nbsp;</font></td>
+					</tr>
+					{if $service_data.status != OK}
+					<tr class='list_one'>
+						<td class="ListColLeft">{$lang.m_mon_services_en_acknowledge}</td>
+						<td class="ListColLeft"><font style='background-color:{$color_onoff[$service_data.pb_aknowledged]};'>&nbsp;{$en_disable[$service_data.pb_aknowledged]}&nbsp;</font></td>
+					</tr>
+					{/if}
+				</table>
+				<br><br>
+				<table id="ListTable">
+					<tr class='ListHeader'>
+						<td class="ListColHeaderCenter">{$lang.m_mon_tips}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft"><a href='./oreon.php?p=602&service_id={$service_id}&o=c'>Configure {$svc_description}</a></td>
+					</tr>
+				</table>
+			</td>
+			<td style='width:20px;'>&nbsp;</td>
+			<td style='vertical-align:top;'>
+				<table id="ListTable">
+					<tr class='ListHeader'>
+						<td class="ListColHeaderCenter">{$lang.m_mon_service_command}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$img_en[$service_data.checks_en]}&nbsp;<a href='./oreon.php?p={$p}&o={$o}&cmd=7&select[{$h.host_name};{$svc_description}]=1&en={$en_inv[$service_data.checks_en]}'>{$en_inv_text[$service_data.checks_en]} {$lang.m_mon_check_this_service}</a></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft"><img src='./img/icones/16x16/undo.gif' border='1'>&nbsp;<a href='./oreon.php?p={$p}&o={$o}&cmd=3&select[{$h.host_name};{$svc_description}]=1'>{$lang.m_mon_schedule}</a></td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft"><img src='./img/icones/16x16/undo.gif' border='1'>&nbsp;<a href='./oreon.php?p={$p}&o={$o}&cmd=4&select[{$h.host_name};{$svc_description}]=1'>{$lang.m_mon_schedule_force}</a></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft"><img src='./img/icones/16x16/undo.gif' border='1'>&nbsp;<a href='./oreon.php?p={$p}&o=svcpc&cmd=16&host_name={$h.host_name}&service_description={$svc_description}'>{$lang.m_mon_submit_passive}</a></td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$img_en[$service_data.accept_passive_check]}&nbsp;<a href='./oreon.php?p={$p}&o={$o}&cmd=11&select[{$h.host_name};{$svc_description}]=1&en={$en_inv[$service_data.accept_passive_check]}'>{$en_inv_text[$service_data.accept_passive_check]} {$lang.m_mon_accept_passive}</a></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$img_en[$service_data.not_en]}&nbsp;&nbsp;<a href='./oreon.php?p={$p}&o={$o}&cmd=10&select[{$h.host_name};{$svc_description}]=1&en={$en_inv[$service_data.not_en]}'>{$en_inv_text[$service_data.not_en]} {$lang.m_mon_notification_service}</a></td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft"><img src='./img/icones/16x16/warning.gif' border='1'>&nbsp;<a href='./oreon.php?p=20305&o=as&host_name={$h.host_name}&service_description={$svc_description}'>{$lang.m_mon_schedule_downtime}</a></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft"><img src='./img/icones/16x16/messages.gif' border='1'>&nbsp;<a href='./oreon.php?p=20306&o=as&host_name={$h.host_name}&service_description={$svc_description}'>{$lang.m_mon_schedule_comment}</a></td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColLeft">{$img_en[$service_data.ev_handler_en]}&nbsp;<a href='./oreon.php?p={$p}&o={$o}&cmd=46&select[{$h.host_name};{$svc_description}]=1&en={$en_inv[$service_data.ev_handler_en]}'>{$en_inv_text[$service_data.ev_handler_en]} {$lang.m_mon_event_handler}</a></td>
+					</tr>
+					<tr class='list_two'>
+						<td class="ListColLeft">{$img_en[$service_data.flap_detect_en]}&nbsp;<a href='./oreon.php?p={$p}&o={$o}&cmd=44&select[{$h.host_name};{$svc_description}]=1&en={$en_inv[$service_data.flap_detect_en]}'>{$en_inv_text[$service_data.flap_detect_en]} {$lang.m_mon_flap_detection}</a></td>
+					</tr>
+					{if $service_data.status != OK}
+					<tr class='list_one'>
+						<td class="ListColLeft">{$img_en[$service_data.pb_aknowledged]}&nbsp;<a href='./oreon.php?p={$p}&o=svcak&cmd=15&host_name={$h.host_name}&service_description={$svc_description}&en={$en_acknowledge[$service_data.pb_aknowledged]}'>{$en_acknowledge_text[$service_data.pb_aknowledged]}</a></td>
+					</tr>
+					{/if}
+				</table>
+				<br>
+				<table id="ListTable">
+					<tr class='ListHeader'>
+						<td class="ListColHeaderCenter">{$lang.m_mon_host_statistics}</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColCenter"><img src='./include/monitoring/objectDetails/generate_images/pie_chart_service.php?o={$o}{$status}&host_name={$h.host_name}'></td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+	</table>
+	<br>
+	{if count($tab_comments_svc)}
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderCenter" colspan="3">Comments For this Service</td>
+		</tr>
+	</table>
+	<br>
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderCenter"><input type="checkbox" disabled checked></td>
+			<td class="ListColHeaderCenter">{$lang.cmt_host_name}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_service_descr}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_entry_time}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_author}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_comment}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_persistent}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_actions}</td>
+		</tr>
+		{foreach item=tcs from=$tab_comments_svc}
+		<tr class={cycle values="list_two, list_one"}>
+			<td class="ListColHeaderCenter"><input type="checkbox" name='select[{$tcs.id}]'></td>
+			<td class="ListColLeft">{$tcs.host_name}</td>
+			<td class="ListColLeft">{$tcs.service_descr}</td>
+			<td class="ListColRight">{$tcs.time}</td>
+			<td class="ListColCenter">{$tcs.author}</td>
+			<td class="ListColLeft" style='white-space:none;'>{$tcs.comment}</td>
+			<td class="ListColLeft">{$tcs.persistent}</td>
+			<td class="ListColCenter"><a href='./oreon.php?p={$p}&o=ds&id={$tcs.id}'><img src='./img/icones/16x16/delete.gif'></a></td>
+		</tr>
+		{/foreach}
+	</table>
+	{/if}
+</div>
\ No newline at end of file
diff --git a/www/include/monitoring/objectDetails/serviceDetails.php b/www/include/monitoring/objectDetails/serviceDetails.php
new file mode 100644
index 0000000000000000000000000000000000000000..fe5fec55b53f8816bf469745a7be4ae89d41fb75
--- /dev/null
+++ b/www/include/monitoring/objectDetails/serviceDetails.php
@@ -0,0 +1,134 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+
+	if (!isset($oreon))
+		exit();
+		
+	$lca =& $oreon->user->lcaHost;
+	
+	if (isset($_GET["host_name"]) && $_GET["host_name"] && isset($_GET["service_description"]) && $_GET["service_description"]){
+		$host_name = $_GET["host_name"];
+		$svc_description = $_GET["service_description"];
+	} else {
+		foreach ($_GET["select"] as $key => $value)
+			$host_service_key = $key;
+		$tab_data = split(";", $host_service_key);
+		$host_name = $tab_data[0];
+		$svc_description = $tab_data[1];
+	}
+	
+	$key = array_search($host_name, $lca);
+	if ($key == NULL){
+		include_once("alt_error.php");
+	} else {
+		$res =& $pearDB->query("SELECT * FROM host WHERE host_id = '".$key."'");
+		$res->fetchInto($host);
+
+		$path = "./include/monitoring/objectDetails/";
+		
+		# Smarty template Init
+		$tpl = new Smarty();
+		$tpl = initSmartyTpl($path, $tpl, "./");
+		
+		if (!file_exists($oreon->Nagioscfg["comment_file"]))
+			print ("downtime file not found");
+		else	{
+			$tab_comments_svc = array();
+			$i = 0;
+			$log = fopen($oreon->Nagioscfg["comment_file"], "r");
+			while ($str = fgets($log))	{
+				$res = preg_split("/;/", $str);
+				if (preg_match("/^\[([0-9]*)\] SERVICE_COMMENT;/", $str, $matches)){
+					if (!strcmp($res[2], $host_name)){
+						$tab_comments_svc[$i] = array();
+						$tab_comments_svc[$i]["id"] = $res[1];
+						$tab_comments_svc[$i]["host_name"] = $res[2];
+						$tab_comments_svc[$i]["service_descr"] = $res[3];
+						$tab_comments_svc[$i]["time"] = date("d-m-Y G:i:s", $matches[1]);
+						$tab_comments_svc[$i]["author"] = $res[5];
+						$tab_comments_svc[$i]["comment"] = $res[6];
+						$tab_comments_svc[$i]["persistent"] = $res[4];
+					}
+				}
+				$i++;	
+			}
+		}
+		
+		
+		$en = array("0" => "No", "1" => "Yes");
+		
+		$en_acknowledge_text = array("1" => $lang ["m_mon_disack"], "0" => $lang ["m_mon_ack"]);
+		$en_acknowledge = array("1" => "0", "0" => "1");
+		
+		$en_disable = array("1" => $lang ["m_mon_enabled"], "0" => $lang ["m_mon_disabled"]);
+		$en_inv = array("1" => "0", "0" => "1");
+		$en_inv_text = array("1" => $lang ["m_mon_disable"], "0" => $lang ["m_mon_enable"]);
+		$color_onoff = array("1" => "#00ff00", "0" => "#ff0000");		
+		$color_onoff_inv = array("0" => "#00ff00", "1" => "#ff0000");		
+		$img_en = array("0" => "<img src='./img/icones/16x16/element_next.gif' border='0'>", "1" => "<img src='./img/icones/16x16/element_previous.gif' border='0'>");
+		
+		/*
+		 * Ajust data for beeing displayed in template
+		 */
+		
+		 $service_status[$host_name."_".$svc_description]["status_color"] = $oreon->optGen["color_".strtolower($service_status[$host_name."_".$svc_description]["status"])];
+		 $service_status[$host_name."_".$svc_description]["last_check"] = date($lang["date_time_format"], $service_status[$host_name."_".$svc_description]["last_check"]);
+		 $service_status[$host_name."_".$svc_description]["next_check"] = date($lang["date_time_format"], $service_status[$host_name."_".$svc_description]["next_check"]);
+		!$service_status[$host_name."_".$svc_description]["latency"] ? $service_status[$host_name."_".$svc_description]["latency"] = "< 1 second" : $service_status[$host_name."_".$svc_description]["latency"] = $service_status[$host_name."_".$svc_description]["latency"] . "seconds";
+		!$service_status[$host_name."_".$svc_description]["exec_time"] ? $service_status[$host_name."_".$svc_description]["exec_time"] = "< 1 second" : $service_status[$host_name."_".$svc_description]["exec_time"] = $service_status[$host_name."_".$svc_description]["exec_time"] . "seconds";
+		!$service_status[$host_name."_".$svc_description]["last_notification"] ? $service_status[$host_name."_".$svc_description]["notification"] = "": $service_status[$host_name."_".$svc_description]["last_notification"] = date($lang["date_time_format"], $service_status[$host_name."_".$svc_description]["last_notification"]);
+		!$service_status[$host_name."_".$svc_description]["last_change"] ? $service_status[$host_name."_".$svc_description]["duration"] = Duration::toString($service_status[$host_name."_".$svc_description]["total_running"]) : $service_status[$host_name."_".$svc_description]["duration"] = Duration::toString(time() - $service_status[$host_name."_".$svc_description]["last_change"]);
+		!$service_status[$host_name."_".$svc_description]["last_change"] ? $service_status[$host_name."_".$svc_description]["last_change"] = "": $service_status[$host_name."_".$svc_description]["last_change"] = date($lang["date_time_format"],$service_status[$host_name."_".$svc_description]["last_change"]);
+		 $service_status[$host_name."_".$svc_description]["last_update"] = date($lang["date_time_format"], time());
+		!$service_status[$host_name."_".$svc_description]["svc_is_flapping"] ? $service_status[$host_name."_".$svc_description]["svc_is_flapping"] = $en[$service_status[$host_name."_".$svc_description]["svc_is_flapping"]] : $service_status[$host_name."_".$svc_description]["svc_is_flapping"] = date($lang["date_time_format"], $service_status[$host_name."_".$svc_description]["svc_is_flapping"]);
+		
+		$tab_status = array();
+		foreach ($tab_host_service[$host_name] as $key_name => $s){
+			if (!isset($tab_status[$service_status[$host_name."_".$key_name]["status"]]))
+				$tab_status[$service_status[$host_name."_".$key_name]["status"]] = 0;
+			$tab_status[$service_status[$host_name."_".$key_name]["status"]]++;
+		}
+		$status = NULL;
+		foreach ($tab_status as $key => $value)
+			$status .= "&value[".$key."]=".$value;
+		
+		$tpl->assign("lang", $lang);
+		$tpl->assign("p", $p);
+		$tpl->assign("o", $o);
+		$tpl->assign("en", $en);
+		$tpl->assign("en_inv", $en_inv);
+		$tpl->assign("en_inv_text", $en_inv_text);
+		$tpl->assign("img_en", $img_en);
+		$tpl->assign("color_onoff", $color_onoff);
+		$tpl->assign("color_onoff_inv", $color_onoff_inv);
+		$tpl->assign("en_disable", $en_disable);
+		
+		$tpl->assign("en_acknowledge_text", $en_acknowledge_text);
+		$tpl->assign("en_acknowledge", $en_acknowledge);
+		
+		
+		$tpl->assign("status", $status);
+		$tpl->assign("h", $host);
+		$tpl->assign("tab_comments_svc", $tab_comments_svc);
+		$tpl->assign("service_id", getMyServiceID($svc_description, $host["host_id"]));
+		$tpl->assign("host_data", $host_status[$host_name]);
+		$tpl->assign("service_data", $service_status[$host_name."_".$svc_description]);
+		$tpl->assign("svc_description", $svc_description);
+		$tpl->display("serviceDetails.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/objectDetails/servicegroupDetails.ihtml b/www/include/monitoring/objectDetails/servicegroupDetails.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/monitoring/objectDetails/servicegroupDetails.php b/www/include/monitoring/objectDetails/servicegroupDetails.php
new file mode 100644
index 0000000000000000000000000000000000000000..52ae23450577f5832f05ca7e7b4e01b801894f48
--- /dev/null
+++ b/www/include/monitoring/objectDetails/servicegroupDetails.php
@@ -0,0 +1,25 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+	
+	require_once './class/other.class.php';
+	include_once("./include/monitoring/common-Func.php");			
+	include_once("./include/monitoring/external_cmd/cmd.php");
+	
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/serviceAcknowledge.ihtml b/www/include/monitoring/serviceAcknowledge.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..0986d700db51f5a11f365e042fa1af5ffada1461
--- /dev/null
+++ b/www/include/monitoring/serviceAcknowledge.ihtml
@@ -0,0 +1,73 @@
+{$form.javascript}
+<form {$form.attributes}>
+<div align=center>
+	 <table id="ListTableSmall">
+
+	 	<tr class="ListHeader">
+	 	<td class="FormHeader" colspan="2">
+	 	{$form.header.title}</td>
+	 	</tr>
+	 	
+		<tr class="list_one">
+			<td class="FormRowField">
+				{$hostlabel}
+			</td>
+			<td class="FormRowValue">
+				{$hostname}
+			</td>
+		</tr>
+		<tr class="list_one">
+			<td class="FormRowField">
+				{$servicelabel}
+			</td>
+			<td class="FormRowValue">
+				{$servicedescription}
+			</td>
+		</tr>
+		{if $en == 1}
+		<tr class="list_two">
+			<td class="FormRowField">
+				{$form.notify.label}
+			</td>
+			<td class="FormRowValue">
+				{$form.notify.html}
+			</td>
+		</tr>
+
+
+		<tr class="list_two">
+			<td class="FormRowField">
+				{$form.persistent.label}
+			</td>
+			<td class="FormRowValue">
+				{$form.persistent.html}
+			</td>
+		</tr>
+		<tr class="list_one">
+			<td class="FormRowField">
+				{$authorlabel}
+			</td>
+			<td class="FormRowValue">
+				{$authoralias}
+			</td>
+		</tr>
+		<tr class="list_one">
+			<td class="FormRowField">
+				{$form.comment.label}
+			</td>
+			<td class="FormRowValue">
+				{$form.comment.html}
+			</td>
+		</tr>		
+		{/if}
+		<tr class="ListFooter">
+			<td class="FormRowValue" colspan="2">
+			<div id="validForm">
+				<p class="oreonbutton">{$form.submit.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+			</div>
+			</td>
+		</tr>
+	</table>
+</div>
+	{$form.hidden}
+</form>
\ No newline at end of file
diff --git a/www/include/monitoring/serviceAcknowledge.php b/www/include/monitoring/serviceAcknowledge.php
new file mode 100644
index 0000000000000000000000000000000000000000..a5244d4a0474cbcf66af177885b65ea2946b92e1
--- /dev/null
+++ b/www/include/monitoring/serviceAcknowledge.php
@@ -0,0 +1,95 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+
+	if (!isset ($oreon))
+		exit ();
+
+	isset($_GET["host_name"]) ? $host_name = $_GET["host_name"] : $host_name = NULL;
+	isset($_GET["service_description"]) ? $service_description = $_GET["service_description"] : $service_description = NULL;
+	isset($_GET["cmd"]) ? $cmd = $_GET["cmd"] : $cmd = NULL;
+	isset($_GET["en"]) ? $en = $_GET["en"] : $en = 1;
+
+	$path = $oreon->optGen["oreon_path"]."www/include/monitoring/";
+
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+
+	# HOST LCA
+	$key = array_search($host_name, $oreon->user->lcaHost);
+	if ($key != NULL){
+
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+
+
+	#
+	## Form begin
+	#
+
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	$form->addElement('header', 'title', 'Command Options');
+
+	$tpl->assign('hostlabel', $lang['h_name']);
+	$tpl->assign('hostname', $host_name);
+	$tpl->assign('en', $en);
+	
+	$tpl->assign('servicelabel', $lang['sv']);
+	$tpl->assign('servicedescription', $service_description);
+
+	$tpl->assign('authorlabel', $lang['cg_alias']);
+	$tpl->assign('authoralias', $oreon->user->get_alias());
+
+	$form->addElement('checkbox', 'notify', 'notify');
+	$form->addElement('checkbox', 'persistent', 'persistent');
+
+	$form->addElement('hidden', 'host_name', $host_name);
+	$form->addElement('hidden', 'service_description', $service_description);
+	$form->addElement('hidden', 'author', $oreon->user->get_alias());
+	$form->addElement('hidden', 'cmd', $cmd);
+	$form->addElement('hidden', 'p', $p);
+	$form->addElement('hidden', 'en', $en);
+
+	$form->applyFilter('_ALL_', 'trim');
+	$attr = "size=40";
+	$form->addElement('text', 'comment', 'comment', $attr);
+	
+	$form->addRule('comment', $lang["error_msg"], 'required', '', 'client');
+	$form->setJsWarnings($lang["herror"],$lang["ferror"]);
+	
+	$form->addElement('submit', 'submit', ($en == 1) ? $lang["m_mon_ack_add"] : $lang["m_mon_ack_del"]);
+	$form->addElement('reset', 'reset', $lang["reset"]);
+	
+
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+	$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+
+	$form->accept($renderer);
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->assign('o', 'svcd');
+	$tpl->display("serviceAcknowledge.ihtml");
+}
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/servicePassiveCheck.ihtml b/www/include/monitoring/servicePassiveCheck.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..48b5855672ede6880fbced9e17e8415567ac1517
--- /dev/null
+++ b/www/include/monitoring/servicePassiveCheck.ihtml
@@ -0,0 +1,67 @@
+{$form.javascript}
+<form {$form.attributes}>
+<div align=center>
+	 <table id="ListTableSmall">
+
+	 	<tr class="ListHeader">
+	 	<td class="FormHeader" colspan="2">
+	 	{$form.header.title}</td>
+	 	</tr>
+	 	
+		<tr class="list_one">
+			<td class="FormRowField">
+				{$hostlabel}
+			</td>
+			<td class="FormRowValue">
+				{$hostname}
+			</td>
+		</tr>
+		<tr class="list_one">
+			<td class="FormRowField">
+				{$servicelabel}
+			</td>
+			<td class="FormRowValue">
+				{$service_description}
+			</td>
+		</tr>
+		<tr class="list_two">
+			<td class="FormRowField">
+				{$form.return_code.label}
+			</td>
+			<td class="FormRowValue">
+				{$form.return_code.html}
+			</td>
+		</tr>
+
+
+		<tr class="list_one">
+			<td class="FormRowField">
+				{$form.output.label}
+			</td>
+			<td class="FormRowValue">
+				{$form.output.html}
+			</td>
+		</tr>
+		<tr class="list_two">
+			<td class="FormRowField">
+				{$form.dataPerform.label}
+			</td>
+			<td class="FormRowValue">
+				{$form.dataPerform.html}
+			</td>
+		</tr>
+
+
+		<tr class="ListFooter">
+			<td class="FormRowValue" colspan="2">
+			<div id="validForm">
+				<p class="oreonbutton">{$form.submit.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+			</div>
+			</td>
+		</tr>
+
+	</table>
+</div>
+<input name="o" type="hidden" value="svcd" />
+	{$form.hidden}
+</form>
\ No newline at end of file
diff --git a/www/include/monitoring/servicePassiveCheck.php b/www/include/monitoring/servicePassiveCheck.php
new file mode 100644
index 0000000000000000000000000000000000000000..74c7beb4809db2dfcf26086daff338c666ff84ef
--- /dev/null
+++ b/www/include/monitoring/servicePassiveCheck.php
@@ -0,0 +1,87 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset ($oreon))
+		exit ();
+
+	isset($_GET["host_name"]) ? $host_name = $_GET["host_name"] : $host_name = NULL;
+	isset($_GET["service_description"]) ? $service_description = $_GET["service_description"] : $service_description = NULL;
+	isset($_GET["cmd"]) ? $cmd = $_GET["cmd"] : $cmd = NULL;
+
+	
+	$path = "/usr/local/oreon/www/include/monitoring/";
+
+
+
+	# HOST LCA
+	$key = array_search($host_name, $oreon->user->lcaHost);
+	if ($key != NULL){
+
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+
+		
+	#
+	## Form begin
+	#
+
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+
+	$form->addElement('header', 'title', 'Command Options');
+
+	$tpl->assign('hostlabel', $lang['h_name']);	
+	$tpl->assign('hostname', $host_name);	
+
+	$tpl->assign('authorlabel', $lang['cg_alias']);	
+	$tpl->assign('authoralias', $oreon->user->get_alias());	
+
+	$tpl->assign('servicelabel', $lang['sv']);
+	$tpl->assign('service_description', $service_description);	
+
+	$return_code = array("0" => "OK","1" => "WARNING", "3" => "UNKNOWN", "2" => "CRITICAL");
+
+	$form->addElement('select', 'return_code', 'checkResult',$return_code);
+	$form->addElement('text', 'output', $lang["mon_checkOutput"]);
+	$form->addElement('text', 'dataPerform', $lang["mon_dataPerform"]);
+
+	$form->addElement('hidden', 'host_name', $host_name);
+	$form->addElement('hidden', 'service_description', $service_description);
+	$form->addElement('hidden', 'author', $oreon->user->get_alias());
+	$form->addElement('hidden', 'cmd', $cmd);
+	$form->addElement('hidden', 'p', $p);
+//	$form->addElement('hidden', 'o', 'svcd');
+
+	$form->addElement('submit', 'submit', $lang["save"]);
+	$form->addElement('reset', 'reset', $lang["reset"]);
+
+
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+	$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+
+	$form->accept($renderer);
+	$tpl->assign('form', $renderer->toArray());	
+
+	//$tpl->assign('o', 'svcd');
+	$tpl->display($path."servicePassiveCheck.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/status/host.php b/www/include/monitoring/status/host.php
new file mode 100644
index 0000000000000000000000000000000000000000..0bf232d524422ecafb61089d15eb648fce6b2cf7
--- /dev/null
+++ b/www/include/monitoring/status/host.php
@@ -0,0 +1,93 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+
+$pagination = "maxViewMonitoring";
+	# set limit & num
+	$res =& $pearDB->query("SELECT maxViewMonitoring FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewMonitoring"] : $limit = $_GET["limit"];
+	!isset($_GET["num"]) ? $num = 0 : $num = $_GET["num"];
+	!isset($_GET["search"]) ? $search = 0 : $search = $_GET["search"];
+
+	$tab_class = array("0" => "list_one", "1" => "list_two");
+	$rows = 0;
+	$host_status_num = array();
+	foreach ($host_status as $name => $h){
+			$tmp = array();
+			$tmp[0] = $name;			
+			$res =& $pearDB->query("SELECT host_address FROM host WHERE host_name = '".$name."'");
+			$res->fetchInto($host);		
+			$host_status[$name]["address"] = $host["host_address"];
+			$host_status[$name]["status_td"] = "<td bgcolor='" . $oreon->optGen["color_".strtolower($h["status"])] . "' align='center'><a href='oreon.php?p=307&host=$name'>" . $h["status"] . "</a></td>";
+			$host_status[$name]["last_check"] = date($lang["date_time_format_status"], $h["last_check"]);
+			$host_status[$name]["last_stat"] = Duration::toString(time() - $h["last_stat"]);
+			$host_status[$name]["class"] = $tab_class[$rows % 2];
+			$host_status[$name]["name"] = $name;
+			$tmp[1] = $host_status[$name];
+			$host_status_num[$rows++] = $tmp;
+	}
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "/templates/");
+
+
+
+	# view tab
+	$displayTab = array();
+	$start = $num*$limit;
+	for($i=$start; isset($host_status_num[$i]) && $i < $limit+$start ;$i++)
+		$displayTab[$host_status_num[$i][0]] = $host_status_num[$i][1];
+	$host_status = $displayTab;
+
+
+
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);
+
+	
+	$lang['mon_host'] = "Hosts";
+	$tpl->assign("p", $p);
+	$tpl->assign("num", $num);
+	$tpl->assign("limit", $limit);
+	$tpl->assign("mon_host", $lang['mon_host']);
+	$tpl->assign("mon_status", $lang['mon_status']);
+	$tpl->assign("mon_last_check", $lang['mon_last_check']); 
+	$tpl->assign("mon_duration", $lang['mon_duration']);
+	$tpl->assign("mon_status_information", $lang['mon_status_information']); 
+	$tpl->assign("host_status", $host_status);
+	if (!isset($_GET["sort_typeh"]))
+		$_GET["sort_typeh"] = "name";
+	$tpl->assign("sort_type", $_GET["sort_typeh"]);
+	if (!isset($_GET["order"]))
+		$_GET["order"] = "sort_asc";
+	$tpl->assign("order", $_GET["order"]);
+	$tab_order = array("sort_asc" => "sort_desc", "sort_desc" => "sort_asc"); 
+	$tpl->assign("tab_order", $tab_order);
+	$tpl->assign("lang", $lang);
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("host.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
diff --git a/www/include/monitoring/status/host_problem.php b/www/include/monitoring/status/host_problem.php
new file mode 100644
index 0000000000000000000000000000000000000000..c2489f3f535ce18ffa81294d0aec30e02093232c
--- /dev/null
+++ b/www/include/monitoring/status/host_problem.php
@@ -0,0 +1,63 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+
+	$tab_class = array("0" => "list_one", "1" => "list_two");
+	$cpt = 0;
+	foreach ($host_status as $name => $h){
+		$res =& $pearDB->query("SELECT host_address FROM host WHERE host_name = '".$name."'");
+			$res->fetchInto($host);
+			$host_status[$name]["address"] = $host["host_address"];
+			$host_status[$name]["status_td"] = "<td bgcolor='" . $oreon->optGen["color_".strtolower($h["status"])] . "' align='center'>" . $h["status"] . "</td>";
+			$host_status[$name]["last_check"] = date($lang["date_time_format_status"], $h["last_check"]);
+			$host_status[$name]["last_stat"] = Duration::toString(time() - $h["last_stat"]);
+			$host_status[$name]["class"] = $tab_class[$cpt % 2];
+			$host_status[$name]["name"] = $name;
+			$cpt++;
+	}
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "/templates/");
+	
+	$lang['mon_host'] = "Hosts";
+	$tpl
+	->assign("p", $p);
+	$tpl->assign("mon_host", $lang['mon_host']);
+	$tpl->assign("mon_status", $lang['mon_status']);
+	$tpl->assign("mon_last_check", $lang['mon_last_check']); 
+	$tpl->assign("mon_duration", $lang['mon_duration']);
+	$tpl->assign("mon_status_information", $lang['mon_status_information']); 
+	$tpl->assign("host_status", $host_status);
+	if (!isset($_GET["sort_typeh"]))
+		$_GET["sort_typeh"] = "name";
+	$tpl->assign("sort_type", $_GET["sort_typeh"]);
+	if (!isset($_GET["order"]))
+		$_GET["order"] = "sort_asc";
+	$tpl->assign("order", $_GET["order"]);
+	$tab_order = array("sort_asc" => "sort_desc", "sort_desc" => "sort_asc"); 
+	$tpl->assign("tab_order", $tab_order);
+	$tpl->assign("lang", $lang);
+	$tpl->display("host_problem.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>	
\ No newline at end of file
diff --git a/www/include/monitoring/status/hostgroup.php b/www/include/monitoring/status/hostgroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..9c2afb6ecb5131d7de62eed3cb540f7bc45a8121
--- /dev/null
+++ b/www/include/monitoring/status/hostgroup.php
@@ -0,0 +1,108 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	$hg = array();
+
+	$tab = array("1"=>'list_one', "0" => "list_two"); 
+
+	$ret =& $pearDB->query("SELECT * FROM hostgroup WHERE hg_activate = '1' ORDER BY hg_name");
+	while ($r =& $ret->fetchRow()){
+		$hg[$r["hg_name"]] = array("name" => $r["hg_name"], 'alias' => $r["hg_alias"]);
+		$status_hg_h[$r["hg_name"]] = array();
+		$status_hg_h[$r["hg_name"]]["UP"] = 0;
+		$status_hg_h[$r["hg_name"]]["DOWN"] = 0;
+		$status_hg_h[$r["hg_name"]]["UNREACHABLE"] = 0;
+		$status_hg_h[$r["hg_name"]]["PENDING"] = 0;
+		$status_hg_h[$r["hg_name"]]["UNKNOWN"] = 0;
+		$status_hg[$r["hg_name"]] = array();
+		$status_hg[$r["hg_name"]]["OK"] = 0;
+		$status_hg[$r["hg_name"]]["PENDING"] = 0;
+		$status_hg[$r["hg_name"]]["WARNING"] = 0;
+		$status_hg[$r["hg_name"]]["CRITICAL"] = 0;
+		$status_hg[$r["hg_name"]]["UNKNOWN"] = 0;
+		
+		$ret_h =& $pearDB->query(	"SELECT host_host_id,host_name FROM hostgroup_relation,host,hostgroup ".
+									"WHERE hostgroup_hg_id = '".$r["hg_id"]."' AND hostgroup.hg_id = hostgroup_relation.hostgroup_hg_id ".
+									"AND hostgroup_relation.host_host_id = host.host_id AND host.host_register = '1' AND hostgroup.hg_activate = '1'");
+		while ($r_h =& $ret_h->fetchRow()){
+			!$r_h["host_name"] ? $hostname = getMyHostName($r_h["host_id"]) : $hostname = $r_h["host_name"];
+			//print $r["hg_name"]. " : " . $hostname ."-".$host_status[$hostname]["status"] . "<br>";
+			if (isset($host_status[$hostname]["status"])){
+				$status_hg_h[$r["hg_name"]][$host_status[$hostname]["status"]]++;
+				foreach ($tab_host_service[$hostname] as $key => $s){
+					$status_hg[$r["hg_name"]][$service_status[$hostname. "_" .$key]["status"]]++;
+				} 		
+			}
+		}
+	}
+	
+	$cpt = 0;
+	foreach ($hg as $hgs){
+		$hg[$hgs["name"]]["host_stats"] = "";
+		if ($status_hg_h[$hgs["name"]]["UP"] != 0)
+			$hg[$hgs["name"]]["host_stats"] = "<span style='background:".$oreon->optGen["color_up"]."'>" . $status_hg_h[$hgs["name"]]["UP"] . " UP</span> ";
+		if ($status_hg_h[$hgs["name"]]["DOWN"] != 0)
+			$hg[$hgs["name"]]["host_stats"] .= "<span style='background:".$oreon->optGen["color_down"]."'>" . $status_hg_h[$hgs["name"]]["DOWN"] . " DOWN</span> ";
+		if ($status_hg_h[$hgs["name"]]["UNREACHABLE"] != 0)
+			$hg[$hgs["name"]]["host_stats"] .= "<span style='background:".$oreon->optGen["color_unreachable"]."'>" . $status_hg_h[$hgs["name"]]["UNREACHABLE"] . " UNREACHABLE</span> ";
+		if ($status_hg_h[$hgs["name"]]["PENDING"] != 0)
+			$hg[$hgs["name"]]["host_stats"] .= "<span style='background:".$oreon->optGen["color_pending"]."'>" . $status_hg_h[$hgs["name"]]["PENDING"] . " PENDING</span> ";
+		if ($status_hg_h[$hgs["name"]]["UNKNOWN"] != 0)
+			$hg[$hgs["name"]]["host_stats"] .= "<span style='background:".$oreon->optGen["color_unknown"]."'>" . $status_hg_h[$hgs["name"]]["UNKNOWN"] . " UNKNOWN</span> ";
+		
+		$hg[$hgs["name"]]["svc_stats"] = "";
+		if ($status_hg[$hgs["name"]]["OK"] != 0)
+			$hg[$hgs["name"]]["svc_stats"] = "<span style='background:".$oreon->optGen["color_ok"]."'>" . $status_hg[$hgs["name"]]["OK"] . " OK</span> ";
+		if ($status_hg[$hgs["name"]]["WARNING"] != 0)
+			$hg[$hgs["name"]]["svc_stats"] .= "<span style='background:".$oreon->optGen["color_warning"]."'>" . $status_hg[$hgs["name"]]["WARNING"] . " WARNING</span> ";
+		if ($status_hg[$hgs["name"]]["CRITICAL"] != 0)
+			$hg[$hgs["name"]]["svc_stats"] .= "<span style='background:".$oreon->optGen["color_critical"]."'>" . $status_hg[$hgs["name"]]["CRITICAL"] . " CRITICAL</span> ";
+		if ($status_hg[$hgs["name"]]["PENDING"] != 0)
+			$hg[$hgs["name"]]["svc_stats"] .= "<span style='background:".$oreon->optGen["color_pending"]."'>" . $status_hg[$hgs["name"]]["PENDING"] . " PENDING</span> ";
+		if ($status_hg[$hgs["name"]]["UNKNOWN"] != 0)
+			$hg[$hgs["name"]]["svc_stats"] .= "<span style='background:".$oreon->optGen["color_unknown"]."'>" . $status_hg[$hgs["name"]]["UNKNOWN"] . " UNKNOWN</span> ";
+		$hg[$hgs["name"]]["class"] = $tab[$cpt % 2];
+		$cpt++;
+	}
+	
+	if ($debug){
+		print "<textarea rows='20' cols='100'>";
+		print_r($status_hg);
+		print "</textarea>";
+		print "<textarea rows='20' cols='100'>";
+		print_r($status_hg_h);
+		print "</textarea>";
+	}
+		
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "/templates/");
+	
+	$tpl->assign("p", $p);
+	$tpl->assign("hg", $hg);
+	$tpl->assign("lang", $lang);
+	$tpl->display("hostgroup.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/status/index.html b/www/include/monitoring/status/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/monitoring/status/metaService.php b/www/include/monitoring/status/metaService.php
new file mode 100644
index 0000000000000000000000000000000000000000..9fb7f144b8cf78150cc0f8b4955f46ffb13d5408
--- /dev/null
+++ b/www/include/monitoring/status/metaService.php
@@ -0,0 +1,80 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset($oreon))
+		exit();
+			
+	$res =& $pearDB->query("SELECT * FROM meta_service WHERE meta_activate = '1'");
+	while ($res->fetchInto($meta)){
+		$metaService_status_bis["meta_" . $meta["meta_id"]]["real_name"] = $meta["meta_name"]; 
+		$metaService_status_bis["meta_" . $meta["meta_id"]]["id"] = $meta["meta_id"]; 
+	}
+	$tab_class = array("0" => "list_one", "1" => "list_two");
+	$c = 0;
+	if (isset($metaService_status)){
+		foreach ($metaService_status as $name => $svc){
+			if (strstr($name, "meta_") && isset($metaService_status[$name]["status"])){
+				$metaService_status_bis[$name]["status"] = $svc["status"];
+				$metaService_status_bis[$name]["status_td"] = "<td  class='ListColCenter' style='background:" . $oreon->optGen["color_".strtolower($svc["status"])] . "'>" . $svc["status"] . "</td>";
+				$metaService_status_bis[$name]["last_check"] = date($lang["date_time_format_status"], $svc["last_check"]);
+				$metaService_status_bis[$name]["last_change"] = Duration::toString(time() - $svc["last_change"]);
+				$metaService_status_bis[$name]["class"] = $tab_class[$c % 2];
+				$metaService_status_bis[$name]["retry"] = $svc["retry"];
+				$metaService_status_bis[$name]["output"] = $svc["output"];
+				$c++;
+			}
+		}
+	}
+				
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "/templates/");
+	
+	$lang['mon_host'] = "Hosts";
+	$tpl->assign("p", $p);
+	$tpl->assign("mon_status", $lang['mon_status']);
+	$tpl->assign("mon_ip", $lang['mon_ip']); 
+	$tpl->assign("mon_last_check", $lang['mon_last_check']); 
+	$tpl->assign("mon_duration", $lang['mon_duration']);
+	$tpl->assign("mon_status_information", $lang['mon_status_information']);
+
+	if (!isset($_GET["sort_types"]))
+		$_GET["sort_types"] = "host_name";
+	$tpl->assign("sort_type", $_GET["sort_types"]);
+	if (!isset($_GET["order"]))
+		$_GET["order"] = "sort_asc";
+	
+	!isset($_GET["num"]) ? $begin = 0 : $begin = $_GET["num"];
+	!isset($_GET["limit"]) ? $nb = 20 : $nb = $begin + $_GET["limit"];
+
+	if (isset($metaService_status))
+		$tpl->assign("metaService_status", $metaService_status_bis);
+
+	
+	$tpl->assign("begin", $begin);
+	$tpl->assign("end", $nb);
+	$tpl->assign("lang", $lang);
+	$tpl->assign("order", $_GET["order"]);
+	$tab_order = array("sort_asc" => "sort_desc", "sort_desc" => "sort_asc"); 
+	$tpl->assign("tab_order", $tab_order);
+	$tpl->display("metaService.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/status/monitoringHost.php b/www/include/monitoring/status/monitoringHost.php
new file mode 100644
index 0000000000000000000000000000000000000000..e6c92dbbbbc749e410b37e9d355e88114d38cd95
--- /dev/null
+++ b/www/include/monitoring/status/monitoringHost.php
@@ -0,0 +1,74 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	require_once './class/other.class.php';
+	include_once("./include/monitoring/external_cmd/cmd.php");
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+
+?>
+
+<?
+	$path = "./include/monitoring/status/";
+	$pathRoot = "./include/monitoring/";
+	$pathDetails = "./include/monitoring/objectDetails/";
+	$pathTools = "./include/tools/";
+
+	if(isset($_GET["cmd"]) && $_GET["cmd"] == 14 && isset($_GET["author"]) && isset($_GET["en"]) && $_GET["en"] == 1){
+		if (!isset($_GET["notify"])){
+				$_GET["notify"] = 0;
+		}
+		if (!isset($_GET["persistent"])){
+				$_GET["persistent"] = 0;
+		}
+		acknowledgeHost($lang);
+	}
+	else if(isset($_GET["cmd"]) && $_GET["cmd"] == 14 && isset($_GET["author"]) && isset($_GET["en"]) && $_GET["en"] == 0){
+		acknowledgeHostDisable($lang);
+	}
+
+	if ($min)
+		switch ($o)	{
+			default : require_once($pathTools."tools.php"); break;
+		}
+
+	else {
+	?>
+
+	<div align="center" style="padding-bottom: 20px;">
+			<?	include("./include/monitoring/status/resume.php"); ?>
+    </div>
+
+	<?
+		switch ($o)	{
+			case "h" 	: require_once($path."host.php"); 					break;
+			case "hpb" 	: require_once($path."host_problem.php"); 			break;
+			case "hd" 	: require_once($pathDetails."hostDetails.php"); 	break;
+			case "hak" 	: require_once($pathRoot."hostAcknowledge.php"); 	break;
+			default 	: require_once($path."host.php"); 					break;
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/status/monitoringHostGroup.php b/www/include/monitoring/status/monitoringHostGroup.php
new file mode 100644
index 0000000000000000000000000000000000000000..9b7c16f32dc4d3e6ffbaa7f09c6e7665f0215cac
--- /dev/null
+++ b/www/include/monitoring/status/monitoringHostGroup.php
@@ -0,0 +1,42 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	require_once './class/other.class.php';
+	include_once("./include/monitoring/common-Func.php");			
+	include_once("./include/monitoring/external_cmd/cmd.php");
+	
+?>
+<div align="center" style="padding-bottom: 20px;">
+			<?	include("./include/monitoring/status/resume.php"); ?>
+</div>
+<?
+	$path = "./include/monitoring/status/";
+	$pathDetails = "./include/monitoring/objectDetails/";
+	
+	switch ($o)	{
+		case "hg" 	: require_once($path."hostgroup.php"); break; 
+		case "hgpb" 	: require_once($path."hostgroup_problem.php"); break;
+		case "hgd" 	: require_once($pathDetails."hostgroupDetails.php"); break; 
+		default 	: require_once($path."hostgroup.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/status/monitoringService.php b/www/include/monitoring/status/monitoringService.php
new file mode 100644
index 0000000000000000000000000000000000000000..ed081f0261db6dcce84cb2025b9e9709806be34e
--- /dev/null
+++ b/www/include/monitoring/status/monitoringService.php
@@ -0,0 +1,74 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+
+
+	require_once './class/other.class.php';
+	include_once("./include/monitoring/common-Func.php");			
+	include_once("./include/monitoring/external_cmd/cmd.php");
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+if(isset($_GET["cmd"]) && $_GET["cmd"] == 15 && isset($_GET["author"]) && isset($_GET["en"]) && $_GET["en"] == 1){
+	if (!isset($_GET["notify"])){
+			$_GET["notify"] = 0;
+	}
+	if (!isset($_GET["persistent"])){
+			$_GET["persistent"] = 0;
+	}
+	acknowledgeService($lang);
+}
+else if(isset($_GET["cmd"]) && $_GET["cmd"] == 15 && isset($_GET["author"]) && isset($_GET["en"]) && $_GET["en"] == 0){
+	acknowledgeServiceDisable($lang);
+}
+
+
+if(isset($_GET["cmd"]) && $_GET["cmd"] == 16 && isset($_GET["output"]))
+{
+	submitPassiveCheck($lang);
+}	
+?>
+<div align="center" style="padding-bottom: 20px;">
+
+			<?	include("./include/monitoring/status/resume.php"); ?>
+</div>
+<?
+	$path = "./include/monitoring/status/";
+	$pathRoot = "./include/monitoring/";
+	$pathDetails = "./include/monitoring/objectDetails/";
+	switch ($o)	{
+		case "svc" 		: require_once($path."service.php"); 					break; 
+		case "svcpb" 	: require_once($path."service_problem.php");			break;
+		case "svcd" 	: require_once($pathDetails."serviceDetails.php"); 		break; 
+		case "svcak" 	: require_once($pathRoot."serviceAcknowledge.php"); 	break; 
+		case "svcpc" 	: require_once($pathRoot."servicePassiveCheck.php"); 	break; 
+		case "svcgrid" 	: require_once($path."serviceGrid.php"); 				break; 
+		case "svcOV" 	: require_once($path."serviceOverview.php"); 			break; 
+		case "svcSum" 	: require_once($path."serviceSummary.php"); 			break; 
+		case "meta" 	: require_once($path."metaService.php"); 				break;
+		case "svcSch" 	: require_once($path."serviceSchedule.php"); 			break; 
+		default 		: require_once($path."service.php"); 					break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/status/proc_info.php b/www/include/monitoring/status/proc_info.php
new file mode 100644
index 0000000000000000000000000000000000000000..acb008bc1d24fcf095b55019c9dc1c79b721750b
--- /dev/null
+++ b/www/include/monitoring/status/proc_info.php
@@ -0,0 +1,288 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Jean Baptiste Gouret - Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+	// restriction
+	
+	require_once './class/other.class.php';
+	
+	if (isset($_POST["o"]) && !strcmp($_POST["o"], "r")){
+		$stdout = shell_exec("sudo /etc/init.d/nagios restart"); 
+		$tab = preg_split ("/[\n]+/", $stdout);
+	}
+	if (isset($oreon->Lca[$oreon->user->get_id()]) && $oreon->Lca[$oreon->user->get_id()]->get_admin_server() == 0)
+		include("./include/security/error.php");
+	else {
+		if ($Logs->log_p->status_proc == 1)		{
+			$running_time = $Logs->log_p->last_command_check - $Logs->log_p->program_start;
+			$d = date("j", $running_time) - 1;
+	?>
+		<table align="left" border="0">
+			<tr>
+				<td valign="top">
+					<table border='1' style='border-width: thin; border-style: dashed; border-color=#9C9C9C;' cellpadding='4' cellspacing='2'>
+						<tr>
+						  <td colspan=3 class="text14b" align="center"><? echo $lang['mon_proc_options']; ?></td>
+						 </tr>
+						<tr bgColor="#eaecef">
+						  <td align=left><? echo $lang['mon_notif_enabled']; ?></td>
+						  <td align="center">
+							<? 
+							if (!strcmp($Logs->log_p->get_enable_notifications(), "0"))
+								echo $lang['no'];
+							else 
+								echo $lang['yes']; 
+							?>
+						  </td>
+						  <td align="center">
+						  <? 
+							if (!strcmp($Logs->log_p->get_enable_notifications(), "0")) 
+								print "<a href='?p=306&cmd=22'><img src='./img/enabled.gif' border='0' alt='Enable notifications' width='20'></a>";
+							else
+								print "<a href='?p=306&cmd=23'><img src='./img/disabled.gif' border='0' alt='Disable notifications' width='20'></a>";	
+						  ?>
+						  </td>
+						</tr>
+						<tr bgColor="#eaecef">
+						  <td align=left><? echo $lang['mon_service_check_executed']; ?></td>
+						  <td align="center">
+							<? 
+							if (!strcmp($Logs->log_p->get_execute_service_checks(), "0"))
+								echo $lang['no'];
+							else 
+								echo $lang['yes']; 
+							?>
+						  </td>
+						  <td align="center">
+						  <? 
+							if (!strcmp($Logs->log_p->get_execute_service_checks(), "0")) 
+								print "<a href='?p=306&cmd=29'><img src='./img/enabled.gif' border='0' alt='Start executing service checks' width='20'></a>";
+							else
+								print "<a href='?p=306&cmd=30'><img src='./img/disabled.gif' border='0' alt='Stop executing service checks' width='20'></a>";	
+						  ?>
+						  </td>
+						</tr>
+						<tr bgColor="#eaecef">
+						  <td align=left><? echo $lang['mon_passive_service_check_executed']; ?></td>
+						  <td align="center">
+							<? 
+							if (!strcmp($Logs->log_p->get_accept_passive_service_checks(), "0"))
+								echo $lang['no'];
+							else 
+								echo $lang['yes']; 
+							?>
+						  </td>
+						  <td align="center">
+						  <? 
+							if (!strcmp($Logs->log_p->get_accept_passive_service_checks(), "0")) 
+								print "<a href='?p=306&cmd=31'><img src='./img/enabled.gif' border='0' alt='Start accepting passive service checks' width='20'></a>";
+							else
+								print "<a href='?p=306&cmd=32'><img src='./img/disabled.gif' border='0' alt='Stop accepting passive service checks' width='20'></a>";	
+						  ?>
+						  </td>
+						</tr>
+						<tr bgColor="#eaecef">
+						  <td align=left><? echo $lang['mon_eh_enabled']; ?></td>
+						  <td align="center">
+							<? 
+							if (!strcmp($Logs->log_p->get_enable_event_handlers(), "0"))
+								echo $lang['no'];
+							else 
+								echo $lang['yes']; 
+							?>
+						  </td>
+						  <td align="center">
+						  <? 
+							if (!strcmp($Logs->log_p->get_enable_event_handlers(), "0")) 
+								print "<a href='?p=306&cmd=35'><img src='./img/enabled.gif' border='0' alt='Enable event handlers' width='20'></a>";
+							else
+								print "<a href='?p=306&cmd=36'><img src='./img/disabled.gif' border='0' alt='Disable event handlers' width='20'></a>";	
+						  ?>
+						  </td>
+						</tr>
+						<tr bgColor="#eaecef">
+						  <td align=left><? echo $lang['mon_obess_over_services']; ?></td>
+						  <td align="center">
+							<? 
+							if (!strcmp($Logs->log_p->get_obsess_over_services(), "0"))
+								echo $lang['no'];
+							else 
+								echo $lang['yes']; 
+							?>
+						  </td>
+						  <td align="center">
+						  <? 
+							if (!strcmp($Logs->log_p->get_obsess_over_services(), "0")) 
+								print "<a href='?p=306&cmd=37'><img src='./img/enabled.gif' border='0' alt='Start obsessing over services' width='20'></a>";
+							else
+								print "<a href='?p=306&cmd=38'><img src='./img/disabled.gif' border='0' alt='Stop obsessing over services' width='20'></a>";	
+						  ?>
+						  </td>
+						</tr>
+						<tr bgColor="#eaecef">
+						  <td align=left><? echo $lang['mon_fp_detection_enabled']; ?></td>
+						  <td align="center">
+							<? 
+							if (!strcmp($Logs->log_p->get_enable_flap_detection(), "0"))
+								echo $lang['no'];
+							else 
+								echo $lang['yes']; 
+							?>
+						  </td>
+						  <td align="center">
+						  <? 
+							if (!strcmp($Logs->log_p->get_enable_flap_detection(), "0")) 
+								print "<a href='?p=306&cmd=39'><img src='./img/enabled.gif' border='0' alt='Enable flap detection' width='20'></a>";
+							else
+								print "<a href='?p=306&cmd=40'><img src='./img/disabled.gif' border='0' alt='Disable flap detection' width='20'></a>";	
+						  ?>
+						  </td>
+						</tr>
+						<tr bgColor="#eaecef">
+						  <td align=left><? echo $lang['mon_perf_data_process']; ?></td>
+						  <td align="center">
+							<? 
+							if (!strcmp($Logs->log_p->get_process_performance_data(), "0\n"))
+								echo $lang['no'];
+							else 
+								echo $lang['yes']; 
+							?>
+						  </td>
+						  <td align="center">
+						  <? 
+							if (!strcmp($Logs->log_p->get_process_performance_data(), "0\n")) 
+								print "<a href='?p=306&cmd=41'><img src='./img/enabled.gif' border='0' alt='Enable performance data' width='20'></a>";
+							else
+								print "<a href='?p=306&cmd=42'><img src='./img/disabled.gif' border='0' alt='Disable performance data' width='20'></a>";	
+						  ?>
+						  </td>
+						</tr>
+					</table>
+				</td>
+				<td style="padding-left: 20px;"></td>
+				<td valign="top">
+					<table border='1' style='border-width: thin; border-style: dashed; border-color=#9C9C9C;' cellpadding='4' cellspacing='2'>
+						<tr>
+						  <td	class="text14b" align="center" colspan="2"><? echo $lang['mon_process_infos']; ?></td>
+						 </tr>
+						<tr bgColor="#eaecef">
+						  <td align=left><? echo $lang['mon_process_start_time']; ?></td>
+						  <td align="center"><? 	if (isset($Logs->log_p->program_start)){print date("j/m/Y - H:i:s", $Logs->log_p->get_program_start());}?></td>
+						</tr>
+						<tr bgColor="#eaecef">
+						  <td align=left><? echo $lang['mon_total_run_time']; ?></td>
+						  <td align="center"><? if (isset($Logs->log_p->last_command_check)){print Duration::toString($Logs->log_p->get_last_command_check() - $Logs->log_p->get_program_start());} ?></td>
+						</tr>
+						<tr bgColor="#eaecef">
+						  <td align=left><? echo $lang['mon_last_ext_command_check']; ?></td>
+						  <td align="center"><? if (isset($Logs->log_p->last_command_check))print date("j/m/Y - H:i:s", $Logs->log_p->get_last_command_check()) ; ?></td>
+						</tr>
+						<tr bgColor="#eaecef">
+						  <td align=left><? echo $lang['mon_last_log_file_rotation']; ?></td>
+						  <td align="center">
+							<? 
+							if (!isset($Logs->log_p->last_log_rotation))
+								print "N/A";
+							else
+								print date("j/m/Y - H:i:s", $Logs->log_p->get_last_log_rotation()); 
+							?>
+						   </td>
+						</tr>
+						<tr bgColor="#eaecef">
+						  <td align=left><? echo $lang['mon_nagios_pid']; ?></td>
+						  <td align="center"><? if (isset($Logs->log_p->nagios_pid)) print $Logs->log_p->get_nagios_pid(); ?></td>
+						</tr>
+					</table>
+				</td>
+				<td style="padding-left: 20px;"></td>
+				<td valign="top">
+					<table border='1' style='border-width: thin; border-style: dashed; border-color=#9C9C9C;' cellpadding='4' cellspacing='2'>
+						<tr>
+						  <td colspan=2 class="text14b" align="center"><? echo $lang['mon_process_cmds']; ?></td>
+						</tr>
+						<tr bgColor="#eaecef">
+						  <td align=left>
+						  <?						  
+							if ($Logs->log_p->get_status_proc() == 1)
+								echo $lang['mon_stop_nagios_proc'];
+							else 
+								echo $lang['mon_start_nagios_proc']						  
+						  ?>
+						  </td>
+						  <td align="center">
+						  <?						  
+							if ($Logs->log_p->get_status_proc() == 1)
+								print "<a href='?p=306&cmd=24'><img src='./img/disabled.gif' border='0'></a>";
+							else 
+								print "<a href='?p=306&cmd=25'><img src='./img/disabled.gif' border='0'></a>";						  
+						  ?>
+						  </td>
+						</tr>
+						<tr bgColor="#eaecef">
+						  <td align=left><? echo $lang['mon_restart_nagios_proc']; ?></td>
+						  <td align="center"><a href='?p=306&cmd=25'><img src='./img/enabled.gif' border="0"></a></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+		</table>
+	<?	} else {
+			if (isset($_POST["o"]) && !strcmp($_POST["o"], "r")) {?>
+			<table border='0'>
+			<tr>
+				<td valign="top" align="center"> 
+					<table cellpadding='0' cellspacing="0" class="tabTableTitle">
+						<tr>
+							<td style="white-space: nowrap;">
+							<?	
+								$i = 0;					
+								foreach ($tab as $str){
+									if (preg_match("/^Running configuration check/", $str, $matches))
+										print "<b><font color='blue'>" . $str . "</font></b><br>";
+									else if (preg_match("/^Starting/", $str, $matches))
+										print "<b><font color='red'>" . $str . "</font></b><br>";
+									else if (preg_match("/^/", $str, $matches))
+										print  $str . "<br>";
+									$i++;
+									unset($str);
+								}
+							?>
+							</td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			</table><? 
+				print "<SCRIPT LANGUAGE='JavaScript'> setTimeout(\"document.location.href=\'oreon.php?p=303&o=proc\'\",2000)</SCRIPT>";
+			} else {?>
+			<table border='0'>
+			<tr>
+				<td valign="top" align="center">
+					<table border='0' align="center" cellpadding='0' cellspacing="0" class="tabTableTitle">
+						<tr>
+							<td valign="middle"><? echo $lang['mon_restart_nagios_proc']; ?></td>
+							<td valign="middle"><form action="" method="post"><input name="o" type="hidden" value="r"><input name="Reboot" type="submit" value="<? echo "Redemarrer"; ?>"></form></td>
+						</tr>
+					</table>
+				</td>
+			</tr>
+			</table>	
+		<? }
+		}	
+	} 
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/status/resume.php b/www/include/monitoring/status/resume.php
new file mode 100644
index 0000000000000000000000000000000000000000..f3798e215b30d983e28fc1cc0d20506c8637cbb4
--- /dev/null
+++ b/www/include/monitoring/status/resume.php
@@ -0,0 +1,59 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset($oreon))
+		exit(); 
+	
+	$path = "./include/monitoring/status/";
+	$pgr_nagios_stat = array();
+
+	include("./include/monitoring/load_status_log.php");
+	
+	# Smarty template Init
+	$tpl_resume = new Smarty();
+	$tpl_resume = initSmartyTpl($path, $tpl_resume, "/templates/");
+	
+	
+	$statistic_host = array("UP" => 0, "DOWN" => 0, "UNREACHABLE" => 0, "PENDING" => 0);
+	$statistic_service = array("OK" => 0, "WARNING" => 0, "CRITICAL" => 0, "UNKNOWN" => 0, "PENDING" => 0);
+	
+	if (isset($host_status))
+		foreach ($host_status as $hs)
+			$statistic_host[$hs["status"]]++;
+	if (isset($service_status))		
+		foreach ($service_status as $s)
+			$statistic_service[$s["status"]]++;
+	
+	$statistic_service_color = array();
+	if (isset($statistic_service))
+		foreach ($statistic_service as $key => $stts)
+			$statistic_service_color[$key] = " style='background:" . $oreon->optGen["color_".strtolower($key)] . "'";
+
+	$statistic_host_color = array();
+	if (isset($statistic_host))
+		foreach ($statistic_host as $key => $stth)
+			$statistic_host_color[$key] = " style='background:" . $oreon->optGen["color_".strtolower($key)] . "'";
+			
+	$tpl_resume->assign("statistic_service", $statistic_service);
+	$tpl_resume->assign("statistic_host", $statistic_host);
+	$tpl_resume->assign("statistic_service_color", $statistic_service_color);
+	$tpl_resume->assign("statistic_host_color", $statistic_host_color);
+	$tpl_resume->assign("lang", $lang);
+	$tpl_resume->assign("refresh", $oreon->optGen["oreon_refresh"]);
+	$tpl_resume->assign("pgr_nagios_stat", $pgr_nagios_stat);
+	$tpl_resume->display("resume.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/status/service.php b/www/include/monitoring/status/service.php
new file mode 100644
index 0000000000000000000000000000000000000000..f28e81ad4c094965371c789683ef0ea9b2c6feab
--- /dev/null
+++ b/www/include/monitoring/status/service.php
@@ -0,0 +1,114 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+	$pagination = "maxViewMonitoring";		
+
+	# set limit & num
+	$res =& $pearDB->query("SELECT maxViewMonitoring FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewMonitoring"] : $limit = $_GET["limit"];
+	!isset($_GET["num"]) ? $num = 0 : $num = $_GET["num"];
+	!isset($_GET["search"]) ? $search = 0 : $search = $_GET["search"];
+
+
+	$tab_class = array("0" => "list_one", "1" => "list_two");
+	$rows = 0;
+	$service_status_num = array();
+	if (isset($service_status))
+		foreach ($service_status as $name => $svc){			
+			$tmp = array();
+			$tmp[0] = $name;		
+			$service_status[$name]["status"] = $svc["status"];
+			$service_status[$name]["status_td"] = "<td  class='ListColCenter' style='background:" . $oreon->optGen["color_".strtolower($svc["status"])] . "'>" . $svc["status"] . "</td>";
+			$service_status[$name]["last_check"] = date($lang["date_time_format_status"], $svc["last_check"]);
+			$service_status[$name]["last_change"] = Duration::toString(time() - $svc["last_change"]);
+			$service_status[$name]["class"] = $tab_class[$rows % 2];
+			$tmp[1] = $service_status[$name];
+			$service_status_num[$rows++] = $tmp;
+		}
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "/templates/");
+	
+	$lang['mon_host'] = "Hosts";
+	$tpl->assign("p", $p);
+	$tpl->assign("num", $num);
+	$tpl->assign("limit", $limit);
+	$tpl->assign("mon_host", $lang['mon_host']);
+	$tpl->assign("mon_status", $lang['mon_status']);
+	$tpl->assign("mon_ip", $lang['mon_ip']); 
+	$tpl->assign("mon_last_check", $lang['mon_last_check']); 
+	$tpl->assign("mon_duration", $lang['mon_duration']);
+	$tpl->assign("mon_status_information", $lang['mon_status_information']); 
+
+
+
+
+	# view tab
+	$displayTab = array();
+	$start = $num*$limit;
+	for($i=$start; $i < ($limit+$start) && isset($service_status_num[$i])  ;$i++)
+		$displayTab[$service_status_num[$i][0]] = $service_status_num[$i][1];
+		$service_status = $displayTab;
+
+
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+
+
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);
+
+
+	if (isset($service_status))
+		$tpl->assign("service_status", $service_status);
+	if (!isset($_GET["sort_types"]))
+		$_GET["sort_types"] = "host_name";
+	$tpl->assign("sort_type", $_GET["sort_types"]);
+	if (!isset($_GET["order"]))
+		$_GET["order"] = "sort_asc";
+	
+
+	isset($_GET["host_name"]) ? $host_name = $_GET["host_name"] : $host_name = NULL;
+	$tpl->assign("host_name", $host_name);
+	isset($_GET["status"]) ? $status = $_GET["status"] : $status = NULL;
+	$tpl->assign("status", $status);
+
+
+	$tpl->assign("begin", $num);
+	$tpl->assign("end", $limit);
+	$tpl->assign("lang", $lang);
+	$tpl->assign("order", $_GET["order"]);
+	$tab_order = array("sort_asc" => "sort_desc", "sort_desc" => "sort_asc"); 
+	$tpl->assign("tab_order", $tab_order);	
+
+	
+	$tpl->assign('form', $renderer->toArray());	
+	$tpl->display("service.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	if ($oreon->optGen["nagios_version"] == 2 && isset($pgr_nagios_stat["created"])) 	
+		$pgr_nagios_stat["created"] = date("d/m/Y G:i", $pgr_nagios_stat["created"]);
+	else
+		$pgr_nagios_stat["created"] = 0;
+	$tpl->display("include/common/legend.ihtml");
+	?>	
\ No newline at end of file
diff --git a/www/include/monitoring/status/serviceGrid.php b/www/include/monitoring/status/serviceGrid.php
new file mode 100644
index 0000000000000000000000000000000000000000..e0c691e4abbffd3cef97a45655a208b4cc381be2
--- /dev/null
+++ b/www/include/monitoring/status/serviceGrid.php
@@ -0,0 +1,75 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	$hg = array();
+	$h_data = array();
+	$svc_data = array();
+
+	$ret =& $pearDB->query("SELECT * FROM hostgroup WHERE hg_activate = '1' ORDER BY hg_name");
+	while ($r =& $ret->fetchRow()){
+		$hg[$r["hg_name"]] = array("name" => $r["hg_name"], 'alias' => $r["hg_alias"], "host" => array());
+		$ret_h =& $pearDB->query(	"SELECT host_host_id, host_name, host_alias FROM hostgroup_relation,host,hostgroup ".
+									"WHERE hostgroup_hg_id = '".$r["hg_id"]."' AND hostgroup.hg_id = hostgroup_relation.hostgroup_hg_id ".
+									"AND hostgroup_relation.host_host_id = host.host_id AND host.host_register = '1' AND hostgroup.hg_activate = '1'");
+		$cpt = 0;
+		while ($r_h =& $ret_h->fetchRow()){
+			$hg[$r["hg_name"]]["host"][$cpt] = $r_h["host_name"];
+			$service_data_str = NULL;
+			$host_data_str = "<a href='./oreon.php?p=201&o=hd&host_name=".$r_h["host_name"]."'>" . $r_h["host_name"] . "</a> (" . $r_h["host_alias"] . ")";
+			if (isset($tab_host_service[$r_h["host_name"]]))
+				foreach ($tab_host_service[$r_h["host_name"]] as $key => $value){
+					$service_data_str .= 	"<span style='background:".
+											$oreon->optGen["color_".strtolower($service_status[$r_h["host_name"]."_".$key]["status"])]."'>".
+											"<a href='./oreon.php?p=202&o=svcd&host_name=".$r_h["host_name"]."&service_description=".$key."'>".$key.
+											"</a></span> &nbsp;&nbsp;";
+				}
+			$h_data[$r["hg_name"]][$r_h["host_name"]] = $host_data_str;
+			$svc_data[$r["hg_name"]][$r_h["host_name"]] = $service_data_str;
+			$cpt++;
+		}
+	}
+
+
+	if ($debug){
+		print "<textarea rows='20' cols='100'>";
+		print_r($status_hg);
+		print "</textarea>";
+		print "<textarea rows='20' cols='100'>";
+		print_r($status_hg_h);
+		print "</textarea>";
+	}
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "/templates/");
+
+	$tpl->assign("p", $p);
+	$tpl->assign("hostgroup", $hg);
+	$tpl->assign("h_data", $h_data);
+	$tpl->assign("lang", $lang);
+	$tpl->assign("svc_data", $svc_data);
+	$tpl->display("serviceGrid.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/status/serviceOverview.php b/www/include/monitoring/status/serviceOverview.php
new file mode 100644
index 0000000000000000000000000000000000000000..bde7d11689603dbcba0312738f56fc469d7b866b
--- /dev/null
+++ b/www/include/monitoring/status/serviceOverview.php
@@ -0,0 +1,85 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	$hg = array();
+	
+	$ret =& $pearDB->query("SELECT * FROM hostgroup WHERE hg_activate = '1' ORDER BY hg_name");
+	while ($r =& $ret->fetchRow()){
+		$hg[$r["hg_name"]] = array("name" => $r["hg_name"], 'alias' => $r["hg_alias"], "host" => array());
+		$ret_h =& $pearDB->query(	"SELECT host_host_id, host_name, host_alias FROM hostgroup_relation,host,hostgroup ".
+									"WHERE hostgroup_hg_id = '".$r["hg_id"]."' AND hostgroup.hg_id = hostgroup_relation.hostgroup_hg_id ".
+									"AND hostgroup_relation.host_host_id = host.host_id AND host.host_register = '1' AND hostgroup.hg_activate = '1'");
+		$cpt = 0;
+		
+		while ($r_h =& $ret_h->fetchRow()){
+			$hg[$r["hg_name"]]["host"][$cpt] = $r_h["host_name"];
+			$service_data_str = NULL;	
+			$host_data_str = "<a href='./oreon.php?p=201&o=hd&host_name=".$r_h["host_name"]."'>" . $r_h["host_name"] . "</a> (" . $r_h["host_alias"] . ")";
+			if(isset($tab_host_service[$r_h["host_name"]]))
+			{
+				foreach ($tab_host_service[$r_h["host_name"]] as $key => $value){
+					$service_data_str .= 	"<span style='background:".
+											$oreon->optGen["color_".strtolower($service_status[$r_h["host_name"]."_".$key]["status"])]."'>".
+											"<a href='./oreon.php?p=202&o=svcd&host_name=".$r_h["host_name"]."&service_description=".$key."'>".$key.
+											"</a></span> &nbsp;&nbsp;";
+				}
+				$h_data[$r["hg_name"]][$r_h["host_name"]] = $host_data_str;
+				$status = "color_".strtolower($host_status[$r_h["host_name"]]["status"]);
+				$h_status_data[$r["hg_name"]][$r_h["host_name"]] = "<td class='ListColCenter' style='background:".$oreon->optGen[$status]."'>".$host_status[$r_h["host_name"]]["status"]."</td>";
+				$svc_data[$r["hg_name"]][$r_h["host_name"]] = $service_data_str;
+				$cpt++;
+			}
+		}
+	}
+	
+	
+	if ($debug){
+		print "<textarea rows='20' cols='100'>";
+		print_r($status_hg);
+		print "</textarea>";
+		print "<textarea rows='20' cols='100'>";
+		print_r($status_hg_h);
+		print "</textarea>";
+	}
+		
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "/templates/");
+
+	
+	$tpl->assign("p", $p);
+	$tpl->assign("hostgroup", $hg);
+	if (isset($h_data))
+		$tpl->assign("h_data", $h_data);
+	if (isset($h_status_data))
+		$tpl->assign("h_status_data", $h_status_data);
+	$tpl->assign("lang", $lang);
+	if(isset($svc_data))
+		$tpl->assign("svc_data", $svc_data);
+
+
+	$tpl->display("serviceOverview.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/status/serviceSchedule.php b/www/include/monitoring/status/serviceSchedule.php
new file mode 100644
index 0000000000000000000000000000000000000000..d1a51e962c2a659e376d1f0defad91e1319987df
--- /dev/null
+++ b/www/include/monitoring/status/serviceSchedule.php
@@ -0,0 +1,80 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+
+	$color_en = array("1" => "#00ff00", "0" => "#ff0000");
+	$color_en_label = array("1" => $lang['enable'], "0" => $lang['disable']);
+?>
+<div align="center"><?
+	$tab_class = array("0" => "list_one", "1" => "list_two");
+	$c = 0;
+	if (isset($service_status))
+		foreach ($service_status as $name => $svc){
+			$service_status[$name]["status"] = $svc["status"];
+			$service_status[$name]["last_check"] = date($lang["date_time_format_status"], $svc["last_check"]);
+			$service_status[$name]["next_check"] = date($lang["date_time_format_status"], $svc["next_check"]);
+			$service_status[$name]["checks_en"] = $svc["checks_en"];
+			$service_status[$name]["class"] = $tab_class[$c % 2];
+			$c++;
+		}
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "/templates/");
+	
+	$lang['mon_host'] = "Hosts";
+	$tpl->assign("p", $p);
+	$tpl->assign("mon_host", $lang['mon_host']);
+	$tpl->assign("mon_status", $lang['mon_status']);
+	$tpl->assign("mon_ip", $lang['mon_ip']); 
+	$tpl->assign("mon_last_check", $lang['mon_last_check']); 
+	$tpl->assign("mon_duration", $lang['mon_duration']);
+	$tpl->assign("mon_status_information", $lang['mon_status_information']); 
+	if (isset($service_status))
+		$tpl->assign("service_status", $service_status);
+	if (!isset($_GET["sort_types"]))
+		$_GET["sort_types"] = "next_check";
+	$tpl->assign("sort_type", $_GET["sort_types"]);
+	if (!isset($_GET["order"]))
+		$_GET["order"] = "sort_asc";
+	
+	!isset($_GET["num"]) ? $begin = 0 : $begin = $_GET["num"];
+	!isset($_GET["limit"]) ? $nb = 20 : $nb = $begin + $_GET["limit"];
+
+	isset($_GET["host_name"]) ? $host_name = $_GET["host_name"] : $host_name = NULL;
+	$tpl->assign("host_name", $host_name);
+	isset($_GET["status"]) ? $status = $_GET["status"] : $status = NULL;
+	$tpl->assign("status", $status);
+
+	$tpl->assign("begin", $begin);
+	$tpl->assign("end", $nb);
+	$tpl->assign("lang", $lang);
+	$tpl->assign("color_en", $color_en);
+	$tpl->assign("color_en_label", $color_en_label);
+	$tpl->assign("order", $_GET["order"]);
+	$tab_order = array("sort_asc" => "sort_desc", "sort_desc" => "sort_asc"); 
+	$tpl->assign("tab_order", $tab_order);
+	$tpl->display("serviceSchedule.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+?>	
+</div>
\ No newline at end of file
diff --git a/www/include/monitoring/status/serviceSummary.php b/www/include/monitoring/status/serviceSummary.php
new file mode 100644
index 0000000000000000000000000000000000000000..0b0e485b1e9e7d45d97ef0f1d81b33e789cff163
--- /dev/null
+++ b/www/include/monitoring/status/serviceSummary.php
@@ -0,0 +1,100 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+
+	if (!isset($oreon))
+		exit();
+	
+	$hg = array();
+	$status_hg = array();
+		
+	$ret =& $pearDB->query("SELECT * FROM hostgroup WHERE hg_activate = '1' ORDER BY hg_name");
+	while ($r =& $ret->fetchRow()){
+		$hg[$r["hg_name"]] = array("name" => $r["hg_name"], 'alias' => $r["hg_alias"], "host" => array());
+		$ret_h =& $pearDB->query(	"SELECT host_host_id, host_name, host_alias FROM hostgroup_relation,host,hostgroup ".
+									"WHERE hostgroup_hg_id = '".$r["hg_id"]."' AND hostgroup.hg_id = hostgroup_relation.hostgroup_hg_id ".
+									"AND hostgroup_relation.host_host_id = host.host_id AND host.host_register = '1' AND hostgroup.hg_activate = '1'");
+		$cpt = 0;
+		
+		while ($r_h =& $ret_h->fetchRow()){
+			$status_hg["OK"] = 0;
+			$status_hg["PENDING"] = 0;
+			$status_hg["WARNING"] = 0;
+			$status_hg["CRITICAL"] = 0;
+			$status_hg["UNKNOWN"] = 0;
+			
+			$hg[$r["hg_name"]]["host"][$cpt] = $r_h["host_name"];
+			$service_data_str = NULL;	
+			
+			$host_data_str = "<a href='./oreon.php?p=201&o=hd&host_name=".$r_h["host_name"]."'>" . $r_h["host_name"] . "</a> (" . $r_h["host_alias"] . ")";
+			if(isset($tab_host_service[$r_h["host_name"]]))
+			{
+					foreach ($tab_host_service[$r_h["host_name"]] as $key => $value)
+						$status_hg[$service_status[$r_h["host_name"]. "_" .$key]["status"]]++;
+					
+					$service_data_str = "";
+					if ($status_hg["OK"] != 0)
+						$service_data_str = "<span style='background:".$oreon->optGen["color_ok"]."'>" . $status_hg["OK"] . " <a href='./oreon.php?p=".$p."&host_name=".$r_h["host_name"]."&status=OK'>OK</a></span> ";
+					if ($status_hg["WARNING"] != 0)
+						$service_data_str .= "<span style='background:".$oreon->optGen["color_warning"]."'>" . $status_hg["WARNING"] . " <a href='./oreon.php?p=".$p."&host_name=".$r_h["host_name"]."&status=WARNING'>WARNING</a></span> ";
+					if ($status_hg["CRITICAL"] != 0)
+						$service_data_str .= "<span style='background:".$oreon->optGen["color_critical"]."'>" . $status_hg["CRITICAL"] . " <a href='./oreon.php?p=".$p."&host_name=".$r_h["host_name"]."&status=CRITICAL'>CRITICAL</a></span> ";
+					if ($status_hg["PENDING"] != 0)
+						$service_data_str .= "<span style='background:".$oreon->optGen["color_pending"]."'>" . $status_hg["PENDING"] . " <a href='./oreon.php?p=".$p."&host_name=".$r_h["host_name"]."&status=PENDING'>PENDING</a></span> ";
+					if ($status_hg["UNKNOWN"] != 0)
+						$service_data_str .= "<span style='background:".$oreon->optGen["color_unknown"]."'>" . $status_hg["UNKNOWN"] . " <a href='./oreon.php?p=".$p."&host_name=".$r_h["host_name"]."&status=UNKNOWN'>UNKNOWN</a></span> ";
+					
+					$h_data[$r["hg_name"]][$r_h["host_name"]] = $host_data_str;
+					$status = "color_".strtolower($host_status[$r_h["host_name"]]["status"]);
+					$h_status_data[$r["hg_name"]][$r_h["host_name"]] = "<td class='ListColCenter' style='background:".$oreon->optGen[$status]."'><a href='./oreon.php?p=".$p."&host_name=".$r_h["host_name"]."'>".$host_status[$r_h["host_name"]]["status"]."</a></td>";
+					$svc_data[$r["hg_name"]][$r_h["host_name"]] = $service_data_str;
+					$cpt++;
+			}
+		}
+	}
+	
+	
+	if ($debug){
+		print "<textarea rows='20' cols='100'>";
+		print_r($status_hg);
+		print "</textarea>";
+		print "<textarea rows='20' cols='100'>";
+		print_r($status_hg_h);
+		print "</textarea>";
+	}
+		
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "/templates/");
+	
+	$tpl->assign("p", $p);
+	//$tpl->assign("view", $lang["m_mon_view"]);
+	$tpl->assign("hostgroup", $hg);
+	if (isset($h_data))
+		$tpl->assign("h_data", $h_data);
+	if (isset($h_status_data))
+		$tpl->assign("h_status_data", $h_status_data);
+	if (isset($svc_data))
+		$tpl->assign("svc_data", $svc_data);
+	$tpl->assign("lang", $lang);
+	$tpl->display("serviceSummary.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/status/service_problem.php b/www/include/monitoring/status/service_problem.php
new file mode 100644
index 0000000000000000000000000000000000000000..b29edf37bfebb1bd98351b1723d0af367f98d800
--- /dev/null
+++ b/www/include/monitoring/status/service_problem.php
@@ -0,0 +1,63 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+?>
+<div align="center"><?
+	$tab_class = array("0" => "list_one", "1" => "list_two");
+	$cpt = 0;
+	if (isset($service_status))
+		foreach ($service_status as $name => $svc){
+			$service_status[$name]["status_td"] = "<td class='ListColCenter' bgcolor='" . $oreon->optGen["color_".strtolower($svc["status"])] . "'>" . $svc["status"] . "</td>";
+			$service_status[$name]["last_check"] = date($lang["date_time_format_status"], $svc["last_check"]);
+			$service_status[$name]["last_change"] = Duration::toString(time() - $svc["last_change"]);
+			$service_status[$name]["class"] = $tab_class[$cpt % 2];
+			$cpt++;
+		}
+	else
+		$service_status = array();
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "/templates/");
+	
+	$lang['mon_host'] = "Hosts";
+	$tpl->assign("p", $p);
+	$tpl->assign("mon_host", $lang['mon_host']);
+	$tpl->assign("mon_status", $lang['mon_status']);
+	$tpl->assign("mon_ip", $lang['mon_ip']); 
+	$tpl->assign("mon_last_check", $lang['mon_last_check']); 
+	$tpl->assign("mon_duration", $lang['mon_duration']);
+	$tpl->assign("mon_status_information", $lang['mon_status_information']); 
+	$tpl->assign("service_status", $service_status);
+	if (!isset($_GET["sort_types"]))
+		$_GET["sort_types"] = "host_name";
+	$tpl->assign("sort_type", $_GET["sort_types"]);
+	if (!isset($_GET["order"]))
+		$_GET["order"] = "sort_asc";
+	$tpl->assign("order", $_GET["order"]);
+	$tab_order = array("sort_asc" => "sort_desc", "sort_desc" => "sort_asc"); 
+	$tpl->assign("tab_order", $tab_order);
+	$tpl->assign("lang", $lang);
+	$tpl->display("service_problem.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+	?>	
+</div>
\ No newline at end of file
diff --git a/www/include/monitoring/status/templates/host.ihtml b/www/include/monitoring/status/templates/host.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..4534f4d1755447b3b6c7d476ba9c7b5ff64cce0d
--- /dev/null
+++ b/www/include/monitoring/status/templates/host.ihtml
@@ -0,0 +1,35 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form method="GET" action="">
+<input name="p" value="{$p}" type="hidden">
+<table id="ListTable">
+	<tr class='ListHeader'>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_typeh=host_name&order=sort_asc'>{ $mon_host }</a>&nbsp;{if $sort_type == "host_name"}<a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_typeh=host_name&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+	 	<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_typeh=status&order=sort_asc'>{$lang.m_mon_status}</a>&nbsp;{if $sort_type == "status"}<a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_typeh=status&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_typeh=address&order=sort_asc'>{ $lang.m_mon_address_ip }</a>&nbsp;{if $sort_type == "address"}<a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_typeh=address&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_typeh=last_check&order=sort_asc'>{ $mon_last_check }</a>&nbsp;{if $sort_type == "last_check"}<a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_typeh=last_check&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_typeh=last_stat&order=sort_asc'>{ $mon_duration }</a&nbsp;{if $sort_type == "last_stat"}<a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_typeh=last_stat&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_typeh=output&order=sort_asc'>{ $mon_status_information }</a>&nbsp;{if $sort_type == "output"}<a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_typeh=output&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+	</tr>
+	{ foreach item=h from=$host_status }
+		<tr class="{$h.class}">
+			<td class="ListColLeft"><a href='oreon.php?p=201&o=hd&host_name={$h.name}'>{ $h.name }</a></td>
+			{ $h.status_td }
+			<td class="ListColCenter">{ $h.address }</td>
+			<td class="ListColRight">{ $h.last_check }</td>
+			<td class="ListColRight">{ $h.last_stat }</td>
+			<td class="ListColNoWrap">{ $h.output}{ $t}</td>
+		</tr>
+	{/foreach}
+</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+
+</form>
\ No newline at end of file
diff --git a/www/include/monitoring/status/templates/host_problem.ihtml b/www/include/monitoring/status/templates/host_problem.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..a56e59a4d076d68311800c23ca05b3755aac90a7
--- /dev/null
+++ b/www/include/monitoring/status/templates/host_problem.ihtml
@@ -0,0 +1,26 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form method="GET" action="">
+<input name="p" value="{$p}" type="hidden">
+<table id="ListTable">
+	<tr class='ListHeader'>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=hpb&sort_typeh=host_name&order=sort_asc'>{ $mon_host }</a>&nbsp;{if $sort_type == "host_name"}<a href='./oreon.php?p={$p}&o=hpb&sort_typeh=host_name&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+	 	<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=hpb&sort_typeh=status&order=sort_asc'>{$lang.m_mon_status}</a>&nbsp;{if $sort_type == "status"}<a href='./oreon.php?p={$p}&o=hpb&sort_typeh=status&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=hpb&sort_typeh=address&order=sort_asc'>{ $lang.m_mon_address_ip }</a>&nbsp;{if $sort_type == "address"}<a href='./oreon.php?p={$p}&o=hpb&sort_typeh=address&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=hpb&sort_typeh=last_check&order=sort_asc'>{ $mon_last_check }</a>&nbsp;{if $sort_type == "last_check"}<a href='./oreon.php?p={$p}&o=hpb&sort_typeh=last_check&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=hpb&sort_typeh=last_stat&order=sort_asc'>{ $mon_duration }</a&nbsp;{if $sort_type == "last_stat"}<a href='./oreon.php?p={$p}&o=hpb&sort_typeh=last_stat&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=hpb&sort_typeh=output&order=sort_asc'>{ $mon_status_information }</a>&nbsp;{if $sort_type == "output"}<a href='./oreon.php?p={$p}&o=hpb&sort_typeh=output&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+	</tr>
+	{ foreach item=h from=$host_status }
+	{if ($h.status ne "UP")}
+		<tr class="{$h.class}">
+			<td class="ListColLeft"><a href='./oreon.php?p=201&o=hd&host_name={$h.name}'>{ $h.name }</a></td>
+			{ $h.status_td }
+			<td class="ListColCenter">{ $h.address }</td>
+			<td class="ListColRight">{ $h.last_check }</td>
+			<td class="ListColRight">{ $h.last_stat }</td>
+			<td class="ListColNoWrap">{ $h.output}{ $t}</td>
+		</tr>
+	{/if}
+	{/foreach}
+</table>
+</form>
\ No newline at end of file
diff --git a/www/include/monitoring/status/templates/hostgroup.ihtml b/www/include/monitoring/status/templates/hostgroup.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..0c19eba8ae6f3adb8d6704fa54a8242f2773b470
--- /dev/null
+++ b/www/include/monitoring/status/templates/hostgroup.ihtml
@@ -0,0 +1,19 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<div>
+	<table id="ListTable">	
+		<tr class='ListHeader'>
+			<td>{$lang.m_mon_hostgroup}</td>
+			<td>{$lang.m_mon_host_stt_ttl}</td>
+			<td>{$lang.m_mon_svc_stt_ttl}</td>
+		</tr>
+		{foreach item=hg from=$hg}
+		{if $hg.host_stats != "" && $hg.svc_stats}
+		<tr class="{$hg.class}">
+			<td>{$hg.name} ({$hg.alias})</td>
+			<td>{$hg.host_stats}</td>
+			<td>{$hg.svc_stats}</td>
+		</tr>
+		{/if}
+		{/foreach}
+	</table>
+</div>
\ No newline at end of file
diff --git a/www/include/monitoring/status/templates/metaService.ihtml b/www/include/monitoring/status/templates/metaService.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..f90f5269749ac2e34d5a3ca3f11e2666adec6303
--- /dev/null
+++ b/www/include/monitoring/status/templates/metaService.ihtml
@@ -0,0 +1,44 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form method="GET" action="">
+<input name="p" value="{$p}" type="hidden">
+<input name="o" value="meta" type="hidden">
+<table id="ListTable">
+	<tr class='ListHeader'>
+		<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=meta&sort_types=description&order=sort_asc'>{$lang.m_mon_services}</a>&nbsp;{if $sort_type == "description"}<a href='./oreon.php?p={$p}&o=meta&sort_types=description&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter">Actions</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=meta&sort_types=status&order=sort_asc'>{$lang.m_mon_status}</a>&nbsp;{if $sort_type == "status"}<a href='./oreon.php?p={$p}&o=meta&sort_types=status&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=meta&sort_types=last_check&order=sort_asc'>{ $mon_last_check }</a>&nbsp;{if $sort_type == "last_check"}<a href='./oreon.php?p={$p}&o=meta&sort_types=last_check&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=meta&sort_types=next_check&order=sort_asc'>{ $mon_duration }</a&nbsp;{if $sort_type == "next_check"}<a href='./oreon.php?p={$p}&o=meta&sort_types=next_check&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=meta&sort_types=retry&order=sort_asc'>{$lang.m_mon_try}</a>&nbsp;{if $sort_type == "retry"}<a href='./oreon.php?p={$p}&o=meta&sort_types=retry&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'>{/if}</a></td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=meta&sort_types=output&order=sort_asc'>{ $mon_status_information }</a>&nbsp;{if $sort_type == "output"}<a href='./oreon.php?p={$p}&o=meta&sort_types=output&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+	</tr>
+	{ foreach item=s from=$metaService_status }
+	{if $s.real_name && $s.status}
+	<tr {if $s.status == CRITICAL}class="list_three"{else}class="{$s.class}"{/if}>
+		<td class="ListColPicker" width="10"><input name="select[{$s.host_name}:{$s.description}]" value="1" type="checkbox"></td>
+		<td class="ListColLeft">{ $s.real_name }</td>
+		<td class="ListColRight">
+			{if $s.checks_en == 0 && $s.accept_passive_check}<img src='./img/icones/14x14/gears_pause.gif'>{/if}
+			{if $s.checks_en == 0 && $s.accept_passive_check == 0}<img src='./img/icones/14x14/gears_stop.gif'>{/if}
+			{if $s.not_en}<img src='./img/icones/14x14/noloudspeaker.gif'>{/if}
+			<a href='./oreon.php?p={$p}&o=meta&cmd=2&select[{$s.host_name}:{$s.description}]=1'><img src='./img/icones/14x14/undo.gif' border='0'></a>
+			<a href='./oreon.php?p=40202&meta_service=meta_{ $s.id }&period=10800&step=0&submitC=Grapher'><img src='./img/icones/16x16/column-chart.gif'></a>
+		</td>
+		{ $s.status_td }
+		<td class="ListColRight">{ $s.last_check }</td>
+		<td class="ListColRight" align="right">{ $s.last_change }</td>
+		<td class="ListColCenter" align="center">{ $s.retry }</td>
+		<td class="ListColNoWrap">{ $s.output}{ $t}</td>
+	</tr>
+	{/if}
+	{/foreach}
+</table>
+<div style="text-align:left;padding-top:5px;">
+	<select name="cmd">
+		<option value="1">{$lang.m_mon_resubmit_im_checks}</option>
+		<option value="2">{$lang.m_mon_resubmit_im_checks_f}</option>
+	</select>
+	<input name="SubmitOptions" value="go" type="submit">
+</div>
+</form>
diff --git a/www/include/monitoring/status/templates/resume.ihtml b/www/include/monitoring/status/templates/resume.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..e04c7a1fab5a70a0f2fd30711d8591ca0cc662a2
--- /dev/null
+++ b/www/include/monitoring/status/templates/resume.ihtml
@@ -0,0 +1,45 @@
+<SCRIPT LANGUAGE='JavaScript'> setTimeout("javascript:history.go(0)","{$refresh}000")</SCRIPT>
+<table cellpadding="0" cellspacing="0" border="0">
+<tr>
+	<td>&nbsp;</td>
+	<td>
+		<table id="ListTableSmall">
+			<tr class='ListHeader'>
+				<td>{$lang.m_mon_hosts_status}</td>
+				<td>{$lang.m_mon_up}</td>
+				<td>{$lang.m_mon_down}</td>
+				<td>{$lang.m_mon_unreachable}</td>
+				<td>{$lang.m_mon_pending}</td>
+			</tr>
+			<tr style="text-align:center;">
+				<td>&nbsp;</td>
+				<td{if $statistic_host.UP != 0}{$statistic_host_color.UP}{/if}>{$statistic_host.UP}</td>
+				<td{if $statistic_host.DOWN != 0}{$statistic_host_color.DOWN}{/if}>{$statistic_host.DOWN}</td>
+				<td{if $statistic_host.UNREACHABLE != 0}{$statistic_host_color.UNREACHABLE}{/if}>{$statistic_host.UNREACHABLE}</td>
+				<td{if $statistic_host.PENDING != 0}{$statistic_host_color.PENDING}{/if}>{$statistic_host.PENDING}</td>
+			</tr>
+		</table>
+	</td>
+	<td>&nbsp;</td>
+	<td>
+		<table id="ListTableSmall">
+			<tr class='ListHeader'>
+				<td>{$lang.m_mon_services_status}</td>
+				<td>{$lang.m_mon_ok}</td>
+				<td>{$lang.m_mon_warning}</td>
+				<td>{$lang.m_mon_critical}</td>
+				<td>{$lang.m_mon_pending}</td>
+				<td>{$lang.m_mon_unknown}</td>		
+			</tr>
+			<tr style="text-align:center;">
+				<td>&nbsp;</td>
+				<td{if $statistic_service.OK != 0}{$statistic_service_color.OK}{/if}>{$statistic_service.OK}</td>
+				<td{if $statistic_service.WARNING != 0}{$statistic_service_color.WARNING}{/if}>{$statistic_service.WARNING}</td>
+				<td{if $statistic_service.CRITICAL != 0}{$statistic_service_color.CRITICAL}{/if}>{$statistic_service.CRITICAL}</td>
+				<td{if $statistic_service.PENDING != 0}{$statistic_service_color.PENDING}{/if}>{$statistic_service.PENDING}</td>
+				<td{if $statistic_service.UNKNOWN != 0}{$statistic_service_color.UNKNOWN}{/if}>{$statistic_service.UNKNOWN}</td>
+			</tr>
+		</table>
+	</td>
+</tr>
+</table>
\ No newline at end of file
diff --git a/www/include/monitoring/status/templates/service.ihtml b/www/include/monitoring/status/templates/service.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..76c1ea7b439cab2f7aabc4a4f2c0568c7e8db7fd
--- /dev/null
+++ b/www/include/monitoring/status/templates/service.ihtml
@@ -0,0 +1,70 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form method="GET" action="">
+<input name="p" value="{$p}" type="hidden">
+<input name="o" value="svc" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+</form>
+<form method="GET" action="">
+<input name="p" value="{$p}" type="hidden">
+<input name="o" value="svc" type="hidden">
+<table id="ListTable">
+	<tr class='ListHeader'>
+		<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_types=host_name&order=sort_asc'>{$lang.m_mon_hosts}</a>&nbsp;{if $sort_type == "host_name"}<a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_types=host_name&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+	 	<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_types=description&order=sort_asc'>{$lang.m_mon_services}</a>&nbsp;{if $sort_type == "description"}<a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_types=description&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter">Actions</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_types=status&order=sort_asc'>{$lang.m_mon_status}</a>&nbsp;{if $sort_type == "status"}<a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_types=status&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_types=last_check&order=sort_asc'>{ $mon_last_check }</a>&nbsp;{if $sort_type == "last_check"}<a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_types=last_check&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_types=next_check&order=sort_asc'>{ $mon_duration }</a&nbsp;{if $sort_type == "next_check"}<a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_types=next_check&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_types=retry&order=sort_asc'>{$lang.m_mon_try}</a>&nbsp;{if $sort_type == "retry"}<a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_types=retry&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'>{/if}</a></td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_types=output&order=sort_asc'>{ $mon_status_information }</a>&nbsp;{if $sort_type == "output"}<a href='./oreon.php?p={$p}&num={$num}&limit={$limit}&sort_types=output&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+	</tr>
+	{ foreach item=s from=$service_status }
+	{if (!$host_name && !$status) || ($host_name == $s.host_name && $status && $status == $s.status) || ($host_name == $s.host_name && !$status)}
+		<tr {if $s.status == CRITICAL}class="list_three"{else}class="{$s.class}"{/if}>
+			<td class="ListColPicker"><input name="select[{$s.host_name}:{$s.description}]" value="1" type="checkbox"></td>
+			{if $host == $s.host_name}
+				<td class="ListColLeft">&nbsp;</td>
+			{elseif $host != $s.host_name}	
+				<td class="ListColLeft"><a href='./oreon.php?p=201&o=hd&host_name={$s.host_name}'>{ $s.host_name }</a></td>
+			{/if}
+			<td class="ListColLeft"><a href='./oreon.php?p=202&o=svcd&host_name={$s.host_name}&service_description={$s.description}'>{ $s.description }</a></td>
+			<td class="ListColRight">
+				{if $s.pb_aknowledged == 1}<img src='./img/icones/16x16/worker.gif'>{/if}
+				{if $s.checks_en == 0 && $s.accept_passive_check}<img src='./img/icones/14x14/gears_pause.gif'>{/if}
+				{if $s.checks_en == 0 && $s.accept_passive_check == 0}<img src='./img/icones/14x14/gears_stop.gif'>{/if}
+				{if $s.not_en == 0}<img src='./img/icones/14x14/noloudspeaker.gif'>{/if}
+				<a href='./oreon.php?p={$p}&o=svc&cmd=2&select[{$s.host_name}:{$s.description}]=1'><img src='./img/icones/14x14/undo.gif' border='0'></a>
+				<a href='./oreon.php?p=40207&host_name={ $s.host_name }&service_description={$s.description}&submitC=Grapher'><img src='./img/icones/16x16/column-chart.gif'></a>
+			</td>
+			{ $s.status_td }
+			<td class="ListColRight">{ $s.last_check }</td>
+			<td class="ListColRight" align="right">{ $s.last_change }</td>
+			<td class="ListColCenter" align="center">{ $s.retry }</td>
+			<td class="ListColNoWrap">{ $s.output}{ $t}</td>
+		</tr>
+		{assign var="host" value=$s.host_name}
+		{/if}
+	{/foreach}
+</table>
+
+{php}
+   include('./include/common/pagination.php');
+{/php}
+
+
+
+
+<div style="text-align:left;padding-top:5px;">
+	<select name="cmd">
+		<option value="1">{$lang.m_mon_resubmit_im_checks}</option>
+		<option value="2">{$lang.m_mon_resubmit_im_checks_f}</option>
+	</select>
+	<input name="SubmitOptions" value="go" type="submit">
+</div>
+{if $pgr_nagios_stat.created != 0}
+	<font style="text-align:center">&nbsp;&nbsp;&nbsp;Last update : {$pgr_nagios_stat.created}</font>
+{/if}
+</form>
diff --git a/www/include/monitoring/status/templates/serviceGrid.ihtml b/www/include/monitoring/status/templates/serviceGrid.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..06c7d452eb637fda205f8088b67fc7d6aa82ac09
--- /dev/null
+++ b/www/include/monitoring/status/templates/serviceGrid.ihtml
@@ -0,0 +1,24 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<div>
+	{foreach key=hg_name item=hstg from=$hostgroup}
+	<table id="ListTable">	
+		<tr class='list_lvl_1'>
+			<td class='ListColHeaderLeft' colspan="4">
+				{$lang.m_mon_hostgroup}{$hg_name} ({$hostgroup.$hg_name.alias})
+			</td>
+		</tr>		<tr class='ListHeader'>
+			<td class='ListColHeaderLeft'>{$lang.m_mon_hosts}</td>
+			<td class='ListColHeaderLeft'>{$lang.m_mon_services}</td>
+		</tr>
+		{foreach item=host_list from=$hostgroup.$hg_name.host}
+		{if $svc_data.$hg_name.$host_list }
+			<tr class="{cycle values="list_one,list_two"}">
+				<td>{$h_data.$hg_name.$host_list}</td>
+				<td>{$svc_data.$hg_name.$host_list}</td>
+			</tr>
+		{/if}
+		{/foreach}
+	</table>
+	<br>
+	{/foreach}
+</div>
\ No newline at end of file
diff --git a/www/include/monitoring/status/templates/serviceOverview.ihtml b/www/include/monitoring/status/templates/serviceOverview.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..049f7a5fdbf99f3bdcc316330147fd42819855ee
--- /dev/null
+++ b/www/include/monitoring/status/templates/serviceOverview.ihtml
@@ -0,0 +1,29 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<div>
+	{foreach key=hg_name item=hstg from=$hostgroup}
+
+	<table id="ListTable">
+		<tr class='list_lvl_1'>
+			<td class='ListColHeaderLeft' colspan="4">	{$lang.m_mon_hostgroup}{$hg_name} ({$hostgroup.$hg_name.alias})</td>
+		</tr>
+		<tr class='ListHeader'>
+			<td class='ListColHeaderLeft'>{$lang.m_mon_hosts}</td>
+			<td class='ListColHeaderLeft'>{$lang.m_mon_status}</td>
+			<td class='ListColHeaderLeft'>{$lang.m_mon_services}</td>
+			<td class='ListColHeaderLeft'>{$lang.mon_actions}</td>
+		</tr>
+		{foreach item=host_list from=$hostgroup.$hg_name.host}
+		{if $svc_data.$hg_name.$host_list }
+			<tr class="{cycle values="list_one,list_two"}">
+				<td class="ListColLeft">{$h_data.$hg_name.$host_list}</td>
+				{$h_status_data.$hg_name.$host_list}
+				<td class="ListColLeft">{$svc_data.$hg_name.$host_list}</td>
+				<td class="ListColLeft"><a href="./oreon.php?p={$p}&host_name={$host_list}"><img src='img/icones/16x16/view.gif' border='0' alt='{$view}'></a></td>
+
+			</tr>
+		{/if}
+		{/foreach}
+	</table>
+	<br>
+	{/foreach}
+</div>
\ No newline at end of file
diff --git a/www/include/monitoring/status/templates/serviceSchedule.ihtml b/www/include/monitoring/status/templates/serviceSchedule.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..13922a2d09b94140e5188b6126542b0c6b17b348
--- /dev/null
+++ b/www/include/monitoring/status/templates/serviceSchedule.ihtml
@@ -0,0 +1,43 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form method="GET" action="">
+<input name="p" value="{$p}" type="hidden">
+<input name="o" value="svc" type="hidden">
+<table id="ListTable">
+	<tr class='ListHeader'>
+		<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+		<td class="ListColHeaderCenter">{$lang.m_mon_hosts}</td>
+	 	<td class="ListColHeaderCenter">{$lang.m_mon_services}</td>
+		<td class="ListColHeaderCenter">Actions</td>
+		<td class="ListColHeaderCenter">{ $lang.m_mon_next_check }</td>
+		<td class="ListColHeaderCenter">{ $mon_last_check }</td>
+		<td class="ListColHeaderCenter">Active Checks</td>
+	</tr>
+	{ foreach item=s from=$service_status }
+	{if (!$host_name && !$status) || ($host_name == $s.host_name && $status && $status == $s.status) || ($host_name == $s.host_name && !$status)}
+		<tr {if $s.status == CRITICAL}class="list_three"{else}class="{$s.class}"{/if}>
+			<td class="ListColPicker" width="10"><input name="select[{$s.host_name}:{$s.description}]" value="1" type="checkbox"></td>
+			<td class="ListColLeft"><a href='./oreon.php?p=201&o=hd&host_name={$s.host_name}'>{ $s.host_name }</a></td>
+			<td class="ListColLeft"><a href='./oreon.php?p=202&o=svcd&host_name={$s.host_name}&service_description={$s.description}'>{ $s.description }</a></td>
+			<td class="ListColRight">
+				{if $s.checks_en == 0 && $s.accept_passive_check}<img src='./img/icones/14x14/gears_pause.gif'>{/if}
+				{if $s.checks_en == 0 && $s.accept_passive_check == 0}<img src='./img/icones/14x14/gears_stop.gif'>{/if}
+				{if $s.not_en == 0}<img src='./img/icones/14x14/noloudspeaker.gif'>{/if}
+				<a href='./oreon.php?p={$p}&o=svcSch&cmd=2&select[{$s.host_name}:{$s.description}]=1'><img src='./img/icones/14x14/undo.gif' border='0'></a>
+				<a href='./oreon.php?p=40207&host_name={ $s.host_name }&service_description={$s.description}&period=10800&step=0&submitC=Grapher'><img src='./img/icones/16x16/column-chart.gif'></a>
+			</td>
+			{ $s.status_td }
+			<td class="ListColRight" align="right">{ $s.next_check }</td>
+			<td class="ListColRight">{ $s.last_check }</td>
+			<td class="ListColHeaderCenter" style='background-color:{$color_en[$s.checks_en]};'>{$color_en_label[$s.checks_en]}</td>
+		</tr>
+		{/if}
+	{/foreach}
+</table>
+<div style="text-align:left;padding-top:5px;">
+	<select name="cmd">
+		<option value="1">{$lang.m_mon_resubmit_im_checks}</option>
+		<option value="2">{$lang.m_mon_resubmit_im_checks_f}</option>
+	</select>
+	<input name="SubmitOptions" value="go" type="submit">
+</div>
+</form>
diff --git a/www/include/monitoring/status/templates/serviceSummary.ihtml b/www/include/monitoring/status/templates/serviceSummary.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..531cdfd76b0cea63e692f4c78fc8dddf3d2dc4cd
--- /dev/null
+++ b/www/include/monitoring/status/templates/serviceSummary.ihtml
@@ -0,0 +1,29 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<div>
+	{foreach key=hg_name item=hstg from=$hostgroup}
+	<table id="ListTable">	
+		<tr class='list_lvl_1'>
+			<td class='ListColHeaderLeft' colspan="4">
+				{$lang.m_mon_hostgroup}{$hg_name} ({$hostgroup.$hg_name.alias})
+			</td>
+		</tr>
+		<tr class='ListHeader'>
+			<td class='ListColHeaderLeft'>{$lang.m_mon_hosts}</td>
+			<td class='ListColHeaderLeft'>{$lang.m_mon_status}</td>
+			<td class='ListColHeaderLeft'>{$lang.m_mon_hosts}</td>
+			<td class='ListColHeaderLeft'>{$lang.mon_actions}</td>
+		</tr>
+		{foreach item=host_list from=$hostgroup.$hg_name.host}
+		{if $svc_data.$hg_name.$host_list }
+			<tr class="{cycle values="list_one,list_two"}">
+				<td class="ListColLeft">{$h_data.$hg_name.$host_list}</td>
+				{$h_status_data.$hg_name.$host_list}
+				<td class="ListColLeft">{$svc_data.$hg_name.$host_list}</td>
+				<td class="ListColLeft"><a href="./oreon.php?p={$p}&host_name={$host_list}"><img src='img/icones/16x16/view.gif' border='0' alt='{$view}'></a></td>
+			</tr>
+		{/if}
+		{/foreach}
+	</table>
+	<br>
+	{/foreach}
+</div>
\ No newline at end of file
diff --git a/www/include/monitoring/status/templates/service_problem.ihtml b/www/include/monitoring/status/templates/service_problem.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..928a60ee9a88a055d1c9716d77926e526b5f5165
--- /dev/null
+++ b/www/include/monitoring/status/templates/service_problem.ihtml
@@ -0,0 +1,52 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form method="GET" action="">
+<input name="p" value="{$p}" type="hidden">
+<input name="o" value="svcpb" type="hidden">
+<table id="ListTable">
+	<tr class='ListHeader'>
+		<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=svcpb&sort_types=host_name&order=sort_asc'>{$lang.m_mon_hosts}</a>&nbsp;{if $sort_type == "host_name"}<a href='./oreon.php?p={$p}&o=svcpb&sort_types=host_name&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+	 	<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=svcpb&sort_types=description&order=sort_asc'>{$lang.m_mon_services}</a>&nbsp;{if $sort_type == "description"}<a href='./oreon.php?p={$p}&o=svcpb&sort_types=description&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter">Actions</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=svcpb&sort_types=status&order=sort_asc'>{$lang.m_mon_status}</a>&nbsp;{if $sort_type == "status"}<a href='./oreon.php?p={$p}&o=svcpb&sort_types=status&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=svcpb&sort_types=last_check&order=sort_asc'>{ $mon_last_check }</a>&nbsp;{if $sort_type == "last_check"}<a href='./oreon.php?p={$p}&o=svcpb&sort_types=last_check&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=svcpb&sort_types=next_check&order=sort_asc'>{ $mon_duration }</a&nbsp;{if $sort_type == "next_check"}<a href='./oreon.php?p={$p}&o=svcpb&sort_types=next_check&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=svcpb&sort_types=retry&order=sort_asc'>{$lang.m_mon_try}</a>&nbsp;{if $sort_type == "retry"}<a href='./oreon.php?p={$p}&o=svcpb&sort_types=retry&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'>{/if}</a></td>
+		<td class="ListColHeaderCenter"><a href='./oreon.php?p={$p}&o=svcpb&sort_types=output&order=sort_asc'>{ $mon_status_information }</a>&nbsp;{if $sort_type == "output"}<a href='./oreon.php?p={$p}&o=svcpb&sort_types=output&order={$tab_order.$order}'><img src='./img/icones/7x7/{$order}.gif'></a>{/if}</td>
+	</tr>
+	{ foreach item=s from=$service_status }
+	{if $s.status ne 'OK'}
+		<tr {if $s.status == CRITICAL}class="list_three"{else}class="{$s.class}"{/if}>
+			<td class="ListColPicker" width="10"><input name="select[{$s.host_name}:{$s.description}]" value="1" type="checkbox"></td>
+			{if $host == $s.host_name}
+				<td class="ListColLeft">&nbsp;</td>
+			{elseif $host != $s.host_name}	
+				<td class="ListColLeft"><a href='./oreon.php?p=201&o=hd&host_name={$s.host_name}'>{ $s.host_name }</a></td>
+			{/if}
+			<td class="ListColLeft"><a href='./oreon.php?p=202&o=svcd&host_name={$s.host_name}&service_description={$s.description}'>{ $s.description }</a></td>
+			<td class="ListColRight">
+				{if $s.pb_aknowledged == 1}<img src='./img/icones/16x16/worker.gif'>{/if}
+				{if $s.checks_en == 0 && $s.accept_passive_check}<img src='./img/icones/14x14/gears_pause.gif'>{/if}
+				{if $s.checks_en == 0 && $s.accept_passive_check == 0}<img src='./img/icones/14x14/gears_stop.gif'>{/if}
+				{if $s.not_en == 0}<img src='./img/icones/14x14/noloudspeaker.gif'>{/if}
+				<a href='./oreon.php?p={$p}&o=svc&cmd=2&select[{$s.host_name}:{$s.description}]=1'><img src='./img/icones/14x14/undo.gif' border='0'></a>
+				<a href='./oreon.php?p=40207&host_name={ $s.host_name }&service_description={$s.description}&submitC=Grapher'><img src='./img/icones/16x16/column-chart.gif'></a>
+			</td>
+			{ $s.status_td }
+			<td class="ListColRight">{ $s.last_check }</td>
+			<td class="ListColRight" align="right">{ $s.last_change }</td>
+			<td class="ListColCenter" align="center">{ $s.retry }</td>
+			<td class="ListColNoWrap">{ $s.output}{ $t}</td>
+		</tr>
+		{assign var="host" value=$s.host_name}
+	{/if}
+	{/foreach}
+</table>
+<div style="text-align:left;padding-top:5px;">
+	<select name="cmd">
+		<option value="1">{$lang.m_mon_resubmit_im_checks}</option>
+		<option value="2">{$lang.m_mon_resubmit_im_checks_f}</option>
+	</select>
+	<input name="SubmitOptions" value="go" type="submit">
+</div>
+</form>
diff --git a/www/include/monitoring/templates/AddHostComment.ihtml b/www/include/monitoring/templates/AddHostComment.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..0975e902cbbdb542ed13e89ef4493528019f9e9d
--- /dev/null
+++ b/www/include/monitoring/templates/AddHostComment.ihtml
@@ -0,0 +1,27 @@
+{$form.javascript}
+<div>
+	<form {$form.attributes}>
+		<table id="ListTable">
+			<tr class="ListHeader">
+				<td class="FormHeader" colspan="2">{$form.header.title}</td>
+			<tr>
+			<tr class="list_one">
+				<td>{$form.host_id.label}</td>
+				<td>{$form.host_id.html}</td>
+			</tr>
+			<tr class="list_one">
+				<td>{$form.persistant.label}</td>
+				<td>{$form.persistant.html}</td>
+			</tr>
+			<tr class="list_two">
+				<td>{$form.comment.label}</td>
+				<td>{$form.comment.html}</td>
+			</tr>
+		</table>		
+		<div id="validForm">
+			<p>{$form.action.html}</p>
+			<p>{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+		</div>
+		{$form.hidden}
+	</form>
+</div>
\ No newline at end of file
diff --git a/www/include/monitoring/templates/AddHostDowntime.ihtml b/www/include/monitoring/templates/AddHostDowntime.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..124a9bd03ad79a585ec2e7f5885d284897f77a6a
--- /dev/null
+++ b/www/include/monitoring/templates/AddHostDowntime.ihtml
@@ -0,0 +1,35 @@
+{$form.javascript}
+<div>
+	<form {$form.attributes}>
+		<table id="ListTable">
+			<tr class="ListHeader">
+				<td class="FormHeader" colspan="2">{$form.header.title}</td>
+			<tr>
+			<tr class="list_two">
+				<td>{$form.host_id.label}</td>
+				<td>{$form.host_id.html}</td>
+			</tr>
+			<tr class="list_one">
+				<td>{$form.persistant.label}</td>
+				<td>{$form.persistant.html}</td>
+			</tr>
+			<tr class="list_two">
+				<td>{$form.start.label}</td>
+				<td>{$form.start.html}</td>
+			</tr>
+			<tr class="list_one">
+				<td>{$form.end.label}</td>
+				<td>{$form.end.html}</td>
+			</tr>
+			<tr class="list_two">
+				<td>{$form.comment.label}</td>
+				<td>{$form.comment.html}</td>
+			</tr>
+		</table>		
+		<div id="validForm">
+			<p>{$form.action.html}</p>
+			<p>{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+		</div>
+		{$form.hidden}
+	</form>
+</div>
\ No newline at end of file
diff --git a/www/include/monitoring/templates/AddSvcComment.ihtml b/www/include/monitoring/templates/AddSvcComment.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..8b6ade3d35199a3eee54c12fc7ea479b39da4dce
--- /dev/null
+++ b/www/include/monitoring/templates/AddSvcComment.ihtml
@@ -0,0 +1,31 @@
+{$form.javascript}
+<div>
+	<form {$form.attributes}>
+		<table id="ListTable">
+			<tr class="ListHeader">
+				<td class="FormHeader" colspan="2">{$form.header.title}</td>
+			<tr>
+			<tr class="list_one">
+				<td>{$form.host_id.label}</td>
+				<td>{$form.host_id.html}</td>
+			</tr>
+			<tr class="list_two">
+				<td>{$form.service_id.label}</td>
+				<td>{$form.service_id.html}</td>
+			</tr>
+			<tr class="list_one">
+				<td>{$form.persistant.label}</td>
+				<td>{$form.persistant.html}</td>
+			</tr>
+			<tr class="list_two">
+				<td>{$form.comment.label}</td>
+				<td>{$form.comment.html}</td>
+			</tr>
+		</table>		
+		<div id="validForm">
+			<p>{$form.action.html}</p>
+			<p>{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+		</div>
+		{$form.hidden}
+	</form>
+</div>
\ No newline at end of file
diff --git a/www/include/monitoring/templates/AddSvcDowntime.ihtml b/www/include/monitoring/templates/AddSvcDowntime.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..42c8c96a378822e53b7e5173196d7961f2f44ba9
--- /dev/null
+++ b/www/include/monitoring/templates/AddSvcDowntime.ihtml
@@ -0,0 +1,40 @@
+{$form.javascript}
+<div>
+	<form {$form.attributes}>
+		<table id="ListTable">
+			<tr class="ListHeader">
+				<td class="FormHeader" colspan="2">{$form.header.title}</td>
+			<tr>
+			<tr class="list_one">
+				<td>{$form.host_id.label}</td>
+				<td>{$form.host_id.html}</td>
+			</tr>
+			<tr class="list_two">
+				<td>{$form.service_id.label}</td>
+				<td>{$form.service_id.html}</td>
+			</tr>
+			<tr class="list_one">
+				<td>{$form.persistant.label}</td>
+				<td>{$form.persistant.html}</td>
+			</tr>
+			<tr class="list_two">
+				<td>{$form.start.label}</td>
+				<td>{$form.start.html}</td>
+			</tr>
+			<tr class="list_one">
+				<td>{$form.end.label}</td>
+				<td>{$form.end.html}</td>
+			</tr>
+			<tr class="list_two">
+				<td>{$form.comment.label}</td>
+				<td>{$form.comment.html}</td>
+			</tr>
+			</tr>
+		</table>		
+		<div id="validForm">
+			<p>{$form.action.html}</p>
+			<p>{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+		</div>
+		{$form.hidden}
+	</form>
+</div>
\ No newline at end of file
diff --git a/www/include/monitoring/templates/comments.ihtml b/www/include/monitoring/templates/comments.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..2956e2e99b6b317192237c9579c4287237b3286c
--- /dev/null
+++ b/www/include/monitoring/templates/comments.ihtml
@@ -0,0 +1,64 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form action="" method='GET'>
+<hidden name="p" value='{$p}'>
+<br><br><span>{$lang.cmt_host_comment}</span><br><br>
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderCenter">{$lang.cmt_host_name}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_entry_time}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_author}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_comment}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_persistent}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_actions}</td>
+		</tr>
+		{foreach item=tch from=$tab_comments_host}
+		<tr class={cycle values="list_two, list_one"}>
+			<td class="ListColPicker"><input type="checkbox" name='select[{$tcs.id}]'></td>
+			<td class="ListColLeft">{$tch.host_name}</td>
+			<td class="ListColRight">{$tch.time}</td>
+			<td class="ListColCenter">{$tch.author}</td>
+			<td class="ListColLeft">{$tch.comment}</td>
+			<td class="ListColLeft">{$tch.persistent}</td>
+			<td class="ListColCenter"><a href='./oreon.php?p={$p}&o=dh&id={$tch.id}'><img src='./img/icones/16x16/delete.gif'></a></td>
+		</tr>
+		{/foreach}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">&nbsp;<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')"></td>
+			<td class="ListColFooterCenter" colspan="4">&nbsp;</td>
+			<td class="ListColFooterRight" align="right"><a href="{$msgh.addL}">{$msgh.addT}</a></td>
+		</tr>		
+	</table>
+	</form>
+	<br><br><span>{$lang.cmt_service_comment}</span><br><br>
+	<form action="" method='GET'>
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderCenter">{$lang.cmt_host_name}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_service_descr}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_entry_time}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_author}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_comment}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_persistent}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_actions}</td>
+		</tr>
+		{foreach item=tcs from=$tab_comments_svc}
+		<tr class={cycle values="list_two, list_one"}>
+			<td class="ListColPicker"><input type="checkbox" name='select[{$tcs.id}]'></td>
+			<td class="ListColLeft">{$tcs.host_name}</td>
+			<td class="ListColLeft">{$tcs.service_descr}</td>
+			<td class="ListColRight">{$tcs.time}</td>
+			<td class="ListColCenter">{$tcs.author}</td>
+			<td class="ListColLeft">{$tcs.comment}</td>
+			<td class="ListColLeft">{$tcs.persistent}</td>
+			<td class="ListColCenter"><a href='./oreon.php?p={$p}&o=ds&id={$tcs.id}'><img src='./img/icones/16x16/delete.gif'></a></td>
+		</tr>
+		{/foreach}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">&nbsp;<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')"></td>
+			<td class="ListColFooterCenter" colspan="5">&nbsp;</td>
+			<td class="ListColFooterRight" align="right"><a href="{$msgs.addL}">{$msgs.addT}</a></td>
+		</tr>	
+	</table>
+</form>
\ No newline at end of file
diff --git a/www/include/monitoring/templates/downtime.ihtml b/www/include/monitoring/templates/downtime.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..aaea59ddf69d81ebc4e2c9f120f905ed64a62936
--- /dev/null
+++ b/www/include/monitoring/templates/downtime.ihtml
@@ -0,0 +1,74 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form action="" method='GET'>
+<hidden name="p" value='{$p}'>
+<br><br><span>{$lang.dtm_host_downtimes}</span><br><br>
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderCenter">{$lang.cmt_host_name}</td>
+			<td class="ListColHeaderCenter">{$lang.dtm_start_time}</td>
+			<td class="ListColHeaderCenter">{$lang.dtm_end_time}</td>
+			<td class="ListColHeaderCenter">{$lang.dtm_duration}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_author}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_comment}</td>
+			<td class="ListColHeaderCenter">{$lang.dtm_fixed}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_actions}</td>
+		</tr>
+		{foreach item=tdh from=$tab_downtime_host}
+		<tr class={cycle values="list_two, list_one"}>
+			<td class="ListColPicker"><input type="checkbox" name='select[{$tdh.id};{$tdh.id_supp}]'></td>
+			<td class="ListColLeft">{$tdh.host_name}</td>
+			<td class="ListColRight">{$tdh.start}</td>
+			<td class="ListColRight">{$tdh.end}</td>
+			<td class="ListColRight">{$tdh.len}</td>
+			<td class="ListColCenter">{$tdh.author}</td>
+			<td class="ListColLeft">{$tdh.comment}</td>
+			<td class="ListColLeft">{$tdh.persistent}</td>
+			<td class="ListColCenter"><a href='./oreon.php?p={$p}&o=dh&select[{$tdh.id};{$tdh.id_supp}]'><img src='./img/icones/16x16/delete.gif'></a></td>
+		</tr>
+		{/foreach}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">&nbsp;<input type="image" name="o" value="dh" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msgh.delConfirm}')"></td>
+			<td class="ListColFooterCenter" colspan="6">&nbsp;</td>
+			<td class="ListColFooterRight" align="right"><a href="{$msgh.addL}">{$msgh.addT}</a></td>
+		</tr>		
+	</table>
+	{$form.hidden}
+	</form>
+	<br><br><span>{$lang.dtm_service_downtimes}</span><br><br>
+	<form action="" method='GET'>
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderCenter">{$lang.cmt_host_name}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_service_descr}</td>
+			<td class="ListColHeaderCenter">{$lang.dtm_start_time}</td>
+			<td class="ListColHeaderCenter">{$lang.dtm_end_time}</td>
+			<td class="ListColHeaderCenter">{$lang.dtm_duration}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_author}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_comment}</td>
+			<td class="ListColHeaderCenter">{$lang.dtm_fixed}</td>
+			<td class="ListColHeaderCenter">{$lang.cmt_actions}</td>
+		</tr>
+		{foreach item=tds from=$tab_downtime_svc}
+		<tr class={cycle values="list_two, list_one"}>
+			<td class="ListColPicker"><input type="checkbox" name='select[{$tds.id};{$tds.id_supp}]'></td>
+			<td class="ListColLeft">{$tds.host_name}</td>
+			<td class="ListColLeft">{$tds.svc_name}</td>
+			<td class="ListColRight">{$tds.start}</td>
+			<td class="ListColRight">{$tds.end}</td>
+			<td class="ListColRight">{$tds.len}</td>
+			<td class="ListColCenter">{$tds.author}</td>
+			<td class="ListColLeft">{$tds.comment}</td>
+			<td class="ListColLeft">{$tds.persistent}</td>
+			<td class="ListColCenter"><a href='./oreon.php?p={$p}&o=ds&select[{$tds.id};{$tds.id_supp}]'><img src='./img/icones/16x16/delete.gif'></a></td>
+		</tr>
+		{/foreach}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">&nbsp;<input type="image" name="o" value="ds" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msgs.delConfirm}')"></td>
+			<td class="ListColFooterCenter" colspan="7">&nbsp;</td>
+			<td class="ListColFooterRight" align="right"><a href="{$msgs.addL}">{$msgs.addT}</a></td>
+		</tr>	
+	</table>
+	{$form.hidden}
+</form>
\ No newline at end of file
diff --git a/www/include/monitoring/templates/servicePassiveCheck.ihtml b/www/include/monitoring/templates/servicePassiveCheck.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..0975e902cbbdb542ed13e89ef4493528019f9e9d
--- /dev/null
+++ b/www/include/monitoring/templates/servicePassiveCheck.ihtml
@@ -0,0 +1,27 @@
+{$form.javascript}
+<div>
+	<form {$form.attributes}>
+		<table id="ListTable">
+			<tr class="ListHeader">
+				<td class="FormHeader" colspan="2">{$form.header.title}</td>
+			<tr>
+			<tr class="list_one">
+				<td>{$form.host_id.label}</td>
+				<td>{$form.host_id.html}</td>
+			</tr>
+			<tr class="list_one">
+				<td>{$form.persistant.label}</td>
+				<td>{$form.persistant.html}</td>
+			</tr>
+			<tr class="list_two">
+				<td>{$form.comment.label}</td>
+				<td>{$form.comment.html}</td>
+			</tr>
+		</table>		
+		<div id="validForm">
+			<p>{$form.action.html}</p>
+			<p>{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+		</div>
+		{$form.hidden}
+	</form>
+</div>
\ No newline at end of file
diff --git a/www/include/monitoring/viewComment.php b/www/include/monitoring/viewComment.php
new file mode 100644
index 0000000000000000000000000000000000000000..a78ed1a5cc92c31a6036a577572b354cf5ec124b
--- /dev/null
+++ b/www/include/monitoring/viewComment.php
@@ -0,0 +1,85 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "templates/");
+	
+	$tpl->assign("lang", $lang);
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	
+	if (!file_exists($oreon->Nagioscfg["comment_file"]))
+		print ("downtime file not found");
+	else	{
+		$log = fopen($oreon->Nagioscfg["comment_file"], "r");
+		$tab_comments_host = array();
+		$tab_comments_svc = array();
+		$i = 0;
+		while ($str = fgets($log))	{
+			$res = preg_split("/;/", $str);
+			if (preg_match("/^\[([0-9]*)\] HOST_COMMENT;/", $str, $matches)){
+				$selectedElements =& $form->addElement('checkbox', "select[".$res[1]."]");
+				$tab_comments_host[$i] = array();
+				$tab_comments_host[$i]["id"] = $res[1];
+				$tab_comments_host[$i]["host_name"] = $res[2];
+				$tab_comments_host[$i]["time"] = date("d-m-Y G:i:s", $matches[1]);
+				$tab_comments_host[$i]["author"] = $res[4];
+				$tab_comments_host[$i]["comment"] = $res[5];
+				$tab_comments_host[$i]["persistent"] = $res[3];
+				$i++;
+			} else if (preg_match("/^\[([0-9]*)\] SERVICE_COMMENT;/", $str, $matches)){
+				$selectedElements =& $form->addElement('checkbox', "select[".$res[1]."]");
+				$tab_comments_svc[$i] = array();
+				$tab_comments_svc[$i]["id"] = $res[1];
+				$tab_comments_svc[$i]["host_name"] = $res[2];
+				$tab_comments_svc[$i]["service_descr"] = $res[3];
+				$tab_comments_svc[$i]["time"] = date("d-m-Y G:i:s", $matches[1]);
+				$tab_comments_svc[$i]["author"] = $res[5];
+				$tab_comments_svc[$i]["comment"] = $res[6];
+				$tab_comments_svc[$i]["persistent"] = $res[4];
+				$i++;
+			}
+		}
+	}
+	
+	#Element we need when we reload the page
+	$form->addElement('hidden', 'p');
+	$tab = array ("p" => $p);
+	$form->setDefaults($tab);	
+	
+	$tpl->assign('msgh', array ("addL"=>"?p=".$p."&o=ah", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	$tpl->assign('msgs', array ("addL"=>"?p=".$p."&o=as", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	$tpl->assign("p", $p);
+	$tpl->assign("tab_comments_host", $tab_comments_host);
+	$tpl->assign("tab_comments_svc", $tab_comments_svc);
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	
+	$tpl->display("comments.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/monitoring/viewDowntime.php b/www/include/monitoring/viewDowntime.php
new file mode 100644
index 0000000000000000000000000000000000000000..d54a433ad9e76820bd712825cb9adf1312a41628
--- /dev/null
+++ b/www/include/monitoring/viewDowntime.php
@@ -0,0 +1,194 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "templates/");
+
+	$tpl->assign("lang", $lang);
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+
+	if (!file_exists($oreon->Nagioscfg["downtime_file"]))
+		print ("downtime file not found");
+	else	{
+		$log = fopen($oreon->Nagioscfg["downtime_file"], "r");
+		$tab_downtime_host = array();
+		$tab_downtime_svc = array();
+		$i = 0;
+		$i2 = 0;
+		if ($oreon->user->get_version() == 1)
+		{
+			while ($str = fgets($log))	{
+				$res = preg_split("/;/", $str);
+				if (preg_match("/^\[([0-9]*)\] HOST_DOWNTIME;/", $str, $matches)){
+					$selectedElements =& $form->addElement('checkbox', "select[".$res[1]."]");
+					$tab_downtime_host[$i] = array();
+					$tab_downtime_host[$i]["id"] = $res[1];
+					$tab_downtime_host[$i]["host_name"] = $res[2];
+					$tab_downtime_host[$i]["time"] = date("d-m-Y G:i:s", $matches[1]);
+					$tab_downtime_host[$i]["start"] = date("d-m-Y G:i:s", $res[3]);
+					$tab_downtime_host[$i]["end"] = date("d-m-Y G:i:s", $res[4]);
+					$tab_downtime_host[$i]["len"] = $res[6];
+					$tab_downtime_host[$i]["author"] = $res[7];
+					$tab_downtime_host[$i]["comment"] = $res[8];
+					$tab_downtime_host[$i]["persistent"] = $res[5];
+					$i++;
+				} else if (preg_match("/^\[([0-9]*)\] SERVICE_DOWNTIME;/", $str, $matches)){
+					$selectedElements =& $form->addElement('checkbox', "select[".$res[1]."]");
+					$tab_downtime_svc[$i] = array();
+					$tab_downtime_svc[$i]["id"] = $res[1];
+					$tab_downtime_svc[$i]["host_name"] = $res[2];
+					$tab_downtime_svc[$i]["svc_name"] = $res[3];
+					$tab_downtime_svc[$i]["time"] = date("d-m-Y G:i:s", $matches[1]);
+					$tab_downtime_svc[$i]["start"] = date("d-m-Y G:i:s", $res[4]);
+					$tab_downtime_svc[$i]["end"] = date("d-m-Y G:i:s", $res[5]);
+					$tab_downtime_svc[$i]["len"] = $res[7];
+					$tab_downtime_svc[$i]["author"] = $res[8];
+					$tab_downtime_svc[$i]["comment"] = $res[9];
+					$tab_downtime_svc[$i]["persistent"] = $res[6];
+					$i++;
+				}			
+			}
+		}
+		else
+		{
+          $flag_host = 0;
+          $flag_svc = 0;
+
+			while ($str = fgets($log))	{
+                if (preg_match("/^hostdowntime/", $str))
+                    {
+                        $tab_downtime_host[$i] = array();
+                      $flag_host = 1;
+                    }
+                else if (preg_match("/^servicedowntime/", $str))
+                    {
+                        $tab_downtime_svc[$i2] = array();
+                      $flag_svc = 1;
+                    }
+                else{
+
+                    if($flag_host == 1)
+                    {
+                      $res = preg_split("/=/", $str);
+                      $res[0] = trim($res[0]);
+                      if (isset($res[1]))
+                      	$res[1] = trim($res[1]);
+                        if (preg_match('`downtime_id$`', $res[0])){
+                            $selectedElements =& $form->addElement('checkbox', "select[".$res[1]."]");
+                            $tab_downtime_host[$i]["id"] = $res[1];}
+                        if (preg_match('`host_name$`', $res[0])){
+                          $tab_downtime_host[$i]["host_name"] = $res[1];}
+                        if (preg_match('`entry_time$`', $res[0])){
+	                        $tab_downtime_host[$i]["time"] = date("d-m-Y G:i:s", $res[1]);
+	                        
+	                        $cmd = "SELECT downtime_id from downtime where entry_time = ".$res[1]." ";
+                        	$result =& $pearDB->query($cmd);
+                        	$result->fetchInto($id_downtime);
+                        	$tab_downtime_host[$i]["id_supp"] = $id_downtime["downtime_id"];
+                        }
+                        if (preg_match('`start_time$`', $res[0])){$tab_downtime_host[$i]["start"] = date("d-m-Y G:i:s", $res[1]);}
+                        if (preg_match('`end_time$`', $res[0])){$tab_downtime_host[$i]["end"] = date("d-m-Y G:i:s", $res[1]);}
+                        if (preg_match('`triggered_by$`', $res[0])){
+    //                      $tab_downtime_host[$i]["..."] = $res[1];
+                        }
+                        if (preg_match('`fixed$`', $res[0])){$tab_downtime_host[$i]["persistent"] = $res[1];}
+                        if (preg_match('`duration$`', $res[0])){$tab_downtime_host[$i]["len"] = $res[1];}
+                        if (preg_match('`author$`', $res[0])){$tab_downtime_host[$i]["author"] = $res[1];}
+                        if (preg_match('`comment$`', $res[0])){$tab_downtime_host[$i]["comment"] = $res[1];}
+                        if (preg_match('`}$`', $str))
+                        {
+                            $flag_host = 0;
+                            $i++;
+                        }
+                    }
+                    else if($flag_svc == 1)
+                    {
+                      $res = preg_split("/=/", $str);
+                      $res[0] = trim($res[0]);
+                      if (isset($res[1]))
+                      	$res[1] = trim($res[1]);
+                      	
+
+                      	
+                        if (preg_match('`downtime_id$`', $res[0])){
+                            $selectedElements =& $form->addElement('checkbox', "select[".$res[1]."]");
+                            $tab_downtime_svc[$i2]["id"] = $res[1];}
+                        if (preg_match('`service_description$`', $res[0])){
+                          $tab_downtime_svc[$i2]["svc_name"] = $res[1];}
+                        if (preg_match('`host_name$`', $res[0])){
+                          $tab_downtime_svc[$i2]["host_name"] = $res[1];}
+                        if (preg_match('`entry_time$`', $res[0])){
+                        	$tab_downtime_svc[$i2]["time"] = date("d-m-Y G:i:s", $res[1]);
+
+
+                        	$cmd = "SELECT downtime_id from downtime where entry_time = ".$res[1]." ";
+                        	$result =& $pearDB->query($cmd);
+                        	$result->fetchInto($id_downtime);
+                        	$tab_downtime_svc[$i2]["id_supp"] = $id_downtime["downtime_id"];
+                        	
+                        }
+                        if (preg_match('`start_time$`', $res[0])){$tab_downtime_svc[$i2]["start"] = date("d-m-Y G:i:s", $res[1]);}
+                        if (preg_match('`end_time$`', $res[0])){$tab_downtime_svc[$i2]["end"] = date("d-m-Y G:i:s", $res[1]);}
+                        if (preg_match('`triggered_by$`', $res[0])){
+    //                      $tab_downtime_host[$i]["..."] = $res[1];
+                        }
+                        if (preg_match('`fixed$`', $res[0])){$tab_downtime_svc[$i2]["persistent"] = $res[1];}
+                        if (preg_match('`duration$`', $res[0])){$tab_downtime_svc[$i2]["len"] = $res[1];}
+                        if (preg_match('`author$`', $res[0])){$tab_downtime_svc[$i2]["author"] = $res[1];}
+                        if (preg_match('`comment$`', $res[0])){$tab_downtime_svc[$i2]["comment"] = $res[1];}
+                        if (preg_match('`}$`', $str))
+                        {
+                            $flag_svc = 0;
+                        $i2++;
+                        }
+                    }
+                }
+
+
+				}
+		}
+	}
+
+	#Element we need when we reload the page
+	$form->addElement('hidden', 'p');
+	$tab = array ("p" => $p);
+	$form->setDefaults($tab);
+
+	$tpl->assign('msgh', array ("addL"=>"?p=".$p."&o=ah", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	$tpl->assign('msgs', array ("addL"=>"?p=".$p."&o=as", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	$tpl->assign("p", $p);
+	$tpl->assign("tab_downtime_host", $tab_downtime_host);
+	$tpl->assign("tab_downtime_svc", $tab_downtime_svc);
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	
+	$tpl->display("downtime.ihtml");
+
+?>
diff --git a/www/include/options/LCA/define/DB-Func.php b/www/include/options/LCA/define/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..a45628696e5ac803a1f1fd457d33745b009eecca
--- /dev/null
+++ b/www/include/options/LCA/define/DB-Func.php
@@ -0,0 +1,254 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function testExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('lca_id');
+		$res =& $pearDB->query("SELECT lca_name, lca_id FROM lca_define WHERE lca_name = '".$name."'");
+		$lca =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $lca["lca_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $lca["lca_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function enableLCAInDB ($lca_id = null)	{
+		if (!$lca_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE lca_define SET lca_activate = '1' WHERE lca_id = '".$lca_id."'");
+	}
+	
+	function disableLCAInDB ($lca_id = null)	{
+		if (!$lca_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE lca_define SET lca_activate = '0' WHERE lca_id = '".$lca_id."'");
+	}
+	
+	function deleteLCAInDB ($lcas = array())	{
+		global $pearDB;
+		foreach($lcas as $key=>$value)
+			$pearDB->query("DELETE FROM lca_define WHERE lca_id = '".$key."'");
+	}
+	
+	function multipleLCAInDB ($lcas = array(), $nbrDup = array())	{
+		foreach($lcas as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM lca_define WHERE lca_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["lca_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "lca_name" ? ($lca_name = clone($value2 = $value2."_".$i)) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testExistence($lca_name))	{
+					$val ? $rq = "INSERT INTO lca_define VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(lca_id) FROM lca_define");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(lca_id)"]))	{
+						$res =& $pearDB->query("SELECT DISTINCT contactgroup_cg_id FROM lca_define_contactgroup_relation WHERE lca_define_lca_id = '".$key."'");
+						while($res->fetchInto($cg))
+							$pearDB->query("INSERT INTO lca_define_contactgroup_relation VALUES ('', '".$maxId["MAX(lca_id)"]."', '".$cg["contactgroup_cg_id"]."')");
+						$res =& $pearDB->query("SELECT DISTINCT host_host_id FROM lca_define_host_relation WHERE lca_define_lca_id = '".$key."'");
+						while($res->fetchInto($host))
+							$pearDB->query("INSERT INTO lca_define_host_relation VALUES ('', '".$maxId["MAX(lca_id)"]."', '".$host["host_host_id"]."')");
+						$res =& $pearDB->query("SELECT DISTINCT hostgroup_hg_id FROM lca_define_hostgroup_relation WHERE lca_define_lca_id = '".$key."'");
+						while($res->fetchInto($hg))
+							$pearDB->query("INSERT INTO lca_define_hostgroup_relation VALUES ('', '".$maxId["MAX(lca_id)"]."', '".$hg["hostgroup_hg_id"]."')");
+						$res =& $pearDB->query("SELECT DISTINCT servicegroup_sg_id FROM lca_define_servicegroup_relation WHERE lca_define_lca_id = '".$key."'");
+						while($res->fetchInto($sg))
+							$pearDB->query("INSERT INTO lca_define_servicegroup_relation VALUES ('', '".$maxId["MAX(lca_id)"]."', '".$sg["servicegroup_sg_id"]."')");
+					}
+				}
+			}
+		}
+	}
+	
+	function updateLCAInDB ($lca_id = NULL)	{
+		if (!$lca_id) return;
+		updateLCA($lca_id);
+		updateLCAContactGroups($lca_id);
+		updateLCAHosts($lca_id);
+		updateLCAHostGroups($lca_id);
+		updateLCAServiceGroups($lca_id);
+		updateLCATopology($lca_id);
+	}	
+	
+	function insertLCAInDB ()	{
+		$lca_id = insertLCA();
+		updateLCAContactGroups($lca_id);
+		updateLCAHosts($lca_id);
+		updateLCAHostGroups($lca_id);
+		updateLCAServiceGroups($lca_id);
+		updateLCATopology($lca_id);
+		return ($lca_id);
+	}
+	
+	function insertLCA()	{
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO lca_define ";
+		$rq .= "(lca_name, lca_comment, lca_hg_childs, lca_activate) ";
+		$rq .= "VALUES ";
+		$rq .= "('".htmlentities($ret["lca_name"], ENT_QUOTES)."', '".htmlentities($ret["lca_comment"], ENT_QUOTES)."', '".$ret["lca_hg_childs"]["lca_hg_childs"]."', '".$ret["lca_activate"]["lca_activate"]."')";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(lca_id) FROM lca_define");
+		$lca_id = $res->fetchRow();
+		return ($lca_id["MAX(lca_id)"]);
+	}
+	
+	function updateLCA($lca_id = null)	{
+		if (!$lca_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE lca_define ";
+		$rq .= "SET lca_name = '".htmlentities($ret["lca_name"], ENT_QUOTES)."', " .
+				"lca_comment = '".htmlentities($ret["lca_comment"], ENT_QUOTES)."', " .
+				"lca_hg_childs = '".$ret["lca_hg_childs"]["lca_hg_childs"]."', " .
+				"lca_activate = '".$ret["lca_activate"]["lca_activate"]."' " .
+				"WHERE lca_id = '".$lca_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function updateLCAContactGroups($lca_id = null)	{
+		if (!$lca_id) return;
+		global $form;
+		global $pearDB;
+		global $oreon;
+		$lcas = array();
+		$rq = "DELETE FROM lca_define_contactgroup_relation ";
+		$rq .= "WHERE lca_define_lca_id = '".$lca_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("lca_cgs");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO lca_define_contactgroup_relation ";
+			$rq .= "(lca_define_lca_id, contactgroup_cg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$lca_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateLCAHosts($lca_id = null)	{
+		if (!$lca_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM lca_define_host_relation ";
+		$rq .= "WHERE lca_define_lca_id = '".$lca_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("lca_hosts");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO lca_define_host_relation ";
+			$rq .= "(lca_define_lca_id, host_host_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$lca_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateLCAHostGroups($lca_id = null)	{
+		if (!$lca_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM lca_define_hostgroup_relation ";
+		$rq .= "WHERE lca_define_lca_id = '".$lca_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("lca_hgs");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO lca_define_hostgroup_relation ";
+			$rq .= "(lca_define_lca_id, hostgroup_hg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$lca_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateLCAServiceGroups($lca_id = null)	{
+		if (!$lca_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM lca_define_servicegroup_relation ";
+		$rq .= "WHERE lca_define_lca_id = '".$lca_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("lca_sgs");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO lca_define_servicegroup_relation ";
+			$rq .= "(lca_define_lca_id, servicegroup_sg_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$lca_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateLCATopology($lca_id = null)	{
+		if (!$lca_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM lca_define_topology_relation ";
+		$rq .= "WHERE lca_define_lca_id = '".$lca_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("lca_topos");
+		$ret = array_keys($ret);		
+		for($i = 0; $i < count($ret); $i++)	{
+			if (isset($ret[$i]))	{
+				$rq = "INSERT INTO lca_define_topology_relation ";
+				$rq .= "(lca_define_lca_id, topology_topology_id) ";
+				$rq .= "VALUES ";
+				$rq .= "('".$lca_id."', '".$ret[$i]."')";
+				$pearDB->query($rq);
+				//updateLCATopologyParents($ret[$i], $lca_id);
+			}
+		}
+	}
+	
+	function updateLCATopologyChilds($topology_id = NULL, $lca_id = NULL)	{
+		if (!$topology_id || !$lca_id) return;
+		global $pearDB;
+		$res =& $pearDB->query("SELECT DISTINCT topology_page FROM topology WHERE topology_id = '".$topology_id."'");
+		$level1 =& $res->fetchRow();
+		$res2 =& $pearDB->query("SELECT topology_id, topology_page FROM topology WHERE topology_parent = '".$level1["topology_page"]."'");
+		while($res2->fetchInto($level2))	{
+			$rq = "INSERT INTO lca_define_topology_relation ";
+			$rq .= "(lca_define_lca_id, topology_topology_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$lca_id."', '".$level2["topology_id"]."')";
+			$pearDB->query($rq);
+			updateLCATopologyChilds($level2["topology_id"], $lca_id);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/options/LCA/define/formLCA.ihtml b/www/include/options/LCA/define/formLCA.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..9fe12e4dafbb3ce035374a50dc8dbdefc63519f9
--- /dev/null
+++ b/www/include/options/LCA/define/formLCA.ihtml
@@ -0,0 +1,56 @@
+<script type="text/javascript" src="include/configuration/changetab.js"></script>
+{$form.javascript}
+<form {$form.attributes}>
+<div>
+<ul id="mainnav">
+	<li class="a" id='c1'><a href="#"  onclick="javascript:montre('1');">{$sort1}</a></li>
+	<li class="b" id='c2'><a href="#" onclick="javascript:montre('2');">{$sort2}</a></li>
+	<li class="b" id='c3'><a href="#" onclick="javascript:montre('3');">{$sort3}</a></li>
+</ul>
+</div>
+<div id='tab1' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/application_lock.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/house.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+	 	
+		<tr class="list_one"><td class="FormRowField">{$form.lca_name.label}</td><td class="FormRowValue">{$form.lca_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.lca_comment.label}</td><td class="FormRowValue">{$form.lca_comment.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.lca_activate.label}</td><td class="FormRowValue">{$form.lca_activate.html}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/users_family.gif'>&nbsp;&nbsp;{$form.header.cg}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.lca_cgs.label}</td><td class="FormRowValue">{$form.lca_cgs.html}</td></tr>
+
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+</div>
+<div id='tab2' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/application_lock.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/clients.gif'>&nbsp;&nbsp;{$form.header.rs}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.lca_hgs.label}</td><td class="FormRowValue">{$form.lca_hgs.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.lca_hg_childs.label}</td><td class="FormRowValue">{$form.lca_hg_childs.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.lca_sgs.label}</td><td class="FormRowValue">{$form.lca_sgs.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.lca_hosts.label}</td><td class="FormRowValue">{$form.lca_hosts.html}</td></tr>
+	</table>
+</div>
+<div id='tab3' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/application_lock.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/window_application_delete.gif'>&nbsp;&nbsp;{$form.header.pages}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.lca_topos.label}</td><td class="FormRowValue">&nbsp;&nbsp;{$form.lca_topos.html}</td></tr>
+	</table>
+</div>
+<div id="validForm">
+{if $o == "a" || $o == "c"}
+	<p>{$form.action.html}</p>
+	<p>{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+{else if $o == "w"}
+	<p>{$form.change.html}</p>
+{/if}
+</div>
+{$form.hidden}
+</form>
+
diff --git a/www/include/options/LCA/define/formLCA.php b/www/include/options/LCA/define/formLCA.php
new file mode 100644
index 0000000000000000000000000000000000000000..8e15f8ed4f709ec9719c7e46489c60309efed688
--- /dev/null
+++ b/www/include/options/LCA/define/formLCA.php
@@ -0,0 +1,269 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	#
+	## Database retrieve information for LCA
+	#
+	if ($o == "c" || $o == "w")	{
+		$res =& $pearDB->query("SELECT * FROM lca_define WHERE lca_id = '".$lca_id."' LIMIT 1");
+		# Set base value
+		$lca = array_map("myDecode", $res->fetchRow());
+		# Set Service Groups relations
+		$res =& $pearDB->query("SELECT DISTINCT servicegroup_sg_id FROM lca_define_servicegroup_relation WHERE lca_define_lca_id = '".$lca_id."'");
+		for($i = 0; $res->fetchInto($sg); $i++)
+			$lca["lca_sgs"][$i] = $sg["servicegroup_sg_id"];
+		$res->free();
+		# Set Host Groups relations
+		$res =& $pearDB->query("SELECT DISTINCT hostgroup_hg_id FROM lca_define_hostgroup_relation WHERE lca_define_lca_id = '".$lca_id."'");
+		for($i = 0; $res->fetchInto($hg); $i++)
+			$lca["lca_hgs"][$i] = $hg["hostgroup_hg_id"];
+		$res->free();
+		# Set Host relations
+		$res =& $pearDB->query("SELECT DISTINCT host_host_id FROM lca_define_host_relation WHERE lca_define_lca_id = '".$lca_id."'");
+		for($i = 0; $res->fetchInto($host); $i++)
+			$lca["lca_hosts"][$i] = $host["host_host_id"];
+		$res->free();
+		# Set Contact Groups relations
+		$res =& $pearDB->query("SELECT DISTINCT contactgroup_cg_id FROM lca_define_contactgroup_relation WHERE lca_define_lca_id = '".$lca_id."'");
+		for($i = 0; $res->fetchInto($cg); $i++)
+			$lca["lca_cgs"][$i] = $cg["contactgroup_cg_id"];
+		$res->free();
+		# Set Topology relations
+		$res =& $pearDB->query("SELECT topology_topology_id FROM lca_define_topology_relation WHERE lca_define_lca_id = '".$lca_id."'");
+		for($i = 0; $res->fetchInto($topo); $i++)
+			$lca["lca_topos"][$topo["topology_topology_id"]] = 1;
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Host Groups comes from DB -> Store in $hgs Array
+	$hgs = array();
+	$res =& $pearDB->query("SELECT hg_id, hg_name FROM hostgroup WHERE hg_id IN (".$oreon->user->lcaHGStr.") ORDER BY hg_name");
+	while($res->fetchInto($hg))
+		$hgs[$hg["hg_id"]] = $hg["hg_name"];
+	$res->free();
+	#
+	# Service Groups comes from DB -> Store in $sgs Array
+	$sgs = array();
+	$res =& $pearDB->query("SELECT sg_id, sg_name FROM servicegroup WHERE sg_id IN (".$oreon->user->lcaSGStr.") ORDER BY sg_name");
+	while($res->fetchInto($sg))
+		$sgs[$sg["sg_id"]] = $sg["sg_name"];
+	$res->free();
+	#
+	# Host comes from DB -> Store in $hosts Array
+	$hosts = array();
+	$res =& $pearDB->query("SELECT host_id, host_name FROM host WHERE host_register = '1' AND host_id IN (".$oreon->user->lcaHStr.") ORDER BY host_name");
+	while($res->fetchInto($host))
+		$hosts[$host["host_id"]] = $host["host_name"];
+	$res->free();
+	#
+	# Contact Groups comes from DB -> Store in $cgs Array
+	$cgs = array();
+	$res =& $pearDB->query("SELECT cg_id, cg_name FROM contactgroup ORDER BY cg_name");
+	while($res->fetchInto($cg))
+		$cgs[$cg["cg_id"]] = $cg["cg_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"3", "cols"=>"30");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["lca_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["lca_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["lca_view"]);
+
+	#
+	## LCA basic information
+	#
+	$form->addElement('header', 'information', $lang['lca_infos']);
+	$form->addElement('text', 'lca_name', $lang["lca_name"], $attrsText);
+/*	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'lca_type', null, $lang['lca_tpMenu'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'lca_type', null, $lang['lca_tpRes'], '2');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'lca_type', null, $lang['lca_tpBoth'], '3');
+	$form->addGroup($tab, 'lca_type', $lang["lca_type"], '&nbsp;');
+	$form->setDefaults(array('lca_type' => '3')); */
+	$form->addElement('textarea', 'lca_comment', $lang["lca_comment"], $attrsTextarea);
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'lca_activate', null, $lang["enable"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'lca_activate', null, $lang["disable"], '0');
+	$form->addGroup($tab, 'lca_activate', $lang["status"], '&nbsp;');
+	$form->setDefaults(array('lca_activate' => '1'));
+
+	#
+	## Contact Group concerned
+	#
+	$form->addElement('header', 'cg', $lang['lca_appCG']);
+    $ams1 =& $form->addElement('advmultiselect', 'lca_cgs', $lang["lca_cg"], $cgs, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+	#
+	## Resources concerned
+	#
+	$form->addElement('header', 'rs', $lang['lca_appRes']);
+
+    $ams1 =& $form->addElement('advmultiselect', 'lca_hgs', $lang["lca_hg"], $hgs, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'lca_hg_childs', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'lca_hg_childs', null, $lang["no"], '0');
+	$form->addGroup($tab, 'lca_hg_childs', $lang['lca_hgChilds'], '&nbsp;');
+	$form->setDefaults(array('lca_hg_childs' => '1'));
+
+    $ams1 =& $form->addElement('advmultiselect', 'lca_hosts', $lang["lca_host"], $hosts, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+    $ams1 =& $form->addElement('advmultiselect', 'lca_sgs', $lang["lca_sg"], $sgs, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+	#
+	## Topology concerned
+	#
+	$form->addElement('header', 'pages', $lang['lca_appTopo']);
+	$rq = "SELECT topology_id, topology_page, topology_name, topology_parent FROM topology WHERE topology_parent IS NULL AND topology_id IN (".$oreon->user->lcaTStr.") ORDER BY topology_order";
+	$res1 =& $pearDB->query($rq);
+	#
+	$lca_topos = array();
+	while ($res1->fetchInto($topo1))	{
+	 	$lca_topos[] =  &HTML_QuickForm::createElement('checkbox', $topo1["topology_id"], null, array_key_exists($topo1["topology_name"], $lang) ? "&nbsp;&nbsp;".$lang[$topo1["topology_name"]]."<br>" : "&nbsp;&nbsp;#UNDEF#"."<br>", array("style"=>"margin-top: 5px;", "id"=>$topo1["topology_id"]));
+	 	$rq = "SELECT topology_id, topology_page, topology_name, topology_parent FROM topology WHERE topology_parent = '".$topo1["topology_page"]."' AND topology_id IN (".$oreon->user->lcaTStr.") ORDER BY topology_order";
+	 	$res2 =& $pearDB->query($rq);
+		while ($res2->fetchInto($topo2))	{
+		 	$lca_topos[] =  &HTML_QuickForm::createElement('checkbox', $topo2["topology_id"], NULL, array_key_exists($topo2["topology_name"], $lang) ? "&nbsp;&nbsp;".$lang[$topo2["topology_name"]]."<br>" : "&nbsp;&nbsp;#UNDEF#"."<br>", array("style"=>"margin-top: 5px; margin-left: 20px;"));
+		 	$rq = "SELECT topology_id, topology_name, topology_parent FROM topology WHERE topology_parent = '".$topo2["topology_page"]."' AND topology_id IN (".$oreon->user->lcaTStr.") ORDER BY topology_order";
+		 	$res3 =& $pearDB->query($rq);
+			while ($res3->fetchInto($topo3))
+			 	$lca_topos[] =  &HTML_QuickForm::createElement('checkbox', $topo3["topology_id"], null, array_key_exists($topo3["topology_name"], $lang) ? "&nbsp;&nbsp;".$lang[$topo3["topology_name"]]."<br>" : "&nbsp;&nbsp;#UNDEF#"."<br>", array("style"=>"margin-top: 5px; margin-left: 40px;"));
+		}
+	}
+	if ($o == "a")	{
+		function one($v)	{
+			$v->setValue(1);
+			return $v;
+		}
+		$lca_topos = array_map("one", $lca_topos);
+	}
+	$form->addGroup($lca_topos, 'lca_topos', $lang['lca_topo'], '&nbsp;&nbsp;');
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+
+	$form->addElement('hidden', 'lca_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('lca_name', $lang['ErrName'], 'required');
+	$form->registerRule('exist', 'callback', 'testExistence');
+	$form->addRule('lca_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Just watch a LCA information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&lca_id=".$lca_id."'"));
+	    $form->setDefaults($lca);
+		$form->freeze();
+	}
+	# Modify a LCA information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["delete"]);
+	    $form->setDefaults($lca);
+	}
+	# Add a LCA information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["delete"]);
+	}
+	$tpl->assign('msg', array ("changeL"=>"?p=".$p."&o=c&lca_id=".$lca_id, "changeT"=>$lang['modify']));
+
+	$tpl->assign("sort1", $lang['lca_infos']);
+	$tpl->assign("sort2", $lang['lca_sortRes']);
+	$tpl->assign("sort3", $lang['lca_sortTopo']);
+
+	$valid = false;
+	if ($form->validate())	{
+		$lcaObj =& $form->getElement('lca_id');
+		if ($form->getSubmitValue("submitA"))
+			$lcaObj->setValue(insertLCAInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateLCAInDB($lcaObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&lca_id=".$lcaObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once("listLCA.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->display("formLCA.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/options/LCA/define/lca.php b/www/include/options/LCA/define/lca.php
new file mode 100644
index 0000000000000000000000000000000000000000..ec49860401fc3d51c453133eb1c3f4e64d0190bc
--- /dev/null
+++ b/www/include/options/LCA/define/lca.php
@@ -0,0 +1,49 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["lca_id"]) ? $cG = $_GET["lca_id"] : $cG = NULL;
+	isset($_POST["lca_id"]) ? $cP = $_POST["lca_id"] : $cP = NULL;
+	$cG ? $lca_id = $cG : $lca_id = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/options/LCA/define/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formLCA.php"); break; #Add a LCA
+		case "w" : require_once($path."formLCA.php"); break; #Watch a LCA
+		case "c" : require_once($path."formLCA.php"); break; #Modify a LCA
+		case "s" : enableLCAInDB($lca_id); require_once($path."listLCA.php"); break; #Activate a LCA
+		case "u" : disableLCAInDB($lca_id); require_once($path."listLCA.php"); break; #Desactivate a LCA
+		case "m" : multipleLCAInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listLCA.php"); break; #Duplicate n LCAs
+		case "d" : deleteLCAInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listLCA.php"); break; #Delete n LCAs
+		default : require_once($path."listLCA.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/options/LCA/define/listLCA.ihtml b/www/include/options/LCA/define/listLCA.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..150085da685bf5ff47529e5d3cf185f0c81dd4d8
--- /dev/null
+++ b/www/include/options/LCA/define/listLCA.ihtml
@@ -0,0 +1,41 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="2"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
\ No newline at end of file
diff --git a/www/include/options/LCA/define/listLCA.php b/www/include/options/LCA/define/listLCA.php
new file mode 100644
index 0000000000000000000000000000000000000000..dc7b0ff056b0cf9abc7aab07baaa49019e24cb7e
--- /dev/null
+++ b/www/include/options/LCA/define/listLCA.php
@@ -0,0 +1,118 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+	$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	$lca_reg = NULL;
+	# Not list the LCA the user is registered by || is admin
+	if (!$oreon->user->get_admin())	{
+		$res =& $pearDB->query("SELECT contactgroup_cg_id FROM contactgroup_contact_relation WHERE contact_contact_id = '".$oreon->user->get_id()."'");
+		while($res->fetchInto($contactGroup))	{
+		 	$res2 =& $pearDB->query("SELECT lca.lca_id FROM lca_define_contactgroup_relation ldcgr, lca_define lca WHERE ldcgr.contactgroup_cg_id = '".$contactGroup["contactgroup_cg_id"]."' AND ldcgr.lca_define_lca_id = lca.lca_id");	
+			while ($res2->fetchInto($lca))
+				$lca_reg ? $lca_reg .= ", ".$lca["lca_id"] : $lca_reg = $lca["lca_id"];
+		}
+	}
+	$lca_reg ? $lca_reg = $lca_reg : $lca_reg =  '\'\'';
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM lca_define WHERE lca_name AND lca_id NOT IN (".$lca_reg.") LIKE '%".$search."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM lca_define WHERE lca_id NOT IN (".$lca_reg.")");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+
+	#List
+	if ($search)
+		$rq = "SELECT lca_id, lca_name, lca_comment, lca_activate  FROM lca_define WHERE lca_name LIKE '%".$search."%' AND lca_id NOT IN (".$lca_reg.") ORDER BY lca_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT lca_id, lca_name, lca_comment, lca_activate FROM lca_define WHERE lca_id NOT IN (".$lca_reg.") ORDER BY lca_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($lca); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$lca['lca_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&lca_id=".$lca['lca_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&lca_id=".$lca['lca_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&lca_id=".$lca['lca_id']."&o=d&select[".$lca['lca_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($lca["lca_activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&lca_id=".$lca['lca_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&lca_id=".$lca['lca_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$lca['lca_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$lca["lca_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&lca_id=".$lca['lca_id'],
+						"RowMenu_desc"=>substr($lca["lca_comment"], 0, 40),
+						"RowMenu_status"=>$lca["lca_activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";
+	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listLCA.ihtml");
+	
+	
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");		
+?>
diff --git a/www/include/options/about/about.php b/www/include/options/about/about.php
new file mode 100644
index 0000000000000000000000000000000000000000..f78f2248f1f1b5aa594511201486cfeed4654937
--- /dev/null
+++ b/www/include/options/about/about.php
@@ -0,0 +1,33 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus- Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset($oreon))
+		exit();
+?>
+<div style="float: left; padding-left: 30px;">
+	<img src="./img/paris.jpg" alt="Logo Join Community">
+</div>
+<div style="float: left; padding-left: 60px; padding-top: 50px;">
+	<div class="list_one"><h3>Oreon <? include "./include/version/version.php"; ?></h3></div>
+	<br>
+	<a href="mailto:rlemerlus@oreon-project.org" class="list_two">Romain Le Merlus (rom)</a><br>
+	<a href="mailto:jmathis@oreon-project.org" class="list_two">Julien Mathis (Julio)</a><br>
+	<a href="mailto:ccoraboeuf@oreon-project.org" class="list_two">Christophe Coraboeuf (Wistof)</a><br>
+	<a href="mailto:cfacon@oreon-project.org" class="list_two">Cedrick Facon (Apo)</a><br>
+	<a href="mailto:ffoiry@oreon-project.org" class="list_two">Florian Foiry (Inconnuflo)</a><br>
+	</ul>
+</div>
\ No newline at end of file
diff --git a/www/include/options/db/extractDB/extractDB.php b/www/include/options/db/extractDB/extractDB.php
new file mode 100644
index 0000000000000000000000000000000000000000..342b26a13692a3141a6d796eb30779a11d976db5
--- /dev/null
+++ b/www/include/options/db/extractDB/extractDB.php
@@ -0,0 +1,99 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset($oreon))
+		exit();
+
+	 if ($oreon->optGen["perfparse_installed"])
+		require_once("./DBPerfparseConnect.php");
+
+	$sql = "SELECT VERSION() AS mysql_version";
+	
+	if($res =& $pearDB->query($sql)){
+		$row =& $res->fetchRow();
+		$version = $row['mysql_version'];
+		if(preg_match("/^(3\.23|4\.|5\.)/", $version)){
+			$db = $conf_oreon["db"];
+			$db_name = ( preg_match("/^(3\.23\.[6-9])|(3\.23\.[1-9][1-9])|(4\.)/", $version) ) ? "`$db`" : $db;
+			$sql = "SHOW TABLE STATUS FROM `".$conf_oreon["db"]."`";
+			if($res =& $pearDB->query($sql))
+			{
+				$dbsize = 0;
+				$rows = 0;
+				$datafree = 0;
+				while ($tabledata_ary =& $res->fetchRow()){
+					$dbsize += $tabledata_ary['Data_length'] + $tabledata_ary['Index_length'];
+					$rows += $tabledata_ary['Rows'];
+					$datafree += $tabledata_ary['Data_free'];
+				}
+			}
+		} else {
+			$dbsize = NULL;
+			$rows = NULL;
+			$datafree = NULL;
+		}
+	}
+	if (isset($pearDBpp)) {
+		$sql = "SELECT VERSION() AS mysql_version";
+		if($res =& $pearDBpp->query($sql)){
+			$row =& $res->fetchRow();
+			$versionpp = $row['mysql_version'];
+			if(preg_match("/^(3\.23|4\.|5\.)/", $versionpp)){
+				$respp =& $pearDB->query("SELECT DB_Name FROM cfg_perfparse WHERE perfparse_activate = '1'");
+				$respp->fetchInto($retpp);
+				$dbpp = $retpp["DB_Name"];
+				$db_name = ( preg_match("/^(3\.23\.[6-9])|(3\.23\.[1-9][1-9])|(4\.)/", $versionpp) ) ? "`$dbpp`" : $dbpp;
+				$sql = "SHOW TABLE STATUS FROM " . $dbpp;
+				if($res =& $pearDBpp->query($sql))
+				{
+					$dbsizepp = 0;
+					$rowspp = 0;
+					$datafreepp = 0;
+					while ($tabledata_ary =& $res->fetchRow()){
+						$dbsizepp += $tabledata_ary['Data_length'] + $tabledata_ary['Index_length'];
+						$rowspp += $tabledata_ary['Rows'];
+						$datafreepp += $tabledata_ary['Data_free'];
+					}
+				}
+			} else {
+				$dbsizepp = NULL;
+				$rowspp = NULL;
+				$datafreepp = NULL;
+			}
+		}
+	}
+?>
+ <table id="ListTable">
+ 	<tr class="ListHeader"><td class="FormHeader" colspan="2">&nbsp;&nbsp;Oreon&nbsp;<? print $lang["DB_status"]; ?></td></tr>
+ 	<tr class="list_one"><td class="FormRowField"><? print $lang["db_lenght"] ; ?></td><td class="FormRowValue"><? $dbsize /= 1024; print round($dbsize, 2); ?>Ko</td></tr>
+	<tr class="list_two"><td class="FormRowField"><? print $lang["db_nb_entry"] ; ?></td><td class="FormRowValue"><? print $rows; ?></td></tr>
+</table>
+<div id="validForm">
+	<p>
+		<form action="" method="post">
+			<input name="s" type="hidden" value="1">
+			<input name="export_sub_list" type="submit" value="<? echo $lang['db_extract']; ?>">
+		</form>
+	</p>
+</div><br><br><br><br><br>
+<? if (isset($pearDBpp)) {?>
+<table id="ListTable">
+ 	<tr class="ListHeader"><td class="FormHeader" colspan="2">&nbsp;&nbsp;Perfparse&nbsp;<? print $lang["DB_status"]; ?></td></tr>
+ 	<tr class="list_one"><td class="FormRowField"><? print $lang["db_lenght"] ; ?></td><td class="FormRowValue"><? $dbsizepp /= 1024; print round($dbsizepp, 2); ?>Ko</td></tr>
+	<tr class="list_two"><td class="FormRowField"><? print $lang["db_nb_entry"] ; ?></td><td class="FormRowValue"><? print $rowspp; ?></td></tr>
+</table>
+<? }?>
\ No newline at end of file
diff --git a/www/include/options/db/extractDB/extract_sub.php b/www/include/options/db/extractDB/extract_sub.php
new file mode 100644
index 0000000000000000000000000000000000000000..7cb3688884b15be68c14749e8b2999f7f08c8fae
--- /dev/null
+++ b/www/include/options/db/extractDB/extract_sub.php
@@ -0,0 +1,149 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+
+	$oreon = & $_SESSION["oreon"];
+
+	if (!isset($oreon))
+		exit();
+
+	///////////////////
+	$host   = $conf_oreon["host"];        /// NOM DU SERVEUR SQL
+	$user   = $conf_oreon["user"];        /// LOGIN
+	$pass   = $conf_oreon["password"];    /// PASS
+	$db     = $conf_oreon["db"];          /// NOM DE LA DATABASE
+	///////////////////
+
+	@set_time_limit(600);
+
+	@mysql_connect($host,$user,$pass)
+	    or die("Impossible de se connecter - Pb sur le 'Hostname' ou sur le 'User' ou sur le 'Password'");
+
+	@mysql_select_db("$db")
+	    or die("Impossible de se connecter - Pb sur le 'Nom de la Data Base'");
+
+	function get_table_def($db, $table, $crlf) {
+	    global $drop;
+	    $schema_create = "";
+	    if(!empty($drop))
+	        $schema_create .= "DROP TABLE IF EXISTS `$table`;$crlf";
+	    $schema_create .= "CREATE TABLE `$table` ($crlf";
+	    $result = mysql_db_query($db, "SHOW FIELDS FROM $table") or mysql_die();
+	    while($row = mysql_fetch_array($result)) {
+	        $schema_create .= "   `$row[Field]` $row[Type]";
+	        if (isset($row["Default"])
+	           && (!empty($row["Default"]) || $row["Default"] == "0"))
+	            $schema_create .= " DEFAULT '$row[Default]'";
+	        if ($row["Null"] != "YES")
+	            $schema_create .= " NOT NULL";
+	        if ($row["Extra"] != "")
+	            $schema_create .= " $row[Extra]";
+	        $schema_create .= ",$crlf";
+	    }
+	    $schema_create = ereg_replace(",".$crlf."$", "", $schema_create);
+	    $result = mysql_db_query($db, "SHOW KEYS FROM $table") or mysql_die();
+	    while ($row = mysql_fetch_array($result)) {
+	        $kname=$row['Key_name'];
+	        if (($kname != "PRIMARY") && ($row['Non_unique'] == 0))
+	            $kname="UNIQUE|$kname";
+	        if (!isset($index[$kname]))
+	            $index[$kname] = array();
+	        $index[$kname][] = $row['Column_name'];
+	    }
+	    while (list($x, $columns) = @each($index)){
+	        $schema_create .= ",$crlf";
+	        if ($x == "PRIMARY")
+	            $schema_create .= " PRIMARY KEY (`" . implode($columns, ", ") . "`)";
+
+	        else if (substr($x,0,6) == "UNIQUE")
+	            $schema_create .= " UNIQUE `".substr($x,7)."` (`".implode($columns,", ")."`)";
+	        else
+	            $schema_create .= " KEY `$x` (`" . implode($columns, ", ") . "`)";
+	    }
+	    $schema_create .= "$crlf)";
+	    return (stripslashes($schema_create));
+	}
+
+	function get_table_content($db, $table, $handler) {
+		$str = "";
+	    $result = mysql_db_query($db, "SELECT * FROM $table") or mysql_die();
+	    $i = 0;
+	    while($row = mysql_fetch_row($result)) {
+	        $table_list = "(";
+	        for($j=0; $j<mysql_num_fields($result);$j++)
+	            $table_list .= mysql_field_name($result,$j).", ";
+	        $table_list = substr($table_list,0,-2);
+	        $table_list .= ")";
+	        if(isset($GLOBALS["showcolumns"]))
+	            $schema_insert = "INSERT INTO `$table` $table_list VALUES (";
+	        else
+	            $schema_insert = "INSERT INTO `$table` VALUES (";
+	        for($j=0; $j<mysql_num_fields($result);$j++)  {
+	            if(!isset($row[$j]))
+	                $schema_insert .= " NULL,";
+	           elseif($row[$j] != "")
+	                $schema_insert .= " '".addslashes($row[$j])."',";
+	            else
+	            $schema_insert .= " '',";
+	        }
+	        $schema_insert = ereg_replace(",$", "", $schema_insert);
+	        $schema_insert .= ")";
+	        $str = $handler(trim($schema_insert), $str);
+	        $i++;
+	    }
+	    return ($str);
+	}
+
+	function my_handler($sql_insert, $str) {
+	    global $crlf, $asfile;
+	    $str .= "$sql_insert;$crlf";
+		return $str;
+	}
+
+
+	///////////////////
+
+	///////////////////
+
+	$crlf="\n";
+	$strTableStructure = "Table structure for table";
+	$strDumpingData = "Dumping data for table";
+	$tables = mysql_list_tables($db);
+	$num_tables = @mysql_numrows($tables);
+	$i = 0;
+	$str = "";
+
+
+	while($i < $num_tables){
+		$table = mysql_tablename($tables, $i);
+		$str .= $crlf;
+		$str .= "# --------------------------------------------------------$crlf";
+		$str .= "#$crlf";
+		$str .= "# $strTableStructure '$table'$crlf";
+		$str .= "#$crlf";
+		$str .= $crlf;
+		$str .= get_table_def($db, $table, $crlf).";$crlf$crlf";
+		$str .= "#$crlf";
+		$str .= "# $strDumpingData '$table'$crlf";
+		$str .= "#$crlf";
+		$str .= $crlf;
+		$str .= get_table_content($db, $table, "my_handler");
+		$i++;
+	}
+	echo $str;
+	mysql_close();
+?>
diff --git a/www/include/options/history.php b/www/include/options/history.php
new file mode 100644
index 0000000000000000000000000000000000000000..f9715fd4a1fafed7085d54b4ea7b5a2dab982506
--- /dev/null
+++ b/www/include/options/history.php
@@ -0,0 +1,114 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+?>
+<table cellpadding="0" cellspacing="0">
+<tr>
+	<td valign="top">
+		<table align="left" border="0">
+			<tr>
+				<td align="left"><? 
+					require_once './include/calendar/calendrier_historique.php';
+					echo calendar();	?>
+				</td>
+			</tr>
+		</table>
+	</td>
+	<td style="padding-left: 20px;"></td>
+	<td align="left" valign="top" width="100%">
+		<? $time = NULL;
+		if (!isset($_GET["o"]) || (isset($_GET["o"]) && !strcmp($_GET["o"], "")))				{
+			$ti = NULL;
+			$i = NULL;
+			if (!file_exists("./include/log/" . date("Ymd") . ".txt"))
+				system("touch  ./include/log/" . date("Ymd") . ".txt");
+			if (file_exists("./include/log/" . date("Ymd") . ".txt"))
+			{
+				$log = fopen("./include/log/" . date("Ymd") . ".txt", "r");
+				while ($str = fgets($log))
+				{
+					if (preg_match("/^\[([0-9]*)\][ ]*([.]*)/", $str, $matches))
+						$time = $matches[1];
+					if ($ti != date("G", $time))
+						$i = 0;
+					$res = preg_split("/\]/", $str);
+					$logs[date("G", $time)][$i] = $time. ";" .$res[1]  ;
+					$ltime[date("G", $time)][$i] = $time;
+					$i++;
+					$ti = date("G", $time);
+				}
+			}
+		?>
+		
+		<? } else if (isset($_GET["o"]) && isset($_GET["file"]) && (!strcmp($_GET["o"], "d") && strcmp($_GET["file"], "") && is_file("./include/log/" . $_GET["file"])))	{
+			$log = fopen("./include/log/" . $_GET["file"], "r");
+			if (ereg ("([0-9]{4})([0-9]{2})([0-9]{2})\.txt", $_GET["file"], $regs)) {
+				$date = mktime(0, 0, 0, $regs[2],$regs[3],$regs[1]);
+			} else {
+			 	$date = now();
+			}
+			$i = NULL;
+			$ti = NULL;
+			while ($str = fgets($log))				{
+				if (preg_match("/^\[([0-9]*)\][ ]*([.]*)/", $str, $matches)){
+					$time = $matches[1];}
+				if ($ti != date("G", $time))
+					$i = 0;
+				$res = preg_split("/\]/", $str);
+				$logs[date("G", $time)][$i] =  $time. ";" .$res[1];
+				$i++;
+				$ti = date("G", $time);
+			}
+			if (!$time)
+				$time = time();
+			}	?>
+			<table cellpadding="0" cellspacing="0">
+				<tr>
+					<td class='tabTableTitle'><? 
+						echo $lang['log_detail'];
+						if (isset($date))
+							echo date($lang["date_format"], $date);
+						else 
+							echo date($lang["date_format"]);
+							 ?>
+					</td>
+				</tr>
+				<tr>
+					<td class="tabTableForTab">
+						<table cellspacing=1 cellpadding=5 border=0 align="left">
+						<?
+						for ($t = 23; $t != -1; $t--){
+							if (isset($logs[$t])){
+								print "<tr bgColor=#eaecef><td colspan='3' class='text11b'>" . $t . ":00</td></tr>" ;
+								foreach ($logs[$t] as $l => $value){///$logs[1][0];
+									$r = preg_split("/;/", $value);
+									print "<tr bgColor='#eaecef'><td class='text11'>" . date($lang["time_format"], $r[0]) . "</td><td> $r[3]</td><td align=left> $r[1]";
+									if (strcmp($r[2], ""))
+										print " - $r[2]";
+									print "</td></tr>";
+								}
+							}
+						} ?>
+						</table>
+					</td>
+				</tr>
+			</table>
+	</td>
+	</tr>
+</table>
diff --git a/www/include/options/index.html b/www/include/options/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/lang/en.php b/www/include/options/lang/en.php
new file mode 100644
index 0000000000000000000000000000000000000000..ede2b3e8c38697ce97172cf2df1b54b6964ee678
--- /dev/null
+++ b/www/include/options/lang/en.php
@@ -0,0 +1,126 @@
+<?
+# Options Error
+
+$lang['requiredFields'] = "<font style='color: red;'>*</font> Require Fields";
+$lang['ErrValidPath'] = "The directory isn't valid";
+$lang['ErrReadPath'] = "Can't read directory";
+$lang['ErrExeBin'] = "Can't execute binary";
+$lang['ErrWrPath'] = "Can't write directory";
+$lang['ErrWrFile'] = "Can't write file";
+
+# LCA
+
+$lang['lca_infos'] = "General Informations";
+$lang['lca_add'] = "Add a ACL";
+$lang['lca_change'] = "Modify a ACL";
+$lang['lca_view'] = "View a ACL";
+$lang['lca_name'] = "ACL definition";
+$lang['lca_comment'] = "Comment";
+$lang['lca_type'] = "Type";
+$lang['lca_tpMenu'] = "Menu";
+$lang['lca_tpRes'] = "Resources";
+$lang['lca_tpBoth'] = "Both";
+$lang['lca_appCG'] = "Contact Groups implied";
+$lang['lca_cg'] = "Contact Groups";
+$lang['lca_sortRes'] = "Resources";
+$lang['lca_appRes'] = "Resources implied";
+$lang['lca_hg'] = "Host Groups";
+$lang['lca_hgChilds'] = "Include Host Groups -> Hosts";
+$lang['lca_sg'] = "Service Groups";
+$lang['lca_host'] = "Hosts";
+$lang['lca_sortTopo'] = "Topology";
+$lang['lca_appTopo'] = "Page implied";
+$lang['lca_topo'] = "Visible Page";
+
+# General Options
+
+$lang["genOpt_change"] = "Modify General Options";
+$lang["genOpt_nagios"] = "Nagios informations";
+$lang["genOpt_oreon"] = "Oreon informations";
+$lang["genOpt_snmp"] = "SNMP informations";
+$lang["genOpt_various"] = "Various Informations";
+$lang["genOpt_nagPath"] = "Directory";
+$lang["genOpt_nagBin"] = "Directory + Binary";
+$lang["genOpt_nagImg"] = "Images Directory";
+$lang["genOpt_nagPlug"] = "Plugins Directory";
+$lang["genOpt_nagVersion"] = "Nagios Release";
+$lang["genOpt_oPath"] = "Directory";
+$lang["genOpt_webPath"] = "Oreon Web Directory";
+$lang["genOpt_oRrdbPath"] = "rrd Directory";
+$lang["genOpt_oRefresh"] = "Refresh Interval (in seconds)";
+$lang["genOpt_oExpire"] = "Sessions Expiration Time (in minutes)";
+$lang["genOpt_oHCUP"] = "Host UP Color";
+$lang["genOpt_oHCDW"] = "Host DOWN Color";
+$lang["genOpt_oHCUN"] = "Host UNREACHABLE Color";
+$lang["genOpt_oSOK"] = "Service OK Color";
+$lang["genOpt_oSWN"] = "Service WARNING Color";
+$lang["genOpt_oSCT"] = "Service CRITICAL Color";
+$lang["genOpt_oSPD"] = "Service PENDING Color";
+$lang["genOpt_oSUK"] = "Service UNKNOWN Color";
+$lang["genOpt_snmpCom"] = "Global Community";
+$lang["genOpt_snmpVer"] = "Version";
+$lang["genOpt_mailer"] = "Directory + Mailer Binary";
+$lang["genOpt_rrdtool"] = "Directory + RRDTOOL Binary";
+$lang["genOpt_rrdtoolV"] = "RRDTOOL Version";
+$lang["genOpt_perfparse"] = "Using PerfParse";
+$lang["genOpt_colorPicker"] = "Pick a color";
+$lang["genOpt_maxViewMonitoring"] = "Limit per page for Monitoring";
+$lang["genOpt_maxViewConfiguration"] = "Limit per page (default)";
+$lang["genOpt_snmp_trapd_pathConf"] = "Directory + Conf File SNMPTrapd";
+$lang["genOpt_snmp_trapd_pathBin"] = "Directory + Daemon SNMPTrapd (/etc/init.d/...)";
+$lang["genOpt_template"] = "Template";
+$lang["genOpt_ldap"] = "LDAP informations";
+$lang["genOpt_ldap_host"] = "LDAP Server";
+$lang["genOpt_ldap_port"] = "LDAP Port";
+$lang["genOpt_ldap_base_dn"] = "LDAP Base DN";
+$lang["genOpt_ldap_login_attrib"] = "LDAP Login Attribut";
+$lang["genOpt_ldap_ssl"] = "Enable LDAP over SSL";
+$lang["genOpt_ldap_auth_enable"] = "Enable LDAP authentification";
+
+# Menu
+
+$lang['menu_infos'] = "Menu Information";
+$lang['menu_mod'] = "Modules Availables";
+$lang['menu_modRules'] = "A module can contain information which will be quickly integrate";
+$lang['menu_modRule1'] = "Files to generate -> /MODULES/generate_files/";
+$lang['menu_modRule2'] = "Sql Files -> /MODULES/sql/";
+$lang['menu_modRule3'] = "Lang Files -> /MODULES/lang/";
+$lang['menu_modInfos'] = "Module Informations";
+$lang['menu_modGen'] = "Generation";
+$lang['menu_modSql'] = "Sql";
+$lang['menu_modLang'] = "Lang Files Available";
+$lang["menu_listName"] = "Name";
+$lang["menu_listDir"] = "Directory";
+$lang["menu_listGen"] = "Generation";
+$lang["menu_listLang"] = "Lang";
+$lang["menu_listSql"] = "Sql";
+
+# Session
+
+$lang['kick_user'] = "Kick User";
+$lang['distant_location'] = "IP Address";
+$lang['wi_user'] = "Users";
+$lang['wi_where'] = "Localisation";
+$lang['wi_last_req'] = "Last request";
+$lang['kicked_user'] = "User Kicked";
+
+# Lang
+
+$lang['lang_title'] = "Lang Files management";
+$lang['lang_user'] = "Default User Lang :";
+$lang['lang_gen'] = "Main Lang Files Availables :";
+$lang['lang_genUse'] = "Main Lang File Used :";
+
+$lang['lang_mod'] = "Module";
+$lang['lang_av'] = "Lang Availables";
+$lang['lang_use'] = "Lang Used";
+$lang['lang_none'] = "None";
+
+# My Account
+
+$lang["myAcc_change"] = "Change my settings";
+
+# Tasks
+
+$lang["m_task"] = "Tasks";
+?>
\ No newline at end of file
diff --git a/www/include/options/lang/fr.php b/www/include/options/lang/fr.php
new file mode 100644
index 0000000000000000000000000000000000000000..c17287484d57eb875ee5b29538757ec1777afb17
--- /dev/null
+++ b/www/include/options/lang/fr.php
@@ -0,0 +1,128 @@
+<?
+# Options Error
+
+$lang['requiredFields'] = "<font style='color: red;'>*</font> Champs requis";
+$lang['ErrValidPath'] = "Le r&eacute;pertoire n'est pas valide";
+$lang['ErrReadPath'] = "Le r&eacute;pertoire n'est pas en lecture";
+$lang['ErrExeBin'] = "Le binaire n'est pas executable";
+$lang['ErrWrPath'] = "Le r&eacute;pertoire n'est pas en &eacute;criture";
+$lang['ErrWrFile'] = "Le fichier n'est pas en &eacute;criture";
+
+# LCA
+
+$lang['lca_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang['lca_add'] = "Ajouter une LCA";
+$lang['lca_change'] = "Modifier une LCA";
+$lang['lca_view'] = "Afficher une LCA";
+$lang['lca_name'] = "D&eacute;finition de la LCA";
+$lang['lca_comment'] = "Commentaire";
+$lang['lca_type'] = "Type";
+$lang['lca_tpMenu'] = "Menu";
+$lang['lca_tpRes'] = "Ressources";
+$lang['lca_tpBoth'] = "Les deux";
+$lang['lca_appCG'] = "Groupes Utilisateurs concern&eacute;s";
+$lang['lca_cg'] = "Groupes Utilisateurs";
+$lang['lca_sortRes'] = "Ressources";
+$lang['lca_appRes'] = "Ressources impact&eacute;es";
+$lang['lca_hg'] = "Host Groups";
+$lang['lca_hgChilds'] = "Inclure les Hosts du Host Groups";
+$lang['lca_sg'] = "Service Groups";
+$lang['lca_host'] = "Hosts";
+$lang['lca_sortTopo'] = "Topologie";
+$lang['lca_appTopo'] = "Pages concern&eacute;es";
+$lang['lca_topo'] = "Pages visibles";
+
+# General Options
+
+$lang["genOpt_change"] = "Modifier les Options G&eacute;n&eacute;rales";
+$lang["genOpt_nagios"] = "Informations sur Nagios";
+$lang["genOpt_oreon"] = "Informations sur Oreon";
+$lang["genOpt_snmp"] = "Informations sur SNMP";
+$lang["genOpt_various"] = "Informations diverses";
+$lang["genOpt_nagPath"] = "R&eacute;pertoire";
+$lang["genOpt_nagBin"] = "R&eacute;pertoire + Binaire";
+$lang["genOpt_nagImg"] = "R&eacute;pertoire Images";
+$lang["genOpt_nagPlug"] = "R&eacute;pertoire Sondes";
+$lang["genOpt_nagVersion"] = "Version de Nagios";
+$lang["genOpt_oPath"] = "R&eacute;pertoire";
+$lang["genOpt_webPath"] = "R&eacute;pertoire Web";
+$lang["genOpt_oRrdbPath"] = "R&eacute;pertoire des Bases rrd";
+$lang["genOpt_oRefresh"] = "Interval de rafraichissement (en secondes)";
+$lang["genOpt_oExpire"] = "Expiration des Sessions (en minutes)";
+$lang["genOpt_oHCUP"] = "Couleur Host UP";
+$lang["genOpt_oHCDW"] = "Couleur Host DOWN";
+$lang["genOpt_oHCUN"] = "Couleur Host UNREACHABLE";
+$lang["genOpt_oSOK"] = "Couleur Service OK";
+$lang["genOpt_oSWN"] = "Couleur Service WARNING";
+$lang["genOpt_oSCT"] = "Couleur Service CRITICAL";
+$lang["genOpt_oSPD"] = "Couleur Service PENDING";
+$lang["genOpt_oSUK"] = "Couleur Service UNKNOWN";
+$lang["genOpt_snmpCom"] = "Communaut&eacute; Globale";
+$lang["genOpt_snmpVer"] = "Version";
+$lang["genOpt_mailer"] = "R&eacute;pertoire + Binaire du Mailer";
+$lang["genOpt_rrdtool"] = "R&eacute;pertoire + Binaire de RRDTOOL";
+$lang["genOpt_rrdtoolV"] = "Version de RRDTOOL";
+$lang["genOpt_perfparse"] = "Utilisation de PerfParse";
+$lang["genOpt_colorPicker"] = "Choisissez une couleur";
+$lang["genOpt_maxViewMonitoring"] = "Limite par page dans le Monitoring";
+$lang["genOpt_maxViewConfiguration"] = "Limite par page (par default)";
+$lang["genOpt_snmp_trapd_pathConf"] = "R&eacute;pertoire + Fichier de conf SNMPTrapd";
+$lang["genOpt_snmp_trapd_pathBin"] = "R&eacute;pertoire + D&eacute;mon SNMPTrapd (/etc/init.d/...)";
+$lang["genOpt_template"] = "Template";
+$lang["genOpt_ldap"] = "Informations sur LDAP";
+$lang["genOpt_ldap_host"] = "Serveur LDAP";
+$lang["genOpt_ldap_port"] = "Port LDAP";
+$lang["genOpt_ldap_base_dn"] = "Base DN LDAP";
+$lang["genOpt_ldap_login_attrib"] = "LDAP Login Attribut";
+$lang["genOpt_ldap_ssl"] = "Activ&eacute; le support SSL pour le LDAP";
+$lang["genOpt_ldap_auth_enable"] = "Activ&eacute; l'authentification LDAP";
+
+
+# Menu
+
+$lang['menu_infos'] = "Informations sur le Menu";
+$lang['menu_mod'] = "Modules disponibles";
+$lang['menu_modRules'] = "Un module peut contenir des informations qui seront int&eacute;gr&eacute;es automatiquement.";
+$lang['menu_modRule1'] = "Des fichiers &agrave; g&eacute;n&eacute;rer -> /MODULES/generate_files/";
+$lang['menu_modRule2'] = "Des fichiers SQL -> /MODULES/sql/";
+$lang['menu_modRule3'] = "Des fichiers de langue -> /MODULES/lang/";
+$lang['menu_modInfos'] = "Informations sur le Module";
+$lang['menu_modGen'] = "G&eacute;n&eacute;ration";
+$lang['menu_modSql'] = "SQL";
+$lang['menu_modLang'] = "Fichier de langue disponible";
+$lang["menu_listName"] = "Nom";
+$lang["menu_listDir"] = "R&eacute;pertoire";
+$lang["menu_listGen"] = "G&eacute;n&eacute;ration";
+$lang["menu_listLang"] = "Langue";
+$lang["menu_listSql"] = "SQL";
+
+# Session
+
+$lang['kick_user'] = "D&eacute;connecter l&#146;utilisateur";
+$lang['distant_location'] = "Adresse IP";
+$lang['wi_user'] = "Utilisateurs";
+$lang['wi_where'] = "Localisation";
+$lang['wi_last_req'] = "Derni&egrave;re Requ&ecirc;te";
+$lang['kicked_user'] = "Utilisateur d&eacute;connect&eacute;";
+
+# Lang
+
+$lang['lang_title'] = "Gestion des fichiers de Langue";
+$lang['lang_user'] = "Langue Utilisateur par d&eacute;faut :";
+$lang['lang_gen'] = "Langues Principales disponibles";
+$lang['lang_genUse'] = "Langue Principale utilis&eacute;e";
+
+$lang['lang_mod'] = "Module";
+$lang['lang_av'] = "Langues disponibles";
+$lang['lang_use'] = "Langue utilis&eacute;e";
+$lang['lang_none'] = "Aucune";
+
+# My Account
+
+$lang["myAcc_change"] = "Modifier mes param&egrave;tres";
+
+# Taches
+
+$lang["m_task"] = "T&acirc;ches";
+
+?>
\ No newline at end of file
diff --git a/www/include/options/oreon/generalOpt/DB-Func.php b/www/include/options/oreon/generalOpt/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..bf0d02db75f5436496a45491e31816f2195c28ed
--- /dev/null
+++ b/www/include/options/oreon/generalOpt/DB-Func.php
@@ -0,0 +1,107 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function is_valid_path($path) {
+		if (is_dir($path))
+		    return true;
+		 else
+		 	return false;
+	 }
+
+	function is_readable_path($path) {
+		if (is_dir($path) && is_readable($path))
+			return true;
+		return false;
+	}
+
+	function is_executable_binary($path)  {
+		if (is_file($path) && is_executable($path))
+			return true;
+		return false;
+	}
+
+	function is_writable_path($path)      {
+		if (is_dir($path) && is_writable($path))
+			return true;
+		return false;
+	}
+
+	function is_writable_file($path)      {
+		if (is_file($path) && is_writable($path))
+			return true;
+		return false;
+	}
+
+	function updateGeneralOptInDB ($gopt_id = NULL)	{
+		if (!$gopt_id) return;
+		updateGeneralOpt($gopt_id);
+	}
+
+	function updateGeneralOpt($gopt_id = null)	{
+		if (!$gopt_id) return;
+		global $form;
+		global $pearDB;
+		global $oreon;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE `general_opt` SET ";
+		$rq .= "nagios_path = '".htmlentities($ret["nagios_path"], ENT_QUOTES)."', " .
+				"nagios_path_bin = '".htmlentities($ret["nagios_path_bin"], ENT_QUOTES)."', " .
+				"nagios_path_img = '".htmlentities($ret["nagios_path_img"], ENT_QUOTES)."', " .
+				"nagios_path_plugins = '".htmlentities($ret["nagios_path_plugins"], ENT_QUOTES)."', " .
+				"nagios_version = '".$ret["nagios_version"]."', " .
+				"snmp_community = '".$ret["snmp_community"]."', " .
+				"snmp_version = '".$ret["snmp_version"]."', " .
+				"snmp_trapd_path_daemon = '".$ret["snmp_trapd_path_daemon"]."', " .
+				"snmp_trapd_path_conf = '".$ret["snmp_trapd_path_conf"]."', " .
+				"mailer_path_bin = '".htmlentities($ret["mailer_path_bin"], ENT_QUOTES)."', " .
+				"rrdtool_path_bin = '".htmlentities($ret["rrdtool_path_bin"], ENT_QUOTES)."', " .
+				"rrdtool_version = '".htmlentities($ret["rrdtool_version"], ENT_QUOTES)."', " .
+				"oreon_path = '".htmlentities($ret["oreon_path"], ENT_QUOTES)."', " .
+				"oreon_web_path = '".htmlentities($ret["oreon_web_path"], ENT_QUOTES)."', " .
+				"oreon_rrdbase_path = '".htmlentities($ret["oreon_rrdbase_path"], ENT_QUOTES)."', " .
+				"oreon_refresh = '".htmlentities($ret["oreon_refresh"], ENT_QUOTES)."', " .
+				"color_up = '".htmlentities($ret["color_up"], ENT_QUOTES)."', " .
+				"color_down = '".htmlentities($ret["color_down"], ENT_QUOTES)."', " .
+				"color_unreachable = '".htmlentities($ret["color_unreachable"], ENT_QUOTES)."', " .
+				"color_ok = '".htmlentities($ret["color_ok"], ENT_QUOTES)."', " .
+				"color_warning = '".htmlentities($ret["color_warning"], ENT_QUOTES)."', " .
+				"color_critical = '".htmlentities($ret["color_critical"], ENT_QUOTES)."', " .
+				"color_pending = '".htmlentities($ret["color_pending"], ENT_QUOTES)."', " .
+				"color_unknown = '".htmlentities($ret["color_unknown"], ENT_QUOTES)."', " .
+				"session_expire = '".htmlentities($ret["session_expire"], ENT_QUOTES)."', " .
+				"perfparse_installed = '".htmlentities($ret["perfparse_installed"]["perfparse_installed"], ENT_QUOTES)."', " .
+				"maxViewMonitoring = '".htmlentities($ret["maxViewMonitoring"], ENT_QUOTES)."', " .
+				"maxViewConfiguration = '".htmlentities($ret["maxViewConfiguration"], ENT_QUOTES)."', " .
+				"template = '".htmlentities($ret["template"], ENT_QUOTES)."', " .
+				"ldap_host = '".htmlentities($ret["ldap_host"], ENT_QUOTES)."', " .
+				"ldap_port = '".htmlentities($ret["ldap_port"], ENT_QUOTES)."', " .
+				"ldap_base_dn = '".htmlentities($ret["ldap_base_dn"], ENT_QUOTES)."', " .
+				"ldap_login_attrib = '".htmlentities($ret["ldap_login_attrib"], ENT_QUOTES)."', " .
+				"ldap_ssl = '".htmlentities($ret["ldap_ssl"]["ldap_ssl"], ENT_QUOTES)."', " .
+				"ldap_auth_enable = '".htmlentities($ret["ldap_auth_enable"]["ldap_auth_enable"], ENT_QUOTES)."' " .
+				"WHERE gopt_id = '".$gopt_id."'";
+		$pearDB->query($rq);
+		$oreon->optGen = array();
+		$res =& $pearDB->query("SELECT * FROM `general_opt` LIMIT 1");
+		$oreon->optGen = $res->fetchRow();
+		$oreon->user->version = $ret["nagios_version"];
+	}
+?>
\ No newline at end of file
diff --git a/www/include/options/oreon/generalOpt/formGeneralOpt.ihtml b/www/include/options/oreon/generalOpt/formGeneralOpt.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..35d91b25514bc3fa4e69557345d2612503ac8683
--- /dev/null
+++ b/www/include/options/oreon/generalOpt/formGeneralOpt.ihtml
@@ -0,0 +1,119 @@
+<script type="text/javascript" src="include/configuration/changetab.js"></script>
+{$form.javascript}
+
+{$colorJS}
+<form {$form.attributes}>
+<div>
+	<ul id="mainnav">
+		<li class="a" id='c1'><a href="#"  onclick="javascript:montre('1');">General Configuration</a></li>
+		<li class="b" id='c2'><a href="#" onclick="javascript:montre('2');">Nagios</a></li>
+		<li class="b" id='c3'><a href="#" onclick="javascript:montre('3');">Colors</a></li>
+		<li class="b" id='c4'><a href="#" onclick="javascript:montre('4');">SNMP</a></li>
+		<li class="b" id='c5'><a href="#" onclick="javascript:montre('5');">RRDTool</a></li>
+		<li class="b" id='c6'><a href="#" onclick="javascript:montre('6');">LDAP</a></li>
+	</ul>
+</div>
+<div id="tab1" class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/lifebelt.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/oreon.gif'>&nbsp;&nbsp;{$form.header.oreon}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.oreon_path.label}</td><td class="FormRowValue">{$form.oreon_path.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.oreon_web_path.label}</td><td class="FormRowValue">{$form.oreon_web_path.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.oreon_rrdbase_path.label}</td><td class="FormRowValue">{$form.oreon_rrdbase_path.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.oreon_refresh.label}</td><td class="FormRowValue">{$form.oreon_refresh.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.session_expire.label}</td><td class="FormRowValue">{$form.session_expire.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.maxViewMonitoring.label}</td><td class="FormRowValue">{$form.maxViewMonitoring.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.maxViewConfiguration.label}</td><td class="FormRowValue">{$form.maxViewConfiguration.html}</td></tr>
+	 	<tr class="list_one"><td class="FormRowField">{$form.template.label}</td><td class="FormRowValue">{$form.template.html}</td></tr>
+	 </table>
+</div>
+<div id="tab2" class="tab">
+	<table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/lifebelt.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/nagios.gif'>&nbsp;&nbsp;{$form.header.nagios}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.nagios_path.label}</td><td class="FormRowValue">{$form.nagios_path.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.nagios_path_bin.label}</td><td class="FormRowValue">{$form.nagios_path_bin.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.nagios_path_img.label}</td><td class="FormRowValue">{$form.nagios_path_img.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.nagios_path_plugins.label}</td><td class="FormRowValue">{$form.nagios_path_plugins.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.nagios_version.label}</td><td class="FormRowValue">{$form.nagios_version.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.mailer_path_bin.label}</td><td class="FormRowValue">{$form.mailer_path_bin.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.perfparse_installed.label}</td><td class="FormRowValue">{$form.perfparse_installed.html}</td></tr>
+	</table>
+</div>
+<div id="tab3" class="tab">
+	<table id="ListTable">
+		<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/lifebelt.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_two"><td class="FormRowField">{$form.color_up.label}</td><td class="FormRowValue">
+        {$form.color_up.html}&nbsp;&nbsp;{$form.color_up_color.html}&nbsp;&nbsp;{$form.color_up_modify.html}
+        </td></tr>
+
+		<tr class="list_one"><td class="FormRowField">{$form.color_down.label}</td><td class="FormRowValue">
+        {$form.color_down.html}&nbsp;&nbsp;{$form.color_down_color.html}&nbsp;&nbsp;{$form.color_down_modify.html}
+        </td></tr>
+
+		<tr class="list_two"><td class="FormRowField">{$form.color_unreachable.label}</td><td class="FormRowValue">
+        {$form.color_unreachable.html}&nbsp;&nbsp;{$form.color_unreachable_color.html}&nbsp;&nbsp;{$form.color_unreachable_modify.html}
+        </td></tr>
+
+		<tr class="list_one"><td class="FormRowField">{$form.color_ok.label}</td><td class="FormRowValue">
+        {$form.color_ok.html}&nbsp;&nbsp;{$form.color_ok_color.html}&nbsp;&nbsp;{$form.color_ok_modify.html}
+        </td></tr>
+
+		<tr class="list_two"><td class="FormRowField">{$form.color_warning.label}</td><td class="FormRowValue">
+        {$form.color_warning.html}&nbsp;&nbsp;{$form.color_warning_color.html}&nbsp;&nbsp;{$form.color_warning_modify.html}
+        </td></tr>
+
+		<tr class="list_one"><td class="FormRowField">{$form.color_critical.label}</td><td class="FormRowValue">
+        {$form.color_critical.html}&nbsp;&nbsp;{$form.color_critical_color.html}&nbsp;&nbsp;{$form.color_critical_modify.html}
+        </td></tr>
+
+		<tr class="list_two"><td class="FormRowField">{$form.color_pending.label}</td><td class="FormRowValue">
+        {$form.color_pending.html}&nbsp;&nbsp;{$form.color_pending_color.html}&nbsp;&nbsp;{$form.color_pending_modify.html}
+        </td></tr>
+
+		<tr class="list_one"><td class="FormRowField">{$form.color_unknown.label}</td><td class="FormRowValue">
+        {$form.color_unknown.html}&nbsp;&nbsp;{$form.color_unknown_color.html}&nbsp;&nbsp;{$form.color_unknown_modify.html}
+        </td></tr>
+	</table>
+</div>
+<div id="tab4" class="tab">
+	<table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/lifebelt.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/step.gif'>&nbsp;&nbsp;{$form.header.snmp}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.snmp_community.label}</td><td class="FormRowValue">{$form.snmp_community.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.snmp_version.label}</td><td class="FormRowValue">{$form.snmp_version.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.snmp_trapd_path_conf.label}</td><td class="FormRowValue">{$form.snmp_trapd_path_conf.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.snmp_trapd_path_daemon.label}</td><td class="FormRowValue">{$form.snmp_trapd_path_daemon.html}</td></tr>
+	</table>
+</div>
+<div id="tab5" class="tab">
+	<table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/lifebelt.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/layout_vertical.gif'>&nbsp;&nbsp;{$form.header.various}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.rrdtool_path_bin.label}</td><td class="FormRowValue">{$form.rrdtool_path_bin.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.rrdtool_version.label}</td><td class="FormRowValue">{$form.rrdtool_version.html}</td></tr>
+	</table>
+</div>
+<div id="tab6" class="tab">
+	<table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/lifebelt.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/users_family.gif'>&nbsp;&nbsp;{$form.header.ldap}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.ldap_auth_enable.label}</td><td class="FormRowValue">{$form.ldap_auth_enable.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.ldap_host.label}</td><td class="FormRowValue">{$form.ldap_host.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.ldap_port.label}</td><td class="FormRowValue">{$form.ldap_port.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.ldap_base_dn.label}</td><td class="FormRowValue">{$form.ldap_base_dn.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.ldap_login_attrib.label}</td><td class="FormRowValue">{$form.ldap_login_attrib.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.ldap_ssl.label}</td><td class="FormRowValue">{$form.ldap_ssl.html}</td></tr>
+	</table>
+</div>
+	{if !$valid}
+		<div id="validForm">
+			<p>{$form.submitC.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+		</div>
+	{else}
+		<div id="validForm">
+			<p>{$form.change.html}</p>
+		</div>
+	{/if}
+	{$form.hidden}
+</form>
\ No newline at end of file
diff --git a/www/include/options/oreon/generalOpt/formGeneralOpt.php b/www/include/options/oreon/generalOpt/formGeneralOpt.php
new file mode 100644
index 0000000000000000000000000000000000000000..33daccbf794d977719c069d20adc675df36c2806
--- /dev/null
+++ b/www/include/options/oreon/generalOpt/formGeneralOpt.php
@@ -0,0 +1,241 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	#
+	## Database retrieve information for LCA
+	#
+	$res =& $pearDB->query("SELECT * FROM general_opt LIMIT 1");
+	# Set base value
+	$gopt = array_map("myDecode", $res->fetchRow());
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+
+	$attrsText 		= array("size"=>"40");
+	$attrsText2		= array("size"=>"5");
+	$attrsAdvSelect = null;
+
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	$form->addElement('header', 'title', $lang["genOpt_change"]);
+
+	#
+	## Nagios information
+	#
+	$form->addElement('header', 'nagios', $lang['genOpt_nagios']);
+	$form->addElement('text', 'nagios_path', $lang["genOpt_nagPath"], $attrsText);
+	$form->addElement('text', 'nagios_path_bin', $lang["genOpt_nagBin"], $attrsText);
+	$form->addElement('text', 'nagios_path_img', $lang["genOpt_nagImg"], $attrsText);
+	$form->addElement('text', 'nagios_path_plugins', $lang["genOpt_nagPlug"], $attrsText);
+	$form->addElement('select', 'nagios_version', $lang["genOpt_nagVersion"], array(1=>"1", 2=>"2"));
+
+	#
+	## Oreon information
+	#
+	$form->addElement('header', 'oreon', $lang['genOpt_oreon']);
+	$form->addElement('text', 'oreon_path', $lang["genOpt_oPath"], $attrsText);
+	$form->addElement('text', 'oreon_web_path', $lang["genOpt_webPath"], $attrsText);
+	$form->addElement('text', 'oreon_rrdbase_path', $lang["genOpt_oRrdbPath"], $attrsText);
+	$form->addElement('text', 'oreon_refresh', $lang["genOpt_oRefresh"], $attrsText2);
+	$form->addElement('text', 'session_expire', $lang["genOpt_oExpire"], $attrsText2);
+
+	$form->addElement('text', 'maxViewMonitoring', $lang["genOpt_maxViewMonitoring"], $attrsText2);
+	$form->addElement('text', 'maxViewConfiguration', $lang["genOpt_maxViewConfiguration"], $attrsText2);
+
+	$templates = array();
+	if ($handle  = @opendir($oreon->optGen["oreon_path"]."www/Themes/"))	{
+		while ($file = @readdir($handle))
+			if (!is_file($oreon->optGen["oreon_path"]."www/Themes/".$file) && $file != "." && $file != ".." && $file != ".svn")
+				$templates[$file] = $file;
+		@closedir($handle);
+	}
+	$form->addElement('select', 'template', $lang["genOpt_template"], $templates);
+
+	$TabColorNameAndLang = array("color_up"=>"genOpt_oHCUP",
+                                    	"color_down"=>"genOpt_oHCDW",
+                                    	"color_unreachable"=>"genOpt_oHCUN",
+                                    	"color_ok"=>"genOpt_oSOK",
+                                    	"color_warning"=>"genOpt_oSWN",
+                                    	"color_critical"=>"genOpt_oSCT",
+                                    	"color_pending"=>"genOpt_oSPD",
+                                    	"color_unknown"=>"genOpt_oSUK",
+					);
+
+	while (list($nameColor, $val) = each($TabColorNameAndLang))
+	{
+		$nameLang = $lang[$val];
+		$codeColor = $gopt[$nameColor];
+		$title = $lang["genOpt_colorPicker"];
+		$attrsText3 	= array("value"=>$nameColor,"size"=>"8","maxlength"=>"7");
+		$form->addElement('text', $nameColor, $nameLang,  $attrsText3);
+		if ($form->validate())	{
+			$colorColor = $form->exportValue($nameColor);
+		}
+		$attrsText4 	= array("style"=>"width:50px; height:18px; background: ".$codeColor." url() left repeat-x 0px; border-color:".$codeColor.";");
+		$attrsText5 	= array("onclick"=>"popup_color_picker('$nameColor','$nameLang','$title');");
+		$form->addElement('button', $nameColor.'_color', "", $attrsText4);
+		if (!$form->validate())	{
+			$form->addElement('button', $nameColor.'_modify', $lang['modify'], $attrsText5);
+		}
+	}
+
+	#
+	## SNMP information
+	#
+	$form->addElement('header', 'snmp', $lang["genOpt_snmp"]);
+	$form->addElement('text', 'snmp_community', $lang["genOpt_snmpCom"], $attrsText2);
+	$form->addElement('select', 'snmp_version', $lang["genOpt_snmpVer"], array("0"=>"1", "1"=>"2", "2"=>"2c"), $attrsAdvSelect);
+	$form->addElement('text', 'snmp_trapd_path_conf', $lang["genOpt_snmp_trapd_pathConf"], $attrsText);
+	$form->addElement('text', 'snmp_trapd_path_daemon', $lang["genOpt_snmp_trapd_pathBin"], $attrsText);
+
+    #
+	## LDAP information
+	#
+	$form->addElement('header', 'ldap', $lang["genOpt_ldap"]);
+	$form->addElement('text', 'ldap_host', $lang["genOpt_ldap_host"], $attrsText );
+	$form->addElement('text', 'ldap_port', $lang["genOpt_ldap_port"],  $attrsText2);
+	$form->addElement('text', 'ldap_base_dn', $lang["genOpt_ldap_base_dn"], $attrsText);
+	$form->addElement('text', 'ldap_login_attrib', $lang["genOpt_ldap_login_attrib"], $attrsText);
+	$ldapUseSSL[] = &HTML_QuickForm::createElement('radio', 'ldap_ssl', null, $lang["yes"], '1');
+	$ldapUseSSL[] = &HTML_QuickForm::createElement('radio', 'ldap_ssl', null, $lang["no"], '0');
+	$form->addGroup($ldapUseSSL, 'ldap_ssl', $lang["genOpt_ldap_ssl"], '&nbsp;');
+	$ldapEnable[] = &HTML_QuickForm::createElement('radio', 'ldap_auth_enable', null, $lang["yes"], '1');
+	$ldapEnable[] = &HTML_QuickForm::createElement('radio', 'ldap_auth_enable', null, $lang["no"], '0');
+	$form->addGroup($ldapEnable, 'ldap_auth_enable', $lang["genOpt_ldap_auth_enable"], '&nbsp;');
+
+	#
+	## Various information
+	#
+	$form->addElement('header', 'various', $lang["genOpt_various"]);
+	$form->addElement('text', 'mailer_path_bin', $lang["genOpt_mailer"], $attrsText);
+	$form->addElement('text', 'rrdtool_path_bin', $lang["genOpt_rrdtool"], $attrsText);
+	$form->addElement('text', 'rrdtool_version', $lang["genOpt_rrdtoolV"], $attrsText2);
+	$ppUse[] = &HTML_QuickForm::createElement('radio', 'perfparse_installed', null, $lang["yes"], '1');
+	$ppUse[] = &HTML_QuickForm::createElement('radio', 'perfparse_installed', null, $lang["no"], '0');
+	$form->addGroup($ppUse, 'perfparse_installed', $lang["genOpt_perfparse"], '&nbsp;');
+
+	$form->addElement('hidden', 'gopt_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	function slash($elem = NULL)	{
+		if ($elem)
+			return rtrim($elem, "/")."/";
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('nagios_path', 'slash');
+	//$form->applyFilter('nagios_path_bin', 'slash');
+	$form->applyFilter('nagios_path_img', 'slash');
+	$form->applyFilter('nagios_path_plugins', 'slash');
+	$form->applyFilter('oreon_path', 'slash');
+	$form->applyFilter('oreon_web_path', 'slash');
+	$form->applyFilter('oreon_rrdbase_path', 'slash');
+	$form->registerRule('is_valid_path', 'callback', 'is_valid_path');
+	$form->registerRule('is_readable_path', 'callback', 'is_readable_path');
+	$form->registerRule('is_executable_binary', 'callback', 'is_executable_binary');
+	$form->registerRule('is_writable_path', 'callback', 'is_writable_path');
+	$form->registerRule('is_writable_file', 'callback', 'is_writable_file');
+	$form->addRule('oreon_path', $lang['ErrWrPath'], 'is_valid_path');
+	$form->addRule('nagios_path_plugins', $lang['ErrWrPath'], 'is_writable_path');
+	$form->addRule('nagios_path_img', $lang['ErrWrPath'], 'is_writable_path');
+	$form->addRule('nagios_path', $lang['ErrValidPath'], 'is_valid_path');
+	$form->addRule('nagios_path_bin', $lang['ErrExeBin'], 'is_executable_binary');
+	$form->addRule('mailer_path_bin', $lang['ErrExeBin'], 'is_executable_binary');
+	$form->addRule('rrdtool_path_bin', $lang['ErrExeBin'], 'is_executable_binary');
+	$form->addRule('oreon_rrdbase_path', $lang['ErrWrPath'], 'is_writable_path');
+	$form->addRule('snmp_trapd_path_conf', $lang['ErrWrFile'], 'is_writable_file');
+
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	$form->setDefaults($gopt);
+
+	$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+	$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+
+	#
+	##Picker Color JS
+	#
+	$tpl->assign('colorJS',"
+	<script type='text/javascript'>
+		function popup_color_picker(t,name,title)
+		{
+			var width = 400;
+			var height = 300;
+			window.open('./include/common/javascript/color_picker.php?n='+t+'&name='+name+'&title='+title, 'cp', 'resizable=no, location=no, width='
+						+width+', height='+height+', menubar=no, status=yes, scrollbars=no, menubar=no');
+		}
+	</script>
+    "
+    );
+	#
+	##End of Picker Color
+	#
+
+    $valid = false;
+	if ($form->validate())	{
+		# Update in DB
+		updateGeneralOptInDB($form->getSubmitValue("gopt_id"));
+		# Update in Oreon Object
+		$oreon->optGen = array();
+		$res2 =& $pearDB->query("SELECT * FROM `general_opt` LIMIT 1");
+		$oreon->optGen = $res2->fetchRow();
+		$o = "w";
+   		$valid = true;
+		$form->freeze();
+	}
+
+	$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."'"));
+
+
+	#
+	##Apply a template definition
+	#
+
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+	$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+	$form->accept($renderer);
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->assign('o', $o);
+	$tpl->assign('valid', $valid);
+	$tpl->display("formGeneralOpt.ihtml");
+?>
diff --git a/www/include/options/oreon/generalOpt/generalOpt.php b/www/include/options/oreon/generalOpt/generalOpt.php
new file mode 100644
index 0000000000000000000000000000000000000000..c9dc78a16c25976aa0b304ba0d149d20ff0d4e1d
--- /dev/null
+++ b/www/include/options/oreon/generalOpt/generalOpt.php
@@ -0,0 +1,42 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["gopt_id"]) ? $cG = $_GET["gopt_id"] : $cG = NULL;
+	isset($_POST["lca_id"]) ? $cP = $_POST["gopt_id"] : $cP = NULL;
+	$cG ? $gopt_id = $cG : $gopt_id = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the option dir
+	$path = "./include/options/oreon/generalOpt/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		default : require_once($path."formGeneralOpt.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/options/oreon/language/lang.ihtml b/www/include/options/oreon/language/lang.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..87b6fbd5e59b96ca6b09978f02d4e5d9d37fd98f
--- /dev/null
+++ b/www/include/options/oreon/language/lang.ihtml
@@ -0,0 +1,12 @@
+<div id="lang">
+<h1>{$title}</h1>
+	{section name=elem loop=$elemArr}
+    <dl>
+        <dt>{$elemArr[elem].ModuleTitle}</dt>
+        <dd>{$elemArr[elem].LangDispoName}&nbsp;&nbsp;{$elemArr[elem].LangDispo}</dd>
+        <dd>{$elemArr[elem].LangUtilName}&nbsp;&nbsp;{$elemArr[elem].LangUtil}</dd>
+    </dl>
+    <br>
+	{/section}
+</div>
+
diff --git a/www/include/options/oreon/language/lang.php b/www/include/options/oreon/language/lang.php
new file mode 100644
index 0000000000000000000000000000000000000000..928da3c2b3cc0cf2270a5e6443aed3d217e32661
--- /dev/null
+++ b/www/include/options/oreon/language/lang.php
@@ -0,0 +1,125 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	require_once "./include/common/common-Func.php";
+
+	#Path to the options dir
+	$path = "./include/options/oreon/language";
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	$tpl->assign("title", $lang['lang_title']);
+
+	$elemArr = array();
+	$i = 0;
+	# Information
+    $langdispo="";
+	$handle = opendir("./lang/");
+	while (false !== ($filename = readdir($handle)))	{
+		if ($filename != "." && $filename != "..")	{
+			$filename = explode(".", $filename);
+			$langdispo .= "-".$filename[0]." ";
+		}
+	}
+	closedir($handle);
+    $elemArr[$i] = array("ModuleTitle"=>$lang['lang_gen'],
+						"LangDispo"=>$langdispo,
+						"LangDispoName"=>$lang['lang_av'],
+						"LangUtil"=>$oreon->user->get_lang(),
+                        "LangUtilName"=>$lang['lang_use']);
+    $i++;
+	echo "<div>";
+	# Configuration Module
+    $langdispo="";
+    $filename="";
+	$handle = opendir("./include/configuration/lang/");
+	$stock = array();
+	while (false !== ($filename = readdir($handle)))	{
+		if ($filename != "." && $filename != "..")	{
+			$filename = explode(".", $filename);
+			$stock[$filename[0]] = $filename[0];
+			$langdispo .= "-".$filename[0]." ";
+		}
+	}
+	closedir($handle);
+	$elemArr[$i] = array("ModuleTitle"=>$lang['lang_mod']." ".$lang['m_configuration'],
+					"LangDispo"=>$langdispo,
+					"LangDispoName"=>$lang['lang_av'],
+					"LangUtil"=>(array_key_exists($oreon->user->get_lang(), $stock) ? $oreon->user->get_lang() : "en"),
+                    "LangUtilName"=>$lang['lang_use']);
+	$i++;
+	# Options Module
+    $langdispo="";
+    $filename="";
+	$handle = opendir("./include/options/lang/");
+	$stock = array();
+	while (false !== ($filename = readdir($handle)))	{
+		if ($filename != "." && $filename != "..")	{
+			$filename = explode(".", $filename);
+			$stock[$filename[0]] = $filename[0];
+			$langdispo .= "-".$filename[0]." ";
+		}
+	}
+	closedir($handle);
+	$elemArr[$i] = array("ModuleTitle"=>$lang['lang_mod']." ".$lang['m_options'],
+					"LangDispo"=>$langdispo,
+					"LangDispoName"=>$lang['lang_av'],
+					"LangUtil"=>(array_key_exists($oreon->user->get_lang(), $stock) ? $oreon->user->get_lang() : "en"),
+                    "LangUtilName"=>$lang['lang_use']);
+	$i++;		
+	# Other Modules in modules/
+	foreach ($oreon->modules as $mod)	{
+		# Module in /modules
+        $langdispo="";
+        $filename="";
+		$stock = array();
+		if ($mod["lang"])	{
+			$handle = opendir("./modules/".$mod["name"]."/lang/");
+			while (false !== ($filename = readdir($handle)))	{
+				if ($filename != "." && $filename != "..")	{
+					$filename = explode(".", $filename);
+					$stock[$filename[0]] = $filename[0];
+					$langdispo .= "-".$filename[0]." ";
+				}
+			}
+			closedir($handle);
+		}
+		else
+			$langdispo = $lang['lang_none'];
+			$elemArr[$i] = array("ModuleTitle"=>$lang['lang_mod']." ".$mod["name"],
+							"LangDispo"=>$langdispo,
+							"LangDispoName"=>$lang['lang_av'],
+							"LangUtil"=>(array_key_exists($oreon->user->get_lang(), $stock) ? $oreon->user->get_lang() : (!count($stock) ? $lang['lang_none'] : "en")),
+	                        "LangUtilName"=>$lang['lang_use']);
+			$i++;
+	}	
+	#
+	##Apply a template definition
+	#
+	$tpl->assign("elemArr", $elemArr);
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$tpl->display("lang.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/options/oreon/menu/listMenu.ihtml b/www/include/options/oreon/menu/listMenu.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..bf860697c57a5939713431f21e1a40e660ef0c09
--- /dev/null
+++ b/www/include/options/oreon/menu/listMenu.ihtml
@@ -0,0 +1,20 @@
+<table id="ListTable">
+	<tr class="ListHeader">
+		<td class="ListColHeaderW5PL0TAcenter">{$headerMenu_icone}</td>
+		<td class="ListColHeaderPL4TAleft">{$headerMenu_name}</td>
+		<td class="ListColHeaderPL4TAleft">{$headerMenu_dir}</td>
+		<td class="ListColHeaderPL4TAleft">{$headerMenu_gen}</td>
+		<td class="ListColHeaderPL4TAleft">{$headerMenu_lang}</td>
+		<td class="ListColHeaderPL4TAleft">{$headerMenu_sql}</td>
+	</tr>
+	{section name=elem loop=$elemArr}
+	<tr class={$elemArr[elem].MenuClass}>
+		<td class="ListColTAcenter"></td>
+		<td class="ListColTAcenter"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+		<td class="ListColTAcenter">{$elemArr[elem].RowMenu_dir}</td>
+		<td class="ListColTAcenter">{if $elemArr[elem].RowMenu_gen}{$yes}{else}{$no}{/if}</td>
+		<td class="ListColTAcenter">{if $elemArr[elem].RowMenu_lang}{$yes}{else}{$no}{/if}</td>
+		<td class="ListColTAcenter">{if $elemArr[elem].RowMenu_sql}{$yes}{else}{$no}{/if}</td>
+	</tr>
+	{/section}	
+</table>
diff --git a/www/include/options/oreon/menu/listMenu.php b/www/include/options/oreon/menu/listMenu.php
new file mode 100644
index 0000000000000000000000000000000000000000..ff32fd3e6cd08dd7c70de639675e34323f583495
--- /dev/null
+++ b/www/include/options/oreon/menu/listMenu.php
@@ -0,0 +1,82 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset($oreon))
+		exit();
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang["menu_listName"]);
+	$tpl->assign("headerMenu_dir", $lang["menu_listDir"]);
+	$tpl->assign("headerMenu_gen", $lang["menu_listGen"]);
+	$tpl->assign("headerMenu_lang", $lang["menu_listLang"]);
+	$tpl->assign("headerMenu_sql", $lang["menu_listSql"]);
+	# end header menu
+	# Grab Modules
+	$oreon->modules = array();
+	$handle = opendir("./modules");	
+	while (false !== ($filename = readdir($handle)))	{
+		if ($filename != "." && $filename != "..")	{
+			$oreon->modules[$filename]["name"] = $filename;
+			if (is_dir("./modules/".$filename."/generate_files/"))
+				$oreon->modules[$filename]["gen"] = true;
+			else
+				$oreon->modules[$filename]["gen"] = false;
+			if (is_dir("./modules/".$filename."/sql/"))
+				$oreon->modules[$filename]["sql"] = true;
+			else
+				$oreon->modules[$filename]["sql"] = false;
+			if (is_dir("./modules/".$filename."/lang/"))
+				$oreon->modules[$filename]["lang"] = true;
+			else
+				$oreon->modules[$filename]["lang"] = false;
+		}
+	}
+	closedir($handle);
+	
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	$i = 0;	foreach ($oreon->modules as $mod) {
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_name"=>$mod["name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&name=".$mod["name"],
+						"RowMenu_dir"=>"./modules/".$mod["name"],
+						"RowMenu_gen"=>$mod["gen"],
+						"RowMenu_lang"=>$mod["lang"],
+						"RowMenu_sql"=>$mod["sql"]);
+		$style != "two" ? $style = "two" : $style = "one";
+		$i++;	}
+	$tpl->assign("elemArr", $elemArr);
+	$tpl->assign("yes", $lang["yes"]);
+	$tpl->assign("no", $lang["no"]);
+	
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$tpl->display("listMenu.ihtml");
+	
+	/*end menu*/
+?>
\ No newline at end of file
diff --git a/www/include/options/oreon/menu/menu.php b/www/include/options/oreon/menu/menu.php
new file mode 100644
index 0000000000000000000000000000000000000000..2fa5b779f8236c1e604258415974db3d544059a1
--- /dev/null
+++ b/www/include/options/oreon/menu/menu.php
@@ -0,0 +1,40 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["menu_id"]) ? $mG = $_GET["menu_id"] : $mG = NULL;
+	isset($_POST["menu_id"]) ? $mP = $_POST["menu_id"] : $mP = NULL;
+	$mG ? $menu_id = $mG : $menu_id = $mP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the options dir
+	$path = "./include/options/oreon/menu/";
+	
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		default : require_once($path."listMenu.php");  break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/options/oreon/myAccount/DB-Func.php b/www/include/options/oreon/myAccount/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..9f09e53ce9ca51020d548ceae06c5eed8d1b1a97
--- /dev/null
+++ b/www/include/options/oreon/myAccount/DB-Func.php
@@ -0,0 +1,89 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function testExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('contact_id');
+		$res =& $pearDB->query("SELECT contact_name, contact_id FROM contact WHERE contact_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$contact =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $contact["contact_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $contact["contact_id"] != $id)
+			return false;
+		else
+			return true;
+	}	
+	
+	function testAliasExistence ($alias = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('contact_id');
+		$res =& $pearDB->query("SELECT contact_alias, contact_id FROM contact WHERE contact_alias = '".htmlentities($alias, ENT_QUOTES)."'");
+		$contact =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $contact["contact_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $contact["contact_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function updateContactInDB ($contact_id = NULL)	{
+		if (!$contact_id) return;
+		updateContact($contact_id);
+	}
+	
+	function updateContact($contact_id = null)	{
+		if (!$contact_id) return;
+		global $form;
+		global $pearDB;
+		global $oreon;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE contact SET ";
+		$rq .= "contact_name = ";
+		isset($ret["contact_name"]) && $ret["contact_name"] != NULL ? $rq .= "'".htmlentities($ret["contact_name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "contact_alias = ";
+		isset($ret["contact_alias"]) && $ret["contact_alias"] != NULL ? $rq .= "'".htmlentities($ret["contact_alias"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		if (isset($ret["contact_passwd"]) && $ret["contact_passwd"])
+			$rq .= "contact_passwd = '".md5($ret["contact_passwd"])."', ";
+		$rq .=	"contact_lang = ";
+		isset($ret["contact_lang"]) && $ret["contact_lang"] != NULL ? $rq .= "'".htmlentities($ret["contact_lang"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "contact_email = ";
+		isset($ret["contact_email"]) && $ret["contact_email"] != NULL ? $rq .= "'".htmlentities($ret["contact_email"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "contact_pager = ";
+		isset($ret["contact_pager"]) && $ret["contact_pager"] != NULL ? $rq .= "'".htmlentities($ret["contact_pager"], ENT_QUOTES)."' ": $rq .= "NULL ";
+		$rq .= "WHERE contact_id = '".$contact_id."'";
+		$pearDB->query($rq);
+		$oreon->user->name = $ret["contact_name"];
+		$oreon->user->alias = $ret["contact_alias"];
+		$oreon->user->lang = $ret["contact_lang"];
+		$oreon->user->email = $ret["contact_email"];
+	}
+?>
\ No newline at end of file
diff --git a/www/include/options/oreon/myAccount/formMyAccount.ihtml b/www/include/options/oreon/myAccount/formMyAccount.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..8ddc2fcd1c3107f0ec6230efdb82b0aa7763ccc6
--- /dev/null
+++ b/www/include/options/oreon/myAccount/formMyAccount.ihtml
@@ -0,0 +1,26 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/user1_message.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/house.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_name.label}</td><td class="FormRowValue">{$form.contact_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.contact_alias.label}</td><td class="FormRowValue">{$form.contact_alias.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_email.label}</td><td class="FormRowValue">{$form.contact_email.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.contact_pager.label}</td><td class="FormRowValue">{$form.contact_pager.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_passwd.label}</td><td class="FormRowValue">{$form.contact_passwd.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.contact_passwd2.label}</td><td class="FormRowValue">{$form.contact_passwd2.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.contact_lang.label}</td><td class="FormRowValue">{$form.contact_lang.html}</td></tr>
+		
+		{if $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+	<div id="validForm">
+	{if $o == "c"}
+		<p class="oreonbutton">{$form.submitC.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
+
diff --git a/www/include/options/oreon/myAccount/formMyAccount.php b/www/include/options/oreon/myAccount/formMyAccount.php
new file mode 100644
index 0000000000000000000000000000000000000000..e09da0319f00bf18355373d47fb307358117730f
--- /dev/null
+++ b/www/include/options/oreon/myAccount/formMyAccount.php
@@ -0,0 +1,149 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["contact_id"]) ? $cG = $_GET["contact_id"] : $cG = NULL;
+	isset($_POST["contact_id"]) ? $cP = $_POST["contact_id"] : $cP = NULL;
+	$cG ? $contact_id = $cG : $contact_id = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+
+	require_once "./include/common/common-Func.php";
+	
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+		
+	#Path to the configuration dir
+	$path = "./include/options/oreon/myAccount/";
+	
+	#PHP Functions
+	require_once $path."DB-Func.php";
+	
+	#
+	## Database retrieve information for the User
+	#
+	$cct = array();
+	if ($o == "c")	{	
+		$res =& $pearDB->query("SELECT contact_id, contact_name, contact_alias, contact_lang, contact_email, contact_pager FROM contact WHERE contact_id = '".$contact_id."' LIMIT 1");
+		# Set base value
+		$cct = array_map("myDecode", $res->fetchRow());
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Langs -> $langs Array
+	$langs = array();
+	 $chemintotal = "./lang/";
+	if ($handle  = opendir($chemintotal))   {
+	    while ($file = readdir($handle))
+	    	if (!is_dir("$chemintotal/$file") && strcmp($file, "index.php")) {
+				$tab = split('\.', $file);
+	      		$langs[$tab[0]] = $tab[0];
+	      	}
+		closedir($handle);
+	}
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"35");
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	$form->addElement('header', 'title', $lang["myAcc_change"]);
+
+	#
+	## Basic information
+	#
+	$form->addElement('header', 'information', $lang['cct_infos']);
+	$form->addElement('text', 'contact_name', $lang["cct_name"], $attrsText);
+	$form->addElement('text', 'contact_alias', $lang["alias"], $attrsText);
+	$form->addElement('text', 'contact_email', $lang["cct_mail"], $attrsText);
+	$form->addElement('text', 'contact_pager', $lang["cct_pager"], $attrsText);
+	$form->addElement('password', 'contact_passwd', $lang['cct_passwd'], $attrsText);
+	$form->addElement('password', 'contact_passwd2', $lang['cct_passwd2'], $attrsText);
+    $form->addElement('select', 'contact_lang', $lang["cct_lang"], $langs);
+
+	
+	$form->addElement('hidden', 'contact_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	function myReplace()	{
+		global $form;
+		$ret = $form->getSubmitValues();
+		return (str_replace(" ", "_", $ret["contact_name"]));
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('contact_name', 'myReplace');
+	$form->addRule('contact_name', $lang['ErrName'], 'required');
+	$form->addRule('contact_alias', $lang['ErrAlias'], 'required');
+	$form->addRule('contact_email', $lang['ErrEmail'], 'required');
+//	$form->addRule('contact_passwd', $lang['ErrRequired'], 'required');
+//	$form->addRule('contact_passwd2', $lang['ErrRequired'], 'required');
+	$form->addRule(array('contact_passwd', 'contact_passwd2'), $lang['ErrCctPasswd'], 'compare');
+	$form->registerRule('exist', 'callback', 'testExistence');
+	$form->addRule('contact_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->registerRule('existAlias', 'callback', 'testAliasExistence');
+	$form->addRule('contact_alias', $lang['ErrAlreadyExist'], 'existAlias');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Modify a contact information
+	if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($cct);
+	}
+	
+	if ($form->validate())	{
+		$cctObj =& $form->getElement('contact_id');
+		updateContactInDB($cctObj->getValue());
+		$oreon->user->passwd = md5($form->getSubmitValue("contact_passwd"));
+		$o = NULL;
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&contact_id=".$cctObj->getValue()."'"));
+		$form->freeze();
+	}
+	#Apply a template definition	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+	$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());	
+	$tpl->assign('o', $o);		
+	$tpl->display("formMyAccount.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/options/plugins.php b/www/include/options/plugins.php
new file mode 100644
index 0000000000000000000000000000000000000000..6269dc98eb5c29da9786dc3846fcf5caa869aacb
--- /dev/null
+++ b/www/include/options/plugins.php
@@ -0,0 +1,250 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+
+	// Print File header
+	include("./include/generatefile/functions.php");
+	// Create Oreon.conf
+	include("./include/generatefile/oreon_pm.php");
+
+	function tab2space ($text, $spaces = 4)	{
+		// Explode the text into an array of single lines
+		$lines = explode("\n", $text);
+		// Loop through each line
+		foreach ($lines as $line) {
+			// Break out of the loop when there are no more tabs to replace
+			while (false !== $tab_pos = strpos($line, "\t")) {
+				// Break the string apart, insert spaces then concatenate
+				$start = substr($line, 0, $tab_pos);
+				$tab   = str_repeat(' ', $spaces - $tab_pos % $spaces);
+				$end   = substr($line, $tab_pos + 1);
+				$line  = $start . $tab . $end;
+			}
+			$result[] = $line;
+		}
+		return implode("\n", $result);
+	}
+
+	if (isset($_GET["a"]) && isset($_GET["n"]) && (!strcmp($_GET["a"], "w") && strcmp($_GET["n"], "")))	{
+		$str = "";
+		$ret = "1";
+		$exec = preg_split ("/[;\<\>|]{1}/", $_GET["n"]);
+		$stdout = shell_exec($oreon->optGen->get_plugins_path() . $exec[0] . " --help");
+		$tab = preg_split ("/[\n]+/", htmlentities($stdout));
+	}
+	else if (isset($_POST["a"]) && !strcmp($_POST["a"], "add"))	{
+		if (!strcmp("", $_FILES["file2"]["tmp_name"]))
+			;
+		else		{
+			if (move_uploaded_file($_FILES["file2"]["tmp_name"], $oreon->optGen->get_plugins_path() . $_FILES["file2"]["name"]) != 0){
+				$msg = $lang["plugins3"];
+				chmod($oreon->optGen->get_plugins_path() . $_FILES["file2"]["name"], 0755);
+				//chown($oreon->optGen->get_plugins_path() . $_FILES["file2"]["name"], $oreon->Nagioscfg->nag_user);
+				//chgrp($oreon->optGen->get_plugins_path() . $_FILES["file2"]["name"], $oreon->Nagioscfg->nag_grp);
+				//passthru("chown  " . $oreon->Nagioscfg->nag_user . ":" . $oreon->Nagioscfg->nag_grp . " " . $oreon->optGen->nagios_pwd . "libexec/*");
+				// log change
+				system("echo \"[" . time() . "] AddPlugin;" . $_FILES["file2"]["name"] . ";" . $oreon->user->get_alias() ."\" >> ./include/log/" . date("Ymd") . ".txt");
+				}
+			else
+				$msg = $lang["plugins4"];
+		}
+	}
+	else if (isset($_GET["a"]) && !strcmp($_GET["a"], "delete") && isset($_GET["file"]) && strcmp($_GET["file"], ""))	{
+		if (is_file($oreon->optGen->get_plugins_path() . addslashes($_GET["file"]))){
+			unlink($oreon->optGen->get_plugins_path() . addslashes($_GET["file"]));
+			$msg = $lang["plugins1"];
+			// log change
+			system("echo \"[" . time() . "] DeletePlugin;" . $_GET["file"] . ";" . $oreon->user->get_alias() . "\" >> ./include/log/" . date("Ymd") . ".txt");
+		}
+	} else if (isset($_POST["s"]) && !strcmp($_POST["s"], "save"))	{
+		$msg_pm =$lang["plugins6"];
+		// Path where configuration file will be write
+		$path = $oreon->optGen->get_plugins_path();
+		Create_oreon_pm_conf($oreon, $path);
+		$handle = fopen($path . "oreon.conf", "r");
+		$stdout = fread($handle, filesize($path . "oreon.conf"));
+		fclose($handle);
+		$tab = preg_split ("/[\n]+/", htmlentities($stdout));
+	}
+?>
+
+<table border="0" cellpadding="0" cellspacing="0">
+	<tr>
+		<td valign="top" align="left">
+		<table border="0" cellpadding="0" cellspacing="0">
+			<tr>
+				<td align="left">
+					<form action="oreon.php?p=207" method="POST" enctype="multipart/form-data">
+						<? if (isset($msg))
+								echo "<div class='msg' style='padding-bottom: 10px;' align='center'>".$msg."</div>"; ?>
+						<table cellpadding="0" cellspacing="0" width="300">
+							<tr>
+								<td class="tabTableTitle"><? echo $lang["plugins"]; ?></td>
+							</tr>
+							<tr>
+								<td class='tabTable' style="padding-top:5px"><? echo $lang["plugins_add"]; ?><br></td>
+							</tr>
+							<tr>
+								<td class='tabTable' style="padding-top:10px" align="center"><input name="file2" type="file"></td>
+							</tr>
+							<tr>
+								<td align="center" style="padding-top: 10px;" class='tabTable'>
+									<input name="a" type="hidden" value="add">
+									<input name="enregistrer" type="submit" value="<? echo $lang['save']; ?>">
+									<br><br>
+								</td>
+							</tr>
+							<tr>
+								<td bgcolor='#CCCCCC'></td>
+							</tr>
+						</table>
+					</form>
+					<br>
+					<form action="oreon.php?p=207" method="POST" enctype="multipart/form-data">
+						<? if (isset($msg_pm))
+								echo "<div class='msg' style='padding-bottom: 10px;' align='center'>".$msg_pm."</div>"; ?>
+						<table cellpadding="0" cellspacing="0" width="300">
+							<tr>
+								<td class="tabTableTitle"><? echo $lang["plugins_pm_conf"]; ?></td>
+							</tr>
+							<tr>
+								<td class="tabTable" style="padding-top:5px"><? echo $lang["plugins_pm_conf_desc"]; ?><br></td>
+							</tr>
+							<tr>
+								<td align="center" style="padding-top: 10px;" class='tabTable'>
+									<input name="s" type="hidden" value="save">
+									<input name="enregister" type="submit" value="<? echo $lang['db_generate']; ?>">
+									<br><br>
+								</td>
+							</tr>
+							<?  if (isset($_POST["s"]) && strcmp("", $_POST["s"]))	{	?>
+							<tr>
+							    <td style="padding-top: 10px;" height="2" class='tabTable'>
+							    <? foreach ($tab as $str)
+									//print "<nobr>" . tab2space($str) . "</nobr><br>";
+									print  tab2space($str) ."<br>" ;
+							    ?>
+							    </td>
+							</tr>
+							<? }	?>
+							<tr>
+								<td bgcolor='#CCCCCC'></td>
+							</tr>
+						</table>
+					</form>
+				<?  if (isset($_GET["n"]) && strcmp("", $_GET["n"]))	{	?>
+					<br>
+					<table border="0" cellpadding="0" cellspacing="0">
+						<tr>
+							<td class="tabTableTitle" height="2" align="center"><? print $lang['details']. " : ".$_GET["n"] ; ?></td>
+						</tr>
+						<tr>
+							<td class="tabTable" style="padding:5px;">
+							<? foreach ($tab as $str)
+									print "<nobr>" . tab2space($str) . "</nobr><br>";
+							?>
+							</td>
+						</tr>
+						<tr>
+							<td bgcolor='#CCCCCC' height="1"></td>
+						</tr>
+					</table>
+				<? } ?>
+				</td>
+			</tr>
+		</table>
+	</td>
+	<td style="padding-left: 20px;"></td>
+	<td align="left" valign="top">
+		<table border="0" align="left">
+			<tr>
+				<td>
+					<?
+					// etc
+					$chemintotal = $oreon->optGen->get_plugins_path();
+					$cpt = 1;
+					$cpt1 = 1;
+					if ($handle  = @opendir($chemintotal))	{
+						while ($file = @readdir($handle))	{
+							if(!is_dir("$chemintotal$file") && strcmp($file, "index.php") && strcmp($file, "exemple.php")) {
+								if (!strstr($file, "#") && !strstr($file, "~")){
+									$table_file[$cpt] = $file;
+									$cpt++;
+								}
+							}
+							if(is_dir("$chemintotal$file")){
+								$table_rep[$cpt1] = $file;
+								$cpt1++;
+							}
+						}
+						@closedir($handle);
+					} ?>
+					<table border='0' align="left" cellpadding="0" cellspacing="0" width="300">
+						<tr>
+							<td class="tabTableTitle"><? print $lang["plugins_list"] ; ?></td>
+						</tr>
+						<tr>
+							<td valign="top" align="center" class="tabTableForTab">
+								<?
+								$cpt = 0;
+								echo "<TABLE BORDER='0' CELLPADDING=3 CELLSPACING='1' nowrap align=center>";
+								echo "<TR>";
+								echo "	<TD background='./img/menu.jpg' ALIGN='center'><b class='link'>".$lang['plugins']."</b></TD>";
+								echo "	<TD background='./img/menu.jpg' ALIGN='center' COLSPAN='1'><B class='link'>".$lang['size']."</B></TD>";
+								echo "	<TD background='./img/menu.jpg' ALIGN='center' COLSPAN='1'><B class='link'>".$lang['delete']."</B></TD>";
+								echo "</TR>";
+								if (isset($table_rep)){
+									sort($table_rep);
+									foreach ($table_rep as $rep)
+									{
+										echo "<TR>";
+										echo "	<TD BGCOLOR='#EBEEF3' bordercolor='#EBEEF3' ALIGN='left'>&nbsp;&nbsp;&nbsp;<a href='oreon.php?p=207&a=w&n=$rep' class='text10'>$rep</a></TD>";
+										echo "	<TD BGCOLOR='#EBEEF3' bordercolor='#EBEEF3' ALIGN='right' COLSPAN='1'><font class='link'>";
+										printf("%u", filesize($oreon->optGen->get_plugins_path() . "$rep") / 1000);
+										echo " ko</font></TD>";
+										echo "	<TD BGCOLOR='#EBEEF3' bordercolor='#EBEEF3' ALIGN='center' COLSPAN='1'>&nbsp;</TD>";
+										echo "</TR>";
+										unset($rep);
+									}
+								}
+								if (isset($table_file)){
+									sort($table_file);
+									foreach ($table_file as $file)
+									{
+										echo "<TR>";
+										echo "	<TD BGCOLOR='#EBEEF3' bordercolor='#EBEEF3' ALIGN='left'>&nbsp;&nbsp;&nbsp;<a href='oreon.php?p=207&a=w&n=$file' class='text10'>$file</a></TD>";
+										echo "	<TD BGCOLOR='#EBEEF3' bordercolor='#EBEEF3' ALIGN='right' COLSPAN='1'><font class='link'>";
+										printf("%u", filesize($oreon->optGen->get_plugins_path() . "$file") / 1000);
+										echo " ko</font></TD>";
+										echo "	<TD BGCOLOR='#EBEEF3' bordercolor='#EBEEF3' ALIGN='center' COLSPAN='1'><a href='oreon.php?p=207&a=delete&file=".$file."'><img src='./img/listDel.gif' border=0  onclick=\"return confirm('".$lang['plugins2']."')\"></a></TD>";
+										echo "</TR>";
+										unset($file);
+									}
+								}
+								echo "</TABLE>";
+								?>
+								</td>
+							</tr>
+						</table>
+					</td>
+				</tr>
+		</table>
+	</td>
+</tr>
+</table>
\ No newline at end of file
diff --git a/www/include/options/session/connected_user.ihtml b/www/include/options/session/connected_user.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..54813431a71624add3c31c9b8cdc26ea1ae4724d
--- /dev/null
+++ b/www/include/options/session/connected_user.ihtml
@@ -0,0 +1,25 @@
+<form id="Form">
+	{if $msg}
+		<span class="msg">{ $msg }</span>
+	{/if}
+	<table id="ListTableMedium">
+		<tr class="ListHeader">
+			<td class="ListColHeaderLeft">{ $wi_user }</td>
+			<td class="ListColHeaderCenter">{ $distant_location }</td>
+			<td class="ListColHeaderCenter">&nbsp;</td>
+			<td class="ListColHeaderCenter">{ $wi_where }</td>
+			<td class="ListColHeaderCenter">{ $wi_last_req }</td>
+			<td class="ListColHeaderCenter">&nbsp;</td>
+		</tr>
+		{foreach name=outer item=sd from=$session_data }
+		<tr class="{$sd.class}">
+			<td class="ListColLeft"><img src='./img/icones/16x16/user1.gif'>&nbsp;&nbsp;<a href='./oreon.php?p=60302&o=w&contact_id={$sd.user_id}'>{$sd.user_alias}</a></td>
+			<td class="ListColCenter">{$sd.ip_address}</td>
+			<td class="ListColCenter">{$sd.topology_icone}</td>
+			<td class="ListColCenter"><a href='./oreon.php?p={$sd.current_page}'>{$sd.topology_name}</a></td>
+			<td class="ListColCenter" align=right>{$sd.last_reload}</td>
+			<td class="ListColCenter" align=right>{$sd.actions}</td>
+		</tr>
+		{/foreach}
+	</table>
+</form>
diff --git a/www/include/options/session/connected_user.php b/www/include/options/session/connected_user.php
new file mode 100644
index 0000000000000000000000000000000000000000..66ca237b82a854e21fbd2945dfdf4bad68b883b1
--- /dev/null
+++ b/www/include/options/session/connected_user.php
@@ -0,0 +1,70 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+	
+	$path = "./include/options/session/";	
+	
+	require_once "./include/common/common-Func.php";
+		
+	if (isset($_GET["o"]) && $_GET["o"] == "k"){
+		$pearDB->query("DELETE FROM session WHERE session_id = '".$_GET["session_id"]."'");
+		$msg = $lang['kicked_user'];
+	}	
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	$res =& $pearDB->query("SELECT * FROM session");
+	$session_data = array();
+	$cpt = 0;
+	while ($r =& $res->fetchRow()){
+		$session_data[$cpt] = array();
+		if ($cpt % 2)
+			$session_data[$cpt]["class"] = "list_one";
+		else
+			$session_data[$cpt]["class"] = "list_two";
+		$resUser =& $pearDB->query("SELECT contact_name FROM contact WHERE contact_id = '".$r["user_id"]."'");
+		$rU =& $resUser->fetchRow();	
+		$session_data[$cpt]["user_id"] = $r["user_id"];
+		$session_data[$cpt]["user_alias"] = $rU["contact_name"];
+		$resCP =& $pearDB->query("SELECT topology_name, topology_icone, topology_page, topology_url_opt FROM topology WHERE topology_page = '".$r["current_page"]."'");
+		$rCP =& $resCP->fetchRow();
+		$session_data[$cpt]["ip_address"] = $r["ip_address"];
+		$session_data[$cpt]["current_page"] = $r["current_page"].$rCP["topology_url_opt"];
+		$session_data[$cpt]["topology_name"] = $lang[$rCP["topology_name"]];
+		if ($rCP["topology_icone"])
+			$session_data[$cpt]["topology_icone"] = "<img src='".$rCP["topology_icone"]."'>";
+		else
+			$session_data[$cpt]["topology_icone"] = "&nbsp;";
+		$session_data[$cpt]["last_reload"] = date("H:i:s", $r["last_reload"]);
+		$session_data[$cpt]["actions"] = "<a href='./oreon.php?p=$p&o=k&session_id=".$r["session_id"]."'><img src='./img/icones/16x16/flash.gif' border='0' alt='".$lang["kick_user"]."' title='".$lang["kick_user"]."'></a>";
+		$cpt++;
+	}
+	if (isset($msg))
+		$tpl->assign("msg", $msg);
+	$tpl->assign("session_data", $session_data);
+	$tpl->assign("wi_user", $lang["wi_user"]);
+	$tpl->assign("wi_where", $lang["wi_where"]);
+	$tpl->assign("wi_last_req", $lang["wi_last_req"]);
+	$tpl->assign("distant_location", $lang["distant_location"]);
+	$tpl->display("connected_user.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/options/sysInfos/COPYING b/www/include/options/sysInfos/COPYING
new file mode 100644
index 0000000000000000000000000000000000000000..bf50f20de6ef55b52fe7832d3a4ed05f0c69d452
--- /dev/null
+++ b/www/include/options/sysInfos/COPYING
@@ -0,0 +1,482 @@
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+    		    59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL.  It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it.  You can use it for
+your libraries, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library.  If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software.  To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+  Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs.  This
+license, the GNU Library General Public License, applies to certain
+designated libraries.  This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+  The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it.  Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program.  However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+  Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries.  We
+concluded that weaker conditions might promote sharing better.
+
+  However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves.  This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them.  (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.)  The hope is that this
+will lead to faster development of free libraries.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+  Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License").  Each licensee is
+addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    c) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    d) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public
+    License along with this library; if not, write to the 
+    Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
+    Boston, MA  02111-1307  USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/www/include/options/sysInfos/ChangeLog b/www/include/options/sysInfos/ChangeLog
new file mode 100644
index 0000000000000000000000000000000000000000..db332e4b9cd2b17013c401722bfb38b5edb80bd9
--- /dev/null
+++ b/www/include/options/sysInfos/ChangeLog
@@ -0,0 +1,2674 @@
+2005-12-10 15:58  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: little spped up the creation
+
+2005-12-10 15:54  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/common_functions.php, includes/xml/memory.php,
+	  includes/xml/filesystems.php, includes/xml/hardware.php,
+	  includes/xml/network.php, includes/xml/vitals.php,
+	  includes/xml/mbinfo.php, includes/xml/hddtemp.php,
+	  templates/black/box.tpl, templates/wintendoxp/box.tpl,
+	  templates/aq/box.tpl, templates/windows_classic/box.tpl,
+	  templates/orange/box.tpl, templates/metal/box.tpl,
+	  templates/blue/box.tpl, templates/typo3/box.tpl,
+	  templates/bulix/box.tpl, templates/kde/box.tpl,
+	  templates/classic/box.tpl: huge update for supporting
+	  rtl-languages should close:  "[ 1364219 ] Fix for bug 1039460 ?"
+	  "[ 1039460 ] chareset=utf-8 dir=rtl breaks templates"
+
+2005-12-10 13:09  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* templates/: black/box.tpl, aq/box.tpl, metal/box.tpl,
+	  kde/box.tpl, wintendoxp/box.tpl, windows_classic/box.tpl: html
+	  code fixes to be HTML 4.01 Transitional compatible, verified at
+	  validator.w3.org
+
+2005-12-10 12:30  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/system_footer.php: fixes bug "[ 1377012 ] Correcting a
+	  html "error"."
+
+2005-12-10 09:08  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/mb/class.mbm5.inc.php: fixes "[ 1377470 ] error in file
+	  "\includes\mb\class.mbm5.inc.php on line 27""
+
+2005-12-09 19:30  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php:
+	  add ability to read pci devices from "pciconf -lv", if this
+	  doesn't work we fall back to old way
+
+2005-12-08 20:18  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php:
+	  loadbar now works also with BSD systems fixes bug "[ 1376395 ]
+	  $loadbar not working"
+
+2005-12-08 19:59  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php:
+	  command must be df -k and not df -kP for BSD systems
+
+2005-12-08 19:54  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php:
+	  we need the pcre extension
+
+2005-12-07 16:04  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/filesystems.php: overall size was wrong calculated
+	  for WINNT systems, here we must use the MountPoint for allready
+	  counted Partitions
+
+2005-12-07 15:47  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.WINNT.inc.php: mhz must be cpuspeed in array
+	  and busspeed has it's own position in the array
+
+2005-12-07 15:36  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.WINNT.inc.php: read hostname from wmi
+
+2005-12-07 15:07  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/common_functions.php: fixes bug "[ 1375301 ] fstype is
+	  CDFS under Windows not iso9660"
+
+2005-12-07 15:02  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/lang/: ar_utf8.php, bg.php, de.php, lv.php, pt.php,
+	  sv.php, br.php, it.php, da.php, cs.php, ct.php, ro.php,
+	  pa_utf8.php, is.php, ca.php, fi.php, big5.php, et.php, tr.php,
+	  pt-br.php, tw.php, hu.php, cn.php, gr.php, he.php, nl.php,
+	  ru.php, fr.php, no.php, id.php, es.php, eu.php, sk.php, sr.php,
+	  ko.php, en.php: fix bug "[ 1375274 ] strftime under windows has
+	  no %r %R"
+
+2005-12-07 05:09  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.SunOS.inc.php: fixed bug "[ 1374759 ] Netword
+	  info wrong for Solaris" with patch included in bug report
+
+2005-12-06 16:04  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* README, index.php: 2.5 release
+
+2005-12-06 15:58  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: fixed bug "[ 1082407 ] IDE HDDs
+	  Capacity reports "0" on FC3", but i can not believe that sys has
+	  the ide and proc not
+
+2005-12-06 15:49  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: check if file exist before include
+
+2005-12-06 05:00  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: security fix
+
+2005-12-03 11:12  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: wrong regex
+
+2005-12-02 22:19  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: fixes bug "[ 1369246 ]
+	  Extra slash on "Mount"" it's now the same filesystem() code linke
+	  on Linux class
+
+2005-12-02 14:14  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.WINNT.inc.php: fix not showing cpu usage (wrong
+	  position in array) add value for cpu bargraph
+
+2005-12-02 14:03  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/: os/class.Linux.inc.php, xml/vitals.php: load averages
+	  change
+
+2005-12-02 13:57  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: undefined variable
+
+2005-11-30 05:14  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* config.php.new: fix for bug "[ 1369688 ] little issue in the
+	  configuration file for hddtemp" changed style of comments
+
+2005-11-28 15:52  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.OpenBSD.inc.php: missing dot causes error,
+	  fixes bug "[ 1368270 ] Error in OpenBSD 3.7"
+
+2005-11-27 20:39  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* sample/lmsensors5.txt: another "nice" output
+
+2005-11-27 20:38  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/mb/class.lmsensors.inc.php: corrected regex
+
+2005-11-27 20:19  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/vitals.php: set maximum value for cpu bargraph
+
+2005-11-27 20:17  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: rewrite, because of bug "[
+	  1367290 ] mount point show 11515% usage."
+
+2005-11-27 17:30  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php, includes/xml/memory.php, includes/xml/filesystems.php,
+	  includes/xml/hardware.php, includes/xml/network.php,
+	  includes/xml/vitals.php, includes/xml/mbinfo.php,
+	  includes/xml/hddtemp.php: htmlentities causes some strange
+	  xml-errors, htmlentities are good enough for our xml
+
+2005-11-27 17:17  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* sample/lmsensors4.txt: another test output
+
+2005-11-27 13:18  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/mb/class.lmsensors.inc.php: we need these lines, the got
+	  lost at last commit
+
+2005-11-26 21:44  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/: common_functions.php, xml/memory.php,
+	  xml/filesystems.php, xml/mbinfo.php, xml/hddtemp.php: restructure
+	  the bargraph output
+
+2005-11-26 21:41  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/mb/class.lmsensors.inc.php: remove ununsed var $alarm
+	  fix for chipsets that have not the full vars we need, e.g.
+	  "fscpos-i2c-0-73"
+
+2005-11-26 15:35  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: reflect version change, and we need a second rc, too
+	  many changes since last rc
+
+2005-11-26 15:19  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/hddtemp.php: write headline if no sensor_program is
+	  available
+
+2005-11-26 13:20  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/: memory.php, filesystems.php, hardware.php,
+	  network.php, vitals.php: tables should be 100% to get a nice
+	  output
+
+2005-11-26 13:20  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/common_functions.php: a no breaking space is required,
+	  else sometimes byte sizewraps to a new line and this looks bad
+
+2005-11-26 13:01  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/class.Template.inc.php: Template class update version
+	  1.6 from egroupware from folder
+	  ./setup/inc/class.Template.inc.php
+
+2005-11-26 11:39  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: changed output for temperatures with help from Timo
+	  van Roermund
+
+2005-11-26 10:45  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: unused value $percent
+
+2005-11-25 21:55  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/mbinfo.php: missing <tr>
+
+2005-11-25 21:27  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/common_functions.php: yellow only for above 75% and not
+	  20
+
+2005-11-24 18:51  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/hardware.php: no extra encoding needed
+
+2005-11-24 17:10  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/: memory.php, filesystems.php, hardware.php,
+	  vitals.php: missing changes for last commit at XPath
+
+2005-11-24 17:05  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* phpsysinfo.dtd, includes/system_header.php,
+	  includes/xml/memory.php, includes/xml/filesystems.php,
+	  includes/xml/hardware.php: DTD update to reflect the latest
+	  changes and privious missing declarations, need some more
+	  tweeking
+
+2005-11-23 17:09  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/lang/ar_utf8.php: missing $text['gen_time']
+
+2005-11-23 17:08  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/lang/ar_utf8.php: missing $text['locale']
+
+2005-11-23 17:03  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: undefined variable
+
+2005-11-23 16:58  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/system_header.php: undefined variable
+
+2005-11-23 16:54  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/: hardware.php, vitals.php: undefined variable
+
+2005-11-23 05:05  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: wrong varname
+
+2005-11-22 16:15  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/vitals.php: typo
+
+2005-11-22 16:14  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* config.php.new: missing entry and description in config.php.new
+	  for last commit
+
+2005-11-22 16:08  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/common_functions.php, includes/system_footer.php,
+	  includes/os/class.Linux.inc.php, includes/xml/vitals.php,
+	  templates/black/box.tpl, templates/aq/box.tpl,
+	  templates/windows_classic/box.tpl, templates/metal/box.tpl,
+	  templates/kde/box.tpl: fix for including page in other scripts
+	  and nothing will work any longer (extra config value $webpath)
+
+2005-11-22 15:08  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/: mb/class.mbmon.inc.php, xml/mbinfo.php: fix for "[
+	  1195024 ] Ignore not connected temperature sensors"
+
+2005-11-22 14:59  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: error message for all FC
+	  systems, where we can't read /proc/net/dev, because of SELinux
+
+2005-11-22 14:30  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* distros.ini, includes/os/class.HP-UX.inc.php,
+	  includes/os/class.NetBSD.inc.php,
+	  includes/os/class.Linux.inc.php,
+	  includes/os/class.Darwin.inc.php,
+	  includes/os/class.FreeBSD.inc.php,
+	  includes/os/class.SunOS.inc.php,
+	  includes/os/class.OpenBSD.inc.php, images/Gentoo.png,
+	  images/lfs.png, images/FreeBSD.png, images/Debian.png,
+	  images/Cobalt.png, images/unknown.png, images/Redhat.png,
+	  images/Slackware.png, images/Mandrake.png, images/NetBSD.png,
+	  images/Darwin.png, images/OpenBSD.png, images/free-eos.png,
+	  images/Fedora.png, images/Suse.png, images/Rubix.png: included
+	  patch "[ 1363677 ] Linux Distro INI Definitions file" for simpler
+	  distro-icon management, also convert some icons to png format
+
+2005-11-21 15:39  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: set the default template, if the one which is stored
+	  in the cookie no longer exists
+
+2005-11-20 13:21  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/vitals.php: round cpuload
+
+2005-11-20 12:54  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* config.php.new, includes/os/class.HP-UX.inc.php,
+	  includes/os/class.Linux.inc.php,
+	  includes/os/class.BSD.common.inc.php,
+	  includes/os/class.WINNT.inc.php, includes/os/class.SunOS.inc.php,
+	  includes/xml/vitals.php: included feature request "[ 1252617 ]
+	  CPU Time/usage"
+
+2005-11-20 11:29  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/lang/pa_utf8.php: new translation from feature request
+	  "[ 1214326 ] New Translation adding"
+
+2005-11-20 11:27  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/hardware.php: another xml-destroyer bug, if GB or kb
+	  is translated
+
+2005-11-20 11:14  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/common_functions.php,
+	  templates/windows_classic/images/yellowbar_right.gif,
+	  templates/windows_classic/images/yellowbar_middle.gif,
+	  templates/windows_classic/images/yellowbar_left.gif: feature
+	  request "[ 620192 ] Color indicators in graph"
+
+	  bars will show in a third color if there are images present like
+	  "yellowbar_*.gif" values can be changed in common_functions.php
+	  at which these colors should appear default: red > 90%, yellow >
+	  75%, else green
+
+2005-11-20 10:43  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: add detection for
+	  Linux-from-Scratch
+
+2005-11-20 10:13  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.WINNT.inc.php: more network informations,
+	  included patch "[ 1234690 ] More network information on
+	  WindowsXP"
+
+2005-11-20 09:56  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* config.php.new, index.php, includes/mb/class.hddtemp.inc.php,
+	  includes/xml/hddtemp.php: read hddtemp values from deamon or
+	  execute hddtemp (fixed with help of Timo van Roermund)
+
+2005-11-19 23:41  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: simplify sparc cache detection
+	  code, also check before open a file exists
+
+2005-11-19 23:33  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: simplify usb detection
+
+2005-11-19 23:23  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/hardware.php: undefined var fix exclude SBUS
+	  information, we have no output for this
+
+2005-11-19 23:21  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/filesystems.php: unneeded calculation of hdd sums in
+	  xml function undefined var fix
+
+2005-11-19 23:09  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: there was a serious error in the
+	  detection code, if sizes are seperated by one only space, hope
+	  this fixes it
+
+2005-11-19 21:59  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: extra distribution information
+	  added (specially for Debian, which got lost)
+
+2005-11-19 21:43  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/: mbinfo.php, hddtemp.php: made bars smaller (same
+	  factor like memory bars), perhaps set  in config file
+
+2005-11-19 21:39  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/hardware.php: remove space after capacity text
+
+2005-11-19 18:36  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* config.php.new, index.php, includes/mb/class.hddtemp.inc.php,
+	  includes/xml/hardware.php, includes/xml/mbinfo.php,
+	  includes/xml/hddtemp.php: added support for hddtemp this closes
+	  "[ 1035068 ] hddtemp support"
+
+2005-11-19 17:11  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: security fixes from debian
+
+2005-11-19 16:00  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: included patch from "[
+	  1334110 ] Support for harddisks above 'ad9' on (Free)BSD"
+
+2005-11-19 15:56  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* config.php.new, includes/common_functions.php,
+	  includes/os/class.HP-UX.inc.php, includes/os/class.Linux.inc.php,
+	  includes/os/class.BSD.common.inc.php,
+	  includes/os/class.Darwin.inc.php,
+	  includes/os/class.WINNT.inc.php, includes/os/class.SunOS.inc.php:
+	  support for hiding specific mounts patch from here "[ 1214480 ]
+	  Support for hiding specific mounts" and closes also "[ 979229 ]
+	  Support for hiding specific mounts"
+
+2005-11-19 15:11  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/filesystems.php: don't count mountpoints twice or
+	  more fixes "[ 1123357 ] the totals size for hd"
+
+2005-11-19 14:42  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/: os/class.Linux.inc.php, xml/memory.php: if more than 1
+	  swapdevice, show the divices in output with the stats of each own
+	  fixes "[ 964630 ] 2 swap partition problem"
+
+2005-11-19 14:08  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/: system_header.php, lang/bg.php, lang/de.php,
+	  lang/lv.php, lang/pt.php, lang/lt.php, lang/sv.php, lang/br.php,
+	  lang/pl.php, lang/it.php, lang/da.php, lang/cs.php, lang/ct.php,
+	  lang/ro.php, lang/is.php, lang/ca.php, lang/fi.php,
+	  lang/big5.php, lang/et.php, lang/tr.php, lang/pt-br.php,
+	  lang/tw.php, lang/hu.php, lang/cn.php, lang/jp.php, lang/gr.php,
+	  lang/he.php, lang/ar_utf8.php, lang/nl.php, lang/ru.php,
+	  lang/fr.php, lang/no.php, lang/id.php, lang/es.php, lang/eu.php,
+	  lang/sk.php, lang/sr.php, lang/ko.php, lang/en.php,
+	  os/class.Linux.inc.php, xml/memory.php: split memory information
+	  (this time only for linux) this closes: "[ 1297967 ] memory usage
+	  includes cache... bad idea?" "[ 1065909 ] split memory usage
+	  information" "[ 1220004 ] Ignore cached memory" "[ 616434 ] More
+	  Memory Values" and now $text['locale'] is used for setting LC_ALL
+	  instead of LC_TIME (numbers have now correct dots and commas)
+
+2005-11-19 12:32  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/common_functions.php,
+	  templates/wintendoxp/images/nobar_middle.gif,
+	  templates/wintendoxp/images/nobar_right.gif,
+	  templates/wintendoxp/images/nobar_left.gif,
+	  templates/windows_classic/images/nobar_middle.gif,
+	  templates/windows_classic/images/nobar_right.gif,
+	  templates/windows_classic/images/nobar_left.gif,
+	  templates/kde/images/nobar_left.gif: included patch from "[
+	  1017212 ] create bar" if there are files called "nobar_*.gif" in
+	  the templates dir, a full bar is shown
+
+2005-11-18 18:05  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: don't show the devices
+	  serialnumber
+
+2005-11-18 17:52  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* config.php.new, includes/os/class.Linux.inc.php,
+	  includes/xml/filesystems.php: included feature suggested here "[
+	  1070565 ] Bind mount management; some cosmetics" and also by
+	  gentoo if showing bind-mounts they dont't increase the overall
+	  size, if disable these mounts not shown controlled by an option
+	  in config.php
+
+2005-11-18 17:16  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/: memory.php, filesystems.php, hardware.php,
+	  network.php, vitals.php, mbinfo.php: now all strings are encoded
+	  in the xml ("[ 1075222 ] XML "&" problems"), not everywhere
+	  necassary, but now it should be safe
+
+2005-11-18 16:59  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: include the patch from gentoo
+	  for sparc
+
+2005-11-18 16:55  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/hardware.php: fixes bug "[ 1072981 ] XML Parsing
+	  error", if there are some characters in the device name which
+	  breaks xml
+
+2005-11-18 16:50  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/: os/class.Linux.inc.php, os/class.BSD.common.inc.php,
+	  xml/filesystems.php: this fixes bugs: "[ 619173 ] broken
+	  filesystem() code" "[ 1001681 ] can't handle whitespaces" also
+	  convert specialchars in devicename and mountpoint to be html
+	  conform
+
+2005-11-18 15:46  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/hardware.php: never, really never store language
+	  specific words in an xml document (if there is no CDATA section)
+
+2005-11-18 15:11  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: security fix for phpgroupware
+
+2005-11-17 19:55  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php, includes/os/class.NetBSD.inc.php,
+	  includes/os/class.Darwin.inc.php,
+	  includes/os/class.FreeBSD.inc.php,
+	  includes/os/class.OpenBSD.inc.php: all require() changed to
+	  require_once() and they include now the APP_ROOT, for using
+	  phpsysinfo in other web-apps
+
+2005-11-17 16:56  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/mb/class.lmsensors.inc.php: following bugs should be
+	  fixed now: "[ 1357257 ] lmsensors & phpsysinfo bugs" "[ 1241520 ]
+	  Temperature, Voltage Empty" "[ 1109524 ] lmsensores Bug" included
+	  fix for "[ 1277145 ] Fan Speed w/out divisor does not show" and
+	  finally fix for some E_NOTICE massages
+
+2005-11-16 21:47  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/lang/nl.php: updated translation from patch "[ 1104472 ]
+	  Dutch language patch"
+
+2005-11-16 21:42  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/lang/fr.php: updated translation from "[ 1220000 ]
+	  French language patch", hope this is all correct translated
+
+2005-11-16 21:28  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: included patch "[ 1198070 ] SuSE
+	  Enterprise Server not detected" also change distribution
+	  detection (first check if a file exist before read it, one icon
+	  can also have more than one associated file)
+
+2005-11-16 17:39  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/system_footer.php, includes/os/class.NetBSD.inc.php,
+	  includes/os/class.Darwin.inc.php,
+	  includes/os/class.FreeBSD.inc.php,
+	  includes/os/class.OpenBSD.inc.php: security fixes, mentioned in
+	  bug "[ 1168383 ] phpSysInfo 2.3 Multiple vulnerabilities"
+
+2005-11-16 17:26  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/XPath.class.php: update to latest version, which fixes
+	  array_merge() warnings
+
+2005-11-16 16:32  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/lang/ru.php: applied patch "[ 1234692 ] Russian lang
+	  typo/mistake fix"
+
+2005-11-11 21:13  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: This is a quick fix for the $lng issue reintroduced in
+	  Version 2.4.	The bugfix for CVE-2005-3347 has reopened
+	  CVE-2003-0536, but since we expect a very short string (directory
+	  name), we can actually do basename and strip off any non-filename
+	  characters.  Also, CVE-2005-3348 was not fixed with
+	  register_globals On, since $charset could be overwritten.  Fix by
+	  christopher.kunz@hardened-php.net */
+
+2005-11-10 17:39  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, index.php: misc updates, releasing 2.4
+
+2005-11-10 17:31  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/sr.php: adding serbian translation
+
+2005-08-19 19:02  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/XPath.class.php: updating to the latest version of
+	  XPath.class.php
+
+2004-10-30 08:09  webbie (webbie at ipfw dot org)
+
+	* includes/mb/: class.healthd.inc.php, class.lmsensors.inc.php,
+	  class.hwsensors.inc.php, class.mbm5.inc.php, class.mbmon.inc.php:
+	  Saving the results of the output to a class level variable, we
+	  only need to run the mbmon binary once.
+
+2004-10-30 07:14  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.mbmon.inc.php: Saving the results of the output
+	  to a class level variable, we only need to run the mbmon binary
+	  once.   ( Gorilla <gorilla_ at users.sf.net> )
+
+2004-10-29 06:49  webbie (webbie at ipfw dot org)
+
+	* includes/xml/filesystems.php: hide mount point in XML when
+	  $show_mount_point is false
+
+2004-10-13 08:13  webbie (webbie at ipfw dot org)
+
+	* includes/: os/class.HP-UX.inc.php, os/class.Linux.inc.php,
+	  os/class.BSD.common.inc.php, os/class.WINNT.inc.php,
+	  os/class.SunOS.inc.php, xml/vitals.php: sysinfo classes return
+	  the Uptime in seconds.   ( Edwin Meester <millenniumv3 at
+	  users.sf.net> )
+
+2004-10-06 05:51  webbie (webbie at ipfw dot org)
+
+	* includes/lang/lt.php: proper Lithuanian translation update
+
+2004-10-06 05:45  webbie (webbie at ipfw dot org)
+
+	* index.php, includes/common_functions.php: Removed GD dependency
+	  ( Edwin Meester <millenniumv3 at users.sf.net> )
+
+2004-10-05 00:39  webbie (webbie at ipfw dot org)
+
+	* index.php: remove debug statement
+
+2004-10-04 03:16  webbie (webbie at ipfw dot org)
+
+	* index.php: comestic fix again
+
+2004-10-04 03:15  webbie (webbie at ipfw dot org)
+
+	* index.php: comestic fix
+
+2004-10-04 03:13  webbie (webbie at ipfw dot org)
+
+	* index.php: bug fix, wrong _GET language variable
+
+2004-10-03 07:13  webbie (webbie at ipfw dot org)
+
+	* includes/: mb/class.mbm5.inc.php, system_footer.php: comestic fix
+
+2004-10-03 07:12  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.mbm5.inc.php: A class for MBM5 wich parses the
+	  csv logs for Fan Speed, Voltages and Temperatures. see the Note
+	  for making things work.  ( Edwin Meester <millenniumv3 at
+	  users.sf.net> )
+
+2004-10-03 05:05  webbie (webbie at ipfw dot org)
+
+	* includes/lang/lt.php: comestic update     ( Rimas Kudelis <er-ku
+	  at users.sf.net> )
+
+2004-10-03 04:25  webbie (webbie at ipfw dot org)
+
+	* index.php, includes/system_footer.php: do not use
+	  register_long_arrays	 ( Edwin Meester <millenniumv3 at
+	  sf.users.net> )
+
+2004-10-03 04:14  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.lmsensors.inc.php: Dirty fix for misinterpreted
+	  output of sensors, where info could come on next line when the
+	  label is too long.  ( Martijn Stolk <netrippert at users.sf.net>
+	  )
+
+2004-10-03 04:07  webbie (webbie at ipfw dot org)
+
+	* config.php.new: A class for MBM5 wich parses the csv logs for Fan
+	  Speed, Voltages and Temperatures. see the Note for making things
+	  work.  ( Edwin Meester <millenniumv3 at users.sf.net> )
+
+2004-09-01 18:00  webbie (webbie at ipfw dot org)
+
+	* includes/lang/fr.php: cosmectic fix
+
+2004-08-31 17:50  webbie (webbie at ipfw dot org)
+
+	* templates/: aq/index.html, black/index.html,
+	  black/images/index.html, aq/images/index.html, blue/index.html,
+	  blue/images/index.html, bulix/index.html,
+	  bulix/images/index.html, kde/index.html, kde/images/index.html,
+	  classic/index.html, classic/images/index.html, orange/index.html,
+	  orange/images/index.html, metal/index.html,
+	  metal/images/index.html, typo3/index.html, wintendoxp/index.html,
+	  wintendoxp/images/index.html, windows_classic/index.html,
+	  windows_classic/images/index.html, typo3/images/index.html:
+	  prevent index listing
+
+2004-08-30 16:05  webbie (webbie at ipfw dot org)
+
+	* templates/windows_classic/images/: bottom_left_corner.gif,
+	  bottom_right_corner.gif, right.gif, left.gif,
+	  upper_right_corner.gif, min_max.gif, top.gif,
+	  upper_left_corner.gif, middle.gif, bottom.gif: Changed the colors
+	  and Icon.	( Edwin Meester <millenniumv3 at users.sf.net> )
+
+2004-08-30 15:51  webbie (webbie at ipfw dot org)
+
+	* includes/lang/: bg.php, br.php, big5.php, ar_utf8.php, de.php,
+	  lv.php, pt.php, lt.php, sv.php, pl.php, it.php, da.php, cs.php,
+	  ct.php, ro.php, is.php, ca.php, fi.php, et.php, tr.php,
+	  pt-br.php, tw.php, hu.php, cn.php, jp.php, gr.php, he.php,
+	  nl.php, ru.php, fr.php, no.php, id.php, es.php, eu.php, sk.php,
+	  ko.php, en.php: missing USB tag     ( Edwin Meester <millenniumv3
+	  at users.sf.net> )
+
+2004-08-30 15:28  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.WINNT.inc.php: Fatal error: Call to undefined
+	  method variant::Next() in
+	  F:\Http\localhost\test\phpsysinfo\includes\os\class.WINNT.inc
+	  .php on line 104 ( Edwin Meester <millenniumv3 at users.sf.net> )
+
+2004-08-25 19:33  webbie (webbie at ipfw dot org)
+
+	* includes/lang/nl.php: - Updated CPUSpeed en BUSSpeed Labels -
+	  changed "Buffergrootte" to "Cache grootte" cause Cache is used by
+	  most of Dutch PC Shops...  ( Edwin Meester <millenniumv3 at
+	  users.sf.net> )
+
+2004-08-25 03:04  webbie (webbie at ipfw dot org)
+
+	* includes/: system_footer.php, lang/bg.php, lang/de.php,
+	  lang/lv.php, lang/lt.php, lang/br.php, lang/it.php, lang/da.php,
+	  lang/cs.php, lang/ct.php, lang/is.php, lang/ca.php, lang/fi.php,
+	  lang/big5.php, lang/et.php, lang/hu.php, lang/cn.php,
+	  lang/jp.php, lang/gr.php, lang/he.php, lang/ar_utf8.php,
+	  lang/nl.php, lang/fr.php, lang/id.php, lang/es.php, lang/eu.php,
+	  lang/ko.php, lang/en.php, lang/pt.php, lang/sv.php, lang/pl.php,
+	  lang/ro.php, lang/tr.php, lang/pt-br.php, lang/tw.php,
+	  lang/ru.php, lang/no.php, lang/sk.php, os/class.Darwin.inc.php,
+	  xml/hardware.php: add BUS Speed to the hardware section (
+	  macftphttp.serverbox.org <macftphttp at users.sf.net> ) ( Edwin
+	  Meester <millenniumv3 at users.sf.net> )
+
+2004-08-25 02:34  webbie (webbie at ipfw dot org)
+
+	* includes/: lang/bg.php, lang/de.php, lang/lv.php, lang/pt.php,
+	  lang/lt.php, lang/sv.php, lang/br.php, lang/pl.php, lang/it.php,
+	  lang/da.php, lang/cs.php, lang/ct.php, lang/ro.php, lang/is.php,
+	  lang/ca.php, lang/fi.php, lang/big5.php, lang/et.php,
+	  lang/tr.php, lang/pt-br.php, lang/tw.php, lang/hu.php,
+	  lang/cn.php, lang/jp.php, lang/gr.php, lang/he.php,
+	  lang/ar_utf8.php, lang/nl.php, lang/ru.php, lang/fr.php,
+	  lang/no.php, lang/id.php, lang/es.php, lang/eu.php, lang/sk.php,
+	  lang/ko.php, lang/en.php, os/class.HP-UX.inc.php,
+	  os/class.Linux.inc.php, os/class.BSD.common.inc.php,
+	  os/class.Darwin.inc.php, os/class.WINNT.inc.php,
+	  os/class.SunOS.inc.php, xml/hardware.php: show CPU speed as X.XX
+	  Ghz or XXX Mhz if less than 1 Ghz.  ( macftphttp.serverbox.org
+	  <macftphttp at users.sf.net> ) ( Edwin Meester <millenniumv3 at
+	  users.sf.net> )
+
+2004-08-24 23:57  webbie (webbie at ipfw dot org)
+
+	* templates/windows_classic/: box.tpl, windows_classic.css,
+	  form.tpl, images/bottom_left_corner.gif,
+	  images/bottom_right_corner.gif, images/redbar_middle.gif,
+	  images/spacer.gif, images/bar_middle.gif, images/right.gif,
+	  images/left.gif, images/bar_right.gif, images/min_max.gif,
+	  images/redbar_right.gif, images/top.gif,
+	  images/upper_left_corner.gif, images/redbar_left.gif,
+	  images/middle.gif, images/bar_left.gif, images/bottom.gif,
+	  images/upper_right_corner.gif: new windows_classic template	 (
+	  Edwin Meester <millenniumv3 at users.sf.net> )
+
+2004-08-24 23:18  webbie (webbie at ipfw dot org)
+
+	* includes/lang/fr.php: update french localization   ( Xavier
+	  Spirlet <exess at skynet.be> )
+
+2004-08-24 23:06  webbie (webbie at ipfw dot org)
+
+	* templates/: aq/form.tpl, black/form.tpl, blue/form.tpl,
+	  bulix/form.tpl, kde/form.tpl, wintendoxp/form.tpl,
+	  orange/form.tpl, metal/form.tpl, typo3/form.tpl: remove
+	  hysteresis from temperature section
+
+2004-08-24 22:58  webbie (webbie at ipfw dot org)
+
+	* includes/xml/mbinfo.php, templates/classic/form.tpl: [no log
+	  message]
+
+2004-08-23 23:02  webbie (webbie at ipfw dot org)
+
+	* includes/lang/nl.php: - Fixed the Dutch Local windows and Linux.
+	  (Guess al other files have to be patched also (for windows
+	  support)
+
+	  - translated labels from version 2.2 and 2.3
+
+	  ( Edwin Meester <millenniumv3 at users.sf.net> )
+
+2004-08-23 22:56  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: add sun cobalt detection   (
+	  Jerry Bauer <kb at diskfailure.nl> )
+
+2004-08-19 14:48  webbie (webbie at ipfw dot org)
+
+	* config.php.new: update comments
+
+2004-08-19 14:32  webbie (webbie at ipfw dot org)
+
+	* includes/lang/is.php: update Icelandic translation   (Throstur
+	  Svanbergsson <throstur at users.sf.net> )
+
+2004-08-19 14:26  webbie (webbie at ipfw dot org)
+
+	* index.php: disable notice if cookie is not set
+
+2004-08-14 22:18  webbie (webbie at ipfw dot org)
+
+	* index.php: bump version to 2.4-cvs
+
+2004-08-14 11:22  webbie (webbie at ipfw dot org)
+
+	* index.php (tags: REL-2-3): phpsysinfo version 2.3 release!
+
+2004-08-13 23:02  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php (tags: REL-2-3): template picklist
+	  should only pickup directory name and language picklist should
+	  only pickup language file with .php extension
+
+2004-08-12 00:07  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php: comestic bug fix
+
+2004-08-11 11:55  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php: format code using phpCodeBeautifier
+
+2004-08-11 07:34  webbie (webbie at ipfw dot org)
+
+	* config.php.new (tags: REL-2-3), includes/system_footer.php: add
+	  option to hide/display langauge and template picklist
+
+2004-08-11 07:23  webbie (webbie at ipfw dot org)
+
+	* config.php.new, index.php: default template and language config
+	  option   (requested by many peoples)
+
+2004-08-11 06:55  webbie (webbie at ipfw dot org)
+
+	* images/Arch.gif, includes/os/class.Linux.inc.php (utags:
+	  REL-2-3): Add Arch Linux detection	 ( Simo L <neotuli at
+	  users.sf.net> )
+
+2004-07-18 03:27  webbie (webbie at ipfw dot org)
+
+	* includes/index.html, includes/lang/index.html,
+	  includes/mb/index.html, includes/os/index.html,
+	  includes/xml/index.html, images/index.html,
+	  templates/wintendoxp/form.tpl, templates/index.html,
+	  templates/kde/form.tpl, sample/index.html (utags: REL-2-3):
+	  prevent index listing
+
+2004-07-16 22:06  webbie (webbie at ipfw dot org)
+
+	* templates/classic/form.tpl (tags: REL-2-3): remove hysteresis
+	  from temperature section
+
+2004-07-16 22:06  webbie (webbie at ipfw dot org)
+
+	* templates/: aq/form.tpl (tags: REL-2-3), black/form.tpl (tags:
+	  REL-2-3), orange/form.tpl (tags: REL-2-3), metal/form.tpl (tags:
+	  REL-2-3), blue/form.tpl (tags: REL-2-3), bulix/form.tpl (tags:
+	  REL-2-3), kde/form.tpl, wintendoxp/form.tpl, typo3/form.tpl
+	  (tags: REL-2-3): add temperature section to bulix and fixing
+	  table tag problem in form.tpl     ( Frederik Schueler <fschueler
+	  at users.sf.net> )
+
+2004-07-14 06:34  webbie (webbie at ipfw dot org)
+
+	* README (tags: REL-2-3): phpsysinfo does work on PHP5.x
+
+2004-07-12 01:39  webbie (webbie at ipfw dot org)
+
+	* includes/lang/: jp.php, ar_utf8.php (utags: REL-2-3): fixing
+	  language template for ar_utf8 and jp	  ( Frederik Schueler
+	  <fschueler at users.sf.net> )
+
+2004-07-05 17:55  webbie (webbie at ipfw dot org)
+
+	* README, config.php.new: better hardware sensor installation
+	  instructions
+
+2004-07-03 01:28  webbie (webbie at ipfw dot org)
+
+	* includes/xml/mbinfo.php (tags: REL-2-3): remove hysteresis from
+	  temperature section
+
+2004-07-02 02:33  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.OpenBSD.inc.php (tags: REL-2-3): remove WIP
+	  message
+
+2004-07-02 02:32  webbie (webbie at ipfw dot org)
+
+	* includes/os/: class.BSD.common.inc.php (tags: REL-2-3),
+	  class.WINNT.inc.php (tags: REL-2-3), class.OpenBSD.inc.php:
+	  Proper fix OpenBSD pci logic
+
+2004-06-29 01:29  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.WINNT.inc.php: add ending ?>
+
+2004-06-29 01:26  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.WINNT.inc.php: Now supports v2.2 of phpSysInfo.
+	  ( Carl C. Longnecker <longneck at users.sf.net> )
+
+2004-06-28 20:51  webbie (webbie at ipfw dot org)
+
+	* includes/: common_functions.php (tags: REL-2-3),
+	  os/class.WINNT.inc.php: add WinNT support   ( Carl C. Longnecker
+	  <longneck at users.sf.net> )
+
+2004-06-27 00:24  webbie (webbie at ipfw dot org)
+
+	* index.php: template and lng cookies now work with register global
+	  on and off
+
+2004-06-26 23:46  webbie (webbie at ipfw dot org)
+
+	* includes/: os/class.HP-UX.inc.php (tags: REL-2-3),
+	  os/class.NetBSD.inc.php (tags: REL-2-3), os/class.Linux.inc.php,
+	  os/class.BSD.common.inc.php, os/class.Darwin.inc.php (tags:
+	  REL-2-3), os/class.FreeBSD.inc.php (tags: REL-2-3),
+	  os/class.OpenBSD.inc.php, xml/hardware.php (tags: REL-2-3): Add
+	  scsi hdd capacity information
+
+2004-06-26 01:50  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.SunOS.inc.php (tags: REL-2-3): remove
+	  compat_array_keys and add usb function boby
+
+2004-06-26 01:27  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.hwsensors.inc.php (tags: REL-2-3): compatible
+	  with OpenBSD 3.5 ( psyc <scotchme@users.sf.net> )
+
+2004-06-26 01:18  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.BSD.common.inc.php: make it compatible with
+	  OpenBSD 3.4
+
+2004-06-26 00:24  webbie (webbie at ipfw dot org)
+
+	* includes/XPath.class.php (tags: REL-2-3): make phpsysinfo works
+	  with php5 see http://bugs.php.net/bug.php?id=27815
+
+2004-06-21 19:14  precision    Uriah Welcome (precision at users.sf.net)
+
+	* images/Trustix.gif (tags: REL-2-3): Adding trustix detection
+
+2004-06-21 19:14  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: adding trustix detection from
+	  Gervasio Varela <gervarela at teleline.es>
+
+2004-06-21 19:09  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/typo3/: typo3.css (tags: REL-2-3), box.tpl (tags:
+	  REL-2-3), form.tpl, images/redbar_middle.gif (tags: REL-2-3),
+	  images/bar_middle.gif (tags: REL-2-3), images/bar_right.gif
+	  (tags: REL-2-3), images/redbar_right.gif (tags: REL-2-3),
+	  images/trans.gif (tags: REL-2-3), images/redbar_left.gif (tags:
+	  REL-2-3), images/bar_left.gif (tags: REL-2-3): adding typo3
+	  template from Mauric Rene Oberlaender <admin at mronet.at>
+
+2004-06-12 23:02  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.lmsensors.inc.php (tags: REL-2-3): This
+	  validates that the limit is actually greater than the hysteresis
+	  value (which is should be).
+
+2004-06-09 16:22  webbie (webbie at ipfw dot org)
+
+	* index.php, phpsysinfo.dtd (tags: REL-2-3): diable magic quotes
+	  during runtime
+
+2004-05-23 02:35  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php: doesn't need to check for 'xml'
+
+2004-05-23 01:47  webbie (webbie at ipfw dot org)
+
+	* sample/mount1.txt (tags: REL-2-3): add sample mount output
+
+2004-05-22 22:13  webbie (webbie at ipfw dot org)
+
+	* config.php.new, includes/system_footer.php,
+	  includes/mb/class.mbmon.inc.php (tags: REL-2-3): Add mbmon
+	  support   ( Zoltan Frombach <zoltan at frombach.com> )
+
+2004-05-15 21:24  webbie (webbie at ipfw dot org)
+
+	* index.php: bump version to 2.3-cvs
+
+2004-05-15 07:27  webbie (webbie at ipfw dot org)
+
+	* index.php (tags: REL-2-2): bump version to 2.2
+
+2004-05-07 01:05  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php (tags: REL-2-2): Add Free EOS
+	  distro detection
+
+2004-05-07 00:51  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Darwin.inc.php (tags: REL-2-2): use Darwin icon
+	  instead of xp icon, peoples are very upset =)
+
+2004-05-05 22:09  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.lmsensors.inc.php (tags: REL-2-2): redo some
+	  regex, hopefully it fixes some weird temperature parsing problem
+
+2004-05-05 21:50  webbie (webbie at ipfw dot org)
+
+	* sample/: lmsensors3.txt, lmsensors1.txt, lmsensors2.txt (utags:
+	  REL-2-2, REL-2-3): add sample lmsensors output
+
+2004-05-02 18:45  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: add SuSE distro detection	(
+	  Ben van Essen <flark at users.sf.net> )
+
+2004-05-02 01:41  webbie (webbie at ipfw dot org)
+
+	* index.php: remove magic quote statement, it is unnecessary
+
+2004-05-01 08:48  webbie (webbie at ipfw dot org)
+
+	* index.php, includes/system_footer.php (tags: REL-2-2): coding
+	  style fixup
+
+2004-05-01 08:31  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php: fix minor glitches in the
+	  system_footer.php   <macftphttp at users.sourceforge.net>
+
+2004-04-30 08:29  webbie (webbie at ipfw dot org)
+
+	* index.php (tags: REL-2-2-RC1): bump version to 2.2-rc1, getting
+	  ready for the final release
+
+2004-04-30 06:04  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Darwin.inc.php (tags: REL-2-2-RC1): Fix Xpath
+	  error in XPath.class.php (David Schlosnagle <schlosna at
+	  users.sourceforge.net>)
+
+2004-04-30 05:42  webbie (webbie at ipfw dot org)
+
+	* index.php: 1. add xml module check 2. turn of magic quote
+
+2004-04-28 07:14  webbie (webbie at ipfw dot org)
+
+	* phpsysinfo.dtd (tags: REL-2-2, REL-2-2-RC1): Add Distroicon
+	  element
+
+2004-04-28 07:12  webbie (webbie at ipfw dot org)
+
+	* includes/lang/: bg.php (tags: REL-2-3), de.php (tags: REL-2-3),
+	  lv.php (tags: REL-2-3), pt.php (tags: REL-2-3), lt.php (tags:
+	  REL-2-3), sv.php (tags: REL-2-3), br.php (tags: REL-2-3), pl.php
+	  (tags: REL-2-3), it.php (tags: REL-2-3), da.php (tags: REL-2-3),
+	  cs.php (tags: REL-2-3), ct.php (tags: REL-2-3), ro.php (tags:
+	  REL-2-3), is.php (tags: REL-2-3), ca.php (tags: REL-2-3), fi.php
+	  (tags: REL-2-3), big5.php (tags: REL-2-3), et.php (tags:
+	  REL-2-3), tr.php (tags: REL-2-3), pt-br.php (tags: REL-2-3),
+	  tw.php (tags: REL-2-3), hu.php (tags: REL-2-3), cn.php (tags:
+	  REL-2-3), jp.php, gr.php (tags: REL-2-3), he.php (tags: REL-2-3),
+	  ar_utf8.php, nl.php (tags: REL-2-3), ru.php (tags: REL-2-3),
+	  fr.php (tags: REL-2-3), no.php (tags: REL-2-3), id.php (tags:
+	  REL-2-3), es.php (tags: REL-2-3), eu.php (tags: REL-2-3), sk.php
+	  (tags: REL-2-3), ko.php (tags: REL-2-3), en.php (tags: REL-2-3)
+	  (utags: REL-2-2, REL-2-2-RC1): fix label case
+
+2004-04-28 06:46  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.lmsensors.inc.php (tags: REL-2-2-RC1): minor
+	  regex string fix
+
+2004-04-25 05:46  webbie (webbie at ipfw dot org)
+
+	* config.php.new, includes/mb/class.hwsensors.inc.php (utags:
+	  REL-2-2, REL-2-2-RC1): add OpenBSD hw.sensors support
+
+2004-04-25 00:39  webbie (webbie at ipfw dot org)
+
+	* includes/XPath.class.php (tags: REL-2-2, REL-2-2-RC1): update
+	  XPath.class.php to v3.4
+
+2004-04-24 22:52  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php (tags: REL-2-2-RC1): Bug fix in
+	  distroicon function
+
+2004-04-24 22:36  webbie (webbie at ipfw dot org)
+
+	* includes/: os/class.HP-UX.inc.php (tags: REL-2-2, REL-2-2-RC1),
+	  os/class.NetBSD.inc.php (tags: REL-2-2, REL-2-2-RC1),
+	  os/class.Linux.inc.php, os/class.Darwin.inc.php,
+	  os/class.FreeBSD.inc.php (tags: REL-2-2, REL-2-2-RC1),
+	  os/class.SunOS.inc.php (tags: REL-2-2, REL-2-2-RC1),
+	  os/class.OpenBSD.inc.php (tags: REL-2-2, REL-2-2-RC1),
+	  xml/vitals.php (tags: REL-2-3, REL-2-2, REL-2-2-RC1): Redo the
+	  distro icon logic, the old way is ugly
+
+2004-04-24 05:53  webbie (webbie at ipfw dot org)
+
+	* includes/: os/class.Linux.inc.php, xml/vitals.php: Add Slackware
+	  detection   ( Paul Cairney <pcairney at users.sourceforge.net> )
+
+2004-04-06 00:26  webbie (webbie at ipfw dot org)
+
+	* includes/: os/class.Linux.inc.php, xml/vitals.php: add Fedora
+	  distro and thank you Beretta for all the distro icons
+
+2004-03-31 21:20  webbie (webbie at ipfw dot org)
+
+	* templates/aq/images/: redbar_middle.gif, d.gif, inf.gif, g.gif,
+	  bar_middle.gif, bar_right.gif, redbar_right.gif, coininfd.gif,
+	  coinsupd.gif, redbar_left.gif, coininfg.gif, coinsupg.gif,
+	  bar_left.gif, sup.gif, fond.gif (utags: REL-2-2, REL-2-2-RC1,
+	  REL-2-3): overwrote aq theme by mistake
+
+2004-03-31 21:08  webbie (webbie at ipfw dot org)
+
+	* templates/bulix/bulix.css (tags: REL-2-3, REL-2-2, REL-2-2-RC1):
+	  cosmetic fix
+
+2004-03-31 10:25  webbie (webbie at ipfw dot org)
+
+	* includes/xml/vitals.php: missing closing bracket
+
+2004-03-31 10:21  webbie (webbie at ipfw dot org)
+
+	* includes/xml/vitals.php, images/xp.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1): Add distro icon logic
+
+2004-03-14 05:59  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: doesn't need 4k buffer to read
+	  distro string
+
+2004-03-14 05:56  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: Add Gentoo Distro detection (
+	  Mark Gillespie <mgillespie @ users.sf.net> )
+
+2004-03-14 05:21  webbie (webbie at ipfw dot org)
+
+	* includes/mb/: class.healthd.inc.php (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), class.lmsensors.inc.php: fix missing ?> tag
+
+2004-03-14 05:16  webbie (webbie at ipfw dot org)
+
+	* includes/: XPath.class.php, class.Template.inc.php (tags:
+	  REL-2-3, REL-2-2, REL-2-2-RC1), os/class.HP-UX.inc.php,
+	  os/class.NetBSD.inc.php, os/class.Linux.inc.php,
+	  os/class.BSD.common.inc.php (tags: REL-2-2, REL-2-2-RC1),
+	  os/class.Darwin.inc.php, os/class.FreeBSD.inc.php,
+	  os/class.SunOS.inc.php, os/class.OpenBSD.inc.php: fix missing
+	  ending ?> tag
+
+2004-03-14 05:05  webbie (webbie at ipfw dot org)
+
+	* index.php: better error message if config.php is missing
+
+2004-03-13 04:52  webbie (webbie at ipfw dot org)
+
+	* templates/wintendoxp/images/: redbar_middle.gif, d.gif, inf.gif,
+	  g.gif, background.gif, bar_middle.gif, aq_background.gif,
+	  bar_right.gif, icons.gif, redbar_right.gif, coininfd.gif,
+	  coinsupd.gif, redbar_left.gif, coininfg.gif, coinsupg.gif,
+	  bar_left.gif, sup.gif, space15_15.gif, fond.gif (utags: REL-2-2,
+	  REL-2-2-RC1, REL-2-3): Rip wintendoxp theme from aspSysInfo
+
+2004-03-13 00:27  webbie (webbie at ipfw dot org)
+
+	* templates/wintendoxp/: box.tpl (tags: REL-2-3), form.tpl,
+	  wintendoxp.css (tags: REL-2-3) (utags: REL-2-2, REL-2-2-RC1): Rip
+	  wintendoxp theme from aspSysInfo
+
+2004-03-13 00:04  webbie (webbie at ipfw dot org)
+
+	* phpsysinfo.dtd, includes/lang/bg.php, includes/lang/ar_utf8.php,
+	  includes/lang/de.php, includes/lang/lv.php, includes/lang/pt.php,
+	  includes/lang/lt.php, includes/lang/sv.php, includes/lang/br.php,
+	  includes/lang/pl.php, includes/lang/it.php, includes/lang/da.php,
+	  includes/lang/cs.php, includes/lang/ct.php, includes/lang/ro.php,
+	  includes/lang/is.php, includes/lang/ca.php, includes/lang/fi.php,
+	  includes/lang/big5.php, includes/lang/et.php,
+	  includes/lang/tr.php, includes/lang/pt-br.php,
+	  includes/lang/tw.php, includes/lang/hu.php, includes/lang/cn.php,
+	  includes/lang/jp.php, includes/lang/gr.php, includes/lang/he.php,
+	  includes/lang/nl.php, includes/lang/ru.php, includes/lang/fr.php,
+	  includes/lang/no.php, includes/lang/id.php, includes/lang/es.php,
+	  includes/lang/eu.php, includes/lang/sk.php, includes/lang/ko.php,
+	  includes/lang/en.php, includes/os/class.HP-UX.inc.php,
+	  includes/os/class.NetBSD.inc.php,
+	  includes/os/class.Linux.inc.php,
+	  includes/os/class.Darwin.inc.php,
+	  includes/os/class.FreeBSD.inc.php,
+	  includes/os/class.SunOS.inc.php,
+	  includes/os/class.OpenBSD.inc.php, includes/xml/vitals.php: Add
+	  distro name as per Beretta's request
+
+2004-03-12 22:55  webbie (webbie at ipfw dot org)
+
+	* templates/kde/: box.tpl (tags: REL-2-3), kde.css (tags: REL-2-3),
+	  form.tpl, images/background.gif (tags: REL-2-3),
+	  images/bar_left.gif (tags: REL-2-3), images/bar_middle.gif (tags:
+	  REL-2-3), images/redbar_middle.gif (tags: REL-2-3), images/d.gif
+	  (tags: REL-2-3), images/inf.gif (tags: REL-2-3), images/g.gif
+	  (tags: REL-2-3), images/title_mid.gif (tags: REL-2-3),
+	  images/title_right.gif (tags: REL-2-3), images/nobar_middle.gif
+	  (tags: REL-2-3), images/bar_right.gif (tags: REL-2-3),
+	  images/title_left.gif (tags: REL-2-3), images/icons.gif (tags:
+	  REL-2-3), images/nobar_right.gif (tags: REL-2-3),
+	  images/redbar_right.gif (tags: REL-2-3), images/coininfd.gif
+	  (tags: REL-2-3), images/coinsupd.gif (tags: REL-2-3),
+	  images/redbar_left.gif (tags: REL-2-3), images/coininfg.gif
+	  (tags: REL-2-3), images/coinsupg.gif (tags: REL-2-3),
+	  images/sup.gif (tags: REL-2-3), images/space15_15.gif (tags:
+	  REL-2-3), images/fond.gif (tags: REL-2-3) (utags: REL-2-2,
+	  REL-2-2-RC1): Rip kde theme from aspSysInfo
+
+2004-03-12 22:51  webbie (webbie at ipfw dot org)
+
+	* templates/aq/images/: redbar_middle.gif, d.gif, inf.gif, g.gif,
+	  bar_middle.gif, bar_right.gif, redbar_right.gif, coininfd.gif,
+	  coinsupd.gif, redbar_left.gif, coininfg.gif, coinsupg.gif,
+	  bar_left.gif, sup.gif, fond.gif: Rip wintendoxp and kde theme
+	  from aspSysInfo
+
+2004-03-12 09:24  webbie (webbie at ipfw dot org)
+
+	* templates/: aq/box.tpl, black/box.tpl, metal/box.tpl (utags:
+	  REL-2-2, REL-2-2-RC1, REL-2-3): remove image alt="none" tag
+
+2004-03-12 07:01  webbie (webbie at ipfw dot org)
+
+	* includes/lang/lt.php: Add sensors section
+
+2004-03-12 07:00  webbie (webbie at ipfw dot org)
+
+	* includes/lang/lt.php: New lithuanian (lt) translation   ( Rimas
+	  Kudelis )
+
+2003-11-27 06:19  webbie (webbie at ipfw dot org)
+
+	* includes/xml/filesystems.php (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1): show mount point option fix
+
+2003-11-26 20:10  webbie (webbie at ipfw dot org)
+
+	* config.php.new: rename config.php to config.php.new to avoid cvs
+	  overwrite user config file
+
+2003-11-26 20:07  webbie (webbie at ipfw dot org)
+
+	* includes/xml/filesystems.php: proper fix for show_mount_point
+	  feature
+
+2003-11-26 19:57  webbie (webbie at ipfw dot org)
+
+	* includes/xml/filesystems.php: new option show_mount_point, set it
+	  to false to hide mount point
+
+2003-11-26 19:41  webbie (webbie at ipfw dot org)
+
+	* includes/xml/: memory.php (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  filesystems.php, network.php (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1): comestic fix to the bulix template
+
+2003-11-26 19:19  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php (tags: REL-2-2-RC1): for some reasons,
+	  xml folder shows up under template and lang directory. We need to
+	  hide it
+
+2003-11-26 02:20  webbie (webbie at ipfw dot org)
+
+	* includes/: system_footer.php, os/class.HP-UX.inc.php,
+	  os/class.NetBSD.inc.php, os/class.Linux.inc.php,
+	  os/class.BSD.common.inc.php, os/class.Darwin.inc.php,
+	  os/class.OpenBSD.inc.php: sort PCI, IDE and SCSI output by
+	  alphabetical order
+
+2003-11-25 19:57  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php: sort template and language dropdown
+	  list in alphabetical order
+
+2003-11-08 23:56  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: minor formatting cleanups
+
+2003-11-08 23:56  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_footer.php: adding XML option to the templates
+	  menu
+
+2003-11-08 23:49  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/: system_header.php (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), lang/jp.php, lang/ja.php (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1): adding Japanese language translations from Yuuki
+	  'SOI' Umeno <soip at users.sf.net>
+
+2003-11-08 23:43  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/bulix/: box.tpl (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  form.tpl (tags: REL-2-2, REL-2-2-RC1), bulix.css,
+	  images/redbar_middle.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/middle_bar.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/bar_middle.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/bar_right.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/redbar_right.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/trans.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/right_bar.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/redbar_left.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/left_bar.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/bar_left.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1): Adding
+	  new theme bulix from Maxime Petazzoni <maxime.petazzoni at
+	  nova-mag.org>
+
+2003-11-08 23:38  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/ar_utf8.php: Adding Arabic translation <nizar at
+	  srcget.com>
+
+2003-11-03 03:07  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: new memory function which works
+	  with all kernel versions    (Frederik Schueler <fschueler at
+	  gmx.net>)
+
+2003-10-15 03:24  webbie (webbie at ipfw dot org)
+
+	* includes/os/: class.HP-UX.inc.php, class.BSD.common.inc.php,
+	  class.SunOS.inc.php: Add groundwork for SBUS device list   (
+	  David Johnson <dj1471 at users.sf.net> )
+
+2003-10-15 03:17  webbie (webbie at ipfw dot org)
+
+	* phpsysinfo.dtd, includes/os/class.Linux.inc.php,
+	  includes/xml/hardware.php (tags: REL-2-2, REL-2-2-RC1): Add
+	  groundwork for SBUS device list    ( David Johnson <dj1471 at
+	  users.sf.net> )
+
+2003-10-15 03:02  webbie (webbie at ipfw dot org)
+
+	* index.php: outputs the "text/xml" content type when using the xml
+	  template.   ( Tim Carey-Smith <timcs at users.sf.net> )
+
+2003-10-15 02:52  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: SPARC CPU info fix	   ( David
+	  Johnson <dj1471 at users.sf.net> )
+
+2003-10-15 02:47  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: linux 2.5 or above memory
+	  display bug fix    ( Marcelo de Paula Bezerra <mosca at
+	  users.sf.net> ) and ( Frederik Sch�ler <fschueler at gmx.net> )
+
+2003-10-14 18:28  webbie (webbie at ipfw dot org)
+
+	* includes/lang/hu.php: missing a <
+
+2003-09-04 03:51  webbie (webbie at ipfw dot org)
+
+	* includes/lang/de.php: German locale update contributed by
+	  Alexander Wild <alexwild at gmx.de>
+
+2003-08-04 21:31  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_header.php: editor cleanups
+
+2003-08-04 21:28  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/mb/class.lmsensors.inc.php: trim() the results to the
+	  XML output is clean Some minor editor cleanups
+
+2003-08-04 21:28  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/en.php: Uppercasing Div and Histeresis to match
+	  everything else
+
+2003-07-22 00:38  webbie (webbie at ipfw dot org)
+
+	* includes/: mb/class.healthd.inc.php, mb/class.lmsensors.inc.php,
+	  os/class.HP-UX.inc.php, os/class.NetBSD.inc.php,
+	  os/class.Linux.inc.php, os/class.BSD.common.inc.php,
+	  os/class.Darwin.inc.php, os/class.FreeBSD.inc.php,
+	  os/class.SunOS.inc.php, os/class.OpenBSD.inc.php: code format
+	  cleanup using phpCodeBeautifier
+
+2003-07-22 00:31  webbie (webbie at ipfw dot org)
+
+	* index.php, includes/system_header.php,
+	  includes/common_functions.php (tags: REL-2-2, REL-2-2-RC1),
+	  includes/system_footer.php, includes/class.Template.inc.php: code
+	  format cleanup using phpCodeBeautifier
+
+2003-06-17 03:04  webbie (webbie at ipfw dot org)
+
+	* includes/system_header.php: Add hostname to the title for easy
+	  bookmarking  ( Maxim Solomatin <makc666 at newmail.ru> )
+
+2003-06-09 16:26  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.lmsensors.inc.php: lmsensor regex fix  ( SOD
+	  <sod at gmx.at> )
+
+2003-05-11 23:23  webbie (webbie at ipfw dot org)
+
+	* includes/lang/cn.php: cosmetic langauge fix
+
+2003-04-26 21:13  webbie (webbie at ipfw dot org)
+
+	* README (tags: REL-2-2, REL-2-2-RC1): wrong again, I am on drug
+	  today
+
+2003-04-26 21:11  webbie (webbie at ipfw dot org)
+
+	* README: oops.. wrong link
+
+2003-04-26 20:59  webbie (webbie at ipfw dot org)
+
+	* README: Make a note that this
+	  http://www.securityfocus.com/archive/1/319713/2003-04-23/2003-04-29/2
+	  problem is fixed
+
+2003-04-03 23:29  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: mee too
+
+2003-03-31 21:26  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/mb/class.healthd.inc.php,
+	  includes/mb/class.lmsensors.inc.php: minor formatting cleanups..
+	  removing some whitespace Fix the ChangeLog generator to fill in
+	  Webbie's email properly
+
+2003-03-31 21:22  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/pt-br.php: Adding Portuguese-Brazil translation
+	  (Marc�lio Maia <marcilio at edn.org.br>)
+
+2003-02-23 09:04  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.BSD.common.inc.php: fix swap space double count
+	  problem
+
+2003-02-16 04:04  webbie (webbie at ipfw dot org)
+
+	* includes/: lang/pl.php, lang/big5.php, lang/tw.php,
+	  xml/hardware.php: various language files update
+
+2003-02-16 03:34  webbie (webbie at ipfw dot org)
+
+	* includes/xml/hardware.php: Hide SCSI, USB section if it doesn't
+	  exist instead of showing as 'none'	( Cichy <cichy @
+	  users.sf.net> )
+
+2003-02-10 00:20  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php: use the method from php.net in the
+	  opendir loop
+
+2003-02-09 23:50  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.FreeBSD.inc.php: Fix network section. It should
+	  works for both FreeBSD 4.x and 5.x now
+
+2003-02-06 04:39  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/classic/classic.css (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1): small CSS fix for Opera 7 (Michael Herger <mherger
+	  at jo-sac.ch>)
+
+2003-02-06 04:36  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/lv.php: adding Latvian translation (Elvis Kvalbergs
+	  <elvis at burti.lv>)
+
+2003-01-25 08:04  webbie (webbie at ipfw dot org)
+
+	* index.php, includes/system_footer.php, includes/lang/bg.php,
+	  includes/lang/de.php, includes/lang/br.php, includes/lang/it.php,
+	  includes/lang/da.php, includes/lang/cs.php, includes/lang/ct.php,
+	  includes/lang/is.php, includes/lang/ca.php, includes/lang/fi.php,
+	  includes/lang/big5.php, includes/lang/et.php,
+	  includes/lang/hu.php, includes/lang/cn.php, includes/lang/gr.php,
+	  includes/lang/he.php, includes/lang/fr.php, includes/lang/id.php,
+	  includes/lang/es.php, includes/lang/eu.php, includes/lang/ko.php,
+	  includes/lang/en.php, includes/lang/pt.php, includes/lang/lt.php,
+	  includes/lang/sv.php, includes/lang/ro.php, includes/lang/tr.php,
+	  includes/lang/tw.php, includes/lang/nl.php, includes/lang/ru.php,
+	  includes/lang/no.php, includes/lang/sk.php,
+	  includes/os/class.BSD.common.inc.php: cosmetic change to the
+	  footer
+
+2003-01-21 01:06  webbie (webbie at ipfw dot org)
+
+	* includes/: system_header.php, system_footer.php, lang/bg.php,
+	  lang/br.php, lang/ca.php, lang/big5.php, lang/de.php,
+	  lang/da.php, lang/cs.php, lang/ct.php, lang/fi.php, lang/et.php,
+	  lang/cn.php, lang/es.php, lang/eu.php, lang/en.php, lang/gr.php,
+	  lang/he.php, lang/fr.php, lang/pt.php, lang/lt.php, lang/sv.php,
+	  lang/pl.php, lang/it.php, lang/ro.php, lang/is.php, lang/tr.php,
+	  lang/tw.php, lang/hu.php, lang/nl.php, lang/ru.php, lang/no.php,
+	  lang/id.php, lang/sk.php, lang/ko.php: display footer in locale
+	  <Cichy>
+
+2003-01-19 02:18  webbie (webbie at ipfw dot org)
+
+	* index.php: Bug #670222: DoS fix ( Wolter Kamphuis <wkamphuis at
+	  users.sf.net> )
+
+2003-01-10 16:50  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: Minor patch for detecting CPU
+	  info under Linux/sparc64. This patch enables phpSysInfo to
+	  retrieve number of CPU's, CPU MHz, and CPU bogomips on sparc64
+	  platforms running Linux.     (Jason Mann <jemann at sf.net>)
+
+2003-01-05 05:16  webbie (webbie at ipfw dot org)
+
+	* index.php, includes/xml/mbinfo.php (tags: REL-2-2, REL-2-2-RC1):
+	  make the temperature bar wider by using scale_factor = 4 and hide
+	  the fan section if all fans RPM are zero.  Suggestions made by
+	  cichy ( Artur Cichocki )
+
+2003-01-05 04:38  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.lmsensors.inc.php: ereg pattern fix: lm_sensors
+	  sometimes return temperature without histeresis
+
+2003-01-04 14:15  webbie (webbie at ipfw dot org)
+
+	* includes/xml/mbinfo.php: comestic change: round histeresis to one
+	  decimal place
+
+2003-01-04 14:08  webbie (webbie at ipfw dot org)
+
+	* index.php, includes/lang/bg.php, includes/lang/big5.php,
+	  includes/lang/br.php, includes/lang/da.php, includes/lang/cs.php,
+	  includes/lang/ct.php, includes/lang/ca.php, includes/lang/cn.php,
+	  includes/lang/de.php, includes/lang/pt.php, includes/lang/lt.php,
+	  includes/lang/sv.php, includes/lang/pl.php, includes/lang/it.php,
+	  includes/lang/ro.php, includes/lang/is.php, includes/lang/fi.php,
+	  includes/lang/et.php, includes/lang/tr.php, includes/lang/tw.php,
+	  includes/lang/hu.php, includes/lang/gr.php, includes/lang/he.php,
+	  includes/lang/nl.php, includes/lang/ru.php, includes/lang/fr.php,
+	  includes/lang/no.php, includes/lang/id.php, includes/lang/es.php,
+	  includes/lang/eu.php, includes/lang/sk.php, includes/lang/ko.php,
+	  includes/lang/en.php, includes/mb/class.healthd.inc.php,
+	  includes/mb/class.lmsensors.inc.php, includes/xml/mbinfo.php,
+	  templates/black/form.tpl (tags: REL-2-2, REL-2-2-RC1),
+	  templates/aq/form.tpl (tags: REL-2-2, REL-2-2-RC1),
+	  templates/orange/form.tpl (tags: REL-2-2, REL-2-2-RC1),
+	  templates/metal/form.tpl (tags: REL-2-2, REL-2-2-RC1),
+	  templates/blue/form.tpl (tags: REL-2-2, REL-2-2-RC1),
+	  templates/classic/form.tpl (tags: REL-2-2, REL-2-2-RC1): Initial
+	  import of the motherboard monitor program module.  It supports
+	  healthd and lm_sensors now.
+
+	  Credits go to NSPIRIT for his lm_sensors module and Cichy
+	  [cichyart@wp.pl] for his enhancements on lm_sensors module.
+
+2003-01-02 06:18  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.BSD.common.inc.php: cosmetic change, remove
+	  comma in the uptime output
+
+2003-01-02 06:12  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.HP-UX.inc.php: uptime and load average stat now
+	  working
+
+2002-12-31 01:51  webbie (webbie at ipfw dot org)
+
+	* includes/: os/class.BSD.common.inc.php, os/class.HP-UX.inc.php,
+	  os/class.NetBSD.inc.php, os/class.Linux.inc.php,
+	  os/class.Darwin.inc.php, os/class.FreeBSD.inc.php,
+	  os/class.SunOS.inc.php, os/class.OpenBSD.inc.php,
+	  xml/filesystems.php, xml/hardware.php, xml/network.php:
+	  Performance tuning, optimized the FOR loop	(webbie <webbie at
+	  ipfw.org>)
+
+2002-12-31 00:20  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php: Added space after "Created by"
+	  (webbie <webbie at ipfw.org>)
+
+2002-12-19 22:53  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/fr.php: small translation fix
+
+2002-12-17 19:23  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: get cache size on PPC (Derrik
+	  Pates <dpates at dsdk12.net>)
+
+2002-12-14 00:03  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.SunOS.inc.php: kstat() conversions to
+	  $this->kstat() removed kstatclass() seems to be unused
+
+2002-12-14 00:01  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.SunOS.inc.php: adding alpha SunOS support
+	  (Gunther Schreiner <schreiner at users.sf.net>)
+
+2002-12-13 23:47  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: fix for translation autodetection and php $_SERVER
+	  stuff (Andreas Heil <aheil at users.sf.net>)
+
+2002-12-13 23:44  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.OpenBSD.inc.php: trying array_unique() again,
+	  maybe this time it'll be consistant
+
+2002-12-13 23:36  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Darwin.inc.php: get proper uptime information
+	  from Jaguar (Mike <lashampoo at users.sf.net>)
+
+2002-12-13 23:34  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: properly stringify uptime
+	  information on BSD from Mike <lashampoo at users.sf.net>
+
+2002-12-13 23:28  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/gr.php: Adding Greek translation from Maria Kaitsa
+	  <idefix at ee.teiath.gr>
+
+2002-11-01 21:53  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/pt.php: added Portugese translation (Bernardo de
+	  Seabra <zznet at wake-on-lan.cjb.net>)
+
+2002-10-25 18:58  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/os/class.Linux.inc.php,
+	  includes/os/class.Darwin.inc.php, includes/xml/filesystems.php,
+	  includes/xml/hardware.php, includes/xml/vitals.php: small
+	  formatting cleanups
+
+2002-10-25 18:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/: bg.php, pl.php, ro.php, big5.php, et.php, tr.php,
+	  tw.php, hu.php, ru.php, fr.php, id.php, ko.php, en.php: small
+	  formatting cleanups
+
+2002-10-25 18:40  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Darwin.inc.php: 1 liner for uptime fix (Matthew
+	  Boehm <dr_mac at mail.utexas.edu>)
+
+2002-10-25 18:39  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/cn.php: Adding Simplified Chinese translation
+	  (<dantifer at tsinghua.org.cn>)
+
+2002-10-17 00:38  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/: system_header.php, system_footer.php: Move the
+	  timestamp outta the <title> and onto the main page  (Jeff Prom
+	  <Jeff.Prom at us.ing.com>)
+
+2002-10-17 00:37  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.NetBSD.inc.php: NetBSD swap information Fix for
+	  >=1.6 (Cliff Albert <cliff at oisec.net>)
+
+2002-10-17 00:34  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/da.php: misspelling (Esben Skov Pedersen <phreak at
+	  geek.linux.dk>)
+
+2002-10-17 00:32  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: Use lspci on linux if it exists
+	  idea by (Mike Beck <mikebeck @ users.sf.net>), reimplementation
+	  by me
+
+2002-10-10 00:12  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/XPath.class.php: updated XPath to latest stable version
+
+2002-09-28 07:53  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.HP-UX.inc.php: initial (alpha quality) HP-UX
+	  support (Webbie <webbie at ipfw.org>)
+
+2002-09-10 05:41  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php: Fix for new PHP (4.2.3)
+	  (Webbie <webbie at ipfw.org>)
+
+2002-09-01 17:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/no.php: updates from Stig-?rjan Smelror <kekepower
+	  at susperianews.cjb.net>
+
+2002-08-20 23:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* phpsysinfo.dtd, includes/lang/de.php, includes/lang/br.php,
+	  includes/lang/it.php, includes/lang/da.php, includes/lang/cs.php,
+	  includes/lang/ct.php, includes/lang/is.php, includes/lang/ca.php,
+	  includes/lang/fi.php, includes/lang/big5.php,
+	  includes/lang/et.php, includes/lang/hu.php, includes/lang/he.php,
+	  includes/lang/fr.php, includes/lang/id.php, includes/lang/es.php,
+	  includes/lang/eu.php, includes/lang/en.php,
+	  includes/os/class.Linux.inc.php,
+	  includes/os/class.BSD.common.inc.php, includes/xml/hardware.php:
+	  USB detection (Max J. Werner <max at home-werner.de>) Add dummy
+	  usb() method to BSD common class as a place holder (me) Update
+	  the DTD to reflect the new USB section (me)
+
+2002-08-20 23:35  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: don't display kernfs on
+	  bsd, since it's always 100% (Jarkko Santala <jake at iki.fi))
+
+2002-08-20 23:33  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: More Verbose BSD kernel
+	  information (Alan E <alane at geeksrus.net>)
+
+2002-08-05 02:48  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/xml/vitals.php: fix the bug where it wouldn't display
+	  the load average > 2
+
+2002-07-02 00:03  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/ru.php: Adding Russian translation from Voldar
+	  <voldar at stability.ru>
+
+2002-06-28 17:01  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: small alpha update
+
+2002-06-28 15:27  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/big5.php: added 2 new entires to the big5
+	  translation Webbie <webbie at ipfw.org>
+
+2002-06-24 17:20  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/sv.php: Updated Swedish translation from Jonas Tull
+	  <jetthe at home.se>
+
+2002-06-18 01:41  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/ko.php: moving kr.php -> ko.php and updating the
+	  charset.  It appears that ko is the proper abreviation and there
+	  is a 'new' charset.
+
+2002-06-17 19:03  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/bg.php: Added Bulgarian translation from Kaloyan
+	  Naumov <loop at nme.com>
+
+2002-06-05 21:50  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, index.php: bumped version number to 2.2-cvs
+
+2002-06-05 21:16  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README (tags: REL-2-1): small formatting changes.  Added a known
+	  problems section.
+
+2002-06-05 21:12  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php (tags: REL-2-1): Changed memory
+	  reporting to include buffers and disk cache in 'used' memory.  I
+	  get too many emails from people who don't understand this concept
+	  and wonder why it's different from 'top' or 'free'.
+
+2002-06-01 06:48  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php (tags: REL-2-1): small cleanups..
+
+2002-06-01 06:34  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/common_functions.php (tags: REL-2-1),
+	  includes/os/class.Linux.inc.php: removed php3 compat functions,
+	  since XPath requires php4 so do we now, no use having the compat
+	  functions.
+
+2002-06-01 06:24  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: Had to move language outside the conditional, the os
+	  classes use them some places..
+
+2002-05-31 22:40  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: moved more stuff inside the XML conditional, we don't
+	  need templates or languages for XML
+
+2002-05-31 21:45  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, index.php, phpsysinfo.dtd (tags: REL-2-1),
+	  includes/system_header.php (tags: REL-2-1),
+	  includes/common_functions.php, includes/system_footer.php (tags:
+	  REL-2-1): Added some generation information that might be useful
+	  to the XML template Added a global $VERSION Added a small
+	  HTML/XML comment showing our URL
+
+2002-05-31 20:09  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_footer.php: added 'random' template
+	  support.  closes feature request #562164
+
+2002-05-31 19:40  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/common_functions.php, includes/system_footer.php,
+	  includes/os/class.NetBSD.inc.php (tags: REL-2-1),
+	  includes/os/class.Linux.inc.php,
+	  includes/os/class.BSD.common.inc.php (tags: REL-2-1),
+	  includes/os/class.Darwin.inc.php (tags: REL-2-1),
+	  includes/os/class.FreeBSD.inc.php (tags: REL-2-1),
+	  includes/os/class.OpenBSD.inc.php (tags: REL-2-1): Code Cleanups
+	  Remove network_connections() from class.Linux since we never used
+	  it
+
+2002-05-31 18:59  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/eu.php (tags: REL-2-1): adding the Basque Language
+	  (eu.php).  Andoni <andonisz at ibercom.com>
+
+2002-05-30 05:09  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, phpsysinfo.dtd: don't need the URL in the dtd link all
+	  the CPU information should be optional
+
+2002-05-30 05:03  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: email address updates
+
+2002-05-30 05:02  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: formatting cleanups
+
+2002-05-30 05:00  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: Removed INSTALL, merged any useful information into
+	  README
+
+2002-05-30 00:13  precision    Uriah Welcome (precision at users.sf.net)
+
+	* phpsysinfo.dtd: forgot we need mulitples for <device>
+
+2002-05-30 00:12  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/xml/network.php (tags: REL-2-1): <device> -> <NetDevice>
+
+2002-05-30 00:08  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: small cleanups
+
+2002-05-29 23:52  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: added DTD support, we can validate now..
+
+2002-05-29 23:45  precision    Uriah Welcome (precision at users.sf.net)
+
+	* phpsysinfo.dtd: adding XML DTD (We can Validate now!)
+
+2002-05-29 22:04  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: [no log message]
+
+2002-05-29 22:01  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: small fix for bogomips on sparc
+	  linux
+
+2002-05-28 18:49  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/XPath.class.php (tags: REL-2-1): updated xpath class
+
+2002-05-20 18:09  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/cs.php (tags: REL-2-1): updated translation
+
+2002-05-08 20:17  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: don't set a cookie if we're using the xml template..
+
+2002-05-03 18:58  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: store the template as a cookie
+
+2002-05-03 18:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/orange/: orange.css (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), box.tpl (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  form.tpl, images/redbar_middle.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), images/bar_middle.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), images/bar_right.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), images/redbar_right.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), images/trans.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), images/redbar_left.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), images/bar_left.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1) (utags: REL-2-1): added the orange template
+
+2002-04-16 17:36  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: obsd memory updates
+
+2002-04-16 17:32  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/: lang/tr.php (tags: REL-2-1), os/class.Linux.inc.php:
+	  alpha cpu updates added turkish translation
+
+2002-04-12 17:19  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: better 2.2 alpha support
+
+2002-04-12 16:35  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/es.php (tags: REL-2-1): updated spanish translation
+
+2002-04-09 17:14  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/es.php: updates spanish translation
+
+2002-04-08 19:12  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/: system_header.php, lang/he.php (tags: REL-2-1): Hebrew
+	  language & text alignment
+
+2002-04-04 19:10  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Darwin.inc.php: small regex to remove
+	  <classIOPCIDevice> since XPath doens't like it.
+
+2002-04-04 18:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/xml/filesystems.php (tags: REL-2-1): small fix for
+	  filesystem percentage..
+
+2002-04-04 17:56  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/hu.php (tags: REL-2-1): added .hu translation
+
+2002-04-02 19:22  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: don't display linux /procfs
+	  compat..
+
+2002-04-02 19:17  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/: class.NetBSD.inc.php, class.Darwin.inc.php: updated
+	  class files!
+
+2002-03-21 19:59  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/en.php (tags: REL-2-1): typo
+
+2002-03-05 22:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: patch for bsd ide
+
+2002-03-04 19:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.OpenBSD.inc.php: small cpu regexp fix
+
+2002-02-25 21:53  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: added xml encoding type and moved a if clause so not
+	  to produce a php error.
+
+2002-02-25 21:15  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php: added fix in format_bytesize() we
+	  shouldn't put &nbsp's into XML
+
+2002-02-25 19:59  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/: common_functions.php, xml/memory.php (tags: REL-2-1),
+	  xml/filesystems.php, xml/hardware.php (tags: REL-2-1),
+	  xml/network.php, xml/vitals.php (tags: REL-2-1): minor cleanups
+
+2002-02-25 19:47  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/XPath.class.php: removed the deprecated stuff since we
+	  don't use it
+
+2002-02-22 21:15  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/xml/hardware.php: oops forgot ide() needs $text;
+
+2002-02-22 21:12  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: [no log message]
+
+2002-02-22 21:05  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: type fix, fix ?template=xml
+
+2002-02-22 20:10  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/XPath.class.php, includes/xml/memory.php,
+	  includes/xml/filesystems.php, includes/xml/hardware.php,
+	  includes/xml/network.php, includes/xml/vitals.php: removed all
+	  the include/tables/*, added functionality into xml classes.
+
+2002-02-19 04:44  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/xml/memory.php, includes/xml/filesystems.php,
+	  includes/xml/hardware.php, includes/xml/network.php,
+	  includes/xml/vitals.php: changed the xml funtions to retunr the
+	  data instead of directly doing the template work.  I hope to
+	  remove the stuff in include/tables/* and just have the xml stuff
+	  w/ some small xml->html wrappers.
+
+2002-02-18 20:10  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/: common_functions.php, xml/network.php, xml/vitals.php:
+	  removed &nbsp's for xml and added a trim()
+
+2002-02-18 19:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: oops.. no images for XML
+
+2002-02-18 19:53  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/xml/memory.php, includes/xml/filesystems.php,
+	  includes/xml/hardware.php, includes/xml/network.php,
+	  includes/xml/vitals.php: Added initial XML implementation
+
+2002-02-18 05:50  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_footer.php: changed version to 2.1-cvs
+
+2002-02-07 06:32  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README (tags: REL-2-0): foo
+
+2002-02-04 01:27  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php (tags: REL-2-0): uniq the
+	  pci, ide, and scsi arrays
+
+2002-01-17 00:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/metal/images/: redbar_middle.gif, redbar_right.gif,
+	  redbar_left.gif (utags: REL-2-0, REL-2-1, REL-2-2, REL-2-2-RC1,
+	  REL-2-3): cosmetic cleanups from webbie (webbie at ipfw dot org)
+
+2002-01-15 09:00  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: more fbsd memory fixes
+
+2002-01-15 08:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: [no log message]
+
+2002-01-14 03:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.OpenBSD.inc.php (tags: REL-2-0): only show
+	  network interfaces that have recieved packets
+
+2002-01-14 03:51  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.FreeBSD.inc.php (tags: REL-2-0): quick hack to
+	  only show interfaces that have sent packets
+
+2002-01-11 01:25  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/it.php (tags: REL-2-1, REL-2-0): updated it.php
+
+2002-01-09 21:44  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php (tags: REL-2-0): added iso9660
+	  patch
+
+2002-01-09 21:37  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/: system_header.php, class.Template.inc.php (tags:
+	  REL-2-1) (utags: REL-2-0): HTML cleanups forgot a couple
+	  $f_body_close's which was causing invalid HTML
+
+2002-01-04 17:42  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/: aq/aq.css (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  metal/metal.css (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  blue/blue.css (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  classic/classic.css (utags: REL-2-0, REL-2-1): more CSS fixes
+	  from Webbie
+
+2002-01-01 00:24  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php (tags: REL-2-0): moved table includes into their own
+	  directory
+
+2002-01-01 00:12  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: added the font tags properly.. since I removed
+	  color_scheme
+
+2001-12-31 23:59  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: removed color_scheme.php
+
+2001-12-31 23:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/os/class.NetBSD.inc.php (tags: REL-2-0),
+	  includes/os/class.Linux.inc.php (tags: REL-2-0),
+	  includes/os/class.BSD.common.inc.php,
+	  includes/os/class.Darwin.inc.php (tags: REL-2-0),
+	  includes/os/class.FreeBSD.inc.php,
+	  includes/os/class.OpenBSD.inc.php: moved all the os based
+	  includes into include/os/
+
+2001-12-31 23:47  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php, templates/aq/aq.css,
+	  templates/black/black.css (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0), templates/black/form.tpl (tags: REL-2-1,
+	  REL-2-0), templates/aq/form.tpl (tags: REL-2-1, REL-2-0),
+	  templates/metal/metal.css, templates/metal/form.tpl (tags:
+	  REL-2-1, REL-2-0), templates/blue/blue.css,
+	  templates/blue/box.tpl (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0), templates/classic/box.tpl (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0),
+	  templates/classic/form.tpl (tags: REL-2-1, REL-2-0),
+	  templates/classic/classic.css: Added CSS patch from Webbie
+
+2001-12-29 08:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/id.php (tags: REL-2-1, REL-2-0): updated id.php
+
+2001-12-17 18:22  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: added small patch from webbie (webbie at ipfw dot org)
+
+2001-12-14 04:34  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_header.php, templates/black/black.css: default
+	  css stuff
+
+2001-12-13 21:16  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/ca.php (tags: REL-2-1, REL-2-0): added ca language
+
+2001-12-09 09:18  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: added note about freebsd removing /var/run/dmesg.boot.
+	  Clean'd up a little
+
+2001-11-23 06:26  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/common_functions.php: white space removal, cleanups
+
+2001-11-13 17:48  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/sk.php (tags: REL-2-1, REL-2-0): updated slovak
+	  translation (stenzel <stenzel at inmail.sk>)
+
+2001-11-13 01:16  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: notes updates about bsd.
+
+2001-11-12 22:31  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: tabs -> spaces cleansup
+
+2001-11-12 22:31  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php: tabs -> spaces cleanups
+
+2001-11-12 20:32  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/sk.php: added slovak translation..
+
+2001-11-11 06:58  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, includes/system_footer.php (tags: REL-2-0): tag'd rel-1-9
+	  updated for the 2.0 devel cycle
+
+2001-11-07 19:15  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/sv.php (tags: REL-2-1, REL-2-0, rel-1-9): se.php ->
+	  sv.php
+
+2001-11-07 17:56  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php (tags: rel-1-9): fix bug w/ templates when
+	  register_globals is off
+
+2001-11-05 22:44  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/id.php (tags: rel-1-9): added Indonesian
+	  translation
+
+2001-10-25 19:59  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/ct.php (tags: REL-2-1, REL-2-0, rel-1-9): added
+	  catalan tranlstion updated swedish translation
+
+2001-10-07 19:05  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: formatting
+
+2001-10-07 08:21  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php (tags: rel-1-9): comment about pipe
+	  checking..
+
+2001-10-07 08:18  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php: pipe away execute_program()
+
+2001-10-07 07:57  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php: seperated execute_program() into 2
+	  functions..  find_program() and execute_program() now just to add
+	  pipe checking and path checking..
+
+2001-10-07 07:42  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_footer.php (tags: rel-1-9): oops
+
+2001-10-07 07:42  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README (tags: rel-1-9), includes/system_footer.php: updating
+	  version number to 1.9
+
+2001-10-07 07:41  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: very minor cleanup consistancy
+
+2001-10-07 07:24  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php: adding freebsd patch from webbie (webbie at ipfw dot org)
+	  code formats and cleanups changed from ``'s to execute_program()
+
+2001-10-07 06:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/: black/box.tpl, aq/box.tpl, metal/box.tpl (utags:
+	  REL-2-0, REL-2-1, rel-1-9): adding 'alt' tags
+
+2001-10-07 06:47  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php: removed / nothing special..
+
+2001-09-19 18:01  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/big5.php (tags: REL-2-1, REL-2-0, rel-1-9): adding
+	  big5 translation
+
+2001-09-17 17:56  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: added browser language detection
+
+2001-09-17 17:49  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/black/: box.tpl, form.tpl (tags: rel-1-9),
+	  images/redbar_middle.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/d.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9), images/inf.gif (tags:
+	  REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/g.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1,
+	  REL-2-0, rel-1-9), images/bar_middle.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9), images/aq_background.gif
+	  (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/bar_right.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/redbar_right.gif (tags:
+	  REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/coininfd.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/coinsupd.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/redbar_left.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/coininfg.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/coinsupg.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/bar_left.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9), images/sup.gif
+	  (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/space15_15.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/fond.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9): adding black
+	  template
+
+2001-09-13 00:24  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/br.php (tags: REL-2-1, REL-2-0, rel-1-9): updaing
+	  br translation
+
+2001-09-04 17:20  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/pl.php (tags: REL-2-1, REL-2-0, rel-1-9): added
+	  polish translation
+
+2001-08-20 17:26  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/tw.php (tags: REL-2-1, REL-2-0, rel-1-9): added
+	  Traditional-Chinese translation..
+
+2001-08-20 17:22  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/metal/: box.tpl, form.tpl (tags: rel-1-9),
+	  images/redbar_middle.gif (tags: rel-1-9), images/d.gif (tags:
+	  REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/inf.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1,
+	  REL-2-0, rel-1-9), images/g.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9), images/bar_middle.gif
+	  (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/bar_right.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/redbar_right.gif (tags:
+	  rel-1-9), images/coininfd.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/metal_background.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/coinsupd.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/redbar_left.gif (tags: rel-1-9), images/coininfg.gif
+	  (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/coinsupg.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/bar_left.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9), images/sup.gif
+	  (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/space15_15.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/fond.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9): adding metal
+	  theme..
+
+2001-08-09 22:28  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/nl.php (tags: REL-2-1, REL-2-0, rel-1-9): updated
+	  Dutch translation (Vincent van Adrighem <vincent at
+	  dirck.mine.nu>)
+
+2001-08-06 18:50  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/de.php (tags: REL-2-1, REL-2-0, rel-1-9): updated
+	  de.php patch # 447446
+
+2001-08-03 18:45  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php: more formatting..
+
+2001-08-03 18:41  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: fixing jengo's formatting
+
+2001-08-02 23:16  jengo    Joseph Engo (jengo at users.sf.net)
+
+	* includes/common_functions.php: I forgot to add this file in
+	  durring my initial commit
+
+2001-08-02 23:15  jengo    Joseph Engo (jengo at users.sf.net)
+
+	* index.php: Changed some code format
+
+2001-08-02 22:41  jengo    Joseph Engo (jengo at users.sf.net)
+
+	* index.php, templates/classic/images/redbar_middle.gif (tags:
+	  REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/classic/images/bar_middle.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/classic/images/bar_right.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/classic/images/redbar_right.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/classic/images/redbar_left.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/classic/images/bar_left.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9): - Started working on
+	  abstracting the system functions to support multiable OS's -
+	  Added code to detect to size of the bar graph image so it looks
+	  nice - Started added sections to allow easy installation under
+	  phpGroupWare
+
+2001-07-05 23:09  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: added fix incase register_globals is off
+
+2001-07-05 23:01  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php (tags: rel-1-9): added
+	  timestamp to the <TITLE></TITLE>
+
+2001-07-05 22:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/: ro.php (tags: REL-2-1, REL-2-0, rel-1-9), nl.php:
+	  updated ro and nl tranlations removed display of filesystems that
+	  are mounted with '-o bind'
+
+2001-06-29 21:03  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: oops.. shouldn't have commited this quite yet
+
+2001-06-29 20:57  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/fi.php (tags: REL-2-1, REL-2-0, rel-1-9): added
+	  finnish language
+
+2001-06-29 17:14  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/is.php (tags: REL-2-1, REL-2-0, rel-1-9): added
+	  is.php
+
+2001-06-25 12:35  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/ro.php: added 2 translations..
+
+2001-06-02 03:35  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/et.php (tags: REL-2-1, REL-2-0, rel-1-9): updated
+	  et translation
+
+2001-06-02 03:33  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: added format_bytesize() call to capacity..
+
+2001-05-31 17:23  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_footer.php: fixing sf bug # 428980
+
+2001-05-31 17:15  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/lang/da.php (tags: REL-2-1, REL-2-0,
+	  rel-1-9), includes/lang/nl.php, includes/lang/fr.php (tags:
+	  REL-2-1, REL-2-0, rel-1-9), includes/lang/en.php (tags: REL-2-0,
+	  rel-1-9): translation updates
+
+2001-05-31 04:43  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, index.php, includes/system_footer.php: small cleanup and
+	  imcremented the version to 1.8.
+
+2001-05-30 18:29  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_footer.php: oops.. michael's patch reverted the
+	  version
+
+2001-05-30 18:27  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: oops.. forgot a $lang->$lng conversion
+
+2001-05-30 18:22  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/system_footer.php, includes/lang/de.php,
+	  includes/lang/lt.php (tags: REL-2-1, REL-2-0, rel-1-9),
+	  includes/lang/br.php, includes/lang/it.php (tags: rel-1-9),
+	  includes/lang/da.php, includes/lang/cs.php (tags: REL-2-0,
+	  rel-1-9), includes/lang/et.php, includes/lang/nl.php,
+	  includes/lang/fr.php, includes/lang/no.php (tags: REL-2-1,
+	  REL-2-0, rel-1-9), includes/lang/es.php (tags: REL-2-0, rel-1-9),
+	  includes/lang/en.php: added patches from Michal Cihar
+
+2001-05-30 18:07  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/classic/form.tpl (tags: rel-1-9): added a <br>
+
+2001-05-30 18:07  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/blue/: box.tpl, form.tpl (tags: REL-2-1, REL-2-0),
+	  images/redbar_middle.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0), images/bar_middle.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0), images/bar_right.gif (tags:
+	  REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0),
+	  images/redbar_right.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0), images/trans.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0), images/redbar_left.gif (tags:
+	  REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0),
+	  images/bar_left.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0) (utags: rel-1-9): adding the 'blue' template
+	  (Michal Cihar <cihar@email.cz>)
+
+2001-05-29 22:08  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, includes/system_footer.php: incremented version to 1.7
+
+2001-05-29 22:03  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_header.php: added css code
+
+2001-05-29 21:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/no.php: updated no.php
+
+2001-05-29 01:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_footer.php, templates/classic/box.tpl (tags:
+	  rel-1-9), templates/classic/form.tpl: HTML fixes.  classic
+	  template is now HTML 4.01 compliant and passes the validator
+
+2001-05-29 01:31  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_footer.php: formatting & cleanups
+
+2001-05-29 01:08  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: cleanups
+
+2001-05-29 00:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: more cleanups, removed extra color_scheme includes..
+
+2001-05-29 00:51  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/system_footer.php: code formatting, changed tabs to
+	  spaces include()'s to require_once()'s
+
+2001-05-28 10:31  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: added note about language selector
+
+2001-05-28 10:20  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/system_footer.php: added language selector
+
+2001-05-28 07:43  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_footer.php: formatting
+
+2001-05-28 07:42  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, index.php, includes/system_footer.php: incremented
+	  version to 1.6, added template changer form (me & Jesse
+	  jesse@krylotek.com), misc code cleanups (me)
+
+2001-05-27 23:28  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/br.php, templates/aq/images/bar_middle.gif (tags:
+	  REL-2-1, REL-2-0, rel-1-9), templates/aq/images/bar_right.gif
+	  (tags: REL-2-1, REL-2-0, rel-1-9),
+	  templates/aq/images/bar_left.gif (tags: REL-2-1, REL-2-0,
+	  rel-1-9): added blue bars for aq, added brazilian translation
+
+2001-05-24 21:21  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_header.php: added HTML core validation
+
+2001-05-21 23:34  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/: da.php, nl.php: added new translations
+
+2001-05-18 21:03  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: final notes before packaging..
+
+2001-05-18 20:57  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_footer.php: changed version to 1.5
+
+2001-05-18 20:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: fixed my email address and changed the warning threshhold
+	  on the bar graphs to 90%
+
+2001-05-18 20:46  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, COPYING, index.php, includes/system_header.php,
+	  includes/system_footer.php, includes/class.Template.inc.php,
+	  includes/lang/de.php, includes/lang/lt.php, includes/lang/it.php,
+	  includes/lang/da.php, includes/lang/et.php, includes/lang/fr.php,
+	  includes/lang/no.php, includes/lang/es.php, includes/lang/en.php,
+	  templates/aq/box.tpl, templates/aq/form.tpl,
+	  templates/aq/images/redbar_middle.gif, templates/aq/images/d.gif,
+	  templates/aq/images/inf.gif, templates/aq/images/g.gif,
+	  templates/aq/images/bar_middle.gif,
+	  templates/aq/images/aq_background.gif,
+	  templates/aq/images/bar_right.gif,
+	  templates/aq/images/redbar_right.gif,
+	  templates/aq/images/coininfd.gif,
+	  templates/aq/images/coinsupd.gif,
+	  templates/aq/images/redbar_left.gif,
+	  templates/aq/images/coininfg.gif,
+	  templates/aq/images/coinsupg.gif,
+	  templates/aq/images/bar_left.gif, templates/aq/images/sup.gif,
+	  templates/aq/images/space15_15.gif, templates/aq/images/fond.gif,
+	  templates/classic/box.tpl, templates/classic/form.tpl,
+	  templates/classic/images/redbar_middle.gif,
+	  templates/classic/images/bar_middle.gif,
+	  templates/classic/images/bar_right.gif,
+	  templates/classic/images/redbar_right.gif,
+	  templates/classic/images/trans.gif,
+	  templates/classic/images/redbar_left.gif,
+	  templates/classic/images/bar_left.gif: Initial revision
+
+2001-05-18 20:46  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, COPYING (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1,
+	  REL-2-0, rel-1-9), index.php, includes/system_header.php,
+	  includes/system_footer.php, includes/class.Template.inc.php
+	  (tags: rel-1-9), includes/lang/de.php, includes/lang/lt.php,
+	  includes/lang/it.php, includes/lang/da.php, includes/lang/et.php,
+	  includes/lang/fr.php, includes/lang/no.php, includes/lang/es.php,
+	  includes/lang/en.php, templates/aq/box.tpl, templates/aq/form.tpl
+	  (tags: rel-1-9), templates/aq/images/redbar_middle.gif (tags:
+	  REL-2-1, REL-2-0, rel-1-9), templates/aq/images/d.gif (tags:
+	  REL-2-1, REL-2-0, rel-1-9), templates/aq/images/inf.gif (tags:
+	  REL-2-1, REL-2-0, rel-1-9), templates/aq/images/g.gif (tags:
+	  REL-2-1, REL-2-0, rel-1-9), templates/aq/images/bar_middle.gif,
+	  templates/aq/images/aq_background.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/aq/images/bar_right.gif,
+	  templates/aq/images/redbar_right.gif (tags: REL-2-1, REL-2-0,
+	  rel-1-9), templates/aq/images/coininfd.gif (tags: REL-2-1,
+	  REL-2-0, rel-1-9), templates/aq/images/coinsupd.gif (tags:
+	  REL-2-1, REL-2-0, rel-1-9), templates/aq/images/redbar_left.gif
+	  (tags: REL-2-1, REL-2-0, rel-1-9),
+	  templates/aq/images/coininfg.gif (tags: REL-2-1, REL-2-0,
+	  rel-1-9), templates/aq/images/coinsupg.gif (tags: REL-2-1,
+	  REL-2-0, rel-1-9), templates/aq/images/bar_left.gif,
+	  templates/aq/images/sup.gif (tags: REL-2-1, REL-2-0, rel-1-9),
+	  templates/aq/images/space15_15.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/aq/images/fond.gif (tags: REL-2-1, REL-2-0, rel-1-9),
+	  templates/classic/box.tpl, templates/classic/form.tpl,
+	  templates/classic/images/redbar_middle.gif,
+	  templates/classic/images/bar_middle.gif,
+	  templates/classic/images/bar_right.gif,
+	  templates/classic/images/redbar_right.gif,
+	  templates/classic/images/trans.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/classic/images/redbar_left.gif,
+	  templates/classic/images/bar_left.gif (utags: start): initial
+	  checkin of 1.3 code
+
diff --git a/www/include/options/sysInfos/README b/www/include/options/sysInfos/README
new file mode 100644
index 0000000000000000000000000000000000000000..bd954c93b17728a75aab63e82c85a29db6d02463
--- /dev/null
+++ b/www/include/options/sysInfos/README
@@ -0,0 +1,87 @@
+
+phpSysInfo 2.5.1 - http://phpsysinfo.sourceforge.net/
+
+Copyright (c), 1999-2002, Uriah Welcome (precision@users.sf.net)
+Copyright (c), 1999-2001, Matthew Snelham (infinite@users.sf.net)
+
+
+CURRENT TESTED PLATFORMS
+------------------------
+  - Linux 2.2+
+  - FreeBSD 4.x
+  - OpenBSD 2.8+
+  - NetBSD
+  - Darwin/OSX
+  - WinNT
+  - PHP 4.x and 5.x
+
+  If your platform is not here try checking out the mailing list archives or
+  the message boards on SourceForge.
+
+
+INSTALLATION AND CONFIGURATION
+------------------------------
+  Just decompress and untar the source (which you should have done by now,
+  if you're reading this...), into your webserver's document root.
+
+  There is a configuration file called config.php.new. If this a brand 
+  new installation, you should copy this file to config.php and edit it.
+
+  - make sure your 'php.ini' file's include_path entry contains "."
+  - make sure your 'php.ini' has safe_mode set to 'off'.
+
+  Please keep in the mind that because phpSysInfo requires access to many
+  files in /proc and other system binary you **MUST DISABLE** php's
+  safe_mode.  Please see the PHP documentation for information on how you
+  can do this.
+
+  That's it.  Restart your webserver (if you changed php.ini), and viola!
+
+
+KNOWN PROBLEMS
+--------------
+  - phpSysInfo is not full compatible with SELinux Systems
+  - small bug under FreeBSD with memory reporting
+  - XML will not work properly/validate under anything except Linux and
+    Net/FreeBSD The "This is Under Development" warning gets printed and
+	isn't valid in XML.
+
+
+PLATFORM SPECIFIC ISSUES
+------------------------
+  - FreeBSD
+    There is currently a bug in FreeBSD that if you boot your system up and
+	drop to single user mode and then again back to multiuser the system
+	removes /var/run/dmesg.boot.  This will cause phpsysinfo to fail.  A bug
+	has already been reported to the FreeBSD team.  (PS, this may exist in
+	other *BSDs also)
+
+
+WHAT TO DO IF IT DOESN'T WORK
+-----------------------------
+  First make sure you've read this file completely, especially the
+  "INSTALLATION AND CONFIGURATION" section.  If it still doesn't work then
+  you can:
+  
+  Submit a bug on SourceForge. (preferred)
+     (http://sourceforge.net/projects/phpsysinfo/)
+
+
+OTHER NOTES
+-----------
+  If you have an great ideas or wanna help out, just drop by the project
+  page at SourceForge (http://sourceforge.net/projects/phpsysinfo/)
+
+  The "Unauthorized reading files on phpSysInfo" reported by
+  Albert Puigsech Galicia <ripe@7a69ezine.org> and Wolter Kamphuis 
+  <security@wkamphuis.student.utwente.nl> is fixed in version 2.2.
+  http://www.securityfocus.com/archive/1/319713
+  
+
+LICENSING
+---------
+  This program and all associated files are released under the GNU Public
+  License, see COPYING for details.
+
+
+$Id: README,v 1.27 2005/12/15 08:35:00 bigmichi1 Exp $
diff --git a/www/include/options/sysInfos/config.php b/www/include/options/sysInfos/config.php
new file mode 100644
index 0000000000000000000000000000000000000000..08b117a1abac93b97d3257ba9a42c801af57cf73
--- /dev/null
+++ b/www/include/options/sysInfos/config.php
@@ -0,0 +1,82 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: config.php.new,v 1.15 2005/11/30 05:14:49 bigmichi1 Exp $
+
+// if $webpath set to an value it will be possible to include phpsysinfo with a simple include() statement in other scripts
+// but the structure in the phpsysinfo directory can't be changed
+// $webpath specifies the absolute path when you browse to the phpsysinfo page
+// e.g.: your domain  www.yourdomain.com
+//       you put the phpsysinfo directory at /phpsysinfo in the webroot
+//       then normally you browse there with www.yourdomain.com/phpsysinfo
+//       now you want to include the index.php from phpsysinfo in a script, locatet at /
+//       then you need to set $webpath to /phpsysinfo/
+// if you put the phpsysinfo folder at /tools/phpsysinfo $webpath will be /tools/phpsysinfo/
+// you don't need to change it, if you don't include it in other pages
+// so default will be fine for everyone
+$webpath = "./include/options/sysInfos/";
+
+// define the default lng and template here
+$default_lng='en';
+$default_template='classic';
+
+// hide language and template picklist
+// false = display picklist
+// true = do not display picklist
+$hide_picklist = false;
+
+// define the motherboard monitoring program here
+// we support four programs so far
+// 1. lmsensors  http://www2.lm-sensors.nu/~lm78/
+// 2. healthd    http://healthd.thehousleys.net/
+// 3. hwsensors  http://www.openbsd.org/
+// 4. mbmon      http://www.nt.phys.kyushu-u.ac.jp/shimizu/download/download.html
+// 5. mbm5       http://mbm.livewiredev.com/
+
+// $sensor_program = "lmsensors";
+// $sensor_program = "healthd";
+// $sensor_program = "hwsensors";
+// $sensor_program = "mbmon";
+// $sensor_program = "mbm5";
+$sensor_program = "";
+
+// show mount point
+// true = show mount point
+// false = do not show mount point
+$show_mount_point = true;
+
+// show bind
+// true = display filesystems mounted with the bind options under Linux
+// false = hide them
+$show_bind = false;
+
+// Hide mount(s). Example:
+// $hide_mounts[] = '/home';
+
+// if the hddtemp program is available we can read the temperature, if hdd is smart capable
+// !!ATTENTION!! hddtemp might be a security issue
+// $hddtemp_avail = "tcp";	// read data from hddtemp deamon (localhost:7634)
+// $hddtemp_avail = "suid";     // read data from hddtemp programm (must be set suid)
+
+// show a graph for current cpuload
+// true = displayed, but it's a performance hit (because we have to wait to get a value, 1 second)
+// false = will not be displayed
+$loadbar = false;
+
+?>
diff --git a/www/include/options/sysInfos/distros.ini b/www/include/options/sysInfos/distros.ini
new file mode 100644
index 0000000000000000000000000000000000000000..7498cf95f2d8a31743821ae9d0f5be411a0ba689
--- /dev/null
+++ b/www/include/options/sysInfos/distros.ini
@@ -0,0 +1,60 @@
+; linux-distros.ini - Defines known linux distros for phpSysInfo.
+; http://phpsysinfo.sourceforge.net/
+; $Id: distros.ini,v 1.1 2005/11/22 14:30:28 bigmichi1 Exp $
+;
+
+[Debian]
+Name = "Debian"
+Image = "Debian.png"
+Files = "/etc/debian_release;/etc/debian_version"
+
+[Suse]
+Image = "Suse.png"
+Files = "/etc/SuSE-release;/etc/UnitedLinux-release"
+
+[Mandrage]
+Image = "Mandrake.png"
+Files = "/etc/mandrake-release"
+
+[Gentoo]
+Image = "Gentoo.png"
+Files = "/etc/gentoo-release"
+
+[RedHat]
+Image = "Redhat.png"
+Files = "/etc/redhat-release;/etc/redhat_version"
+
+[Fedora]
+Image = "Fedora.png"
+Files = "/etc/fedora-release"
+
+[Slackware]
+Image = "Slackware.png"
+Files = "/etc/slackware-release;/etc/slackware-version"
+
+[Trustix]
+Image = "Trustix.gif"
+Files = "/etc/trustix-release;/etc/trustix-version"
+
+[FreeEOS]
+Image = "free-eos.png"
+Files = "/etc/eos-version"
+
+[Arch]
+Image = "Arch.gif"
+Files = "/etc/gentoo-release"
+
+[Cobalt]
+Image = "Cobalt.png"
+Files = "/etc/cobalt-release"
+
+[LinuxFromScratch]
+Image = "lsf.png"
+Files = "/etc/lfs-release"
+
+[Rubix]
+Image   = "Rubix.png"
+Files   = "/etc/rubix-version"
+
+[Ubunto]
+Files = "/etc/lsb-release"
diff --git a/www/include/options/sysInfos/images/Arch.gif b/www/include/options/sysInfos/images/Arch.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a643b2da666d932639f041d43475135490d82f74
Binary files /dev/null and b/www/include/options/sysInfos/images/Arch.gif differ
diff --git a/www/include/options/sysInfos/images/COPYING b/www/include/options/sysInfos/images/COPYING
new file mode 100644
index 0000000000000000000000000000000000000000..bf50f20de6ef55b52fe7832d3a4ed05f0c69d452
--- /dev/null
+++ b/www/include/options/sysInfos/images/COPYING
@@ -0,0 +1,482 @@
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+    		    59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL.  It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it.  You can use it for
+your libraries, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library.  If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software.  To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+  Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs.  This
+license, the GNU Library General Public License, applies to certain
+designated libraries.  This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+  The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it.  Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program.  However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+  Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries.  We
+concluded that weaker conditions might promote sharing better.
+
+  However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves.  This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them.  (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.)  The hope is that this
+will lead to faster development of free libraries.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+  Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License").  Each licensee is
+addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    c) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    d) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public
+    License along with this library; if not, write to the 
+    Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
+    Boston, MA  02111-1307  USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/www/include/options/sysInfos/images/ChangeLog b/www/include/options/sysInfos/images/ChangeLog
new file mode 100644
index 0000000000000000000000000000000000000000..db332e4b9cd2b17013c401722bfb38b5edb80bd9
--- /dev/null
+++ b/www/include/options/sysInfos/images/ChangeLog
@@ -0,0 +1,2674 @@
+2005-12-10 15:58  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: little spped up the creation
+
+2005-12-10 15:54  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/common_functions.php, includes/xml/memory.php,
+	  includes/xml/filesystems.php, includes/xml/hardware.php,
+	  includes/xml/network.php, includes/xml/vitals.php,
+	  includes/xml/mbinfo.php, includes/xml/hddtemp.php,
+	  templates/black/box.tpl, templates/wintendoxp/box.tpl,
+	  templates/aq/box.tpl, templates/windows_classic/box.tpl,
+	  templates/orange/box.tpl, templates/metal/box.tpl,
+	  templates/blue/box.tpl, templates/typo3/box.tpl,
+	  templates/bulix/box.tpl, templates/kde/box.tpl,
+	  templates/classic/box.tpl: huge update for supporting
+	  rtl-languages should close:  "[ 1364219 ] Fix for bug 1039460 ?"
+	  "[ 1039460 ] chareset=utf-8 dir=rtl breaks templates"
+
+2005-12-10 13:09  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* templates/: black/box.tpl, aq/box.tpl, metal/box.tpl,
+	  kde/box.tpl, wintendoxp/box.tpl, windows_classic/box.tpl: html
+	  code fixes to be HTML 4.01 Transitional compatible, verified at
+	  validator.w3.org
+
+2005-12-10 12:30  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/system_footer.php: fixes bug "[ 1377012 ] Correcting a
+	  html "error"."
+
+2005-12-10 09:08  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/mb/class.mbm5.inc.php: fixes "[ 1377470 ] error in file
+	  "\includes\mb\class.mbm5.inc.php on line 27""
+
+2005-12-09 19:30  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php:
+	  add ability to read pci devices from "pciconf -lv", if this
+	  doesn't work we fall back to old way
+
+2005-12-08 20:18  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php:
+	  loadbar now works also with BSD systems fixes bug "[ 1376395 ]
+	  $loadbar not working"
+
+2005-12-08 19:59  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php:
+	  command must be df -k and not df -kP for BSD systems
+
+2005-12-08 19:54  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php:
+	  we need the pcre extension
+
+2005-12-07 16:04  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/filesystems.php: overall size was wrong calculated
+	  for WINNT systems, here we must use the MountPoint for allready
+	  counted Partitions
+
+2005-12-07 15:47  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.WINNT.inc.php: mhz must be cpuspeed in array
+	  and busspeed has it's own position in the array
+
+2005-12-07 15:36  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.WINNT.inc.php: read hostname from wmi
+
+2005-12-07 15:07  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/common_functions.php: fixes bug "[ 1375301 ] fstype is
+	  CDFS under Windows not iso9660"
+
+2005-12-07 15:02  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/lang/: ar_utf8.php, bg.php, de.php, lv.php, pt.php,
+	  sv.php, br.php, it.php, da.php, cs.php, ct.php, ro.php,
+	  pa_utf8.php, is.php, ca.php, fi.php, big5.php, et.php, tr.php,
+	  pt-br.php, tw.php, hu.php, cn.php, gr.php, he.php, nl.php,
+	  ru.php, fr.php, no.php, id.php, es.php, eu.php, sk.php, sr.php,
+	  ko.php, en.php: fix bug "[ 1375274 ] strftime under windows has
+	  no %r %R"
+
+2005-12-07 05:09  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.SunOS.inc.php: fixed bug "[ 1374759 ] Netword
+	  info wrong for Solaris" with patch included in bug report
+
+2005-12-06 16:04  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* README, index.php: 2.5 release
+
+2005-12-06 15:58  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: fixed bug "[ 1082407 ] IDE HDDs
+	  Capacity reports "0" on FC3", but i can not believe that sys has
+	  the ide and proc not
+
+2005-12-06 15:49  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: check if file exist before include
+
+2005-12-06 05:00  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: security fix
+
+2005-12-03 11:12  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: wrong regex
+
+2005-12-02 22:19  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: fixes bug "[ 1369246 ]
+	  Extra slash on "Mount"" it's now the same filesystem() code linke
+	  on Linux class
+
+2005-12-02 14:14  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.WINNT.inc.php: fix not showing cpu usage (wrong
+	  position in array) add value for cpu bargraph
+
+2005-12-02 14:03  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/: os/class.Linux.inc.php, xml/vitals.php: load averages
+	  change
+
+2005-12-02 13:57  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: undefined variable
+
+2005-11-30 05:14  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* config.php.new: fix for bug "[ 1369688 ] little issue in the
+	  configuration file for hddtemp" changed style of comments
+
+2005-11-28 15:52  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.OpenBSD.inc.php: missing dot causes error,
+	  fixes bug "[ 1368270 ] Error in OpenBSD 3.7"
+
+2005-11-27 20:39  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* sample/lmsensors5.txt: another "nice" output
+
+2005-11-27 20:38  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/mb/class.lmsensors.inc.php: corrected regex
+
+2005-11-27 20:19  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/vitals.php: set maximum value for cpu bargraph
+
+2005-11-27 20:17  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: rewrite, because of bug "[
+	  1367290 ] mount point show 11515% usage."
+
+2005-11-27 17:30  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php, includes/xml/memory.php, includes/xml/filesystems.php,
+	  includes/xml/hardware.php, includes/xml/network.php,
+	  includes/xml/vitals.php, includes/xml/mbinfo.php,
+	  includes/xml/hddtemp.php: htmlentities causes some strange
+	  xml-errors, htmlentities are good enough for our xml
+
+2005-11-27 17:17  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* sample/lmsensors4.txt: another test output
+
+2005-11-27 13:18  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/mb/class.lmsensors.inc.php: we need these lines, the got
+	  lost at last commit
+
+2005-11-26 21:44  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/: common_functions.php, xml/memory.php,
+	  xml/filesystems.php, xml/mbinfo.php, xml/hddtemp.php: restructure
+	  the bargraph output
+
+2005-11-26 21:41  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/mb/class.lmsensors.inc.php: remove ununsed var $alarm
+	  fix for chipsets that have not the full vars we need, e.g.
+	  "fscpos-i2c-0-73"
+
+2005-11-26 15:35  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: reflect version change, and we need a second rc, too
+	  many changes since last rc
+
+2005-11-26 15:19  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/hddtemp.php: write headline if no sensor_program is
+	  available
+
+2005-11-26 13:20  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/: memory.php, filesystems.php, hardware.php,
+	  network.php, vitals.php: tables should be 100% to get a nice
+	  output
+
+2005-11-26 13:20  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/common_functions.php: a no breaking space is required,
+	  else sometimes byte sizewraps to a new line and this looks bad
+
+2005-11-26 13:01  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/class.Template.inc.php: Template class update version
+	  1.6 from egroupware from folder
+	  ./setup/inc/class.Template.inc.php
+
+2005-11-26 11:39  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: changed output for temperatures with help from Timo
+	  van Roermund
+
+2005-11-26 10:45  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: unused value $percent
+
+2005-11-25 21:55  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/mbinfo.php: missing <tr>
+
+2005-11-25 21:27  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/common_functions.php: yellow only for above 75% and not
+	  20
+
+2005-11-24 18:51  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/hardware.php: no extra encoding needed
+
+2005-11-24 17:10  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/: memory.php, filesystems.php, hardware.php,
+	  vitals.php: missing changes for last commit at XPath
+
+2005-11-24 17:05  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* phpsysinfo.dtd, includes/system_header.php,
+	  includes/xml/memory.php, includes/xml/filesystems.php,
+	  includes/xml/hardware.php: DTD update to reflect the latest
+	  changes and privious missing declarations, need some more
+	  tweeking
+
+2005-11-23 17:09  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/lang/ar_utf8.php: missing $text['gen_time']
+
+2005-11-23 17:08  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/lang/ar_utf8.php: missing $text['locale']
+
+2005-11-23 17:03  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: undefined variable
+
+2005-11-23 16:58  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/system_header.php: undefined variable
+
+2005-11-23 16:54  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/: hardware.php, vitals.php: undefined variable
+
+2005-11-23 05:05  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: wrong varname
+
+2005-11-22 16:15  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/vitals.php: typo
+
+2005-11-22 16:14  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* config.php.new: missing entry and description in config.php.new
+	  for last commit
+
+2005-11-22 16:08  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/common_functions.php, includes/system_footer.php,
+	  includes/os/class.Linux.inc.php, includes/xml/vitals.php,
+	  templates/black/box.tpl, templates/aq/box.tpl,
+	  templates/windows_classic/box.tpl, templates/metal/box.tpl,
+	  templates/kde/box.tpl: fix for including page in other scripts
+	  and nothing will work any longer (extra config value $webpath)
+
+2005-11-22 15:08  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/: mb/class.mbmon.inc.php, xml/mbinfo.php: fix for "[
+	  1195024 ] Ignore not connected temperature sensors"
+
+2005-11-22 14:59  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: error message for all FC
+	  systems, where we can't read /proc/net/dev, because of SELinux
+
+2005-11-22 14:30  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* distros.ini, includes/os/class.HP-UX.inc.php,
+	  includes/os/class.NetBSD.inc.php,
+	  includes/os/class.Linux.inc.php,
+	  includes/os/class.Darwin.inc.php,
+	  includes/os/class.FreeBSD.inc.php,
+	  includes/os/class.SunOS.inc.php,
+	  includes/os/class.OpenBSD.inc.php, images/Gentoo.png,
+	  images/lfs.png, images/FreeBSD.png, images/Debian.png,
+	  images/Cobalt.png, images/unknown.png, images/Redhat.png,
+	  images/Slackware.png, images/Mandrake.png, images/NetBSD.png,
+	  images/Darwin.png, images/OpenBSD.png, images/free-eos.png,
+	  images/Fedora.png, images/Suse.png, images/Rubix.png: included
+	  patch "[ 1363677 ] Linux Distro INI Definitions file" for simpler
+	  distro-icon management, also convert some icons to png format
+
+2005-11-21 15:39  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: set the default template, if the one which is stored
+	  in the cookie no longer exists
+
+2005-11-20 13:21  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/vitals.php: round cpuload
+
+2005-11-20 12:54  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* config.php.new, includes/os/class.HP-UX.inc.php,
+	  includes/os/class.Linux.inc.php,
+	  includes/os/class.BSD.common.inc.php,
+	  includes/os/class.WINNT.inc.php, includes/os/class.SunOS.inc.php,
+	  includes/xml/vitals.php: included feature request "[ 1252617 ]
+	  CPU Time/usage"
+
+2005-11-20 11:29  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/lang/pa_utf8.php: new translation from feature request
+	  "[ 1214326 ] New Translation adding"
+
+2005-11-20 11:27  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/hardware.php: another xml-destroyer bug, if GB or kb
+	  is translated
+
+2005-11-20 11:14  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/common_functions.php,
+	  templates/windows_classic/images/yellowbar_right.gif,
+	  templates/windows_classic/images/yellowbar_middle.gif,
+	  templates/windows_classic/images/yellowbar_left.gif: feature
+	  request "[ 620192 ] Color indicators in graph"
+
+	  bars will show in a third color if there are images present like
+	  "yellowbar_*.gif" values can be changed in common_functions.php
+	  at which these colors should appear default: red > 90%, yellow >
+	  75%, else green
+
+2005-11-20 10:43  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: add detection for
+	  Linux-from-Scratch
+
+2005-11-20 10:13  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.WINNT.inc.php: more network informations,
+	  included patch "[ 1234690 ] More network information on
+	  WindowsXP"
+
+2005-11-20 09:56  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* config.php.new, index.php, includes/mb/class.hddtemp.inc.php,
+	  includes/xml/hddtemp.php: read hddtemp values from deamon or
+	  execute hddtemp (fixed with help of Timo van Roermund)
+
+2005-11-19 23:41  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: simplify sparc cache detection
+	  code, also check before open a file exists
+
+2005-11-19 23:33  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: simplify usb detection
+
+2005-11-19 23:23  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/hardware.php: undefined var fix exclude SBUS
+	  information, we have no output for this
+
+2005-11-19 23:21  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/filesystems.php: unneeded calculation of hdd sums in
+	  xml function undefined var fix
+
+2005-11-19 23:09  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: there was a serious error in the
+	  detection code, if sizes are seperated by one only space, hope
+	  this fixes it
+
+2005-11-19 21:59  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: extra distribution information
+	  added (specially for Debian, which got lost)
+
+2005-11-19 21:43  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/: mbinfo.php, hddtemp.php: made bars smaller (same
+	  factor like memory bars), perhaps set  in config file
+
+2005-11-19 21:39  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/hardware.php: remove space after capacity text
+
+2005-11-19 18:36  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* config.php.new, index.php, includes/mb/class.hddtemp.inc.php,
+	  includes/xml/hardware.php, includes/xml/mbinfo.php,
+	  includes/xml/hddtemp.php: added support for hddtemp this closes
+	  "[ 1035068 ] hddtemp support"
+
+2005-11-19 17:11  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: security fixes from debian
+
+2005-11-19 16:00  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: included patch from "[
+	  1334110 ] Support for harddisks above 'ad9' on (Free)BSD"
+
+2005-11-19 15:56  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* config.php.new, includes/common_functions.php,
+	  includes/os/class.HP-UX.inc.php, includes/os/class.Linux.inc.php,
+	  includes/os/class.BSD.common.inc.php,
+	  includes/os/class.Darwin.inc.php,
+	  includes/os/class.WINNT.inc.php, includes/os/class.SunOS.inc.php:
+	  support for hiding specific mounts patch from here "[ 1214480 ]
+	  Support for hiding specific mounts" and closes also "[ 979229 ]
+	  Support for hiding specific mounts"
+
+2005-11-19 15:11  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/filesystems.php: don't count mountpoints twice or
+	  more fixes "[ 1123357 ] the totals size for hd"
+
+2005-11-19 14:42  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/: os/class.Linux.inc.php, xml/memory.php: if more than 1
+	  swapdevice, show the divices in output with the stats of each own
+	  fixes "[ 964630 ] 2 swap partition problem"
+
+2005-11-19 14:08  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/: system_header.php, lang/bg.php, lang/de.php,
+	  lang/lv.php, lang/pt.php, lang/lt.php, lang/sv.php, lang/br.php,
+	  lang/pl.php, lang/it.php, lang/da.php, lang/cs.php, lang/ct.php,
+	  lang/ro.php, lang/is.php, lang/ca.php, lang/fi.php,
+	  lang/big5.php, lang/et.php, lang/tr.php, lang/pt-br.php,
+	  lang/tw.php, lang/hu.php, lang/cn.php, lang/jp.php, lang/gr.php,
+	  lang/he.php, lang/ar_utf8.php, lang/nl.php, lang/ru.php,
+	  lang/fr.php, lang/no.php, lang/id.php, lang/es.php, lang/eu.php,
+	  lang/sk.php, lang/sr.php, lang/ko.php, lang/en.php,
+	  os/class.Linux.inc.php, xml/memory.php: split memory information
+	  (this time only for linux) this closes: "[ 1297967 ] memory usage
+	  includes cache... bad idea?" "[ 1065909 ] split memory usage
+	  information" "[ 1220004 ] Ignore cached memory" "[ 616434 ] More
+	  Memory Values" and now $text['locale'] is used for setting LC_ALL
+	  instead of LC_TIME (numbers have now correct dots and commas)
+
+2005-11-19 12:32  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/common_functions.php,
+	  templates/wintendoxp/images/nobar_middle.gif,
+	  templates/wintendoxp/images/nobar_right.gif,
+	  templates/wintendoxp/images/nobar_left.gif,
+	  templates/windows_classic/images/nobar_middle.gif,
+	  templates/windows_classic/images/nobar_right.gif,
+	  templates/windows_classic/images/nobar_left.gif,
+	  templates/kde/images/nobar_left.gif: included patch from "[
+	  1017212 ] create bar" if there are files called "nobar_*.gif" in
+	  the templates dir, a full bar is shown
+
+2005-11-18 18:05  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: don't show the devices
+	  serialnumber
+
+2005-11-18 17:52  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* config.php.new, includes/os/class.Linux.inc.php,
+	  includes/xml/filesystems.php: included feature suggested here "[
+	  1070565 ] Bind mount management; some cosmetics" and also by
+	  gentoo if showing bind-mounts they dont't increase the overall
+	  size, if disable these mounts not shown controlled by an option
+	  in config.php
+
+2005-11-18 17:16  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/: memory.php, filesystems.php, hardware.php,
+	  network.php, vitals.php, mbinfo.php: now all strings are encoded
+	  in the xml ("[ 1075222 ] XML "&" problems"), not everywhere
+	  necassary, but now it should be safe
+
+2005-11-18 16:59  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: include the patch from gentoo
+	  for sparc
+
+2005-11-18 16:55  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/hardware.php: fixes bug "[ 1072981 ] XML Parsing
+	  error", if there are some characters in the device name which
+	  breaks xml
+
+2005-11-18 16:50  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/: os/class.Linux.inc.php, os/class.BSD.common.inc.php,
+	  xml/filesystems.php: this fixes bugs: "[ 619173 ] broken
+	  filesystem() code" "[ 1001681 ] can't handle whitespaces" also
+	  convert specialchars in devicename and mountpoint to be html
+	  conform
+
+2005-11-18 15:46  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/xml/hardware.php: never, really never store language
+	  specific words in an xml document (if there is no CDATA section)
+
+2005-11-18 15:11  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php: security fix for phpgroupware
+
+2005-11-17 19:55  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php, includes/os/class.NetBSD.inc.php,
+	  includes/os/class.Darwin.inc.php,
+	  includes/os/class.FreeBSD.inc.php,
+	  includes/os/class.OpenBSD.inc.php: all require() changed to
+	  require_once() and they include now the APP_ROOT, for using
+	  phpsysinfo in other web-apps
+
+2005-11-17 16:56  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/mb/class.lmsensors.inc.php: following bugs should be
+	  fixed now: "[ 1357257 ] lmsensors & phpsysinfo bugs" "[ 1241520 ]
+	  Temperature, Voltage Empty" "[ 1109524 ] lmsensores Bug" included
+	  fix for "[ 1277145 ] Fan Speed w/out divisor does not show" and
+	  finally fix for some E_NOTICE massages
+
+2005-11-16 21:47  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/lang/nl.php: updated translation from patch "[ 1104472 ]
+	  Dutch language patch"
+
+2005-11-16 21:42  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/lang/fr.php: updated translation from "[ 1220000 ]
+	  French language patch", hope this is all correct translated
+
+2005-11-16 21:28  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: included patch "[ 1198070 ] SuSE
+	  Enterprise Server not detected" also change distribution
+	  detection (first check if a file exist before read it, one icon
+	  can also have more than one associated file)
+
+2005-11-16 17:39  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/system_footer.php, includes/os/class.NetBSD.inc.php,
+	  includes/os/class.Darwin.inc.php,
+	  includes/os/class.FreeBSD.inc.php,
+	  includes/os/class.OpenBSD.inc.php: security fixes, mentioned in
+	  bug "[ 1168383 ] phpSysInfo 2.3 Multiple vulnerabilities"
+
+2005-11-16 17:26  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/XPath.class.php: update to latest version, which fixes
+	  array_merge() warnings
+
+2005-11-16 16:32  bigmichi1     Michael Cramer (bigmichi1 at users.sf.net)
+
+	* includes/lang/ru.php: applied patch "[ 1234692 ] Russian lang
+	  typo/mistake fix"
+
+2005-11-11 21:13  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: This is a quick fix for the $lng issue reintroduced in
+	  Version 2.4.	The bugfix for CVE-2005-3347 has reopened
+	  CVE-2003-0536, but since we expect a very short string (directory
+	  name), we can actually do basename and strip off any non-filename
+	  characters.  Also, CVE-2005-3348 was not fixed with
+	  register_globals On, since $charset could be overwritten.  Fix by
+	  christopher.kunz@hardened-php.net */
+
+2005-11-10 17:39  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, index.php: misc updates, releasing 2.4
+
+2005-11-10 17:31  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/sr.php: adding serbian translation
+
+2005-08-19 19:02  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/XPath.class.php: updating to the latest version of
+	  XPath.class.php
+
+2004-10-30 08:09  webbie (webbie at ipfw dot org)
+
+	* includes/mb/: class.healthd.inc.php, class.lmsensors.inc.php,
+	  class.hwsensors.inc.php, class.mbm5.inc.php, class.mbmon.inc.php:
+	  Saving the results of the output to a class level variable, we
+	  only need to run the mbmon binary once.
+
+2004-10-30 07:14  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.mbmon.inc.php: Saving the results of the output
+	  to a class level variable, we only need to run the mbmon binary
+	  once.   ( Gorilla <gorilla_ at users.sf.net> )
+
+2004-10-29 06:49  webbie (webbie at ipfw dot org)
+
+	* includes/xml/filesystems.php: hide mount point in XML when
+	  $show_mount_point is false
+
+2004-10-13 08:13  webbie (webbie at ipfw dot org)
+
+	* includes/: os/class.HP-UX.inc.php, os/class.Linux.inc.php,
+	  os/class.BSD.common.inc.php, os/class.WINNT.inc.php,
+	  os/class.SunOS.inc.php, xml/vitals.php: sysinfo classes return
+	  the Uptime in seconds.   ( Edwin Meester <millenniumv3 at
+	  users.sf.net> )
+
+2004-10-06 05:51  webbie (webbie at ipfw dot org)
+
+	* includes/lang/lt.php: proper Lithuanian translation update
+
+2004-10-06 05:45  webbie (webbie at ipfw dot org)
+
+	* index.php, includes/common_functions.php: Removed GD dependency
+	  ( Edwin Meester <millenniumv3 at users.sf.net> )
+
+2004-10-05 00:39  webbie (webbie at ipfw dot org)
+
+	* index.php: remove debug statement
+
+2004-10-04 03:16  webbie (webbie at ipfw dot org)
+
+	* index.php: comestic fix again
+
+2004-10-04 03:15  webbie (webbie at ipfw dot org)
+
+	* index.php: comestic fix
+
+2004-10-04 03:13  webbie (webbie at ipfw dot org)
+
+	* index.php: bug fix, wrong _GET language variable
+
+2004-10-03 07:13  webbie (webbie at ipfw dot org)
+
+	* includes/: mb/class.mbm5.inc.php, system_footer.php: comestic fix
+
+2004-10-03 07:12  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.mbm5.inc.php: A class for MBM5 wich parses the
+	  csv logs for Fan Speed, Voltages and Temperatures. see the Note
+	  for making things work.  ( Edwin Meester <millenniumv3 at
+	  users.sf.net> )
+
+2004-10-03 05:05  webbie (webbie at ipfw dot org)
+
+	* includes/lang/lt.php: comestic update     ( Rimas Kudelis <er-ku
+	  at users.sf.net> )
+
+2004-10-03 04:25  webbie (webbie at ipfw dot org)
+
+	* index.php, includes/system_footer.php: do not use
+	  register_long_arrays	 ( Edwin Meester <millenniumv3 at
+	  sf.users.net> )
+
+2004-10-03 04:14  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.lmsensors.inc.php: Dirty fix for misinterpreted
+	  output of sensors, where info could come on next line when the
+	  label is too long.  ( Martijn Stolk <netrippert at users.sf.net>
+	  )
+
+2004-10-03 04:07  webbie (webbie at ipfw dot org)
+
+	* config.php.new: A class for MBM5 wich parses the csv logs for Fan
+	  Speed, Voltages and Temperatures. see the Note for making things
+	  work.  ( Edwin Meester <millenniumv3 at users.sf.net> )
+
+2004-09-01 18:00  webbie (webbie at ipfw dot org)
+
+	* includes/lang/fr.php: cosmectic fix
+
+2004-08-31 17:50  webbie (webbie at ipfw dot org)
+
+	* templates/: aq/index.html, black/index.html,
+	  black/images/index.html, aq/images/index.html, blue/index.html,
+	  blue/images/index.html, bulix/index.html,
+	  bulix/images/index.html, kde/index.html, kde/images/index.html,
+	  classic/index.html, classic/images/index.html, orange/index.html,
+	  orange/images/index.html, metal/index.html,
+	  metal/images/index.html, typo3/index.html, wintendoxp/index.html,
+	  wintendoxp/images/index.html, windows_classic/index.html,
+	  windows_classic/images/index.html, typo3/images/index.html:
+	  prevent index listing
+
+2004-08-30 16:05  webbie (webbie at ipfw dot org)
+
+	* templates/windows_classic/images/: bottom_left_corner.gif,
+	  bottom_right_corner.gif, right.gif, left.gif,
+	  upper_right_corner.gif, min_max.gif, top.gif,
+	  upper_left_corner.gif, middle.gif, bottom.gif: Changed the colors
+	  and Icon.	( Edwin Meester <millenniumv3 at users.sf.net> )
+
+2004-08-30 15:51  webbie (webbie at ipfw dot org)
+
+	* includes/lang/: bg.php, br.php, big5.php, ar_utf8.php, de.php,
+	  lv.php, pt.php, lt.php, sv.php, pl.php, it.php, da.php, cs.php,
+	  ct.php, ro.php, is.php, ca.php, fi.php, et.php, tr.php,
+	  pt-br.php, tw.php, hu.php, cn.php, jp.php, gr.php, he.php,
+	  nl.php, ru.php, fr.php, no.php, id.php, es.php, eu.php, sk.php,
+	  ko.php, en.php: missing USB tag     ( Edwin Meester <millenniumv3
+	  at users.sf.net> )
+
+2004-08-30 15:28  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.WINNT.inc.php: Fatal error: Call to undefined
+	  method variant::Next() in
+	  F:\Http\localhost\test\phpsysinfo\includes\os\class.WINNT.inc
+	  .php on line 104 ( Edwin Meester <millenniumv3 at users.sf.net> )
+
+2004-08-25 19:33  webbie (webbie at ipfw dot org)
+
+	* includes/lang/nl.php: - Updated CPUSpeed en BUSSpeed Labels -
+	  changed "Buffergrootte" to "Cache grootte" cause Cache is used by
+	  most of Dutch PC Shops...  ( Edwin Meester <millenniumv3 at
+	  users.sf.net> )
+
+2004-08-25 03:04  webbie (webbie at ipfw dot org)
+
+	* includes/: system_footer.php, lang/bg.php, lang/de.php,
+	  lang/lv.php, lang/lt.php, lang/br.php, lang/it.php, lang/da.php,
+	  lang/cs.php, lang/ct.php, lang/is.php, lang/ca.php, lang/fi.php,
+	  lang/big5.php, lang/et.php, lang/hu.php, lang/cn.php,
+	  lang/jp.php, lang/gr.php, lang/he.php, lang/ar_utf8.php,
+	  lang/nl.php, lang/fr.php, lang/id.php, lang/es.php, lang/eu.php,
+	  lang/ko.php, lang/en.php, lang/pt.php, lang/sv.php, lang/pl.php,
+	  lang/ro.php, lang/tr.php, lang/pt-br.php, lang/tw.php,
+	  lang/ru.php, lang/no.php, lang/sk.php, os/class.Darwin.inc.php,
+	  xml/hardware.php: add BUS Speed to the hardware section (
+	  macftphttp.serverbox.org <macftphttp at users.sf.net> ) ( Edwin
+	  Meester <millenniumv3 at users.sf.net> )
+
+2004-08-25 02:34  webbie (webbie at ipfw dot org)
+
+	* includes/: lang/bg.php, lang/de.php, lang/lv.php, lang/pt.php,
+	  lang/lt.php, lang/sv.php, lang/br.php, lang/pl.php, lang/it.php,
+	  lang/da.php, lang/cs.php, lang/ct.php, lang/ro.php, lang/is.php,
+	  lang/ca.php, lang/fi.php, lang/big5.php, lang/et.php,
+	  lang/tr.php, lang/pt-br.php, lang/tw.php, lang/hu.php,
+	  lang/cn.php, lang/jp.php, lang/gr.php, lang/he.php,
+	  lang/ar_utf8.php, lang/nl.php, lang/ru.php, lang/fr.php,
+	  lang/no.php, lang/id.php, lang/es.php, lang/eu.php, lang/sk.php,
+	  lang/ko.php, lang/en.php, os/class.HP-UX.inc.php,
+	  os/class.Linux.inc.php, os/class.BSD.common.inc.php,
+	  os/class.Darwin.inc.php, os/class.WINNT.inc.php,
+	  os/class.SunOS.inc.php, xml/hardware.php: show CPU speed as X.XX
+	  Ghz or XXX Mhz if less than 1 Ghz.  ( macftphttp.serverbox.org
+	  <macftphttp at users.sf.net> ) ( Edwin Meester <millenniumv3 at
+	  users.sf.net> )
+
+2004-08-24 23:57  webbie (webbie at ipfw dot org)
+
+	* templates/windows_classic/: box.tpl, windows_classic.css,
+	  form.tpl, images/bottom_left_corner.gif,
+	  images/bottom_right_corner.gif, images/redbar_middle.gif,
+	  images/spacer.gif, images/bar_middle.gif, images/right.gif,
+	  images/left.gif, images/bar_right.gif, images/min_max.gif,
+	  images/redbar_right.gif, images/top.gif,
+	  images/upper_left_corner.gif, images/redbar_left.gif,
+	  images/middle.gif, images/bar_left.gif, images/bottom.gif,
+	  images/upper_right_corner.gif: new windows_classic template	 (
+	  Edwin Meester <millenniumv3 at users.sf.net> )
+
+2004-08-24 23:18  webbie (webbie at ipfw dot org)
+
+	* includes/lang/fr.php: update french localization   ( Xavier
+	  Spirlet <exess at skynet.be> )
+
+2004-08-24 23:06  webbie (webbie at ipfw dot org)
+
+	* templates/: aq/form.tpl, black/form.tpl, blue/form.tpl,
+	  bulix/form.tpl, kde/form.tpl, wintendoxp/form.tpl,
+	  orange/form.tpl, metal/form.tpl, typo3/form.tpl: remove
+	  hysteresis from temperature section
+
+2004-08-24 22:58  webbie (webbie at ipfw dot org)
+
+	* includes/xml/mbinfo.php, templates/classic/form.tpl: [no log
+	  message]
+
+2004-08-23 23:02  webbie (webbie at ipfw dot org)
+
+	* includes/lang/nl.php: - Fixed the Dutch Local windows and Linux.
+	  (Guess al other files have to be patched also (for windows
+	  support)
+
+	  - translated labels from version 2.2 and 2.3
+
+	  ( Edwin Meester <millenniumv3 at users.sf.net> )
+
+2004-08-23 22:56  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: add sun cobalt detection   (
+	  Jerry Bauer <kb at diskfailure.nl> )
+
+2004-08-19 14:48  webbie (webbie at ipfw dot org)
+
+	* config.php.new: update comments
+
+2004-08-19 14:32  webbie (webbie at ipfw dot org)
+
+	* includes/lang/is.php: update Icelandic translation   (Throstur
+	  Svanbergsson <throstur at users.sf.net> )
+
+2004-08-19 14:26  webbie (webbie at ipfw dot org)
+
+	* index.php: disable notice if cookie is not set
+
+2004-08-14 22:18  webbie (webbie at ipfw dot org)
+
+	* index.php: bump version to 2.4-cvs
+
+2004-08-14 11:22  webbie (webbie at ipfw dot org)
+
+	* index.php (tags: REL-2-3): phpsysinfo version 2.3 release!
+
+2004-08-13 23:02  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php (tags: REL-2-3): template picklist
+	  should only pickup directory name and language picklist should
+	  only pickup language file with .php extension
+
+2004-08-12 00:07  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php: comestic bug fix
+
+2004-08-11 11:55  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php: format code using phpCodeBeautifier
+
+2004-08-11 07:34  webbie (webbie at ipfw dot org)
+
+	* config.php.new (tags: REL-2-3), includes/system_footer.php: add
+	  option to hide/display langauge and template picklist
+
+2004-08-11 07:23  webbie (webbie at ipfw dot org)
+
+	* config.php.new, index.php: default template and language config
+	  option   (requested by many peoples)
+
+2004-08-11 06:55  webbie (webbie at ipfw dot org)
+
+	* images/Arch.gif, includes/os/class.Linux.inc.php (utags:
+	  REL-2-3): Add Arch Linux detection	 ( Simo L <neotuli at
+	  users.sf.net> )
+
+2004-07-18 03:27  webbie (webbie at ipfw dot org)
+
+	* includes/index.html, includes/lang/index.html,
+	  includes/mb/index.html, includes/os/index.html,
+	  includes/xml/index.html, images/index.html,
+	  templates/wintendoxp/form.tpl, templates/index.html,
+	  templates/kde/form.tpl, sample/index.html (utags: REL-2-3):
+	  prevent index listing
+
+2004-07-16 22:06  webbie (webbie at ipfw dot org)
+
+	* templates/classic/form.tpl (tags: REL-2-3): remove hysteresis
+	  from temperature section
+
+2004-07-16 22:06  webbie (webbie at ipfw dot org)
+
+	* templates/: aq/form.tpl (tags: REL-2-3), black/form.tpl (tags:
+	  REL-2-3), orange/form.tpl (tags: REL-2-3), metal/form.tpl (tags:
+	  REL-2-3), blue/form.tpl (tags: REL-2-3), bulix/form.tpl (tags:
+	  REL-2-3), kde/form.tpl, wintendoxp/form.tpl, typo3/form.tpl
+	  (tags: REL-2-3): add temperature section to bulix and fixing
+	  table tag problem in form.tpl     ( Frederik Schueler <fschueler
+	  at users.sf.net> )
+
+2004-07-14 06:34  webbie (webbie at ipfw dot org)
+
+	* README (tags: REL-2-3): phpsysinfo does work on PHP5.x
+
+2004-07-12 01:39  webbie (webbie at ipfw dot org)
+
+	* includes/lang/: jp.php, ar_utf8.php (utags: REL-2-3): fixing
+	  language template for ar_utf8 and jp	  ( Frederik Schueler
+	  <fschueler at users.sf.net> )
+
+2004-07-05 17:55  webbie (webbie at ipfw dot org)
+
+	* README, config.php.new: better hardware sensor installation
+	  instructions
+
+2004-07-03 01:28  webbie (webbie at ipfw dot org)
+
+	* includes/xml/mbinfo.php (tags: REL-2-3): remove hysteresis from
+	  temperature section
+
+2004-07-02 02:33  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.OpenBSD.inc.php (tags: REL-2-3): remove WIP
+	  message
+
+2004-07-02 02:32  webbie (webbie at ipfw dot org)
+
+	* includes/os/: class.BSD.common.inc.php (tags: REL-2-3),
+	  class.WINNT.inc.php (tags: REL-2-3), class.OpenBSD.inc.php:
+	  Proper fix OpenBSD pci logic
+
+2004-06-29 01:29  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.WINNT.inc.php: add ending ?>
+
+2004-06-29 01:26  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.WINNT.inc.php: Now supports v2.2 of phpSysInfo.
+	  ( Carl C. Longnecker <longneck at users.sf.net> )
+
+2004-06-28 20:51  webbie (webbie at ipfw dot org)
+
+	* includes/: common_functions.php (tags: REL-2-3),
+	  os/class.WINNT.inc.php: add WinNT support   ( Carl C. Longnecker
+	  <longneck at users.sf.net> )
+
+2004-06-27 00:24  webbie (webbie at ipfw dot org)
+
+	* index.php: template and lng cookies now work with register global
+	  on and off
+
+2004-06-26 23:46  webbie (webbie at ipfw dot org)
+
+	* includes/: os/class.HP-UX.inc.php (tags: REL-2-3),
+	  os/class.NetBSD.inc.php (tags: REL-2-3), os/class.Linux.inc.php,
+	  os/class.BSD.common.inc.php, os/class.Darwin.inc.php (tags:
+	  REL-2-3), os/class.FreeBSD.inc.php (tags: REL-2-3),
+	  os/class.OpenBSD.inc.php, xml/hardware.php (tags: REL-2-3): Add
+	  scsi hdd capacity information
+
+2004-06-26 01:50  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.SunOS.inc.php (tags: REL-2-3): remove
+	  compat_array_keys and add usb function boby
+
+2004-06-26 01:27  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.hwsensors.inc.php (tags: REL-2-3): compatible
+	  with OpenBSD 3.5 ( psyc <scotchme@users.sf.net> )
+
+2004-06-26 01:18  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.BSD.common.inc.php: make it compatible with
+	  OpenBSD 3.4
+
+2004-06-26 00:24  webbie (webbie at ipfw dot org)
+
+	* includes/XPath.class.php (tags: REL-2-3): make phpsysinfo works
+	  with php5 see http://bugs.php.net/bug.php?id=27815
+
+2004-06-21 19:14  precision    Uriah Welcome (precision at users.sf.net)
+
+	* images/Trustix.gif (tags: REL-2-3): Adding trustix detection
+
+2004-06-21 19:14  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: adding trustix detection from
+	  Gervasio Varela <gervarela at teleline.es>
+
+2004-06-21 19:09  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/typo3/: typo3.css (tags: REL-2-3), box.tpl (tags:
+	  REL-2-3), form.tpl, images/redbar_middle.gif (tags: REL-2-3),
+	  images/bar_middle.gif (tags: REL-2-3), images/bar_right.gif
+	  (tags: REL-2-3), images/redbar_right.gif (tags: REL-2-3),
+	  images/trans.gif (tags: REL-2-3), images/redbar_left.gif (tags:
+	  REL-2-3), images/bar_left.gif (tags: REL-2-3): adding typo3
+	  template from Mauric Rene Oberlaender <admin at mronet.at>
+
+2004-06-12 23:02  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.lmsensors.inc.php (tags: REL-2-3): This
+	  validates that the limit is actually greater than the hysteresis
+	  value (which is should be).
+
+2004-06-09 16:22  webbie (webbie at ipfw dot org)
+
+	* index.php, phpsysinfo.dtd (tags: REL-2-3): diable magic quotes
+	  during runtime
+
+2004-05-23 02:35  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php: doesn't need to check for 'xml'
+
+2004-05-23 01:47  webbie (webbie at ipfw dot org)
+
+	* sample/mount1.txt (tags: REL-2-3): add sample mount output
+
+2004-05-22 22:13  webbie (webbie at ipfw dot org)
+
+	* config.php.new, includes/system_footer.php,
+	  includes/mb/class.mbmon.inc.php (tags: REL-2-3): Add mbmon
+	  support   ( Zoltan Frombach <zoltan at frombach.com> )
+
+2004-05-15 21:24  webbie (webbie at ipfw dot org)
+
+	* index.php: bump version to 2.3-cvs
+
+2004-05-15 07:27  webbie (webbie at ipfw dot org)
+
+	* index.php (tags: REL-2-2): bump version to 2.2
+
+2004-05-07 01:05  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php (tags: REL-2-2): Add Free EOS
+	  distro detection
+
+2004-05-07 00:51  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Darwin.inc.php (tags: REL-2-2): use Darwin icon
+	  instead of xp icon, peoples are very upset =)
+
+2004-05-05 22:09  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.lmsensors.inc.php (tags: REL-2-2): redo some
+	  regex, hopefully it fixes some weird temperature parsing problem
+
+2004-05-05 21:50  webbie (webbie at ipfw dot org)
+
+	* sample/: lmsensors3.txt, lmsensors1.txt, lmsensors2.txt (utags:
+	  REL-2-2, REL-2-3): add sample lmsensors output
+
+2004-05-02 18:45  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: add SuSE distro detection	(
+	  Ben van Essen <flark at users.sf.net> )
+
+2004-05-02 01:41  webbie (webbie at ipfw dot org)
+
+	* index.php: remove magic quote statement, it is unnecessary
+
+2004-05-01 08:48  webbie (webbie at ipfw dot org)
+
+	* index.php, includes/system_footer.php (tags: REL-2-2): coding
+	  style fixup
+
+2004-05-01 08:31  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php: fix minor glitches in the
+	  system_footer.php   <macftphttp at users.sourceforge.net>
+
+2004-04-30 08:29  webbie (webbie at ipfw dot org)
+
+	* index.php (tags: REL-2-2-RC1): bump version to 2.2-rc1, getting
+	  ready for the final release
+
+2004-04-30 06:04  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Darwin.inc.php (tags: REL-2-2-RC1): Fix Xpath
+	  error in XPath.class.php (David Schlosnagle <schlosna at
+	  users.sourceforge.net>)
+
+2004-04-30 05:42  webbie (webbie at ipfw dot org)
+
+	* index.php: 1. add xml module check 2. turn of magic quote
+
+2004-04-28 07:14  webbie (webbie at ipfw dot org)
+
+	* phpsysinfo.dtd (tags: REL-2-2, REL-2-2-RC1): Add Distroicon
+	  element
+
+2004-04-28 07:12  webbie (webbie at ipfw dot org)
+
+	* includes/lang/: bg.php (tags: REL-2-3), de.php (tags: REL-2-3),
+	  lv.php (tags: REL-2-3), pt.php (tags: REL-2-3), lt.php (tags:
+	  REL-2-3), sv.php (tags: REL-2-3), br.php (tags: REL-2-3), pl.php
+	  (tags: REL-2-3), it.php (tags: REL-2-3), da.php (tags: REL-2-3),
+	  cs.php (tags: REL-2-3), ct.php (tags: REL-2-3), ro.php (tags:
+	  REL-2-3), is.php (tags: REL-2-3), ca.php (tags: REL-2-3), fi.php
+	  (tags: REL-2-3), big5.php (tags: REL-2-3), et.php (tags:
+	  REL-2-3), tr.php (tags: REL-2-3), pt-br.php (tags: REL-2-3),
+	  tw.php (tags: REL-2-3), hu.php (tags: REL-2-3), cn.php (tags:
+	  REL-2-3), jp.php, gr.php (tags: REL-2-3), he.php (tags: REL-2-3),
+	  ar_utf8.php, nl.php (tags: REL-2-3), ru.php (tags: REL-2-3),
+	  fr.php (tags: REL-2-3), no.php (tags: REL-2-3), id.php (tags:
+	  REL-2-3), es.php (tags: REL-2-3), eu.php (tags: REL-2-3), sk.php
+	  (tags: REL-2-3), ko.php (tags: REL-2-3), en.php (tags: REL-2-3)
+	  (utags: REL-2-2, REL-2-2-RC1): fix label case
+
+2004-04-28 06:46  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.lmsensors.inc.php (tags: REL-2-2-RC1): minor
+	  regex string fix
+
+2004-04-25 05:46  webbie (webbie at ipfw dot org)
+
+	* config.php.new, includes/mb/class.hwsensors.inc.php (utags:
+	  REL-2-2, REL-2-2-RC1): add OpenBSD hw.sensors support
+
+2004-04-25 00:39  webbie (webbie at ipfw dot org)
+
+	* includes/XPath.class.php (tags: REL-2-2, REL-2-2-RC1): update
+	  XPath.class.php to v3.4
+
+2004-04-24 22:52  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php (tags: REL-2-2-RC1): Bug fix in
+	  distroicon function
+
+2004-04-24 22:36  webbie (webbie at ipfw dot org)
+
+	* includes/: os/class.HP-UX.inc.php (tags: REL-2-2, REL-2-2-RC1),
+	  os/class.NetBSD.inc.php (tags: REL-2-2, REL-2-2-RC1),
+	  os/class.Linux.inc.php, os/class.Darwin.inc.php,
+	  os/class.FreeBSD.inc.php (tags: REL-2-2, REL-2-2-RC1),
+	  os/class.SunOS.inc.php (tags: REL-2-2, REL-2-2-RC1),
+	  os/class.OpenBSD.inc.php (tags: REL-2-2, REL-2-2-RC1),
+	  xml/vitals.php (tags: REL-2-3, REL-2-2, REL-2-2-RC1): Redo the
+	  distro icon logic, the old way is ugly
+
+2004-04-24 05:53  webbie (webbie at ipfw dot org)
+
+	* includes/: os/class.Linux.inc.php, xml/vitals.php: Add Slackware
+	  detection   ( Paul Cairney <pcairney at users.sourceforge.net> )
+
+2004-04-06 00:26  webbie (webbie at ipfw dot org)
+
+	* includes/: os/class.Linux.inc.php, xml/vitals.php: add Fedora
+	  distro and thank you Beretta for all the distro icons
+
+2004-03-31 21:20  webbie (webbie at ipfw dot org)
+
+	* templates/aq/images/: redbar_middle.gif, d.gif, inf.gif, g.gif,
+	  bar_middle.gif, bar_right.gif, redbar_right.gif, coininfd.gif,
+	  coinsupd.gif, redbar_left.gif, coininfg.gif, coinsupg.gif,
+	  bar_left.gif, sup.gif, fond.gif (utags: REL-2-2, REL-2-2-RC1,
+	  REL-2-3): overwrote aq theme by mistake
+
+2004-03-31 21:08  webbie (webbie at ipfw dot org)
+
+	* templates/bulix/bulix.css (tags: REL-2-3, REL-2-2, REL-2-2-RC1):
+	  cosmetic fix
+
+2004-03-31 10:25  webbie (webbie at ipfw dot org)
+
+	* includes/xml/vitals.php: missing closing bracket
+
+2004-03-31 10:21  webbie (webbie at ipfw dot org)
+
+	* includes/xml/vitals.php, images/xp.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1): Add distro icon logic
+
+2004-03-14 05:59  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: doesn't need 4k buffer to read
+	  distro string
+
+2004-03-14 05:56  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: Add Gentoo Distro detection (
+	  Mark Gillespie <mgillespie @ users.sf.net> )
+
+2004-03-14 05:21  webbie (webbie at ipfw dot org)
+
+	* includes/mb/: class.healthd.inc.php (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), class.lmsensors.inc.php: fix missing ?> tag
+
+2004-03-14 05:16  webbie (webbie at ipfw dot org)
+
+	* includes/: XPath.class.php, class.Template.inc.php (tags:
+	  REL-2-3, REL-2-2, REL-2-2-RC1), os/class.HP-UX.inc.php,
+	  os/class.NetBSD.inc.php, os/class.Linux.inc.php,
+	  os/class.BSD.common.inc.php (tags: REL-2-2, REL-2-2-RC1),
+	  os/class.Darwin.inc.php, os/class.FreeBSD.inc.php,
+	  os/class.SunOS.inc.php, os/class.OpenBSD.inc.php: fix missing
+	  ending ?> tag
+
+2004-03-14 05:05  webbie (webbie at ipfw dot org)
+
+	* index.php: better error message if config.php is missing
+
+2004-03-13 04:52  webbie (webbie at ipfw dot org)
+
+	* templates/wintendoxp/images/: redbar_middle.gif, d.gif, inf.gif,
+	  g.gif, background.gif, bar_middle.gif, aq_background.gif,
+	  bar_right.gif, icons.gif, redbar_right.gif, coininfd.gif,
+	  coinsupd.gif, redbar_left.gif, coininfg.gif, coinsupg.gif,
+	  bar_left.gif, sup.gif, space15_15.gif, fond.gif (utags: REL-2-2,
+	  REL-2-2-RC1, REL-2-3): Rip wintendoxp theme from aspSysInfo
+
+2004-03-13 00:27  webbie (webbie at ipfw dot org)
+
+	* templates/wintendoxp/: box.tpl (tags: REL-2-3), form.tpl,
+	  wintendoxp.css (tags: REL-2-3) (utags: REL-2-2, REL-2-2-RC1): Rip
+	  wintendoxp theme from aspSysInfo
+
+2004-03-13 00:04  webbie (webbie at ipfw dot org)
+
+	* phpsysinfo.dtd, includes/lang/bg.php, includes/lang/ar_utf8.php,
+	  includes/lang/de.php, includes/lang/lv.php, includes/lang/pt.php,
+	  includes/lang/lt.php, includes/lang/sv.php, includes/lang/br.php,
+	  includes/lang/pl.php, includes/lang/it.php, includes/lang/da.php,
+	  includes/lang/cs.php, includes/lang/ct.php, includes/lang/ro.php,
+	  includes/lang/is.php, includes/lang/ca.php, includes/lang/fi.php,
+	  includes/lang/big5.php, includes/lang/et.php,
+	  includes/lang/tr.php, includes/lang/pt-br.php,
+	  includes/lang/tw.php, includes/lang/hu.php, includes/lang/cn.php,
+	  includes/lang/jp.php, includes/lang/gr.php, includes/lang/he.php,
+	  includes/lang/nl.php, includes/lang/ru.php, includes/lang/fr.php,
+	  includes/lang/no.php, includes/lang/id.php, includes/lang/es.php,
+	  includes/lang/eu.php, includes/lang/sk.php, includes/lang/ko.php,
+	  includes/lang/en.php, includes/os/class.HP-UX.inc.php,
+	  includes/os/class.NetBSD.inc.php,
+	  includes/os/class.Linux.inc.php,
+	  includes/os/class.Darwin.inc.php,
+	  includes/os/class.FreeBSD.inc.php,
+	  includes/os/class.SunOS.inc.php,
+	  includes/os/class.OpenBSD.inc.php, includes/xml/vitals.php: Add
+	  distro name as per Beretta's request
+
+2004-03-12 22:55  webbie (webbie at ipfw dot org)
+
+	* templates/kde/: box.tpl (tags: REL-2-3), kde.css (tags: REL-2-3),
+	  form.tpl, images/background.gif (tags: REL-2-3),
+	  images/bar_left.gif (tags: REL-2-3), images/bar_middle.gif (tags:
+	  REL-2-3), images/redbar_middle.gif (tags: REL-2-3), images/d.gif
+	  (tags: REL-2-3), images/inf.gif (tags: REL-2-3), images/g.gif
+	  (tags: REL-2-3), images/title_mid.gif (tags: REL-2-3),
+	  images/title_right.gif (tags: REL-2-3), images/nobar_middle.gif
+	  (tags: REL-2-3), images/bar_right.gif (tags: REL-2-3),
+	  images/title_left.gif (tags: REL-2-3), images/icons.gif (tags:
+	  REL-2-3), images/nobar_right.gif (tags: REL-2-3),
+	  images/redbar_right.gif (tags: REL-2-3), images/coininfd.gif
+	  (tags: REL-2-3), images/coinsupd.gif (tags: REL-2-3),
+	  images/redbar_left.gif (tags: REL-2-3), images/coininfg.gif
+	  (tags: REL-2-3), images/coinsupg.gif (tags: REL-2-3),
+	  images/sup.gif (tags: REL-2-3), images/space15_15.gif (tags:
+	  REL-2-3), images/fond.gif (tags: REL-2-3) (utags: REL-2-2,
+	  REL-2-2-RC1): Rip kde theme from aspSysInfo
+
+2004-03-12 22:51  webbie (webbie at ipfw dot org)
+
+	* templates/aq/images/: redbar_middle.gif, d.gif, inf.gif, g.gif,
+	  bar_middle.gif, bar_right.gif, redbar_right.gif, coininfd.gif,
+	  coinsupd.gif, redbar_left.gif, coininfg.gif, coinsupg.gif,
+	  bar_left.gif, sup.gif, fond.gif: Rip wintendoxp and kde theme
+	  from aspSysInfo
+
+2004-03-12 09:24  webbie (webbie at ipfw dot org)
+
+	* templates/: aq/box.tpl, black/box.tpl, metal/box.tpl (utags:
+	  REL-2-2, REL-2-2-RC1, REL-2-3): remove image alt="none" tag
+
+2004-03-12 07:01  webbie (webbie at ipfw dot org)
+
+	* includes/lang/lt.php: Add sensors section
+
+2004-03-12 07:00  webbie (webbie at ipfw dot org)
+
+	* includes/lang/lt.php: New lithuanian (lt) translation   ( Rimas
+	  Kudelis )
+
+2003-11-27 06:19  webbie (webbie at ipfw dot org)
+
+	* includes/xml/filesystems.php (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1): show mount point option fix
+
+2003-11-26 20:10  webbie (webbie at ipfw dot org)
+
+	* config.php.new: rename config.php to config.php.new to avoid cvs
+	  overwrite user config file
+
+2003-11-26 20:07  webbie (webbie at ipfw dot org)
+
+	* includes/xml/filesystems.php: proper fix for show_mount_point
+	  feature
+
+2003-11-26 19:57  webbie (webbie at ipfw dot org)
+
+	* includes/xml/filesystems.php: new option show_mount_point, set it
+	  to false to hide mount point
+
+2003-11-26 19:41  webbie (webbie at ipfw dot org)
+
+	* includes/xml/: memory.php (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  filesystems.php, network.php (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1): comestic fix to the bulix template
+
+2003-11-26 19:19  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php (tags: REL-2-2-RC1): for some reasons,
+	  xml folder shows up under template and lang directory. We need to
+	  hide it
+
+2003-11-26 02:20  webbie (webbie at ipfw dot org)
+
+	* includes/: system_footer.php, os/class.HP-UX.inc.php,
+	  os/class.NetBSD.inc.php, os/class.Linux.inc.php,
+	  os/class.BSD.common.inc.php, os/class.Darwin.inc.php,
+	  os/class.OpenBSD.inc.php: sort PCI, IDE and SCSI output by
+	  alphabetical order
+
+2003-11-25 19:57  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php: sort template and language dropdown
+	  list in alphabetical order
+
+2003-11-08 23:56  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: minor formatting cleanups
+
+2003-11-08 23:56  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_footer.php: adding XML option to the templates
+	  menu
+
+2003-11-08 23:49  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/: system_header.php (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), lang/jp.php, lang/ja.php (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1): adding Japanese language translations from Yuuki
+	  'SOI' Umeno <soip at users.sf.net>
+
+2003-11-08 23:43  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/bulix/: box.tpl (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  form.tpl (tags: REL-2-2, REL-2-2-RC1), bulix.css,
+	  images/redbar_middle.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/middle_bar.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/bar_middle.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/bar_right.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/redbar_right.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/trans.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/right_bar.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/redbar_left.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/left_bar.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  images/bar_left.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1): Adding
+	  new theme bulix from Maxime Petazzoni <maxime.petazzoni at
+	  nova-mag.org>
+
+2003-11-08 23:38  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/ar_utf8.php: Adding Arabic translation <nizar at
+	  srcget.com>
+
+2003-11-03 03:07  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: new memory function which works
+	  with all kernel versions    (Frederik Schueler <fschueler at
+	  gmx.net>)
+
+2003-10-15 03:24  webbie (webbie at ipfw dot org)
+
+	* includes/os/: class.HP-UX.inc.php, class.BSD.common.inc.php,
+	  class.SunOS.inc.php: Add groundwork for SBUS device list   (
+	  David Johnson <dj1471 at users.sf.net> )
+
+2003-10-15 03:17  webbie (webbie at ipfw dot org)
+
+	* phpsysinfo.dtd, includes/os/class.Linux.inc.php,
+	  includes/xml/hardware.php (tags: REL-2-2, REL-2-2-RC1): Add
+	  groundwork for SBUS device list    ( David Johnson <dj1471 at
+	  users.sf.net> )
+
+2003-10-15 03:02  webbie (webbie at ipfw dot org)
+
+	* index.php: outputs the "text/xml" content type when using the xml
+	  template.   ( Tim Carey-Smith <timcs at users.sf.net> )
+
+2003-10-15 02:52  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: SPARC CPU info fix	   ( David
+	  Johnson <dj1471 at users.sf.net> )
+
+2003-10-15 02:47  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: linux 2.5 or above memory
+	  display bug fix    ( Marcelo de Paula Bezerra <mosca at
+	  users.sf.net> ) and ( Frederik Sch�ler <fschueler at gmx.net> )
+
+2003-10-14 18:28  webbie (webbie at ipfw dot org)
+
+	* includes/lang/hu.php: missing a <
+
+2003-09-04 03:51  webbie (webbie at ipfw dot org)
+
+	* includes/lang/de.php: German locale update contributed by
+	  Alexander Wild <alexwild at gmx.de>
+
+2003-08-04 21:31  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_header.php: editor cleanups
+
+2003-08-04 21:28  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/mb/class.lmsensors.inc.php: trim() the results to the
+	  XML output is clean Some minor editor cleanups
+
+2003-08-04 21:28  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/en.php: Uppercasing Div and Histeresis to match
+	  everything else
+
+2003-07-22 00:38  webbie (webbie at ipfw dot org)
+
+	* includes/: mb/class.healthd.inc.php, mb/class.lmsensors.inc.php,
+	  os/class.HP-UX.inc.php, os/class.NetBSD.inc.php,
+	  os/class.Linux.inc.php, os/class.BSD.common.inc.php,
+	  os/class.Darwin.inc.php, os/class.FreeBSD.inc.php,
+	  os/class.SunOS.inc.php, os/class.OpenBSD.inc.php: code format
+	  cleanup using phpCodeBeautifier
+
+2003-07-22 00:31  webbie (webbie at ipfw dot org)
+
+	* index.php, includes/system_header.php,
+	  includes/common_functions.php (tags: REL-2-2, REL-2-2-RC1),
+	  includes/system_footer.php, includes/class.Template.inc.php: code
+	  format cleanup using phpCodeBeautifier
+
+2003-06-17 03:04  webbie (webbie at ipfw dot org)
+
+	* includes/system_header.php: Add hostname to the title for easy
+	  bookmarking  ( Maxim Solomatin <makc666 at newmail.ru> )
+
+2003-06-09 16:26  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.lmsensors.inc.php: lmsensor regex fix  ( SOD
+	  <sod at gmx.at> )
+
+2003-05-11 23:23  webbie (webbie at ipfw dot org)
+
+	* includes/lang/cn.php: cosmetic langauge fix
+
+2003-04-26 21:13  webbie (webbie at ipfw dot org)
+
+	* README (tags: REL-2-2, REL-2-2-RC1): wrong again, I am on drug
+	  today
+
+2003-04-26 21:11  webbie (webbie at ipfw dot org)
+
+	* README: oops.. wrong link
+
+2003-04-26 20:59  webbie (webbie at ipfw dot org)
+
+	* README: Make a note that this
+	  http://www.securityfocus.com/archive/1/319713/2003-04-23/2003-04-29/2
+	  problem is fixed
+
+2003-04-03 23:29  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: mee too
+
+2003-03-31 21:26  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/mb/class.healthd.inc.php,
+	  includes/mb/class.lmsensors.inc.php: minor formatting cleanups..
+	  removing some whitespace Fix the ChangeLog generator to fill in
+	  Webbie's email properly
+
+2003-03-31 21:22  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/pt-br.php: Adding Portuguese-Brazil translation
+	  (Marc�lio Maia <marcilio at edn.org.br>)
+
+2003-02-23 09:04  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.BSD.common.inc.php: fix swap space double count
+	  problem
+
+2003-02-16 04:04  webbie (webbie at ipfw dot org)
+
+	* includes/: lang/pl.php, lang/big5.php, lang/tw.php,
+	  xml/hardware.php: various language files update
+
+2003-02-16 03:34  webbie (webbie at ipfw dot org)
+
+	* includes/xml/hardware.php: Hide SCSI, USB section if it doesn't
+	  exist instead of showing as 'none'	( Cichy <cichy @
+	  users.sf.net> )
+
+2003-02-10 00:20  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php: use the method from php.net in the
+	  opendir loop
+
+2003-02-09 23:50  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.FreeBSD.inc.php: Fix network section. It should
+	  works for both FreeBSD 4.x and 5.x now
+
+2003-02-06 04:39  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/classic/classic.css (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1): small CSS fix for Opera 7 (Michael Herger <mherger
+	  at jo-sac.ch>)
+
+2003-02-06 04:36  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/lv.php: adding Latvian translation (Elvis Kvalbergs
+	  <elvis at burti.lv>)
+
+2003-01-25 08:04  webbie (webbie at ipfw dot org)
+
+	* index.php, includes/system_footer.php, includes/lang/bg.php,
+	  includes/lang/de.php, includes/lang/br.php, includes/lang/it.php,
+	  includes/lang/da.php, includes/lang/cs.php, includes/lang/ct.php,
+	  includes/lang/is.php, includes/lang/ca.php, includes/lang/fi.php,
+	  includes/lang/big5.php, includes/lang/et.php,
+	  includes/lang/hu.php, includes/lang/cn.php, includes/lang/gr.php,
+	  includes/lang/he.php, includes/lang/fr.php, includes/lang/id.php,
+	  includes/lang/es.php, includes/lang/eu.php, includes/lang/ko.php,
+	  includes/lang/en.php, includes/lang/pt.php, includes/lang/lt.php,
+	  includes/lang/sv.php, includes/lang/ro.php, includes/lang/tr.php,
+	  includes/lang/tw.php, includes/lang/nl.php, includes/lang/ru.php,
+	  includes/lang/no.php, includes/lang/sk.php,
+	  includes/os/class.BSD.common.inc.php: cosmetic change to the
+	  footer
+
+2003-01-21 01:06  webbie (webbie at ipfw dot org)
+
+	* includes/: system_header.php, system_footer.php, lang/bg.php,
+	  lang/br.php, lang/ca.php, lang/big5.php, lang/de.php,
+	  lang/da.php, lang/cs.php, lang/ct.php, lang/fi.php, lang/et.php,
+	  lang/cn.php, lang/es.php, lang/eu.php, lang/en.php, lang/gr.php,
+	  lang/he.php, lang/fr.php, lang/pt.php, lang/lt.php, lang/sv.php,
+	  lang/pl.php, lang/it.php, lang/ro.php, lang/is.php, lang/tr.php,
+	  lang/tw.php, lang/hu.php, lang/nl.php, lang/ru.php, lang/no.php,
+	  lang/id.php, lang/sk.php, lang/ko.php: display footer in locale
+	  <Cichy>
+
+2003-01-19 02:18  webbie (webbie at ipfw dot org)
+
+	* index.php: Bug #670222: DoS fix ( Wolter Kamphuis <wkamphuis at
+	  users.sf.net> )
+
+2003-01-10 16:50  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.Linux.inc.php: Minor patch for detecting CPU
+	  info under Linux/sparc64. This patch enables phpSysInfo to
+	  retrieve number of CPU's, CPU MHz, and CPU bogomips on sparc64
+	  platforms running Linux.     (Jason Mann <jemann at sf.net>)
+
+2003-01-05 05:16  webbie (webbie at ipfw dot org)
+
+	* index.php, includes/xml/mbinfo.php (tags: REL-2-2, REL-2-2-RC1):
+	  make the temperature bar wider by using scale_factor = 4 and hide
+	  the fan section if all fans RPM are zero.  Suggestions made by
+	  cichy ( Artur Cichocki )
+
+2003-01-05 04:38  webbie (webbie at ipfw dot org)
+
+	* includes/mb/class.lmsensors.inc.php: ereg pattern fix: lm_sensors
+	  sometimes return temperature without histeresis
+
+2003-01-04 14:15  webbie (webbie at ipfw dot org)
+
+	* includes/xml/mbinfo.php: comestic change: round histeresis to one
+	  decimal place
+
+2003-01-04 14:08  webbie (webbie at ipfw dot org)
+
+	* index.php, includes/lang/bg.php, includes/lang/big5.php,
+	  includes/lang/br.php, includes/lang/da.php, includes/lang/cs.php,
+	  includes/lang/ct.php, includes/lang/ca.php, includes/lang/cn.php,
+	  includes/lang/de.php, includes/lang/pt.php, includes/lang/lt.php,
+	  includes/lang/sv.php, includes/lang/pl.php, includes/lang/it.php,
+	  includes/lang/ro.php, includes/lang/is.php, includes/lang/fi.php,
+	  includes/lang/et.php, includes/lang/tr.php, includes/lang/tw.php,
+	  includes/lang/hu.php, includes/lang/gr.php, includes/lang/he.php,
+	  includes/lang/nl.php, includes/lang/ru.php, includes/lang/fr.php,
+	  includes/lang/no.php, includes/lang/id.php, includes/lang/es.php,
+	  includes/lang/eu.php, includes/lang/sk.php, includes/lang/ko.php,
+	  includes/lang/en.php, includes/mb/class.healthd.inc.php,
+	  includes/mb/class.lmsensors.inc.php, includes/xml/mbinfo.php,
+	  templates/black/form.tpl (tags: REL-2-2, REL-2-2-RC1),
+	  templates/aq/form.tpl (tags: REL-2-2, REL-2-2-RC1),
+	  templates/orange/form.tpl (tags: REL-2-2, REL-2-2-RC1),
+	  templates/metal/form.tpl (tags: REL-2-2, REL-2-2-RC1),
+	  templates/blue/form.tpl (tags: REL-2-2, REL-2-2-RC1),
+	  templates/classic/form.tpl (tags: REL-2-2, REL-2-2-RC1): Initial
+	  import of the motherboard monitor program module.  It supports
+	  healthd and lm_sensors now.
+
+	  Credits go to NSPIRIT for his lm_sensors module and Cichy
+	  [cichyart@wp.pl] for his enhancements on lm_sensors module.
+
+2003-01-02 06:18  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.BSD.common.inc.php: cosmetic change, remove
+	  comma in the uptime output
+
+2003-01-02 06:12  webbie (webbie at ipfw dot org)
+
+	* includes/os/class.HP-UX.inc.php: uptime and load average stat now
+	  working
+
+2002-12-31 01:51  webbie (webbie at ipfw dot org)
+
+	* includes/: os/class.BSD.common.inc.php, os/class.HP-UX.inc.php,
+	  os/class.NetBSD.inc.php, os/class.Linux.inc.php,
+	  os/class.Darwin.inc.php, os/class.FreeBSD.inc.php,
+	  os/class.SunOS.inc.php, os/class.OpenBSD.inc.php,
+	  xml/filesystems.php, xml/hardware.php, xml/network.php:
+	  Performance tuning, optimized the FOR loop	(webbie <webbie at
+	  ipfw.org>)
+
+2002-12-31 00:20  webbie (webbie at ipfw dot org)
+
+	* includes/system_footer.php: Added space after "Created by"
+	  (webbie <webbie at ipfw.org>)
+
+2002-12-19 22:53  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/fr.php: small translation fix
+
+2002-12-17 19:23  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: get cache size on PPC (Derrik
+	  Pates <dpates at dsdk12.net>)
+
+2002-12-14 00:03  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.SunOS.inc.php: kstat() conversions to
+	  $this->kstat() removed kstatclass() seems to be unused
+
+2002-12-14 00:01  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.SunOS.inc.php: adding alpha SunOS support
+	  (Gunther Schreiner <schreiner at users.sf.net>)
+
+2002-12-13 23:47  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: fix for translation autodetection and php $_SERVER
+	  stuff (Andreas Heil <aheil at users.sf.net>)
+
+2002-12-13 23:44  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.OpenBSD.inc.php: trying array_unique() again,
+	  maybe this time it'll be consistant
+
+2002-12-13 23:36  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Darwin.inc.php: get proper uptime information
+	  from Jaguar (Mike <lashampoo at users.sf.net>)
+
+2002-12-13 23:34  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: properly stringify uptime
+	  information on BSD from Mike <lashampoo at users.sf.net>
+
+2002-12-13 23:28  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/gr.php: Adding Greek translation from Maria Kaitsa
+	  <idefix at ee.teiath.gr>
+
+2002-11-01 21:53  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/pt.php: added Portugese translation (Bernardo de
+	  Seabra <zznet at wake-on-lan.cjb.net>)
+
+2002-10-25 18:58  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/os/class.Linux.inc.php,
+	  includes/os/class.Darwin.inc.php, includes/xml/filesystems.php,
+	  includes/xml/hardware.php, includes/xml/vitals.php: small
+	  formatting cleanups
+
+2002-10-25 18:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/: bg.php, pl.php, ro.php, big5.php, et.php, tr.php,
+	  tw.php, hu.php, ru.php, fr.php, id.php, ko.php, en.php: small
+	  formatting cleanups
+
+2002-10-25 18:40  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Darwin.inc.php: 1 liner for uptime fix (Matthew
+	  Boehm <dr_mac at mail.utexas.edu>)
+
+2002-10-25 18:39  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/cn.php: Adding Simplified Chinese translation
+	  (<dantifer at tsinghua.org.cn>)
+
+2002-10-17 00:38  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/: system_header.php, system_footer.php: Move the
+	  timestamp outta the <title> and onto the main page  (Jeff Prom
+	  <Jeff.Prom at us.ing.com>)
+
+2002-10-17 00:37  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.NetBSD.inc.php: NetBSD swap information Fix for
+	  >=1.6 (Cliff Albert <cliff at oisec.net>)
+
+2002-10-17 00:34  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/da.php: misspelling (Esben Skov Pedersen <phreak at
+	  geek.linux.dk>)
+
+2002-10-17 00:32  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: Use lspci on linux if it exists
+	  idea by (Mike Beck <mikebeck @ users.sf.net>), reimplementation
+	  by me
+
+2002-10-10 00:12  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/XPath.class.php: updated XPath to latest stable version
+
+2002-09-28 07:53  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.HP-UX.inc.php: initial (alpha quality) HP-UX
+	  support (Webbie <webbie at ipfw.org>)
+
+2002-09-10 05:41  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php: Fix for new PHP (4.2.3)
+	  (Webbie <webbie at ipfw.org>)
+
+2002-09-01 17:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/no.php: updates from Stig-?rjan Smelror <kekepower
+	  at susperianews.cjb.net>
+
+2002-08-20 23:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* phpsysinfo.dtd, includes/lang/de.php, includes/lang/br.php,
+	  includes/lang/it.php, includes/lang/da.php, includes/lang/cs.php,
+	  includes/lang/ct.php, includes/lang/is.php, includes/lang/ca.php,
+	  includes/lang/fi.php, includes/lang/big5.php,
+	  includes/lang/et.php, includes/lang/hu.php, includes/lang/he.php,
+	  includes/lang/fr.php, includes/lang/id.php, includes/lang/es.php,
+	  includes/lang/eu.php, includes/lang/en.php,
+	  includes/os/class.Linux.inc.php,
+	  includes/os/class.BSD.common.inc.php, includes/xml/hardware.php:
+	  USB detection (Max J. Werner <max at home-werner.de>) Add dummy
+	  usb() method to BSD common class as a place holder (me) Update
+	  the DTD to reflect the new USB section (me)
+
+2002-08-20 23:35  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: don't display kernfs on
+	  bsd, since it's always 100% (Jarkko Santala <jake at iki.fi))
+
+2002-08-20 23:33  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: More Verbose BSD kernel
+	  information (Alan E <alane at geeksrus.net>)
+
+2002-08-05 02:48  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/xml/vitals.php: fix the bug where it wouldn't display
+	  the load average > 2
+
+2002-07-02 00:03  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/ru.php: Adding Russian translation from Voldar
+	  <voldar at stability.ru>
+
+2002-06-28 17:01  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: small alpha update
+
+2002-06-28 15:27  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/big5.php: added 2 new entires to the big5
+	  translation Webbie <webbie at ipfw.org>
+
+2002-06-24 17:20  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/sv.php: Updated Swedish translation from Jonas Tull
+	  <jetthe at home.se>
+
+2002-06-18 01:41  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/ko.php: moving kr.php -> ko.php and updating the
+	  charset.  It appears that ko is the proper abreviation and there
+	  is a 'new' charset.
+
+2002-06-17 19:03  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/bg.php: Added Bulgarian translation from Kaloyan
+	  Naumov <loop at nme.com>
+
+2002-06-05 21:50  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, index.php: bumped version number to 2.2-cvs
+
+2002-06-05 21:16  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README (tags: REL-2-1): small formatting changes.  Added a known
+	  problems section.
+
+2002-06-05 21:12  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php (tags: REL-2-1): Changed memory
+	  reporting to include buffers and disk cache in 'used' memory.  I
+	  get too many emails from people who don't understand this concept
+	  and wonder why it's different from 'top' or 'free'.
+
+2002-06-01 06:48  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php (tags: REL-2-1): small cleanups..
+
+2002-06-01 06:34  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/common_functions.php (tags: REL-2-1),
+	  includes/os/class.Linux.inc.php: removed php3 compat functions,
+	  since XPath requires php4 so do we now, no use having the compat
+	  functions.
+
+2002-06-01 06:24  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: Had to move language outside the conditional, the os
+	  classes use them some places..
+
+2002-05-31 22:40  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: moved more stuff inside the XML conditional, we don't
+	  need templates or languages for XML
+
+2002-05-31 21:45  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, index.php, phpsysinfo.dtd (tags: REL-2-1),
+	  includes/system_header.php (tags: REL-2-1),
+	  includes/common_functions.php, includes/system_footer.php (tags:
+	  REL-2-1): Added some generation information that might be useful
+	  to the XML template Added a global $VERSION Added a small
+	  HTML/XML comment showing our URL
+
+2002-05-31 20:09  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_footer.php: added 'random' template
+	  support.  closes feature request #562164
+
+2002-05-31 19:40  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/common_functions.php, includes/system_footer.php,
+	  includes/os/class.NetBSD.inc.php (tags: REL-2-1),
+	  includes/os/class.Linux.inc.php,
+	  includes/os/class.BSD.common.inc.php (tags: REL-2-1),
+	  includes/os/class.Darwin.inc.php (tags: REL-2-1),
+	  includes/os/class.FreeBSD.inc.php (tags: REL-2-1),
+	  includes/os/class.OpenBSD.inc.php (tags: REL-2-1): Code Cleanups
+	  Remove network_connections() from class.Linux since we never used
+	  it
+
+2002-05-31 18:59  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/eu.php (tags: REL-2-1): adding the Basque Language
+	  (eu.php).  Andoni <andonisz at ibercom.com>
+
+2002-05-30 05:09  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, phpsysinfo.dtd: don't need the URL in the dtd link all
+	  the CPU information should be optional
+
+2002-05-30 05:03  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: email address updates
+
+2002-05-30 05:02  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: formatting cleanups
+
+2002-05-30 05:00  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: Removed INSTALL, merged any useful information into
+	  README
+
+2002-05-30 00:13  precision    Uriah Welcome (precision at users.sf.net)
+
+	* phpsysinfo.dtd: forgot we need mulitples for <device>
+
+2002-05-30 00:12  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/xml/network.php (tags: REL-2-1): <device> -> <NetDevice>
+
+2002-05-30 00:08  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: small cleanups
+
+2002-05-29 23:52  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: added DTD support, we can validate now..
+
+2002-05-29 23:45  precision    Uriah Welcome (precision at users.sf.net)
+
+	* phpsysinfo.dtd: adding XML DTD (We can Validate now!)
+
+2002-05-29 22:04  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: [no log message]
+
+2002-05-29 22:01  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: small fix for bogomips on sparc
+	  linux
+
+2002-05-28 18:49  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/XPath.class.php (tags: REL-2-1): updated xpath class
+
+2002-05-20 18:09  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/cs.php (tags: REL-2-1): updated translation
+
+2002-05-08 20:17  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: don't set a cookie if we're using the xml template..
+
+2002-05-03 18:58  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: store the template as a cookie
+
+2002-05-03 18:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/orange/: orange.css (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), box.tpl (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  form.tpl, images/redbar_middle.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), images/bar_middle.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), images/bar_right.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), images/redbar_right.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), images/trans.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), images/redbar_left.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1), images/bar_left.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1) (utags: REL-2-1): added the orange template
+
+2002-04-16 17:36  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: obsd memory updates
+
+2002-04-16 17:32  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/: lang/tr.php (tags: REL-2-1), os/class.Linux.inc.php:
+	  alpha cpu updates added turkish translation
+
+2002-04-12 17:19  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Linux.inc.php: better 2.2 alpha support
+
+2002-04-12 16:35  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/es.php (tags: REL-2-1): updated spanish translation
+
+2002-04-09 17:14  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/es.php: updates spanish translation
+
+2002-04-08 19:12  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/: system_header.php, lang/he.php (tags: REL-2-1): Hebrew
+	  language & text alignment
+
+2002-04-04 19:10  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.Darwin.inc.php: small regex to remove
+	  <classIOPCIDevice> since XPath doens't like it.
+
+2002-04-04 18:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/xml/filesystems.php (tags: REL-2-1): small fix for
+	  filesystem percentage..
+
+2002-04-04 17:56  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/hu.php (tags: REL-2-1): added .hu translation
+
+2002-04-02 19:22  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: don't display linux /procfs
+	  compat..
+
+2002-04-02 19:17  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/: class.NetBSD.inc.php, class.Darwin.inc.php: updated
+	  class files!
+
+2002-03-21 19:59  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/en.php (tags: REL-2-1): typo
+
+2002-03-05 22:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: patch for bsd ide
+
+2002-03-04 19:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.OpenBSD.inc.php: small cpu regexp fix
+
+2002-02-25 21:53  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: added xml encoding type and moved a if clause so not
+	  to produce a php error.
+
+2002-02-25 21:15  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php: added fix in format_bytesize() we
+	  shouldn't put &nbsp's into XML
+
+2002-02-25 19:59  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/: common_functions.php, xml/memory.php (tags: REL-2-1),
+	  xml/filesystems.php, xml/hardware.php (tags: REL-2-1),
+	  xml/network.php, xml/vitals.php (tags: REL-2-1): minor cleanups
+
+2002-02-25 19:47  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/XPath.class.php: removed the deprecated stuff since we
+	  don't use it
+
+2002-02-22 21:15  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/xml/hardware.php: oops forgot ide() needs $text;
+
+2002-02-22 21:12  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: [no log message]
+
+2002-02-22 21:05  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: type fix, fix ?template=xml
+
+2002-02-22 20:10  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/XPath.class.php, includes/xml/memory.php,
+	  includes/xml/filesystems.php, includes/xml/hardware.php,
+	  includes/xml/network.php, includes/xml/vitals.php: removed all
+	  the include/tables/*, added functionality into xml classes.
+
+2002-02-19 04:44  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/xml/memory.php, includes/xml/filesystems.php,
+	  includes/xml/hardware.php, includes/xml/network.php,
+	  includes/xml/vitals.php: changed the xml funtions to retunr the
+	  data instead of directly doing the template work.  I hope to
+	  remove the stuff in include/tables/* and just have the xml stuff
+	  w/ some small xml->html wrappers.
+
+2002-02-18 20:10  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/: common_functions.php, xml/network.php, xml/vitals.php:
+	  removed &nbsp's for xml and added a trim()
+
+2002-02-18 19:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: oops.. no images for XML
+
+2002-02-18 19:53  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/xml/memory.php, includes/xml/filesystems.php,
+	  includes/xml/hardware.php, includes/xml/network.php,
+	  includes/xml/vitals.php: Added initial XML implementation
+
+2002-02-18 05:50  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_footer.php: changed version to 2.1-cvs
+
+2002-02-07 06:32  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README (tags: REL-2-0): foo
+
+2002-02-04 01:27  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php (tags: REL-2-0): uniq the
+	  pci, ide, and scsi arrays
+
+2002-01-17 00:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/metal/images/: redbar_middle.gif, redbar_right.gif,
+	  redbar_left.gif (utags: REL-2-0, REL-2-1, REL-2-2, REL-2-2-RC1,
+	  REL-2-3): cosmetic cleanups from webbie (webbie at ipfw dot org)
+
+2002-01-15 09:00  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: more fbsd memory fixes
+
+2002-01-15 08:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.BSD.common.inc.php: [no log message]
+
+2002-01-14 03:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.OpenBSD.inc.php (tags: REL-2-0): only show
+	  network interfaces that have recieved packets
+
+2002-01-14 03:51  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/os/class.FreeBSD.inc.php (tags: REL-2-0): quick hack to
+	  only show interfaces that have sent packets
+
+2002-01-11 01:25  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/it.php (tags: REL-2-1, REL-2-0): updated it.php
+
+2002-01-09 21:44  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php (tags: REL-2-0): added iso9660
+	  patch
+
+2002-01-09 21:37  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/: system_header.php, class.Template.inc.php (tags:
+	  REL-2-1) (utags: REL-2-0): HTML cleanups forgot a couple
+	  $f_body_close's which was causing invalid HTML
+
+2002-01-04 17:42  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/: aq/aq.css (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  metal/metal.css (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  blue/blue.css (tags: REL-2-3, REL-2-2, REL-2-2-RC1),
+	  classic/classic.css (utags: REL-2-0, REL-2-1): more CSS fixes
+	  from Webbie
+
+2002-01-01 00:24  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php (tags: REL-2-0): moved table includes into their own
+	  directory
+
+2002-01-01 00:12  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: added the font tags properly.. since I removed
+	  color_scheme
+
+2001-12-31 23:59  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: removed color_scheme.php
+
+2001-12-31 23:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/os/class.NetBSD.inc.php (tags: REL-2-0),
+	  includes/os/class.Linux.inc.php (tags: REL-2-0),
+	  includes/os/class.BSD.common.inc.php,
+	  includes/os/class.Darwin.inc.php (tags: REL-2-0),
+	  includes/os/class.FreeBSD.inc.php,
+	  includes/os/class.OpenBSD.inc.php: moved all the os based
+	  includes into include/os/
+
+2001-12-31 23:47  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php, templates/aq/aq.css,
+	  templates/black/black.css (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0), templates/black/form.tpl (tags: REL-2-1,
+	  REL-2-0), templates/aq/form.tpl (tags: REL-2-1, REL-2-0),
+	  templates/metal/metal.css, templates/metal/form.tpl (tags:
+	  REL-2-1, REL-2-0), templates/blue/blue.css,
+	  templates/blue/box.tpl (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0), templates/classic/box.tpl (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0),
+	  templates/classic/form.tpl (tags: REL-2-1, REL-2-0),
+	  templates/classic/classic.css: Added CSS patch from Webbie
+
+2001-12-29 08:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/id.php (tags: REL-2-1, REL-2-0): updated id.php
+
+2001-12-17 18:22  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: added small patch from webbie (webbie at ipfw dot org)
+
+2001-12-14 04:34  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_header.php, templates/black/black.css: default
+	  css stuff
+
+2001-12-13 21:16  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/ca.php (tags: REL-2-1, REL-2-0): added ca language
+
+2001-12-09 09:18  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: added note about freebsd removing /var/run/dmesg.boot.
+	  Clean'd up a little
+
+2001-11-23 06:26  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/common_functions.php: white space removal, cleanups
+
+2001-11-13 17:48  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/sk.php (tags: REL-2-1, REL-2-0): updated slovak
+	  translation (stenzel <stenzel at inmail.sk>)
+
+2001-11-13 01:16  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: notes updates about bsd.
+
+2001-11-12 22:31  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: tabs -> spaces cleansup
+
+2001-11-12 22:31  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php: tabs -> spaces cleanups
+
+2001-11-12 20:32  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/sk.php: added slovak translation..
+
+2001-11-11 06:58  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, includes/system_footer.php (tags: REL-2-0): tag'd rel-1-9
+	  updated for the 2.0 devel cycle
+
+2001-11-07 19:15  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/sv.php (tags: REL-2-1, REL-2-0, rel-1-9): se.php ->
+	  sv.php
+
+2001-11-07 17:56  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php (tags: rel-1-9): fix bug w/ templates when
+	  register_globals is off
+
+2001-11-05 22:44  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/id.php (tags: rel-1-9): added Indonesian
+	  translation
+
+2001-10-25 19:59  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/ct.php (tags: REL-2-1, REL-2-0, rel-1-9): added
+	  catalan tranlstion updated swedish translation
+
+2001-10-07 19:05  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: formatting
+
+2001-10-07 08:21  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php (tags: rel-1-9): comment about pipe
+	  checking..
+
+2001-10-07 08:18  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php: pipe away execute_program()
+
+2001-10-07 07:57  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php: seperated execute_program() into 2
+	  functions..  find_program() and execute_program() now just to add
+	  pipe checking and path checking..
+
+2001-10-07 07:42  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_footer.php (tags: rel-1-9): oops
+
+2001-10-07 07:42  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README (tags: rel-1-9), includes/system_footer.php: updating
+	  version number to 1.9
+
+2001-10-07 07:41  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: very minor cleanup consistancy
+
+2001-10-07 07:24  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php: adding freebsd patch from webbie (webbie at ipfw dot org)
+	  code formats and cleanups changed from ``'s to execute_program()
+
+2001-10-07 06:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/: black/box.tpl, aq/box.tpl, metal/box.tpl (utags:
+	  REL-2-0, REL-2-1, rel-1-9): adding 'alt' tags
+
+2001-10-07 06:47  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php: removed / nothing special..
+
+2001-09-19 18:01  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/big5.php (tags: REL-2-1, REL-2-0, rel-1-9): adding
+	  big5 translation
+
+2001-09-17 17:56  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: added browser language detection
+
+2001-09-17 17:49  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/black/: box.tpl, form.tpl (tags: rel-1-9),
+	  images/redbar_middle.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/d.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9), images/inf.gif (tags:
+	  REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/g.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1,
+	  REL-2-0, rel-1-9), images/bar_middle.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9), images/aq_background.gif
+	  (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/bar_right.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/redbar_right.gif (tags:
+	  REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/coininfd.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/coinsupd.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/redbar_left.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/coininfg.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/coinsupg.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/bar_left.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9), images/sup.gif
+	  (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/space15_15.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/fond.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9): adding black
+	  template
+
+2001-09-13 00:24  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/br.php (tags: REL-2-1, REL-2-0, rel-1-9): updaing
+	  br translation
+
+2001-09-04 17:20  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/pl.php (tags: REL-2-1, REL-2-0, rel-1-9): added
+	  polish translation
+
+2001-08-20 17:26  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/tw.php (tags: REL-2-1, REL-2-0, rel-1-9): added
+	  Traditional-Chinese translation..
+
+2001-08-20 17:22  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/metal/: box.tpl, form.tpl (tags: rel-1-9),
+	  images/redbar_middle.gif (tags: rel-1-9), images/d.gif (tags:
+	  REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/inf.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1,
+	  REL-2-0, rel-1-9), images/g.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9), images/bar_middle.gif
+	  (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/bar_right.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/redbar_right.gif (tags:
+	  rel-1-9), images/coininfd.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/metal_background.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/coinsupd.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/redbar_left.gif (tags: rel-1-9), images/coininfg.gif
+	  (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/coinsupg.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/bar_left.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9), images/sup.gif
+	  (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  images/space15_15.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0, rel-1-9), images/fond.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9): adding metal
+	  theme..
+
+2001-08-09 22:28  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/nl.php (tags: REL-2-1, REL-2-0, rel-1-9): updated
+	  Dutch translation (Vincent van Adrighem <vincent at
+	  dirck.mine.nu>)
+
+2001-08-06 18:50  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/de.php (tags: REL-2-1, REL-2-0, rel-1-9): updated
+	  de.php patch # 447446
+
+2001-08-03 18:45  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/common_functions.php: more formatting..
+
+2001-08-03 18:41  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: fixing jengo's formatting
+
+2001-08-02 23:16  jengo    Joseph Engo (jengo at users.sf.net)
+
+	* includes/common_functions.php: I forgot to add this file in
+	  durring my initial commit
+
+2001-08-02 23:15  jengo    Joseph Engo (jengo at users.sf.net)
+
+	* index.php: Changed some code format
+
+2001-08-02 22:41  jengo    Joseph Engo (jengo at users.sf.net)
+
+	* index.php, templates/classic/images/redbar_middle.gif (tags:
+	  REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/classic/images/bar_middle.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/classic/images/bar_right.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/classic/images/redbar_right.gif (tags: REL-2-3,
+	  REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/classic/images/redbar_left.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/classic/images/bar_left.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9): - Started working on
+	  abstracting the system functions to support multiable OS's -
+	  Added code to detect to size of the bar graph image so it looks
+	  nice - Started added sections to allow easy installation under
+	  phpGroupWare
+
+2001-07-05 23:09  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: added fix incase register_globals is off
+
+2001-07-05 23:01  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php (tags: rel-1-9): added
+	  timestamp to the <TITLE></TITLE>
+
+2001-07-05 22:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/: ro.php (tags: REL-2-1, REL-2-0, rel-1-9), nl.php:
+	  updated ro and nl tranlations removed display of filesystems that
+	  are mounted with '-o bind'
+
+2001-06-29 21:03  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: oops.. shouldn't have commited this quite yet
+
+2001-06-29 20:57  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/fi.php (tags: REL-2-1, REL-2-0, rel-1-9): added
+	  finnish language
+
+2001-06-29 17:14  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/is.php (tags: REL-2-1, REL-2-0, rel-1-9): added
+	  is.php
+
+2001-06-25 12:35  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/ro.php: added 2 translations..
+
+2001-06-02 03:35  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/et.php (tags: REL-2-1, REL-2-0, rel-1-9): updated
+	  et translation
+
+2001-06-02 03:33  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: added format_bytesize() call to capacity..
+
+2001-05-31 17:23  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_footer.php: fixing sf bug # 428980
+
+2001-05-31 17:15  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/lang/da.php (tags: REL-2-1, REL-2-0,
+	  rel-1-9), includes/lang/nl.php, includes/lang/fr.php (tags:
+	  REL-2-1, REL-2-0, rel-1-9), includes/lang/en.php (tags: REL-2-0,
+	  rel-1-9): translation updates
+
+2001-05-31 04:43  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, index.php, includes/system_footer.php: small cleanup and
+	  imcremented the version to 1.8.
+
+2001-05-30 18:29  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_footer.php: oops.. michael's patch reverted the
+	  version
+
+2001-05-30 18:27  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: oops.. forgot a $lang->$lng conversion
+
+2001-05-30 18:22  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/system_footer.php, includes/lang/de.php,
+	  includes/lang/lt.php (tags: REL-2-1, REL-2-0, rel-1-9),
+	  includes/lang/br.php, includes/lang/it.php (tags: rel-1-9),
+	  includes/lang/da.php, includes/lang/cs.php (tags: REL-2-0,
+	  rel-1-9), includes/lang/et.php, includes/lang/nl.php,
+	  includes/lang/fr.php, includes/lang/no.php (tags: REL-2-1,
+	  REL-2-0, rel-1-9), includes/lang/es.php (tags: REL-2-0, rel-1-9),
+	  includes/lang/en.php: added patches from Michal Cihar
+
+2001-05-30 18:07  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/classic/form.tpl (tags: rel-1-9): added a <br>
+
+2001-05-30 18:07  precision    Uriah Welcome (precision at users.sf.net)
+
+	* templates/blue/: box.tpl, form.tpl (tags: REL-2-1, REL-2-0),
+	  images/redbar_middle.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0), images/bar_middle.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0), images/bar_right.gif (tags:
+	  REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0),
+	  images/redbar_right.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0), images/trans.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0), images/redbar_left.gif (tags:
+	  REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1, REL-2-0),
+	  images/bar_left.gif (tags: REL-2-3, REL-2-2, REL-2-2-RC1,
+	  REL-2-1, REL-2-0) (utags: rel-1-9): adding the 'blue' template
+	  (Michal Cihar <cihar@email.cz>)
+
+2001-05-29 22:08  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, includes/system_footer.php: incremented version to 1.7
+
+2001-05-29 22:03  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_header.php: added css code
+
+2001-05-29 21:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/no.php: updated no.php
+
+2001-05-29 01:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_footer.php, templates/classic/box.tpl (tags:
+	  rel-1-9), templates/classic/form.tpl: HTML fixes.  classic
+	  template is now HTML 4.01 compliant and passes the validator
+
+2001-05-29 01:31  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_footer.php: formatting & cleanups
+
+2001-05-29 01:08  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: cleanups
+
+2001-05-29 00:55  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php: more cleanups, removed extra color_scheme includes..
+
+2001-05-29 00:51  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/system_footer.php: code formatting, changed tabs to
+	  spaces include()'s to require_once()'s
+
+2001-05-28 10:31  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: added note about language selector
+
+2001-05-28 10:20  precision    Uriah Welcome (precision at users.sf.net)
+
+	* index.php, includes/system_header.php,
+	  includes/system_footer.php: added language selector
+
+2001-05-28 07:43  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_footer.php: formatting
+
+2001-05-28 07:42  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, index.php, includes/system_footer.php: incremented
+	  version to 1.6, added template changer form (me & Jesse
+	  jesse@krylotek.com), misc code cleanups (me)
+
+2001-05-27 23:28  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/br.php, templates/aq/images/bar_middle.gif (tags:
+	  REL-2-1, REL-2-0, rel-1-9), templates/aq/images/bar_right.gif
+	  (tags: REL-2-1, REL-2-0, rel-1-9),
+	  templates/aq/images/bar_left.gif (tags: REL-2-1, REL-2-0,
+	  rel-1-9): added blue bars for aq, added brazilian translation
+
+2001-05-24 21:21  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_header.php: added HTML core validation
+
+2001-05-21 23:34  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/lang/: da.php, nl.php: added new translations
+
+2001-05-18 21:03  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: final notes before packaging..
+
+2001-05-18 20:57  precision    Uriah Welcome (precision at users.sf.net)
+
+	* includes/system_footer.php: changed version to 1.5
+
+2001-05-18 20:54  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README: fixed my email address and changed the warning threshhold
+	  on the bar graphs to 90%
+
+2001-05-18 20:46  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, COPYING, index.php, includes/system_header.php,
+	  includes/system_footer.php, includes/class.Template.inc.php,
+	  includes/lang/de.php, includes/lang/lt.php, includes/lang/it.php,
+	  includes/lang/da.php, includes/lang/et.php, includes/lang/fr.php,
+	  includes/lang/no.php, includes/lang/es.php, includes/lang/en.php,
+	  templates/aq/box.tpl, templates/aq/form.tpl,
+	  templates/aq/images/redbar_middle.gif, templates/aq/images/d.gif,
+	  templates/aq/images/inf.gif, templates/aq/images/g.gif,
+	  templates/aq/images/bar_middle.gif,
+	  templates/aq/images/aq_background.gif,
+	  templates/aq/images/bar_right.gif,
+	  templates/aq/images/redbar_right.gif,
+	  templates/aq/images/coininfd.gif,
+	  templates/aq/images/coinsupd.gif,
+	  templates/aq/images/redbar_left.gif,
+	  templates/aq/images/coininfg.gif,
+	  templates/aq/images/coinsupg.gif,
+	  templates/aq/images/bar_left.gif, templates/aq/images/sup.gif,
+	  templates/aq/images/space15_15.gif, templates/aq/images/fond.gif,
+	  templates/classic/box.tpl, templates/classic/form.tpl,
+	  templates/classic/images/redbar_middle.gif,
+	  templates/classic/images/bar_middle.gif,
+	  templates/classic/images/bar_right.gif,
+	  templates/classic/images/redbar_right.gif,
+	  templates/classic/images/trans.gif,
+	  templates/classic/images/redbar_left.gif,
+	  templates/classic/images/bar_left.gif: Initial revision
+
+2001-05-18 20:46  precision    Uriah Welcome (precision at users.sf.net)
+
+	* README, COPYING (tags: REL-2-3, REL-2-2, REL-2-2-RC1, REL-2-1,
+	  REL-2-0, rel-1-9), index.php, includes/system_header.php,
+	  includes/system_footer.php, includes/class.Template.inc.php
+	  (tags: rel-1-9), includes/lang/de.php, includes/lang/lt.php,
+	  includes/lang/it.php, includes/lang/da.php, includes/lang/et.php,
+	  includes/lang/fr.php, includes/lang/no.php, includes/lang/es.php,
+	  includes/lang/en.php, templates/aq/box.tpl, templates/aq/form.tpl
+	  (tags: rel-1-9), templates/aq/images/redbar_middle.gif (tags:
+	  REL-2-1, REL-2-0, rel-1-9), templates/aq/images/d.gif (tags:
+	  REL-2-1, REL-2-0, rel-1-9), templates/aq/images/inf.gif (tags:
+	  REL-2-1, REL-2-0, rel-1-9), templates/aq/images/g.gif (tags:
+	  REL-2-1, REL-2-0, rel-1-9), templates/aq/images/bar_middle.gif,
+	  templates/aq/images/aq_background.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/aq/images/bar_right.gif,
+	  templates/aq/images/redbar_right.gif (tags: REL-2-1, REL-2-0,
+	  rel-1-9), templates/aq/images/coininfd.gif (tags: REL-2-1,
+	  REL-2-0, rel-1-9), templates/aq/images/coinsupd.gif (tags:
+	  REL-2-1, REL-2-0, rel-1-9), templates/aq/images/redbar_left.gif
+	  (tags: REL-2-1, REL-2-0, rel-1-9),
+	  templates/aq/images/coininfg.gif (tags: REL-2-1, REL-2-0,
+	  rel-1-9), templates/aq/images/coinsupg.gif (tags: REL-2-1,
+	  REL-2-0, rel-1-9), templates/aq/images/bar_left.gif,
+	  templates/aq/images/sup.gif (tags: REL-2-1, REL-2-0, rel-1-9),
+	  templates/aq/images/space15_15.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/aq/images/fond.gif (tags: REL-2-1, REL-2-0, rel-1-9),
+	  templates/classic/box.tpl, templates/classic/form.tpl,
+	  templates/classic/images/redbar_middle.gif,
+	  templates/classic/images/bar_middle.gif,
+	  templates/classic/images/bar_right.gif,
+	  templates/classic/images/redbar_right.gif,
+	  templates/classic/images/trans.gif (tags: REL-2-3, REL-2-2,
+	  REL-2-2-RC1, REL-2-1, REL-2-0, rel-1-9),
+	  templates/classic/images/redbar_left.gif,
+	  templates/classic/images/bar_left.gif (utags: start): initial
+	  checkin of 1.3 code
+
diff --git a/www/include/options/sysInfos/images/Cobalt.png b/www/include/options/sysInfos/images/Cobalt.png
new file mode 100644
index 0000000000000000000000000000000000000000..b992ed245f696188898ecdc464329644cf14947a
Binary files /dev/null and b/www/include/options/sysInfos/images/Cobalt.png differ
diff --git a/www/include/options/sysInfos/images/Darwin.png b/www/include/options/sysInfos/images/Darwin.png
new file mode 100644
index 0000000000000000000000000000000000000000..a4d8d2de7f3240d0247657bdb51b0e88dd021fe0
Binary files /dev/null and b/www/include/options/sysInfos/images/Darwin.png differ
diff --git a/www/include/options/sysInfos/images/Debian.png b/www/include/options/sysInfos/images/Debian.png
new file mode 100644
index 0000000000000000000000000000000000000000..03ae20207591fdda1bb2cf88ee6c98d99110c687
Binary files /dev/null and b/www/include/options/sysInfos/images/Debian.png differ
diff --git a/www/include/options/sysInfos/images/Fedora.png b/www/include/options/sysInfos/images/Fedora.png
new file mode 100644
index 0000000000000000000000000000000000000000..b0aa8d094cb4596b5505ca563435a244126aa721
Binary files /dev/null and b/www/include/options/sysInfos/images/Fedora.png differ
diff --git a/www/include/options/sysInfos/images/FreeBSD.png b/www/include/options/sysInfos/images/FreeBSD.png
new file mode 100644
index 0000000000000000000000000000000000000000..4c271fc542426d1e2adeba61e48b7e4c4e1b4437
Binary files /dev/null and b/www/include/options/sysInfos/images/FreeBSD.png differ
diff --git a/www/include/options/sysInfos/images/Gentoo.png b/www/include/options/sysInfos/images/Gentoo.png
new file mode 100644
index 0000000000000000000000000000000000000000..9b0163055a77cf3833cf6e81d5f0e0a792592dc3
Binary files /dev/null and b/www/include/options/sysInfos/images/Gentoo.png differ
diff --git a/www/include/options/sysInfos/images/Mandrake.png b/www/include/options/sysInfos/images/Mandrake.png
new file mode 100644
index 0000000000000000000000000000000000000000..09ccd20aaefeaec1f47f83a9360f3afbf5388e39
Binary files /dev/null and b/www/include/options/sysInfos/images/Mandrake.png differ
diff --git a/www/include/options/sysInfos/images/NetBSD.png b/www/include/options/sysInfos/images/NetBSD.png
new file mode 100644
index 0000000000000000000000000000000000000000..306ce773048509f14d43e5d5e2f8fd5b7cde01ba
Binary files /dev/null and b/www/include/options/sysInfos/images/NetBSD.png differ
diff --git a/www/include/options/sysInfos/images/OpenBSD.png b/www/include/options/sysInfos/images/OpenBSD.png
new file mode 100644
index 0000000000000000000000000000000000000000..84da5c780893263cea9c89be0fd46449f6601ec1
Binary files /dev/null and b/www/include/options/sysInfos/images/OpenBSD.png differ
diff --git a/www/include/options/sysInfos/images/README b/www/include/options/sysInfos/images/README
new file mode 100644
index 0000000000000000000000000000000000000000..bd954c93b17728a75aab63e82c85a29db6d02463
--- /dev/null
+++ b/www/include/options/sysInfos/images/README
@@ -0,0 +1,87 @@
+
+phpSysInfo 2.5.1 - http://phpsysinfo.sourceforge.net/
+
+Copyright (c), 1999-2002, Uriah Welcome (precision@users.sf.net)
+Copyright (c), 1999-2001, Matthew Snelham (infinite@users.sf.net)
+
+
+CURRENT TESTED PLATFORMS
+------------------------
+  - Linux 2.2+
+  - FreeBSD 4.x
+  - OpenBSD 2.8+
+  - NetBSD
+  - Darwin/OSX
+  - WinNT
+  - PHP 4.x and 5.x
+
+  If your platform is not here try checking out the mailing list archives or
+  the message boards on SourceForge.
+
+
+INSTALLATION AND CONFIGURATION
+------------------------------
+  Just decompress and untar the source (which you should have done by now,
+  if you're reading this...), into your webserver's document root.
+
+  There is a configuration file called config.php.new. If this a brand 
+  new installation, you should copy this file to config.php and edit it.
+
+  - make sure your 'php.ini' file's include_path entry contains "."
+  - make sure your 'php.ini' has safe_mode set to 'off'.
+
+  Please keep in the mind that because phpSysInfo requires access to many
+  files in /proc and other system binary you **MUST DISABLE** php's
+  safe_mode.  Please see the PHP documentation for information on how you
+  can do this.
+
+  That's it.  Restart your webserver (if you changed php.ini), and viola!
+
+
+KNOWN PROBLEMS
+--------------
+  - phpSysInfo is not full compatible with SELinux Systems
+  - small bug under FreeBSD with memory reporting
+  - XML will not work properly/validate under anything except Linux and
+    Net/FreeBSD The "This is Under Development" warning gets printed and
+	isn't valid in XML.
+
+
+PLATFORM SPECIFIC ISSUES
+------------------------
+  - FreeBSD
+    There is currently a bug in FreeBSD that if you boot your system up and
+	drop to single user mode and then again back to multiuser the system
+	removes /var/run/dmesg.boot.  This will cause phpsysinfo to fail.  A bug
+	has already been reported to the FreeBSD team.  (PS, this may exist in
+	other *BSDs also)
+
+
+WHAT TO DO IF IT DOESN'T WORK
+-----------------------------
+  First make sure you've read this file completely, especially the
+  "INSTALLATION AND CONFIGURATION" section.  If it still doesn't work then
+  you can:
+  
+  Submit a bug on SourceForge. (preferred)
+     (http://sourceforge.net/projects/phpsysinfo/)
+
+
+OTHER NOTES
+-----------
+  If you have an great ideas or wanna help out, just drop by the project
+  page at SourceForge (http://sourceforge.net/projects/phpsysinfo/)
+
+  The "Unauthorized reading files on phpSysInfo" reported by
+  Albert Puigsech Galicia <ripe@7a69ezine.org> and Wolter Kamphuis 
+  <security@wkamphuis.student.utwente.nl> is fixed in version 2.2.
+  http://www.securityfocus.com/archive/1/319713
+  
+
+LICENSING
+---------
+  This program and all associated files are released under the GNU Public
+  License, see COPYING for details.
+
+
+$Id: README,v 1.27 2005/12/15 08:35:00 bigmichi1 Exp $
diff --git a/www/include/options/sysInfos/images/Redhat.png b/www/include/options/sysInfos/images/Redhat.png
new file mode 100644
index 0000000000000000000000000000000000000000..6dc749715e3d26fd61c8aab382dd89ca3e052ce2
Binary files /dev/null and b/www/include/options/sysInfos/images/Redhat.png differ
diff --git a/www/include/options/sysInfos/images/Rubix.png b/www/include/options/sysInfos/images/Rubix.png
new file mode 100644
index 0000000000000000000000000000000000000000..50cbcbf96cc818af88a8aabe879087e394771062
Binary files /dev/null and b/www/include/options/sysInfos/images/Rubix.png differ
diff --git a/www/include/options/sysInfos/images/Slackware.png b/www/include/options/sysInfos/images/Slackware.png
new file mode 100644
index 0000000000000000000000000000000000000000..dd94b52730cbfb4fecd42e7e8fdb08f55c3ae09c
Binary files /dev/null and b/www/include/options/sysInfos/images/Slackware.png differ
diff --git a/www/include/options/sysInfos/images/Suse.png b/www/include/options/sysInfos/images/Suse.png
new file mode 100644
index 0000000000000000000000000000000000000000..6baf76def1ab88ba70c207b7e6b27fa5886b19bb
Binary files /dev/null and b/www/include/options/sysInfos/images/Suse.png differ
diff --git a/www/include/options/sysInfos/images/Trustix.gif b/www/include/options/sysInfos/images/Trustix.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6cdc3efdb42b82017539ea4ec452031f753133cb
Binary files /dev/null and b/www/include/options/sysInfos/images/Trustix.gif differ
diff --git a/www/include/options/sysInfos/images/config.php b/www/include/options/sysInfos/images/config.php
new file mode 100644
index 0000000000000000000000000000000000000000..1e4baebb471a9e61b579c373ed4943fa7efec568
--- /dev/null
+++ b/www/include/options/sysInfos/images/config.php
@@ -0,0 +1,82 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: config.php.new,v 1.15 2005/11/30 05:14:49 bigmichi1 Exp $
+
+// if $webpath set to an value it will be possible to include phpsysinfo with a simple include() statement in other scripts
+// but the structure in the phpsysinfo directory can't be changed
+// $webpath specifies the absolute path when you browse to the phpsysinfo page
+// e.g.: your domain  www.yourdomain.com
+//       you put the phpsysinfo directory at /phpsysinfo in the webroot
+//       then normally you browse there with www.yourdomain.com/phpsysinfo
+//       now you want to include the index.php from phpsysinfo in a script, locatet at /
+//       then you need to set $webpath to /phpsysinfo/
+// if you put the phpsysinfo folder at /tools/phpsysinfo $webpath will be /tools/phpsysinfo/
+// you don't need to change it, if you don't include it in other pages
+// so default will be fine for everyone
+$webpath = "";
+
+// define the default lng and template here
+$default_lng='en';
+$default_template='classic';
+
+// hide language and template picklist
+// false = display picklist
+// true = do not display picklist
+$hide_picklist = false;
+
+// define the motherboard monitoring program here
+// we support four programs so far
+// 1. lmsensors  http://www2.lm-sensors.nu/~lm78/
+// 2. healthd    http://healthd.thehousleys.net/
+// 3. hwsensors  http://www.openbsd.org/
+// 4. mbmon      http://www.nt.phys.kyushu-u.ac.jp/shimizu/download/download.html
+// 5. mbm5       http://mbm.livewiredev.com/
+
+// $sensor_program = "lmsensors";
+// $sensor_program = "healthd";
+// $sensor_program = "hwsensors";
+// $sensor_program = "mbmon";
+// $sensor_program = "mbm5";
+$sensor_program = "";
+
+// show mount point
+// true = show mount point
+// false = do not show mount point
+$show_mount_point = true;
+
+// show bind
+// true = display filesystems mounted with the bind options under Linux
+// false = hide them
+$show_bind = false;
+
+// Hide mount(s). Example:
+// $hide_mounts[] = '/home';
+
+// if the hddtemp program is available we can read the temperature, if hdd is smart capable
+// !!ATTENTION!! hddtemp might be a security issue
+// $hddtemp_avail = "tcp";	// read data from hddtemp deamon (localhost:7634)
+// $hddtemp_avail = "suid";     // read data from hddtemp programm (must be set suid)
+
+// show a graph for current cpuload
+// true = displayed, but it's a performance hit (because we have to wait to get a value, 1 second)
+// false = will not be displayed
+$loadbar = false;
+
+?>
diff --git a/www/include/options/sysInfos/images/distros.ini b/www/include/options/sysInfos/images/distros.ini
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/free-eos.png b/www/include/options/sysInfos/images/free-eos.png
new file mode 100644
index 0000000000000000000000000000000000000000..ade5c03a3c45c3dd9d656db9de33cd706e7f4878
Binary files /dev/null and b/www/include/options/sysInfos/images/free-eos.png differ
diff --git a/www/include/options/sysInfos/images/images/Arch.gif b/www/include/options/sysInfos/images/images/Arch.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a643b2da666d932639f041d43475135490d82f74
Binary files /dev/null and b/www/include/options/sysInfos/images/images/Arch.gif differ
diff --git a/www/include/options/sysInfos/images/images/Cobalt.png b/www/include/options/sysInfos/images/images/Cobalt.png
new file mode 100644
index 0000000000000000000000000000000000000000..b992ed245f696188898ecdc464329644cf14947a
Binary files /dev/null and b/www/include/options/sysInfos/images/images/Cobalt.png differ
diff --git a/www/include/options/sysInfos/images/images/Darwin.png b/www/include/options/sysInfos/images/images/Darwin.png
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/images/Debian.png b/www/include/options/sysInfos/images/images/Debian.png
new file mode 100644
index 0000000000000000000000000000000000000000..03ae20207591fdda1bb2cf88ee6c98d99110c687
Binary files /dev/null and b/www/include/options/sysInfos/images/images/Debian.png differ
diff --git a/www/include/options/sysInfos/images/images/Fedora.png b/www/include/options/sysInfos/images/images/Fedora.png
new file mode 100644
index 0000000000000000000000000000000000000000..b0aa8d094cb4596b5505ca563435a244126aa721
Binary files /dev/null and b/www/include/options/sysInfos/images/images/Fedora.png differ
diff --git a/www/include/options/sysInfos/images/images/FreeBSD.png b/www/include/options/sysInfos/images/images/FreeBSD.png
new file mode 100644
index 0000000000000000000000000000000000000000..4c271fc542426d1e2adeba61e48b7e4c4e1b4437
Binary files /dev/null and b/www/include/options/sysInfos/images/images/FreeBSD.png differ
diff --git a/www/include/options/sysInfos/images/images/Gentoo.png b/www/include/options/sysInfos/images/images/Gentoo.png
new file mode 100644
index 0000000000000000000000000000000000000000..9b0163055a77cf3833cf6e81d5f0e0a792592dc3
Binary files /dev/null and b/www/include/options/sysInfos/images/images/Gentoo.png differ
diff --git a/www/include/options/sysInfos/images/images/Mandrake.png b/www/include/options/sysInfos/images/images/Mandrake.png
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/images/NetBSD.png b/www/include/options/sysInfos/images/images/NetBSD.png
new file mode 100644
index 0000000000000000000000000000000000000000..306ce773048509f14d43e5d5e2f8fd5b7cde01ba
Binary files /dev/null and b/www/include/options/sysInfos/images/images/NetBSD.png differ
diff --git a/www/include/options/sysInfos/images/images/OpenBSD.png b/www/include/options/sysInfos/images/images/OpenBSD.png
new file mode 100644
index 0000000000000000000000000000000000000000..84da5c780893263cea9c89be0fd46449f6601ec1
Binary files /dev/null and b/www/include/options/sysInfos/images/images/OpenBSD.png differ
diff --git a/www/include/options/sysInfos/images/images/Redhat.png b/www/include/options/sysInfos/images/images/Redhat.png
new file mode 100644
index 0000000000000000000000000000000000000000..6dc749715e3d26fd61c8aab382dd89ca3e052ce2
Binary files /dev/null and b/www/include/options/sysInfos/images/images/Redhat.png differ
diff --git a/www/include/options/sysInfos/images/images/Rubix.png b/www/include/options/sysInfos/images/images/Rubix.png
new file mode 100644
index 0000000000000000000000000000000000000000..50cbcbf96cc818af88a8aabe879087e394771062
Binary files /dev/null and b/www/include/options/sysInfos/images/images/Rubix.png differ
diff --git a/www/include/options/sysInfos/images/images/Slackware.png b/www/include/options/sysInfos/images/images/Slackware.png
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/images/Suse.png b/www/include/options/sysInfos/images/images/Suse.png
new file mode 100644
index 0000000000000000000000000000000000000000..6baf76def1ab88ba70c207b7e6b27fa5886b19bb
Binary files /dev/null and b/www/include/options/sysInfos/images/images/Suse.png differ
diff --git a/www/include/options/sysInfos/images/images/Trustix.gif b/www/include/options/sysInfos/images/images/Trustix.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6cdc3efdb42b82017539ea4ec452031f753133cb
Binary files /dev/null and b/www/include/options/sysInfos/images/images/Trustix.gif differ
diff --git a/www/include/options/sysInfos/images/images/free-eos.png b/www/include/options/sysInfos/images/images/free-eos.png
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/images/index.html b/www/include/options/sysInfos/images/images/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/images/lfs.png b/www/include/options/sysInfos/images/images/lfs.png
new file mode 100644
index 0000000000000000000000000000000000000000..e59446004b2bd042170f4dbd202934659490bdd4
Binary files /dev/null and b/www/include/options/sysInfos/images/images/lfs.png differ
diff --git a/www/include/options/sysInfos/images/images/unknown.png b/www/include/options/sysInfos/images/images/unknown.png
new file mode 100644
index 0000000000000000000000000000000000000000..54dc5b47bc2336a06fc29f88cb85a170b39fb615
Binary files /dev/null and b/www/include/options/sysInfos/images/images/unknown.png differ
diff --git a/www/include/options/sysInfos/images/images/xp.gif b/www/include/options/sysInfos/images/images/xp.gif
new file mode 100644
index 0000000000000000000000000000000000000000..bd97897d24f569160155da6f04e555d53587a654
Binary files /dev/null and b/www/include/options/sysInfos/images/images/xp.gif differ
diff --git a/www/include/options/sysInfos/images/includes/XPath.class.php b/www/include/options/sysInfos/images/includes/XPath.class.php
new file mode 100644
index 0000000000000000000000000000000000000000..ec44a99e211f02a09325fea313e5757b615cc3ee
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/XPath.class.php
@@ -0,0 +1,6355 @@
+<?php
+/**
+ * Php.XPath
+ *
+ * +======================================================================================================+
+ * | A php class for searching an XML document using XPath, and making modifications using a DOM 
+ * | style API. Does not require the DOM XML PHP library. 
+ * |
+ * +======================================================================================================+
+ * | What Is XPath:
+ * | --------------
+ * | - "What SQL is for a relational database, XPath is for an XML document." -- Sam Blum
+ * | - "The primary purpose of XPath is to address parts of an XML document. In support of this 
+ * |    primary purpose, it also provides basic facilities for manipulting it." -- W3C
+ * | 
+ * | XPath in action and a very nice intro is under:
+ * |    http://www.zvon.org/xxl/XPathTutorial/General/examples.html
+ * | Specs Can be found under:
+ * |    http://www.w3.org/TR/xpath     W3C XPath Recommendation 
+ * |    http://www.w3.org/TR/xpath20   W3C XPath Recommendation 
+ * |
+ * | NOTE: Most of the XPath-spec has been realized, but not all. Usually this should not be
+ * |       problem as the missing part is either rarely used or it's simpler to do with PHP itself.
+ * +------------------------------------------------------------------------------------------------------+
+ * | Requires PHP version  4.0.5 and up
+ * +------------------------------------------------------------------------------------------------------+
+ * | Main Active Authors:
+ * | --------------------
+ * | Nigel Swinson <nigelswinson@users.sourceforge.net>
+ * |   Started around 2001-07, saved phpxml from near death and renamed to Php.XPath
+ * |   Restructured XPath code to stay in line with XPath spec.
+ * | Sam Blum <bs_php@infeer.com>
+ * |   Started around 2001-09 1st major restruct (V2.0) and testbench initiator.   
+ * |   2nd (V3.0) major rewrite in 2002-02
+ * | Daniel Allen <bigredlinux@yahoo.com>
+ * |   Started around 2001-10 working to make Php.XPath adhere to specs 
+ * | Main Former Author: Michael P. Mehl <mpm@phpxml.org>
+ * |   Inital creator of V 1.0. Stoped activities around 2001-03        
+ * +------------------------------------------------------------------------------------------------------+
+ * | Code Structure:
+ * | --------------_
+ * | The class is split into 3 main objects. To keep usability easy all 3 
+ * | objects are in this file (but may be split in 3 file in future).
+ * |   +-------------+ 
+ * |   |  XPathBase  | XPathBase holds general and debugging functions. 
+ * |   +------+------+
+ * |          v      
+ * |   +-------------+ XPathEngine is the implementation of the W3C XPath spec. It contains the 
+ * |   | XPathEngine | XML-import (parser), -export  and can handle xPathQueries. It's a fully 
+ * |   +------+------+ functional class but has no functions to modify the XML-document (see following).
+ * |          v      
+ * |   +-------------+ 
+ * |   |    XPath    | XPath extends the functionality with actions to modify the XML-document.
+ * |   +-------------+ We tryed to implement a DOM - like interface.
+ * +------------------------------------------------------------------------------------------------------+
+ * | Usage:
+ * | ------
+ * | Scroll to the end of this php file and you will find a short sample code to get you started
+ * +------------------------------------------------------------------------------------------------------+
+ * | Glossary:
+ * | ---------
+ * | To understand how to use the functions and to pass the right parameters, read following:
+ * |     
+ * | Document: (full node tree, XML-tree)
+ * |     After a XML-source has been imported and parsed, it's stored as a tree of nodes sometimes 
+ * |     refered to as 'document'.
+ * |     
+ * | AbsoluteXPath: (xPath, xPathSet)
+ * |     A absolute XPath is a string. It 'points' to *one* node in the XML-document. We use the
+ * |     term 'absolute' to emphasise that it is not an xPath-query (see xPathQuery). A valid xPath 
+ * |     has the form like '/AAA[1]/BBB[2]/CCC[1]'. Usually functions that require a node (see Node) 
+ * |     will also accept an abs. XPath.
+ * |     
+ * | Node: (node, nodeSet, node-tree)
+ * |     Some funtions require or return a node (or a whole node-tree). Nodes are only used with the 
+ * |     XPath-interface and have an internal structure. Every node in a XML document has a unique 
+ * |     corresponding abs. xPath. That's why public functions that accept a node, will usually also 
+ * |     accept a abs. xPath (a string) 'pointing' to an existing node (see absolutXPath).
+ * |     
+ * | XPathQuery: (xquery, query)
+ * |     A xPath-query is a string that is matched against the XML-document. The result of the match 
+ * |     is a xPathSet (vector of xPath's). It's always possible to pass a single absoluteXPath 
+ * |     instead of a xPath-query. A valid xPathQuery could look like this:
+ * |     '//XXX/*[contains(., "foo")]/..' (See the link in 'What Is XPath' to learn more).
+ * |     
+ * |     
+ * +------------------------------------------------------------------------------------------------------+
+ * | Internals:
+ * | ----------
+ * | - The Node Tree
+ * |   -------------
+ * | A central role of the package is how the XML-data is stored. The whole data is in a node-tree.
+ * | A node can be seen as the equvalent to a tag in the XML soure with some extra info.
+ * | For instance the following XML 
+ * |                        <AAA foo="x">***<BBB/><CCC/>**<BBB/>*</AAA>
+ * | Would produce folowing node-tree:
+ * |                              'super-root'      <-- $nodeRoot (Very handy)  
+ * |                                    |                                           
+ * |             'depth' 0            AAA[1]        <-- top node. The 'textParts' of this node would be
+ * |                                /   |   \                     'textParts' => array('***','','**','*')
+ * |             'depth' 1     BBB[1] CCC[1] BBB[2]               (NOTE: Is always size of child nodes+1)
+ * | - The Node
+ * |   --------
+ * | The node itself is an structure desiged mainly to be used in connection with the interface of PHP.XPath.
+ * | That means it's possible for functions to return a sub-node-tree that can be used as input of an other 
+ * | PHP.XPath function.
+ * | 
+ * | The main structure of a node is:
+ * |   $node = array(
+ * |     'name'        => '',      # The tag name. E.g. In <FOO bar="aaa"/> it would be 'FOO'
+ * |     'attributes'  => array(), # The attributes of the tag E.g. In <FOO bar="aaa"/> it would be array('bar'=>'aaa')
+ * |     'textParts'   => array(), # Array of text parts surrounding the children E.g. <FOO>aa<A>bb<B/>cc</A>dd</FOO> -> array('aa','bb','cc','dd')
+ * |     'childNodes'  => array(), # Array of refences (pointers) to child nodes.
+ * |     
+ * | For optimisation reasions some additional data is stored in the node too:
+ * |     'parentNode'  => NULL     # Reference (pointer) to the parent node (or NULL if it's 'super root')
+ * |     'depth'       => 0,       # The tag depth (or tree level) starting with the root tag at 0.
+ * |     'pos'         => 0,       # Is the zero-based position this node has in the parent's 'childNodes'-list.
+ * |     'contextPos'  => 1,       # Is the one-based position this node has by counting the siblings tags (tags with same name)
+ * |     'xpath'       => ''       # Is the abs. XPath to this node.
+ * |     'generated_id'=> ''       # The id returned for this node by generate-id() (attribute and text nodes not supported)
+ * | 
+ * | - The NodeIndex
+ * |   -------------
+ * | Every node in the tree has an absolute XPath. E.g '/AAA[1]/BBB[2]' the $nodeIndex is a hash array
+ * | to all the nodes in the node-tree. The key used is the absolute XPath (a string).
+ * |    
+ * +------------------------------------------------------------------------------------------------------+
+ * | License:
+ * | --------
+ * | The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); 
+ * | you may not use this file except in compliance with the License. You may obtain a copy of the 
+ * | License at http://www.mozilla.org/MPL/ 
+ * | 
+ * | Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY
+ * | OF ANY KIND, either express or implied. See the License for the specific language governing 
+ * | rights and limitations under the License. 
+ * |
+ * | The Original Code is <phpXML/>. 
+ * | 
+ * | The Initial Developer of the Original Code is Michael P. Mehl. Portions created by Michael 
+ * | P. Mehl are Copyright (C) 2001 Michael P. Mehl. All Rights Reserved.
+ * |
+ * | Contributor(s): N.Swinson / S.Blum / D.Allen
+ * | 
+ * | Alternatively, the contents of this file may be used under the terms of either of the GNU 
+ * | General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public 
+ * | License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the 
+ * | LGPL License are applicable instead of those above.  If you wish to allow use of your version 
+ * | of this file only under the terms of the GPL or the LGPL License and not to allow others to 
+ * | use your version of this file under the MPL, indicate your decision by deleting the 
+ * | provisions above and replace them with the notice and other provisions required by the 
+ * | GPL or the LGPL License.  If you do not delete the provisions above, a recipient may use 
+ * | your version of this file under either the MPL, the GPL or the LGPL License. 
+ * | 
+ * +======================================================================================================+
+ *
+ * @author  S.Blum / N.Swinson / D.Allen / (P.Mehl)
+ * @link    http://sourceforge.net/projects/phpxpath/
+ * @version 3.5
+ * @CVS $Id: XPath.class.php,v 1.9 2005/11/16 17:26:05 bigmichi1 Exp $
+ */
+
+// Include guard, protects file being included twice
+$ConstantName = 'INCLUDED_'.strtoupper(__FILE__);
+if (defined($ConstantName)) return;
+define($ConstantName,1, TRUE);
+
+/************************************************************************************************
+* ===============================================================================================
+*                               X P a t h B a s e  -  Class                                      
+* ===============================================================================================
+************************************************************************************************/
+class XPathBase {
+  var $_lastError;
+  
+  // As debugging of the xml parse is spread across several functions, we need to make this a member.
+  var $bDebugXmlParse = FALSE;
+
+  // do we want to do profiling?
+  var $bClassProfiling = FALSE;
+
+  // Used to help navigate through the begin/end debug calls
+  var $iDebugNextLinkNumber = 1;
+  var $aDebugOpenLinks = array();
+  var $aDebugFunctions = array(
+          //'_evaluatePrimaryExpr',
+          //'_evaluateExpr',
+          //'_evaluateStep',
+          //'_checkPredicates',
+          //'_evaluateFunction',
+          //'_evaluateOperator',
+          //'_evaluatePathExpr',
+               );
+
+  /**
+   * Constructor
+   */
+  function XPathBase() {
+    # $this->bDebugXmlParse = TRUE;
+    $this->properties['verboseLevel'] = 1;  // 0=silent, 1 and above produce verbose output (an echo to screen). 
+    
+    if (!isSet($_ENV)) {  // Note: $_ENV introduced in 4.1.0. In earlier versions, use $HTTP_ENV_VARS.
+      $_ENV = $GLOBALS['HTTP_ENV_VARS'];
+    }
+    
+    // Windows 95/98 do not support file locking. Detecting OS (Operation System) and setting the 
+    // properties['OS_supports_flock'] to FALSE if win 95/98 is detected. 
+    // This will surpress the file locking error reported from win 98 users when exportToFile() is called.
+    // May have to add more OS's to the list in future (Macs?).
+    // ### Note that it's only the FAT and NFS file systems that are really a problem.  NTFS and
+    // the latest php libs do support flock()
+    $_ENV['OS'] = isSet($_ENV['OS']) ? $_ENV['OS'] : 'Unknown OS';
+    switch ($_ENV['OS']) { 
+      case 'Windows_95':
+      case 'Windows_98':
+      case 'Unknown OS':
+        // should catch Mac OS X compatible environment 
+        if (!empty($_SERVER['SERVER_SOFTWARE']) 
+            && preg_match('/Darwin/',$_SERVER['SERVER_SOFTWARE'])) { 
+           // fall-through 
+        } else { 
+           $this->properties['OS_supports_flock'] = FALSE; 
+           break; 
+        }
+      default:
+        $this->properties['OS_supports_flock'] = TRUE;
+    }
+  }
+  
+  
+  /**
+   * Resets the object so it's able to take a new xml sting/file
+   *
+   * Constructing objects is slow.  If you can, reuse ones that you have used already
+   * by using this reset() function.
+   */
+  function reset() {
+    $this->_lastError   = '';
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPathBase                    ------  Helpers  ------                                    
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * This method checks the right amount and match of brackets
+   *
+   * @param     $term (string) String in which is checked.
+   * @return          (bool)   TRUE: OK / FALSE: KO  
+   */
+  function _bracketsCheck($term) {
+    $leng = strlen($term);
+    $brackets = 0;
+    $bracketMisscount = $bracketMissmatsh = FALSE;
+    $stack = array();
+    for ($i=0; $i<$leng; $i++) {
+      switch ($term[$i]) {
+        case '(' : 
+        case '[' : 
+          $stack[$brackets] = $term[$i]; 
+          $brackets++; 
+          break;
+        case ')': 
+          $brackets--;
+          if ($brackets<0) {
+            $bracketMisscount = TRUE;
+            break 2;
+          }
+          if ($stack[$brackets] != '(') {
+            $bracketMissmatsh = TRUE;
+            break 2;
+          }
+          break;
+        case ']' : 
+          $brackets--;
+          if ($brackets<0) {
+            $bracketMisscount = TRUE;
+            break 2;
+          }
+          if ($stack[$brackets] != '[') {
+            $bracketMissmatsh = TRUE;
+            break 2;
+          }
+          break;
+      }
+    }
+    // Check whether we had a valid number of brackets.
+    if ($brackets != 0) $bracketMisscount = TRUE;
+    if ($bracketMisscount || $bracketMissmatsh) {
+      return FALSE;
+    }
+    return TRUE;
+  }
+  
+  /**
+   * Looks for a string within another string -- BUT the search-string must be located *outside* of any brackets.
+   *
+   * This method looks for a string within another string. Brackets in the
+   * string the method is looking through will be respected, which means that
+   * only if the string the method is looking for is located outside of
+   * brackets, the search will be successful.
+   *
+   * @param     $term       (string) String in which the search shall take place.
+   * @param     $expression (string) String that should be searched.
+   * @return                (int)    This method returns -1 if no string was found, 
+   *                                 otherwise the offset at which the string was found.
+   */
+  function _searchString($term, $expression) {
+    $bracketCounter = 0; // Record where we are in the brackets. 
+    $leng = strlen($term);
+    $exprLeng = strlen($expression);
+    for ($i=0; $i<$leng; $i++) {
+      $char = $term[$i];
+      if ($char=='(' || $char=='[') {
+        $bracketCounter++;
+        continue;
+      }
+      elseif ($char==')' || $char==']') {
+        $bracketCounter--;
+      }
+      if ($bracketCounter == 0) {
+        // Check whether we can find the expression at this index.
+        if (substr($term, $i, $exprLeng) == $expression) return $i;
+      }
+    }
+    // Nothing was found.
+    return (-1);
+  }
+  
+  /**
+   * Split a string by a searator-string -- BUT the separator-string must be located *outside* of any brackets.
+   * 
+   * Returns an array of strings, each of which is a substring of string formed 
+   * by splitting it on boundaries formed by the string separator. 
+   *
+   * @param     $separator  (string) String that should be searched.
+   * @param     $term       (string) String in which the search shall take place.
+   * @return                (array)  see above
+   */
+  function _bracketExplode($separator, $term) {
+    // Note that it doesn't make sense for $separator to itself contain (,),[ or ],
+    // but as this is a private function we should be ok.
+    $resultArr   = array();
+    $bracketCounter = 0;  // Record where we are in the brackets. 
+    do { // BEGIN try block
+      // Check if any separator is in the term
+      $sepLeng =  strlen($separator);
+      if (strpos($term, $separator)===FALSE) { // no separator found so end now
+        $resultArr[] = $term;
+        break; // try-block
+      }
+      
+      // Make a substitute separator out of 'unused chars'.
+      $substituteSep = str_repeat(chr(2), $sepLeng);
+      
+      // Now determine the first bracket '(' or '['.
+      $tmp1 = strpos($term, '(');
+      $tmp2 = strpos($term, '[');
+      if ($tmp1===FALSE) {
+        $startAt = (int)$tmp2;
+      } elseif ($tmp2===FALSE) {
+        $startAt = (int)$tmp1;
+      } else {
+        $startAt = min($tmp1, $tmp2);
+      }
+      
+      // Get prefix string part before the first bracket.
+      $preStr = substr($term, 0, $startAt);
+      // Substitute separator in prefix string.
+      $preStr = str_replace($separator, $substituteSep, $preStr);
+      
+      // Now get the rest-string (postfix string)
+      $postStr = substr($term, $startAt);
+      // Go all the way through the rest-string.
+      $strLeng = strlen($postStr);
+      for ($i=0; $i < $strLeng; $i++) {
+        $char = $postStr[$i];
+        // Spot (,),[,] and modify our bracket counter.  Note there is an
+        // assumption here that you don't have a string(with[mis)matched]brackets.
+        // This should be ok as the dodgy string will be detected elsewhere.
+        if ($char=='(' || $char=='[') {
+          $bracketCounter++;
+          continue;
+        } 
+        elseif ($char==')' || $char==']') {
+          $bracketCounter--;
+        }
+        // If no brackets surround us check for separator
+        if ($bracketCounter == 0) {
+          // Check whether we can find the expression starting at this index.
+          if ((substr($postStr, $i, $sepLeng) == $separator)) {
+            // Substitute the found separator 
+            for ($j=0; $j<$sepLeng; $j++) {
+              $postStr[$i+$j] = $substituteSep[$j];
+            }
+          }
+        }
+      }
+      // Now explod using the substitute separator as key.
+      $resultArr = explode($substituteSep, $preStr . $postStr);
+    } while (FALSE); // End try block
+    // Return the results that we found. May be a array with 1 entry.
+    return $resultArr;
+  }
+
+  /**
+   * Split a string at it's groups, ie bracketed expressions
+   * 
+   * Returns an array of strings, when concatenated together would produce the original
+   * string.  ie a(b)cde(f)(g) would map to:
+   * array ('a', '(b)', cde', '(f)', '(g)')
+   *
+   * @param     $string  (string) The string to process
+   * @param     $open    (string) The substring for the open of a group
+   * @param     $close   (string) The substring for the close of a group
+   * @return             (array)  The parsed string, see above
+   */
+  function _getEndGroups($string, $open='[', $close=']') {
+    // Note that it doesn't make sense for $separator to itself contain (,),[ or ],
+    // but as this is a private function we should be ok.
+    $resultArr   = array();
+    do { // BEGIN try block
+      // Check if we have both an open and a close tag      
+      if (empty($open) and empty($close)) { // no separator found so end now
+        $resultArr[] = $string;
+        break; // try-block
+      }
+
+      if (empty($string)) {
+        $resultArr[] = $string;
+        break; // try-block
+      }
+
+      
+      while (!empty($string)) {
+        // Now determine the first bracket '(' or '['.
+        $openPos = strpos($string, $open);
+        $closePos = strpos($string, $close);
+        if ($openPos===FALSE || $closePos===FALSE) {
+          // Oh, no more groups to be found then.  Quit
+          $resultArr[] = $string;
+          break;
+        }
+
+        // Sanity check
+        if ($openPos > $closePos) {
+          // Malformed string, dump the rest and quit.
+          $resultArr[] = $string;
+          break;
+        }
+
+        // Get prefix string part before the first bracket.
+        $preStr = substr($string, 0, $openPos);
+        // This is the first string that will go in our output
+        if (!empty($preStr))
+          $resultArr[] = $preStr;
+
+        // Skip over what we've proceed, including the open char
+        $string = substr($string, $openPos + 1 - strlen($string));
+
+        // Find the next open char and adjust our close char
+//echo "close: $closePos\nopen: $openPos\n\n";
+        $closePos -= $openPos + 1;
+        $openPos = strpos($string, $open);
+//echo "close: $closePos\nopen: $openPos\n\n";
+
+        // While we have found nesting...
+        while ($openPos && $closePos && ($closePos > $openPos)) {
+          // Find another close pos after the one we are looking at
+          $closePos = strpos($string, $close, $closePos + 1);
+          // And skip our open
+          $openPos = strpos($string, $open, $openPos + 1);
+        }
+//echo "close: $closePos\nopen: $openPos\n\n";
+
+        // If we now have a close pos, then it's the end of the group.
+        if ($closePos === FALSE) {
+          // We didn't... so bail dumping what was left
+          $resultArr[] = $open.$string;
+          break;
+        }
+
+        // We did, so we can extract the group
+        $resultArr[] = $open.substr($string, 0, $closePos + 1);
+        // Skip what we have processed
+        $string = substr($string, $closePos + 1);
+      }
+    } while (FALSE); // End try block
+    // Return the results that we found. May be a array with 1 entry.
+    return $resultArr;
+  }
+  
+  /**
+   * Retrieves a substring before a delimiter.
+   *
+   * This method retrieves everything from a string before a given delimiter,
+   * not including the delimiter.
+   *
+   * @param     $string     (string) String, from which the substring should be extracted.
+   * @param     $delimiter  (string) String containing the delimiter to use.
+   * @return                (string) Substring from the original string before the delimiter.
+   * @see       _afterstr()
+   */
+  function _prestr(&$string, $delimiter, $offset=0) {
+    // Return the substring.
+    $offset = ($offset<0) ? 0 : $offset;
+    $pos = strpos($string, $delimiter, $offset);
+    if ($pos===FALSE) return $string; else return substr($string, 0, $pos);
+  }
+  
+  /**
+   * Retrieves a substring after a delimiter.
+   *
+   * This method retrieves everything from a string after a given delimiter,
+   * not including the delimiter.
+   *
+   * @param     $string     (string) String, from which the substring should be extracted.
+   * @param     $delimiter  (string) String containing the delimiter to use.
+   * @return                (string) Substring from the original string after the delimiter.
+   * @see       _prestr()
+   */
+  function _afterstr($string, $delimiter, $offset=0) {
+    $offset = ($offset<0) ? 0 : $offset;
+    // Return the substring.
+    return substr($string, strpos($string, $delimiter, $offset) + strlen($delimiter));
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPathBase                ------  Debug Stuff  ------                                    
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Alter the verbose (error) level reporting.
+   *
+   * Pass an int. >0 to turn on, 0 to turn off.  The higher the number, the 
+   * higher the level of verbosity. By default, the class has a verbose level 
+   * of 1.
+   *
+   * @param $levelOfVerbosity (int) default is 1 = on
+   */
+  function setVerbose($levelOfVerbosity = 1) {
+    $level = -1;
+    if ($levelOfVerbosity === TRUE) {
+      $level = 1;
+    } elseif ($levelOfVerbosity === FALSE) {
+      $level = 0;
+    } elseif (is_numeric($levelOfVerbosity)) {
+      $level = $levelOfVerbosity;
+    }
+    if ($level >= 0) $this->properties['verboseLevel'] = $levelOfVerbosity;
+  }
+   
+  /**
+   * Returns the last occured error message.
+   *
+   * @access public
+   * @return string (may be empty if there was no error at all)
+   * @see    _setLastError(), _lastError
+   */
+  function getLastError() {
+    return $this->_lastError;
+  }
+  
+  /**
+   * Creates a textual error message and sets it. 
+   * 
+   * example: 'XPath error in THIS_FILE_NAME:LINE. Message: YOUR_MESSAGE';
+   * 
+   * I don't think the message should include any markup because not everyone wants to debug 
+   * into the browser window.
+   * 
+   * You should call _displayError() rather than _setLastError() if you would like the message,
+   * dependant on their verbose settings, echoed to the screen.
+   * 
+   * @param $message (string) a textual error message default is ''
+   * @param $line    (int)    the line number where the error occured, use __LINE__
+   * @see getLastError()
+   */
+  function _setLastError($message='', $line='-', $file='-') {
+    $this->_lastError = 'XPath error in ' . basename($file) . ':' . $line . '. Message: ' . $message;
+  }
+  
+  /**
+   * Displays an error message.
+   *
+   * This method displays an error messages depending on the users verbose settings 
+   * and sets the last error message.  
+   *
+   * If also possibly stops the execution of the script.
+   * ### Terminate should not be allowed --fab.  Should it??  N.S.
+   *
+   * @param $message    (string)  Error message to be displayed.
+   * @param $lineNumber (int)     line number given by __LINE__
+   * @param $terminate  (bool)    (default TURE) End the execution of this script.
+   */
+  function _displayError($message, $lineNumber='-', $file='-', $terminate=TRUE) {
+    // Display the error message.
+    $err = '<b>XPath error in '.basename($file).':'.$lineNumber.'</b> '.$message."<br \>\n";
+    $this->_setLastError($message, $lineNumber, $file);
+    if (($this->properties['verboseLevel'] > 0) OR ($terminate)) echo $err;
+    // End the execution of this script.
+    if ($terminate) exit;
+  }
+
+  /**
+   * Displays a diagnostic message
+   *
+   * This method displays an error messages
+   *
+   * @param $message    (string)  Error message to be displayed.
+   * @param $lineNumber (int)     line number given by __LINE__
+   */
+  function _displayMessage($message, $lineNumber='-', $file='-') {
+    // Display the error message.
+    $err = '<b>XPath message from '.basename($file).':'.$lineNumber.'</b> '.$message."<br \>\n";
+    if ($this->properties['verboseLevel'] > 0) echo $err;
+  }
+  
+  /**
+   * Called to begin the debug run of a function.
+   *
+   * This method starts a <DIV><PRE> tag so that the entry to this function
+   * is clear to the debugging user.  Call _closeDebugFunction() at the
+   * end of the function to create a clean box round the function call.
+   *
+   * @author    Nigel Swinson <nigelswinson@users.sourceforge.net>
+   * @author    Sam   Blum    <bs_php@infeer.com>
+   * @param     $functionName (string) the name of the function we are beginning to debug
+   * @param     $bDebugFlag   (bool) TRUE if we are to draw a call stack, FALSE otherwise
+   * @return                  (array)  the output from the microtime() function.
+   * @see       _closeDebugFunction()
+   */
+  function _beginDebugFunction($functionName, $bDebugFlag) {
+    if ($bDebugFlag) {
+      $fileName = basename(__FILE__);
+      static $color = array('green','blue','red','lime','fuchsia', 'aqua');
+      static $colIndex = -1;
+      $colIndex++;
+      echo '<div style="clear:both" align="left"> ';
+      echo '<pre STYLE="border:solid thin '. $color[$colIndex % 6] . '; padding:5">';
+      echo '<a style="float:right;margin:5px" name="'.$this->iDebugNextLinkNumber.'Open" href="#'.$this->iDebugNextLinkNumber.'Close">Function Close '.$this->iDebugNextLinkNumber.'</a>';
+      echo "<STRONG>{$fileName} : {$functionName}</STRONG>";
+      echo '<hr style="clear:both">';
+      array_push($this->aDebugOpenLinks, $this->iDebugNextLinkNumber);
+      $this->iDebugNextLinkNumber++;
+    }
+
+    if ($this->bClassProfiling)
+      $this->_ProfBegin($FunctionName);
+
+    return TRUE;
+  }
+  
+  /**
+   * Called to end the debug run of a function.
+   *
+   * This method ends a <DIV><PRE> block and reports the time since $aStartTime
+   * is clear to the debugging user.
+   *
+   * @author    Nigel Swinson <nigelswinson@users.sourceforge.net>
+   * @param     $functionName (string) the name of the function we are beginning to debug
+   * @param     $return_value (mixed) the return value from the function call that 
+   *                                  we are debugging
+   * @param     $bDebugFlag   (bool) TRUE if we are to draw a call stack, FALSE otherwise
+   */
+  function _closeDebugFunction($functionName, $returnValue = "", $bDebugFlag) {
+    if ($bDebugFlag) {
+      echo "<hr>";
+      $iOpenLinkNumber = array_pop($this->aDebugOpenLinks);
+      echo '<a style="float:right" name="'.$iOpenLinkNumber.'Close" href="#'.$iOpenLinkNumber.'Open">Function Open '.$iOpenLinkNumber.'</a>';
+      if (isSet($returnValue)) {
+      if (is_array($returnValue))
+        echo "Return Value: ".print_r($returnValue)."\n";
+      else if (is_numeric($returnValue)) 
+        echo "Return Value: ".(string)$returnValue."\n";
+      else if (is_bool($returnValue)) 
+        echo "Return Value: ".($returnValue ? "TRUE" : "FALSE")."\n";
+      else 
+        echo "Return Value: \"".htmlspecialchars($returnValue)."\"\n";
+    }
+      echo '<br style="clear:both">';
+      echo " \n</pre></div>";
+    }
+  
+    if ($this->bClassProfiling)
+      $this->_ProfEnd($FunctionName);
+
+    return TRUE;
+  }
+  
+  /**
+    * Profile begin call
+    */
+  function _ProfBegin($sonFuncName) {
+    static $entryTmpl = array ( 'start' => array(),
+                  'recursiveCount' => 0,
+                  'totTime' => 0,
+                  'callCount' => 0  );
+    $now = explode(' ', microtime());
+
+    if (empty($this->callStack)) {
+      $fatherFuncName = '';
+    }
+    else {
+      $fatherFuncName = $this->callStack[sizeOf($this->callStack)-1];
+      $fatherEntry = &$this->profile[$fatherFuncName];
+    }
+    $this->callStack[] = $sonFuncName;
+
+    if (!isSet($this->profile[$sonFuncName])) {
+      $this->profile[$sonFuncName] = $entryTmpl;
+    }
+
+    $sonEntry = &$this->profile[$sonFuncName];
+    $sonEntry['callCount']++;
+    // if we call the t's the same function let the time run, otherwise sum up
+    if ($fatherFuncName == $sonFuncName) {
+      $sonEntry['recursiveCount']++;
+    }
+    if (!empty($fatherFuncName)) {
+      $last = $fatherEntry['start'];
+    $fatherEntry['totTime'] += round( (($now[1] - $last[1]) + ($now[0] - $last[0]))*10000 );
+      $fatherEntry['start'] = 0;
+    }
+    $sonEntry['start'] = explode(' ', microtime());
+  }
+
+  /**
+   * Profile end call
+   */
+  function _ProfEnd($sonFuncName) {
+    $now = explode(' ', microtime());
+
+    array_pop($this->callStack);
+    if (empty($this->callStack)) {
+      $fatherFuncName = '';
+    }
+    else {
+      $fatherFuncName = $this->callStack[sizeOf($this->callStack)-1];
+      $fatherEntry = &$this->profile[$fatherFuncName];
+    }
+    $sonEntry = &$this->profile[$sonFuncName];
+    if (empty($sonEntry)) {
+      echo "ERROR in profEnd(): '$funcNam' not in list. Seams it was never started ;o)";
+    }
+
+    $last = $sonEntry['start'];
+    $sonEntry['totTime'] += round( (($now[1] - $last[1]) + ($now[0] - $last[0]))*10000 );
+    $sonEntry['start'] = 0;
+    if (!empty($fatherEntry)) $fatherEntry['start'] = explode(' ', microtime());
+  }
+
+    /**
+   * Show profile gathered so far as HTML table
+   */
+  function _ProfileToHtml() {
+    $sortArr = array();
+    if (empty($this->profile)) return '';
+    reset($this->profile);
+    while (list($funcName) = each($this->profile)) {
+      $sortArrKey[] = $this->profile[$funcName]['totTime'];
+      $sortArrVal[] = $funcName;
+    }
+    //echo '<pre>';var_dump($sortArrVal);echo '</pre>';
+    array_multisort ($sortArrKey, SORT_DESC, $sortArrVal );
+    //echo '<pre>';var_dump($sortArrVal);echo '</pre>';
+
+    $totTime = 0;
+    $size = sizeOf($sortArrVal);
+    for ($i=0; $i<$size; $i++) {
+      $funcName = &$sortArrVal[$i];
+      $totTime += $this->profile[$funcName]['totTime'];
+    }
+    $out = '<table border="1">';
+    $out .='<tr align="center" bgcolor="#bcd6f1"><th>Function</th><th> % </th><th>Total [ms]</th><th># Call</th><th>[ms] per Call</th><th># Recursive</th></tr>';
+    for ($i=0; $i<$size; $i++) {
+      $funcName = &$sortArrVal[$i];
+      $row = &$this->profile[$funcName];
+      $procent = round($row['totTime']*100/$totTime);
+      if ($procent>20) $bgc = '#ff8080';
+      elseif ($procent>15) $bgc = '#ff9999';
+      elseif ($procent>10) $bgc = '#ffcccc';
+      elseif ($procent>5) $bgc = '#ffffcc';
+      else $bgc = '#66ff99';
+
+      $out .="<tr align='center' bgcolor='{$bgc}'>";
+      $out .='<td>'. $funcName .'</td><td>'. $procent .'% '.'</td><td>'. $row['totTime']/10 .'</td><td>'. $row['callCount'] .'</td><td>'. round($row['totTime']/10/$row['callCount'],2) .'</td><td>'. $row['recursiveCount'].'</td>';
+      $out .='</tr>';
+    }
+    $out .= '</table> Total Time [' . $totTime/10 .'ms]' ;
+
+    echo $out;
+    return TRUE;
+  }
+
+  /**
+   * Echo an XPath context for diagnostic purposes
+   *
+   * @param $context   (array)   An XPath context
+   */
+  function _printContext($context) {
+    echo "{$context['nodePath']}({$context['pos']}/{$context['size']})";
+  }
+  
+  /**
+   * This is a debug helper function. It dumps the node-tree as HTML
+   *
+   * *QUICK AND DIRTY*. Needs some polishing.
+   *
+   * @param $node   (array)   A node 
+   * @param $indent (string) (optional, default=''). For internal recursive calls.
+   */
+  function _treeDump($node, $indent = '') {
+    $out = '';
+    
+    // Get rid of recursion
+    $parentName = empty($node['parentNode']) ? "SUPER ROOT" :  $node['parentNode']['name'];
+    unset($node['parentNode']);
+    $node['parentNode'] = $parentName ;
+    
+    $out .= "NODE[{$node['name']}]\n";
+    
+    foreach($node as $key => $val) {
+      if ($key === 'childNodes') continue;
+      if (is_Array($val)) {
+        $out .= $indent . "  [{$key}]\n" . arrayToStr($val, $indent . '    ');
+      } else {
+        $out .= $indent . "  [{$key}] => '{$val}' \n";
+      }
+    }
+    
+    if (!empty($node['childNodes'])) {
+      $out .= $indent . "  ['childNodes'] (Size = ".sizeOf($node['childNodes']).")\n";
+      foreach($node['childNodes'] as $key => $childNode) {
+        $out .= $indent . "     [$key] => " . $this->_treeDump($childNode, $indent . '       ') . "\n";
+      }
+    }
+    
+    if (empty($indent)) {
+      return "<pre>" . htmlspecialchars($out) . "</pre>";
+    }
+    return $out;
+  }
+} // END OF CLASS XPathBase
+
+
+/************************************************************************************************
+* ===============================================================================================
+*                             X P a t h E n g i n e  -  Class                                    
+* ===============================================================================================
+************************************************************************************************/
+
+class XPathEngine extends XPathBase {
+  
+  // List of supported XPath axes.
+  // What a stupid idea from W3C to take axes name containing a '-' (dash)
+  // NOTE: We replace the '-' with '_' to avoid the conflict with the minus operator.
+  //       We will then do the same on the users Xpath querys
+  //   -sibling => _sibling
+  //   -or-     =>     _or_
+  //  
+  // This array contains a list of all valid axes that can be evaluated in an
+  // XPath query.
+  var $axes = array ( 'ancestor', 'ancestor_or_self', 'attribute', 'child', 'descendant', 
+                        'descendant_or_self', 'following', 'following_sibling',  
+                        'namespace', 'parent', 'preceding', 'preceding_sibling', 'self' 
+     );
+  
+  // List of supported XPath functions.
+  // What a stupid idea from W3C to take function name containing a '-' (dash)
+  // NOTE: We replace the '-' with '_' to avoid the conflict with the minus operator.
+  //       We will then do the same on the users Xpath querys 
+  //   starts-with      => starts_with
+  //   substring-before => substring_before
+  //   substring-after  => substring_after
+  //   string-length    => string_length
+  //
+  // This array contains a list of all valid functions that can be evaluated
+  // in an XPath query.
+  var $functions = array ( 'last', 'position', 'count', 'id', 'name',
+    'string', 'concat', 'starts_with', 'contains', 'substring_before',
+    'substring_after', 'substring', 'string_length', 'normalize_space', 'translate',
+    'boolean', 'not', 'true', 'false', 'lang', 'number', 'sum', 'floor',
+    'ceiling', 'round', 'x_lower', 'x_upper', 'generate_id' );
+    
+  // List of supported XPath operators.
+  //
+  // This array contains a list of all valid operators that can be evaluated
+  // in a predicate of an XPath query. The list is ordered by the
+  // precedence of the operators (lowest precedence first).
+  var $operators = array( ' or ', ' and ', '=', '!=', '<=', '<', '>=', '>',
+    '+', '-', '*', ' div ', ' mod ', ' | ');
+
+  // List of literals from the xPath string.
+  var $axPathLiterals = array();
+  
+  // The index and tree that is created during the analysis of an XML source.
+  var $nodeIndex = array();
+  var $nodeRoot  = array();
+  var $emptyNode = array(
+                     'name'        => '',       // The tag name. E.g. In <FOO bar="aaa"/> it would be 'FOO'
+                     'attributes'  => array(),  // The attributes of the tag E.g. In <FOO bar="aaa"/> it would be array('bar'=>'aaa')
+                     'childNodes'  => array(),  // Array of pointers to child nodes.
+                     'textParts'   => array(),  // Array of text parts between the cilderen E.g. <FOO>aa<A>bb<B/>cc</A>dd</FOO> -> array('aa','bb','cc','dd')
+                     'parentNode'   => NULL,     // Pointer to parent node or NULL if this node is the 'super root'
+                     //-- *!* Following vars are set by the indexer and is for optimisation only *!*
+                     'depth'       => 0,  // The tag depth (or tree level) starting with the root tag at 0.
+                     'pos'         => 0,  // Is the zero-based position this node has in the parents 'childNodes'-list.
+                     'contextPos'  => 1,  // Is the one-based position this node has by counting the siblings tags (tags with same name)
+                     'xpath'       => ''  // Is the abs. XPath to this node.
+                   );
+  var $_indexIsDirty = FALSE;
+
+  
+  // These variable used during the parse XML source
+  var $nodeStack       = array(); // The elements that we have still to close.
+  var $parseStackIndex = 0;       // The current element of the nodeStack[] that we are adding to while 
+                                  // parsing an XML source.  Corresponds to the depth of the xml node.
+                                  // in our input data.
+  var $parseOptions    = array(); // Used to set the PHP's XML parser options (see xml_parser_set_option)
+  var $parsedTextLocation   = ''; // A reference to where we have to put char data collected during XML parsing
+  var $parsInCData     = 0 ;      // Is >0 when we are inside a CDATA section.  
+  var $parseSkipWhiteCache = 0;   // A cache of the skip whitespace parse option to speed up the parse.
+
+  // This is the array of error strings, to keep consistency.
+  var $errorStrings = array(
+    'AbsoluteXPathRequired' => "The supplied xPath '%s' does not *uniquely* describe a node in the xml document.",
+    'NoNodeMatch'           => "The supplied xPath-query '%s' does not match *any* node in the xml document.",
+    'RootNodeAlreadyExists' => "An xml document may have only one root node."
+    );
+    
+  /**
+   * Constructor
+   *
+   * Optionally you may call this constructor with the XML-filename to parse and the 
+   * XML option vector. Each of the entries in the option vector will be passed to
+   * xml_parser_set_option().
+   *
+   * A option vector sample: 
+   *   $xmlOpt = array(XML_OPTION_CASE_FOLDING => FALSE, 
+   *                   XML_OPTION_SKIP_WHITE => TRUE);
+   *
+   * @param  $userXmlOptions (array) (optional) Vector of (<optionID>=><value>, 
+   *                                 <optionID>=><value>, ...).  See PHP's
+   *                                 xml_parser_set_option() docu for a list of possible
+   *                                 options.
+   * @see   importFromFile(), importFromString(), setXmlOptions()
+   */
+  function XPathEngine($userXmlOptions=array()) {
+    parent::XPathBase();
+    // Default to not folding case
+    $this->parseOptions[XML_OPTION_CASE_FOLDING] = FALSE;
+    // And not skipping whitespace
+    $this->parseOptions[XML_OPTION_SKIP_WHITE] = FALSE;
+    
+    // Now merge in the overrides.
+    // Don't use PHP's array_merge!
+    if (is_array($userXmlOptions)) {
+      foreach($userXmlOptions as $key => $val) $this->parseOptions[$key] = $val;
+    }
+  }
+  
+  /**
+   * Resets the object so it's able to take a new xml sting/file
+   *
+   * Constructing objects is slow.  If you can, reuse ones that you have used already
+   * by using this reset() function.
+   */
+  function reset() {
+    parent::reset();
+    $this->properties['xmlFile']  = ''; 
+    $this->parseStackIndex = 0;
+    $this->parsedTextLocation = '';
+    $this->parsInCData   = 0;
+    $this->nodeIndex     = array();
+    $this->nodeRoot      = array();
+    $this->nodeStack     = array();
+    $this->aLiterals     = array();
+    $this->_indexIsDirty = FALSE;
+  }
+  
+  
+  //-----------------------------------------------------------------------------------------
+  // XPathEngine              ------  Get / Set Stuff  ------                                
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Returns the property/ies you want.
+   * 
+   * if $param is not given, all properties will be returned in a hash.
+   *
+   * @param  $param (string) the property you want the value of, or NULL for all the properties
+   * @return        (mixed)  string OR hash of all params, or NULL on an unknown parameter.
+   */
+  function getProperties($param=NULL) {
+    $this->properties['hasContent']      = !empty($this->nodeRoot);
+    $this->properties['caseFolding']     = $this->parseOptions[XML_OPTION_CASE_FOLDING];
+    $this->properties['skipWhiteSpaces'] = $this->parseOptions[XML_OPTION_SKIP_WHITE];
+    
+    if (empty($param)) return $this->properties;
+    
+    if (isSet($this->properties[$param])) {
+      return $this->properties[$param];
+    } else {
+      return NULL;
+    }
+  }
+  
+  /**
+   * Set an xml_parser_set_option()
+   *
+   * @param $optionID (int) The option ID (e.g. XML_OPTION_SKIP_WHITE)
+   * @param $value    (int) The option value.
+   * @see XML parser functions in PHP doc
+   */
+  function setXmlOption($optionID, $value) {
+    if (!is_numeric($optionID)) return;
+     $this->parseOptions[$optionID] = $value;
+  }
+
+  /**
+   * Sets a number of xml_parser_set_option()s
+   *
+   * @param  $userXmlOptions (array) An array of parser options.
+   * @see setXmlOption
+   */
+  function setXmlOptions($userXmlOptions=array()) {
+    if (!is_array($userXmlOptions)) return;
+    foreach($userXmlOptions as $key => $val) {
+      $this->setXmlOption($key, $val);
+    }
+  }
+  
+  /**
+   * Alternative way to control whether case-folding is enabled for this XML parser.
+   *
+   * Short cut to setXmlOptions(XML_OPTION_CASE_FOLDING, TRUE/FALSE)
+   *
+   * When it comes to XML, case-folding simply means uppercasing all tag- 
+   * and attribute-names (NOT the content) if set to TRUE.  Note if you
+   * have this option set, then your XPath queries will also be case folded 
+   * for you.
+   *
+   * @param $onOff (bool) (default TRUE) 
+   * @see XML parser functions in PHP doc
+   */
+  function setCaseFolding($onOff=TRUE) {
+    $this->parseOptions[XML_OPTION_CASE_FOLDING] = $onOff;
+  }
+  
+  /**
+   * Alternative way to control whether skip-white-spaces is enabled for this XML parser.
+   *
+   * Short cut to setXmlOptions(XML_OPTION_SKIP_WHITE, TRUE/FALSE)
+   *
+   * When it comes to XML, skip-white-spaces will trim the tag content.
+   * An XML file with no whitespace will be faster to process, but will make 
+   * your data less human readable when you come to write it out.
+   *
+   * Running with this option on will slow the class down, so if you want to 
+   * speed up your XML, then run it through once skipping white-spaces, then
+   * write out the new version of your XML without whitespace, then use the
+   * new XML file with skip whitespaces turned off.
+   *
+   * @param $onOff (bool) (default TRUE) 
+   * @see XML parser functions in PHP doc
+   */
+  function setSkipWhiteSpaces($onOff=TRUE) {
+    $this->parseOptions[XML_OPTION_SKIP_WHITE] = $onOff;
+  }
+   
+  /**
+   * Get the node defined by the $absoluteXPath.
+   *
+   * @param   $absoluteXPath (string) (optional, default is 'super-root') xpath to the node.
+   * @return                 (array)  The node, or FALSE if the node wasn't found.
+   */
+  function &getNode($absoluteXPath='') {
+    if ($absoluteXPath==='/') $absoluteXPath = '';
+    if (!isSet($this->nodeIndex[$absoluteXPath])) return FALSE;
+    if ($this->_indexIsDirty) $this->reindexNodeTree();
+    return $this->nodeIndex[$absoluteXPath];
+  }
+
+  /**
+   * Get a the content of a node text part or node attribute.
+   * 
+   * If the absolute Xpath references an attribute (Xpath ends with @ or attribute::), 
+   * then the text value of that node-attribute is returned.
+   * Otherwise the Xpath is referencing a text part of the node. This can be either a 
+   * direct reference to a text part (Xpath ends with text()[<nr>]) or indirect reference 
+   * (a simple abs. Xpath to a node).
+   * 1) Direct Reference (xpath ends with text()[<part-number>]):
+   *   If the 'part-number' is omitted, the first text-part is assumed; starting by 1.
+   *   Negative numbers are allowed, where -1 is the last text-part a.s.o.
+   * 2) Indirect Reference (a simple abs. Xpath to a node):
+   *   Default is to return the *whole text*; that is the concated text-parts of the matching
+   *   node. (NOTE that only in this case you'll only get a copy and changes to the returned  
+   *   value wounld have no effect). Optionally you may pass a parameter 
+   *   $textPartNr to define the text-part you want;  starting by 1.
+   *   Negative numbers are allowed, where -1 is the last text-part a.s.o.
+   *
+   * NOTE I : The returned value can be fetched by reference
+   *          E.g. $text =& wholeText(). If you wish to modify the text.
+   * NOTE II: text-part numbers out of range will return FALSE
+   * SIDENOTE:The function name is a suggestion from W3C in the XPath specification level 3.
+   *
+   * @param   $absoluteXPath  (string)  xpath to the node (See above).
+   * @param   $textPartNr     (int)     If referring to a node, specifies which text part 
+   *                                    to query.
+   * @return                  (&string) A *reference* to the text if the node that the other 
+   *                                    parameters describe or FALSE if the node is not found.
+   */
+  function &wholeText($absoluteXPath, $textPartNr=NULL) {
+    $status = FALSE;
+    $text   = NULL;
+    if ($this->_indexIsDirty) $this->reindexNodeTree();
+    
+    do { // try-block
+      if (preg_match(";(.*)/(attribute::|@)([^/]*)$;U", $absoluteXPath, $matches)) {
+        $absoluteXPath = $matches[1];
+        $attribute = $matches[3];
+        if (!isSet($this->nodeIndex[$absoluteXPath]['attributes'][$attribute])) {
+          $this->_displayError("The $absoluteXPath/attribute::$attribute value isn't a node in this document.", __LINE__, __FILE__, FALSE);
+          break; // try-block
+        }
+        $text =& $this->nodeIndex[$absoluteXPath]['attributes'][$attribute];
+        $status = TRUE;
+        break; // try-block
+      }
+            
+      // Xpath contains a 'text()'-function, thus goes right to a text node. If so interpret the Xpath.
+      if (preg_match(":(.*)/text\(\)(\[(.*)\])?$:U", $absoluteXPath, $matches)) {
+        $absoluteXPath = $matches[1];
+ 
+        if (!isSet($this->nodeIndex[$absoluteXPath])) {
+            $this->_displayError("The $absoluteXPath value isn't a node in this document.", __LINE__, __FILE__, FALSE);
+            break; // try-block
+        }
+
+        // Get the amount of the text parts in the node.
+        $textPartSize = sizeOf($this->nodeIndex[$absoluteXPath]['textParts']);
+
+        // default to the first text node if a text node was not specified
+        $textPartNr = isSet($matches[2]) ? substr($matches[2],1,-1) : 1;
+
+        // Support negative indexes like -1 === last a.s.o.
+        if ($textPartNr < 0) $textPartNr = $textPartSize + $textPartNr +1;
+        if (($textPartNr <= 0) OR ($textPartNr > $textPartSize)) {
+          $this->_displayError("The $absoluteXPath/text()[$textPartNr] value isn't a NODE in this document.", __LINE__, __FILE__, FALSE);
+          break; // try-block
+        }
+        $text =& $this->nodeIndex[$absoluteXPath]['textParts'][$textPartNr - 1];
+        $status = TRUE;
+        break; // try-block
+      }
+      
+      // At this point we have been given an xpath with neither a 'text()' nor 'attribute::' axis at the end
+      // So we assume a get to text is wanted and use the optioanl fallback parameters $textPartNr
+     
+      if (!isSet($this->nodeIndex[$absoluteXPath])) {
+          $this->_displayError("The $absoluteXPath value isn't a node in this document.", __LINE__, __FILE__, FALSE);
+          break; // try-block
+      }
+
+      // Get the amount of the text parts in the node.
+      $textPartSize = sizeOf($this->nodeIndex[$absoluteXPath]['textParts']);
+
+      // If $textPartNr == NULL we return a *copy* of the whole concated text-parts
+      if (is_null($textPartNr)) {
+        unset($text);
+        $text = implode('', $this->nodeIndex[$absoluteXPath]['textParts']);
+        $status = TRUE;
+        break; // try-block
+      }
+      
+      // Support negative indexes like -1 === last a.s.o.
+      if ($textPartNr < 0) $textPartNr = $textPartSize + $textPartNr +1;
+      if (($textPartNr <= 0) OR ($textPartNr > $textPartSize)) {
+        $this->_displayError("The $absoluteXPath has no text part at pos [$textPartNr] (Note: text parts start with 1).", __LINE__, __FILE__, FALSE);
+        break; // try-block
+      }
+      $text =& $this->nodeIndex[$absoluteXPath]['textParts'][$textPartNr -1];
+      $status = TRUE;
+    } while (FALSE); // END try-block
+    
+    if (!$status) return FALSE;
+    return $text;
+  }
+
+  /**
+   * Obtain the string value of an object
+   *
+   * http://www.w3.org/TR/xpath#dt-string-value
+   *
+   * "For every type of node, there is a way of determining a string-value for a node of that type. 
+   * For some types of node, the string-value is part of the node; for other types of node, the 
+   * string-value is computed from the string-value of descendant nodes."
+   *
+   * @param $node   (node)   The node we have to convert
+   * @return        (string) The string value of the node.  "" if the object has no evaluatable
+   *                         string value
+   */
+  function _stringValue($node) {
+    // Decode the entitites and then add the resulting literal string into our array.
+    return $this->_addLiteral($this->decodeEntities($this->wholeText($node)));
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPathEngine           ------ Export the XML Document ------                             
+  //-----------------------------------------------------------------------------------------
+   
+  /**
+   * Returns the containing XML as marked up HTML with specified nodes hi-lighted
+   *
+   * @param $absoluteXPath    (string) The address of the node you would like to export.
+   *                                   If empty the whole document will be exported.
+   * @param $hilighXpathList  (array)  A list of nodes that you would like to highlight
+   * @return                  (mixed)  The Xml document marked up as HTML so that it can
+   *                                   be viewed in a browser, including any XML headers.
+   *                                   FALSE on error.
+   * @see _export()    
+   */
+  function exportAsHtml($absoluteXPath='', $hilightXpathList=array()) {
+    $htmlString = $this->_export($absoluteXPath, $xmlHeader=NULL, $hilightXpathList);
+    if (!$htmlString) return FALSE;
+    return "<pre>\n" . $htmlString . "\n</pre>"; 
+  }
+  
+  /**
+   * Given a context this function returns the containing XML
+   *
+   * @param $absoluteXPath  (string) The address of the node you would like to export.
+   *                                 If empty the whole document will be exported.
+   * @param $xmlHeader      (array)  The string that you would like to appear before
+   *                                 the XML content.  ie before the <root></root>.  If you
+   *                                 do not specify this argument, the xmlHeader that was 
+   *                                 found in the parsed xml file will be used instead.
+   * @return                (mixed)  The Xml fragment/document, suitable for writing
+   *                                 out to an .xml file or as part of a larger xml file, or
+   *                                 FALSE on error.
+   * @see _export()    
+   */
+  function exportAsXml($absoluteXPath='', $xmlHeader=NULL) {
+    $this->hilightXpathList = NULL;
+    return $this->_export($absoluteXPath, $xmlHeader); 
+  }
+    
+  /**
+   * Generates a XML string with the content of the current document and writes it to a file.
+   *
+   * Per default includes a <?xml ...> tag at the start of the data too. 
+   *
+   * @param     $fileName       (string) 
+   * @param     $absoluteXPath  (string) The path to the parent node you want(see text above)
+   * @param     $xmlHeader      (array)  The string that you would like to appear before
+   *                                     the XML content.  ie before the <root></root>.  If you
+   *                                     do not specify this argument, the xmlHeader that was 
+   *                                     found in the parsed xml file will be used instead.
+   * @return                    (string) The returned string contains well-formed XML data 
+   *                                     or FALSE on error.
+   * @see       exportAsXml(), exportAsHtml()
+   */
+  function exportToFile($fileName, $absoluteXPath='', $xmlHeader=NULL) {   
+    $status = FALSE;
+    do { // try-block
+      if (!($hFile = fopen($fileName, "wb"))) {   // Did we open the file ok?
+        $errStr = "Failed to open the $fileName xml file.";
+        break; // try-block
+      }
+      
+      if ($this->properties['OS_supports_flock']) {
+        if (!flock($hFile, LOCK_EX + LOCK_NB)) {  // Lock the file
+          $errStr = "Couldn't get an exclusive lock on the $fileName file.";
+          break; // try-block
+        }
+      }
+      if (!($xmlOut = $this->_export($absoluteXPath, $xmlHeader))) {
+        $errStr = "Export failed";
+        break; // try-block
+      }
+      
+      $iBytesWritten = fwrite($hFile, $xmlOut);
+      if ($iBytesWritten != strlen($xmlOut)) {
+        $errStr = "Write error when writing back the $fileName file.";
+        break; // try-block
+      }
+      
+      // Flush and unlock the file
+      @fflush($hFile);
+      $status = TRUE;
+    } while(FALSE);
+    
+    @flock($hFile, LOCK_UN);
+    @fclose($hFile);
+    // Sanity check the produced file.
+    clearstatcache();
+    if (filesize($fileName) < strlen($xmlOut)) {
+      $errStr = "Write error when writing back the $fileName file.";
+      $status = FALSE;
+    }
+    
+    if (!$status)  $this->_displayError($errStr, __LINE__, __FILE__, FALSE);
+    return $status;
+  }
+
+  /**
+   * Generates a XML string with the content of the current document.
+   *
+   * This is the start for extracting the XML-data from the node-tree. We do some preperations
+   * and then call _InternalExport() to fetch the main XML-data. You optionally may pass 
+   * xpath to any node that will then be used as top node, to extract XML-parts of the 
+   * document. Default is '', meaning to extract the whole document.
+   *
+   * You also may pass a 'xmlHeader' (usually something like <?xml version="1.0"? > that will
+   * overwrite any other 'xmlHeader', if there was one in the original source.  If there
+   * wasn't one in the original source, and you still don't specify one, then it will
+   * use a default of <?xml version="1.0"? >
+   * Finaly, when exporting to HTML, you may pass a vector xPaths you want to hi-light.
+   * The hi-lighted tags and attributes will receive a nice color. 
+   * 
+   * NOTE I : The output can have 2 formats:
+   *       a) If "skip white spaces" is/was set. (Not Recommended - slower)
+   *          The output is formatted by adding indenting and carriage returns.
+   *       b) If "skip white spaces" is/was *NOT* set.
+   *          'as is'. No formatting is done. The output should the same as the 
+   *          the original parsed XML source. 
+   *
+   * @param  $absoluteXPath (string) (optional, default is root) The node we choose as top-node
+   * @param  $xmlHeader     (string) (optional) content before <root/> (see text above)
+   * @param  $hilightXpath  (array)  (optional) a vector of xPaths to nodes we wat to 
+   *                                 hi-light (see text above)
+   * @return                (mixed)  The xml string, or FALSE on error.
+   */
+  function _export($absoluteXPath='', $xmlHeader=NULL, $hilightXpathList='') {
+    // Check whether a root node is given.
+    if (empty($absoluteXpath)) $absoluteXpath = '';
+    if ($absoluteXpath == '/') $absoluteXpath = '';
+    if ($this->_indexIsDirty) $this->reindexNodeTree();
+    if (!isSet($this->nodeIndex[$absoluteXpath])) {
+      // If the $absoluteXpath was '' and it didn't exist, then the document is empty
+      // and we can safely return ''.
+      if ($absoluteXpath == '') return '';
+      $this->_displayError("The given xpath '{$absoluteXpath}' isn't a node in this document.", __LINE__, __FILE__, FALSE);
+      return FALSE;
+    }
+    
+    $this->hilightXpathList = $hilightXpathList;
+    $this->indentStep = '  ';
+    $hilightIsActive = is_array($hilightXpathList);
+    if ($hilightIsActive) {
+      $this->indentStep = '&nbsp;&nbsp;&nbsp;&nbsp;';
+    }    
+    
+    // Cache this now
+    $this->parseSkipWhiteCache = isSet($this->parseOptions[XML_OPTION_SKIP_WHITE]) ? $this->parseOptions[XML_OPTION_SKIP_WHITE] : FALSE;
+
+    ///////////////////////////////////////
+    // Get the starting node and begin with the header
+
+    // Get the start node.  The super root is a special case.
+    $startNode = NULL;
+    if (empty($absoluteXPath)) {
+      $superRoot = $this->nodeIndex[''];
+      // If they didn't specify an xml header, use the one in the object
+      if (is_null($xmlHeader)) {
+        $xmlHeader = $this->parseSkipWhiteCache ? trim($superRoot['textParts'][0]) : $superRoot['textParts'][0];
+        // If we still don't have an XML header, then use a suitable default
+        if (empty($xmlHeader)) {
+            $xmlHeader = '<?xml version="1.0"?>';
+        }
+      }
+
+      if (isSet($superRoot['childNodes'][0])) $startNode = $superRoot['childNodes'][0];
+    } else {
+      $startNode = $this->nodeIndex[$absoluteXPath];
+    }
+
+    if (!empty($xmlHeader)) { 
+      $xmlOut = $this->parseSkipWhiteCache ? $xmlHeader."\n" : $xmlHeader;
+    } else {
+      $xmlOut = '';
+    }
+
+    ///////////////////////////////////////
+    // Output the document.
+
+    if (($xmlOut .= $this->_InternalExport($startNode)) === FALSE) {
+      return FALSE;
+    }
+    
+    ///////////////////////////////////////
+
+    // Convert our markers to hi-lights.
+    if ($hilightIsActive) {
+      $from = array('<', '>', chr(2), chr(3));
+      $to = array('&lt;', '&gt;', '<font color="#FF0000"><b>', '</b></font>');
+      $xmlOut = str_replace($from, $to, $xmlOut);
+    }
+    return $xmlOut; 
+  }  
+
+  /**
+   * Export the xml document starting at the named node.
+   *
+   * @param $node (node)   The node we have to start exporting from
+   * @return      (string) The string representation of the node.
+   */
+  function _InternalExport($node) {
+    $ThisFunctionName = '_InternalExport';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Exporting node: ".$node['xpath']."<br>\n";
+    }
+
+    ////////////////////////////////
+
+    // Quick out.
+    if (empty($node)) return '';
+
+    // The output starts as empty.
+    $xmlOut = '';
+    // This loop will output the text before the current child of a parent then the 
+    // current child.  Where the child is a short tag we output the child, then move
+    // onto the next child.  Where the child is not a short tag, we output the open tag, 
+    // then queue up on currentParentStack[] the child.  
+    //
+    // When we run out of children, we then output the last text part, and close the 
+    // 'parent' tag before popping the stack and carrying on.
+    //
+    // To illustrate, the numbers in this xml file indicate what is output on each
+    // pass of the while loop:
+    //
+    // 1
+    // <1>2
+    //  <2>3
+    //   <3/>4
+    //  </4>5
+    //  <5/>6
+    // </6>
+
+    // Although this is neater done using recursion, there's a 33% performance saving
+    // to be gained by using this stack mechanism.
+
+    // Only add CR's if "skip white spaces" was set. Otherwise leave as is.
+    $CR = ($this->parseSkipWhiteCache) ? "\n" : '';
+    $currentIndent = '';
+    $hilightIsActive = is_array($this->hilightXpathList);
+
+    // To keep track of where we are in the document we use a node stack.  The node 
+    // stack has the following parallel entries:
+    //   'Parent'     => (array) A copy of the parent node that who's children we are 
+    //                           exporting
+    //   'ChildIndex' => (array) The child index of the corresponding parent that we
+    //                           are currently exporting.
+    //   'Highlighted'=> (bool)  If we are highlighting this node.  Only relevant if
+    //                           the hilight is active.
+
+    // Setup our node stack.  The loop is designed to output children of a parent, 
+    // not the parent itself, so we must put the parent on as the starting point.
+    $nodeStack['Parent'] = array($node['parentNode']);
+    // And add the childpos of our node in it's parent to our "child index stack".
+    $nodeStack['ChildIndex'] = array($node['pos']);
+    // We start at 0.
+    $nodeStackIndex = 0;
+
+    // We have not to output text before/after our node, so blank it.  We will recover it
+    // later
+    $OldPreceedingStringValue = $nodeStack['Parent'][0]['textParts'][$node['pos']];
+    $OldPreceedingStringRef =& $nodeStack['Parent'][0]['textParts'][$node['pos']];
+    $OldPreceedingStringRef = "";
+    $currentXpath = "";
+
+    // While we still have data on our stack
+    while ($nodeStackIndex >= 0) {
+      // Count the children and get a copy of the current child.
+      $iChildCount = count($nodeStack['Parent'][$nodeStackIndex]['childNodes']);
+      $currentChild = $nodeStack['ChildIndex'][$nodeStackIndex];
+      // Only do the auto indenting if the $parseSkipWhiteCache flag was set.
+      if ($this->parseSkipWhiteCache)
+        $currentIndent = str_repeat($this->indentStep, $nodeStackIndex);
+
+      if ($bDebugThisFunction)
+        echo "Exporting child ".($currentChild+1)." of node {$nodeStack['Parent'][$nodeStackIndex]['xpath']}\n";
+
+      ///////////////////////////////////////////
+      // Add the text before our child.
+
+      // Add the text part before the current child
+      $tmpTxt =& $nodeStack['Parent'][$nodeStackIndex]['textParts'][$currentChild];
+      if (isSet($tmpTxt) AND ($tmpTxt!="")) {
+        // Only add CR indent if there were children
+        if ($iChildCount)
+          $xmlOut .= $CR.$currentIndent;
+        // Hilight if necessary.
+        $highlightStart = $highlightEnd = '';
+        if ($hilightIsActive) {
+          $currentXpath = $nodeStack['Parent'][$nodeStackIndex]['xpath'].'/text()['.($currentChild+1).']';
+          if (in_array($currentXpath, $this->hilightXpathList)) {
+           // Yes we hilight
+            $highlightStart = chr(2);
+            $highlightEnd   = chr(3);
+          }
+        }
+        $xmlOut .= $highlightStart.$nodeStack['Parent'][$nodeStackIndex]['textParts'][$currentChild].$highlightEnd;
+      }
+      if ($iChildCount && $nodeStackIndex) $xmlOut .= $CR;
+
+      ///////////////////////////////////////////
+
+      // Are there any more children?
+      if ($iChildCount <= $currentChild) {
+        // Nope, so output the last text before the closing tag
+        $tmpTxt =& $nodeStack['Parent'][$nodeStackIndex]['textParts'][$currentChild+1];
+        if (isSet($tmpTxt) AND ($tmpTxt!="")) {
+          // Hilight if necessary.
+          $highlightStart = $highlightEnd = '';
+          if ($hilightIsActive) {
+            $currentXpath = $nodeStack['Parent'][$nodeStackIndex]['xpath'].'/text()['.($currentChild+2).']';
+            if (in_array($currentXpath, $this->hilightXpathList)) {
+             // Yes we hilight
+              $highlightStart = chr(2);
+              $highlightEnd   = chr(3);
+            }
+          }
+          $xmlOut .= $highlightStart
+                .$currentIndent.$nodeStack['Parent'][$nodeStackIndex]['textParts'][$currentChild+1].$CR
+                .$highlightEnd;
+        }
+
+        // Now close this tag, as we are finished with this child.
+
+        // Potentially output an (slightly smaller indent).
+        if ($this->parseSkipWhiteCache
+          && count($nodeStack['Parent'][$nodeStackIndex]['childNodes'])) {
+          $xmlOut .= str_repeat($this->indentStep, $nodeStackIndex - 1);
+        }
+
+        // Check whether the xml-tag is to be hilighted.
+        $highlightStart = $highlightEnd = '';
+        if ($hilightIsActive) {
+          $currentXpath = $nodeStack['Parent'][$nodeStackIndex]['xpath'];
+          if (in_array($currentXpath, $this->hilightXpathList)) {
+            // Yes we hilight
+            $highlightStart = chr(2);
+            $highlightEnd   = chr(3);
+          }
+        }
+        $xmlOut .=  $highlightStart
+                     .'</'.$nodeStack['Parent'][$nodeStackIndex]['name'].'>'
+                     .$highlightEnd;
+        // Decrement the $nodeStackIndex to go back to the next unfinished parent.
+        $nodeStackIndex--;
+
+        // If the index is 0 we are finished exporting the last node, as we may have been
+        // exporting an internal node.
+        if ($nodeStackIndex == 0) break;
+
+        // Indicate to the parent that we are finished with this child.
+        $nodeStack['ChildIndex'][$nodeStackIndex]++;
+
+        continue;
+      }
+
+      ///////////////////////////////////////////
+      // Ok, there are children still to process.
+
+      // Queue up the next child (I can copy because I won't modify and copying is faster.)
+      $nodeStack['Parent'][$nodeStackIndex + 1] = $nodeStack['Parent'][$nodeStackIndex]['childNodes'][$currentChild];
+
+      // Work out if it is a short child tag.
+      $iGrandChildCount = count($nodeStack['Parent'][$nodeStackIndex + 1]['childNodes']);
+      $shortGrandChild = (($iGrandChildCount == 0) AND (implode('',$nodeStack['Parent'][$nodeStackIndex + 1]['textParts'])==''));
+
+      ///////////////////////////////////////////
+      // Assemble the attribute string first.
+      $attrStr = '';
+      foreach($nodeStack['Parent'][$nodeStackIndex + 1]['attributes'] as $key=>$val) {
+        // Should we hilight the attribute?
+        if ($hilightIsActive AND in_array($currentXpath.'/attribute::'.$key, $this->hilightXpathList)) {
+          $hiAttrStart = chr(2);
+          $hiAttrEnd   = chr(3);
+        } else {
+          $hiAttrStart = $hiAttrEnd = '';
+        }
+        $attrStr .= ' '.$hiAttrStart.$key.'="'.$val.'"'.$hiAttrEnd;
+      }
+
+      ///////////////////////////////////////////
+      // Work out what goes before and after the tag content
+
+      $beforeTagContent = $currentIndent;
+      if ($shortGrandChild) $afterTagContent = '/>';
+      else                  $afterTagContent = '>';
+
+      // Check whether the xml-tag is to be hilighted.
+      if ($hilightIsActive) {
+        $currentXpath = $nodeStack['Parent'][$nodeStackIndex + 1]['xpath'];
+        if (in_array($currentXpath, $this->hilightXpathList)) {
+          // Yes we hilight
+          $beforeTagContent .= chr(2);
+          $afterTagContent  .= chr(3);
+        }
+      }
+      $beforeTagContent .= '<';
+//      if ($shortGrandChild) $afterTagContent .= $CR;
+      
+      ///////////////////////////////////////////
+      // Output the tag
+
+      $xmlOut .= $beforeTagContent
+                  .$nodeStack['Parent'][$nodeStackIndex + 1]['name'].$attrStr
+                  .$afterTagContent;
+
+      ///////////////////////////////////////////
+      // Carry on.            
+
+      // If it is a short tag, then we've already done this child, we just move to the next
+      if ($shortGrandChild) {
+        // Move to the next child, we need not go deeper in the tree.
+        $nodeStack['ChildIndex'][$nodeStackIndex]++;
+        // But if we are just exporting the one node we'd go no further.
+        if ($nodeStackIndex == 0) break;
+      } else {
+        // Else queue up the child going one deeper in the stack
+        $nodeStackIndex++;
+        // Start with it's first child
+        $nodeStack['ChildIndex'][$nodeStackIndex] = 0;
+      }
+    }
+
+    $result = $xmlOut;
+
+    // Repair what we "undid"
+    $OldPreceedingStringRef = $OldPreceedingStringValue;
+
+    ////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    return $result;
+  }
+     
+  //-----------------------------------------------------------------------------------------
+  // XPathEngine           ------ Import the XML Source ------                               
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Reads a file or URL and parses the XML data.
+   *
+   * Parse the XML source and (upon success) store the information into an internal structure.
+   *
+   * @param     $fileName (string) Path and name (or URL) of the file to be read and parsed.
+   * @return              (bool)   TRUE on success, FALSE on failure (check getLastError())
+   * @see       importFromString(), getLastError(), 
+   */
+  function importFromFile($fileName) {
+    $status = FALSE;
+    $errStr = '';
+    do { // try-block
+      // Remember file name. Used in error output to know in which file it happend
+      $this->properties['xmlFile'] = $fileName;
+      // If we already have content, then complain.
+      if (!empty($this->nodeRoot)) {
+        $errStr = 'Called when this object already contains xml data. Use reset().';
+        break; // try-block
+      }
+      // The the source is an url try to fetch it.
+      if (preg_match(';^http(s)?://;', $fileName)) {
+        // Read the content of the url...this is really prone to errors, and we don't really
+        // check for too many here...for now, suppressing both possible warnings...we need
+        // to check if we get a none xml page or something of that nature in the future
+        $xmlString = @implode('', @file($fileName));
+        if (!empty($xmlString)) {
+          $status = TRUE;
+        } else {
+          $errStr = "The url '{$fileName}' could not be found or read.";
+        }
+        break; // try-block
+      } 
+      
+      // Reaching this point we're dealing with a real file (not an url). Check if the file exists and is readable.
+      if (!is_readable($fileName)) { // Read the content from the file
+        $errStr = "File '{$fileName}' could not be found or read.";
+        break; // try-block
+      }
+      if (is_dir($fileName)) {
+        $errStr = "'{$fileName}' is a directory.";
+        break; // try-block
+      }
+      // Read the file
+      if (!($fp = @fopen($fileName, 'rb'))) {
+        $errStr = "Failed to open '{$fileName}' for read.";
+        break; // try-block
+      }
+      $xmlString = fread($fp, filesize($fileName));
+      @fclose($fp);
+      
+      $status = TRUE;
+    } while (FALSE);
+    
+    if (!$status) {
+      $this->_displayError('In importFromFile(): '. $errStr, __LINE__, __FILE__, FALSE);
+      return FALSE;
+    }
+    return $this->importFromString($xmlString);
+  }
+  
+  /**
+   * Reads a string and parses the XML data.
+   *
+   * Parse the XML source and (upon success) store the information into an internal structure.
+   * If a parent xpath is given this means that XML data is to be *appended* to that parent.
+   *
+   * ### If a function uses setLastError(), then say in the function header that getLastError() is useful.
+   *
+   * @param  $xmlString           (string) Name of the string to be read and parsed.
+   * @param  $absoluteParentPath  (string) Node to append data too (see above)
+   * @return                      (bool)   TRUE on success, FALSE on failure 
+   *                                       (check getLastError())
+   */
+  function importFromString($xmlString, $absoluteParentPath = '') {
+    $ThisFunctionName = 'importFromString';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Importing from string of length ".strlen($xmlString)." to node '$absoluteParentPath'\n<br>";
+      echo "Parser options:\n<br>";
+      print_r($this->parseOptions);
+    }
+
+    $status = FALSE;
+    $errStr = '';
+    do { // try-block
+      // If we already have content, then complain.
+      if (!empty($this->nodeRoot) AND empty($absoluteParentPath)) {
+        $errStr = 'Called when this object already contains xml data. Use reset() or pass the parent Xpath as 2ed param to where tie data will append.';
+        break; // try-block
+      }
+      // Check whether content has been read.
+      if (empty($xmlString)) {
+        // Nothing to do!!
+        $status = TRUE;
+        // If we were importing to root, build a blank root.
+        if (empty($absoluteParentPath)) {
+          $this->_createSuperRoot();
+        }
+        $this->reindexNodeTree();
+//        $errStr = 'This xml document (string) was empty';
+        break; // try-block
+      } else {
+        $xmlString = $this->_translateAmpersand($xmlString);
+      }
+      
+      // Restart our node index with a root entry.
+      $nodeStack = array();
+      $this->parseStackIndex = 0;
+
+      // If a parent xpath is given this means that XML data is to be *appended* to that parent.
+      if (!empty($absoluteParentPath)) {
+        // Check if parent exists
+        if (!isSet($this->nodeIndex[$absoluteParentPath])) {
+          $errStr = "You tried to append XML data to a parent '$absoluteParentPath' that does not exist.";
+          break; // try-block
+        } 
+        // Add it as the starting point in our array.
+        $this->nodeStack[0] =& $this->nodeIndex[$absoluteParentPath];
+      } else {
+        // Build a 'super-root'
+        $this->_createSuperRoot();
+        // Put it in as the start of our node stack.
+        $this->nodeStack[0] =& $this->nodeRoot;
+      }
+
+      // Point our text buffer reference at the next text part of the root
+      $this->parsedTextLocation =& $this->nodeStack[0]['textParts'][];
+      $this->parsInCData = 0;
+      // We cache this now.
+      $this->parseSkipWhiteCache = isSet($this->parseOptions[XML_OPTION_SKIP_WHITE]) ? $this->parseOptions[XML_OPTION_SKIP_WHITE] : FALSE;
+      
+      // Create an XML parser.
+      $parser = xml_parser_create();
+      // Set default XML parser options.
+      if (is_array($this->parseOptions)) {
+        foreach($this->parseOptions as $key => $val) {
+          xml_parser_set_option($parser, $key, $val);
+        }
+      }
+      
+      // Set the object and the element handlers for the XML parser.
+      xml_set_object($parser, $this);
+      xml_set_element_handler($parser, '_handleStartElement', '_handleEndElement');
+      xml_set_character_data_handler($parser, '_handleCharacterData');
+      xml_set_default_handler($parser, '_handleDefaultData');
+      xml_set_processing_instruction_handler($parser, '_handlePI');
+     
+      // Parse the XML source and on error generate an error message.
+      if (!xml_parse($parser, $xmlString, TRUE)) {
+        $source = empty($this->properties['xmlFile']) ? 'string' : 'file ' . basename($this->properties['xmlFile']) . "'";
+        $errStr = "XML error in given {$source} on line ".
+               xml_get_current_line_number($parser). '  column '. xml_get_current_column_number($parser) .
+               '. Reason:'. xml_error_string(xml_get_error_code($parser));
+        break; // try-block
+      }
+      
+      // Free the parser.
+      @xml_parser_free($parser);
+      // And we don't need this any more.
+      $this->nodeStack = array();
+
+      $this->reindexNodeTree();
+
+      if ($bDebugThisFunction) {
+        print_r(array_keys($this->nodeIndex));
+      }
+
+      $status = TRUE;
+    } while (FALSE);
+    
+    if (!$status) {
+      $this->_displayError('In importFromString(): '. $errStr, __LINE__, __FILE__, FALSE);
+      $bResult = FALSE;
+    } else {
+      $bResult = TRUE;
+    }
+
+    ////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $bResult, $bDebugThisFunction);
+
+    return $bResult;
+  }
+  
+  
+  //-----------------------------------------------------------------------------------------
+  // XPathEngine               ------  XML Handlers  ------                                  
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Handles opening XML tags while parsing.
+   *
+   * While parsing a XML document for each opening tag this method is
+   * called. It'll add the tag found to the tree of document nodes.
+   *
+   * @param $parser     (int)    Handler for accessing the current XML parser.
+   * @param $name       (string) Name of the opening tag found in the document.
+   * @param $attributes (array)  Associative array containing a list of
+   *                             all attributes of the tag found in the document.
+   * @see _handleEndElement(), _handleCharacterData()
+   */
+  function _handleStartElement($parser, $nodeName, $attributes) {
+    if (empty($nodeName)) {
+      $this->_displayError('XML error in file at line'. xml_get_current_line_number($parser) .'. Empty name.', __LINE__, __FILE__);
+      return;
+    }
+
+    // Trim accumulated text if necessary.
+    if ($this->parseSkipWhiteCache) {
+      $iCount = count($this->nodeStack[$this->parseStackIndex]['textParts']);
+      $this->nodeStack[$this->parseStackIndex]['textParts'][$iCount-1] = rtrim($this->parsedTextLocation);
+    } 
+
+    if ($this->bDebugXmlParse) {
+      echo "<blockquote>" . htmlspecialchars("Start node: <".$nodeName . ">")."<br>";
+      echo "Appended to stack entry: $this->parseStackIndex<br>\n";
+      echo "Text part before element is: ".htmlspecialchars($this->parsedTextLocation);
+      /*
+      echo "<pre>";
+      $dataPartsCount = count($this->nodeStack[$this->parseStackIndex]['textParts']);
+      for ($i = 0; $i < $dataPartsCount; $i++) {
+        echo "$i:". htmlspecialchars($this->nodeStack[$this->parseStackIndex]['textParts'][$i])."\n";
+      }
+      echo "</pre>";
+      */
+    }
+
+    // Add a node and set path to current.
+    if (!$this->_internalAppendChild($this->parseStackIndex, $nodeName)) {
+      $this->_displayError('Internal error during parse of XML file at line'. xml_get_current_line_number($parser) .'. Empty name.', __LINE__, __FILE__);
+      return;
+    }    
+
+    // We will have gone one deeper then in the stack.
+    $this->parseStackIndex++;
+
+    // Point our parseTxtBuffer reference at the new node.
+    $this->parsedTextLocation =& $this->nodeStack[$this->parseStackIndex]['textParts'][0];
+    
+    // Set the attributes.
+    if (!empty($attributes)) {
+      if ($this->bDebugXmlParse) {
+        echo 'Attributes: <br>';
+        print_r($attributes);
+        echo '<br>';
+      }
+      $this->nodeStack[$this->parseStackIndex]['attributes'] = $attributes;
+    }
+  }
+  
+  /**
+   * Handles closing XML tags while parsing.
+   *
+   * While parsing a XML document for each closing tag this method is called.
+   *
+   * @param $parser (int)    Handler for accessing the current XML parser.
+   * @param $name   (string) Name of the closing tag found in the document.
+   * @see       _handleStartElement(), _handleCharacterData()
+   */
+  function _handleEndElement($parser, $name) {
+    if (($this->parsedTextLocation=='') 
+        && empty($this->nodeStack[$this->parseStackIndex]['textParts'])) {
+      // We reach this point when parsing a tag of format <foo/>. The 'textParts'-array 
+      // should stay empty and not have an empty string in it.
+    } else {
+      // Trim accumulated text if necessary.
+      if ($this->parseSkipWhiteCache) {
+        $iCount = count($this->nodeStack[$this->parseStackIndex]['textParts']);
+        $this->nodeStack[$this->parseStackIndex]['textParts'][$iCount-1] = rtrim($this->parsedTextLocation);
+      }
+    }
+
+    if ($this->bDebugXmlParse) {
+      echo "Text part after element is: ".htmlspecialchars($this->parsedTextLocation)."<br>\n";
+      echo htmlspecialchars("Parent:<{$this->parseStackIndex}>, End-node:</$name> '".$this->parsedTextLocation) . "'<br>Text nodes:<pre>\n";
+      $dataPartsCount = count($this->nodeStack[$this->parseStackIndex]['textParts']);
+      for ($i = 0; $i < $dataPartsCount; $i++) {
+        echo "$i:". htmlspecialchars($this->nodeStack[$this->parseStackIndex]['textParts'][$i])."\n";
+      }
+      var_dump($this->nodeStack[$this->parseStackIndex]['textParts']);
+      echo "</pre></blockquote>\n";
+    }
+
+    // Jump back to the parent element.
+    $this->parseStackIndex--;
+
+    // Set our reference for where we put any more whitespace
+    $this->parsedTextLocation =& $this->nodeStack[$this->parseStackIndex]['textParts'][];
+
+    // Note we leave the entry in the stack, as it will get blanked over by the next element
+    // at this level.  The safe thing to do would be to remove it too, but in the interests 
+    // of performance, we will not bother, as were it to be a problem, then it would be an
+    // internal bug anyway.
+    if ($this->parseStackIndex < 0) {
+      $this->_displayError('Internal error during parse of XML file at line'. xml_get_current_line_number($parser) .'. Empty name.', __LINE__, __FILE__);
+      return;
+    }    
+  }
+  
+  /**
+   * Handles character data while parsing.
+   *
+   * While parsing a XML document for each character data this method
+   * is called. It'll add the character data to the document tree.
+   *
+   * @param $parser (int)    Handler for accessing the current XML parser.
+   * @param $text   (string) Character data found in the document.
+   * @see       _handleStartElement(), _handleEndElement()
+   */
+  function _handleCharacterData($parser, $text) {
+  
+    if ($this->parsInCData >0) $text = $this->_translateAmpersand($text, $reverse=TRUE);
+    
+    if ($this->bDebugXmlParse) echo "Handling character data: '".htmlspecialchars($text)."'<br>";
+    if ($this->parseSkipWhiteCache AND !empty($text) AND !$this->parsInCData) {
+      // Special case CR. CR always comes in a separate data. Trans. it to '' or ' '. 
+      // If txtBuffer is already ending with a space use '' otherwise ' '.
+      $bufferHasEndingSpace = (empty($this->parsedTextLocation) OR substr($this->parsedTextLocation, -1) === ' ') ? TRUE : FALSE;
+      if ($text=="\n") {
+        $text = $bufferHasEndingSpace ? '' : ' ';
+      } else {
+        if ($bufferHasEndingSpace) {
+          $text = ltrim(preg_replace('/\s+/', ' ', $text));
+        } else {
+          $text = preg_replace('/\s+/', ' ', $text);
+        }
+      }
+      if ($this->bDebugXmlParse) echo "'Skip white space' is ON. reduced to : '" .htmlspecialchars($text) . "'<br>";
+    }
+    $this->parsedTextLocation .= $text;
+  }
+  
+  /**
+   * Default handler for the XML parser.  
+   *
+   * While parsing a XML document for string not caught by one of the other
+   * handler functions, we end up here.
+   *
+   * @param $parser (int)    Handler for accessing the current XML parser.
+   * @param $text   (string) Character data found in the document.
+   * @see       _handleStartElement(), _handleEndElement()
+   */
+  function _handleDefaultData($parser, $text) {
+    do { // try-block
+      if (!strcmp($text, '<![CDATA[')) {
+        $this->parsInCData++;
+      } elseif (!strcmp($text, ']]>')) {
+        $this->parsInCData--;
+        if ($this->parsInCData < 0) $this->parsInCData = 0;
+      }
+      $this->parsedTextLocation .= $this->_translateAmpersand($text, $reverse=TRUE);
+      if ($this->bDebugXmlParse) echo "Default handler data: ".htmlspecialchars($text)."<br>";    
+      break; // try-block
+    } while (FALSE); // END try-block
+  }
+  
+  /**
+   * Handles processing instruction (PI)
+   *
+   * A processing instruction has the following format: 
+   * <?  target data  ? > e.g.  <? dtd version="1.0" ? >
+   *
+   * Currently I have no bether idea as to left it 'as is' and treat the PI data as normal 
+   * text (and adding the surrounding PI-tags <? ? >). 
+   *
+   * @param     $parser (int)    Handler for accessing the current XML parser.
+   * @param     $target (string) Name of the PI target. E.g. XML, PHP, DTD, ... 
+   * @param     $data   (string) Associative array containing a list of
+   * @see       PHP's manual "xml_set_processing_instruction_handler"
+   */
+  function _handlePI($parser, $target, $data) {
+    //echo("pi data=".$data."end"); exit;
+    $data = $this->_translateAmpersand($data, $reverse=TRUE);
+    $this->parsedTextLocation .= "<?{$target} {$data}?>";
+    return TRUE;
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPathEngine          ------  Node Tree Stuff  ------                                    
+  //-----------------------------------------------------------------------------------------
+
+  /**
+   * Creates a super root node.
+   */
+  function _createSuperRoot() {
+    // Build a 'super-root'
+    $this->nodeRoot = $this->emptyNode;
+    $this->nodeRoot['name']      = '';
+    $this->nodeRoot['parentNode'] = NULL;
+    $this->nodeIndex[''] =& $this->nodeRoot;
+  }
+
+  /**
+   * Adds a new node to the XML document tree during xml parsing.
+   *
+   * This method adds a new node to the tree of nodes of the XML document
+   * being handled by this class. The new node is created according to the
+   * parameters passed to this method.  This method is a much watered down
+   * version of appendChild(), used in parsing an xml file only.
+   * 
+   * It is assumed that adding starts with root and progresses through the
+   * document in parse order.  New nodes must have a corresponding parent. And
+   * once we have read the </> tag for the element we will never need to add
+   * any more data to that node.  Otherwise the add will be ignored or fail.
+   *
+   * The function is faciliated by a nodeStack, which is an array of nodes that
+   * we have yet to close.
+   *
+   * @param   $stackParentIndex (int)    The index into the nodeStack[] of the parent
+   *                                     node to which the new node should be added as 
+   *                                     a child. *READONLY*
+   * @param   $nodeName         (string) Name of the new node. *READONLY*
+   * @return                    (bool)   TRUE if we successfully added a new child to 
+   *                                     the node stack at index $stackParentIndex + 1,
+   *                                     FALSE on error.
+   */
+  function _internalAppendChild($stackParentIndex, $nodeName) {
+    // This call is likely to be executed thousands of times, so every 0.01ms counts.
+    // If you want to debug this function, you'll have to comment the stuff back in
+    //$bDebugThisFunction = FALSE;
+    
+    /*
+    $ThisFunctionName = '_internalAppendChild';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Current Node (parent-index) and the child to append : '{$stackParentIndex}' +  '{$nodeName}' \n<br>";
+    }
+    */
+     //////////////////////////////////////
+
+    if (!isSet($this->nodeStack[$stackParentIndex])) {
+      $errStr = "Invalid parent. You tried to append the tag '{$nodeName}' to an non-existing parent in our node stack '{$stackParentIndex}'.";
+      $this->_displayError('In _internalAppendChild(): '. $errStr, __LINE__, __FILE__, FALSE); 
+
+      /*
+      $this->_closeDebugFunction($ThisFunctionName, FALSE, $bDebugThisFunction);
+      */
+
+      return FALSE;
+    }
+
+    // Retrieve the parent node from the node stack.  This is the last node at that 
+    // depth that we have yet to close.  This is where we should add the text/node.
+    $parentNode =& $this->nodeStack[$stackParentIndex];
+          
+    // Brand new node please
+    $newChildNode = $this->emptyNode;
+    
+    // Save the vital information about the node.
+    $newChildNode['name'] = $nodeName;
+    $parentNode['childNodes'][] =& $newChildNode;
+    
+    // Add to our node stack
+    $this->nodeStack[$stackParentIndex + 1] =& $newChildNode;
+
+    /*
+    if ($bDebugThisFunction) {
+      echo "The new node received index: '".($stackParentIndex + 1)."'\n";
+      foreach($this->nodeStack as $key => $val) echo "$key => ".$val['name']."\n"; 
+    }
+    $this->_closeDebugFunction($ThisFunctionName, TRUE, $bDebugThisFunction);
+    */
+
+    return TRUE;
+  }
+  
+  /**
+   * Update nodeIndex and every node of the node-tree. 
+   *
+   * Call after you have finished any tree modifications other wise a match with 
+   * an xPathQuery will produce wrong results.  The $this->nodeIndex[] is recreated 
+   * and every nodes optimization data is updated.  The optimization data is all the
+   * data that is duplicate information, would just take longer to find. Child nodes 
+   * with value NULL are removed from the tree.
+   *
+   * By default the modification functions in this component will automatically re-index
+   * the nodes in the tree.  Sometimes this is not the behaver you want. To surpress the 
+   * reindex, set the functions $autoReindex to FALSE and call reindexNodeTree() at the 
+   * end of your changes.  This sometimes leads to better code (and less CPU overhead).
+   *
+   * Sample:
+   * =======
+   * Given the xml is <AAA><B/>.<B/>.<B/></AAA> | Goal is <AAA>.<B/>.</AAA>  (Delete B[1] and B[3])
+   *   $xPathSet = $xPath->match('//B'); # Will result in array('/AAA[1]/B[1]', '/AAA[1]/B[2]', '/AAA[1]/B[3]');
+   * Three ways to do it.
+   * 1) Top-Down  (with auto reindexing) - Safe, Slow and you get easily mix up with the the changing node index
+   *    removeChild('/AAA[1]/B[1]'); // B[1] removed, thus all B[n] become B[n-1] !!
+   *    removeChild('/AAA[1]/B[2]'); // Now remove B[2] (That originaly was B[3])
+   * 2) Bottom-Up (with auto reindexing) -  Safe, Slow and the changing node index (caused by auto-reindex) can be ignored.
+   *    for ($i=sizeOf($xPathSet)-1; $i>=0; $i--) {
+   *      if ($i==1) continue; 
+   *      removeChild($xPathSet[$i]);
+   *    }
+   * 3) // Top-down (with *NO* auto reindexing) - Fast, Safe as long as you call reindexNodeTree()
+   *    foreach($xPathSet as $xPath) {
+   *      // Specify no reindexing
+   *      if ($xPath == $xPathSet[1]) continue; 
+   *      removeChild($xPath, $autoReindex=FALSE);
+   *      // The object is now in a slightly inconsistent state.
+   *    }
+   *    // Finally do the reindex and the object is consistent again
+   *    reindexNodeTree();
+   *
+   * @return (bool) TRUE on success, FALSE otherwise.
+   * @see _recursiveReindexNodeTree()
+   */
+  function reindexNodeTree() {
+    //return;
+    $this->_indexIsDirty = FALSE;
+    $this->nodeIndex = array();
+    $this->nodeIndex[''] =& $this->nodeRoot;
+    // Quick out for when the tree has no data.
+    if (empty($this->nodeRoot)) return TRUE;
+    return $this->_recursiveReindexNodeTree('');
+  }
+  
+
+  /**
+   * Create the ids that are accessable through the generate-id() function
+   */
+  function _generate_ids() {
+    // If we have generated them already, then bail.
+    if (isset($this->nodeIndex['']['generate_id'])) return;
+
+    // keys generated are the string 'id0' . hexatridecimal-based (0..9,a-z) index
+    $aNodeIndexes = array_keys($this->nodeIndex);
+    $idNumber = 0;
+    foreach($aNodeIndexes as $index => $key) {
+//      $this->nodeIndex[$key]['generated_id'] = 'id' . base_convert($index,10,36);
+      // Skip attribute and text nodes.
+      // ### Currently don't support attribute and text nodes.
+      if (strstr($key, 'text()') !== FALSE) continue;
+      if (strstr($key, 'attribute::') !== FALSE) continue;
+      $this->nodeIndex[$key]['generated_id'] = 'idPhpXPath' . $idNumber;
+
+      // Make the id's sequential so that we can test predictively.
+      $idNumber++;
+    }
+  }
+
+  /**
+   * Here's where the work is done for reindexing (see reindexNodeTree)
+   *
+   * @param  $absoluteParentPath (string) the xPath to the parent node
+   * @return                     (bool)   TRUE on success, FALSE otherwise.
+   * @see reindexNodeTree()
+   */
+  function _recursiveReindexNodeTree($absoluteParentPath) {
+    $parentNode =& $this->nodeIndex[$absoluteParentPath];
+    
+    // Check for any 'dead' child nodes first and concate the text parts if found.
+    for ($iChildIndex=sizeOf($parentNode['childNodes'])-1; $iChildIndex>=0; $iChildIndex--) {
+      // Check if the child node still exits (it may have been removed).
+      if (!empty($parentNode['childNodes'][$iChildIndex])) continue;
+      // Child node was removed. We got to merge the text parts then.
+      $parentNode['textParts'][$iChildIndex] .= $parentNode['textParts'][$iChildIndex+1];
+      array_splice($parentNode['textParts'], $iChildIndex+1, 1); 
+      array_splice($parentNode['childNodes'], $iChildIndex, 1);
+    }
+
+    // Now start a reindex.
+    $contextHash = array();
+    $childSize = sizeOf($parentNode['childNodes']);
+
+    // If there are no children, we have to treat this specially:
+    if ($childSize == 0) {
+      // Add a dummy text node.
+      $this->nodeIndex[$absoluteParentPath.'/text()[1]'] =& $parentNode;
+    } else {
+      for ($iChildIndex=0; $iChildIndex<$childSize; $iChildIndex++) {
+        $childNode =& $parentNode['childNodes'][$iChildIndex];
+        // Make sure that there is a text-part in front of every node. (May be empty)
+        if (!isSet($parentNode['textParts'][$iChildIndex])) $parentNode['textParts'][$iChildIndex] = '';
+        // Count the nodes with same name (to determine their context position)
+        $childName = $childNode['name'];
+        if (empty($contextHash[$childName])) { 
+          $contextPos = $contextHash[$childName] = 1;
+        } else {
+          $contextPos = ++$contextHash[$childName];
+        }
+        // Make the node-index hash
+        $newPath = $absoluteParentPath . '/' . $childName . '['.$contextPos.']';
+
+        // ### Note ultimately we will end up supporting text nodes as actual nodes.
+
+        // Preceed with a dummy entry for the text node.
+        $this->nodeIndex[$absoluteParentPath.'/text()['.($childNode['pos']+1).']'] =& $childNode;
+        // Then the node itself
+        $this->nodeIndex[$newPath] =& $childNode;
+
+        // Now some dummy nodes for each of the attribute nodes.
+        $iAttributeCount = sizeOf($childNode['attributes']);
+        if ($iAttributeCount > 0) {
+          $aAttributesNames = array_keys($childNode['attributes']);
+          for ($iAttributeIndex = 0; $iAttributeIndex < $iAttributeCount; $iAttributeIndex++) {
+            $attribute = $aAttributesNames[$iAttributeIndex];
+            $newAttributeNode = $this->emptyNode;
+            $newAttributeNode['name'] = $attribute;
+            $newAttributeNode['textParts'] = array($childNode['attributes'][$attribute]);
+            $newAttributeNode['contextPos'] = $iAttributeIndex;
+            $newAttributeNode['xpath'] = "$newPath/attribute::$attribute";
+            $newAttributeNode['parentNode'] =& $childNode;
+            $newAttributeNode['depth'] =& $parentNode['depth'] + 2;
+            // Insert the node as a master node, not a reference, otherwise there will be 
+            // variable "bleeding".
+            $this->nodeIndex["$newPath/attribute::$attribute"] = $newAttributeNode;
+          }
+        }
+
+        // Update the node info (optimisation)
+        $childNode['parentNode'] =& $parentNode;
+        $childNode['depth'] = $parentNode['depth'] + 1;
+        $childNode['pos'] = $iChildIndex;
+        $childNode['contextPos'] = $contextHash[$childName];
+        $childNode['xpath'] = $newPath;
+        $this->_recursiveReindexNodeTree($newPath);
+
+        // Follow with a dummy entry for the text node.
+        $this->nodeIndex[$absoluteParentPath.'/text()['.($childNode['pos']+2).']'] =& $childNode;
+      }
+
+      // Make sure that their is a text-part after the last node.
+      if (!isSet($parentNode['textParts'][$iChildIndex])) $parentNode['textParts'][$iChildIndex] = '';
+    }
+
+    return TRUE;
+  }
+  
+  /** 
+   * Clone a node and it's child nodes.
+   *
+   * NOTE: If the node has children you *MUST* use the reference operator!
+   *       E.g. $clonedNode =& cloneNode($node);
+   *       Otherwise the children will not point back to the parent, they will point 
+   *       back to your temporary variable instead.
+   *
+   * @param   $node (mixed)  Either a node (hash array) or an abs. Xpath to a node in 
+   *                         the current doc
+   * @return        (&array) A node and it's child nodes.
+   */
+  function &cloneNode($node, $recursive=FALSE) {
+    if (is_string($node) AND isSet($this->nodeIndex[$node])) {
+      $node = $this->nodeIndex[$node];
+    }
+    // Copy the text-parts ()
+    $textParts = $node['textParts'];
+    $node['textParts'] = array();
+    foreach ($textParts as $key => $val) {
+      $node['textParts'][] = $val;
+    }
+    
+    $childSize = sizeOf($node['childNodes']);
+    for ($i=0; $i<$childSize; $i++) {
+      $childNode =& $this->cloneNode($node['childNodes'][$i], TRUE);  // copy child 
+      $node['childNodes'][$i] =& $childNode; // reference the copy
+      $childNode['parentNode'] =& $node;      // child references the parent.
+    }
+    
+    if (!$recursive) {
+      //$node['childNodes'][0]['parentNode'] = null;
+      //print "<pre>";
+      //var_dump($node);
+    }
+    return $node;
+  }
+  
+  
+/** Nice to have but __sleep() has a bug. 
+    (2002-2 PHP V4.1. See bug #15350)
+  
+  /**
+   * PHP cals this function when you call PHP's serialize. 
+   *
+   * It prevents cyclic referencing, which is why print_r() of an XPath object doesn't work.
+   *
+  function __sleep() {
+    // Destroy recursive pointers
+    $keys = array_keys($this->nodeIndex);
+    $size = sizeOf($keys);
+    for ($i=0; $i<$size; $i++) {
+      unset($this->nodeIndex[$keys[$i]]['parentNode']);
+    }
+    unset($this->nodeIndex);
+  }
+  
+  /**
+   * PHP cals this function when you call PHP's unserialize. 
+   *
+   * It reindexes the node-tree
+   *
+  function __wakeup() {
+    $this->reindexNodeTree();
+  }
+  
+*/
+  
+  //-----------------------------------------------------------------------------------------
+  // XPath            ------  XPath Query / Evaluation Handlers  ------                      
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Matches (evaluates) an XPath query
+   *
+   * This method tries to evaluate an XPath query by parsing it. A XML source must 
+   * have been imported before this method is able to work.
+   *
+   * @param     $xPathQuery  (string) XPath query to be evaluated.
+   * @param     $baseXPath   (string) (default is super-root) XPath query to a single document node, 
+   *                                  from which the XPath query should  start evaluating.
+   * @return                 (mixed)  The result of the XPath expression.  Either:
+   *                                    node-set (an ordered collection of absolute references to nodes without duplicates) 
+   *                                    boolean (true or false) 
+   *                                    number (a floating-point number) 
+   *                                    string (a sequence of UCS characters) 
+   */
+  function match($xPathQuery, $baseXPath='') {
+    if ($this->_indexIsDirty) $this->reindexNodeTree();
+    
+    // Replace a double slashes, because they'll cause problems otherwise.
+    static $slashes2descendant = array(
+        '//@' => '/descendant_or_self::*/attribute::', 
+        '//'  => '/descendant_or_self::node()/', 
+        '/@'  => '/attribute::');
+    // Stupid idea from W3C to take axes name containing a '-' (dash) !!!
+    // We replace the '-' with '_' to avoid the conflict with the minus operator.
+    static $dash2underscoreHash = array( 
+        '-sibling'    => '_sibling', 
+        '-or-'        => '_or_',
+        'starts-with' => 'starts_with', 
+        'substring-before' => 'substring_before',
+        'substring-after'  => 'substring_after', 
+        'string-length'    => 'string_length',
+        'normalize-space'  => 'normalize_space',
+        'x-lower'          => 'x_lower',
+        'x-upper'          => 'x_upper',
+        'generate-id'      => 'generate_id');
+    
+    if (empty($xPathQuery)) return array();
+
+    // Special case for when document is empty.
+    if (empty($this->nodeRoot)) return array();
+
+    if (!isSet($this->nodeIndex[$baseXPath])) {
+            $xPathSet = $this->_resolveXPathQuery($baseXPath,'match');
+            if (sizeOf($xPathSet) !== 1) {
+                $this->_displayError(sprintf($this->errorStrings['NoNodeMatch'], $xPathQuery), __LINE__, __FILE__, FALSE);
+                return FALSE;
+            }
+            $baseXPath = $xPathSet[0];
+    }
+
+    // We should possibly do a proper syntactical parse, but instead we will cheat and just
+    // remove any literals that could make things very difficult for us, and replace them with
+    // special tags.  Then we can treat the xPathQuery much more easily as JUST "syntax".  Provided 
+    // there are no literals in the string, then we can guarentee that most of the operators and 
+    // syntactical elements are indeed elements and not just part of a literal string.
+    $processedxPathQuery = $this->_removeLiterals($xPathQuery);
+    
+    // Replace a double slashes, and '-' (dash) in axes names.
+    $processedxPathQuery = strtr($processedxPathQuery, $slashes2descendant);
+    $processedxPathQuery = strtr($processedxPathQuery, $dash2underscoreHash);
+
+    // Build the context
+    $context = array('nodePath' => $baseXPath, 'pos' => 1, 'size' => 1);
+
+    // The primary syntactic construct in XPath is the expression.
+    $result = $this->_evaluateExpr($processedxPathQuery, $context);
+
+    // We might have been returned a string.. If so convert back to a literal
+    $literalString = $this->_asLiteral($result);
+    if ($literalString != FALSE) return $literalString;
+    else return $result;
+  }
+
+  /**
+   * Alias for the match function
+   *
+   * @see match()
+   */
+  function evaluate($xPathQuery, $baseXPath='') {
+    return $this->match($xPathQuery, $baseXPath);
+  }
+
+  /**
+   * Parse out the literals of an XPath expression.
+   *
+   * Instead of doing a full lexical parse, we parse out the literal strings, and then
+   * Treat the sections of the string either as parts of XPath or literal strings.  So
+   * this function replaces each literal it finds with a literal reference, and then inserts
+   * the reference into an array of strings that we can access.  The literals can be accessed
+   * later from the literals associative array.
+   *
+   * Example:
+   *  XPathExpr = /AAA[@CCC = "hello"]/BBB[DDD = 'world'] 
+   *  =>  literals: array("hello", "world")
+   *      return value: /AAA[@CCC = $1]/BBB[DDD = $2] 
+   *
+   * Note: This does not interfere with the VariableReference syntactical element, as these 
+   * elements must not start with a number.
+   *
+   * @param  $xPathQuery  (string) XPath expression to be processed
+   * @return              (string) The XPath expression without the literals.
+   *                              
+   */
+  function _removeLiterals($xPathQuery) {
+    // What comes first?  A " or a '?
+    if (!preg_match(":^([^\"']*)([\"'].*)$:", $xPathQuery, $aMatches)) {
+      // No " or ' means no more literals.
+      return $xPathQuery;
+    }
+    
+    $result = $aMatches[1];
+    $remainder = $aMatches[2];
+    // What kind of literal?
+    if (preg_match(':^"([^"]*)"(.*)$:', $remainder, $aMatches)) {
+      // A "" literal.
+      $literal = $aMatches[1];
+      $remainder = $aMatches[2];
+    } else if (preg_match(":^'([^']*)'(.*)$:", $remainder, $aMatches)) {
+      // A '' literal.
+      $literal = $aMatches[1];
+      $remainder = $aMatches[2];
+    } else {
+      $this->_displayError("The '$xPathQuery' argument began a literal, but did not close it.", __LINE__, __FILE__);
+    }
+
+    // Store the literal
+    $literalNumber = count($this->axPathLiterals);
+    $this->axPathLiterals[$literalNumber] = $literal;
+    $result .= '$'.$literalNumber;
+    return $result.$this->_removeLiterals($remainder);
+  }
+
+  /**
+   * Returns the given string as a literal reference.
+   *
+   * @param $string (string) The string that we are processing
+   * @return        (mixed)  The literal string.  FALSE if the string isn't a literal reference.
+   */
+  function _asLiteral($string) {
+    if (empty($string)) return FALSE;
+    if (empty($string[0])) return FALSE;
+    if ($string[0] == '$') {
+      $remainder = substr($string, 1);
+      if (is_numeric($remainder)) {
+        // We have a string reference then.
+        $stringNumber = (int)$remainder;
+        if ($stringNumber >= count($this->axPathLiterals)) {
+            $this->_displayError("Internal error.  Found a string reference that we didn't set in xPathQuery: '$xPathQuery'.", __LINE__, __FILE__);
+            return FALSE;
+        }
+        return $this->axPathLiterals[$stringNumber];
+      }
+    }
+
+    // It's not a reference then.
+    return FALSE;
+  }
+  
+  /**
+   * Adds a literal to our array of literals
+   *
+   * In order to make sure we don't interpret literal strings as XPath expressions, we have to
+   * encode literal strings so that we know that they are not XPaths.
+   *
+   * @param $string (string) The literal string that we need to store for future access
+   * @return        (mixed)  A reference string to this literal.
+   */
+  function _addLiteral($string) {
+    // Store the literal
+    $literalNumber = count($this->axPathLiterals);
+    $this->axPathLiterals[$literalNumber] = $string;
+    $result = '$'.$literalNumber;
+    return $result;
+  }
+
+  /**
+   * Look for operators in the expression
+   *
+   * Parses through the given expression looking for operators.  If found returns
+   * the operands and the operator in the resulting array.
+   *
+   * @param  $xPathQuery  (string) XPath query to be evaluated.
+   * @return              (array)  If an operator is found, it returns an array containing
+   *                               information about the operator.  If no operator is found
+   *                               then it returns an empty array.  If an operator is found,
+   *                               but has invalid operands, it returns FALSE.
+   *                               The resulting array has the following entries:
+   *                                'operator' => The string version of operator that was found,
+   *                                              trimmed for whitespace
+   *                                'left operand' => The left operand, or empty if there was no
+   *                                              left operand for this operator.
+   *                                'right operand' => The right operand, or empty if there was no
+   *                                              right operand for this operator.
+   */
+  function _GetOperator($xPathQuery) {
+    $position = 0;
+    $operator = '';
+
+    // The results of this function can easily be cached.
+    static $aResultsCache = array();
+    if (isset($aResultsCache[$xPathQuery])) {
+      return $aResultsCache[$xPathQuery];
+    }
+
+    // Run through all operators and try to find one.
+    $opSize = sizeOf($this->operators);
+    for ($i=0; $i<$opSize; $i++) {
+      // Pick an operator to try.
+      $operator = $this->operators[$i];
+      // Quickcheck. If not present don't wast time searching 'the hard way'
+      if (strpos($xPathQuery, $operator)===FALSE) continue;
+      // Special check
+      $position = $this->_searchString($xPathQuery, $operator);
+      // Check whether a operator was found.
+      if ($position <= 0 ) continue;
+
+      // Check whether it's the equal operator.
+      if ($operator == '=') {
+        // Also look for other operators containing the equal sign.
+        switch ($xPathQuery[$position-1]) {
+          case '<' : 
+            $position--;
+            $operator = '<=';
+            break;
+          case '>' : 
+            $position--;
+            $operator = '>=';
+            break;
+          case '!' : 
+            $position--;
+            $operator = '!=';
+            break;
+          default:
+            // It's a pure = operator then.
+        }
+        break;
+      }
+
+      if ($operator == '*') {
+        // http://www.w3.org/TR/xpath#exprlex:
+        // "If there is a preceding token and the preceding token is not one of @, ::, (, [, 
+        // or an Operator, then a * must be recognized as a MultiplyOperator and an NCName must 
+        // be recognized as an OperatorName."
+
+        // Get some substrings.
+        $character = substr($xPathQuery, $position - 1, 1);
+      
+        // Check whether it's a multiply operator or a name test.
+        if (strchr('/@:([', $character) != FALSE) {
+          // Don't use the operator.
+            $position = -1;
+          continue;
+        } else {
+          // The operator is good.  Lets use it.
+          break;
+        }
+      }
+
+      // Extremely annoyingly, we could have a node name like "for-each" and we should not
+      // parse this as a "-" operator.  So if the first char of the right operator is alphabetic,
+      // then this is NOT an interger operator.
+      if (strchr('-+*', $operator) != FALSE) {
+        $rightOperand = trim(substr($xPathQuery, $position + strlen($operator)));
+        if (strlen($rightOperand) > 1) {
+          if (preg_match(':^\D$:', $rightOperand[0])) {
+            // Don't use the operator.
+            $position = -1;
+            continue;
+          } else {
+            // The operator is good.  Lets use it.
+            break;
+          }
+        }
+      }
+
+      // The operator must be good then :o)
+      break;
+
+    } // end while each($this->operators)
+
+    // Did we find an operator?
+    if ($position == -1) {
+      $aResultsCache[$xPathQuery] = array();
+      return array();
+    }
+
+    /////////////////////////////////////////////
+    // Get the operands
+
+    // Get the left and the right part of the expression.
+    $leftOperand  = trim(substr($xPathQuery, 0, $position));
+    $rightOperand = trim(substr($xPathQuery, $position + strlen($operator)));
+  
+    // Remove whitespaces.
+    $leftOperand  = trim($leftOperand);
+    $rightOperand = trim($rightOperand);
+
+    /////////////////////////////////////////////
+    // Check the operands.
+
+    if ($leftOperand == '') {
+      $aResultsCache[$xPathQuery] = FALSE;
+      return FALSE;
+    }
+
+    if ($rightOperand == '') {
+      $aResultsCache[$xPathQuery] = FALSE;
+      return FALSE;
+    }
+
+    // Package up and return what we found.
+    $aResult = array('operator' => $operator,
+                'left operand' => $leftOperand,
+                'right operand' => $rightOperand);
+
+    $aResultsCache[$xPathQuery] = $aResult;
+
+    return $aResult;
+  }
+
+  /**
+   * Evaluates an XPath PrimaryExpr
+   *
+   * http://www.w3.org/TR/xpath#section-Basics
+   *
+   *  [15]    PrimaryExpr    ::= VariableReference  
+   *                             | '(' Expr ')'  
+   *                             | Literal  
+   *                             | Number  
+   *                             | FunctionCall 
+   *
+   * @param  $xPathQuery  (string)   XPath query to be evaluated.
+   * @param  $context     (array)    The context from which to evaluate
+   * @param  $results     (mixed)    If the expression could be parsed and evaluated as one of these
+   *                                 syntactical elements, then this will be either:
+   *                                    - node-set (an ordered collection of nodes without duplicates) 
+   *                                    - boolean (true or false) 
+   *                                    - number (a floating-point number) 
+   *                                    - string (a sequence of UCS characters) 
+   * @return              (string)    An empty string if the query was successfully parsed and 
+   *                                  evaluated, else a string containing the reason for failing.
+   * @see    evaluate()
+   */
+  function _evaluatePrimaryExpr($xPathQuery, $context, &$result) {
+    $ThisFunctionName = '_evaluatePrimaryExpr';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Path: $xPathQuery\n";
+      echo "Context:";
+      $this->_printContext($context);
+      echo "\n";
+    }
+
+    // Certain expressions will never be PrimaryExpr, so to speed up processing, cache the
+    // results we do find from this function.
+    static $aResultsCache = array();
+    
+    // Do while false loop
+    $error = "";
+    // If the result is independant of context, then we can cache the result and speed this function
+    // up on future calls.
+    $bCacheableResult = FALSE;
+    do {
+      if (isset($aResultsCache[$xPathQuery])) {
+        $error = $aResultsCache[$xPathQuery]['Error'];
+        $result = $aResultsCache[$xPathQuery]['Result'];
+        break;
+      }
+
+      // VariableReference 
+      // ### Not supported.
+
+      // Is it a number?
+      // | Number  
+      if (is_numeric($xPathQuery)) {
+        $result = doubleval($xPathQuery);
+        $bCacheableResult = TRUE;
+        break;
+      }
+
+      // If it starts with $, and the remainder is a number, then it's a string.
+      // | Literal  
+      $literal = $this->_asLiteral($xPathQuery);
+      if ($literal !== FALSE) {
+        $result = $xPathQuery;
+        $bCacheableResult = TRUE;
+        break;
+      }
+
+      // Is it a function?
+      // | FunctionCall 
+      {
+        // Check whether it's all wrapped in a function.  will be like count(.*) where .* is anything
+        // text() will try to be matched here, so just explicitly ignore it
+        $regex = ":^([^\(\)\[\]/]*)\s*\((.*)\)$:U";
+        if (preg_match($regex, $xPathQuery, $aMatch) && $xPathQuery != "text()") {
+          $function = $aMatch[1];
+          $data     = $aMatch[2];
+          // It is possible that we will get "a() or b()" which will match as function "a" with
+          // arguments ") or b(" which is clearly wrong... _bracketsCheck() should catch this.
+          if ($this->_bracketsCheck($data)) {
+            if (in_array($function, $this->functions)) {
+              if ($bDebugThisFunction) echo "XPathExpr: $xPathQuery is a $function() function call:\n";
+              $result = $this->_evaluateFunction($function, $data, $context);
+              break;
+            } 
+          }
+        }
+      }
+
+      // Is it a bracketed expression?
+      // | '(' Expr ')'  
+      // If it is surrounded by () then trim the brackets
+      $bBrackets = FALSE;
+      if (preg_match(":^\((.*)\):", $xPathQuery, $aMatches)) {
+        // Do not keep trimming off the () as we could have "(() and ())"
+        $bBrackets = TRUE;
+        $xPathQuery = $aMatches[1];
+      }
+
+      if ($bBrackets) {
+        // Must be a Expr then.
+        $result = $this->_evaluateExpr($xPathQuery, $context);
+        break;
+      }
+
+      // Can't be a PrimaryExpr then.
+      $error = "Expression is not a PrimaryExpr";
+      $bCacheableResult = TRUE;
+    } while (FALSE);
+    //////////////////////////////////////////////    
+
+    // If possible, cache the result.
+    if ($bCacheableResult) {
+        $aResultsCache[$xPathQuery]['Error'] = $error;
+        $aResultsCache[$xPathQuery]['Result'] = $result;
+    }
+
+    $this->_closeDebugFunction($ThisFunctionName, array('result' => $result, 'error' => $error), $bDebugThisFunction);
+
+    // Return the result.
+    return $error;
+  }
+
+  /**
+   * Evaluates an XPath Expr
+   *
+   * $this->evaluate() is the entry point and does some inits, while this 
+   * function is called recursive internaly for every sub-xPath expresion we find.
+   * It handles the following syntax, and calls evaluatePathExpr if it finds that none
+   * of this grammer applies.
+   *
+   * http://www.w3.org/TR/xpath#section-Basics
+   *
+   * [14]    Expr               ::= OrExpr 
+   * [21]    OrExpr             ::= AndExpr  
+   *                                | OrExpr 'or' AndExpr  
+   * [22]    AndExpr            ::= EqualityExpr  
+   *                                | AndExpr 'and' EqualityExpr  
+   * [23]    EqualityExpr       ::= RelationalExpr  
+   *                                | EqualityExpr '=' RelationalExpr  
+   *                                | EqualityExpr '!=' RelationalExpr  
+   * [24]    RelationalExpr     ::= AdditiveExpr  
+   *                                | RelationalExpr '<' AdditiveExpr  
+   *                                | RelationalExpr '>' AdditiveExpr  
+   *                                | RelationalExpr '<=' AdditiveExpr  
+   *                                | RelationalExpr '>=' AdditiveExpr  
+   * [25]    AdditiveExpr       ::= MultiplicativeExpr  
+   *                                | AdditiveExpr '+' MultiplicativeExpr  
+   *                                | AdditiveExpr '-' MultiplicativeExpr  
+   * [26]    MultiplicativeExpr ::= UnaryExpr  
+   *                                | MultiplicativeExpr MultiplyOperator UnaryExpr  
+   *                                | MultiplicativeExpr 'div' UnaryExpr  
+   *                                | MultiplicativeExpr 'mod' UnaryExpr  
+   * [27]    UnaryExpr          ::= UnionExpr  
+   *                                | '-' UnaryExpr 
+   * [18]    UnionExpr          ::= PathExpr  
+   *                                | UnionExpr '|' PathExpr 
+   *
+   * NOTE: The effect of the above grammar is that the order of precedence is 
+   * (lowest precedence first): 
+   * 1) or 
+   * 2) and 
+   * 3) =, != 
+   * 4) <=, <, >=, > 
+   * 5) +, -
+   * 6) *, div, mod
+   * 7) - (negate)
+   * 8) |
+   *
+   * @param  $xPathQuery  (string)   XPath query to be evaluated.
+   * @param  $context     (array)    An associative array the describes the context from which
+   *                                 to evaluate the XPath Expr.  Contains three members:
+   *                                  'nodePath' => The absolute XPath expression to the context node
+   *                                  'size' => The context size
+   *                                  'pos' => The context position
+   * @return              (mixed)    The result of the XPath expression.  Either:
+   *                                 node-set (an ordered collection of nodes without duplicates) 
+   *                                 boolean (true or false) 
+   *                                 number (a floating-point number) 
+   *                                 string (a sequence of UCS characters) 
+   * @see    evaluate()
+   */
+  function _evaluateExpr($xPathQuery, $context) {
+    $ThisFunctionName = '_evaluateExpr';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Path: $xPathQuery\n";
+      echo "Context:";
+      $this->_printContext($context);
+      echo "\n";    
+    }
+
+    // Numpty check
+    if (!isset($xPathQuery) || ($xPathQuery == '')) {
+      $this->_displayError("The \$xPathQuery argument must have a value.", __LINE__, __FILE__);
+      return FALSE;
+    }
+
+    // At the top level we deal with booleans.  Only if the Expr is just an AdditiveExpr will 
+    // the result not be a boolean.
+    //
+    //
+    // Between these syntactical elements we get PathExprs.
+
+    // Do while false loop
+    do {
+      static $aKnownPathExprCache = array();
+
+      if (isset($aKnownPathExprCache[$xPathQuery])) {
+        if ($bDebugThisFunction) echo "XPathExpr is a PathExpr\n";
+        $result = $this->_evaluatePathExpr($xPathQuery, $context);
+        break;
+      }
+
+      // Check for operators first, as we could have "() op ()" and the PrimaryExpr will try to
+      // say that that is an Expr called ") op ("
+      // Set the default position and the type of the operator.
+      $aOperatorInfo = $this->_GetOperator($xPathQuery);
+
+      // An expression can be one of these, and we should catch these "first" as they are most common
+      if (empty($aOperatorInfo)) {
+        $error = $this->_evaluatePrimaryExpr($xPathQuery, $context, $result);
+        if (empty($error)) {
+          // It could be parsed as a PrimaryExpr, so look no further :o)
+          break;
+        }
+      }
+
+      // Check whether an operator was found.
+      if (empty($aOperatorInfo)) {
+        if ($bDebugThisFunction) echo "XPathExpr is a PathExpr\n";
+        $aKnownPathExprCache[$xPathQuery] = TRUE;
+        // No operator.  Means we have a PathExpr then.  Go to the next level.
+        $result = $this->_evaluatePathExpr($xPathQuery, $context);
+        break;
+      } 
+
+      if ($bDebugThisFunction) { echo "\nFound and operator:"; print_r($aOperatorInfo); }//LEFT:[$leftOperand]  oper:[$operator]  RIGHT:[$rightOperand]";
+
+      $operator = $aOperatorInfo['operator'];
+
+      /////////////////////////////////////////////
+      // Recursively process the operator
+
+      // Check the kind of operator.
+      switch ($operator) {
+        case ' or ': 
+        case ' and ':
+          $operatorType = 'Boolean';
+          break;
+        case '+': 
+        case '-': 
+        case '*':
+        case ' div ':
+        case ' mod ':
+          $operatorType = 'Integer';
+          break;
+        case ' | ':
+          $operatorType = 'NodeSet';
+          break;
+        case '<=':
+        case '<': 
+        case '>=':
+        case '>':
+        case '=': 
+        case '!=':
+          $operatorType = 'Multi';
+          break;
+        default:
+            $this->_displayError("Internal error.  Default case of switch statement reached.", __LINE__, __FILE__);
+      }
+
+      if ($bDebugThisFunction) echo "\nOperator is a [$operator]($operatorType operator)";
+
+      /////////////////////////////////////////////
+      // Evaluate the operands
+
+      // Evaluate the left part.
+      if ($bDebugThisFunction) echo "\nEvaluating LEFT:[{$aOperatorInfo['left operand']}]\n";
+      $left = $this->_evaluateExpr($aOperatorInfo['left operand'], $context);
+      if ($bDebugThisFunction) {echo "{$aOperatorInfo['left operand']} evals as:\n"; print_r($left); }
+      
+      // If it is a boolean operator, it's possible we don't need to evaluate the right part.
+
+      // Only evaluate the right part if we need to.
+      $right = '';
+      if ($operatorType == 'Boolean') {
+        // Is the left part false?
+        $left = $this->_handleFunction_boolean($left, $context);
+        if (!$left and ($operator == ' and ')) {
+          $result = FALSE;
+          break;
+        } else if ($left and ($operator == ' or ')) {
+          $result = TRUE;
+          break;
+        }
+      } 
+
+      // Evaluate the right part
+      if ($bDebugThisFunction) echo "\nEvaluating RIGHT:[{$aOperatorInfo['right operand']}]\n";
+      $right = $this->_evaluateExpr($aOperatorInfo['right operand'], $context);
+      if ($bDebugThisFunction) {echo "{$aOperatorInfo['right operand']} evals as:\n"; print_r($right); echo "\n";}
+
+      /////////////////////////////////////////////
+      // Combine the operands
+
+      // If necessary, work out how to treat the multi operators
+      if ($operatorType != 'Multi') {
+        $result = $this->_evaluateOperator($left, $operator, $right, $operatorType, $context);
+      } else {
+        // http://www.w3.org/TR/xpath#booleans
+        // If both objects to be compared are node-sets, then the comparison will be true if and 
+        // only if there is a node in the first node-set and a node in the second node-set such 
+        // that the result of performing the comparison on the string-values of the two nodes is 
+        // true. 
+        // 
+        // If one object to be compared is a node-set and the other is a number, then the 
+        // comparison will be true if and only if there is a node in the node-set such that the 
+        // result of performing the comparison on the number to be compared and on the result of 
+        // converting the string-value of that node to a number using the number function is true. 
+        //
+        // If one object to be compared is a node-set and the other is a string, then the comparison 
+        // will be true if and only if there is a node in the node-set such that the result of performing 
+        // the comparison on the string-value of the node and the other string is true. 
+        // 
+        // If one object to be compared is a node-set and the other is a boolean, then the comparison 
+        // will be true if and only if the result of performing the comparison on the boolean and on 
+        // the result of converting the node-set to a boolean using the boolean function is true.
+        if (is_array($left) || is_array($right)) {
+          if ($bDebugThisFunction) echo "As one of the operands is an array, we will need to loop\n";
+          if (is_array($left) && is_array($right)) {
+            $operatorType = 'String';
+          } elseif (is_numeric($left) || is_numeric($right)) {
+            $operatorType = 'Integer';
+          } elseif (is_bool($left)) {
+            $operatorType = 'Boolean';
+            $right = $this->_handleFunction_boolean($right, $context);
+          } elseif (is_bool($right)) {
+            $operatorType = 'Boolean';
+            $left = $this->_handleFunction_boolean($left, $context);
+          } else {
+            $operatorType = 'String';
+          }
+          if ($bDebugThisFunction) echo "Equals operator is a $operatorType operator\n";
+          // Turn both operands into arrays to simplify logic
+          $aLeft = $left;
+          $aRight = $right;
+          if (!is_array($aLeft)) $aLeft = array($aLeft);
+          if (!is_array($aRight)) $aRight = array($aRight);
+          $result = FALSE;
+          if (!empty($aLeft)) {
+            foreach ($aLeft as $leftItem) {
+              if (empty($aRight)) break;
+              // If the item is from a node set, we should evaluate it's string-value
+              if (is_array($left)) {
+                if ($bDebugThisFunction) echo "\tObtaining string-value of LHS:$leftItem as it's from a nodeset\n";
+                $leftItem = $this->_stringValue($leftItem);
+              }
+              foreach ($aRight as $rightItem) {
+                // If the item is from a node set, we should evaluate it's string-value
+                if (is_array($right)) {
+                  if ($bDebugThisFunction) echo "\tObtaining string-value of RHS:$rightItem as it's from a nodeset\n";
+                  $rightItem = $this->_stringValue($rightItem);
+                }
+
+                if ($bDebugThisFunction) echo "\tEvaluating $leftItem $operator $rightItem\n";
+                $result = $this->_evaluateOperator($leftItem, $operator, $rightItem, $operatorType, $context);
+                if ($result === TRUE) break;
+              }
+              if ($result === TRUE) break;
+            }
+          }
+        } 
+        // When neither object to be compared is a node-set and the operator is = or !=, then the 
+        // objects are compared by converting them to a common type as follows and then comparing 
+        // them. 
+        //
+        // If at least one object to be compared is a boolean, then each object to be compared 
+        // is converted to a boolean as if by applying the boolean function. 
+        //
+        // Otherwise, if at least one object to be compared is a number, then each object to be 
+        // compared is converted to a number as if by applying the number function. 
+        //
+        // Otherwise, both objects to be compared are converted to strings as if by applying 
+        // the string function. 
+        //  
+        // The = comparison will be true if and only if the objects are equal; the != comparison 
+        // will be true if and only if the objects are not equal. Numbers are compared for equality 
+        // according to IEEE 754 [IEEE 754]. Two booleans are equal if either both are true or 
+        // both are false. Two strings are equal if and only if they consist of the same sequence 
+        // of UCS characters.
+        else {
+          if (is_bool($left) || is_bool($right)) {
+            $operatorType = 'Boolean';
+          } elseif (is_numeric($left) || is_numeric($right)) {
+            $operatorType = 'Integer';
+          } else {
+            $operatorType = 'String';
+          }
+          if ($bDebugThisFunction) echo "Equals operator is a $operatorType operator\n";
+          $result = $this->_evaluateOperator($left, $operator, $right, $operatorType, $context);
+        }
+      }
+
+    } while (FALSE);
+    //////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    // Return the result.
+    return $result;
+  }
+
+  /**
+   * Evaluate the result of an operator whose operands have been evaluated
+   *
+   * If the operator type is not "NodeSet", then neither the left or right operators 
+   * will be node sets, as the processing when one or other is an array is complex,
+   * and should be handled by the caller.
+   *
+   * @param  $left          (mixed)   The left operand
+   * @param  $right         (mixed)   The right operand
+   * @param  $operator      (string)  The operator to use to combine the operands
+   * @param  $operatorType  (string)  The type of the operator.  Either 'Boolean', 
+   *                                  'Integer', 'String', or 'NodeSet'
+   * @param  $context     (array)    The context from which to evaluate
+   * @return              (mixed)    The result of the XPath expression.  Either:
+   *                                 node-set (an ordered collection of nodes without duplicates) 
+   *                                 boolean (true or false) 
+   *                                 number (a floating-point number) 
+   *                                 string (a sequence of UCS characters) 
+   */
+  function _evaluateOperator($left, $operator, $right, $operatorType, $context) {
+    $ThisFunctionName = '_evaluateOperator';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "left: $left\n";
+      echo "right: $right\n";
+      echo "operator: $operator\n";
+      echo "operator type: $operatorType\n";
+    }
+
+    // Do while false loop
+    do {
+      // Handle the operator depending on the operator type.
+      switch ($operatorType) {
+        case 'Boolean':
+          {
+            // Boolify the arguments.  (The left arg is already a bool)
+            $right = $this->_handleFunction_boolean($right, $context);
+            switch ($operator) {
+              case '=': // Compare the two results.
+                $result = (bool)($left == $right); 
+                break;
+              case ' or ': // Return the two results connected by an 'or'.
+                $result = (bool)( $left or $right );
+                break;
+              case ' and ': // Return the two results connected by an 'and'.
+                $result = (bool)( $left and $right );
+                break;
+              case '!=': // Check whether the two results are not equal.
+                $result = (bool)( $left != $right );
+                break;
+              default:
+                $this->_displayError("Internal error.  Default case of switch statement reached.", __LINE__, __FILE__);
+            }
+          }
+          break;
+        case 'Integer':
+          {
+            // Convert both left and right operands into numbers.
+            if (empty($left) && ($operator == '-')) {
+              // There may be no left operator if the op is '-'
+              $left = 0;
+            } else {
+              $left = $this->_handleFunction_number($left, $context);
+            }
+            $right = $this->_handleFunction_number($right, $context);
+            if ($bDebugThisFunction) echo "\nLeft is $left, Right is $right\n";
+            switch ($operator) {
+              case '=': // Compare the two results.
+                $result = (bool)($left == $right); 
+                break;
+              case '!=': // Compare the two results.
+                $result = (bool)($left != $right); 
+                break;
+              case '+': // Return the result by adding one result to the other.
+                $result = $left + $right;
+                break;
+              case '-': // Return the result by decrease one result by the other.
+                $result = $left - $right;
+                break;
+              case '*': // Return a multiplication of the two results.
+                $result =  $left * $right;
+                break;
+              case ' div ': // Return a division of the two results.
+                $result = $left / $right;
+                break;
+              case ' mod ': // Return a modulo division of the two results.
+                $result = $left % $right;
+                break;
+              case '<=': // Compare the two results.
+                $result = (bool)( $left <= $right );
+                break;
+              case '<': // Compare the two results.
+                $result = (bool)( $left < $right );
+                break;
+              case '>=': // Compare the two results.
+                $result = (bool)( $left >= $right );
+                break;
+              case '>': // Compare the two results.
+                $result = (bool)( $left > $right );
+                break;
+              default:
+                $this->_displayError("Internal error.  Default case of switch statement reached.", __LINE__, __FILE__);
+            }
+          }
+          break;
+        case 'NodeSet':
+          // Add the nodes to the result set
+          $result = array_merge($left, $right);
+          // Remove duplicated nodes.
+          $result = array_unique($result);
+
+          // Preserve doc order if there was more than one query.
+          if (count($result) > 1) {
+            $result = $this->_sortByDocOrder($result);
+          }
+          break;
+        case 'String':
+            $left = $this->_handleFunction_string($left, $context);
+            $right = $this->_handleFunction_string($right, $context);
+            if ($bDebugThisFunction) echo "\nLeft is $left, Right is $right\n";
+            switch ($operator) {
+              case '=': // Compare the two results.
+                $result = (bool)($left == $right); 
+                break;
+              case '!=': // Compare the two results.
+                $result = (bool)($left != $right); 
+                break;
+              default:
+                $this->_displayError("Internal error.  Default case of switch statement reached.", __LINE__, __FILE__);
+            }
+          break;
+        default:
+          $this->_displayError("Internal error.  Default case of switch statement reached.", __LINE__, __FILE__);
+      }
+    } while (FALSE);
+
+    //////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    // Return the result.
+    return $result;
+  }
+  
+  /**
+   * Evaluates an XPath PathExpr
+   *
+   * It handles the following syntax:
+   *
+   * http://www.w3.org/TR/xpath#node-sets
+   * http://www.w3.org/TR/xpath#NT-LocationPath
+   * http://www.w3.org/TR/xpath#path-abbrev
+   * http://www.w3.org/TR/xpath#NT-Step
+   *
+   * [19]   PathExpr              ::= LocationPath  
+   *                                  | FilterExpr  
+   *                                  | FilterExpr '/' RelativeLocationPath  
+   *                                  | FilterExpr '//' RelativeLocationPath
+   * [20]   FilterExpr            ::= PrimaryExpr  
+   *                                  | FilterExpr Predicate 
+   * [1]    LocationPath          ::= RelativeLocationPath  
+   *                                  | AbsoluteLocationPath  
+   * [2]    AbsoluteLocationPath  ::= '/' RelativeLocationPath?  
+   *                                  | AbbreviatedAbsoluteLocationPath
+   * [3]    RelativeLocationPath  ::= Step  
+   *                                  | RelativeLocationPath '/' Step  
+   *                                  | AbbreviatedRelativeLocationPath
+   * [4]    Step                  ::= AxisSpecifier NodeTest Predicate*  
+   *                                  | AbbreviatedStep  
+   * [5]    AxisSpecifier         ::= AxisName '::'  
+   *                                  | AbbreviatedAxisSpecifier  
+   * [10]   AbbreviatedAbsoluteLocationPath
+   *                              ::= '//' RelativeLocationPath
+   * [11]   AbbreviatedRelativeLocationPath
+   *                              ::= RelativeLocationPath '//' Step
+   * [12]   AbbreviatedStep       ::= '.'  
+   *                                  | '..'  
+   * [13]   AbbreviatedAxisSpecifier    
+   *                              ::= '@'? 
+   *
+   * If you expand all the abbreviated versions, then the grammer simplifies to:
+   *
+   * [19]   PathExpr              ::= RelativeLocationPath  
+   *                                  | '/' RelativeLocationPath?  
+   *                                  | FilterExpr  
+   *                                  | FilterExpr '/' RelativeLocationPath  
+   * [20]   FilterExpr            ::= PrimaryExpr  
+   *                                  | FilterExpr Predicate 
+   * [3]    RelativeLocationPath  ::= Step  
+   *                                  | RelativeLocationPath '/' Step  
+   * [4]    Step                  ::= AxisName '::' NodeTest Predicate*  
+   *
+   * Conceptually you can say that we should split by '/' and try to treat the parts
+   * as steps, and if that fails then try to treat it as a PrimaryExpr.  
+   * 
+   * @param  $PathExpr   (string) PathExpr syntactical element
+   * @param  $context    (array)  The context from which to evaluate
+   * @return             (mixed)  The result of the XPath expression.  Either:
+   *                               node-set (an ordered collection of nodes without duplicates) 
+   *                               boolean (true or false) 
+   *                               number (a floating-point number) 
+   *                               string (a sequence of UCS characters) 
+   * @see    evaluate()
+   */
+  function _evaluatePathExpr($PathExpr, $context) {
+    $ThisFunctionName = '_evaluatePathExpr';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "PathExpr: $PathExpr\n";
+      echo "Context:";
+      $this->_printContext($context);
+      echo "\n";
+    }
+    
+    // Numpty check
+    if (empty($PathExpr)) {
+      $this->_displayError("The \$PathExpr argument must have a value.", __LINE__, __FILE__);
+      return FALSE;
+    }
+    //////////////////////////////////////////////
+
+    // Parsing the expression into steps is a cachable operation as it doesn't depend on the context
+    static $aResultsCache = array();
+
+    if (isset($aResultsCache[$PathExpr])) {
+      $steps = $aResultsCache[$PathExpr];
+    } else {
+      // Note that we have used $this->slashes2descendant to simplify this logic, so the 
+      // "Abbreviated" paths basically never exist as '//' never exists.
+
+      // mini syntax check
+      if (!$this->_bracketsCheck($PathExpr)) {
+        $this->_displayError('While parsing an XPath query, in the PathExpr "' .
+        $PathExpr.
+        '", there was an invalid number of brackets or a bracket mismatch.', __LINE__, __FILE__);
+      }
+      // Save the current path.
+      $this->currentXpathQuery = $PathExpr;
+      // Split the path at every slash *outside* a bracket.
+      $steps = $this->_bracketExplode('/', $PathExpr);
+      if ($bDebugThisFunction) { echo "<hr>Split the path '$PathExpr' at every slash *outside* a bracket.\n "; print_r($steps); }
+      // Check whether the first element is empty.
+      if (empty($steps[0])) {
+        // Remove the first and empty element. It's a starting  '//'.
+        array_shift($steps);
+      }
+      $aResultsCache[$PathExpr] = $steps;
+    }
+
+    // Start to evaluate the steps.
+    // ### Consider implementing an evaluateSteps() function that removes recursion from
+    // evaluateStep()
+    $result = $this->_evaluateStep($steps, $context);
+
+    // Preserve doc order if there was more than one result
+    if (count($result) > 1) {
+      $result = $this->_sortByDocOrder($result);
+    }
+    //////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    // Return the result.
+    return $result;
+  }
+
+  /**
+   * Sort an xPathSet by doc order.
+   *
+   * @param  $xPathSet (array) Array of full paths to nodes that need to be sorted
+   * @return           (array) Array containing the same contents as $xPathSet, but
+   *                           with the contents in doc order
+   */
+  function _sortByDocOrder($xPathSet) {
+    $ThisFunctionName = '_sortByDocOrder';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "_sortByDocOrder(xPathSet:[".count($xPathSet)."])";
+      echo "xPathSet:\n";
+      print_r($xPathSet);
+      echo "<hr>\n";
+    }
+    //////////////////////////////////////////////
+
+    $aResult = array();
+
+    // Spot some common shortcuts.
+    if (count($xPathSet) < 1) {
+      $aResult = $xPathSet;
+    } else {
+      // Build an array of doc-pos indexes.
+      $aDocPos = array();
+      $nodeCount = count($this->nodeIndex);
+      $aPaths = array_keys($this->nodeIndex);
+      if ($bDebugThisFunction) {
+        echo "searching for path indices in array_keys(this->nodeIndex)...\n";
+        //print_r($aPaths);
+      }
+
+      // The last index we found.  In general the elements will be in groups
+      // that are themselves in order.
+      $iLastIndex = 0;
+      foreach ($xPathSet as $path) {
+        // Cycle round the nodes, starting at the last index, looking for the path.
+        $foundNode = FALSE;
+        for ($iIndex = $iLastIndex; $iIndex < $nodeCount + $iLastIndex; $iIndex++) {
+          $iThisIndex = $iIndex % $nodeCount;
+          if (!strcmp($aPaths[$iThisIndex],$path)) {
+            // we have found the doc-position index of the path 
+            $aDocPos[] = $iThisIndex;
+            $iLastIndex = $iThisIndex;
+            $foundNode = TRUE;
+            break;
+          }
+        }
+        if ($bDebugThisFunction) {
+          if (!$foundNode)
+            echo "Error: $path not found in \$this->nodeIndex\n";
+          else 
+            echo "Found node after ".($iIndex - $iLastIndex)." iterations\n";
+        }
+      }
+      // Now count the number of doc pos we have and the number of results and
+      // confirm that we have the same number of each.
+      $iDocPosCount = count($aDocPos);
+      $iResultCount = count($xPathSet);
+      if ($iDocPosCount != $iResultCount) {
+        if ($bDebugThisFunction) {
+          echo "count(\$aDocPos)=$iDocPosCount; count(\$result)=$iResultCount\n";
+          print_r(array_keys($this->nodeIndex));
+        }
+        $this->_displayError('Results from _InternalEvaluate() are corrupt.  '.
+                                      'Do you need to call reindexNodeTree()?', __LINE__, __FILE__);
+      }
+
+      // Now sort the indexes.
+      sort($aDocPos);
+
+      // And now convert back to paths.
+      $iPathCount = count($aDocPos);
+      for ($iIndex = 0; $iIndex < $iPathCount; $iIndex++) {
+        $aResult[] = $aPaths[$aDocPos[$iIndex]];
+      }
+    }
+
+    // Our result from the function is this array.
+    $result = $aResult;
+
+    //////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    // Return the result.
+    return $result;
+  }
+
+  /**
+   * Evaluate a step from a XPathQuery expression at a specific contextPath.
+   *
+   * Steps are the arguments of a XPathQuery when divided by a '/'. A contextPath is a 
+   * absolute XPath (or vector of XPaths) to a starting node(s) from which the step should 
+   * be evaluated.
+   *
+   * @param  $steps        (array) Vector containing the remaining steps of the current 
+   *                               XPathQuery expression.
+   * @param  $context      (array) The context from which to evaluate
+   * @return               (array) Vector of absolute XPath's as a result of the step 
+   *                               evaluation.  The results will not necessarily be in doc order
+   * @see    _evaluatePathExpr()
+   */
+  function _evaluateStep($steps, $context) {
+    $ThisFunctionName = '_evaluateStep';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Context:";
+      $this->_printContext($context);
+      echo "\n";
+      echo "Steps: ";
+      print_r($steps);
+      echo "<hr>\n";
+    }
+    //////////////////////////////////////////////
+
+    $result = array(); // Create an empty array for saving the abs. XPath's found.
+
+    $contextPaths = array();   // Create an array to save the new contexts.
+    $step = trim(array_shift($steps)); // Get this step.
+    if ($bDebugThisFunction) echo __LINE__.":Evaluating step $step\n";
+    
+    $axis = $this->_getAxis($step); // Get the axis of the current step.
+
+    // If there was no axis, then it must be a PrimaryExpr
+    if ($axis == FALSE) {
+      if ($bDebugThisFunction) echo __LINE__.":Step is not an axis but a PrimaryExpr\n";
+      // ### This isn't correct, as the result of this function might not be a node set.
+      $error = $this->_evaluatePrimaryExpr($step, $context, $contextPaths);
+      if (!empty($error)) {
+        $this->_displayError("Expression failed to parse as PrimaryExpr because: $error"
+                , __LINE__, __FILE__, FALSE);
+      }
+    } else {
+      if ($bDebugThisFunction) { echo __LINE__.":Axis of step is:\n"; print_r($axis); echo "\n";}
+      $method = '_handleAxis_' . $axis['axis']; // Create the name of the method.
+    
+      // Check whether the axis handler is defined. If not display an error message.
+      if (!method_exists($this, $method)) {
+        $this->_displayError('While parsing an XPath query, the axis ' .
+        $axis['axis'] . ' could not be handled, because this version does not support this axis.', __LINE__, __FILE__);
+      }
+      if ($bDebugThisFunction) echo __LINE__.":Calling user method $method\n";        
+      
+      // Perform an axis action.
+      $contextPaths = $this->$method($axis, $context['nodePath']);
+      if ($bDebugThisFunction) { echo __LINE__.":We found these contexts from this step:\n"; print_r( $contextPaths ); echo "\n";}
+    }
+
+    // Check whether there are predicates.
+    if (count($contextPaths) > 0 && count($axis['predicate']) > 0) {
+      if ($bDebugThisFunction) echo __LINE__.":Filtering contexts by predicate...\n";
+      
+      // Check whether each node fits the predicates.
+      $contextPaths = $this->_checkPredicates($contextPaths, $axis['predicate']);
+    }
+
+    // Check whether there are more steps left.
+    if (count($steps) > 0) {
+      if ($bDebugThisFunction) echo __LINE__.":Evaluating next step given the context of the first step...\n";        
+      
+      // Continue the evaluation of the next steps.
+
+      // Run through the array.
+      $size = sizeOf($contextPaths);
+      for ($pos=0; $pos<$size; $pos++) {
+        // Build new context
+        $newContext = array('nodePath' => $contextPaths[$pos], 'size' => $size, 'pos' => $pos + 1);
+        if ($bDebugThisFunction) echo __LINE__.":Evaluating step for the {$contextPaths[$pos]} context...\n";
+        // Call this method for this single path.
+        $xPathSetNew = $this->_evaluateStep($steps, $newContext);
+        if ($bDebugThisFunction) {echo "New results for this context:\n"; print_r($xPathSetNew);}
+        $result = array_merge($result, $xPathSetNew);
+      }
+
+      // Remove duplicated nodes.
+      $result = array_unique($result);
+    } else {
+      $result = $contextPaths; // Save the found contexts.
+    }
+    
+    //////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    // Return the result.
+    return $result;
+  }
+  
+  /**
+   * Checks whether a node matches predicates.
+   *
+   * This method checks whether a list of nodes passed to this method match
+   * a given list of predicates. 
+   *
+   * @param  $xPathSet   (array)  Array of full paths of all nodes to be tested.
+   * @param  $predicates (array)  Array of predicates to use.
+   * @return             (array)  Vector of absolute XPath's that match the given predicates.
+   * @see    _evaluateStep()
+   */
+  function _checkPredicates($xPathSet, $predicates) {
+    $ThisFunctionName = '_checkPredicates';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "XPathSet:";
+      print_r($xPathSet);
+      echo "Predicates:";
+      print_r($predicates);
+      echo "<hr>";
+    }
+    //////////////////////////////////////////////
+    // Create an empty set of nodes.
+    $result = array();
+
+    // Run through all predicates.
+    $pSize = sizeOf($predicates);
+    for ($j=0; $j<$pSize; $j++) {
+      $predicate = $predicates[$j]; 
+      if ($bDebugThisFunction) echo "Evaluating predicate \"$predicate\"\n";
+
+      // This will contain all the nodes that match this predicate
+      $aNewSet = array();
+      
+      // Run through all nodes.
+      $contextSize = count($xPathSet);
+      for ($contextPos=0; $contextPos<$contextSize; $contextPos++) {
+        $xPath = $xPathSet[$contextPos];
+
+        // Build the context for this predicate
+        $context = array('nodePath' => $xPath, 'size' => $contextSize, 'pos' => $contextPos + 1);
+      
+        // Check whether the predicate is just an number.
+        if (preg_match('/^\d+$/', $predicate)) {
+          if ($bDebugThisFunction) echo "Taking short cut and calling _handleFunction_position() directly.\n";
+          // Take a short cut.  If it is just a position, then call 
+          // _handleFunction_position() directly.  70% of the
+          // time this will be the case. ## N.S
+//          $check = (bool) ($predicate == $context['pos']);
+          $check = (bool) ($predicate == $this->_handleFunction_position('', $context));
+        } else {                
+          // Else do the predicate check the long and through way.
+          $check = $this->_evaluateExpr($predicate, $context);
+        }
+        if ($bDebugThisFunction) {
+          echo "Evaluating the predicate returned "; 
+          var_dump($check); 
+          echo "\n";
+        }
+
+        if (is_int($check)) { // Check whether it's an integer.
+          // Check whether it's the current position.
+          $check = (bool) ($check == $this->_handleFunction_position('', $context));
+        } else {
+          $check = (bool) ($this->_handleFunction_boolean($check, $context));
+//          if ($bDebugThisFunction) {echo $this->_handleFunction_string($check, $context);}
+        }
+
+        if ($bDebugThisFunction) echo "Node $xPath matches predicate $predicate: " . (($check) ? "TRUE" : "FALSE") ."\n";
+
+        // Do we add it?
+        if ($check) $aNewSet[] = $xPath;
+      }
+       
+      // Use the newly filtered list.
+      $xPathSet = $aNewSet;
+
+      if ($bDebugThisFunction) {echo "Node set now contains : "; print_r($xPathSet); }
+    }
+
+    $result = $xPathSet;
+
+    //////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    // Return the array of nodes.
+    return $result;
+  }
+  
+  /**
+   * Evaluates an XPath function
+   *
+   * This method evaluates a given XPath function with its arguments on a
+   * specific node of the document.
+   *
+   * @param  $function      (string) Name of the function to be evaluated.
+   * @param  $arguments     (string) String containing the arguments being
+   *                                 passed to the function.
+   * @param  $context       (array)  The context from which to evaluate
+   * @return                (mixed)  This method returns the result of the evaluation of
+   *                                 the function. Depending on the function the type of the 
+   *                                 return value can be different.
+   * @see    evaluate()
+   */
+  function _evaluateFunction($function, $arguments, $context) {
+    $ThisFunctionName = '_evaluateFunction';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      if (is_array($arguments)) {
+        echo "Arguments:\n";
+        print_r($arguments);
+      } else {
+        echo "Arguments: $arguments\n";
+      }
+      echo "Context:";
+      $this->_printContext($context);
+      echo "\n";
+      echo "<hr>\n";
+    }
+    /////////////////////////////////////
+    // Remove whitespaces.
+    $function  = trim($function);
+    $arguments = trim($arguments);
+    // Create the name of the function handling function.
+    $method = '_handleFunction_'. $function;
+    
+    // Check whether the function handling function is available.
+    if (!method_exists($this, $method)) {
+      // Display an error message.
+      $this->_displayError("While parsing an XPath query, ".
+        "the function \"$function\" could not be handled, because this ".
+        "version does not support this function.", __LINE__, __FILE__);
+    }
+    if ($bDebugThisFunction) echo "Calling function $method($arguments)\n"; 
+    
+    // Return the result of the function.
+    $result = $this->$method($arguments, $context);
+    
+    //////////////////////////////////////////////
+    // Return the nodes found.
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    // Return the result.
+    return $result;
+  }
+    
+  /**
+   * Checks whether a node matches a node-test.
+   *
+   * This method checks whether a node in the document matches a given node-test.
+   * A node test is something like text(), node(), or an element name.
+   *
+   * @param  $contextPath (string)  Full xpath of the node, which should be tested for 
+   *                                matching the node-test.
+   * @param  $nodeTest    (string)  String containing the node-test for the node.
+   * @return              (boolean) This method returns TRUE if the node matches the 
+   *                                node-test, otherwise FALSE.
+   * @see    evaluate()
+   */
+  function _checkNodeTest($contextPath, $nodeTest) {
+    // Empty node test means that it must match
+    if (empty($nodeTest)) return TRUE;
+
+    if ($nodeTest == '*') {
+      // * matches all element nodes.
+      return (!preg_match(':/[^/]+\(\)\[\d+\]$:U', $contextPath));
+    }
+    elseif (preg_match('/^[\w-:\.]+$/', $nodeTest)) {
+       // http://www.w3.org/TR/2000/REC-xml-20001006#NT-Name
+       // The real spec for what constitutes whitespace is quite elaborate, and 
+       // we currently just hope that "\w" catches them all.  In reality it should
+       // start with a letter too, not a number, but we've just left it simple.
+       // It's just a node name test.  It should end with "/$nodeTest[x]"
+       return (preg_match('"/'.$nodeTest.'\[\d+\]$"', $contextPath));
+    }
+    elseif (preg_match('/\(/U', $nodeTest)) { // Check whether it's a function.
+      // Get the type of function to use.
+      $function = $this->_prestr($nodeTest, '(');
+      // Check whether the node fits the method.
+      switch ($function) {
+        case 'node':   // Add this node to the list of nodes.
+          return TRUE;
+        case 'text':   // Check whether the node has some text.
+          $tmp = implode('', $this->nodeIndex[$contextPath]['textParts']);
+          if (!empty($tmp)) {
+            return TRUE; // Add this node to the list of nodes.
+          }
+          break;
+/******** NOT supported (yet?)          
+        case 'comment':  // Check whether the node has some comment.
+          if (!empty($this->nodeIndex[$contextPath]['comment'])) {
+            return TRUE; // Add this node to the list of nodes.
+          }
+          break;
+        case 'processing-instruction':
+          $literal = $this->_afterstr($axis['node-test'], '('); // Get the literal argument.
+          $literal = substr($literal, 0, strlen($literal) - 1); // Cut the literal.
+          
+          // Check whether a literal was given.
+          if (!empty($literal)) {
+            // Check whether the node's processing instructions are matching the literals given.
+            if ($this->nodeIndex[$context]['processing-instructions'] == $literal) {
+              return TRUE; // Add this node to the node-set.
+            }
+          } else {
+            // Check whether the node has processing instructions.
+            if (!empty($this->nodeIndex[$contextPath]['processing-instructions'])) {
+              return TRUE; // Add this node to the node-set.
+            }
+          }
+          break;
+***********/            
+        default:  // Display an error message.
+          $this->_displayError('While parsing an XPath query there was an undefined function called "' .
+             str_replace($function, '<b>'.$function.'</b>', $this->currentXpathQuery) .'"', __LINE__, __FILE__);
+      }
+    }
+    else { // Display an error message.
+      $this->_displayError("While parsing the XPath query \"{$this->currentXpathQuery}\" ".
+        "an empty and therefore invalid node-test has been found.", __LINE__, __FILE__, FALSE);
+    }
+    
+    return FALSE; // Don't add this context.
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPath                    ------  XPath AXIS Handlers  ------                            
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Retrieves axis information from an XPath query step.
+   *
+   * This method tries to extract the name of the axis and its node-test
+   * from a given step of an XPath query at a given node.  If it can't parse
+   * the step, then we treat it as a PrimaryExpr.
+   *
+   * [4]    Step            ::= AxisSpecifier NodeTest Predicate*  
+   *                            | AbbreviatedStep  
+   * [5]    AxisSpecifier   ::= AxisName '::'  
+   *                            | AbbreviatedAxisSpecifier 
+   * [12]   AbbreviatedStep ::= '.'  
+   *                            | '..'  
+   * [13]   AbbreviatedAxisSpecifier    
+   *                        ::=    '@'? 
+   * 
+   * [7]    NodeTest        ::= NameTest  
+   *                            | NodeType '(' ')'  
+   *                            | 'processing-instruction' '(' Literal ')'  
+   * [37]   NameTest        ::= '*'  
+   *                            | NCName ':' '*'  
+   *                            | QName  
+   * [38]   NodeType        ::= 'comment'  
+   *                            | 'text'  
+   *                            | 'processing-instruction'  
+   *                            | 'node' 
+   *
+   * @param  $step     (string) String containing a step of an XPath query.
+   * @return           (array)  Contains information about the axis found in the step, or FALSE
+   *                            if the string isn't a valid step.
+   * @see    _evaluateStep()
+   */
+  function _getAxis($step) {
+    // The results of this function are very cachable, as it is completely independant of context.
+    static $aResultsCache = array();
+
+    // Create an array to save the axis information.
+    $axis = array(
+      'axis'      => '',
+      'node-test' => '',
+      'predicate' => array()
+    );
+
+    $cacheKey = $step;
+    do { // parse block
+      $parseBlock = 1;
+
+      if (isset($aResultsCache[$cacheKey])) {
+        return $aResultsCache[$cacheKey];
+      } else {
+        // We have some danger of causing recursion here if we refuse to parse a step as having an
+        // axis, and demand it be treated as a PrimaryExpr.  So if we are going to fail, make sure
+        // we record what we tried, so that we can catch to see if it comes straight back.
+        $guess = array(
+          'axis' => 'child',
+          'node-test' => $step,
+          'predicate' => array());
+        $aResultsCache[$cacheKey] = $guess;
+      }
+
+      ///////////////////////////////////////////////////
+      // Spot the steps that won't come with an axis
+
+      // Check whether the step is empty or only self. 
+      if (empty($step) OR ($step == '.') OR ($step == 'current()')) {
+        // Set it to the default value.
+        $step = '.';
+        $axis['axis']      = 'self';
+        $axis['node-test'] = '*';
+        break $parseBlock;
+      }
+
+      if ($step == '..') {
+        // Select the parent axis.
+        $axis['axis']      = 'parent';
+        $axis['node-test'] = '*';
+        break $parseBlock;
+      }
+
+      ///////////////////////////////////////////////////
+      // Pull off the predicates
+
+      // Check whether there are predicates and add the predicate to the list 
+      // of predicates without []. Get contents of every [] found.
+      $groups = $this->_getEndGroups($step);
+//print_r($groups);
+      $groupCount = count($groups);
+      while (($groupCount > 0) && ($groups[$groupCount - 1][0] == '[')) {
+        // Remove the [] and add the predicate to the top of the list
+        $predicate = substr($groups[$groupCount - 1], 1, -1);
+        array_unshift($axis['predicate'], $predicate);
+        // Pop a group off the end of the list
+        array_pop($groups);
+        $groupCount--;
+      }
+
+      // Finally stick the rest back together and this is the rest of our step
+      if ($groupCount > 0) {
+        $step = implode('', $groups);
+      }
+
+      ///////////////////////////////////////////////////
+      // Pull off the axis
+
+      // Check for abbreviated syntax
+      if ($step[0] == '@') {
+        // Use the attribute axis and select the attribute.
+        $axis['axis']      = 'attribute';
+        $step = substr($step, 1);
+      } else {
+        // Check whether the axis is given in plain text.
+        if (preg_match("/^([^:]*)::(.*)$/", $step, $match)) {
+          // Split the step to extract axis and node-test.
+          $axis['axis'] = $match[1];
+          $step         = $match[2];
+        } else {
+          // The default axis is child
+          $axis['axis'] = 'child';
+        }
+      }
+
+      ///////////////////////////////////////////////////
+      // Process the rest which will either a node test, or else this isn't a step.
+
+      // Check whether is an abbreviated syntax.
+      if ($step == '*') {
+        // Use the child axis and select all children.
+        $axis['node-test'] = '*';
+        break $parseBlock;
+      }
+
+      // ### I'm pretty sure our current handling of cdata is a fudge, and we should
+      // really do this better, but leave this as is for now.
+      if ($step == "text()") {
+        // Handle the text node
+        $axis["node-test"] = "cdata";
+        break $parseBlock;
+      }
+
+      // There are a few node tests that we match verbatim.
+      if ($step == "node()"
+          || $step == "comment()"
+          || $step == "text()"
+          || $step == "processing-instruction") {
+        $axis["node-test"] = $step;
+        break $parseBlock;
+      }
+
+      // processing-instruction() is allowed to take an argument, but if it does, the argument
+      // is a literal, which we will have parsed out to $[number].
+      if (preg_match(":processing-instruction\(\$\d*\):", $step)) {
+        $axis["node-test"] = $step;
+        break $parseBlock;
+      }
+
+      // The only remaining way this can be a step, is if the remaining string is a simple name
+      // or else a :* name.
+      // http://www.w3.org/TR/xpath#NT-NameTest
+      // NameTest   ::= '*'  
+      //                | NCName ':' '*'  
+      //                | QName 
+      // QName      ::=  (Prefix ':')? LocalPart 
+      // Prefix     ::=  NCName 
+      // LocalPart  ::=  NCName 
+      //
+      // ie
+      // NameTest   ::= '*'  
+      //                | NCName ':' '*'  
+      //                | (NCName ':')? NCName
+      // NCName ::=  (Letter | '_') (NCNameChar)* 
+      $NCName = "[a-zA-Z_][\w\.\-_]*";
+      if (preg_match("/^$NCName:$NCName$/", $step)
+        || preg_match("/^$NCName:*$/", $step)) {
+        $axis['node-test'] = $step;
+        if (!empty($this->parseOptions[XML_OPTION_CASE_FOLDING])) {
+          // Case in-sensitive
+          $axis['node-test'] = strtoupper($axis['node-test']);
+        }
+        // Not currently recursing
+        $LastFailedStep = '';
+        $LastFailedContext = '';
+        break $parseBlock;
+      } 
+
+      // It's not a node then, we must treat it as a PrimaryExpr
+      // Check for recursion
+      if ($LastFailedStep == $step) {
+        $this->_displayError('Recursion detected while parsing an XPath query, in the step ' .
+              str_replace($step, '<b>'.$step.'</b>', $this->currentXpathQuery)
+              , __LINE__, __FILE__, FALSE);
+        $axis['node-test'] = $step;
+      } else {
+        $LastFailedStep = $step;
+        $axis = FALSE;
+      }
+      
+    } while(FALSE); // end parse block
+    
+    // Check whether it's a valid axis.
+    if ($axis !== FALSE) {
+      if (!in_array($axis['axis'], array_merge($this->axes, array('function')))) {
+        // Display an error message.
+        $this->_displayError('While parsing an XPath query, in the step ' .
+          str_replace($step, '<b>'.$step.'</b>', $this->currentXpathQuery) .
+          ' the invalid axis ' . $axis['axis'] . ' was found.', __LINE__, __FILE__, FALSE);
+      }
+    }
+
+    // Cache the real axis information
+    $aResultsCache[$cacheKey] = $axis;
+
+    // Return the axis information.
+    return $axis;
+  }
+   
+
+  /**
+   * Handles the XPath child axis.
+   *
+   * This method handles the XPath child axis.  It essentially filters out the
+   * children to match the name specified after the '/'.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should 
+   *                               be processed.
+   * @return              (array)  A vector containing all nodes that were found, during 
+   *                               the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_child($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set to hold the results of the child matches
+    if ($axis["node-test"] == "cdata") {
+      if (!isSet($this->nodeIndex[$contextPath]['textParts']) ) return '';
+      $tSize = sizeOf($this->nodeIndex[$contextPath]['textParts']);
+      for ($i=1; $i<=$tSize; $i++) { 
+        $xPathSet[] = $contextPath . '/text()['.$i.']';
+      }
+    }
+    else {
+      // Get a list of all children.
+      $allChildren = $this->nodeIndex[$contextPath]['childNodes'];
+      
+      // Run through all children in the order they where set.
+      $cSize = sizeOf($allChildren);
+      for ($i=0; $i<$cSize; $i++) {
+        $childPath = $contextPath .'/'. $allChildren[$i]['name'] .'['. $allChildren[$i]['contextPos']  .']';
+        $textChildPath = $contextPath.'/text()['.($i + 1).']';
+        // Check the text node
+        if ($this->_checkNodeTest($textChildPath, $axis['node-test'])) { // node test check
+          $xPathSet[] = $textChildPath; // Add the child to the node-set.
+        }
+        // Check the actual node
+        if ($this->_checkNodeTest($childPath, $axis['node-test'])) { // node test check
+          $xPathSet[] = $childPath; // Add the child to the node-set.
+        }
+      }
+
+      // Finally there will be one more text node to try
+     $textChildPath = $contextPath.'/text()['.($cSize + 1).']';
+     // Check the text node
+     if ($this->_checkNodeTest($textChildPath, $axis['node-test'])) { // node test check
+       $xPathSet[] = $textChildPath; // Add the child to the node-set.
+     }
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath parent axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the 
+   *                               evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_parent($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Check whether the parent matches the node-test.
+    $parentPath = $this->getParentXPath($contextPath);
+    if ($this->_checkNodeTest($parentPath, $axis['node-test'])) {
+      $xPathSet[] = $parentPath; // Add this node to the list of nodes.
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath attribute axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_attribute($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Check whether all nodes should be selected.
+    $nodeAttr = $this->nodeIndex[$contextPath]['attributes'];
+    if ($axis['node-test'] == '*'  
+        || $axis['node-test'] == 'node()') {
+      foreach($nodeAttr as $key=>$dummy) { // Run through the attributes.
+        $xPathSet[] = $contextPath.'/attribute::'.$key; // Add this node to the node-set.
+      }
+    }
+    elseif (isset($nodeAttr[$axis['node-test']])) {
+      $xPathSet[] = $contextPath . '/attribute::'. $axis['node-test']; // Add this node to the node-set.
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+   
+  /**
+   * Handles the XPath self axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_self($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Check whether the context match the node-test.
+    if ($this->_checkNodeTest($contextPath, $axis['node-test'])) {
+      $xPathSet[] = $contextPath; // Add this node to the node-set.
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath descendant axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_descendant($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Get a list of all children.
+    $allChildren = $this->nodeIndex[$contextPath]['childNodes'];
+    
+    // Run through all children in the order they where set.
+    $cSize = sizeOf($allChildren);
+    for ($i=0; $i<$cSize; $i++) {
+      $childPath = $allChildren[$i]['xpath'];
+      // Check whether the child matches the node-test.
+      if ($this->_checkNodeTest($childPath, $axis['node-test'])) {
+        $xPathSet[] = $childPath; // Add the child to the list of nodes.
+      }
+      // Recurse to the next level.
+      $xPathSet = array_merge($xPathSet, $this->_handleAxis_descendant($axis, $childPath));
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath ancestor axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_ancestor($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+        
+    $parentPath = $this->getParentXPath($contextPath); // Get the parent of the current node.
+    
+    // Check whether the parent isn't super-root.
+    if (!empty($parentPath)) {
+      // Check whether the parent matches the node-test.
+      if ($this->_checkNodeTest($parentPath, $axis['node-test'])) {
+        $xPathSet[] = $parentPath; // Add the parent to the list of nodes.
+      }
+      // Handle all other ancestors.
+      $xPathSet = array_merge($this->_handleAxis_ancestor($axis, $parentPath), $xPathSet);
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath namespace axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_namespace($axis, $contextPath) {
+    $this->_displayError("The axis 'namespace is not suported'", __LINE__, __FILE__, FALSE);
+  }
+  
+  /**
+   * Handles the XPath following axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_following($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    do { // try-block
+      $node = $this->nodeIndex[$contextPath]; // Get the current node
+      $position = $node['pos'];               // Get the current tree position.
+      $parent = $node['parentNode'];
+      // Check if there is a following sibling at all; if not end.
+      if ($position >= sizeOf($parent['childNodes'])) break; // try-block
+      // Build the starting abs. XPath
+      $startXPath = $parent['childNodes'][$position+1]['xpath'];
+      // Run through all nodes of the document.
+      $nodeKeys = array_keys($this->nodeIndex);
+      $nodeSize = sizeOf($nodeKeys);
+      for ($k=0; $k<$nodeSize; $k++) {
+        if ($nodeKeys[$k] == $startXPath) break; // Check whether this is the starting abs. XPath
+      }
+      for (; $k<$nodeSize; $k++) {
+        // Check whether the node fits the node-test.
+        if ($this->_checkNodeTest($nodeKeys[$k], $axis['node-test'])) {
+          $xPathSet[] = $nodeKeys[$k]; // Add the node to the list of nodes.
+        }
+      }
+    } while(FALSE);
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath preceding axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_preceding($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Run through all nodes of the document.
+    foreach ($this->nodeIndex as $xPath=>$dummy) {
+      if (empty($xPath)) continue; // skip super-Root
+      
+      // Check whether this is the context node.
+      if ($xPath == $contextPath) {
+        break; // After this we won't look for more nodes.
+      }
+      if (!strncmp($xPath, $contextPath, strLen($xPath))) {
+        continue;
+      }
+      // Check whether the node fits the node-test.
+      if ($this->_checkNodeTest($xPath, $axis['node-test'])) {
+        $xPathSet[] = $xPath; // Add the node to the list of nodes.
+      }
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath following-sibling axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_following_sibling($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Get all children from the parent.
+    $siblings = $this->_handleAxis_child($axis, $this->getParentXPath($contextPath));
+    // Create a flag whether the context node was already found.
+    $found = FALSE;
+    
+    // Run through all siblings.
+    $size = sizeOf($siblings);
+    for ($i=0; $i<$size; $i++) {
+      $sibling = $siblings[$i];
+      
+      // Check whether the context node was already found.
+      if ($found) {
+        // Check whether the sibling matches the node-test.
+        if ($this->_checkNodeTest($sibling, $axis['node-test'])) {
+          $xPathSet[] = $sibling; // Add the sibling to the list of nodes.
+        }
+      }
+      // Check if we reached *this* context node.
+      if ($sibling == $contextPath) {
+        $found = TRUE; // Continue looking for other siblings.
+      }
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath preceding-sibling axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_preceding_sibling($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Get all children from the parent.
+    $siblings = $this->_handleAxis_child($axis, $this->getParentXPath($contextPath));
+    
+    // Run through all siblings.
+    $size = sizeOf($siblings);
+    for ($i=0; $i<$size; $i++) {
+      $sibling = $siblings[$i];
+      // Check whether this is the context node.
+      if ($sibling == $contextPath) {
+        break; // Don't continue looking for other siblings.
+      }
+      // Check whether the sibling matches the node-test.
+      if ($this->_checkNodeTest($sibling, $axis['node-test'])) {
+        $xPathSet[] = $sibling; // Add the sibling to the list of nodes.
+      }
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath descendant-or-self axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_descendant_or_self($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Read the nodes.
+    $xPathSet = array_merge(
+                 $this->_handleAxis_self($axis, $contextPath),
+                 $this->_handleAxis_descendant($axis, $contextPath)
+               );
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath ancestor-or-self axis.
+   *
+   * This method handles the XPath ancestor-or-self axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_ancestor_or_self ( $axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Read the nodes.
+    $xPathSet = array_merge(
+                 $this->_handleAxis_ancestor($axis, $contextPath),
+                 $this->_handleAxis_self($axis, $contextPath)
+               );
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  
+  //-----------------------------------------------------------------------------------------
+  // XPath                  ------  XPath FUNCTION Handlers  ------                          
+  //-----------------------------------------------------------------------------------------
+  
+   /**
+    * Handles the XPath function last.
+    *    
+    * @param  $arguments     (string) String containing the arguments that were passed to the function.
+    * @param  $context       (array)  The context from which to evaluate the function
+    * @return                (mixed)  Depending on the type of function being processed
+    * @see    evaluate()
+    */
+  function _handleFunction_last($arguments, $context) {
+    return $context['size'];
+  }
+  
+  /**
+   * Handles the XPath function position.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_position($arguments, $context) {
+    return $context['pos'];
+  }
+  
+  /**
+   * Handles the XPath function count.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_count($arguments, $context) {
+    // Evaluate the argument of the method as an XPath and return the number of results.
+    return count($this->_evaluateExpr($arguments, $context));
+  }
+  
+  /**
+   * Handles the XPath function id.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_id($arguments, $context) {
+    $arguments = trim($arguments);         // Trim the arguments.
+    $arguments = explode(' ', $arguments); // Now split the arguments into an array.
+    // Create a list of nodes.
+    $resultXPaths = array();
+    // Run through all nodes of the document.
+    $keys = array_keys($this->nodeIndex);
+    $kSize = $sizeOf($keys);
+    for ($i=0; $i<$kSize; $i++) {
+      if (empty($keys[$i])) continue; // skip super-Root
+      if (in_array($this->nodeIndex[$keys[$i]]['attributes']['id'], $arguments)) {
+        $resultXPaths[] = $context['nodePath']; // Add this node to the list of nodes.
+      }
+    }
+    return $resultXPaths; // Return the list of nodes.
+  }
+  
+  /**
+   * Handles the XPath function name.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_name($arguments, $context) {
+    // If the argument it omitted, it defaults to a node-set with the context node as its only member.
+    if (empty($arguments)) {
+      return $this->_addLiteral($this->nodeIndex[$context['nodePath']]['name']);
+    }
+
+    // Evaluate the argument to get a node set.
+    $nodeSet = $this->_evaluateExpr($arguments, $context);
+    if (!is_array($nodeSet)) return '';
+    if (count($nodeSet) < 1) return '';
+    if (!isset($this->nodeIndex[$nodeSet[0]])) return '';
+     // Return a reference to the name of the node.
+    return $this->_addLiteral($this->nodeIndex[$nodeSet[0]]['name']);
+  }
+  
+  /**
+   * Handles the XPath function string.
+   *
+   * http://www.w3.org/TR/xpath#section-String-Functions
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_string($arguments, $context) {
+    // Check what type of parameter is given
+    if (is_array($arguments)) {
+      // Get the value of the first result (which means we want to concat all the text...unless
+      // a specific text() node has been given, and it will switch off to substringData
+      if (!count($arguments)) $result = '';
+      else {
+        $result = $this->_stringValue($arguments[0]);
+        if (($literal = $this->_asLiteral($result)) !== FALSE) {
+          $result = $literal;
+        }
+      }
+    }
+    // Is it a number string?
+    elseif (preg_match('/^[0-9]+(\.[0-9]+)?$/', $arguments) OR preg_match('/^\.[0-9]+$/', $arguments)) {
+      // ### Note no support for NaN and Infinity.
+      $number = doubleval($arguments); // Convert the digits to a number.
+      $result = strval($number); // Return the number.
+    }
+    elseif (is_bool($arguments)) { // Check whether it's TRUE or FALSE and return as string.
+      // ### Note that we used to return TRUE and FALSE which was incorrect according to the standard.
+      if ($arguments === TRUE) {        
+        $result = 'true'; 
+      } else {
+        $result = 'false';
+      }
+    }
+    elseif (($literal = $this->_asLiteral($arguments)) !== FALSE) {
+      return $literal;
+    }
+    elseif (!empty($arguments)) {
+      // Spec says:
+      // "An object of a type other than the four basic types is converted to a string in a way that 
+      // is dependent on that type."
+      // Use the argument as an XPath.
+      $result = $this->_evaluateExpr($arguments, $context);
+      if (is_string($result) && is_string($arguments) && (!strcmp($result, $arguments))) {
+        $this->_displayError("Loop detected in XPath expression.  Probably an internal error :o/.  _handleFunction_string($result)", __LINE__, __FILE__, FALSE);
+        return '';
+      } else {
+        $result = $this->_handleFunction_string($result, $context);
+      }
+    }
+    else {
+      $result = '';  // Return an empty string.
+    }
+    return $result;
+  }
+  
+  /**
+   * Handles the XPath function concat.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_concat($arguments, $context) {
+    // Split the arguments.
+    $arguments = explode(',', $arguments);
+    // Run through each argument and evaluate it.
+    $size = sizeof($arguments);
+    for ($i=0; $i<$size; $i++) {
+      $arguments[$i] = trim($arguments[$i]);  // Trim each argument.
+      // Evaluate it.
+      $arguments[$i] = $this->_handleFunction_string($arguments[$i], $context);
+    }
+    $arguments = implode('', $arguments);  // Put the string together and return it.
+    return $this->_addLiteral($arguments);
+  }
+  
+  /**
+   * Handles the XPath function starts-with.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_starts_with($arguments, $context) {
+    // Get the arguments.
+    $first  = trim($this->_prestr($arguments, ','));
+    $second = trim($this->_afterstr($arguments, ','));
+    // Evaluate each argument.
+    $first  = $this->_handleFunction_string($first, $context);
+    $second = $this->_handleFunction_string($second, $context);
+    // Check whether the first string starts with the second one.
+    return  (bool) ereg('^'.$second, $first);
+  }
+  
+  /**
+   * Handles the XPath function contains.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_contains($arguments, $context) {
+    // Get the arguments.
+    $first  = trim($this->_prestr($arguments, ','));
+    $second = trim($this->_afterstr($arguments, ','));
+    //echo "Predicate: $arguments First: ".$first." Second: ".$second."\n";
+    // Evaluate each argument.
+    $first = $this->_handleFunction_string($first, $context);
+    $second = $this->_handleFunction_string($second, $context);
+    //echo $second.": ".$first."\n";
+    // If the search string is null, then the provided there is a value it will contain it as
+    // it is considered that all strings contain the empty string. ## N.S.
+    if ($second==='') return TRUE;
+    // Check whether the first string starts with the second one.
+    if (strpos($first, $second) === FALSE) {
+      return FALSE;
+    } else {
+      return TRUE;
+    }
+  }
+  
+  /**
+   * Handles the XPath function substring-before.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_substring_before($arguments, $context) {
+    // Get the arguments.
+    $first  = trim($this->_prestr($arguments, ','));
+    $second = trim($this->_afterstr($arguments, ','));
+    // Evaluate each argument.
+    $first  = $this->_handleFunction_string($first, $context);
+    $second = $this->_handleFunction_string($second, $context);
+    // Return the substring.
+    return $this->_addLiteral($this->_prestr(strval($first), strval($second)));
+  }
+  
+  /**
+   * Handles the XPath function substring-after.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_substring_after($arguments, $context) {
+    // Get the arguments.
+    $first  = trim($this->_prestr($arguments, ','));
+    $second = trim($this->_afterstr($arguments, ','));
+    // Evaluate each argument.
+    $first  = $this->_handleFunction_string($first, $context);
+    $second = $this->_handleFunction_string($second, $context);
+    // Return the substring.
+    return $this->_addLiteral($this->_afterstr(strval($first), strval($second)));
+  }
+  
+  /**
+   * Handles the XPath function substring.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_substring($arguments, $context) {
+    // Split the arguments.
+    $arguments = explode(",", $arguments);
+    $size = sizeOf($arguments);
+    for ($i=0; $i<$size; $i++) { // Run through all arguments.
+      $arguments[$i] = trim($arguments[$i]); // Trim the string.
+      // Evaluate each argument.
+      $arguments[$i] = $this->_handleFunction_string($arguments[$i], $context);
+    }
+    // Check whether a third argument was given and return the substring..
+    if (!empty($arguments[2])) {
+      return $this->_addLiteral(substr(strval($arguments[0]), $arguments[1] - 1, $arguments[2]));
+    } else {
+      return $this->_addLiteral(substr(strval($arguments[0]), $arguments[1] - 1));
+    }
+  }
+  
+  /**
+   * Handles the XPath function string-length.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_string_length($arguments, $context) {
+    $arguments = trim($arguments); // Trim the argument.
+    // Evaluate the argument.
+    $arguments = $this->_handleFunction_string($arguments, $context);
+    return strlen(strval($arguments)); // Return the length of the string.
+  }
+
+  /**
+   * Handles the XPath function normalize-space.
+   *
+   * The normalize-space function returns the argument string with whitespace
+   * normalized by stripping leading and trailing whitespace and replacing sequences
+   * of whitespace characters by a single space.
+   * If the argument is omitted, it defaults to the context node converted to a string,
+   * in other words the string-value of the context node
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                 (stri)g trimed string
+   * @see    evaluate()
+   */
+  function _handleFunction_normalize_space($arguments, $context) {
+    if (empty($arguments)) {
+      $arguments = $this->getParentXPath($context['nodePath']).'/'.$this->nodeIndex[$context['nodePath']]['name'].'['.$this->nodeIndex[$context['nodePath']]['contextPos'].']';
+    } else {
+       $arguments = $this->_handleFunction_string($arguments, $context);
+    }
+    $arguments = trim(preg_replace (";[[:space:]]+;s",' ',$arguments));
+    return $this->_addLiteral($arguments);
+  }
+
+  /**
+   * Handles the XPath function translate.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_translate($arguments, $context) {
+    $arguments = explode(',', $arguments); // Split the arguments.
+    $size = sizeOf($arguments);
+    for ($i=0; $i<$size; $i++) { // Run through all arguments.
+      $arguments[$i] = trim($arguments[$i]); // Trim the argument.
+      // Evaluate the argument.
+      $arguments[$i] = $this->_handleFunction_string($arguments[$i], $context);
+    }
+    // Return the translated string.
+    return $this->_addLiteral(strtr($arguments[0], $arguments[1], $arguments[2]));
+  }
+
+  /**
+   * Handles the XPath function boolean.
+   *   
+   * http://www.w3.org/TR/xpath#section-Boolean-Functions
+   *
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_boolean($arguments, $context) {
+    if (empty($arguments)) {
+      return FALSE; // Sorry, there were no arguments.
+    }
+    // a bool is dead obvious
+    elseif (is_bool($arguments)) {
+      return $arguments;
+    }
+    // a node-set is true if and only if it is non-empty
+    elseif (is_array($arguments)) {
+      return (count($arguments) > 0);
+    }
+    // a number is true if and only if it is neither positive or negative zero nor NaN 
+    // (Straight out of the XPath spec.. makes no sense?????)
+    elseif (preg_match('/^[0-9]+(\.[0-9]+)?$/', $arguments) || preg_match('/^\.[0-9]+$/', $arguments)) {
+      $number = doubleval($arguments);  // Convert the digits to a number.
+      // If number zero return FALSE else TRUE.
+      if ($number == 0) return FALSE; else return TRUE;
+    }
+    // a string is true if and only if its length is non-zero
+    elseif (($literal = $this->_asLiteral($arguments)) !== FALSE) {
+      return (strlen($literal) != 0);
+    }
+    // an object of a type other than the four basic types is converted to a boolean in a 
+    // way that is dependent on that type
+    else {
+      // Spec says:
+      // "An object of a type other than the four basic types is converted to a number in a way 
+      // that is dependent on that type"
+      // Try to evaluate the argument as an XPath.
+      $result = $this->_evaluateExpr($arguments, $context);
+      if (is_string($result) && is_string($arguments) && (!strcmp($result, $arguments))) {
+        $this->_displayError("Loop detected in XPath expression.  Probably an internal error :o/.  _handleFunction_boolean($result)", __LINE__, __FILE__, FALSE);
+        return FALSE;
+      } else {
+        return $this->_handleFunction_boolean($result, $context);
+      }
+    }
+  }
+  
+  /**
+   * Handles the XPath function not.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_not($arguments, $context) {
+    // Return the negative value of the content of the brackets.
+    $bArgResult = $this->_handleFunction_boolean($arguments, $context);
+//echo "Before inversion: ".($bArgResult?"TRUE":"FALSE")."\n";
+    return !$bArgResult;
+  }
+  
+  /**
+   * Handles the XPath function TRUE.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_true($arguments, $context) {
+    return TRUE; // Return TRUE.
+  }
+  
+  /**
+   * Handles the XPath function FALSE.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_false($arguments, $context) {
+    return FALSE; // Return FALSE.
+  }
+  
+  /**
+   * Handles the XPath function lang.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_lang($arguments, $context) {
+    $arguments = trim($arguments); // Trim the arguments.
+    $currentNode = $this->nodeIndex[$context['nodePath']];
+    while (!empty($currentNode['name'])) { // Run through the ancestors.
+      // Check whether the node has an language attribute.
+      if (isSet($currentNode['attributes']['xml:lang'])) {
+        // Check whether it's the language, the user asks for; if so return TRUE else FALSE
+        return eregi('^'.$arguments, $currentNode['attributes']['xml:lang']);
+      }
+      $currentNode = $currentNode['parentNode']; // Move up to parent
+    } // End while
+    return FALSE;
+  }
+  
+  /**
+   * Handles the XPath function number.
+   *   
+   * http://www.w3.org/TR/xpath#section-Number-Functions
+   *
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_number($arguments, $context) {
+    // Check the type of argument.
+
+    // A string that is a number
+    if (is_numeric($arguments)) {
+      return doubleval($arguments); // Return the argument as a number.
+    }
+    // A bool
+    elseif (is_bool($arguments)) {  // Return TRUE/FALSE as a number.
+      if ($arguments === TRUE) return 1; else return 0;  
+    }
+    // A node set
+    elseif (is_array($arguments)) {
+      // Is converted to a string then handled like a string
+      $string = $this->_handleFunction_string($arguments, $context);
+      if (is_numeric($string))
+        return doubleval($string);
+    }
+    elseif (($literal = $this->_asLiteral($arguments)) !== FALSE) {
+      if (is_numeric($literal)) {
+        return doubleval($literal);
+      } else {
+        // If we are to stick strictly to the spec, we should return NaN, but lets just
+        // leave PHP to see if can do some dynamic conversion.
+        return $literal;
+      }
+    }
+    else {
+      // Spec says:
+      // "An object of a type other than the four basic types is converted to a number in a way 
+      // that is dependent on that type"
+      // Try to evaluate the argument as an XPath.
+      $result = $this->_evaluateExpr($arguments, $context);
+      if (is_string($result) && is_string($arguments) && (!strcmp($result, $arguments))) {
+        $this->_displayError("Loop detected in XPath expression.  Probably an internal error :o/.  _handleFunction_number($result)", __LINE__, __FILE__, FALSE);
+        return FALSE;
+      } else {
+        return $this->_handleFunction_number($result, $context);
+      }
+    }
+  }
+
+  /**
+   * Handles the XPath function sum.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_sum($arguments, $context) {
+    $arguments = trim($arguments); // Trim the arguments.
+    // Evaluate the arguments as an XPath query.
+    $result = $this->_evaluateExpr($arguments, $context);
+    $sum = 0; // Create a variable to save the sum.
+    // The sum function expects a node set as an argument.
+    if (is_array($result)) {
+      // Run through all results.
+      $size = sizeOf($result);
+      for ($i=0; $i<$size; $i++) {
+        $value = $this->_stringValue($result[$i], $context);
+        if (($literal = $this->_asLiteral($value)) !== FALSE) {
+          $value = $literal;
+        }
+        $sum += doubleval($value); // Add it to the sum.
+      }
+    }
+    return $sum; // Return the sum.
+  }
+
+  /**
+   * Handles the XPath function floor.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_floor($arguments, $context) {
+    if (!is_numeric($arguments)) {
+      $arguments = $this->_handleFunction_number($arguments, $context);
+    }
+    $arguments = doubleval($arguments); // Convert the arguments to a number.
+    return floor($arguments);           // Return the result
+  }
+  
+  /**
+   * Handles the XPath function ceiling.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_ceiling($arguments, $context) {
+    if (!is_numeric($arguments)) {
+      $arguments = $this->_handleFunction_number($arguments, $context);
+    }
+    $arguments = doubleval($arguments); // Convert the arguments to a number.
+    return ceil($arguments);            // Return the result
+  }
+  
+  /**
+   * Handles the XPath function round.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_round($arguments, $context) {
+    if (!is_numeric($arguments)) {
+      $arguments = $this->_handleFunction_number($arguments, $context);
+    }
+    $arguments = doubleval($arguments); // Convert the arguments to a number.
+    return round($arguments);           // Return the result
+  }
+
+  //-----------------------------------------------------------------------------------------
+  // XPath                  ------  XPath Extension FUNCTION Handlers  ------                          
+  //-----------------------------------------------------------------------------------------
+
+  /**
+   * Handles the XPath function x-lower.
+   *
+   * lower case a string.
+   *    string x-lower(string) 
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_x_lower($arguments, $context) {
+    // Evaluate the argument.
+    $string = $this->_handleFunction_string($arguments, $context);
+     // Return a reference to the lowercased string
+    return $this->_addLiteral(strtolower(strval($string)));
+  }
+
+  /**
+   * Handles the XPath function x-upper.
+   *
+   * upper case a string.
+   *    string x-upper(string) 
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_x_upper($arguments, $context) {
+    // Evaluate the argument.
+    $string = $this->_handleFunction_string($arguments, $context);
+     // Return a reference to the lowercased string
+    return $this->_addLiteral(strtoupper(strval($string)));
+  }
+
+  /**
+   * Handles the XPath function generate-id.
+   *
+   * Produce a unique id for the first node of the node set.
+   * 
+   * Example usage, produces an index of all the nodes in an .xml document, where the content of each
+   * "section" is the exported node as XML.
+   *
+   *   $aFunctions = $xPath->match('//');
+   *   
+   *   foreach ($aFunctions as $Function) {
+   *       $id = $xPath->match("generate-id($Function)");
+   *       echo "<a href='#$id'>$Function</a><br>";
+   *   }
+   *   
+   *   foreach ($aFunctions as $Function) {
+   *       $id = $xPath->match("generate-id($Function)");
+   *       echo "<h2 id='$id'>$Function</h2>";
+   *       echo htmlspecialchars($xPath->exportAsXml($Function));
+   *   }
+   * 
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @author Ricardo Garcia
+   * @see    evaluate()
+   */
+  function _handleFunction_generate_id($arguments, $context) {
+    // If the argument is omitted, it defaults to a node-set with the context node as its only member.
+    if (is_string($arguments) && empty($arguments)) {
+      // We need ids then
+      $this->_generate_ids();
+      return $this->_addLiteral($this->nodeIndex[$context['nodePath']]['generated_id']);
+    }
+
+    // Evaluate the argument to get a node set.
+    $nodeSet = $this->_evaluateExpr($arguments, $context);
+
+    if (!is_array($nodeSet)) return '';
+    if (count($nodeSet) < 1) return '';
+    if (!isset($this->nodeIndex[$nodeSet[0]])) return '';
+     // Return a reference to the name of the node.
+    // We need ids then
+    $this->_generate_ids();
+    return $this->_addLiteral($this->nodeIndex[$nodeSet[0]]['generated_id']);
+  }
+
+  //-----------------------------------------------------------------------------------------
+  // XPathEngine                ------  Help Stuff  ------                                   
+  //-----------------------------------------------------------------------------------------
+
+  /**
+   * Decodes the character set entities in the given string.
+   *
+   * This function is given for convenience, as all text strings or attributes
+   * are going to come back to you with their entities still encoded.  You can
+   * use this function to remove these entites.
+   *
+   * It makes use of the get_html_translation_table(HTML_ENTITIES) php library 
+   * call, so is limited in the same ways.  At the time of writing this seemed
+   * be restricted to iso-8859-1
+   *
+   * ### Provide an option that will do this by default.
+   *
+   * @param $encodedData (mixed) The string or array that has entities you would like to remove
+   * @param $reverse     (bool)  If TRUE entities will be encoded rather than decoded, ie
+   *                             < to &lt; rather than &lt; to <.
+   * @return             (mixed) The string or array returned with entities decoded.
+   */
+  function decodeEntities($encodedData, $reverse=FALSE) {
+    static $aEncodeTbl;
+    static $aDecodeTbl;
+    // Get the translation entities, but we'll cache the result to enhance performance.
+    if (empty($aDecodeTbl)) {
+      // Get the translation entities.
+      $aEncodeTbl = get_html_translation_table(HTML_ENTITIES);
+      $aDecodeTbl = array_flip($aEncodeTbl);
+    }
+
+    // If it's just a single string.
+    if (!is_array($encodedData)) {
+      if ($reverse) {
+        return strtr($encodedData, $aEncodeTbl);
+      } else {
+        return strtr($encodedData, $aDecodeTbl);
+      }
+    }
+
+    $result = array();
+    foreach($encodedData as $string) {
+      if ($reverse) {
+        $result[] = strtr($string, $aEncodeTbl);
+      } else {
+        $result[] = strtr($string, $aDecodeTbl);
+      }
+    }
+
+    return $result;
+  }
+  
+  /**
+   * Compare two nodes to see if they are equal (point to the same node in the doc)
+   *
+   * 2 nodes are considered equal if the absolute XPath is equal.
+   * 
+   * @param  $node1 (mixed) Either an absolute XPath to an node OR a real tree-node (hash-array)
+   * @param  $node2 (mixed) Either an absolute XPath to an node OR a real tree-node (hash-array)
+   * @return        (bool)  TRUE if equal (see text above), FALSE if not (and on error).
+   */
+  function equalNodes($node1, $node2) {
+    $xPath_1 = is_string($node1) ? $node1 : $this->getNodePath($node1);
+    $xPath_2 = is_string($node2) ? $node2 : $this->getNodePath($node2);
+    return (strncasecmp ($xPath_1, $xPath_2, strLen($xPath_1)) == 0);
+  }
+  
+  /**
+   * Get the absolute XPath of a node that is in a document tree.
+   *
+   * @param $node (array)  A real tree-node (hash-array)   
+   * @return      (string) The string path to the node or FALSE on error.
+   */
+  function getNodePath($node) {
+    if (!empty($node['xpath'])) return $node['xpath'];
+    $pathInfo = array();
+    do {
+      if (empty($node['name']) OR empty($node['parentNode'])) break; // End criteria
+      $pathInfo[] = array('name' => $node['name'], 'contextPos' => $node['contextPos']);
+      $node = $node['parentNode'];
+    } while (TRUE);
+    
+    $xPath = '';
+    for ($i=sizeOf($pathInfo)-1; $i>=0; $i--) {
+      $xPath .= '/' . $pathInfo[$i]['name'] . '[' . $pathInfo[$i]['contextPos'] . ']';
+    }
+    if (empty($xPath)) return FALSE;
+    return $xPath;
+  }
+  
+  /**
+   * Retrieves the absolute parent XPath query.
+   *
+   * The parents stored in the tree are only relative parents...but all the parent
+   * information is stored in the XPath query itself...so instead we use a function
+   * to extract the parent from the absolute Xpath query
+   *
+   * @param  $childPath (string) String containing an absolute XPath query
+   * @return            (string) returns the absolute XPath of the parent
+   */
+   function getParentXPath($absoluteXPath) {
+     $lastSlashPos = strrpos($absoluteXPath, '/'); 
+     if ($lastSlashPos == 0) { // it's already the root path
+       return ''; // 'super-root'
+     } else {
+       return (substr($absoluteXPath, 0, $lastSlashPos));
+     }
+   }
+  
+  /**
+   * Returns TRUE if the given node has child nodes below it
+   *
+   * @param  $absoluteXPath (string) full path of the potential parent node
+   * @return                (bool)   TRUE if this node exists and has a child, FALSE otherwise
+   */
+  function hasChildNodes($absoluteXPath) {
+    if ($this->_indexIsDirty) $this->reindexNodeTree();
+    return (bool) (isSet($this->nodeIndex[$absoluteXPath]) 
+                   AND sizeOf($this->nodeIndex[$absoluteXPath]['childNodes']));
+  }
+  
+  /**
+   * Translate all ampersands to it's literal entities '&amp;' and back.
+   *
+   * I wasn't aware of this problem at first but it's important to understand why we do this.
+   * At first you must know:
+   * a) PHP's XML parser *translates* all entities to the equivalent char E.g. &lt; is returned as '<'
+   * b) PHP's XML parser (in V 4.1.0) has problems with most *literal* entities! The only one's that are 
+   *    recognized are &amp;, &lt; &gt; and &quot;. *ALL* others (like &nbsp; &copy; a.s.o.) cause an 
+   *    XML_ERROR_UNDEFINED_ENTITY error. I reported this as bug at http://bugs.php.net/bug.php?id=15092
+   *    (It turned out not to be a 'real' bug, but one of those nice W3C-spec things).
+   * 
+   * Forget position b) now. It's just for info. Because the way we will solve a) will also solve b) too. 
+   *
+   * THE PROBLEM
+   * To understand the problem, here a sample:
+   * Given is the following XML:    "<AAA> &lt; &nbsp; &gt; </AAA>"
+   *   Try to parse it and PHP's XML parser will fail with a XML_ERROR_UNDEFINED_ENTITY becaus of 
+   *   the unknown litteral-entity '&nbsp;'. (The numeric equivalent '&#160;' would work though). 
+   * Next try is to use the numeric equivalent 160 for '&nbsp;', thus  "<AAA> &lt; &#160; &gt; </AAA>"
+   *   The data we receive in the tag <AAA> is  " <   > ". So we get the *translated entities* and 
+   *   NOT the 3 entities &lt; &#160; &gt. Thus, we will not even notice that there were entities at all!
+   *   In *most* cases we're not able to tell if the data was given as entity or as 'normal' char.
+   *   E.g. When receiving a quote or a single space were not able to tell if it was given as 'normal' char
+   *   or as &nbsp; or &quot;. Thus we loose the entity-information of the XML-data!
+   * 
+   * THE SOLUTION
+   * The better solution is to keep the data 'as is' by replacing the '&' before parsing begins.
+   * E.g. Taking the original input from above, this would result in "<AAA> &amp;lt; &amp;nbsp; &amp;gt; </AAA>"
+   * The data we receive now for the tag <AAA> is  " &lt; &nbsp; &gt; ". and that's what we want.
+   * 
+   * The bad thing is, that a global replace will also replace data in section that are NOT translated by the 
+   * PHP XML-parser. That is comments (<!-- -->), IP-sections (stuff between <? ? >) and CDATA-block too.
+   * So all data comming from those sections must be reversed. This is done during the XML parse phase.
+   * So:
+   * a) Replacement of all '&' in the XML-source.
+   * b) All data that is not char-data or in CDATA-block have to be reversed during the XML-parse phase.
+   *
+   * @param  $xmlSource (string) The XML string
+   * @return            (string) The XML string with translated ampersands.
+   */
+  function _translateAmpersand($xmlSource, $reverse=FALSE) {
+    $PHP5 = (substr(phpversion(), 0, 1) == '5');
+    if ($PHP5) {
+      //otherwise we receive  &amp;nbsp;  instead of  &nbsp;
+      return $xmlSource;
+    } else {
+      return ($reverse ? str_replace('&amp;', '&', $xmlSource) : str_replace('&', '&amp;', $xmlSource));
+    }
+  }
+
+} // END OF CLASS XPathEngine
+
+
+/************************************************************************************************
+* ===============================================================================================
+*                                     X P a t h  -  Class                                        
+* ===============================================================================================
+************************************************************************************************/
+
+define('XPATH_QUERYHIT_ALL'   , 1);
+define('XPATH_QUERYHIT_FIRST' , 2);
+define('XPATH_QUERYHIT_UNIQUE', 3);
+
+class XPath extends XPathEngine {
+    
+  /**
+   * Constructor of the class
+   *
+   * Optionally you may call this constructor with the XML-filename to parse and the 
+   * XML option vector. A option vector sample: 
+   *   $xmlOpt = array(XML_OPTION_CASE_FOLDING => FALSE, XML_OPTION_SKIP_WHITE => TRUE);
+   *
+   * @param  $userXmlOptions (array)  (optional) Vector of (<optionID>=><value>, <optionID>=><value>, ...)
+   * @param  $fileName       (string) (optional) Filename of XML file to load from.
+   *                                  It is recommended that you call importFromFile()
+   *                                  instead as you will get an error code.  If the
+   *                                  import fails, the object will be set to FALSE.
+   * @see    parent::XPathEngine()
+   */
+  function XPath($fileName='', $userXmlOptions=array()) {
+    parent::XPathEngine($userXmlOptions);
+    $this->properties['modMatch'] = XPATH_QUERYHIT_ALL;
+    if ($fileName) {
+      if (!$this->importFromFile($fileName)) {
+        // Re-run the base constructor to "reset" the object.  If the user has any sense, then
+        // they will have created the object, and then explicitly called importFromFile(), giving
+        // them the chance to catch and handle the error properly.
+        parent::XPathEngine($userXmlOptions);
+      }
+    }
+  }
+  
+  /**
+   * Resets the object so it's able to take a new xml sting/file
+   *
+   * Constructing objects is slow.  If you can, reuse ones that you have used already
+   * by using this reset() function.
+   */
+  function reset() {
+    parent::reset();
+    $this->properties['modMatch'] = XPATH_QUERYHIT_ALL;
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPath                    ------  Get / Set Stuff  ------                                
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Resolves and xPathQuery array depending on the property['modMatch']
+   *
+   * Most of the modification functions of XPath will also accept a xPathQuery (instead 
+   * of an absolute Xpath). The only problem is that the query could match more the one 
+   * node. The question is, if the none, the fist or all nodes are to be modified.
+   * The behaver can be set with setModMatch()  
+   *
+   * @param $modMatch (int) One of the following:
+   *                        - XPATH_QUERYHIT_ALL (default) 
+   *                        - XPATH_QUERYHIT_FIRST
+   *                        - XPATH_QUERYHIT_UNIQUE // If the query matches more then one node. 
+   * @see  _resolveXPathQuery()
+   */
+  function setModMatch($modMatch = XPATH_QUERYHIT_ALL) {
+    switch($modMatch) {
+      case XPATH_QUERYHIT_UNIQUE : $this->properties['modMatch'] =  XPATH_QUERYHIT_UNIQUE; break;
+      case XPATH_QUERYHIT_FIRST: $this->properties['modMatch'] =  XPATH_QUERYHIT_FIRST; break;
+      default: $this->properties['modMatch'] = XPATH_QUERYHIT_ALL;
+    }
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPath                    ------  DOM Like Modification  ------                          
+  //-----------------------------------------------------------------------------------------
+  
+  //-----------------------------------------------------------------------------------------
+  // XPath                  ------  Child (Node)  Set/Get  ------                           
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Retrieves the name(s) of a node or a group of document nodes.
+   *          
+   * This method retrieves the names of a group of document nodes
+   * specified in the argument.  So if the argument was '/A[1]/B[2]' then it
+   * would return 'B' if the node did exist in the tree.
+   *          
+   * @param  $xPathQuery (mixed) Array or single full document path(s) of the node(s), 
+   *                             from which the names should be retrieved.
+   * @return             (mixed) Array or single string of the names of the specified 
+   *                             nodes, or just the individual name.  If the node did 
+   *                             not exist, then returns FALSE.
+   */
+  function nodeName($xPathQuery) {
+    if (is_array($xPathQuery)) {
+      $xPathSet = $xPathQuery;
+    } else {
+      // Check for a valid xPathQuery
+      $xPathSet = $this->_resolveXPathQuery($xPathQuery,'nodeName');
+    }
+    if (count($xPathSet) == 0) return FALSE;
+    // For each node, get it's name
+    $result = array();
+    foreach($xPathSet as $xPath) {
+      $node = &$this->getNode($xPath);
+      if (!$node) {
+        // ### Fatal internal error?? 
+        continue;
+      }
+      $result[] = $node['name'];
+    }
+    // If just a single string, return string
+    if (count($xPathSet) == 1) $result = $result[0];
+    // Return result.
+    return $result;
+  }
+  
+  /**
+   * Removes a node from the XML document.
+   *
+   * This method removes a node from the tree of nodes of the XML document. If the node 
+   * is a document node, all children of the node and its character data will be removed. 
+   * If the node is an attribute node, only this attribute will be removed, the node to which 
+   * the attribute belongs as well as its children will remain unmodified.
+   *
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery  (string) xpath to the node (See note above).
+   * @param  $autoReindex (bool)   (optional, default=TRUE) Reindex the document to reflect 
+   *                               the changes.  A performance helper.  See reindexNodeTree()
+   * @return              (bool)   TRUE on success, FALSE on error;
+   * @see    setModMatch(), reindexNodeTree()
+   */
+  function removeChild($xPathQuery, $autoReindex=TRUE) {
+    $ThisFunctionName = 'removeChild';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Node: $xPathQuery\n";
+      echo '<hr>';
+    }
+
+    $NULL = NULL;
+    $status = FALSE;
+    do { // try-block
+      // Check for a valid xPathQuery
+      $xPathSet = $this->_resolveXPathQuery($xPathQuery,'removeChild');
+      if (sizeOf($xPathSet) === 0) {
+        $this->_displayError(sprintf($this->errorStrings['NoNodeMatch'], $xPathQuery), __LINE__, __FILE__, FALSE);
+        break; // try-block
+      }
+      $mustReindex = FALSE;
+      // Make chages from 'bottom-up'. In this manner the modifications will not affect itself.
+      for ($i=sizeOf($xPathSet)-1; $i>=0; $i--) {
+        $absoluteXPath = $xPathSet[$i];
+        if (preg_match(';/attribute::;', $absoluteXPath)) { // Handle the case of an attribute node
+          $xPath = $this->_prestr($absoluteXPath, '/attribute::');       // Get the path to the attribute node's parent.
+          $attribute = $this->_afterstr($absoluteXPath, '/attribute::'); // Get the name of the attribute.
+          unSet($this->nodeIndex[$xPath]['attributes'][$attribute]);     // Unset the attribute
+          if ($bDebugThisFunction) echo "We removed the attribute '$attribute' of node '$xPath'.\n";
+          continue;
+        }
+        // Otherwise remove the node by setting it to NULL. It will be removed on the next reindexNodeTree() call.
+        $mustReindex = $autoReindex;
+        // Flag the index as dirty; it's not uptodate. A reindex will be forced (if dirty) when exporting the XML doc
+        $this->_indexIsDirty = TRUE;
+        
+        $theNode = $this->nodeIndex[$absoluteXPath];
+        $theNode['parentNode']['childNodes'][$theNode['pos']] =& $NULL;
+        if ($bDebugThisFunction) echo "We removed the node '$absoluteXPath'.\n";
+      }
+      // Reindex the node tree again
+      if ($mustReindex) $this->reindexNodeTree();
+      $status = TRUE;
+    } while(FALSE);
+    
+    $this->_closeDebugFunction($ThisFunctionName, $status, $bDebugThisFunction);
+
+    return $status;
+  }
+  
+  /**
+   * Replace a node with any data string. The $data is taken 1:1.
+   *
+   * This function will delete the node you define by $absoluteXPath (plus it's sub-nodes) and 
+   * substitute it by the string $text. Often used to push in not well formed HTML.
+   * WARNING: 
+   *   The $data is taken 1:1. 
+   *   You are in charge that the data you enter is valid XML if you intend
+   *   to export and import the content again.
+   *
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery  (string) xpath to the node (See note above).
+   * @param  $data        (string) String containing the content to be set. *READONLY*
+   * @param  $autoReindex (bool)   (optional, default=TRUE) Reindex the document to reflect 
+   *                               the changes.  A performance helper.  See reindexNodeTree()
+   * @return              (bool)   TRUE on success, FALSE on error;
+   * @see    setModMatch(), replaceChild(), reindexNodeTree()
+   */
+  function replaceChildByData($xPathQuery, $data, $autoReindex=TRUE) {
+    $ThisFunctionName = 'replaceChildByData';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Node: $xPathQuery\n";
+    }
+
+    $NULL = NULL;
+    $status = FALSE;
+    do { // try-block
+      // Check for a valid xPathQuery
+      $xPathSet = $this->_resolveXPathQuery($xPathQuery,'replaceChildByData');
+      if (sizeOf($xPathSet) === 0) {
+        $this->_displayError(sprintf($this->errorStrings['NoNodeMatch'], $xPathQuery), __LINE__, __FILE__, FALSE);
+        break; // try-block
+      }
+      $mustReindex = FALSE;
+      // Make chages from 'bottom-up'. In this manner the modifications will not affect itself.
+      for ($i=sizeOf($xPathSet)-1; $i>=0; $i--) {
+        $mustReindex = $autoReindex;
+        // Flag the index as dirty; it's not uptodate. A reindex will be forced (if dirty) when exporting the XML doc
+        $this->_indexIsDirty = TRUE;
+        
+        $absoluteXPath = $xPathSet[$i];
+        $theNode = $this->nodeIndex[$absoluteXPath];
+        $pos = $theNode['pos'];
+        $theNode['parentNode']['textParts'][$pos] .= $data;
+        $theNode['parentNode']['childNodes'][$pos] =& $NULL;
+        if ($bDebugThisFunction) echo "We replaced the node '$absoluteXPath' with data.\n";
+      }
+      // Reindex the node tree again
+      if ($mustReindex) $this->reindexNodeTree();
+      $status = TRUE;
+    } while(FALSE);
+    
+    $this->_closeDebugFunction($ThisFunctionName, ($status) ? 'Success' : '!!! FAILD !!!', $bDebugThisFunction);
+
+    return $status;
+  }
+  
+  /**
+   * Replace the node(s) that matches the xQuery with the passed node (or passed node-tree)
+   * 
+   * If the passed node is a string it's assumed to be XML and replaceChildByXml() 
+   * will be called.
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery  (string) Xpath to the node being replaced.
+   * @param  $node        (mixed)  String or Array (Usually a String)
+   *                               If string: Vaild XML. E.g. "<A/>" or "<A> foo <B/> bar <A/>"
+   *                               If array:  A Node (can be a whole sub-tree) (See comment in header)
+   * @param  $autoReindex (bool)   (optional, default=TRUE) Reindex the document to reflect 
+   *                               the changes.  A performance helper.  See reindexNodeTree()
+   * @return              (array)  The last replaced $node (can be a whole sub-tree)
+   * @see    reindexNodeTree()
+   */
+  function &replaceChild($xPathQuery, $node, $autoReindex=TRUE) {
+    $NULL = NULL;
+    if (is_string($node)) {
+      if (empty($node)) { //--sam. Not sure how to react on an empty string - think it's an error.
+        return array();
+      } else { 
+        if (!($node = $this->_xml2Document($node))) return FALSE;
+      }
+    }
+    
+    // Special case if it's 'super root'. We then have to take the child node == top node
+    if (empty($node['parentNode'])) $node = $node['childNodes'][0];
+    
+    $status = FALSE;
+    do { // try-block
+      // Check for a valid xPathQuery
+      $xPathSet = $this->_resolveXPathQuery($xPathQuery,'replaceChild');
+      if (sizeOf($xPathSet) === 0) {
+        $this->_displayError(sprintf($this->errorStrings['NoNodeMatch'], $xPathQuery), __LINE__, __FILE__, FALSE);
+        break; // try-block
+      }
+      $mustReindex = FALSE;
+      
+      // Make chages from 'bottom-up'. In this manner the modifications will not affect itself.
+      for ($i=sizeOf($xPathSet)-1; $i>=0; $i--) {
+        $mustReindex = $autoReindex;
+        // Flag the index as dirty; it's not uptodate. A reindex will be forced (if dirty) when exporting the XML doc
+        $this->_indexIsDirty = TRUE;
+        
+        $absoluteXPath = $xPathSet[$i];
+        $childNode =& $this->nodeIndex[$absoluteXPath];
+        $parentNode =& $childNode['parentNode'];
+        $childNode['parentNode'] =& $NULL;
+        $childPos = $childNode['pos'];
+        $parentNode['childNodes'][$childPos] =& $this->cloneNode($node);
+      }
+      if ($mustReindex) $this->reindexNodeTree();
+      $status = TRUE;
+    } while(FALSE);
+    
+    if (!$status) return FALSE;
+    return $childNode;
+  }
+  
+  /**
+   * Insert passed node (or passed node-tree) at the node(s) that matches the xQuery.
+   *
+   * With parameters you can define if the 'hit'-node is shifted to the right or left 
+   * and if it's placed before of after the text-part.
+   * Per derfault the 'hit'-node is shifted to the right and the node takes the place 
+   * the of the 'hit'-node. 
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   * 
+   * E.g. Following is given:           AAA[1]           
+   *                                  /       \          
+   *                              ..BBB[1]..BBB[2] ..    
+   *
+   * a) insertChild('/AAA[1]/BBB[2]', <node CCC>)
+   * b) insertChild('/AAA[1]/BBB[2]', <node CCC>, $shiftRight=FALSE)
+   * c) insertChild('/AAA[1]/BBB[2]', <node CCC>, $shiftRight=FALSE, $afterText=FALSE)
+   *
+   * a)                          b)                           c)                        
+   *          AAA[1]                       AAA[1]                       AAA[1]          
+   *        /    |   \                   /    |   \                   /    |   \        
+   *  ..BBB[1]..CCC[1]BBB[2]..     ..BBB[1]..BBB[2]..CCC[1]     ..BBB[1]..BBB[2]CCC[1]..
+   *
+   * #### Do a complete review of the "(optional)" tag after several arguments.
+   *
+   * @param  $xPathQuery  (string) Xpath to the node to append.
+   * @param  $node        (mixed)  String or Array (Usually a String)
+   *                               If string: Vaild XML. E.g. "<A/>" or "<A> foo <B/> bar <A/>"
+   *                               If array:  A Node (can be a whole sub-tree) (See comment in header)
+   * @param  $shiftRight  (bool)   (optional, default=TRUE) Shift the target node to the right.
+   * @param  $afterText   (bool)   (optional, default=TRUE) Insert after the text.
+   * @param  $autoReindex (bool)   (optional, default=TRUE) Reindex the document to reflect 
+   *                                the changes.  A performance helper.  See reindexNodeTree()
+   * @return              (mixed)  FALSE on error (or no match). On success we return the path(s) to the newly
+   *                               appended nodes. That is: Array of paths if more then 1 node was added or
+   *                               a single path string if only one node was added.
+   *                               NOTE:  If autoReindex is FALSE, then we can't return the *complete* path
+   *                               as the exact doc-pos isn't available without reindexing. In that case we leave
+   *                               out the last [docpos] in the path(s). ie  we'd return /A[3]/B instead of /A[3]/B[2]
+   * @see    appendChildByXml(), reindexNodeTree()
+   */
+  function insertChild($xPathQuery, $node, $shiftRight=TRUE, $afterText=TRUE, $autoReindex=TRUE) {
+    if (is_string($node)) {
+      if (empty($node)) { //--sam. Not sure how to react on an empty string - think it's an error.
+        return FALSE;
+      } else { 
+        if (!($node = $this->_xml2Document($node))) return FALSE;
+      }
+    }
+
+    // Special case if it's 'super root'. We then have to take the child node == top node
+    if (empty($node['parentNode'])) $node = $node['childNodes'][0];
+    
+    // Check for a valid xPathQuery
+    $xPathSet = $this->_resolveXPathQuery($xPathQuery,'insertChild');
+    if (sizeOf($xPathSet) === 0) {
+      $this->_displayError(sprintf($this->errorStrings['NoNodeMatch'], $xPathQuery), __LINE__, __FILE__, FALSE);
+      return FALSE;
+    }
+    $mustReindex = FALSE;
+    $newNodes = array();
+    $result = array();
+    // Make chages from 'bottom-up'. In this manner the modifications will not affect itself.
+    for ($i=sizeOf($xPathSet)-1; $i>=0; $i--) {
+      $absoluteXPath = $xPathSet[$i];
+      $childNode =& $this->nodeIndex[$absoluteXPath];
+      $parentNode =& $childNode['parentNode'];
+
+      // We can't insert at the super root or at the root.
+      if (empty($absoluteXPath) || (!$parentNode['parentNode'])) {
+        $this->_displayError(sprintf($this->errorStrings['RootNodeAlreadyExists']), __LINE__, __FILE__, FALSE);
+        return FALSE;
+      }
+
+      $mustReindex = $autoReindex;
+      // Flag the index as dirty; it's not uptodate. A reindex will be forced (if dirty) when exporting the XML doc
+      $this->_indexIsDirty = TRUE;
+      
+      //Special case: It not possible to add siblings to the top node.
+      if (empty($parentNode['name'])) continue;
+      $newNode =& $this->cloneNode($node);
+      $pos = $shiftRight ? $childNode['pos'] : $childNode['pos']+1;
+      $parentNode['childNodes'] = array_merge(
+                                    array_slice($parentNode['childNodes'], 0, $pos),
+                                    array(&$newNode),
+                                    array_slice($parentNode['childNodes'], $pos)
+                                  );
+      $pos += $afterText ? 1 : 0;
+      $parentNode['textParts'] = array_merge(
+                                   array_slice($parentNode['textParts'], 0, $pos),
+                                   array(''),
+                                   array_slice($parentNode['textParts'], $pos)
+                                 );
+      
+      // We are going from bottom to top, but the user will want results from top to bottom.
+      if ($mustReindex) {
+        // We'll have to wait till after the reindex to get the full path to this new node.
+        $newNodes[] = &$newNode;
+      } else {
+        // If we are reindexing the tree later, then we can't return the user any
+        // useful results, so we just return them the count.
+        $newNodePath = $parentNode['xpath'].'/'.$newNode['name'];
+        array_unshift($result, $newNodePath);
+      }
+    }
+    if ($mustReindex) {
+      $this->reindexNodeTree();
+      // Now we must fill in the result array.  Because until now we did not
+      // know what contextpos our newly added entries had, just their pos within
+      // the siblings.
+      foreach ($newNodes as $newNode) {
+        array_unshift($result, $newNode['xpath']);
+      }
+    }
+    if (count($result) == 1) $result = $result[0];
+    return $result;
+  }
+  
+  /**
+   * Appends a child to anothers children.
+   *
+   * If you intend to do a lot of appending, you should leave autoIndex as FALSE
+   * and then call reindexNodeTree() when you are finished all the appending.
+   *
+   * @param  $xPathQuery  (string) Xpath to the node to append to.
+   * @param  $node        (mixed)  String or Array (Usually a String)
+   *                               If string: Vaild XML. E.g. "<A/>" or "<A> foo <B/> bar <A/>"
+   *                               If array:  A Node (can be a whole sub-tree) (See comment in header)
+   * @param  $afterText   (bool)   (optional, default=FALSE) Insert after the text.
+   * @param  $autoReindex (bool)   (optional, default=TRUE) Reindex the document to reflect 
+   *                               the changes.  A performance helper.  See reindexNodeTree()
+   * @return              (mixed)  FALSE on error (or no match). On success we return the path(s) to the newly
+   *                               appended nodes. That is: Array of paths if more then 1 node was added or
+   *                               a single path string if only one node was added.
+   *                               NOTE:  If autoReindex is FALSE, then we can't return the *complete* path
+   *                               as the exact doc-pos isn't available without reindexing. In that case we leave
+   *                               out the last [docpos] in the path(s). ie  we'd return /A[3]/B instead of /A[3]/B[2]
+   * @see    insertChild(), reindexNodeTree()
+   */
+  function appendChild($xPathQuery, $node, $afterText=FALSE, $autoReindex=TRUE) {
+    if (is_string($node)) {
+      if (empty($node)) { //--sam. Not sure how to react on an empty string - think it's an error.
+        return FALSE;
+      } else { 
+        if (!($node = $this->_xml2Document($node))) return FALSE;
+      }
+    }
+    
+    // Special case if it's 'super root'. We then have to take the child node == top node
+    if (empty($node['parentNode'])) $node = $node['childNodes'][0];
+
+    // Check for a valid xPathQuery
+    $xPathSet = $this->_resolveXPathQueryForNodeMod($xPathQuery, 'appendChild');
+    if (sizeOf($xPathSet) === 0) return FALSE;
+
+    $mustReindex = FALSE;
+    $newNodes = array();
+    $result = array();
+    // Make chages from 'bottom-up'. In this manner the modifications will not affect itself.
+    for ($i=sizeOf($xPathSet)-1; $i>=0; $i--) {
+      $mustReindex = $autoReindex;
+      // Flag the index as dirty; it's not uptodate. A reindex will be forced (if dirty) when exporting the XML doc
+      $this->_indexIsDirty = TRUE;
+      
+      $absoluteXPath = $xPathSet[$i];
+      $parentNode =& $this->nodeIndex[$absoluteXPath];
+      $newNode =& $this->cloneNode($node);
+      $parentNode['childNodes'][] =& $newNode;
+      $pos = count($parentNode['textParts']);
+      $pos -= $afterText ? 0 : 1;
+      $parentNode['textParts'] = array_merge(
+                                   array_slice($parentNode['textParts'], 0, $pos),
+                                   array(''),
+                                   array_slice($parentNode['textParts'], $pos)
+                                 );
+      // We are going from bottom to top, but the user will want results from top to bottom.
+      if ($mustReindex) {
+        // We'll have to wait till after the reindex to get the full path to this new node.
+        $newNodes[] = &$newNode;
+      } else {
+        // If we are reindexing the tree later, then we can't return the user any
+        // useful results, so we just return them the count.
+        array_unshift($result, "$absoluteXPath/{$newNode['name']}");
+      }
+    }
+    if ($mustReindex) {
+      $this->reindexNodeTree();
+      // Now we must fill in the result array.  Because until now we did not
+      // know what contextpos our newly added entries had, just their pos within
+      // the siblings.
+      foreach ($newNodes as $newNode) {
+        array_unshift($result, $newNode['xpath']);
+      }
+    } 
+    if (count($result) == 1) $result = $result[0];
+    return $result;
+  }
+  
+  /**
+   * Inserts a node before the reference node with the same parent.
+   *
+   * If you intend to do a lot of appending, you should leave autoIndex as FALSE
+   * and then call reindexNodeTree() when you are finished all the appending.
+   *
+   * @param  $xPathQuery  (string) Xpath to the node to insert new node before
+   * @param  $node        (mixed)  String or Array (Usually a String)
+   *                               If string: Vaild XML. E.g. "<A/>" or "<A> foo <B/> bar <A/>"
+   *                               If array:  A Node (can be a whole sub-tree) (See comment in header)
+   * @param  $afterText   (bool)   (optional, default=FLASE) Insert after the text.
+   * @param  $autoReindex (bool)   (optional, default=TRUE) Reindex the document to reflect 
+   *                               the changes.  A performance helper.  See reindexNodeTree()
+   * @return              (mixed)  FALSE on error (or no match). On success we return the path(s) to the newly
+   *                               appended nodes. That is: Array of paths if more then 1 node was added or
+   *                               a single path string if only one node was added.
+   *                               NOTE:  If autoReindex is FALSE, then we can't return the *complete* path
+   *                               as the exact doc-pos isn't available without reindexing. In that case we leave
+   *                               out the last [docpos] in the path(s). ie  we'd return /A[3]/B instead of /A[3]/B[2]
+   * @see    reindexNodeTree()
+   */
+  function insertBefore($xPathQuery, $node, $afterText=TRUE, $autoReindex=TRUE) {
+    return $this->insertChild($xPathQuery, $node, $shiftRight=TRUE, $afterText, $autoReindex);
+  }
+  
+
+  //-----------------------------------------------------------------------------------------
+  // XPath                     ------  Attribute  Set/Get  ------                            
+  //-----------------------------------------------------------------------------------------
+  
+  /** 
+   * Retrieves a dedecated attribute value or a hash-array of all attributes of a node.
+   * 
+   * The first param $absoluteXPath must be a valid xpath OR a xpath-query that results 
+   * to *one* xpath. If the second param $attrName is not set, a hash-array of all attributes 
+   * of that node is returned.
+   *
+   * Optionally you may pass an attrubute name in $attrName and the function will return the 
+   * string value of that attribute.
+   *
+   * @param  $absoluteXPath (string) Full xpath OR a xpath-query that results to *one* xpath.
+   * @param  $attrName      (string) (Optional) The name of the attribute. See above.
+   * @return                (mixed)  hash-array or a string of attributes depending if the 
+   *                                 parameter $attrName was set (see above).  FALSE if the 
+   *                                 node or attribute couldn't be found.
+   * @see    setAttribute(), removeAttribute()
+   */
+  function getAttributes($absoluteXPath, $attrName=NULL) {
+    // Numpty check
+    if (!isSet($this->nodeIndex[$absoluteXPath])) {
+      $xPathSet = $this->_resolveXPathQuery($absoluteXPath,'getAttributes');
+      if (empty($xPathSet)) return FALSE;
+      // only use the first entry
+      $absoluteXPath = $xPathSet[0];
+    }
+    if (!empty($this->parseOptions[XML_OPTION_CASE_FOLDING])) {
+        // Case in-sensitive
+        $attrName = strtoupper($attrName);
+    }
+    
+    // Return the complete list or just the desired element
+    if (is_null($attrName)) {
+      return $this->nodeIndex[$absoluteXPath]['attributes'];
+    } elseif (isSet($this->nodeIndex[$absoluteXPath]['attributes'][$attrName])) {
+      return $this->nodeIndex[$absoluteXPath]['attributes'][$attrName];
+    }
+    return FALSE;
+  }
+  
+  /**
+   * Set attributes of a node(s).
+   *
+   * This method sets a number single attributes. An existing attribute is overwritten (default)
+   * with the new value, but setting the last param to FALSE will prevent overwritten.
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery (string) xpath to the node (See note above).
+   * @param  $name       (string) Attribute name.
+   * @param  $value      (string) Attribute value.   
+   * @param  $overwrite  (bool)   If the attribute is already set we overwrite it (see text above)
+   * @return             (bool)   TRUE on success, FALSE on failure.
+   * @see    getAttributes(), removeAttribute()
+   */
+  function setAttribute($xPathQuery, $name, $value, $overwrite=TRUE) {
+    return $this->setAttributes($xPathQuery, array($name => $value), $overwrite);
+  }
+  
+  /**
+   * Version of setAttribute() that sets multiple attributes to node(s).
+   *
+   * This method sets a number of attributes. Existing attributes are overwritten (default)
+   * with the new values, but setting the last param to FALSE will prevent overwritten.
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery (string) xpath to the node (See note above).
+   * @param  $attributes (array)  associative array of attributes to set.
+   * @param  $overwrite  (bool)   If the attributes are already set we overwrite them (see text above)
+   * @return             (bool)   TRUE on success, FALSE otherwise
+   * @see    setAttribute(), getAttributes(), removeAttribute()
+   */
+  function setAttributes($xPathQuery, $attributes, $overwrite=TRUE) {
+    $status = FALSE;
+    do { // try-block
+      // The attributes parameter should be an associative array.
+      if (!is_array($attributes)) break;  // try-block
+      
+      // Check for a valid xPathQuery
+      $xPathSet = $this->_resolveXPathQuery($xPathQuery,'setAttributes');
+      foreach($xPathSet as $absoluteXPath) {
+        // Add the attributes to the node.
+        $theNode =& $this->nodeIndex[$absoluteXPath];
+        if (empty($theNode['attributes'])) {
+          $this->nodeIndex[$absoluteXPath]['attributes'] = $attributes;
+        } else {
+          $theNode['attributes'] = $overwrite ? array_merge($theNode['attributes'],$attributes) : array_merge($attributes, $theNode['attributes']);
+        }
+      }
+      $status = TRUE;
+    } while(FALSE); // END try-block
+    
+    return $status;
+  }
+  
+  /**
+   * Removes an attribute of a node(s).
+   *
+   * This method removes *ALL* attributres per default unless the second parameter $attrList is set.
+   * $attrList can be either a single attr-name as string OR a vector of attr-names as array.
+   * E.g. 
+   *  removeAttribute(<xPath>);                     # will remove *ALL* attributes.
+   *  removeAttribute(<xPath>, 'A');                # will only remove attributes called 'A'.
+   *  removeAttribute(<xPath>, array('A_1','A_2')); # will remove attribute 'A_1' and 'A_2'.
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param   $xPathQuery (string) xpath to the node (See note above).
+   * @param   $attrList   (mixed)  (optional) if not set will delete *all* (see text above)
+   * @return              (bool)   TRUE on success, FALSE if the node couldn't be found
+   * @see     getAttributes(), setAttribute()
+   */
+  function removeAttribute($xPathQuery, $attrList=NULL) {
+    // Check for a valid xPathQuery
+    $xPathSet = $this->_resolveXPathQuery($xPathQuery, 'removeAttribute');
+    
+    if (!empty($attrList) AND is_string($attrList)) $attrList = array($attrList);
+    if (!is_array($attrList)) return FALSE;
+    
+    foreach($xPathSet as $absoluteXPath) {
+      // If the attribute parameter wasn't set then remove all the attributes
+      if ($attrList[0] === NULL) {
+        $this->nodeIndex[$absoluteXPath]['attributes'] = array();
+        continue; 
+      }
+      // Remove all the elements in the array then.
+      foreach($attrList as $name) {
+        unset($this->nodeIndex[$absoluteXPath]['attributes'][$name]);
+      }
+    }
+    return TRUE;
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPath                        ------  Text  Set/Get  ------                              
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Retrieve all the text from a node as a single string.
+   *
+   * Sample  
+   * Given is: <AA> This <BB\>is <BB\>  some<BB\>text </AA>
+   * Return of getData('/AA[1]') would be:  " This is   sometext "
+   * The first param $xPathQuery must be a valid xpath OR a xpath-query that 
+   * results to *one* xpath. 
+   *
+   * @param  $xPathQuery (string) xpath to the node - resolves to *one* xpath.
+   * @return             (mixed)  The returned string (see above), FALSE if the node 
+   *                              couldn't be found or is not unique.
+   * @see getDataParts()
+   */
+  function getData($xPathQuery) {
+    $aDataParts = $this->getDataParts($xPathQuery);
+    if ($aDataParts === FALSE) return FALSE;
+    return implode('', $aDataParts);
+  }
+  
+  /**
+   * Retrieve all the text from a node as a vector of strings
+   * 
+   * Where each element of the array was interrupted by a non-text child element.
+   *
+   * Sample  
+   * Given is: <AA> This <BB\>is <BB\>  some<BB\>text </AA>
+   * Return of getDataParts('/AA[1]') would be:  array([0]=>' This ', [1]=>'is ', [2]=>'  some', [3]=>'text ');
+   * The first param $absoluteXPath must be a valid xpath OR a xpath-query that results 
+   * to *one* xpath. 
+   *
+   * @param  $xPathQuery (string) xpath to the node - resolves to *one* xpath.
+   * @return             (mixed)  The returned array (see above), or FALSE if node is not 
+   *                              found or is not unique.
+   * @see getData()
+   */
+  function getDataParts($xPathQuery) {
+    // Resolve xPath argument
+    $xPathSet = $this->_resolveXPathQuery($xPathQuery, 'getDataParts');
+    if (1 !== ($setSize=count($xPathSet))) {
+      $this->_displayError(sprintf($this->errorStrings['AbsoluteXPathRequired'], $xPathQuery) . "Not unique xpath-query, matched {$setSize}-times.", __LINE__, __FILE__, FALSE);
+      return FALSE;
+    }
+    $absoluteXPath = $xPathSet[0];
+    // Is it an attribute node?
+    if (preg_match(";(.*)/attribute::([^/]*)$;U", $xPathSet[0], $matches)) {
+      $absoluteXPath = $matches[1];
+      $attribute = $matches[2];
+      if (!isSet($this->nodeIndex[$absoluteXPath]['attributes'][$attribute])) {
+        $this->_displayError("The $absoluteXPath/attribute::$attribute value isn't a node in this document.", __LINE__, __FILE__, FALSE);
+        continue;
+      }
+      return array($this->nodeIndex[$absoluteXPath]['attributes'][$attribute]);
+    } else if (preg_match(":(.*)/text\(\)(\[(.*)\])?$:U", $xPathQuery, $matches)) {
+      $absoluteXPath = $matches[1];
+      $textPartNr = $matches[2];      
+      return array($this->nodeIndex[$absoluteXPath]['textParts'][$textPartNr]);
+    } else {
+      return $this->nodeIndex[$absoluteXPath]['textParts'];
+    }
+  }
+  
+  /**
+   * Retrieves a sub string of a text-part OR attribute-value.
+   *
+   * This method retrieves the sub string of a specific text-part OR (if the 
+   * $absoluteXPath references an attribute) the the sub string  of the attribute value.
+   * If no 'direct referencing' is used (Xpath ends with text()[<part-number>]), then 
+   * the first text-part of the node ist returned (if exsiting).
+   *
+   * @param  $absoluteXPath (string) Xpath to the node (See note above).   
+   * @param  $offset        (int)    (optional, default is 0) Starting offset. (Just like PHP's substr())
+   * @param  $count         (number) (optional, default is ALL) Character count  (Just like PHP's substr())
+   * @return                (mixed)  The sub string, FALSE if not found or on error
+   * @see    XPathEngine::wholeText(), PHP's substr()
+   */
+  function substringData($absoluteXPath, $offset = 0, $count = NULL) {
+    if (!($text = $this->wholeText($absoluteXPath))) return FALSE;
+    if (is_null($count)) {
+      return substr($text, $offset);
+    } else {
+      return substr($text, $offset, $count);
+    } 
+  }
+  
+  /**
+   * Replace a sub string of a text-part OR attribute-value.
+   *
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery    (string) xpath to the node (See note above).
+   * @param  $replacement   (string) The string to replace with.
+   * @param  $offset        (int)    (optional, default is 0) Starting offset. (Just like PHP's substr_replace ())
+   * @param  $count         (number) (optional, default is 0=ALL) Character count  (Just like PHP's substr_replace())
+   * @param  $textPartNr    (int)    (optional) (see _getTextSet() )
+   * @return                (bool)   The new string value on success, FALSE if not found or on error
+   * @see    substringData()
+   */
+  function replaceData($xPathQuery, $replacement, $offset = 0, $count = 0, $textPartNr=1) {
+    if (!($textSet = $this->_getTextSet($xPathQuery, $textPartNr))) return FALSE;
+    $tSize=sizeOf($textSet);
+    for ($i=0; $i<$tSize; $i++) {
+      if ($count) {
+        $textSet[$i] = substr_replace($textSet[$i], $replacement, $offset, $count);
+      } else {
+        $textSet[$i] = substr_replace($textSet[$i], $replacement, $offset);
+      } 
+    }
+    return TRUE;
+  }
+  
+  /**
+   * Insert a sub string in a text-part OR attribute-value.
+   *
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery (string) xpath to the node (See note above).
+   * @param  $data       (string) The string to replace with.
+   * @param  $offset     (int)    (optional, default is 0) Offset at which to insert the data.
+   * @return             (bool)   The new string on success, FALSE if not found or on error
+   * @see    replaceData()
+   */
+  function insertData($xPathQuery, $data, $offset=0) {
+    return $this->replaceData($xPathQuery, $data, $offset, 0);
+  }
+  
+  /**
+   * Append text data to the end of the text for an attribute OR node text-part.
+   *
+   * This method adds content to a node. If it's an attribute node, then
+   * the value of the attribute will be set, otherwise the passed data will append to 
+   * character data of the node text-part. Per default the first text-part is taken.
+   *
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param   $xPathQuery (string) to the node(s) (See note above).
+   * @param   $data       (string) String containing the content to be added.
+   * @param   $textPartNr (int)    (optional, default is 1) (see _getTextSet())
+   * @return              (bool)   TRUE on success, otherwise FALSE
+   * @see     _getTextSet()
+   */
+  function appendData($xPathQuery, $data, $textPartNr=1) {
+    if (!($textSet = $this->_getTextSet($xPathQuery, $textPartNr))) return FALSE;
+    $tSize=sizeOf($textSet);
+    for ($i=0; $i<$tSize; $i++) {
+      $textSet[$i] .= $data;
+    }
+    return TRUE;
+  }
+  
+  /**
+   * Delete the data of a node.
+   *
+   * This method deletes content of a node. If it's an attribute node, then
+   * the value of the attribute will be removed, otherwise the node text-part. 
+   * will be deleted.  Per default the first text-part is deleted.
+   *
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery (string) to the node(s) (See note above).
+   * @param  $offset     (int)    (optional, default is 0) Starting offset. (Just like PHP's substr_replace())
+   * @param  $count      (number) (optional, default is 0=ALL) Character count.  (Just like PHP's substr_replace())
+   * @param  $textPartNr (int)    (optional, default is 0) the text part to delete (see _getTextSet())
+   * @return             (bool)   TRUE on success, otherwise FALSE
+   * @see     _getTextSet()
+   */
+  function deleteData($xPathQuery, $offset=0, $count=0, $textPartNr=1) {
+    if (!($textSet = $this->_getTextSet($xPathQuery, $textPartNr))) return FALSE;
+    $tSize=sizeOf($textSet);
+    for ($i=0; $i<$tSize; $i++) {
+      if (!$count)
+        $textSet[$i] = "";
+      else
+        $textSet[$i] = substr_replace($textSet[$i],'', $offset, $count);
+    } 
+    return TRUE;
+  }
+ 
+  //-----------------------------------------------------------------------------------------
+  // XPath                      ------  Help Stuff  ------                                   
+  //-----------------------------------------------------------------------------------------
+   
+  /**
+   * Parse the XML to a node-tree. A so called 'document'
+   *
+   * @param  $xmlString (string) The string to turn into a document node.
+   * @return            (&array)  a node-tree
+   */
+  function &_xml2Document($xmlString) {
+    $xmlOptions = array(
+                    XML_OPTION_CASE_FOLDING => $this->getProperties('caseFolding'), 
+                    XML_OPTION_SKIP_WHITE   => $this->getProperties('skipWhiteSpaces')
+                  );
+    $xmlParser =& new XPathEngine($xmlOptions);
+    $xmlParser->setVerbose($this->properties['verboseLevel']);
+    // Parse the XML string
+    if (!$xmlParser->importFromString($xmlString)) {
+      $this->_displayError($xmlParser->getLastError(), __LINE__, __FILE__, FALSE);
+      return FALSE;
+    }
+    return $xmlParser->getNode('/');
+  }
+  
+  /**
+   * Get a reference-list to node text part(s) or node attribute(s).
+   * 
+   * If the Xquery references an attribute(s) (Xquery ends with attribute::), 
+   * then the text value of the node-attribute(s) is/are returned.
+   * Otherwise the Xquery is referencing to text part(s) of node(s). This can be either a 
+   * direct reference to text part(s) (Xquery ends with text()[<nr>]) or indirect reference 
+   * (a simple Xquery to node(s)).
+   * 1) Direct Reference (Xquery ends with text()[<part-number>]):
+   *   If the 'part-number' is omitted, the first text-part is assumed; starting by 1.
+   *   Negative numbers are allowed, where -1 is the last text-part a.s.o.
+   * 2) Indirect Reference (a simple  Xquery to node(s)):
+   *   Default is to return the first text part(s). Optionally you may pass a parameter 
+   *   $textPartNr to define the text-part you want;  starting by 1.
+   *   Negative numbers are allowed, where -1 is the last text-part a.s.o.
+   *
+   * NOTE I : The returned vector is a set of references to the text parts / attributes.
+   *          This is handy, if you wish to modify the contents.
+   * NOTE II: text-part numbers out of range will not be in the list
+   * NOTE III:Instead of an absolute xpath you may also pass a xpath-query.
+   *          Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param   $xPathQuery (string) xpath to the node (See note above).
+   * @param   $textPartNr (int)    String containing the content to be set.
+   * @return              (mixed)  A vector of *references* to the text that match, or 
+   *                               FALSE on error
+   * @see XPathEngine::wholeText()
+   */
+  function _getTextSet($xPathQuery, $textPartNr=1) {
+    $ThisFunctionName = '_getTextSet';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Node: $xPathQuery\n";
+      echo "Text Part Number: $textPartNr\n";
+      echo "<hr>";
+    }
+    
+    $status = FALSE;
+    $funcName = '_getTextSet';
+    $textSet = array();
+    
+    do { // try-block
+      // Check if it's a Xpath reference to an attribut(s). Xpath ends with attribute::)
+      if (preg_match(";(.*)/(attribute::|@)([^/]*)$;U", $xPathQuery, $matches)) {
+        $xPathQuery = $matches[1];
+        $attribute = $matches[3];
+        // Quick out
+        if (isSet($this->nodeIndex[$xPathQuery])) {
+          $xPathSet[] = $xPathQuery;
+        } else {
+          // Try to evaluate the absoluteXPath (since it seems to be an Xquery and not an abs. Xpath)
+          $xPathSet = $this->_resolveXPathQuery("$xPathQuery/attribute::$attribute", $funcName);
+        }
+        foreach($xPathSet as $absoluteXPath) {
+          preg_match(";(.*)/attribute::([^/]*)$;U", $xPathSet[0], $matches);
+          $absoluteXPath = $matches[1];
+          $attribute = $matches[2];
+          if (!isSet($this->nodeIndex[$absoluteXPath]['attributes'][$attribute])) {
+            $this->_displayError("The $absoluteXPath/attribute::$attribute value isn't a node in this document.", __LINE__, __FILE__, FALSE);
+            continue;
+          }
+          $textSet[] =& $this->nodes[$absoluteXPath]['attributes'][$attribute];
+        }
+        $status = TRUE;
+        break; // try-block
+      }
+      
+      // Check if it's a Xpath reference direct to a text-part(s). (xpath ends with text()[<part-number>])
+      if (preg_match(":(.*)/text\(\)(\[(.*)\])?$:U", $xPathQuery, $matches)) {
+        $xPathQuery = $matches[1];
+        // default to the first text node if a text node was not specified
+        $textPartNr = isSet($matches[2]) ? substr($matches[2],1,-1) : 1;
+        // Quick check
+        if (isSet($this->nodeIndex[$xPathQuery])) {
+          $xPathSet[] = $xPathQuery;
+        } else {
+          // Try to evaluate the absoluteXPath (since it seams to be an Xquery and not an abs. Xpath)
+          $xPathSet = $this->_resolveXPathQuery("$xPathQuery/text()[$textPartNr]", $funcName);
+        }
+      }
+      else {
+        // At this point we have been given an xpath with neither a 'text()' or 'attribute::' axis at the end
+        // So this means to get the text-part of the node. If parameter $textPartNr was not set, use the last
+        // text-part.
+        if (isSet($this->nodeIndex[$xPathQuery])) {
+          $xPathSet[] = $xPathQuery;
+        } else {
+          // Try to evaluate the absoluteXPath (since it seams to be an Xquery and not an abs. Xpath)
+          $xPathSet = $this->_resolveXPathQuery($xPathQuery, $funcName);
+        }
+      }
+
+      if ($bDebugThisFunction) {
+        echo "Looking up paths for:\n";
+        print_r($xPathSet);
+      }
+
+      // Now fetch all text-parts that match. (May be 0,1 or many)
+      foreach($xPathSet as $absoluteXPath) {
+        unset($text);
+        if ($text =& $this->wholeText($absoluteXPath, $textPartNr)) {
+          $textSet[] =& $text;
+        } else {
+          // The node does not yet have any text, so we have to add a '' string so that
+          // if we insert or replace to it, then we'll actually have something to op on.
+          $this->nodeIndex[$absoluteXPath]['textParts'][$textPartNr-1] = '';
+          $textSet[] =& $this->nodeIndex[$absoluteXPath]['textParts'][$textPartNr-1];
+        }
+      }
+
+      $status = TRUE;
+    } while (FALSE); // END try-block
+    
+    if (!$status) $result = FALSE;
+    else          $result = $textSet;
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    return $result;
+  }
+  
+
+  /**
+   * Resolves an xPathQuery vector for a node op for modification
+   *
+   * It is possible to create a brand new object, and try to append and insert nodes
+   * into it, so this is a version of _resolveXPathQuery() that will autocreate the
+   * super root if it detects that it is not present and the $xPathQuery is empty.
+   *
+   * Also it demands that there be at least one node returned, and displays a suitable
+   * error message if the returned xPathSet does not contain any nodes.
+   * 
+   * @param  $xPathQuery (string) An xpath query targeting a single node.  If empty() 
+   *                              returns the root node and auto creates the root node
+   *                              if it doesn't exist.
+   * @param  $function   (string) The function in which this check was called
+   * @return             (array)  Vector of $absoluteXPath's (May be empty)
+   * @see    _resolveXPathQuery()
+   */
+  function _resolveXPathQueryForNodeMod($xPathQuery, $functionName) {
+    $xPathSet = array();
+    if (empty($xPathQuery)) {
+      // You can append even if the root node doesn't exist.
+      if (!isset($this->nodeIndex[$xPathQuery])) $this->_createSuperRoot();
+      $xPathSet[] = '';
+      // However, you can only append to the super root, if there isn't already a root entry.
+      $rootNodes = $this->_resolveXPathQuery('/*','appendChild');
+      if (count($rootNodes) !== 0) {
+        $this->_displayError(sprintf($this->errorStrings['RootNodeAlreadyExists']), __LINE__, __FILE__, FALSE);
+        return array();
+      }
+    } else {
+      $xPathSet = $this->_resolveXPathQuery($xPathQuery,'appendChild');
+      if (sizeOf($xPathSet) === 0) {
+        $this->_displayError(sprintf($this->errorStrings['NoNodeMatch'], $xPathQuery), __LINE__, __FILE__, FALSE);
+        return array();
+      }
+    }
+    return $xPathSet;
+  }
+
+  /**
+   * Resolves an xPathQuery vector depending on the property['modMatch']
+   * 
+   * To:
+   *   - all matches, 
+   *   - the first
+   *   - none (If the query matches more then one node.)
+   * see  setModMatch() for details
+   * 
+   * @param  $xPathQuery (string) An xpath query targeting a single node.  If empty() 
+   *                              returns the root node (if it exists).
+   * @param  $function   (string) The function in which this check was called
+   * @return             (array)  Vector of $absoluteXPath's (May be empty)
+   * @see    setModMatch()
+   */
+  function _resolveXPathQuery($xPathQuery, $function) {
+    $xPathSet = array();
+    do { // try-block
+      if (isSet($this->nodeIndex[$xPathQuery])) {
+        $xPathSet[] = $xPathQuery;
+        break; // try-block
+      }
+      if (empty($xPathQuery)) break; // try-block
+      if (substr($xPathQuery, -1) === '/') break; // If the xPathQuery ends with '/' then it cannot be a good query.
+      // If this xPathQuery is not absolute then attempt to evaluate it
+      $xPathSet = $this->match($xPathQuery);
+      
+      $resultSize = sizeOf($xPathSet);
+      switch($this->properties['modMatch']) {
+        case XPATH_QUERYHIT_UNIQUE : 
+          if ($resultSize >1) {
+            $xPathSet = array();
+            if ($this->properties['verboseLevel']) $this->_displayError("Canceled function '{$function}'. The query '{$xPathQuery}' mached {$resultSize} nodes and 'modMatch' is set to XPATH_QUERYHIT_UNIQUE.", __LINE__, __FILE__, FALSE);
+          }
+          break;
+        case XPATH_QUERYHIT_FIRST : 
+          if ($resultSize >1) {
+            $xPathSet = array($xPathSet[0]);
+            if ($this->properties['verboseLevel']) $this->_displayError("Only modified first node in function '{$function}' because the query '{$xPathQuery}' mached {$resultSize} nodes and 'modMatch' is set to XPATH_QUERYHIT_FIRST.", __LINE__, __FILE__, FALSE);
+          }
+          break;
+        default: ; // DO NOTHING
+      }
+    } while (FALSE);
+    
+    if ($this->properties['verboseLevel'] >= 2) $this->_displayMessage("'{$xPathQuery}' parameter from '{$function}' returned the following nodes: ".(count($xPathSet)?implode('<br>', $xPathSet):'[none]'), __LINE__, __FILE__);
+    return $xPathSet;
+  }
+} // END OF CLASS XPath
+
+// -----------------------------------------------------------------------------------------
+// -----------------------------------------------------------------------------------------
+// -----------------------------------------------------------------------------------------
+// -----------------------------------------------------------------------------------------
+
+/**************************************************************************************************
+// Usage Sample:
+// -------------
+// Following code will give you an idea how to work with PHP.XPath. It's a working sample
+// to help you get started. :o)
+// Take the comment tags away and run this file.
+**************************************************************************************************/
+
+/**
+ * Produces a short title line.
+ */
+function _title($title) { 
+  echo "<br><hr><b>" . htmlspecialchars($title) . "</b><hr>\n";
+}
+
+$self = isSet($_SERVER) ? $_SERVER['PHP_SELF'] : $PHP_SELF;
+if (basename($self) == 'XPath.class.php') {
+  // The sampe source:
+  $q = '?';
+  $xmlSource = <<< EOD
+  <{$q}Process_Instruction test="&copy;&nbsp;All right reserved" {$q}>
+    <AAA foo="bar"> ,,1,,
+      ..1.. <![CDATA[ bla  bla 
+      newLine blo blo ]]>
+      <BBB foo="bar">
+        ..2..
+      </BBB>..3..<CC/>   ..4..</AAA> 
+EOD;
+  
+  // The sample code:
+  $xmlOptions = array(XML_OPTION_CASE_FOLDING => TRUE, XML_OPTION_SKIP_WHITE => TRUE);
+  $xPath =& new XPath(FALSE, $xmlOptions);
+  //$xPath->bDebugXmlParse = TRUE;
+  if (!$xPath->importFromString($xmlSource)) { echo $xPath->getLastError(); exit; }
+  
+  _title("Following was imported:");
+  echo $xPath->exportAsHtml();
+  
+  _title("Get some content");
+  echo "Last text part in &lt;AAA&gt;: '" . $xPath->wholeText('/AAA[1]', -1) ."'<br>\n";
+  echo "All the text in  &lt;AAA&gt;: '" . $xPath->wholeText('/AAA[1]') ."'<br>\n";
+  echo "The attibute value  in  &lt;BBB&gt; using getAttributes('/AAA[1]/BBB[1]', 'FOO'): '" . $xPath->getAttributes('/AAA[1]', 'FOO') ."'<br>\n";
+  echo "The attibute value  in  &lt;BBB&gt; using getData('/AAA[1]/@FOO'): '" . $xPath->getData('/AAA[1]/@FOO') ."'<br>\n";
+  
+  _title("Append some additional XML below /AAA/BBB:");
+  $xPath->appendChild('/AAA[1]/BBB[1]', '<CCC> Step 1. Append new node </CCC>', $afterText=FALSE);
+  $xPath->appendChild('/AAA[1]/BBB[1]', '<CCC> Step 2. Append new node </CCC>', $afterText=TRUE);
+  $xPath->appendChild('/AAA[1]/BBB[1]', '<CCC> Step 3. Append new node </CCC>', $afterText=TRUE);
+  echo $xPath->exportAsHtml();
+  
+  _title("Insert some additional XML below <AAA>:");
+  $xPath->reindexNodeTree();
+  $xPath->insertChild('/AAA[1]/BBB[1]', '<BB> Step 1. Insert new node </BB>', $shiftRight=TRUE, $afterText=TRUE);
+  $xPath->insertChild('/AAA[1]/BBB[1]', '<BB> Step 2. Insert new node </BB>', $shiftRight=FALSE, $afterText=TRUE);
+  $xPath->insertChild('/AAA[1]/BBB[1]', '<BB> Step 3. Insert new node </BB>', $shiftRight=FALSE, $afterText=FALSE);
+  echo $xPath->exportAsHtml();
+
+  _title("Replace the last <BB> node with new XML data '&lt;DDD&gt; Replaced last BB &lt;/DDD&gt;':");
+  $xPath->reindexNodeTree();
+  $xPath->replaceChild('/AAA[1]/BB[last()]', '<DDD> Replaced last BB </DDD>', $afterText=FALSE);
+  echo $xPath->exportAsHtml();
+  
+  _title("Replace second <BB> node with normal text");
+  $xPath->reindexNodeTree();
+  $xPath->replaceChildByData('/AAA[1]/BB[2]', '"Some new text"');
+  echo $xPath->exportAsHtml();
+}
+
+?>
\ No newline at end of file
diff --git a/www/include/options/sysInfos/images/includes/class.Template.inc.php b/www/include/options/sysInfos/images/includes/class.Template.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..9c3457ce9b2e3cd8f2a5668a971675e469425269
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/class.Template.inc.php
@@ -0,0 +1,449 @@
+<?php
+  /**************************************************************************\
+  * eGroupWare API - Template class                                          *
+  * (C) Copyright 1999-2000 NetUSE GmbH Kristian Koehntopp                   *
+  * ------------------------------------------------------------------------ *
+  * http://www.egroupware.org/                                               *  
+  * ------------------------------------------------------------------------ *
+  * This program is free software; you can redistribute it and/or modify it  *
+  * under the terms of the GNU Lesser General Public License as published    *
+  * by the Free Software Foundation; either version 2.1 of the License, or   *
+  * any later version.                                                       *
+  \**************************************************************************/
+
+  /* $Id: class.Template.inc.php,v 1.5 2005/11/26 13:01:24 bigmichi1 Exp $ */
+
+	class Template
+	{
+		var $classname = 'Template';
+
+		/* if set, echo assignments */
+		var $debug = False;
+
+		/* $file[handle] = 'filename'; */
+		var $file = array();
+
+		/* relative filenames are relative to this pathname */
+		var $root = '';
+
+		/* $varkeys[key] = 'key'; $varvals[key] = 'value'; */
+		var $varkeys = array();
+		var $varvals = array();
+
+		/* 'remove'  => remove undefined variables
+		 * 'comment' => replace undefined variables with comments
+		 * 'keep'    => keep undefined variables
+		 */
+		var $unknowns = 'remove';
+
+		/* 'yes' => halt, 'report' => report error, continue, 'no' => ignore error quietly */
+		var $halt_on_error = 'yes';
+
+		/* last error message is retained here */
+		var $last_error = '';
+
+		/***************************************************************************/
+		/* public: Constructor.
+		 * root:     template directory.
+		 * unknowns: how to handle unknown variables.
+		 */
+		function Template($root = '.', $unknowns = 'remove')
+		{
+			$this->set_root($root);
+			$this->set_unknowns($unknowns);
+		}
+
+		/* public: setroot(pathname $root)
+		 * root:   new template directory.
+		 */
+		function set_root($root)
+		{
+			if (!is_dir($root))
+			{
+				$this->halt("set_root: $root is not a directory.");
+				return false;
+			}
+			$this->root = $root;
+			return true;
+		}
+
+		/* public: set_unknowns(enum $unknowns)
+		 * unknowns: 'remove', 'comment', 'keep'
+		 *
+		 */
+		function set_unknowns($unknowns = 'keep')
+		{
+			$this->unknowns = $unknowns;
+		}
+
+		/* public: set_file(array $filelist)
+		 * filelist: array of handle, filename pairs.
+		 *
+		 * public: set_file(string $handle, string $filename)
+		 * handle: handle for a filename,
+		 * filename: name of template file
+		 */
+		function set_file($handle, $filename = '')
+		{
+			if (!is_array($handle))
+			{
+				if ($filename == '')
+				{
+					$this->halt("set_file: For handle $handle filename is empty.");
+					return false;
+				}
+				$this->file[$handle] = $this->filename($filename);
+			}
+			else
+			{
+				reset($handle);
+				while(list($h, $f) = each($handle))
+				{
+					$this->file[$h] = $this->filename($f);
+				}
+			}
+		}
+
+		/* public: set_block(string $parent, string $handle, string $name = '')
+		 * extract the template $handle from $parent, 
+		 * place variable {$name} instead.
+		 */
+		function set_block($parent, $handle, $name = '')
+		{
+			if (!$this->loadfile($parent))
+			{
+				$this->halt("subst: unable to load $parent.");
+				return false;
+			}
+			if ($name == '')
+			{
+				$name = $handle;
+			}
+			$str = $this->get_var($parent);
+			$reg = "/<!--\s+BEGIN $handle\s+-->(.*)\n\s*<!--\s+END $handle\s+-->/sm";
+			preg_match_all($reg, $str, $m);
+			$str = preg_replace($reg, '{' . "$name}", $str);
+			$this->set_var($handle, $m[1][0]);
+			$this->set_var($parent, $str);
+		}
+
+		/* public: set_var(array $values)
+		 * values: array of variable name, value pairs.
+		 *
+		 * public: set_var(string $varname, string $value)
+		 * varname: name of a variable that is to be defined
+		 * value:   value of that variable
+		 */
+		function set_var($varname, $value = '')
+		{
+			if (!is_array($varname))
+			{
+				if (!empty($varname))
+				{
+					if ($this->debug)
+					{
+						print "scalar: set *$varname* to *$value*<br>\n";
+					}
+					$this->varkeys[$varname] = $this->varname($varname);
+					$this->varvals[$varname] = str_replace('phpGroupWare','eGroupWare',$value);
+				}
+			}
+			else
+			{
+				reset($varname);
+				while(list($k, $v) = each($varname))
+				{
+					if (!empty($k))
+					{
+						if ($this->debug)
+						{
+							print "array: set *$k* to *$v*<br>\n";
+						}
+						$this->varkeys[$k] = $this->varname($k);
+						$this->varvals[$k] = str_replace('phpGroupWare','eGroupWare',$v);
+					}
+				}
+			}
+		}
+
+		/* public: subst(string $handle)
+		 * handle: handle of template where variables are to be substituted.
+		 */
+		function subst($handle)
+		{
+			if (!$this->loadfile($handle))
+			{
+				$this->halt("subst: unable to load $handle.");
+				return false;
+			}
+
+			$str = $this->get_var($handle);
+			reset($this->varkeys);
+			while (list($k, $v) = each($this->varkeys))
+			{
+				$str = str_replace($v, $this->varvals[$k], $str);
+			}
+			return $str;
+		}
+
+		/* public: psubst(string $handle)
+		 * handle: handle of template where variables are to be substituted.
+		 */
+		function psubst($handle)
+		{
+			print $this->subst($handle);
+			return false;
+		}
+
+		/* public: parse(string $target, string $handle, boolean append)
+		 * public: parse(string $target, array  $handle, boolean append)
+		 * target: handle of variable to generate
+		 * handle: handle of template to substitute
+		 * append: append to target handle
+		 */
+		function parse($target, $handle, $append = false)
+		{
+			if (!is_array($handle))
+			{
+				$str = $this->subst($handle);
+				if ($append)
+				{
+					$this->set_var($target, $this->get_var($target) . $str);
+				}
+				else
+				{
+					$this->set_var($target, $str);
+				}
+			}
+			else
+			{
+				reset($handle);
+				while(list($i, $h) = each($handle))
+				{
+					$str = $this->subst($h);
+					$this->set_var($target, $str);
+				}
+			}
+			return $str;
+		}
+
+		function pparse($target, $handle, $append = false)
+		{
+			print $this->parse($target, $handle, $append);
+			return false;
+		}
+
+		/* This is short for finish parse */
+		function fp($target, $handle, $append = False)
+		{
+			return $this->finish($this->parse($target, $handle, $append));
+		}
+
+		/* This is a short cut for print finish parse */
+		function pfp($target, $handle, $append = False)
+		{
+			echo $this->finish($this->parse($target, $handle, $append));
+		}
+
+		/* public: get_vars()
+		 */
+		function get_vars()
+		{
+			reset($this->varkeys);
+			while(list($k, $v) = each($this->varkeys))
+			{
+				$result[$k] = $this->varvals[$k];
+			}
+			return $result;
+		}
+
+		/* public: get_var(string varname)
+		 * varname: name of variable.
+		 *
+		 * public: get_var(array varname)
+		 * varname: array of variable names
+		 */
+		function get_var($varname)
+		{
+			if (!is_array($varname))
+			{
+				return $this->varvals[$varname];
+			}
+			else
+			{
+				reset($varname);
+				while(list($k, $v) = each($varname))
+				{
+					$result[$k] = $this->varvals[$k];
+				}
+				return $result;
+			}
+		}
+
+		/* public: get_undefined($handle)
+		 * handle: handle of a template.
+		 */
+		function get_undefined($handle)
+		{
+			if (!$this->loadfile($handle))
+			{
+				$this->halt("get_undefined: unable to load $handle.");
+				return false;
+			}
+
+			preg_match_all("/\{([^}]+)\}/", $this->get_var($handle), $m);
+			$m = $m[1];
+			if (!is_array($m))
+			{
+				return false;
+			}
+			reset($m);
+			while(list($k, $v) = each($m))
+			{
+				if (!isset($this->varkeys[$v]))
+				{
+					$result[$v] = $v;
+				}
+			}
+
+			if (count($result))
+			{
+				return $result;
+			}
+			else
+			{
+				return false;
+			}
+		}
+
+		/* public: finish(string $str)
+		 * str: string to finish.
+		 */
+		function finish($str)
+		{
+			switch ($this->unknowns)
+			{
+				case 'keep':
+					break;
+				case 'remove':
+					$str = preg_replace('/{[^ \t\r\n}]+}/', '', $str);
+					break;
+				case 'comment':
+					$str = preg_replace('/{([^ \t\r\n}]+)}/', "<!-- Template $handle: Variable \\1 undefined -->", $str);
+					break;
+			}
+
+			return $str;
+		}
+
+		/* public: p(string $varname)
+		 * varname: name of variable to print.
+		 */
+		function p($varname)
+		{
+			print $this->finish($this->get_var($varname));
+		}
+
+		function get($varname)
+		{
+			return $this->finish($this->get_var($varname));
+		}
+
+		/***************************************************************************/
+		/* private: filename($filename)
+		 * filename: name to be completed.
+		 */
+		function filename($filename,$root='',$time=1)
+		{
+			if($root=='')
+			{
+				$root=$this->root;
+			}
+			if (substr($filename, 0, 1) != '/')
+			{
+				$new_filename = $root.'/'.$filename;
+			}
+			else
+			{
+				$new_filename = $filename;
+			}
+
+			if (!file_exists($new_filename))
+			{
+				if($time==2)
+				{
+					$this->halt("filename: file $new_filename does not exist.");
+				}
+				else
+				{
+					$new_root = str_replace($GLOBALS['egw_info']['server']['template_set'],'default',$root);
+					$new_filename = $this->filename(str_replace($root.'/','',$new_filename),$new_root,2);
+				}
+			}
+			return $new_filename;
+		}
+
+		/* private: varname($varname)
+		 * varname: name of a replacement variable to be protected.
+		 */
+		function varname($varname)
+		{
+			return '{'.$varname.'}';
+		}
+
+		/* private: loadfile(string $handle)
+		 * handle:  load file defined by handle, if it is not loaded yet.
+		 */
+		function loadfile($handle)
+		{
+			if (isset($this->varkeys[$handle]) and !empty($this->varvals[$handle]))
+			{
+				return true;
+			}
+			if (!isset($this->file[$handle]))
+			{
+				$this->halt("loadfile: $handle is not a valid handle.");
+				return false;
+			}
+			$filename = $this->file[$handle];
+
+			$str = implode('', @file($filename));
+			if (empty($str))
+			{
+				$this->halt("loadfile: While loading $handle, $filename does not exist or is empty.");
+				return false;
+			}
+
+			$this->set_var($handle, $str);
+			return true;
+		}
+
+		/***************************************************************************/
+		/* public: halt(string $msg)
+		 * msg:    error message to show.
+		 */
+		function halt($msg)
+		{
+			$this->last_error = $msg;
+
+			if ($this->halt_on_error != 'no')
+			{
+				$this->haltmsg($msg);
+			}
+
+			if ($this->halt_on_error == 'yes')
+			{
+				echo('<b>Halted.</b>');
+			}
+
+			exit;
+		}
+
+		/* public, override: haltmsg($msg)
+		 * msg: error message to show.
+		 */
+		function haltmsg($msg)
+		{
+			printf("<b>Template Error:</b> %s<br>\n", $msg);
+		}
+	}
diff --git a/www/include/options/sysInfos/images/includes/common_functions.php b/www/include/options/sysInfos/images/includes/common_functions.php
new file mode 100644
index 0000000000000000000000000000000000000000..3d6badaa690e46ec4ff3c00a71bbcd0a3b45dd70
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/common_functions.php
@@ -0,0 +1,208 @@
+<?php 
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+// $Id: common_functions.php,v 1.28 2005/12/10 15:54:41 bigmichi1 Exp $
+// HTML/XML Comment
+function created_by ()
+{
+  global $VERSION;
+  return "<!--\n\tCreated By: phpSysInfo - $VERSION\n\thttp://phpsysinfo.sourceforge.net/\n-->\n\n";
+} 
+// So that stupid warnings do not appear when we stats files that do not exist.
+error_reporting(5);
+// print out the bar graph
+
+// $value as full percentages
+// $maximim as current maximum 
+// $b as scale factor
+// $type as filesystem type
+function create_bargraph ($value, $maximum, $b, $type = "")
+{
+  global $webpath;
+  
+  $textdir = direction();
+
+  $imgpath = $webpath . 'templates/' . TEMPLATE_SET . '/images/';
+  $maximum == 0 ? $barwidth = 0 : $barwidth = round((100  / $maximum) * $value) * $b;
+  $red = 90 * $b;
+  $yellow = 75 * $b;
+
+  if (!file_exists(APP_ROOT . "/templates/" . TEMPLATE_SET . "/images/nobar_left.gif")) {
+    if ($barwidth == 0) {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_middle.gif" width="1" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_' . $textdir['right'] . '.gif" alt="">';
+    } elseif (file_exists(APP_ROOT . "/templates/" . TEMPLATE_SET . "/images/yellowbar_left.gif") && $barwidth > $yellow && $barwidth < $red) {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'yellowbar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'yellowbar_middle.gif" width="' . $barwidth . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'yellowbar_' . $textdir['right'] . '.gif" alt="">';
+    } elseif (($barwidth < $red) || ($type == "iso9660") || ($type == "CDFS")) {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_middle.gif" width="' . $barwidth . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_' . $textdir['right'] . '.gif" alt="">';
+    } else {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_middle.gif" width="' . $barwidth . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_' . $textdir['right'] . '.gif" alt="">';
+    }
+  } else {
+    if ($barwidth == 0) {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_middle.gif" width="' . (100 * $b) . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_' . $textdir['right'] . '.gif" alt="">';
+    } elseif (file_exists(APP_ROOT . "/templates/" . TEMPLATE_SET . "/images/yellowbar_left.gif") && $barwidth > $yellow && $barwidth < $red) {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'yellowbar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'yellowbar_middle.gif" width="' . $barwidth . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_middle.gif" width="' . ((100 * $b) - $barwidth) . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_' . $textdir['right'] . '.gif" alt="">';
+    } elseif (($barwidth < $red) || $type == "iso9660" || ($type == "CDFS")) {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_middle.gif" width="' . $barwidth . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_middle.gif" width="' . ((100 * $b) - $barwidth) . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_' . $textdir['right'] . '.gif" alt="">';
+    } elseif ($barwidth == (100 * $b)) {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_middle.gif" width="' . (100 * $b) . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_' . $textdir['right'] . '.gif" alt="">';
+    } else {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_middle.gif" width="' . $barwidth . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_middle.gif" width="' . ((100 * $b) - $barwidth) . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_' . $textdir['right'] . '.gif" alt="">';
+    }
+  }
+} 
+
+function direction() {
+  global $text_dir;
+
+  if(!isset($text_dir) || $text_dir == "ltr") {
+    $result['direction'] = "ltr";
+    $result['left'] = "left";
+    $result['right'] = "right";
+  } else {
+    $result['direction'] = "rtl";
+    $result['left'] = "right";
+    $result['right'] = "left";
+  }
+  
+  return $result;
+}
+
+// Find a system program.  Do path checking
+function find_program ($program)
+{
+  $path = array('/bin', '/sbin', '/usr/bin', '/usr/sbin', '/usr/local/bin', '/usr/local/sbin');
+
+  if (function_exists("is_executable")) {
+    while ($this_path = current($path)) {
+      if (is_executable("$this_path/$program")) {
+        return "$this_path/$program";
+      } 
+      next($path);
+    } 
+  } else {
+    return strpos($program, '.exe');
+  } ;
+
+  return;
+} 
+// Execute a system program. return a trim()'d result.
+// does very crude pipe checking.  you need ' | ' for it to work
+// ie $program = execute_program('netstat', '-anp | grep LIST');
+// NOT $program = execute_program('netstat', '-anp|grep LIST');
+function execute_program ($program, $args = '')
+{
+  $buffer = '';
+  $program = find_program($program);
+
+  if (!$program) {
+    return;
+  } 
+  // see if we've gotten a |, if we have we need to do patch checking on the cmd
+  if ($args) {
+    $args_list = split(' ', $args);
+    for ($i = 0; $i < count($args_list); $i++) {
+      if ($args_list[$i] == '|') {
+        $cmd = $args_list[$i + 1];
+        $new_cmd = find_program($cmd);
+        $args = ereg_replace("\| $cmd", "| $new_cmd", $args);
+      } 
+    } 
+  } 
+  // we've finally got a good cmd line.. execute it
+  if ($fp = popen("$program $args", 'r')) {
+    while (!feof($fp)) {
+      $buffer .= fgets($fp, 4096);
+    } 
+    return trim($buffer);
+  } 
+} 
+// A helper function, when passed a number representing KB,
+// and optionally the number of decimal places required,
+// it returns a formated number string, with unit identifier.
+function format_bytesize ($kbytes, $dec_places = 2)
+{
+  global $text;
+  $spacer = '&nbsp;';
+  if ($kbytes > 1048576) {
+    $result = sprintf('%.' . $dec_places . 'f', $kbytes / 1048576);
+    $result .= $spacer . $text['gb'];
+  } elseif ($kbytes > 1024) {
+    $result = sprintf('%.' . $dec_places . 'f', $kbytes / 1024);
+    $result .= $spacer . $text['mb'];
+  } else {
+    $result = sprintf('%.' . $dec_places . 'f', $kbytes);
+    $result .= $spacer . $text['kb'];
+  } 
+  return $result;
+} 
+
+function get_gif_image_height($image)
+{ 
+  // gives the height of the given GIF image, by reading it's LSD (Logical Screen Discriptor)
+  // by Edwin Meester aka MillenniumV3
+  // Header: 3bytes 	Discription
+  // 3bytes 	Version
+  // LSD:		2bytes 	Logical Screen Width
+  // 2bytes 	Logical Screen Height
+  // 1bit 		Global Color Table Flag
+  // 3bits   Color Resolution
+  // 1bit		Sort Flag
+  // 3bits		Size of Global Color Table
+  // 1byte		Background Color Index
+  // 1byte		Pixel Aspect Ratio
+  // Open Image
+  $fp = fopen($image, 'rb'); 
+  // read Header + LSD
+  $header_and_lsd = fread($fp, 13);
+  fclose($fp); 
+  // calc Height from Logical Screen Height bytes
+  $result = ord($header_and_lsd{8}) + ord($header_and_lsd{9}) * 255;
+  return $result;
+} 
+
+// Check if a string exist in the global $hide_mounts.
+// Return true if this is the case.
+function hide_mount($mount) {
+	global $hide_mounts;
+	if (isset($hide_mounts) && is_array($hide_mounts) && in_array($mount, $hide_mounts)) {
+		return true;
+	}
+	else {
+		return false;
+	}
+}
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/index.html b/www/include/options/sysInfos/images/includes/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/includes/lang/ar_utf8.php b/www/include/options/sysInfos/images/includes/lang/ar_utf8.php
new file mode 100644
index 0000000000000000000000000000000000000000..e554937e3699839e208fad08ee98a46d719fab3e
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/ar_utf8.php
@@ -0,0 +1,110 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: ar_utf8.php,v 1.11 2005/12/07 15:02:08 bigmichi1 Exp $
+//
+//Translated to arabic by: Nizar Abed  - nizar@srcget.com - Adios
+
+$charset                = 'utf-8';
+
+$text['title']          = 'معلومات عن ألنظام';
+
+$text['vitals']         = 'حيويه';
+$text['hostname']       = ' ألمحطه';
+$text['ip']             = 'IP عنوان أل';
+$text['kversion']       = 'إصدار رقم';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'مدة ألتشغيل';
+$text['users']          = 'مستخدمون';
+$text['loadavg']        = 'معدل ألتشغيل';
+
+$text['hardware']       = 'معلومات ألمعدات';
+$text['numcpu']         = 'وحدات ألمعالجه';
+$text['cpumodel']       = 'نوع';
+$text['cpuspeed']       = 'سرعه في';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = ' cache سعة ذاكرة';
+$text['bogomips']       = 'Bogomips سرعه في';
+
+$text['pci']            = 'PCI معدات ';
+$text['ide']            = 'IDE معدات';
+$text['scsi']           = 'SCSI معدات';
+$text['usb']            = 'USB معدات';
+
+$text['netusage']       = 'إستعمال ألشبكه';
+$text['device']         = 'معدات';
+$text['received']       = 'إستقبل حتى ألآن';
+$text['sent']           = 'أرسل';
+$text['errors']         = 'أخطاء';
+
+$text['connections']    = 'إتصالات شبكه منفذه';
+
+$text['memusage']       = 'ذاكره مستعمله';
+$text['phymem']         = 'ذاكره جسديه';
+$text['swap']           = 'Swap ذاكرة';
+
+$text['fs']             = 'أنظمة ملفات مخططه';
+$text['mount']          = 'مخطط';
+$text['partition']      = 'تقطيع';
+
+$text['percent']        = 'سعه بألنسبه ألمؤيه';
+$text['type']           = 'نوع';
+$text['free']           = 'حر';
+$text['used']           = 'مستعمل';
+$text['size']           = 'حجم';
+$text['totals']         = 'مجموع';
+
+$text['kb']             = ' كيلو بايت KB';
+$text['mb']             = 'ميغا بايت MB';
+$text['gb']             = 'جيغا بايت GB';
+
+$text['none']           = 'بدون';
+
+$text['capacity']       = 'سعه'; 
+
+$text['template']       = 'بنيه';
+$text['language']       = 'لغه';
+$text['submit']         = 'أدخل';
+$text['created']        = 'إصدر بواسطة';
+
+$text['days']           = 'أيام';
+$text['hours']          = 'ساعات';
+$text['minutes']        = 'دفائق';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+$text['locale']		= 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/bg.php b/www/include/options/sysInfos/images/includes/lang/bg.php
new file mode 100644
index 0000000000000000000000000000000000000000..626c4ab9225aa8b25edb6a3a4289df6e91f5015f
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/bg.php
@@ -0,0 +1,108 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: bg.php,v 1.12 2005/12/07 15:02:10 bigmichi1 Exp $
+
+$charset                = 'cp-1251';
+
+$text['title']          = '�������� ����������';
+
+$text['vitals']         = '������� ����������';
+$text['hostname']       = '��� �� �����';
+$text['ip']             = 'IP �����';
+$text['kversion']       = '������ �� ������';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = '������ ��';
+$text['users']          = '�������� �����������';
+$text['loadavg']        = '������ �����������';
+
+$text['hardware']       = '���������� �� ��������';
+$text['numcpu']         = '���� ���������';
+$text['cpumodel']       = '����� �� ��������';
+$text['cpuspeed']       = '�������';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = '������ �� ���a ';
+$text['bogomips']       = 'Bogomips ������';
+
+$text['pci']            = 'PCI ����������';
+$text['ide']            = 'IDE ����������';
+$text['scsi']           = 'SCSI ����������';
+$text['usb']            = 'USB ����������';
+
+$text['netusage']       = '������� ����������';
+$text['device']         = '����������';
+$text['received']       = '��������';
+$text['sent']           = '���������';
+$text['errors']         = '������/���������';
+
+$text['connections']    = '����������� ������� ������';
+
+$text['memusage']       = '���������� �����';
+$text['phymem']         = '��������� �����';
+$text['swap']           = 'Swap �����';
+
+$text['fs']             = '������� �������';
+$text['mount']          = '�����';
+$text['partition']      = '���';
+
+$text['percent']        = '��������� ����������';
+$text['type']           = '���';
+$text['free']           = '��������';
+$text['used']           = '����������';
+$text['size']           = '��� ����';
+$text['totals']         = '������';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '����';
+
+$text['capacity']       = '���������';
+
+$text['template']       = '����';
+$text['language']       = '����';
+$text['submit']         = '�������';
+$text['created']        = '��������� �';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = '���';
+$text['hours']          = '����';
+$text['minutes']        = '������';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/big5.php b/www/include/options/sysInfos/images/includes/lang/big5.php
new file mode 100644
index 0000000000000000000000000000000000000000..822ec9274c19302b31c262949813c7e9b9e82108
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/big5.php
@@ -0,0 +1,107 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: big5.php,v 1.15 2005/12/07 15:02:11 bigmichi1 Exp $
+//
+$charset                = 'big5';
+$text['title']          = '�t�θ�T';
+
+$text['vitals']         = '�t�θ귽';
+$text['hostname']       = '�D���W��';
+$text['ip']             = '�D����~ IP';
+$text['kversion']       = '�֤ߪ���';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = '�w�}���ɶ�';
+$text['users']          = '�n�J�H��';
+$text['loadavg']        = '�t�έt��';
+
+$text['hardware']       = '�w��귽';
+$text['numcpu']         = '�B�⤸';
+$text['cpumodel']       = 'CPU����';
+$text['cpuspeed']       = '�u�@�W�v';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = '�֨��j�p';
+$text['bogomips']       = '�޿�B�⤸';
+
+$text['pci']            = 'PCI ����';
+$text['ide']            = 'IDE ����';
+$text['scsi']           = 'SCSI ����';
+$text['usb']            = 'USB ����';
+
+$text['netusage']       = '�����ʥ]';
+$text['device']         = '����';
+$text['received']       = '����';
+$text['sent']           = '�ǰe';
+$text['errors']         = '���~/��';
+
+$text['connections']    = 'Established Network Connections';
+
+$text['memusage']       = '�O����귽';
+$text['phymem']         = '����O����';
+$text['swap']           = '�����O����(�Ϻиm��)';
+
+$text['fs']             = '�w���J���ɮרt��';
+$text['mount']          = '���J';
+$text['partition']      = '�ϰ�';
+
+$text['percent']        = '�ϥΦʤ���';
+$text['type']           = '�榡';
+$text['free']           = '�žl';
+$text['used']           = '�w��';
+$text['size']           = '�j�p';
+$text['totals']         = '�X�p';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '�L';
+
+$text['capacity']       = '�e�q';
+
+$text['template']       = '�˦�';
+$text['language']       = '�y��';
+$text['submit']         = '�T�w';
+$text['created']        = '���ͥ�';
+$text['locale']         = 'zh_TW.Big5';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = '��';
+$text['hours']          = '�p��';
+$text['minutes']        = '����';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/br.php b/www/include/options/sysInfos/images/includes/lang/br.php
new file mode 100644
index 0000000000000000000000000000000000000000..442b6248981c9019be8c1de3b39c687f83a76393
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/br.php
@@ -0,0 +1,105 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: br.php,v 1.14 2005/12/07 15:02:11 bigmichi1 Exp $
+// Translated by �lvaro Reguly - alvaro at reguly dot net
+//
+$text['title']          = 'Informa��es do Sistema';
+
+$text['vitals']         = 'Sistema';
+$text['hostname']       = 'Nome Can�nico';
+$text['ip']             = 'N�meros IP';
+$text['kversion']       = 'Vers�o do Kernel';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Usu�rios Conectados';
+$text['loadavg']        = 'Carga do Sistema';
+
+$text['hardware']       = 'Informa��es do Hardware';
+$text['numcpu']         = 'Processadores';
+$text['cpumodel']       = 'Modelo';
+$text['cpuspeed']       = 'CPU Speed';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Tamanho Cache';
+$text['bogomips']       = 'Bogomips';
+
+$text['pci']            = 'Dispositivos PCI';
+$text['ide']            = 'Dispositivos IDE';
+$text['scsi']           = 'Dispositivos SCSI';
+$text['usb']            = 'Dispositivos USB';
+
+$text['netusage']       = 'Utiliza��o da Rede';
+$text['device']         = 'Dispositivo';
+$text['received']       = 'Recebidos';
+$text['sent']           = 'Enviados';
+$text['errors']         = 'Erros/Drop';
+
+$text['memusage']       = 'Utiliza��o da Mem�ria';
+$text['phymem']         = 'Mem�ria F�sica';
+$text['swap']           = 'Swap';
+
+$text['fs']             = 'Sistemas de Arquivo Montados';
+$text['mount']          = 'Mount';
+$text['partition']      = 'Parti��o';
+
+$text['percent']        = 'Porcentual da Capacidade';
+$text['type']           = 'Tipo';
+$text['free']           = 'Livres';
+$text['used']           = 'Utilizados';
+$text['size']           = 'Tamanho';
+$text['totals']         = 'Totais';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'nenhum';
+
+$text['capacity']       = 'Capacidade';
+
+$text['template']       = 'Molde';
+$text['language']       = 'L�ngua';
+$text['submit']         = 'Enviar';
+$text['created']        = 'Criado por';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dias';
+$text['hours']          = 'horas';
+$text['minutes']        = 'minutos';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/ca.php b/www/include/options/sysInfos/images/includes/lang/ca.php
new file mode 100644
index 0000000000000000000000000000000000000000..91cc92eb01152c503e8e925225a57d76c2068c45
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/ca.php
@@ -0,0 +1,107 @@
+<?php
+//
+// phpSysInfo -A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// $Id: ca.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+//
+// Traductor: Miquel Guillamet Montalat
+// E-mail: mikelet15@netscape.com Web: http://gitx.dhs.org
+//
+$text['title']       = 'Informaci� del Sistema';
+
+$text['vitals']      = 'Vital';
+$text['hostname']    = 'Nom del Sistema';
+$text['ip']          = 'Direcci� IP';
+$text['kversion']    = 'Versi� del Kernel';
+$text['dversion']       = 'Distro Name';
+$text['uptime']      = 'Uptime';
+$text['users']       = 'Usuaris actuals';
+$text['loadavg']     = 'Carrega del Servidor';
+
+$text['hardware']    = 'Informaci� del Hardware';
+$text['numcpu']      = 'Processadors';
+$text['cpumodel']    = 'Model';
+$text['cpuspeed']    = 'Frequ�ncia en MHz';
+$text['busspeed']    = 'BUS Speed';
+$text['cache']       = 'RAM';
+$text['bogomips']    = 'Bogomips';
+
+$text['pci']         = 'Dispositius PCI';
+$text['ide']         = 'Dispositius IDE';
+$text['scsi']        = 'Dispositius SCSI';
+$text['usb']         = 'Dispisitius USB';
+
+$text['netusage']    = 'Utilitzaci� de la XARXA';
+$text['device']      = 'Dispositiu';
+$text['received']    = 'Rebut';
+$text['sent']        = 'Enviat';
+$text['errors']      = 'Errors/Perduts';
+
+$text['memusage']    = 'Utilitzaci� de la RAM';
+$text['phymem']      = 'Memoria Fisica';
+$text['swap']        = 'Swap';
+
+$text['fs']          = 'Particions Montades';
+$text['mount']       = 'Montat a';
+$text['partition']   = 'Partici�';
+
+$text['percent']     = 'Capacitat';
+$text['type']        = 'Tipus';
+$text['free']        = 'Lliure';
+$text['used']        = 'Usat';
+$text['size']        = 'Tamany';
+$text['totals']      = 'Totals';
+
+$text['kb']          = 'KB';
+$text['mg']          = 'MB';
+$text['gb']          = 'GB';
+
+$text['none']        = 'ningun';
+
+$text['capacity']    = 'Capacitat';
+
+$text['template']    = 'Themes';
+$text['language']    = 'Llenguatge';
+$text['submit']      = 'Enviar';
+$text['created']     = 'Creat per';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']        = 'dies';
+$text['hours']       = 'hores';
+$text['minutes']     = 'minuts';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/cn.php b/www/include/options/sysInfos/images/includes/lang/cn.php
new file mode 100644
index 0000000000000000000000000000000000000000..3cb58d94d7ac77be1b1733fd554e60346e8bf6f9
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/cn.php
@@ -0,0 +1,105 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: cn.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$charset                = 'gb2312';
+
+$text['title']          = 'ϵͳ��Ϣ';
+$text['vitals']         = 'ϵͳ��Ҫ��Ϣ';
+$text['hostname']       = '��������';
+$text['ip']             = '��������IP';
+$text['kversion']       = '�ں˰汾';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = '����ʱ��';
+$text['users']          = '����ʹ����';
+$text['loadavg']        = 'ƽ������';
+
+$text['hardware']       = 'Ӳ����Ϣ';
+$text['numcpu']         = '����������';
+$text['cpumodel']       = 'CPU�ͺ�';
+$text['cpuspeed']       = 'оƬ�ٶ�';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cache��С';
+$text['bogomips']       = 'ϵͳBogomips';
+
+$text['pci']            = 'PCI�豸';
+$text['ide']            = 'IDE�豸';
+$text['scsi']           = 'SCSI�豸';
+$text['usb']            = 'USB�豸';
+
+$text['netusage']       = '���縺��';
+$text['device']         = '�����豸';
+$text['received']       = '����';
+$text['sent']           = '�ͳ�';
+$text['errors']         = '����/�ж�';
+
+$text['memusage']       = '�ڴ�ʹ����';
+$text['phymem']         = '�����ڴ�';
+$text['swap']           = '�����ڴ�(��������)';
+
+$text['fs']             = '�ѹ��ط���';
+$text['mount']          = '����·��';
+$text['partition']      = '��������';
+
+$text['percent']        = 'ʹ�����ٷֱ�';
+$text['type']           = '�ļ�ϵͳ����';
+$text['free']           = 'ʣ��ռ�';
+$text['used']           = '���ÿռ�';
+$text['size']           = '������';
+$text['totals']         = '��ʹ����';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '��';
+
+$text['capacity']       = '����';
+
+$text['template']       = '����';
+$text['language']       = '����';
+$text['submit']         = 'ȷ��';
+$text['created']        = '���� By';
+$text['locale']         = 'zh_CN.eucCN';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = '��';
+$text['hours']          = 'Сʱ';
+$text['minutes']        = '����';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/cs.php b/www/include/options/sysInfos/images/includes/lang/cs.php
new file mode 100644
index 0000000000000000000000000000000000000000..aff560bf8e2ed9af127b1b1d31dcf743d331f7ef
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/cs.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: cs.php,v 1.13 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$charset                = 'iso-8859-2';
+
+$text['title']          = 'Informace o syst�mu';
+
+$text['vitals']         = 'Z�kladn� informace';
+$text['hostname']       = 'Jm�no po��ta�e';
+$text['ip']             = 'IP adresa';
+$text['kversion']       = 'Verze j�dra';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'P�ihl�en�ch u�ivatel�';
+$text['loadavg']        = 'Pr�m�rn� z�t�';
+
+$text['hardware']       = 'Hardwarov� informace';
+$text['numcpu']         = 'Procesory';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'Frekvence';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Velikost cache';
+$text['bogomips']       = 'Bogomipsy';
+
+$text['pci']            = 'PCI za��zen�';
+$text['ide']            = 'IDE za��zen�';
+$text['scsi']           = 'SCSI za��zen�';
+$text['usb']            = 'USB za��zen�';
+
+$text['netusage']       = 'Pou��v�n� s�t�';
+$text['device']         = 'Za��zen�';
+$text['received']       = 'P�ijato';
+$text['sent']           = 'Odesl�no';
+$text['errors']         = 'Chyby/Vypu�t�no';
+
+$text['memusage']       = 'Obsazen� pam�ti';
+$text['phymem']         = 'Fyzick� pam�';
+$text['swap']           = 'Swap';
+
+$text['fs']             = 'P�ipojen� souborov� syst�my';
+$text['mount']          = 'Adres��';
+$text['partition']      = 'Odd�l';
+
+$text['percent']        = 'Obsazeno';
+$text['type']           = 'Typ';
+$text['free']           = 'Volno';
+$text['used']           = 'Pou�ito';
+$text['size']           = 'Velikost';
+$text['totals']         = 'Celkem';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '��dn�';
+
+$text['capacity']       = 'Kapacita';
+
+$text['template']       = '�ablona';
+$text['language']       = 'Jazyk';
+$text['submit']         = 'Odeslat';
+$text['created']        = 'Vytvo�eno pomoc�';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dn�';
+$text['hours']          = 'hodin';
+$text['minutes']        = 'minut';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/ct.php b/www/include/options/sysInfos/images/includes/lang/ct.php
new file mode 100644
index 0000000000000000000000000000000000000000..0ed2f791c3ec0b76501b84e1d9d7b19bc979674d
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/ct.php
@@ -0,0 +1,103 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: ct.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Informaci&oacute; del Sistema';
+
+$text['vitals']         = 'Vitals del Sistema';
+$text['hostname']       = 'Nom Can�nic';
+$text['ip']             = 'Adre�a IP';
+$text['kversion']       = 'Versi&oacute; del Kernel';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Temps Aixecat';
+$text['users']          = 'Usuaris Actuals';
+$text['loadavg']        = 'C�rrega Promitg';
+
+$text['hardware']       = 'Informaci&oacute; del Maquinari';
+$text['numcpu']         = 'Processadors';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'Xip MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Tamany Mem�ria Cau';
+$text['bogomips']       = 'Bogomips';
+
+$text['pci']            = 'Dispositius PCI';
+$text['ide']            = 'Dispositius IDE';
+$text['scsi']           = 'Dispositius SCSI';
+$text['usb']            = 'Dispositius USB';
+
+$text['netusage']       = '�s de la Xarxa';
+$text['device']         = 'Dispositiu';
+$text['received']       = 'Rebuts';
+$text['sent']           = 'Enviats';
+$text['errors']         = 'Errors/Perduts';
+
+$text['memusage']       = '�s de la Mem�ria';
+$text['phymem']         = 'Mem�ria F&iacute;sica';
+$text['swap']           = 'Disc d\'Swap';
+
+$text['fs']             = 'Sistemes d\'Arxius Muntats';
+$text['mount']          = 'Muntat';
+$text['partition']      = 'Partici�';
+$text['percent']        = 'Percentatge de Capacitat';
+$text['type']           = 'Tipus';
+$text['free']           = 'Lliure';
+$text['used']           = 'Emprat';
+$text['size']           = 'Tamany';
+$text['totals']         = 'Totals';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'cap';
+
+$text['capacity']       = 'Capacitat';
+  
+$text['template']       = 'Plantilla';
+$text['language']       = 'Lleng�a';
+$text['submit']         = 'Enviar';
+$text['created']        = 'Creat per';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dies';
+$text['hours']          = 'hores';
+$text['minutes']        = 'minuts';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/da.php b/www/include/options/sysInfos/images/includes/lang/da.php
new file mode 100644
index 0000000000000000000000000000000000000000..01fc43aaa5eaed21eb047c2e644382daeab95be4
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/da.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: da.php,v 1.16 2005/12/07 15:02:11 bigmichi1 Exp $
+
+# Translated by Jonas Koch Bentzen (understroem.dk).
+
+$text['title']          = 'Systeminformation';
+
+$text['vitals']         = 'Systemenheder';
+$text['hostname']       = 'Konisk v�rtsnavn';
+$text['ip']             = 'IP-adresse, der lyttes p�';
+$text['kversion']       = 'Kerne-version';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Oppetid';
+$text['users']          = 'Antal brugere logget ind lige nu';
+$text['loadavg']        = 'Ressourceforbrug - gennemsnit';
+
+$text['hardware']       = 'Hardwareinformation';
+$text['numcpu']         = 'Processorer';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'CPU Speed';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cachest�rrelse';
+$text['bogomips']       = 'Bogomips';
+
+$text['pci']            = 'PCI-enheder';
+$text['ide']            = 'IDE-enheder';
+$text['scsi']           = 'SCSI-enheder';
+$text['usb']            = 'USB-enheder';
+
+$text['netusage']       = 'Netv�rkstrafik';
+$text['device']         = 'Enhed';
+$text['received']       = 'Modtaget';
+$text['sent']           = 'Afsendt';
+$text['errors']         = 'Mislykket/tabt';
+
+$text['memusage']       = 'Hukommelsesforbrug';
+$text['phymem']         = 'Fysisk hukommelse';
+$text['swap']           = 'Swap';
+
+$text['fs']             = 'Monterede filsystemer';
+$text['mount']          = 'Monteret p�';
+$text['partition']      = 'Partition';
+
+$text['percent']        = 'Procent af kapaciteten';
+$text['type']           = 'Type';
+$text['free']           = 'Ledig';
+$text['used']           = 'Brugt';
+$text['size']           = 'St�rrelse';
+$text['totals']         = 'I alt';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'ingen';
+
+$text['capacity']       = 'Kapacitet';
+  
+$text['template']       = 'Skabelon';
+$text['language']       = 'Sprog';
+$text['submit']         = 'Okay';
+$text['created']        = 'Lavet af';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dage';
+$text['hours']          = 'timer';
+$text['minutes']        = 'minutter';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/de.php b/www/include/options/sysInfos/images/includes/lang/de.php
new file mode 100644
index 0000000000000000000000000000000000000000..0e17fcab36648f5d930e287609c1256b5c869253
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/de.php
@@ -0,0 +1,104 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: de.php,v 1.15 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'System Information';
+
+$text['vitals']         = 'System &Uuml;bersicht';
+$text['hostname']       = 'Zugewiesener Hostname';
+$text['ip']             = '&Uuml;berwachte IP';
+$text['kversion']       = 'Kernel Version';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Betriebszeit';
+$text['users']          = 'Eingeloggte Benutzer';
+$text['loadavg']        = 'Auslastung';
+
+$text['hardware']       = 'Hardware &Uuml;bersicht';
+$text['numcpu']         = 'Prozessoren';
+$text['cpumodel']       = 'Modell';
+$text['cpuspeed']       = 'Taktfrequenz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cachegr&ouml;&szlig;e';
+$text['bogomips']       = 'System Bogomips';
+
+$text['pci']            = 'PCI Ger&auml;te';
+$text['ide']            = 'IDE Ger&auml;te';
+$text['scsi']           = 'SCSI Ger&auml;te';
+$text['usb']            = 'USB Ger&auml;te';
+
+$text['netusage']       = 'Netzwerk-Auslastung';
+$text['device']         = 'Schnittstelle';
+$text['received']       = 'Empfangen';
+$text['sent']           = 'Gesendet';
+$text['errors']         = 'Fehler/Verworfen';
+
+$text['memusage']       = 'Speicher-Auslastung';
+$text['phymem']         = 'Physikalischer Speicher';
+$text['swap']           = 'Auslagerungsdatei';
+
+$text['fs']             = 'Angemeldete Filesysteme';
+$text['mount']          = 'Mount';
+$text['partition']      = 'Partition';
+
+$text['percent']        = 'Prozentuale Auslastung';
+$text['type']           = 'Typ';
+$text['free']           = 'Frei';
+$text['used']           = 'Benutzt';
+$text['size']           = 'Gr&ouml;&szlig;e';
+$text['totals']         = 'Insgesamt';
+
+$text['kb']             = 'KiB';
+$text['mb']             = 'MiB';
+$text['gb']             = 'GiB';
+
+$text['none']           = 'keine';
+
+$text['capacity']       = 'Kapazit�t';
+  
+$text['template']       = 'Vorlage';
+$text['language']       = 'Sprache';
+$text['submit']         = '�ndern';
+$text['created']        = 'Erstellt von';
+$text['locale']         = 'de_DE';
+$text['gen_time']       = 'am %d.%b %Y um %H:%M';
+
+$text['days']           = 'Tage';
+$text['hours']          = 'Stunden';
+$text['minutes']        = 'Minuten';
+  
+$text['temperature']    = 'Temperatur';
+$text['voltage']        = 'Spannungen';
+$text['fans']           = 'L&uuml;fter';
+$text['s_value']        = 'Wert';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Grenzwert';
+$text['s_label']        = 'Bezeichnung';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/en.php b/www/include/options/sysInfos/images/includes/lang/en.php
new file mode 100644
index 0000000000000000000000000000000000000000..369a2399e25f5c8746e804d91a4f4327d28e35e1
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/en.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: en.php,v 1.17 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'System Information';
+
+$text['vitals']         = 'System Vital';
+$text['hostname']       = 'Canonical Hostname';
+$text['ip']             = 'Listening IP';
+$text['kversion']       = 'Kernel Version';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Current Users';
+$text['loadavg']        = 'Load Averages';
+
+$text['hardware']       = 'Hardware Information';
+$text['numcpu']         = 'Processors';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'CPU Speed';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cache Size';
+$text['bogomips']       = 'System Bogomips';
+
+$text['pci']            = 'PCI Devices';
+$text['ide']            = 'IDE Devices';
+$text['scsi']           = 'SCSI Devices';
+$text['usb']            = 'USB Devices';
+
+$text['netusage']       = 'Network Usage';
+$text['device']         = 'Device';
+$text['received']       = 'Received';
+$text['sent']           = 'Sent';
+$text['errors']         = 'Err/Drop';
+
+$text['connections']    = 'Established Network Connections';
+
+$text['memusage']       = 'Memory Usage';
+$text['phymem']         = 'Physical Memory';
+$text['swap']           = 'Disk Swap';
+
+$text['fs']             = 'Mounted Filesystems';
+$text['mount']          = 'Mount';
+$text['partition']      = 'Partition';
+
+$text['percent']        = 'Percent Capacity';
+$text['type']           = 'Type';
+$text['free']           = 'Free';
+$text['used']           = 'Used';
+$text['size']           = 'Size';
+$text['totals']         = 'Totals';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'none';
+
+$text['capacity']       = 'Capacity'; 
+
+$text['template']       = 'Template';
+$text['language']       = 'Language';
+$text['submit']         = 'Submit';
+$text['created']        = 'Created by';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'days';
+$text['hours']          = 'hours';
+$text['minutes']        = 'minutes';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/es.php b/www/include/options/sysInfos/images/includes/lang/es.php
new file mode 100644
index 0000000000000000000000000000000000000000..d8a1ebaa24e4fa333a65b63f1b7f1b6b76c99937
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/es.php
@@ -0,0 +1,104 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: es.php,v 1.15 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Informaci&oacute;n Del Sistema';
+
+$text['vitals']         = 'Vitales';
+$text['hostname']       = 'Nombre Del Sistema';
+$text['ip']             = 'Direcci&oacute;n IP';
+$text['kversion']       = 'Versi&oacute;n Del N&uacute;cleo';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Usuarios Actuales';
+$text['loadavg']        = 'Promedio De Uso';
+
+$text['hardware']       = 'Informaci&oacute;n Del Hardware';
+$text['numcpu']         = 'Procesadores';
+$text['cpumodel']       = 'Modelo';
+$text['cpuspeed']       = 'Frecuencia';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Tama&ntilde;o Del Cach&eacute;';
+$text['bogomips']       = 'Bogomips';
+
+$text['pci']            = 'Dispositivos PCI';
+$text['ide']            = 'Dispositivos IDE';
+$text['scsi']           = 'Dispositivos SCSI';
+$text['usb']            = 'Dispositivos USB';
+
+$text['netusage']       = 'Utilizaci&oacute;n De La Red';
+$text['device']         = 'Dispositivo';
+$text['received']       = 'Recibidos';
+$text['sent']           = 'Enviados';
+$text['errors']         = 'Errores/Perdidos';
+
+$text['memusage']       = 'Utilizaci&oacute;n De La Memoria';
+$text['phymem']         = 'Memoria F&iacute;sica';
+$text['swap']           = 'Memoria De Intercambio';
+
+$text['fs']             = 'Sistemas De Archivos';
+$text['mount']          = 'Punto De Montaje';
+$text['partition']      = 'Partici&oacute;n';
+
+$text['percent']        = 'Porcentaje De Uso';
+$text['type']           = 'Tipo';
+$text['free']           = 'Libre';
+$text['used']           = 'Usado';
+$text['size']           = 'Tama&ntilde;o';
+$text['totals']         = 'Totales';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'Ninguno';
+
+$text['capacity']       = 'Capacidad';
+
+$text['template']       = 'Plantilla';
+$text['language']       = 'Idioma';
+$text['submit']         = 'Enviar';
+$text['created']        = 'Creado por';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'd&iacute;as';
+$text['hours']          = 'horas';
+$text['minutes']        = 'minutos';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/et.php b/www/include/options/sysInfos/images/includes/lang/et.php
new file mode 100644
index 0000000000000000000000000000000000000000..cfa141b2b0ee37d04aafecf730cb0c2e286025be
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/et.php
@@ -0,0 +1,104 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: et.php,v 1.15 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'S&uuml;steemi Informatsioon';
+
+$text['vitals']         = 'System Vital';
+$text['hostname']       = 'Kanooniline masinanimi';
+$text['ip']             = 'Vastav IP';
+$text['kversion']       = 'Kernel Versioon';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Masin elus juba';
+$text['users']          = 'Hetkel kasutajaid';
+$text['loadavg']        = 'Koormuse keskmised';
+
+$text['hardware']       = 'Riistvara Informatsioon';
+$text['numcpu']         = 'Protsessoreid';
+$text['cpumodel']       = 'Mudel';
+$text['cpuspeed']       = 'Taktsagedus MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Vahem&auml;lu suurus';
+$text['bogomips']       = 'S&uuml;steemi Bogomips';
+
+$text['pci']            = 'PCI Seadmed';
+$text['ide']            = 'IDE Seadmed';
+$text['scsi']           = 'SCSI Seadmed';
+$text['usb']            = 'USB Seadmed';
+
+$text['netusage']       = 'V&otilde;rguteenuse kasutamine';
+$text['device']         = 'Seade';
+$text['received']       = 'Saadud';
+$text['sent']           = 'Saadetud';
+$text['errors']         = 'Vigu/H&uuml;ljatud';
+
+$text['memusage']       = 'M&auml;lu kasutamine';
+$text['phymem']         = 'F&uuml;&uuml;siline m&auml;lu';
+$text['swap']           = 'Saalem&auml;lu kettal';
+
+$text['fs']             = '&Uuml;hendatud failis&uuml;steemid';
+$text['mount']          = '&Uuml;hendus';
+$text['partition']      = 'Partitsioon';
+
+$text['percent']        = 'Protsendiline h&otilde;ivatus';
+$text['type']           = 'T&uuml;&uuml;p';
+$text['free']           = 'Vaba';
+$text['used']           = 'Kasutusel';
+$text['size']           = 'Suurus';
+$text['totals']         = 'Kokku';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'puudub';
+
+$text['capacity']       = 'H&otilde;ivatus';
+  
+$text['template']       = 'Template';
+$text['language']       = 'Keel';
+$text['submit']         = 'Kehtesta';
+$text['created']        = 'Looja: ';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'p&auml;eva';
+$text['hours']          = 'tundi';
+$text['minutes']        = 'minutit';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/eu.php b/www/include/options/sysInfos/images/includes/lang/eu.php
new file mode 100644
index 0000000000000000000000000000000000000000..61215a30226591a45716dcced96688c958d741af
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/eu.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: eu.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Sistemaren Informazioa';
+
+$text['vitals']         = 'Sistema';
+$text['hostname']       = 'Zerbitzariaren izen Kanonikoa';
+$text['ip']             = 'Entzuten duen IP-a';
+$text['kversion']       = 'Kernel Bertsioa';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Piztutako denbora';
+$text['users']          = 'Uneko Erabiltzaileak';
+$text['loadavg']        = 'Karga ertainak';
+
+$text['hardware']       = 'Hardwarezko Informazioa';
+$text['numcpu']         = 'Prozasatzailea';
+$text['cpumodel']       = 'Modeloa';
+$text['cpuspeed']       = 'Txip MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cache tamaina';
+$text['bogomips']       = 'Sistemare Bogomips-ak';
+
+$text['pci']            = 'PCI Dispositiboak';
+$text['ide']            = 'IDE Dispositiboak';
+$text['scsi']           = 'SCSI Dispositiboak';
+$text['usb']            = 'USB Dispositiboak';
+
+$text['netusage']       = 'Sarearen Erabilera';
+$text['device']         = 'Dispositiboa';
+$text['received']       = 'Jasotakoa';
+$text['sent']           = 'Bidalitakoa';
+$text['errors']         = 'Err/Huts';
+
+$text['connections']    = 'Established Network Connections';
+
+$text['memusage']       = 'Memoriaren Erabilpena';
+$text['phymem']         = 'Memoria Fisikoa';
+$text['swap']           = 'Disko Memoria';
+
+$text['fs']             = 'Montatutako Fitxategi-sistemak';
+$text['mount']          = 'Non montatuta';
+$text['partition']      = 'Partizioa';
+
+$text['percent']        = 'Ehunekoa';
+$text['type']           = 'Mota';
+$text['free']           = 'Aske';
+$text['used']           = 'Erabilita';
+$text['size']           = 'Tamaina';
+$text['totals']         = 'Guztira';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'ezer ez';
+
+$text['capacity']       = 'Kapazitatea'; 
+
+$text['template']       = 'Txantiloia';
+$text['language']       = 'Langoaia';
+$text['submit']         = 'Bidali';
+$text['created']        = 'Sortzailea: ';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'egun';
+$text['hours']          = 'ordu';
+$text['minutes']        = 'minutu';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/fi.php b/www/include/options/sysInfos/images/includes/lang/fi.php
new file mode 100644
index 0000000000000000000000000000000000000000..01e009ec283619657883e7b213d72b03da4cd205
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/fi.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: fi.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+
+// Finnish language file by Jani 'Japala' Ponkko
+
+$text['title']          = 'Tietoa j&auml;rjestelm&auml;st&auml;';
+
+$text['vitals']         = 'Perustiedot';
+$text['hostname']       = 'Kanoninen nimi';
+$text['ip']             = 'K&auml;ytett&auml;v&auml; IP';
+$text['kversion']       = 'Kernelin versio';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Toiminta-aika';
+$text['users']          = 'K&auml;ytt&auml;ji&auml;';
+$text['loadavg']        = 'Keskikuormat';
+
+$text['hardware']       = 'Laitteisto';
+$text['numcpu']         = 'Prosessoreita';
+$text['cpumodel']       = 'Malli';
+$text['cpuspeed']       = 'Piirin MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'V&auml;limuistin koko';
+$text['bogomips']       = 'J&auml;rjestelm&auml;n Bogomipsit';
+
+$text['pci']            = 'PCI Laitteet';
+$text['ide']            = 'IDE Laitteet';
+$text['scsi']           = 'SCSI Laitteet';
+$text['usb']            = 'USB Laitteet';
+
+$text['netusage']       = 'Verkon k&auml;ytt&ouml;';
+$text['device']         = 'Laite';
+$text['received']       = 'Vastaanotettu';
+$text['sent']           = 'L&auml;hetetty';
+$text['errors']         = 'Virheet/Pudotetut';
+
+$text['memusage']       = 'Muistin kuormitus';
+$text['phymem']         = 'Fyysinen muisti';
+$text['swap']           = 'Virtuaalimuisti';
+
+$text['fs']             = 'Liitetyt tiedostoj&auml;rjestelm&auml;t';
+$text['mount']          = 'Liitoskohta';
+$text['partition']      = 'Osio';
+
+$text['percent']        = 'Prosenttia kapasiteetista';
+$text['type']           = 'Tyyppi';
+$text['free']           = 'Vapaana';
+$text['used']           = 'K&auml;yt&ouml;ss&auml;';
+$text['size']           = 'Koko';
+$text['totals']         = 'Yhteens&auml;';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'Ei yht&auml;&auml;n';
+
+$text['capacity']       = 'Kapasiteetti'; 
+
+$text['template']       = 'Malli';
+$text['language']       = 'Kieli';
+$text['submit']         = 'Valitse';
+$text['created']        = 'Luonut';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'p&auml;iv&auml;&auml;';
+$text['hours']          = 'tuntia';
+$text['minutes']        = 'minuuttia';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/fr.php b/www/include/options/sysInfos/images/includes/lang/fr.php
new file mode 100644
index 0000000000000000000000000000000000000000..4c331344fe38e56273a1bb5641d0160d9657adf1
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/fr.php
@@ -0,0 +1,102 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: fr.php,v 1.19 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Informations Syst�me ';
+
+$text['vitals']         = 'Syst�me';
+$text['hostname']       = 'Nom d\'h�te cannonique';
+$text['ip']             = 'IP';
+$text['kversion']       = 'Version du noyau';
+$text['dversion']       = 'Distribution';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Utilisateurs';
+$text['loadavg']        = 'Charge syst�me';
+
+$text['hardware']       = 'Informations Mat�riel';
+$text['numcpu']         = 'Processeurs';
+$text['cpumodel']       = 'Mod�le';
+$text['mhz']            = 'Fr�quence';
+$text['cache']          = 'Taille Cache';
+$text['bogomips']       = 'Bogomips';
+$text['usb']            = 'P�riph. USB';
+$text['pci']            = 'P�riph. PCI';
+$text['ide']            = 'P�riph. IDE';
+$text['scsi']           = 'P�riph. SCSI';
+
+$text['netusage']       = 'R�seau';
+$text['device']         = 'P�riph�rique';
+$text['received']       = 'R�ception';
+$text['sent']           = 'Envoi';
+$text['errors']         = 'Err/Drop';
+
+$text['memusage']       = 'Utilisation m�moire';
+$text['phymem']         = 'M�moire Physique';
+$text['swap']           = 'Swap disque';
+
+$text['fs']             = 'Syst�mes de fichiers mont�s';
+$text['mount']          = 'Point';
+$text['partition']      = 'Partition';
+
+$text['percent']        = 'Utilisation';
+$text['type']           = 'Type';
+$text['free']           = 'Libre';
+$text['used']           = 'Occup�';
+$text['size']           = 'Taille';
+$text['totals']         = 'Totaux';
+
+$text['kb']             = 'Ko';
+$text['mb']             = 'Mo';
+$text['gb']             = 'Go';
+
+$text['none']           = 'aucun';
+
+$text['capacity']       = 'Capacit�';
+  
+$text['template']       = 'Mod�le ';
+$text['language']       = 'Langue ';
+$text['submit']         = 'Valider';
+$text['created']        = 'Cr�� par';
+$text['locale']         = 'fr_FR';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'jours';
+$text['hours']          = 'heures';
+$text['minutes']        = 'minutes';
+
+$text['temperature']    = 'Temp�rature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Ventilateurs';
+$text['s_value']        = 'valeur';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hyst�r�sis';
+$text['s_limit']        = 'Limite';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/gr.php b/www/include/options/sysInfos/images/includes/lang/gr.php
new file mode 100644
index 0000000000000000000000000000000000000000..11979c80c039ebbf9a8554157020b09c2ec6b5dd
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/gr.php
@@ -0,0 +1,108 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: gr.php,v 1.11 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$charset                = "iso-8895-7";
+
+$text['title']          = '����������� ����������';
+
+$text['vitals']         = '�������������� ����������';
+$text['hostname']       = '����� ����������';
+$text['ip']             = '��������� ��';
+$text['kversion']       = '������ ������';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = '������ ����������� ����������';
+$text['users']          = '���������� �������';
+$text['loadavg']        = 'Load Average';
+
+$text['hardware']       = '����������� ������';
+$text['numcpu']         = '������������';
+$text['cpumodel']       = '�������';
+$text['cpuspeed']       = '�������� MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = '������� ������ Cache';
+$text['bogomips']       = '������������� ����� �� Bogomips';
+
+$text['pci']            = '�������� PCI';
+$text['ide']            = '�������� IDE';
+$text['scsi']           = '�������� SCSI';
+$text['usb']            = '�������� USB';
+
+$text['netusage']       = '����� �������';
+$text['device']         = '�������';
+$text['received']       = '�����������';
+$text['sent']           = '�����������';
+$text['errors']         = '��������';
+
+$text['connections']    = '������� �������� �������';
+
+$text['memusage']       = '����� ������';
+$text['phymem']         = '����� Physical';
+$text['swap']           = '������ Swap';
+
+$text['fs']             = '������������ ��������� �������';
+$text['mount']          = '����������';
+$text['partition']      = '���������';
+
+$text['percent']        = '������������ %';
+$text['type']           = '�����';
+$text['free']           = '��������';
+$text['used']           = '�� �����';
+$text['size']           = '�������';
+$text['totals']         = '��������';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '-';
+
+$text['capacity']       = '������������'; 
+
+$text['template']       = '����';
+$text['language']       = '������';
+$text['submit']         = '�������';
+$text['created']        = '������������� ��� ��';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = '�����';
+$text['hours']          = '����';
+$text['minutes']        = '�����';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/hu.php b/www/include/options/sysInfos/images/includes/lang/hu.php
new file mode 100644
index 0000000000000000000000000000000000000000..37ab316e2936109de63ffeac519d4223d8f27bf7
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/hu.php
@@ -0,0 +1,108 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+// Translated by Zsozso - zsozso@internews.hu
+// $Id: hu.php,v 1.14 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$charset                = 'iso-8859-2';
+
+$text['title']          = 'Rendszer Inform�ci�';
+
+$text['vitals']         = 'A Rendszer Alapvet� Inform�ci�i';
+$text['hostname']       = 'Hostn�v';
+$text['ip']             = 'Figyelt IP';
+$text['kversion']       = 'Kernel Verzi�';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Pillanatnyi felhaszn�l�k';
+$text['loadavg']        = 'Terhel�si �tlag';
+
+$text['hardware']       = 'Hardware Inform�ci�';
+$text['numcpu']         = 'Processzor';
+$text['cpumodel']       = 'Modell';
+$text['cpuspeed']       = 'Chip MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cache M�ret';
+$text['bogomips']       = 'Rendszer Bogomips';
+
+$text['pci']            = 'PCI Eszk�z�k';
+$text['ide']            = 'IDE Eszk�z�k';
+$text['scsi']           = 'SCSI Eszk�z�k';
+$text['usb']            = 'USB Eszk�z�k';
+
+$text['netusage']       = 'H�l� Haszn�lat';
+$text['device']         = 'Eszk�z';
+$text['received']       = 'Fogadott';
+$text['sent']           = 'K�ld�tt';
+$text['hib�k']          = 'Err/Drop';
+
+$text['connections']    = 'L�tes�tett H�l�zati Kapcsolatok';
+
+$text['memusage']       = 'Mem�ria Haszn�lat';
+$text['phymem']         = 'Fizikai Mem�ria';
+$text['swap']           = 'Lemez Swap';
+
+$text['fs']             = 'Csatlakoztatott File Rendszerek';
+$text['mount']          = 'Mount';
+$text['partition']      = 'Part�ci�k';
+
+$text['percent']        = 'Sz�zal�kos Haszn�lat';
+$text['type']           = 'T�pus';
+$text['free']           = 'Szabad';
+$text['used']           = 'Haszn�lt';
+$text['size']           = 'M�ret';
+$text['totals']         = '�sszesen';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'nincs';
+
+$text['capacity']       = 'Kapac�t�s'; 
+
+$text['template']       = 'Sablon';
+$text['language']       = 'Nyelv';
+$text['submit']         = 'Mehet';
+$text['created']        = 'K�sz�lt:';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'nap';
+$text['hours']          = '�ra';
+$text['minutes']        = 'perc';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/id.php b/www/include/options/sysInfos/images/includes/lang/id.php
new file mode 100644
index 0000000000000000000000000000000000000000..dc914dfd3d7f0c6c57f6cf9d256be99ae3f63949
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/id.php
@@ -0,0 +1,107 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: id.php,v 1.14 2005/12/07 15:02:11 bigmichi1 Exp $
+// Translated by: Firman Pribadi <http://ragiel.dhs.org>
+
+$text['title']          = 'Informasi Sistem';
+
+$text['vitals']         = 'Informasi Utama';
+$text['hostname']       = 'Hostname Resmi';
+$text['ip']             = 'IP Penerima';
+$text['kversion']       = 'Versi Kernel';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Aktif Selama';
+$text['users']          = 'Pengguna Saat Ini';
+$text['loadavg']        = 'Beban Rata-rata';
+
+$text['hardware']       = 'Informasi Perangkat Keras';
+$text['numcpu']         = 'Prosesor';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'CPU Speed';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Ukuran Cache';
+$text['bogomips']       = 'Sistem Bogomips';
+
+$text['pci']            = 'Perangkat PCI';
+$text['ide']            = 'Perangkat IDE';
+$text['scsi']           = 'Perangkat SCSI';
+$text['usb']            = 'Perangkat USB';
+
+$text['netusage']       = 'Status Penggunaan Jaringan';
+$text['device']         = 'Perangkat';
+$text['received']       = 'Diterima';
+$text['sent']           = 'Dikirim';
+$text['errors']         = 'Rusak/Drop';
+
+$text['connections']    = 'Koneksi Jaringan Aktif';
+
+$text['memusage']       = 'Status Penggunaan Memori';
+$text['phymem']         = 'Memori Fisik';
+$text['swap']           = 'Swap HardDisk';
+
+$text['fs']             = 'Status Penggunaan Media Penyimpanan dan Filesystem';
+$text['mount']          = 'Titik Mount';
+$text['partition']      = 'Partisi';
+
+$text['percent']        = 'Digunakan (Persen)';
+$text['type']           = 'Tipe';
+$text['free']           = 'Bebas';
+$text['used']           = 'Digunakan';
+$text['size']           = 'Ukuran';
+$text['totals']         = 'Total';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'tidak ditemukan';
+
+$text['capacity']       = 'Kapasitas'; 
+
+$text['template']       = 'Template';
+$text['language']       = 'Bahasa';
+$text['submit']         = 'Gunakan';
+$text['created']        = 'Dibangun menggunakan';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'hari';
+$text['hours']          = 'jam';
+$text['minutes']        = 'menit';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/index.html b/www/include/options/sysInfos/images/includes/lang/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/includes/lang/is.php b/www/include/options/sysInfos/images/includes/lang/is.php
new file mode 100644
index 0000000000000000000000000000000000000000..2469cfb3d17d4816f5b61c2236d1d962c232462f
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/is.php
@@ -0,0 +1,104 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: is.php,v 1.13 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Kerfisuppl�singar';
+
+$text['vitals']         = 'Helstu uppl�singar';
+$text['hostname']       = 'V�larnafn';
+$text['ip']             = 'IP-tala';
+$text['kversion']       = '�tg�fa kjarna';
+$text['dversion']       = 'Nafn dreifingar';
+$text['uptime']         = 'Uppit�mi';
+$text['users']          = 'Notendur';
+$text['loadavg']        = 'Me�al�lag';
+
+$text['hardware']       = 'Uppl�singar um v�lb�na�';
+$text['numcpu']         = 'Fj�ldi �rgj�rva';
+$text['cpumodel']       = 'Tegund';
+$text['cpuspeed']       = 'Hra�i';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'St�r� fl�timinnis';
+$text['bogomips']       = 'Bogomips';
+
+$text['pci']            = 'PCI ja�art�ki';
+$text['ide']            = 'IDE ja�art�ki';
+$text['scsi']           = 'SCSI ja�art�ki';
+$text['usb']            = 'USB ja�art�ki';
+
+$text['netusage']       = 'Netnotkun';
+$text['device']         = 'Ja�art�ki';
+$text['received']       = 'M�tteki�';
+$text['sent']           = 'Sent';
+$text['errors']         = 'Villur/Hent';
+
+$text['memusage']       = 'Minnisnotkun';
+$text['phymem']         = 'Vinnsluminni';
+$text['swap']           = 'S�ndarminni';
+
+$text['fs']             = 'Tengd skr�arkerfi';
+$text['mount']          = 'Tengipunktur';
+$text['partition']      = 'Disksnei�';
+
+$text['percent']        = 'Hlutfall af heildarst�r�';
+$text['type']           = 'Tegund';
+$text['free']           = 'Laust';
+$text['used']           = 'Nota�';
+$text['size']           = 'St�r�';
+$text['totals']         = 'Samtals';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'ekkert';
+
+$text['capacity']       = 'Heildarst�r�'; 
+
+$text['template']       = 'Sni�m�t';
+$text['language']       = 'Tungum�l';
+$text['submit']         = 'Senda';
+$text['created']        = 'B�i� til af';
+$text['locale']         = 'is_IS';
+$text['gen_time']       = '�ann %d.%m.%Y kl. %H:%M';
+
+$text['days']           = 'dagar';
+$text['hours']          = 'klukkustundir';
+$text['minutes']        = 'm�n�tur';
+  
+$text['temperature']    = 'Hitastig';
+$text['voltage']        = 'Volt';
+$text['fans']           = 'Viftur';
+$text['s_value']        = 'Gildi';
+$text['s_min']          = 'L�gst';
+$text['s_max']          = 'H�st';
+$text['s_div']          = 'Deilir';
+$text['hysteresis']     = 'A�v�run l�kur';
+$text['s_limit']        = 'A�v�run byrjar';
+$text['s_label']        = 'Nafn m�lis';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/ja.php b/www/include/options/sysInfos/images/includes/lang/ja.php
new file mode 100644
index 0000000000000000000000000000000000000000..ed1055e8a478eeab4b4d64351b4807b6bb06c842
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/ja.php
@@ -0,0 +1,3 @@
+<?php
+require 'jp.php';
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/jp.php b/www/include/options/sysInfos/images/includes/lang/jp.php
new file mode 100644
index 0000000000000000000000000000000000000000..41a83b8f4e76767e2c482050b7aa0f9b76849e08
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/jp.php
@@ -0,0 +1,105 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: jp.php,v 1.8 2005/11/19 14:08:32 bigmichi1 Exp $
+
+$charset                = 'euc-jp';
+$text['title']          = '�����ƥ����';
+
+$text['vitals']         = '�����ƥ�ư�����';
+$text['hostname']       = '�ۥ���̾';
+$text['ip']             = 'IP���ɥ쥹';
+$text['kversion']       = '�����ͥ�С������(uname)';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Ϣ³��Ư����(uptime)';
+$text['users']          = '��������桼����';
+$text['loadavg']        = '�����ɥ��٥졼��';
+
+$text['hardware']       = '�ϡ��ɥ���������';
+$text['numcpu']         = 'CPU��';
+$text['cpumodel']       = 'CPU��ǥ�';
+$text['cpuspeed']       = '��������(MHz)';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = '����å��奵����';
+$text['bogomips']       = 'System Bogomips';
+
+$text['pci']            = 'PCI�ǥХ�������';
+$text['ide']            = 'IDE�ǥХ�������';
+$text['scsi']           = 'SCSI�ǥХ�������';
+$text['usb']            = 'USB�ǥХ�������';
+
+$text['netusage']       = '�ͥåȥ�����Ѿ���';
+$text['device']         = '���󥿥ե�����̾';
+$text['received']       = '����������';
+$text['sent']           = '����������';
+$text['errors']         = '���顼/������ǽ';
+
+$text['connections']    = '������³���Ƥ���ͥåȥ����³����';
+
+$text['memusage']       = '������Ѿ���';
+$text['phymem']         = 'ʪ��������';
+$text['swap']           = '�ǥ���������å�';
+
+$text['fs']             = '�ޥ���ȺѤߥե����륷���ƥ����';
+$text['mount']          = '�ޥ���ȥݥ����';
+$text['partition']      = '�ǥ������ѡ��ƥ������';
+
+$text['percent']        = '���ѳ��';
+$text['type']           = '�ե����륷���ƥ����';
+$text['free']           = '����';
+$text['used']           = '����';
+$text['size']           = '����';
+$text['totals']         = '���';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '����ޤ���';
+
+$text['capacity']       = '����'; 
+
+$text['template']       = '�ǥ���������';
+$text['language']       = '����';
+$text['submit']         = '����';
+$text['created']        = 'Created by';
+
+$text['days']           = '��';
+$text['hours']          = '����';
+$text['minutes']        = 'ʬ';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/lt.php b/www/include/options/sysInfos/images/includes/lang/lt.php
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/includes/lang/lv.php b/www/include/options/sysInfos/images/includes/lang/lv.php
new file mode 100644
index 0000000000000000000000000000000000000000..ee96043e341718fa9be197f99a64f2a6c5a94edd
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/lv.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: lv.php,v 1.8 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Sist�mas inform�cija';
+
+$text['vitals']         = 'Galvenie r�d�t�ji';
+$text['hostname']       = 'Hosta v�rds';
+$text['ip']             = 'IP Adrese';
+$text['kversion']       = 'Kerne�a versija';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Nep�rtrauktais darba laiks';
+$text['users']          = 'Lietot�ji';
+$text['loadavg']        = 'Vid�jie iel�des r�d�t�ji';
+
+$text['hardware']       = 'Aparat�ra';
+$text['numcpu']         = 'Procesors';
+$text['cpumodel']       = 'Modelis';
+$text['cpuspeed']       = '�ipa MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Ke� atmi�a';
+$text['bogomips']       = 'Sist�mas "Bogomips"';
+
+$text['pci']            = 'PCI ier�ces';
+$text['ide']            = 'IDE ier�ces';
+$text['scsi']           = 'SCSI ier�ces';
+$text['usb']            = 'USB ier�ces';
+
+$text['netusage']       = 'T�kla inform�cija';
+$text['device']         = 'Ier�ce';
+$text['received']       = 'Sa�emts';
+$text['sent']           = 'Aizs�t�ts';
+$text['errors']         = 'K��das/Zaud�t�s paketes';
+
+$text['connections']    = 'Established Network Connections';
+
+$text['memusage']       = 'Atmi�as lietojums';
+$text['phymem']         = 'Operat�v� atmi�a';
+$text['swap']           = 'Swap atmi�a';
+
+$text['fs']             = 'Cietie diski';
+$text['mount']          = 'Mounta vieta';
+$text['partition']      = 'Part�cija';
+
+$text['percent']        = 'Aiz�emts procentos';
+$text['type']           = 'Tips';
+$text['free']           = 'Br�vs';
+$text['used']           = 'Aiz�emts';
+$text['size']           = 'Ietilp�ba';
+$text['totals']         = 'Kop�';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'nav';
+
+$text['capacity']       = 'Ietilp�ba';
+
+$text['template']       = 'Sagatave';
+$text['language']       = 'Valoda';
+$text['submit']         = 'Apstiprin�t';
+$text['created']        = 'Autors';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dienas';
+$text['hours']          = 'stundas';
+$text['minutes']        = 'min�tes';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/nl.php b/www/include/options/sysInfos/images/includes/lang/nl.php
new file mode 100644
index 0000000000000000000000000000000000000000..cf123c266290b2b3289e5c0d222042a0327056ee
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/nl.php
@@ -0,0 +1,110 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: nl.php,v 1.18 2005/12/07 15:02:11 bigmichi1 Exp $
+
+if (PHP_OS == 'WINNT') {
+  $text['locale']         = 'dutch'; // (windows) 
+}
+else {	
+  $text['locale']         = 'nl-NL'; // (Linux and friends(?))
+}
+
+$text['title']          = 'Systeem Informatie';
+
+$text['vitals']         = 'Systeem overzicht';
+$text['hostname']       = 'Toegewezen naam';
+$text['ip']             = 'IP-adres';
+$text['kversion']       = 'Kernelversie';
+$text['dversion']       = 'Distributie';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Huidige gebruikers';
+$text['loadavg']        = 'Gemiddelde belasting';
+
+$text['hardware']       = 'Hardware overzicht';
+$text['numcpu']         = 'Processors';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'CPU snelheid';
+$text['busspeed']       = 'BUS snelheid';
+$text['cache']          = 'Cache grootte';
+$text['bogomips']       = 'Systeem Bogomips';
+
+$text['pci']            = 'PCI Apparaten';
+$text['ide']            = 'IDE Apparaten';
+$text['scsi']           = 'SCSI Apparaten';
+$text['usb']            = 'USB Apparaten';
+
+$text['netusage']       = 'Netwerkgebruik';
+$text['device']         = 'Apparaat';
+$text['received']       = 'Ontvangen';
+$text['sent']           = 'Verzonden';
+$text['errors']         = 'Err/Drop';
+
+$text['memusage']       = 'Geheugengebruik';
+$text['phymem']         = 'Fysiek geheugen';
+$text['swap']           = 'Swap geheugen';
+
+$text['fs']             = 'Aangesloten bestandssystemen';
+$text['mount']          = 'Mount';
+$text['partition']      = 'Partitie';
+
+$text['percent']        = 'Percentage gebruikt';
+$text['type']           = 'Type';
+$text['free']           = 'Vrij';
+$text['used']           = 'Gebruikt';
+$text['size']           = 'Grootte';
+$text['totals']         = 'Totaal';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'geen';
+
+$text['capacity']       = 'Capaciteit';
+  
+$text['template']       = 'Opmaak-model';
+$text['language']       = 'Taal';
+$text['submit']         = 'Toepassen';
+$text['created']        = 'Gegenereerd door';
+$text['gen_time']       = 'op %d %B %Y, om %H:%M';
+
+$text['days']           = 'dagen';
+$text['hours']          = 'uren';
+$text['minutes']        = 'minuten';
+  
+$text['temperature']    = 'Temperatuur';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Waarde';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysterie';
+$text['s_limit']        = 'Limiet';
+$text['s_label']        = 'Omschrijving';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/no.php b/www/include/options/sysInfos/images/includes/lang/no.php
new file mode 100644
index 0000000000000000000000000000000000000000..5421114b435f48c10a029b4403f3bf9bf5af3faa
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/no.php
@@ -0,0 +1,104 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: no.php,v 1.14 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Systeminformasjon';
+
+$text['vitals']         = 'Vital Informasjon';
+$text['hostname']       = 'Egentlige Tjenernavn';
+$text['ip']             = 'IP-Adresse';
+$text['kversion']       = 'Kernel Versjon';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Oppetid';
+$text['users']          = 'Antall Brukere';
+$text['loadavg']        = 'Gj.Snitt Belastning';
+
+$text['hardware']       = 'Maskinvareinformasjon';
+$text['numcpu']         = 'Prosessorer';
+$text['cpumodel']       = 'Modell';
+$text['cpuspeed']       = 'Brikke MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cache St&oslash;rrelse';
+$text['bogomips']       = 'System Bogomips';
+
+$text['pci']            = 'PCI Enheter';
+$text['ide']            = 'IDE Enheter';
+$text['scsi']           = 'SCSI Enheter';
+$text['usb']            = 'USB Enheter';
+
+$text['netusage']       = 'Nettverksbruk';
+$text['device']         = 'Enhet';
+$text['received']       = 'Mottatt';
+$text['sent']           = 'Sendt';
+$text['errors']         = 'Feil/Dropp';
+
+$text['memusage']       = 'Minnebruk';
+$text['phymem']         = 'Fysisk Minne';
+$text['swap']           = 'Disk Swap';
+
+$text['fs']             = 'Monterte Filsystemer';
+$text['mount']          = 'Punkt';
+$text['partition']      = 'Partisjon';
+
+$text['percent']        = 'Brukt Kapasitet i Prosent';
+$text['type']           = 'Type';
+$text['free']           = 'Ledig';
+$text['used']           = 'Brukt';
+$text['size']           = 'St&oslash;rrelse';
+$text['totals']         = 'Totalt';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'Ingen';
+
+$text['capacity']       = 'Kapasitet';
+  
+$text['template']       = 'Mal';
+$text['language']       = 'Spr&aring;k';
+$text['submit']         = 'Endre';
+$text['created']        = 'Generert av';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dager';
+$text['hours']          = 'timer';
+$text['minutes']        = 'minutter';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/pl.php b/www/include/options/sysInfos/images/includes/lang/pl.php
new file mode 100644
index 0000000000000000000000000000000000000000..34552907d7343b87b34b3430ef9e1203eb4a1999
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/pl.php
@@ -0,0 +1,107 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: pl.php,v 1.11 2005/11/19 14:08:32 bigmichi1 Exp $
+
+$charset                = 'iso-8859-2';
+
+$text['title']          = 'Informacja o systemie';
+
+$text['vitals']         = 'Stan systemu';
+$text['hostname']       = 'Nazwa kanoniczna hosta';
+$text['ip']             = 'IP nas�uchuj�cy';
+$text['kversion']       = 'Wersja j�dra';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Obecnych u�ytkownk�w';
+$text['loadavg']        = 'Obci��enia �rednie';
+
+$text['hardware']       = 'Informacja o sprz�cie';
+$text['numcpu']         = 'Procesory';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'Cz&#281;stotliwo&#347;&#263;';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cache Size';
+$text['bogomips']       = 'System Bogomips';
+
+$text['pci']            = 'Urz�dzenia PCI';
+$text['ide']            = 'Urz�dzenia IDE';
+$text['scsi']           = 'Urz�dzenia SCSI';
+$text['usb']            = 'Urz�dzenia USB';
+
+$text['netusage']       = 'Sie�';
+$text['device']         = 'Urz�dzenie';
+$text['received']       = 'Odebrano';
+$text['sent']           = 'Wys�ano';
+$text['errors']         = 'B��dow/Porzuconych';
+
+$text['memusage']       = 'Obci��enie pami�ci';
+$text['phymem']         = 'Pami�� fizyczna';
+$text['swap']           = 'Pami�� Swap';
+
+$text['fs']             = 'Zamontowane systemy plik�w';
+$text['mount']          = 'Punkt montowania';
+$text['partition']      = 'Partycja';
+
+$text['percent']        = 'Procentowo zaj�te';
+$text['type']           = 'Typ';
+$text['free']           = 'Wolne';
+$text['used']           = 'Zaj�te';
+$text['size']           = 'Rozmiar';
+$text['totals']         = 'Ca�kowite';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'brak';
+
+$text['capacity']       = 'Rozmiar';
+
+$text['template']       = 'Szablon';
+$text['language']       = 'J�zyk';
+$text['submit']         = 'Wy�lij';
+$text['created']        = 'Utworzone przez';
+$text['locale']         = 'pl_PL'; 
+$text['gen_time']       = " %e %b %Y o godzinie %T";
+
+$text['days']           = 'dni';
+$text['hours']          = 'godzin';
+$text['minutes']        = 'minut';
+
+$text['sensors']        = 'Czujniki (lm_sensors)';
+$text['temperature']    = 'Temperatura';
+$text['voltage']        = 'Napi�cia';
+$text['fans']           = 'Wiatraczki';
+$text['s_value']        = 'Warto��';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hystereza';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Nazwa';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/pt-br.php b/www/include/options/sysInfos/images/includes/lang/pt-br.php
new file mode 100644
index 0000000000000000000000000000000000000000..cd556596515eb211108665808ad898b2477e9cb4
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/pt-br.php
@@ -0,0 +1,110 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: pt-br.php,v 1.8 2005/12/07 15:02:11 bigmichi1 Exp $
+//
+// Tradutor: Marc�lio Cunha Marinho Maia, 29/03/2003 �s 04:34 (Goi�nia-GO,Brasil)
+// E-mail: marcilio@nextsolution.com.br Web: http://www.nextsolution.com.br
+// Icq: 22493131
+
+$text['title']          = 'Informa��o Sobre o Sistema';
+
+$text['vitals']         = 'Informa��es Vitais do Sistema';
+$text['hostname']       = 'Nome do Servidor';
+$text['ip']             = 'N�mero IP';
+$text['kversion']       = 'Vers�o do Kernel';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Tempo Ativo do Sistema';
+$text['users']          = 'Usuarios Ativos';
+$text['loadavg']        = 'Carga do Sistema';
+
+$text['hardware']       = 'Informa��es sobre o Hardware';
+$text['numcpu']         = 'Processadores';
+$text['cpumodel']       = 'Modelo';
+$text['cpuspeed']       = 'Velocidade em MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Tamanho do Cache';
+$text['bogomips']       = 'Velocidade em Bogomips';
+
+$text['pci']            = 'Dispositivos PCI';
+$text['ide']            = 'Dispositivos IDE';
+$text['scsi']           = 'Dispositivos SCSI';
+$text['usb']            = 'Dispositivos USB';
+
+$text['netusage']       = 'Uso da Rede';
+$text['device']         = 'Dispositivo';
+$text['received']       = 'Recebido';
+$text['sent']           = 'Enviado';
+$text['errors']         = 'Perdido';
+
+$text['connections']    = 'Conex�es Estabelecidas';
+
+$text['memusage']       = 'Utiliza��o Mem�ria';
+$text['phymem']         = 'Mem�ria F�sica';
+$text['swap']           = 'Mem�ria Virtual (SWAP)';
+
+$text['fs']             = 'Sistemas de Arquivos';
+$text['mount']          = 'Ponto de montagem';
+$text['partition']      = 'Parti��o';
+
+$text['percent']        = 'Capacidade Utilizada';
+$text['type']           = 'Tipo';
+$text['free']           = 'Livre';
+$text['used']           = 'Utilizado';
+$text['size']           = 'Tamanho';
+$text['totals']         = 'Totais';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'N/A';
+
+$text['capacity']       = 'Capacidade'; 
+
+$text['template']       = 'Exemplos';
+$text['language']       = 'L�ngua';
+$text['submit']         = 'Entrar';
+$text['created']        = 'Criado por';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'Dias';
+$text['hours']          = 'Horas';
+$text['minutes']        = 'Minutos';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/pt.php b/www/include/options/sysInfos/images/includes/lang/pt.php
new file mode 100644
index 0000000000000000000000000000000000000000..ee2ae8f202e6d578e203362be8cb8ee928b39dc2
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/pt.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: pt.php,v 1.11 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Informa��es do Sistema';
+
+$text['vitals']         = 'Informa��es Vitais';
+$text['hostname']       = 'Hostname Can�nico';
+$text['ip']             = 'IP';
+$text['kversion']       = 'Vers�o do Kernel';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Utilizadores Ligados';
+$text['loadavg']        = 'Carga M�dia';
+
+$text['hardware']       = 'Informa��es do Hardware';
+$text['numcpu']         = 'Processadores';
+$text['cpumodel']       = 'Modelo';
+$text['cpuspeed']       = 'CPU Speed';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Tamanho da Cache';
+$text['bogomips']       = 'Bogomips do Sistema';
+
+$text['pci']            = 'Hardware PCI';
+$text['ide']            = 'Hardware IDE';
+$text['scsi']           = 'Hardware SCSI';
+$text['usb']            = 'Hardware USB';
+
+$text['netusage']       = 'Utiliza��o da Rede';
+$text['device']         = 'Dispositivo';
+$text['received']       = 'Recebidos';
+$text['sent']           = 'Enviados';
+$text['errors']         = 'Erro/Rejeitados';
+
+$text['connections']    = 'Liga��es Estabelecidas';
+
+$text['memusage']       = 'Utiliza��o da Mem�ria';
+$text['phymem']         = 'Mem�ria F�sica';
+$text['swap']           = 'Swap';
+
+$text['fs']             = 'Sistema de Ficheiros (Mounted)';
+$text['mount']          = 'Mount';
+$text['partition']      = 'Parti��es';
+
+$text['percent']        = 'Capacidade em Percentagem';
+$text['type']           = 'Tipo';
+$text['free']           = 'Livre';
+$text['used']           = 'Utilizada';
+$text['size']           = 'Tamanho';
+$text['totals']         = 'Totais';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'indispon�vel';
+
+$text['capacity']       = 'Capacidade'; 
+
+$text['template']       = 'Template';
+$text['language']       = 'Idioma';
+$text['submit']         = 'Enviar';
+$text['created']        = 'Produzido por';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dias';
+$text['hours']          = 'horas';
+$text['minutes']        = 'minutos';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/ro.php b/www/include/options/sysInfos/images/includes/lang/ro.php
new file mode 100644
index 0000000000000000000000000000000000000000..f425b55872b09195f7908bdcfde261f22d97ffa0
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/ro.php
@@ -0,0 +1,105 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: ro.php,v 1.0 6/9/01 12:41PM 
+// Translated by Silviu Simen - ssimen@sympatico.ca
+
+$text['title']          = 'Informatii despre sistem';
+
+$text['vitals']         = 'Informatii vitale';
+$text['hostname']       = 'Numele canonic';
+$text['ip']             = 'Adresa IP';
+$text['kversion']       = 'Versiune nucleu';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Timp de viata';
+$text['users']          = 'Utilizatori curenti';
+$text['loadavg']        = 'Incarcarea sistemului';
+
+$text['hardware']       = 'Informatii hardware';
+$text['numcpu']         = 'Procesoare';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'CPU Speed';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Marime Cache';
+$text['bogomips']       = 'Bogomips';
+
+$text['pci']            = 'Dispozitive PCI';
+$text['ide']            = 'Dispozitive IDE';
+$text['scsi']           = 'Dispozitive SCSI';
+$text['usb']            = 'Dispozitive USB';
+
+$text['netusage']       = 'Utilizarea retelei';
+$text['device']         = 'Dispozitiv';
+$text['received']       = 'Primit';
+$text['sent']           = 'Trimis';
+$text['errors']         = 'Erori';
+
+$text['memusage']       = 'Utilizarea memoriei';
+$text['phymem']         = 'Memorie fizica';
+$text['swap']           = 'Disk Swap';
+
+$text['fs']             = 'Sisteme de fisiere montate';
+$text['mount']          = 'Punct montare';
+$text['partition']      = 'Partitie';
+
+$text['percent']        = 'Procent capacitate';
+$text['type']           = 'Tip';
+$text['free']           = 'Liber';
+$text['used']           = 'Utilizat';
+$text['size']           = 'Marime';
+$text['totals']         = 'Total';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'nici unul';
+
+$text['capacity']       = 'Capacitate';
+
+$text['template']       = 'Model';
+$text['language']       = 'Limba';
+$text['submit']         = 'Actualizeaza';
+$text['created']        = 'Creat de';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'zile';
+$text['hours']          = 'ore';
+$text['minutes']        = 'minute';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/ru.php b/www/include/options/sysInfos/images/includes/lang/ru.php
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/includes/lang/sk.php b/www/include/options/sysInfos/images/includes/lang/sk.php
new file mode 100644
index 0000000000000000000000000000000000000000..c3b99c36a9c06a60b3dc8cffb381bb26feb352a8
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/sk.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: sk.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$charset                = 'iso-8859-2';
+
+$text['title']          = 'Inform�cie o syst�me';
+
+$text['vitals']         = 'Z�kladn� inform�cie';
+$text['hostname']       = 'Meno po��ta�a';
+$text['ip']             = 'IP adresa';
+$text['kversion']       = 'Verzia jadra';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Prihl�sen�ch u��vate�ov';
+$text['loadavg']        = 'Priemer loadu';
+
+$text['hardware']       = 'Hardwarov� inform�cie';
+$text['numcpu']         = 'Procesory';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'Frekvencia';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Ve�kos� cache';
+$text['bogomips']       = 'Bogomipsov';
+
+$text['pci']            = 'PCI zariadenia';
+$text['ide']            = 'IDE zariadenia';
+$text['scsi']           = 'SCSI zariadenia';
+$text['usb']            = 'USB zariadenia';
+
+$text['netusage']       = 'Pou��vanie siete';
+$text['device']         = 'Zariadenia';
+$text['received']       = 'Prijat�ch';
+$text['sent']           = 'Odoslan�ch';
+$text['errors']         = 'Chyby/Vypusten�ch';
+
+$text['memusage']       = 'Obsadenie pam�ti';
+$text['phymem']         = 'Fyzick� pam�';
+$text['swap']           = 'Swap';
+
+$text['fs']             = 'Namountovan� s�borov� syst�my';
+$text['mount']          = 'Adres�r';
+$text['partition']      = 'Part�cia';
+
+$text['percent']        = 'Obsaden�ch';
+$text['type']           = 'Typ';
+$text['free']           = 'Vo�n�ch';
+$text['used']           = 'Pou�it�ch';
+$text['size']           = 'Ve�kos�';
+$text['totals']         = 'Celkom';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '�iadne';
+
+$text['capacity']       = 'Kapacita';
+
+$text['template']       = '�abl�na';
+$text['language']       = 'Jazyk';
+$text['submit']         = 'Odosla�';
+$text['created']        = 'Vytvoren� pomocou';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dn�';
+$text['hours']          = 'hod�n';
+$text['minutes']        = 'min�t';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/sr.php b/www/include/options/sysInfos/images/includes/lang/sr.php
new file mode 100644
index 0000000000000000000000000000000000000000..8102a82cd7fba689af354a6312a9c78b9be57aeb
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/sr.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: sr.php,v 1.3 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$charset                = 'utf-8';
+
+$text['title']          = 'Спецификација Система ';
+
+$text['vitals']         = 'Систем';
+$text['hostname']       = 'Име домаћина';
+$text['ip']             = 'ИП адреса';
+$text['kversion']       = 'Верзија кернела';
+$text['dversion']       = 'Дицтрибуција';
+$text['uptime']         = 'Радно време';
+$text['users']          = 'Број корисника';
+$text['loadavg']        = 'Просечно оптерећење';
+
+$text['hardware']       = 'Хардверске компоненте';
+$text['numcpu']         = 'Процесор';
+$text['cpumodel']       = 'Moдел';
+$text['mhz']            = 'Брзина чипа';
+$text['cache']          = 'Величина предмеморије';
+$text['bogomips']       = 'Богомипс';
+$text['usb']            = 'УСБ уређаји';
+$text['pci']            = 'ПЦИ уређаји';
+$text['ide']            = 'ИДЕ уређаји';
+$text['scsi']           = 'СЦСИ уређаји';
+
+$text['netusage']       = 'Мрежна Употреба';
+$text['device']         = 'Уређај';
+$text['received']       = 'Примљено';
+$text['sent']           = 'Послато';
+$text['errors']         = 'Грешке';
+
+$text['connections']    = 'Успостављене конекције';
+
+$text['memusage']       = 'Употреба меморије';
+$text['phymem']         = 'Тврда memorija';
+$text['swap']           = 'СВАП меморија';
+
+$text['fs']             = 'Монтирани фајл системи';
+$text['mount']          = 'Монтирани';
+$text['partition']      = 'Партиција';
+
+$text['percent']        = 'Проценти';
+$text['type']           = 'Врста';
+$text['free']           = 'Слободно';
+$text['used']           = 'Искоришћено';
+$text['size']           = 'Величина';
+$text['totals']         = 'Укупно';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'ezer ez';
+
+$text['capacity']       = 'Капацитет'; 
+
+$text['template']       = 'Tемплат';
+$text['language']       = 'Језик';
+$text['submit']         = 'Пошаљи';
+$text['created']        = 'Креирано: ';
+$text['locale']         = 'ср';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'Дани';
+$text['hours']          = 'Сати';
+$text['minutes']        = 'Минути';
+  
+$text['temperature']    = 'Температура';
+$text['voltage']        = 'Напајање';
+$text['fans']           = 'Вентилатори';
+$text['s_value']        = 'Снага';
+$text['s_min']          = 'Мин';
+$text['s_max']          = 'Mах';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Аларм';
+$text['s_limit']        = 'Лимит';
+$text['s_label']        = 'Име';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/sv.php b/www/include/options/sysInfos/images/includes/lang/sv.php
new file mode 100644
index 0000000000000000000000000000000000000000..d2dab28dace9cd274bb3e5e7d1ef5257f4aed405
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/lang/sv.php
@@ -0,0 +1,107 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: sv.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+//
+// translation by shockzor
+// updated/edited by jetthe
+
+$text['title']          = 'Systeminformation';
+
+$text['vitals']         = 'Allm�n information';
+$text['hostname']       = 'V�rdnamn';
+$text['ip']             = 'IP-adress';
+$text['kversion']       = 'Kernel-version';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Drifttid';
+$text['users']          = 'Aktuella anv�ndare';
+$text['loadavg']        = 'Medelbelastning';
+
+$text['hardware']       = 'H�rdvaruinformation';
+$text['numcpu']         = 'Processorer';
+$text['cpumodel']       = 'Modell';
+$text['cpuspeed']       = 'Klockfrekvens';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cachestorlek';
+$text['bogomips']       = 'Bogomips';
+
+$text['pci']            = 'PCI-enheter';
+$text['ide']            = 'IDE-enheter';
+$text['scsi']           = 'SCSI-enheter';
+$text['usb']            = 'USB-enheter';
+
+$text['netusage']       = 'N�tverksanv�ndning';
+$text['device']         = 'Enheter';
+$text['received']       = 'Mottaget';
+$text['sent']           = 'Skickat';
+$text['errors']         = 'Fel/F�rlorat';
+
+$text['memusage']       = 'Minnesanv�ndning';
+$text['phymem']         = 'Fysiskt minne';
+$text['swap']           = 'V�xlingsminne';
+
+$text['fs']             = 'Monterade filsystem';
+$text['mount']          = 'Monteringspunkt';
+$text['partition']      = 'Partition';
+
+$text['percent']        = 'Kapacitetsutnyttjande';
+$text['type']           = 'Typ';
+$text['free']           = 'Ledigt';
+$text['used']           = 'Anv�nt';
+$text['size']           = 'Storlek';
+$text['totals']         = 'Totalt';
+
+$text['kb']             = 'kB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'inga';
+
+$text['capacity']       = 'Kapacitet';
+  
+$text['template']       = 'Mall';
+$text['language']       = 'Spr�k';
+$text['submit']         = 'Skicka';
+
+$text['days']           = 'dagar';
+$text['hours']          = 'timmar';
+$text['minutes']        = 'minuter';
+$text['created']        = 'Skapat av';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/lang/tr.php b/www/include/options/sysInfos/images/includes/lang/tr.php
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/includes/os/class.BSD.common.inc.php b/www/include/options/sysInfos/images/includes/os/class.BSD.common.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..871e4d9b9a463cc1f56f18566709cc43d33de8a7
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/os/class.BSD.common.inc.php
@@ -0,0 +1,330 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.BSD.common.inc.php,v 1.34 2005/12/09 19:30:48 bigmichi1 Exp $
+
+class bsd_common {
+  var $dmesg; 
+  // Our constructor
+  // this function is run on the initialization of this class
+  function bsd_common () {
+    // initialize all the variables we need from our parent class
+    $this->sysinfo();
+  } 
+  // read /var/run/dmesg.boot, but only if we haven't already.
+  function read_dmesg () {
+    if (! $this->dmesg) {
+      $this->dmesg = file ('/var/run/dmesg.boot');
+    } 
+    return $this->dmesg;
+  } 
+  // grabs a key from sysctl(8)
+  function grab_key ($key) {
+    return execute_program('sysctl', "-n $key");
+  } 
+  // get our apache SERVER_NAME or vhost
+  function hostname () {
+    if (!($result = getenv('SERVER_NAME'))) {
+      $result = "N.A.";
+    } 
+    return $result;
+  } 
+  // get our canonical hostname
+  function chostname () {
+    return execute_program('hostname');
+  } 
+  // get the IP address of our canonical hostname
+  function ip_addr () {
+    if (!($result = getenv('SERVER_ADDR'))) {
+      $result = gethostbyname($this->chostname());
+    } 
+    return $result;
+  } 
+
+  function kernel () {
+    $s = $this->grab_key('kern.version');
+    $a = explode(':', $s);
+    return $a[0] . $a[1] . ':' . $a[2];
+  } 
+
+  function uptime () {
+    $result = $this->get_sys_ticks();
+
+    return $result;
+  } 
+
+  function users () {
+    return execute_program('who', '| wc -l');
+  } 
+
+  function loadavg ($bar = false) {
+    $s = $this->grab_key('vm.loadavg');
+    $s = ereg_replace('{ ', '', $s);
+    $s = ereg_replace(' }', '', $s);
+    $results['avg'] = explode(' ', $s);
+
+    if ($bar) {
+      if ($fd = $this->grab_key('kern.cp_time')) {
+        sscanf($fd, "%*s %Ld %Ld %Ld %Ld", $ab, $ac, $ad, $ae);
+        // Find out the CPU load
+        // user + sys = load
+        // total = total
+        $load = $ab + $ac + $ad;        // cpu.user + cpu.sys
+        $total = $ab + $ac + $ad + $ae; // cpu.total
+
+        // we need a second value, wait 1 second befor getting (< 1 second no good value will occour)
+        sleep(1);
+        $fd = $this->grab_key('kern.cp_time');
+        sscanf($fd, "%*s %Ld %Ld %Ld %Ld", $ab, $ac, $ad, $ae);
+        $load2 = $ab + $ac + $ad;
+        $total2 = $ab + $ac + $ad + $ae;
+        $results['cpupercent'] = (100*($load2 - $load)) / ($total2 - $total);
+      }
+    }
+    return $results;
+  } 
+
+  function cpu_info () {
+    $results = array();
+    $ar_buf = array();
+
+    $results['model'] = $this->grab_key('hw.model');
+    $results['cpus'] = $this->grab_key('hw.ncpu');
+
+    for ($i = 0, $max = count($this->read_dmesg()); $i < $max; $i++) {
+      $buf = $this->dmesg[$i];
+      if (preg_match("/$this->cpu_regexp/", $buf, $ar_buf)) {
+        $results['cpuspeed'] = round($ar_buf[2]);
+        break;
+      } 
+    } 
+    return $results;
+  } 
+  // get the scsi device information out of dmesg
+  function scsi () {
+    $results = array();
+    $ar_buf = array();
+
+    for ($i = 0, $max = count($this->read_dmesg()); $i < $max; $i++) {
+      $buf = $this->dmesg[$i];
+
+      if (preg_match("/$this->scsi_regexp1/", $buf, $ar_buf)) {
+        $s = $ar_buf[1];
+        $results[$s]['model'] = $ar_buf[2];
+        $results[$s]['media'] = 'Hard Disk';
+      } elseif (preg_match("/$this->scsi_regexp2/", $buf, $ar_buf)) {
+        $s = $ar_buf[1];
+        $results[$s]['capacity'] = $ar_buf[2] * 2048 * 1.049;
+      }
+    } 
+    // return array_values(array_unique($results));
+    // 1. more useful to have device names
+    // 2. php 4.1.1 array_unique() deletes non-unique values.
+    asort($results);
+    return $results;
+  } 
+
+  // get the pci device information out of dmesg
+  function pci () {
+    $results = array();
+
+    if($buf = execute_program("pciconf", "-lv")) {
+	$buf = explode("\n", $buf); $s = 0;
+	foreach($buf as $line) {
+	    if (preg_match("/(.*) = '(.*)'/", $line, $strings)) {
+		if (trim($strings[1]) == "vendor") {
+		    $results[$s] = trim($strings[2]);
+		} elseif (trim($strings[1]) == "device") {
+		    $results[$s] .= " - " . trim($strings[2]);
+		    $s++;
+		}
+	    }
+	}
+    } else {
+	for ($i = 0, $s = 0; $i < count($this->read_dmesg()); $i++) {
+	    $buf = $this->dmesg[$i];
+	    if (preg_match('/(.*): <(.*)>(.*) pci[0-9]$/', $buf, $ar_buf)) {
+		$results[$s++] = $ar_buf[1] . ": " . $ar_buf[2];
+	    } elseif (preg_match('/(.*): <(.*)>.* at [.0-9]+ irq/', $buf, $ar_buf)) {
+		$results[$s++] = $ar_buf[1] . ": " . $ar_buf[2];
+	    }
+	} 
+	$results = array_unique($results);
+    }
+    asort($results);
+    return $results;
+  } 
+
+  // get the ide device information out of dmesg
+  function ide () {
+    $results = array();
+
+    $s = 0;
+    for ($i = 0, $max = count($this->read_dmesg()); $i < $max; $i++) {
+      $buf = $this->dmesg[$i];
+
+      if (preg_match('/^(ad[0-9]+): (.*)MB <(.*)> (.*) (.*)/', $buf, $ar_buf)) {
+        $s = $ar_buf[1];
+        $results[$s]['model'] = $ar_buf[3];
+        $results[$s]['media'] = 'Hard Disk';
+        $results[$s]['capacity'] = $ar_buf[2] * 2048 * 1.049;
+      } elseif (preg_match('/^(acd[0-9]+): (.*) <(.*)> (.*)/', $buf, $ar_buf)) {
+        $s = $ar_buf[1];
+        $results[$s]['model'] = $ar_buf[3];
+        $results[$s]['media'] = 'CD-ROM';
+      }
+    } 
+    // return array_values(array_unique($results));
+    // 1. more useful to have device names
+    // 2. php 4.1.1 array_unique() deletes non-unique values.
+    asort($results);
+    return $results;
+  } 
+
+  // place holder function until we add acual usb detection
+  function usb () {
+    return array();
+  } 
+
+  function sbus () {
+    $results = array();
+    $_results[0] = "";
+    // TODO. Nothing here yet. Move along.
+    $results = $_results;
+    return $results;
+  }
+
+  function memory () {
+    $s = $this->grab_key('hw.physmem');
+
+    if (PHP_OS == 'FreeBSD' || PHP_OS == 'OpenBSD') {
+      // vmstat on fbsd 4.4 or greater outputs kbytes not hw.pagesize
+      // I should probably add some version checking here, but for now
+      // we only support fbsd 4.4
+      $pagesize = 1024;
+    } else {
+      $pagesize = $this->grab_key('hw.pagesize');
+    } 
+
+    $results['ram'] = array();
+
+    $pstat = execute_program('vmstat');
+    $lines = split("\n", $pstat);
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i], 19);
+
+      if ($i == 2) {
+        $results['ram']['free'] = $ar_buf[5] * $pagesize / 1024;
+      } 
+    } 
+
+    $results['ram']['total'] = $s / 1024;
+    $results['ram']['shared'] = 0;
+    $results['ram']['buffers'] = 0;
+    $results['ram']['used'] = $results['ram']['total'] - $results['ram']['free'];
+    $results['ram']['cached'] = 0;
+    $results['ram']['t_used'] = $results['ram']['used'];
+    $results['ram']['t_free'] = $results['ram']['free'];
+
+    $results['ram']['percent'] = round(($results['ram']['used'] * 100) / $results['ram']['total']);
+
+    if (PHP_OS == 'OpenBSD') {
+      $pstat = execute_program('swapctl', '-l -k');
+    } else {
+      $pstat = execute_program('swapinfo', '-k');
+    } 
+
+    $lines = split("\n", $pstat);
+
+    $results['swap']['total'] = 0;
+    $results['swap']['used'] = 0;
+    $results['swap']['free'] = 0;
+
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i], 6);
+
+      if ($ar_buf[0] != 'Total') {
+        $results['swap']['total'] = $results['swap']['total'] + $ar_buf[1];
+        $results['swap']['used'] = $results['swap']['used'] + $ar_buf[2];
+        $results['swap']['free'] = $results['swap']['free'] + $ar_buf[3];
+      } 
+    } 
+    $results['swap']['percent'] = round(($results['swap']['used'] * 100) / $results['swap']['total']);
+
+    return $results;
+  } 
+
+  function filesystems () {
+    global $show_bind;
+    $fstype = array();
+    $fsoptions = array();
+
+    $df = execute_program('df', '-k');
+    $mounts = split("\n", $df);
+
+    $buffer = execute_program("mount");
+    $buffer = explode("\n", $buffer);
+
+    $j = 0;
+    foreach($buffer as $line) {
+      preg_match("/(.*) on (.*) \((.*)\)/", $line, $result);
+      list($result[3], $result[4]) = preg_split("/,\s/", $result[3], 2);
+      if (count($result) == 5) {
+        $dev = $result[1]; $mpoint = $result[2]; $type = $result[3]; $options = $result[4];
+        $fstype[$mpoint] = $type; $fsdev[$dev] = $type; $fsoptions[$mpoint] = $options;
+
+       if ($dev == "devfs")
+         continue;
+        foreach ($mounts as $line2) {
+          if (preg_match("#^" . $result[1] . "#", $line2)) {
+            $line2 = preg_replace("#^" . $result[1] . "#", "", $line2);
+            $ar_buf = preg_split("/(\s+)/", $line2, 6);
+            $ar_buf[0] = $result[1];
+
+            if (hide_mount($ar_buf[5]) || $ar_buf[0] == "") {
+              continue;
+            }
+
+            if ($show_bind || !stristr($fsoptions[$ar_buf[5]], "bind")) {
+              $results[$j] = array();
+              $results[$j]['disk'] = $ar_buf[0];
+              $results[$j]['size'] = $ar_buf[1];
+              $results[$j]['used'] = $ar_buf[2];
+              $results[$j]['free'] = $ar_buf[3];
+              $results[$j]['percent'] = round(($results[$j]['used'] * 100) / $results[$j]['size']) . '%';
+              $results[$j]['mount'] = $ar_buf[5];
+              ($fstype[$ar_buf[5]]) ? $results[$j]['fstype'] = $fstype[$ar_buf[5]] : $results[$j]['fstype'] = $fsdev[$ar_buf[0]];
+              $results[$j]['options'] = $fsoptions[$ar_buf[5]];
+              $j++;
+            }
+          }
+        }
+      }
+    }
+    return $results;
+  }
+
+  function distro () { 
+    $distro = execute_program('uname', '-s');                             
+    $result = $distro;
+    return($result);               
+  }
+} 
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/os/class.Darwin.inc.php b/www/include/options/sysInfos/images/includes/os/class.Darwin.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..8c4d3678ef9bf1cf36651f3625e087f69a41074e
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/os/class.Darwin.inc.php
@@ -0,0 +1,233 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.Darwin.inc.php,v 1.22 2005/11/22 14:30:28 bigmichi1 Exp $
+if (!defined('IN_PHPSYSINFO')) {
+    die("No Hacking");
+}
+
+require_once(APP_ROOT . '/includes/os/class.BSD.common.inc.php');
+
+echo "<p align=center><b>Note: The Darwin version of phpSysInfo is work in progress, some things currently don't work</b></p>";
+
+class sysinfo extends bsd_common {
+  var $cpu_regexp;
+  var $scsi_regexp; 
+  // Our contstructor
+  // this function is run on the initialization of this class
+  function sysinfo () {
+    // $this->cpu_regexp = "CPU: (.*) \((.*)-MHz (.*)\)";
+    // $this->scsi_regexp1 = "^(.*): <(.*)> .*SCSI.*device";
+  } 
+
+  function grab_key ($key) {
+    $s = execute_program('sysctl', $key);
+    $s = ereg_replace($key . ': ', '', $s);
+    $s = ereg_replace($key . ' = ', '', $s); // fix Apple set keys
+    
+    return $s;
+  } 
+
+  function grab_ioreg ($key) {
+    $s = execute_program('ioreg', '-cls "' . $key . '" | grep "' . $key . '"'); //ioreg -cls "$key" | grep "$key"
+    $s = ereg_replace('\|', '', $s);
+    $s = ereg_replace('\+\-\o', '', $s);
+    $s = ereg_replace('[ ]+', '', $s);
+    $s = ereg_replace('<[^>]+>', '', $s); // remove possible XML conflicts
+
+    return $s;
+  } 
+
+  function get_sys_ticks () {
+    $a = execute_program('sysctl', '-n kern.boottime'); // get boottime (value in seconds) 
+    $sys_ticks = time() - $a;
+
+    return $sys_ticks;
+  } 
+
+  function cpu_info () {
+    $results = array(); 
+    // $results['model'] = $this->grab_key('hw.model'); // need to expand this somehow...
+    // $results['model'] = $this->grab_key('hw.machine');
+    $results['model'] = ereg_replace('Processor type: ', '', execute_program('hostinfo', '| grep "Processor type"')); // get processor type
+    $results['cpus'] = $this->grab_key('hw.ncpu');
+    $results['cpuspeed'] = round($this->grab_key('hw.cpufrequency') / 1000000); // return cpu speed - Mhz
+    $results['busspeed'] = round($this->grab_key('hw.busfrequency') / 1000000); // return bus speed - Mhz
+    $results['cache'] = round($this->grab_key('hw.l2cachesize') / 1024); // return l2 cache
+    
+    return $results;
+  } 
+  // get the pci device information out of ioreg
+  function pci () {
+    $results = array();
+    $s = $this->grab_ioreg('IOPCIDevice');
+
+    $lines = split("\n", $s);
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i], 19);
+      $results[$i] = $ar_buf[0];
+    } 
+    asort($results);
+    return array_values(array_unique($results));
+  } 
+  // get the ide device information out of ioreg
+  function ide () {
+    $results = array(); 
+    // ioreg | grep "Media  <class IOMedia>"
+    $s = $this->grab_ioreg('IOATABlockStorageDevice'); 
+
+    $lines = split("\n", $s);
+    $j = 0;
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\/\//", $lines[$i], 19);
+
+      if ($ar_buf[1] == 'class IOMedia' && preg_match('/Media/', $ar_buf[0])) {
+        $results[$j++]['model'] = $ar_buf[0];
+      } 
+    } 
+    asort($results);
+    return array_values(array_unique($results));
+  } 
+
+  function memory () {
+    $s = $this->grab_key('hw.physmem');
+
+    $results['ram'] = array();
+
+    $pstat = execute_program('vm_stat'); // use darwin's vm_stat
+    $lines = split("\n", $pstat);
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i], 19);
+
+      if ($i == 1) {
+        $results['ram']['free'] = $ar_buf[2] * 4; // calculate free memory from page sizes (each page = 4MB)
+      } 
+    } 
+
+    $results['ram']['total'] = $s / 1024;
+    $results['ram']['shared'] = 0;
+    $results['ram']['buffers'] = 0;
+    $results['ram']['used'] = $results['ram']['total'] - $results['ram']['free'];
+    $results['ram']['cached'] = 0;
+    $results['ram']['t_used'] = $results['ram']['used'];
+    $results['ram']['t_free'] = $results['ram']['free'];
+
+    $results['ram']['percent'] = round(($results['ram']['used'] * 100) / $results['ram']['total']); 
+    // need to fix the swap info...
+    $pstat = execute_program('swapinfo', '-k');
+    $lines = split("\n", $pstat);
+
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i], 6);
+
+      if ($i == 0) {
+        $results['swap']['total'] = 0;
+        $results['swap']['used'] = 0;
+        $results['swap']['free'] = 0;
+      } else {
+        $results['swap']['total'] = $results['swap']['total'] + $ar_buf[1];
+        $results['swap']['used'] = $results['swap']['used'] + $ar_buf[2];
+        $results['swap']['free'] = $results['swap']['free'] + $ar_buf[3];
+      } 
+    } 
+    $results['swap']['percent'] = round(($results['swap']['used'] * 100) / $results['swap']['total']);
+
+    return $results;
+  } 
+
+  function network () {
+    $netstat = execute_program('netstat', '-nbdi | cut -c1-24,42- | grep Link');
+    $lines = split("\n", $netstat);
+    $results = array();
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i]);
+      if (!empty($ar_buf[0])) {
+        $results[$ar_buf[0]] = array();
+
+        $results[$ar_buf[0]]['rx_bytes'] = $ar_buf[5];
+        $results[$ar_buf[0]]['rx_packets'] = $ar_buf[3];
+        $results[$ar_buf[0]]['rx_errs'] = $ar_buf[4];
+        $results[$ar_buf[0]]['rx_drop'] = $ar_buf[10];
+
+        $results[$ar_buf[0]]['tx_bytes'] = $ar_buf[8];
+        $results[$ar_buf[0]]['tx_packets'] = $ar_buf[6];
+        $results[$ar_buf[0]]['tx_errs'] = $ar_buf[7];
+        $results[$ar_buf[0]]['tx_drop'] = $ar_buf[10];
+
+        $results[$ar_buf[0]]['errs'] = $ar_buf[4] + $ar_buf[7];
+        $results[$ar_buf[0]]['drop'] = $ar_buf[10];
+      } 
+    } 
+    return $results;
+  } 
+
+  function filesystems () {
+    $df = execute_program('df', '-k');
+    $mounts = split("\n", $df);
+    $fstype = array();
+
+    $s = execute_program('mount');
+    $lines = explode("\n", $s);
+
+    $i = 0;
+    while (list(, $line) = each($lines)) {
+      ereg('(.*) \((.*)\)', $line, $a);
+
+      $m = explode(' ', $a[0]);
+      $fsdev[$m[0]] = $a[2];
+    } 
+
+    for ($i = 1, $j = 0, $max = sizeof($mounts); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $mounts[$i], 6);
+
+      switch ($ar_buf[0]) {
+        case 'automount': // skip the automount entries
+        case 'devfs': // skip the dev filesystem
+        case 'fdesc': // skip the fdesc
+        case 'procfs': // skip the proc filesystem
+        case '<volfs>': // skip the vol filesystem
+          continue 2;
+          break;
+      } 
+      if (hide_mount($ar_buf[5])) {
+        continue;
+      }													
+
+      $results[$j] = array();
+
+      $results[$j]['disk'] = $ar_buf[0];
+      $results[$j]['size'] = $ar_buf[1];
+      $results[$j]['used'] = $ar_buf[2];
+      $results[$j]['free'] = $ar_buf[3];
+      $results[$j]['percent'] = $ar_buf[4];
+      $results[$j]['mount'] = $ar_buf[5];
+      ($fstype[$ar_buf[5]]) ? $results[$j]['fstype'] = $fstype[$ar_buf[5]] : $results[$j]['fstype'] = $fsdev[$ar_buf[0]];
+      $j++;
+    } 
+    return $results;
+  } 
+  
+  function distroicon () {
+    $result = 'Darwin.png';
+    return($result);
+  }
+
+} 
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/os/class.FreeBSD.inc.php b/www/include/options/sysInfos/images/includes/os/class.FreeBSD.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..3d176b9f5b2351a1be8fcfbb89eb67952ff01071
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/os/class.FreeBSD.inc.php
@@ -0,0 +1,92 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.FreeBSD.inc.php,v 1.13 2005/11/22 14:30:28 bigmichi1 Exp $
+if (!defined('IN_PHPSYSINFO')) {
+    die("No Hacking");
+}
+
+require_once(APP_ROOT . '/includes/os/class.BSD.common.inc.php');
+
+class sysinfo extends bsd_common {
+  var $cpu_regexp;
+  var $scsi_regexp; 
+  // Our contstructor
+  // this function is run on the initialization of this class
+  function sysinfo () {
+    $this->cpu_regexp = "CPU: (.*) \((.*)-MHz (.*)\)";
+    $this->scsi_regexp1 = "^(.*): <(.*)> .*SCSI.*device";
+    $this->scsi_regexp2 = "^(da[0-9]): (.*)MB ";
+  } 
+
+  function get_sys_ticks () {
+    $s = explode(' ', $this->grab_key('kern.boottime'));
+    $a = ereg_replace('{ ', '', $s[3]);
+    $sys_ticks = time() - $a;
+    return $sys_ticks;
+  } 
+
+  function network () {
+    $netstat = execute_program('netstat', '-nibd | grep Link');
+    $lines = split("\n", $netstat);
+    $results = array();
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i]);
+      if (!empty($ar_buf[0])) {
+        $results[$ar_buf[0]] = array();
+
+        if (strlen($ar_buf[3]) < 15) {
+          $results[$ar_buf[0]]['rx_bytes'] = $ar_buf[5];
+          $results[$ar_buf[0]]['rx_packets'] = $ar_buf[3];
+          $results[$ar_buf[0]]['rx_errs'] = $ar_buf[4];
+          $results[$ar_buf[0]]['rx_drop'] = $ar_buf[10];
+
+          $results[$ar_buf[0]]['tx_bytes'] = $ar_buf[8];
+          $results[$ar_buf[0]]['tx_packets'] = $ar_buf[6];
+          $results[$ar_buf[0]]['tx_errs'] = $ar_buf[7];
+          $results[$ar_buf[0]]['tx_drop'] = $ar_buf[10];
+
+          $results[$ar_buf[0]]['errs'] = $ar_buf[4] + $ar_buf[7];
+          $results[$ar_buf[0]]['drop'] = $ar_buf[10];
+        } else {
+          $results[$ar_buf[0]]['rx_bytes'] = $ar_buf[6];
+          $results[$ar_buf[0]]['rx_packets'] = $ar_buf[4];
+          $results[$ar_buf[0]]['rx_errs'] = $ar_buf[5];
+          $results[$ar_buf[0]]['rx_drop'] = $ar_buf[11];
+
+          $results[$ar_buf[0]]['tx_bytes'] = $ar_buf[9];
+          $results[$ar_buf[0]]['tx_packets'] = $ar_buf[7];
+          $results[$ar_buf[0]]['tx_errs'] = $ar_buf[8];
+          $results[$ar_buf[0]]['tx_drop'] = $ar_buf[11];
+
+          $results[$ar_buf[0]]['errs'] = $ar_buf[5] + $ar_buf[8];
+          $results[$ar_buf[0]]['drop'] = $ar_buf[11];
+        } 
+      } 
+    } 
+    return $results;
+  } 
+
+  function distroicon () {
+    $result = 'FreeBSD.png';
+    return($result);
+  }
+} 
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/os/class.HP-UX.inc.php b/www/include/options/sysInfos/images/includes/os/class.HP-UX.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..458786c3d9abd5924c5392f3d4895ba55dcba05c
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/os/class.HP-UX.inc.php
@@ -0,0 +1,419 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.HP-UX.inc.php,v 1.15 2005/11/22 14:30:28 bigmichi1 Exp $
+
+class sysinfo {
+  // get our apache SERVER_NAME or vhost
+  function vhostname () {
+    if (! ($result = getenv('SERVER_NAME'))) {
+      $result = 'N.A.';
+    } 
+    return $result;
+  } 
+  // get our canonical hostname
+  function chostname () {
+    return execute_program('hostname');
+  } 
+  // get the IP address of our canonical hostname
+  function ip_addr () {
+    if (!($result = getenv('SERVER_ADDR'))) {
+      $result = gethostbyname($this->chostname());
+    } 
+    return $result;
+  } 
+
+  function kernel () {
+    return execute_program('uname', '-srvm');
+  } 
+
+  function uptime () {
+    $result = 0;
+    $ar_buf = array();
+
+    $buf = execute_program('uptime');
+    if (preg_match("/up (\d+) days,\s*(\d+):(\d+),/", $buf, $ar_buf)) {
+      $min = $ar_buf[3];
+      $hours = $ar_buf[2];
+      $days = $ar_buf[1];
+      $result = $days * 86400 + $hours * 3600 + $min * 60;
+    } 
+
+    return $result;
+  } 
+
+  function users () {
+    $who = split('=', execute_program('who', '-q'));
+    $result = $who[1];
+    return $result;
+  } 
+
+  function loadavg ($bar = false) {
+    $ar_buf = array();
+
+    $buf = execute_program('uptime');
+
+    if (preg_match("/average: (.*), (.*), (.*)$/", $buf, $ar_buf)) {
+      $results['avg'] = array($ar_buf[1], $ar_buf[2], $ar_buf[3]);
+    } else {
+      $results['avg'] = array('N.A.', 'N.A.', 'N.A.');
+    } 
+    return $results;
+  } 
+
+  function cpu_info () {
+    $results = array();
+    $ar_buf = array();
+
+    if ($fd = fopen('/proc/cpuinfo', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        list($key, $value) = preg_split('/\s+:\s+/', trim($buf), 2); 
+        // All of the tags here are highly architecture dependant.
+        // the only way I could reconstruct them for machines I don't
+        // have is to browse the kernel source.  So if your arch isn't
+        // supported, tell me you want it written in.
+        switch ($key) {
+          case 'model name':
+            $results['model'] = $value;
+            break;
+          case 'cpu MHz':
+            $results['cpuspeed'] = sprintf('%.2f', $value);
+            break;
+          case 'cycle frequency [Hz]': // For Alpha arch - 2.2.x
+            $results['cpuspeed'] = sprintf('%.2f', $value / 1000000);
+            break;
+          case 'clock': // For PPC arch (damn borked POS)
+            $results['cpuspeed'] = sprintf('%.2f', $value);
+            break;
+          case 'cpu': // For PPC arch (damn borked POS)
+            $results['model'] = $value;
+            break;
+          case 'revision': // For PPC arch (damn borked POS)
+            $results['model'] .= ' ( rev: ' . $value . ')';
+            break;
+          case 'cpu model': // For Alpha arch - 2.2.x
+            $results['model'] .= ' (' . $value . ')';
+            break;
+          case 'cache size':
+            $results['cache'] = $value;
+            break;
+          case 'bogomips':
+            $results['bogomips'] += $value;
+            break;
+          case 'BogoMIPS': // For alpha arch - 2.2.x
+            $results['bogomips'] += $value;
+            break;
+          case 'BogoMips': // For sparc arch
+            $results['bogomips'] += $value;
+            break;
+          case 'cpus detected': // For Alpha arch - 2.2.x
+            $results['cpus'] += $value;
+            break;
+          case 'system type': // Alpha arch - 2.2.x
+            $results['model'] .= ', ' . $value . ' ';
+            break;
+          case 'platform string': // Alpha arch - 2.2.x
+            $results['model'] .= ' (' . $value . ')';
+            break;
+          case 'processor':
+            $results['cpus'] += 1;
+            break;
+        } 
+      } 
+      fclose($fd);
+    } 
+
+    $keys = array_keys($results);
+    $keys2be = array('model', 'cpuspeed', 'cache', 'bogomips', 'cpus');
+
+    while ($ar_buf = each($keys2be)) {
+      if (! in_array($ar_buf[1], $keys)) {
+        $results[$ar_buf[1]] = 'N.A.';
+      } 
+    } 
+    return $results;
+  } 
+
+  function pci () {
+    $results = array();
+
+    if ($fd = fopen('/proc/pci', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/Bus/', $buf)) {
+          $device = 1;
+          continue;
+        } 
+
+        if ($device) {
+          list($key, $value) = split(': ', $buf, 2);
+
+          if (!preg_match('/bridge/i', $key) && !preg_match('/USB/i', $key)) {
+            $results[] = preg_replace('/\([^\)]+\)\.$/', '', trim($value));
+          } 
+          $device = 0;
+        } 
+      } 
+    } 
+    asort($results);
+    return $results;
+  } 
+
+  function ide () {
+    $results = array();
+
+    $handle = opendir('/proc/ide');
+
+    while ($file = readdir($handle)) {
+      if (preg_match('/^hd/', $file)) {
+        $results[$file] = array(); 
+        // Check if device is CD-ROM (CD-ROM capacity shows as 1024 GB)
+        if ($fd = fopen("/proc/ide/$file/media", 'r')) {
+          $results[$file]['media'] = trim(fgets($fd, 4096));
+          if ($results[$file]['media'] == 'disk') {
+            $results[$file]['media'] = 'Hard Disk';
+          } 
+
+          if ($results[$file]['media'] == 'cdrom') {
+            $results[$file]['media'] = 'CD-ROM';
+          } 
+          fclose($fd);
+        } 
+
+        if ($fd = fopen("/proc/ide/$file/model", 'r')) {
+          $results[$file]['model'] = trim(fgets($fd, 4096));
+          if (preg_match('/WDC/', $results[$file]['model'])) {
+            $results[$file]['manufacture'] = 'Western Digital';
+          } elseif (preg_match('/IBM/', $results[$file]['model'])) {
+            $results[$file]['manufacture'] = 'IBM';
+          } elseif (preg_match('/FUJITSU/', $results[$file]['model'])) {
+            $results[$file]['manufacture'] = 'Fujitsu';
+          } else {
+            $results[$file]['manufacture'] = 'Unknown';
+          } 
+
+          fclose($fd);
+        } 
+
+        if ($fd = fopen("/proc/ide/$file/capacity", 'r')) {
+          $results[$file]['capacity'] = trim(fgets($fd, 4096));
+          if ($results[$file]['media'] == 'CD-ROM') {
+            unset($results[$file]['capacity']);
+          } 
+          fclose($fd);
+        } 
+      } 
+    } 
+    closedir($handle);
+
+    asort($results);
+    return $results;
+  } 
+
+  function scsi () {
+    $results = array();
+    $dev_vendor = '';
+    $dev_model = '';
+    $dev_rev = '';
+    $dev_type = '';
+    $s = 1;
+
+    if ($fd = fopen('/proc/scsi/scsi', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/Vendor/', $buf)) {
+          preg_match('/Vendor: (.*) Model: (.*) Rev: (.*)/i', $buf, $dev);
+          list($key, $value) = split(': ', $buf, 2);
+          $dev_str = $value;
+          $get_type = 1;
+          continue;
+        } 
+
+        if ($get_type) {
+          preg_match('/Type:\s+(\S+)/i', $buf, $dev_type);
+          $results[$s]['model'] = "$dev[1] $dev[2] ($dev_type[1])";
+          $results[$s]['media'] = "Hard Disk";
+          $s++;
+          $get_type = 0;
+        } 
+      } 
+    } 
+    asort($results);
+    return $results;
+  } 
+
+  function usb () {
+    $results = array();
+    $devstring = 0;
+    $devnum = -1;
+
+    if ($fd = fopen('/proc/bus/usb/devices', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/^T/', $buf)) {
+          $devnum += 1;
+        } 
+        if (preg_match('/^S/', $buf)) {
+          $devstring = 1;
+        } 
+
+        if ($devstring) {
+          list($key, $value) = split(': ', $buf, 2);
+          list($key, $value2) = split('=', $value, 2);
+          $results[$devnum] .= " " . trim($value2);
+          $devstring = 0;
+        } 
+      } 
+    } 
+    return $results;
+  } 
+
+  function sbus () {
+    $results = array();
+    $_results[0] = "";
+    // TODO. Nothing here yet. Move along.
+    $results = $_results;
+    return $results;
+  }
+
+  function network () {
+    $netstat = execute_program('netstat', '-ni | tail -n +2');
+    $lines = split("\n", $netstat);
+    $results = array();
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i]);
+      if (!empty($ar_buf[0]) && !empty($ar_buf[3])) {
+        $results[$ar_buf[0]] = array();
+
+        $results[$ar_buf[0]]['rx_bytes'] = $ar_buf[4];
+        $results[$ar_buf[0]]['rx_packets'] = $ar_buf[4];
+        $results[$ar_buf[0]]['rx_errs'] = $ar_buf[5];
+        $results[$ar_buf[0]]['rx_drop'] = $ar_buf[8];
+
+        $results[$ar_buf[0]]['tx_bytes'] = $ar_buf[6];
+        $results[$ar_buf[0]]['tx_packets'] = $ar_buf[6];
+        $results[$ar_buf[0]]['tx_errs'] = $ar_buf[7];
+        $results[$ar_buf[0]]['tx_drop'] = $ar_buf[8];
+
+        $results[$ar_buf[0]]['errs'] = $ar_buf[5] + $ar_buf[7];
+        $results[$ar_buf[0]]['drop'] = $ar_buf[8];
+      } 
+    } 
+    return $results;
+  } 
+  function memory () {
+    if ($fd = fopen('/proc/meminfo', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/Mem:\s+(.*)$/', $buf, $ar_buf)) {
+          $ar_buf = preg_split('/\s+/', $ar_buf[1], 6);
+
+          $results['ram'] = array();
+
+          $results['ram']['total'] = $ar_buf[0] / 1024;
+          $results['ram']['used'] = $ar_buf[1] / 1024;
+          $results['ram']['free'] = $ar_buf[2] / 1024;
+          $results['ram']['shared'] = $ar_buf[3] / 1024;
+          $results['ram']['buffers'] = $ar_buf[4] / 1024;
+          $results['ram']['cached'] = $ar_buf[5] / 1024; 
+          // I don't like this since buffers and cache really aren't
+          // 'used' per say, but I get too many emails about it.
+          $results['ram']['t_used'] = $results['ram']['used'];
+          $results['ram']['t_free'] = $results['ram']['total'] - $results['ram']['t_used'];
+          $results['ram']['percent'] = round(($results['ram']['t_used'] * 100) / $results['ram']['total']);
+        } 
+
+        if (preg_match('/Swap:\s+(.*)$/', $buf, $ar_buf)) {
+          $ar_buf = preg_split('/\s+/', $ar_buf[1], 3);
+
+          $results['swap'] = array();
+
+          $results['swap']['total'] = $ar_buf[0] / 1024;
+          $results['swap']['used'] = $ar_buf[1] / 1024;
+          $results['swap']['free'] = $ar_buf[2] / 1024;
+          $results['swap']['percent'] = round(($ar_buf[1] * 100) / $ar_buf[0]); 
+          // Get info on individual swap files
+          $swaps = file ('/proc/swaps');
+          $swapdevs = split("\n", $swaps);
+
+          for ($i = 1, $max = (sizeof($swapdevs) - 1); $i < $max; $i++) {
+            $ar_buf = preg_split('/\s+/', $swapdevs[$i], 6);
+
+            $results['devswap'][$i - 1] = array();
+            $results['devswap'][$i - 1]['dev'] = $ar_buf[0];
+            $results['devswap'][$i - 1]['total'] = $ar_buf[2];
+            $results['devswap'][$i - 1]['used'] = $ar_buf[3];
+            $results['devswap'][$i - 1]['free'] = ($results['devswap'][$i - 1]['total'] - $results['devswap'][$i - 1]['used']);
+            $results['devswap'][$i - 1]['percent'] = round(($ar_buf[3] * 100) / $ar_buf[2]);
+          } 
+          break;
+        } 
+      } 
+      fclose($fd);
+    } else {
+      $results['ram'] = array();
+      $results['swap'] = array();
+      $results['devswap'] = array();
+    } 
+    return $results;
+  } 
+
+  function filesystems () {
+    $df = execute_program('df', '-kP');
+    $mounts = split("\n", $df);
+    $fstype = array();
+
+    $s = execute_program('mount', '-v');
+    $lines = explode("\n", $s);
+
+    $i = 0;
+    while (list(, $line) = each($lines)) {
+      $a = split(' ', $line);
+      $fsdev[$a[0]] = $a[4];
+    } 
+
+    for ($i = 1, $j = 0, $max = sizeof($mounts); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $mounts[$i], 6);
+
+      if (hide_mount($ar_buf[5])) {
+        continue;
+      }
+
+      $results[$j] = array();
+
+      $results[$j]['disk'] = $ar_buf[0];
+      $results[$j]['size'] = $ar_buf[1];
+      $results[$j]['used'] = $ar_buf[2];
+      $results[$j]['free'] = $ar_buf[3];
+      $results[$j]['percent'] = $ar_buf[4];
+      $results[$j]['mount'] = $ar_buf[5];
+      ($fstype[$ar_buf[5]]) ? $results[$j]['fstype'] = $fstype[$ar_buf[5]] : $results[$j]['fstype'] = $fsdev[$ar_buf[0]];
+      $j++;
+    } 
+    return $results;
+  } 
+  
+  function distro () {
+    $result = 'HP-UX';  	
+    return($result);
+  }
+
+  function distroicon () {
+    $result = 'unknown.png';
+    return($result);
+  }
+} 
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/os/class.Linux.inc.php b/www/include/options/sysInfos/images/includes/os/class.Linux.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..f4a65fc5e179702afc6e41f3fe26a17006a960ba
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/os/class.Linux.inc.php
@@ -0,0 +1,533 @@
+<?php 
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+// $Id: class.Linux.inc.php,v 1.58 2005/12/06 15:58:55 bigmichi1 Exp $
+class sysinfo {
+  var $inifile = "distros.ini";
+  var $icon = "unknown.png";
+  var $distro = "unknown";
+
+  // get the distro name and icon when create the sysinfo object
+  function sysinfo() {
+   $list = @parse_ini_file(APP_ROOT . "/" . $this->inifile, true);
+   if (!$list) {
+    return;
+   }
+   foreach ($list as $section => $distribution) {
+    if (!isset($distribution["Files"])) {
+     continue;
+    } else {
+     foreach (explode(";", $distribution["Files"]) as $filename) {
+      if (file_exists($filename)) {
+       $fd = fopen($filename, 'r');
+       $buf = fgets($fd, 1024);
+       fclose($fd);
+       $this->icon = isset($distribution["Image"]) ? $distribution["Image"] : $this->icon;
+       $this->distro = isset($distribution["Name"]) ? $distribution["Name"] . " " . trim($buf) : trim($buf);
+       break 2;
+      }
+     }
+    }
+   }
+  }
+
+  // get our apache SERVER_NAME or vhost
+  function vhostname () {
+    if (! ($result = getenv('SERVER_NAME'))) {
+      $result = 'N.A.';
+    } 
+    return $result;
+  } 
+  // get our canonical hostname
+  function chostname () {
+    if ($fp = fopen('/proc/sys/kernel/hostname', 'r')) {
+      $result = trim(fgets($fp, 4096));
+      fclose($fp);
+      $result = gethostbyaddr(gethostbyname($result));
+    } else {
+      $result = 'N.A.';
+    } 
+    return $result;
+  } 
+  // get the IP address of our canonical hostname
+  function ip_addr () {
+    if (!($result = getenv('SERVER_ADDR'))) {
+      $result = gethostbyname($this->chostname());
+    } 
+    return $result;
+  } 
+
+  function kernel () {
+    if ($fd = fopen('/proc/version', 'r')) {
+      $buf = fgets($fd, 4096);
+      fclose($fd);
+
+      if (preg_match('/version (.*?) /', $buf, $ar_buf)) {
+        $result = $ar_buf[1];
+
+        if (preg_match('/SMP/', $buf)) {
+          $result .= ' (SMP)';
+        } 
+      } else {
+        $result = 'N.A.';
+      } 
+    } else {
+      $result = 'N.A.';
+    } 
+    return $result;
+  } 
+  
+  function uptime () {
+    $fd = fopen('/proc/uptime', 'r');
+    $ar_buf = split(' ', fgets($fd, 4096));
+    fclose($fd);
+
+    $result = trim($ar_buf[0]);
+
+    return $result;
+  } 
+
+  function users () {
+    $who = split('=', execute_program('who', '-q'));
+    $result = $who[1];
+    return $result;
+  } 
+
+  function loadavg ($bar = false) {
+    if ($fd = fopen('/proc/loadavg', 'r')) {
+      $results['avg'] = preg_split("/\s/", fgets($fd, 4096),4);
+      unset($results['avg'][3]);	// don't need the extra values, only first three
+      fclose($fd);
+    } else {
+      $results['avg'] = array('N.A.', 'N.A.', 'N.A.');
+    } 
+    if ($bar) {
+      if ($fd = fopen('/proc/stat', 'r')) {
+	fscanf($fd, "%*s %Ld %Ld %Ld %Ld", $ab, $ac, $ad, $ae);
+	// Find out the CPU load
+	// user + sys = load 
+	// total = total
+	$load = $ab + $ac + $ad;	// cpu.user + cpu.sys
+	$total = $ab + $ac + $ad + $ae;	// cpu.total
+	fclose($fd);
+
+	// we need a second value, wait 1 second befor getting (< 1 second no good value will occour)
+	sleep(1);
+	$fd = fopen('/proc/stat', 'r');
+	fscanf($fd, "%*s %Ld %Ld %Ld %Ld", $ab, $ac, $ad, $ae);
+	$load2 = $ab + $ac + $ad;
+	$total2 = $ab + $ac + $ad + $ae;
+	$results['cpupercent'] = (100*($load2 - $load)) / ($total2 - $total);
+	fclose($fd);
+      }
+    }
+    return $results;
+  } 
+
+  function cpu_info () {
+    $results = array('cpus' => 0, 'bogomips' => 0);
+    $ar_buf = array();
+
+    if ($fd = fopen('/proc/cpuinfo', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+       if($buf != "\n") {
+        list($key, $value) = preg_split('/\s+:\s+/', trim($buf), 2); 
+        // All of the tags here are highly architecture dependant.
+        // the only way I could reconstruct them for machines I don't
+        // have is to browse the kernel source.  So if your arch isn't
+        // supported, tell me you want it written in.
+        switch ($key) {
+          case 'model name':
+            $results['model'] = $value;
+            break;
+          case 'cpu MHz':
+            $results['cpuspeed'] = sprintf('%.2f', $value);
+            break;
+          case 'cycle frequency [Hz]': // For Alpha arch - 2.2.x
+            $results['cpuspeed'] = sprintf('%.2f', $value / 1000000);
+            break;
+          case 'clock': // For PPC arch (damn borked POS)
+            $results['cpuspeed'] = sprintf('%.2f', $value);
+            break;
+          case 'cpu': // For PPC arch (damn borked POS)
+            $results['model'] = $value;
+            break;
+          case 'L2 cache': // More for PPC
+            $results['cache'] = $value;
+            break;
+          case 'revision': // For PPC arch (damn borked POS)
+            $results['model'] .= ' ( rev: ' . $value . ')';
+            break;
+          case 'cpu model': // For Alpha arch - 2.2.x
+            $results['model'] .= ' (' . $value . ')';
+            break;
+          case 'cache size':
+            $results['cache'] = $value;
+            break;
+          case 'bogomips':
+            $results['bogomips'] += $value;
+            break;
+          case 'BogoMIPS': // For alpha arch - 2.2.x
+            $results['bogomips'] += $value;
+            break;
+          case 'BogoMips': // For sparc arch
+            $results['bogomips'] += $value;
+            break;
+          case 'cpus detected': // For Alpha arch - 2.2.x
+            $results['cpus'] += $value;
+            break;
+          case 'system type': // Alpha arch - 2.2.x
+            $results['model'] .= ', ' . $value . ' ';
+            break;
+          case 'platform string': // Alpha arch - 2.2.x
+            $results['model'] .= ' (' . $value . ')';
+            break;
+          case 'processor':
+            $results['cpus'] += 1;
+            break;
+          case 'Cpu0ClkTck': // Linux sparc64
+            $results['cpuspeed'] = sprintf('%.2f', hexdec($value) / 1000000);
+            break;
+          case 'Cpu0Bogo': // Linux sparc64 & sparc32
+            $results['bogomips'] = $value;
+            break;
+          case 'ncpus probed': // Linux sparc64 & sparc32
+            $results['cpus'] = $value;
+            break;
+        } 
+       }
+      } 
+      fclose($fd);
+    } 
+
+    // sparc64 specific code follows
+    // This adds the ability to display the cache that a CPU has
+    // Originally made by Sven Blumenstein <bazik@gentoo.org> in 2004
+    // Modified by Tom Weustink <freshy98@gmx.net> in 2004
+    $sparclist = array('SUNW,UltraSPARC@0,0', 'SUNW,UltraSPARC-II@0,0', 'SUNW,UltraSPARC@1c,0', 'SUNW,UltraSPARC-IIi@1c,0', 'SUNW,UltraSPARC-II@1c,0');
+    foreach ($sparclist as $name) {
+      if (file_exists('/proc/openprom/' . $name . '/ecache-size')) {
+        $fd = fopen('/proc/openprom/' . $name . '/ecache-size', 'r');
+        $results['cache'] = base_convert(fgets($fd, 32), 16, 10)/1024 . ' KB';
+        fclose($fd);
+      }
+    }
+    // sparc64 specific code ends
+
+    $keys = array_keys($results);
+    $keys2be = array('model', 'cpuspeed', 'cache', 'bogomips', 'cpus');
+
+    while ($ar_buf = each($keys2be)) {
+      if (! in_array($ar_buf[1], $keys)) {
+        $results[$ar_buf[1]] = 'N.A.';
+      } 
+    } 
+    return $results;
+  } 
+
+  function pci () {
+    $results = array();
+
+    if ($_results = execute_program('lspci')) {
+      $lines = split("\n", $_results);
+      for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+        list($addr, $name) = explode(' ', trim($lines[$i]), 2);
+
+        if (!preg_match('/bridge/i', $name) && !preg_match('/USB/i', $name)) {
+          // remove all the version strings
+          $name = preg_replace('/\(.*\)/', '', $name);
+          $results[] = $addr . ' ' . $name;
+        } 
+      } 
+    } elseif ($fd = fopen('/proc/pci', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/Bus/', $buf)) {
+          $device = 1;
+          continue;
+        } 
+
+        if ($device) {
+          list($key, $value) = split(': ', $buf, 2);
+
+          if (!preg_match('/bridge/i', $key) && !preg_match('/USB/i', $key)) {
+            $results[] = preg_replace('/\([^\)]+\)\.$/', '', trim($value));
+          } 
+          $device = 0;
+        } 
+      } 
+    } 
+    asort($results);
+    return $results;
+  } 
+
+  function ide () {
+    $results = array();
+
+    $handle = opendir('/proc/ide');
+
+    while ($file = readdir($handle)) {
+      if (preg_match('/^hd/', $file)) {
+        $results[$file] = array(); 
+        // Check if device is CD-ROM (CD-ROM capacity shows as 1024 GB)
+        if ($fd = fopen("/proc/ide/$file/media", 'r')) {
+          $results[$file]['media'] = trim(fgets($fd, 4096));
+          if ($results[$file]['media'] == 'disk') {
+            $results[$file]['media'] = 'Hard Disk';
+          } 
+
+          if ($results[$file]['media'] == 'cdrom') {
+            $results[$file]['media'] = 'CD-ROM';
+          } 
+          fclose($fd);
+        } 
+
+        if ($fd = fopen("/proc/ide/$file/model", 'r')) {
+          $results[$file]['model'] = trim(fgets($fd, 4096));
+          if (preg_match('/WDC/', $results[$file]['model'])) {
+            $results[$file]['manufacture'] = 'Western Digital';
+          } elseif (preg_match('/IBM/', $results[$file]['model'])) {
+            $results[$file]['manufacture'] = 'IBM';
+          } elseif (preg_match('/FUJITSU/', $results[$file]['model'])) {
+            $results[$file]['manufacture'] = 'Fujitsu';
+          } else {
+            $results[$file]['manufacture'] = 'Unknown';
+          } 
+
+          fclose($fd);
+        } 
+	
+	if (file_exists("/proc/ide/$file/capacity"))
+	    $filename = "/proc/ide/$file/capacity";
+	elseif (file_exists("/sys/block/$file/size"))
+	    $filename = "/sys/block/$file/size";
+
+        if (isset($filename) && $fd = fopen("/proc/ide/$file/capacity", 'r')) {
+          $results[$file]['capacity'] = trim(fgets($fd, 4096));
+          if ($results[$file]['media'] == 'CD-ROM') {
+            unset($results[$file]['capacity']);
+          } 
+          fclose($fd);
+        } 
+      } 
+    } 
+    closedir($handle);
+
+    asort($results);
+    return $results;
+  } 
+
+  function scsi () {
+    $results = array();
+    $dev_vendor = '';
+    $dev_model = '';
+    $dev_rev = '';
+    $dev_type = '';
+    $s = 1;
+    $get_type = 0;
+
+    if ($fd = fopen('/proc/scsi/scsi', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/Vendor/', $buf)) {
+          preg_match('/Vendor: (.*) Model: (.*) Rev: (.*)/i', $buf, $dev);
+          list($key, $value) = split(': ', $buf, 2);
+          $dev_str = $value;
+          $get_type = 1;
+          continue;
+        } 
+
+        if ($get_type) {
+          preg_match('/Type:\s+(\S+)/i', $buf, $dev_type);
+          $results[$s]['model'] = "$dev[1] $dev[2] ($dev_type[1])";
+          $results[$s]['media'] = "Hard Disk";
+          $s++;
+          $get_type = 0;
+        } 
+      } 
+    } 
+    asort($results);
+    return $results;
+  } 
+
+  function usb () {
+    $results = array();
+    $devnum = -1;
+
+    if ($fd = fopen('/proc/bus/usb/devices', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/^T/', $buf)) {
+          $devnum += 1;
+	  $results[$devnum] = "";
+        } elseif (preg_match('/^S:/', $buf)) {
+          list($key, $value) = split(': ', $buf, 2);
+          list($key, $value2) = split('=', $value, 2);
+	  if (trim($key) != "SerialNumber") {
+            $results[$devnum] .= " " . trim($value2);
+            $devstring = 0;
+	  }
+        } 
+      } 
+    } 
+    return $results;
+  } 
+
+  function sbus () {
+    $results = array();
+    $_results[0] = ""; 
+    // TODO. Nothing here yet. Move along.
+    $results = $_results;
+    return $results;
+  } 
+
+  function network () {
+    $results = array();
+
+    if ($fd = fopen('/proc/net/dev', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/:/', $buf)) {
+          list($dev_name, $stats_list) = preg_split('/:/', $buf, 2);
+          $stats = preg_split('/\s+/', trim($stats_list));
+          $results[$dev_name] = array();
+
+          $results[$dev_name]['rx_bytes'] = $stats[0];
+          $results[$dev_name]['rx_packets'] = $stats[1];
+          $results[$dev_name]['rx_errs'] = $stats[2];
+          $results[$dev_name]['rx_drop'] = $stats[3];
+
+          $results[$dev_name]['tx_bytes'] = $stats[8];
+          $results[$dev_name]['tx_packets'] = $stats[9];
+          $results[$dev_name]['tx_errs'] = $stats[10];
+          $results[$dev_name]['tx_drop'] = $stats[11];
+
+          $results[$dev_name]['errs'] = $stats[2] + $stats[10];
+          $results[$dev_name]['drop'] = $stats[3] + $stats[11];
+        } 
+      } 
+    } else {
+      echo "'/proc/net/dev' not readable";
+    }
+    return $results;
+  } 
+
+  function memory () {
+    if ($fd = fopen('/proc/meminfo', 'r')) {
+      $results['ram'] = array();
+      $results['swap'] = array();
+      $results['devswap'] = array();
+
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/^MemTotal:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
+          $results['ram']['total'] = $ar_buf[1];
+        } else if (preg_match('/^MemFree:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
+          $results['ram']['t_free'] = $ar_buf[1];
+        } else if (preg_match('/^Cached:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
+          $results['ram']['cached'] = $ar_buf[1];
+        } else if (preg_match('/^Buffers:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
+          $results['ram']['buffers'] = $ar_buf[1];
+        } else if (preg_match('/^SwapTotal:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
+          $results['swap']['total'] = $ar_buf[1];
+        } else if (preg_match('/^SwapFree:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
+          $results['swap']['free'] = $ar_buf[1];
+        } 
+      } 
+      fclose($fd);
+
+      $results['ram']['t_used'] = $results['ram']['total'] - $results['ram']['t_free'];
+      $results['ram']['percent'] = round(($results['ram']['t_used'] * 100) / $results['ram']['total']);
+      $results['swap']['used'] = $results['swap']['total'] - $results['swap']['free'];
+      $results['swap']['percent'] = round(($results['swap']['used'] * 100) / $results['swap']['total']);
+      
+      // values for splitting memory usage
+      if (isset($results['ram']['cached']) && isset($results['ram']['buffers'])) {
+        $results['ram']['app'] = $results['ram']['t_used'] - $results['ram']['cached'] - $results['ram']['buffers'];
+	$results['ram']['app_percent'] = round(($results['ram']['app'] * 100) / $results['ram']['total']);
+	$results['ram']['buffers_percent'] = round(($results['ram']['buffers'] * 100) / $results['ram']['total']);
+	$results['ram']['cached_percent'] = round(($results['ram']['cached'] * 100) / $results['ram']['total']);
+      }
+
+      $swaps = file ('/proc/swaps');
+      for ($i = 1; $i < (sizeof($swaps)); $i++) {
+        $ar_buf = preg_split('/\s+/', $swaps[$i], 6);
+        $results['devswap'][$i - 1] = array();
+        $results['devswap'][$i - 1]['dev'] = $ar_buf[0];
+        $results['devswap'][$i - 1]['total'] = $ar_buf[2];
+        $results['devswap'][$i - 1]['used'] = $ar_buf[3];
+        $results['devswap'][$i - 1]['free'] = ($results['devswap'][$i - 1]['total'] - $results['devswap'][$i - 1]['used']);
+        $results['devswap'][$i - 1]['percent'] = round(($ar_buf[3] * 100) / $ar_buf[2]);
+      } 
+    } else {
+      $results['ram'] = array();
+      $results['swap'] = array();
+      $results['devswap'] = array();
+    }
+    return $results;
+  } 
+
+  function filesystems () {
+    global $show_bind;
+    $fstype = array();
+    $fsoptions = array();
+
+    $df = execute_program('df', '-kP');
+    $mounts = split("\n", $df);
+
+    $buffer = execute_program("mount");
+    $buffer = explode("\n", $buffer);
+
+    $j = 0;
+    foreach($buffer as $line) {
+      preg_match("/(.*) on (.*) type (.*) \((.*)\)/", $line, $result);
+      if (count($result) == 5) {
+        $dev = $result[1]; $mpoint = $result[2]; $type = $result[3]; $options = $result[4];
+        $fstype[$mpoint] = $type; $fsdev[$dev] = $type; $fsoptions[$mpoint] = $options;
+
+        foreach ($mounts as $line2) {
+          if (preg_match("#^" . $result[1] . "#", $line2)) {
+            $line2 = preg_replace("#^" . $result[1] . "#", "", $line2);
+            $ar_buf = preg_split("/(\s+)/", $line2, 6);
+            $ar_buf[0] = $result[1];
+
+            if (hide_mount($ar_buf[5]) || $ar_buf[0] == "") {
+              continue;
+            }
+
+            if ($show_bind || !stristr($fsoptions[$ar_buf[5]], "bind")) {
+              $results[$j] = array();
+              $results[$j]['disk'] = $ar_buf[0];
+              $results[$j]['size'] = $ar_buf[1];
+              $results[$j]['used'] = $ar_buf[2];
+              $results[$j]['free'] = $ar_buf[3];
+              $results[$j]['percent'] = round(($results[$j]['used'] * 100) / $results[$j]['size']) . '%';
+              $results[$j]['mount'] = $ar_buf[5];
+              ($fstype[$ar_buf[5]]) ? $results[$j]['fstype'] = $fstype[$ar_buf[5]] : $results[$j]['fstype'] = $fsdev[$ar_buf[0]];
+              $results[$j]['options'] = $fsoptions[$ar_buf[5]];
+              $j++;
+            }
+          }
+	}
+      }
+    }
+    return $results;
+  } 
+
+  function distro () {
+   return $this->distro;
+  }
+
+  function distroicon () {   
+   return $this->icon;
+  }
+
+} 
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/os/class.NetBSD.inc.php b/www/include/options/sysInfos/images/includes/os/class.NetBSD.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..c3e167b0e0851820a8dd54ce0ab9fe5a9da7a188
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/os/class.NetBSD.inc.php
@@ -0,0 +1,153 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.NetBSD.inc.php,v 1.14 2005/11/22 14:30:28 bigmichi1 Exp $
+if (!defined('IN_PHPSYSINFO')) {
+    die("No Hacking");
+}
+
+require_once(APP_ROOT . '/includes/os/class.BSD.common.inc.php');
+
+class sysinfo extends bsd_common {
+  var $cpu_regexp;
+  var $scsi_regexp; 
+  // Our contstructor
+  // this function is run on the initialization of this class
+  function sysinfo () {
+    $this->cpu_regexp = "^cpu(.*)\, (.*) MHz";
+    $this->scsi_regexp1 = "^(.*) at scsibus.*: <(.*)> .*";
+    $this->scsi_regexp2 = "^(da[0-9]): (.*)MB ";
+  } 
+
+  function get_sys_ticks () {
+    $a = $this->grab_key('kern.boottime');
+    $sys_ticks = time() - $a;
+    return $sys_ticks;
+  } 
+  // get the pci device information out of dmesg
+  function pci () {
+    $results = array();
+
+    for ($i = 0, $max = count($this->read_dmesg()); $i < $max; $i++) {
+      $buf = $this->dmesg[$i];
+      if (preg_match('/(.*) at pci[0-9] dev [0-9]* function [0-9]*: (.*)$/', $buf, $ar_buf)) {
+        $results[$i] = $ar_buf[1] . ": " . $ar_buf[2];
+      } elseif (preg_match('/"(.*)" (.*).* at [.0-9]+ irq/', $buf, $ar_buf)) {
+        $results[$i] = $ar_buf[1] . ": " . $ar_buf[2];
+      } 
+    } 
+    asort($results);
+    return $results;
+  } 
+
+  function network () {
+    $netstat_b = execute_program('netstat', '-nbdi | cut -c1-25,44- | grep "^[a-z]*[0-9][ \t].*Link"');
+    $netstat_n = execute_program('netstat', '-ndi | cut -c1-25,44- | grep "^[a-z]*[0-9][ \t].*Link"');
+    $lines_b = split("\n", $netstat_b);
+    $lines_n = split("\n", $netstat_n);
+    $results = array();
+    for ($i = 0, $max = sizeof($lines_b); $i < $max; $i++) {
+      $ar_buf_b = preg_split("/\s+/", $lines_b[$i]);
+      $ar_buf_n = preg_split("/\s+/", $lines_n[$i]);
+      if (!empty($ar_buf_b[0]) && !empty($ar_buf_n[3])) {
+        $results[$ar_buf_b[0]] = array();
+
+        $results[$ar_buf_b[0]]['rx_bytes'] = $ar_buf_b[3];
+        $results[$ar_buf_b[0]]['rx_packets'] = $ar_buf_n[3];
+        $results[$ar_buf_b[0]]['rx_errs'] = $ar_buf_n[4];
+        $results[$ar_buf_b[0]]['rx_drop'] = $ar_buf_n[8];
+
+        $results[$ar_buf_b[0]]['tx_bytes'] = $ar_buf_b[4];
+        $results[$ar_buf_b[0]]['tx_packets'] = $ar_buf_n[5];
+        $results[$ar_buf_b[0]]['tx_errs'] = $ar_buf_n[6];
+        $results[$ar_buf_b[0]]['tx_drop'] = $ar_buf_n[8];
+
+        $results[$ar_buf_b[0]]['errs'] = $ar_buf_n[4] + $ar_buf_n[6];
+        $results[$ar_buf_b[0]]['drop'] = $ar_buf_n[8];
+      } 
+    } 
+    return $results;
+  } 
+
+  function memory () {
+    $s = $this->grab_key('hw.physmem');
+    $pagesize = $this->grab_key('hw.pagesize');
+
+    $results['ram'] = array();
+
+    $pstat = execute_program('vmstat', '-s');
+    $lines = split("\n", $pstat);
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i], 19);
+
+      if ($i == 3) {
+        $results['ram']['free'] = $ar_buf[1] * $pagesize / 1024;
+      } elseif ($i == 19) {
+        $results['swap']['total'] = $ar_buf[1] * $pagesize / 1024;
+      } elseif ($i == 20) {
+        $results['swap']['used'] = $ar_buf[1] * $pagesize / 1024;
+      } 
+    } 
+
+    $results['ram']['total'] = $s / 1024;
+    $results['ram']['shared'] = 0;
+    $results['ram']['buffers'] = 0;
+    $results['ram']['used'] = $results['ram']['total'] - $results['ram']['free'];
+    $results['ram']['cached'] = 0;
+    $results['ram']['t_used'] = $results['ram']['used'];
+    $results['ram']['t_free'] = $results['ram']['free'];
+    $results['ram']['percent'] = round(($results['ram']['used'] * 100) / $results['ram']['total']);
+
+    $results['swap']['free'] = $results['swap']['total'] - $results['swap']['used'];
+    $results['swap']['percent'] = round(($results['swap']['used'] * 100) / $results['swap']['total']);
+
+    return $results;
+  } 
+  // get the ide device information out of dmesg
+  function ide () {
+    $results = array();
+
+    $s = 0;
+    for ($i = 0, $max = count($this->read_dmesg()); $i < $max; $i++) {
+      $buf = $this->dmesg[$i];
+      if (preg_match('/^(.*) at (pciide|wdc)[0-9] (.*): <(.*)>/', $buf, $ar_buf)) {
+        $s = $ar_buf[1];
+        $results[$s]['model'] = $ar_buf[4];
+        $results[$s]['media'] = 'Hard Disk'; 
+        // now loop again and find the capacity
+        for ($j = 0, $max1 = count($this->read_dmesg()); $j < $max1; $j++) {
+          $buf_n = $this->dmesg[$j];
+          if (preg_match("/^($s): (.*), (.*), (.*)MB, .*$/", $buf_n, $ar_buf_n)) {
+            $results[$s]['capacity'] = $ar_buf_n[4] * 2048 * 1.049;;
+          } 
+        } 
+      } 
+    } 
+    asort($results);
+    return $results;
+  } 
+
+  function distroicon () {
+    $result = 'NetBSD.png';
+    return($result);
+  }
+  
+} 
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/os/class.OpenBSD.inc.php b/www/include/options/sysInfos/images/includes/os/class.OpenBSD.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..cf51eb84f5d249ec065c61005954055c508e93e6
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/os/class.OpenBSD.inc.php
@@ -0,0 +1,120 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.OpenBSD.inc.php,v 1.18 2005/11/28 15:52:15 bigmichi1 Exp $
+if (!defined('IN_PHPSYSINFO')) {
+    die("No Hacking");
+}
+
+require_once(APP_ROOT . '/includes/os/class.BSD.common.inc.php');
+
+class sysinfo extends bsd_common {
+  var $cpu_regexp;
+  var $scsi_regexp; 
+  // Our contstructor
+  // this function is run on the initialization of this class
+  function sysinfo () {
+    $this->cpu_regexp = "^cpu(.*) (.*) MHz";
+    $this->scsi_regexp1 = "^(.*) at scsibus.*: <(.*)> .*";
+    $this->scsi_regexp2 = "^(da[0-9]): (.*)MB ";
+  } 
+
+  function get_sys_ticks () {
+    $a = $this->grab_key('kern.boottime');
+    $sys_ticks = time() - $a;
+    return $sys_ticks;
+  } 
+  // get the pci device information out of dmesg
+  function pci () {
+    $results = array();
+
+    for ($i = 0, $s = 0, $max = count($this->read_dmesg()); $i < $max; $i++) {
+      $buf = $this->dmesg[$i];
+      if (preg_match('/(.*) at pci[0-9] .* "(.*)"/', $buf, $ar_buf)) {
+        $results[$s++] = $ar_buf[1] . ": " . $ar_buf[2];
+      } elseif (preg_match('/"(.*)" (.*).* at [.0-9]+ irq/', $buf, $ar_buf)) {
+        $results[$s++] = $ar_buf[1] . ": " . $ar_buf[2];
+      } 
+    }
+
+    $results = array_unique($results);
+    asort($results);
+    return $results;
+  } 
+
+  function network () {
+    $netstat_b = execute_program('netstat', '-nbdi | cut -c1-25,44- | grep Link | grep -v \'* \'');
+    $netstat_n = execute_program('netstat', '-ndi | cut -c1-25,44- | grep Link | grep -v \'* \'');
+    $lines_b = split("\n", $netstat_b);
+    $lines_n = split("\n", $netstat_n);
+    $results = array();
+    for ($i = 0, $max = sizeof($lines_b); $i < $max; $i++) {
+      $ar_buf_b = preg_split("/\s+/", $lines_b[$i]);
+      $ar_buf_n = preg_split("/\s+/", $lines_n[$i]);
+      if (!empty($ar_buf_b[0]) && !empty($ar_buf_n[3])) {
+        $results[$ar_buf_b[0]] = array();
+
+        $results[$ar_buf_b[0]]['rx_bytes'] = $ar_buf_b[3];
+        $results[$ar_buf_b[0]]['rx_packets'] = $ar_buf_n[3];
+        $results[$ar_buf_b[0]]['rx_errs'] = $ar_buf_n[4];
+        $results[$ar_buf_b[0]]['rx_drop'] = $ar_buf_n[8];
+
+        $results[$ar_buf_b[0]]['tx_bytes'] = $ar_buf_b[4];
+        $results[$ar_buf_b[0]]['tx_packets'] = $ar_buf_n[5];
+        $results[$ar_buf_b[0]]['tx_errs'] = $ar_buf_n[6];
+        $results[$ar_buf_b[0]]['tx_drop'] = $ar_buf_n[8];
+
+        $results[$ar_buf_b[0]]['errs'] = $ar_buf_n[4] + $ar_buf_n[6];
+        $results[$ar_buf_b[0]]['drop'] = $ar_buf_n[8];
+      } 
+    } 
+    return $results;
+  } 
+  // get the ide device information out of dmesg
+  function ide () {
+    $results = array();
+
+    $s = 0;
+    for ($i = 0, $max = count($this->read_dmesg()); $i < $max; $i++) {
+      $buf = $this->dmesg[$i];
+      if (preg_match('/^(.*) at pciide[0-9] (.*): <(.*)>/', $buf, $ar_buf)) {
+        $s = $ar_buf[1];
+        $results[$s]['model'] = $ar_buf[3];
+        $results[$s]['media'] = 'Hard Disk'; 
+        // now loop again and find the capacity
+        for ($j = 0, $max1 = count($this->read_dmesg()); $j < $max1; $j++) {
+          $buf_n = $this->dmesg[$j];
+          if (preg_match("/^($s): (.*), (.*), (.*)MB, .*$/", $buf_n, $ar_buf_n)) {
+            $results[$s]['capacity'] = $ar_buf_n[4] * 2048 * 1.049;;
+          } 
+        } 
+      } 
+    } 
+    asort($results);
+    return $results;
+  } 
+
+  function distroicon () {
+    $result = 'OpenBSD.png';
+    return($result);
+  }
+  
+} 
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/os/class.SunOS.inc.php b/www/include/options/sysInfos/images/includes/os/class.SunOS.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..38c017e606a75c598d26dd1c1aea9b7e63027f6b
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/os/class.SunOS.inc.php
@@ -0,0 +1,247 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.SunOS.inc.php,v 1.15 2005/12/07 05:09:39 bigmichi1 Exp $
+
+echo "<center><b>Note: The SunOS version of phpSysInfo is work in progress, some things currently don't work";
+
+class sysinfo {
+  // Extract kernel values via kstat() interface
+  function kstat ($key) {
+    $m = execute_program('kstat', "-p d $key");
+    list($key, $value) = split("\t", trim($m), 2);
+    return $value;
+  } 
+
+  function vhostname () {
+    if (! ($result = getenv('SERVER_NAME'))) {
+      $result = 'N.A.';
+    } 
+    return $result;
+  } 
+  // get our canonical hostname
+  function chostname () {
+    if ($result = execute_program('uname', '-n')) {
+      $result = gethostbyaddr(gethostbyname($result));
+    } else {
+      $result = 'N.A.';
+    } 
+    return $result;
+  } 
+  // get the IP address of our canonical hostname
+  function ip_addr () {
+    if (!($result = getenv('SERVER_ADDR'))) {
+      $result = gethostbyname($this->chostname());
+    } 
+    return $result;
+  } 
+
+  function kernel () {
+    $os = execute_program('uname', '-s');
+    $version = execute_program('uname', '-r');
+    return $os . ' ' . $version;
+  } 
+
+  function uptime () {
+    $result = time() - $this->kstat('unix:0:system_misc:boot_time');
+
+    return $result;
+  } 
+
+  function users () {
+    $who = split('=', execute_program('who', '-q'));
+    $result = $who[1];
+    return $result;
+  } 
+
+  function loadavg ($bar = false) {
+    $load1 = $this->kstat('unix:0:system_misc:avenrun_1min');
+    $load5 = $this->kstat('unix:0:system_misc:avenrun_5min');
+    $load15 = $this->kstat('unix:0:system_misc:avenrun_15min');
+    $results['avg'] = array($load1, $load5, $load15);
+    return $results;
+  } 
+
+  function cpu_info () {
+    $results = array();
+    $ar_buf = array();
+
+    $results['model'] = execute_program('uname', '-i');
+    $results['cpuspeed'] = $this->kstat('cpu_info:0:cpu_info0:clock_MHz');
+    $results['cache'] = $this->kstat('cpu_info:0:cpu_info0:cpu_type');
+    $results['bogomips'] = 1;
+    $results['cpus'] = $this->kstat('unix:0:system_misc:ncpus');
+
+    $keys = array_keys($results);
+    $keys2be = array('model', 'cpuspeed', 'cache', 'bogomips', 'cpus');
+
+    while ($ar_buf = each($keys2be)) {
+      if (! in_array($ar_buf[1], $keys)) {
+        $results[$ar_buf[1]] = 'N.A.';
+      } 
+    } 
+    return $results;
+  } 
+
+  function pci () {
+    // FIXME
+    $results = array();
+    return $results;
+  } 
+
+  function ide () {
+    // FIXME
+    $results = array();
+    return $results;
+  } 
+
+  function scsi () {
+    // FIXME
+    $results = array();
+    return $results;
+  } 
+
+  function usb () {
+    // FIXME
+    $results = array();
+    return $results;
+  } 
+
+  function sbus () {
+    $results = array();
+    $_results[0] = "";
+    // TODO. Nothing here yet. Move along.
+    $results = $_results;
+    return $results;
+  }
+
+  function network () {
+    $results = array();
+
+    $netstat = execute_program('netstat', '-ni | awk \'(NF ==10){print;}\'');
+    $lines = split("\n", $netstat);
+    $results = array();
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i]);
+      if ((!empty($ar_buf[0])) && ($ar_buf[0] != 'Name')) {
+        $results[$ar_buf[0]] = array();
+
+        $results[$ar_buf[0]]['rx_bytes'] = 0;
+        $results[$ar_buf[0]]['rx_packets'] = $ar_buf[4];
+        $results[$ar_buf[0]]['rx_errs'] = $ar_buf[5];
+        $results[$ar_buf[0]]['rx_drop'] = 0;
+
+        $results[$ar_buf[0]]['tx_bytes'] = 0;
+        $results[$ar_buf[0]]['tx_packets'] = $ar_buf[6];
+        $results[$ar_buf[0]]['tx_errs'] = $ar_buf[7];
+        $results[$ar_buf[0]]['tx_drop'] = 0;
+
+        $results[$ar_buf[0]]['errs'] = $ar_buf[5] + $ar_buf[
+        7];
+        $results[$ar_buf[0]]['drop'] = 0;
+
+        preg_match('/^(\D+)(\d+)$/', $ar_buf[0], $intf);
+        $prefix = $intf[1] . ':' . $intf[2] . ':' . $intf[1] . $intf[2] . ':';
+        $cnt = $this->kstat($prefix . 'drop');
+
+        if ($cnt > 0) {
+          $results[$ar_buf[0]]['rx_drop'] = $cnt;
+        } 
+        $cnt = $this->kstat($prefix . 'obytes64');
+
+        if ($cnt > 0) {
+          $results[$ar_buf[0]]['tx_bytes'] = $cnt;
+        } 
+        $cnt = $this->kstat($prefix . 'rbytes64');
+
+        if ($cnt > 0) {
+          $results[$ar_buf[0]]['rx_bytes'] = $cnt;
+        }
+      } 
+    } 
+    return $results;
+  } 
+
+  function memory () {
+    $results['devswap'] = array();
+
+    $results['ram'] = array();
+
+    $pagesize = $this->kstat('unix:0:seg_cache:slab_size');
+    $results['ram']['total'] = $this->kstat('unix:0:system_pages:pagestotal') * $pagesize;
+    $results['ram']['used'] = $this->kstat('unix:0:system_pages:pageslocked') * $pagesize;
+    $results['ram']['free'] = $this->kstat('unix:0:system_pages:pagesfree') * $pagesize;
+    $results['ram']['shared'] = 0;
+    $results['ram']['buffers'] = 0;
+    $results['ram']['cached'] = 0;
+
+    $results['ram']['t_used'] = $results['ram']['used'] - $results['ram']['cached'] - $results['ram']['buffers'];
+    $results['ram']['t_free'] = $results['ram']['total'] - $results['ram']['t_used'];
+    $results['ram']['percent'] = round(($results['ram']['used'] * 100) / $results['ram']['total']);
+
+    $results['swap'] = array();
+    $results['swap']['total'] = $this->kstat('unix:0:vminfo:swap_avail') / 1024;
+    $results['swap']['used'] = $this->kstat('unix:0:vminfo:swap_alloc') / 1024;
+    $results['swap']['free'] = $this->kstat('unix:0:vminfo:swap_free') / 1024;
+    $results['swap']['percent'] = round(($ar_buf[1] * 100) / $ar_buf[0]);
+    $results['swap']['percent'] = round(($results['swap']['used'] * 100) / $results['swap']['total']);
+    return $results;
+  } 
+
+  function filesystems () {
+    $df = execute_program('df', '-k');
+    $mounts = split("\n", $df);
+
+    $dftypes = execute_program('df', '-n');
+    $mounttypes = split("\n", $dftypes);
+
+    for ($i = 1, $j = 0, $max = sizeof($mounts); $i < $max; $i++) {
+      $ar_buf = preg_split('/\s+/', $mounts[$i], 6);
+      $ty_buf = split(':', $mounttypes[$i-1], 2);
+
+      if (hide_mount($ar_buf[5])) {
+        continue;
+      }
+
+      $results[$j] = array();
+
+      $results[$j]['disk'] = $ar_buf[0];
+      $results[$j]['size'] = $ar_buf[1];
+      $results[$j]['used'] = $ar_buf[2];
+      $results[$j]['free'] = $ar_buf[3];
+      $results[$j]['percent'] = round(($results[$j]['used'] * 100) / $results[$j]['size']) . '%';
+      $results[$j]['mount'] = $ar_buf[5];
+      $results[$j]['fstype'] = $ty_buf[1];
+      $j++;
+    } 
+    return $results;
+  } 
+  
+  function distro () {
+    $result = 'SunOS';  	
+    return($result);
+  }
+
+  function distroicon () {
+    $result = 'unknown.png';
+    return($result);
+  }
+} 
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/os/class.WINNT.inc.php b/www/include/options/sysInfos/images/includes/os/class.WINNT.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..dd652469aa287888434d8aa4e7e8acaf53c6dc77
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/os/class.WINNT.inc.php
@@ -0,0 +1,291 @@
+<?php 
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+// WINNT implementation written by Carl C. Longnecker, longneck@iname.com
+// $Id: class.WINNT.inc.php,v 1.13 2005/12/07 15:47:03 bigmichi1 Exp $
+class sysinfo {
+  // winnt needs some special prep
+  // $wmi holds the COM object that we pull all the WMI data from
+  var $wmi; 
+  // this constructor initialis the $wmi object
+  function sysinfo ()
+  {
+    $this->wmi = new COM("WinMgmts:\\\\.");
+  } 
+
+  // get our canonical hostname
+  function chostname ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_ComputerSystem");
+    foreach ($objInstance as $obj) {
+        $result = $obj->DNSHostName;
+    }
+    return $result;
+  }
+
+  // get the IP address of our canonical hostname
+  function ip_addr ()
+  {
+    if (!($result = gethostbyname($this->chostname()))) {
+      $result = 'N.A.';
+    }
+    return $result;
+  }
+
+  function kernel ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_OperatingSystem");
+    foreach ($objInstance as $obj) {
+      $result = $obj->Version;
+      if ($obj->ServicePackMajorVersion > 0) {
+        $result .= ' SP' . $obj->ServicePackMajorVersion;
+      } 
+    } 
+    return $result;
+  } 
+
+  function uptime ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_OperatingSystem");
+    foreach ($objInstance as $obj) {
+      $result = 0;
+
+      $year = intval(substr($obj->LastBootUpTime, 0, 4));
+      $month = intval(substr($obj->LastBootUpTime, 4, 2));
+      $day = intval(substr($obj->LastBootUpTime, 6, 2));
+      $hour = intval(substr($obj->LastBootUpTime, 8, 2));
+      $minute = intval(substr($obj->LastBootUpTime, 10, 2));
+      $seconds = intval(substr($obj->LastBootUpTime, 12, 2));
+
+      $boottime = mktime($hour, $minute, $seconds, $month, $day, $year);
+
+      $diff_seconds = mktime() - $boottime;
+
+      $result = $diff_seconds;
+    } 
+    return $result;
+  } 
+
+  function users ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_PerfRawData_TermService_TerminalServices");
+    foreach ($objInstance as $obj) {
+      return $obj->TotalSessions;
+    } 
+  } 
+
+  function loadavg ($bar = false)
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_Processor");
+
+    $cpuload = array();
+    foreach ($objInstance as $obj) {
+      $cpuload['avg'][] = $obj->LoadPercentage;
+    }
+    if ($bar) {
+      $cpuload['cpupercent'] = array_sum($cpuload['avg']);
+    } 
+    // while
+    return $cpuload;
+  } 
+
+  function cpu_info ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_Processor");
+    $results['cpus'] = 0;
+    foreach ($objInstance as $obj) {
+      // still need bogomips (wtf are bogomips?)
+      $results['cpus']++;
+      $results['model'] = $obj->Name;
+      $results['cache'] = $obj->L2CacheSize;
+      $results['cpuspeed'] = $obj->CurrentClockSpeed;
+      $results['busspeed'] = $obj->ExtClock;
+    } 
+    return $results;
+  } 
+
+  function pci ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_PnPEntity");
+
+    $pci = array();
+    foreach ($objInstance as $obj) {
+      if (substr($obj->PNPDeviceID, 0, 4) == "PCI\\") {
+        $pci[] = $obj->Name;
+      } 
+    } // while
+    return $pci;
+  } 
+
+  function ide ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_PnPEntity");
+
+    $ide = array();
+    foreach ($objInstance as $obj) {
+      if (substr($obj->PNPDeviceID, 0, 4) == "IDE\\") {
+        $ide[]['model'] = $obj->Name;
+      } 
+    } // while
+    return $ide;
+  } 
+
+  function scsi ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_PnPEntity");
+
+    $scsi = array();
+    foreach ($objInstance as $obj) {
+      if (substr($obj->PNPDeviceID, 0, 5) == "SCSI\\") {
+        $scsi[] = $obj->Name;
+      } 
+    } // while
+    return $scsi;
+  } 
+
+  function usb ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_PnPEntity");
+
+    $usb = array();
+    foreach ($objInstance as $obj) {
+      if (substr($obj->PNPDeviceID, 0, 4) == "USB\\") {
+        $usb[] = $obj->Name;
+      } 
+    } // while
+    return $usb;
+  } 
+
+  function sbus ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_PnPEntity");
+
+    $sbus = array();
+    foreach ($objInstance as $obj) {
+      if (substr($obj->PNPDeviceID, 0, 5) == "SBUS\\") {
+        $sbus[] = $obj->Name;
+      } 
+    } // while
+    return $sbus;
+  } 
+
+  function network ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_PerfRawData_Tcpip_NetworkInterface");
+
+    $results = array();
+    foreach ($objInstance as $obj) {
+      $dev_name = $obj->Name;
+      // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_perfrawdata_tcpip_networkinterface.asp
+      $results[$dev_name]['rx_bytes'] = $obj->BytesReceivedPersec;
+      $results[$dev_name]['rx_packets'] = $obj->PacketsReceivedPersec;
+      $results[$dev_name]['rx_errs'] = $obj->PacketsReceivedErrors;
+      $results[$dev_name]['rx_drop'] = $obj->PacketsReceivedDiscarded;
+
+      $results[$dev_name]['tx_bytes'] = $obj->BytesSentPersec;
+      $results[$dev_name]['tx_packets'] = $obj->PacketsSentPersec;
+
+      $results[$dev_name]['errs'] = $obj->PacketsReceivedErrors;
+      $results[$dev_name]['drop'] = $obj->PacketsReceivedDiscarded;
+    }
+    return $results;
+  } 
+
+  function memory ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_LogicalMemoryConfiguration");
+    foreach ($objInstance as $obj) {
+      $results['ram']['total'] = $obj->TotalPhysicalMemory;
+    } 
+    $objInstance = $this->wmi->InstancesOf("Win32_PerfRawData_PerfOS_Memory");
+    foreach ($objInstance as $obj) {
+      $results['ram']['free'] = $obj->AvailableKBytes;
+    } 
+    $results['ram']['used'] = $results['ram']['total'] - $results['ram']['free'];
+    $results['ram']['t_used'] = $results['ram']['used'];
+    $results['ram']['t_free'] = $results['ram']['total'] - $results['ram']['t_used'];
+    $results['ram']['percent'] = round(($results['ram']['t_used'] * 100) / $results['ram']['total']);
+
+    $results['swap']['total'] = 0;
+    $results['swap']['used'] = 0;
+    $results['swap']['free'] = 0;
+
+    $objInstance = $this->wmi->InstancesOf("Win32_PageFileUsage");
+
+    $k = 0;
+    foreach ($objInstance as $obj) {
+      $results['devswap'][$k]['dev'] = $obj->Name;
+      $results['devswap'][$k]['total'] = $obj->AllocatedBaseSize * 1024;
+      $results['devswap'][$k]['used'] = $obj->CurrentUsage * 1024;
+      $results['devswap'][$k]['free'] = ($obj->AllocatedBaseSize - $obj->CurrentUsage) * 1024;
+      $results['devswap'][$k]['percent'] = $obj->CurrentUsage / $obj->AllocatedBaseSize;
+
+      $results['swap']['total'] += $results['devswap'][$k]['total'];
+      $results['swap']['used'] += $results['devswap'][$k]['used'];
+      $results['swap']['free'] += $results['devswap'][$k]['free'];
+      $k += 1;
+    } 
+
+    $results['swap']['percent'] = round($results['swap']['used'] / $results['swap']['total'] * 100);
+
+    return $results;
+  } 
+
+  function filesystems ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_LogicalDisk");
+
+    $k = 0;
+    foreach ($objInstance as $obj) {
+      if (hide_mount($obj->Name)){
+        continue;
+      }
+      $results[$k]['mount'] = $obj->Name;
+      $results[$k]['size'] = $obj->Size / 1024;
+      $results[$k]['used'] = ($obj->Size - $obj->FreeSpace) / 1024;
+      $results[$k]['free'] = $obj->FreeSpace / 1024;
+      $results[$k]['percent'] = round($results[$k]['used'] / $results[$k]['size'] * 100);
+      $results[$k]['fstype'] = $obj->FileSystem;
+
+      $typearray = array("Unknown", "No Root Directory", "Removeable Disk",
+        "Local Disk", "Network Drive", "Compact Disc", "RAM Disk");
+      $floppyarray = array("Unknown", "5 1/4 in.", "3 1/2 in.", "3 1/2 in.",
+        "3 1/2 in.", "3 1/2 in.", "5 1/4 in.", "5 1/4 in.", "5 1/4 in.",
+        "5 1/4 in.", "5 1/4 in.", "Other", "HD", "3 1/2 in.", "3 1/2 in.",
+        "5 1/4 in.", "5 1/4 in.", "3 1/2 in.", "3 1/2 in.", "5 1/4 in.",
+        "3 1/2 in.", "3 1/2 in.", "8 in.");
+
+      $results[$k]['disk'] = $typearray[$obj->DriveType];
+      if ($obj->DriveType == 2) $results[$k]['disk'] .= " (" . $floppyarray[$obj->MediaType] . ")";
+      $k += 1;
+    } 
+
+    return $results;
+  } 
+
+  function distro ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_OperatingSystem");
+    foreach ($objInstance as $obj) {
+      return $obj->Caption;
+    } 
+  } 
+
+  function distroicon ()
+  {
+    return 'xp.gif';
+  } 
+} 
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/system_footer.php b/www/include/options/sysInfos/images/includes/system_footer.php
new file mode 100644
index 0000000000000000000000000000000000000000..fbc997d7ade2114e73f6a6a8d7d87e9651bb1991
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/system_footer.php
@@ -0,0 +1,103 @@
+<?php 
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: system_footer.php,v 1.44 2005/12/10 12:30:19 bigmichi1 Exp $
+//
+if (!defined('IN_PHPSYSINFO')) {
+    die("No Hacking");
+}
+
+if (!$hide_picklist) {
+  echo "<center>";
+}
+  /*
+  $update_form = "<form method=\"POST\" action=\"" . $_SERVER['PHP_SELF'] . "\">\n" . "\t" . $text['template'] . ":&nbsp;\n" . "\t<select name=\"template\">\n";
+
+  $dir = opendir(APP_ROOT . '/templates/');
+  while (false !== ($file = readdir($dir))) {
+    if ($file != 'CVS' && $file[0] != '.' && is_dir(APP_ROOT . '/templates/' . $file)) {
+      $filelist[] = $file;
+    } 
+  } 
+  closedir($dir);
+
+  asort($filelist);
+
+  while (list ($key, $val) = each ($filelist)) {
+    if ($_COOKIE['template'] == $val) {
+      $update_form .= "\t\t<option value=\"$val\" SELECTED>$val</option>\n";
+    } else {
+      $update_form .= "\t\t<option value=\"$val\">$val</option>\n";
+    } 
+  } 
+
+  $update_form .= "\t\t<option value=\"xml\">XML</option>\n";
+  // auto select the random template, if we're set to random
+  $update_form .= "\t\t<option value=\"random\"";
+  if ($_COOKIE['template']=='random') {
+    $update_form .= " SELECTED";
+  } 
+  $update_form .= ">random</option>\n";
+
+  $update_form .= "\t</select>\n";
+
+  $update_form .= "\t&nbsp;&nbsp;" . $text['language'] . ":&nbsp;\n" . "\t<select name=\"lng\">\n";
+
+  unset($filelist);
+
+  $dir = opendir(APP_ROOT . '/includes/lang/');
+  while (false !== ($file = readdir($dir))) {
+    if ($file[0] != '.' && is_file(APP_ROOT . '/includes/lang/' . $file) && eregi("\.php$", $file)) {
+      $filelist[] = eregi_replace('.php', '', $file);
+    } 
+  } 
+  closedir($dir);
+
+  asort($filelist);
+
+  while (list ($key, $val) = each ($filelist)) {
+    if ($_COOKIE['lng'] == $val) {
+      $update_form .= "\t\t<option value=\"$val\" SELECTED>$val</option>\n";
+    } else {
+      $update_form .= "\t\t<option value=\"$val\">$val</option>\n";
+    } 
+  } 
+	
+	$update_form .= "\t\t<option value=\"browser\"";
+  if ($_COOKIE['lng']=='browser') {
+    $update_form .= " SELECTED";
+  } 
+  $update_form .= ">browser default</option>\n";
+	
+  $update_form .= "\t</select>\n" . "\t<input type=\"submit\" value=\"" . $text['submit'] . "\">\n" . "</form>\n";
+
+  echo $update_form;
+
+  echo "\n\n</center>";
+} else {
+  echo "\n\n<br>";
+} 
+
+echo "\n<hr>\n" . $text['created'];
+  */
+echo '&nbsp;<a href="http://phpsysinfo.sourceforge.net" target="_blank">phpSysInfo-' . $VERSION . '</a> ' . strftime ($text['gen_time'], time());
+
+echo "\n<br>\n</body>\n</html>\n";
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/system_header.php b/www/include/options/sysInfos/images/includes/system_header.php
new file mode 100644
index 0000000000000000000000000000000000000000..ce3b620c64d665c44e1f4f2506bd279e5b516a6a
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/system_header.php
@@ -0,0 +1,64 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: system_header.php,v 1.27 2005/12/10 15:54:41 bigmichi1 Exp $
+
+
+if (!defined('IN_PHPSYSINFO')) {
+    die("No Hacking");
+}
+
+header("Cache-Control: no-cache, must-revalidate");
+if (!isset($charset)) {
+  $charset = 'iso-8859-1';
+} 
+
+setlocale (LC_ALL, $text['locale']);
+
+header('Content-Type: text/html; charset=' . $charset);
+
+global $XPath;
+
+
+echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
+echo "<html>\n";
+echo created_by();
+echo "<head>\n";
+echo "  <title>" . $text['title'], " -- ", $XPath->getData('/phpsysinfo/Vitals/Hostname'), " --</title>\n";
+
+if (isset($charset) && $charset == 'euc-jp') {
+    echo "  <meta http-equiv=\"content-type\" content=\"text/html;charset=$charset\">\n";
+}
+if (isset($refresh) && ($refresh = intval($refresh))) {
+  echo "  <meta http-equiv=\"Refresh\" content=\"$refresh\">\n";
+}
+
+if (file_exists(APP_ROOT . "/templates/$template/$template.css")) {
+  echo "  <link rel=\"stylesheet\" type=\"text/css\" href=\"" . $webpath . "templates/" . $template . "/" . $template . ".css\">\n";
+}
+
+echo "</head>\n";
+
+if (file_exists(APP_ROOT . "/templates/$template/images/$template" . "_background.gif")) {
+  echo "<body background=\"" . $webpath . "templates/" . $template . "/images/" . $template . "_background.gif\">";
+} else {
+  echo "<body>\n";
+}
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/xml/filesystems.php b/www/include/options/sysInfos/images/includes/xml/filesystems.php
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/includes/xml/hardware.php b/www/include/options/sysInfos/images/includes/xml/hardware.php
new file mode 100644
index 0000000000000000000000000000000000000000..4436aa3335add5906b5910428f0902ccbc75b104
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/xml/hardware.php
@@ -0,0 +1,252 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: hardware.php,v 1.28 2005/12/10 15:54:56 bigmichi1 Exp $
+
+function xml_hardware (&$hddtemp_devices)
+{
+    global $sysinfo;
+    global $text;
+    $pci_devices = ""; $ide_devices = ""; $usb_devices = ""; $scsi_devices = "";    
+
+    $sys = $sysinfo->cpu_info();
+
+    $ar_buf = $sysinfo->pci();
+
+    if (count($ar_buf)) {
+        for ($i = 0, $max = sizeof($ar_buf); $i < $max; $i++) {
+            if ($ar_buf[$i]) {
+                $pci_devices .= "      <Device><Name>" . htmlspecialchars(chop($ar_buf[$i]), ENT_QUOTES) . "</Name></Device>\n";
+            } 
+        } 
+    } 
+
+    $ar_buf = $sysinfo->ide();
+
+    ksort($ar_buf);
+
+    if (count($ar_buf)) {
+        while (list($key, $value) = each($ar_buf)) {
+            $ide_devices .= "      <Device>\n<Name>" . htmlspecialchars($key . ': ' . $ar_buf[$key]['model'], ENT_QUOTES) . "</Name>\n";
+            if (isset($ar_buf[$key]['capacity'])) {
+                $ide_devices .= '<Capacity>' . htmlspecialchars($ar_buf[$key]['capacity'], ENT_QUOTES) . '</Capacity>';
+            }
+	    $hddtemp_devices[] = $key;
+	    $ide_devices .= "</Device>\n";
+        } 
+    } 
+
+    $ar_buf = $sysinfo->scsi();
+    ksort($ar_buf);
+
+    if (count($ar_buf)) {
+        while (list($key, $value) = each($ar_buf)) {
+	    $scsi_devices .= "<Device>\n";
+            if ($key >= '0' && $key <= '9') {
+                $scsi_devices .= "      <Name>" . htmlspecialchars($ar_buf[$key]['model'], ENT_QUOTES) . "</Name>\n";
+            } else {
+                $scsi_devices .= "      <Name>" . htmlspecialchars($key . ': ' . $ar_buf[$key]['model'], ENT_QUOTES) . "</Name>\n";
+            } 
+            if (isset($ar_buf[$key]['capacity'])) {
+                $scsi_devices .= '<Capacity>' . htmlspecialchars($ar_buf[$key]['capacity'], ENT_QUOTES) . '</Capacity>';
+            } 
+            $scsi_devices .= "</Device>\n";
+        } 
+    } 
+
+    $ar_buf = $sysinfo->usb();
+
+    if (count($ar_buf)) {
+        for ($i = 0, $max = sizeof($ar_buf); $i < $max; $i++) {
+            if ($ar_buf[$i]) {
+                $usb_devices .= "      <Device><Name>" . htmlspecialchars(chop($ar_buf[$i]), ENT_QUOTES) . "</Name></Device>\n";
+            } 
+        } 
+    } 
+
+/* disabled since we output this information
+    $ar_buf = $sysinfo->sbus();
+    if (count($ar_buf)) {
+        for ($i = 0, $max = sizeof($ar_buf); $i < $max; $i++) {
+            if ($ar_buf[$i]) {
+                $sbus_devices .= "      <Device>" . htmlspecialchars(chop($ar_buf[$i]), ENT_QUOTES) . "</Device>\n";
+            } 
+        } 
+    } 
+*/
+    $_text = "  <Hardware>\n";
+    $_text .= "    <CPU>\n";
+    if (isset($sys['cpus'])) {
+        $_text .= "      <Number>" . htmlspecialchars($sys['cpus'], ENT_QUOTES) . "</Number>\n";
+    } 
+    if (isset($sys['model'])) {
+        $_text .= "      <Model>" . htmlspecialchars($sys['model'], ENT_QUOTES) . "</Model>\n";
+    } 
+    if (isset($sys['cpuspeed'])) {
+        $_text .= "      <Cpuspeed>" . htmlspecialchars($sys['cpuspeed'], ENT_QUOTES) . "</Cpuspeed>\n";
+    } 
+    if (isset($sys['busspeed'])) {
+        $_text .= "      <Busspeed>" . htmlspecialchars($sys['busspeed'], ENT_QUOTES) . "</Busspeed>\n";
+    } 
+    if (isset($sys['cache'])) {
+        $_text .= "      <Cache>" . htmlspecialchars($sys['cache'], ENT_QUOTES) . "</Cache>\n";
+    } 
+    if (isset($sys['bogomips'])) {
+        $_text .= "      <Bogomips>" . htmlspecialchars($sys['bogomips'], ENT_QUOTES) . "</Bogomips>\n";
+    } 
+    $_text .= "    </CPU>\n";
+
+    $_text .= "    <PCI>\n";
+    if ($pci_devices) {
+        $_text .= $pci_devices;
+    } 
+    $_text .= "    </PCI>\n";
+
+    $_text .= "    <IDE>\n";
+    if ($ide_devices) {
+        $_text .= $ide_devices;
+    } 
+    $_text .= "    </IDE>\n";
+
+    $_text .= "    <SCSI>\n";
+    if ($scsi_devices) {
+        $_text .= $scsi_devices;
+    } 
+    $_text .= "    </SCSI>\n";
+
+    $_text .= "    <USB>\n";
+    if ($usb_devices) {
+        $_text .= $usb_devices;
+    } 
+    $_text .= "    </USB>\n";
+
+/*
+    $_text .= "    <SBUS>\n";
+    if ($sbus_devices) {
+        $_text .= $sbus_devices;
+    } 
+    $_text .= "    </SBUS>\n";
+*/
+
+    $_text .= "  </Hardware>\n";
+
+    return $_text;
+} 
+
+function html_hardware ()
+{
+    global $XPath;
+    global $text;
+    $pci_devices = ""; $ide_devices = ""; $usb_devices = ""; $scsi_devices = "";
+    $textdir = direction();
+
+    for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/PCI')); $i < $max; $i++) {
+        if ($XPath->match("/phpsysinfo/Hardware/PCI/Device[$i]/Name")) {
+            $pci_devices .= $XPath->getData("/phpsysinfo/Hardware/PCI/Device[$i]/Name") . '<br>';
+        } 
+    } 
+
+    for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/IDE')); $i < $max; $i++) {
+        if ($XPath->match("/phpsysinfo/Hardware/IDE/Device[$i]")) {
+            $ide_devices .= $XPath->getData("/phpsysinfo/Hardware/IDE/Device[$i]/Name");
+	    if ($XPath->match("/phpsysinfo/Hardware/IDE/Device[$i]/Capacity")) {
+		$ide_devices .= " (" . $text['capacity'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Hardware/IDE/Device[$i]/Capacity") / 2) . ")";
+	    }
+	    $ide_devices .= '<br>';
+        } 
+    } 
+
+    for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/SCSI')); $i < $max; $i++) {
+        if ($XPath->match("/phpsysinfo/Hardware/SCSI/Device[$i]")) {
+            $scsi_devices .= $XPath->getData("/phpsysinfo/Hardware/SCSI/Device[$i]/Name");
+	    if ($XPath->match("/phpsysinfo/Hardware/SCSI/Device[$i]/Capacity")) {
+		$scsi_devices .= " (" . $text['capacity'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Hardware/SCSI/Device[$i]/Capacity") / 2) . ")";
+	    }
+	    $scsi_devices .= '<br>';
+        } 
+    } 
+
+    for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/USB')); $i < $max; $i++) {
+        if ($XPath->match("/phpsysinfo/Hardware/USB/Device[$i]/Name")) {
+            $usb_devices .= $XPath->getData("/phpsysinfo/Hardware/USB/Device[$i]/Name") . '<br>';
+        } 
+    } 
+
+    $_text = "<table border=\"0\" width=\"100%\" align=\"center\">\n";
+
+    if ($XPath->match("/phpsysinfo/Hardware/CPU/Number")) {
+        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['numcpu'] . "</font></td>\n    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Number") . "</font></td>\n  </tr>\n";
+    } 
+    if ($XPath->match("/phpsysinfo/Hardware/CPU/Model")) {
+        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['cpumodel'] . "</font></td>\n    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Model") . "</font></td>\n  </tr>\n";
+    } 
+
+    if ($XPath->match("/phpsysinfo/Hardware/CPU/Cpuspeed")) {
+        $tmp_speed = $XPath->getData("/phpsysinfo/Hardware/CPU/Cpuspeed");
+        if ($tmp_speed < 1000) {
+            $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['cpuspeed'] . "</font></td>\n    <td><font size=\"-1\">" . $tmp_speed . " MHz</font></td>\n  </tr>\n";
+        } else {
+            $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['cpuspeed'] . "</font></td>\n    <td><font size=\"-1\">" . round($tmp_speed / 1000, 2) . " GHz</font></td>\n  </tr>\n";
+        } 
+    } 
+    if ($XPath->match("/phpsysinfo/Hardware/CPU/Busspeed")) {
+        $tmp_speed = $XPath->getData("/phpsysinfo/Hardware/CPU/Busspeed");
+        if ($tmp_speed < 1000) {
+            $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['busspeed'] . "</font></td>\n    <td><font size=\"-1\">" . $tmp_speed . " MHz</font></td>\n  </tr>\n";
+        } else {
+            $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['busspeed'] . "</font></td>\n    <td><font size=\"-1\">" . round($tmp_speed / 1000, 2) . " GHz</font></td>\n  </tr>\n";
+        } 
+    } 
+    if ($XPath->match("/phpsysinfo/Hardware/CPU/Cache")) {
+        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['cache'] . "</font></td>\n    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Cache") . "</font></td>\n  </tr>\n";
+    } 
+    if ($XPath->match("/phpsysinfo/Hardware/CPU/Bogomips")) {
+        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['bogomips'] . "</font></td>\n    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Bogomips") . "</font></td>\n  </tr>\n";
+    } 
+
+    $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['pci'] . "</font></td>\n    <td><font size=\"-1\">";
+    if ($pci_devices) {
+        $_text .= $pci_devices;
+    } else {
+        $_text .= "<i>" . $text['none'] . "</i>";
+    } 
+    $_text .= "</font></td>\n  </tr>\n";
+
+    $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['ide'] . "</font></td>\n    <td><font size=\"-1\">";
+    if ($ide_devices) {
+        $_text .= $ide_devices;
+    } else {
+        $_text .= "<i>" . $text['none'] . "</i>";
+    } 
+    $_text .= "</font></td>\n  </tr>\n";
+
+    if ($scsi_devices) {
+        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['scsi'] . "</font></td>\n    <td><font size=\"-1\">" . $scsi_devices . "</font></td>\n  </tr>";
+    } 
+
+    if ($usb_devices) {
+        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['usb'] . "</font></td>\n    <td><font size=\"-1\">" . $usb_devices . "</font></td>\n  </tr>";
+    } 
+
+    $_text .= "</table>";
+
+    return $_text;
+} 
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/xml/hddtemp.php b/www/include/options/sysInfos/images/includes/xml/hddtemp.php
new file mode 100644
index 0000000000000000000000000000000000000000..61d6ba51b924d4880db366576fb82a8c59a8c5b9
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/xml/hddtemp.php
@@ -0,0 +1,73 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: hddtemp.php,v 1.7 2005/12/10 15:54:56 bigmichi1 Exp $
+
+function xml_hddtemp($hddtemp) {
+  global $hddtemp_avail;
+  $data = $hddtemp->temperature($hddtemp_avail);
+
+  $_text = "  <HDDTemp>\n";
+    if (sizeof($data) > 0) {
+      for ($i=0, $max = sizeof($data); $i < $max; $i++) {
+        $_text .= "     <Item>\n";
+        $_text .= "        <Label>" . htmlspecialchars($data[$i]['label'], ENT_QUOTES) . "</Label>\n";
+        $_text .= "        <Value>" . htmlspecialchars($data[$i]['value'], ENT_QUOTES) . "</Value>\n";
+        $_text .= "        <Model>" . htmlspecialchars($data[$i]['model'], ENT_QUOTES) . "</Model>\n";
+        $_text .= "     </Item>\n";
+      }
+    }
+    $_text .= "  </HDDTemp>\n";
+    
+    return $_text;
+}
+
+function html_hddtemp() {
+  global $XPath;
+  global $text;
+  global $sensor_program;
+
+  $textdir = direction();  
+  $scale_factor = 2;
+  $_text = "";
+  $maxvalue = "+60";
+
+  if ($XPath->match("/phpsysinfo/HDDTemp")) {
+    for ($i=1, $max = sizeof($XPath->getDataParts('/phpsysinfo/HDDTemp')); $i < $max; $i++) {
+      if( $XPath->getData("/phpsysinfo/HDDTemp/Item[$i]/Value") != 0) {
+        $_text .= "  <tr>\n";
+        $_text .= "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">". $XPath->getData("/phpsysinfo/HDDTemp/Item[$i]/Model") . "</font></td>\n";
+        $_text .= "    <td align=\"" . $textdir['left'] . "\" valign=\"top\" nowrap><font size=\"-1\">";
+        $_text .= create_bargraph($XPath->getData("/phpsysinfo/HDDTemp/Item[$i]/Value"), $maxvalue, $scale_factor);
+        $_text .= "&nbsp;" . round($XPath->getData("/phpsysinfo/HDDTemp/Item[$i]/Value")) . " " . $text['degree_mark'] . "</font></td>\n";
+        $_text .= "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">". $maxvalue . " " . $text['degree_mark'] . "</font></td></tr>\n";
+      }
+    }
+  };
+  if (strlen($_text) > 0 && empty($sensor_program)) {
+    $_text = "  <tr>\n"
+           . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['s_label'] . "</b></font></td>\n"
+	   . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['s_value'] . "</b></font></td>\n"
+	   . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['s_limit'] . "</b></font></td>\n"
+	   . "  </tr>" . $_text;
+  }
+  return $_text;
+};
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/xml/index.html b/www/include/options/sysInfos/images/includes/xml/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/includes/xml/mbinfo.php b/www/include/options/sysInfos/images/includes/xml/mbinfo.php
new file mode 100644
index 0000000000000000000000000000000000000000..b5309d825a65ff6c946aa84b228bb43825c394d8
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/xml/mbinfo.php
@@ -0,0 +1,190 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  
+//   
+// $Id: mbinfo.php,v 1.13 2005/12/10 15:54:56 bigmichi1 Exp $
+
+function xml_mbtemp() {
+    global $text;
+    global $mbinfo;
+
+    $_text = "";
+    $data = $mbinfo->temperature();
+
+    $_text = "  <MBinfo>\n";
+    if (sizeof($data) > 0) {
+    $_text .= "    <Temperature>\n";
+    for ($i=0, $max = sizeof($data); $i < $max; $i++) {
+        $_text .= "       <Item>\n";
+        $_text .= "      <Label>" . htmlspecialchars($data[$i]['label'], ENT_QUOTES) . "</Label>\n";
+        $_text .= "      <Value>" . htmlspecialchars($data[$i]['value'], ENT_QUOTES) . "</Value>\n";
+        $_text .= "      <Limit>" . htmlspecialchars($data[$i]['limit'], ENT_QUOTES) . "</Limit>\n";
+        $_text .= "       </Item>\n";
+    }
+    $_text .= "    </Temperature>\n";
+    }
+
+    return $_text;  
+};
+
+function xml_mbfans() {
+    global $text;
+    global $mbinfo;
+
+    $_text = "";
+    $data = $mbinfo->fans();
+    if (sizeof($data) > 0) {
+        $_text = "    <Fans>\n";
+        for ($i=0, $max = sizeof($data); $i < $max; $i++) {
+            $_text .= "       <Item>\n";
+            $_text .= "      <Label>" . htmlspecialchars($data[$i]['label'], ENT_QUOTES) . "</Label>\n";
+            $_text .= "      <Value>" . htmlspecialchars($data[$i]['value'], ENT_QUOTES) . "</Value>\n";
+            $_text .= "      <Min>" . htmlspecialchars($data[$i]['min'], ENT_QUOTES) . "</Min>\n";
+            $_text .= "      <Div>" . htmlspecialchars($data[$i]['div'], ENT_QUOTES) . "</Div>\n";
+            $_text .= "       </Item>\n";
+        }
+        $_text .= "    </Fans>\n";
+    }
+
+    return $_text;  
+};
+
+function xml_mbvoltage() {
+    global $text;
+    global $mbinfo;
+
+    $_text = "";
+    $data = $mbinfo->voltage();
+    if (sizeof($data) > 0) {
+        $_text = "    <Voltage>\n";
+        for ($i=0, $max = sizeof($data); $i < $max; $i++) {
+            $_text .= "       <Item>\n";
+            $_text .= "      <Label>" . htmlspecialchars($data[$i]['label'], ENT_QUOTES) . "</Label>\n";
+            $_text .= "      <Value>" . htmlspecialchars($data[$i]['value'], ENT_QUOTES) . "</Value>\n";
+            $_text .= "      <Min>" . htmlspecialchars($data[$i]['min'], ENT_QUOTES) . "</Min>\n";
+            $_text .= "      <Max>" . htmlspecialchars($data[$i]['max'], ENT_QUOTES) . "</Max>\n";
+            $_text .= "       </Item>\n";
+        }
+        $_text .= "    </Voltage>\n";
+    }
+    $_text .= "  </MBinfo>\n";
+
+    return $_text;  
+};
+
+
+function html_mbtemp() {
+  global $text;
+  global $mbinfo;
+
+  $textdir = direction();
+  $data = array();
+  $scale_factor = 2;
+
+  $_text = "  <tr>\n"
+         . "    <td><font size=\"-1\"><b>" . $text['s_label'] . "</b></font></td>\n"
+	 . "    <td><font size=\"-1\"><b>" . $text['s_value'] . "</b></font></td>\n"
+	 . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['s_limit'] . "</b></font></td>\n"
+	 . "  </tr>\n";
+
+  $data = $mbinfo->temperature();
+  for ($i=0, $max = sizeof($data); $i < $max; $i++) {
+     $_text .= "  <tr>\n"
+             . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">". $data[$i]['label'] . "</font></td>\n"
+	     . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">";
+     if ($data[$i]['value'] == 0) {
+       $_text .= "Unknown - Not connected?";
+     } else {
+       $_text .= create_bargraph($data[$i]['value'], $data[$i]['limit'], $scale_factor);
+     }
+     $_text .= "&nbsp;" . round($data[$i]['value']) . "&nbsp;" . $text['degree_mark'] . "</font></td>\n"
+             . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">". $data[$i]['limit'] . "&nbsp;" . $text['degree_mark'] . "</font></td>\n"
+	     . "  </tr>\n";
+  };
+
+  return $_text;  
+};
+
+
+function html_mbfans() {
+  global $text;
+  global $mbinfo;
+  $textdir = direction();
+
+  $_text ="<table width=\"100%\">\n";
+
+  $_text .= "  <tr>\n"
+	  . "    <td><font size=\"-1\"><b>" . $text['s_label'] . "</b></font></td>\n"
+          . "    <td align=\"" . $textdir['right'] . "\"><font size=\"-1\"><b>" . $text['s_value'] . "</b></font></td>\n"
+	  . "    <td align=\"" . $textdir['right'] . "\"><font size=\"-1\"><b>" . $text['s_min'] . "</b></font></td>\n"
+	  . "    <td align=\"" . $textdir['right'] . "\"><font size=\"-1\"><b>" . $text['s_div'] . "</b></font></td>\n"
+	  . "  </tr>\n";
+
+  $data = $mbinfo->fans();
+  $show_fans = false;
+
+  for ($i=0, $max = sizeof($data); $i < $max; $i++) {
+      $_text .= "  <tr>\n"
+              . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">". $data[$i]['label'] . "</font></td>\n"
+              . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">". round($data[$i]['value']) . " " . $text['rpm_mark'] . "</font></td>\n"
+              . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">". $data[$i]['min'] . " " . $text['rpm_mark'] . "</font></td>\n"
+              . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . $data[$i]['div'] . "</font></td>\n"
+              . "  </tr>\n";
+      if (round($data[$i]['value']) > 0) { 
+          $show_fans = true;
+      }
+  };
+  $_text .= "</table>\n";
+
+  if (!$show_fans) {
+      $_text = "";
+  }
+
+  return $_text;  
+};
+
+
+function html_mbvoltage() {
+  global $text;
+  global $mbinfo;
+  $textdir = direction();
+
+  $_text = "<table width=\"100%\">\n";
+
+  $_text .= "  <tr>\n"
+          . "    <td><font size=\"-1\"><b>" . $text['s_label'] . "</b></font></td>\n"
+	  . "    <td align=\"" . $textdir['right'] . "\"><font size=\"-1\"><b>" . $text['s_value'] . "</b></font></td>\n"
+	  . "    <td align=\"" . $textdir['right'] . "\"><font size=\"-1\"><b>" . $text['s_min'] . "</b></font></td>\n"
+	  . "    <td align=\"" . $textdir['right'] . "\"><font size=\"-1\"><b>" . $text['s_max'] . "</b></font></td>\n"
+	  . "  </tr>\n";
+
+    $data = $mbinfo->voltage();
+    for ($i=0, $max = sizeof($data); $i < $max; $i++) {
+            $_text .= "  <tr>\n"
+                    . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">". $data[$i]['label'] . "</font></td>\n"
+                    . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">". $data[$i]['value'] . " " . $text['voltage_mark'] . "</font></td>\n"
+                    . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">". $data[$i]['min'] . " " . $text['voltage_mark'] . "</font></td>\n"
+                    . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . $data[$i]['max'] . " " . $text['voltage_mark'] . "</font></td>\n"
+		    . "  </tr>\n";
+    };
+
+  $_text .= "</table>\n";
+
+  return $_text;  
+};
+?>
diff --git a/www/include/options/sysInfos/images/includes/xml/memory.php b/www/include/options/sysInfos/images/includes/xml/memory.php
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/includes/xml/network.php b/www/include/options/sysInfos/images/includes/xml/network.php
new file mode 100644
index 0000000000000000000000000000000000000000..375e385ec0e05e09db66e28b7ef152b4de410847
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/xml/network.php
@@ -0,0 +1,76 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: network.php,v 1.12 2005/12/10 15:54:56 bigmichi1 Exp $
+
+//
+// xml_network()
+//
+function xml_network () {
+    global $sysinfo;
+    $net = $sysinfo->network();
+
+    $_text = "  <Network>\n";
+    while (list($dev, $stats) = each($net)) {
+        $_text .= "    <NetDevice>\n"
+               .  "      <Name>" . htmlspecialchars(trim($dev), ENT_QUOTES) . "</Name>\n"
+               .  "      <RxBytes>" . htmlspecialchars($stats['rx_bytes'], ENT_QUOTES) . "</RxBytes>\n"
+               .  "      <TxBytes>" . htmlspecialchars($stats['tx_bytes'], ENT_QUOTES) . "</TxBytes>\n"
+               .  "      <Errors>" . htmlspecialchars($stats['errs'], ENT_QUOTES) . "</Errors>\n"
+               .  "      <Drops>" . htmlspecialchars($stats['drop'], ENT_QUOTES) . "</Drops>\n"
+               .  "    </NetDevice>\n";
+    }
+    $_text .= "  </Network>\n";
+
+    return $_text;
+}
+
+//
+// html_network()
+//
+function html_network () {
+    global $XPath;
+    global $text;
+
+    $textdir = direction();
+    
+    $_text = "<table border=\"0\" width=\"100%\" align=\"center\">\n"
+           . "  <tr>\n"
+	   . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['device'] . "</b></font></td>\n"
+           . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['received'] . "</b></font></td>\n"
+           . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['sent'] . "</b></font></td>\n"
+           . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['errors'] . "</b></font></td>\n"
+	   . "  </tr>\n";
+	   
+    for ($i=1, $max = sizeof($XPath->getDataParts("/phpsysinfo/Network")); $i < $max; $i++) {
+        if ($XPath->match("/phpsysinfo/Network/NetDevice[$i]/Name")) {
+            $_text .= "  <tr>\n";
+            $_text .= "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Network/NetDevice[$i]/Name") . "</font></td>\n";
+            $_text .= "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Network/NetDevice[$i]/RxBytes") / 1024) . "</font></td>\n";
+            $_text .= "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Network/NetDevice[$i]/TxBytes") / 1024) . "</font></td>\n";
+            $_text .= "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Network/NetDevice[$i]/Errors") . '/' . $XPath->getData("/phpsysinfo/Network/NetDevice[$i]/Drops") . "</font></td>\n";
+            $_text .= "  </tr>\n";
+        }
+    }
+    $_text .= "</table>";
+
+    return $_text;
+}
+
+?>
diff --git a/www/include/options/sysInfos/images/includes/xml/vitals.php b/www/include/options/sysInfos/images/includes/xml/vitals.php
new file mode 100644
index 0000000000000000000000000000000000000000..073bd297f53e63e94b08dff49db9bb2b998fb65d
--- /dev/null
+++ b/www/include/options/sysInfos/images/includes/xml/vitals.php
@@ -0,0 +1,116 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: vitals.php,v 1.26 2005/12/10 15:54:56 bigmichi1 Exp $
+
+// xml_vitals()
+
+function xml_vitals ()
+{
+  global $sysinfo;
+  global $loadbar;
+
+  $load_avg = "";
+  $ar_buf = ($loadbar ? $sysinfo->loadavg($loadbar) : $sysinfo->loadavg());
+
+  for ($i = 0; $i < count($ar_buf['avg']); $i++) {
+    $load_avg .= $ar_buf['avg'][$i] . ' ';
+  } 
+
+  $_text = "  <Vitals>\n"
+   . "    <Hostname>" . htmlspecialchars($sysinfo->chostname(), ENT_QUOTES) . "</Hostname>\n"
+   . "    <IPAddr>" . htmlspecialchars($sysinfo->ip_addr(), ENT_QUOTES) . "</IPAddr>\n"
+   . "    <Kernel>" . htmlspecialchars($sysinfo->kernel(), ENT_QUOTES) . "</Kernel>\n"
+   . "    <Distro>" . htmlspecialchars($sysinfo->distro(), ENT_QUOTES) . "</Distro>\n"
+   . "    <Distroicon>" . htmlspecialchars($sysinfo->distroicon(), ENT_QUOTES) . "</Distroicon>\n"
+   . "    <Uptime>" . htmlspecialchars($sysinfo->uptime(), ENT_QUOTES) . "</Uptime>\n"
+   . "    <Users>" . htmlspecialchars($sysinfo->users(), ENT_QUOTES) . "</Users>\n"
+   . "    <LoadAvg>" . htmlspecialchars(trim($load_avg), ENT_QUOTES) . "</LoadAvg>\n";
+   if (isset($ar_buf['cpupercent']))
+     $_text .= "   <CPULoad>" . htmlspecialchars(round($ar_buf['cpupercent'], 2), ENT_QUOTES) . "</CPULoad>";
+   $_text .= "  </Vitals>\n";
+  return $_text;
+} 
+
+// html_vitals()
+
+function html_vitals ()
+{
+  global $webpath;
+  global $XPath;
+  global $text;
+
+  $textdir = direction();
+  $scale_factor = 2;
+  $loadbar = "";
+  $uptime = "";
+  
+  if($XPath->match("/phpsysinfo/Vitals/CPULoad"))
+    $loadbar = "<br/>" . create_bargraph($XPath->getData("/phpsysinfo/Vitals/CPULoad"), 100, $scale_factor) . "&nbsp;" . $XPath->getData("/phpsysinfo/Vitals/CPULoad") . "%";
+
+  $min = $XPath->getData('/phpsysinfo/Vitals/Uptime') / 60;
+  $hours = $min / 60;
+  $days = floor($hours / 24);
+  $hours = floor($hours - ($days * 24));
+  $min = floor($min - ($days * 60 * 24) - ($hours * 60));
+
+  if ($days != 0) {
+    $uptime = $days. "&nbsp;" . $text['days'] . "&nbsp;";
+  } 
+
+  if ($hours != 0) {
+    $uptime .= $hours . "&nbsp;" . $text['hours'] . "&nbsp;";
+  } 
+  $uptime .= $min . "&nbsp;" . $text['minutes'];
+
+  $_text = "<table border=\"0\" width=\"100%\" align=\"center\">\n"
+	 . "  <tr>\n"
+	 . "    <td valign=\"top\"><font size=\"-1\">" . $text['hostname'] . "</font></td>\n"
+	 . "    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Vitals/Hostname") . "</font></td>\n"
+	 . "  </tr>\n"
+	 . "  <tr>\n"
+	 . "    <td valign=\"top\"><font size=\"-1\">" . $text['ip'] . "</font></td>\n"
+	 . "    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Vitals/IPAddr") . "</font></td>\n"
+	 . "  </tr>\n"
+	 . "  <tr>\n"
+	 . "    <td valign=\"top\"><font size=\"-1\">" . $text['kversion'] . "</font></td>\n"
+	 . "    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Vitals/Kernel") . "</font></td>\n"
+	 . "  </tr>\n"
+	 . "  <tr>\n"
+	 . "    <td valign=\"top\"><font size=\"-1\">" . $text['dversion'] . "</font></td>\n"
+	 . "    <td><img width=\"16\" height=\"16\" alt=\"\" src=\"" . $webpath . "images/" . $XPath->getData("/phpsysinfo/Vitals/Distroicon") . "\">&nbsp;<font size=\"-1\">" . $XPath->getData("/phpsysinfo/Vitals/Distro") . "</font></td>\n"
+	 . "  </tr>\n"
+	 . "  <tr>\n"
+	 . "    <td valign=\"top\"><font size=\"-1\">" . $text['uptime'] . "</font></td>\n"
+	 . "    <td><font size=\"-1\">" . $uptime . "</font></td>\n"
+	 . "  </tr>\n"
+	 . "  <tr>\n"
+	 . "    <td valign=\"top\"><font size=\"-1\">" . $text['users'] . "</font></td>\n"
+	 . "    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Vitals/Users") . "</font></td>\n"
+	 . "  </tr>\n"
+	 . "  <tr>\n"
+	 . "    <td valign=\"top\"><font size=\"-1\">" . $text['loadavg'] . "</font></td>\n"
+	 . "    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Vitals/LoadAvg") . $loadbar . "</font></td>\n"
+	 . "  </tr>\n"
+	 . "</table>\n";
+
+  return $_text;
+} 
+
+?>
diff --git a/www/include/options/sysInfos/images/index.html b/www/include/options/sysInfos/images/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/index.php b/www/include/options/sysInfos/images/index.php
new file mode 100644
index 0000000000000000000000000000000000000000..9f2933a73dbd571ea85c85639bc4f63b1349e367
--- /dev/null
+++ b/www/include/options/sysInfos/images/index.php
@@ -0,0 +1,269 @@
+<?php 
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+// $Id: index.php,v 1.104 2005/12/15 08:35:00 bigmichi1 Exp $
+// phpsysinfo release version number
+$VERSION = "2.5.1";
+
+define('APP_ROOT', dirname(__FILE__));
+define('IN_PHPSYSINFO', true);
+
+ini_set('magic_quotes_runtime', 'off');
+ini_set('register_globals', 'off');
+
+if (!file_exists(APP_ROOT . '/config.php')) {
+  echo '<center><b>Error: config.php does not exist.</b></center>';
+  exit;
+} 
+
+require_once(APP_ROOT . '/config.php'); // get the config file
+
+if (!extension_loaded('xml')) {
+  echo '<center><b>Error: phpsysinfo requires xml module.</b></center>';
+  exit;
+} 
+
+if (!extension_loaded('pcre')) {
+  echo '<center><b>Error: phpsysinfo requires pcre module.</b></center>';
+  exit;
+} 
+
+// Check to see if where running inside of phpGroupWare
+if (file_exists("../header.inc.php") && isset($_REQUEST['sessionid']) && $_REQUEST['sessionid'] && $_REQUEST['kp3'] && $_REQUEST['domain']) {
+  define('PHPGROUPWARE', 1);
+  $phpgw_info['flags'] = array('currentapp' => 'phpsysinfo-dev');
+  include('../header.inc.php');
+} else {
+  define('PHPGROUPWARE', 0);
+}
+
+// DEFINE TEMPLATE_SET
+if (isset($_POST['template'])) {
+  $template = $_POST['template'];
+} elseif (isset($_GET['template'])) {
+  $template = $_GET['template'];
+} elseif (isset($_COOKIE['template'])) {
+  $template = $_COOKIE['template'];
+} else {
+  $template = $default_template; 
+}
+
+// check to see if we have a random
+if ($template == 'random') {
+  $dir = opendir(APP_ROOT . "/templates/");
+  while (($file = readdir($dir)) != false) {
+    if ($file != 'CVS' && $file != '.' && $file != '..') {
+      $buf[] = $file;
+    } 
+  } 
+  $template = $buf[array_rand($buf, 1)];
+} 
+
+if ($template != 'xml' && $template != 'random') {
+  // figure out if the template exists
+  $template = basename($template);
+  if (!file_exists(APP_ROOT . "/templates/" . $template)) {
+    // use default if not exists.
+    $template = $default_template;
+  }
+}
+
+// Store the current template name in a cookie, set expire date to 30 days later
+// if template is xml then skip
+if ($template != 'xml') {
+  setcookie("template", $template, (time() + 60 * 60 * 24 * 30));
+  $_COOKIE['template'] = $template; //update COOKIE Var
+}
+
+
+define('TEMPLATE_SET', $template);
+// get our current language
+// default to english, but this is negotiable.
+if (isset($_POST['lng'])) {
+  $lng = $_POST['lng'];
+} elseif (isset($_GET['lng'])) {
+  $lng = $_GET['lng'];
+  if (!file_exists(APP_ROOT . '/includes/lang/' . $lng . '.php')) {
+    $lng = 'browser';
+  } 
+} elseif (isset($_COOKIE['lng'])) {
+  $lng = $_COOKIE['lng'];
+} else {
+  $lng = $default_lng;
+} 
+// Store the current language selection in a cookie, set expire date to 30 days later
+setcookie("lng", $lng, (time() + 60 * 60 * 24 * 30));
+$_COOKIE['lng'] = $lng; //update COOKIE Var
+
+if ($lng == 'browser') {
+  // see if the browser knows the right languange.
+  if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+    $plng = split(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
+    if (count($plng) > 0) {
+      while (list($k, $v) = each($plng)) {
+        $k = split(';', $v, 1);
+        $k = split('-', $k[0]);
+        if (file_exists(APP_ROOT . '/includes/lang/' . $k[0] . '.php')) {
+          $lng = $k[0];
+          break;
+        }
+      }
+    }
+  }
+}
+
+$charset = 'iso-8859-1';
+$lng = basename($lng);
+if (file_exists(APP_ROOT . '/includes/lang/' . $lng . '.php')) {
+    require_once(APP_ROOT . '/includes/lang/' . $lng . '.php'); // get our language include
+} else {
+    echo "Sorry, we don't support this language.";
+    exit;
+}
+
+// Figure out which OS where running on, and detect support
+if (file_exists(APP_ROOT . '/includes/os/class.' . PHP_OS . '.inc.php')) {
+  require_once(APP_ROOT . '/includes/os/class.' . PHP_OS . '.inc.php');
+  $sysinfo = new sysinfo;
+} else {
+  echo '<center><b>Error: ' . PHP_OS . ' is not currently supported</b></center>';
+  exit;
+}
+
+if (!empty($sensor_program)) {
+  $sensor_program = basename($sensor_program);
+  if (file_exists(APP_ROOT . '/includes/mb/class.' . $sensor_program . '.inc.php')) {
+    require_once(APP_ROOT . '/includes/mb/class.' . $sensor_program . '.inc.php');
+    $mbinfo = new mbinfo;
+  } else {
+    echo '<center><b>Error: ' . htmlspecialchars($sensor_program, ENT_QUOTES) . ' is not currently supported</b></center>';
+    exit;
+  } 
+} 
+
+require_once(APP_ROOT . '/includes/common_functions.php'); // Set of common functions used through out the app
+require_once(APP_ROOT . '/includes/xml/vitals.php');
+require_once(APP_ROOT . '/includes/xml/network.php');
+require_once(APP_ROOT . '/includes/xml/hardware.php');
+require_once(APP_ROOT . '/includes/xml/memory.php');
+require_once(APP_ROOT . '/includes/xml/filesystems.php');
+require_once(APP_ROOT . '/includes/xml/mbinfo.php');
+require_once(APP_ROOT . '/includes/xml/hddtemp.php');
+
+
+
+$xml = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
+$xml .= "<!DOCTYPE phpsysinfo SYSTEM \"phpsysinfo.dtd\">\n\n";
+$xml .= created_by();
+$xml .= "<phpsysinfo>\n";
+$xml .= "  <Generation version=\"$VERSION\" timestamp=\"" . time() . "\"/>\n";
+$xml .= xml_vitals();
+$xml .= xml_network();
+$xml .= xml_hardware($hddtemp_devices);
+$xml .= xml_memory();
+$xml .= xml_filesystems();
+if (!empty($sensor_program)) {
+  $xml .= xml_mbtemp();
+  $xml .= xml_mbfans();
+  $xml .= xml_mbvoltage();
+};
+if (isset($hddtemp_avail)) {
+  require_once(APP_ROOT . "/includes/mb/class.hddtemp.inc.php");
+  $hddtemp = new hddtemp($hddtemp_devices);
+  $xml .= xml_hddtemp($hddtemp);
+}
+$xml .= "</phpsysinfo>";
+
+if (TEMPLATE_SET == 'xml' and !$oreon) {
+  // just printout the XML and exit
+  Header("Content-Type: text/xml\n\n");
+  print $xml;
+} else {
+  $image_height = get_gif_image_height(APP_ROOT . '/templates/' . TEMPLATE_SET . '/images/bar_middle.gif');
+  define('BAR_HEIGHT', $image_height);
+
+  if (PHPGROUPWARE != 1) {
+    require_once(APP_ROOT . '/includes/class.Template.inc.php'); // template library
+  } 
+  // fire up the template engine
+  $tpl = new Template(APP_ROOT . '/templates/' . TEMPLATE_SET);
+  $tpl->set_file(array('form' => 'form.tpl')); 
+  // print out a box of information
+  function makebox ($title, $content)
+  {
+    if (empty($content)) {
+      return "";
+    } else {
+      global $webpath;
+      $textdir = direction();
+      $t = new Template(APP_ROOT . '/templates/' . TEMPLATE_SET);
+      $t->set_file(array('box' => 'box.tpl'));
+      $t->set_var('title', $title);
+      $t->set_var('content', $content);
+      $t->set_var('webpath', $webpath);
+      $t->set_var('text_dir', $textdir['direction']);
+      return $t->parse('out', 'box');
+    } 
+  } 
+  // Fire off the XPath class
+  require_once(APP_ROOT . '/includes/XPath.class.php');
+  $XPath = new XPath();
+  $XPath->importFromString($xml); 
+  // let the page begin.
+  require_once(APP_ROOT . '/includes/system_header.php');
+
+  $tpl->set_var('title', $text['title'] . ': ' . $XPath->getData('/phpsysinfo/Vitals/Hostname') . ' (' . $XPath->getData('/phpsysinfo/Vitals/IPAddr') . ')');
+  $tpl->set_var('vitals', makebox($text['vitals'], html_vitals()));
+  $tpl->set_var('network', makebox($text['netusage'], html_network()));
+  $tpl->set_var('hardware', makebox($text['hardware'], html_hardware()));
+  $tpl->set_var('memory', makebox($text['memusage'], html_memory()));
+  $tpl->set_var('filesystems', makebox($text['fs'], html_filesystems()));
+  // Timo van Roermund: change the condition for showing the temperature, voltage and fans section
+  $html_temp = "";
+  if (!empty($sensor_program)) {
+    if ($XPath->match("/phpsysinfo/MBinfo/Temperature/Item")) {
+      $html_temp = html_mbtemp();
+    }
+    if ($XPath->match("/phpsysinfo/MBinfo/Fans/Item")) {
+      $tpl->set_var('mbfans', makebox($text['fans'], html_mbfans()));
+    } else {
+      $tpl->set_var('mbfans', '');
+    };
+    if ($XPath->match("/phpsysinfo/MBinfo/Voltage/Item")) {
+      $tpl->set_var('mbvoltage', makebox($text['voltage'], html_mbvoltage()));
+    } else {
+      $tpl->set_var('mbvoltage', '');
+    };
+  }
+  if (isset($hddtemp_avail) && $hddtemp_avail) {
+    if ($XPath->match("/phpsysinfo/HDDTemp/Item")) {
+      $html_temp .= html_hddtemp();
+    };
+  }
+  if (strlen($html_temp) > 0) {
+    $tpl->set_var('mbtemp', makebox($text['temperature'], "\n<table width=\"100%\">\n" . $html_temp . "</table>\n"));
+  }
+  
+  // parse our the template
+  $tpl->pfp('out', 'form'); 
+ 
+  // finally our print our footer
+  if (PHPGROUPWARE == 1) {
+    $phpgw->common->phpgw_footer();
+  } else {
+    require_once(APP_ROOT . '/includes/system_footer.php');
+  } 
+} 
+
+?>
diff --git a/www/include/options/sysInfos/images/lfs.png b/www/include/options/sysInfos/images/lfs.png
new file mode 100644
index 0000000000000000000000000000000000000000..e59446004b2bd042170f4dbd202934659490bdd4
Binary files /dev/null and b/www/include/options/sysInfos/images/lfs.png differ
diff --git a/www/include/options/sysInfos/images/phpsysinfo.dtd b/www/include/options/sysInfos/images/phpsysinfo.dtd
new file mode 100644
index 0000000000000000000000000000000000000000..11243721b3fb99fce8ef26af199f1a2b1ee2c580
--- /dev/null
+++ b/www/include/options/sysInfos/images/phpsysinfo.dtd
@@ -0,0 +1,86 @@
+<!--
+
+  phpSysInfo - A PHP System Information Script
+  http://phpsysinfo.sourceforge.net/
+
+  $Id: phpsysinfo.dtd,v 1.10 2005/11/24 17:05:55 bigmichi1 Exp $
+
+-->
+<!ELEMENT phpsysinfo (Generation, Vitals, Network, Hardware, Memory, Swap, Swapdevices, FileSystem, MBinfo*, HDDTemp*)>
+  <!ELEMENT Generation EMPTY>
+    <!ATTLIST Generation version CDATA "2.3">
+    <!ATTLIST Generation timestamp CDATA "000000000">
+
+  <!ELEMENT Vitals (Hostname, IPAddr, Kernel, Distro, Distroicon, Uptime, Users, LoadAvg)>
+    <!ELEMENT Hostname (#PCDATA)>
+    <!ELEMENT IPAddr (#PCDATA)>
+    <!ELEMENT Kernel (#PCDATA)>
+    <!ELEMENT Distro (#PCDATA)>
+    <!ELEMENT Distroicon (#PCDATA)>
+    <!ELEMENT Uptime (#PCDATA)>
+    <!ELEMENT Users (#PCDATA)>
+    <!ELEMENT LoadAvg (#PCDATA)>
+
+  <!ELEMENT Network (NetDevice*)>
+    <!ELEMENT NetDevice (Name, RxBytes, TxBytes, Errors, Drops)>
+      <!ELEMENT Name (#PCDATA)>
+      <!ELEMENT RxBytes (#PCDATA)>
+      <!ELEMENT TxBytes (#PCDATA)>
+      <!ELEMENT Errors (#PCDATA)>
+      <!ELEMENT Drops (#PCDATA)>
+
+  <!ELEMENT Hardware (CPU*, PCI*, IDE*, SCSI*, USB*, SBUS*)>
+    <!ELEMENT CPU (Number*, Model*, Mhz*, Cpuspeed* ,Cache*, Bogomips*)>
+      <!ELEMENT Number (#PCDATA)>
+      <!ELEMENT Model (#PCDATA)>
+      <!ELEMENT Mhz (#PCDATA)>
+      <!ELEMENT Cpuspeed (#PCDATA)>
+      <!ELEMENT Cache (#PCDATA)>
+      <!ELEMENT Bogomips (#PCDATA)>
+    <!ELEMENT PCI (Device*)>
+      <!ELEMENT Device (Name, Capacity*)>
+	<!ELEMENT Capacity (#PCDATA)>
+    <!ELEMENT IDE (Device*)>
+    <!ELEMENT SCSI (Device*)>
+    <!ELEMENT USB (Device*)>
+    <!ELEMENT SBUS (Device*)>
+
+  <!ELEMENT Memory (Free, Used, Total, Percent, App*, AppPercent*, Buffers*, BuffersPercent*, Cached*, CachedPercent*)>
+    <!ELEMENT Free (#PCDATA)>
+    <!ELEMENT Used (#PCDATA)>
+    <!ELEMENT Total (#PCDATA)>
+    <!ELEMENT Percent (#PCDATA)>
+    <!ELEMENT App (#PCDATA)>
+    <!ELEMENT AppPercent (#PCDATA)>
+    <!ELEMENT Buffers (#PCDATA)>
+    <!ELEMENT BuffersPercent (#PCDATA)>
+    <!ELEMENT Cached (#PCDATA)>
+    <!ELEMENT CachedPercent (#PCDATA)>
+    
+
+  <!ELEMENT Swap (Free, Used, Total, Percent)>
+
+  <!ELEMENT Swapdevices (Mount*)>
+
+  <!ELEMENT FileSystem (Mount*)>
+    <!ELEMENT Mount (MountPointID, MountPoint*, Type, Device, Percent, Free, Used, Size, Options*)>
+      <!ELEMENT MountPointID (#PCDATA)>
+      <!ELEMENT MountPoint (#PCDATA)>
+      <!ELEMENT Type (#PCDATA)>
+      <!ELEMENT Size (#PCDATA)>
+      <!ELEMENT Options (#PCDATA)>
+
+  <!ELEMENT MBinfo (Temperature*, Fans*, Voltage*)>
+    <!ELEMENT Temperature (Item*)>
+      <!ELEMENT Item (Label, Value, Limit*, Min*, Max*, Div*, Model*)>
+        <!ELEMENT Label (#PCDATA)>
+	<!ELEMENT Value (#PCDATA)>
+	<!ELEMENT Limit (#PCDATA)>
+	<!ELEMENT Min (#PCDATA)>
+	<!ELEMENT Max (#PCDATA)>
+	<!ELEMENT Div (#PCDATA)>
+    <!ELEMENT Fans (Item*)>
+    <!ELEMENT Voltage (Item*)>
+    
+  <!ELEMENT HDDTemp (Item*)>
+  
\ No newline at end of file
diff --git a/www/include/options/sysInfos/images/templates/aq/aq.css b/www/include/options/sysInfos/images/templates/aq/aq.css
new file mode 100644
index 0000000000000000000000000000000000000000..60bf470db9d2bedde698e92c05b9a83a68db7ae8
--- /dev/null
+++ b/www/include/options/sysInfos/images/templates/aq/aq.css
@@ -0,0 +1,46 @@
+A {
+  text-decoration: none;
+}
+A:link {
+  color: #486591;
+}
+A:visited {
+  color: #6f6c81;
+}
+A:active {
+  color: blue;
+}
+body {
+  color: #000000;
+  background-color: #fefefe;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 10px;
+  font-weight: normal;
+}
+font {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+H1 {
+  color: #000000;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 20px;
+}
+select {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: normal;
+}
+input {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: bold;
+}
diff --git a/www/include/options/sysInfos/images/templates/aq/box.tpl b/www/include/options/sysInfos/images/templates/aq/box.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..f623162353e73e0cf17edde650f2831f9ae6f550
--- /dev/null
+++ b/www/include/options/sysInfos/images/templates/aq/box.tpl
@@ -0,0 +1,23 @@
+<!-- BEGIN portal -->
+
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+  <tr> 
+    <td width="15" height="15" style="background-image: url({webpath}templates/aq/images/coinsupg.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td height="15" style="background-image: url({webpath}templates/aq/images/sup.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td width="15" height="15" style="background-image: url({webpath}templates/aq/images/coinsupd.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+
+  <tr>
+   <td width="15" style="background-image: url({webpath}templates/aq/images/g.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+   <td style="background-image: url({webpath}templates/aq/images/fond.gif);" align="left" width="100%" dir="{text_dir}">{title}{content}</td>
+   <td width="15" style="background-image: url({webpath}templates/aq/images/d.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+
+  <tr> 
+    <td width="15" height="15" style="background-image: url({webpath}templates/aq/images/coininfg.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td height="15" style="background-image: url({webpath}templates/aq/images/inf.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td width="15" height="15" style="background-image: url({webpath}templates/aq/images/coininfd.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+</table>
+
+<!-- END portal -->
diff --git a/www/include/options/sysInfos/images/templates/aq/form.tpl b/www/include/options/sysInfos/images/templates/aq/form.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..655a5f999ca30302dca921e2c55a3dc51a3f4938
--- /dev/null
+++ b/www/include/options/sysInfos/images/templates/aq/form.tpl
@@ -0,0 +1,47 @@
+<center><h1>{title}</h1></center>
+
+<table width="100%" align="center" cellpadding="0" cellspacing="2">
+ <tr>
+  <td width="50%" valign="top">
+   {vitals}
+   <table cellpadding="0" cellspacing="0">
+   <tr><td height="8"></td></tr>
+   </table>
+   {network}
+  </td>
+
+  <td width="50%" valign="top">
+   {hardware}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {memory}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {filesystems}
+  </td>
+ </tr>
+
+</table>
+
+<table width="100%" cellpadding="0" cellspacing="2">
+ <tr>
+  <td width="55%" valign="top">
+   {mbtemp}
+   <table cellpadding="0" cellspacing="0">
+   <tr><td height="8"></td></tr>
+   </table>
+   {mbfans}
+  </td>
+
+  <td width="45%" valign="top">
+   {mbvoltage}
+  </td>
+ </tr>
+</table>
+
diff --git a/www/include/options/sysInfos/images/templates/aq/images/aq_background.gif b/www/include/options/sysInfos/images/templates/aq/images/aq_background.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c34fa449ee6659e4a74ddd168f8028c4133a4f66
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/aq/images/aq_background.gif differ
diff --git a/www/include/options/sysInfos/images/templates/aq/images/bar_left.gif b/www/include/options/sysInfos/images/templates/aq/images/bar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/templates/aq/images/bar_middle.gif b/www/include/options/sysInfos/images/templates/aq/images/bar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..bfe4bfa680b0849aa505218dfb8a3a4362294be3
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/aq/images/bar_middle.gif differ
diff --git a/www/include/options/sysInfos/images/templates/aq/images/bar_right.gif b/www/include/options/sysInfos/images/templates/aq/images/bar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..cf0bab00865d81a44b9d70995b23d869d9e6ede4
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/aq/images/bar_right.gif differ
diff --git a/www/include/options/sysInfos/images/templates/aq/images/coininfd.gif b/www/include/options/sysInfos/images/templates/aq/images/coininfd.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5a9e30a85caf0d7d9b0ca61f959bd78c09ee0442
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/aq/images/coininfd.gif differ
diff --git a/www/include/options/sysInfos/images/templates/aq/images/coininfg.gif b/www/include/options/sysInfos/images/templates/aq/images/coininfg.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9185e611279a8065fd3194ca569ac2f765b9b10c
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/aq/images/coininfg.gif differ
diff --git a/www/include/options/sysInfos/images/templates/aq/images/coinsupd.gif b/www/include/options/sysInfos/images/templates/aq/images/coinsupd.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6d9b0f5fa26a700c98a8aa3d1aa419f2c248cf7f
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/aq/images/coinsupd.gif differ
diff --git a/www/include/options/sysInfos/images/templates/aq/images/coinsupg.gif b/www/include/options/sysInfos/images/templates/aq/images/coinsupg.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/templates/aq/images/d.gif b/www/include/options/sysInfos/images/templates/aq/images/d.gif
new file mode 100644
index 0000000000000000000000000000000000000000..72e3d65f52971294d1046f5c5607fba61a1fbee1
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/aq/images/d.gif differ
diff --git a/www/include/options/sysInfos/images/templates/aq/images/fond.gif b/www/include/options/sysInfos/images/templates/aq/images/fond.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/templates/aq/images/g.gif b/www/include/options/sysInfos/images/templates/aq/images/g.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d98d7c3f177dffb5af6a800793ab3936578ddb0b
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/aq/images/g.gif differ
diff --git a/www/include/options/sysInfos/images/templates/aq/images/index.html b/www/include/options/sysInfos/images/templates/aq/images/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/templates/aq/images/inf.gif b/www/include/options/sysInfos/images/templates/aq/images/inf.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ee1d7d5b6d2a2370f58810a66e62d4cb198ef450
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/aq/images/inf.gif differ
diff --git a/www/include/options/sysInfos/images/templates/aq/images/redbar_left.gif b/www/include/options/sysInfos/images/templates/aq/images/redbar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..31bfaf022a28aa839c715bb84137976cca725336
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/aq/images/redbar_left.gif differ
diff --git a/www/include/options/sysInfos/images/templates/aq/images/redbar_middle.gif b/www/include/options/sysInfos/images/templates/aq/images/redbar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3be837dd2167387a8ea4970974e379f61de4f8ed
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/aq/images/redbar_middle.gif differ
diff --git a/www/include/options/sysInfos/images/templates/aq/images/redbar_right.gif b/www/include/options/sysInfos/images/templates/aq/images/redbar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..32826a974bb27da339b772e09a4e517a45e6c52c
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/aq/images/redbar_right.gif differ
diff --git a/www/include/options/sysInfos/images/templates/aq/images/space15_15.gif b/www/include/options/sysInfos/images/templates/aq/images/space15_15.gif
new file mode 100644
index 0000000000000000000000000000000000000000..78d029c5dc084cbab91d82cec012b129376d4930
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/aq/images/space15_15.gif differ
diff --git a/www/include/options/sysInfos/images/templates/aq/images/sup.gif b/www/include/options/sysInfos/images/templates/aq/images/sup.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/templates/aq/index.html b/www/include/options/sysInfos/images/templates/aq/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/templates/black/black.css b/www/include/options/sysInfos/images/templates/black/black.css
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/templates/black/box.tpl b/www/include/options/sysInfos/images/templates/black/box.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..26148a6b881736f2cc06e814e07325a3be59cea4
--- /dev/null
+++ b/www/include/options/sysInfos/images/templates/black/box.tpl
@@ -0,0 +1,23 @@
+<!-- BEGIN portal -->
+
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+  <tr> 
+    <td width="15" height="15" style="background-image: url({webpath}templates/black/images/coinsupg.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td height="15" style="background-image: url({webpath}templates/black/images/sup.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td width="15" height="15" style="background-image: url({webpath}templates/black/images/coinsupd.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+
+  <tr>
+   <td width="15" style="background-image: url({webpath}templates/black/images/g.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+   <td style="background-image: url({webpath}templates/black/images/fond.gif);" align="left" width="100%" dir="{text_dir}">{title}{content}</td>
+   <td width="15" style="background-image: url({webpath}templates/black/images/d.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+
+  <tr> 
+    <td width="15" height="15" style="background-image: url({webpath}templates/black/images/coininfg.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td height="15" style="background-image: url({webpath}templates/black/images/inf.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td width="15" height="15" style="background-image: url({webpath}templates/black/images/coininfd.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+</table>
+
+<!-- END portal -->
diff --git a/www/include/options/sysInfos/images/templates/black/form.tpl b/www/include/options/sysInfos/images/templates/black/form.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/templates/black/images/coininfd.gif b/www/include/options/sysInfos/images/templates/black/images/coininfd.gif
new file mode 100644
index 0000000000000000000000000000000000000000..cd90ac7b5b5e12bada5fb4d35f1f5fe1825d69c8
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/black/images/coininfd.gif differ
diff --git a/www/include/options/sysInfos/images/templates/black/images/g.gif b/www/include/options/sysInfos/images/templates/black/images/g.gif
new file mode 100644
index 0000000000000000000000000000000000000000..23f6e09c2dabb1b58bdfe1cf2a800e28c38f0a81
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/black/images/g.gif differ
diff --git a/www/include/options/sysInfos/images/templates/black/images/inf.gif b/www/include/options/sysInfos/images/templates/black/images/inf.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4958049490bff0b3e21837d52210ddb217dddb5c
Binary files /dev/null and b/www/include/options/sysInfos/images/templates/black/images/inf.gif differ
diff --git a/www/include/options/sysInfos/images/templates/black/index.html b/www/include/options/sysInfos/images/templates/black/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/templates/classic/box.tpl b/www/include/options/sysInfos/images/templates/classic/box.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..ae77293195beb61bbbe34bd520f150809a410bef
--- /dev/null
+++ b/www/include/options/sysInfos/images/templates/classic/box.tpl
@@ -0,0 +1,19 @@
+<table width="100%">
+ <tr>
+  <td>
+
+    <table class="box">
+
+     <tr class="boxheader">
+      <td class="boxheader">{title}</td>
+     </tr>
+
+     <tr class="boxbody">
+      <td dir="{text_dir}">{content}</td>
+     </tr>
+
+    </table>
+
+   </td>
+  </tr>
+</table>
diff --git a/www/include/options/sysInfos/images/templates/classic/classic.css b/www/include/options/sysInfos/images/templates/classic/classic.css
new file mode 100644
index 0000000000000000000000000000000000000000..0c14e116260a155fc03f1835b0a88b7819ca9fd2
--- /dev/null
+++ b/www/include/options/sysInfos/images/templates/classic/classic.css
@@ -0,0 +1,74 @@
+A {
+  text-decoration: none;
+}
+A:link {
+  color: #486591;
+  background-color: transparent;
+}
+A:visited {
+  color: #6f6c81;
+  background-color: transparent;
+}
+A:active {
+  color: blue;
+  background-color: transparent;
+}
+body {
+  color: #000000;
+  background-color: #fefefe;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+font {
+  color: #000000;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+H1 {
+  color: #000000;
+  background-color: transparent;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 20px;
+}
+select {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: normal;
+}
+input {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: bold;
+}
+table
+{
+  border: none;
+  margin: 0px;
+  padding: 0px;
+}
+table.box {
+  color: #fefefe;
+  background-color: #486591;
+  border: none;
+  padding: 1px;
+  width: 100%;
+}
+tr.boxheader {
+  background-color: #486591;
+}
+td.boxheader {
+  text-align: center;
+}
+tr.boxbody {
+  color: #fefefe;
+  background-color: #e6e6e6;
+}
diff --git a/www/include/options/sysInfos/images/templates/classic/index.html b/www/include/options/sysInfos/images/templates/classic/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/templates/index.html b/www/include/options/sysInfos/images/templates/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/templates/kde/form.tpl b/www/include/options/sysInfos/images/templates/kde/form.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/templates/kde/kde.css b/www/include/options/sysInfos/images/templates/kde/kde.css
new file mode 100644
index 0000000000000000000000000000000000000000..ccd76d244353e25b4b1e7f46b4031f76c5964267
--- /dev/null
+++ b/www/include/options/sysInfos/images/templates/kde/kde.css
@@ -0,0 +1,64 @@
+A {
+  text-decoration: none;
+}
+A:link {
+  color: blue;
+}
+A:visited {
+  color: blue;
+}
+A:active {
+  color: blue;
+}
+.itemtitle {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: none;
+}
+.itemtext {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+.tabletitles {
+  text-decoration: underline;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: bold;
+}
+body {
+  color: #000000;
+  background-color: #B0BAE4;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 10px;
+  font-weight: normal;
+}
+font {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+H1 {
+  color: #000000;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 20px;
+}
+select {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: normal;
+}
+input {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: bold;
+}
diff --git a/www/include/options/sysInfos/images/templates/metal/aq_background.gif b/www/include/options/sysInfos/images/templates/metal/aq_background.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/templates/metal/bar_left.gif b/www/include/options/sysInfos/images/templates/metal/bar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/images/unknown.png b/www/include/options/sysInfos/images/unknown.png
new file mode 100644
index 0000000000000000000000000000000000000000..54dc5b47bc2336a06fc29f88cb85a170b39fb615
Binary files /dev/null and b/www/include/options/sysInfos/images/unknown.png differ
diff --git a/www/include/options/sysInfos/images/xp.gif b/www/include/options/sysInfos/images/xp.gif
new file mode 100644
index 0000000000000000000000000000000000000000..bd97897d24f569160155da6f04e555d53587a654
Binary files /dev/null and b/www/include/options/sysInfos/images/xp.gif differ
diff --git a/www/include/options/sysInfos/includes/XPath.class.php b/www/include/options/sysInfos/includes/XPath.class.php
new file mode 100644
index 0000000000000000000000000000000000000000..ec44a99e211f02a09325fea313e5757b615cc3ee
--- /dev/null
+++ b/www/include/options/sysInfos/includes/XPath.class.php
@@ -0,0 +1,6355 @@
+<?php
+/**
+ * Php.XPath
+ *
+ * +======================================================================================================+
+ * | A php class for searching an XML document using XPath, and making modifications using a DOM 
+ * | style API. Does not require the DOM XML PHP library. 
+ * |
+ * +======================================================================================================+
+ * | What Is XPath:
+ * | --------------
+ * | - "What SQL is for a relational database, XPath is for an XML document." -- Sam Blum
+ * | - "The primary purpose of XPath is to address parts of an XML document. In support of this 
+ * |    primary purpose, it also provides basic facilities for manipulting it." -- W3C
+ * | 
+ * | XPath in action and a very nice intro is under:
+ * |    http://www.zvon.org/xxl/XPathTutorial/General/examples.html
+ * | Specs Can be found under:
+ * |    http://www.w3.org/TR/xpath     W3C XPath Recommendation 
+ * |    http://www.w3.org/TR/xpath20   W3C XPath Recommendation 
+ * |
+ * | NOTE: Most of the XPath-spec has been realized, but not all. Usually this should not be
+ * |       problem as the missing part is either rarely used or it's simpler to do with PHP itself.
+ * +------------------------------------------------------------------------------------------------------+
+ * | Requires PHP version  4.0.5 and up
+ * +------------------------------------------------------------------------------------------------------+
+ * | Main Active Authors:
+ * | --------------------
+ * | Nigel Swinson <nigelswinson@users.sourceforge.net>
+ * |   Started around 2001-07, saved phpxml from near death and renamed to Php.XPath
+ * |   Restructured XPath code to stay in line with XPath spec.
+ * | Sam Blum <bs_php@infeer.com>
+ * |   Started around 2001-09 1st major restruct (V2.0) and testbench initiator.   
+ * |   2nd (V3.0) major rewrite in 2002-02
+ * | Daniel Allen <bigredlinux@yahoo.com>
+ * |   Started around 2001-10 working to make Php.XPath adhere to specs 
+ * | Main Former Author: Michael P. Mehl <mpm@phpxml.org>
+ * |   Inital creator of V 1.0. Stoped activities around 2001-03        
+ * +------------------------------------------------------------------------------------------------------+
+ * | Code Structure:
+ * | --------------_
+ * | The class is split into 3 main objects. To keep usability easy all 3 
+ * | objects are in this file (but may be split in 3 file in future).
+ * |   +-------------+ 
+ * |   |  XPathBase  | XPathBase holds general and debugging functions. 
+ * |   +------+------+
+ * |          v      
+ * |   +-------------+ XPathEngine is the implementation of the W3C XPath spec. It contains the 
+ * |   | XPathEngine | XML-import (parser), -export  and can handle xPathQueries. It's a fully 
+ * |   +------+------+ functional class but has no functions to modify the XML-document (see following).
+ * |          v      
+ * |   +-------------+ 
+ * |   |    XPath    | XPath extends the functionality with actions to modify the XML-document.
+ * |   +-------------+ We tryed to implement a DOM - like interface.
+ * +------------------------------------------------------------------------------------------------------+
+ * | Usage:
+ * | ------
+ * | Scroll to the end of this php file and you will find a short sample code to get you started
+ * +------------------------------------------------------------------------------------------------------+
+ * | Glossary:
+ * | ---------
+ * | To understand how to use the functions and to pass the right parameters, read following:
+ * |     
+ * | Document: (full node tree, XML-tree)
+ * |     After a XML-source has been imported and parsed, it's stored as a tree of nodes sometimes 
+ * |     refered to as 'document'.
+ * |     
+ * | AbsoluteXPath: (xPath, xPathSet)
+ * |     A absolute XPath is a string. It 'points' to *one* node in the XML-document. We use the
+ * |     term 'absolute' to emphasise that it is not an xPath-query (see xPathQuery). A valid xPath 
+ * |     has the form like '/AAA[1]/BBB[2]/CCC[1]'. Usually functions that require a node (see Node) 
+ * |     will also accept an abs. XPath.
+ * |     
+ * | Node: (node, nodeSet, node-tree)
+ * |     Some funtions require or return a node (or a whole node-tree). Nodes are only used with the 
+ * |     XPath-interface and have an internal structure. Every node in a XML document has a unique 
+ * |     corresponding abs. xPath. That's why public functions that accept a node, will usually also 
+ * |     accept a abs. xPath (a string) 'pointing' to an existing node (see absolutXPath).
+ * |     
+ * | XPathQuery: (xquery, query)
+ * |     A xPath-query is a string that is matched against the XML-document. The result of the match 
+ * |     is a xPathSet (vector of xPath's). It's always possible to pass a single absoluteXPath 
+ * |     instead of a xPath-query. A valid xPathQuery could look like this:
+ * |     '//XXX/*[contains(., "foo")]/..' (See the link in 'What Is XPath' to learn more).
+ * |     
+ * |     
+ * +------------------------------------------------------------------------------------------------------+
+ * | Internals:
+ * | ----------
+ * | - The Node Tree
+ * |   -------------
+ * | A central role of the package is how the XML-data is stored. The whole data is in a node-tree.
+ * | A node can be seen as the equvalent to a tag in the XML soure with some extra info.
+ * | For instance the following XML 
+ * |                        <AAA foo="x">***<BBB/><CCC/>**<BBB/>*</AAA>
+ * | Would produce folowing node-tree:
+ * |                              'super-root'      <-- $nodeRoot (Very handy)  
+ * |                                    |                                           
+ * |             'depth' 0            AAA[1]        <-- top node. The 'textParts' of this node would be
+ * |                                /   |   \                     'textParts' => array('***','','**','*')
+ * |             'depth' 1     BBB[1] CCC[1] BBB[2]               (NOTE: Is always size of child nodes+1)
+ * | - The Node
+ * |   --------
+ * | The node itself is an structure desiged mainly to be used in connection with the interface of PHP.XPath.
+ * | That means it's possible for functions to return a sub-node-tree that can be used as input of an other 
+ * | PHP.XPath function.
+ * | 
+ * | The main structure of a node is:
+ * |   $node = array(
+ * |     'name'        => '',      # The tag name. E.g. In <FOO bar="aaa"/> it would be 'FOO'
+ * |     'attributes'  => array(), # The attributes of the tag E.g. In <FOO bar="aaa"/> it would be array('bar'=>'aaa')
+ * |     'textParts'   => array(), # Array of text parts surrounding the children E.g. <FOO>aa<A>bb<B/>cc</A>dd</FOO> -> array('aa','bb','cc','dd')
+ * |     'childNodes'  => array(), # Array of refences (pointers) to child nodes.
+ * |     
+ * | For optimisation reasions some additional data is stored in the node too:
+ * |     'parentNode'  => NULL     # Reference (pointer) to the parent node (or NULL if it's 'super root')
+ * |     'depth'       => 0,       # The tag depth (or tree level) starting with the root tag at 0.
+ * |     'pos'         => 0,       # Is the zero-based position this node has in the parent's 'childNodes'-list.
+ * |     'contextPos'  => 1,       # Is the one-based position this node has by counting the siblings tags (tags with same name)
+ * |     'xpath'       => ''       # Is the abs. XPath to this node.
+ * |     'generated_id'=> ''       # The id returned for this node by generate-id() (attribute and text nodes not supported)
+ * | 
+ * | - The NodeIndex
+ * |   -------------
+ * | Every node in the tree has an absolute XPath. E.g '/AAA[1]/BBB[2]' the $nodeIndex is a hash array
+ * | to all the nodes in the node-tree. The key used is the absolute XPath (a string).
+ * |    
+ * +------------------------------------------------------------------------------------------------------+
+ * | License:
+ * | --------
+ * | The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); 
+ * | you may not use this file except in compliance with the License. You may obtain a copy of the 
+ * | License at http://www.mozilla.org/MPL/ 
+ * | 
+ * | Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY
+ * | OF ANY KIND, either express or implied. See the License for the specific language governing 
+ * | rights and limitations under the License. 
+ * |
+ * | The Original Code is <phpXML/>. 
+ * | 
+ * | The Initial Developer of the Original Code is Michael P. Mehl. Portions created by Michael 
+ * | P. Mehl are Copyright (C) 2001 Michael P. Mehl. All Rights Reserved.
+ * |
+ * | Contributor(s): N.Swinson / S.Blum / D.Allen
+ * | 
+ * | Alternatively, the contents of this file may be used under the terms of either of the GNU 
+ * | General Public License Version 2 or later (the "GPL"), or the GNU Lesser General Public 
+ * | License Version 2.1 or later (the "LGPL"), in which case the provisions of the GPL or the 
+ * | LGPL License are applicable instead of those above.  If you wish to allow use of your version 
+ * | of this file only under the terms of the GPL or the LGPL License and not to allow others to 
+ * | use your version of this file under the MPL, indicate your decision by deleting the 
+ * | provisions above and replace them with the notice and other provisions required by the 
+ * | GPL or the LGPL License.  If you do not delete the provisions above, a recipient may use 
+ * | your version of this file under either the MPL, the GPL or the LGPL License. 
+ * | 
+ * +======================================================================================================+
+ *
+ * @author  S.Blum / N.Swinson / D.Allen / (P.Mehl)
+ * @link    http://sourceforge.net/projects/phpxpath/
+ * @version 3.5
+ * @CVS $Id: XPath.class.php,v 1.9 2005/11/16 17:26:05 bigmichi1 Exp $
+ */
+
+// Include guard, protects file being included twice
+$ConstantName = 'INCLUDED_'.strtoupper(__FILE__);
+if (defined($ConstantName)) return;
+define($ConstantName,1, TRUE);
+
+/************************************************************************************************
+* ===============================================================================================
+*                               X P a t h B a s e  -  Class                                      
+* ===============================================================================================
+************************************************************************************************/
+class XPathBase {
+  var $_lastError;
+  
+  // As debugging of the xml parse is spread across several functions, we need to make this a member.
+  var $bDebugXmlParse = FALSE;
+
+  // do we want to do profiling?
+  var $bClassProfiling = FALSE;
+
+  // Used to help navigate through the begin/end debug calls
+  var $iDebugNextLinkNumber = 1;
+  var $aDebugOpenLinks = array();
+  var $aDebugFunctions = array(
+          //'_evaluatePrimaryExpr',
+          //'_evaluateExpr',
+          //'_evaluateStep',
+          //'_checkPredicates',
+          //'_evaluateFunction',
+          //'_evaluateOperator',
+          //'_evaluatePathExpr',
+               );
+
+  /**
+   * Constructor
+   */
+  function XPathBase() {
+    # $this->bDebugXmlParse = TRUE;
+    $this->properties['verboseLevel'] = 1;  // 0=silent, 1 and above produce verbose output (an echo to screen). 
+    
+    if (!isSet($_ENV)) {  // Note: $_ENV introduced in 4.1.0. In earlier versions, use $HTTP_ENV_VARS.
+      $_ENV = $GLOBALS['HTTP_ENV_VARS'];
+    }
+    
+    // Windows 95/98 do not support file locking. Detecting OS (Operation System) and setting the 
+    // properties['OS_supports_flock'] to FALSE if win 95/98 is detected. 
+    // This will surpress the file locking error reported from win 98 users when exportToFile() is called.
+    // May have to add more OS's to the list in future (Macs?).
+    // ### Note that it's only the FAT and NFS file systems that are really a problem.  NTFS and
+    // the latest php libs do support flock()
+    $_ENV['OS'] = isSet($_ENV['OS']) ? $_ENV['OS'] : 'Unknown OS';
+    switch ($_ENV['OS']) { 
+      case 'Windows_95':
+      case 'Windows_98':
+      case 'Unknown OS':
+        // should catch Mac OS X compatible environment 
+        if (!empty($_SERVER['SERVER_SOFTWARE']) 
+            && preg_match('/Darwin/',$_SERVER['SERVER_SOFTWARE'])) { 
+           // fall-through 
+        } else { 
+           $this->properties['OS_supports_flock'] = FALSE; 
+           break; 
+        }
+      default:
+        $this->properties['OS_supports_flock'] = TRUE;
+    }
+  }
+  
+  
+  /**
+   * Resets the object so it's able to take a new xml sting/file
+   *
+   * Constructing objects is slow.  If you can, reuse ones that you have used already
+   * by using this reset() function.
+   */
+  function reset() {
+    $this->_lastError   = '';
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPathBase                    ------  Helpers  ------                                    
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * This method checks the right amount and match of brackets
+   *
+   * @param     $term (string) String in which is checked.
+   * @return          (bool)   TRUE: OK / FALSE: KO  
+   */
+  function _bracketsCheck($term) {
+    $leng = strlen($term);
+    $brackets = 0;
+    $bracketMisscount = $bracketMissmatsh = FALSE;
+    $stack = array();
+    for ($i=0; $i<$leng; $i++) {
+      switch ($term[$i]) {
+        case '(' : 
+        case '[' : 
+          $stack[$brackets] = $term[$i]; 
+          $brackets++; 
+          break;
+        case ')': 
+          $brackets--;
+          if ($brackets<0) {
+            $bracketMisscount = TRUE;
+            break 2;
+          }
+          if ($stack[$brackets] != '(') {
+            $bracketMissmatsh = TRUE;
+            break 2;
+          }
+          break;
+        case ']' : 
+          $brackets--;
+          if ($brackets<0) {
+            $bracketMisscount = TRUE;
+            break 2;
+          }
+          if ($stack[$brackets] != '[') {
+            $bracketMissmatsh = TRUE;
+            break 2;
+          }
+          break;
+      }
+    }
+    // Check whether we had a valid number of brackets.
+    if ($brackets != 0) $bracketMisscount = TRUE;
+    if ($bracketMisscount || $bracketMissmatsh) {
+      return FALSE;
+    }
+    return TRUE;
+  }
+  
+  /**
+   * Looks for a string within another string -- BUT the search-string must be located *outside* of any brackets.
+   *
+   * This method looks for a string within another string. Brackets in the
+   * string the method is looking through will be respected, which means that
+   * only if the string the method is looking for is located outside of
+   * brackets, the search will be successful.
+   *
+   * @param     $term       (string) String in which the search shall take place.
+   * @param     $expression (string) String that should be searched.
+   * @return                (int)    This method returns -1 if no string was found, 
+   *                                 otherwise the offset at which the string was found.
+   */
+  function _searchString($term, $expression) {
+    $bracketCounter = 0; // Record where we are in the brackets. 
+    $leng = strlen($term);
+    $exprLeng = strlen($expression);
+    for ($i=0; $i<$leng; $i++) {
+      $char = $term[$i];
+      if ($char=='(' || $char=='[') {
+        $bracketCounter++;
+        continue;
+      }
+      elseif ($char==')' || $char==']') {
+        $bracketCounter--;
+      }
+      if ($bracketCounter == 0) {
+        // Check whether we can find the expression at this index.
+        if (substr($term, $i, $exprLeng) == $expression) return $i;
+      }
+    }
+    // Nothing was found.
+    return (-1);
+  }
+  
+  /**
+   * Split a string by a searator-string -- BUT the separator-string must be located *outside* of any brackets.
+   * 
+   * Returns an array of strings, each of which is a substring of string formed 
+   * by splitting it on boundaries formed by the string separator. 
+   *
+   * @param     $separator  (string) String that should be searched.
+   * @param     $term       (string) String in which the search shall take place.
+   * @return                (array)  see above
+   */
+  function _bracketExplode($separator, $term) {
+    // Note that it doesn't make sense for $separator to itself contain (,),[ or ],
+    // but as this is a private function we should be ok.
+    $resultArr   = array();
+    $bracketCounter = 0;  // Record where we are in the brackets. 
+    do { // BEGIN try block
+      // Check if any separator is in the term
+      $sepLeng =  strlen($separator);
+      if (strpos($term, $separator)===FALSE) { // no separator found so end now
+        $resultArr[] = $term;
+        break; // try-block
+      }
+      
+      // Make a substitute separator out of 'unused chars'.
+      $substituteSep = str_repeat(chr(2), $sepLeng);
+      
+      // Now determine the first bracket '(' or '['.
+      $tmp1 = strpos($term, '(');
+      $tmp2 = strpos($term, '[');
+      if ($tmp1===FALSE) {
+        $startAt = (int)$tmp2;
+      } elseif ($tmp2===FALSE) {
+        $startAt = (int)$tmp1;
+      } else {
+        $startAt = min($tmp1, $tmp2);
+      }
+      
+      // Get prefix string part before the first bracket.
+      $preStr = substr($term, 0, $startAt);
+      // Substitute separator in prefix string.
+      $preStr = str_replace($separator, $substituteSep, $preStr);
+      
+      // Now get the rest-string (postfix string)
+      $postStr = substr($term, $startAt);
+      // Go all the way through the rest-string.
+      $strLeng = strlen($postStr);
+      for ($i=0; $i < $strLeng; $i++) {
+        $char = $postStr[$i];
+        // Spot (,),[,] and modify our bracket counter.  Note there is an
+        // assumption here that you don't have a string(with[mis)matched]brackets.
+        // This should be ok as the dodgy string will be detected elsewhere.
+        if ($char=='(' || $char=='[') {
+          $bracketCounter++;
+          continue;
+        } 
+        elseif ($char==')' || $char==']') {
+          $bracketCounter--;
+        }
+        // If no brackets surround us check for separator
+        if ($bracketCounter == 0) {
+          // Check whether we can find the expression starting at this index.
+          if ((substr($postStr, $i, $sepLeng) == $separator)) {
+            // Substitute the found separator 
+            for ($j=0; $j<$sepLeng; $j++) {
+              $postStr[$i+$j] = $substituteSep[$j];
+            }
+          }
+        }
+      }
+      // Now explod using the substitute separator as key.
+      $resultArr = explode($substituteSep, $preStr . $postStr);
+    } while (FALSE); // End try block
+    // Return the results that we found. May be a array with 1 entry.
+    return $resultArr;
+  }
+
+  /**
+   * Split a string at it's groups, ie bracketed expressions
+   * 
+   * Returns an array of strings, when concatenated together would produce the original
+   * string.  ie a(b)cde(f)(g) would map to:
+   * array ('a', '(b)', cde', '(f)', '(g)')
+   *
+   * @param     $string  (string) The string to process
+   * @param     $open    (string) The substring for the open of a group
+   * @param     $close   (string) The substring for the close of a group
+   * @return             (array)  The parsed string, see above
+   */
+  function _getEndGroups($string, $open='[', $close=']') {
+    // Note that it doesn't make sense for $separator to itself contain (,),[ or ],
+    // but as this is a private function we should be ok.
+    $resultArr   = array();
+    do { // BEGIN try block
+      // Check if we have both an open and a close tag      
+      if (empty($open) and empty($close)) { // no separator found so end now
+        $resultArr[] = $string;
+        break; // try-block
+      }
+
+      if (empty($string)) {
+        $resultArr[] = $string;
+        break; // try-block
+      }
+
+      
+      while (!empty($string)) {
+        // Now determine the first bracket '(' or '['.
+        $openPos = strpos($string, $open);
+        $closePos = strpos($string, $close);
+        if ($openPos===FALSE || $closePos===FALSE) {
+          // Oh, no more groups to be found then.  Quit
+          $resultArr[] = $string;
+          break;
+        }
+
+        // Sanity check
+        if ($openPos > $closePos) {
+          // Malformed string, dump the rest and quit.
+          $resultArr[] = $string;
+          break;
+        }
+
+        // Get prefix string part before the first bracket.
+        $preStr = substr($string, 0, $openPos);
+        // This is the first string that will go in our output
+        if (!empty($preStr))
+          $resultArr[] = $preStr;
+
+        // Skip over what we've proceed, including the open char
+        $string = substr($string, $openPos + 1 - strlen($string));
+
+        // Find the next open char and adjust our close char
+//echo "close: $closePos\nopen: $openPos\n\n";
+        $closePos -= $openPos + 1;
+        $openPos = strpos($string, $open);
+//echo "close: $closePos\nopen: $openPos\n\n";
+
+        // While we have found nesting...
+        while ($openPos && $closePos && ($closePos > $openPos)) {
+          // Find another close pos after the one we are looking at
+          $closePos = strpos($string, $close, $closePos + 1);
+          // And skip our open
+          $openPos = strpos($string, $open, $openPos + 1);
+        }
+//echo "close: $closePos\nopen: $openPos\n\n";
+
+        // If we now have a close pos, then it's the end of the group.
+        if ($closePos === FALSE) {
+          // We didn't... so bail dumping what was left
+          $resultArr[] = $open.$string;
+          break;
+        }
+
+        // We did, so we can extract the group
+        $resultArr[] = $open.substr($string, 0, $closePos + 1);
+        // Skip what we have processed
+        $string = substr($string, $closePos + 1);
+      }
+    } while (FALSE); // End try block
+    // Return the results that we found. May be a array with 1 entry.
+    return $resultArr;
+  }
+  
+  /**
+   * Retrieves a substring before a delimiter.
+   *
+   * This method retrieves everything from a string before a given delimiter,
+   * not including the delimiter.
+   *
+   * @param     $string     (string) String, from which the substring should be extracted.
+   * @param     $delimiter  (string) String containing the delimiter to use.
+   * @return                (string) Substring from the original string before the delimiter.
+   * @see       _afterstr()
+   */
+  function _prestr(&$string, $delimiter, $offset=0) {
+    // Return the substring.
+    $offset = ($offset<0) ? 0 : $offset;
+    $pos = strpos($string, $delimiter, $offset);
+    if ($pos===FALSE) return $string; else return substr($string, 0, $pos);
+  }
+  
+  /**
+   * Retrieves a substring after a delimiter.
+   *
+   * This method retrieves everything from a string after a given delimiter,
+   * not including the delimiter.
+   *
+   * @param     $string     (string) String, from which the substring should be extracted.
+   * @param     $delimiter  (string) String containing the delimiter to use.
+   * @return                (string) Substring from the original string after the delimiter.
+   * @see       _prestr()
+   */
+  function _afterstr($string, $delimiter, $offset=0) {
+    $offset = ($offset<0) ? 0 : $offset;
+    // Return the substring.
+    return substr($string, strpos($string, $delimiter, $offset) + strlen($delimiter));
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPathBase                ------  Debug Stuff  ------                                    
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Alter the verbose (error) level reporting.
+   *
+   * Pass an int. >0 to turn on, 0 to turn off.  The higher the number, the 
+   * higher the level of verbosity. By default, the class has a verbose level 
+   * of 1.
+   *
+   * @param $levelOfVerbosity (int) default is 1 = on
+   */
+  function setVerbose($levelOfVerbosity = 1) {
+    $level = -1;
+    if ($levelOfVerbosity === TRUE) {
+      $level = 1;
+    } elseif ($levelOfVerbosity === FALSE) {
+      $level = 0;
+    } elseif (is_numeric($levelOfVerbosity)) {
+      $level = $levelOfVerbosity;
+    }
+    if ($level >= 0) $this->properties['verboseLevel'] = $levelOfVerbosity;
+  }
+   
+  /**
+   * Returns the last occured error message.
+   *
+   * @access public
+   * @return string (may be empty if there was no error at all)
+   * @see    _setLastError(), _lastError
+   */
+  function getLastError() {
+    return $this->_lastError;
+  }
+  
+  /**
+   * Creates a textual error message and sets it. 
+   * 
+   * example: 'XPath error in THIS_FILE_NAME:LINE. Message: YOUR_MESSAGE';
+   * 
+   * I don't think the message should include any markup because not everyone wants to debug 
+   * into the browser window.
+   * 
+   * You should call _displayError() rather than _setLastError() if you would like the message,
+   * dependant on their verbose settings, echoed to the screen.
+   * 
+   * @param $message (string) a textual error message default is ''
+   * @param $line    (int)    the line number where the error occured, use __LINE__
+   * @see getLastError()
+   */
+  function _setLastError($message='', $line='-', $file='-') {
+    $this->_lastError = 'XPath error in ' . basename($file) . ':' . $line . '. Message: ' . $message;
+  }
+  
+  /**
+   * Displays an error message.
+   *
+   * This method displays an error messages depending on the users verbose settings 
+   * and sets the last error message.  
+   *
+   * If also possibly stops the execution of the script.
+   * ### Terminate should not be allowed --fab.  Should it??  N.S.
+   *
+   * @param $message    (string)  Error message to be displayed.
+   * @param $lineNumber (int)     line number given by __LINE__
+   * @param $terminate  (bool)    (default TURE) End the execution of this script.
+   */
+  function _displayError($message, $lineNumber='-', $file='-', $terminate=TRUE) {
+    // Display the error message.
+    $err = '<b>XPath error in '.basename($file).':'.$lineNumber.'</b> '.$message."<br \>\n";
+    $this->_setLastError($message, $lineNumber, $file);
+    if (($this->properties['verboseLevel'] > 0) OR ($terminate)) echo $err;
+    // End the execution of this script.
+    if ($terminate) exit;
+  }
+
+  /**
+   * Displays a diagnostic message
+   *
+   * This method displays an error messages
+   *
+   * @param $message    (string)  Error message to be displayed.
+   * @param $lineNumber (int)     line number given by __LINE__
+   */
+  function _displayMessage($message, $lineNumber='-', $file='-') {
+    // Display the error message.
+    $err = '<b>XPath message from '.basename($file).':'.$lineNumber.'</b> '.$message."<br \>\n";
+    if ($this->properties['verboseLevel'] > 0) echo $err;
+  }
+  
+  /**
+   * Called to begin the debug run of a function.
+   *
+   * This method starts a <DIV><PRE> tag so that the entry to this function
+   * is clear to the debugging user.  Call _closeDebugFunction() at the
+   * end of the function to create a clean box round the function call.
+   *
+   * @author    Nigel Swinson <nigelswinson@users.sourceforge.net>
+   * @author    Sam   Blum    <bs_php@infeer.com>
+   * @param     $functionName (string) the name of the function we are beginning to debug
+   * @param     $bDebugFlag   (bool) TRUE if we are to draw a call stack, FALSE otherwise
+   * @return                  (array)  the output from the microtime() function.
+   * @see       _closeDebugFunction()
+   */
+  function _beginDebugFunction($functionName, $bDebugFlag) {
+    if ($bDebugFlag) {
+      $fileName = basename(__FILE__);
+      static $color = array('green','blue','red','lime','fuchsia', 'aqua');
+      static $colIndex = -1;
+      $colIndex++;
+      echo '<div style="clear:both" align="left"> ';
+      echo '<pre STYLE="border:solid thin '. $color[$colIndex % 6] . '; padding:5">';
+      echo '<a style="float:right;margin:5px" name="'.$this->iDebugNextLinkNumber.'Open" href="#'.$this->iDebugNextLinkNumber.'Close">Function Close '.$this->iDebugNextLinkNumber.'</a>';
+      echo "<STRONG>{$fileName} : {$functionName}</STRONG>";
+      echo '<hr style="clear:both">';
+      array_push($this->aDebugOpenLinks, $this->iDebugNextLinkNumber);
+      $this->iDebugNextLinkNumber++;
+    }
+
+    if ($this->bClassProfiling)
+      $this->_ProfBegin($FunctionName);
+
+    return TRUE;
+  }
+  
+  /**
+   * Called to end the debug run of a function.
+   *
+   * This method ends a <DIV><PRE> block and reports the time since $aStartTime
+   * is clear to the debugging user.
+   *
+   * @author    Nigel Swinson <nigelswinson@users.sourceforge.net>
+   * @param     $functionName (string) the name of the function we are beginning to debug
+   * @param     $return_value (mixed) the return value from the function call that 
+   *                                  we are debugging
+   * @param     $bDebugFlag   (bool) TRUE if we are to draw a call stack, FALSE otherwise
+   */
+  function _closeDebugFunction($functionName, $returnValue = "", $bDebugFlag) {
+    if ($bDebugFlag) {
+      echo "<hr>";
+      $iOpenLinkNumber = array_pop($this->aDebugOpenLinks);
+      echo '<a style="float:right" name="'.$iOpenLinkNumber.'Close" href="#'.$iOpenLinkNumber.'Open">Function Open '.$iOpenLinkNumber.'</a>';
+      if (isSet($returnValue)) {
+      if (is_array($returnValue))
+        echo "Return Value: ".print_r($returnValue)."\n";
+      else if (is_numeric($returnValue)) 
+        echo "Return Value: ".(string)$returnValue."\n";
+      else if (is_bool($returnValue)) 
+        echo "Return Value: ".($returnValue ? "TRUE" : "FALSE")."\n";
+      else 
+        echo "Return Value: \"".htmlspecialchars($returnValue)."\"\n";
+    }
+      echo '<br style="clear:both">';
+      echo " \n</pre></div>";
+    }
+  
+    if ($this->bClassProfiling)
+      $this->_ProfEnd($FunctionName);
+
+    return TRUE;
+  }
+  
+  /**
+    * Profile begin call
+    */
+  function _ProfBegin($sonFuncName) {
+    static $entryTmpl = array ( 'start' => array(),
+                  'recursiveCount' => 0,
+                  'totTime' => 0,
+                  'callCount' => 0  );
+    $now = explode(' ', microtime());
+
+    if (empty($this->callStack)) {
+      $fatherFuncName = '';
+    }
+    else {
+      $fatherFuncName = $this->callStack[sizeOf($this->callStack)-1];
+      $fatherEntry = &$this->profile[$fatherFuncName];
+    }
+    $this->callStack[] = $sonFuncName;
+
+    if (!isSet($this->profile[$sonFuncName])) {
+      $this->profile[$sonFuncName] = $entryTmpl;
+    }
+
+    $sonEntry = &$this->profile[$sonFuncName];
+    $sonEntry['callCount']++;
+    // if we call the t's the same function let the time run, otherwise sum up
+    if ($fatherFuncName == $sonFuncName) {
+      $sonEntry['recursiveCount']++;
+    }
+    if (!empty($fatherFuncName)) {
+      $last = $fatherEntry['start'];
+    $fatherEntry['totTime'] += round( (($now[1] - $last[1]) + ($now[0] - $last[0]))*10000 );
+      $fatherEntry['start'] = 0;
+    }
+    $sonEntry['start'] = explode(' ', microtime());
+  }
+
+  /**
+   * Profile end call
+   */
+  function _ProfEnd($sonFuncName) {
+    $now = explode(' ', microtime());
+
+    array_pop($this->callStack);
+    if (empty($this->callStack)) {
+      $fatherFuncName = '';
+    }
+    else {
+      $fatherFuncName = $this->callStack[sizeOf($this->callStack)-1];
+      $fatherEntry = &$this->profile[$fatherFuncName];
+    }
+    $sonEntry = &$this->profile[$sonFuncName];
+    if (empty($sonEntry)) {
+      echo "ERROR in profEnd(): '$funcNam' not in list. Seams it was never started ;o)";
+    }
+
+    $last = $sonEntry['start'];
+    $sonEntry['totTime'] += round( (($now[1] - $last[1]) + ($now[0] - $last[0]))*10000 );
+    $sonEntry['start'] = 0;
+    if (!empty($fatherEntry)) $fatherEntry['start'] = explode(' ', microtime());
+  }
+
+    /**
+   * Show profile gathered so far as HTML table
+   */
+  function _ProfileToHtml() {
+    $sortArr = array();
+    if (empty($this->profile)) return '';
+    reset($this->profile);
+    while (list($funcName) = each($this->profile)) {
+      $sortArrKey[] = $this->profile[$funcName]['totTime'];
+      $sortArrVal[] = $funcName;
+    }
+    //echo '<pre>';var_dump($sortArrVal);echo '</pre>';
+    array_multisort ($sortArrKey, SORT_DESC, $sortArrVal );
+    //echo '<pre>';var_dump($sortArrVal);echo '</pre>';
+
+    $totTime = 0;
+    $size = sizeOf($sortArrVal);
+    for ($i=0; $i<$size; $i++) {
+      $funcName = &$sortArrVal[$i];
+      $totTime += $this->profile[$funcName]['totTime'];
+    }
+    $out = '<table border="1">';
+    $out .='<tr align="center" bgcolor="#bcd6f1"><th>Function</th><th> % </th><th>Total [ms]</th><th># Call</th><th>[ms] per Call</th><th># Recursive</th></tr>';
+    for ($i=0; $i<$size; $i++) {
+      $funcName = &$sortArrVal[$i];
+      $row = &$this->profile[$funcName];
+      $procent = round($row['totTime']*100/$totTime);
+      if ($procent>20) $bgc = '#ff8080';
+      elseif ($procent>15) $bgc = '#ff9999';
+      elseif ($procent>10) $bgc = '#ffcccc';
+      elseif ($procent>5) $bgc = '#ffffcc';
+      else $bgc = '#66ff99';
+
+      $out .="<tr align='center' bgcolor='{$bgc}'>";
+      $out .='<td>'. $funcName .'</td><td>'. $procent .'% '.'</td><td>'. $row['totTime']/10 .'</td><td>'. $row['callCount'] .'</td><td>'. round($row['totTime']/10/$row['callCount'],2) .'</td><td>'. $row['recursiveCount'].'</td>';
+      $out .='</tr>';
+    }
+    $out .= '</table> Total Time [' . $totTime/10 .'ms]' ;
+
+    echo $out;
+    return TRUE;
+  }
+
+  /**
+   * Echo an XPath context for diagnostic purposes
+   *
+   * @param $context   (array)   An XPath context
+   */
+  function _printContext($context) {
+    echo "{$context['nodePath']}({$context['pos']}/{$context['size']})";
+  }
+  
+  /**
+   * This is a debug helper function. It dumps the node-tree as HTML
+   *
+   * *QUICK AND DIRTY*. Needs some polishing.
+   *
+   * @param $node   (array)   A node 
+   * @param $indent (string) (optional, default=''). For internal recursive calls.
+   */
+  function _treeDump($node, $indent = '') {
+    $out = '';
+    
+    // Get rid of recursion
+    $parentName = empty($node['parentNode']) ? "SUPER ROOT" :  $node['parentNode']['name'];
+    unset($node['parentNode']);
+    $node['parentNode'] = $parentName ;
+    
+    $out .= "NODE[{$node['name']}]\n";
+    
+    foreach($node as $key => $val) {
+      if ($key === 'childNodes') continue;
+      if (is_Array($val)) {
+        $out .= $indent . "  [{$key}]\n" . arrayToStr($val, $indent . '    ');
+      } else {
+        $out .= $indent . "  [{$key}] => '{$val}' \n";
+      }
+    }
+    
+    if (!empty($node['childNodes'])) {
+      $out .= $indent . "  ['childNodes'] (Size = ".sizeOf($node['childNodes']).")\n";
+      foreach($node['childNodes'] as $key => $childNode) {
+        $out .= $indent . "     [$key] => " . $this->_treeDump($childNode, $indent . '       ') . "\n";
+      }
+    }
+    
+    if (empty($indent)) {
+      return "<pre>" . htmlspecialchars($out) . "</pre>";
+    }
+    return $out;
+  }
+} // END OF CLASS XPathBase
+
+
+/************************************************************************************************
+* ===============================================================================================
+*                             X P a t h E n g i n e  -  Class                                    
+* ===============================================================================================
+************************************************************************************************/
+
+class XPathEngine extends XPathBase {
+  
+  // List of supported XPath axes.
+  // What a stupid idea from W3C to take axes name containing a '-' (dash)
+  // NOTE: We replace the '-' with '_' to avoid the conflict with the minus operator.
+  //       We will then do the same on the users Xpath querys
+  //   -sibling => _sibling
+  //   -or-     =>     _or_
+  //  
+  // This array contains a list of all valid axes that can be evaluated in an
+  // XPath query.
+  var $axes = array ( 'ancestor', 'ancestor_or_self', 'attribute', 'child', 'descendant', 
+                        'descendant_or_self', 'following', 'following_sibling',  
+                        'namespace', 'parent', 'preceding', 'preceding_sibling', 'self' 
+     );
+  
+  // List of supported XPath functions.
+  // What a stupid idea from W3C to take function name containing a '-' (dash)
+  // NOTE: We replace the '-' with '_' to avoid the conflict with the minus operator.
+  //       We will then do the same on the users Xpath querys 
+  //   starts-with      => starts_with
+  //   substring-before => substring_before
+  //   substring-after  => substring_after
+  //   string-length    => string_length
+  //
+  // This array contains a list of all valid functions that can be evaluated
+  // in an XPath query.
+  var $functions = array ( 'last', 'position', 'count', 'id', 'name',
+    'string', 'concat', 'starts_with', 'contains', 'substring_before',
+    'substring_after', 'substring', 'string_length', 'normalize_space', 'translate',
+    'boolean', 'not', 'true', 'false', 'lang', 'number', 'sum', 'floor',
+    'ceiling', 'round', 'x_lower', 'x_upper', 'generate_id' );
+    
+  // List of supported XPath operators.
+  //
+  // This array contains a list of all valid operators that can be evaluated
+  // in a predicate of an XPath query. The list is ordered by the
+  // precedence of the operators (lowest precedence first).
+  var $operators = array( ' or ', ' and ', '=', '!=', '<=', '<', '>=', '>',
+    '+', '-', '*', ' div ', ' mod ', ' | ');
+
+  // List of literals from the xPath string.
+  var $axPathLiterals = array();
+  
+  // The index and tree that is created during the analysis of an XML source.
+  var $nodeIndex = array();
+  var $nodeRoot  = array();
+  var $emptyNode = array(
+                     'name'        => '',       // The tag name. E.g. In <FOO bar="aaa"/> it would be 'FOO'
+                     'attributes'  => array(),  // The attributes of the tag E.g. In <FOO bar="aaa"/> it would be array('bar'=>'aaa')
+                     'childNodes'  => array(),  // Array of pointers to child nodes.
+                     'textParts'   => array(),  // Array of text parts between the cilderen E.g. <FOO>aa<A>bb<B/>cc</A>dd</FOO> -> array('aa','bb','cc','dd')
+                     'parentNode'   => NULL,     // Pointer to parent node or NULL if this node is the 'super root'
+                     //-- *!* Following vars are set by the indexer and is for optimisation only *!*
+                     'depth'       => 0,  // The tag depth (or tree level) starting with the root tag at 0.
+                     'pos'         => 0,  // Is the zero-based position this node has in the parents 'childNodes'-list.
+                     'contextPos'  => 1,  // Is the one-based position this node has by counting the siblings tags (tags with same name)
+                     'xpath'       => ''  // Is the abs. XPath to this node.
+                   );
+  var $_indexIsDirty = FALSE;
+
+  
+  // These variable used during the parse XML source
+  var $nodeStack       = array(); // The elements that we have still to close.
+  var $parseStackIndex = 0;       // The current element of the nodeStack[] that we are adding to while 
+                                  // parsing an XML source.  Corresponds to the depth of the xml node.
+                                  // in our input data.
+  var $parseOptions    = array(); // Used to set the PHP's XML parser options (see xml_parser_set_option)
+  var $parsedTextLocation   = ''; // A reference to where we have to put char data collected during XML parsing
+  var $parsInCData     = 0 ;      // Is >0 when we are inside a CDATA section.  
+  var $parseSkipWhiteCache = 0;   // A cache of the skip whitespace parse option to speed up the parse.
+
+  // This is the array of error strings, to keep consistency.
+  var $errorStrings = array(
+    'AbsoluteXPathRequired' => "The supplied xPath '%s' does not *uniquely* describe a node in the xml document.",
+    'NoNodeMatch'           => "The supplied xPath-query '%s' does not match *any* node in the xml document.",
+    'RootNodeAlreadyExists' => "An xml document may have only one root node."
+    );
+    
+  /**
+   * Constructor
+   *
+   * Optionally you may call this constructor with the XML-filename to parse and the 
+   * XML option vector. Each of the entries in the option vector will be passed to
+   * xml_parser_set_option().
+   *
+   * A option vector sample: 
+   *   $xmlOpt = array(XML_OPTION_CASE_FOLDING => FALSE, 
+   *                   XML_OPTION_SKIP_WHITE => TRUE);
+   *
+   * @param  $userXmlOptions (array) (optional) Vector of (<optionID>=><value>, 
+   *                                 <optionID>=><value>, ...).  See PHP's
+   *                                 xml_parser_set_option() docu for a list of possible
+   *                                 options.
+   * @see   importFromFile(), importFromString(), setXmlOptions()
+   */
+  function XPathEngine($userXmlOptions=array()) {
+    parent::XPathBase();
+    // Default to not folding case
+    $this->parseOptions[XML_OPTION_CASE_FOLDING] = FALSE;
+    // And not skipping whitespace
+    $this->parseOptions[XML_OPTION_SKIP_WHITE] = FALSE;
+    
+    // Now merge in the overrides.
+    // Don't use PHP's array_merge!
+    if (is_array($userXmlOptions)) {
+      foreach($userXmlOptions as $key => $val) $this->parseOptions[$key] = $val;
+    }
+  }
+  
+  /**
+   * Resets the object so it's able to take a new xml sting/file
+   *
+   * Constructing objects is slow.  If you can, reuse ones that you have used already
+   * by using this reset() function.
+   */
+  function reset() {
+    parent::reset();
+    $this->properties['xmlFile']  = ''; 
+    $this->parseStackIndex = 0;
+    $this->parsedTextLocation = '';
+    $this->parsInCData   = 0;
+    $this->nodeIndex     = array();
+    $this->nodeRoot      = array();
+    $this->nodeStack     = array();
+    $this->aLiterals     = array();
+    $this->_indexIsDirty = FALSE;
+  }
+  
+  
+  //-----------------------------------------------------------------------------------------
+  // XPathEngine              ------  Get / Set Stuff  ------                                
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Returns the property/ies you want.
+   * 
+   * if $param is not given, all properties will be returned in a hash.
+   *
+   * @param  $param (string) the property you want the value of, or NULL for all the properties
+   * @return        (mixed)  string OR hash of all params, or NULL on an unknown parameter.
+   */
+  function getProperties($param=NULL) {
+    $this->properties['hasContent']      = !empty($this->nodeRoot);
+    $this->properties['caseFolding']     = $this->parseOptions[XML_OPTION_CASE_FOLDING];
+    $this->properties['skipWhiteSpaces'] = $this->parseOptions[XML_OPTION_SKIP_WHITE];
+    
+    if (empty($param)) return $this->properties;
+    
+    if (isSet($this->properties[$param])) {
+      return $this->properties[$param];
+    } else {
+      return NULL;
+    }
+  }
+  
+  /**
+   * Set an xml_parser_set_option()
+   *
+   * @param $optionID (int) The option ID (e.g. XML_OPTION_SKIP_WHITE)
+   * @param $value    (int) The option value.
+   * @see XML parser functions in PHP doc
+   */
+  function setXmlOption($optionID, $value) {
+    if (!is_numeric($optionID)) return;
+     $this->parseOptions[$optionID] = $value;
+  }
+
+  /**
+   * Sets a number of xml_parser_set_option()s
+   *
+   * @param  $userXmlOptions (array) An array of parser options.
+   * @see setXmlOption
+   */
+  function setXmlOptions($userXmlOptions=array()) {
+    if (!is_array($userXmlOptions)) return;
+    foreach($userXmlOptions as $key => $val) {
+      $this->setXmlOption($key, $val);
+    }
+  }
+  
+  /**
+   * Alternative way to control whether case-folding is enabled for this XML parser.
+   *
+   * Short cut to setXmlOptions(XML_OPTION_CASE_FOLDING, TRUE/FALSE)
+   *
+   * When it comes to XML, case-folding simply means uppercasing all tag- 
+   * and attribute-names (NOT the content) if set to TRUE.  Note if you
+   * have this option set, then your XPath queries will also be case folded 
+   * for you.
+   *
+   * @param $onOff (bool) (default TRUE) 
+   * @see XML parser functions in PHP doc
+   */
+  function setCaseFolding($onOff=TRUE) {
+    $this->parseOptions[XML_OPTION_CASE_FOLDING] = $onOff;
+  }
+  
+  /**
+   * Alternative way to control whether skip-white-spaces is enabled for this XML parser.
+   *
+   * Short cut to setXmlOptions(XML_OPTION_SKIP_WHITE, TRUE/FALSE)
+   *
+   * When it comes to XML, skip-white-spaces will trim the tag content.
+   * An XML file with no whitespace will be faster to process, but will make 
+   * your data less human readable when you come to write it out.
+   *
+   * Running with this option on will slow the class down, so if you want to 
+   * speed up your XML, then run it through once skipping white-spaces, then
+   * write out the new version of your XML without whitespace, then use the
+   * new XML file with skip whitespaces turned off.
+   *
+   * @param $onOff (bool) (default TRUE) 
+   * @see XML parser functions in PHP doc
+   */
+  function setSkipWhiteSpaces($onOff=TRUE) {
+    $this->parseOptions[XML_OPTION_SKIP_WHITE] = $onOff;
+  }
+   
+  /**
+   * Get the node defined by the $absoluteXPath.
+   *
+   * @param   $absoluteXPath (string) (optional, default is 'super-root') xpath to the node.
+   * @return                 (array)  The node, or FALSE if the node wasn't found.
+   */
+  function &getNode($absoluteXPath='') {
+    if ($absoluteXPath==='/') $absoluteXPath = '';
+    if (!isSet($this->nodeIndex[$absoluteXPath])) return FALSE;
+    if ($this->_indexIsDirty) $this->reindexNodeTree();
+    return $this->nodeIndex[$absoluteXPath];
+  }
+
+  /**
+   * Get a the content of a node text part or node attribute.
+   * 
+   * If the absolute Xpath references an attribute (Xpath ends with @ or attribute::), 
+   * then the text value of that node-attribute is returned.
+   * Otherwise the Xpath is referencing a text part of the node. This can be either a 
+   * direct reference to a text part (Xpath ends with text()[<nr>]) or indirect reference 
+   * (a simple abs. Xpath to a node).
+   * 1) Direct Reference (xpath ends with text()[<part-number>]):
+   *   If the 'part-number' is omitted, the first text-part is assumed; starting by 1.
+   *   Negative numbers are allowed, where -1 is the last text-part a.s.o.
+   * 2) Indirect Reference (a simple abs. Xpath to a node):
+   *   Default is to return the *whole text*; that is the concated text-parts of the matching
+   *   node. (NOTE that only in this case you'll only get a copy and changes to the returned  
+   *   value wounld have no effect). Optionally you may pass a parameter 
+   *   $textPartNr to define the text-part you want;  starting by 1.
+   *   Negative numbers are allowed, where -1 is the last text-part a.s.o.
+   *
+   * NOTE I : The returned value can be fetched by reference
+   *          E.g. $text =& wholeText(). If you wish to modify the text.
+   * NOTE II: text-part numbers out of range will return FALSE
+   * SIDENOTE:The function name is a suggestion from W3C in the XPath specification level 3.
+   *
+   * @param   $absoluteXPath  (string)  xpath to the node (See above).
+   * @param   $textPartNr     (int)     If referring to a node, specifies which text part 
+   *                                    to query.
+   * @return                  (&string) A *reference* to the text if the node that the other 
+   *                                    parameters describe or FALSE if the node is not found.
+   */
+  function &wholeText($absoluteXPath, $textPartNr=NULL) {
+    $status = FALSE;
+    $text   = NULL;
+    if ($this->_indexIsDirty) $this->reindexNodeTree();
+    
+    do { // try-block
+      if (preg_match(";(.*)/(attribute::|@)([^/]*)$;U", $absoluteXPath, $matches)) {
+        $absoluteXPath = $matches[1];
+        $attribute = $matches[3];
+        if (!isSet($this->nodeIndex[$absoluteXPath]['attributes'][$attribute])) {
+          $this->_displayError("The $absoluteXPath/attribute::$attribute value isn't a node in this document.", __LINE__, __FILE__, FALSE);
+          break; // try-block
+        }
+        $text =& $this->nodeIndex[$absoluteXPath]['attributes'][$attribute];
+        $status = TRUE;
+        break; // try-block
+      }
+            
+      // Xpath contains a 'text()'-function, thus goes right to a text node. If so interpret the Xpath.
+      if (preg_match(":(.*)/text\(\)(\[(.*)\])?$:U", $absoluteXPath, $matches)) {
+        $absoluteXPath = $matches[1];
+ 
+        if (!isSet($this->nodeIndex[$absoluteXPath])) {
+            $this->_displayError("The $absoluteXPath value isn't a node in this document.", __LINE__, __FILE__, FALSE);
+            break; // try-block
+        }
+
+        // Get the amount of the text parts in the node.
+        $textPartSize = sizeOf($this->nodeIndex[$absoluteXPath]['textParts']);
+
+        // default to the first text node if a text node was not specified
+        $textPartNr = isSet($matches[2]) ? substr($matches[2],1,-1) : 1;
+
+        // Support negative indexes like -1 === last a.s.o.
+        if ($textPartNr < 0) $textPartNr = $textPartSize + $textPartNr +1;
+        if (($textPartNr <= 0) OR ($textPartNr > $textPartSize)) {
+          $this->_displayError("The $absoluteXPath/text()[$textPartNr] value isn't a NODE in this document.", __LINE__, __FILE__, FALSE);
+          break; // try-block
+        }
+        $text =& $this->nodeIndex[$absoluteXPath]['textParts'][$textPartNr - 1];
+        $status = TRUE;
+        break; // try-block
+      }
+      
+      // At this point we have been given an xpath with neither a 'text()' nor 'attribute::' axis at the end
+      // So we assume a get to text is wanted and use the optioanl fallback parameters $textPartNr
+     
+      if (!isSet($this->nodeIndex[$absoluteXPath])) {
+          $this->_displayError("The $absoluteXPath value isn't a node in this document.", __LINE__, __FILE__, FALSE);
+          break; // try-block
+      }
+
+      // Get the amount of the text parts in the node.
+      $textPartSize = sizeOf($this->nodeIndex[$absoluteXPath]['textParts']);
+
+      // If $textPartNr == NULL we return a *copy* of the whole concated text-parts
+      if (is_null($textPartNr)) {
+        unset($text);
+        $text = implode('', $this->nodeIndex[$absoluteXPath]['textParts']);
+        $status = TRUE;
+        break; // try-block
+      }
+      
+      // Support negative indexes like -1 === last a.s.o.
+      if ($textPartNr < 0) $textPartNr = $textPartSize + $textPartNr +1;
+      if (($textPartNr <= 0) OR ($textPartNr > $textPartSize)) {
+        $this->_displayError("The $absoluteXPath has no text part at pos [$textPartNr] (Note: text parts start with 1).", __LINE__, __FILE__, FALSE);
+        break; // try-block
+      }
+      $text =& $this->nodeIndex[$absoluteXPath]['textParts'][$textPartNr -1];
+      $status = TRUE;
+    } while (FALSE); // END try-block
+    
+    if (!$status) return FALSE;
+    return $text;
+  }
+
+  /**
+   * Obtain the string value of an object
+   *
+   * http://www.w3.org/TR/xpath#dt-string-value
+   *
+   * "For every type of node, there is a way of determining a string-value for a node of that type. 
+   * For some types of node, the string-value is part of the node; for other types of node, the 
+   * string-value is computed from the string-value of descendant nodes."
+   *
+   * @param $node   (node)   The node we have to convert
+   * @return        (string) The string value of the node.  "" if the object has no evaluatable
+   *                         string value
+   */
+  function _stringValue($node) {
+    // Decode the entitites and then add the resulting literal string into our array.
+    return $this->_addLiteral($this->decodeEntities($this->wholeText($node)));
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPathEngine           ------ Export the XML Document ------                             
+  //-----------------------------------------------------------------------------------------
+   
+  /**
+   * Returns the containing XML as marked up HTML with specified nodes hi-lighted
+   *
+   * @param $absoluteXPath    (string) The address of the node you would like to export.
+   *                                   If empty the whole document will be exported.
+   * @param $hilighXpathList  (array)  A list of nodes that you would like to highlight
+   * @return                  (mixed)  The Xml document marked up as HTML so that it can
+   *                                   be viewed in a browser, including any XML headers.
+   *                                   FALSE on error.
+   * @see _export()    
+   */
+  function exportAsHtml($absoluteXPath='', $hilightXpathList=array()) {
+    $htmlString = $this->_export($absoluteXPath, $xmlHeader=NULL, $hilightXpathList);
+    if (!$htmlString) return FALSE;
+    return "<pre>\n" . $htmlString . "\n</pre>"; 
+  }
+  
+  /**
+   * Given a context this function returns the containing XML
+   *
+   * @param $absoluteXPath  (string) The address of the node you would like to export.
+   *                                 If empty the whole document will be exported.
+   * @param $xmlHeader      (array)  The string that you would like to appear before
+   *                                 the XML content.  ie before the <root></root>.  If you
+   *                                 do not specify this argument, the xmlHeader that was 
+   *                                 found in the parsed xml file will be used instead.
+   * @return                (mixed)  The Xml fragment/document, suitable for writing
+   *                                 out to an .xml file or as part of a larger xml file, or
+   *                                 FALSE on error.
+   * @see _export()    
+   */
+  function exportAsXml($absoluteXPath='', $xmlHeader=NULL) {
+    $this->hilightXpathList = NULL;
+    return $this->_export($absoluteXPath, $xmlHeader); 
+  }
+    
+  /**
+   * Generates a XML string with the content of the current document and writes it to a file.
+   *
+   * Per default includes a <?xml ...> tag at the start of the data too. 
+   *
+   * @param     $fileName       (string) 
+   * @param     $absoluteXPath  (string) The path to the parent node you want(see text above)
+   * @param     $xmlHeader      (array)  The string that you would like to appear before
+   *                                     the XML content.  ie before the <root></root>.  If you
+   *                                     do not specify this argument, the xmlHeader that was 
+   *                                     found in the parsed xml file will be used instead.
+   * @return                    (string) The returned string contains well-formed XML data 
+   *                                     or FALSE on error.
+   * @see       exportAsXml(), exportAsHtml()
+   */
+  function exportToFile($fileName, $absoluteXPath='', $xmlHeader=NULL) {   
+    $status = FALSE;
+    do { // try-block
+      if (!($hFile = fopen($fileName, "wb"))) {   // Did we open the file ok?
+        $errStr = "Failed to open the $fileName xml file.";
+        break; // try-block
+      }
+      
+      if ($this->properties['OS_supports_flock']) {
+        if (!flock($hFile, LOCK_EX + LOCK_NB)) {  // Lock the file
+          $errStr = "Couldn't get an exclusive lock on the $fileName file.";
+          break; // try-block
+        }
+      }
+      if (!($xmlOut = $this->_export($absoluteXPath, $xmlHeader))) {
+        $errStr = "Export failed";
+        break; // try-block
+      }
+      
+      $iBytesWritten = fwrite($hFile, $xmlOut);
+      if ($iBytesWritten != strlen($xmlOut)) {
+        $errStr = "Write error when writing back the $fileName file.";
+        break; // try-block
+      }
+      
+      // Flush and unlock the file
+      @fflush($hFile);
+      $status = TRUE;
+    } while(FALSE);
+    
+    @flock($hFile, LOCK_UN);
+    @fclose($hFile);
+    // Sanity check the produced file.
+    clearstatcache();
+    if (filesize($fileName) < strlen($xmlOut)) {
+      $errStr = "Write error when writing back the $fileName file.";
+      $status = FALSE;
+    }
+    
+    if (!$status)  $this->_displayError($errStr, __LINE__, __FILE__, FALSE);
+    return $status;
+  }
+
+  /**
+   * Generates a XML string with the content of the current document.
+   *
+   * This is the start for extracting the XML-data from the node-tree. We do some preperations
+   * and then call _InternalExport() to fetch the main XML-data. You optionally may pass 
+   * xpath to any node that will then be used as top node, to extract XML-parts of the 
+   * document. Default is '', meaning to extract the whole document.
+   *
+   * You also may pass a 'xmlHeader' (usually something like <?xml version="1.0"? > that will
+   * overwrite any other 'xmlHeader', if there was one in the original source.  If there
+   * wasn't one in the original source, and you still don't specify one, then it will
+   * use a default of <?xml version="1.0"? >
+   * Finaly, when exporting to HTML, you may pass a vector xPaths you want to hi-light.
+   * The hi-lighted tags and attributes will receive a nice color. 
+   * 
+   * NOTE I : The output can have 2 formats:
+   *       a) If "skip white spaces" is/was set. (Not Recommended - slower)
+   *          The output is formatted by adding indenting and carriage returns.
+   *       b) If "skip white spaces" is/was *NOT* set.
+   *          'as is'. No formatting is done. The output should the same as the 
+   *          the original parsed XML source. 
+   *
+   * @param  $absoluteXPath (string) (optional, default is root) The node we choose as top-node
+   * @param  $xmlHeader     (string) (optional) content before <root/> (see text above)
+   * @param  $hilightXpath  (array)  (optional) a vector of xPaths to nodes we wat to 
+   *                                 hi-light (see text above)
+   * @return                (mixed)  The xml string, or FALSE on error.
+   */
+  function _export($absoluteXPath='', $xmlHeader=NULL, $hilightXpathList='') {
+    // Check whether a root node is given.
+    if (empty($absoluteXpath)) $absoluteXpath = '';
+    if ($absoluteXpath == '/') $absoluteXpath = '';
+    if ($this->_indexIsDirty) $this->reindexNodeTree();
+    if (!isSet($this->nodeIndex[$absoluteXpath])) {
+      // If the $absoluteXpath was '' and it didn't exist, then the document is empty
+      // and we can safely return ''.
+      if ($absoluteXpath == '') return '';
+      $this->_displayError("The given xpath '{$absoluteXpath}' isn't a node in this document.", __LINE__, __FILE__, FALSE);
+      return FALSE;
+    }
+    
+    $this->hilightXpathList = $hilightXpathList;
+    $this->indentStep = '  ';
+    $hilightIsActive = is_array($hilightXpathList);
+    if ($hilightIsActive) {
+      $this->indentStep = '&nbsp;&nbsp;&nbsp;&nbsp;';
+    }    
+    
+    // Cache this now
+    $this->parseSkipWhiteCache = isSet($this->parseOptions[XML_OPTION_SKIP_WHITE]) ? $this->parseOptions[XML_OPTION_SKIP_WHITE] : FALSE;
+
+    ///////////////////////////////////////
+    // Get the starting node and begin with the header
+
+    // Get the start node.  The super root is a special case.
+    $startNode = NULL;
+    if (empty($absoluteXPath)) {
+      $superRoot = $this->nodeIndex[''];
+      // If they didn't specify an xml header, use the one in the object
+      if (is_null($xmlHeader)) {
+        $xmlHeader = $this->parseSkipWhiteCache ? trim($superRoot['textParts'][0]) : $superRoot['textParts'][0];
+        // If we still don't have an XML header, then use a suitable default
+        if (empty($xmlHeader)) {
+            $xmlHeader = '<?xml version="1.0"?>';
+        }
+      }
+
+      if (isSet($superRoot['childNodes'][0])) $startNode = $superRoot['childNodes'][0];
+    } else {
+      $startNode = $this->nodeIndex[$absoluteXPath];
+    }
+
+    if (!empty($xmlHeader)) { 
+      $xmlOut = $this->parseSkipWhiteCache ? $xmlHeader."\n" : $xmlHeader;
+    } else {
+      $xmlOut = '';
+    }
+
+    ///////////////////////////////////////
+    // Output the document.
+
+    if (($xmlOut .= $this->_InternalExport($startNode)) === FALSE) {
+      return FALSE;
+    }
+    
+    ///////////////////////////////////////
+
+    // Convert our markers to hi-lights.
+    if ($hilightIsActive) {
+      $from = array('<', '>', chr(2), chr(3));
+      $to = array('&lt;', '&gt;', '<font color="#FF0000"><b>', '</b></font>');
+      $xmlOut = str_replace($from, $to, $xmlOut);
+    }
+    return $xmlOut; 
+  }  
+
+  /**
+   * Export the xml document starting at the named node.
+   *
+   * @param $node (node)   The node we have to start exporting from
+   * @return      (string) The string representation of the node.
+   */
+  function _InternalExport($node) {
+    $ThisFunctionName = '_InternalExport';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Exporting node: ".$node['xpath']."<br>\n";
+    }
+
+    ////////////////////////////////
+
+    // Quick out.
+    if (empty($node)) return '';
+
+    // The output starts as empty.
+    $xmlOut = '';
+    // This loop will output the text before the current child of a parent then the 
+    // current child.  Where the child is a short tag we output the child, then move
+    // onto the next child.  Where the child is not a short tag, we output the open tag, 
+    // then queue up on currentParentStack[] the child.  
+    //
+    // When we run out of children, we then output the last text part, and close the 
+    // 'parent' tag before popping the stack and carrying on.
+    //
+    // To illustrate, the numbers in this xml file indicate what is output on each
+    // pass of the while loop:
+    //
+    // 1
+    // <1>2
+    //  <2>3
+    //   <3/>4
+    //  </4>5
+    //  <5/>6
+    // </6>
+
+    // Although this is neater done using recursion, there's a 33% performance saving
+    // to be gained by using this stack mechanism.
+
+    // Only add CR's if "skip white spaces" was set. Otherwise leave as is.
+    $CR = ($this->parseSkipWhiteCache) ? "\n" : '';
+    $currentIndent = '';
+    $hilightIsActive = is_array($this->hilightXpathList);
+
+    // To keep track of where we are in the document we use a node stack.  The node 
+    // stack has the following parallel entries:
+    //   'Parent'     => (array) A copy of the parent node that who's children we are 
+    //                           exporting
+    //   'ChildIndex' => (array) The child index of the corresponding parent that we
+    //                           are currently exporting.
+    //   'Highlighted'=> (bool)  If we are highlighting this node.  Only relevant if
+    //                           the hilight is active.
+
+    // Setup our node stack.  The loop is designed to output children of a parent, 
+    // not the parent itself, so we must put the parent on as the starting point.
+    $nodeStack['Parent'] = array($node['parentNode']);
+    // And add the childpos of our node in it's parent to our "child index stack".
+    $nodeStack['ChildIndex'] = array($node['pos']);
+    // We start at 0.
+    $nodeStackIndex = 0;
+
+    // We have not to output text before/after our node, so blank it.  We will recover it
+    // later
+    $OldPreceedingStringValue = $nodeStack['Parent'][0]['textParts'][$node['pos']];
+    $OldPreceedingStringRef =& $nodeStack['Parent'][0]['textParts'][$node['pos']];
+    $OldPreceedingStringRef = "";
+    $currentXpath = "";
+
+    // While we still have data on our stack
+    while ($nodeStackIndex >= 0) {
+      // Count the children and get a copy of the current child.
+      $iChildCount = count($nodeStack['Parent'][$nodeStackIndex]['childNodes']);
+      $currentChild = $nodeStack['ChildIndex'][$nodeStackIndex];
+      // Only do the auto indenting if the $parseSkipWhiteCache flag was set.
+      if ($this->parseSkipWhiteCache)
+        $currentIndent = str_repeat($this->indentStep, $nodeStackIndex);
+
+      if ($bDebugThisFunction)
+        echo "Exporting child ".($currentChild+1)." of node {$nodeStack['Parent'][$nodeStackIndex]['xpath']}\n";
+
+      ///////////////////////////////////////////
+      // Add the text before our child.
+
+      // Add the text part before the current child
+      $tmpTxt =& $nodeStack['Parent'][$nodeStackIndex]['textParts'][$currentChild];
+      if (isSet($tmpTxt) AND ($tmpTxt!="")) {
+        // Only add CR indent if there were children
+        if ($iChildCount)
+          $xmlOut .= $CR.$currentIndent;
+        // Hilight if necessary.
+        $highlightStart = $highlightEnd = '';
+        if ($hilightIsActive) {
+          $currentXpath = $nodeStack['Parent'][$nodeStackIndex]['xpath'].'/text()['.($currentChild+1).']';
+          if (in_array($currentXpath, $this->hilightXpathList)) {
+           // Yes we hilight
+            $highlightStart = chr(2);
+            $highlightEnd   = chr(3);
+          }
+        }
+        $xmlOut .= $highlightStart.$nodeStack['Parent'][$nodeStackIndex]['textParts'][$currentChild].$highlightEnd;
+      }
+      if ($iChildCount && $nodeStackIndex) $xmlOut .= $CR;
+
+      ///////////////////////////////////////////
+
+      // Are there any more children?
+      if ($iChildCount <= $currentChild) {
+        // Nope, so output the last text before the closing tag
+        $tmpTxt =& $nodeStack['Parent'][$nodeStackIndex]['textParts'][$currentChild+1];
+        if (isSet($tmpTxt) AND ($tmpTxt!="")) {
+          // Hilight if necessary.
+          $highlightStart = $highlightEnd = '';
+          if ($hilightIsActive) {
+            $currentXpath = $nodeStack['Parent'][$nodeStackIndex]['xpath'].'/text()['.($currentChild+2).']';
+            if (in_array($currentXpath, $this->hilightXpathList)) {
+             // Yes we hilight
+              $highlightStart = chr(2);
+              $highlightEnd   = chr(3);
+            }
+          }
+          $xmlOut .= $highlightStart
+                .$currentIndent.$nodeStack['Parent'][$nodeStackIndex]['textParts'][$currentChild+1].$CR
+                .$highlightEnd;
+        }
+
+        // Now close this tag, as we are finished with this child.
+
+        // Potentially output an (slightly smaller indent).
+        if ($this->parseSkipWhiteCache
+          && count($nodeStack['Parent'][$nodeStackIndex]['childNodes'])) {
+          $xmlOut .= str_repeat($this->indentStep, $nodeStackIndex - 1);
+        }
+
+        // Check whether the xml-tag is to be hilighted.
+        $highlightStart = $highlightEnd = '';
+        if ($hilightIsActive) {
+          $currentXpath = $nodeStack['Parent'][$nodeStackIndex]['xpath'];
+          if (in_array($currentXpath, $this->hilightXpathList)) {
+            // Yes we hilight
+            $highlightStart = chr(2);
+            $highlightEnd   = chr(3);
+          }
+        }
+        $xmlOut .=  $highlightStart
+                     .'</'.$nodeStack['Parent'][$nodeStackIndex]['name'].'>'
+                     .$highlightEnd;
+        // Decrement the $nodeStackIndex to go back to the next unfinished parent.
+        $nodeStackIndex--;
+
+        // If the index is 0 we are finished exporting the last node, as we may have been
+        // exporting an internal node.
+        if ($nodeStackIndex == 0) break;
+
+        // Indicate to the parent that we are finished with this child.
+        $nodeStack['ChildIndex'][$nodeStackIndex]++;
+
+        continue;
+      }
+
+      ///////////////////////////////////////////
+      // Ok, there are children still to process.
+
+      // Queue up the next child (I can copy because I won't modify and copying is faster.)
+      $nodeStack['Parent'][$nodeStackIndex + 1] = $nodeStack['Parent'][$nodeStackIndex]['childNodes'][$currentChild];
+
+      // Work out if it is a short child tag.
+      $iGrandChildCount = count($nodeStack['Parent'][$nodeStackIndex + 1]['childNodes']);
+      $shortGrandChild = (($iGrandChildCount == 0) AND (implode('',$nodeStack['Parent'][$nodeStackIndex + 1]['textParts'])==''));
+
+      ///////////////////////////////////////////
+      // Assemble the attribute string first.
+      $attrStr = '';
+      foreach($nodeStack['Parent'][$nodeStackIndex + 1]['attributes'] as $key=>$val) {
+        // Should we hilight the attribute?
+        if ($hilightIsActive AND in_array($currentXpath.'/attribute::'.$key, $this->hilightXpathList)) {
+          $hiAttrStart = chr(2);
+          $hiAttrEnd   = chr(3);
+        } else {
+          $hiAttrStart = $hiAttrEnd = '';
+        }
+        $attrStr .= ' '.$hiAttrStart.$key.'="'.$val.'"'.$hiAttrEnd;
+      }
+
+      ///////////////////////////////////////////
+      // Work out what goes before and after the tag content
+
+      $beforeTagContent = $currentIndent;
+      if ($shortGrandChild) $afterTagContent = '/>';
+      else                  $afterTagContent = '>';
+
+      // Check whether the xml-tag is to be hilighted.
+      if ($hilightIsActive) {
+        $currentXpath = $nodeStack['Parent'][$nodeStackIndex + 1]['xpath'];
+        if (in_array($currentXpath, $this->hilightXpathList)) {
+          // Yes we hilight
+          $beforeTagContent .= chr(2);
+          $afterTagContent  .= chr(3);
+        }
+      }
+      $beforeTagContent .= '<';
+//      if ($shortGrandChild) $afterTagContent .= $CR;
+      
+      ///////////////////////////////////////////
+      // Output the tag
+
+      $xmlOut .= $beforeTagContent
+                  .$nodeStack['Parent'][$nodeStackIndex + 1]['name'].$attrStr
+                  .$afterTagContent;
+
+      ///////////////////////////////////////////
+      // Carry on.            
+
+      // If it is a short tag, then we've already done this child, we just move to the next
+      if ($shortGrandChild) {
+        // Move to the next child, we need not go deeper in the tree.
+        $nodeStack['ChildIndex'][$nodeStackIndex]++;
+        // But if we are just exporting the one node we'd go no further.
+        if ($nodeStackIndex == 0) break;
+      } else {
+        // Else queue up the child going one deeper in the stack
+        $nodeStackIndex++;
+        // Start with it's first child
+        $nodeStack['ChildIndex'][$nodeStackIndex] = 0;
+      }
+    }
+
+    $result = $xmlOut;
+
+    // Repair what we "undid"
+    $OldPreceedingStringRef = $OldPreceedingStringValue;
+
+    ////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    return $result;
+  }
+     
+  //-----------------------------------------------------------------------------------------
+  // XPathEngine           ------ Import the XML Source ------                               
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Reads a file or URL and parses the XML data.
+   *
+   * Parse the XML source and (upon success) store the information into an internal structure.
+   *
+   * @param     $fileName (string) Path and name (or URL) of the file to be read and parsed.
+   * @return              (bool)   TRUE on success, FALSE on failure (check getLastError())
+   * @see       importFromString(), getLastError(), 
+   */
+  function importFromFile($fileName) {
+    $status = FALSE;
+    $errStr = '';
+    do { // try-block
+      // Remember file name. Used in error output to know in which file it happend
+      $this->properties['xmlFile'] = $fileName;
+      // If we already have content, then complain.
+      if (!empty($this->nodeRoot)) {
+        $errStr = 'Called when this object already contains xml data. Use reset().';
+        break; // try-block
+      }
+      // The the source is an url try to fetch it.
+      if (preg_match(';^http(s)?://;', $fileName)) {
+        // Read the content of the url...this is really prone to errors, and we don't really
+        // check for too many here...for now, suppressing both possible warnings...we need
+        // to check if we get a none xml page or something of that nature in the future
+        $xmlString = @implode('', @file($fileName));
+        if (!empty($xmlString)) {
+          $status = TRUE;
+        } else {
+          $errStr = "The url '{$fileName}' could not be found or read.";
+        }
+        break; // try-block
+      } 
+      
+      // Reaching this point we're dealing with a real file (not an url). Check if the file exists and is readable.
+      if (!is_readable($fileName)) { // Read the content from the file
+        $errStr = "File '{$fileName}' could not be found or read.";
+        break; // try-block
+      }
+      if (is_dir($fileName)) {
+        $errStr = "'{$fileName}' is a directory.";
+        break; // try-block
+      }
+      // Read the file
+      if (!($fp = @fopen($fileName, 'rb'))) {
+        $errStr = "Failed to open '{$fileName}' for read.";
+        break; // try-block
+      }
+      $xmlString = fread($fp, filesize($fileName));
+      @fclose($fp);
+      
+      $status = TRUE;
+    } while (FALSE);
+    
+    if (!$status) {
+      $this->_displayError('In importFromFile(): '. $errStr, __LINE__, __FILE__, FALSE);
+      return FALSE;
+    }
+    return $this->importFromString($xmlString);
+  }
+  
+  /**
+   * Reads a string and parses the XML data.
+   *
+   * Parse the XML source and (upon success) store the information into an internal structure.
+   * If a parent xpath is given this means that XML data is to be *appended* to that parent.
+   *
+   * ### If a function uses setLastError(), then say in the function header that getLastError() is useful.
+   *
+   * @param  $xmlString           (string) Name of the string to be read and parsed.
+   * @param  $absoluteParentPath  (string) Node to append data too (see above)
+   * @return                      (bool)   TRUE on success, FALSE on failure 
+   *                                       (check getLastError())
+   */
+  function importFromString($xmlString, $absoluteParentPath = '') {
+    $ThisFunctionName = 'importFromString';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Importing from string of length ".strlen($xmlString)." to node '$absoluteParentPath'\n<br>";
+      echo "Parser options:\n<br>";
+      print_r($this->parseOptions);
+    }
+
+    $status = FALSE;
+    $errStr = '';
+    do { // try-block
+      // If we already have content, then complain.
+      if (!empty($this->nodeRoot) AND empty($absoluteParentPath)) {
+        $errStr = 'Called when this object already contains xml data. Use reset() or pass the parent Xpath as 2ed param to where tie data will append.';
+        break; // try-block
+      }
+      // Check whether content has been read.
+      if (empty($xmlString)) {
+        // Nothing to do!!
+        $status = TRUE;
+        // If we were importing to root, build a blank root.
+        if (empty($absoluteParentPath)) {
+          $this->_createSuperRoot();
+        }
+        $this->reindexNodeTree();
+//        $errStr = 'This xml document (string) was empty';
+        break; // try-block
+      } else {
+        $xmlString = $this->_translateAmpersand($xmlString);
+      }
+      
+      // Restart our node index with a root entry.
+      $nodeStack = array();
+      $this->parseStackIndex = 0;
+
+      // If a parent xpath is given this means that XML data is to be *appended* to that parent.
+      if (!empty($absoluteParentPath)) {
+        // Check if parent exists
+        if (!isSet($this->nodeIndex[$absoluteParentPath])) {
+          $errStr = "You tried to append XML data to a parent '$absoluteParentPath' that does not exist.";
+          break; // try-block
+        } 
+        // Add it as the starting point in our array.
+        $this->nodeStack[0] =& $this->nodeIndex[$absoluteParentPath];
+      } else {
+        // Build a 'super-root'
+        $this->_createSuperRoot();
+        // Put it in as the start of our node stack.
+        $this->nodeStack[0] =& $this->nodeRoot;
+      }
+
+      // Point our text buffer reference at the next text part of the root
+      $this->parsedTextLocation =& $this->nodeStack[0]['textParts'][];
+      $this->parsInCData = 0;
+      // We cache this now.
+      $this->parseSkipWhiteCache = isSet($this->parseOptions[XML_OPTION_SKIP_WHITE]) ? $this->parseOptions[XML_OPTION_SKIP_WHITE] : FALSE;
+      
+      // Create an XML parser.
+      $parser = xml_parser_create();
+      // Set default XML parser options.
+      if (is_array($this->parseOptions)) {
+        foreach($this->parseOptions as $key => $val) {
+          xml_parser_set_option($parser, $key, $val);
+        }
+      }
+      
+      // Set the object and the element handlers for the XML parser.
+      xml_set_object($parser, $this);
+      xml_set_element_handler($parser, '_handleStartElement', '_handleEndElement');
+      xml_set_character_data_handler($parser, '_handleCharacterData');
+      xml_set_default_handler($parser, '_handleDefaultData');
+      xml_set_processing_instruction_handler($parser, '_handlePI');
+     
+      // Parse the XML source and on error generate an error message.
+      if (!xml_parse($parser, $xmlString, TRUE)) {
+        $source = empty($this->properties['xmlFile']) ? 'string' : 'file ' . basename($this->properties['xmlFile']) . "'";
+        $errStr = "XML error in given {$source} on line ".
+               xml_get_current_line_number($parser). '  column '. xml_get_current_column_number($parser) .
+               '. Reason:'. xml_error_string(xml_get_error_code($parser));
+        break; // try-block
+      }
+      
+      // Free the parser.
+      @xml_parser_free($parser);
+      // And we don't need this any more.
+      $this->nodeStack = array();
+
+      $this->reindexNodeTree();
+
+      if ($bDebugThisFunction) {
+        print_r(array_keys($this->nodeIndex));
+      }
+
+      $status = TRUE;
+    } while (FALSE);
+    
+    if (!$status) {
+      $this->_displayError('In importFromString(): '. $errStr, __LINE__, __FILE__, FALSE);
+      $bResult = FALSE;
+    } else {
+      $bResult = TRUE;
+    }
+
+    ////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $bResult, $bDebugThisFunction);
+
+    return $bResult;
+  }
+  
+  
+  //-----------------------------------------------------------------------------------------
+  // XPathEngine               ------  XML Handlers  ------                                  
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Handles opening XML tags while parsing.
+   *
+   * While parsing a XML document for each opening tag this method is
+   * called. It'll add the tag found to the tree of document nodes.
+   *
+   * @param $parser     (int)    Handler for accessing the current XML parser.
+   * @param $name       (string) Name of the opening tag found in the document.
+   * @param $attributes (array)  Associative array containing a list of
+   *                             all attributes of the tag found in the document.
+   * @see _handleEndElement(), _handleCharacterData()
+   */
+  function _handleStartElement($parser, $nodeName, $attributes) {
+    if (empty($nodeName)) {
+      $this->_displayError('XML error in file at line'. xml_get_current_line_number($parser) .'. Empty name.', __LINE__, __FILE__);
+      return;
+    }
+
+    // Trim accumulated text if necessary.
+    if ($this->parseSkipWhiteCache) {
+      $iCount = count($this->nodeStack[$this->parseStackIndex]['textParts']);
+      $this->nodeStack[$this->parseStackIndex]['textParts'][$iCount-1] = rtrim($this->parsedTextLocation);
+    } 
+
+    if ($this->bDebugXmlParse) {
+      echo "<blockquote>" . htmlspecialchars("Start node: <".$nodeName . ">")."<br>";
+      echo "Appended to stack entry: $this->parseStackIndex<br>\n";
+      echo "Text part before element is: ".htmlspecialchars($this->parsedTextLocation);
+      /*
+      echo "<pre>";
+      $dataPartsCount = count($this->nodeStack[$this->parseStackIndex]['textParts']);
+      for ($i = 0; $i < $dataPartsCount; $i++) {
+        echo "$i:". htmlspecialchars($this->nodeStack[$this->parseStackIndex]['textParts'][$i])."\n";
+      }
+      echo "</pre>";
+      */
+    }
+
+    // Add a node and set path to current.
+    if (!$this->_internalAppendChild($this->parseStackIndex, $nodeName)) {
+      $this->_displayError('Internal error during parse of XML file at line'. xml_get_current_line_number($parser) .'. Empty name.', __LINE__, __FILE__);
+      return;
+    }    
+
+    // We will have gone one deeper then in the stack.
+    $this->parseStackIndex++;
+
+    // Point our parseTxtBuffer reference at the new node.
+    $this->parsedTextLocation =& $this->nodeStack[$this->parseStackIndex]['textParts'][0];
+    
+    // Set the attributes.
+    if (!empty($attributes)) {
+      if ($this->bDebugXmlParse) {
+        echo 'Attributes: <br>';
+        print_r($attributes);
+        echo '<br>';
+      }
+      $this->nodeStack[$this->parseStackIndex]['attributes'] = $attributes;
+    }
+  }
+  
+  /**
+   * Handles closing XML tags while parsing.
+   *
+   * While parsing a XML document for each closing tag this method is called.
+   *
+   * @param $parser (int)    Handler for accessing the current XML parser.
+   * @param $name   (string) Name of the closing tag found in the document.
+   * @see       _handleStartElement(), _handleCharacterData()
+   */
+  function _handleEndElement($parser, $name) {
+    if (($this->parsedTextLocation=='') 
+        && empty($this->nodeStack[$this->parseStackIndex]['textParts'])) {
+      // We reach this point when parsing a tag of format <foo/>. The 'textParts'-array 
+      // should stay empty and not have an empty string in it.
+    } else {
+      // Trim accumulated text if necessary.
+      if ($this->parseSkipWhiteCache) {
+        $iCount = count($this->nodeStack[$this->parseStackIndex]['textParts']);
+        $this->nodeStack[$this->parseStackIndex]['textParts'][$iCount-1] = rtrim($this->parsedTextLocation);
+      }
+    }
+
+    if ($this->bDebugXmlParse) {
+      echo "Text part after element is: ".htmlspecialchars($this->parsedTextLocation)."<br>\n";
+      echo htmlspecialchars("Parent:<{$this->parseStackIndex}>, End-node:</$name> '".$this->parsedTextLocation) . "'<br>Text nodes:<pre>\n";
+      $dataPartsCount = count($this->nodeStack[$this->parseStackIndex]['textParts']);
+      for ($i = 0; $i < $dataPartsCount; $i++) {
+        echo "$i:". htmlspecialchars($this->nodeStack[$this->parseStackIndex]['textParts'][$i])."\n";
+      }
+      var_dump($this->nodeStack[$this->parseStackIndex]['textParts']);
+      echo "</pre></blockquote>\n";
+    }
+
+    // Jump back to the parent element.
+    $this->parseStackIndex--;
+
+    // Set our reference for where we put any more whitespace
+    $this->parsedTextLocation =& $this->nodeStack[$this->parseStackIndex]['textParts'][];
+
+    // Note we leave the entry in the stack, as it will get blanked over by the next element
+    // at this level.  The safe thing to do would be to remove it too, but in the interests 
+    // of performance, we will not bother, as were it to be a problem, then it would be an
+    // internal bug anyway.
+    if ($this->parseStackIndex < 0) {
+      $this->_displayError('Internal error during parse of XML file at line'. xml_get_current_line_number($parser) .'. Empty name.', __LINE__, __FILE__);
+      return;
+    }    
+  }
+  
+  /**
+   * Handles character data while parsing.
+   *
+   * While parsing a XML document for each character data this method
+   * is called. It'll add the character data to the document tree.
+   *
+   * @param $parser (int)    Handler for accessing the current XML parser.
+   * @param $text   (string) Character data found in the document.
+   * @see       _handleStartElement(), _handleEndElement()
+   */
+  function _handleCharacterData($parser, $text) {
+  
+    if ($this->parsInCData >0) $text = $this->_translateAmpersand($text, $reverse=TRUE);
+    
+    if ($this->bDebugXmlParse) echo "Handling character data: '".htmlspecialchars($text)."'<br>";
+    if ($this->parseSkipWhiteCache AND !empty($text) AND !$this->parsInCData) {
+      // Special case CR. CR always comes in a separate data. Trans. it to '' or ' '. 
+      // If txtBuffer is already ending with a space use '' otherwise ' '.
+      $bufferHasEndingSpace = (empty($this->parsedTextLocation) OR substr($this->parsedTextLocation, -1) === ' ') ? TRUE : FALSE;
+      if ($text=="\n") {
+        $text = $bufferHasEndingSpace ? '' : ' ';
+      } else {
+        if ($bufferHasEndingSpace) {
+          $text = ltrim(preg_replace('/\s+/', ' ', $text));
+        } else {
+          $text = preg_replace('/\s+/', ' ', $text);
+        }
+      }
+      if ($this->bDebugXmlParse) echo "'Skip white space' is ON. reduced to : '" .htmlspecialchars($text) . "'<br>";
+    }
+    $this->parsedTextLocation .= $text;
+  }
+  
+  /**
+   * Default handler for the XML parser.  
+   *
+   * While parsing a XML document for string not caught by one of the other
+   * handler functions, we end up here.
+   *
+   * @param $parser (int)    Handler for accessing the current XML parser.
+   * @param $text   (string) Character data found in the document.
+   * @see       _handleStartElement(), _handleEndElement()
+   */
+  function _handleDefaultData($parser, $text) {
+    do { // try-block
+      if (!strcmp($text, '<![CDATA[')) {
+        $this->parsInCData++;
+      } elseif (!strcmp($text, ']]>')) {
+        $this->parsInCData--;
+        if ($this->parsInCData < 0) $this->parsInCData = 0;
+      }
+      $this->parsedTextLocation .= $this->_translateAmpersand($text, $reverse=TRUE);
+      if ($this->bDebugXmlParse) echo "Default handler data: ".htmlspecialchars($text)."<br>";    
+      break; // try-block
+    } while (FALSE); // END try-block
+  }
+  
+  /**
+   * Handles processing instruction (PI)
+   *
+   * A processing instruction has the following format: 
+   * <?  target data  ? > e.g.  <? dtd version="1.0" ? >
+   *
+   * Currently I have no bether idea as to left it 'as is' and treat the PI data as normal 
+   * text (and adding the surrounding PI-tags <? ? >). 
+   *
+   * @param     $parser (int)    Handler for accessing the current XML parser.
+   * @param     $target (string) Name of the PI target. E.g. XML, PHP, DTD, ... 
+   * @param     $data   (string) Associative array containing a list of
+   * @see       PHP's manual "xml_set_processing_instruction_handler"
+   */
+  function _handlePI($parser, $target, $data) {
+    //echo("pi data=".$data."end"); exit;
+    $data = $this->_translateAmpersand($data, $reverse=TRUE);
+    $this->parsedTextLocation .= "<?{$target} {$data}?>";
+    return TRUE;
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPathEngine          ------  Node Tree Stuff  ------                                    
+  //-----------------------------------------------------------------------------------------
+
+  /**
+   * Creates a super root node.
+   */
+  function _createSuperRoot() {
+    // Build a 'super-root'
+    $this->nodeRoot = $this->emptyNode;
+    $this->nodeRoot['name']      = '';
+    $this->nodeRoot['parentNode'] = NULL;
+    $this->nodeIndex[''] =& $this->nodeRoot;
+  }
+
+  /**
+   * Adds a new node to the XML document tree during xml parsing.
+   *
+   * This method adds a new node to the tree of nodes of the XML document
+   * being handled by this class. The new node is created according to the
+   * parameters passed to this method.  This method is a much watered down
+   * version of appendChild(), used in parsing an xml file only.
+   * 
+   * It is assumed that adding starts with root and progresses through the
+   * document in parse order.  New nodes must have a corresponding parent. And
+   * once we have read the </> tag for the element we will never need to add
+   * any more data to that node.  Otherwise the add will be ignored or fail.
+   *
+   * The function is faciliated by a nodeStack, which is an array of nodes that
+   * we have yet to close.
+   *
+   * @param   $stackParentIndex (int)    The index into the nodeStack[] of the parent
+   *                                     node to which the new node should be added as 
+   *                                     a child. *READONLY*
+   * @param   $nodeName         (string) Name of the new node. *READONLY*
+   * @return                    (bool)   TRUE if we successfully added a new child to 
+   *                                     the node stack at index $stackParentIndex + 1,
+   *                                     FALSE on error.
+   */
+  function _internalAppendChild($stackParentIndex, $nodeName) {
+    // This call is likely to be executed thousands of times, so every 0.01ms counts.
+    // If you want to debug this function, you'll have to comment the stuff back in
+    //$bDebugThisFunction = FALSE;
+    
+    /*
+    $ThisFunctionName = '_internalAppendChild';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Current Node (parent-index) and the child to append : '{$stackParentIndex}' +  '{$nodeName}' \n<br>";
+    }
+    */
+     //////////////////////////////////////
+
+    if (!isSet($this->nodeStack[$stackParentIndex])) {
+      $errStr = "Invalid parent. You tried to append the tag '{$nodeName}' to an non-existing parent in our node stack '{$stackParentIndex}'.";
+      $this->_displayError('In _internalAppendChild(): '. $errStr, __LINE__, __FILE__, FALSE); 
+
+      /*
+      $this->_closeDebugFunction($ThisFunctionName, FALSE, $bDebugThisFunction);
+      */
+
+      return FALSE;
+    }
+
+    // Retrieve the parent node from the node stack.  This is the last node at that 
+    // depth that we have yet to close.  This is where we should add the text/node.
+    $parentNode =& $this->nodeStack[$stackParentIndex];
+          
+    // Brand new node please
+    $newChildNode = $this->emptyNode;
+    
+    // Save the vital information about the node.
+    $newChildNode['name'] = $nodeName;
+    $parentNode['childNodes'][] =& $newChildNode;
+    
+    // Add to our node stack
+    $this->nodeStack[$stackParentIndex + 1] =& $newChildNode;
+
+    /*
+    if ($bDebugThisFunction) {
+      echo "The new node received index: '".($stackParentIndex + 1)."'\n";
+      foreach($this->nodeStack as $key => $val) echo "$key => ".$val['name']."\n"; 
+    }
+    $this->_closeDebugFunction($ThisFunctionName, TRUE, $bDebugThisFunction);
+    */
+
+    return TRUE;
+  }
+  
+  /**
+   * Update nodeIndex and every node of the node-tree. 
+   *
+   * Call after you have finished any tree modifications other wise a match with 
+   * an xPathQuery will produce wrong results.  The $this->nodeIndex[] is recreated 
+   * and every nodes optimization data is updated.  The optimization data is all the
+   * data that is duplicate information, would just take longer to find. Child nodes 
+   * with value NULL are removed from the tree.
+   *
+   * By default the modification functions in this component will automatically re-index
+   * the nodes in the tree.  Sometimes this is not the behaver you want. To surpress the 
+   * reindex, set the functions $autoReindex to FALSE and call reindexNodeTree() at the 
+   * end of your changes.  This sometimes leads to better code (and less CPU overhead).
+   *
+   * Sample:
+   * =======
+   * Given the xml is <AAA><B/>.<B/>.<B/></AAA> | Goal is <AAA>.<B/>.</AAA>  (Delete B[1] and B[3])
+   *   $xPathSet = $xPath->match('//B'); # Will result in array('/AAA[1]/B[1]', '/AAA[1]/B[2]', '/AAA[1]/B[3]');
+   * Three ways to do it.
+   * 1) Top-Down  (with auto reindexing) - Safe, Slow and you get easily mix up with the the changing node index
+   *    removeChild('/AAA[1]/B[1]'); // B[1] removed, thus all B[n] become B[n-1] !!
+   *    removeChild('/AAA[1]/B[2]'); // Now remove B[2] (That originaly was B[3])
+   * 2) Bottom-Up (with auto reindexing) -  Safe, Slow and the changing node index (caused by auto-reindex) can be ignored.
+   *    for ($i=sizeOf($xPathSet)-1; $i>=0; $i--) {
+   *      if ($i==1) continue; 
+   *      removeChild($xPathSet[$i]);
+   *    }
+   * 3) // Top-down (with *NO* auto reindexing) - Fast, Safe as long as you call reindexNodeTree()
+   *    foreach($xPathSet as $xPath) {
+   *      // Specify no reindexing
+   *      if ($xPath == $xPathSet[1]) continue; 
+   *      removeChild($xPath, $autoReindex=FALSE);
+   *      // The object is now in a slightly inconsistent state.
+   *    }
+   *    // Finally do the reindex and the object is consistent again
+   *    reindexNodeTree();
+   *
+   * @return (bool) TRUE on success, FALSE otherwise.
+   * @see _recursiveReindexNodeTree()
+   */
+  function reindexNodeTree() {
+    //return;
+    $this->_indexIsDirty = FALSE;
+    $this->nodeIndex = array();
+    $this->nodeIndex[''] =& $this->nodeRoot;
+    // Quick out for when the tree has no data.
+    if (empty($this->nodeRoot)) return TRUE;
+    return $this->_recursiveReindexNodeTree('');
+  }
+  
+
+  /**
+   * Create the ids that are accessable through the generate-id() function
+   */
+  function _generate_ids() {
+    // If we have generated them already, then bail.
+    if (isset($this->nodeIndex['']['generate_id'])) return;
+
+    // keys generated are the string 'id0' . hexatridecimal-based (0..9,a-z) index
+    $aNodeIndexes = array_keys($this->nodeIndex);
+    $idNumber = 0;
+    foreach($aNodeIndexes as $index => $key) {
+//      $this->nodeIndex[$key]['generated_id'] = 'id' . base_convert($index,10,36);
+      // Skip attribute and text nodes.
+      // ### Currently don't support attribute and text nodes.
+      if (strstr($key, 'text()') !== FALSE) continue;
+      if (strstr($key, 'attribute::') !== FALSE) continue;
+      $this->nodeIndex[$key]['generated_id'] = 'idPhpXPath' . $idNumber;
+
+      // Make the id's sequential so that we can test predictively.
+      $idNumber++;
+    }
+  }
+
+  /**
+   * Here's where the work is done for reindexing (see reindexNodeTree)
+   *
+   * @param  $absoluteParentPath (string) the xPath to the parent node
+   * @return                     (bool)   TRUE on success, FALSE otherwise.
+   * @see reindexNodeTree()
+   */
+  function _recursiveReindexNodeTree($absoluteParentPath) {
+    $parentNode =& $this->nodeIndex[$absoluteParentPath];
+    
+    // Check for any 'dead' child nodes first and concate the text parts if found.
+    for ($iChildIndex=sizeOf($parentNode['childNodes'])-1; $iChildIndex>=0; $iChildIndex--) {
+      // Check if the child node still exits (it may have been removed).
+      if (!empty($parentNode['childNodes'][$iChildIndex])) continue;
+      // Child node was removed. We got to merge the text parts then.
+      $parentNode['textParts'][$iChildIndex] .= $parentNode['textParts'][$iChildIndex+1];
+      array_splice($parentNode['textParts'], $iChildIndex+1, 1); 
+      array_splice($parentNode['childNodes'], $iChildIndex, 1);
+    }
+
+    // Now start a reindex.
+    $contextHash = array();
+    $childSize = sizeOf($parentNode['childNodes']);
+
+    // If there are no children, we have to treat this specially:
+    if ($childSize == 0) {
+      // Add a dummy text node.
+      $this->nodeIndex[$absoluteParentPath.'/text()[1]'] =& $parentNode;
+    } else {
+      for ($iChildIndex=0; $iChildIndex<$childSize; $iChildIndex++) {
+        $childNode =& $parentNode['childNodes'][$iChildIndex];
+        // Make sure that there is a text-part in front of every node. (May be empty)
+        if (!isSet($parentNode['textParts'][$iChildIndex])) $parentNode['textParts'][$iChildIndex] = '';
+        // Count the nodes with same name (to determine their context position)
+        $childName = $childNode['name'];
+        if (empty($contextHash[$childName])) { 
+          $contextPos = $contextHash[$childName] = 1;
+        } else {
+          $contextPos = ++$contextHash[$childName];
+        }
+        // Make the node-index hash
+        $newPath = $absoluteParentPath . '/' . $childName . '['.$contextPos.']';
+
+        // ### Note ultimately we will end up supporting text nodes as actual nodes.
+
+        // Preceed with a dummy entry for the text node.
+        $this->nodeIndex[$absoluteParentPath.'/text()['.($childNode['pos']+1).']'] =& $childNode;
+        // Then the node itself
+        $this->nodeIndex[$newPath] =& $childNode;
+
+        // Now some dummy nodes for each of the attribute nodes.
+        $iAttributeCount = sizeOf($childNode['attributes']);
+        if ($iAttributeCount > 0) {
+          $aAttributesNames = array_keys($childNode['attributes']);
+          for ($iAttributeIndex = 0; $iAttributeIndex < $iAttributeCount; $iAttributeIndex++) {
+            $attribute = $aAttributesNames[$iAttributeIndex];
+            $newAttributeNode = $this->emptyNode;
+            $newAttributeNode['name'] = $attribute;
+            $newAttributeNode['textParts'] = array($childNode['attributes'][$attribute]);
+            $newAttributeNode['contextPos'] = $iAttributeIndex;
+            $newAttributeNode['xpath'] = "$newPath/attribute::$attribute";
+            $newAttributeNode['parentNode'] =& $childNode;
+            $newAttributeNode['depth'] =& $parentNode['depth'] + 2;
+            // Insert the node as a master node, not a reference, otherwise there will be 
+            // variable "bleeding".
+            $this->nodeIndex["$newPath/attribute::$attribute"] = $newAttributeNode;
+          }
+        }
+
+        // Update the node info (optimisation)
+        $childNode['parentNode'] =& $parentNode;
+        $childNode['depth'] = $parentNode['depth'] + 1;
+        $childNode['pos'] = $iChildIndex;
+        $childNode['contextPos'] = $contextHash[$childName];
+        $childNode['xpath'] = $newPath;
+        $this->_recursiveReindexNodeTree($newPath);
+
+        // Follow with a dummy entry for the text node.
+        $this->nodeIndex[$absoluteParentPath.'/text()['.($childNode['pos']+2).']'] =& $childNode;
+      }
+
+      // Make sure that their is a text-part after the last node.
+      if (!isSet($parentNode['textParts'][$iChildIndex])) $parentNode['textParts'][$iChildIndex] = '';
+    }
+
+    return TRUE;
+  }
+  
+  /** 
+   * Clone a node and it's child nodes.
+   *
+   * NOTE: If the node has children you *MUST* use the reference operator!
+   *       E.g. $clonedNode =& cloneNode($node);
+   *       Otherwise the children will not point back to the parent, they will point 
+   *       back to your temporary variable instead.
+   *
+   * @param   $node (mixed)  Either a node (hash array) or an abs. Xpath to a node in 
+   *                         the current doc
+   * @return        (&array) A node and it's child nodes.
+   */
+  function &cloneNode($node, $recursive=FALSE) {
+    if (is_string($node) AND isSet($this->nodeIndex[$node])) {
+      $node = $this->nodeIndex[$node];
+    }
+    // Copy the text-parts ()
+    $textParts = $node['textParts'];
+    $node['textParts'] = array();
+    foreach ($textParts as $key => $val) {
+      $node['textParts'][] = $val;
+    }
+    
+    $childSize = sizeOf($node['childNodes']);
+    for ($i=0; $i<$childSize; $i++) {
+      $childNode =& $this->cloneNode($node['childNodes'][$i], TRUE);  // copy child 
+      $node['childNodes'][$i] =& $childNode; // reference the copy
+      $childNode['parentNode'] =& $node;      // child references the parent.
+    }
+    
+    if (!$recursive) {
+      //$node['childNodes'][0]['parentNode'] = null;
+      //print "<pre>";
+      //var_dump($node);
+    }
+    return $node;
+  }
+  
+  
+/** Nice to have but __sleep() has a bug. 
+    (2002-2 PHP V4.1. See bug #15350)
+  
+  /**
+   * PHP cals this function when you call PHP's serialize. 
+   *
+   * It prevents cyclic referencing, which is why print_r() of an XPath object doesn't work.
+   *
+  function __sleep() {
+    // Destroy recursive pointers
+    $keys = array_keys($this->nodeIndex);
+    $size = sizeOf($keys);
+    for ($i=0; $i<$size; $i++) {
+      unset($this->nodeIndex[$keys[$i]]['parentNode']);
+    }
+    unset($this->nodeIndex);
+  }
+  
+  /**
+   * PHP cals this function when you call PHP's unserialize. 
+   *
+   * It reindexes the node-tree
+   *
+  function __wakeup() {
+    $this->reindexNodeTree();
+  }
+  
+*/
+  
+  //-----------------------------------------------------------------------------------------
+  // XPath            ------  XPath Query / Evaluation Handlers  ------                      
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Matches (evaluates) an XPath query
+   *
+   * This method tries to evaluate an XPath query by parsing it. A XML source must 
+   * have been imported before this method is able to work.
+   *
+   * @param     $xPathQuery  (string) XPath query to be evaluated.
+   * @param     $baseXPath   (string) (default is super-root) XPath query to a single document node, 
+   *                                  from which the XPath query should  start evaluating.
+   * @return                 (mixed)  The result of the XPath expression.  Either:
+   *                                    node-set (an ordered collection of absolute references to nodes without duplicates) 
+   *                                    boolean (true or false) 
+   *                                    number (a floating-point number) 
+   *                                    string (a sequence of UCS characters) 
+   */
+  function match($xPathQuery, $baseXPath='') {
+    if ($this->_indexIsDirty) $this->reindexNodeTree();
+    
+    // Replace a double slashes, because they'll cause problems otherwise.
+    static $slashes2descendant = array(
+        '//@' => '/descendant_or_self::*/attribute::', 
+        '//'  => '/descendant_or_self::node()/', 
+        '/@'  => '/attribute::');
+    // Stupid idea from W3C to take axes name containing a '-' (dash) !!!
+    // We replace the '-' with '_' to avoid the conflict with the minus operator.
+    static $dash2underscoreHash = array( 
+        '-sibling'    => '_sibling', 
+        '-or-'        => '_or_',
+        'starts-with' => 'starts_with', 
+        'substring-before' => 'substring_before',
+        'substring-after'  => 'substring_after', 
+        'string-length'    => 'string_length',
+        'normalize-space'  => 'normalize_space',
+        'x-lower'          => 'x_lower',
+        'x-upper'          => 'x_upper',
+        'generate-id'      => 'generate_id');
+    
+    if (empty($xPathQuery)) return array();
+
+    // Special case for when document is empty.
+    if (empty($this->nodeRoot)) return array();
+
+    if (!isSet($this->nodeIndex[$baseXPath])) {
+            $xPathSet = $this->_resolveXPathQuery($baseXPath,'match');
+            if (sizeOf($xPathSet) !== 1) {
+                $this->_displayError(sprintf($this->errorStrings['NoNodeMatch'], $xPathQuery), __LINE__, __FILE__, FALSE);
+                return FALSE;
+            }
+            $baseXPath = $xPathSet[0];
+    }
+
+    // We should possibly do a proper syntactical parse, but instead we will cheat and just
+    // remove any literals that could make things very difficult for us, and replace them with
+    // special tags.  Then we can treat the xPathQuery much more easily as JUST "syntax".  Provided 
+    // there are no literals in the string, then we can guarentee that most of the operators and 
+    // syntactical elements are indeed elements and not just part of a literal string.
+    $processedxPathQuery = $this->_removeLiterals($xPathQuery);
+    
+    // Replace a double slashes, and '-' (dash) in axes names.
+    $processedxPathQuery = strtr($processedxPathQuery, $slashes2descendant);
+    $processedxPathQuery = strtr($processedxPathQuery, $dash2underscoreHash);
+
+    // Build the context
+    $context = array('nodePath' => $baseXPath, 'pos' => 1, 'size' => 1);
+
+    // The primary syntactic construct in XPath is the expression.
+    $result = $this->_evaluateExpr($processedxPathQuery, $context);
+
+    // We might have been returned a string.. If so convert back to a literal
+    $literalString = $this->_asLiteral($result);
+    if ($literalString != FALSE) return $literalString;
+    else return $result;
+  }
+
+  /**
+   * Alias for the match function
+   *
+   * @see match()
+   */
+  function evaluate($xPathQuery, $baseXPath='') {
+    return $this->match($xPathQuery, $baseXPath);
+  }
+
+  /**
+   * Parse out the literals of an XPath expression.
+   *
+   * Instead of doing a full lexical parse, we parse out the literal strings, and then
+   * Treat the sections of the string either as parts of XPath or literal strings.  So
+   * this function replaces each literal it finds with a literal reference, and then inserts
+   * the reference into an array of strings that we can access.  The literals can be accessed
+   * later from the literals associative array.
+   *
+   * Example:
+   *  XPathExpr = /AAA[@CCC = "hello"]/BBB[DDD = 'world'] 
+   *  =>  literals: array("hello", "world")
+   *      return value: /AAA[@CCC = $1]/BBB[DDD = $2] 
+   *
+   * Note: This does not interfere with the VariableReference syntactical element, as these 
+   * elements must not start with a number.
+   *
+   * @param  $xPathQuery  (string) XPath expression to be processed
+   * @return              (string) The XPath expression without the literals.
+   *                              
+   */
+  function _removeLiterals($xPathQuery) {
+    // What comes first?  A " or a '?
+    if (!preg_match(":^([^\"']*)([\"'].*)$:", $xPathQuery, $aMatches)) {
+      // No " or ' means no more literals.
+      return $xPathQuery;
+    }
+    
+    $result = $aMatches[1];
+    $remainder = $aMatches[2];
+    // What kind of literal?
+    if (preg_match(':^"([^"]*)"(.*)$:', $remainder, $aMatches)) {
+      // A "" literal.
+      $literal = $aMatches[1];
+      $remainder = $aMatches[2];
+    } else if (preg_match(":^'([^']*)'(.*)$:", $remainder, $aMatches)) {
+      // A '' literal.
+      $literal = $aMatches[1];
+      $remainder = $aMatches[2];
+    } else {
+      $this->_displayError("The '$xPathQuery' argument began a literal, but did not close it.", __LINE__, __FILE__);
+    }
+
+    // Store the literal
+    $literalNumber = count($this->axPathLiterals);
+    $this->axPathLiterals[$literalNumber] = $literal;
+    $result .= '$'.$literalNumber;
+    return $result.$this->_removeLiterals($remainder);
+  }
+
+  /**
+   * Returns the given string as a literal reference.
+   *
+   * @param $string (string) The string that we are processing
+   * @return        (mixed)  The literal string.  FALSE if the string isn't a literal reference.
+   */
+  function _asLiteral($string) {
+    if (empty($string)) return FALSE;
+    if (empty($string[0])) return FALSE;
+    if ($string[0] == '$') {
+      $remainder = substr($string, 1);
+      if (is_numeric($remainder)) {
+        // We have a string reference then.
+        $stringNumber = (int)$remainder;
+        if ($stringNumber >= count($this->axPathLiterals)) {
+            $this->_displayError("Internal error.  Found a string reference that we didn't set in xPathQuery: '$xPathQuery'.", __LINE__, __FILE__);
+            return FALSE;
+        }
+        return $this->axPathLiterals[$stringNumber];
+      }
+    }
+
+    // It's not a reference then.
+    return FALSE;
+  }
+  
+  /**
+   * Adds a literal to our array of literals
+   *
+   * In order to make sure we don't interpret literal strings as XPath expressions, we have to
+   * encode literal strings so that we know that they are not XPaths.
+   *
+   * @param $string (string) The literal string that we need to store for future access
+   * @return        (mixed)  A reference string to this literal.
+   */
+  function _addLiteral($string) {
+    // Store the literal
+    $literalNumber = count($this->axPathLiterals);
+    $this->axPathLiterals[$literalNumber] = $string;
+    $result = '$'.$literalNumber;
+    return $result;
+  }
+
+  /**
+   * Look for operators in the expression
+   *
+   * Parses through the given expression looking for operators.  If found returns
+   * the operands and the operator in the resulting array.
+   *
+   * @param  $xPathQuery  (string) XPath query to be evaluated.
+   * @return              (array)  If an operator is found, it returns an array containing
+   *                               information about the operator.  If no operator is found
+   *                               then it returns an empty array.  If an operator is found,
+   *                               but has invalid operands, it returns FALSE.
+   *                               The resulting array has the following entries:
+   *                                'operator' => The string version of operator that was found,
+   *                                              trimmed for whitespace
+   *                                'left operand' => The left operand, or empty if there was no
+   *                                              left operand for this operator.
+   *                                'right operand' => The right operand, or empty if there was no
+   *                                              right operand for this operator.
+   */
+  function _GetOperator($xPathQuery) {
+    $position = 0;
+    $operator = '';
+
+    // The results of this function can easily be cached.
+    static $aResultsCache = array();
+    if (isset($aResultsCache[$xPathQuery])) {
+      return $aResultsCache[$xPathQuery];
+    }
+
+    // Run through all operators and try to find one.
+    $opSize = sizeOf($this->operators);
+    for ($i=0; $i<$opSize; $i++) {
+      // Pick an operator to try.
+      $operator = $this->operators[$i];
+      // Quickcheck. If not present don't wast time searching 'the hard way'
+      if (strpos($xPathQuery, $operator)===FALSE) continue;
+      // Special check
+      $position = $this->_searchString($xPathQuery, $operator);
+      // Check whether a operator was found.
+      if ($position <= 0 ) continue;
+
+      // Check whether it's the equal operator.
+      if ($operator == '=') {
+        // Also look for other operators containing the equal sign.
+        switch ($xPathQuery[$position-1]) {
+          case '<' : 
+            $position--;
+            $operator = '<=';
+            break;
+          case '>' : 
+            $position--;
+            $operator = '>=';
+            break;
+          case '!' : 
+            $position--;
+            $operator = '!=';
+            break;
+          default:
+            // It's a pure = operator then.
+        }
+        break;
+      }
+
+      if ($operator == '*') {
+        // http://www.w3.org/TR/xpath#exprlex:
+        // "If there is a preceding token and the preceding token is not one of @, ::, (, [, 
+        // or an Operator, then a * must be recognized as a MultiplyOperator and an NCName must 
+        // be recognized as an OperatorName."
+
+        // Get some substrings.
+        $character = substr($xPathQuery, $position - 1, 1);
+      
+        // Check whether it's a multiply operator or a name test.
+        if (strchr('/@:([', $character) != FALSE) {
+          // Don't use the operator.
+            $position = -1;
+          continue;
+        } else {
+          // The operator is good.  Lets use it.
+          break;
+        }
+      }
+
+      // Extremely annoyingly, we could have a node name like "for-each" and we should not
+      // parse this as a "-" operator.  So if the first char of the right operator is alphabetic,
+      // then this is NOT an interger operator.
+      if (strchr('-+*', $operator) != FALSE) {
+        $rightOperand = trim(substr($xPathQuery, $position + strlen($operator)));
+        if (strlen($rightOperand) > 1) {
+          if (preg_match(':^\D$:', $rightOperand[0])) {
+            // Don't use the operator.
+            $position = -1;
+            continue;
+          } else {
+            // The operator is good.  Lets use it.
+            break;
+          }
+        }
+      }
+
+      // The operator must be good then :o)
+      break;
+
+    } // end while each($this->operators)
+
+    // Did we find an operator?
+    if ($position == -1) {
+      $aResultsCache[$xPathQuery] = array();
+      return array();
+    }
+
+    /////////////////////////////////////////////
+    // Get the operands
+
+    // Get the left and the right part of the expression.
+    $leftOperand  = trim(substr($xPathQuery, 0, $position));
+    $rightOperand = trim(substr($xPathQuery, $position + strlen($operator)));
+  
+    // Remove whitespaces.
+    $leftOperand  = trim($leftOperand);
+    $rightOperand = trim($rightOperand);
+
+    /////////////////////////////////////////////
+    // Check the operands.
+
+    if ($leftOperand == '') {
+      $aResultsCache[$xPathQuery] = FALSE;
+      return FALSE;
+    }
+
+    if ($rightOperand == '') {
+      $aResultsCache[$xPathQuery] = FALSE;
+      return FALSE;
+    }
+
+    // Package up and return what we found.
+    $aResult = array('operator' => $operator,
+                'left operand' => $leftOperand,
+                'right operand' => $rightOperand);
+
+    $aResultsCache[$xPathQuery] = $aResult;
+
+    return $aResult;
+  }
+
+  /**
+   * Evaluates an XPath PrimaryExpr
+   *
+   * http://www.w3.org/TR/xpath#section-Basics
+   *
+   *  [15]    PrimaryExpr    ::= VariableReference  
+   *                             | '(' Expr ')'  
+   *                             | Literal  
+   *                             | Number  
+   *                             | FunctionCall 
+   *
+   * @param  $xPathQuery  (string)   XPath query to be evaluated.
+   * @param  $context     (array)    The context from which to evaluate
+   * @param  $results     (mixed)    If the expression could be parsed and evaluated as one of these
+   *                                 syntactical elements, then this will be either:
+   *                                    - node-set (an ordered collection of nodes without duplicates) 
+   *                                    - boolean (true or false) 
+   *                                    - number (a floating-point number) 
+   *                                    - string (a sequence of UCS characters) 
+   * @return              (string)    An empty string if the query was successfully parsed and 
+   *                                  evaluated, else a string containing the reason for failing.
+   * @see    evaluate()
+   */
+  function _evaluatePrimaryExpr($xPathQuery, $context, &$result) {
+    $ThisFunctionName = '_evaluatePrimaryExpr';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Path: $xPathQuery\n";
+      echo "Context:";
+      $this->_printContext($context);
+      echo "\n";
+    }
+
+    // Certain expressions will never be PrimaryExpr, so to speed up processing, cache the
+    // results we do find from this function.
+    static $aResultsCache = array();
+    
+    // Do while false loop
+    $error = "";
+    // If the result is independant of context, then we can cache the result and speed this function
+    // up on future calls.
+    $bCacheableResult = FALSE;
+    do {
+      if (isset($aResultsCache[$xPathQuery])) {
+        $error = $aResultsCache[$xPathQuery]['Error'];
+        $result = $aResultsCache[$xPathQuery]['Result'];
+        break;
+      }
+
+      // VariableReference 
+      // ### Not supported.
+
+      // Is it a number?
+      // | Number  
+      if (is_numeric($xPathQuery)) {
+        $result = doubleval($xPathQuery);
+        $bCacheableResult = TRUE;
+        break;
+      }
+
+      // If it starts with $, and the remainder is a number, then it's a string.
+      // | Literal  
+      $literal = $this->_asLiteral($xPathQuery);
+      if ($literal !== FALSE) {
+        $result = $xPathQuery;
+        $bCacheableResult = TRUE;
+        break;
+      }
+
+      // Is it a function?
+      // | FunctionCall 
+      {
+        // Check whether it's all wrapped in a function.  will be like count(.*) where .* is anything
+        // text() will try to be matched here, so just explicitly ignore it
+        $regex = ":^([^\(\)\[\]/]*)\s*\((.*)\)$:U";
+        if (preg_match($regex, $xPathQuery, $aMatch) && $xPathQuery != "text()") {
+          $function = $aMatch[1];
+          $data     = $aMatch[2];
+          // It is possible that we will get "a() or b()" which will match as function "a" with
+          // arguments ") or b(" which is clearly wrong... _bracketsCheck() should catch this.
+          if ($this->_bracketsCheck($data)) {
+            if (in_array($function, $this->functions)) {
+              if ($bDebugThisFunction) echo "XPathExpr: $xPathQuery is a $function() function call:\n";
+              $result = $this->_evaluateFunction($function, $data, $context);
+              break;
+            } 
+          }
+        }
+      }
+
+      // Is it a bracketed expression?
+      // | '(' Expr ')'  
+      // If it is surrounded by () then trim the brackets
+      $bBrackets = FALSE;
+      if (preg_match(":^\((.*)\):", $xPathQuery, $aMatches)) {
+        // Do not keep trimming off the () as we could have "(() and ())"
+        $bBrackets = TRUE;
+        $xPathQuery = $aMatches[1];
+      }
+
+      if ($bBrackets) {
+        // Must be a Expr then.
+        $result = $this->_evaluateExpr($xPathQuery, $context);
+        break;
+      }
+
+      // Can't be a PrimaryExpr then.
+      $error = "Expression is not a PrimaryExpr";
+      $bCacheableResult = TRUE;
+    } while (FALSE);
+    //////////////////////////////////////////////    
+
+    // If possible, cache the result.
+    if ($bCacheableResult) {
+        $aResultsCache[$xPathQuery]['Error'] = $error;
+        $aResultsCache[$xPathQuery]['Result'] = $result;
+    }
+
+    $this->_closeDebugFunction($ThisFunctionName, array('result' => $result, 'error' => $error), $bDebugThisFunction);
+
+    // Return the result.
+    return $error;
+  }
+
+  /**
+   * Evaluates an XPath Expr
+   *
+   * $this->evaluate() is the entry point and does some inits, while this 
+   * function is called recursive internaly for every sub-xPath expresion we find.
+   * It handles the following syntax, and calls evaluatePathExpr if it finds that none
+   * of this grammer applies.
+   *
+   * http://www.w3.org/TR/xpath#section-Basics
+   *
+   * [14]    Expr               ::= OrExpr 
+   * [21]    OrExpr             ::= AndExpr  
+   *                                | OrExpr 'or' AndExpr  
+   * [22]    AndExpr            ::= EqualityExpr  
+   *                                | AndExpr 'and' EqualityExpr  
+   * [23]    EqualityExpr       ::= RelationalExpr  
+   *                                | EqualityExpr '=' RelationalExpr  
+   *                                | EqualityExpr '!=' RelationalExpr  
+   * [24]    RelationalExpr     ::= AdditiveExpr  
+   *                                | RelationalExpr '<' AdditiveExpr  
+   *                                | RelationalExpr '>' AdditiveExpr  
+   *                                | RelationalExpr '<=' AdditiveExpr  
+   *                                | RelationalExpr '>=' AdditiveExpr  
+   * [25]    AdditiveExpr       ::= MultiplicativeExpr  
+   *                                | AdditiveExpr '+' MultiplicativeExpr  
+   *                                | AdditiveExpr '-' MultiplicativeExpr  
+   * [26]    MultiplicativeExpr ::= UnaryExpr  
+   *                                | MultiplicativeExpr MultiplyOperator UnaryExpr  
+   *                                | MultiplicativeExpr 'div' UnaryExpr  
+   *                                | MultiplicativeExpr 'mod' UnaryExpr  
+   * [27]    UnaryExpr          ::= UnionExpr  
+   *                                | '-' UnaryExpr 
+   * [18]    UnionExpr          ::= PathExpr  
+   *                                | UnionExpr '|' PathExpr 
+   *
+   * NOTE: The effect of the above grammar is that the order of precedence is 
+   * (lowest precedence first): 
+   * 1) or 
+   * 2) and 
+   * 3) =, != 
+   * 4) <=, <, >=, > 
+   * 5) +, -
+   * 6) *, div, mod
+   * 7) - (negate)
+   * 8) |
+   *
+   * @param  $xPathQuery  (string)   XPath query to be evaluated.
+   * @param  $context     (array)    An associative array the describes the context from which
+   *                                 to evaluate the XPath Expr.  Contains three members:
+   *                                  'nodePath' => The absolute XPath expression to the context node
+   *                                  'size' => The context size
+   *                                  'pos' => The context position
+   * @return              (mixed)    The result of the XPath expression.  Either:
+   *                                 node-set (an ordered collection of nodes without duplicates) 
+   *                                 boolean (true or false) 
+   *                                 number (a floating-point number) 
+   *                                 string (a sequence of UCS characters) 
+   * @see    evaluate()
+   */
+  function _evaluateExpr($xPathQuery, $context) {
+    $ThisFunctionName = '_evaluateExpr';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Path: $xPathQuery\n";
+      echo "Context:";
+      $this->_printContext($context);
+      echo "\n";    
+    }
+
+    // Numpty check
+    if (!isset($xPathQuery) || ($xPathQuery == '')) {
+      $this->_displayError("The \$xPathQuery argument must have a value.", __LINE__, __FILE__);
+      return FALSE;
+    }
+
+    // At the top level we deal with booleans.  Only if the Expr is just an AdditiveExpr will 
+    // the result not be a boolean.
+    //
+    //
+    // Between these syntactical elements we get PathExprs.
+
+    // Do while false loop
+    do {
+      static $aKnownPathExprCache = array();
+
+      if (isset($aKnownPathExprCache[$xPathQuery])) {
+        if ($bDebugThisFunction) echo "XPathExpr is a PathExpr\n";
+        $result = $this->_evaluatePathExpr($xPathQuery, $context);
+        break;
+      }
+
+      // Check for operators first, as we could have "() op ()" and the PrimaryExpr will try to
+      // say that that is an Expr called ") op ("
+      // Set the default position and the type of the operator.
+      $aOperatorInfo = $this->_GetOperator($xPathQuery);
+
+      // An expression can be one of these, and we should catch these "first" as they are most common
+      if (empty($aOperatorInfo)) {
+        $error = $this->_evaluatePrimaryExpr($xPathQuery, $context, $result);
+        if (empty($error)) {
+          // It could be parsed as a PrimaryExpr, so look no further :o)
+          break;
+        }
+      }
+
+      // Check whether an operator was found.
+      if (empty($aOperatorInfo)) {
+        if ($bDebugThisFunction) echo "XPathExpr is a PathExpr\n";
+        $aKnownPathExprCache[$xPathQuery] = TRUE;
+        // No operator.  Means we have a PathExpr then.  Go to the next level.
+        $result = $this->_evaluatePathExpr($xPathQuery, $context);
+        break;
+      } 
+
+      if ($bDebugThisFunction) { echo "\nFound and operator:"; print_r($aOperatorInfo); }//LEFT:[$leftOperand]  oper:[$operator]  RIGHT:[$rightOperand]";
+
+      $operator = $aOperatorInfo['operator'];
+
+      /////////////////////////////////////////////
+      // Recursively process the operator
+
+      // Check the kind of operator.
+      switch ($operator) {
+        case ' or ': 
+        case ' and ':
+          $operatorType = 'Boolean';
+          break;
+        case '+': 
+        case '-': 
+        case '*':
+        case ' div ':
+        case ' mod ':
+          $operatorType = 'Integer';
+          break;
+        case ' | ':
+          $operatorType = 'NodeSet';
+          break;
+        case '<=':
+        case '<': 
+        case '>=':
+        case '>':
+        case '=': 
+        case '!=':
+          $operatorType = 'Multi';
+          break;
+        default:
+            $this->_displayError("Internal error.  Default case of switch statement reached.", __LINE__, __FILE__);
+      }
+
+      if ($bDebugThisFunction) echo "\nOperator is a [$operator]($operatorType operator)";
+
+      /////////////////////////////////////////////
+      // Evaluate the operands
+
+      // Evaluate the left part.
+      if ($bDebugThisFunction) echo "\nEvaluating LEFT:[{$aOperatorInfo['left operand']}]\n";
+      $left = $this->_evaluateExpr($aOperatorInfo['left operand'], $context);
+      if ($bDebugThisFunction) {echo "{$aOperatorInfo['left operand']} evals as:\n"; print_r($left); }
+      
+      // If it is a boolean operator, it's possible we don't need to evaluate the right part.
+
+      // Only evaluate the right part if we need to.
+      $right = '';
+      if ($operatorType == 'Boolean') {
+        // Is the left part false?
+        $left = $this->_handleFunction_boolean($left, $context);
+        if (!$left and ($operator == ' and ')) {
+          $result = FALSE;
+          break;
+        } else if ($left and ($operator == ' or ')) {
+          $result = TRUE;
+          break;
+        }
+      } 
+
+      // Evaluate the right part
+      if ($bDebugThisFunction) echo "\nEvaluating RIGHT:[{$aOperatorInfo['right operand']}]\n";
+      $right = $this->_evaluateExpr($aOperatorInfo['right operand'], $context);
+      if ($bDebugThisFunction) {echo "{$aOperatorInfo['right operand']} evals as:\n"; print_r($right); echo "\n";}
+
+      /////////////////////////////////////////////
+      // Combine the operands
+
+      // If necessary, work out how to treat the multi operators
+      if ($operatorType != 'Multi') {
+        $result = $this->_evaluateOperator($left, $operator, $right, $operatorType, $context);
+      } else {
+        // http://www.w3.org/TR/xpath#booleans
+        // If both objects to be compared are node-sets, then the comparison will be true if and 
+        // only if there is a node in the first node-set and a node in the second node-set such 
+        // that the result of performing the comparison on the string-values of the two nodes is 
+        // true. 
+        // 
+        // If one object to be compared is a node-set and the other is a number, then the 
+        // comparison will be true if and only if there is a node in the node-set such that the 
+        // result of performing the comparison on the number to be compared and on the result of 
+        // converting the string-value of that node to a number using the number function is true. 
+        //
+        // If one object to be compared is a node-set and the other is a string, then the comparison 
+        // will be true if and only if there is a node in the node-set such that the result of performing 
+        // the comparison on the string-value of the node and the other string is true. 
+        // 
+        // If one object to be compared is a node-set and the other is a boolean, then the comparison 
+        // will be true if and only if the result of performing the comparison on the boolean and on 
+        // the result of converting the node-set to a boolean using the boolean function is true.
+        if (is_array($left) || is_array($right)) {
+          if ($bDebugThisFunction) echo "As one of the operands is an array, we will need to loop\n";
+          if (is_array($left) && is_array($right)) {
+            $operatorType = 'String';
+          } elseif (is_numeric($left) || is_numeric($right)) {
+            $operatorType = 'Integer';
+          } elseif (is_bool($left)) {
+            $operatorType = 'Boolean';
+            $right = $this->_handleFunction_boolean($right, $context);
+          } elseif (is_bool($right)) {
+            $operatorType = 'Boolean';
+            $left = $this->_handleFunction_boolean($left, $context);
+          } else {
+            $operatorType = 'String';
+          }
+          if ($bDebugThisFunction) echo "Equals operator is a $operatorType operator\n";
+          // Turn both operands into arrays to simplify logic
+          $aLeft = $left;
+          $aRight = $right;
+          if (!is_array($aLeft)) $aLeft = array($aLeft);
+          if (!is_array($aRight)) $aRight = array($aRight);
+          $result = FALSE;
+          if (!empty($aLeft)) {
+            foreach ($aLeft as $leftItem) {
+              if (empty($aRight)) break;
+              // If the item is from a node set, we should evaluate it's string-value
+              if (is_array($left)) {
+                if ($bDebugThisFunction) echo "\tObtaining string-value of LHS:$leftItem as it's from a nodeset\n";
+                $leftItem = $this->_stringValue($leftItem);
+              }
+              foreach ($aRight as $rightItem) {
+                // If the item is from a node set, we should evaluate it's string-value
+                if (is_array($right)) {
+                  if ($bDebugThisFunction) echo "\tObtaining string-value of RHS:$rightItem as it's from a nodeset\n";
+                  $rightItem = $this->_stringValue($rightItem);
+                }
+
+                if ($bDebugThisFunction) echo "\tEvaluating $leftItem $operator $rightItem\n";
+                $result = $this->_evaluateOperator($leftItem, $operator, $rightItem, $operatorType, $context);
+                if ($result === TRUE) break;
+              }
+              if ($result === TRUE) break;
+            }
+          }
+        } 
+        // When neither object to be compared is a node-set and the operator is = or !=, then the 
+        // objects are compared by converting them to a common type as follows and then comparing 
+        // them. 
+        //
+        // If at least one object to be compared is a boolean, then each object to be compared 
+        // is converted to a boolean as if by applying the boolean function. 
+        //
+        // Otherwise, if at least one object to be compared is a number, then each object to be 
+        // compared is converted to a number as if by applying the number function. 
+        //
+        // Otherwise, both objects to be compared are converted to strings as if by applying 
+        // the string function. 
+        //  
+        // The = comparison will be true if and only if the objects are equal; the != comparison 
+        // will be true if and only if the objects are not equal. Numbers are compared for equality 
+        // according to IEEE 754 [IEEE 754]. Two booleans are equal if either both are true or 
+        // both are false. Two strings are equal if and only if they consist of the same sequence 
+        // of UCS characters.
+        else {
+          if (is_bool($left) || is_bool($right)) {
+            $operatorType = 'Boolean';
+          } elseif (is_numeric($left) || is_numeric($right)) {
+            $operatorType = 'Integer';
+          } else {
+            $operatorType = 'String';
+          }
+          if ($bDebugThisFunction) echo "Equals operator is a $operatorType operator\n";
+          $result = $this->_evaluateOperator($left, $operator, $right, $operatorType, $context);
+        }
+      }
+
+    } while (FALSE);
+    //////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    // Return the result.
+    return $result;
+  }
+
+  /**
+   * Evaluate the result of an operator whose operands have been evaluated
+   *
+   * If the operator type is not "NodeSet", then neither the left or right operators 
+   * will be node sets, as the processing when one or other is an array is complex,
+   * and should be handled by the caller.
+   *
+   * @param  $left          (mixed)   The left operand
+   * @param  $right         (mixed)   The right operand
+   * @param  $operator      (string)  The operator to use to combine the operands
+   * @param  $operatorType  (string)  The type of the operator.  Either 'Boolean', 
+   *                                  'Integer', 'String', or 'NodeSet'
+   * @param  $context     (array)    The context from which to evaluate
+   * @return              (mixed)    The result of the XPath expression.  Either:
+   *                                 node-set (an ordered collection of nodes without duplicates) 
+   *                                 boolean (true or false) 
+   *                                 number (a floating-point number) 
+   *                                 string (a sequence of UCS characters) 
+   */
+  function _evaluateOperator($left, $operator, $right, $operatorType, $context) {
+    $ThisFunctionName = '_evaluateOperator';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "left: $left\n";
+      echo "right: $right\n";
+      echo "operator: $operator\n";
+      echo "operator type: $operatorType\n";
+    }
+
+    // Do while false loop
+    do {
+      // Handle the operator depending on the operator type.
+      switch ($operatorType) {
+        case 'Boolean':
+          {
+            // Boolify the arguments.  (The left arg is already a bool)
+            $right = $this->_handleFunction_boolean($right, $context);
+            switch ($operator) {
+              case '=': // Compare the two results.
+                $result = (bool)($left == $right); 
+                break;
+              case ' or ': // Return the two results connected by an 'or'.
+                $result = (bool)( $left or $right );
+                break;
+              case ' and ': // Return the two results connected by an 'and'.
+                $result = (bool)( $left and $right );
+                break;
+              case '!=': // Check whether the two results are not equal.
+                $result = (bool)( $left != $right );
+                break;
+              default:
+                $this->_displayError("Internal error.  Default case of switch statement reached.", __LINE__, __FILE__);
+            }
+          }
+          break;
+        case 'Integer':
+          {
+            // Convert both left and right operands into numbers.
+            if (empty($left) && ($operator == '-')) {
+              // There may be no left operator if the op is '-'
+              $left = 0;
+            } else {
+              $left = $this->_handleFunction_number($left, $context);
+            }
+            $right = $this->_handleFunction_number($right, $context);
+            if ($bDebugThisFunction) echo "\nLeft is $left, Right is $right\n";
+            switch ($operator) {
+              case '=': // Compare the two results.
+                $result = (bool)($left == $right); 
+                break;
+              case '!=': // Compare the two results.
+                $result = (bool)($left != $right); 
+                break;
+              case '+': // Return the result by adding one result to the other.
+                $result = $left + $right;
+                break;
+              case '-': // Return the result by decrease one result by the other.
+                $result = $left - $right;
+                break;
+              case '*': // Return a multiplication of the two results.
+                $result =  $left * $right;
+                break;
+              case ' div ': // Return a division of the two results.
+                $result = $left / $right;
+                break;
+              case ' mod ': // Return a modulo division of the two results.
+                $result = $left % $right;
+                break;
+              case '<=': // Compare the two results.
+                $result = (bool)( $left <= $right );
+                break;
+              case '<': // Compare the two results.
+                $result = (bool)( $left < $right );
+                break;
+              case '>=': // Compare the two results.
+                $result = (bool)( $left >= $right );
+                break;
+              case '>': // Compare the two results.
+                $result = (bool)( $left > $right );
+                break;
+              default:
+                $this->_displayError("Internal error.  Default case of switch statement reached.", __LINE__, __FILE__);
+            }
+          }
+          break;
+        case 'NodeSet':
+          // Add the nodes to the result set
+          $result = array_merge($left, $right);
+          // Remove duplicated nodes.
+          $result = array_unique($result);
+
+          // Preserve doc order if there was more than one query.
+          if (count($result) > 1) {
+            $result = $this->_sortByDocOrder($result);
+          }
+          break;
+        case 'String':
+            $left = $this->_handleFunction_string($left, $context);
+            $right = $this->_handleFunction_string($right, $context);
+            if ($bDebugThisFunction) echo "\nLeft is $left, Right is $right\n";
+            switch ($operator) {
+              case '=': // Compare the two results.
+                $result = (bool)($left == $right); 
+                break;
+              case '!=': // Compare the two results.
+                $result = (bool)($left != $right); 
+                break;
+              default:
+                $this->_displayError("Internal error.  Default case of switch statement reached.", __LINE__, __FILE__);
+            }
+          break;
+        default:
+          $this->_displayError("Internal error.  Default case of switch statement reached.", __LINE__, __FILE__);
+      }
+    } while (FALSE);
+
+    //////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    // Return the result.
+    return $result;
+  }
+  
+  /**
+   * Evaluates an XPath PathExpr
+   *
+   * It handles the following syntax:
+   *
+   * http://www.w3.org/TR/xpath#node-sets
+   * http://www.w3.org/TR/xpath#NT-LocationPath
+   * http://www.w3.org/TR/xpath#path-abbrev
+   * http://www.w3.org/TR/xpath#NT-Step
+   *
+   * [19]   PathExpr              ::= LocationPath  
+   *                                  | FilterExpr  
+   *                                  | FilterExpr '/' RelativeLocationPath  
+   *                                  | FilterExpr '//' RelativeLocationPath
+   * [20]   FilterExpr            ::= PrimaryExpr  
+   *                                  | FilterExpr Predicate 
+   * [1]    LocationPath          ::= RelativeLocationPath  
+   *                                  | AbsoluteLocationPath  
+   * [2]    AbsoluteLocationPath  ::= '/' RelativeLocationPath?  
+   *                                  | AbbreviatedAbsoluteLocationPath
+   * [3]    RelativeLocationPath  ::= Step  
+   *                                  | RelativeLocationPath '/' Step  
+   *                                  | AbbreviatedRelativeLocationPath
+   * [4]    Step                  ::= AxisSpecifier NodeTest Predicate*  
+   *                                  | AbbreviatedStep  
+   * [5]    AxisSpecifier         ::= AxisName '::'  
+   *                                  | AbbreviatedAxisSpecifier  
+   * [10]   AbbreviatedAbsoluteLocationPath
+   *                              ::= '//' RelativeLocationPath
+   * [11]   AbbreviatedRelativeLocationPath
+   *                              ::= RelativeLocationPath '//' Step
+   * [12]   AbbreviatedStep       ::= '.'  
+   *                                  | '..'  
+   * [13]   AbbreviatedAxisSpecifier    
+   *                              ::= '@'? 
+   *
+   * If you expand all the abbreviated versions, then the grammer simplifies to:
+   *
+   * [19]   PathExpr              ::= RelativeLocationPath  
+   *                                  | '/' RelativeLocationPath?  
+   *                                  | FilterExpr  
+   *                                  | FilterExpr '/' RelativeLocationPath  
+   * [20]   FilterExpr            ::= PrimaryExpr  
+   *                                  | FilterExpr Predicate 
+   * [3]    RelativeLocationPath  ::= Step  
+   *                                  | RelativeLocationPath '/' Step  
+   * [4]    Step                  ::= AxisName '::' NodeTest Predicate*  
+   *
+   * Conceptually you can say that we should split by '/' and try to treat the parts
+   * as steps, and if that fails then try to treat it as a PrimaryExpr.  
+   * 
+   * @param  $PathExpr   (string) PathExpr syntactical element
+   * @param  $context    (array)  The context from which to evaluate
+   * @return             (mixed)  The result of the XPath expression.  Either:
+   *                               node-set (an ordered collection of nodes without duplicates) 
+   *                               boolean (true or false) 
+   *                               number (a floating-point number) 
+   *                               string (a sequence of UCS characters) 
+   * @see    evaluate()
+   */
+  function _evaluatePathExpr($PathExpr, $context) {
+    $ThisFunctionName = '_evaluatePathExpr';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "PathExpr: $PathExpr\n";
+      echo "Context:";
+      $this->_printContext($context);
+      echo "\n";
+    }
+    
+    // Numpty check
+    if (empty($PathExpr)) {
+      $this->_displayError("The \$PathExpr argument must have a value.", __LINE__, __FILE__);
+      return FALSE;
+    }
+    //////////////////////////////////////////////
+
+    // Parsing the expression into steps is a cachable operation as it doesn't depend on the context
+    static $aResultsCache = array();
+
+    if (isset($aResultsCache[$PathExpr])) {
+      $steps = $aResultsCache[$PathExpr];
+    } else {
+      // Note that we have used $this->slashes2descendant to simplify this logic, so the 
+      // "Abbreviated" paths basically never exist as '//' never exists.
+
+      // mini syntax check
+      if (!$this->_bracketsCheck($PathExpr)) {
+        $this->_displayError('While parsing an XPath query, in the PathExpr "' .
+        $PathExpr.
+        '", there was an invalid number of brackets or a bracket mismatch.', __LINE__, __FILE__);
+      }
+      // Save the current path.
+      $this->currentXpathQuery = $PathExpr;
+      // Split the path at every slash *outside* a bracket.
+      $steps = $this->_bracketExplode('/', $PathExpr);
+      if ($bDebugThisFunction) { echo "<hr>Split the path '$PathExpr' at every slash *outside* a bracket.\n "; print_r($steps); }
+      // Check whether the first element is empty.
+      if (empty($steps[0])) {
+        // Remove the first and empty element. It's a starting  '//'.
+        array_shift($steps);
+      }
+      $aResultsCache[$PathExpr] = $steps;
+    }
+
+    // Start to evaluate the steps.
+    // ### Consider implementing an evaluateSteps() function that removes recursion from
+    // evaluateStep()
+    $result = $this->_evaluateStep($steps, $context);
+
+    // Preserve doc order if there was more than one result
+    if (count($result) > 1) {
+      $result = $this->_sortByDocOrder($result);
+    }
+    //////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    // Return the result.
+    return $result;
+  }
+
+  /**
+   * Sort an xPathSet by doc order.
+   *
+   * @param  $xPathSet (array) Array of full paths to nodes that need to be sorted
+   * @return           (array) Array containing the same contents as $xPathSet, but
+   *                           with the contents in doc order
+   */
+  function _sortByDocOrder($xPathSet) {
+    $ThisFunctionName = '_sortByDocOrder';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "_sortByDocOrder(xPathSet:[".count($xPathSet)."])";
+      echo "xPathSet:\n";
+      print_r($xPathSet);
+      echo "<hr>\n";
+    }
+    //////////////////////////////////////////////
+
+    $aResult = array();
+
+    // Spot some common shortcuts.
+    if (count($xPathSet) < 1) {
+      $aResult = $xPathSet;
+    } else {
+      // Build an array of doc-pos indexes.
+      $aDocPos = array();
+      $nodeCount = count($this->nodeIndex);
+      $aPaths = array_keys($this->nodeIndex);
+      if ($bDebugThisFunction) {
+        echo "searching for path indices in array_keys(this->nodeIndex)...\n";
+        //print_r($aPaths);
+      }
+
+      // The last index we found.  In general the elements will be in groups
+      // that are themselves in order.
+      $iLastIndex = 0;
+      foreach ($xPathSet as $path) {
+        // Cycle round the nodes, starting at the last index, looking for the path.
+        $foundNode = FALSE;
+        for ($iIndex = $iLastIndex; $iIndex < $nodeCount + $iLastIndex; $iIndex++) {
+          $iThisIndex = $iIndex % $nodeCount;
+          if (!strcmp($aPaths[$iThisIndex],$path)) {
+            // we have found the doc-position index of the path 
+            $aDocPos[] = $iThisIndex;
+            $iLastIndex = $iThisIndex;
+            $foundNode = TRUE;
+            break;
+          }
+        }
+        if ($bDebugThisFunction) {
+          if (!$foundNode)
+            echo "Error: $path not found in \$this->nodeIndex\n";
+          else 
+            echo "Found node after ".($iIndex - $iLastIndex)." iterations\n";
+        }
+      }
+      // Now count the number of doc pos we have and the number of results and
+      // confirm that we have the same number of each.
+      $iDocPosCount = count($aDocPos);
+      $iResultCount = count($xPathSet);
+      if ($iDocPosCount != $iResultCount) {
+        if ($bDebugThisFunction) {
+          echo "count(\$aDocPos)=$iDocPosCount; count(\$result)=$iResultCount\n";
+          print_r(array_keys($this->nodeIndex));
+        }
+        $this->_displayError('Results from _InternalEvaluate() are corrupt.  '.
+                                      'Do you need to call reindexNodeTree()?', __LINE__, __FILE__);
+      }
+
+      // Now sort the indexes.
+      sort($aDocPos);
+
+      // And now convert back to paths.
+      $iPathCount = count($aDocPos);
+      for ($iIndex = 0; $iIndex < $iPathCount; $iIndex++) {
+        $aResult[] = $aPaths[$aDocPos[$iIndex]];
+      }
+    }
+
+    // Our result from the function is this array.
+    $result = $aResult;
+
+    //////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    // Return the result.
+    return $result;
+  }
+
+  /**
+   * Evaluate a step from a XPathQuery expression at a specific contextPath.
+   *
+   * Steps are the arguments of a XPathQuery when divided by a '/'. A contextPath is a 
+   * absolute XPath (or vector of XPaths) to a starting node(s) from which the step should 
+   * be evaluated.
+   *
+   * @param  $steps        (array) Vector containing the remaining steps of the current 
+   *                               XPathQuery expression.
+   * @param  $context      (array) The context from which to evaluate
+   * @return               (array) Vector of absolute XPath's as a result of the step 
+   *                               evaluation.  The results will not necessarily be in doc order
+   * @see    _evaluatePathExpr()
+   */
+  function _evaluateStep($steps, $context) {
+    $ThisFunctionName = '_evaluateStep';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Context:";
+      $this->_printContext($context);
+      echo "\n";
+      echo "Steps: ";
+      print_r($steps);
+      echo "<hr>\n";
+    }
+    //////////////////////////////////////////////
+
+    $result = array(); // Create an empty array for saving the abs. XPath's found.
+
+    $contextPaths = array();   // Create an array to save the new contexts.
+    $step = trim(array_shift($steps)); // Get this step.
+    if ($bDebugThisFunction) echo __LINE__.":Evaluating step $step\n";
+    
+    $axis = $this->_getAxis($step); // Get the axis of the current step.
+
+    // If there was no axis, then it must be a PrimaryExpr
+    if ($axis == FALSE) {
+      if ($bDebugThisFunction) echo __LINE__.":Step is not an axis but a PrimaryExpr\n";
+      // ### This isn't correct, as the result of this function might not be a node set.
+      $error = $this->_evaluatePrimaryExpr($step, $context, $contextPaths);
+      if (!empty($error)) {
+        $this->_displayError("Expression failed to parse as PrimaryExpr because: $error"
+                , __LINE__, __FILE__, FALSE);
+      }
+    } else {
+      if ($bDebugThisFunction) { echo __LINE__.":Axis of step is:\n"; print_r($axis); echo "\n";}
+      $method = '_handleAxis_' . $axis['axis']; // Create the name of the method.
+    
+      // Check whether the axis handler is defined. If not display an error message.
+      if (!method_exists($this, $method)) {
+        $this->_displayError('While parsing an XPath query, the axis ' .
+        $axis['axis'] . ' could not be handled, because this version does not support this axis.', __LINE__, __FILE__);
+      }
+      if ($bDebugThisFunction) echo __LINE__.":Calling user method $method\n";        
+      
+      // Perform an axis action.
+      $contextPaths = $this->$method($axis, $context['nodePath']);
+      if ($bDebugThisFunction) { echo __LINE__.":We found these contexts from this step:\n"; print_r( $contextPaths ); echo "\n";}
+    }
+
+    // Check whether there are predicates.
+    if (count($contextPaths) > 0 && count($axis['predicate']) > 0) {
+      if ($bDebugThisFunction) echo __LINE__.":Filtering contexts by predicate...\n";
+      
+      // Check whether each node fits the predicates.
+      $contextPaths = $this->_checkPredicates($contextPaths, $axis['predicate']);
+    }
+
+    // Check whether there are more steps left.
+    if (count($steps) > 0) {
+      if ($bDebugThisFunction) echo __LINE__.":Evaluating next step given the context of the first step...\n";        
+      
+      // Continue the evaluation of the next steps.
+
+      // Run through the array.
+      $size = sizeOf($contextPaths);
+      for ($pos=0; $pos<$size; $pos++) {
+        // Build new context
+        $newContext = array('nodePath' => $contextPaths[$pos], 'size' => $size, 'pos' => $pos + 1);
+        if ($bDebugThisFunction) echo __LINE__.":Evaluating step for the {$contextPaths[$pos]} context...\n";
+        // Call this method for this single path.
+        $xPathSetNew = $this->_evaluateStep($steps, $newContext);
+        if ($bDebugThisFunction) {echo "New results for this context:\n"; print_r($xPathSetNew);}
+        $result = array_merge($result, $xPathSetNew);
+      }
+
+      // Remove duplicated nodes.
+      $result = array_unique($result);
+    } else {
+      $result = $contextPaths; // Save the found contexts.
+    }
+    
+    //////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    // Return the result.
+    return $result;
+  }
+  
+  /**
+   * Checks whether a node matches predicates.
+   *
+   * This method checks whether a list of nodes passed to this method match
+   * a given list of predicates. 
+   *
+   * @param  $xPathSet   (array)  Array of full paths of all nodes to be tested.
+   * @param  $predicates (array)  Array of predicates to use.
+   * @return             (array)  Vector of absolute XPath's that match the given predicates.
+   * @see    _evaluateStep()
+   */
+  function _checkPredicates($xPathSet, $predicates) {
+    $ThisFunctionName = '_checkPredicates';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "XPathSet:";
+      print_r($xPathSet);
+      echo "Predicates:";
+      print_r($predicates);
+      echo "<hr>";
+    }
+    //////////////////////////////////////////////
+    // Create an empty set of nodes.
+    $result = array();
+
+    // Run through all predicates.
+    $pSize = sizeOf($predicates);
+    for ($j=0; $j<$pSize; $j++) {
+      $predicate = $predicates[$j]; 
+      if ($bDebugThisFunction) echo "Evaluating predicate \"$predicate\"\n";
+
+      // This will contain all the nodes that match this predicate
+      $aNewSet = array();
+      
+      // Run through all nodes.
+      $contextSize = count($xPathSet);
+      for ($contextPos=0; $contextPos<$contextSize; $contextPos++) {
+        $xPath = $xPathSet[$contextPos];
+
+        // Build the context for this predicate
+        $context = array('nodePath' => $xPath, 'size' => $contextSize, 'pos' => $contextPos + 1);
+      
+        // Check whether the predicate is just an number.
+        if (preg_match('/^\d+$/', $predicate)) {
+          if ($bDebugThisFunction) echo "Taking short cut and calling _handleFunction_position() directly.\n";
+          // Take a short cut.  If it is just a position, then call 
+          // _handleFunction_position() directly.  70% of the
+          // time this will be the case. ## N.S
+//          $check = (bool) ($predicate == $context['pos']);
+          $check = (bool) ($predicate == $this->_handleFunction_position('', $context));
+        } else {                
+          // Else do the predicate check the long and through way.
+          $check = $this->_evaluateExpr($predicate, $context);
+        }
+        if ($bDebugThisFunction) {
+          echo "Evaluating the predicate returned "; 
+          var_dump($check); 
+          echo "\n";
+        }
+
+        if (is_int($check)) { // Check whether it's an integer.
+          // Check whether it's the current position.
+          $check = (bool) ($check == $this->_handleFunction_position('', $context));
+        } else {
+          $check = (bool) ($this->_handleFunction_boolean($check, $context));
+//          if ($bDebugThisFunction) {echo $this->_handleFunction_string($check, $context);}
+        }
+
+        if ($bDebugThisFunction) echo "Node $xPath matches predicate $predicate: " . (($check) ? "TRUE" : "FALSE") ."\n";
+
+        // Do we add it?
+        if ($check) $aNewSet[] = $xPath;
+      }
+       
+      // Use the newly filtered list.
+      $xPathSet = $aNewSet;
+
+      if ($bDebugThisFunction) {echo "Node set now contains : "; print_r($xPathSet); }
+    }
+
+    $result = $xPathSet;
+
+    //////////////////////////////////////////////
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    // Return the array of nodes.
+    return $result;
+  }
+  
+  /**
+   * Evaluates an XPath function
+   *
+   * This method evaluates a given XPath function with its arguments on a
+   * specific node of the document.
+   *
+   * @param  $function      (string) Name of the function to be evaluated.
+   * @param  $arguments     (string) String containing the arguments being
+   *                                 passed to the function.
+   * @param  $context       (array)  The context from which to evaluate
+   * @return                (mixed)  This method returns the result of the evaluation of
+   *                                 the function. Depending on the function the type of the 
+   *                                 return value can be different.
+   * @see    evaluate()
+   */
+  function _evaluateFunction($function, $arguments, $context) {
+    $ThisFunctionName = '_evaluateFunction';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      if (is_array($arguments)) {
+        echo "Arguments:\n";
+        print_r($arguments);
+      } else {
+        echo "Arguments: $arguments\n";
+      }
+      echo "Context:";
+      $this->_printContext($context);
+      echo "\n";
+      echo "<hr>\n";
+    }
+    /////////////////////////////////////
+    // Remove whitespaces.
+    $function  = trim($function);
+    $arguments = trim($arguments);
+    // Create the name of the function handling function.
+    $method = '_handleFunction_'. $function;
+    
+    // Check whether the function handling function is available.
+    if (!method_exists($this, $method)) {
+      // Display an error message.
+      $this->_displayError("While parsing an XPath query, ".
+        "the function \"$function\" could not be handled, because this ".
+        "version does not support this function.", __LINE__, __FILE__);
+    }
+    if ($bDebugThisFunction) echo "Calling function $method($arguments)\n"; 
+    
+    // Return the result of the function.
+    $result = $this->$method($arguments, $context);
+    
+    //////////////////////////////////////////////
+    // Return the nodes found.
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    // Return the result.
+    return $result;
+  }
+    
+  /**
+   * Checks whether a node matches a node-test.
+   *
+   * This method checks whether a node in the document matches a given node-test.
+   * A node test is something like text(), node(), or an element name.
+   *
+   * @param  $contextPath (string)  Full xpath of the node, which should be tested for 
+   *                                matching the node-test.
+   * @param  $nodeTest    (string)  String containing the node-test for the node.
+   * @return              (boolean) This method returns TRUE if the node matches the 
+   *                                node-test, otherwise FALSE.
+   * @see    evaluate()
+   */
+  function _checkNodeTest($contextPath, $nodeTest) {
+    // Empty node test means that it must match
+    if (empty($nodeTest)) return TRUE;
+
+    if ($nodeTest == '*') {
+      // * matches all element nodes.
+      return (!preg_match(':/[^/]+\(\)\[\d+\]$:U', $contextPath));
+    }
+    elseif (preg_match('/^[\w-:\.]+$/', $nodeTest)) {
+       // http://www.w3.org/TR/2000/REC-xml-20001006#NT-Name
+       // The real spec for what constitutes whitespace is quite elaborate, and 
+       // we currently just hope that "\w" catches them all.  In reality it should
+       // start with a letter too, not a number, but we've just left it simple.
+       // It's just a node name test.  It should end with "/$nodeTest[x]"
+       return (preg_match('"/'.$nodeTest.'\[\d+\]$"', $contextPath));
+    }
+    elseif (preg_match('/\(/U', $nodeTest)) { // Check whether it's a function.
+      // Get the type of function to use.
+      $function = $this->_prestr($nodeTest, '(');
+      // Check whether the node fits the method.
+      switch ($function) {
+        case 'node':   // Add this node to the list of nodes.
+          return TRUE;
+        case 'text':   // Check whether the node has some text.
+          $tmp = implode('', $this->nodeIndex[$contextPath]['textParts']);
+          if (!empty($tmp)) {
+            return TRUE; // Add this node to the list of nodes.
+          }
+          break;
+/******** NOT supported (yet?)          
+        case 'comment':  // Check whether the node has some comment.
+          if (!empty($this->nodeIndex[$contextPath]['comment'])) {
+            return TRUE; // Add this node to the list of nodes.
+          }
+          break;
+        case 'processing-instruction':
+          $literal = $this->_afterstr($axis['node-test'], '('); // Get the literal argument.
+          $literal = substr($literal, 0, strlen($literal) - 1); // Cut the literal.
+          
+          // Check whether a literal was given.
+          if (!empty($literal)) {
+            // Check whether the node's processing instructions are matching the literals given.
+            if ($this->nodeIndex[$context]['processing-instructions'] == $literal) {
+              return TRUE; // Add this node to the node-set.
+            }
+          } else {
+            // Check whether the node has processing instructions.
+            if (!empty($this->nodeIndex[$contextPath]['processing-instructions'])) {
+              return TRUE; // Add this node to the node-set.
+            }
+          }
+          break;
+***********/            
+        default:  // Display an error message.
+          $this->_displayError('While parsing an XPath query there was an undefined function called "' .
+             str_replace($function, '<b>'.$function.'</b>', $this->currentXpathQuery) .'"', __LINE__, __FILE__);
+      }
+    }
+    else { // Display an error message.
+      $this->_displayError("While parsing the XPath query \"{$this->currentXpathQuery}\" ".
+        "an empty and therefore invalid node-test has been found.", __LINE__, __FILE__, FALSE);
+    }
+    
+    return FALSE; // Don't add this context.
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPath                    ------  XPath AXIS Handlers  ------                            
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Retrieves axis information from an XPath query step.
+   *
+   * This method tries to extract the name of the axis and its node-test
+   * from a given step of an XPath query at a given node.  If it can't parse
+   * the step, then we treat it as a PrimaryExpr.
+   *
+   * [4]    Step            ::= AxisSpecifier NodeTest Predicate*  
+   *                            | AbbreviatedStep  
+   * [5]    AxisSpecifier   ::= AxisName '::'  
+   *                            | AbbreviatedAxisSpecifier 
+   * [12]   AbbreviatedStep ::= '.'  
+   *                            | '..'  
+   * [13]   AbbreviatedAxisSpecifier    
+   *                        ::=    '@'? 
+   * 
+   * [7]    NodeTest        ::= NameTest  
+   *                            | NodeType '(' ')'  
+   *                            | 'processing-instruction' '(' Literal ')'  
+   * [37]   NameTest        ::= '*'  
+   *                            | NCName ':' '*'  
+   *                            | QName  
+   * [38]   NodeType        ::= 'comment'  
+   *                            | 'text'  
+   *                            | 'processing-instruction'  
+   *                            | 'node' 
+   *
+   * @param  $step     (string) String containing a step of an XPath query.
+   * @return           (array)  Contains information about the axis found in the step, or FALSE
+   *                            if the string isn't a valid step.
+   * @see    _evaluateStep()
+   */
+  function _getAxis($step) {
+    // The results of this function are very cachable, as it is completely independant of context.
+    static $aResultsCache = array();
+
+    // Create an array to save the axis information.
+    $axis = array(
+      'axis'      => '',
+      'node-test' => '',
+      'predicate' => array()
+    );
+
+    $cacheKey = $step;
+    do { // parse block
+      $parseBlock = 1;
+
+      if (isset($aResultsCache[$cacheKey])) {
+        return $aResultsCache[$cacheKey];
+      } else {
+        // We have some danger of causing recursion here if we refuse to parse a step as having an
+        // axis, and demand it be treated as a PrimaryExpr.  So if we are going to fail, make sure
+        // we record what we tried, so that we can catch to see if it comes straight back.
+        $guess = array(
+          'axis' => 'child',
+          'node-test' => $step,
+          'predicate' => array());
+        $aResultsCache[$cacheKey] = $guess;
+      }
+
+      ///////////////////////////////////////////////////
+      // Spot the steps that won't come with an axis
+
+      // Check whether the step is empty or only self. 
+      if (empty($step) OR ($step == '.') OR ($step == 'current()')) {
+        // Set it to the default value.
+        $step = '.';
+        $axis['axis']      = 'self';
+        $axis['node-test'] = '*';
+        break $parseBlock;
+      }
+
+      if ($step == '..') {
+        // Select the parent axis.
+        $axis['axis']      = 'parent';
+        $axis['node-test'] = '*';
+        break $parseBlock;
+      }
+
+      ///////////////////////////////////////////////////
+      // Pull off the predicates
+
+      // Check whether there are predicates and add the predicate to the list 
+      // of predicates without []. Get contents of every [] found.
+      $groups = $this->_getEndGroups($step);
+//print_r($groups);
+      $groupCount = count($groups);
+      while (($groupCount > 0) && ($groups[$groupCount - 1][0] == '[')) {
+        // Remove the [] and add the predicate to the top of the list
+        $predicate = substr($groups[$groupCount - 1], 1, -1);
+        array_unshift($axis['predicate'], $predicate);
+        // Pop a group off the end of the list
+        array_pop($groups);
+        $groupCount--;
+      }
+
+      // Finally stick the rest back together and this is the rest of our step
+      if ($groupCount > 0) {
+        $step = implode('', $groups);
+      }
+
+      ///////////////////////////////////////////////////
+      // Pull off the axis
+
+      // Check for abbreviated syntax
+      if ($step[0] == '@') {
+        // Use the attribute axis and select the attribute.
+        $axis['axis']      = 'attribute';
+        $step = substr($step, 1);
+      } else {
+        // Check whether the axis is given in plain text.
+        if (preg_match("/^([^:]*)::(.*)$/", $step, $match)) {
+          // Split the step to extract axis and node-test.
+          $axis['axis'] = $match[1];
+          $step         = $match[2];
+        } else {
+          // The default axis is child
+          $axis['axis'] = 'child';
+        }
+      }
+
+      ///////////////////////////////////////////////////
+      // Process the rest which will either a node test, or else this isn't a step.
+
+      // Check whether is an abbreviated syntax.
+      if ($step == '*') {
+        // Use the child axis and select all children.
+        $axis['node-test'] = '*';
+        break $parseBlock;
+      }
+
+      // ### I'm pretty sure our current handling of cdata is a fudge, and we should
+      // really do this better, but leave this as is for now.
+      if ($step == "text()") {
+        // Handle the text node
+        $axis["node-test"] = "cdata";
+        break $parseBlock;
+      }
+
+      // There are a few node tests that we match verbatim.
+      if ($step == "node()"
+          || $step == "comment()"
+          || $step == "text()"
+          || $step == "processing-instruction") {
+        $axis["node-test"] = $step;
+        break $parseBlock;
+      }
+
+      // processing-instruction() is allowed to take an argument, but if it does, the argument
+      // is a literal, which we will have parsed out to $[number].
+      if (preg_match(":processing-instruction\(\$\d*\):", $step)) {
+        $axis["node-test"] = $step;
+        break $parseBlock;
+      }
+
+      // The only remaining way this can be a step, is if the remaining string is a simple name
+      // or else a :* name.
+      // http://www.w3.org/TR/xpath#NT-NameTest
+      // NameTest   ::= '*'  
+      //                | NCName ':' '*'  
+      //                | QName 
+      // QName      ::=  (Prefix ':')? LocalPart 
+      // Prefix     ::=  NCName 
+      // LocalPart  ::=  NCName 
+      //
+      // ie
+      // NameTest   ::= '*'  
+      //                | NCName ':' '*'  
+      //                | (NCName ':')? NCName
+      // NCName ::=  (Letter | '_') (NCNameChar)* 
+      $NCName = "[a-zA-Z_][\w\.\-_]*";
+      if (preg_match("/^$NCName:$NCName$/", $step)
+        || preg_match("/^$NCName:*$/", $step)) {
+        $axis['node-test'] = $step;
+        if (!empty($this->parseOptions[XML_OPTION_CASE_FOLDING])) {
+          // Case in-sensitive
+          $axis['node-test'] = strtoupper($axis['node-test']);
+        }
+        // Not currently recursing
+        $LastFailedStep = '';
+        $LastFailedContext = '';
+        break $parseBlock;
+      } 
+
+      // It's not a node then, we must treat it as a PrimaryExpr
+      // Check for recursion
+      if ($LastFailedStep == $step) {
+        $this->_displayError('Recursion detected while parsing an XPath query, in the step ' .
+              str_replace($step, '<b>'.$step.'</b>', $this->currentXpathQuery)
+              , __LINE__, __FILE__, FALSE);
+        $axis['node-test'] = $step;
+      } else {
+        $LastFailedStep = $step;
+        $axis = FALSE;
+      }
+      
+    } while(FALSE); // end parse block
+    
+    // Check whether it's a valid axis.
+    if ($axis !== FALSE) {
+      if (!in_array($axis['axis'], array_merge($this->axes, array('function')))) {
+        // Display an error message.
+        $this->_displayError('While parsing an XPath query, in the step ' .
+          str_replace($step, '<b>'.$step.'</b>', $this->currentXpathQuery) .
+          ' the invalid axis ' . $axis['axis'] . ' was found.', __LINE__, __FILE__, FALSE);
+      }
+    }
+
+    // Cache the real axis information
+    $aResultsCache[$cacheKey] = $axis;
+
+    // Return the axis information.
+    return $axis;
+  }
+   
+
+  /**
+   * Handles the XPath child axis.
+   *
+   * This method handles the XPath child axis.  It essentially filters out the
+   * children to match the name specified after the '/'.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should 
+   *                               be processed.
+   * @return              (array)  A vector containing all nodes that were found, during 
+   *                               the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_child($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set to hold the results of the child matches
+    if ($axis["node-test"] == "cdata") {
+      if (!isSet($this->nodeIndex[$contextPath]['textParts']) ) return '';
+      $tSize = sizeOf($this->nodeIndex[$contextPath]['textParts']);
+      for ($i=1; $i<=$tSize; $i++) { 
+        $xPathSet[] = $contextPath . '/text()['.$i.']';
+      }
+    }
+    else {
+      // Get a list of all children.
+      $allChildren = $this->nodeIndex[$contextPath]['childNodes'];
+      
+      // Run through all children in the order they where set.
+      $cSize = sizeOf($allChildren);
+      for ($i=0; $i<$cSize; $i++) {
+        $childPath = $contextPath .'/'. $allChildren[$i]['name'] .'['. $allChildren[$i]['contextPos']  .']';
+        $textChildPath = $contextPath.'/text()['.($i + 1).']';
+        // Check the text node
+        if ($this->_checkNodeTest($textChildPath, $axis['node-test'])) { // node test check
+          $xPathSet[] = $textChildPath; // Add the child to the node-set.
+        }
+        // Check the actual node
+        if ($this->_checkNodeTest($childPath, $axis['node-test'])) { // node test check
+          $xPathSet[] = $childPath; // Add the child to the node-set.
+        }
+      }
+
+      // Finally there will be one more text node to try
+     $textChildPath = $contextPath.'/text()['.($cSize + 1).']';
+     // Check the text node
+     if ($this->_checkNodeTest($textChildPath, $axis['node-test'])) { // node test check
+       $xPathSet[] = $textChildPath; // Add the child to the node-set.
+     }
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath parent axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the 
+   *                               evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_parent($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Check whether the parent matches the node-test.
+    $parentPath = $this->getParentXPath($contextPath);
+    if ($this->_checkNodeTest($parentPath, $axis['node-test'])) {
+      $xPathSet[] = $parentPath; // Add this node to the list of nodes.
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath attribute axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_attribute($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Check whether all nodes should be selected.
+    $nodeAttr = $this->nodeIndex[$contextPath]['attributes'];
+    if ($axis['node-test'] == '*'  
+        || $axis['node-test'] == 'node()') {
+      foreach($nodeAttr as $key=>$dummy) { // Run through the attributes.
+        $xPathSet[] = $contextPath.'/attribute::'.$key; // Add this node to the node-set.
+      }
+    }
+    elseif (isset($nodeAttr[$axis['node-test']])) {
+      $xPathSet[] = $contextPath . '/attribute::'. $axis['node-test']; // Add this node to the node-set.
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+   
+  /**
+   * Handles the XPath self axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_self($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Check whether the context match the node-test.
+    if ($this->_checkNodeTest($contextPath, $axis['node-test'])) {
+      $xPathSet[] = $contextPath; // Add this node to the node-set.
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath descendant axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_descendant($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Get a list of all children.
+    $allChildren = $this->nodeIndex[$contextPath]['childNodes'];
+    
+    // Run through all children in the order they where set.
+    $cSize = sizeOf($allChildren);
+    for ($i=0; $i<$cSize; $i++) {
+      $childPath = $allChildren[$i]['xpath'];
+      // Check whether the child matches the node-test.
+      if ($this->_checkNodeTest($childPath, $axis['node-test'])) {
+        $xPathSet[] = $childPath; // Add the child to the list of nodes.
+      }
+      // Recurse to the next level.
+      $xPathSet = array_merge($xPathSet, $this->_handleAxis_descendant($axis, $childPath));
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath ancestor axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_ancestor($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+        
+    $parentPath = $this->getParentXPath($contextPath); // Get the parent of the current node.
+    
+    // Check whether the parent isn't super-root.
+    if (!empty($parentPath)) {
+      // Check whether the parent matches the node-test.
+      if ($this->_checkNodeTest($parentPath, $axis['node-test'])) {
+        $xPathSet[] = $parentPath; // Add the parent to the list of nodes.
+      }
+      // Handle all other ancestors.
+      $xPathSet = array_merge($this->_handleAxis_ancestor($axis, $parentPath), $xPathSet);
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath namespace axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_namespace($axis, $contextPath) {
+    $this->_displayError("The axis 'namespace is not suported'", __LINE__, __FILE__, FALSE);
+  }
+  
+  /**
+   * Handles the XPath following axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_following($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    do { // try-block
+      $node = $this->nodeIndex[$contextPath]; // Get the current node
+      $position = $node['pos'];               // Get the current tree position.
+      $parent = $node['parentNode'];
+      // Check if there is a following sibling at all; if not end.
+      if ($position >= sizeOf($parent['childNodes'])) break; // try-block
+      // Build the starting abs. XPath
+      $startXPath = $parent['childNodes'][$position+1]['xpath'];
+      // Run through all nodes of the document.
+      $nodeKeys = array_keys($this->nodeIndex);
+      $nodeSize = sizeOf($nodeKeys);
+      for ($k=0; $k<$nodeSize; $k++) {
+        if ($nodeKeys[$k] == $startXPath) break; // Check whether this is the starting abs. XPath
+      }
+      for (; $k<$nodeSize; $k++) {
+        // Check whether the node fits the node-test.
+        if ($this->_checkNodeTest($nodeKeys[$k], $axis['node-test'])) {
+          $xPathSet[] = $nodeKeys[$k]; // Add the node to the list of nodes.
+        }
+      }
+    } while(FALSE);
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath preceding axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_preceding($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Run through all nodes of the document.
+    foreach ($this->nodeIndex as $xPath=>$dummy) {
+      if (empty($xPath)) continue; // skip super-Root
+      
+      // Check whether this is the context node.
+      if ($xPath == $contextPath) {
+        break; // After this we won't look for more nodes.
+      }
+      if (!strncmp($xPath, $contextPath, strLen($xPath))) {
+        continue;
+      }
+      // Check whether the node fits the node-test.
+      if ($this->_checkNodeTest($xPath, $axis['node-test'])) {
+        $xPathSet[] = $xPath; // Add the node to the list of nodes.
+      }
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath following-sibling axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_following_sibling($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Get all children from the parent.
+    $siblings = $this->_handleAxis_child($axis, $this->getParentXPath($contextPath));
+    // Create a flag whether the context node was already found.
+    $found = FALSE;
+    
+    // Run through all siblings.
+    $size = sizeOf($siblings);
+    for ($i=0; $i<$size; $i++) {
+      $sibling = $siblings[$i];
+      
+      // Check whether the context node was already found.
+      if ($found) {
+        // Check whether the sibling matches the node-test.
+        if ($this->_checkNodeTest($sibling, $axis['node-test'])) {
+          $xPathSet[] = $sibling; // Add the sibling to the list of nodes.
+        }
+      }
+      // Check if we reached *this* context node.
+      if ($sibling == $contextPath) {
+        $found = TRUE; // Continue looking for other siblings.
+      }
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath preceding-sibling axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_preceding_sibling($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Get all children from the parent.
+    $siblings = $this->_handleAxis_child($axis, $this->getParentXPath($contextPath));
+    
+    // Run through all siblings.
+    $size = sizeOf($siblings);
+    for ($i=0; $i<$size; $i++) {
+      $sibling = $siblings[$i];
+      // Check whether this is the context node.
+      if ($sibling == $contextPath) {
+        break; // Don't continue looking for other siblings.
+      }
+      // Check whether the sibling matches the node-test.
+      if ($this->_checkNodeTest($sibling, $axis['node-test'])) {
+        $xPathSet[] = $sibling; // Add the sibling to the list of nodes.
+      }
+    }
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath descendant-or-self axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_descendant_or_self($axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Read the nodes.
+    $xPathSet = array_merge(
+                 $this->_handleAxis_self($axis, $contextPath),
+                 $this->_handleAxis_descendant($axis, $contextPath)
+               );
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  /**
+   * Handles the XPath ancestor-or-self axis.
+   *
+   * This method handles the XPath ancestor-or-self axis.
+   *
+   * @param  $axis        (array)  Array containing information about the axis.
+   * @param  $contextPath (string) xpath to starting node from which the axis should be processed.
+   * @return              (array)  A vector containing all nodes that were found, during the evaluation of the axis.
+   * @see    evaluate()
+   */
+  function _handleAxis_ancestor_or_self ( $axis, $contextPath) {
+    $xPathSet = array(); // Create an empty node-set.
+    
+    // Read the nodes.
+    $xPathSet = array_merge(
+                 $this->_handleAxis_ancestor($axis, $contextPath),
+                 $this->_handleAxis_self($axis, $contextPath)
+               );
+    return $xPathSet; // Return the nodeset.
+  }
+  
+  
+  //-----------------------------------------------------------------------------------------
+  // XPath                  ------  XPath FUNCTION Handlers  ------                          
+  //-----------------------------------------------------------------------------------------
+  
+   /**
+    * Handles the XPath function last.
+    *    
+    * @param  $arguments     (string) String containing the arguments that were passed to the function.
+    * @param  $context       (array)  The context from which to evaluate the function
+    * @return                (mixed)  Depending on the type of function being processed
+    * @see    evaluate()
+    */
+  function _handleFunction_last($arguments, $context) {
+    return $context['size'];
+  }
+  
+  /**
+   * Handles the XPath function position.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_position($arguments, $context) {
+    return $context['pos'];
+  }
+  
+  /**
+   * Handles the XPath function count.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_count($arguments, $context) {
+    // Evaluate the argument of the method as an XPath and return the number of results.
+    return count($this->_evaluateExpr($arguments, $context));
+  }
+  
+  /**
+   * Handles the XPath function id.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_id($arguments, $context) {
+    $arguments = trim($arguments);         // Trim the arguments.
+    $arguments = explode(' ', $arguments); // Now split the arguments into an array.
+    // Create a list of nodes.
+    $resultXPaths = array();
+    // Run through all nodes of the document.
+    $keys = array_keys($this->nodeIndex);
+    $kSize = $sizeOf($keys);
+    for ($i=0; $i<$kSize; $i++) {
+      if (empty($keys[$i])) continue; // skip super-Root
+      if (in_array($this->nodeIndex[$keys[$i]]['attributes']['id'], $arguments)) {
+        $resultXPaths[] = $context['nodePath']; // Add this node to the list of nodes.
+      }
+    }
+    return $resultXPaths; // Return the list of nodes.
+  }
+  
+  /**
+   * Handles the XPath function name.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_name($arguments, $context) {
+    // If the argument it omitted, it defaults to a node-set with the context node as its only member.
+    if (empty($arguments)) {
+      return $this->_addLiteral($this->nodeIndex[$context['nodePath']]['name']);
+    }
+
+    // Evaluate the argument to get a node set.
+    $nodeSet = $this->_evaluateExpr($arguments, $context);
+    if (!is_array($nodeSet)) return '';
+    if (count($nodeSet) < 1) return '';
+    if (!isset($this->nodeIndex[$nodeSet[0]])) return '';
+     // Return a reference to the name of the node.
+    return $this->_addLiteral($this->nodeIndex[$nodeSet[0]]['name']);
+  }
+  
+  /**
+   * Handles the XPath function string.
+   *
+   * http://www.w3.org/TR/xpath#section-String-Functions
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_string($arguments, $context) {
+    // Check what type of parameter is given
+    if (is_array($arguments)) {
+      // Get the value of the first result (which means we want to concat all the text...unless
+      // a specific text() node has been given, and it will switch off to substringData
+      if (!count($arguments)) $result = '';
+      else {
+        $result = $this->_stringValue($arguments[0]);
+        if (($literal = $this->_asLiteral($result)) !== FALSE) {
+          $result = $literal;
+        }
+      }
+    }
+    // Is it a number string?
+    elseif (preg_match('/^[0-9]+(\.[0-9]+)?$/', $arguments) OR preg_match('/^\.[0-9]+$/', $arguments)) {
+      // ### Note no support for NaN and Infinity.
+      $number = doubleval($arguments); // Convert the digits to a number.
+      $result = strval($number); // Return the number.
+    }
+    elseif (is_bool($arguments)) { // Check whether it's TRUE or FALSE and return as string.
+      // ### Note that we used to return TRUE and FALSE which was incorrect according to the standard.
+      if ($arguments === TRUE) {        
+        $result = 'true'; 
+      } else {
+        $result = 'false';
+      }
+    }
+    elseif (($literal = $this->_asLiteral($arguments)) !== FALSE) {
+      return $literal;
+    }
+    elseif (!empty($arguments)) {
+      // Spec says:
+      // "An object of a type other than the four basic types is converted to a string in a way that 
+      // is dependent on that type."
+      // Use the argument as an XPath.
+      $result = $this->_evaluateExpr($arguments, $context);
+      if (is_string($result) && is_string($arguments) && (!strcmp($result, $arguments))) {
+        $this->_displayError("Loop detected in XPath expression.  Probably an internal error :o/.  _handleFunction_string($result)", __LINE__, __FILE__, FALSE);
+        return '';
+      } else {
+        $result = $this->_handleFunction_string($result, $context);
+      }
+    }
+    else {
+      $result = '';  // Return an empty string.
+    }
+    return $result;
+  }
+  
+  /**
+   * Handles the XPath function concat.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_concat($arguments, $context) {
+    // Split the arguments.
+    $arguments = explode(',', $arguments);
+    // Run through each argument and evaluate it.
+    $size = sizeof($arguments);
+    for ($i=0; $i<$size; $i++) {
+      $arguments[$i] = trim($arguments[$i]);  // Trim each argument.
+      // Evaluate it.
+      $arguments[$i] = $this->_handleFunction_string($arguments[$i], $context);
+    }
+    $arguments = implode('', $arguments);  // Put the string together and return it.
+    return $this->_addLiteral($arguments);
+  }
+  
+  /**
+   * Handles the XPath function starts-with.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_starts_with($arguments, $context) {
+    // Get the arguments.
+    $first  = trim($this->_prestr($arguments, ','));
+    $second = trim($this->_afterstr($arguments, ','));
+    // Evaluate each argument.
+    $first  = $this->_handleFunction_string($first, $context);
+    $second = $this->_handleFunction_string($second, $context);
+    // Check whether the first string starts with the second one.
+    return  (bool) ereg('^'.$second, $first);
+  }
+  
+  /**
+   * Handles the XPath function contains.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_contains($arguments, $context) {
+    // Get the arguments.
+    $first  = trim($this->_prestr($arguments, ','));
+    $second = trim($this->_afterstr($arguments, ','));
+    //echo "Predicate: $arguments First: ".$first." Second: ".$second."\n";
+    // Evaluate each argument.
+    $first = $this->_handleFunction_string($first, $context);
+    $second = $this->_handleFunction_string($second, $context);
+    //echo $second.": ".$first."\n";
+    // If the search string is null, then the provided there is a value it will contain it as
+    // it is considered that all strings contain the empty string. ## N.S.
+    if ($second==='') return TRUE;
+    // Check whether the first string starts with the second one.
+    if (strpos($first, $second) === FALSE) {
+      return FALSE;
+    } else {
+      return TRUE;
+    }
+  }
+  
+  /**
+   * Handles the XPath function substring-before.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_substring_before($arguments, $context) {
+    // Get the arguments.
+    $first  = trim($this->_prestr($arguments, ','));
+    $second = trim($this->_afterstr($arguments, ','));
+    // Evaluate each argument.
+    $first  = $this->_handleFunction_string($first, $context);
+    $second = $this->_handleFunction_string($second, $context);
+    // Return the substring.
+    return $this->_addLiteral($this->_prestr(strval($first), strval($second)));
+  }
+  
+  /**
+   * Handles the XPath function substring-after.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_substring_after($arguments, $context) {
+    // Get the arguments.
+    $first  = trim($this->_prestr($arguments, ','));
+    $second = trim($this->_afterstr($arguments, ','));
+    // Evaluate each argument.
+    $first  = $this->_handleFunction_string($first, $context);
+    $second = $this->_handleFunction_string($second, $context);
+    // Return the substring.
+    return $this->_addLiteral($this->_afterstr(strval($first), strval($second)));
+  }
+  
+  /**
+   * Handles the XPath function substring.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_substring($arguments, $context) {
+    // Split the arguments.
+    $arguments = explode(",", $arguments);
+    $size = sizeOf($arguments);
+    for ($i=0; $i<$size; $i++) { // Run through all arguments.
+      $arguments[$i] = trim($arguments[$i]); // Trim the string.
+      // Evaluate each argument.
+      $arguments[$i] = $this->_handleFunction_string($arguments[$i], $context);
+    }
+    // Check whether a third argument was given and return the substring..
+    if (!empty($arguments[2])) {
+      return $this->_addLiteral(substr(strval($arguments[0]), $arguments[1] - 1, $arguments[2]));
+    } else {
+      return $this->_addLiteral(substr(strval($arguments[0]), $arguments[1] - 1));
+    }
+  }
+  
+  /**
+   * Handles the XPath function string-length.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_string_length($arguments, $context) {
+    $arguments = trim($arguments); // Trim the argument.
+    // Evaluate the argument.
+    $arguments = $this->_handleFunction_string($arguments, $context);
+    return strlen(strval($arguments)); // Return the length of the string.
+  }
+
+  /**
+   * Handles the XPath function normalize-space.
+   *
+   * The normalize-space function returns the argument string with whitespace
+   * normalized by stripping leading and trailing whitespace and replacing sequences
+   * of whitespace characters by a single space.
+   * If the argument is omitted, it defaults to the context node converted to a string,
+   * in other words the string-value of the context node
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                 (stri)g trimed string
+   * @see    evaluate()
+   */
+  function _handleFunction_normalize_space($arguments, $context) {
+    if (empty($arguments)) {
+      $arguments = $this->getParentXPath($context['nodePath']).'/'.$this->nodeIndex[$context['nodePath']]['name'].'['.$this->nodeIndex[$context['nodePath']]['contextPos'].']';
+    } else {
+       $arguments = $this->_handleFunction_string($arguments, $context);
+    }
+    $arguments = trim(preg_replace (";[[:space:]]+;s",' ',$arguments));
+    return $this->_addLiteral($arguments);
+  }
+
+  /**
+   * Handles the XPath function translate.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_translate($arguments, $context) {
+    $arguments = explode(',', $arguments); // Split the arguments.
+    $size = sizeOf($arguments);
+    for ($i=0; $i<$size; $i++) { // Run through all arguments.
+      $arguments[$i] = trim($arguments[$i]); // Trim the argument.
+      // Evaluate the argument.
+      $arguments[$i] = $this->_handleFunction_string($arguments[$i], $context);
+    }
+    // Return the translated string.
+    return $this->_addLiteral(strtr($arguments[0], $arguments[1], $arguments[2]));
+  }
+
+  /**
+   * Handles the XPath function boolean.
+   *   
+   * http://www.w3.org/TR/xpath#section-Boolean-Functions
+   *
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_boolean($arguments, $context) {
+    if (empty($arguments)) {
+      return FALSE; // Sorry, there were no arguments.
+    }
+    // a bool is dead obvious
+    elseif (is_bool($arguments)) {
+      return $arguments;
+    }
+    // a node-set is true if and only if it is non-empty
+    elseif (is_array($arguments)) {
+      return (count($arguments) > 0);
+    }
+    // a number is true if and only if it is neither positive or negative zero nor NaN 
+    // (Straight out of the XPath spec.. makes no sense?????)
+    elseif (preg_match('/^[0-9]+(\.[0-9]+)?$/', $arguments) || preg_match('/^\.[0-9]+$/', $arguments)) {
+      $number = doubleval($arguments);  // Convert the digits to a number.
+      // If number zero return FALSE else TRUE.
+      if ($number == 0) return FALSE; else return TRUE;
+    }
+    // a string is true if and only if its length is non-zero
+    elseif (($literal = $this->_asLiteral($arguments)) !== FALSE) {
+      return (strlen($literal) != 0);
+    }
+    // an object of a type other than the four basic types is converted to a boolean in a 
+    // way that is dependent on that type
+    else {
+      // Spec says:
+      // "An object of a type other than the four basic types is converted to a number in a way 
+      // that is dependent on that type"
+      // Try to evaluate the argument as an XPath.
+      $result = $this->_evaluateExpr($arguments, $context);
+      if (is_string($result) && is_string($arguments) && (!strcmp($result, $arguments))) {
+        $this->_displayError("Loop detected in XPath expression.  Probably an internal error :o/.  _handleFunction_boolean($result)", __LINE__, __FILE__, FALSE);
+        return FALSE;
+      } else {
+        return $this->_handleFunction_boolean($result, $context);
+      }
+    }
+  }
+  
+  /**
+   * Handles the XPath function not.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_not($arguments, $context) {
+    // Return the negative value of the content of the brackets.
+    $bArgResult = $this->_handleFunction_boolean($arguments, $context);
+//echo "Before inversion: ".($bArgResult?"TRUE":"FALSE")."\n";
+    return !$bArgResult;
+  }
+  
+  /**
+   * Handles the XPath function TRUE.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_true($arguments, $context) {
+    return TRUE; // Return TRUE.
+  }
+  
+  /**
+   * Handles the XPath function FALSE.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_false($arguments, $context) {
+    return FALSE; // Return FALSE.
+  }
+  
+  /**
+   * Handles the XPath function lang.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_lang($arguments, $context) {
+    $arguments = trim($arguments); // Trim the arguments.
+    $currentNode = $this->nodeIndex[$context['nodePath']];
+    while (!empty($currentNode['name'])) { // Run through the ancestors.
+      // Check whether the node has an language attribute.
+      if (isSet($currentNode['attributes']['xml:lang'])) {
+        // Check whether it's the language, the user asks for; if so return TRUE else FALSE
+        return eregi('^'.$arguments, $currentNode['attributes']['xml:lang']);
+      }
+      $currentNode = $currentNode['parentNode']; // Move up to parent
+    } // End while
+    return FALSE;
+  }
+  
+  /**
+   * Handles the XPath function number.
+   *   
+   * http://www.w3.org/TR/xpath#section-Number-Functions
+   *
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_number($arguments, $context) {
+    // Check the type of argument.
+
+    // A string that is a number
+    if (is_numeric($arguments)) {
+      return doubleval($arguments); // Return the argument as a number.
+    }
+    // A bool
+    elseif (is_bool($arguments)) {  // Return TRUE/FALSE as a number.
+      if ($arguments === TRUE) return 1; else return 0;  
+    }
+    // A node set
+    elseif (is_array($arguments)) {
+      // Is converted to a string then handled like a string
+      $string = $this->_handleFunction_string($arguments, $context);
+      if (is_numeric($string))
+        return doubleval($string);
+    }
+    elseif (($literal = $this->_asLiteral($arguments)) !== FALSE) {
+      if (is_numeric($literal)) {
+        return doubleval($literal);
+      } else {
+        // If we are to stick strictly to the spec, we should return NaN, but lets just
+        // leave PHP to see if can do some dynamic conversion.
+        return $literal;
+      }
+    }
+    else {
+      // Spec says:
+      // "An object of a type other than the four basic types is converted to a number in a way 
+      // that is dependent on that type"
+      // Try to evaluate the argument as an XPath.
+      $result = $this->_evaluateExpr($arguments, $context);
+      if (is_string($result) && is_string($arguments) && (!strcmp($result, $arguments))) {
+        $this->_displayError("Loop detected in XPath expression.  Probably an internal error :o/.  _handleFunction_number($result)", __LINE__, __FILE__, FALSE);
+        return FALSE;
+      } else {
+        return $this->_handleFunction_number($result, $context);
+      }
+    }
+  }
+
+  /**
+   * Handles the XPath function sum.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_sum($arguments, $context) {
+    $arguments = trim($arguments); // Trim the arguments.
+    // Evaluate the arguments as an XPath query.
+    $result = $this->_evaluateExpr($arguments, $context);
+    $sum = 0; // Create a variable to save the sum.
+    // The sum function expects a node set as an argument.
+    if (is_array($result)) {
+      // Run through all results.
+      $size = sizeOf($result);
+      for ($i=0; $i<$size; $i++) {
+        $value = $this->_stringValue($result[$i], $context);
+        if (($literal = $this->_asLiteral($value)) !== FALSE) {
+          $value = $literal;
+        }
+        $sum += doubleval($value); // Add it to the sum.
+      }
+    }
+    return $sum; // Return the sum.
+  }
+
+  /**
+   * Handles the XPath function floor.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_floor($arguments, $context) {
+    if (!is_numeric($arguments)) {
+      $arguments = $this->_handleFunction_number($arguments, $context);
+    }
+    $arguments = doubleval($arguments); // Convert the arguments to a number.
+    return floor($arguments);           // Return the result
+  }
+  
+  /**
+   * Handles the XPath function ceiling.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_ceiling($arguments, $context) {
+    if (!is_numeric($arguments)) {
+      $arguments = $this->_handleFunction_number($arguments, $context);
+    }
+    $arguments = doubleval($arguments); // Convert the arguments to a number.
+    return ceil($arguments);            // Return the result
+  }
+  
+  /**
+   * Handles the XPath function round.
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_round($arguments, $context) {
+    if (!is_numeric($arguments)) {
+      $arguments = $this->_handleFunction_number($arguments, $context);
+    }
+    $arguments = doubleval($arguments); // Convert the arguments to a number.
+    return round($arguments);           // Return the result
+  }
+
+  //-----------------------------------------------------------------------------------------
+  // XPath                  ------  XPath Extension FUNCTION Handlers  ------                          
+  //-----------------------------------------------------------------------------------------
+
+  /**
+   * Handles the XPath function x-lower.
+   *
+   * lower case a string.
+   *    string x-lower(string) 
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_x_lower($arguments, $context) {
+    // Evaluate the argument.
+    $string = $this->_handleFunction_string($arguments, $context);
+     // Return a reference to the lowercased string
+    return $this->_addLiteral(strtolower(strval($string)));
+  }
+
+  /**
+   * Handles the XPath function x-upper.
+   *
+   * upper case a string.
+   *    string x-upper(string) 
+   *   
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @see    evaluate()
+   */
+  function _handleFunction_x_upper($arguments, $context) {
+    // Evaluate the argument.
+    $string = $this->_handleFunction_string($arguments, $context);
+     // Return a reference to the lowercased string
+    return $this->_addLiteral(strtoupper(strval($string)));
+  }
+
+  /**
+   * Handles the XPath function generate-id.
+   *
+   * Produce a unique id for the first node of the node set.
+   * 
+   * Example usage, produces an index of all the nodes in an .xml document, where the content of each
+   * "section" is the exported node as XML.
+   *
+   *   $aFunctions = $xPath->match('//');
+   *   
+   *   foreach ($aFunctions as $Function) {
+   *       $id = $xPath->match("generate-id($Function)");
+   *       echo "<a href='#$id'>$Function</a><br>";
+   *   }
+   *   
+   *   foreach ($aFunctions as $Function) {
+   *       $id = $xPath->match("generate-id($Function)");
+   *       echo "<h2 id='$id'>$Function</h2>";
+   *       echo htmlspecialchars($xPath->exportAsXml($Function));
+   *   }
+   * 
+   * @param  $arguments     (string) String containing the arguments that were passed to the function.
+   * @param  $context       (array)  The context from which to evaluate the function
+   * @return                (mixed)  Depending on the type of function being processed
+   * @author Ricardo Garcia
+   * @see    evaluate()
+   */
+  function _handleFunction_generate_id($arguments, $context) {
+    // If the argument is omitted, it defaults to a node-set with the context node as its only member.
+    if (is_string($arguments) && empty($arguments)) {
+      // We need ids then
+      $this->_generate_ids();
+      return $this->_addLiteral($this->nodeIndex[$context['nodePath']]['generated_id']);
+    }
+
+    // Evaluate the argument to get a node set.
+    $nodeSet = $this->_evaluateExpr($arguments, $context);
+
+    if (!is_array($nodeSet)) return '';
+    if (count($nodeSet) < 1) return '';
+    if (!isset($this->nodeIndex[$nodeSet[0]])) return '';
+     // Return a reference to the name of the node.
+    // We need ids then
+    $this->_generate_ids();
+    return $this->_addLiteral($this->nodeIndex[$nodeSet[0]]['generated_id']);
+  }
+
+  //-----------------------------------------------------------------------------------------
+  // XPathEngine                ------  Help Stuff  ------                                   
+  //-----------------------------------------------------------------------------------------
+
+  /**
+   * Decodes the character set entities in the given string.
+   *
+   * This function is given for convenience, as all text strings or attributes
+   * are going to come back to you with their entities still encoded.  You can
+   * use this function to remove these entites.
+   *
+   * It makes use of the get_html_translation_table(HTML_ENTITIES) php library 
+   * call, so is limited in the same ways.  At the time of writing this seemed
+   * be restricted to iso-8859-1
+   *
+   * ### Provide an option that will do this by default.
+   *
+   * @param $encodedData (mixed) The string or array that has entities you would like to remove
+   * @param $reverse     (bool)  If TRUE entities will be encoded rather than decoded, ie
+   *                             < to &lt; rather than &lt; to <.
+   * @return             (mixed) The string or array returned with entities decoded.
+   */
+  function decodeEntities($encodedData, $reverse=FALSE) {
+    static $aEncodeTbl;
+    static $aDecodeTbl;
+    // Get the translation entities, but we'll cache the result to enhance performance.
+    if (empty($aDecodeTbl)) {
+      // Get the translation entities.
+      $aEncodeTbl = get_html_translation_table(HTML_ENTITIES);
+      $aDecodeTbl = array_flip($aEncodeTbl);
+    }
+
+    // If it's just a single string.
+    if (!is_array($encodedData)) {
+      if ($reverse) {
+        return strtr($encodedData, $aEncodeTbl);
+      } else {
+        return strtr($encodedData, $aDecodeTbl);
+      }
+    }
+
+    $result = array();
+    foreach($encodedData as $string) {
+      if ($reverse) {
+        $result[] = strtr($string, $aEncodeTbl);
+      } else {
+        $result[] = strtr($string, $aDecodeTbl);
+      }
+    }
+
+    return $result;
+  }
+  
+  /**
+   * Compare two nodes to see if they are equal (point to the same node in the doc)
+   *
+   * 2 nodes are considered equal if the absolute XPath is equal.
+   * 
+   * @param  $node1 (mixed) Either an absolute XPath to an node OR a real tree-node (hash-array)
+   * @param  $node2 (mixed) Either an absolute XPath to an node OR a real tree-node (hash-array)
+   * @return        (bool)  TRUE if equal (see text above), FALSE if not (and on error).
+   */
+  function equalNodes($node1, $node2) {
+    $xPath_1 = is_string($node1) ? $node1 : $this->getNodePath($node1);
+    $xPath_2 = is_string($node2) ? $node2 : $this->getNodePath($node2);
+    return (strncasecmp ($xPath_1, $xPath_2, strLen($xPath_1)) == 0);
+  }
+  
+  /**
+   * Get the absolute XPath of a node that is in a document tree.
+   *
+   * @param $node (array)  A real tree-node (hash-array)   
+   * @return      (string) The string path to the node or FALSE on error.
+   */
+  function getNodePath($node) {
+    if (!empty($node['xpath'])) return $node['xpath'];
+    $pathInfo = array();
+    do {
+      if (empty($node['name']) OR empty($node['parentNode'])) break; // End criteria
+      $pathInfo[] = array('name' => $node['name'], 'contextPos' => $node['contextPos']);
+      $node = $node['parentNode'];
+    } while (TRUE);
+    
+    $xPath = '';
+    for ($i=sizeOf($pathInfo)-1; $i>=0; $i--) {
+      $xPath .= '/' . $pathInfo[$i]['name'] . '[' . $pathInfo[$i]['contextPos'] . ']';
+    }
+    if (empty($xPath)) return FALSE;
+    return $xPath;
+  }
+  
+  /**
+   * Retrieves the absolute parent XPath query.
+   *
+   * The parents stored in the tree are only relative parents...but all the parent
+   * information is stored in the XPath query itself...so instead we use a function
+   * to extract the parent from the absolute Xpath query
+   *
+   * @param  $childPath (string) String containing an absolute XPath query
+   * @return            (string) returns the absolute XPath of the parent
+   */
+   function getParentXPath($absoluteXPath) {
+     $lastSlashPos = strrpos($absoluteXPath, '/'); 
+     if ($lastSlashPos == 0) { // it's already the root path
+       return ''; // 'super-root'
+     } else {
+       return (substr($absoluteXPath, 0, $lastSlashPos));
+     }
+   }
+  
+  /**
+   * Returns TRUE if the given node has child nodes below it
+   *
+   * @param  $absoluteXPath (string) full path of the potential parent node
+   * @return                (bool)   TRUE if this node exists and has a child, FALSE otherwise
+   */
+  function hasChildNodes($absoluteXPath) {
+    if ($this->_indexIsDirty) $this->reindexNodeTree();
+    return (bool) (isSet($this->nodeIndex[$absoluteXPath]) 
+                   AND sizeOf($this->nodeIndex[$absoluteXPath]['childNodes']));
+  }
+  
+  /**
+   * Translate all ampersands to it's literal entities '&amp;' and back.
+   *
+   * I wasn't aware of this problem at first but it's important to understand why we do this.
+   * At first you must know:
+   * a) PHP's XML parser *translates* all entities to the equivalent char E.g. &lt; is returned as '<'
+   * b) PHP's XML parser (in V 4.1.0) has problems with most *literal* entities! The only one's that are 
+   *    recognized are &amp;, &lt; &gt; and &quot;. *ALL* others (like &nbsp; &copy; a.s.o.) cause an 
+   *    XML_ERROR_UNDEFINED_ENTITY error. I reported this as bug at http://bugs.php.net/bug.php?id=15092
+   *    (It turned out not to be a 'real' bug, but one of those nice W3C-spec things).
+   * 
+   * Forget position b) now. It's just for info. Because the way we will solve a) will also solve b) too. 
+   *
+   * THE PROBLEM
+   * To understand the problem, here a sample:
+   * Given is the following XML:    "<AAA> &lt; &nbsp; &gt; </AAA>"
+   *   Try to parse it and PHP's XML parser will fail with a XML_ERROR_UNDEFINED_ENTITY becaus of 
+   *   the unknown litteral-entity '&nbsp;'. (The numeric equivalent '&#160;' would work though). 
+   * Next try is to use the numeric equivalent 160 for '&nbsp;', thus  "<AAA> &lt; &#160; &gt; </AAA>"
+   *   The data we receive in the tag <AAA> is  " <   > ". So we get the *translated entities* and 
+   *   NOT the 3 entities &lt; &#160; &gt. Thus, we will not even notice that there were entities at all!
+   *   In *most* cases we're not able to tell if the data was given as entity or as 'normal' char.
+   *   E.g. When receiving a quote or a single space were not able to tell if it was given as 'normal' char
+   *   or as &nbsp; or &quot;. Thus we loose the entity-information of the XML-data!
+   * 
+   * THE SOLUTION
+   * The better solution is to keep the data 'as is' by replacing the '&' before parsing begins.
+   * E.g. Taking the original input from above, this would result in "<AAA> &amp;lt; &amp;nbsp; &amp;gt; </AAA>"
+   * The data we receive now for the tag <AAA> is  " &lt; &nbsp; &gt; ". and that's what we want.
+   * 
+   * The bad thing is, that a global replace will also replace data in section that are NOT translated by the 
+   * PHP XML-parser. That is comments (<!-- -->), IP-sections (stuff between <? ? >) and CDATA-block too.
+   * So all data comming from those sections must be reversed. This is done during the XML parse phase.
+   * So:
+   * a) Replacement of all '&' in the XML-source.
+   * b) All data that is not char-data or in CDATA-block have to be reversed during the XML-parse phase.
+   *
+   * @param  $xmlSource (string) The XML string
+   * @return            (string) The XML string with translated ampersands.
+   */
+  function _translateAmpersand($xmlSource, $reverse=FALSE) {
+    $PHP5 = (substr(phpversion(), 0, 1) == '5');
+    if ($PHP5) {
+      //otherwise we receive  &amp;nbsp;  instead of  &nbsp;
+      return $xmlSource;
+    } else {
+      return ($reverse ? str_replace('&amp;', '&', $xmlSource) : str_replace('&', '&amp;', $xmlSource));
+    }
+  }
+
+} // END OF CLASS XPathEngine
+
+
+/************************************************************************************************
+* ===============================================================================================
+*                                     X P a t h  -  Class                                        
+* ===============================================================================================
+************************************************************************************************/
+
+define('XPATH_QUERYHIT_ALL'   , 1);
+define('XPATH_QUERYHIT_FIRST' , 2);
+define('XPATH_QUERYHIT_UNIQUE', 3);
+
+class XPath extends XPathEngine {
+    
+  /**
+   * Constructor of the class
+   *
+   * Optionally you may call this constructor with the XML-filename to parse and the 
+   * XML option vector. A option vector sample: 
+   *   $xmlOpt = array(XML_OPTION_CASE_FOLDING => FALSE, XML_OPTION_SKIP_WHITE => TRUE);
+   *
+   * @param  $userXmlOptions (array)  (optional) Vector of (<optionID>=><value>, <optionID>=><value>, ...)
+   * @param  $fileName       (string) (optional) Filename of XML file to load from.
+   *                                  It is recommended that you call importFromFile()
+   *                                  instead as you will get an error code.  If the
+   *                                  import fails, the object will be set to FALSE.
+   * @see    parent::XPathEngine()
+   */
+  function XPath($fileName='', $userXmlOptions=array()) {
+    parent::XPathEngine($userXmlOptions);
+    $this->properties['modMatch'] = XPATH_QUERYHIT_ALL;
+    if ($fileName) {
+      if (!$this->importFromFile($fileName)) {
+        // Re-run the base constructor to "reset" the object.  If the user has any sense, then
+        // they will have created the object, and then explicitly called importFromFile(), giving
+        // them the chance to catch and handle the error properly.
+        parent::XPathEngine($userXmlOptions);
+      }
+    }
+  }
+  
+  /**
+   * Resets the object so it's able to take a new xml sting/file
+   *
+   * Constructing objects is slow.  If you can, reuse ones that you have used already
+   * by using this reset() function.
+   */
+  function reset() {
+    parent::reset();
+    $this->properties['modMatch'] = XPATH_QUERYHIT_ALL;
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPath                    ------  Get / Set Stuff  ------                                
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Resolves and xPathQuery array depending on the property['modMatch']
+   *
+   * Most of the modification functions of XPath will also accept a xPathQuery (instead 
+   * of an absolute Xpath). The only problem is that the query could match more the one 
+   * node. The question is, if the none, the fist or all nodes are to be modified.
+   * The behaver can be set with setModMatch()  
+   *
+   * @param $modMatch (int) One of the following:
+   *                        - XPATH_QUERYHIT_ALL (default) 
+   *                        - XPATH_QUERYHIT_FIRST
+   *                        - XPATH_QUERYHIT_UNIQUE // If the query matches more then one node. 
+   * @see  _resolveXPathQuery()
+   */
+  function setModMatch($modMatch = XPATH_QUERYHIT_ALL) {
+    switch($modMatch) {
+      case XPATH_QUERYHIT_UNIQUE : $this->properties['modMatch'] =  XPATH_QUERYHIT_UNIQUE; break;
+      case XPATH_QUERYHIT_FIRST: $this->properties['modMatch'] =  XPATH_QUERYHIT_FIRST; break;
+      default: $this->properties['modMatch'] = XPATH_QUERYHIT_ALL;
+    }
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPath                    ------  DOM Like Modification  ------                          
+  //-----------------------------------------------------------------------------------------
+  
+  //-----------------------------------------------------------------------------------------
+  // XPath                  ------  Child (Node)  Set/Get  ------                           
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Retrieves the name(s) of a node or a group of document nodes.
+   *          
+   * This method retrieves the names of a group of document nodes
+   * specified in the argument.  So if the argument was '/A[1]/B[2]' then it
+   * would return 'B' if the node did exist in the tree.
+   *          
+   * @param  $xPathQuery (mixed) Array or single full document path(s) of the node(s), 
+   *                             from which the names should be retrieved.
+   * @return             (mixed) Array or single string of the names of the specified 
+   *                             nodes, or just the individual name.  If the node did 
+   *                             not exist, then returns FALSE.
+   */
+  function nodeName($xPathQuery) {
+    if (is_array($xPathQuery)) {
+      $xPathSet = $xPathQuery;
+    } else {
+      // Check for a valid xPathQuery
+      $xPathSet = $this->_resolveXPathQuery($xPathQuery,'nodeName');
+    }
+    if (count($xPathSet) == 0) return FALSE;
+    // For each node, get it's name
+    $result = array();
+    foreach($xPathSet as $xPath) {
+      $node = &$this->getNode($xPath);
+      if (!$node) {
+        // ### Fatal internal error?? 
+        continue;
+      }
+      $result[] = $node['name'];
+    }
+    // If just a single string, return string
+    if (count($xPathSet) == 1) $result = $result[0];
+    // Return result.
+    return $result;
+  }
+  
+  /**
+   * Removes a node from the XML document.
+   *
+   * This method removes a node from the tree of nodes of the XML document. If the node 
+   * is a document node, all children of the node and its character data will be removed. 
+   * If the node is an attribute node, only this attribute will be removed, the node to which 
+   * the attribute belongs as well as its children will remain unmodified.
+   *
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery  (string) xpath to the node (See note above).
+   * @param  $autoReindex (bool)   (optional, default=TRUE) Reindex the document to reflect 
+   *                               the changes.  A performance helper.  See reindexNodeTree()
+   * @return              (bool)   TRUE on success, FALSE on error;
+   * @see    setModMatch(), reindexNodeTree()
+   */
+  function removeChild($xPathQuery, $autoReindex=TRUE) {
+    $ThisFunctionName = 'removeChild';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Node: $xPathQuery\n";
+      echo '<hr>';
+    }
+
+    $NULL = NULL;
+    $status = FALSE;
+    do { // try-block
+      // Check for a valid xPathQuery
+      $xPathSet = $this->_resolveXPathQuery($xPathQuery,'removeChild');
+      if (sizeOf($xPathSet) === 0) {
+        $this->_displayError(sprintf($this->errorStrings['NoNodeMatch'], $xPathQuery), __LINE__, __FILE__, FALSE);
+        break; // try-block
+      }
+      $mustReindex = FALSE;
+      // Make chages from 'bottom-up'. In this manner the modifications will not affect itself.
+      for ($i=sizeOf($xPathSet)-1; $i>=0; $i--) {
+        $absoluteXPath = $xPathSet[$i];
+        if (preg_match(';/attribute::;', $absoluteXPath)) { // Handle the case of an attribute node
+          $xPath = $this->_prestr($absoluteXPath, '/attribute::');       // Get the path to the attribute node's parent.
+          $attribute = $this->_afterstr($absoluteXPath, '/attribute::'); // Get the name of the attribute.
+          unSet($this->nodeIndex[$xPath]['attributes'][$attribute]);     // Unset the attribute
+          if ($bDebugThisFunction) echo "We removed the attribute '$attribute' of node '$xPath'.\n";
+          continue;
+        }
+        // Otherwise remove the node by setting it to NULL. It will be removed on the next reindexNodeTree() call.
+        $mustReindex = $autoReindex;
+        // Flag the index as dirty; it's not uptodate. A reindex will be forced (if dirty) when exporting the XML doc
+        $this->_indexIsDirty = TRUE;
+        
+        $theNode = $this->nodeIndex[$absoluteXPath];
+        $theNode['parentNode']['childNodes'][$theNode['pos']] =& $NULL;
+        if ($bDebugThisFunction) echo "We removed the node '$absoluteXPath'.\n";
+      }
+      // Reindex the node tree again
+      if ($mustReindex) $this->reindexNodeTree();
+      $status = TRUE;
+    } while(FALSE);
+    
+    $this->_closeDebugFunction($ThisFunctionName, $status, $bDebugThisFunction);
+
+    return $status;
+  }
+  
+  /**
+   * Replace a node with any data string. The $data is taken 1:1.
+   *
+   * This function will delete the node you define by $absoluteXPath (plus it's sub-nodes) and 
+   * substitute it by the string $text. Often used to push in not well formed HTML.
+   * WARNING: 
+   *   The $data is taken 1:1. 
+   *   You are in charge that the data you enter is valid XML if you intend
+   *   to export and import the content again.
+   *
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery  (string) xpath to the node (See note above).
+   * @param  $data        (string) String containing the content to be set. *READONLY*
+   * @param  $autoReindex (bool)   (optional, default=TRUE) Reindex the document to reflect 
+   *                               the changes.  A performance helper.  See reindexNodeTree()
+   * @return              (bool)   TRUE on success, FALSE on error;
+   * @see    setModMatch(), replaceChild(), reindexNodeTree()
+   */
+  function replaceChildByData($xPathQuery, $data, $autoReindex=TRUE) {
+    $ThisFunctionName = 'replaceChildByData';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Node: $xPathQuery\n";
+    }
+
+    $NULL = NULL;
+    $status = FALSE;
+    do { // try-block
+      // Check for a valid xPathQuery
+      $xPathSet = $this->_resolveXPathQuery($xPathQuery,'replaceChildByData');
+      if (sizeOf($xPathSet) === 0) {
+        $this->_displayError(sprintf($this->errorStrings['NoNodeMatch'], $xPathQuery), __LINE__, __FILE__, FALSE);
+        break; // try-block
+      }
+      $mustReindex = FALSE;
+      // Make chages from 'bottom-up'. In this manner the modifications will not affect itself.
+      for ($i=sizeOf($xPathSet)-1; $i>=0; $i--) {
+        $mustReindex = $autoReindex;
+        // Flag the index as dirty; it's not uptodate. A reindex will be forced (if dirty) when exporting the XML doc
+        $this->_indexIsDirty = TRUE;
+        
+        $absoluteXPath = $xPathSet[$i];
+        $theNode = $this->nodeIndex[$absoluteXPath];
+        $pos = $theNode['pos'];
+        $theNode['parentNode']['textParts'][$pos] .= $data;
+        $theNode['parentNode']['childNodes'][$pos] =& $NULL;
+        if ($bDebugThisFunction) echo "We replaced the node '$absoluteXPath' with data.\n";
+      }
+      // Reindex the node tree again
+      if ($mustReindex) $this->reindexNodeTree();
+      $status = TRUE;
+    } while(FALSE);
+    
+    $this->_closeDebugFunction($ThisFunctionName, ($status) ? 'Success' : '!!! FAILD !!!', $bDebugThisFunction);
+
+    return $status;
+  }
+  
+  /**
+   * Replace the node(s) that matches the xQuery with the passed node (or passed node-tree)
+   * 
+   * If the passed node is a string it's assumed to be XML and replaceChildByXml() 
+   * will be called.
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery  (string) Xpath to the node being replaced.
+   * @param  $node        (mixed)  String or Array (Usually a String)
+   *                               If string: Vaild XML. E.g. "<A/>" or "<A> foo <B/> bar <A/>"
+   *                               If array:  A Node (can be a whole sub-tree) (See comment in header)
+   * @param  $autoReindex (bool)   (optional, default=TRUE) Reindex the document to reflect 
+   *                               the changes.  A performance helper.  See reindexNodeTree()
+   * @return              (array)  The last replaced $node (can be a whole sub-tree)
+   * @see    reindexNodeTree()
+   */
+  function &replaceChild($xPathQuery, $node, $autoReindex=TRUE) {
+    $NULL = NULL;
+    if (is_string($node)) {
+      if (empty($node)) { //--sam. Not sure how to react on an empty string - think it's an error.
+        return array();
+      } else { 
+        if (!($node = $this->_xml2Document($node))) return FALSE;
+      }
+    }
+    
+    // Special case if it's 'super root'. We then have to take the child node == top node
+    if (empty($node['parentNode'])) $node = $node['childNodes'][0];
+    
+    $status = FALSE;
+    do { // try-block
+      // Check for a valid xPathQuery
+      $xPathSet = $this->_resolveXPathQuery($xPathQuery,'replaceChild');
+      if (sizeOf($xPathSet) === 0) {
+        $this->_displayError(sprintf($this->errorStrings['NoNodeMatch'], $xPathQuery), __LINE__, __FILE__, FALSE);
+        break; // try-block
+      }
+      $mustReindex = FALSE;
+      
+      // Make chages from 'bottom-up'. In this manner the modifications will not affect itself.
+      for ($i=sizeOf($xPathSet)-1; $i>=0; $i--) {
+        $mustReindex = $autoReindex;
+        // Flag the index as dirty; it's not uptodate. A reindex will be forced (if dirty) when exporting the XML doc
+        $this->_indexIsDirty = TRUE;
+        
+        $absoluteXPath = $xPathSet[$i];
+        $childNode =& $this->nodeIndex[$absoluteXPath];
+        $parentNode =& $childNode['parentNode'];
+        $childNode['parentNode'] =& $NULL;
+        $childPos = $childNode['pos'];
+        $parentNode['childNodes'][$childPos] =& $this->cloneNode($node);
+      }
+      if ($mustReindex) $this->reindexNodeTree();
+      $status = TRUE;
+    } while(FALSE);
+    
+    if (!$status) return FALSE;
+    return $childNode;
+  }
+  
+  /**
+   * Insert passed node (or passed node-tree) at the node(s) that matches the xQuery.
+   *
+   * With parameters you can define if the 'hit'-node is shifted to the right or left 
+   * and if it's placed before of after the text-part.
+   * Per derfault the 'hit'-node is shifted to the right and the node takes the place 
+   * the of the 'hit'-node. 
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   * 
+   * E.g. Following is given:           AAA[1]           
+   *                                  /       \          
+   *                              ..BBB[1]..BBB[2] ..    
+   *
+   * a) insertChild('/AAA[1]/BBB[2]', <node CCC>)
+   * b) insertChild('/AAA[1]/BBB[2]', <node CCC>, $shiftRight=FALSE)
+   * c) insertChild('/AAA[1]/BBB[2]', <node CCC>, $shiftRight=FALSE, $afterText=FALSE)
+   *
+   * a)                          b)                           c)                        
+   *          AAA[1]                       AAA[1]                       AAA[1]          
+   *        /    |   \                   /    |   \                   /    |   \        
+   *  ..BBB[1]..CCC[1]BBB[2]..     ..BBB[1]..BBB[2]..CCC[1]     ..BBB[1]..BBB[2]CCC[1]..
+   *
+   * #### Do a complete review of the "(optional)" tag after several arguments.
+   *
+   * @param  $xPathQuery  (string) Xpath to the node to append.
+   * @param  $node        (mixed)  String or Array (Usually a String)
+   *                               If string: Vaild XML. E.g. "<A/>" or "<A> foo <B/> bar <A/>"
+   *                               If array:  A Node (can be a whole sub-tree) (See comment in header)
+   * @param  $shiftRight  (bool)   (optional, default=TRUE) Shift the target node to the right.
+   * @param  $afterText   (bool)   (optional, default=TRUE) Insert after the text.
+   * @param  $autoReindex (bool)   (optional, default=TRUE) Reindex the document to reflect 
+   *                                the changes.  A performance helper.  See reindexNodeTree()
+   * @return              (mixed)  FALSE on error (or no match). On success we return the path(s) to the newly
+   *                               appended nodes. That is: Array of paths if more then 1 node was added or
+   *                               a single path string if only one node was added.
+   *                               NOTE:  If autoReindex is FALSE, then we can't return the *complete* path
+   *                               as the exact doc-pos isn't available without reindexing. In that case we leave
+   *                               out the last [docpos] in the path(s). ie  we'd return /A[3]/B instead of /A[3]/B[2]
+   * @see    appendChildByXml(), reindexNodeTree()
+   */
+  function insertChild($xPathQuery, $node, $shiftRight=TRUE, $afterText=TRUE, $autoReindex=TRUE) {
+    if (is_string($node)) {
+      if (empty($node)) { //--sam. Not sure how to react on an empty string - think it's an error.
+        return FALSE;
+      } else { 
+        if (!($node = $this->_xml2Document($node))) return FALSE;
+      }
+    }
+
+    // Special case if it's 'super root'. We then have to take the child node == top node
+    if (empty($node['parentNode'])) $node = $node['childNodes'][0];
+    
+    // Check for a valid xPathQuery
+    $xPathSet = $this->_resolveXPathQuery($xPathQuery,'insertChild');
+    if (sizeOf($xPathSet) === 0) {
+      $this->_displayError(sprintf($this->errorStrings['NoNodeMatch'], $xPathQuery), __LINE__, __FILE__, FALSE);
+      return FALSE;
+    }
+    $mustReindex = FALSE;
+    $newNodes = array();
+    $result = array();
+    // Make chages from 'bottom-up'. In this manner the modifications will not affect itself.
+    for ($i=sizeOf($xPathSet)-1; $i>=0; $i--) {
+      $absoluteXPath = $xPathSet[$i];
+      $childNode =& $this->nodeIndex[$absoluteXPath];
+      $parentNode =& $childNode['parentNode'];
+
+      // We can't insert at the super root or at the root.
+      if (empty($absoluteXPath) || (!$parentNode['parentNode'])) {
+        $this->_displayError(sprintf($this->errorStrings['RootNodeAlreadyExists']), __LINE__, __FILE__, FALSE);
+        return FALSE;
+      }
+
+      $mustReindex = $autoReindex;
+      // Flag the index as dirty; it's not uptodate. A reindex will be forced (if dirty) when exporting the XML doc
+      $this->_indexIsDirty = TRUE;
+      
+      //Special case: It not possible to add siblings to the top node.
+      if (empty($parentNode['name'])) continue;
+      $newNode =& $this->cloneNode($node);
+      $pos = $shiftRight ? $childNode['pos'] : $childNode['pos']+1;
+      $parentNode['childNodes'] = array_merge(
+                                    array_slice($parentNode['childNodes'], 0, $pos),
+                                    array(&$newNode),
+                                    array_slice($parentNode['childNodes'], $pos)
+                                  );
+      $pos += $afterText ? 1 : 0;
+      $parentNode['textParts'] = array_merge(
+                                   array_slice($parentNode['textParts'], 0, $pos),
+                                   array(''),
+                                   array_slice($parentNode['textParts'], $pos)
+                                 );
+      
+      // We are going from bottom to top, but the user will want results from top to bottom.
+      if ($mustReindex) {
+        // We'll have to wait till after the reindex to get the full path to this new node.
+        $newNodes[] = &$newNode;
+      } else {
+        // If we are reindexing the tree later, then we can't return the user any
+        // useful results, so we just return them the count.
+        $newNodePath = $parentNode['xpath'].'/'.$newNode['name'];
+        array_unshift($result, $newNodePath);
+      }
+    }
+    if ($mustReindex) {
+      $this->reindexNodeTree();
+      // Now we must fill in the result array.  Because until now we did not
+      // know what contextpos our newly added entries had, just their pos within
+      // the siblings.
+      foreach ($newNodes as $newNode) {
+        array_unshift($result, $newNode['xpath']);
+      }
+    }
+    if (count($result) == 1) $result = $result[0];
+    return $result;
+  }
+  
+  /**
+   * Appends a child to anothers children.
+   *
+   * If you intend to do a lot of appending, you should leave autoIndex as FALSE
+   * and then call reindexNodeTree() when you are finished all the appending.
+   *
+   * @param  $xPathQuery  (string) Xpath to the node to append to.
+   * @param  $node        (mixed)  String or Array (Usually a String)
+   *                               If string: Vaild XML. E.g. "<A/>" or "<A> foo <B/> bar <A/>"
+   *                               If array:  A Node (can be a whole sub-tree) (See comment in header)
+   * @param  $afterText   (bool)   (optional, default=FALSE) Insert after the text.
+   * @param  $autoReindex (bool)   (optional, default=TRUE) Reindex the document to reflect 
+   *                               the changes.  A performance helper.  See reindexNodeTree()
+   * @return              (mixed)  FALSE on error (or no match). On success we return the path(s) to the newly
+   *                               appended nodes. That is: Array of paths if more then 1 node was added or
+   *                               a single path string if only one node was added.
+   *                               NOTE:  If autoReindex is FALSE, then we can't return the *complete* path
+   *                               as the exact doc-pos isn't available without reindexing. In that case we leave
+   *                               out the last [docpos] in the path(s). ie  we'd return /A[3]/B instead of /A[3]/B[2]
+   * @see    insertChild(), reindexNodeTree()
+   */
+  function appendChild($xPathQuery, $node, $afterText=FALSE, $autoReindex=TRUE) {
+    if (is_string($node)) {
+      if (empty($node)) { //--sam. Not sure how to react on an empty string - think it's an error.
+        return FALSE;
+      } else { 
+        if (!($node = $this->_xml2Document($node))) return FALSE;
+      }
+    }
+    
+    // Special case if it's 'super root'. We then have to take the child node == top node
+    if (empty($node['parentNode'])) $node = $node['childNodes'][0];
+
+    // Check for a valid xPathQuery
+    $xPathSet = $this->_resolveXPathQueryForNodeMod($xPathQuery, 'appendChild');
+    if (sizeOf($xPathSet) === 0) return FALSE;
+
+    $mustReindex = FALSE;
+    $newNodes = array();
+    $result = array();
+    // Make chages from 'bottom-up'. In this manner the modifications will not affect itself.
+    for ($i=sizeOf($xPathSet)-1; $i>=0; $i--) {
+      $mustReindex = $autoReindex;
+      // Flag the index as dirty; it's not uptodate. A reindex will be forced (if dirty) when exporting the XML doc
+      $this->_indexIsDirty = TRUE;
+      
+      $absoluteXPath = $xPathSet[$i];
+      $parentNode =& $this->nodeIndex[$absoluteXPath];
+      $newNode =& $this->cloneNode($node);
+      $parentNode['childNodes'][] =& $newNode;
+      $pos = count($parentNode['textParts']);
+      $pos -= $afterText ? 0 : 1;
+      $parentNode['textParts'] = array_merge(
+                                   array_slice($parentNode['textParts'], 0, $pos),
+                                   array(''),
+                                   array_slice($parentNode['textParts'], $pos)
+                                 );
+      // We are going from bottom to top, but the user will want results from top to bottom.
+      if ($mustReindex) {
+        // We'll have to wait till after the reindex to get the full path to this new node.
+        $newNodes[] = &$newNode;
+      } else {
+        // If we are reindexing the tree later, then we can't return the user any
+        // useful results, so we just return them the count.
+        array_unshift($result, "$absoluteXPath/{$newNode['name']}");
+      }
+    }
+    if ($mustReindex) {
+      $this->reindexNodeTree();
+      // Now we must fill in the result array.  Because until now we did not
+      // know what contextpos our newly added entries had, just their pos within
+      // the siblings.
+      foreach ($newNodes as $newNode) {
+        array_unshift($result, $newNode['xpath']);
+      }
+    } 
+    if (count($result) == 1) $result = $result[0];
+    return $result;
+  }
+  
+  /**
+   * Inserts a node before the reference node with the same parent.
+   *
+   * If you intend to do a lot of appending, you should leave autoIndex as FALSE
+   * and then call reindexNodeTree() when you are finished all the appending.
+   *
+   * @param  $xPathQuery  (string) Xpath to the node to insert new node before
+   * @param  $node        (mixed)  String or Array (Usually a String)
+   *                               If string: Vaild XML. E.g. "<A/>" or "<A> foo <B/> bar <A/>"
+   *                               If array:  A Node (can be a whole sub-tree) (See comment in header)
+   * @param  $afterText   (bool)   (optional, default=FLASE) Insert after the text.
+   * @param  $autoReindex (bool)   (optional, default=TRUE) Reindex the document to reflect 
+   *                               the changes.  A performance helper.  See reindexNodeTree()
+   * @return              (mixed)  FALSE on error (or no match). On success we return the path(s) to the newly
+   *                               appended nodes. That is: Array of paths if more then 1 node was added or
+   *                               a single path string if only one node was added.
+   *                               NOTE:  If autoReindex is FALSE, then we can't return the *complete* path
+   *                               as the exact doc-pos isn't available without reindexing. In that case we leave
+   *                               out the last [docpos] in the path(s). ie  we'd return /A[3]/B instead of /A[3]/B[2]
+   * @see    reindexNodeTree()
+   */
+  function insertBefore($xPathQuery, $node, $afterText=TRUE, $autoReindex=TRUE) {
+    return $this->insertChild($xPathQuery, $node, $shiftRight=TRUE, $afterText, $autoReindex);
+  }
+  
+
+  //-----------------------------------------------------------------------------------------
+  // XPath                     ------  Attribute  Set/Get  ------                            
+  //-----------------------------------------------------------------------------------------
+  
+  /** 
+   * Retrieves a dedecated attribute value or a hash-array of all attributes of a node.
+   * 
+   * The first param $absoluteXPath must be a valid xpath OR a xpath-query that results 
+   * to *one* xpath. If the second param $attrName is not set, a hash-array of all attributes 
+   * of that node is returned.
+   *
+   * Optionally you may pass an attrubute name in $attrName and the function will return the 
+   * string value of that attribute.
+   *
+   * @param  $absoluteXPath (string) Full xpath OR a xpath-query that results to *one* xpath.
+   * @param  $attrName      (string) (Optional) The name of the attribute. See above.
+   * @return                (mixed)  hash-array or a string of attributes depending if the 
+   *                                 parameter $attrName was set (see above).  FALSE if the 
+   *                                 node or attribute couldn't be found.
+   * @see    setAttribute(), removeAttribute()
+   */
+  function getAttributes($absoluteXPath, $attrName=NULL) {
+    // Numpty check
+    if (!isSet($this->nodeIndex[$absoluteXPath])) {
+      $xPathSet = $this->_resolveXPathQuery($absoluteXPath,'getAttributes');
+      if (empty($xPathSet)) return FALSE;
+      // only use the first entry
+      $absoluteXPath = $xPathSet[0];
+    }
+    if (!empty($this->parseOptions[XML_OPTION_CASE_FOLDING])) {
+        // Case in-sensitive
+        $attrName = strtoupper($attrName);
+    }
+    
+    // Return the complete list or just the desired element
+    if (is_null($attrName)) {
+      return $this->nodeIndex[$absoluteXPath]['attributes'];
+    } elseif (isSet($this->nodeIndex[$absoluteXPath]['attributes'][$attrName])) {
+      return $this->nodeIndex[$absoluteXPath]['attributes'][$attrName];
+    }
+    return FALSE;
+  }
+  
+  /**
+   * Set attributes of a node(s).
+   *
+   * This method sets a number single attributes. An existing attribute is overwritten (default)
+   * with the new value, but setting the last param to FALSE will prevent overwritten.
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery (string) xpath to the node (See note above).
+   * @param  $name       (string) Attribute name.
+   * @param  $value      (string) Attribute value.   
+   * @param  $overwrite  (bool)   If the attribute is already set we overwrite it (see text above)
+   * @return             (bool)   TRUE on success, FALSE on failure.
+   * @see    getAttributes(), removeAttribute()
+   */
+  function setAttribute($xPathQuery, $name, $value, $overwrite=TRUE) {
+    return $this->setAttributes($xPathQuery, array($name => $value), $overwrite);
+  }
+  
+  /**
+   * Version of setAttribute() that sets multiple attributes to node(s).
+   *
+   * This method sets a number of attributes. Existing attributes are overwritten (default)
+   * with the new values, but setting the last param to FALSE will prevent overwritten.
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery (string) xpath to the node (See note above).
+   * @param  $attributes (array)  associative array of attributes to set.
+   * @param  $overwrite  (bool)   If the attributes are already set we overwrite them (see text above)
+   * @return             (bool)   TRUE on success, FALSE otherwise
+   * @see    setAttribute(), getAttributes(), removeAttribute()
+   */
+  function setAttributes($xPathQuery, $attributes, $overwrite=TRUE) {
+    $status = FALSE;
+    do { // try-block
+      // The attributes parameter should be an associative array.
+      if (!is_array($attributes)) break;  // try-block
+      
+      // Check for a valid xPathQuery
+      $xPathSet = $this->_resolveXPathQuery($xPathQuery,'setAttributes');
+      foreach($xPathSet as $absoluteXPath) {
+        // Add the attributes to the node.
+        $theNode =& $this->nodeIndex[$absoluteXPath];
+        if (empty($theNode['attributes'])) {
+          $this->nodeIndex[$absoluteXPath]['attributes'] = $attributes;
+        } else {
+          $theNode['attributes'] = $overwrite ? array_merge($theNode['attributes'],$attributes) : array_merge($attributes, $theNode['attributes']);
+        }
+      }
+      $status = TRUE;
+    } while(FALSE); // END try-block
+    
+    return $status;
+  }
+  
+  /**
+   * Removes an attribute of a node(s).
+   *
+   * This method removes *ALL* attributres per default unless the second parameter $attrList is set.
+   * $attrList can be either a single attr-name as string OR a vector of attr-names as array.
+   * E.g. 
+   *  removeAttribute(<xPath>);                     # will remove *ALL* attributes.
+   *  removeAttribute(<xPath>, 'A');                # will only remove attributes called 'A'.
+   *  removeAttribute(<xPath>, array('A_1','A_2')); # will remove attribute 'A_1' and 'A_2'.
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param   $xPathQuery (string) xpath to the node (See note above).
+   * @param   $attrList   (mixed)  (optional) if not set will delete *all* (see text above)
+   * @return              (bool)   TRUE on success, FALSE if the node couldn't be found
+   * @see     getAttributes(), setAttribute()
+   */
+  function removeAttribute($xPathQuery, $attrList=NULL) {
+    // Check for a valid xPathQuery
+    $xPathSet = $this->_resolveXPathQuery($xPathQuery, 'removeAttribute');
+    
+    if (!empty($attrList) AND is_string($attrList)) $attrList = array($attrList);
+    if (!is_array($attrList)) return FALSE;
+    
+    foreach($xPathSet as $absoluteXPath) {
+      // If the attribute parameter wasn't set then remove all the attributes
+      if ($attrList[0] === NULL) {
+        $this->nodeIndex[$absoluteXPath]['attributes'] = array();
+        continue; 
+      }
+      // Remove all the elements in the array then.
+      foreach($attrList as $name) {
+        unset($this->nodeIndex[$absoluteXPath]['attributes'][$name]);
+      }
+    }
+    return TRUE;
+  }
+  
+  //-----------------------------------------------------------------------------------------
+  // XPath                        ------  Text  Set/Get  ------                              
+  //-----------------------------------------------------------------------------------------
+  
+  /**
+   * Retrieve all the text from a node as a single string.
+   *
+   * Sample  
+   * Given is: <AA> This <BB\>is <BB\>  some<BB\>text </AA>
+   * Return of getData('/AA[1]') would be:  " This is   sometext "
+   * The first param $xPathQuery must be a valid xpath OR a xpath-query that 
+   * results to *one* xpath. 
+   *
+   * @param  $xPathQuery (string) xpath to the node - resolves to *one* xpath.
+   * @return             (mixed)  The returned string (see above), FALSE if the node 
+   *                              couldn't be found or is not unique.
+   * @see getDataParts()
+   */
+  function getData($xPathQuery) {
+    $aDataParts = $this->getDataParts($xPathQuery);
+    if ($aDataParts === FALSE) return FALSE;
+    return implode('', $aDataParts);
+  }
+  
+  /**
+   * Retrieve all the text from a node as a vector of strings
+   * 
+   * Where each element of the array was interrupted by a non-text child element.
+   *
+   * Sample  
+   * Given is: <AA> This <BB\>is <BB\>  some<BB\>text </AA>
+   * Return of getDataParts('/AA[1]') would be:  array([0]=>' This ', [1]=>'is ', [2]=>'  some', [3]=>'text ');
+   * The first param $absoluteXPath must be a valid xpath OR a xpath-query that results 
+   * to *one* xpath. 
+   *
+   * @param  $xPathQuery (string) xpath to the node - resolves to *one* xpath.
+   * @return             (mixed)  The returned array (see above), or FALSE if node is not 
+   *                              found or is not unique.
+   * @see getData()
+   */
+  function getDataParts($xPathQuery) {
+    // Resolve xPath argument
+    $xPathSet = $this->_resolveXPathQuery($xPathQuery, 'getDataParts');
+    if (1 !== ($setSize=count($xPathSet))) {
+      $this->_displayError(sprintf($this->errorStrings['AbsoluteXPathRequired'], $xPathQuery) . "Not unique xpath-query, matched {$setSize}-times.", __LINE__, __FILE__, FALSE);
+      return FALSE;
+    }
+    $absoluteXPath = $xPathSet[0];
+    // Is it an attribute node?
+    if (preg_match(";(.*)/attribute::([^/]*)$;U", $xPathSet[0], $matches)) {
+      $absoluteXPath = $matches[1];
+      $attribute = $matches[2];
+      if (!isSet($this->nodeIndex[$absoluteXPath]['attributes'][$attribute])) {
+        $this->_displayError("The $absoluteXPath/attribute::$attribute value isn't a node in this document.", __LINE__, __FILE__, FALSE);
+        continue;
+      }
+      return array($this->nodeIndex[$absoluteXPath]['attributes'][$attribute]);
+    } else if (preg_match(":(.*)/text\(\)(\[(.*)\])?$:U", $xPathQuery, $matches)) {
+      $absoluteXPath = $matches[1];
+      $textPartNr = $matches[2];      
+      return array($this->nodeIndex[$absoluteXPath]['textParts'][$textPartNr]);
+    } else {
+      return $this->nodeIndex[$absoluteXPath]['textParts'];
+    }
+  }
+  
+  /**
+   * Retrieves a sub string of a text-part OR attribute-value.
+   *
+   * This method retrieves the sub string of a specific text-part OR (if the 
+   * $absoluteXPath references an attribute) the the sub string  of the attribute value.
+   * If no 'direct referencing' is used (Xpath ends with text()[<part-number>]), then 
+   * the first text-part of the node ist returned (if exsiting).
+   *
+   * @param  $absoluteXPath (string) Xpath to the node (See note above).   
+   * @param  $offset        (int)    (optional, default is 0) Starting offset. (Just like PHP's substr())
+   * @param  $count         (number) (optional, default is ALL) Character count  (Just like PHP's substr())
+   * @return                (mixed)  The sub string, FALSE if not found or on error
+   * @see    XPathEngine::wholeText(), PHP's substr()
+   */
+  function substringData($absoluteXPath, $offset = 0, $count = NULL) {
+    if (!($text = $this->wholeText($absoluteXPath))) return FALSE;
+    if (is_null($count)) {
+      return substr($text, $offset);
+    } else {
+      return substr($text, $offset, $count);
+    } 
+  }
+  
+  /**
+   * Replace a sub string of a text-part OR attribute-value.
+   *
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery    (string) xpath to the node (See note above).
+   * @param  $replacement   (string) The string to replace with.
+   * @param  $offset        (int)    (optional, default is 0) Starting offset. (Just like PHP's substr_replace ())
+   * @param  $count         (number) (optional, default is 0=ALL) Character count  (Just like PHP's substr_replace())
+   * @param  $textPartNr    (int)    (optional) (see _getTextSet() )
+   * @return                (bool)   The new string value on success, FALSE if not found or on error
+   * @see    substringData()
+   */
+  function replaceData($xPathQuery, $replacement, $offset = 0, $count = 0, $textPartNr=1) {
+    if (!($textSet = $this->_getTextSet($xPathQuery, $textPartNr))) return FALSE;
+    $tSize=sizeOf($textSet);
+    for ($i=0; $i<$tSize; $i++) {
+      if ($count) {
+        $textSet[$i] = substr_replace($textSet[$i], $replacement, $offset, $count);
+      } else {
+        $textSet[$i] = substr_replace($textSet[$i], $replacement, $offset);
+      } 
+    }
+    return TRUE;
+  }
+  
+  /**
+   * Insert a sub string in a text-part OR attribute-value.
+   *
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery (string) xpath to the node (See note above).
+   * @param  $data       (string) The string to replace with.
+   * @param  $offset     (int)    (optional, default is 0) Offset at which to insert the data.
+   * @return             (bool)   The new string on success, FALSE if not found or on error
+   * @see    replaceData()
+   */
+  function insertData($xPathQuery, $data, $offset=0) {
+    return $this->replaceData($xPathQuery, $data, $offset, 0);
+  }
+  
+  /**
+   * Append text data to the end of the text for an attribute OR node text-part.
+   *
+   * This method adds content to a node. If it's an attribute node, then
+   * the value of the attribute will be set, otherwise the passed data will append to 
+   * character data of the node text-part. Per default the first text-part is taken.
+   *
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param   $xPathQuery (string) to the node(s) (See note above).
+   * @param   $data       (string) String containing the content to be added.
+   * @param   $textPartNr (int)    (optional, default is 1) (see _getTextSet())
+   * @return              (bool)   TRUE on success, otherwise FALSE
+   * @see     _getTextSet()
+   */
+  function appendData($xPathQuery, $data, $textPartNr=1) {
+    if (!($textSet = $this->_getTextSet($xPathQuery, $textPartNr))) return FALSE;
+    $tSize=sizeOf($textSet);
+    for ($i=0; $i<$tSize; $i++) {
+      $textSet[$i] .= $data;
+    }
+    return TRUE;
+  }
+  
+  /**
+   * Delete the data of a node.
+   *
+   * This method deletes content of a node. If it's an attribute node, then
+   * the value of the attribute will be removed, otherwise the node text-part. 
+   * will be deleted.  Per default the first text-part is deleted.
+   *
+   * NOTE: When passing a xpath-query instead of an abs. Xpath.
+   *       Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param  $xPathQuery (string) to the node(s) (See note above).
+   * @param  $offset     (int)    (optional, default is 0) Starting offset. (Just like PHP's substr_replace())
+   * @param  $count      (number) (optional, default is 0=ALL) Character count.  (Just like PHP's substr_replace())
+   * @param  $textPartNr (int)    (optional, default is 0) the text part to delete (see _getTextSet())
+   * @return             (bool)   TRUE on success, otherwise FALSE
+   * @see     _getTextSet()
+   */
+  function deleteData($xPathQuery, $offset=0, $count=0, $textPartNr=1) {
+    if (!($textSet = $this->_getTextSet($xPathQuery, $textPartNr))) return FALSE;
+    $tSize=sizeOf($textSet);
+    for ($i=0; $i<$tSize; $i++) {
+      if (!$count)
+        $textSet[$i] = "";
+      else
+        $textSet[$i] = substr_replace($textSet[$i],'', $offset, $count);
+    } 
+    return TRUE;
+  }
+ 
+  //-----------------------------------------------------------------------------------------
+  // XPath                      ------  Help Stuff  ------                                   
+  //-----------------------------------------------------------------------------------------
+   
+  /**
+   * Parse the XML to a node-tree. A so called 'document'
+   *
+   * @param  $xmlString (string) The string to turn into a document node.
+   * @return            (&array)  a node-tree
+   */
+  function &_xml2Document($xmlString) {
+    $xmlOptions = array(
+                    XML_OPTION_CASE_FOLDING => $this->getProperties('caseFolding'), 
+                    XML_OPTION_SKIP_WHITE   => $this->getProperties('skipWhiteSpaces')
+                  );
+    $xmlParser =& new XPathEngine($xmlOptions);
+    $xmlParser->setVerbose($this->properties['verboseLevel']);
+    // Parse the XML string
+    if (!$xmlParser->importFromString($xmlString)) {
+      $this->_displayError($xmlParser->getLastError(), __LINE__, __FILE__, FALSE);
+      return FALSE;
+    }
+    return $xmlParser->getNode('/');
+  }
+  
+  /**
+   * Get a reference-list to node text part(s) or node attribute(s).
+   * 
+   * If the Xquery references an attribute(s) (Xquery ends with attribute::), 
+   * then the text value of the node-attribute(s) is/are returned.
+   * Otherwise the Xquery is referencing to text part(s) of node(s). This can be either a 
+   * direct reference to text part(s) (Xquery ends with text()[<nr>]) or indirect reference 
+   * (a simple Xquery to node(s)).
+   * 1) Direct Reference (Xquery ends with text()[<part-number>]):
+   *   If the 'part-number' is omitted, the first text-part is assumed; starting by 1.
+   *   Negative numbers are allowed, where -1 is the last text-part a.s.o.
+   * 2) Indirect Reference (a simple  Xquery to node(s)):
+   *   Default is to return the first text part(s). Optionally you may pass a parameter 
+   *   $textPartNr to define the text-part you want;  starting by 1.
+   *   Negative numbers are allowed, where -1 is the last text-part a.s.o.
+   *
+   * NOTE I : The returned vector is a set of references to the text parts / attributes.
+   *          This is handy, if you wish to modify the contents.
+   * NOTE II: text-part numbers out of range will not be in the list
+   * NOTE III:Instead of an absolute xpath you may also pass a xpath-query.
+   *          Depending on setModMatch() one, none or multiple nodes are affected.
+   *
+   * @param   $xPathQuery (string) xpath to the node (See note above).
+   * @param   $textPartNr (int)    String containing the content to be set.
+   * @return              (mixed)  A vector of *references* to the text that match, or 
+   *                               FALSE on error
+   * @see XPathEngine::wholeText()
+   */
+  function _getTextSet($xPathQuery, $textPartNr=1) {
+    $ThisFunctionName = '_getTextSet';
+    $bDebugThisFunction = in_array($ThisFunctionName, $this->aDebugFunctions);
+    $this->_beginDebugFunction($ThisFunctionName, $bDebugThisFunction);
+    if ($bDebugThisFunction) {
+      echo "Node: $xPathQuery\n";
+      echo "Text Part Number: $textPartNr\n";
+      echo "<hr>";
+    }
+    
+    $status = FALSE;
+    $funcName = '_getTextSet';
+    $textSet = array();
+    
+    do { // try-block
+      // Check if it's a Xpath reference to an attribut(s). Xpath ends with attribute::)
+      if (preg_match(";(.*)/(attribute::|@)([^/]*)$;U", $xPathQuery, $matches)) {
+        $xPathQuery = $matches[1];
+        $attribute = $matches[3];
+        // Quick out
+        if (isSet($this->nodeIndex[$xPathQuery])) {
+          $xPathSet[] = $xPathQuery;
+        } else {
+          // Try to evaluate the absoluteXPath (since it seems to be an Xquery and not an abs. Xpath)
+          $xPathSet = $this->_resolveXPathQuery("$xPathQuery/attribute::$attribute", $funcName);
+        }
+        foreach($xPathSet as $absoluteXPath) {
+          preg_match(";(.*)/attribute::([^/]*)$;U", $xPathSet[0], $matches);
+          $absoluteXPath = $matches[1];
+          $attribute = $matches[2];
+          if (!isSet($this->nodeIndex[$absoluteXPath]['attributes'][$attribute])) {
+            $this->_displayError("The $absoluteXPath/attribute::$attribute value isn't a node in this document.", __LINE__, __FILE__, FALSE);
+            continue;
+          }
+          $textSet[] =& $this->nodes[$absoluteXPath]['attributes'][$attribute];
+        }
+        $status = TRUE;
+        break; // try-block
+      }
+      
+      // Check if it's a Xpath reference direct to a text-part(s). (xpath ends with text()[<part-number>])
+      if (preg_match(":(.*)/text\(\)(\[(.*)\])?$:U", $xPathQuery, $matches)) {
+        $xPathQuery = $matches[1];
+        // default to the first text node if a text node was not specified
+        $textPartNr = isSet($matches[2]) ? substr($matches[2],1,-1) : 1;
+        // Quick check
+        if (isSet($this->nodeIndex[$xPathQuery])) {
+          $xPathSet[] = $xPathQuery;
+        } else {
+          // Try to evaluate the absoluteXPath (since it seams to be an Xquery and not an abs. Xpath)
+          $xPathSet = $this->_resolveXPathQuery("$xPathQuery/text()[$textPartNr]", $funcName);
+        }
+      }
+      else {
+        // At this point we have been given an xpath with neither a 'text()' or 'attribute::' axis at the end
+        // So this means to get the text-part of the node. If parameter $textPartNr was not set, use the last
+        // text-part.
+        if (isSet($this->nodeIndex[$xPathQuery])) {
+          $xPathSet[] = $xPathQuery;
+        } else {
+          // Try to evaluate the absoluteXPath (since it seams to be an Xquery and not an abs. Xpath)
+          $xPathSet = $this->_resolveXPathQuery($xPathQuery, $funcName);
+        }
+      }
+
+      if ($bDebugThisFunction) {
+        echo "Looking up paths for:\n";
+        print_r($xPathSet);
+      }
+
+      // Now fetch all text-parts that match. (May be 0,1 or many)
+      foreach($xPathSet as $absoluteXPath) {
+        unset($text);
+        if ($text =& $this->wholeText($absoluteXPath, $textPartNr)) {
+          $textSet[] =& $text;
+        } else {
+          // The node does not yet have any text, so we have to add a '' string so that
+          // if we insert or replace to it, then we'll actually have something to op on.
+          $this->nodeIndex[$absoluteXPath]['textParts'][$textPartNr-1] = '';
+          $textSet[] =& $this->nodeIndex[$absoluteXPath]['textParts'][$textPartNr-1];
+        }
+      }
+
+      $status = TRUE;
+    } while (FALSE); // END try-block
+    
+    if (!$status) $result = FALSE;
+    else          $result = $textSet;
+
+    $this->_closeDebugFunction($ThisFunctionName, $result, $bDebugThisFunction);
+
+    return $result;
+  }
+  
+
+  /**
+   * Resolves an xPathQuery vector for a node op for modification
+   *
+   * It is possible to create a brand new object, and try to append and insert nodes
+   * into it, so this is a version of _resolveXPathQuery() that will autocreate the
+   * super root if it detects that it is not present and the $xPathQuery is empty.
+   *
+   * Also it demands that there be at least one node returned, and displays a suitable
+   * error message if the returned xPathSet does not contain any nodes.
+   * 
+   * @param  $xPathQuery (string) An xpath query targeting a single node.  If empty() 
+   *                              returns the root node and auto creates the root node
+   *                              if it doesn't exist.
+   * @param  $function   (string) The function in which this check was called
+   * @return             (array)  Vector of $absoluteXPath's (May be empty)
+   * @see    _resolveXPathQuery()
+   */
+  function _resolveXPathQueryForNodeMod($xPathQuery, $functionName) {
+    $xPathSet = array();
+    if (empty($xPathQuery)) {
+      // You can append even if the root node doesn't exist.
+      if (!isset($this->nodeIndex[$xPathQuery])) $this->_createSuperRoot();
+      $xPathSet[] = '';
+      // However, you can only append to the super root, if there isn't already a root entry.
+      $rootNodes = $this->_resolveXPathQuery('/*','appendChild');
+      if (count($rootNodes) !== 0) {
+        $this->_displayError(sprintf($this->errorStrings['RootNodeAlreadyExists']), __LINE__, __FILE__, FALSE);
+        return array();
+      }
+    } else {
+      $xPathSet = $this->_resolveXPathQuery($xPathQuery,'appendChild');
+      if (sizeOf($xPathSet) === 0) {
+        $this->_displayError(sprintf($this->errorStrings['NoNodeMatch'], $xPathQuery), __LINE__, __FILE__, FALSE);
+        return array();
+      }
+    }
+    return $xPathSet;
+  }
+
+  /**
+   * Resolves an xPathQuery vector depending on the property['modMatch']
+   * 
+   * To:
+   *   - all matches, 
+   *   - the first
+   *   - none (If the query matches more then one node.)
+   * see  setModMatch() for details
+   * 
+   * @param  $xPathQuery (string) An xpath query targeting a single node.  If empty() 
+   *                              returns the root node (if it exists).
+   * @param  $function   (string) The function in which this check was called
+   * @return             (array)  Vector of $absoluteXPath's (May be empty)
+   * @see    setModMatch()
+   */
+  function _resolveXPathQuery($xPathQuery, $function) {
+    $xPathSet = array();
+    do { // try-block
+      if (isSet($this->nodeIndex[$xPathQuery])) {
+        $xPathSet[] = $xPathQuery;
+        break; // try-block
+      }
+      if (empty($xPathQuery)) break; // try-block
+      if (substr($xPathQuery, -1) === '/') break; // If the xPathQuery ends with '/' then it cannot be a good query.
+      // If this xPathQuery is not absolute then attempt to evaluate it
+      $xPathSet = $this->match($xPathQuery);
+      
+      $resultSize = sizeOf($xPathSet);
+      switch($this->properties['modMatch']) {
+        case XPATH_QUERYHIT_UNIQUE : 
+          if ($resultSize >1) {
+            $xPathSet = array();
+            if ($this->properties['verboseLevel']) $this->_displayError("Canceled function '{$function}'. The query '{$xPathQuery}' mached {$resultSize} nodes and 'modMatch' is set to XPATH_QUERYHIT_UNIQUE.", __LINE__, __FILE__, FALSE);
+          }
+          break;
+        case XPATH_QUERYHIT_FIRST : 
+          if ($resultSize >1) {
+            $xPathSet = array($xPathSet[0]);
+            if ($this->properties['verboseLevel']) $this->_displayError("Only modified first node in function '{$function}' because the query '{$xPathQuery}' mached {$resultSize} nodes and 'modMatch' is set to XPATH_QUERYHIT_FIRST.", __LINE__, __FILE__, FALSE);
+          }
+          break;
+        default: ; // DO NOTHING
+      }
+    } while (FALSE);
+    
+    if ($this->properties['verboseLevel'] >= 2) $this->_displayMessage("'{$xPathQuery}' parameter from '{$function}' returned the following nodes: ".(count($xPathSet)?implode('<br>', $xPathSet):'[none]'), __LINE__, __FILE__);
+    return $xPathSet;
+  }
+} // END OF CLASS XPath
+
+// -----------------------------------------------------------------------------------------
+// -----------------------------------------------------------------------------------------
+// -----------------------------------------------------------------------------------------
+// -----------------------------------------------------------------------------------------
+
+/**************************************************************************************************
+// Usage Sample:
+// -------------
+// Following code will give you an idea how to work with PHP.XPath. It's a working sample
+// to help you get started. :o)
+// Take the comment tags away and run this file.
+**************************************************************************************************/
+
+/**
+ * Produces a short title line.
+ */
+function _title($title) { 
+  echo "<br><hr><b>" . htmlspecialchars($title) . "</b><hr>\n";
+}
+
+$self = isSet($_SERVER) ? $_SERVER['PHP_SELF'] : $PHP_SELF;
+if (basename($self) == 'XPath.class.php') {
+  // The sampe source:
+  $q = '?';
+  $xmlSource = <<< EOD
+  <{$q}Process_Instruction test="&copy;&nbsp;All right reserved" {$q}>
+    <AAA foo="bar"> ,,1,,
+      ..1.. <![CDATA[ bla  bla 
+      newLine blo blo ]]>
+      <BBB foo="bar">
+        ..2..
+      </BBB>..3..<CC/>   ..4..</AAA> 
+EOD;
+  
+  // The sample code:
+  $xmlOptions = array(XML_OPTION_CASE_FOLDING => TRUE, XML_OPTION_SKIP_WHITE => TRUE);
+  $xPath =& new XPath(FALSE, $xmlOptions);
+  //$xPath->bDebugXmlParse = TRUE;
+  if (!$xPath->importFromString($xmlSource)) { echo $xPath->getLastError(); exit; }
+  
+  _title("Following was imported:");
+  echo $xPath->exportAsHtml();
+  
+  _title("Get some content");
+  echo "Last text part in &lt;AAA&gt;: '" . $xPath->wholeText('/AAA[1]', -1) ."'<br>\n";
+  echo "All the text in  &lt;AAA&gt;: '" . $xPath->wholeText('/AAA[1]') ."'<br>\n";
+  echo "The attibute value  in  &lt;BBB&gt; using getAttributes('/AAA[1]/BBB[1]', 'FOO'): '" . $xPath->getAttributes('/AAA[1]', 'FOO') ."'<br>\n";
+  echo "The attibute value  in  &lt;BBB&gt; using getData('/AAA[1]/@FOO'): '" . $xPath->getData('/AAA[1]/@FOO') ."'<br>\n";
+  
+  _title("Append some additional XML below /AAA/BBB:");
+  $xPath->appendChild('/AAA[1]/BBB[1]', '<CCC> Step 1. Append new node </CCC>', $afterText=FALSE);
+  $xPath->appendChild('/AAA[1]/BBB[1]', '<CCC> Step 2. Append new node </CCC>', $afterText=TRUE);
+  $xPath->appendChild('/AAA[1]/BBB[1]', '<CCC> Step 3. Append new node </CCC>', $afterText=TRUE);
+  echo $xPath->exportAsHtml();
+  
+  _title("Insert some additional XML below <AAA>:");
+  $xPath->reindexNodeTree();
+  $xPath->insertChild('/AAA[1]/BBB[1]', '<BB> Step 1. Insert new node </BB>', $shiftRight=TRUE, $afterText=TRUE);
+  $xPath->insertChild('/AAA[1]/BBB[1]', '<BB> Step 2. Insert new node </BB>', $shiftRight=FALSE, $afterText=TRUE);
+  $xPath->insertChild('/AAA[1]/BBB[1]', '<BB> Step 3. Insert new node </BB>', $shiftRight=FALSE, $afterText=FALSE);
+  echo $xPath->exportAsHtml();
+
+  _title("Replace the last <BB> node with new XML data '&lt;DDD&gt; Replaced last BB &lt;/DDD&gt;':");
+  $xPath->reindexNodeTree();
+  $xPath->replaceChild('/AAA[1]/BB[last()]', '<DDD> Replaced last BB </DDD>', $afterText=FALSE);
+  echo $xPath->exportAsHtml();
+  
+  _title("Replace second <BB> node with normal text");
+  $xPath->reindexNodeTree();
+  $xPath->replaceChildByData('/AAA[1]/BB[2]', '"Some new text"');
+  echo $xPath->exportAsHtml();
+}
+
+?>
\ No newline at end of file
diff --git a/www/include/options/sysInfos/includes/class.Template.inc.php b/www/include/options/sysInfos/includes/class.Template.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..9c3457ce9b2e3cd8f2a5668a971675e469425269
--- /dev/null
+++ b/www/include/options/sysInfos/includes/class.Template.inc.php
@@ -0,0 +1,449 @@
+<?php
+  /**************************************************************************\
+  * eGroupWare API - Template class                                          *
+  * (C) Copyright 1999-2000 NetUSE GmbH Kristian Koehntopp                   *
+  * ------------------------------------------------------------------------ *
+  * http://www.egroupware.org/                                               *  
+  * ------------------------------------------------------------------------ *
+  * This program is free software; you can redistribute it and/or modify it  *
+  * under the terms of the GNU Lesser General Public License as published    *
+  * by the Free Software Foundation; either version 2.1 of the License, or   *
+  * any later version.                                                       *
+  \**************************************************************************/
+
+  /* $Id: class.Template.inc.php,v 1.5 2005/11/26 13:01:24 bigmichi1 Exp $ */
+
+	class Template
+	{
+		var $classname = 'Template';
+
+		/* if set, echo assignments */
+		var $debug = False;
+
+		/* $file[handle] = 'filename'; */
+		var $file = array();
+
+		/* relative filenames are relative to this pathname */
+		var $root = '';
+
+		/* $varkeys[key] = 'key'; $varvals[key] = 'value'; */
+		var $varkeys = array();
+		var $varvals = array();
+
+		/* 'remove'  => remove undefined variables
+		 * 'comment' => replace undefined variables with comments
+		 * 'keep'    => keep undefined variables
+		 */
+		var $unknowns = 'remove';
+
+		/* 'yes' => halt, 'report' => report error, continue, 'no' => ignore error quietly */
+		var $halt_on_error = 'yes';
+
+		/* last error message is retained here */
+		var $last_error = '';
+
+		/***************************************************************************/
+		/* public: Constructor.
+		 * root:     template directory.
+		 * unknowns: how to handle unknown variables.
+		 */
+		function Template($root = '.', $unknowns = 'remove')
+		{
+			$this->set_root($root);
+			$this->set_unknowns($unknowns);
+		}
+
+		/* public: setroot(pathname $root)
+		 * root:   new template directory.
+		 */
+		function set_root($root)
+		{
+			if (!is_dir($root))
+			{
+				$this->halt("set_root: $root is not a directory.");
+				return false;
+			}
+			$this->root = $root;
+			return true;
+		}
+
+		/* public: set_unknowns(enum $unknowns)
+		 * unknowns: 'remove', 'comment', 'keep'
+		 *
+		 */
+		function set_unknowns($unknowns = 'keep')
+		{
+			$this->unknowns = $unknowns;
+		}
+
+		/* public: set_file(array $filelist)
+		 * filelist: array of handle, filename pairs.
+		 *
+		 * public: set_file(string $handle, string $filename)
+		 * handle: handle for a filename,
+		 * filename: name of template file
+		 */
+		function set_file($handle, $filename = '')
+		{
+			if (!is_array($handle))
+			{
+				if ($filename == '')
+				{
+					$this->halt("set_file: For handle $handle filename is empty.");
+					return false;
+				}
+				$this->file[$handle] = $this->filename($filename);
+			}
+			else
+			{
+				reset($handle);
+				while(list($h, $f) = each($handle))
+				{
+					$this->file[$h] = $this->filename($f);
+				}
+			}
+		}
+
+		/* public: set_block(string $parent, string $handle, string $name = '')
+		 * extract the template $handle from $parent, 
+		 * place variable {$name} instead.
+		 */
+		function set_block($parent, $handle, $name = '')
+		{
+			if (!$this->loadfile($parent))
+			{
+				$this->halt("subst: unable to load $parent.");
+				return false;
+			}
+			if ($name == '')
+			{
+				$name = $handle;
+			}
+			$str = $this->get_var($parent);
+			$reg = "/<!--\s+BEGIN $handle\s+-->(.*)\n\s*<!--\s+END $handle\s+-->/sm";
+			preg_match_all($reg, $str, $m);
+			$str = preg_replace($reg, '{' . "$name}", $str);
+			$this->set_var($handle, $m[1][0]);
+			$this->set_var($parent, $str);
+		}
+
+		/* public: set_var(array $values)
+		 * values: array of variable name, value pairs.
+		 *
+		 * public: set_var(string $varname, string $value)
+		 * varname: name of a variable that is to be defined
+		 * value:   value of that variable
+		 */
+		function set_var($varname, $value = '')
+		{
+			if (!is_array($varname))
+			{
+				if (!empty($varname))
+				{
+					if ($this->debug)
+					{
+						print "scalar: set *$varname* to *$value*<br>\n";
+					}
+					$this->varkeys[$varname] = $this->varname($varname);
+					$this->varvals[$varname] = str_replace('phpGroupWare','eGroupWare',$value);
+				}
+			}
+			else
+			{
+				reset($varname);
+				while(list($k, $v) = each($varname))
+				{
+					if (!empty($k))
+					{
+						if ($this->debug)
+						{
+							print "array: set *$k* to *$v*<br>\n";
+						}
+						$this->varkeys[$k] = $this->varname($k);
+						$this->varvals[$k] = str_replace('phpGroupWare','eGroupWare',$v);
+					}
+				}
+			}
+		}
+
+		/* public: subst(string $handle)
+		 * handle: handle of template where variables are to be substituted.
+		 */
+		function subst($handle)
+		{
+			if (!$this->loadfile($handle))
+			{
+				$this->halt("subst: unable to load $handle.");
+				return false;
+			}
+
+			$str = $this->get_var($handle);
+			reset($this->varkeys);
+			while (list($k, $v) = each($this->varkeys))
+			{
+				$str = str_replace($v, $this->varvals[$k], $str);
+			}
+			return $str;
+		}
+
+		/* public: psubst(string $handle)
+		 * handle: handle of template where variables are to be substituted.
+		 */
+		function psubst($handle)
+		{
+			print $this->subst($handle);
+			return false;
+		}
+
+		/* public: parse(string $target, string $handle, boolean append)
+		 * public: parse(string $target, array  $handle, boolean append)
+		 * target: handle of variable to generate
+		 * handle: handle of template to substitute
+		 * append: append to target handle
+		 */
+		function parse($target, $handle, $append = false)
+		{
+			if (!is_array($handle))
+			{
+				$str = $this->subst($handle);
+				if ($append)
+				{
+					$this->set_var($target, $this->get_var($target) . $str);
+				}
+				else
+				{
+					$this->set_var($target, $str);
+				}
+			}
+			else
+			{
+				reset($handle);
+				while(list($i, $h) = each($handle))
+				{
+					$str = $this->subst($h);
+					$this->set_var($target, $str);
+				}
+			}
+			return $str;
+		}
+
+		function pparse($target, $handle, $append = false)
+		{
+			print $this->parse($target, $handle, $append);
+			return false;
+		}
+
+		/* This is short for finish parse */
+		function fp($target, $handle, $append = False)
+		{
+			return $this->finish($this->parse($target, $handle, $append));
+		}
+
+		/* This is a short cut for print finish parse */
+		function pfp($target, $handle, $append = False)
+		{
+			echo $this->finish($this->parse($target, $handle, $append));
+		}
+
+		/* public: get_vars()
+		 */
+		function get_vars()
+		{
+			reset($this->varkeys);
+			while(list($k, $v) = each($this->varkeys))
+			{
+				$result[$k] = $this->varvals[$k];
+			}
+			return $result;
+		}
+
+		/* public: get_var(string varname)
+		 * varname: name of variable.
+		 *
+		 * public: get_var(array varname)
+		 * varname: array of variable names
+		 */
+		function get_var($varname)
+		{
+			if (!is_array($varname))
+			{
+				return $this->varvals[$varname];
+			}
+			else
+			{
+				reset($varname);
+				while(list($k, $v) = each($varname))
+				{
+					$result[$k] = $this->varvals[$k];
+				}
+				return $result;
+			}
+		}
+
+		/* public: get_undefined($handle)
+		 * handle: handle of a template.
+		 */
+		function get_undefined($handle)
+		{
+			if (!$this->loadfile($handle))
+			{
+				$this->halt("get_undefined: unable to load $handle.");
+				return false;
+			}
+
+			preg_match_all("/\{([^}]+)\}/", $this->get_var($handle), $m);
+			$m = $m[1];
+			if (!is_array($m))
+			{
+				return false;
+			}
+			reset($m);
+			while(list($k, $v) = each($m))
+			{
+				if (!isset($this->varkeys[$v]))
+				{
+					$result[$v] = $v;
+				}
+			}
+
+			if (count($result))
+			{
+				return $result;
+			}
+			else
+			{
+				return false;
+			}
+		}
+
+		/* public: finish(string $str)
+		 * str: string to finish.
+		 */
+		function finish($str)
+		{
+			switch ($this->unknowns)
+			{
+				case 'keep':
+					break;
+				case 'remove':
+					$str = preg_replace('/{[^ \t\r\n}]+}/', '', $str);
+					break;
+				case 'comment':
+					$str = preg_replace('/{([^ \t\r\n}]+)}/', "<!-- Template $handle: Variable \\1 undefined -->", $str);
+					break;
+			}
+
+			return $str;
+		}
+
+		/* public: p(string $varname)
+		 * varname: name of variable to print.
+		 */
+		function p($varname)
+		{
+			print $this->finish($this->get_var($varname));
+		}
+
+		function get($varname)
+		{
+			return $this->finish($this->get_var($varname));
+		}
+
+		/***************************************************************************/
+		/* private: filename($filename)
+		 * filename: name to be completed.
+		 */
+		function filename($filename,$root='',$time=1)
+		{
+			if($root=='')
+			{
+				$root=$this->root;
+			}
+			if (substr($filename, 0, 1) != '/')
+			{
+				$new_filename = $root.'/'.$filename;
+			}
+			else
+			{
+				$new_filename = $filename;
+			}
+
+			if (!file_exists($new_filename))
+			{
+				if($time==2)
+				{
+					$this->halt("filename: file $new_filename does not exist.");
+				}
+				else
+				{
+					$new_root = str_replace($GLOBALS['egw_info']['server']['template_set'],'default',$root);
+					$new_filename = $this->filename(str_replace($root.'/','',$new_filename),$new_root,2);
+				}
+			}
+			return $new_filename;
+		}
+
+		/* private: varname($varname)
+		 * varname: name of a replacement variable to be protected.
+		 */
+		function varname($varname)
+		{
+			return '{'.$varname.'}';
+		}
+
+		/* private: loadfile(string $handle)
+		 * handle:  load file defined by handle, if it is not loaded yet.
+		 */
+		function loadfile($handle)
+		{
+			if (isset($this->varkeys[$handle]) and !empty($this->varvals[$handle]))
+			{
+				return true;
+			}
+			if (!isset($this->file[$handle]))
+			{
+				$this->halt("loadfile: $handle is not a valid handle.");
+				return false;
+			}
+			$filename = $this->file[$handle];
+
+			$str = implode('', @file($filename));
+			if (empty($str))
+			{
+				$this->halt("loadfile: While loading $handle, $filename does not exist or is empty.");
+				return false;
+			}
+
+			$this->set_var($handle, $str);
+			return true;
+		}
+
+		/***************************************************************************/
+		/* public: halt(string $msg)
+		 * msg:    error message to show.
+		 */
+		function halt($msg)
+		{
+			$this->last_error = $msg;
+
+			if ($this->halt_on_error != 'no')
+			{
+				$this->haltmsg($msg);
+			}
+
+			if ($this->halt_on_error == 'yes')
+			{
+				echo('<b>Halted.</b>');
+			}
+
+			exit;
+		}
+
+		/* public, override: haltmsg($msg)
+		 * msg: error message to show.
+		 */
+		function haltmsg($msg)
+		{
+			printf("<b>Template Error:</b> %s<br>\n", $msg);
+		}
+	}
diff --git a/www/include/options/sysInfos/includes/common_functions.php b/www/include/options/sysInfos/includes/common_functions.php
new file mode 100644
index 0000000000000000000000000000000000000000..3d6badaa690e46ec4ff3c00a71bbcd0a3b45dd70
--- /dev/null
+++ b/www/include/options/sysInfos/includes/common_functions.php
@@ -0,0 +1,208 @@
+<?php 
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+// $Id: common_functions.php,v 1.28 2005/12/10 15:54:41 bigmichi1 Exp $
+// HTML/XML Comment
+function created_by ()
+{
+  global $VERSION;
+  return "<!--\n\tCreated By: phpSysInfo - $VERSION\n\thttp://phpsysinfo.sourceforge.net/\n-->\n\n";
+} 
+// So that stupid warnings do not appear when we stats files that do not exist.
+error_reporting(5);
+// print out the bar graph
+
+// $value as full percentages
+// $maximim as current maximum 
+// $b as scale factor
+// $type as filesystem type
+function create_bargraph ($value, $maximum, $b, $type = "")
+{
+  global $webpath;
+  
+  $textdir = direction();
+
+  $imgpath = $webpath . 'templates/' . TEMPLATE_SET . '/images/';
+  $maximum == 0 ? $barwidth = 0 : $barwidth = round((100  / $maximum) * $value) * $b;
+  $red = 90 * $b;
+  $yellow = 75 * $b;
+
+  if (!file_exists(APP_ROOT . "/templates/" . TEMPLATE_SET . "/images/nobar_left.gif")) {
+    if ($barwidth == 0) {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_middle.gif" width="1" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_' . $textdir['right'] . '.gif" alt="">';
+    } elseif (file_exists(APP_ROOT . "/templates/" . TEMPLATE_SET . "/images/yellowbar_left.gif") && $barwidth > $yellow && $barwidth < $red) {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'yellowbar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'yellowbar_middle.gif" width="' . $barwidth . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'yellowbar_' . $textdir['right'] . '.gif" alt="">';
+    } elseif (($barwidth < $red) || ($type == "iso9660") || ($type == "CDFS")) {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_middle.gif" width="' . $barwidth . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_' . $textdir['right'] . '.gif" alt="">';
+    } else {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_middle.gif" width="' . $barwidth . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_' . $textdir['right'] . '.gif" alt="">';
+    }
+  } else {
+    if ($barwidth == 0) {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_middle.gif" width="' . (100 * $b) . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_' . $textdir['right'] . '.gif" alt="">';
+    } elseif (file_exists(APP_ROOT . "/templates/" . TEMPLATE_SET . "/images/yellowbar_left.gif") && $barwidth > $yellow && $barwidth < $red) {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'yellowbar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'yellowbar_middle.gif" width="' . $barwidth . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_middle.gif" width="' . ((100 * $b) - $barwidth) . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_' . $textdir['right'] . '.gif" alt="">';
+    } elseif (($barwidth < $red) || $type == "iso9660" || ($type == "CDFS")) {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'bar_middle.gif" width="' . $barwidth . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_middle.gif" width="' . ((100 * $b) - $barwidth) . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_' . $textdir['right'] . '.gif" alt="">';
+    } elseif ($barwidth == (100 * $b)) {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_middle.gif" width="' . (100 * $b) . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_' . $textdir['right'] . '.gif" alt="">';
+    } else {
+      return '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_' . $textdir['left'] . '.gif" alt="">' 
+           . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'redbar_middle.gif" width="' . $barwidth . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_middle.gif" width="' . ((100 * $b) - $barwidth) . '" alt="">' 
+	   . '<img height="' . BAR_HEIGHT . '" src="' . $imgpath . 'nobar_' . $textdir['right'] . '.gif" alt="">';
+    }
+  }
+} 
+
+function direction() {
+  global $text_dir;
+
+  if(!isset($text_dir) || $text_dir == "ltr") {
+    $result['direction'] = "ltr";
+    $result['left'] = "left";
+    $result['right'] = "right";
+  } else {
+    $result['direction'] = "rtl";
+    $result['left'] = "right";
+    $result['right'] = "left";
+  }
+  
+  return $result;
+}
+
+// Find a system program.  Do path checking
+function find_program ($program)
+{
+  $path = array('/bin', '/sbin', '/usr/bin', '/usr/sbin', '/usr/local/bin', '/usr/local/sbin');
+
+  if (function_exists("is_executable")) {
+    while ($this_path = current($path)) {
+      if (is_executable("$this_path/$program")) {
+        return "$this_path/$program";
+      } 
+      next($path);
+    } 
+  } else {
+    return strpos($program, '.exe');
+  } ;
+
+  return;
+} 
+// Execute a system program. return a trim()'d result.
+// does very crude pipe checking.  you need ' | ' for it to work
+// ie $program = execute_program('netstat', '-anp | grep LIST');
+// NOT $program = execute_program('netstat', '-anp|grep LIST');
+function execute_program ($program, $args = '')
+{
+  $buffer = '';
+  $program = find_program($program);
+
+  if (!$program) {
+    return;
+  } 
+  // see if we've gotten a |, if we have we need to do patch checking on the cmd
+  if ($args) {
+    $args_list = split(' ', $args);
+    for ($i = 0; $i < count($args_list); $i++) {
+      if ($args_list[$i] == '|') {
+        $cmd = $args_list[$i + 1];
+        $new_cmd = find_program($cmd);
+        $args = ereg_replace("\| $cmd", "| $new_cmd", $args);
+      } 
+    } 
+  } 
+  // we've finally got a good cmd line.. execute it
+  if ($fp = popen("$program $args", 'r')) {
+    while (!feof($fp)) {
+      $buffer .= fgets($fp, 4096);
+    } 
+    return trim($buffer);
+  } 
+} 
+// A helper function, when passed a number representing KB,
+// and optionally the number of decimal places required,
+// it returns a formated number string, with unit identifier.
+function format_bytesize ($kbytes, $dec_places = 2)
+{
+  global $text;
+  $spacer = '&nbsp;';
+  if ($kbytes > 1048576) {
+    $result = sprintf('%.' . $dec_places . 'f', $kbytes / 1048576);
+    $result .= $spacer . $text['gb'];
+  } elseif ($kbytes > 1024) {
+    $result = sprintf('%.' . $dec_places . 'f', $kbytes / 1024);
+    $result .= $spacer . $text['mb'];
+  } else {
+    $result = sprintf('%.' . $dec_places . 'f', $kbytes);
+    $result .= $spacer . $text['kb'];
+  } 
+  return $result;
+} 
+
+function get_gif_image_height($image)
+{ 
+  // gives the height of the given GIF image, by reading it's LSD (Logical Screen Discriptor)
+  // by Edwin Meester aka MillenniumV3
+  // Header: 3bytes 	Discription
+  // 3bytes 	Version
+  // LSD:		2bytes 	Logical Screen Width
+  // 2bytes 	Logical Screen Height
+  // 1bit 		Global Color Table Flag
+  // 3bits   Color Resolution
+  // 1bit		Sort Flag
+  // 3bits		Size of Global Color Table
+  // 1byte		Background Color Index
+  // 1byte		Pixel Aspect Ratio
+  // Open Image
+  $fp = fopen($image, 'rb'); 
+  // read Header + LSD
+  $header_and_lsd = fread($fp, 13);
+  fclose($fp); 
+  // calc Height from Logical Screen Height bytes
+  $result = ord($header_and_lsd{8}) + ord($header_and_lsd{9}) * 255;
+  return $result;
+} 
+
+// Check if a string exist in the global $hide_mounts.
+// Return true if this is the case.
+function hide_mount($mount) {
+	global $hide_mounts;
+	if (isset($hide_mounts) && is_array($hide_mounts) && in_array($mount, $hide_mounts)) {
+		return true;
+	}
+	else {
+		return false;
+	}
+}
+
+?>
diff --git a/www/include/options/sysInfos/includes/index.html b/www/include/options/sysInfos/includes/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/includes/lang/ar_utf8.php b/www/include/options/sysInfos/includes/lang/ar_utf8.php
new file mode 100644
index 0000000000000000000000000000000000000000..e554937e3699839e208fad08ee98a46d719fab3e
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/ar_utf8.php
@@ -0,0 +1,110 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: ar_utf8.php,v 1.11 2005/12/07 15:02:08 bigmichi1 Exp $
+//
+//Translated to arabic by: Nizar Abed  - nizar@srcget.com - Adios
+
+$charset                = 'utf-8';
+
+$text['title']          = 'معلومات عن ألنظام';
+
+$text['vitals']         = 'حيويه';
+$text['hostname']       = ' ألمحطه';
+$text['ip']             = 'IP عنوان أل';
+$text['kversion']       = 'إصدار رقم';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'مدة ألتشغيل';
+$text['users']          = 'مستخدمون';
+$text['loadavg']        = 'معدل ألتشغيل';
+
+$text['hardware']       = 'معلومات ألمعدات';
+$text['numcpu']         = 'وحدات ألمعالجه';
+$text['cpumodel']       = 'نوع';
+$text['cpuspeed']       = 'سرعه في';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = ' cache سعة ذاكرة';
+$text['bogomips']       = 'Bogomips سرعه في';
+
+$text['pci']            = 'PCI معدات ';
+$text['ide']            = 'IDE معدات';
+$text['scsi']           = 'SCSI معدات';
+$text['usb']            = 'USB معدات';
+
+$text['netusage']       = 'إستعمال ألشبكه';
+$text['device']         = 'معدات';
+$text['received']       = 'إستقبل حتى ألآن';
+$text['sent']           = 'أرسل';
+$text['errors']         = 'أخطاء';
+
+$text['connections']    = 'إتصالات شبكه منفذه';
+
+$text['memusage']       = 'ذاكره مستعمله';
+$text['phymem']         = 'ذاكره جسديه';
+$text['swap']           = 'Swap ذاكرة';
+
+$text['fs']             = 'أنظمة ملفات مخططه';
+$text['mount']          = 'مخطط';
+$text['partition']      = 'تقطيع';
+
+$text['percent']        = 'سعه بألنسبه ألمؤيه';
+$text['type']           = 'نوع';
+$text['free']           = 'حر';
+$text['used']           = 'مستعمل';
+$text['size']           = 'حجم';
+$text['totals']         = 'مجموع';
+
+$text['kb']             = ' كيلو بايت KB';
+$text['mb']             = 'ميغا بايت MB';
+$text['gb']             = 'جيغا بايت GB';
+
+$text['none']           = 'بدون';
+
+$text['capacity']       = 'سعه'; 
+
+$text['template']       = 'بنيه';
+$text['language']       = 'لغه';
+$text['submit']         = 'أدخل';
+$text['created']        = 'إصدر بواسطة';
+
+$text['days']           = 'أيام';
+$text['hours']          = 'ساعات';
+$text['minutes']        = 'دفائق';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+$text['locale']		= 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+?>
diff --git a/www/include/options/sysInfos/includes/lang/bg.php b/www/include/options/sysInfos/includes/lang/bg.php
new file mode 100644
index 0000000000000000000000000000000000000000..626c4ab9225aa8b25edb6a3a4289df6e91f5015f
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/bg.php
@@ -0,0 +1,108 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: bg.php,v 1.12 2005/12/07 15:02:10 bigmichi1 Exp $
+
+$charset                = 'cp-1251';
+
+$text['title']          = '�������� ����������';
+
+$text['vitals']         = '������� ����������';
+$text['hostname']       = '��� �� �����';
+$text['ip']             = 'IP �����';
+$text['kversion']       = '������ �� ������';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = '������ ��';
+$text['users']          = '�������� �����������';
+$text['loadavg']        = '������ �����������';
+
+$text['hardware']       = '���������� �� ��������';
+$text['numcpu']         = '���� ���������';
+$text['cpumodel']       = '����� �� ��������';
+$text['cpuspeed']       = '�������';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = '������ �� ���a ';
+$text['bogomips']       = 'Bogomips ������';
+
+$text['pci']            = 'PCI ����������';
+$text['ide']            = 'IDE ����������';
+$text['scsi']           = 'SCSI ����������';
+$text['usb']            = 'USB ����������';
+
+$text['netusage']       = '������� ����������';
+$text['device']         = '����������';
+$text['received']       = '��������';
+$text['sent']           = '���������';
+$text['errors']         = '������/���������';
+
+$text['connections']    = '����������� ������� ������';
+
+$text['memusage']       = '���������� �����';
+$text['phymem']         = '��������� �����';
+$text['swap']           = 'Swap �����';
+
+$text['fs']             = '������� �������';
+$text['mount']          = '�����';
+$text['partition']      = '���';
+
+$text['percent']        = '��������� ����������';
+$text['type']           = '���';
+$text['free']           = '��������';
+$text['used']           = '����������';
+$text['size']           = '��� ����';
+$text['totals']         = '������';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '����';
+
+$text['capacity']       = '���������';
+
+$text['template']       = '����';
+$text['language']       = '����';
+$text['submit']         = '�������';
+$text['created']        = '��������� �';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = '���';
+$text['hours']          = '����';
+$text['minutes']        = '������';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/big5.php b/www/include/options/sysInfos/includes/lang/big5.php
new file mode 100644
index 0000000000000000000000000000000000000000..822ec9274c19302b31c262949813c7e9b9e82108
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/big5.php
@@ -0,0 +1,107 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: big5.php,v 1.15 2005/12/07 15:02:11 bigmichi1 Exp $
+//
+$charset                = 'big5';
+$text['title']          = '�t�θ�T';
+
+$text['vitals']         = '�t�θ귽';
+$text['hostname']       = '�D���W��';
+$text['ip']             = '�D����~ IP';
+$text['kversion']       = '�֤ߪ���';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = '�w�}���ɶ�';
+$text['users']          = '�n�J�H��';
+$text['loadavg']        = '�t�έt��';
+
+$text['hardware']       = '�w��귽';
+$text['numcpu']         = '�B�⤸';
+$text['cpumodel']       = 'CPU����';
+$text['cpuspeed']       = '�u�@�W�v';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = '�֨��j�p';
+$text['bogomips']       = '�޿�B�⤸';
+
+$text['pci']            = 'PCI ����';
+$text['ide']            = 'IDE ����';
+$text['scsi']           = 'SCSI ����';
+$text['usb']            = 'USB ����';
+
+$text['netusage']       = '�����ʥ]';
+$text['device']         = '����';
+$text['received']       = '����';
+$text['sent']           = '�ǰe';
+$text['errors']         = '���~/��';
+
+$text['connections']    = 'Established Network Connections';
+
+$text['memusage']       = '�O����귽';
+$text['phymem']         = '����O����';
+$text['swap']           = '�����O����(�Ϻиm��)';
+
+$text['fs']             = '�w���J���ɮרt��';
+$text['mount']          = '���J';
+$text['partition']      = '�ϰ�';
+
+$text['percent']        = '�ϥΦʤ���';
+$text['type']           = '�榡';
+$text['free']           = '�žl';
+$text['used']           = '�w��';
+$text['size']           = '�j�p';
+$text['totals']         = '�X�p';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '�L';
+
+$text['capacity']       = '�e�q';
+
+$text['template']       = '�˦�';
+$text['language']       = '�y��';
+$text['submit']         = '�T�w';
+$text['created']        = '���ͥ�';
+$text['locale']         = 'zh_TW.Big5';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = '��';
+$text['hours']          = '�p��';
+$text['minutes']        = '����';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/br.php b/www/include/options/sysInfos/includes/lang/br.php
new file mode 100644
index 0000000000000000000000000000000000000000..442b6248981c9019be8c1de3b39c687f83a76393
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/br.php
@@ -0,0 +1,105 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: br.php,v 1.14 2005/12/07 15:02:11 bigmichi1 Exp $
+// Translated by �lvaro Reguly - alvaro at reguly dot net
+//
+$text['title']          = 'Informa��es do Sistema';
+
+$text['vitals']         = 'Sistema';
+$text['hostname']       = 'Nome Can�nico';
+$text['ip']             = 'N�meros IP';
+$text['kversion']       = 'Vers�o do Kernel';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Usu�rios Conectados';
+$text['loadavg']        = 'Carga do Sistema';
+
+$text['hardware']       = 'Informa��es do Hardware';
+$text['numcpu']         = 'Processadores';
+$text['cpumodel']       = 'Modelo';
+$text['cpuspeed']       = 'CPU Speed';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Tamanho Cache';
+$text['bogomips']       = 'Bogomips';
+
+$text['pci']            = 'Dispositivos PCI';
+$text['ide']            = 'Dispositivos IDE';
+$text['scsi']           = 'Dispositivos SCSI';
+$text['usb']            = 'Dispositivos USB';
+
+$text['netusage']       = 'Utiliza��o da Rede';
+$text['device']         = 'Dispositivo';
+$text['received']       = 'Recebidos';
+$text['sent']           = 'Enviados';
+$text['errors']         = 'Erros/Drop';
+
+$text['memusage']       = 'Utiliza��o da Mem�ria';
+$text['phymem']         = 'Mem�ria F�sica';
+$text['swap']           = 'Swap';
+
+$text['fs']             = 'Sistemas de Arquivo Montados';
+$text['mount']          = 'Mount';
+$text['partition']      = 'Parti��o';
+
+$text['percent']        = 'Porcentual da Capacidade';
+$text['type']           = 'Tipo';
+$text['free']           = 'Livres';
+$text['used']           = 'Utilizados';
+$text['size']           = 'Tamanho';
+$text['totals']         = 'Totais';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'nenhum';
+
+$text['capacity']       = 'Capacidade';
+
+$text['template']       = 'Molde';
+$text['language']       = 'L�ngua';
+$text['submit']         = 'Enviar';
+$text['created']        = 'Criado por';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dias';
+$text['hours']          = 'horas';
+$text['minutes']        = 'minutos';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/ca.php b/www/include/options/sysInfos/includes/lang/ca.php
new file mode 100644
index 0000000000000000000000000000000000000000..91cc92eb01152c503e8e925225a57d76c2068c45
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/ca.php
@@ -0,0 +1,107 @@
+<?php
+//
+// phpSysInfo -A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// $Id: ca.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+//
+// Traductor: Miquel Guillamet Montalat
+// E-mail: mikelet15@netscape.com Web: http://gitx.dhs.org
+//
+$text['title']       = 'Informaci� del Sistema';
+
+$text['vitals']      = 'Vital';
+$text['hostname']    = 'Nom del Sistema';
+$text['ip']          = 'Direcci� IP';
+$text['kversion']    = 'Versi� del Kernel';
+$text['dversion']       = 'Distro Name';
+$text['uptime']      = 'Uptime';
+$text['users']       = 'Usuaris actuals';
+$text['loadavg']     = 'Carrega del Servidor';
+
+$text['hardware']    = 'Informaci� del Hardware';
+$text['numcpu']      = 'Processadors';
+$text['cpumodel']    = 'Model';
+$text['cpuspeed']    = 'Frequ�ncia en MHz';
+$text['busspeed']    = 'BUS Speed';
+$text['cache']       = 'RAM';
+$text['bogomips']    = 'Bogomips';
+
+$text['pci']         = 'Dispositius PCI';
+$text['ide']         = 'Dispositius IDE';
+$text['scsi']        = 'Dispositius SCSI';
+$text['usb']         = 'Dispisitius USB';
+
+$text['netusage']    = 'Utilitzaci� de la XARXA';
+$text['device']      = 'Dispositiu';
+$text['received']    = 'Rebut';
+$text['sent']        = 'Enviat';
+$text['errors']      = 'Errors/Perduts';
+
+$text['memusage']    = 'Utilitzaci� de la RAM';
+$text['phymem']      = 'Memoria Fisica';
+$text['swap']        = 'Swap';
+
+$text['fs']          = 'Particions Montades';
+$text['mount']       = 'Montat a';
+$text['partition']   = 'Partici�';
+
+$text['percent']     = 'Capacitat';
+$text['type']        = 'Tipus';
+$text['free']        = 'Lliure';
+$text['used']        = 'Usat';
+$text['size']        = 'Tamany';
+$text['totals']      = 'Totals';
+
+$text['kb']          = 'KB';
+$text['mg']          = 'MB';
+$text['gb']          = 'GB';
+
+$text['none']        = 'ningun';
+
+$text['capacity']    = 'Capacitat';
+
+$text['template']    = 'Themes';
+$text['language']    = 'Llenguatge';
+$text['submit']      = 'Enviar';
+$text['created']     = 'Creat per';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']        = 'dies';
+$text['hours']       = 'hores';
+$text['minutes']     = 'minuts';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/cn.php b/www/include/options/sysInfos/includes/lang/cn.php
new file mode 100644
index 0000000000000000000000000000000000000000..3cb58d94d7ac77be1b1733fd554e60346e8bf6f9
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/cn.php
@@ -0,0 +1,105 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: cn.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$charset                = 'gb2312';
+
+$text['title']          = 'ϵͳ��Ϣ';
+$text['vitals']         = 'ϵͳ��Ҫ��Ϣ';
+$text['hostname']       = '��������';
+$text['ip']             = '��������IP';
+$text['kversion']       = '�ں˰汾';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = '����ʱ��';
+$text['users']          = '����ʹ����';
+$text['loadavg']        = 'ƽ������';
+
+$text['hardware']       = 'Ӳ����Ϣ';
+$text['numcpu']         = '����������';
+$text['cpumodel']       = 'CPU�ͺ�';
+$text['cpuspeed']       = 'оƬ�ٶ�';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cache��С';
+$text['bogomips']       = 'ϵͳBogomips';
+
+$text['pci']            = 'PCI�豸';
+$text['ide']            = 'IDE�豸';
+$text['scsi']           = 'SCSI�豸';
+$text['usb']            = 'USB�豸';
+
+$text['netusage']       = '���縺��';
+$text['device']         = '�����豸';
+$text['received']       = '����';
+$text['sent']           = '�ͳ�';
+$text['errors']         = '����/�ж�';
+
+$text['memusage']       = '�ڴ�ʹ����';
+$text['phymem']         = '�����ڴ�';
+$text['swap']           = '�����ڴ�(��������)';
+
+$text['fs']             = '�ѹ��ط���';
+$text['mount']          = '����·��';
+$text['partition']      = '��������';
+
+$text['percent']        = 'ʹ�����ٷֱ�';
+$text['type']           = '�ļ�ϵͳ����';
+$text['free']           = 'ʣ��ռ�';
+$text['used']           = '���ÿռ�';
+$text['size']           = '������';
+$text['totals']         = '��ʹ����';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '��';
+
+$text['capacity']       = '����';
+
+$text['template']       = '����';
+$text['language']       = '����';
+$text['submit']         = 'ȷ��';
+$text['created']        = '���� By';
+$text['locale']         = 'zh_CN.eucCN';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = '��';
+$text['hours']          = 'Сʱ';
+$text['minutes']        = '����';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/cs.php b/www/include/options/sysInfos/includes/lang/cs.php
new file mode 100644
index 0000000000000000000000000000000000000000..aff560bf8e2ed9af127b1b1d31dcf743d331f7ef
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/cs.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: cs.php,v 1.13 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$charset                = 'iso-8859-2';
+
+$text['title']          = 'Informace o syst�mu';
+
+$text['vitals']         = 'Z�kladn� informace';
+$text['hostname']       = 'Jm�no po��ta�e';
+$text['ip']             = 'IP adresa';
+$text['kversion']       = 'Verze j�dra';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'P�ihl�en�ch u�ivatel�';
+$text['loadavg']        = 'Pr�m�rn� z�t�';
+
+$text['hardware']       = 'Hardwarov� informace';
+$text['numcpu']         = 'Procesory';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'Frekvence';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Velikost cache';
+$text['bogomips']       = 'Bogomipsy';
+
+$text['pci']            = 'PCI za��zen�';
+$text['ide']            = 'IDE za��zen�';
+$text['scsi']           = 'SCSI za��zen�';
+$text['usb']            = 'USB za��zen�';
+
+$text['netusage']       = 'Pou��v�n� s�t�';
+$text['device']         = 'Za��zen�';
+$text['received']       = 'P�ijato';
+$text['sent']           = 'Odesl�no';
+$text['errors']         = 'Chyby/Vypu�t�no';
+
+$text['memusage']       = 'Obsazen� pam�ti';
+$text['phymem']         = 'Fyzick� pam�';
+$text['swap']           = 'Swap';
+
+$text['fs']             = 'P�ipojen� souborov� syst�my';
+$text['mount']          = 'Adres��';
+$text['partition']      = 'Odd�l';
+
+$text['percent']        = 'Obsazeno';
+$text['type']           = 'Typ';
+$text['free']           = 'Volno';
+$text['used']           = 'Pou�ito';
+$text['size']           = 'Velikost';
+$text['totals']         = 'Celkem';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '��dn�';
+
+$text['capacity']       = 'Kapacita';
+
+$text['template']       = '�ablona';
+$text['language']       = 'Jazyk';
+$text['submit']         = 'Odeslat';
+$text['created']        = 'Vytvo�eno pomoc�';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dn�';
+$text['hours']          = 'hodin';
+$text['minutes']        = 'minut';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/ct.php b/www/include/options/sysInfos/includes/lang/ct.php
new file mode 100644
index 0000000000000000000000000000000000000000..0ed2f791c3ec0b76501b84e1d9d7b19bc979674d
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/ct.php
@@ -0,0 +1,103 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: ct.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Informaci&oacute; del Sistema';
+
+$text['vitals']         = 'Vitals del Sistema';
+$text['hostname']       = 'Nom Can�nic';
+$text['ip']             = 'Adre�a IP';
+$text['kversion']       = 'Versi&oacute; del Kernel';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Temps Aixecat';
+$text['users']          = 'Usuaris Actuals';
+$text['loadavg']        = 'C�rrega Promitg';
+
+$text['hardware']       = 'Informaci&oacute; del Maquinari';
+$text['numcpu']         = 'Processadors';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'Xip MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Tamany Mem�ria Cau';
+$text['bogomips']       = 'Bogomips';
+
+$text['pci']            = 'Dispositius PCI';
+$text['ide']            = 'Dispositius IDE';
+$text['scsi']           = 'Dispositius SCSI';
+$text['usb']            = 'Dispositius USB';
+
+$text['netusage']       = '�s de la Xarxa';
+$text['device']         = 'Dispositiu';
+$text['received']       = 'Rebuts';
+$text['sent']           = 'Enviats';
+$text['errors']         = 'Errors/Perduts';
+
+$text['memusage']       = '�s de la Mem�ria';
+$text['phymem']         = 'Mem�ria F&iacute;sica';
+$text['swap']           = 'Disc d\'Swap';
+
+$text['fs']             = 'Sistemes d\'Arxius Muntats';
+$text['mount']          = 'Muntat';
+$text['partition']      = 'Partici�';
+$text['percent']        = 'Percentatge de Capacitat';
+$text['type']           = 'Tipus';
+$text['free']           = 'Lliure';
+$text['used']           = 'Emprat';
+$text['size']           = 'Tamany';
+$text['totals']         = 'Totals';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'cap';
+
+$text['capacity']       = 'Capacitat';
+  
+$text['template']       = 'Plantilla';
+$text['language']       = 'Lleng�a';
+$text['submit']         = 'Enviar';
+$text['created']        = 'Creat per';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dies';
+$text['hours']          = 'hores';
+$text['minutes']        = 'minuts';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/da.php b/www/include/options/sysInfos/includes/lang/da.php
new file mode 100644
index 0000000000000000000000000000000000000000..01fc43aaa5eaed21eb047c2e644382daeab95be4
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/da.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: da.php,v 1.16 2005/12/07 15:02:11 bigmichi1 Exp $
+
+# Translated by Jonas Koch Bentzen (understroem.dk).
+
+$text['title']          = 'Systeminformation';
+
+$text['vitals']         = 'Systemenheder';
+$text['hostname']       = 'Konisk v�rtsnavn';
+$text['ip']             = 'IP-adresse, der lyttes p�';
+$text['kversion']       = 'Kerne-version';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Oppetid';
+$text['users']          = 'Antal brugere logget ind lige nu';
+$text['loadavg']        = 'Ressourceforbrug - gennemsnit';
+
+$text['hardware']       = 'Hardwareinformation';
+$text['numcpu']         = 'Processorer';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'CPU Speed';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cachest�rrelse';
+$text['bogomips']       = 'Bogomips';
+
+$text['pci']            = 'PCI-enheder';
+$text['ide']            = 'IDE-enheder';
+$text['scsi']           = 'SCSI-enheder';
+$text['usb']            = 'USB-enheder';
+
+$text['netusage']       = 'Netv�rkstrafik';
+$text['device']         = 'Enhed';
+$text['received']       = 'Modtaget';
+$text['sent']           = 'Afsendt';
+$text['errors']         = 'Mislykket/tabt';
+
+$text['memusage']       = 'Hukommelsesforbrug';
+$text['phymem']         = 'Fysisk hukommelse';
+$text['swap']           = 'Swap';
+
+$text['fs']             = 'Monterede filsystemer';
+$text['mount']          = 'Monteret p�';
+$text['partition']      = 'Partition';
+
+$text['percent']        = 'Procent af kapaciteten';
+$text['type']           = 'Type';
+$text['free']           = 'Ledig';
+$text['used']           = 'Brugt';
+$text['size']           = 'St�rrelse';
+$text['totals']         = 'I alt';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'ingen';
+
+$text['capacity']       = 'Kapacitet';
+  
+$text['template']       = 'Skabelon';
+$text['language']       = 'Sprog';
+$text['submit']         = 'Okay';
+$text['created']        = 'Lavet af';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dage';
+$text['hours']          = 'timer';
+$text['minutes']        = 'minutter';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/de.php b/www/include/options/sysInfos/includes/lang/de.php
new file mode 100644
index 0000000000000000000000000000000000000000..0e17fcab36648f5d930e287609c1256b5c869253
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/de.php
@@ -0,0 +1,104 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: de.php,v 1.15 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'System Information';
+
+$text['vitals']         = 'System &Uuml;bersicht';
+$text['hostname']       = 'Zugewiesener Hostname';
+$text['ip']             = '&Uuml;berwachte IP';
+$text['kversion']       = 'Kernel Version';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Betriebszeit';
+$text['users']          = 'Eingeloggte Benutzer';
+$text['loadavg']        = 'Auslastung';
+
+$text['hardware']       = 'Hardware &Uuml;bersicht';
+$text['numcpu']         = 'Prozessoren';
+$text['cpumodel']       = 'Modell';
+$text['cpuspeed']       = 'Taktfrequenz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cachegr&ouml;&szlig;e';
+$text['bogomips']       = 'System Bogomips';
+
+$text['pci']            = 'PCI Ger&auml;te';
+$text['ide']            = 'IDE Ger&auml;te';
+$text['scsi']           = 'SCSI Ger&auml;te';
+$text['usb']            = 'USB Ger&auml;te';
+
+$text['netusage']       = 'Netzwerk-Auslastung';
+$text['device']         = 'Schnittstelle';
+$text['received']       = 'Empfangen';
+$text['sent']           = 'Gesendet';
+$text['errors']         = 'Fehler/Verworfen';
+
+$text['memusage']       = 'Speicher-Auslastung';
+$text['phymem']         = 'Physikalischer Speicher';
+$text['swap']           = 'Auslagerungsdatei';
+
+$text['fs']             = 'Angemeldete Filesysteme';
+$text['mount']          = 'Mount';
+$text['partition']      = 'Partition';
+
+$text['percent']        = 'Prozentuale Auslastung';
+$text['type']           = 'Typ';
+$text['free']           = 'Frei';
+$text['used']           = 'Benutzt';
+$text['size']           = 'Gr&ouml;&szlig;e';
+$text['totals']         = 'Insgesamt';
+
+$text['kb']             = 'KiB';
+$text['mb']             = 'MiB';
+$text['gb']             = 'GiB';
+
+$text['none']           = 'keine';
+
+$text['capacity']       = 'Kapazit�t';
+  
+$text['template']       = 'Vorlage';
+$text['language']       = 'Sprache';
+$text['submit']         = '�ndern';
+$text['created']        = 'Erstellt von';
+$text['locale']         = 'de_DE';
+$text['gen_time']       = 'am %d.%b %Y um %H:%M';
+
+$text['days']           = 'Tage';
+$text['hours']          = 'Stunden';
+$text['minutes']        = 'Minuten';
+  
+$text['temperature']    = 'Temperatur';
+$text['voltage']        = 'Spannungen';
+$text['fans']           = 'L&uuml;fter';
+$text['s_value']        = 'Wert';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Grenzwert';
+$text['s_label']        = 'Bezeichnung';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/en.php b/www/include/options/sysInfos/includes/lang/en.php
new file mode 100644
index 0000000000000000000000000000000000000000..369a2399e25f5c8746e804d91a4f4327d28e35e1
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/en.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: en.php,v 1.17 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'System Information';
+
+$text['vitals']         = 'System Vital';
+$text['hostname']       = 'Canonical Hostname';
+$text['ip']             = 'Listening IP';
+$text['kversion']       = 'Kernel Version';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Current Users';
+$text['loadavg']        = 'Load Averages';
+
+$text['hardware']       = 'Hardware Information';
+$text['numcpu']         = 'Processors';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'CPU Speed';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cache Size';
+$text['bogomips']       = 'System Bogomips';
+
+$text['pci']            = 'PCI Devices';
+$text['ide']            = 'IDE Devices';
+$text['scsi']           = 'SCSI Devices';
+$text['usb']            = 'USB Devices';
+
+$text['netusage']       = 'Network Usage';
+$text['device']         = 'Device';
+$text['received']       = 'Received';
+$text['sent']           = 'Sent';
+$text['errors']         = 'Err/Drop';
+
+$text['connections']    = 'Established Network Connections';
+
+$text['memusage']       = 'Memory Usage';
+$text['phymem']         = 'Physical Memory';
+$text['swap']           = 'Disk Swap';
+
+$text['fs']             = 'Mounted Filesystems';
+$text['mount']          = 'Mount';
+$text['partition']      = 'Partition';
+
+$text['percent']        = 'Percent Capacity';
+$text['type']           = 'Type';
+$text['free']           = 'Free';
+$text['used']           = 'Used';
+$text['size']           = 'Size';
+$text['totals']         = 'Totals';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'none';
+
+$text['capacity']       = 'Capacity'; 
+
+$text['template']       = 'Template';
+$text['language']       = 'Language';
+$text['submit']         = 'Submit';
+$text['created']        = 'Created by';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'days';
+$text['hours']          = 'hours';
+$text['minutes']        = 'minutes';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/es.php b/www/include/options/sysInfos/includes/lang/es.php
new file mode 100644
index 0000000000000000000000000000000000000000..d8a1ebaa24e4fa333a65b63f1b7f1b6b76c99937
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/es.php
@@ -0,0 +1,104 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: es.php,v 1.15 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Informaci&oacute;n Del Sistema';
+
+$text['vitals']         = 'Vitales';
+$text['hostname']       = 'Nombre Del Sistema';
+$text['ip']             = 'Direcci&oacute;n IP';
+$text['kversion']       = 'Versi&oacute;n Del N&uacute;cleo';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Usuarios Actuales';
+$text['loadavg']        = 'Promedio De Uso';
+
+$text['hardware']       = 'Informaci&oacute;n Del Hardware';
+$text['numcpu']         = 'Procesadores';
+$text['cpumodel']       = 'Modelo';
+$text['cpuspeed']       = 'Frecuencia';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Tama&ntilde;o Del Cach&eacute;';
+$text['bogomips']       = 'Bogomips';
+
+$text['pci']            = 'Dispositivos PCI';
+$text['ide']            = 'Dispositivos IDE';
+$text['scsi']           = 'Dispositivos SCSI';
+$text['usb']            = 'Dispositivos USB';
+
+$text['netusage']       = 'Utilizaci&oacute;n De La Red';
+$text['device']         = 'Dispositivo';
+$text['received']       = 'Recibidos';
+$text['sent']           = 'Enviados';
+$text['errors']         = 'Errores/Perdidos';
+
+$text['memusage']       = 'Utilizaci&oacute;n De La Memoria';
+$text['phymem']         = 'Memoria F&iacute;sica';
+$text['swap']           = 'Memoria De Intercambio';
+
+$text['fs']             = 'Sistemas De Archivos';
+$text['mount']          = 'Punto De Montaje';
+$text['partition']      = 'Partici&oacute;n';
+
+$text['percent']        = 'Porcentaje De Uso';
+$text['type']           = 'Tipo';
+$text['free']           = 'Libre';
+$text['used']           = 'Usado';
+$text['size']           = 'Tama&ntilde;o';
+$text['totals']         = 'Totales';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'Ninguno';
+
+$text['capacity']       = 'Capacidad';
+
+$text['template']       = 'Plantilla';
+$text['language']       = 'Idioma';
+$text['submit']         = 'Enviar';
+$text['created']        = 'Creado por';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'd&iacute;as';
+$text['hours']          = 'horas';
+$text['minutes']        = 'minutos';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/et.php b/www/include/options/sysInfos/includes/lang/et.php
new file mode 100644
index 0000000000000000000000000000000000000000..cfa141b2b0ee37d04aafecf730cb0c2e286025be
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/et.php
@@ -0,0 +1,104 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: et.php,v 1.15 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'S&uuml;steemi Informatsioon';
+
+$text['vitals']         = 'System Vital';
+$text['hostname']       = 'Kanooniline masinanimi';
+$text['ip']             = 'Vastav IP';
+$text['kversion']       = 'Kernel Versioon';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Masin elus juba';
+$text['users']          = 'Hetkel kasutajaid';
+$text['loadavg']        = 'Koormuse keskmised';
+
+$text['hardware']       = 'Riistvara Informatsioon';
+$text['numcpu']         = 'Protsessoreid';
+$text['cpumodel']       = 'Mudel';
+$text['cpuspeed']       = 'Taktsagedus MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Vahem&auml;lu suurus';
+$text['bogomips']       = 'S&uuml;steemi Bogomips';
+
+$text['pci']            = 'PCI Seadmed';
+$text['ide']            = 'IDE Seadmed';
+$text['scsi']           = 'SCSI Seadmed';
+$text['usb']            = 'USB Seadmed';
+
+$text['netusage']       = 'V&otilde;rguteenuse kasutamine';
+$text['device']         = 'Seade';
+$text['received']       = 'Saadud';
+$text['sent']           = 'Saadetud';
+$text['errors']         = 'Vigu/H&uuml;ljatud';
+
+$text['memusage']       = 'M&auml;lu kasutamine';
+$text['phymem']         = 'F&uuml;&uuml;siline m&auml;lu';
+$text['swap']           = 'Saalem&auml;lu kettal';
+
+$text['fs']             = '&Uuml;hendatud failis&uuml;steemid';
+$text['mount']          = '&Uuml;hendus';
+$text['partition']      = 'Partitsioon';
+
+$text['percent']        = 'Protsendiline h&otilde;ivatus';
+$text['type']           = 'T&uuml;&uuml;p';
+$text['free']           = 'Vaba';
+$text['used']           = 'Kasutusel';
+$text['size']           = 'Suurus';
+$text['totals']         = 'Kokku';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'puudub';
+
+$text['capacity']       = 'H&otilde;ivatus';
+  
+$text['template']       = 'Template';
+$text['language']       = 'Keel';
+$text['submit']         = 'Kehtesta';
+$text['created']        = 'Looja: ';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'p&auml;eva';
+$text['hours']          = 'tundi';
+$text['minutes']        = 'minutit';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/eu.php b/www/include/options/sysInfos/includes/lang/eu.php
new file mode 100644
index 0000000000000000000000000000000000000000..61215a30226591a45716dcced96688c958d741af
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/eu.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: eu.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Sistemaren Informazioa';
+
+$text['vitals']         = 'Sistema';
+$text['hostname']       = 'Zerbitzariaren izen Kanonikoa';
+$text['ip']             = 'Entzuten duen IP-a';
+$text['kversion']       = 'Kernel Bertsioa';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Piztutako denbora';
+$text['users']          = 'Uneko Erabiltzaileak';
+$text['loadavg']        = 'Karga ertainak';
+
+$text['hardware']       = 'Hardwarezko Informazioa';
+$text['numcpu']         = 'Prozasatzailea';
+$text['cpumodel']       = 'Modeloa';
+$text['cpuspeed']       = 'Txip MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cache tamaina';
+$text['bogomips']       = 'Sistemare Bogomips-ak';
+
+$text['pci']            = 'PCI Dispositiboak';
+$text['ide']            = 'IDE Dispositiboak';
+$text['scsi']           = 'SCSI Dispositiboak';
+$text['usb']            = 'USB Dispositiboak';
+
+$text['netusage']       = 'Sarearen Erabilera';
+$text['device']         = 'Dispositiboa';
+$text['received']       = 'Jasotakoa';
+$text['sent']           = 'Bidalitakoa';
+$text['errors']         = 'Err/Huts';
+
+$text['connections']    = 'Established Network Connections';
+
+$text['memusage']       = 'Memoriaren Erabilpena';
+$text['phymem']         = 'Memoria Fisikoa';
+$text['swap']           = 'Disko Memoria';
+
+$text['fs']             = 'Montatutako Fitxategi-sistemak';
+$text['mount']          = 'Non montatuta';
+$text['partition']      = 'Partizioa';
+
+$text['percent']        = 'Ehunekoa';
+$text['type']           = 'Mota';
+$text['free']           = 'Aske';
+$text['used']           = 'Erabilita';
+$text['size']           = 'Tamaina';
+$text['totals']         = 'Guztira';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'ezer ez';
+
+$text['capacity']       = 'Kapazitatea'; 
+
+$text['template']       = 'Txantiloia';
+$text['language']       = 'Langoaia';
+$text['submit']         = 'Bidali';
+$text['created']        = 'Sortzailea: ';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'egun';
+$text['hours']          = 'ordu';
+$text['minutes']        = 'minutu';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/fi.php b/www/include/options/sysInfos/includes/lang/fi.php
new file mode 100644
index 0000000000000000000000000000000000000000..01e009ec283619657883e7b213d72b03da4cd205
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/fi.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: fi.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+
+// Finnish language file by Jani 'Japala' Ponkko
+
+$text['title']          = 'Tietoa j&auml;rjestelm&auml;st&auml;';
+
+$text['vitals']         = 'Perustiedot';
+$text['hostname']       = 'Kanoninen nimi';
+$text['ip']             = 'K&auml;ytett&auml;v&auml; IP';
+$text['kversion']       = 'Kernelin versio';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Toiminta-aika';
+$text['users']          = 'K&auml;ytt&auml;ji&auml;';
+$text['loadavg']        = 'Keskikuormat';
+
+$text['hardware']       = 'Laitteisto';
+$text['numcpu']         = 'Prosessoreita';
+$text['cpumodel']       = 'Malli';
+$text['cpuspeed']       = 'Piirin MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'V&auml;limuistin koko';
+$text['bogomips']       = 'J&auml;rjestelm&auml;n Bogomipsit';
+
+$text['pci']            = 'PCI Laitteet';
+$text['ide']            = 'IDE Laitteet';
+$text['scsi']           = 'SCSI Laitteet';
+$text['usb']            = 'USB Laitteet';
+
+$text['netusage']       = 'Verkon k&auml;ytt&ouml;';
+$text['device']         = 'Laite';
+$text['received']       = 'Vastaanotettu';
+$text['sent']           = 'L&auml;hetetty';
+$text['errors']         = 'Virheet/Pudotetut';
+
+$text['memusage']       = 'Muistin kuormitus';
+$text['phymem']         = 'Fyysinen muisti';
+$text['swap']           = 'Virtuaalimuisti';
+
+$text['fs']             = 'Liitetyt tiedostoj&auml;rjestelm&auml;t';
+$text['mount']          = 'Liitoskohta';
+$text['partition']      = 'Osio';
+
+$text['percent']        = 'Prosenttia kapasiteetista';
+$text['type']           = 'Tyyppi';
+$text['free']           = 'Vapaana';
+$text['used']           = 'K&auml;yt&ouml;ss&auml;';
+$text['size']           = 'Koko';
+$text['totals']         = 'Yhteens&auml;';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'Ei yht&auml;&auml;n';
+
+$text['capacity']       = 'Kapasiteetti'; 
+
+$text['template']       = 'Malli';
+$text['language']       = 'Kieli';
+$text['submit']         = 'Valitse';
+$text['created']        = 'Luonut';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'p&auml;iv&auml;&auml;';
+$text['hours']          = 'tuntia';
+$text['minutes']        = 'minuuttia';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/fr.php b/www/include/options/sysInfos/includes/lang/fr.php
new file mode 100644
index 0000000000000000000000000000000000000000..635579be55de782ab31e39c8b3aca5bd0092e73f
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/fr.php
@@ -0,0 +1,102 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: fr.php,v 1.19 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Informations Syst&egrave;me ';
+
+$text['vitals']         = 'Syst&egrave;me';
+$text['hostname']       = 'Nom d\'h&ocirc;te cannonique';
+$text['ip']             = 'IP';
+$text['kversion']       = 'Version du noyau';
+$text['dversion']       = 'Distribution';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Utilisateurs';
+$text['loadavg']        = 'Charge syst&egrave;me';
+
+$text['hardware']       = 'Informations Mat&eacute;riel';
+$text['numcpu']         = 'Processeurs';
+$text['cpumodel']       = 'Mod&egrave;le';
+$text['mhz']            = 'Fr&eacute;quence';
+$text['cache']          = 'Taille Cache';
+$text['bogomips']       = 'Bogomips';
+$text['usb']            = 'P&eacute;riph. USB';
+$text['pci']            = 'P&eacute;riph. PCI';
+$text['ide']            = 'P&eacute;riph. IDE';
+$text['scsi']           = 'P&eacute;riph. SCSI';
+
+$text['netusage']       = 'R&eacute;seau';
+$text['device']         = 'P&eacute;riph&eacute;rique';
+$text['received']       = 'R&eacute;ception';
+$text['sent']           = 'Envoi';
+$text['errors']         = 'Err/Drop';
+
+$text['memusage']       = 'Utilisation m&eacute;moire';
+$text['phymem']         = 'M&eacute;moire Physique';
+$text['swap']           = 'Swap disque';
+
+$text['fs']             = 'Syst&egrave;mes de fichiers mont&eacute;s';
+$text['mount']          = 'Point';
+$text['partition']      = 'Partition';
+
+$text['percent']        = 'Utilisation';
+$text['type']           = 'Type';
+$text['free']           = 'Libre';
+$text['used']           = 'Occup&eacute;';
+$text['size']           = 'Taille';
+$text['totals']         = 'Totaux';
+
+$text['kb']             = 'Ko';
+$text['mb']             = 'Mo';
+$text['gb']             = 'Go';
+
+$text['none']           = 'aucun';
+
+$text['capacity']       = 'Capacit&eacute;';
+  
+$text['template']       = 'Mod&egrave;le ';
+$text['language']       = 'Langue ';
+$text['submit']         = 'Valider';
+$text['created']        = 'Cr&eacute;&eacute; par';
+$text['locale']         = 'fr_FR';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'jours';
+$text['hours']          = 'heures';
+$text['minutes']        = 'minutes';
+
+$text['temperature']    = 'Temp&eacute;rature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Ventilateurs';
+$text['s_value']        = 'valeur';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hyst&eacute;r&eacute;sis';
+$text['s_limit']        = 'Limite';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/gr.php b/www/include/options/sysInfos/includes/lang/gr.php
new file mode 100644
index 0000000000000000000000000000000000000000..11979c80c039ebbf9a8554157020b09c2ec6b5dd
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/gr.php
@@ -0,0 +1,108 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: gr.php,v 1.11 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$charset                = "iso-8895-7";
+
+$text['title']          = '����������� ����������';
+
+$text['vitals']         = '�������������� ����������';
+$text['hostname']       = '����� ����������';
+$text['ip']             = '��������� ��';
+$text['kversion']       = '������ ������';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = '������ ����������� ����������';
+$text['users']          = '���������� �������';
+$text['loadavg']        = 'Load Average';
+
+$text['hardware']       = '����������� ������';
+$text['numcpu']         = '������������';
+$text['cpumodel']       = '�������';
+$text['cpuspeed']       = '�������� MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = '������� ������ Cache';
+$text['bogomips']       = '������������� ����� �� Bogomips';
+
+$text['pci']            = '�������� PCI';
+$text['ide']            = '�������� IDE';
+$text['scsi']           = '�������� SCSI';
+$text['usb']            = '�������� USB';
+
+$text['netusage']       = '����� �������';
+$text['device']         = '�������';
+$text['received']       = '�����������';
+$text['sent']           = '�����������';
+$text['errors']         = '��������';
+
+$text['connections']    = '������� �������� �������';
+
+$text['memusage']       = '����� ������';
+$text['phymem']         = '����� Physical';
+$text['swap']           = '������ Swap';
+
+$text['fs']             = '������������ ��������� �������';
+$text['mount']          = '����������';
+$text['partition']      = '���������';
+
+$text['percent']        = '������������ %';
+$text['type']           = '�����';
+$text['free']           = '��������';
+$text['used']           = '�� �����';
+$text['size']           = '�������';
+$text['totals']         = '��������';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '-';
+
+$text['capacity']       = '������������'; 
+
+$text['template']       = '����';
+$text['language']       = '������';
+$text['submit']         = '�������';
+$text['created']        = '������������� ��� ��';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = '�����';
+$text['hours']          = '����';
+$text['minutes']        = '�����';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/he.php b/www/include/options/sysInfos/includes/lang/he.php
new file mode 100644
index 0000000000000000000000000000000000000000..2f6c19dda729e18aa7fe837b7b24a816d0c3874b
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/he.php
@@ -0,0 +1,107 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: he.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+$charset                = 'windows-1255';
+$text_dir               = 'rtl';
+$text['title']          = '���� �� ������';
+
+$text['vitals']         = '������� �����';
+$text['hostname']       = '�� ����';
+$text['ip']             = '����� IP';
+$text['kversion']       = '���� ����';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = '��� ������� �����';
+$text['users']          = '������ �������';
+$text['loadavg']        = '����� ������';
+
+$text['hardware']       = '���� �����';
+$text['numcpu']         = '������';
+$text['cpumodel']       = '���';
+$text['cpuspeed']       = '������ �MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = '���� ����� �����';
+$text['bogomips']       = '������ �bogomips';
+
+$text['pci']            = '����� PCI';
+$text['ide']            = '����� IDE';
+$text['scsi']           = '����� SCSI';
+$text['usb']            = '����� USB';
+
+$text['netusage']       = '���';
+$text['device']         = '����';
+$text['received']       = '����';
+$text['sent']           = '���';
+$text['errors']         = '�����/������';
+
+$text['connections']    = '����� ������ ������';
+
+$text['memusage']       = '������ �����';
+$text['phymem']         = '����� ����';
+$text['swap']           = '����� swap';
+
+$text['fs']             = '������ ����� �������';
+$text['mount']          = '�����';
+$text['partition']      = '�����';
+
+$text['percent']        = '����� �������';
+$text['type']           = '���';
+$text['free']           = '�����';
+$text['used']           = '������';
+$text['size']           = '����';
+$text['totals']         = '��"�';
+
+$text['kb']             = '���� ����';
+$text['mb']             = '���';
+$text['gb']             = '����';
+
+$text['none']           = '���';
+
+$text['capacity']       = '�����'; 
+
+$text['template']       = '�����';
+$text['language']       = '���';
+$text['submit']         = '���';
+$text['created']        = '���� �"�';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = '����';
+$text['hours']          = '����';
+$text['minutes']        = '����';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/hu.php b/www/include/options/sysInfos/includes/lang/hu.php
new file mode 100644
index 0000000000000000000000000000000000000000..37ab316e2936109de63ffeac519d4223d8f27bf7
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/hu.php
@@ -0,0 +1,108 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+// Translated by Zsozso - zsozso@internews.hu
+// $Id: hu.php,v 1.14 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$charset                = 'iso-8859-2';
+
+$text['title']          = 'Rendszer Inform�ci�';
+
+$text['vitals']         = 'A Rendszer Alapvet� Inform�ci�i';
+$text['hostname']       = 'Hostn�v';
+$text['ip']             = 'Figyelt IP';
+$text['kversion']       = 'Kernel Verzi�';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Pillanatnyi felhaszn�l�k';
+$text['loadavg']        = 'Terhel�si �tlag';
+
+$text['hardware']       = 'Hardware Inform�ci�';
+$text['numcpu']         = 'Processzor';
+$text['cpumodel']       = 'Modell';
+$text['cpuspeed']       = 'Chip MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cache M�ret';
+$text['bogomips']       = 'Rendszer Bogomips';
+
+$text['pci']            = 'PCI Eszk�z�k';
+$text['ide']            = 'IDE Eszk�z�k';
+$text['scsi']           = 'SCSI Eszk�z�k';
+$text['usb']            = 'USB Eszk�z�k';
+
+$text['netusage']       = 'H�l� Haszn�lat';
+$text['device']         = 'Eszk�z';
+$text['received']       = 'Fogadott';
+$text['sent']           = 'K�ld�tt';
+$text['hib�k']          = 'Err/Drop';
+
+$text['connections']    = 'L�tes�tett H�l�zati Kapcsolatok';
+
+$text['memusage']       = 'Mem�ria Haszn�lat';
+$text['phymem']         = 'Fizikai Mem�ria';
+$text['swap']           = 'Lemez Swap';
+
+$text['fs']             = 'Csatlakoztatott File Rendszerek';
+$text['mount']          = 'Mount';
+$text['partition']      = 'Part�ci�k';
+
+$text['percent']        = 'Sz�zal�kos Haszn�lat';
+$text['type']           = 'T�pus';
+$text['free']           = 'Szabad';
+$text['used']           = 'Haszn�lt';
+$text['size']           = 'M�ret';
+$text['totals']         = '�sszesen';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'nincs';
+
+$text['capacity']       = 'Kapac�t�s'; 
+
+$text['template']       = 'Sablon';
+$text['language']       = 'Nyelv';
+$text['submit']         = 'Mehet';
+$text['created']        = 'K�sz�lt:';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'nap';
+$text['hours']          = '�ra';
+$text['minutes']        = 'perc';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/id.php b/www/include/options/sysInfos/includes/lang/id.php
new file mode 100644
index 0000000000000000000000000000000000000000..dc914dfd3d7f0c6c57f6cf9d256be99ae3f63949
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/id.php
@@ -0,0 +1,107 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: id.php,v 1.14 2005/12/07 15:02:11 bigmichi1 Exp $
+// Translated by: Firman Pribadi <http://ragiel.dhs.org>
+
+$text['title']          = 'Informasi Sistem';
+
+$text['vitals']         = 'Informasi Utama';
+$text['hostname']       = 'Hostname Resmi';
+$text['ip']             = 'IP Penerima';
+$text['kversion']       = 'Versi Kernel';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Aktif Selama';
+$text['users']          = 'Pengguna Saat Ini';
+$text['loadavg']        = 'Beban Rata-rata';
+
+$text['hardware']       = 'Informasi Perangkat Keras';
+$text['numcpu']         = 'Prosesor';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'CPU Speed';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Ukuran Cache';
+$text['bogomips']       = 'Sistem Bogomips';
+
+$text['pci']            = 'Perangkat PCI';
+$text['ide']            = 'Perangkat IDE';
+$text['scsi']           = 'Perangkat SCSI';
+$text['usb']            = 'Perangkat USB';
+
+$text['netusage']       = 'Status Penggunaan Jaringan';
+$text['device']         = 'Perangkat';
+$text['received']       = 'Diterima';
+$text['sent']           = 'Dikirim';
+$text['errors']         = 'Rusak/Drop';
+
+$text['connections']    = 'Koneksi Jaringan Aktif';
+
+$text['memusage']       = 'Status Penggunaan Memori';
+$text['phymem']         = 'Memori Fisik';
+$text['swap']           = 'Swap HardDisk';
+
+$text['fs']             = 'Status Penggunaan Media Penyimpanan dan Filesystem';
+$text['mount']          = 'Titik Mount';
+$text['partition']      = 'Partisi';
+
+$text['percent']        = 'Digunakan (Persen)';
+$text['type']           = 'Tipe';
+$text['free']           = 'Bebas';
+$text['used']           = 'Digunakan';
+$text['size']           = 'Ukuran';
+$text['totals']         = 'Total';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'tidak ditemukan';
+
+$text['capacity']       = 'Kapasitas'; 
+
+$text['template']       = 'Template';
+$text['language']       = 'Bahasa';
+$text['submit']         = 'Gunakan';
+$text['created']        = 'Dibangun menggunakan';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'hari';
+$text['hours']          = 'jam';
+$text['minutes']        = 'menit';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/index.html b/www/include/options/sysInfos/includes/lang/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/includes/lang/is.php b/www/include/options/sysInfos/includes/lang/is.php
new file mode 100644
index 0000000000000000000000000000000000000000..2469cfb3d17d4816f5b61c2236d1d962c232462f
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/is.php
@@ -0,0 +1,104 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: is.php,v 1.13 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Kerfisuppl�singar';
+
+$text['vitals']         = 'Helstu uppl�singar';
+$text['hostname']       = 'V�larnafn';
+$text['ip']             = 'IP-tala';
+$text['kversion']       = '�tg�fa kjarna';
+$text['dversion']       = 'Nafn dreifingar';
+$text['uptime']         = 'Uppit�mi';
+$text['users']          = 'Notendur';
+$text['loadavg']        = 'Me�al�lag';
+
+$text['hardware']       = 'Uppl�singar um v�lb�na�';
+$text['numcpu']         = 'Fj�ldi �rgj�rva';
+$text['cpumodel']       = 'Tegund';
+$text['cpuspeed']       = 'Hra�i';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'St�r� fl�timinnis';
+$text['bogomips']       = 'Bogomips';
+
+$text['pci']            = 'PCI ja�art�ki';
+$text['ide']            = 'IDE ja�art�ki';
+$text['scsi']           = 'SCSI ja�art�ki';
+$text['usb']            = 'USB ja�art�ki';
+
+$text['netusage']       = 'Netnotkun';
+$text['device']         = 'Ja�art�ki';
+$text['received']       = 'M�tteki�';
+$text['sent']           = 'Sent';
+$text['errors']         = 'Villur/Hent';
+
+$text['memusage']       = 'Minnisnotkun';
+$text['phymem']         = 'Vinnsluminni';
+$text['swap']           = 'S�ndarminni';
+
+$text['fs']             = 'Tengd skr�arkerfi';
+$text['mount']          = 'Tengipunktur';
+$text['partition']      = 'Disksnei�';
+
+$text['percent']        = 'Hlutfall af heildarst�r�';
+$text['type']           = 'Tegund';
+$text['free']           = 'Laust';
+$text['used']           = 'Nota�';
+$text['size']           = 'St�r�';
+$text['totals']         = 'Samtals';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'ekkert';
+
+$text['capacity']       = 'Heildarst�r�'; 
+
+$text['template']       = 'Sni�m�t';
+$text['language']       = 'Tungum�l';
+$text['submit']         = 'Senda';
+$text['created']        = 'B�i� til af';
+$text['locale']         = 'is_IS';
+$text['gen_time']       = '�ann %d.%m.%Y kl. %H:%M';
+
+$text['days']           = 'dagar';
+$text['hours']          = 'klukkustundir';
+$text['minutes']        = 'm�n�tur';
+  
+$text['temperature']    = 'Hitastig';
+$text['voltage']        = 'Volt';
+$text['fans']           = 'Viftur';
+$text['s_value']        = 'Gildi';
+$text['s_min']          = 'L�gst';
+$text['s_max']          = 'H�st';
+$text['s_div']          = 'Deilir';
+$text['hysteresis']     = 'A�v�run l�kur';
+$text['s_limit']        = 'A�v�run byrjar';
+$text['s_label']        = 'Nafn m�lis';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/it.php b/www/include/options/sysInfos/includes/lang/it.php
new file mode 100644
index 0000000000000000000000000000000000000000..3420844667dfc64e6c43f5e27fbcf94f73064684
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/it.php
@@ -0,0 +1,104 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: it.php,v 1.14 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Informazioni sul Sistema';
+
+$text['vitals']         = 'Informazioni Vitali';
+$text['hostname']       = 'Nome Canonico';
+$text['ip']             = 'Indirizzo IP';
+$text['kversion']       = 'Versione del Kernel';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Tempo di Esercizio';
+$text['users']          = 'Utenti Collegati';
+$text['loadavg']        = 'Carico Medio';
+
+$text['hardware']       = 'Informazioni Hardware';
+$text['numcpu']         = 'Processori';
+$text['cpumodel']       = 'Modello';
+$text['cpuspeed']       = 'MHz del Chip';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Dimensione Cache';
+$text['bogomips']       = 'Bogomips del Sistema';
+
+$text['pci']            = 'Unit� PCI';
+$text['ide']            = 'Unit� IDE';
+$text['scsi']           = 'Unit� SCSI';
+$text['usb']            = 'Unit� USB';
+
+$text['netusage']       = 'Utilizzo della Rete';
+$text['device']         = 'Device';
+$text['received']       = 'Ricevuti';
+$text['sent']           = 'Inviati';
+$text['errors']         = 'Err/Drop';
+
+$text['memusage']       = 'Utilizzo della Memoria';
+$text['phymem']         = 'Memoria Fisica';
+$text['swap']           = 'Disco di Swap';
+
+$text['fs']             = 'Filesystem Montati';
+$text['mount']          = 'Punto di Mount';
+$text['partition']      = 'Partizione';
+
+$text['percent']        = 'Uso Percentuale';
+$text['type']           = 'Tipo';
+$text['free']           = 'Libero';
+$text['used']           = 'Usato';
+$text['size']           = 'Dimensione';
+$text['totals']         = 'Totali';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'none';
+
+$text['capacity']       = 'Capacit�';
+  
+$text['template']       = 'Template';
+$text['language']       = 'Lingua';
+$text['submit']         = 'Invia';
+$text['created']        = 'Creato da';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'giorni';
+$text['hours']          = 'ore';
+$text['minutes']        = 'minuti';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/ja.php b/www/include/options/sysInfos/includes/lang/ja.php
new file mode 100644
index 0000000000000000000000000000000000000000..ed1055e8a478eeab4b4d64351b4807b6bb06c842
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/ja.php
@@ -0,0 +1,3 @@
+<?php
+require 'jp.php';
+?>
diff --git a/www/include/options/sysInfos/includes/lang/jp.php b/www/include/options/sysInfos/includes/lang/jp.php
new file mode 100644
index 0000000000000000000000000000000000000000..41a83b8f4e76767e2c482050b7aa0f9b76849e08
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/jp.php
@@ -0,0 +1,105 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: jp.php,v 1.8 2005/11/19 14:08:32 bigmichi1 Exp $
+
+$charset                = 'euc-jp';
+$text['title']          = '�����ƥ����';
+
+$text['vitals']         = '�����ƥ�ư�����';
+$text['hostname']       = '�ۥ���̾';
+$text['ip']             = 'IP���ɥ쥹';
+$text['kversion']       = '�����ͥ�С������(uname)';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Ϣ³��Ư����(uptime)';
+$text['users']          = '��������桼����';
+$text['loadavg']        = '�����ɥ��٥졼��';
+
+$text['hardware']       = '�ϡ��ɥ���������';
+$text['numcpu']         = 'CPU��';
+$text['cpumodel']       = 'CPU��ǥ�';
+$text['cpuspeed']       = '��������(MHz)';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = '����å��奵����';
+$text['bogomips']       = 'System Bogomips';
+
+$text['pci']            = 'PCI�ǥХ�������';
+$text['ide']            = 'IDE�ǥХ�������';
+$text['scsi']           = 'SCSI�ǥХ�������';
+$text['usb']            = 'USB�ǥХ�������';
+
+$text['netusage']       = '�ͥåȥ�����Ѿ���';
+$text['device']         = '���󥿥ե�����̾';
+$text['received']       = '����������';
+$text['sent']           = '����������';
+$text['errors']         = '���顼/������ǽ';
+
+$text['connections']    = '������³���Ƥ���ͥåȥ����³����';
+
+$text['memusage']       = '������Ѿ���';
+$text['phymem']         = 'ʪ��������';
+$text['swap']           = '�ǥ���������å�';
+
+$text['fs']             = '�ޥ���ȺѤߥե����륷���ƥ����';
+$text['mount']          = '�ޥ���ȥݥ����';
+$text['partition']      = '�ǥ������ѡ��ƥ������';
+
+$text['percent']        = '���ѳ��';
+$text['type']           = '�ե����륷���ƥ����';
+$text['free']           = '����';
+$text['used']           = '����';
+$text['size']           = '����';
+$text['totals']         = '���';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '����ޤ���';
+
+$text['capacity']       = '����'; 
+
+$text['template']       = '�ǥ���������';
+$text['language']       = '����';
+$text['submit']         = '����';
+$text['created']        = 'Created by';
+
+$text['days']           = '��';
+$text['hours']          = '����';
+$text['minutes']        = 'ʬ';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/ko.php b/www/include/options/sysInfos/includes/lang/ko.php
new file mode 100644
index 0000000000000000000000000000000000000000..4fcaea497c4d89d0caa6fcf8076524da8c49fab6
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/ko.php
@@ -0,0 +1,107 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: ko.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+// Translated by Sungkook KIM - ace@aceteam.org
+
+$charset                = 'euc-kr';
+
+$text['title']          = '�ý��� ����';
+
+$text['vitals']         = '���� �ý��� ��Ȳ';
+$text['hostname']       = '�ý����� ȣ��Ʈ����';
+$text['ip']             = '�ý����� IP �ּ�';
+$text['kversion']       = 'Ŀ�� ����';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = '���� �ð�';
+$text['users']          = '���� ������ ��';
+$text['loadavg']        = '��� �ε�';
+
+$text['hardware']       = '�ϵ���� ����';
+$text['numcpu']         = '����� ����';
+$text['cpumodel']       = '����� ��';
+$text['cpuspeed']       = 'Ĩ�� Ŭ��';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = '�ɽ� ������';
+$text['bogomips']       = '��ü�׽�Ʈ Ŭ��';
+
+$text['pci']            = 'PCI ��ġ';
+$text['ide']            = 'IDE ��ġ';
+$text['scsi']           = 'SCSI ��ġ';
+$text['usb']            = 'USB ��ġ';
+
+$text['netusage']       = ' ��Ʈ��ũ �������';
+$text['device']         = '��ġ';
+$text['received']       = '���� ��';
+$text['sent']           = '���� ��';
+$text['errors']         = '���� / ����';
+
+$text['memusage']       = '�޸� ��뷮';
+$text['phymem']         = '������ �޸�';
+$text['swap']           = '���� ��ũ';
+
+$text['fs']             = '����Ʈ ��Ȳ';
+$text['mount']          = '����Ʈ';
+$text['partition']      = '��Ƽ��';
+
+$text['percent']        = ' �ۼ�Ʈ';
+$text['type']           = 'Ÿ��';
+$text['free']           = '������';
+$text['used']           = '��뷮';
+$text['size']           = '�� �뷮';
+$text['totals']         = '�հ�';
+
+$text['kb']             = 'ų�ι���Ʈ(KB)';
+$text['mb']             = '�ް�����Ʈ(MB)';
+$text['gb']             = '�Ⱑ����Ʈ(GB)';
+
+$text['none']           = '����';
+
+$text['capacity']       = '�뷮';
+
+$text['template']       = '���ø�';
+$text['language']       = '���';
+$text['submit']         = '����';
+$text['created']        = '������';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = '��';
+$text['hours']          = '��';
+$text['minutes']        = '��';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/lt.php b/www/include/options/sysInfos/includes/lang/lt.php
new file mode 100644
index 0000000000000000000000000000000000000000..56caf61ee6fe2ac07efb95b783611b1ad7e610d5
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/lt.php
@@ -0,0 +1,109 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: lt.php,v 1.15 2005/11/19 14:08:32 bigmichi1 Exp $
+
+$charset                = 'utf-8';
+
+$text['title']          = 'Informacija apie sistemą';
+
+$text['vitals']         = 'Sistema';
+$text['hostname']       = 'Kompiuterio vardas';
+$text['ip']             = 'IP adresas';
+$text['kversion']       = 'Branduolio versija';
+$text['dversion']       = 'Distribucija';
+$text['uptime']         = 'Veikimo laikas';
+$text['users']          = 'Vartotojai';
+$text['loadavg']        = 'Apkrovos vidurkiai';
+
+$text['hardware']       = 'Aparatūra';
+$text['numcpu']         = 'Procesorių kiekis';
+$text['cpumodel']       = 'Modelis';
+$text['cpuspeed']       = 'Procesoriaus dažnis';
+$text['busspeed']       = 'Magistralės dažnis';
+$text['cache']          = 'Spartinančioji atmintinė';
+$text['bogomips']       = 'Sistemos „bogomips“';
+
+$text['pci']            = 'PCI įrenginiai';
+$text['ide']            = 'IDE įrenginiai';
+$text['scsi']           = 'SCSI įrenginiai';
+$text['usb']            = 'USB įrenginiai';
+
+$text['netusage']       = 'Tinklas';
+$text['device']         = 'Įrenginys';
+$text['received']       = 'Gauta';
+$text['sent']           = 'Išsiųsta';
+$text['errors']         = 'Klaidos/pamesti paketai';
+
+$text['memusage']       = 'Atmintis';
+$text['phymem']         = 'Operatyvioji atmintis';
+$text['swap']           = 'Disko swap skirsnis';
+
+$text['fs']             = 'Bylų sistema';
+$text['mount']          = 'Prijungimo vieta';
+$text['partition']      = 'Skirsnis';
+
+$text['percent']        = 'Apkrova procentais';
+$text['type']           = 'Tipas';
+$text['free']           = 'Laisva';
+$text['used']           = 'Apkrauta';
+$text['size']           = 'Dydis';
+$text['totals']         = 'Iš viso';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'nėra';
+
+$text['capacity']       = 'Talpa';
+  
+$text['template']       = 'Šablonas';
+$text['language']       = 'Kalba';
+$text['submit']         = 'Atnaujinti';
+$text['created']        = 'Naudojamas';
+
+$text['days']           = 'd.';
+$text['hours']          = 'val.';
+$text['minutes']        = 'min.';
+
+$text['temperature']    = 'Temperatūra';
+$text['voltage']        = 'Įtampa';
+$text['fans']           = 'Aušintuvai';
+$text['s_value']        = 'Reikšmė';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Maks';
+$text['s_div']          = 'Div';
+// Hysteresis is the value that defines at which temp
+// the alarm should deactivate. If you have set an
+// alarm to go off when CPU temp reaches 60 degrees,
+// a hysteresis set at, say, 58 degress will deactivate
+// the alarm when temp goes below 58 degrees.
+$text['hysteresis']     = 'Signalizuojama ties';
+$text['s_limit']        = 'Riba';
+$text['s_label']        = 'Pavadinimas';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'aps./min';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/lv.php b/www/include/options/sysInfos/includes/lang/lv.php
new file mode 100644
index 0000000000000000000000000000000000000000..ee96043e341718fa9be197f99a64f2a6c5a94edd
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/lv.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: lv.php,v 1.8 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Sist�mas inform�cija';
+
+$text['vitals']         = 'Galvenie r�d�t�ji';
+$text['hostname']       = 'Hosta v�rds';
+$text['ip']             = 'IP Adrese';
+$text['kversion']       = 'Kerne�a versija';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Nep�rtrauktais darba laiks';
+$text['users']          = 'Lietot�ji';
+$text['loadavg']        = 'Vid�jie iel�des r�d�t�ji';
+
+$text['hardware']       = 'Aparat�ra';
+$text['numcpu']         = 'Procesors';
+$text['cpumodel']       = 'Modelis';
+$text['cpuspeed']       = '�ipa MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Ke� atmi�a';
+$text['bogomips']       = 'Sist�mas "Bogomips"';
+
+$text['pci']            = 'PCI ier�ces';
+$text['ide']            = 'IDE ier�ces';
+$text['scsi']           = 'SCSI ier�ces';
+$text['usb']            = 'USB ier�ces';
+
+$text['netusage']       = 'T�kla inform�cija';
+$text['device']         = 'Ier�ce';
+$text['received']       = 'Sa�emts';
+$text['sent']           = 'Aizs�t�ts';
+$text['errors']         = 'K��das/Zaud�t�s paketes';
+
+$text['connections']    = 'Established Network Connections';
+
+$text['memusage']       = 'Atmi�as lietojums';
+$text['phymem']         = 'Operat�v� atmi�a';
+$text['swap']           = 'Swap atmi�a';
+
+$text['fs']             = 'Cietie diski';
+$text['mount']          = 'Mounta vieta';
+$text['partition']      = 'Part�cija';
+
+$text['percent']        = 'Aiz�emts procentos';
+$text['type']           = 'Tips';
+$text['free']           = 'Br�vs';
+$text['used']           = 'Aiz�emts';
+$text['size']           = 'Ietilp�ba';
+$text['totals']         = 'Kop�';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'nav';
+
+$text['capacity']       = 'Ietilp�ba';
+
+$text['template']       = 'Sagatave';
+$text['language']       = 'Valoda';
+$text['submit']         = 'Apstiprin�t';
+$text['created']        = 'Autors';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dienas';
+$text['hours']          = 'stundas';
+$text['minutes']        = 'min�tes';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/nl.php b/www/include/options/sysInfos/includes/lang/nl.php
new file mode 100644
index 0000000000000000000000000000000000000000..cf123c266290b2b3289e5c0d222042a0327056ee
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/nl.php
@@ -0,0 +1,110 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: nl.php,v 1.18 2005/12/07 15:02:11 bigmichi1 Exp $
+
+if (PHP_OS == 'WINNT') {
+  $text['locale']         = 'dutch'; // (windows) 
+}
+else {	
+  $text['locale']         = 'nl-NL'; // (Linux and friends(?))
+}
+
+$text['title']          = 'Systeem Informatie';
+
+$text['vitals']         = 'Systeem overzicht';
+$text['hostname']       = 'Toegewezen naam';
+$text['ip']             = 'IP-adres';
+$text['kversion']       = 'Kernelversie';
+$text['dversion']       = 'Distributie';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Huidige gebruikers';
+$text['loadavg']        = 'Gemiddelde belasting';
+
+$text['hardware']       = 'Hardware overzicht';
+$text['numcpu']         = 'Processors';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'CPU snelheid';
+$text['busspeed']       = 'BUS snelheid';
+$text['cache']          = 'Cache grootte';
+$text['bogomips']       = 'Systeem Bogomips';
+
+$text['pci']            = 'PCI Apparaten';
+$text['ide']            = 'IDE Apparaten';
+$text['scsi']           = 'SCSI Apparaten';
+$text['usb']            = 'USB Apparaten';
+
+$text['netusage']       = 'Netwerkgebruik';
+$text['device']         = 'Apparaat';
+$text['received']       = 'Ontvangen';
+$text['sent']           = 'Verzonden';
+$text['errors']         = 'Err/Drop';
+
+$text['memusage']       = 'Geheugengebruik';
+$text['phymem']         = 'Fysiek geheugen';
+$text['swap']           = 'Swap geheugen';
+
+$text['fs']             = 'Aangesloten bestandssystemen';
+$text['mount']          = 'Mount';
+$text['partition']      = 'Partitie';
+
+$text['percent']        = 'Percentage gebruikt';
+$text['type']           = 'Type';
+$text['free']           = 'Vrij';
+$text['used']           = 'Gebruikt';
+$text['size']           = 'Grootte';
+$text['totals']         = 'Totaal';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'geen';
+
+$text['capacity']       = 'Capaciteit';
+  
+$text['template']       = 'Opmaak-model';
+$text['language']       = 'Taal';
+$text['submit']         = 'Toepassen';
+$text['created']        = 'Gegenereerd door';
+$text['gen_time']       = 'op %d %B %Y, om %H:%M';
+
+$text['days']           = 'dagen';
+$text['hours']          = 'uren';
+$text['minutes']        = 'minuten';
+  
+$text['temperature']    = 'Temperatuur';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Waarde';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysterie';
+$text['s_limit']        = 'Limiet';
+$text['s_label']        = 'Omschrijving';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/no.php b/www/include/options/sysInfos/includes/lang/no.php
new file mode 100644
index 0000000000000000000000000000000000000000..5421114b435f48c10a029b4403f3bf9bf5af3faa
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/no.php
@@ -0,0 +1,104 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: no.php,v 1.14 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Systeminformasjon';
+
+$text['vitals']         = 'Vital Informasjon';
+$text['hostname']       = 'Egentlige Tjenernavn';
+$text['ip']             = 'IP-Adresse';
+$text['kversion']       = 'Kernel Versjon';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Oppetid';
+$text['users']          = 'Antall Brukere';
+$text['loadavg']        = 'Gj.Snitt Belastning';
+
+$text['hardware']       = 'Maskinvareinformasjon';
+$text['numcpu']         = 'Prosessorer';
+$text['cpumodel']       = 'Modell';
+$text['cpuspeed']       = 'Brikke MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cache St&oslash;rrelse';
+$text['bogomips']       = 'System Bogomips';
+
+$text['pci']            = 'PCI Enheter';
+$text['ide']            = 'IDE Enheter';
+$text['scsi']           = 'SCSI Enheter';
+$text['usb']            = 'USB Enheter';
+
+$text['netusage']       = 'Nettverksbruk';
+$text['device']         = 'Enhet';
+$text['received']       = 'Mottatt';
+$text['sent']           = 'Sendt';
+$text['errors']         = 'Feil/Dropp';
+
+$text['memusage']       = 'Minnebruk';
+$text['phymem']         = 'Fysisk Minne';
+$text['swap']           = 'Disk Swap';
+
+$text['fs']             = 'Monterte Filsystemer';
+$text['mount']          = 'Punkt';
+$text['partition']      = 'Partisjon';
+
+$text['percent']        = 'Brukt Kapasitet i Prosent';
+$text['type']           = 'Type';
+$text['free']           = 'Ledig';
+$text['used']           = 'Brukt';
+$text['size']           = 'St&oslash;rrelse';
+$text['totals']         = 'Totalt';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'Ingen';
+
+$text['capacity']       = 'Kapasitet';
+  
+$text['template']       = 'Mal';
+$text['language']       = 'Spr&aring;k';
+$text['submit']         = 'Endre';
+$text['created']        = 'Generert av';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dager';
+$text['hours']          = 'timer';
+$text['minutes']        = 'minutter';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/pa_utf8.php b/www/include/options/sysInfos/includes/lang/pa_utf8.php
new file mode 100644
index 0000000000000000000000000000000000000000..d4ce558a2accfda2532094c2a715451f483ef9bc
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/pa_utf8.php
@@ -0,0 +1,104 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: pa_utf8.php,v 1.2 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$charset		= 'utf-8';
+
+$text['title']          = 'ਸਿਸਟਮ ਜਾਣਕਾਰੀ';
+
+$text['vitals']         = 'ਸਿਸਟਮ ਮਾਰਕਮ';
+$text['hostname']       = 'ਮੇਜ਼ਬਾਨ ਨਾਂ';
+$text['ip']             = 'ਸੁਣਨ IP';
+$text['kversion']       = 'ਕਰਨਲ ਵਰਜਨ';
+$text['dversion']       = 'ਵੰਡ ਨਾਂ';
+$text['uptime']         = 'ਚੱਲਣ ਸਮਾਂ';
+$text['users']          = 'ਕੁੱਲ ਉਪਭੋਗੀ';
+$text['loadavg']        = 'ਔਸਤ ਲੋਡ';
+
+$text['hardware']       = 'ਜੰਤਰ ਜਾਣਕਾਰੀ';
+$text['numcpu']         = 'ਪਰੋਸੈਸਰ';
+$text['cpumodel']       = 'ਮਾਡਲ';
+$text['cpuspeed']       = 'CPU ਗਤੀ';
+$text['busspeed']       = 'ਬਸ ਗਤੀ';
+$text['cache']          = 'ਕੈਂਚੇ ਅਕਾਰ';
+$text['bogomips']       = 'ਸਿਸਟਮ Bogomips';
+
+$text['pci']            = 'PCI ਜੰਤਰ';
+$text['ide']            = 'IDE ਜੰਤਰ';
+$text['scsi']           = 'SCSI ਜੰਤਰ';
+$text['usb']            = 'USB ਜੰਤਰ';
+
+$text['netusage']       = 'ਨੈੱਟਵਰਕ ਵਰਤੋਂ';
+$text['device']         = 'ਜੰਤਰ';
+$text['received']       = 'ਪਰਾਪਤ ਹੋਇਆ';
+$text['sent']           = 'ਭੇਜਿਆ';
+$text['errors']         = 'ਗਲਤੀ/ਸੁੱਟੇ';
+
+$text['connections']    = 'ਸਥਾਪਤ ਨੈੱਟਵਰਕ ਕੁਨੈਕਸ਼ਨ';
+
+$text['memusage']       = 'ਮੈਮੋਰੀ ਵਰਤੋਂ';
+$text['phymem']         = 'ਭੌਤਿਕ ਮੈਮੋਰੀ';
+$text['swap']           = 'ਡਿਸਕ ਸਵੈਪ';
+
+$text['fs']             = 'ਮਾਊਂਟ ਕੀਤੇ ਫਾਇਲ ਸਿਸਟਮ';
+$text['mount']          = 'ਮਾਊਂਟ';
+$text['partition']      = 'ਭਾਗ';
+
+$text['percent']        = 'ਫ਼ੀ-ਸਦੀ ਸਮੱਰਥਾ';
+$text['type']           = 'ਕਿਸਮ';
+$text['free']           = 'ਮੁਕਤ (ਖਾਲੀ)';
+$text['used']           = 'ਵਰਤੀ';
+$text['size']           = 'ਅਕਾਰ';
+$text['totals']         = 'ਕੁੱਲ';
+
+$text['kb']             = 'ਕਿਬਾ';
+$text['mb']             = 'ਮੈਬਾ';
+$text['gb']             = 'ਗੈਬਾ';
+
+$text['none']           = 'ਕੋਈ ਨਹੀਂ';
+
+$text['capacity']       = 'ਸਮੱਰਥਾ'; 
+
+$text['template']       = 'ਨਮੂਨਾ';
+$text['language']       = 'ਭਾਸ਼ਾ';
+$text['submit']         = 'ਪੇਸ਼ ਕਰੋੇ';
+$text['created']        = 'ਬਣਾਇਆ';
+$text['locale']         = 'pa';
+$text['gen_time']       = '%b %d, %Y ਨੂੰ %I:%M %p ਵਜੇ';
+
+$text['days']           = 'ਦਿਨ';
+$text['hours']          = 'ਘੰਟੇ';
+$text['minutes']        = 'ਮਿੰਟ';
+
+$text['temperature']    = 'ਤਾਪਮਾਨ';
+$text['voltage']        = 'ਵੋਲਟੇਜ਼';
+$text['fans']           = 'ਪੱਖੇ';
+$text['s_value']        = 'ਮੁੱਲ';
+$text['s_min']          = 'ਘੱਟੋ-ਘੱਟ';
+$text['s_max']          = 'ਵੱਧੋ-ਵੱਧ';
+$text['s_div']          = 'ਡਿਜ';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'ਸੀਮਾ';
+$text['s_label']        = 'ਲੇਬਲ';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/pl.php b/www/include/options/sysInfos/includes/lang/pl.php
new file mode 100644
index 0000000000000000000000000000000000000000..34552907d7343b87b34b3430ef9e1203eb4a1999
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/pl.php
@@ -0,0 +1,107 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: pl.php,v 1.11 2005/11/19 14:08:32 bigmichi1 Exp $
+
+$charset                = 'iso-8859-2';
+
+$text['title']          = 'Informacja o systemie';
+
+$text['vitals']         = 'Stan systemu';
+$text['hostname']       = 'Nazwa kanoniczna hosta';
+$text['ip']             = 'IP nas�uchuj�cy';
+$text['kversion']       = 'Wersja j�dra';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Obecnych u�ytkownk�w';
+$text['loadavg']        = 'Obci��enia �rednie';
+
+$text['hardware']       = 'Informacja o sprz�cie';
+$text['numcpu']         = 'Procesory';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'Cz&#281;stotliwo&#347;&#263;';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cache Size';
+$text['bogomips']       = 'System Bogomips';
+
+$text['pci']            = 'Urz�dzenia PCI';
+$text['ide']            = 'Urz�dzenia IDE';
+$text['scsi']           = 'Urz�dzenia SCSI';
+$text['usb']            = 'Urz�dzenia USB';
+
+$text['netusage']       = 'Sie�';
+$text['device']         = 'Urz�dzenie';
+$text['received']       = 'Odebrano';
+$text['sent']           = 'Wys�ano';
+$text['errors']         = 'B��dow/Porzuconych';
+
+$text['memusage']       = 'Obci��enie pami�ci';
+$text['phymem']         = 'Pami�� fizyczna';
+$text['swap']           = 'Pami�� Swap';
+
+$text['fs']             = 'Zamontowane systemy plik�w';
+$text['mount']          = 'Punkt montowania';
+$text['partition']      = 'Partycja';
+
+$text['percent']        = 'Procentowo zaj�te';
+$text['type']           = 'Typ';
+$text['free']           = 'Wolne';
+$text['used']           = 'Zaj�te';
+$text['size']           = 'Rozmiar';
+$text['totals']         = 'Ca�kowite';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'brak';
+
+$text['capacity']       = 'Rozmiar';
+
+$text['template']       = 'Szablon';
+$text['language']       = 'J�zyk';
+$text['submit']         = 'Wy�lij';
+$text['created']        = 'Utworzone przez';
+$text['locale']         = 'pl_PL'; 
+$text['gen_time']       = " %e %b %Y o godzinie %T";
+
+$text['days']           = 'dni';
+$text['hours']          = 'godzin';
+$text['minutes']        = 'minut';
+
+$text['sensors']        = 'Czujniki (lm_sensors)';
+$text['temperature']    = 'Temperatura';
+$text['voltage']        = 'Napi�cia';
+$text['fans']           = 'Wiatraczki';
+$text['s_value']        = 'Warto��';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hystereza';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Nazwa';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/pt-br.php b/www/include/options/sysInfos/includes/lang/pt-br.php
new file mode 100644
index 0000000000000000000000000000000000000000..cd556596515eb211108665808ad898b2477e9cb4
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/pt-br.php
@@ -0,0 +1,110 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: pt-br.php,v 1.8 2005/12/07 15:02:11 bigmichi1 Exp $
+//
+// Tradutor: Marc�lio Cunha Marinho Maia, 29/03/2003 �s 04:34 (Goi�nia-GO,Brasil)
+// E-mail: marcilio@nextsolution.com.br Web: http://www.nextsolution.com.br
+// Icq: 22493131
+
+$text['title']          = 'Informa��o Sobre o Sistema';
+
+$text['vitals']         = 'Informa��es Vitais do Sistema';
+$text['hostname']       = 'Nome do Servidor';
+$text['ip']             = 'N�mero IP';
+$text['kversion']       = 'Vers�o do Kernel';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Tempo Ativo do Sistema';
+$text['users']          = 'Usuarios Ativos';
+$text['loadavg']        = 'Carga do Sistema';
+
+$text['hardware']       = 'Informa��es sobre o Hardware';
+$text['numcpu']         = 'Processadores';
+$text['cpumodel']       = 'Modelo';
+$text['cpuspeed']       = 'Velocidade em MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Tamanho do Cache';
+$text['bogomips']       = 'Velocidade em Bogomips';
+
+$text['pci']            = 'Dispositivos PCI';
+$text['ide']            = 'Dispositivos IDE';
+$text['scsi']           = 'Dispositivos SCSI';
+$text['usb']            = 'Dispositivos USB';
+
+$text['netusage']       = 'Uso da Rede';
+$text['device']         = 'Dispositivo';
+$text['received']       = 'Recebido';
+$text['sent']           = 'Enviado';
+$text['errors']         = 'Perdido';
+
+$text['connections']    = 'Conex�es Estabelecidas';
+
+$text['memusage']       = 'Utiliza��o Mem�ria';
+$text['phymem']         = 'Mem�ria F�sica';
+$text['swap']           = 'Mem�ria Virtual (SWAP)';
+
+$text['fs']             = 'Sistemas de Arquivos';
+$text['mount']          = 'Ponto de montagem';
+$text['partition']      = 'Parti��o';
+
+$text['percent']        = 'Capacidade Utilizada';
+$text['type']           = 'Tipo';
+$text['free']           = 'Livre';
+$text['used']           = 'Utilizado';
+$text['size']           = 'Tamanho';
+$text['totals']         = 'Totais';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'N/A';
+
+$text['capacity']       = 'Capacidade'; 
+
+$text['template']       = 'Exemplos';
+$text['language']       = 'L�ngua';
+$text['submit']         = 'Entrar';
+$text['created']        = 'Criado por';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'Dias';
+$text['hours']          = 'Horas';
+$text['minutes']        = 'Minutos';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/pt.php b/www/include/options/sysInfos/includes/lang/pt.php
new file mode 100644
index 0000000000000000000000000000000000000000..ee2ae8f202e6d578e203362be8cb8ee928b39dc2
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/pt.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: pt.php,v 1.11 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Informa��es do Sistema';
+
+$text['vitals']         = 'Informa��es Vitais';
+$text['hostname']       = 'Hostname Can�nico';
+$text['ip']             = 'IP';
+$text['kversion']       = 'Vers�o do Kernel';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Utilizadores Ligados';
+$text['loadavg']        = 'Carga M�dia';
+
+$text['hardware']       = 'Informa��es do Hardware';
+$text['numcpu']         = 'Processadores';
+$text['cpumodel']       = 'Modelo';
+$text['cpuspeed']       = 'CPU Speed';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Tamanho da Cache';
+$text['bogomips']       = 'Bogomips do Sistema';
+
+$text['pci']            = 'Hardware PCI';
+$text['ide']            = 'Hardware IDE';
+$text['scsi']           = 'Hardware SCSI';
+$text['usb']            = 'Hardware USB';
+
+$text['netusage']       = 'Utiliza��o da Rede';
+$text['device']         = 'Dispositivo';
+$text['received']       = 'Recebidos';
+$text['sent']           = 'Enviados';
+$text['errors']         = 'Erro/Rejeitados';
+
+$text['connections']    = 'Liga��es Estabelecidas';
+
+$text['memusage']       = 'Utiliza��o da Mem�ria';
+$text['phymem']         = 'Mem�ria F�sica';
+$text['swap']           = 'Swap';
+
+$text['fs']             = 'Sistema de Ficheiros (Mounted)';
+$text['mount']          = 'Mount';
+$text['partition']      = 'Parti��es';
+
+$text['percent']        = 'Capacidade em Percentagem';
+$text['type']           = 'Tipo';
+$text['free']           = 'Livre';
+$text['used']           = 'Utilizada';
+$text['size']           = 'Tamanho';
+$text['totals']         = 'Totais';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'indispon�vel';
+
+$text['capacity']       = 'Capacidade'; 
+
+$text['template']       = 'Template';
+$text['language']       = 'Idioma';
+$text['submit']         = 'Enviar';
+$text['created']        = 'Produzido por';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dias';
+$text['hours']          = 'horas';
+$text['minutes']        = 'minutos';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/ro.php b/www/include/options/sysInfos/includes/lang/ro.php
new file mode 100644
index 0000000000000000000000000000000000000000..f425b55872b09195f7908bdcfde261f22d97ffa0
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/ro.php
@@ -0,0 +1,105 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: ro.php,v 1.0 6/9/01 12:41PM 
+// Translated by Silviu Simen - ssimen@sympatico.ca
+
+$text['title']          = 'Informatii despre sistem';
+
+$text['vitals']         = 'Informatii vitale';
+$text['hostname']       = 'Numele canonic';
+$text['ip']             = 'Adresa IP';
+$text['kversion']       = 'Versiune nucleu';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Timp de viata';
+$text['users']          = 'Utilizatori curenti';
+$text['loadavg']        = 'Incarcarea sistemului';
+
+$text['hardware']       = 'Informatii hardware';
+$text['numcpu']         = 'Procesoare';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'CPU Speed';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Marime Cache';
+$text['bogomips']       = 'Bogomips';
+
+$text['pci']            = 'Dispozitive PCI';
+$text['ide']            = 'Dispozitive IDE';
+$text['scsi']           = 'Dispozitive SCSI';
+$text['usb']            = 'Dispozitive USB';
+
+$text['netusage']       = 'Utilizarea retelei';
+$text['device']         = 'Dispozitiv';
+$text['received']       = 'Primit';
+$text['sent']           = 'Trimis';
+$text['errors']         = 'Erori';
+
+$text['memusage']       = 'Utilizarea memoriei';
+$text['phymem']         = 'Memorie fizica';
+$text['swap']           = 'Disk Swap';
+
+$text['fs']             = 'Sisteme de fisiere montate';
+$text['mount']          = 'Punct montare';
+$text['partition']      = 'Partitie';
+
+$text['percent']        = 'Procent capacitate';
+$text['type']           = 'Tip';
+$text['free']           = 'Liber';
+$text['used']           = 'Utilizat';
+$text['size']           = 'Marime';
+$text['totals']         = 'Total';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'nici unul';
+
+$text['capacity']       = 'Capacitate';
+
+$text['template']       = 'Model';
+$text['language']       = 'Limba';
+$text['submit']         = 'Actualizeaza';
+$text['created']        = 'Creat de';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'zile';
+$text['hours']          = 'ore';
+$text['minutes']        = 'minute';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/ru.php b/www/include/options/sysInfos/includes/lang/ru.php
new file mode 100644
index 0000000000000000000000000000000000000000..48edb52b8d8ec675df303af7c7ffb64955a5183b
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/ru.php
@@ -0,0 +1,108 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: ru.php,v 1.0 2002/06/26 11:05:32
+// Translated by Voldar (voldar@quality.s2.ru)
+
+$charset                = 'cp1251';
+$text['title']          = '��������� ����������';
+
+$text['vitals']         = '�������� ������';
+$text['hostname']       = '��� �����';
+$text['ip']             = '�������������� IP';
+$text['kversion']       = '������ ����';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = '����� ������';
+$text['users']          = '������������� � �������';
+$text['loadavg']        = '������� ��������';
+
+$text['hardware']       = '���������� �����������';
+$text['numcpu']         = '����������';
+$text['cpumodel']       = '������';
+$text['cpuspeed']       = '�������� ���������� MHz';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = '������ ����';
+$text['bogomips']       = 'System Bogomips';
+
+$text['pci']            = '���������� PCI';
+$text['ide']            = '���������� IDE';
+$text['scsi']           = '���������� SCSI';
+$text['usb']            = '���������� USB';
+
+$text['netusage']       = '������������� ����';
+$text['device']         = '����������';
+$text['received']       = '��������';
+$text['sent']           = '����������';
+$text['errors']         = '������';
+
+$text['connections']    = '������������� ������� ����������';
+
+$text['memusage']       = '������������� ������';
+$text['phymem']         = '���������� ������';
+$text['swap']           = '���� ��������';
+
+$text['fs']             = '�������������� �������� �������';
+$text['mount']          = '����� ������������';
+$text['partition']      = '������';
+
+$text['percent']        = '������� �������������';
+$text['type']           = '���';
+$text['free']           = '��������';
+$text['used']           = '������';
+$text['size']           = '������';
+$text['totals']         = '�����';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '�����������';
+
+$text['capacity']       = '������';
+
+$text['template']       = '������';
+$text['language']       = '����';
+$text['submit']         = '���������';
+$text['created']        = '�������';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = '����';
+$text['hours']          = 'hours';
+$text['minutes']        = 'minutes';
+
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/sk.php b/www/include/options/sysInfos/includes/lang/sk.php
new file mode 100644
index 0000000000000000000000000000000000000000..c3b99c36a9c06a60b3dc8cffb381bb26feb352a8
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/sk.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: sk.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$charset                = 'iso-8859-2';
+
+$text['title']          = 'Inform�cie o syst�me';
+
+$text['vitals']         = 'Z�kladn� inform�cie';
+$text['hostname']       = 'Meno po��ta�a';
+$text['ip']             = 'IP adresa';
+$text['kversion']       = 'Verzia jadra';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Uptime';
+$text['users']          = 'Prihl�sen�ch u��vate�ov';
+$text['loadavg']        = 'Priemer loadu';
+
+$text['hardware']       = 'Hardwarov� inform�cie';
+$text['numcpu']         = 'Procesory';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'Frekvencia';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Ve�kos� cache';
+$text['bogomips']       = 'Bogomipsov';
+
+$text['pci']            = 'PCI zariadenia';
+$text['ide']            = 'IDE zariadenia';
+$text['scsi']           = 'SCSI zariadenia';
+$text['usb']            = 'USB zariadenia';
+
+$text['netusage']       = 'Pou��vanie siete';
+$text['device']         = 'Zariadenia';
+$text['received']       = 'Prijat�ch';
+$text['sent']           = 'Odoslan�ch';
+$text['errors']         = 'Chyby/Vypusten�ch';
+
+$text['memusage']       = 'Obsadenie pam�ti';
+$text['phymem']         = 'Fyzick� pam�';
+$text['swap']           = 'Swap';
+
+$text['fs']             = 'Namountovan� s�borov� syst�my';
+$text['mount']          = 'Adres�r';
+$text['partition']      = 'Part�cia';
+
+$text['percent']        = 'Obsaden�ch';
+$text['type']           = 'Typ';
+$text['free']           = 'Vo�n�ch';
+$text['used']           = 'Pou�it�ch';
+$text['size']           = 'Ve�kos�';
+$text['totals']         = 'Celkom';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '�iadne';
+
+$text['capacity']       = 'Kapacita';
+
+$text['template']       = '�abl�na';
+$text['language']       = 'Jazyk';
+$text['submit']         = 'Odosla�';
+$text['created']        = 'Vytvoren� pomocou';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'dn�';
+$text['hours']          = 'hod�n';
+$text['minutes']        = 'min�t';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/sr.php b/www/include/options/sysInfos/includes/lang/sr.php
new file mode 100644
index 0000000000000000000000000000000000000000..8102a82cd7fba689af354a6312a9c78b9be57aeb
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/sr.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: sr.php,v 1.3 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$charset                = 'utf-8';
+
+$text['title']          = 'Спецификација Система ';
+
+$text['vitals']         = 'Систем';
+$text['hostname']       = 'Име домаћина';
+$text['ip']             = 'ИП адреса';
+$text['kversion']       = 'Верзија кернела';
+$text['dversion']       = 'Дицтрибуција';
+$text['uptime']         = 'Радно време';
+$text['users']          = 'Број корисника';
+$text['loadavg']        = 'Просечно оптерећење';
+
+$text['hardware']       = 'Хардверске компоненте';
+$text['numcpu']         = 'Процесор';
+$text['cpumodel']       = 'Moдел';
+$text['mhz']            = 'Брзина чипа';
+$text['cache']          = 'Величина предмеморије';
+$text['bogomips']       = 'Богомипс';
+$text['usb']            = 'УСБ уређаји';
+$text['pci']            = 'ПЦИ уређаји';
+$text['ide']            = 'ИДЕ уређаји';
+$text['scsi']           = 'СЦСИ уређаји';
+
+$text['netusage']       = 'Мрежна Употреба';
+$text['device']         = 'Уређај';
+$text['received']       = 'Примљено';
+$text['sent']           = 'Послато';
+$text['errors']         = 'Грешке';
+
+$text['connections']    = 'Успостављене конекције';
+
+$text['memusage']       = 'Употреба меморије';
+$text['phymem']         = 'Тврда memorija';
+$text['swap']           = 'СВАП меморија';
+
+$text['fs']             = 'Монтирани фајл системи';
+$text['mount']          = 'Монтирани';
+$text['partition']      = 'Партиција';
+
+$text['percent']        = 'Проценти';
+$text['type']           = 'Врста';
+$text['free']           = 'Слободно';
+$text['used']           = 'Искоришћено';
+$text['size']           = 'Величина';
+$text['totals']         = 'Укупно';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'ezer ez';
+
+$text['capacity']       = 'Капацитет'; 
+
+$text['template']       = 'Tемплат';
+$text['language']       = 'Језик';
+$text['submit']         = 'Пошаљи';
+$text['created']        = 'Креирано: ';
+$text['locale']         = 'ср';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'Дани';
+$text['hours']          = 'Сати';
+$text['minutes']        = 'Минути';
+  
+$text['temperature']    = 'Температура';
+$text['voltage']        = 'Напајање';
+$text['fans']           = 'Вентилатори';
+$text['s_value']        = 'Снага';
+$text['s_min']          = 'Мин';
+$text['s_max']          = 'Mах';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Аларм';
+$text['s_limit']        = 'Лимит';
+$text['s_label']        = 'Име';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/sv.php b/www/include/options/sysInfos/includes/lang/sv.php
new file mode 100644
index 0000000000000000000000000000000000000000..d2dab28dace9cd274bb3e5e7d1ef5257f4aed405
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/sv.php
@@ -0,0 +1,107 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: sv.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+//
+// translation by shockzor
+// updated/edited by jetthe
+
+$text['title']          = 'Systeminformation';
+
+$text['vitals']         = 'Allm�n information';
+$text['hostname']       = 'V�rdnamn';
+$text['ip']             = 'IP-adress';
+$text['kversion']       = 'Kernel-version';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'Drifttid';
+$text['users']          = 'Aktuella anv�ndare';
+$text['loadavg']        = 'Medelbelastning';
+
+$text['hardware']       = 'H�rdvaruinformation';
+$text['numcpu']         = 'Processorer';
+$text['cpumodel']       = 'Modell';
+$text['cpuspeed']       = 'Klockfrekvens';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cachestorlek';
+$text['bogomips']       = 'Bogomips';
+
+$text['pci']            = 'PCI-enheter';
+$text['ide']            = 'IDE-enheter';
+$text['scsi']           = 'SCSI-enheter';
+$text['usb']            = 'USB-enheter';
+
+$text['netusage']       = 'N�tverksanv�ndning';
+$text['device']         = 'Enheter';
+$text['received']       = 'Mottaget';
+$text['sent']           = 'Skickat';
+$text['errors']         = 'Fel/F�rlorat';
+
+$text['memusage']       = 'Minnesanv�ndning';
+$text['phymem']         = 'Fysiskt minne';
+$text['swap']           = 'V�xlingsminne';
+
+$text['fs']             = 'Monterade filsystem';
+$text['mount']          = 'Monteringspunkt';
+$text['partition']      = 'Partition';
+
+$text['percent']        = 'Kapacitetsutnyttjande';
+$text['type']           = 'Typ';
+$text['free']           = 'Ledigt';
+$text['used']           = 'Anv�nt';
+$text['size']           = 'Storlek';
+$text['totals']         = 'Totalt';
+
+$text['kb']             = 'kB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'inga';
+
+$text['capacity']       = 'Kapacitet';
+  
+$text['template']       = 'Mall';
+$text['language']       = 'Spr�k';
+$text['submit']         = 'Skicka';
+
+$text['days']           = 'dagar';
+$text['hours']          = 'timmar';
+$text['minutes']        = 'minuter';
+$text['created']        = 'Skapat av';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/tr.php b/www/include/options/sysInfos/includes/lang/tr.php
new file mode 100644
index 0000000000000000000000000000000000000000..02546602e3627db6ec4f629c4d5ea4693a38a694
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/tr.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: tr.php,v 1.12 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$text['title']          = 'Sistem Bilgisi';
+
+$text['vitals']         = 'Sistem Temel';
+$text['hostname']       = 'Cannonical Host Adresi';
+$text['ip']             = 'IP Adresi';
+$text['kversion']       = 'Kernel Versiyonu';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = 'A��k Kald��� S�re';
+$text['users']          = '�u Andaki Kullan�c�lar';
+$text['loadavg']        = 'Y�kleme Ortalamas�';
+
+$text['hardware']       = 'Hardware Bilgisi';
+$text['numcpu']         = 'CPU Say�s�';
+$text['cpumodel']       = 'Model';
+$text['cpuspeed']       = 'CPU H�z�( Mhz)';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = 'Cache B�y�kl���';
+$text['bogomips']       = 'Sistem Bogomips';
+
+$text['pci']            = 'PCI Ara�lar';
+$text['ide']            = 'IDE Ara�lar';
+$text['scsi']           = 'SCSI Ara�lar';
+$text['usb']            = 'USB Ara�lar';
+
+$text['netusage']       = 'Network Kullan�m�';
+$text['device']         = 'Aray�z';
+$text['received']       = 'Al�nan';
+$text['sent']           = 'G�nderilen';
+$text['errors']         = 'Hata/D���r�len';
+
+$text['connections']    = 'Kurulmu� Network Ba�lant�lar�';
+
+$text['memusage']       = 'Haf�za Kullan�m�';
+$text['phymem']         = 'Fiziksel Haf�za';
+$text['swap']           = 'Disk Swap';
+
+$text['fs']             = 'Mount Edilmi� Sistemler';
+$text['mount']          = 'Mount';
+$text['partition']      = 'K�s�m';
+
+$text['percent']        = 'Y�zde Kapasite';
+$text['type']           = 'T�r';
+$text['free']           = 'Bo� Alan';
+$text['used']           = 'Kullan�lan';
+$text['size']           = 'B�y�kl�k';
+$text['totals']         = 'Toplam';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = 'Hi�biri';
+
+$text['capacity']       = 'Kapasite';
+
+$text['template']       = 'Aray�z';
+$text['language']       = 'Dil';
+$text['submit']         = 'G�nder';
+$text['created']        = 'Yaratan';
+$text['locale']         = 'en_US';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = 'g�n';
+$text['hours']          = 'saat';
+$text['minutes']        = 'dakika';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/lang/tw.php b/www/include/options/sysInfos/includes/lang/tw.php
new file mode 100644
index 0000000000000000000000000000000000000000..e9c1e24ddcca9c69d4347207e5cfea0676069aa5
--- /dev/null
+++ b/www/include/options/sysInfos/includes/lang/tw.php
@@ -0,0 +1,106 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: tw.php,v 1.13 2005/12/07 15:02:11 bigmichi1 Exp $
+
+$charset                = 'big5';
+
+$text['title']          = '�t�θ�T';
+
+$text['vitals']         = '�t�ΥD�n�T��';
+$text['hostname']       = '�D���W��';
+$text['ip']             = '�D����~ IP';
+$text['kversion']       = '�֤ߪ���';
+$text['dversion']       = 'Distro Name';
+$text['uptime']         = '�}���ɶ�';
+$text['users']          = '�u�W�ϥΪ�';
+$text['loadavg']        = '�����t��';
+
+$text['hardware']       = '�w���T';
+$text['numcpu']         = '�B�z���ƶq';
+$text['cpumodel']       = 'CPU����';
+$text['cpuspeed']       = '�����t��';
+$text['busspeed']       = 'BUS Speed';
+$text['cache']          = '�֨��j�p';
+$text['bogomips']       = '�t�� Bogomips';
+
+$text['pci']            = 'PCI �]��';
+$text['ide']            = 'IDE �]��';
+$text['scsi']           = 'SCSI �]��';
+$text['usb']            = 'USB �]��';
+
+$text['netusage']       = '�����ϥζq';
+$text['device']         = '�����]��';
+$text['received']       = '����';
+$text['sent']           = '�e�X';
+$text['errors']         = '���~/���_';
+
+$text['memusage']       = '�O����ϥζq';
+$text['phymem']         = '����O����';
+$text['swap']           = '�����O����(�Ϻиm��)';
+
+$text['fs']             = '�w�����ɮרt��';
+$text['mount']          = '�������|';
+$text['partition']      = '���κϰ�';
+
+$text['percent']        = '�ϥζq�ʤ���';
+$text['type']           = '���A';
+$text['free']           = '�Ѿl�Ŷ�';
+$text['used']           = '�w�ϥ�';
+$text['size']           = '�`�e�q';
+$text['totals']         = '�`�ϥζq';
+
+$text['kb']             = 'KB';
+$text['mb']             = 'MB';
+$text['gb']             = 'GB';
+
+$text['none']           = '�L';
+
+$text['capacity']       = '�e�q';
+
+$text['template']       = '�d��';
+$text['language']       = '�y��';
+$text['submit']         = '�e�X';
+$text['created']        = '���ͥ�';
+$text['locale']         = 'zh_TW.Big5';
+$text['gen_time']       = 'on %b %d, %Y at %I:%M %p';
+
+$text['days']           = '��';
+$text['hours']          = '�p��';
+$text['minutes']        = '����';
+  
+$text['temperature']    = 'Temperature';
+$text['voltage']        = 'Voltage';
+$text['fans']           = 'Fans';
+$text['s_value']        = 'Value';
+$text['s_min']          = 'Min';
+$text['s_max']          = 'Max';
+$text['s_div']          = 'Div';
+$text['hysteresis']     = 'Hysteresis';
+$text['s_limit']        = 'Limit';
+$text['s_label']        = 'Label';
+$text['degree_mark']    = '&ordm;C';
+$text['voltage_mark']   = 'V';
+$text['rpm_mark']       = 'RPM';
+
+$text['app']		= '- Kernel + applications';
+$text['buffers']	= '- Buffers';
+$text['cached']		= '- Cached';
+
+?>
diff --git a/www/include/options/sysInfos/includes/mb/class.hddtemp.inc.php b/www/include/options/sysInfos/includes/mb/class.hddtemp.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..6d68172741410d13662b79ccdd7e7ba5a7946d7d
--- /dev/null
+++ b/www/include/options/sysInfos/includes/mb/class.hddtemp.inc.php
@@ -0,0 +1,93 @@
+<?php
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.hddtemp.inc.php,v 1.2 2005/11/20 09:56:58 bigmichi1 Exp $
+
+class hddtemp {
+
+  var $drives;
+
+  function hddtemp($devices) {
+    foreach( $devices as $drive) {
+        $this->drives = $this->drives . '/dev/' . $drive . ' ';
+    }
+  }
+
+  function temperature($hddtemp_avail) {
+    $ar_buf = array();
+    $results = array();
+    switch ($hddtemp_avail) {
+    case "tcp":
+	{
+	    // Timo van Roermund: connect to the hddtemp daemon, use a 5 second timeout.
+	    $fp = fsockopen('localhost', 7634, $errno, $errstr, 5);
+	    // if connected, read the output of the hddtemp daemon
+	    if ($fp) {
+		// read output of the daemon
+		$lines = '';
+		while (!feof($fp)) {
+		    $lines .= fread($fp, 1024);
+		}
+		// close the connection
+		fclose($fp);
+	    } else {
+		die("HDDTemp error: " . $errno . ", " . $errstr);
+	    }
+	    $lines = str_replace("||", "|\n|", $lines);
+	    $ar_buf = explode("\n", $lines);
+	    break;
+	}
+    case "suid":
+	{
+	    $hddtemp_value = execute_program("hddtemp", "$this->drives");
+	    $hddtemp_value = explode("\n", $hddtemp_value);
+	    foreach($hddtemp_value as $line)
+	    {	
+		$temp = preg_split("/:\s/", $line, 3);
+		if (preg_match("/^[0-9]/", $temp[2])) {
+		    list($temp[2], $temp[3]) = (preg_split("/\s/", $temp[2]));
+		    array_push( $ar_buf, "|" . implode("|", $temp) . "|");
+		}
+	    }
+	    break;
+	}
+    default:
+	{
+	    die("Bad hddtemp configuration in config.php");
+	}
+    }
+    
+    // Timo van Roermund: parse the info from the hddtemp daemon.
+    $i = 0;
+    foreach($ar_buf as $line) {
+      $data = array();
+      if (ereg("\|(.*)\|(.*)\|(.*)\|(.*)\|", $line, $data))
+      {
+        // get the info we need
+	$results[$i]['label'] = $data[1];
+	$results[$i]['value'] = $data[3];
+        $results[$i]['model'] = $data[2];
+        $i++;
+      };
+    }
+
+    return $results;
+  }
+}
+?>
diff --git a/www/include/options/sysInfos/includes/mb/class.healthd.inc.php b/www/include/options/sysInfos/includes/mb/class.healthd.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..662c8d5289456a5c89334a2f3fff77ea0ac23d24
--- /dev/null
+++ b/www/include/options/sysInfos/includes/mb/class.healthd.inc.php
@@ -0,0 +1,119 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.healthd.inc.php,v 1.5 2004/10/30 08:09:27 webbie Exp $
+
+class mbinfo {
+    var $lines;
+
+  function temperature() {
+    $ar_buf = array();
+    $results = array();
+
+    if (!isset($this->lines)) {
+      $this->lines = execute_program('healthdc', '-t');
+    }
+
+    $ar_buf = preg_split("/\t+/", $this->lines);
+
+    $results[0]['label'] = 'temp1';
+    $results[0]['value'] = $ar_buf[1];
+    $results[0]['limit'] = '70.0';
+    $results[0]['percent'] = $results[0]['value'] * 100 / $results[0]['limit'];
+    $results[1]['label'] = 'temp2';
+    $results[1]['value'] = $ar_buf[2];
+    $results[1]['limit'] = '70.0';
+    $results[1]['percent'] = $results[1]['value'] * 100 / $results[1]['limit'];
+    $results[2]['label'] = 'temp3';
+    $results[2]['value'] = $ar_buf[3];
+    $results[2]['limit'] = '70.0';
+    $results[2]['percent'] = $results[2]['value'] * 100 / $results[2]['limit'];
+    return $results;
+  } 
+
+  function fans() {
+    $ar_buf = array();
+    $results = array();
+
+    if (!isset($this->lines)) {
+      $this->lines = execute_program('healthdc', '-t');
+    }
+
+    $ar_buf = preg_split("/\t+/", $this->lines);
+
+    $results[0]['label'] = 'fan1';
+    $results[0]['value'] = $ar_buf[4];
+    $results[0]['min'] = '3000';
+    $results[0]['div'] = '2';
+    $results[1]['label'] = 'fan2';
+    $results[1]['value'] = $ar_buf[5];
+    $results[1]['min'] = '3000';
+    $results[1]['div'] = '2';
+    $results[2]['label'] = 'fan3';
+    $results[2]['value'] = $ar_buf[6];
+    $results[2]['min'] = '3000';
+    $results[2]['div'] = '2';
+
+    return $results;
+  } 
+
+  function voltage() {
+    $ar_buf = array();
+    $results = array();
+
+    if (!isset($this->lines)) {
+      $this->lines = execute_program('healthdc', '-t');
+    }
+
+    $ar_buf = preg_split("/\t+/", $this->lines);
+
+    $results[0]['label'] = 'Vcore1';
+    $results[0]['value'] = $ar_buf[7];
+    $results[0]['min'] = '0.00';
+    $results[0]['max'] = '0.00';
+    $results[1]['label'] = 'Vcore2';
+    $results[1]['value'] = $ar_buf[8];
+    $results[1]['min'] = '0.00';
+    $results[1]['max'] = '0.00';
+    $results[2]['label'] = '3volt';
+    $results[2]['value'] = $ar_buf[9];
+    $results[2]['min'] = '0.00';
+    $results[2]['max'] = '0.00';
+    $results[3]['label'] = '+5Volt';
+    $results[3]['value'] = $ar_buf[10];
+    $results[3]['min'] = '0.00';
+    $results[3]['max'] = '0.00';
+    $results[4]['label'] = '+12Volt';
+    $results[4]['value'] = $ar_buf[11];
+    $results[4]['min'] = '0.00';
+    $results[4]['max'] = '0.00';
+    $results[5]['label'] = '-12Volt';
+    $results[5]['value'] = $ar_buf[12];
+    $results[5]['min'] = '0.00';
+    $results[5]['max'] = '0.00';
+    $results[6]['label'] = '-5Volt';
+    $results[6]['value'] = $ar_buf[13];
+    $results[6]['min'] = '0.00';
+    $results[6]['max'] = '0.00';
+
+    return $results;
+  } 
+} 
+
+?>
diff --git a/www/include/options/sysInfos/includes/mb/class.hwsensors.inc.php b/www/include/options/sysInfos/includes/mb/class.hwsensors.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..79d79bf884dbcc8e8c8f408760658ace6833da74
--- /dev/null
+++ b/www/include/options/sysInfos/includes/mb/class.hwsensors.inc.php
@@ -0,0 +1,102 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.hwsensors.inc.php,v 1.3 2004/10/30 08:09:27 webbie Exp $
+
+class mbinfo {
+    var $lines;
+
+  function temperature() {
+    $ar_buf = array();
+    $lines = array();
+    $results = array();
+
+    if (!isset($this->lines) ) {
+        $this->lines = execute_program('sysctl', '-w hw.sensors');
+    }
+
+    $lines = explode("\n", $this->lines);
+
+    for ($i = 0, $j = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/[\s,]+/", $lines[$i]);
+
+      if ($ar_buf[2] == 'temp') {
+        $results[$j]['label'] = $ar_buf[1];
+        $results[$j]['value'] = $ar_buf[3];
+        $results[$j]['limit'] = '70.0';
+        $results[$j]['percent'] = $results[$j]['value'] * 100 / $results[$j]['limit'];
+        $j++;
+      }
+    }
+
+    return $results;
+  } 
+
+  function fans() {
+    $ar_buf = array();
+    $lines = array();
+    $results = array();
+
+    if (!isset($this->lines) ) {
+        $this->lines = execute_program('sysctl', '-w hw.sensors');
+    }
+
+    $lines = explode("\n", $this->lines);
+
+    for ($i = 0, $j = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/[\s,]+/", $lines[$i]);
+
+      if ($ar_buf[2] == 'fanrpm') {
+        $results[$j]['label'] = $ar_buf[1];
+        $results[$j]['value'] = $ar_buf[3];
+        $j++;
+      }
+    }
+
+    return $results;
+  } 
+
+  function voltage() {
+    $ar_buf = array();
+    $lines = array();
+    $results = array();
+
+    if (!isset($this->lines) ) {
+        $this->lines = execute_program('sysctl', '-w hw.sensors');
+    }
+
+    $lines = explode("\n", $this->lines);
+
+    for ($i = 0, $j = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/[\s,]+/", $lines[$i]);
+
+      if ($ar_buf[2] == 'volts_dc') {
+        $results[$j]['label'] = $ar_buf[1];
+        $results[$j]['value'] = $ar_buf[3];
+        $results[$j]['min'] = '0.00';
+        $results[$j]['max'] = '0.00';
+        $j++;
+      }
+    }
+
+    return $results;
+  } 
+} 
+
+?>
diff --git a/www/include/options/sysInfos/includes/mb/class.lmsensors.inc.php b/www/include/options/sysInfos/includes/mb/class.lmsensors.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..89745d9b4a03bbfaf6c8e91ab84d751a806af023
--- /dev/null
+++ b/www/include/options/sysInfos/includes/mb/class.lmsensors.inc.php
@@ -0,0 +1,171 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.lmsensors.inc.php,v 1.16 2005/11/27 20:38:15 bigmichi1 Exp $
+if (!defined('IN_PHPSYSINFO')) {
+    die("No Hacking");
+}
+
+require_once(APP_ROOT . "/includes/common_functions.php");
+
+class mbinfo {
+  var $lines;
+
+  function mbinfo() {
+   $lines = execute_program("sensors", "");
+   // Martijn Stolk: Dirty fix for misinterpreted output of sensors, 
+   // where info could come on next line when the label is too long.
+   $lines = str_replace(":\n", ":", $lines);
+   $lines = str_replace("\n\n", "\n", $lines);
+   $this->lines = explode("\n", $lines);
+  }
+  
+  function temperature() {
+    $ar_buf = array();
+    $results = array();
+
+    $sensors_value = $this->lines;
+
+    foreach($sensors_value as $line) {
+      $data = array();
+      if (ereg("(.*):(.*)\((.*)=(.*),(.*)=(.*)\)(.*)", $line, $data)) ;
+      elseif (ereg("(.*):(.*)\((.*)=(.*)\)(.*)", $line, $data)) ;
+      else (ereg("(.*):(.*)", $line, $data));
+      if (count($data) > 1) {
+        $temp = substr(trim($data[2]), -1);
+        switch ($temp) {
+          case "C";
+          case "F":
+            array_push($ar_buf, $line);
+            break;
+        }
+      }
+    }
+
+    $i = 0;
+    foreach($ar_buf as $line) {
+      unset($data);
+      if (ereg("(.*):(.*).C[ ]*\((.*)=(.*).C,(.*)=(.*).C\)(.*)\)", $line, $data)) ;
+      elseif (ereg("(.*):(.*).C[ ]*\((.*)=(.*).C,(.*)=(.*).C\)(.*)", $line, $data)) ;
+      elseif (ereg("(.*):(.*).C[ ]*\((.*)=(.*).C\)(.*)", $line, $data)) ;
+      else (ereg("(.*):(.*).C", $line, $data));
+
+      $results[$i]['label'] = $data[1];
+      $results[$i]['value'] = trim($data[2]);
+      $results[$i]['limit'] = isset($data[4]) ? trim($data[4]) : "+60";
+      $results[$i]['perce'] = isset($data[6]) ? trim($data[6]) : "+60";
+      if ($results[$i]['limit'] < $results[$i]['perce']) {	 	
+         $results[$i]['limit'] = $results[$i]['perce'];	 	
+       }      
+      $i++;
+    }
+
+    asort($results);
+    return array_values($results);
+  }
+
+  function fans() {
+    $ar_buf = array();
+    $results = array();
+
+    $sensors_value = $this->lines;
+
+    foreach($sensors_value as $line) {
+      $data = array();
+      if (ereg("(.*):(.*)\((.*)=(.*),(.*)=(.*)\)(.*)", $line, $data));
+      elseif (ereg("(.*):(.*)\((.*)=(.*)\)(.*)", $line, $data));
+      else ereg("(.*):(.*)", $line, $data);
+
+      if (count($data) > 1) {
+        $temp = explode(" ", trim($data[2]));
+        if (count($temp) == 1)
+          $temp = explode("\xb0", trim($data[2]));
+	if(isset($temp[1])) {
+          switch ($temp[1]) {
+            case "RPM":
+              array_push($ar_buf, $line);
+              break;
+          }
+	}
+      }
+    }
+
+    $i = 0;
+    foreach($ar_buf as $line) {
+      unset($data);
+      if (ereg("(.*):(.*) RPM  \((.*)=(.*) RPM,(.*)=(.*)\)(.*)\)", $line, $data));
+      elseif (ereg("(.*):(.*) RPM  \((.*)=(.*) RPM,(.*)=(.*)\)(.*)", $line, $data));
+      elseif (ereg("(.*):(.*) RPM  \((.*)=(.*) RPM\)(.*)", $line, $data));
+      else ereg("(.*):(.*) RPM", $line, $data);
+
+      $results[$i]['label'] = trim($data[1]);
+      $results[$i]['value'] = trim($data[2]);
+      $results[$i]['min'] = isset($data[4]) ? trim($data[4]) : 0;
+      $results[$i]['div'] = isset($data[6]) ? trim($data[6]) : 0;
+      $i++;
+    }
+
+    asort($results);
+    return array_values($results);
+  }
+
+  function voltage() {
+    $ar_buf = array();
+    $results = array();
+
+    $sensors_value = $this->lines;
+
+    foreach($sensors_value as $line) {
+      $data = array();
+      if (ereg("(.*):(.*)\((.*)=(.*),(.*)=(.*)\)(.*)", $line, $data));
+      else ereg("(.*):(.*)", $line, $data);
+      
+      if (count($data) > 1) {
+        $temp = explode(" ", trim($data[2]));
+        if (count($temp) == 1)
+          $temp = explode("\xb0", trim($data[2]));
+        if (isset($temp[1])) {
+          switch ($temp[1]) {
+            case "V":
+              array_push($ar_buf, $line);
+              break;
+	  }
+        }
+      }
+    }
+
+    $i = 0;
+    foreach($ar_buf as $line) {
+      unset($data);
+      if (ereg("(.*):(.*) V  \((.*)=(.*) V,(.*)=(.*) V\)(.*)\)", $line, $data));
+      elseif (ereg("(.*):(.*) V  \((.*)=(.*) V,(.*)=(.*) V\)(.*)", $line, $data));
+      else ereg("(.*):(.*) V$", $line, $data);
+      if(isset($data[1])) {
+        $results[$i]['label'] = trim($data[1]);
+        $results[$i]['value'] = trim($data[2]);
+        $results[$i]['min'] = isset($data[4]) ? trim($data[4]) : 0;
+        $results[$i]['max'] = isset($data[6]) ? trim($data[6]) : 0;
+        $i++;
+      }
+    }
+    return $results;
+  }
+}
+
+?>
diff --git a/www/include/options/sysInfos/includes/mb/class.mbm5.inc.php b/www/include/options/sysInfos/includes/mb/class.mbm5.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..a69ac26e9618dae8d68a3c042393d64d52bdb1f0
--- /dev/null
+++ b/www/include/options/sysInfos/includes/mb/class.mbm5.inc.php
@@ -0,0 +1,127 @@
+<?php 
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: class.mbm5.inc.php,v 1.4 2005/12/10 09:08:19 bigmichi1 Exp $
+//
+// Note: Make sure you set MBM5 Interval Logging to csv and to the root of PHPSysInfo.
+// Also make sure MBM5 doesn't at symbols to the values. Did is a Quick MBM5 log parser,
+// need more csv logs to make it better.
+//
+class mbinfo {
+    var $buf_label;
+    var $buf_value;
+
+  function temperature() {
+    $results = array();
+
+    if (!isset($this->buf_label)) {
+      if ($fp = fopen('MBM5.csv', 'r')) {
+	    $this->buf_label = split(';', fgets($fp));
+        $this->buf_value = split(';', fgets($fp));
+        fclose($fp);
+      }
+    }
+    
+    $results[0]['label'] = $this->buf_label[3];
+    $results[0]['value'] = $this->buf_value[3];
+    $results[0]['limit'] = '70.0';
+    $results[0]['percent'] = $results[0]['value'] * 100 / $results[0]['limit'];
+    $results[1]['label'] = $this->buf_label[4];
+    $results[1]['value'] = $this->buf_value[4];
+    $results[1]['limit'] = '70.0';
+    $results[1]['percent'] = $results[1]['value'] * 100 / $results[1]['limit'];
+    $results[2]['label'] = $this->buf_label[5];
+    $results[2]['value'] = $this->buf_value[5];
+    $results[2]['limit'] = '70.0';
+    $results[2]['percent'] = $results[2]['value'] * 100 / $results[2]['limit'];
+    return $results;
+  } 
+
+  function fans() {
+    $results = array();
+
+    if (!isset($this->buf_label)) {
+      if ($fp = fopen('MBM5.csv', 'r')) {
+	    $this->buf_label = split(';', fgets($fp));
+        $this->buf_value = split(';', fgets($fp));
+        fclose($fp);
+      }
+    }
+    
+    $results[0]['label'] = $this->buf_label[13];
+    $results[0]['value'] = $this->buf_value[13];
+    $results[0]['min'] = '3000';
+    $results[0]['div'] = '2';
+    $results[1]['label'] = $this->buf_label[14];
+    $results[1]['value'] = $this->buf_value[14];
+    $results[1]['min'] = '3000';
+    $results[1]['div'] = '2';
+    $results[2]['label'] = $this->buf_label[15];
+    $results[2]['value'] = $this->buf_value[15];
+    $results[2]['min'] = '3000';
+    $results[2]['div'] = '2';
+
+    return $results;
+  } 
+
+  function voltage() {
+    $results = array();
+
+    if (!isset($this->buf_label)) {
+      if ($fp = fopen('MBM5.csv', 'r')) {
+	    $this->buf_label = split(';', fgets($fp));
+        $this->buf_value = split(';', fgets($fp));
+        fclose($fp);
+      }
+    }
+   
+    $results[0]['label'] = $this->buf_label[6];
+    $results[0]['value'] = $this->buf_value[6];
+    $results[0]['min'] = '0.00';
+    $results[0]['max'] = '0.00';
+    $results[1]['label'] = $this->buf_label[7];
+    $results[1]['value'] = $this->buf_value[7];
+    $results[1]['min'] = '0.00';
+    $results[1]['max'] = '0.00';
+    $results[2]['label'] = $this->buf_label[8];
+    $results[2]['value'] = $this->buf_value[8];
+    $results[2]['min'] = '0.00';
+    $results[2]['max'] = '0.00';
+    $results[3]['label'] = $this->buf_label[9];
+    $results[3]['value'] = $this->buf_value[9];
+    $results[3]['min'] = '0.00';
+    $results[3]['max'] = '0.00';
+    $results[4]['label'] = $this->buf_label[10];
+    $results[4]['value'] = $this->buf_value[10];
+    $results[4]['min'] = '0.00';
+    $results[4]['max'] = '0.00';
+    $results[5]['label'] = $this->buf_label[11];
+    $results[5]['value'] = $this->buf_value[11];
+    $results[5]['min'] = '0.00';
+    $results[5]['max'] = '0.00';
+    $results[6]['label'] = $this->buf_label[12];
+    $results[6]['value'] = $this->buf_value[12];
+    $results[6]['min'] = '0.00';
+    $results[6]['max'] = '0.00';
+
+    return $results;
+  } 
+} 
+
+?>
diff --git a/www/include/options/sysInfos/includes/mb/class.mbmon.inc.php b/www/include/options/sysInfos/includes/mb/class.mbmon.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..bace209282f320d14edf236c9d60d53d178b9379
--- /dev/null
+++ b/www/include/options/sysInfos/includes/mb/class.mbmon.inc.php
@@ -0,0 +1,100 @@
+<?php
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// This class was created by Z. Frombach ( zoltan at frombach dot com )
+
+// $Id: class.mbmon.inc.php,v 1.4 2005/11/22 15:08:29 bigmichi1 Exp $
+
+class mbinfo {
+	var $lines;
+
+  function temperature() {
+    $results = array();
+
+	if (!isset($this->lines) ) {
+	    $this->lines = explode("\n", execute_program('mbmon', '-c 1 -r'));
+	}
+
+    $i = 0;
+    foreach($this->lines as $line) {
+      if (preg_match('/^(TEMP\d*)\s*:\s*(.*)$/D', $line, $data)) {
+        if ($data[2]<>'0') {
+          $results[$i]['label'] = $data[1];
+          $results[$i]['limit'] = '70.0';
+	  if($data[2] > 250) {
+	    $results[$i]['value'] = 0;
+	    $results[$i]['percent'] = 0;
+	  } else {
+            $results[$i]['value'] = $data[2];
+            $results[$i]['percent'] = $results[$i]['value'] * 100 / $results[$i]['limit'];
+	  }
+          $i++;
+        }
+      }
+    }
+    return $results;
+  }
+
+  function fans() {
+    $results = array();
+
+	if (!isset($this->lines) ) {
+	    $this->lines = explode("\n", execute_program('mbmon', '-c 1 -r'));
+	}
+
+    $i = 0;
+    foreach($this->lines as $line) {
+      if (preg_match('/^(FAN\d*)\s*:\s*(.*)$/D', $line, $data)) {
+        if ($data[2]<>'0') {
+          $results[$i]['label'] = $data[1];
+          $results[$i]['value'] = $data[2];
+          $results[$i]['min'] = '3000';
+          $results[$i]['div'] = '2';
+          $i++;
+        }
+      }
+    }
+    return $results;
+  }
+
+  function voltage() {
+    $results = array();
+
+	if (!isset($this->lines) ) {
+	    $this->lines = explode("\n", execute_program('mbmon', '-c 1 -r'));
+	}
+
+    $i = 0;
+    foreach($this->lines as $line) {
+      if (preg_match('/^(V.*)\s*:\s*(.*)$/D', $line, $data)) {
+        if ($data[2]<>'+0.00') {
+          $results[$i]['label'] = $data[1];
+          $results[$i]['value'] = $data[2];
+          $results[$i]['min'] = '0.00';
+          $results[$i]['max'] = '0.00';
+          $i++;
+        }
+      }
+    }
+
+    return $results;
+  }
+}
+
+?>
diff --git a/www/include/options/sysInfos/includes/mb/index.html b/www/include/options/sysInfos/includes/mb/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/includes/os/class.BSD.common.inc.php b/www/include/options/sysInfos/includes/os/class.BSD.common.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..871e4d9b9a463cc1f56f18566709cc43d33de8a7
--- /dev/null
+++ b/www/include/options/sysInfos/includes/os/class.BSD.common.inc.php
@@ -0,0 +1,330 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.BSD.common.inc.php,v 1.34 2005/12/09 19:30:48 bigmichi1 Exp $
+
+class bsd_common {
+  var $dmesg; 
+  // Our constructor
+  // this function is run on the initialization of this class
+  function bsd_common () {
+    // initialize all the variables we need from our parent class
+    $this->sysinfo();
+  } 
+  // read /var/run/dmesg.boot, but only if we haven't already.
+  function read_dmesg () {
+    if (! $this->dmesg) {
+      $this->dmesg = file ('/var/run/dmesg.boot');
+    } 
+    return $this->dmesg;
+  } 
+  // grabs a key from sysctl(8)
+  function grab_key ($key) {
+    return execute_program('sysctl', "-n $key");
+  } 
+  // get our apache SERVER_NAME or vhost
+  function hostname () {
+    if (!($result = getenv('SERVER_NAME'))) {
+      $result = "N.A.";
+    } 
+    return $result;
+  } 
+  // get our canonical hostname
+  function chostname () {
+    return execute_program('hostname');
+  } 
+  // get the IP address of our canonical hostname
+  function ip_addr () {
+    if (!($result = getenv('SERVER_ADDR'))) {
+      $result = gethostbyname($this->chostname());
+    } 
+    return $result;
+  } 
+
+  function kernel () {
+    $s = $this->grab_key('kern.version');
+    $a = explode(':', $s);
+    return $a[0] . $a[1] . ':' . $a[2];
+  } 
+
+  function uptime () {
+    $result = $this->get_sys_ticks();
+
+    return $result;
+  } 
+
+  function users () {
+    return execute_program('who', '| wc -l');
+  } 
+
+  function loadavg ($bar = false) {
+    $s = $this->grab_key('vm.loadavg');
+    $s = ereg_replace('{ ', '', $s);
+    $s = ereg_replace(' }', '', $s);
+    $results['avg'] = explode(' ', $s);
+
+    if ($bar) {
+      if ($fd = $this->grab_key('kern.cp_time')) {
+        sscanf($fd, "%*s %Ld %Ld %Ld %Ld", $ab, $ac, $ad, $ae);
+        // Find out the CPU load
+        // user + sys = load
+        // total = total
+        $load = $ab + $ac + $ad;        // cpu.user + cpu.sys
+        $total = $ab + $ac + $ad + $ae; // cpu.total
+
+        // we need a second value, wait 1 second befor getting (< 1 second no good value will occour)
+        sleep(1);
+        $fd = $this->grab_key('kern.cp_time');
+        sscanf($fd, "%*s %Ld %Ld %Ld %Ld", $ab, $ac, $ad, $ae);
+        $load2 = $ab + $ac + $ad;
+        $total2 = $ab + $ac + $ad + $ae;
+        $results['cpupercent'] = (100*($load2 - $load)) / ($total2 - $total);
+      }
+    }
+    return $results;
+  } 
+
+  function cpu_info () {
+    $results = array();
+    $ar_buf = array();
+
+    $results['model'] = $this->grab_key('hw.model');
+    $results['cpus'] = $this->grab_key('hw.ncpu');
+
+    for ($i = 0, $max = count($this->read_dmesg()); $i < $max; $i++) {
+      $buf = $this->dmesg[$i];
+      if (preg_match("/$this->cpu_regexp/", $buf, $ar_buf)) {
+        $results['cpuspeed'] = round($ar_buf[2]);
+        break;
+      } 
+    } 
+    return $results;
+  } 
+  // get the scsi device information out of dmesg
+  function scsi () {
+    $results = array();
+    $ar_buf = array();
+
+    for ($i = 0, $max = count($this->read_dmesg()); $i < $max; $i++) {
+      $buf = $this->dmesg[$i];
+
+      if (preg_match("/$this->scsi_regexp1/", $buf, $ar_buf)) {
+        $s = $ar_buf[1];
+        $results[$s]['model'] = $ar_buf[2];
+        $results[$s]['media'] = 'Hard Disk';
+      } elseif (preg_match("/$this->scsi_regexp2/", $buf, $ar_buf)) {
+        $s = $ar_buf[1];
+        $results[$s]['capacity'] = $ar_buf[2] * 2048 * 1.049;
+      }
+    } 
+    // return array_values(array_unique($results));
+    // 1. more useful to have device names
+    // 2. php 4.1.1 array_unique() deletes non-unique values.
+    asort($results);
+    return $results;
+  } 
+
+  // get the pci device information out of dmesg
+  function pci () {
+    $results = array();
+
+    if($buf = execute_program("pciconf", "-lv")) {
+	$buf = explode("\n", $buf); $s = 0;
+	foreach($buf as $line) {
+	    if (preg_match("/(.*) = '(.*)'/", $line, $strings)) {
+		if (trim($strings[1]) == "vendor") {
+		    $results[$s] = trim($strings[2]);
+		} elseif (trim($strings[1]) == "device") {
+		    $results[$s] .= " - " . trim($strings[2]);
+		    $s++;
+		}
+	    }
+	}
+    } else {
+	for ($i = 0, $s = 0; $i < count($this->read_dmesg()); $i++) {
+	    $buf = $this->dmesg[$i];
+	    if (preg_match('/(.*): <(.*)>(.*) pci[0-9]$/', $buf, $ar_buf)) {
+		$results[$s++] = $ar_buf[1] . ": " . $ar_buf[2];
+	    } elseif (preg_match('/(.*): <(.*)>.* at [.0-9]+ irq/', $buf, $ar_buf)) {
+		$results[$s++] = $ar_buf[1] . ": " . $ar_buf[2];
+	    }
+	} 
+	$results = array_unique($results);
+    }
+    asort($results);
+    return $results;
+  } 
+
+  // get the ide device information out of dmesg
+  function ide () {
+    $results = array();
+
+    $s = 0;
+    for ($i = 0, $max = count($this->read_dmesg()); $i < $max; $i++) {
+      $buf = $this->dmesg[$i];
+
+      if (preg_match('/^(ad[0-9]+): (.*)MB <(.*)> (.*) (.*)/', $buf, $ar_buf)) {
+        $s = $ar_buf[1];
+        $results[$s]['model'] = $ar_buf[3];
+        $results[$s]['media'] = 'Hard Disk';
+        $results[$s]['capacity'] = $ar_buf[2] * 2048 * 1.049;
+      } elseif (preg_match('/^(acd[0-9]+): (.*) <(.*)> (.*)/', $buf, $ar_buf)) {
+        $s = $ar_buf[1];
+        $results[$s]['model'] = $ar_buf[3];
+        $results[$s]['media'] = 'CD-ROM';
+      }
+    } 
+    // return array_values(array_unique($results));
+    // 1. more useful to have device names
+    // 2. php 4.1.1 array_unique() deletes non-unique values.
+    asort($results);
+    return $results;
+  } 
+
+  // place holder function until we add acual usb detection
+  function usb () {
+    return array();
+  } 
+
+  function sbus () {
+    $results = array();
+    $_results[0] = "";
+    // TODO. Nothing here yet. Move along.
+    $results = $_results;
+    return $results;
+  }
+
+  function memory () {
+    $s = $this->grab_key('hw.physmem');
+
+    if (PHP_OS == 'FreeBSD' || PHP_OS == 'OpenBSD') {
+      // vmstat on fbsd 4.4 or greater outputs kbytes not hw.pagesize
+      // I should probably add some version checking here, but for now
+      // we only support fbsd 4.4
+      $pagesize = 1024;
+    } else {
+      $pagesize = $this->grab_key('hw.pagesize');
+    } 
+
+    $results['ram'] = array();
+
+    $pstat = execute_program('vmstat');
+    $lines = split("\n", $pstat);
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i], 19);
+
+      if ($i == 2) {
+        $results['ram']['free'] = $ar_buf[5] * $pagesize / 1024;
+      } 
+    } 
+
+    $results['ram']['total'] = $s / 1024;
+    $results['ram']['shared'] = 0;
+    $results['ram']['buffers'] = 0;
+    $results['ram']['used'] = $results['ram']['total'] - $results['ram']['free'];
+    $results['ram']['cached'] = 0;
+    $results['ram']['t_used'] = $results['ram']['used'];
+    $results['ram']['t_free'] = $results['ram']['free'];
+
+    $results['ram']['percent'] = round(($results['ram']['used'] * 100) / $results['ram']['total']);
+
+    if (PHP_OS == 'OpenBSD') {
+      $pstat = execute_program('swapctl', '-l -k');
+    } else {
+      $pstat = execute_program('swapinfo', '-k');
+    } 
+
+    $lines = split("\n", $pstat);
+
+    $results['swap']['total'] = 0;
+    $results['swap']['used'] = 0;
+    $results['swap']['free'] = 0;
+
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i], 6);
+
+      if ($ar_buf[0] != 'Total') {
+        $results['swap']['total'] = $results['swap']['total'] + $ar_buf[1];
+        $results['swap']['used'] = $results['swap']['used'] + $ar_buf[2];
+        $results['swap']['free'] = $results['swap']['free'] + $ar_buf[3];
+      } 
+    } 
+    $results['swap']['percent'] = round(($results['swap']['used'] * 100) / $results['swap']['total']);
+
+    return $results;
+  } 
+
+  function filesystems () {
+    global $show_bind;
+    $fstype = array();
+    $fsoptions = array();
+
+    $df = execute_program('df', '-k');
+    $mounts = split("\n", $df);
+
+    $buffer = execute_program("mount");
+    $buffer = explode("\n", $buffer);
+
+    $j = 0;
+    foreach($buffer as $line) {
+      preg_match("/(.*) on (.*) \((.*)\)/", $line, $result);
+      list($result[3], $result[4]) = preg_split("/,\s/", $result[3], 2);
+      if (count($result) == 5) {
+        $dev = $result[1]; $mpoint = $result[2]; $type = $result[3]; $options = $result[4];
+        $fstype[$mpoint] = $type; $fsdev[$dev] = $type; $fsoptions[$mpoint] = $options;
+
+       if ($dev == "devfs")
+         continue;
+        foreach ($mounts as $line2) {
+          if (preg_match("#^" . $result[1] . "#", $line2)) {
+            $line2 = preg_replace("#^" . $result[1] . "#", "", $line2);
+            $ar_buf = preg_split("/(\s+)/", $line2, 6);
+            $ar_buf[0] = $result[1];
+
+            if (hide_mount($ar_buf[5]) || $ar_buf[0] == "") {
+              continue;
+            }
+
+            if ($show_bind || !stristr($fsoptions[$ar_buf[5]], "bind")) {
+              $results[$j] = array();
+              $results[$j]['disk'] = $ar_buf[0];
+              $results[$j]['size'] = $ar_buf[1];
+              $results[$j]['used'] = $ar_buf[2];
+              $results[$j]['free'] = $ar_buf[3];
+              $results[$j]['percent'] = round(($results[$j]['used'] * 100) / $results[$j]['size']) . '%';
+              $results[$j]['mount'] = $ar_buf[5];
+              ($fstype[$ar_buf[5]]) ? $results[$j]['fstype'] = $fstype[$ar_buf[5]] : $results[$j]['fstype'] = $fsdev[$ar_buf[0]];
+              $results[$j]['options'] = $fsoptions[$ar_buf[5]];
+              $j++;
+            }
+          }
+        }
+      }
+    }
+    return $results;
+  }
+
+  function distro () { 
+    $distro = execute_program('uname', '-s');                             
+    $result = $distro;
+    return($result);               
+  }
+} 
+
+?>
diff --git a/www/include/options/sysInfos/includes/os/class.Darwin.inc.php b/www/include/options/sysInfos/includes/os/class.Darwin.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..8c4d3678ef9bf1cf36651f3625e087f69a41074e
--- /dev/null
+++ b/www/include/options/sysInfos/includes/os/class.Darwin.inc.php
@@ -0,0 +1,233 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.Darwin.inc.php,v 1.22 2005/11/22 14:30:28 bigmichi1 Exp $
+if (!defined('IN_PHPSYSINFO')) {
+    die("No Hacking");
+}
+
+require_once(APP_ROOT . '/includes/os/class.BSD.common.inc.php');
+
+echo "<p align=center><b>Note: The Darwin version of phpSysInfo is work in progress, some things currently don't work</b></p>";
+
+class sysinfo extends bsd_common {
+  var $cpu_regexp;
+  var $scsi_regexp; 
+  // Our contstructor
+  // this function is run on the initialization of this class
+  function sysinfo () {
+    // $this->cpu_regexp = "CPU: (.*) \((.*)-MHz (.*)\)";
+    // $this->scsi_regexp1 = "^(.*): <(.*)> .*SCSI.*device";
+  } 
+
+  function grab_key ($key) {
+    $s = execute_program('sysctl', $key);
+    $s = ereg_replace($key . ': ', '', $s);
+    $s = ereg_replace($key . ' = ', '', $s); // fix Apple set keys
+    
+    return $s;
+  } 
+
+  function grab_ioreg ($key) {
+    $s = execute_program('ioreg', '-cls "' . $key . '" | grep "' . $key . '"'); //ioreg -cls "$key" | grep "$key"
+    $s = ereg_replace('\|', '', $s);
+    $s = ereg_replace('\+\-\o', '', $s);
+    $s = ereg_replace('[ ]+', '', $s);
+    $s = ereg_replace('<[^>]+>', '', $s); // remove possible XML conflicts
+
+    return $s;
+  } 
+
+  function get_sys_ticks () {
+    $a = execute_program('sysctl', '-n kern.boottime'); // get boottime (value in seconds) 
+    $sys_ticks = time() - $a;
+
+    return $sys_ticks;
+  } 
+
+  function cpu_info () {
+    $results = array(); 
+    // $results['model'] = $this->grab_key('hw.model'); // need to expand this somehow...
+    // $results['model'] = $this->grab_key('hw.machine');
+    $results['model'] = ereg_replace('Processor type: ', '', execute_program('hostinfo', '| grep "Processor type"')); // get processor type
+    $results['cpus'] = $this->grab_key('hw.ncpu');
+    $results['cpuspeed'] = round($this->grab_key('hw.cpufrequency') / 1000000); // return cpu speed - Mhz
+    $results['busspeed'] = round($this->grab_key('hw.busfrequency') / 1000000); // return bus speed - Mhz
+    $results['cache'] = round($this->grab_key('hw.l2cachesize') / 1024); // return l2 cache
+    
+    return $results;
+  } 
+  // get the pci device information out of ioreg
+  function pci () {
+    $results = array();
+    $s = $this->grab_ioreg('IOPCIDevice');
+
+    $lines = split("\n", $s);
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i], 19);
+      $results[$i] = $ar_buf[0];
+    } 
+    asort($results);
+    return array_values(array_unique($results));
+  } 
+  // get the ide device information out of ioreg
+  function ide () {
+    $results = array(); 
+    // ioreg | grep "Media  <class IOMedia>"
+    $s = $this->grab_ioreg('IOATABlockStorageDevice'); 
+
+    $lines = split("\n", $s);
+    $j = 0;
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\/\//", $lines[$i], 19);
+
+      if ($ar_buf[1] == 'class IOMedia' && preg_match('/Media/', $ar_buf[0])) {
+        $results[$j++]['model'] = $ar_buf[0];
+      } 
+    } 
+    asort($results);
+    return array_values(array_unique($results));
+  } 
+
+  function memory () {
+    $s = $this->grab_key('hw.physmem');
+
+    $results['ram'] = array();
+
+    $pstat = execute_program('vm_stat'); // use darwin's vm_stat
+    $lines = split("\n", $pstat);
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i], 19);
+
+      if ($i == 1) {
+        $results['ram']['free'] = $ar_buf[2] * 4; // calculate free memory from page sizes (each page = 4MB)
+      } 
+    } 
+
+    $results['ram']['total'] = $s / 1024;
+    $results['ram']['shared'] = 0;
+    $results['ram']['buffers'] = 0;
+    $results['ram']['used'] = $results['ram']['total'] - $results['ram']['free'];
+    $results['ram']['cached'] = 0;
+    $results['ram']['t_used'] = $results['ram']['used'];
+    $results['ram']['t_free'] = $results['ram']['free'];
+
+    $results['ram']['percent'] = round(($results['ram']['used'] * 100) / $results['ram']['total']); 
+    // need to fix the swap info...
+    $pstat = execute_program('swapinfo', '-k');
+    $lines = split("\n", $pstat);
+
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i], 6);
+
+      if ($i == 0) {
+        $results['swap']['total'] = 0;
+        $results['swap']['used'] = 0;
+        $results['swap']['free'] = 0;
+      } else {
+        $results['swap']['total'] = $results['swap']['total'] + $ar_buf[1];
+        $results['swap']['used'] = $results['swap']['used'] + $ar_buf[2];
+        $results['swap']['free'] = $results['swap']['free'] + $ar_buf[3];
+      } 
+    } 
+    $results['swap']['percent'] = round(($results['swap']['used'] * 100) / $results['swap']['total']);
+
+    return $results;
+  } 
+
+  function network () {
+    $netstat = execute_program('netstat', '-nbdi | cut -c1-24,42- | grep Link');
+    $lines = split("\n", $netstat);
+    $results = array();
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i]);
+      if (!empty($ar_buf[0])) {
+        $results[$ar_buf[0]] = array();
+
+        $results[$ar_buf[0]]['rx_bytes'] = $ar_buf[5];
+        $results[$ar_buf[0]]['rx_packets'] = $ar_buf[3];
+        $results[$ar_buf[0]]['rx_errs'] = $ar_buf[4];
+        $results[$ar_buf[0]]['rx_drop'] = $ar_buf[10];
+
+        $results[$ar_buf[0]]['tx_bytes'] = $ar_buf[8];
+        $results[$ar_buf[0]]['tx_packets'] = $ar_buf[6];
+        $results[$ar_buf[0]]['tx_errs'] = $ar_buf[7];
+        $results[$ar_buf[0]]['tx_drop'] = $ar_buf[10];
+
+        $results[$ar_buf[0]]['errs'] = $ar_buf[4] + $ar_buf[7];
+        $results[$ar_buf[0]]['drop'] = $ar_buf[10];
+      } 
+    } 
+    return $results;
+  } 
+
+  function filesystems () {
+    $df = execute_program('df', '-k');
+    $mounts = split("\n", $df);
+    $fstype = array();
+
+    $s = execute_program('mount');
+    $lines = explode("\n", $s);
+
+    $i = 0;
+    while (list(, $line) = each($lines)) {
+      ereg('(.*) \((.*)\)', $line, $a);
+
+      $m = explode(' ', $a[0]);
+      $fsdev[$m[0]] = $a[2];
+    } 
+
+    for ($i = 1, $j = 0, $max = sizeof($mounts); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $mounts[$i], 6);
+
+      switch ($ar_buf[0]) {
+        case 'automount': // skip the automount entries
+        case 'devfs': // skip the dev filesystem
+        case 'fdesc': // skip the fdesc
+        case 'procfs': // skip the proc filesystem
+        case '<volfs>': // skip the vol filesystem
+          continue 2;
+          break;
+      } 
+      if (hide_mount($ar_buf[5])) {
+        continue;
+      }													
+
+      $results[$j] = array();
+
+      $results[$j]['disk'] = $ar_buf[0];
+      $results[$j]['size'] = $ar_buf[1];
+      $results[$j]['used'] = $ar_buf[2];
+      $results[$j]['free'] = $ar_buf[3];
+      $results[$j]['percent'] = $ar_buf[4];
+      $results[$j]['mount'] = $ar_buf[5];
+      ($fstype[$ar_buf[5]]) ? $results[$j]['fstype'] = $fstype[$ar_buf[5]] : $results[$j]['fstype'] = $fsdev[$ar_buf[0]];
+      $j++;
+    } 
+    return $results;
+  } 
+  
+  function distroicon () {
+    $result = 'Darwin.png';
+    return($result);
+  }
+
+} 
+
+?>
diff --git a/www/include/options/sysInfos/includes/os/class.FreeBSD.inc.php b/www/include/options/sysInfos/includes/os/class.FreeBSD.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..3d176b9f5b2351a1be8fcfbb89eb67952ff01071
--- /dev/null
+++ b/www/include/options/sysInfos/includes/os/class.FreeBSD.inc.php
@@ -0,0 +1,92 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.FreeBSD.inc.php,v 1.13 2005/11/22 14:30:28 bigmichi1 Exp $
+if (!defined('IN_PHPSYSINFO')) {
+    die("No Hacking");
+}
+
+require_once(APP_ROOT . '/includes/os/class.BSD.common.inc.php');
+
+class sysinfo extends bsd_common {
+  var $cpu_regexp;
+  var $scsi_regexp; 
+  // Our contstructor
+  // this function is run on the initialization of this class
+  function sysinfo () {
+    $this->cpu_regexp = "CPU: (.*) \((.*)-MHz (.*)\)";
+    $this->scsi_regexp1 = "^(.*): <(.*)> .*SCSI.*device";
+    $this->scsi_regexp2 = "^(da[0-9]): (.*)MB ";
+  } 
+
+  function get_sys_ticks () {
+    $s = explode(' ', $this->grab_key('kern.boottime'));
+    $a = ereg_replace('{ ', '', $s[3]);
+    $sys_ticks = time() - $a;
+    return $sys_ticks;
+  } 
+
+  function network () {
+    $netstat = execute_program('netstat', '-nibd | grep Link');
+    $lines = split("\n", $netstat);
+    $results = array();
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i]);
+      if (!empty($ar_buf[0])) {
+        $results[$ar_buf[0]] = array();
+
+        if (strlen($ar_buf[3]) < 15) {
+          $results[$ar_buf[0]]['rx_bytes'] = $ar_buf[5];
+          $results[$ar_buf[0]]['rx_packets'] = $ar_buf[3];
+          $results[$ar_buf[0]]['rx_errs'] = $ar_buf[4];
+          $results[$ar_buf[0]]['rx_drop'] = $ar_buf[10];
+
+          $results[$ar_buf[0]]['tx_bytes'] = $ar_buf[8];
+          $results[$ar_buf[0]]['tx_packets'] = $ar_buf[6];
+          $results[$ar_buf[0]]['tx_errs'] = $ar_buf[7];
+          $results[$ar_buf[0]]['tx_drop'] = $ar_buf[10];
+
+          $results[$ar_buf[0]]['errs'] = $ar_buf[4] + $ar_buf[7];
+          $results[$ar_buf[0]]['drop'] = $ar_buf[10];
+        } else {
+          $results[$ar_buf[0]]['rx_bytes'] = $ar_buf[6];
+          $results[$ar_buf[0]]['rx_packets'] = $ar_buf[4];
+          $results[$ar_buf[0]]['rx_errs'] = $ar_buf[5];
+          $results[$ar_buf[0]]['rx_drop'] = $ar_buf[11];
+
+          $results[$ar_buf[0]]['tx_bytes'] = $ar_buf[9];
+          $results[$ar_buf[0]]['tx_packets'] = $ar_buf[7];
+          $results[$ar_buf[0]]['tx_errs'] = $ar_buf[8];
+          $results[$ar_buf[0]]['tx_drop'] = $ar_buf[11];
+
+          $results[$ar_buf[0]]['errs'] = $ar_buf[5] + $ar_buf[8];
+          $results[$ar_buf[0]]['drop'] = $ar_buf[11];
+        } 
+      } 
+    } 
+    return $results;
+  } 
+
+  function distroicon () {
+    $result = 'FreeBSD.png';
+    return($result);
+  }
+} 
+
+?>
diff --git a/www/include/options/sysInfos/includes/os/class.HP-UX.inc.php b/www/include/options/sysInfos/includes/os/class.HP-UX.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..458786c3d9abd5924c5392f3d4895ba55dcba05c
--- /dev/null
+++ b/www/include/options/sysInfos/includes/os/class.HP-UX.inc.php
@@ -0,0 +1,419 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.HP-UX.inc.php,v 1.15 2005/11/22 14:30:28 bigmichi1 Exp $
+
+class sysinfo {
+  // get our apache SERVER_NAME or vhost
+  function vhostname () {
+    if (! ($result = getenv('SERVER_NAME'))) {
+      $result = 'N.A.';
+    } 
+    return $result;
+  } 
+  // get our canonical hostname
+  function chostname () {
+    return execute_program('hostname');
+  } 
+  // get the IP address of our canonical hostname
+  function ip_addr () {
+    if (!($result = getenv('SERVER_ADDR'))) {
+      $result = gethostbyname($this->chostname());
+    } 
+    return $result;
+  } 
+
+  function kernel () {
+    return execute_program('uname', '-srvm');
+  } 
+
+  function uptime () {
+    $result = 0;
+    $ar_buf = array();
+
+    $buf = execute_program('uptime');
+    if (preg_match("/up (\d+) days,\s*(\d+):(\d+),/", $buf, $ar_buf)) {
+      $min = $ar_buf[3];
+      $hours = $ar_buf[2];
+      $days = $ar_buf[1];
+      $result = $days * 86400 + $hours * 3600 + $min * 60;
+    } 
+
+    return $result;
+  } 
+
+  function users () {
+    $who = split('=', execute_program('who', '-q'));
+    $result = $who[1];
+    return $result;
+  } 
+
+  function loadavg ($bar = false) {
+    $ar_buf = array();
+
+    $buf = execute_program('uptime');
+
+    if (preg_match("/average: (.*), (.*), (.*)$/", $buf, $ar_buf)) {
+      $results['avg'] = array($ar_buf[1], $ar_buf[2], $ar_buf[3]);
+    } else {
+      $results['avg'] = array('N.A.', 'N.A.', 'N.A.');
+    } 
+    return $results;
+  } 
+
+  function cpu_info () {
+    $results = array();
+    $ar_buf = array();
+
+    if ($fd = fopen('/proc/cpuinfo', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        list($key, $value) = preg_split('/\s+:\s+/', trim($buf), 2); 
+        // All of the tags here are highly architecture dependant.
+        // the only way I could reconstruct them for machines I don't
+        // have is to browse the kernel source.  So if your arch isn't
+        // supported, tell me you want it written in.
+        switch ($key) {
+          case 'model name':
+            $results['model'] = $value;
+            break;
+          case 'cpu MHz':
+            $results['cpuspeed'] = sprintf('%.2f', $value);
+            break;
+          case 'cycle frequency [Hz]': // For Alpha arch - 2.2.x
+            $results['cpuspeed'] = sprintf('%.2f', $value / 1000000);
+            break;
+          case 'clock': // For PPC arch (damn borked POS)
+            $results['cpuspeed'] = sprintf('%.2f', $value);
+            break;
+          case 'cpu': // For PPC arch (damn borked POS)
+            $results['model'] = $value;
+            break;
+          case 'revision': // For PPC arch (damn borked POS)
+            $results['model'] .= ' ( rev: ' . $value . ')';
+            break;
+          case 'cpu model': // For Alpha arch - 2.2.x
+            $results['model'] .= ' (' . $value . ')';
+            break;
+          case 'cache size':
+            $results['cache'] = $value;
+            break;
+          case 'bogomips':
+            $results['bogomips'] += $value;
+            break;
+          case 'BogoMIPS': // For alpha arch - 2.2.x
+            $results['bogomips'] += $value;
+            break;
+          case 'BogoMips': // For sparc arch
+            $results['bogomips'] += $value;
+            break;
+          case 'cpus detected': // For Alpha arch - 2.2.x
+            $results['cpus'] += $value;
+            break;
+          case 'system type': // Alpha arch - 2.2.x
+            $results['model'] .= ', ' . $value . ' ';
+            break;
+          case 'platform string': // Alpha arch - 2.2.x
+            $results['model'] .= ' (' . $value . ')';
+            break;
+          case 'processor':
+            $results['cpus'] += 1;
+            break;
+        } 
+      } 
+      fclose($fd);
+    } 
+
+    $keys = array_keys($results);
+    $keys2be = array('model', 'cpuspeed', 'cache', 'bogomips', 'cpus');
+
+    while ($ar_buf = each($keys2be)) {
+      if (! in_array($ar_buf[1], $keys)) {
+        $results[$ar_buf[1]] = 'N.A.';
+      } 
+    } 
+    return $results;
+  } 
+
+  function pci () {
+    $results = array();
+
+    if ($fd = fopen('/proc/pci', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/Bus/', $buf)) {
+          $device = 1;
+          continue;
+        } 
+
+        if ($device) {
+          list($key, $value) = split(': ', $buf, 2);
+
+          if (!preg_match('/bridge/i', $key) && !preg_match('/USB/i', $key)) {
+            $results[] = preg_replace('/\([^\)]+\)\.$/', '', trim($value));
+          } 
+          $device = 0;
+        } 
+      } 
+    } 
+    asort($results);
+    return $results;
+  } 
+
+  function ide () {
+    $results = array();
+
+    $handle = opendir('/proc/ide');
+
+    while ($file = readdir($handle)) {
+      if (preg_match('/^hd/', $file)) {
+        $results[$file] = array(); 
+        // Check if device is CD-ROM (CD-ROM capacity shows as 1024 GB)
+        if ($fd = fopen("/proc/ide/$file/media", 'r')) {
+          $results[$file]['media'] = trim(fgets($fd, 4096));
+          if ($results[$file]['media'] == 'disk') {
+            $results[$file]['media'] = 'Hard Disk';
+          } 
+
+          if ($results[$file]['media'] == 'cdrom') {
+            $results[$file]['media'] = 'CD-ROM';
+          } 
+          fclose($fd);
+        } 
+
+        if ($fd = fopen("/proc/ide/$file/model", 'r')) {
+          $results[$file]['model'] = trim(fgets($fd, 4096));
+          if (preg_match('/WDC/', $results[$file]['model'])) {
+            $results[$file]['manufacture'] = 'Western Digital';
+          } elseif (preg_match('/IBM/', $results[$file]['model'])) {
+            $results[$file]['manufacture'] = 'IBM';
+          } elseif (preg_match('/FUJITSU/', $results[$file]['model'])) {
+            $results[$file]['manufacture'] = 'Fujitsu';
+          } else {
+            $results[$file]['manufacture'] = 'Unknown';
+          } 
+
+          fclose($fd);
+        } 
+
+        if ($fd = fopen("/proc/ide/$file/capacity", 'r')) {
+          $results[$file]['capacity'] = trim(fgets($fd, 4096));
+          if ($results[$file]['media'] == 'CD-ROM') {
+            unset($results[$file]['capacity']);
+          } 
+          fclose($fd);
+        } 
+      } 
+    } 
+    closedir($handle);
+
+    asort($results);
+    return $results;
+  } 
+
+  function scsi () {
+    $results = array();
+    $dev_vendor = '';
+    $dev_model = '';
+    $dev_rev = '';
+    $dev_type = '';
+    $s = 1;
+
+    if ($fd = fopen('/proc/scsi/scsi', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/Vendor/', $buf)) {
+          preg_match('/Vendor: (.*) Model: (.*) Rev: (.*)/i', $buf, $dev);
+          list($key, $value) = split(': ', $buf, 2);
+          $dev_str = $value;
+          $get_type = 1;
+          continue;
+        } 
+
+        if ($get_type) {
+          preg_match('/Type:\s+(\S+)/i', $buf, $dev_type);
+          $results[$s]['model'] = "$dev[1] $dev[2] ($dev_type[1])";
+          $results[$s]['media'] = "Hard Disk";
+          $s++;
+          $get_type = 0;
+        } 
+      } 
+    } 
+    asort($results);
+    return $results;
+  } 
+
+  function usb () {
+    $results = array();
+    $devstring = 0;
+    $devnum = -1;
+
+    if ($fd = fopen('/proc/bus/usb/devices', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/^T/', $buf)) {
+          $devnum += 1;
+        } 
+        if (preg_match('/^S/', $buf)) {
+          $devstring = 1;
+        } 
+
+        if ($devstring) {
+          list($key, $value) = split(': ', $buf, 2);
+          list($key, $value2) = split('=', $value, 2);
+          $results[$devnum] .= " " . trim($value2);
+          $devstring = 0;
+        } 
+      } 
+    } 
+    return $results;
+  } 
+
+  function sbus () {
+    $results = array();
+    $_results[0] = "";
+    // TODO. Nothing here yet. Move along.
+    $results = $_results;
+    return $results;
+  }
+
+  function network () {
+    $netstat = execute_program('netstat', '-ni | tail -n +2');
+    $lines = split("\n", $netstat);
+    $results = array();
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i]);
+      if (!empty($ar_buf[0]) && !empty($ar_buf[3])) {
+        $results[$ar_buf[0]] = array();
+
+        $results[$ar_buf[0]]['rx_bytes'] = $ar_buf[4];
+        $results[$ar_buf[0]]['rx_packets'] = $ar_buf[4];
+        $results[$ar_buf[0]]['rx_errs'] = $ar_buf[5];
+        $results[$ar_buf[0]]['rx_drop'] = $ar_buf[8];
+
+        $results[$ar_buf[0]]['tx_bytes'] = $ar_buf[6];
+        $results[$ar_buf[0]]['tx_packets'] = $ar_buf[6];
+        $results[$ar_buf[0]]['tx_errs'] = $ar_buf[7];
+        $results[$ar_buf[0]]['tx_drop'] = $ar_buf[8];
+
+        $results[$ar_buf[0]]['errs'] = $ar_buf[5] + $ar_buf[7];
+        $results[$ar_buf[0]]['drop'] = $ar_buf[8];
+      } 
+    } 
+    return $results;
+  } 
+  function memory () {
+    if ($fd = fopen('/proc/meminfo', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/Mem:\s+(.*)$/', $buf, $ar_buf)) {
+          $ar_buf = preg_split('/\s+/', $ar_buf[1], 6);
+
+          $results['ram'] = array();
+
+          $results['ram']['total'] = $ar_buf[0] / 1024;
+          $results['ram']['used'] = $ar_buf[1] / 1024;
+          $results['ram']['free'] = $ar_buf[2] / 1024;
+          $results['ram']['shared'] = $ar_buf[3] / 1024;
+          $results['ram']['buffers'] = $ar_buf[4] / 1024;
+          $results['ram']['cached'] = $ar_buf[5] / 1024; 
+          // I don't like this since buffers and cache really aren't
+          // 'used' per say, but I get too many emails about it.
+          $results['ram']['t_used'] = $results['ram']['used'];
+          $results['ram']['t_free'] = $results['ram']['total'] - $results['ram']['t_used'];
+          $results['ram']['percent'] = round(($results['ram']['t_used'] * 100) / $results['ram']['total']);
+        } 
+
+        if (preg_match('/Swap:\s+(.*)$/', $buf, $ar_buf)) {
+          $ar_buf = preg_split('/\s+/', $ar_buf[1], 3);
+
+          $results['swap'] = array();
+
+          $results['swap']['total'] = $ar_buf[0] / 1024;
+          $results['swap']['used'] = $ar_buf[1] / 1024;
+          $results['swap']['free'] = $ar_buf[2] / 1024;
+          $results['swap']['percent'] = round(($ar_buf[1] * 100) / $ar_buf[0]); 
+          // Get info on individual swap files
+          $swaps = file ('/proc/swaps');
+          $swapdevs = split("\n", $swaps);
+
+          for ($i = 1, $max = (sizeof($swapdevs) - 1); $i < $max; $i++) {
+            $ar_buf = preg_split('/\s+/', $swapdevs[$i], 6);
+
+            $results['devswap'][$i - 1] = array();
+            $results['devswap'][$i - 1]['dev'] = $ar_buf[0];
+            $results['devswap'][$i - 1]['total'] = $ar_buf[2];
+            $results['devswap'][$i - 1]['used'] = $ar_buf[3];
+            $results['devswap'][$i - 1]['free'] = ($results['devswap'][$i - 1]['total'] - $results['devswap'][$i - 1]['used']);
+            $results['devswap'][$i - 1]['percent'] = round(($ar_buf[3] * 100) / $ar_buf[2]);
+          } 
+          break;
+        } 
+      } 
+      fclose($fd);
+    } else {
+      $results['ram'] = array();
+      $results['swap'] = array();
+      $results['devswap'] = array();
+    } 
+    return $results;
+  } 
+
+  function filesystems () {
+    $df = execute_program('df', '-kP');
+    $mounts = split("\n", $df);
+    $fstype = array();
+
+    $s = execute_program('mount', '-v');
+    $lines = explode("\n", $s);
+
+    $i = 0;
+    while (list(, $line) = each($lines)) {
+      $a = split(' ', $line);
+      $fsdev[$a[0]] = $a[4];
+    } 
+
+    for ($i = 1, $j = 0, $max = sizeof($mounts); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $mounts[$i], 6);
+
+      if (hide_mount($ar_buf[5])) {
+        continue;
+      }
+
+      $results[$j] = array();
+
+      $results[$j]['disk'] = $ar_buf[0];
+      $results[$j]['size'] = $ar_buf[1];
+      $results[$j]['used'] = $ar_buf[2];
+      $results[$j]['free'] = $ar_buf[3];
+      $results[$j]['percent'] = $ar_buf[4];
+      $results[$j]['mount'] = $ar_buf[5];
+      ($fstype[$ar_buf[5]]) ? $results[$j]['fstype'] = $fstype[$ar_buf[5]] : $results[$j]['fstype'] = $fsdev[$ar_buf[0]];
+      $j++;
+    } 
+    return $results;
+  } 
+  
+  function distro () {
+    $result = 'HP-UX';  	
+    return($result);
+  }
+
+  function distroicon () {
+    $result = 'unknown.png';
+    return($result);
+  }
+} 
+
+?>
diff --git a/www/include/options/sysInfos/includes/os/class.Linux.inc.php b/www/include/options/sysInfos/includes/os/class.Linux.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..f4a65fc5e179702afc6e41f3fe26a17006a960ba
--- /dev/null
+++ b/www/include/options/sysInfos/includes/os/class.Linux.inc.php
@@ -0,0 +1,533 @@
+<?php 
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+// $Id: class.Linux.inc.php,v 1.58 2005/12/06 15:58:55 bigmichi1 Exp $
+class sysinfo {
+  var $inifile = "distros.ini";
+  var $icon = "unknown.png";
+  var $distro = "unknown";
+
+  // get the distro name and icon when create the sysinfo object
+  function sysinfo() {
+   $list = @parse_ini_file(APP_ROOT . "/" . $this->inifile, true);
+   if (!$list) {
+    return;
+   }
+   foreach ($list as $section => $distribution) {
+    if (!isset($distribution["Files"])) {
+     continue;
+    } else {
+     foreach (explode(";", $distribution["Files"]) as $filename) {
+      if (file_exists($filename)) {
+       $fd = fopen($filename, 'r');
+       $buf = fgets($fd, 1024);
+       fclose($fd);
+       $this->icon = isset($distribution["Image"]) ? $distribution["Image"] : $this->icon;
+       $this->distro = isset($distribution["Name"]) ? $distribution["Name"] . " " . trim($buf) : trim($buf);
+       break 2;
+      }
+     }
+    }
+   }
+  }
+
+  // get our apache SERVER_NAME or vhost
+  function vhostname () {
+    if (! ($result = getenv('SERVER_NAME'))) {
+      $result = 'N.A.';
+    } 
+    return $result;
+  } 
+  // get our canonical hostname
+  function chostname () {
+    if ($fp = fopen('/proc/sys/kernel/hostname', 'r')) {
+      $result = trim(fgets($fp, 4096));
+      fclose($fp);
+      $result = gethostbyaddr(gethostbyname($result));
+    } else {
+      $result = 'N.A.';
+    } 
+    return $result;
+  } 
+  // get the IP address of our canonical hostname
+  function ip_addr () {
+    if (!($result = getenv('SERVER_ADDR'))) {
+      $result = gethostbyname($this->chostname());
+    } 
+    return $result;
+  } 
+
+  function kernel () {
+    if ($fd = fopen('/proc/version', 'r')) {
+      $buf = fgets($fd, 4096);
+      fclose($fd);
+
+      if (preg_match('/version (.*?) /', $buf, $ar_buf)) {
+        $result = $ar_buf[1];
+
+        if (preg_match('/SMP/', $buf)) {
+          $result .= ' (SMP)';
+        } 
+      } else {
+        $result = 'N.A.';
+      } 
+    } else {
+      $result = 'N.A.';
+    } 
+    return $result;
+  } 
+  
+  function uptime () {
+    $fd = fopen('/proc/uptime', 'r');
+    $ar_buf = split(' ', fgets($fd, 4096));
+    fclose($fd);
+
+    $result = trim($ar_buf[0]);
+
+    return $result;
+  } 
+
+  function users () {
+    $who = split('=', execute_program('who', '-q'));
+    $result = $who[1];
+    return $result;
+  } 
+
+  function loadavg ($bar = false) {
+    if ($fd = fopen('/proc/loadavg', 'r')) {
+      $results['avg'] = preg_split("/\s/", fgets($fd, 4096),4);
+      unset($results['avg'][3]);	// don't need the extra values, only first three
+      fclose($fd);
+    } else {
+      $results['avg'] = array('N.A.', 'N.A.', 'N.A.');
+    } 
+    if ($bar) {
+      if ($fd = fopen('/proc/stat', 'r')) {
+	fscanf($fd, "%*s %Ld %Ld %Ld %Ld", $ab, $ac, $ad, $ae);
+	// Find out the CPU load
+	// user + sys = load 
+	// total = total
+	$load = $ab + $ac + $ad;	// cpu.user + cpu.sys
+	$total = $ab + $ac + $ad + $ae;	// cpu.total
+	fclose($fd);
+
+	// we need a second value, wait 1 second befor getting (< 1 second no good value will occour)
+	sleep(1);
+	$fd = fopen('/proc/stat', 'r');
+	fscanf($fd, "%*s %Ld %Ld %Ld %Ld", $ab, $ac, $ad, $ae);
+	$load2 = $ab + $ac + $ad;
+	$total2 = $ab + $ac + $ad + $ae;
+	$results['cpupercent'] = (100*($load2 - $load)) / ($total2 - $total);
+	fclose($fd);
+      }
+    }
+    return $results;
+  } 
+
+  function cpu_info () {
+    $results = array('cpus' => 0, 'bogomips' => 0);
+    $ar_buf = array();
+
+    if ($fd = fopen('/proc/cpuinfo', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+       if($buf != "\n") {
+        list($key, $value) = preg_split('/\s+:\s+/', trim($buf), 2); 
+        // All of the tags here are highly architecture dependant.
+        // the only way I could reconstruct them for machines I don't
+        // have is to browse the kernel source.  So if your arch isn't
+        // supported, tell me you want it written in.
+        switch ($key) {
+          case 'model name':
+            $results['model'] = $value;
+            break;
+          case 'cpu MHz':
+            $results['cpuspeed'] = sprintf('%.2f', $value);
+            break;
+          case 'cycle frequency [Hz]': // For Alpha arch - 2.2.x
+            $results['cpuspeed'] = sprintf('%.2f', $value / 1000000);
+            break;
+          case 'clock': // For PPC arch (damn borked POS)
+            $results['cpuspeed'] = sprintf('%.2f', $value);
+            break;
+          case 'cpu': // For PPC arch (damn borked POS)
+            $results['model'] = $value;
+            break;
+          case 'L2 cache': // More for PPC
+            $results['cache'] = $value;
+            break;
+          case 'revision': // For PPC arch (damn borked POS)
+            $results['model'] .= ' ( rev: ' . $value . ')';
+            break;
+          case 'cpu model': // For Alpha arch - 2.2.x
+            $results['model'] .= ' (' . $value . ')';
+            break;
+          case 'cache size':
+            $results['cache'] = $value;
+            break;
+          case 'bogomips':
+            $results['bogomips'] += $value;
+            break;
+          case 'BogoMIPS': // For alpha arch - 2.2.x
+            $results['bogomips'] += $value;
+            break;
+          case 'BogoMips': // For sparc arch
+            $results['bogomips'] += $value;
+            break;
+          case 'cpus detected': // For Alpha arch - 2.2.x
+            $results['cpus'] += $value;
+            break;
+          case 'system type': // Alpha arch - 2.2.x
+            $results['model'] .= ', ' . $value . ' ';
+            break;
+          case 'platform string': // Alpha arch - 2.2.x
+            $results['model'] .= ' (' . $value . ')';
+            break;
+          case 'processor':
+            $results['cpus'] += 1;
+            break;
+          case 'Cpu0ClkTck': // Linux sparc64
+            $results['cpuspeed'] = sprintf('%.2f', hexdec($value) / 1000000);
+            break;
+          case 'Cpu0Bogo': // Linux sparc64 & sparc32
+            $results['bogomips'] = $value;
+            break;
+          case 'ncpus probed': // Linux sparc64 & sparc32
+            $results['cpus'] = $value;
+            break;
+        } 
+       }
+      } 
+      fclose($fd);
+    } 
+
+    // sparc64 specific code follows
+    // This adds the ability to display the cache that a CPU has
+    // Originally made by Sven Blumenstein <bazik@gentoo.org> in 2004
+    // Modified by Tom Weustink <freshy98@gmx.net> in 2004
+    $sparclist = array('SUNW,UltraSPARC@0,0', 'SUNW,UltraSPARC-II@0,0', 'SUNW,UltraSPARC@1c,0', 'SUNW,UltraSPARC-IIi@1c,0', 'SUNW,UltraSPARC-II@1c,0');
+    foreach ($sparclist as $name) {
+      if (file_exists('/proc/openprom/' . $name . '/ecache-size')) {
+        $fd = fopen('/proc/openprom/' . $name . '/ecache-size', 'r');
+        $results['cache'] = base_convert(fgets($fd, 32), 16, 10)/1024 . ' KB';
+        fclose($fd);
+      }
+    }
+    // sparc64 specific code ends
+
+    $keys = array_keys($results);
+    $keys2be = array('model', 'cpuspeed', 'cache', 'bogomips', 'cpus');
+
+    while ($ar_buf = each($keys2be)) {
+      if (! in_array($ar_buf[1], $keys)) {
+        $results[$ar_buf[1]] = 'N.A.';
+      } 
+    } 
+    return $results;
+  } 
+
+  function pci () {
+    $results = array();
+
+    if ($_results = execute_program('lspci')) {
+      $lines = split("\n", $_results);
+      for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+        list($addr, $name) = explode(' ', trim($lines[$i]), 2);
+
+        if (!preg_match('/bridge/i', $name) && !preg_match('/USB/i', $name)) {
+          // remove all the version strings
+          $name = preg_replace('/\(.*\)/', '', $name);
+          $results[] = $addr . ' ' . $name;
+        } 
+      } 
+    } elseif ($fd = fopen('/proc/pci', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/Bus/', $buf)) {
+          $device = 1;
+          continue;
+        } 
+
+        if ($device) {
+          list($key, $value) = split(': ', $buf, 2);
+
+          if (!preg_match('/bridge/i', $key) && !preg_match('/USB/i', $key)) {
+            $results[] = preg_replace('/\([^\)]+\)\.$/', '', trim($value));
+          } 
+          $device = 0;
+        } 
+      } 
+    } 
+    asort($results);
+    return $results;
+  } 
+
+  function ide () {
+    $results = array();
+
+    $handle = opendir('/proc/ide');
+
+    while ($file = readdir($handle)) {
+      if (preg_match('/^hd/', $file)) {
+        $results[$file] = array(); 
+        // Check if device is CD-ROM (CD-ROM capacity shows as 1024 GB)
+        if ($fd = fopen("/proc/ide/$file/media", 'r')) {
+          $results[$file]['media'] = trim(fgets($fd, 4096));
+          if ($results[$file]['media'] == 'disk') {
+            $results[$file]['media'] = 'Hard Disk';
+          } 
+
+          if ($results[$file]['media'] == 'cdrom') {
+            $results[$file]['media'] = 'CD-ROM';
+          } 
+          fclose($fd);
+        } 
+
+        if ($fd = fopen("/proc/ide/$file/model", 'r')) {
+          $results[$file]['model'] = trim(fgets($fd, 4096));
+          if (preg_match('/WDC/', $results[$file]['model'])) {
+            $results[$file]['manufacture'] = 'Western Digital';
+          } elseif (preg_match('/IBM/', $results[$file]['model'])) {
+            $results[$file]['manufacture'] = 'IBM';
+          } elseif (preg_match('/FUJITSU/', $results[$file]['model'])) {
+            $results[$file]['manufacture'] = 'Fujitsu';
+          } else {
+            $results[$file]['manufacture'] = 'Unknown';
+          } 
+
+          fclose($fd);
+        } 
+	
+	if (file_exists("/proc/ide/$file/capacity"))
+	    $filename = "/proc/ide/$file/capacity";
+	elseif (file_exists("/sys/block/$file/size"))
+	    $filename = "/sys/block/$file/size";
+
+        if (isset($filename) && $fd = fopen("/proc/ide/$file/capacity", 'r')) {
+          $results[$file]['capacity'] = trim(fgets($fd, 4096));
+          if ($results[$file]['media'] == 'CD-ROM') {
+            unset($results[$file]['capacity']);
+          } 
+          fclose($fd);
+        } 
+      } 
+    } 
+    closedir($handle);
+
+    asort($results);
+    return $results;
+  } 
+
+  function scsi () {
+    $results = array();
+    $dev_vendor = '';
+    $dev_model = '';
+    $dev_rev = '';
+    $dev_type = '';
+    $s = 1;
+    $get_type = 0;
+
+    if ($fd = fopen('/proc/scsi/scsi', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/Vendor/', $buf)) {
+          preg_match('/Vendor: (.*) Model: (.*) Rev: (.*)/i', $buf, $dev);
+          list($key, $value) = split(': ', $buf, 2);
+          $dev_str = $value;
+          $get_type = 1;
+          continue;
+        } 
+
+        if ($get_type) {
+          preg_match('/Type:\s+(\S+)/i', $buf, $dev_type);
+          $results[$s]['model'] = "$dev[1] $dev[2] ($dev_type[1])";
+          $results[$s]['media'] = "Hard Disk";
+          $s++;
+          $get_type = 0;
+        } 
+      } 
+    } 
+    asort($results);
+    return $results;
+  } 
+
+  function usb () {
+    $results = array();
+    $devnum = -1;
+
+    if ($fd = fopen('/proc/bus/usb/devices', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/^T/', $buf)) {
+          $devnum += 1;
+	  $results[$devnum] = "";
+        } elseif (preg_match('/^S:/', $buf)) {
+          list($key, $value) = split(': ', $buf, 2);
+          list($key, $value2) = split('=', $value, 2);
+	  if (trim($key) != "SerialNumber") {
+            $results[$devnum] .= " " . trim($value2);
+            $devstring = 0;
+	  }
+        } 
+      } 
+    } 
+    return $results;
+  } 
+
+  function sbus () {
+    $results = array();
+    $_results[0] = ""; 
+    // TODO. Nothing here yet. Move along.
+    $results = $_results;
+    return $results;
+  } 
+
+  function network () {
+    $results = array();
+
+    if ($fd = fopen('/proc/net/dev', 'r')) {
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/:/', $buf)) {
+          list($dev_name, $stats_list) = preg_split('/:/', $buf, 2);
+          $stats = preg_split('/\s+/', trim($stats_list));
+          $results[$dev_name] = array();
+
+          $results[$dev_name]['rx_bytes'] = $stats[0];
+          $results[$dev_name]['rx_packets'] = $stats[1];
+          $results[$dev_name]['rx_errs'] = $stats[2];
+          $results[$dev_name]['rx_drop'] = $stats[3];
+
+          $results[$dev_name]['tx_bytes'] = $stats[8];
+          $results[$dev_name]['tx_packets'] = $stats[9];
+          $results[$dev_name]['tx_errs'] = $stats[10];
+          $results[$dev_name]['tx_drop'] = $stats[11];
+
+          $results[$dev_name]['errs'] = $stats[2] + $stats[10];
+          $results[$dev_name]['drop'] = $stats[3] + $stats[11];
+        } 
+      } 
+    } else {
+      echo "'/proc/net/dev' not readable";
+    }
+    return $results;
+  } 
+
+  function memory () {
+    if ($fd = fopen('/proc/meminfo', 'r')) {
+      $results['ram'] = array();
+      $results['swap'] = array();
+      $results['devswap'] = array();
+
+      while ($buf = fgets($fd, 4096)) {
+        if (preg_match('/^MemTotal:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
+          $results['ram']['total'] = $ar_buf[1];
+        } else if (preg_match('/^MemFree:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
+          $results['ram']['t_free'] = $ar_buf[1];
+        } else if (preg_match('/^Cached:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
+          $results['ram']['cached'] = $ar_buf[1];
+        } else if (preg_match('/^Buffers:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
+          $results['ram']['buffers'] = $ar_buf[1];
+        } else if (preg_match('/^SwapTotal:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
+          $results['swap']['total'] = $ar_buf[1];
+        } else if (preg_match('/^SwapFree:\s+(.*)\s*kB/i', $buf, $ar_buf)) {
+          $results['swap']['free'] = $ar_buf[1];
+        } 
+      } 
+      fclose($fd);
+
+      $results['ram']['t_used'] = $results['ram']['total'] - $results['ram']['t_free'];
+      $results['ram']['percent'] = round(($results['ram']['t_used'] * 100) / $results['ram']['total']);
+      $results['swap']['used'] = $results['swap']['total'] - $results['swap']['free'];
+      $results['swap']['percent'] = round(($results['swap']['used'] * 100) / $results['swap']['total']);
+      
+      // values for splitting memory usage
+      if (isset($results['ram']['cached']) && isset($results['ram']['buffers'])) {
+        $results['ram']['app'] = $results['ram']['t_used'] - $results['ram']['cached'] - $results['ram']['buffers'];
+	$results['ram']['app_percent'] = round(($results['ram']['app'] * 100) / $results['ram']['total']);
+	$results['ram']['buffers_percent'] = round(($results['ram']['buffers'] * 100) / $results['ram']['total']);
+	$results['ram']['cached_percent'] = round(($results['ram']['cached'] * 100) / $results['ram']['total']);
+      }
+
+      $swaps = file ('/proc/swaps');
+      for ($i = 1; $i < (sizeof($swaps)); $i++) {
+        $ar_buf = preg_split('/\s+/', $swaps[$i], 6);
+        $results['devswap'][$i - 1] = array();
+        $results['devswap'][$i - 1]['dev'] = $ar_buf[0];
+        $results['devswap'][$i - 1]['total'] = $ar_buf[2];
+        $results['devswap'][$i - 1]['used'] = $ar_buf[3];
+        $results['devswap'][$i - 1]['free'] = ($results['devswap'][$i - 1]['total'] - $results['devswap'][$i - 1]['used']);
+        $results['devswap'][$i - 1]['percent'] = round(($ar_buf[3] * 100) / $ar_buf[2]);
+      } 
+    } else {
+      $results['ram'] = array();
+      $results['swap'] = array();
+      $results['devswap'] = array();
+    }
+    return $results;
+  } 
+
+  function filesystems () {
+    global $show_bind;
+    $fstype = array();
+    $fsoptions = array();
+
+    $df = execute_program('df', '-kP');
+    $mounts = split("\n", $df);
+
+    $buffer = execute_program("mount");
+    $buffer = explode("\n", $buffer);
+
+    $j = 0;
+    foreach($buffer as $line) {
+      preg_match("/(.*) on (.*) type (.*) \((.*)\)/", $line, $result);
+      if (count($result) == 5) {
+        $dev = $result[1]; $mpoint = $result[2]; $type = $result[3]; $options = $result[4];
+        $fstype[$mpoint] = $type; $fsdev[$dev] = $type; $fsoptions[$mpoint] = $options;
+
+        foreach ($mounts as $line2) {
+          if (preg_match("#^" . $result[1] . "#", $line2)) {
+            $line2 = preg_replace("#^" . $result[1] . "#", "", $line2);
+            $ar_buf = preg_split("/(\s+)/", $line2, 6);
+            $ar_buf[0] = $result[1];
+
+            if (hide_mount($ar_buf[5]) || $ar_buf[0] == "") {
+              continue;
+            }
+
+            if ($show_bind || !stristr($fsoptions[$ar_buf[5]], "bind")) {
+              $results[$j] = array();
+              $results[$j]['disk'] = $ar_buf[0];
+              $results[$j]['size'] = $ar_buf[1];
+              $results[$j]['used'] = $ar_buf[2];
+              $results[$j]['free'] = $ar_buf[3];
+              $results[$j]['percent'] = round(($results[$j]['used'] * 100) / $results[$j]['size']) . '%';
+              $results[$j]['mount'] = $ar_buf[5];
+              ($fstype[$ar_buf[5]]) ? $results[$j]['fstype'] = $fstype[$ar_buf[5]] : $results[$j]['fstype'] = $fsdev[$ar_buf[0]];
+              $results[$j]['options'] = $fsoptions[$ar_buf[5]];
+              $j++;
+            }
+          }
+	}
+      }
+    }
+    return $results;
+  } 
+
+  function distro () {
+   return $this->distro;
+  }
+
+  function distroicon () {   
+   return $this->icon;
+  }
+
+} 
+
+?>
diff --git a/www/include/options/sysInfos/includes/os/class.NetBSD.inc.php b/www/include/options/sysInfos/includes/os/class.NetBSD.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..c3e167b0e0851820a8dd54ce0ab9fe5a9da7a188
--- /dev/null
+++ b/www/include/options/sysInfos/includes/os/class.NetBSD.inc.php
@@ -0,0 +1,153 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.NetBSD.inc.php,v 1.14 2005/11/22 14:30:28 bigmichi1 Exp $
+if (!defined('IN_PHPSYSINFO')) {
+    die("No Hacking");
+}
+
+require_once(APP_ROOT . '/includes/os/class.BSD.common.inc.php');
+
+class sysinfo extends bsd_common {
+  var $cpu_regexp;
+  var $scsi_regexp; 
+  // Our contstructor
+  // this function is run on the initialization of this class
+  function sysinfo () {
+    $this->cpu_regexp = "^cpu(.*)\, (.*) MHz";
+    $this->scsi_regexp1 = "^(.*) at scsibus.*: <(.*)> .*";
+    $this->scsi_regexp2 = "^(da[0-9]): (.*)MB ";
+  } 
+
+  function get_sys_ticks () {
+    $a = $this->grab_key('kern.boottime');
+    $sys_ticks = time() - $a;
+    return $sys_ticks;
+  } 
+  // get the pci device information out of dmesg
+  function pci () {
+    $results = array();
+
+    for ($i = 0, $max = count($this->read_dmesg()); $i < $max; $i++) {
+      $buf = $this->dmesg[$i];
+      if (preg_match('/(.*) at pci[0-9] dev [0-9]* function [0-9]*: (.*)$/', $buf, $ar_buf)) {
+        $results[$i] = $ar_buf[1] . ": " . $ar_buf[2];
+      } elseif (preg_match('/"(.*)" (.*).* at [.0-9]+ irq/', $buf, $ar_buf)) {
+        $results[$i] = $ar_buf[1] . ": " . $ar_buf[2];
+      } 
+    } 
+    asort($results);
+    return $results;
+  } 
+
+  function network () {
+    $netstat_b = execute_program('netstat', '-nbdi | cut -c1-25,44- | grep "^[a-z]*[0-9][ \t].*Link"');
+    $netstat_n = execute_program('netstat', '-ndi | cut -c1-25,44- | grep "^[a-z]*[0-9][ \t].*Link"');
+    $lines_b = split("\n", $netstat_b);
+    $lines_n = split("\n", $netstat_n);
+    $results = array();
+    for ($i = 0, $max = sizeof($lines_b); $i < $max; $i++) {
+      $ar_buf_b = preg_split("/\s+/", $lines_b[$i]);
+      $ar_buf_n = preg_split("/\s+/", $lines_n[$i]);
+      if (!empty($ar_buf_b[0]) && !empty($ar_buf_n[3])) {
+        $results[$ar_buf_b[0]] = array();
+
+        $results[$ar_buf_b[0]]['rx_bytes'] = $ar_buf_b[3];
+        $results[$ar_buf_b[0]]['rx_packets'] = $ar_buf_n[3];
+        $results[$ar_buf_b[0]]['rx_errs'] = $ar_buf_n[4];
+        $results[$ar_buf_b[0]]['rx_drop'] = $ar_buf_n[8];
+
+        $results[$ar_buf_b[0]]['tx_bytes'] = $ar_buf_b[4];
+        $results[$ar_buf_b[0]]['tx_packets'] = $ar_buf_n[5];
+        $results[$ar_buf_b[0]]['tx_errs'] = $ar_buf_n[6];
+        $results[$ar_buf_b[0]]['tx_drop'] = $ar_buf_n[8];
+
+        $results[$ar_buf_b[0]]['errs'] = $ar_buf_n[4] + $ar_buf_n[6];
+        $results[$ar_buf_b[0]]['drop'] = $ar_buf_n[8];
+      } 
+    } 
+    return $results;
+  } 
+
+  function memory () {
+    $s = $this->grab_key('hw.physmem');
+    $pagesize = $this->grab_key('hw.pagesize');
+
+    $results['ram'] = array();
+
+    $pstat = execute_program('vmstat', '-s');
+    $lines = split("\n", $pstat);
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i], 19);
+
+      if ($i == 3) {
+        $results['ram']['free'] = $ar_buf[1] * $pagesize / 1024;
+      } elseif ($i == 19) {
+        $results['swap']['total'] = $ar_buf[1] * $pagesize / 1024;
+      } elseif ($i == 20) {
+        $results['swap']['used'] = $ar_buf[1] * $pagesize / 1024;
+      } 
+    } 
+
+    $results['ram']['total'] = $s / 1024;
+    $results['ram']['shared'] = 0;
+    $results['ram']['buffers'] = 0;
+    $results['ram']['used'] = $results['ram']['total'] - $results['ram']['free'];
+    $results['ram']['cached'] = 0;
+    $results['ram']['t_used'] = $results['ram']['used'];
+    $results['ram']['t_free'] = $results['ram']['free'];
+    $results['ram']['percent'] = round(($results['ram']['used'] * 100) / $results['ram']['total']);
+
+    $results['swap']['free'] = $results['swap']['total'] - $results['swap']['used'];
+    $results['swap']['percent'] = round(($results['swap']['used'] * 100) / $results['swap']['total']);
+
+    return $results;
+  } 
+  // get the ide device information out of dmesg
+  function ide () {
+    $results = array();
+
+    $s = 0;
+    for ($i = 0, $max = count($this->read_dmesg()); $i < $max; $i++) {
+      $buf = $this->dmesg[$i];
+      if (preg_match('/^(.*) at (pciide|wdc)[0-9] (.*): <(.*)>/', $buf, $ar_buf)) {
+        $s = $ar_buf[1];
+        $results[$s]['model'] = $ar_buf[4];
+        $results[$s]['media'] = 'Hard Disk'; 
+        // now loop again and find the capacity
+        for ($j = 0, $max1 = count($this->read_dmesg()); $j < $max1; $j++) {
+          $buf_n = $this->dmesg[$j];
+          if (preg_match("/^($s): (.*), (.*), (.*)MB, .*$/", $buf_n, $ar_buf_n)) {
+            $results[$s]['capacity'] = $ar_buf_n[4] * 2048 * 1.049;;
+          } 
+        } 
+      } 
+    } 
+    asort($results);
+    return $results;
+  } 
+
+  function distroicon () {
+    $result = 'NetBSD.png';
+    return($result);
+  }
+  
+} 
+
+?>
diff --git a/www/include/options/sysInfos/includes/os/class.OpenBSD.inc.php b/www/include/options/sysInfos/includes/os/class.OpenBSD.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..cf51eb84f5d249ec065c61005954055c508e93e6
--- /dev/null
+++ b/www/include/options/sysInfos/includes/os/class.OpenBSD.inc.php
@@ -0,0 +1,120 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.OpenBSD.inc.php,v 1.18 2005/11/28 15:52:15 bigmichi1 Exp $
+if (!defined('IN_PHPSYSINFO')) {
+    die("No Hacking");
+}
+
+require_once(APP_ROOT . '/includes/os/class.BSD.common.inc.php');
+
+class sysinfo extends bsd_common {
+  var $cpu_regexp;
+  var $scsi_regexp; 
+  // Our contstructor
+  // this function is run on the initialization of this class
+  function sysinfo () {
+    $this->cpu_regexp = "^cpu(.*) (.*) MHz";
+    $this->scsi_regexp1 = "^(.*) at scsibus.*: <(.*)> .*";
+    $this->scsi_regexp2 = "^(da[0-9]): (.*)MB ";
+  } 
+
+  function get_sys_ticks () {
+    $a = $this->grab_key('kern.boottime');
+    $sys_ticks = time() - $a;
+    return $sys_ticks;
+  } 
+  // get the pci device information out of dmesg
+  function pci () {
+    $results = array();
+
+    for ($i = 0, $s = 0, $max = count($this->read_dmesg()); $i < $max; $i++) {
+      $buf = $this->dmesg[$i];
+      if (preg_match('/(.*) at pci[0-9] .* "(.*)"/', $buf, $ar_buf)) {
+        $results[$s++] = $ar_buf[1] . ": " . $ar_buf[2];
+      } elseif (preg_match('/"(.*)" (.*).* at [.0-9]+ irq/', $buf, $ar_buf)) {
+        $results[$s++] = $ar_buf[1] . ": " . $ar_buf[2];
+      } 
+    }
+
+    $results = array_unique($results);
+    asort($results);
+    return $results;
+  } 
+
+  function network () {
+    $netstat_b = execute_program('netstat', '-nbdi | cut -c1-25,44- | grep Link | grep -v \'* \'');
+    $netstat_n = execute_program('netstat', '-ndi | cut -c1-25,44- | grep Link | grep -v \'* \'');
+    $lines_b = split("\n", $netstat_b);
+    $lines_n = split("\n", $netstat_n);
+    $results = array();
+    for ($i = 0, $max = sizeof($lines_b); $i < $max; $i++) {
+      $ar_buf_b = preg_split("/\s+/", $lines_b[$i]);
+      $ar_buf_n = preg_split("/\s+/", $lines_n[$i]);
+      if (!empty($ar_buf_b[0]) && !empty($ar_buf_n[3])) {
+        $results[$ar_buf_b[0]] = array();
+
+        $results[$ar_buf_b[0]]['rx_bytes'] = $ar_buf_b[3];
+        $results[$ar_buf_b[0]]['rx_packets'] = $ar_buf_n[3];
+        $results[$ar_buf_b[0]]['rx_errs'] = $ar_buf_n[4];
+        $results[$ar_buf_b[0]]['rx_drop'] = $ar_buf_n[8];
+
+        $results[$ar_buf_b[0]]['tx_bytes'] = $ar_buf_b[4];
+        $results[$ar_buf_b[0]]['tx_packets'] = $ar_buf_n[5];
+        $results[$ar_buf_b[0]]['tx_errs'] = $ar_buf_n[6];
+        $results[$ar_buf_b[0]]['tx_drop'] = $ar_buf_n[8];
+
+        $results[$ar_buf_b[0]]['errs'] = $ar_buf_n[4] + $ar_buf_n[6];
+        $results[$ar_buf_b[0]]['drop'] = $ar_buf_n[8];
+      } 
+    } 
+    return $results;
+  } 
+  // get the ide device information out of dmesg
+  function ide () {
+    $results = array();
+
+    $s = 0;
+    for ($i = 0, $max = count($this->read_dmesg()); $i < $max; $i++) {
+      $buf = $this->dmesg[$i];
+      if (preg_match('/^(.*) at pciide[0-9] (.*): <(.*)>/', $buf, $ar_buf)) {
+        $s = $ar_buf[1];
+        $results[$s]['model'] = $ar_buf[3];
+        $results[$s]['media'] = 'Hard Disk'; 
+        // now loop again and find the capacity
+        for ($j = 0, $max1 = count($this->read_dmesg()); $j < $max1; $j++) {
+          $buf_n = $this->dmesg[$j];
+          if (preg_match("/^($s): (.*), (.*), (.*)MB, .*$/", $buf_n, $ar_buf_n)) {
+            $results[$s]['capacity'] = $ar_buf_n[4] * 2048 * 1.049;;
+          } 
+        } 
+      } 
+    } 
+    asort($results);
+    return $results;
+  } 
+
+  function distroicon () {
+    $result = 'OpenBSD.png';
+    return($result);
+  }
+  
+} 
+
+?>
diff --git a/www/include/options/sysInfos/includes/os/class.SunOS.inc.php b/www/include/options/sysInfos/includes/os/class.SunOS.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..38c017e606a75c598d26dd1c1aea9b7e63027f6b
--- /dev/null
+++ b/www/include/options/sysInfos/includes/os/class.SunOS.inc.php
@@ -0,0 +1,247 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: class.SunOS.inc.php,v 1.15 2005/12/07 05:09:39 bigmichi1 Exp $
+
+echo "<center><b>Note: The SunOS version of phpSysInfo is work in progress, some things currently don't work";
+
+class sysinfo {
+  // Extract kernel values via kstat() interface
+  function kstat ($key) {
+    $m = execute_program('kstat', "-p d $key");
+    list($key, $value) = split("\t", trim($m), 2);
+    return $value;
+  } 
+
+  function vhostname () {
+    if (! ($result = getenv('SERVER_NAME'))) {
+      $result = 'N.A.';
+    } 
+    return $result;
+  } 
+  // get our canonical hostname
+  function chostname () {
+    if ($result = execute_program('uname', '-n')) {
+      $result = gethostbyaddr(gethostbyname($result));
+    } else {
+      $result = 'N.A.';
+    } 
+    return $result;
+  } 
+  // get the IP address of our canonical hostname
+  function ip_addr () {
+    if (!($result = getenv('SERVER_ADDR'))) {
+      $result = gethostbyname($this->chostname());
+    } 
+    return $result;
+  } 
+
+  function kernel () {
+    $os = execute_program('uname', '-s');
+    $version = execute_program('uname', '-r');
+    return $os . ' ' . $version;
+  } 
+
+  function uptime () {
+    $result = time() - $this->kstat('unix:0:system_misc:boot_time');
+
+    return $result;
+  } 
+
+  function users () {
+    $who = split('=', execute_program('who', '-q'));
+    $result = $who[1];
+    return $result;
+  } 
+
+  function loadavg ($bar = false) {
+    $load1 = $this->kstat('unix:0:system_misc:avenrun_1min');
+    $load5 = $this->kstat('unix:0:system_misc:avenrun_5min');
+    $load15 = $this->kstat('unix:0:system_misc:avenrun_15min');
+    $results['avg'] = array($load1, $load5, $load15);
+    return $results;
+  } 
+
+  function cpu_info () {
+    $results = array();
+    $ar_buf = array();
+
+    $results['model'] = execute_program('uname', '-i');
+    $results['cpuspeed'] = $this->kstat('cpu_info:0:cpu_info0:clock_MHz');
+    $results['cache'] = $this->kstat('cpu_info:0:cpu_info0:cpu_type');
+    $results['bogomips'] = 1;
+    $results['cpus'] = $this->kstat('unix:0:system_misc:ncpus');
+
+    $keys = array_keys($results);
+    $keys2be = array('model', 'cpuspeed', 'cache', 'bogomips', 'cpus');
+
+    while ($ar_buf = each($keys2be)) {
+      if (! in_array($ar_buf[1], $keys)) {
+        $results[$ar_buf[1]] = 'N.A.';
+      } 
+    } 
+    return $results;
+  } 
+
+  function pci () {
+    // FIXME
+    $results = array();
+    return $results;
+  } 
+
+  function ide () {
+    // FIXME
+    $results = array();
+    return $results;
+  } 
+
+  function scsi () {
+    // FIXME
+    $results = array();
+    return $results;
+  } 
+
+  function usb () {
+    // FIXME
+    $results = array();
+    return $results;
+  } 
+
+  function sbus () {
+    $results = array();
+    $_results[0] = "";
+    // TODO. Nothing here yet. Move along.
+    $results = $_results;
+    return $results;
+  }
+
+  function network () {
+    $results = array();
+
+    $netstat = execute_program('netstat', '-ni | awk \'(NF ==10){print;}\'');
+    $lines = split("\n", $netstat);
+    $results = array();
+    for ($i = 0, $max = sizeof($lines); $i < $max; $i++) {
+      $ar_buf = preg_split("/\s+/", $lines[$i]);
+      if ((!empty($ar_buf[0])) && ($ar_buf[0] != 'Name')) {
+        $results[$ar_buf[0]] = array();
+
+        $results[$ar_buf[0]]['rx_bytes'] = 0;
+        $results[$ar_buf[0]]['rx_packets'] = $ar_buf[4];
+        $results[$ar_buf[0]]['rx_errs'] = $ar_buf[5];
+        $results[$ar_buf[0]]['rx_drop'] = 0;
+
+        $results[$ar_buf[0]]['tx_bytes'] = 0;
+        $results[$ar_buf[0]]['tx_packets'] = $ar_buf[6];
+        $results[$ar_buf[0]]['tx_errs'] = $ar_buf[7];
+        $results[$ar_buf[0]]['tx_drop'] = 0;
+
+        $results[$ar_buf[0]]['errs'] = $ar_buf[5] + $ar_buf[
+        7];
+        $results[$ar_buf[0]]['drop'] = 0;
+
+        preg_match('/^(\D+)(\d+)$/', $ar_buf[0], $intf);
+        $prefix = $intf[1] . ':' . $intf[2] . ':' . $intf[1] . $intf[2] . ':';
+        $cnt = $this->kstat($prefix . 'drop');
+
+        if ($cnt > 0) {
+          $results[$ar_buf[0]]['rx_drop'] = $cnt;
+        } 
+        $cnt = $this->kstat($prefix . 'obytes64');
+
+        if ($cnt > 0) {
+          $results[$ar_buf[0]]['tx_bytes'] = $cnt;
+        } 
+        $cnt = $this->kstat($prefix . 'rbytes64');
+
+        if ($cnt > 0) {
+          $results[$ar_buf[0]]['rx_bytes'] = $cnt;
+        }
+      } 
+    } 
+    return $results;
+  } 
+
+  function memory () {
+    $results['devswap'] = array();
+
+    $results['ram'] = array();
+
+    $pagesize = $this->kstat('unix:0:seg_cache:slab_size');
+    $results['ram']['total'] = $this->kstat('unix:0:system_pages:pagestotal') * $pagesize;
+    $results['ram']['used'] = $this->kstat('unix:0:system_pages:pageslocked') * $pagesize;
+    $results['ram']['free'] = $this->kstat('unix:0:system_pages:pagesfree') * $pagesize;
+    $results['ram']['shared'] = 0;
+    $results['ram']['buffers'] = 0;
+    $results['ram']['cached'] = 0;
+
+    $results['ram']['t_used'] = $results['ram']['used'] - $results['ram']['cached'] - $results['ram']['buffers'];
+    $results['ram']['t_free'] = $results['ram']['total'] - $results['ram']['t_used'];
+    $results['ram']['percent'] = round(($results['ram']['used'] * 100) / $results['ram']['total']);
+
+    $results['swap'] = array();
+    $results['swap']['total'] = $this->kstat('unix:0:vminfo:swap_avail') / 1024;
+    $results['swap']['used'] = $this->kstat('unix:0:vminfo:swap_alloc') / 1024;
+    $results['swap']['free'] = $this->kstat('unix:0:vminfo:swap_free') / 1024;
+    $results['swap']['percent'] = round(($ar_buf[1] * 100) / $ar_buf[0]);
+    $results['swap']['percent'] = round(($results['swap']['used'] * 100) / $results['swap']['total']);
+    return $results;
+  } 
+
+  function filesystems () {
+    $df = execute_program('df', '-k');
+    $mounts = split("\n", $df);
+
+    $dftypes = execute_program('df', '-n');
+    $mounttypes = split("\n", $dftypes);
+
+    for ($i = 1, $j = 0, $max = sizeof($mounts); $i < $max; $i++) {
+      $ar_buf = preg_split('/\s+/', $mounts[$i], 6);
+      $ty_buf = split(':', $mounttypes[$i-1], 2);
+
+      if (hide_mount($ar_buf[5])) {
+        continue;
+      }
+
+      $results[$j] = array();
+
+      $results[$j]['disk'] = $ar_buf[0];
+      $results[$j]['size'] = $ar_buf[1];
+      $results[$j]['used'] = $ar_buf[2];
+      $results[$j]['free'] = $ar_buf[3];
+      $results[$j]['percent'] = round(($results[$j]['used'] * 100) / $results[$j]['size']) . '%';
+      $results[$j]['mount'] = $ar_buf[5];
+      $results[$j]['fstype'] = $ty_buf[1];
+      $j++;
+    } 
+    return $results;
+  } 
+  
+  function distro () {
+    $result = 'SunOS';  	
+    return($result);
+  }
+
+  function distroicon () {
+    $result = 'unknown.png';
+    return($result);
+  }
+} 
+
+?>
diff --git a/www/include/options/sysInfos/includes/os/class.WINNT.inc.php b/www/include/options/sysInfos/includes/os/class.WINNT.inc.php
new file mode 100644
index 0000000000000000000000000000000000000000..dd652469aa287888434d8aa4e7e8acaf53c6dc77
--- /dev/null
+++ b/www/include/options/sysInfos/includes/os/class.WINNT.inc.php
@@ -0,0 +1,291 @@
+<?php 
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+// WINNT implementation written by Carl C. Longnecker, longneck@iname.com
+// $Id: class.WINNT.inc.php,v 1.13 2005/12/07 15:47:03 bigmichi1 Exp $
+class sysinfo {
+  // winnt needs some special prep
+  // $wmi holds the COM object that we pull all the WMI data from
+  var $wmi; 
+  // this constructor initialis the $wmi object
+  function sysinfo ()
+  {
+    $this->wmi = new COM("WinMgmts:\\\\.");
+  } 
+
+  // get our canonical hostname
+  function chostname ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_ComputerSystem");
+    foreach ($objInstance as $obj) {
+        $result = $obj->DNSHostName;
+    }
+    return $result;
+  }
+
+  // get the IP address of our canonical hostname
+  function ip_addr ()
+  {
+    if (!($result = gethostbyname($this->chostname()))) {
+      $result = 'N.A.';
+    }
+    return $result;
+  }
+
+  function kernel ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_OperatingSystem");
+    foreach ($objInstance as $obj) {
+      $result = $obj->Version;
+      if ($obj->ServicePackMajorVersion > 0) {
+        $result .= ' SP' . $obj->ServicePackMajorVersion;
+      } 
+    } 
+    return $result;
+  } 
+
+  function uptime ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_OperatingSystem");
+    foreach ($objInstance as $obj) {
+      $result = 0;
+
+      $year = intval(substr($obj->LastBootUpTime, 0, 4));
+      $month = intval(substr($obj->LastBootUpTime, 4, 2));
+      $day = intval(substr($obj->LastBootUpTime, 6, 2));
+      $hour = intval(substr($obj->LastBootUpTime, 8, 2));
+      $minute = intval(substr($obj->LastBootUpTime, 10, 2));
+      $seconds = intval(substr($obj->LastBootUpTime, 12, 2));
+
+      $boottime = mktime($hour, $minute, $seconds, $month, $day, $year);
+
+      $diff_seconds = mktime() - $boottime;
+
+      $result = $diff_seconds;
+    } 
+    return $result;
+  } 
+
+  function users ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_PerfRawData_TermService_TerminalServices");
+    foreach ($objInstance as $obj) {
+      return $obj->TotalSessions;
+    } 
+  } 
+
+  function loadavg ($bar = false)
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_Processor");
+
+    $cpuload = array();
+    foreach ($objInstance as $obj) {
+      $cpuload['avg'][] = $obj->LoadPercentage;
+    }
+    if ($bar) {
+      $cpuload['cpupercent'] = array_sum($cpuload['avg']);
+    } 
+    // while
+    return $cpuload;
+  } 
+
+  function cpu_info ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_Processor");
+    $results['cpus'] = 0;
+    foreach ($objInstance as $obj) {
+      // still need bogomips (wtf are bogomips?)
+      $results['cpus']++;
+      $results['model'] = $obj->Name;
+      $results['cache'] = $obj->L2CacheSize;
+      $results['cpuspeed'] = $obj->CurrentClockSpeed;
+      $results['busspeed'] = $obj->ExtClock;
+    } 
+    return $results;
+  } 
+
+  function pci ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_PnPEntity");
+
+    $pci = array();
+    foreach ($objInstance as $obj) {
+      if (substr($obj->PNPDeviceID, 0, 4) == "PCI\\") {
+        $pci[] = $obj->Name;
+      } 
+    } // while
+    return $pci;
+  } 
+
+  function ide ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_PnPEntity");
+
+    $ide = array();
+    foreach ($objInstance as $obj) {
+      if (substr($obj->PNPDeviceID, 0, 4) == "IDE\\") {
+        $ide[]['model'] = $obj->Name;
+      } 
+    } // while
+    return $ide;
+  } 
+
+  function scsi ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_PnPEntity");
+
+    $scsi = array();
+    foreach ($objInstance as $obj) {
+      if (substr($obj->PNPDeviceID, 0, 5) == "SCSI\\") {
+        $scsi[] = $obj->Name;
+      } 
+    } // while
+    return $scsi;
+  } 
+
+  function usb ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_PnPEntity");
+
+    $usb = array();
+    foreach ($objInstance as $obj) {
+      if (substr($obj->PNPDeviceID, 0, 4) == "USB\\") {
+        $usb[] = $obj->Name;
+      } 
+    } // while
+    return $usb;
+  } 
+
+  function sbus ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_PnPEntity");
+
+    $sbus = array();
+    foreach ($objInstance as $obj) {
+      if (substr($obj->PNPDeviceID, 0, 5) == "SBUS\\") {
+        $sbus[] = $obj->Name;
+      } 
+    } // while
+    return $sbus;
+  } 
+
+  function network ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_PerfRawData_Tcpip_NetworkInterface");
+
+    $results = array();
+    foreach ($objInstance as $obj) {
+      $dev_name = $obj->Name;
+      // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_perfrawdata_tcpip_networkinterface.asp
+      $results[$dev_name]['rx_bytes'] = $obj->BytesReceivedPersec;
+      $results[$dev_name]['rx_packets'] = $obj->PacketsReceivedPersec;
+      $results[$dev_name]['rx_errs'] = $obj->PacketsReceivedErrors;
+      $results[$dev_name]['rx_drop'] = $obj->PacketsReceivedDiscarded;
+
+      $results[$dev_name]['tx_bytes'] = $obj->BytesSentPersec;
+      $results[$dev_name]['tx_packets'] = $obj->PacketsSentPersec;
+
+      $results[$dev_name]['errs'] = $obj->PacketsReceivedErrors;
+      $results[$dev_name]['drop'] = $obj->PacketsReceivedDiscarded;
+    }
+    return $results;
+  } 
+
+  function memory ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_LogicalMemoryConfiguration");
+    foreach ($objInstance as $obj) {
+      $results['ram']['total'] = $obj->TotalPhysicalMemory;
+    } 
+    $objInstance = $this->wmi->InstancesOf("Win32_PerfRawData_PerfOS_Memory");
+    foreach ($objInstance as $obj) {
+      $results['ram']['free'] = $obj->AvailableKBytes;
+    } 
+    $results['ram']['used'] = $results['ram']['total'] - $results['ram']['free'];
+    $results['ram']['t_used'] = $results['ram']['used'];
+    $results['ram']['t_free'] = $results['ram']['total'] - $results['ram']['t_used'];
+    $results['ram']['percent'] = round(($results['ram']['t_used'] * 100) / $results['ram']['total']);
+
+    $results['swap']['total'] = 0;
+    $results['swap']['used'] = 0;
+    $results['swap']['free'] = 0;
+
+    $objInstance = $this->wmi->InstancesOf("Win32_PageFileUsage");
+
+    $k = 0;
+    foreach ($objInstance as $obj) {
+      $results['devswap'][$k]['dev'] = $obj->Name;
+      $results['devswap'][$k]['total'] = $obj->AllocatedBaseSize * 1024;
+      $results['devswap'][$k]['used'] = $obj->CurrentUsage * 1024;
+      $results['devswap'][$k]['free'] = ($obj->AllocatedBaseSize - $obj->CurrentUsage) * 1024;
+      $results['devswap'][$k]['percent'] = $obj->CurrentUsage / $obj->AllocatedBaseSize;
+
+      $results['swap']['total'] += $results['devswap'][$k]['total'];
+      $results['swap']['used'] += $results['devswap'][$k]['used'];
+      $results['swap']['free'] += $results['devswap'][$k]['free'];
+      $k += 1;
+    } 
+
+    $results['swap']['percent'] = round($results['swap']['used'] / $results['swap']['total'] * 100);
+
+    return $results;
+  } 
+
+  function filesystems ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_LogicalDisk");
+
+    $k = 0;
+    foreach ($objInstance as $obj) {
+      if (hide_mount($obj->Name)){
+        continue;
+      }
+      $results[$k]['mount'] = $obj->Name;
+      $results[$k]['size'] = $obj->Size / 1024;
+      $results[$k]['used'] = ($obj->Size - $obj->FreeSpace) / 1024;
+      $results[$k]['free'] = $obj->FreeSpace / 1024;
+      $results[$k]['percent'] = round($results[$k]['used'] / $results[$k]['size'] * 100);
+      $results[$k]['fstype'] = $obj->FileSystem;
+
+      $typearray = array("Unknown", "No Root Directory", "Removeable Disk",
+        "Local Disk", "Network Drive", "Compact Disc", "RAM Disk");
+      $floppyarray = array("Unknown", "5 1/4 in.", "3 1/2 in.", "3 1/2 in.",
+        "3 1/2 in.", "3 1/2 in.", "5 1/4 in.", "5 1/4 in.", "5 1/4 in.",
+        "5 1/4 in.", "5 1/4 in.", "Other", "HD", "3 1/2 in.", "3 1/2 in.",
+        "5 1/4 in.", "5 1/4 in.", "3 1/2 in.", "3 1/2 in.", "5 1/4 in.",
+        "3 1/2 in.", "3 1/2 in.", "8 in.");
+
+      $results[$k]['disk'] = $typearray[$obj->DriveType];
+      if ($obj->DriveType == 2) $results[$k]['disk'] .= " (" . $floppyarray[$obj->MediaType] . ")";
+      $k += 1;
+    } 
+
+    return $results;
+  } 
+
+  function distro ()
+  {
+    $objInstance = $this->wmi->InstancesOf("Win32_OperatingSystem");
+    foreach ($objInstance as $obj) {
+      return $obj->Caption;
+    } 
+  } 
+
+  function distroicon ()
+  {
+    return 'xp.gif';
+  } 
+} 
+
+?>
diff --git a/www/include/options/sysInfos/includes/os/index.html b/www/include/options/sysInfos/includes/os/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/includes/system_footer.php b/www/include/options/sysInfos/includes/system_footer.php
new file mode 100644
index 0000000000000000000000000000000000000000..1b8730c0e2bea7d373820cfb30561d6e27c0e65f
--- /dev/null
+++ b/www/include/options/sysInfos/includes/system_footer.php
@@ -0,0 +1,104 @@
+<?php 
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: system_footer.php,v 1.44 2005/12/10 12:30:19 bigmichi1 Exp $
+//
+if (!defined('IN_PHPSYSINFO')) {
+    die("No Hacking");
+}
+  /*
+if (!$hide_picklist) {
+  echo "<center>";
+
+
+  $update_form = "<form method=\"POST\" action=\"" . $_SERVER['PHP_SELF'] . "\">\n" . "\t" . $text['template'] . ":&nbsp;\n" . "\t<select name=\"template\">\n";
+
+  $dir = opendir(APP_ROOT . '/templates/');
+  while (false !== ($file = readdir($dir))) {
+    if ($file != 'CVS' && $file[0] != '.' && is_dir(APP_ROOT . '/templates/' . $file)) {
+      $filelist[] = $file;
+    } 
+  } 
+  closedir($dir);
+
+  asort($filelist);
+
+  while (list ($key, $val) = each ($filelist)) {
+    if ($_COOKIE['template'] == $val) {
+      $update_form .= "\t\t<option value=\"$val\" SELECTED>$val</option>\n";
+    } else {
+      $update_form .= "\t\t<option value=\"$val\">$val</option>\n";
+    } 
+  } 
+
+  $update_form .= "\t\t<option value=\"xml\">XML</option>\n";
+  // auto select the random template, if we're set to random
+  $update_form .= "\t\t<option value=\"random\"";
+  if ($_COOKIE['template']=='random') {
+    $update_form .= " SELECTED";
+  } 
+  $update_form .= ">random</option>\n";
+
+  $update_form .= "\t</select>\n";
+
+  $update_form .= "\t&nbsp;&nbsp;" . $text['language'] . ":&nbsp;\n" . "\t<select name=\"lng\">\n";
+
+  unset($filelist);
+
+  $dir = opendir(APP_ROOT . '/includes/lang/');
+  while (false !== ($file = readdir($dir))) {
+    if ($file[0] != '.' && is_file(APP_ROOT . '/includes/lang/' . $file) && eregi("\.php$", $file)) {
+      $filelist[] = eregi_replace('.php', '', $file);
+    } 
+  } 
+  closedir($dir);
+
+  asort($filelist);
+
+  while (list ($key, $val) = each ($filelist)) {
+    if ($_COOKIE['lng'] == $val) {
+      $update_form .= "\t\t<option value=\"$val\" SELECTED>$val</option>\n";
+    } else {
+      $update_form .= "\t\t<option value=\"$val\">$val</option>\n";
+    } 
+  } 
+	
+	$update_form .= "\t\t<option value=\"browser\"";
+  if ($_COOKIE['lng']=='browser') {
+    $update_form .= " SELECTED";
+  } 
+  $update_form .= ">browser default</option>\n";
+	
+  $update_form .= "\t</select>\n" . "\t<input type=\"submit\" value=\"" . $text['submit'] . "\">\n" . "</form>\n";
+
+  echo $update_form;
+
+  echo "\n\n</center>";
+} else {
+  echo "\n\n<br>";
+} 
+
+echo "\n<hr>\n" . $text['created'];
+ 
+*/
+
+echo '&nbsp;<a href="http://phpsysinfo.sourceforge.net" target="_blank">phpSysInfo-' . $VERSION . '</a> ';
+
+echo "\n<br>\n</body>\n</html>\n";
+?>
\ No newline at end of file
diff --git a/www/include/options/sysInfos/includes/system_header.php b/www/include/options/sysInfos/includes/system_header.php
new file mode 100644
index 0000000000000000000000000000000000000000..8ec3e882f76c9364642aed8764c3fd1ffb043d1f
--- /dev/null
+++ b/www/include/options/sysInfos/includes/system_header.php
@@ -0,0 +1,64 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: system_header.php,v 1.27 2005/12/10 15:54:41 bigmichi1 Exp $
+
+
+if (!defined('IN_PHPSYSINFO')) {
+    die("No Hacking");
+}
+
+header("Cache-Control: no-cache, must-revalidate");
+if (!isset($charset)) {
+  $charset = 'iso-8859-1';
+} 
+
+setlocale (LC_ALL, $text['locale']);
+
+header('Content-Type: text/html; charset=' . $charset);
+
+global $XPath;
+/*
+
+echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
+echo "<html>\n";
+echo created_by();
+echo "<head>\n";
+echo "  <title>" . $text['title'], " -- ", $XPath->getData('/phpsysinfo/Vitals/Hostname'), " --</title>\n";
+
+if (isset($charset) && $charset == 'euc-jp') {
+    echo "  <meta http-equiv=\"content-type\" content=\"text/html;charset=$charset\">\n";
+}
+if (isset($refresh) && ($refresh = intval($refresh))) {
+  echo "  <meta http-equiv=\"Refresh\" content=\"$refresh\">\n";
+}
+
+if (file_exists(APP_ROOT . "/templates/$template/$template.css")) {
+  echo "  <link rel=\"stylesheet\" type=\"text/css\" href=\"" . $webpath . "templates/" . $template . "/" . $template . ".css\">\n";
+}
+
+echo "</head>\n";
+
+if (file_exists(APP_ROOT . "/templates/$template/images/$template" . "_background.gif")) {
+  echo "<body background=\"" . $webpath . "templates/" . $template . "/images/" . $template . "_background.gif\">";
+} else {
+  echo "<body>\n";
+}
+*/
+?>
diff --git a/www/include/options/sysInfos/includes/xml/filesystems.php b/www/include/options/sysInfos/includes/xml/filesystems.php
new file mode 100644
index 0000000000000000000000000000000000000000..bc9d7ba24f66ba305107acd212770ac475146b86
--- /dev/null
+++ b/www/include/options/sysInfos/includes/xml/filesystems.php
@@ -0,0 +1,131 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: filesystems.php,v 1.24 2005/12/10 15:54:56 bigmichi1 Exp $
+
+//
+// xml_filesystems()
+//
+function xml_filesystems () {
+    global $sysinfo;
+    global $show_mount_point;
+    
+    $fs = $sysinfo->filesystems();
+
+    $_text = "  <FileSystem>\n";
+    for ($i=0, $max = sizeof($fs); $i < $max; $i++) {
+        $_text .= "    <Mount>\n";
+        $_text .= "      <MountPointID>" . htmlspecialchars($i, ENT_QUOTES) . "</MountPointID>\n";
+
+        if ($show_mount_point) {
+          $_text .= "      <MountPoint>" . htmlspecialchars($fs[$i]['mount'], ENT_QUOTES) . "</MountPoint>\n";
+        }
+
+        $_text .= "      <Type>" . htmlspecialchars($fs[$i]['fstype'], ENT_QUOTES) . "</Type>\n"
+                . "      <Device><Name>" . htmlspecialchars($fs[$i]['disk'], ENT_QUOTES) . "</Name></Device>\n"
+                . "      <Percent>" . htmlspecialchars($fs[$i]['percent'], ENT_QUOTES) . "</Percent>\n"
+                . "      <Free>" . htmlspecialchars($fs[$i]['free'], ENT_QUOTES) . "</Free>\n"
+                . "      <Used>" . htmlspecialchars($fs[$i]['used'], ENT_QUOTES) . "</Used>\n"
+                . "      <Size>" . htmlspecialchars($fs[$i]['size'], ENT_QUOTES) . "</Size>\n";
+	if (isset($fs[$i]['options']))
+	    $_text .= "      <Options>" . htmlspecialchars($fs[$i]['options'], ENT_QUOTES) . "</Options>\n";
+        $_text  .= "    </Mount>\n";
+    }
+    $_text .= "  </FileSystem>\n";
+    return $_text;
+}
+
+//
+// html_filesystems()
+//
+function html_filesystems () {
+    global $XPath;
+    global $text;
+    global $show_mount_point;
+    
+    $textdir = direction();
+    
+    $sum = array("size" => 0, "used" => 0, "free" => 0);
+
+    $counted_devlist = array();
+    $scale_factor = 2;
+
+    $_text  = "<table border=\"0\" width=\"100%\" align=\"center\">\n";
+    $_text .= "  <tr>\n";
+
+    if ($show_mount_point) {
+      $_text .= "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['mount'] . "</b></font></td>\n";
+    }
+
+    $_text .= "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['type'] . "</b></font></td>\n"
+            . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['partition'] . "</b></font></td>\n"
+            . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['percent'] . "</b></font></td>\n"
+            . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['free'] . "</b></font></td>\n"
+            . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['used'] . "</b></font></td>\n"
+            . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['size'] . "</b></font></td>\n  </tr>\n";
+
+    for ($i=1, $max = sizeof($XPath->getDataParts('/phpsysinfo/FileSystem')); $i < $max; $i++) {
+        if ($XPath->match("/phpsysinfo/FileSystem/Mount[$i]/MountPointID")) {
+	  if (!$XPath->match("/phpsysinfo/FileSystem/Mount[$i]/Options") || !stristr($XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Options"), "bind")) {
+	    if (!in_array($XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Device/Name"), $counted_devlist)) {
+              $sum['size'] += $XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Size");
+              $sum['used'] += $XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Used");
+              $sum['free'] += $XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Free");
+	      if (PHP_OS != "WINNT")
+	        $counted_devlist[] = $XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Device/Name");
+	      else
+	        $counted_devlist[] = $XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/MountPoint");
+	    }
+	  }
+            $_text .= "  <tr>\n";
+
+            if ($show_mount_point) {
+              $_text .= "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/MountPoint") . "</font></td>\n";
+            }
+            $_text .= "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Type") . "</font></td>\n"
+                    . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Device/Name") . "</font></td>\n"
+                    . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">"
+                    . create_bargraph($XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Used"), $XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Size"), $scale_factor, $XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Type"))
+                    . "&nbsp;" . $XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Percent") . "</font></td>\n"
+                    . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Free")) . "</font></td>\n"
+                    . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Used")) . "</font></td>\n"
+                    . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/FileSystem/Mount[$i]/Size")) . "</font></td>\n"
+                    . "  </tr>\n";
+        }
+    }
+
+    $_text .= "  <tr>\n";
+
+    if ($show_mount_point) {
+      $_text .= "  <td colspan=\"3\" align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><i>" . $text['totals'] . " :&nbsp;&nbsp;</i></font></td>\n";
+    } else {
+      $_text .= "  <td colspan=\"2\" align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><i>" . $text['totals'] . " :&nbsp;&nbsp;</i></font></td>\n";
+    }
+
+    $_text .= "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">"
+            . create_bargraph($sum['used'], $sum['size'], $scale_factor)
+            . "&nbsp;" . round(100 / $sum['size'] *  $sum['used']) . "%" .  "</font></td>\n"
+            . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($sum['free']) . "</font></td>\n"
+            . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($sum['used']) . "</font></td>\n"
+            . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($sum['size']) . "</font></td>\n  </tr>\n"
+            . "</table>\n";
+
+    return $_text;
+}
+?>
diff --git a/www/include/options/sysInfos/includes/xml/hardware.php b/www/include/options/sysInfos/includes/xml/hardware.php
new file mode 100644
index 0000000000000000000000000000000000000000..4436aa3335add5906b5910428f0902ccbc75b104
--- /dev/null
+++ b/www/include/options/sysInfos/includes/xml/hardware.php
@@ -0,0 +1,252 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: hardware.php,v 1.28 2005/12/10 15:54:56 bigmichi1 Exp $
+
+function xml_hardware (&$hddtemp_devices)
+{
+    global $sysinfo;
+    global $text;
+    $pci_devices = ""; $ide_devices = ""; $usb_devices = ""; $scsi_devices = "";    
+
+    $sys = $sysinfo->cpu_info();
+
+    $ar_buf = $sysinfo->pci();
+
+    if (count($ar_buf)) {
+        for ($i = 0, $max = sizeof($ar_buf); $i < $max; $i++) {
+            if ($ar_buf[$i]) {
+                $pci_devices .= "      <Device><Name>" . htmlspecialchars(chop($ar_buf[$i]), ENT_QUOTES) . "</Name></Device>\n";
+            } 
+        } 
+    } 
+
+    $ar_buf = $sysinfo->ide();
+
+    ksort($ar_buf);
+
+    if (count($ar_buf)) {
+        while (list($key, $value) = each($ar_buf)) {
+            $ide_devices .= "      <Device>\n<Name>" . htmlspecialchars($key . ': ' . $ar_buf[$key]['model'], ENT_QUOTES) . "</Name>\n";
+            if (isset($ar_buf[$key]['capacity'])) {
+                $ide_devices .= '<Capacity>' . htmlspecialchars($ar_buf[$key]['capacity'], ENT_QUOTES) . '</Capacity>';
+            }
+	    $hddtemp_devices[] = $key;
+	    $ide_devices .= "</Device>\n";
+        } 
+    } 
+
+    $ar_buf = $sysinfo->scsi();
+    ksort($ar_buf);
+
+    if (count($ar_buf)) {
+        while (list($key, $value) = each($ar_buf)) {
+	    $scsi_devices .= "<Device>\n";
+            if ($key >= '0' && $key <= '9') {
+                $scsi_devices .= "      <Name>" . htmlspecialchars($ar_buf[$key]['model'], ENT_QUOTES) . "</Name>\n";
+            } else {
+                $scsi_devices .= "      <Name>" . htmlspecialchars($key . ': ' . $ar_buf[$key]['model'], ENT_QUOTES) . "</Name>\n";
+            } 
+            if (isset($ar_buf[$key]['capacity'])) {
+                $scsi_devices .= '<Capacity>' . htmlspecialchars($ar_buf[$key]['capacity'], ENT_QUOTES) . '</Capacity>';
+            } 
+            $scsi_devices .= "</Device>\n";
+        } 
+    } 
+
+    $ar_buf = $sysinfo->usb();
+
+    if (count($ar_buf)) {
+        for ($i = 0, $max = sizeof($ar_buf); $i < $max; $i++) {
+            if ($ar_buf[$i]) {
+                $usb_devices .= "      <Device><Name>" . htmlspecialchars(chop($ar_buf[$i]), ENT_QUOTES) . "</Name></Device>\n";
+            } 
+        } 
+    } 
+
+/* disabled since we output this information
+    $ar_buf = $sysinfo->sbus();
+    if (count($ar_buf)) {
+        for ($i = 0, $max = sizeof($ar_buf); $i < $max; $i++) {
+            if ($ar_buf[$i]) {
+                $sbus_devices .= "      <Device>" . htmlspecialchars(chop($ar_buf[$i]), ENT_QUOTES) . "</Device>\n";
+            } 
+        } 
+    } 
+*/
+    $_text = "  <Hardware>\n";
+    $_text .= "    <CPU>\n";
+    if (isset($sys['cpus'])) {
+        $_text .= "      <Number>" . htmlspecialchars($sys['cpus'], ENT_QUOTES) . "</Number>\n";
+    } 
+    if (isset($sys['model'])) {
+        $_text .= "      <Model>" . htmlspecialchars($sys['model'], ENT_QUOTES) . "</Model>\n";
+    } 
+    if (isset($sys['cpuspeed'])) {
+        $_text .= "      <Cpuspeed>" . htmlspecialchars($sys['cpuspeed'], ENT_QUOTES) . "</Cpuspeed>\n";
+    } 
+    if (isset($sys['busspeed'])) {
+        $_text .= "      <Busspeed>" . htmlspecialchars($sys['busspeed'], ENT_QUOTES) . "</Busspeed>\n";
+    } 
+    if (isset($sys['cache'])) {
+        $_text .= "      <Cache>" . htmlspecialchars($sys['cache'], ENT_QUOTES) . "</Cache>\n";
+    } 
+    if (isset($sys['bogomips'])) {
+        $_text .= "      <Bogomips>" . htmlspecialchars($sys['bogomips'], ENT_QUOTES) . "</Bogomips>\n";
+    } 
+    $_text .= "    </CPU>\n";
+
+    $_text .= "    <PCI>\n";
+    if ($pci_devices) {
+        $_text .= $pci_devices;
+    } 
+    $_text .= "    </PCI>\n";
+
+    $_text .= "    <IDE>\n";
+    if ($ide_devices) {
+        $_text .= $ide_devices;
+    } 
+    $_text .= "    </IDE>\n";
+
+    $_text .= "    <SCSI>\n";
+    if ($scsi_devices) {
+        $_text .= $scsi_devices;
+    } 
+    $_text .= "    </SCSI>\n";
+
+    $_text .= "    <USB>\n";
+    if ($usb_devices) {
+        $_text .= $usb_devices;
+    } 
+    $_text .= "    </USB>\n";
+
+/*
+    $_text .= "    <SBUS>\n";
+    if ($sbus_devices) {
+        $_text .= $sbus_devices;
+    } 
+    $_text .= "    </SBUS>\n";
+*/
+
+    $_text .= "  </Hardware>\n";
+
+    return $_text;
+} 
+
+function html_hardware ()
+{
+    global $XPath;
+    global $text;
+    $pci_devices = ""; $ide_devices = ""; $usb_devices = ""; $scsi_devices = "";
+    $textdir = direction();
+
+    for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/PCI')); $i < $max; $i++) {
+        if ($XPath->match("/phpsysinfo/Hardware/PCI/Device[$i]/Name")) {
+            $pci_devices .= $XPath->getData("/phpsysinfo/Hardware/PCI/Device[$i]/Name") . '<br>';
+        } 
+    } 
+
+    for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/IDE')); $i < $max; $i++) {
+        if ($XPath->match("/phpsysinfo/Hardware/IDE/Device[$i]")) {
+            $ide_devices .= $XPath->getData("/phpsysinfo/Hardware/IDE/Device[$i]/Name");
+	    if ($XPath->match("/phpsysinfo/Hardware/IDE/Device[$i]/Capacity")) {
+		$ide_devices .= " (" . $text['capacity'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Hardware/IDE/Device[$i]/Capacity") / 2) . ")";
+	    }
+	    $ide_devices .= '<br>';
+        } 
+    } 
+
+    for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/SCSI')); $i < $max; $i++) {
+        if ($XPath->match("/phpsysinfo/Hardware/SCSI/Device[$i]")) {
+            $scsi_devices .= $XPath->getData("/phpsysinfo/Hardware/SCSI/Device[$i]/Name");
+	    if ($XPath->match("/phpsysinfo/Hardware/SCSI/Device[$i]/Capacity")) {
+		$scsi_devices .= " (" . $text['capacity'] . ": " . format_bytesize($XPath->getData("/phpsysinfo/Hardware/SCSI/Device[$i]/Capacity") / 2) . ")";
+	    }
+	    $scsi_devices .= '<br>';
+        } 
+    } 
+
+    for ($i = 1, $max = sizeof($XPath->getDataParts('/phpsysinfo/Hardware/USB')); $i < $max; $i++) {
+        if ($XPath->match("/phpsysinfo/Hardware/USB/Device[$i]/Name")) {
+            $usb_devices .= $XPath->getData("/phpsysinfo/Hardware/USB/Device[$i]/Name") . '<br>';
+        } 
+    } 
+
+    $_text = "<table border=\"0\" width=\"100%\" align=\"center\">\n";
+
+    if ($XPath->match("/phpsysinfo/Hardware/CPU/Number")) {
+        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['numcpu'] . "</font></td>\n    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Number") . "</font></td>\n  </tr>\n";
+    } 
+    if ($XPath->match("/phpsysinfo/Hardware/CPU/Model")) {
+        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['cpumodel'] . "</font></td>\n    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Model") . "</font></td>\n  </tr>\n";
+    } 
+
+    if ($XPath->match("/phpsysinfo/Hardware/CPU/Cpuspeed")) {
+        $tmp_speed = $XPath->getData("/phpsysinfo/Hardware/CPU/Cpuspeed");
+        if ($tmp_speed < 1000) {
+            $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['cpuspeed'] . "</font></td>\n    <td><font size=\"-1\">" . $tmp_speed . " MHz</font></td>\n  </tr>\n";
+        } else {
+            $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['cpuspeed'] . "</font></td>\n    <td><font size=\"-1\">" . round($tmp_speed / 1000, 2) . " GHz</font></td>\n  </tr>\n";
+        } 
+    } 
+    if ($XPath->match("/phpsysinfo/Hardware/CPU/Busspeed")) {
+        $tmp_speed = $XPath->getData("/phpsysinfo/Hardware/CPU/Busspeed");
+        if ($tmp_speed < 1000) {
+            $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['busspeed'] . "</font></td>\n    <td><font size=\"-1\">" . $tmp_speed . " MHz</font></td>\n  </tr>\n";
+        } else {
+            $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['busspeed'] . "</font></td>\n    <td><font size=\"-1\">" . round($tmp_speed / 1000, 2) . " GHz</font></td>\n  </tr>\n";
+        } 
+    } 
+    if ($XPath->match("/phpsysinfo/Hardware/CPU/Cache")) {
+        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['cache'] . "</font></td>\n    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Cache") . "</font></td>\n  </tr>\n";
+    } 
+    if ($XPath->match("/phpsysinfo/Hardware/CPU/Bogomips")) {
+        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['bogomips'] . "</font></td>\n    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Hardware/CPU/Bogomips") . "</font></td>\n  </tr>\n";
+    } 
+
+    $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['pci'] . "</font></td>\n    <td><font size=\"-1\">";
+    if ($pci_devices) {
+        $_text .= $pci_devices;
+    } else {
+        $_text .= "<i>" . $text['none'] . "</i>";
+    } 
+    $_text .= "</font></td>\n  </tr>\n";
+
+    $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['ide'] . "</font></td>\n    <td><font size=\"-1\">";
+    if ($ide_devices) {
+        $_text .= $ide_devices;
+    } else {
+        $_text .= "<i>" . $text['none'] . "</i>";
+    } 
+    $_text .= "</font></td>\n  </tr>\n";
+
+    if ($scsi_devices) {
+        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['scsi'] . "</font></td>\n    <td><font size=\"-1\">" . $scsi_devices . "</font></td>\n  </tr>";
+    } 
+
+    if ($usb_devices) {
+        $_text .= "  <tr>\n    <td valign=\"top\"><font size=\"-1\">" . $text['usb'] . "</font></td>\n    <td><font size=\"-1\">" . $usb_devices . "</font></td>\n  </tr>";
+    } 
+
+    $_text .= "</table>";
+
+    return $_text;
+} 
+
+?>
diff --git a/www/include/options/sysInfos/includes/xml/hddtemp.php b/www/include/options/sysInfos/includes/xml/hddtemp.php
new file mode 100644
index 0000000000000000000000000000000000000000..61d6ba51b924d4880db366576fb82a8c59a8c5b9
--- /dev/null
+++ b/www/include/options/sysInfos/includes/xml/hddtemp.php
@@ -0,0 +1,73 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: hddtemp.php,v 1.7 2005/12/10 15:54:56 bigmichi1 Exp $
+
+function xml_hddtemp($hddtemp) {
+  global $hddtemp_avail;
+  $data = $hddtemp->temperature($hddtemp_avail);
+
+  $_text = "  <HDDTemp>\n";
+    if (sizeof($data) > 0) {
+      for ($i=0, $max = sizeof($data); $i < $max; $i++) {
+        $_text .= "     <Item>\n";
+        $_text .= "        <Label>" . htmlspecialchars($data[$i]['label'], ENT_QUOTES) . "</Label>\n";
+        $_text .= "        <Value>" . htmlspecialchars($data[$i]['value'], ENT_QUOTES) . "</Value>\n";
+        $_text .= "        <Model>" . htmlspecialchars($data[$i]['model'], ENT_QUOTES) . "</Model>\n";
+        $_text .= "     </Item>\n";
+      }
+    }
+    $_text .= "  </HDDTemp>\n";
+    
+    return $_text;
+}
+
+function html_hddtemp() {
+  global $XPath;
+  global $text;
+  global $sensor_program;
+
+  $textdir = direction();  
+  $scale_factor = 2;
+  $_text = "";
+  $maxvalue = "+60";
+
+  if ($XPath->match("/phpsysinfo/HDDTemp")) {
+    for ($i=1, $max = sizeof($XPath->getDataParts('/phpsysinfo/HDDTemp')); $i < $max; $i++) {
+      if( $XPath->getData("/phpsysinfo/HDDTemp/Item[$i]/Value") != 0) {
+        $_text .= "  <tr>\n";
+        $_text .= "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">". $XPath->getData("/phpsysinfo/HDDTemp/Item[$i]/Model") . "</font></td>\n";
+        $_text .= "    <td align=\"" . $textdir['left'] . "\" valign=\"top\" nowrap><font size=\"-1\">";
+        $_text .= create_bargraph($XPath->getData("/phpsysinfo/HDDTemp/Item[$i]/Value"), $maxvalue, $scale_factor);
+        $_text .= "&nbsp;" . round($XPath->getData("/phpsysinfo/HDDTemp/Item[$i]/Value")) . " " . $text['degree_mark'] . "</font></td>\n";
+        $_text .= "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">". $maxvalue . " " . $text['degree_mark'] . "</font></td></tr>\n";
+      }
+    }
+  };
+  if (strlen($_text) > 0 && empty($sensor_program)) {
+    $_text = "  <tr>\n"
+           . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['s_label'] . "</b></font></td>\n"
+	   . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['s_value'] . "</b></font></td>\n"
+	   . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['s_limit'] . "</b></font></td>\n"
+	   . "  </tr>" . $_text;
+  }
+  return $_text;
+};
+
+?>
diff --git a/www/include/options/sysInfos/includes/xml/index.html b/www/include/options/sysInfos/includes/xml/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/includes/xml/mbinfo.php b/www/include/options/sysInfos/includes/xml/mbinfo.php
new file mode 100644
index 0000000000000000000000000000000000000000..b5309d825a65ff6c946aa84b228bb43825c394d8
--- /dev/null
+++ b/www/include/options/sysInfos/includes/xml/mbinfo.php
@@ -0,0 +1,190 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  
+//   
+// $Id: mbinfo.php,v 1.13 2005/12/10 15:54:56 bigmichi1 Exp $
+
+function xml_mbtemp() {
+    global $text;
+    global $mbinfo;
+
+    $_text = "";
+    $data = $mbinfo->temperature();
+
+    $_text = "  <MBinfo>\n";
+    if (sizeof($data) > 0) {
+    $_text .= "    <Temperature>\n";
+    for ($i=0, $max = sizeof($data); $i < $max; $i++) {
+        $_text .= "       <Item>\n";
+        $_text .= "      <Label>" . htmlspecialchars($data[$i]['label'], ENT_QUOTES) . "</Label>\n";
+        $_text .= "      <Value>" . htmlspecialchars($data[$i]['value'], ENT_QUOTES) . "</Value>\n";
+        $_text .= "      <Limit>" . htmlspecialchars($data[$i]['limit'], ENT_QUOTES) . "</Limit>\n";
+        $_text .= "       </Item>\n";
+    }
+    $_text .= "    </Temperature>\n";
+    }
+
+    return $_text;  
+};
+
+function xml_mbfans() {
+    global $text;
+    global $mbinfo;
+
+    $_text = "";
+    $data = $mbinfo->fans();
+    if (sizeof($data) > 0) {
+        $_text = "    <Fans>\n";
+        for ($i=0, $max = sizeof($data); $i < $max; $i++) {
+            $_text .= "       <Item>\n";
+            $_text .= "      <Label>" . htmlspecialchars($data[$i]['label'], ENT_QUOTES) . "</Label>\n";
+            $_text .= "      <Value>" . htmlspecialchars($data[$i]['value'], ENT_QUOTES) . "</Value>\n";
+            $_text .= "      <Min>" . htmlspecialchars($data[$i]['min'], ENT_QUOTES) . "</Min>\n";
+            $_text .= "      <Div>" . htmlspecialchars($data[$i]['div'], ENT_QUOTES) . "</Div>\n";
+            $_text .= "       </Item>\n";
+        }
+        $_text .= "    </Fans>\n";
+    }
+
+    return $_text;  
+};
+
+function xml_mbvoltage() {
+    global $text;
+    global $mbinfo;
+
+    $_text = "";
+    $data = $mbinfo->voltage();
+    if (sizeof($data) > 0) {
+        $_text = "    <Voltage>\n";
+        for ($i=0, $max = sizeof($data); $i < $max; $i++) {
+            $_text .= "       <Item>\n";
+            $_text .= "      <Label>" . htmlspecialchars($data[$i]['label'], ENT_QUOTES) . "</Label>\n";
+            $_text .= "      <Value>" . htmlspecialchars($data[$i]['value'], ENT_QUOTES) . "</Value>\n";
+            $_text .= "      <Min>" . htmlspecialchars($data[$i]['min'], ENT_QUOTES) . "</Min>\n";
+            $_text .= "      <Max>" . htmlspecialchars($data[$i]['max'], ENT_QUOTES) . "</Max>\n";
+            $_text .= "       </Item>\n";
+        }
+        $_text .= "    </Voltage>\n";
+    }
+    $_text .= "  </MBinfo>\n";
+
+    return $_text;  
+};
+
+
+function html_mbtemp() {
+  global $text;
+  global $mbinfo;
+
+  $textdir = direction();
+  $data = array();
+  $scale_factor = 2;
+
+  $_text = "  <tr>\n"
+         . "    <td><font size=\"-1\"><b>" . $text['s_label'] . "</b></font></td>\n"
+	 . "    <td><font size=\"-1\"><b>" . $text['s_value'] . "</b></font></td>\n"
+	 . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['s_limit'] . "</b></font></td>\n"
+	 . "  </tr>\n";
+
+  $data = $mbinfo->temperature();
+  for ($i=0, $max = sizeof($data); $i < $max; $i++) {
+     $_text .= "  <tr>\n"
+             . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">". $data[$i]['label'] . "</font></td>\n"
+	     . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">";
+     if ($data[$i]['value'] == 0) {
+       $_text .= "Unknown - Not connected?";
+     } else {
+       $_text .= create_bargraph($data[$i]['value'], $data[$i]['limit'], $scale_factor);
+     }
+     $_text .= "&nbsp;" . round($data[$i]['value']) . "&nbsp;" . $text['degree_mark'] . "</font></td>\n"
+             . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">". $data[$i]['limit'] . "&nbsp;" . $text['degree_mark'] . "</font></td>\n"
+	     . "  </tr>\n";
+  };
+
+  return $_text;  
+};
+
+
+function html_mbfans() {
+  global $text;
+  global $mbinfo;
+  $textdir = direction();
+
+  $_text ="<table width=\"100%\">\n";
+
+  $_text .= "  <tr>\n"
+	  . "    <td><font size=\"-1\"><b>" . $text['s_label'] . "</b></font></td>\n"
+          . "    <td align=\"" . $textdir['right'] . "\"><font size=\"-1\"><b>" . $text['s_value'] . "</b></font></td>\n"
+	  . "    <td align=\"" . $textdir['right'] . "\"><font size=\"-1\"><b>" . $text['s_min'] . "</b></font></td>\n"
+	  . "    <td align=\"" . $textdir['right'] . "\"><font size=\"-1\"><b>" . $text['s_div'] . "</b></font></td>\n"
+	  . "  </tr>\n";
+
+  $data = $mbinfo->fans();
+  $show_fans = false;
+
+  for ($i=0, $max = sizeof($data); $i < $max; $i++) {
+      $_text .= "  <tr>\n"
+              . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">". $data[$i]['label'] . "</font></td>\n"
+              . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">". round($data[$i]['value']) . " " . $text['rpm_mark'] . "</font></td>\n"
+              . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">". $data[$i]['min'] . " " . $text['rpm_mark'] . "</font></td>\n"
+              . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . $data[$i]['div'] . "</font></td>\n"
+              . "  </tr>\n";
+      if (round($data[$i]['value']) > 0) { 
+          $show_fans = true;
+      }
+  };
+  $_text .= "</table>\n";
+
+  if (!$show_fans) {
+      $_text = "";
+  }
+
+  return $_text;  
+};
+
+
+function html_mbvoltage() {
+  global $text;
+  global $mbinfo;
+  $textdir = direction();
+
+  $_text = "<table width=\"100%\">\n";
+
+  $_text .= "  <tr>\n"
+          . "    <td><font size=\"-1\"><b>" . $text['s_label'] . "</b></font></td>\n"
+	  . "    <td align=\"" . $textdir['right'] . "\"><font size=\"-1\"><b>" . $text['s_value'] . "</b></font></td>\n"
+	  . "    <td align=\"" . $textdir['right'] . "\"><font size=\"-1\"><b>" . $text['s_min'] . "</b></font></td>\n"
+	  . "    <td align=\"" . $textdir['right'] . "\"><font size=\"-1\"><b>" . $text['s_max'] . "</b></font></td>\n"
+	  . "  </tr>\n";
+
+    $data = $mbinfo->voltage();
+    for ($i=0, $max = sizeof($data); $i < $max; $i++) {
+            $_text .= "  <tr>\n"
+                    . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">". $data[$i]['label'] . "</font></td>\n"
+                    . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">". $data[$i]['value'] . " " . $text['voltage_mark'] . "</font></td>\n"
+                    . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">". $data[$i]['min'] . " " . $text['voltage_mark'] . "</font></td>\n"
+                    . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . $data[$i]['max'] . " " . $text['voltage_mark'] . "</font></td>\n"
+		    . "  </tr>\n";
+    };
+
+  $_text .= "</table>\n";
+
+  return $_text;  
+};
+?>
diff --git a/www/include/options/sysInfos/includes/xml/memory.php b/www/include/options/sysInfos/includes/xml/memory.php
new file mode 100644
index 0000000000000000000000000000000000000000..38441909de084441ab8ccbe977f6f815fe5ee30f
--- /dev/null
+++ b/www/include/options/sysInfos/includes/xml/memory.php
@@ -0,0 +1,169 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: memory.php,v 1.14 2005/12/10 15:54:56 bigmichi1 Exp $
+
+//
+// xml_memory()
+//
+function xml_memory () {
+    global $sysinfo;
+    $mem = $sysinfo->memory();
+
+    $_text = "  <Memory>\n"
+           . "    <Free>" . htmlspecialchars($mem['ram']['t_free'], ENT_QUOTES) . "</Free>\n"
+           . "    <Used>" . htmlspecialchars($mem['ram']['t_used'], ENT_QUOTES) . "</Used>\n"
+           . "    <Total>" . htmlspecialchars($mem['ram']['total'], ENT_QUOTES) . "</Total>\n"
+           . "    <Percent>" . htmlspecialchars($mem['ram']['percent'], ENT_QUOTES) . "</Percent>\n";
+	   
+    if (isset($mem['ram']['app_percent']))
+      $_text .= "    <App>" . htmlspecialchars($mem['ram']['app'], ENT_QUOTES) . "</App>\n    <AppPercent>" . htmlspecialchars($mem['ram']['app_percent'], ENT_QUOTES) . "</AppPercent>\n";
+    if (isset($mem['ram']['buffers_percent']))
+      $_text .= "    <Buffers>" . htmlspecialchars($mem['ram']['buffers'], ENT_QUOTES) . "</Buffers>\n    <BuffersPercent>" . htmlspecialchars($mem['ram']['buffers_percent'], ENT_QUOTES) . "</BuffersPercent>\n";
+    if (isset($mem['ram']['cached_percent']))
+      $_text .= "    <Cached>" . htmlspecialchars($mem['ram']['cached'], ENT_QUOTES) . "</Cached>\n    <CachedPercent>" . htmlspecialchars($mem['ram']['cached_percent'], ENT_QUOTES) . "</CachedPercent>\n";
+      
+    $_text .= "  </Memory>\n"
+           . "  <Swap>\n"
+           . "    <Free>" . htmlspecialchars($mem['swap']['free'], ENT_QUOTES) . "</Free>\n"
+           . "    <Used>" . htmlspecialchars($mem['swap']['used'], ENT_QUOTES) . "</Used>\n"
+           . "    <Total>" . htmlspecialchars($mem['swap']['total'], ENT_QUOTES) . "</Total>\n"
+           . "    <Percent>" . htmlspecialchars($mem['swap']['percent'], ENT_QUOTES) . "</Percent>\n"
+           . "  </Swap>\n"
+	   . "  <Swapdevices>\n";
+    $i = 0;
+    foreach ($mem['devswap'] as $device) {
+	$_text .="    <Mount>\n"
+	       . "     <MountPointID>" . htmlspecialchars($i++, ENT_QUOTES) . "</MountPointID>\n"
+	       . "     <Type>Swap</Type>"
+	       . "     <Device><Name>" . htmlspecialchars($device['dev'], ENT_QUOTES) . "</Name></Device>\n"
+    	       . "     <Percent>" . htmlspecialchars($device['percent'], ENT_QUOTES) . "</Percent>\n"
+    	       . "     <Free>" . htmlspecialchars($device['free'], ENT_QUOTES) . "</Free>\n"
+    	       . "     <Used>" . htmlspecialchars($device['used'], ENT_QUOTES) . "</Used>\n"
+    	       . "     <Size>" . htmlspecialchars($device['total'], ENT_QUOTES) . "</Size>\n"
+    	       . "    </Mount>\n";
+    }
+    $_text .= "  </Swapdevices>\n";
+
+    return $_text;
+}
+
+//
+// xml_memory()
+//
+function html_memory () {
+    global $XPath;
+    global $text;
+
+    $textdir = direction();
+    $scale_factor = 2;
+
+    $ram = create_bargraph($XPath->getData("/phpsysinfo/Memory/Used"), $XPath->getData("/phpsysinfo/Memory/Total"), $scale_factor);
+    $ram .= "&nbsp;&nbsp;" . $XPath->getData("/phpsysinfo/Memory/Percent") . "% ";
+
+    $swap = create_bargraph($XPath->getData("/phpsysinfo/Swap/Used"), $XPath->getData("/phpsysinfo/Swap/Total"), $scale_factor);
+    $swap .= "&nbsp;&nbsp;" . $XPath->getData("/phpsysinfo/Swap/Percent") . "% ";
+
+    if ($XPath->match("/phpsysinfo/Memory/AppPercent")) {
+	$app = create_bargraph($XPath->getData("/phpsysinfo/Memory/App"), $XPath->getData("/phpsysinfo/Memory/Total"), $scale_factor);
+        $app .= "&nbsp;&nbsp;" . $XPath->getData("/phpsysinfo/Memory/AppPercent") . "% ";
+    }
+    if ($XPath->match("/phpsysinfo/Memory/BuffersPercent")) {
+	$buffers = create_bargraph($XPath->getData("/phpsysinfo/Memory/Buffers"), $XPath->getData("/phpsysinfo/Memory/Total"), $scale_factor);
+        $buffers .= "&nbsp;&nbsp;" . $XPath->getData("/phpsysinfo/Memory/BuffersPercent") . "% ";
+    }
+    if ($XPath->match("/phpsysinfo/Memory/CachedPercent")) {
+	$cached = create_bargraph($XPath->getData("/phpsysinfo/Memory/Cached"), $XPath->getData("/phpsysinfo/Memory/Total"), $scale_factor);
+        $cached .= "&nbsp;&nbsp;" . $XPath->getData("/phpsysinfo/Memory/CachedPercent") . "% ";
+    }
+
+    $_text = "<table border=\"0\" width=\"100%\" align=\"center\">\n"
+           . "  <tr>\n"
+	   . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['type'] . "</b></font></td>\n"
+           . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['percent'] . "</b></font></td>\n"
+           . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['free'] . "</b></font></td>\n"
+           . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['used'] . "</b></font></td>\n"
+           . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['size'] . "</b></font></td>\n"
+	   . "  </tr>\n"
+	   
+           . "  <tr>\n"
+	   . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $text['phymem'] . "</font></td>\n"
+           . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $ram . "</font></td>\n"
+           . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Memory/Free")) . "</font></td>\n"
+           . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Memory/Used")) . "</font></td>\n"
+           . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Memory/Total")) . "</font></td>\n"
+	   . "  </tr>\n";
+
+    if (isset($app)) {
+      $_text .= "  <tr>\n"
+    	      . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $text['app'] . "</font></td>\n"
+    	      . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $app . "</font></td>\n"
+	      . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">&nbsp;</font></td>\n"
+	      . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Memory/App")) . "</font></td>\n"
+	      . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">&nbsp;</font></td>\n"
+	      . "  </tr>\n";
+    }
+
+    if (isset($buffers)) {
+      $_text .= "  <tr>\n"
+    	      . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $text['buffers'] . "</font></td>\n"
+    	      . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $buffers . "</font></td>\n"
+	      . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">&nbsp;</font></td>\n"
+	      . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Memory/Buffers")) . "</font></td>\n"
+	      . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">&nbsp;</font></td>\n"
+	      . "  </tr>\n";
+    }
+
+    if (isset($cached)) {
+      $_text .= "  <tr>\n"
+    	      . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $text['cached'] . "</font></td>\n"
+    	      . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $cached . "</font></td>\n"
+	      . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">&nbsp;</font></td>\n"
+	      . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Memory/Cached")) . "</font></td>\n"
+	      . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">&nbsp;</font></td>\n"
+	      . "  </tr>\n";
+    }
+
+    $_text .= "  <tr>\n"
+            . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $text['swap'] . "</font></td>\n"
+            . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $swap . "</font></td>\n"
+            . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Swap/Free")) . "</font></td>\n"
+            . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Swap/Used")) . "</font></td>\n"
+            . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Swap/Total")) . "</font></td>\n"
+	    . "  </tr>\n";
+
+    if (($max = sizeof($XPath->getDataParts("/phpsysinfo/Swapdevices"))) > 2) {
+      for($i = 1; $i < $max; $i++) {
+        $swapdev = create_bargraph($XPath->getData("/phpsysinfo/Swapdevices/Mount[$i]/Used"), $XPath->getData("/phpsysinfo/Swapdevices/Mount[$i]/Size"), $scale_factor);
+        $swapdev .= "&nbsp;&nbsp;" . $XPath->getData("/phpsysinfo/Swapdevices/Mount[$i]/Percent") . "% ";
+        $_text .= "  <tr>\n"
+		. "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\"> - " . $XPath->getData("/phpsysinfo/Swapdevices/Mount[$i]/Device/Name") . "</font></td>\n"
+                . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $swapdev . "</font></td>\n"
+                . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Swapdevices/Mount[$i]/Free")) . "</font></td>\n"
+                . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Swapdevices/Mount[$i]/Used")) . "</font></td>\n"
+                . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Swapdevices/Mount[$i]/Size")) . "</font></td>\n"
+		. "  </tr>\n";
+      }
+    }
+    $_text .= "</table>";
+
+    return $_text;
+}
+
+?>
diff --git a/www/include/options/sysInfos/includes/xml/network.php b/www/include/options/sysInfos/includes/xml/network.php
new file mode 100644
index 0000000000000000000000000000000000000000..593ac5fa8e83453b016827176440bf854b082bfe
--- /dev/null
+++ b/www/include/options/sysInfos/includes/xml/network.php
@@ -0,0 +1,76 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: network.php,v 1.12 2005/12/10 15:54:56 bigmichi1 Exp $
+
+//
+// xml_network()
+//
+function xml_network () {
+    global $sysinfo;
+    $net = $sysinfo->network();
+
+    $_text = "  <Network>\n";
+    while (list($dev, $stats) = each($net)) {
+        $_text .= "    <NetDevice>\n"
+               .  "      <Name>" . htmlspecialchars(trim($dev), ENT_QUOTES) . "</Name>\n"
+               .  "      <RxBytes>" . htmlspecialchars($stats['rx_bytes'], ENT_QUOTES) . "</RxBytes>\n"
+               .  "      <TxBytes>" . htmlspecialchars($stats['tx_bytes'], ENT_QUOTES) . "</TxBytes>\n"
+               .  "      <Errors>" . htmlspecialchars($stats['errs'], ENT_QUOTES) . "</Errors>\n"
+               .  "      <Drops>" . htmlspecialchars($stats['drop'], ENT_QUOTES) . "</Drops>\n"
+               .  "    </NetDevice>\n";
+    }
+    $_text .= "  </Network>\n";
+
+    return $_text;
+}
+
+//
+// html_network()
+//
+function html_network () {
+    global $XPath;
+    global $text;
+
+    $textdir = direction();
+    
+    $_text = "<table border=\"0\" width=\"100%\" align=\"center\">\n"
+           . "  <tr>\n"
+	   . "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['device'] . "</b></font></td>\n"
+           . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\" class='title_sysInfo'><font size=\"-1\"><b>" . $text['received'] . "</b></font></td>\n"
+           . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['sent'] . "</b></font></td>\n"
+           . "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\"><b>" . $text['errors'] . "</b></font></td>\n"
+	   . "  </tr>\n";
+	   
+    for ($i=1, $max = sizeof($XPath->getDataParts("/phpsysinfo/Network")); $i < $max; $i++) {
+        if ($XPath->match("/phpsysinfo/Network/NetDevice[$i]/Name")) {
+            $_text .= "  <tr>\n";
+            $_text .= "    <td align=\"" . $textdir['left'] . "\" valign=\"top\"><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Network/NetDevice[$i]/Name") . "</font></td>\n";
+            $_text .= "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Network/NetDevice[$i]/RxBytes") / 1024) . "</font></td>\n";
+            $_text .= "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . format_bytesize($XPath->getData("/phpsysinfo/Network/NetDevice[$i]/TxBytes") / 1024) . "</font></td>\n";
+            $_text .= "    <td align=\"" . $textdir['right'] . "\" valign=\"top\"><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Network/NetDevice[$i]/Errors") . '/' . $XPath->getData("/phpsysinfo/Network/NetDevice[$i]/Drops") . "</font></td>\n";
+            $_text .= "  </tr>\n";
+        }
+    }
+    $_text .= "</table>";
+
+    return $_text;
+}
+
+?>
diff --git a/www/include/options/sysInfos/includes/xml/vitals.php b/www/include/options/sysInfos/includes/xml/vitals.php
new file mode 100644
index 0000000000000000000000000000000000000000..073bd297f53e63e94b08dff49db9bb2b998fb65d
--- /dev/null
+++ b/www/include/options/sysInfos/includes/xml/vitals.php
@@ -0,0 +1,116 @@
+<?php 
+
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+// $Id: vitals.php,v 1.26 2005/12/10 15:54:56 bigmichi1 Exp $
+
+// xml_vitals()
+
+function xml_vitals ()
+{
+  global $sysinfo;
+  global $loadbar;
+
+  $load_avg = "";
+  $ar_buf = ($loadbar ? $sysinfo->loadavg($loadbar) : $sysinfo->loadavg());
+
+  for ($i = 0; $i < count($ar_buf['avg']); $i++) {
+    $load_avg .= $ar_buf['avg'][$i] . ' ';
+  } 
+
+  $_text = "  <Vitals>\n"
+   . "    <Hostname>" . htmlspecialchars($sysinfo->chostname(), ENT_QUOTES) . "</Hostname>\n"
+   . "    <IPAddr>" . htmlspecialchars($sysinfo->ip_addr(), ENT_QUOTES) . "</IPAddr>\n"
+   . "    <Kernel>" . htmlspecialchars($sysinfo->kernel(), ENT_QUOTES) . "</Kernel>\n"
+   . "    <Distro>" . htmlspecialchars($sysinfo->distro(), ENT_QUOTES) . "</Distro>\n"
+   . "    <Distroicon>" . htmlspecialchars($sysinfo->distroicon(), ENT_QUOTES) . "</Distroicon>\n"
+   . "    <Uptime>" . htmlspecialchars($sysinfo->uptime(), ENT_QUOTES) . "</Uptime>\n"
+   . "    <Users>" . htmlspecialchars($sysinfo->users(), ENT_QUOTES) . "</Users>\n"
+   . "    <LoadAvg>" . htmlspecialchars(trim($load_avg), ENT_QUOTES) . "</LoadAvg>\n";
+   if (isset($ar_buf['cpupercent']))
+     $_text .= "   <CPULoad>" . htmlspecialchars(round($ar_buf['cpupercent'], 2), ENT_QUOTES) . "</CPULoad>";
+   $_text .= "  </Vitals>\n";
+  return $_text;
+} 
+
+// html_vitals()
+
+function html_vitals ()
+{
+  global $webpath;
+  global $XPath;
+  global $text;
+
+  $textdir = direction();
+  $scale_factor = 2;
+  $loadbar = "";
+  $uptime = "";
+  
+  if($XPath->match("/phpsysinfo/Vitals/CPULoad"))
+    $loadbar = "<br/>" . create_bargraph($XPath->getData("/phpsysinfo/Vitals/CPULoad"), 100, $scale_factor) . "&nbsp;" . $XPath->getData("/phpsysinfo/Vitals/CPULoad") . "%";
+
+  $min = $XPath->getData('/phpsysinfo/Vitals/Uptime') / 60;
+  $hours = $min / 60;
+  $days = floor($hours / 24);
+  $hours = floor($hours - ($days * 24));
+  $min = floor($min - ($days * 60 * 24) - ($hours * 60));
+
+  if ($days != 0) {
+    $uptime = $days. "&nbsp;" . $text['days'] . "&nbsp;";
+  } 
+
+  if ($hours != 0) {
+    $uptime .= $hours . "&nbsp;" . $text['hours'] . "&nbsp;";
+  } 
+  $uptime .= $min . "&nbsp;" . $text['minutes'];
+
+  $_text = "<table border=\"0\" width=\"100%\" align=\"center\">\n"
+	 . "  <tr>\n"
+	 . "    <td valign=\"top\"><font size=\"-1\">" . $text['hostname'] . "</font></td>\n"
+	 . "    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Vitals/Hostname") . "</font></td>\n"
+	 . "  </tr>\n"
+	 . "  <tr>\n"
+	 . "    <td valign=\"top\"><font size=\"-1\">" . $text['ip'] . "</font></td>\n"
+	 . "    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Vitals/IPAddr") . "</font></td>\n"
+	 . "  </tr>\n"
+	 . "  <tr>\n"
+	 . "    <td valign=\"top\"><font size=\"-1\">" . $text['kversion'] . "</font></td>\n"
+	 . "    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Vitals/Kernel") . "</font></td>\n"
+	 . "  </tr>\n"
+	 . "  <tr>\n"
+	 . "    <td valign=\"top\"><font size=\"-1\">" . $text['dversion'] . "</font></td>\n"
+	 . "    <td><img width=\"16\" height=\"16\" alt=\"\" src=\"" . $webpath . "images/" . $XPath->getData("/phpsysinfo/Vitals/Distroicon") . "\">&nbsp;<font size=\"-1\">" . $XPath->getData("/phpsysinfo/Vitals/Distro") . "</font></td>\n"
+	 . "  </tr>\n"
+	 . "  <tr>\n"
+	 . "    <td valign=\"top\"><font size=\"-1\">" . $text['uptime'] . "</font></td>\n"
+	 . "    <td><font size=\"-1\">" . $uptime . "</font></td>\n"
+	 . "  </tr>\n"
+	 . "  <tr>\n"
+	 . "    <td valign=\"top\"><font size=\"-1\">" . $text['users'] . "</font></td>\n"
+	 . "    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Vitals/Users") . "</font></td>\n"
+	 . "  </tr>\n"
+	 . "  <tr>\n"
+	 . "    <td valign=\"top\"><font size=\"-1\">" . $text['loadavg'] . "</font></td>\n"
+	 . "    <td><font size=\"-1\">" . $XPath->getData("/phpsysinfo/Vitals/LoadAvg") . $loadbar . "</font></td>\n"
+	 . "  </tr>\n"
+	 . "</table>\n";
+
+  return $_text;
+} 
+
+?>
diff --git a/www/include/options/sysInfos/index.php b/www/include/options/sysInfos/index.php
new file mode 100644
index 0000000000000000000000000000000000000000..cbc7a90c72b166690ab66ecd7d36546a04047599
--- /dev/null
+++ b/www/include/options/sysInfos/index.php
@@ -0,0 +1,270 @@
+<?php 
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+// $Id: index.php,v 1.104 2005/12/15 08:35:00 bigmichi1 Exp $
+// phpsysinfo release version number
+$VERSION = "2.5.1";
+
+define('APP_ROOT', dirname(__FILE__));
+define('IN_PHPSYSINFO', true);
+
+ini_set('magic_quotes_runtime', 'off');
+ini_set('register_globals', 'off');
+
+if (!file_exists(APP_ROOT . '/config.php')) {
+  echo '<center><b>Error: config.php does not exist.</b></center>';
+  exit;
+} 
+
+require_once(APP_ROOT . '/config.php'); // get the config file
+
+if (!extension_loaded('xml')) {
+  echo '<center><b>Error: phpsysinfo requires xml module.</b></center>';
+  exit;
+} 
+
+if (!extension_loaded('pcre')) {
+  echo '<center><b>Error: phpsysinfo requires pcre module.</b></center>';
+  exit;
+} 
+
+// Check to see if where running inside of phpGroupWare
+if (file_exists("../header.inc.php") && isset($_REQUEST['sessionid']) && $_REQUEST['sessionid'] && $_REQUEST['kp3'] && $_REQUEST['domain']) {
+  define('PHPGROUPWARE', 1);
+  $phpgw_info['flags'] = array('currentapp' => 'phpsysinfo-dev');
+  include('../header.inc.php');
+} else {
+  define('PHPGROUPWARE', 0);
+}
+
+// DEFINE TEMPLATE_SET
+if (isset($_POST['template'])) {
+  $template = $_POST['template'];
+} elseif (isset($_GET['template'])) {
+  $template = $_GET['template'];
+} elseif (isset($_COOKIE['template'])) {
+  $template = $_COOKIE['template'];
+} else {
+  $template = $default_template; 
+}
+
+// check to see if we have a random
+if ($template == 'random') {
+  $dir = opendir(APP_ROOT . "/templates/");
+  while (($file = readdir($dir)) != false) {
+    if ($file != 'CVS' && $file != '.' && $file != '..') {
+      $buf[] = $file;
+    } 
+  } 
+  $template = $buf[array_rand($buf, 1)];
+} 
+
+if ($template != 'xml' && $template != 'random') {
+  // figure out if the template exists
+  $template = basename($template);
+  if (!file_exists(APP_ROOT . "/templates/" . $template)) {
+    // use default if not exists.
+    $template = $default_template;
+  }
+}
+
+// Store the current template name in a cookie, set expire date to 30 days later
+// if template is xml then skip
+/*
+if ($template != 'xml') {
+  setcookie("template", $template, (time() + 60 * 60 * 24 * 30));
+  $_COOKIE['template'] = $template; //update COOKIE Var
+}
+*/
+
+define('TEMPLATE_SET', $template);
+// get our current language
+// default to english, but this is negotiable.
+if (isset($_POST['lng'])) {
+  $lng = $_POST['lng'];
+} elseif (isset($_GET['lng'])) {
+  $lng = $_GET['lng'];
+  if (!file_exists(APP_ROOT . '/includes/lang/' . $lng . '.php')) {
+    $lng = 'browser';
+  } 
+} elseif (isset($_COOKIE['lng'])) {
+  $lng = $_COOKIE['lng'];
+} else {
+  $lng = $default_lng;
+} 
+// Store the current language selection in a cookie, set expire date to 30 days later
+//setcookie("lng", $lng, (time() + 60 * 60 * 24 * 30));
+//$_COOKIE['lng'] = $lng; //update COOKIE Var
+
+if ($lng == 'browser') {
+  // see if the browser knows the right languange.
+  if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+    $plng = split(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
+    if (count($plng) > 0) {
+      while (list($k, $v) = each($plng)) {
+        $k = split(';', $v, 1);
+        $k = split('-', $k[0]);
+        if (file_exists(APP_ROOT . '/includes/lang/' . $k[0] . '.php')) {
+          $lng = $k[0];
+          break;
+        }
+      }
+    }
+  }
+}
+
+$charset = 'iso-8859-1';
+$lng = basename($lng);
+if (file_exists(APP_ROOT . '/includes/lang/' . $oreon->user->get_lang() . '.php')) {
+    require_once(APP_ROOT . '/includes/lang/' . $oreon->user->get_lang() . '.php'); // get our language include
+} else {
+    echo "Sorry, we don't support this language.";
+    exit;
+}
+
+// Figure out which OS where running on, and detect support
+if (file_exists(APP_ROOT . '/includes/os/class.' . PHP_OS . '.inc.php')) {
+  require_once(APP_ROOT . '/includes/os/class.' . PHP_OS . '.inc.php');
+  $sysinfo = new sysinfo;
+} else {
+  echo '<center><b>Error: ' . PHP_OS . ' is not currently supported</b></center>';
+  exit;
+}
+
+if (!empty($sensor_program)) {
+  $sensor_program = basename($sensor_program);
+  if (file_exists(APP_ROOT . '/includes/mb/class.' . $sensor_program . '.inc.php')) {
+    require_once(APP_ROOT . '/includes/mb/class.' . $sensor_program . '.inc.php');
+    $mbinfo = new mbinfo;
+  } else {
+    echo '<center><b>Error: ' . htmlspecialchars($sensor_program, ENT_QUOTES) . ' is not currently supported</b></center>';
+    exit;
+  } 
+} 
+
+require_once(APP_ROOT . '/includes/common_functions.php'); // Set of common functions used through out the app
+require_once(APP_ROOT . '/includes/xml/vitals.php');
+require_once(APP_ROOT . '/includes/xml/network.php');
+require_once(APP_ROOT . '/includes/xml/hardware.php');
+require_once(APP_ROOT . '/includes/xml/memory.php');
+require_once(APP_ROOT . '/includes/xml/filesystems.php');
+require_once(APP_ROOT . '/includes/xml/mbinfo.php');
+require_once(APP_ROOT . '/includes/xml/hddtemp.php');
+
+
+
+$xml = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
+$xml .= "<!DOCTYPE phpsysinfo SYSTEM \"phpsysinfo.dtd\">\n\n";
+$xml .= created_by();
+$xml .= "<phpsysinfo>\n";
+$xml .= "  <Generation version=\"$VERSION\" timestamp=\"" . time() . "\"/>\n";
+$xml .= xml_vitals();
+$xml .= xml_network();
+$xml .= xml_hardware($hddtemp_devices);
+$xml .= xml_memory();
+$xml .= xml_filesystems();
+if (!empty($sensor_program)) {
+  $xml .= xml_mbtemp();
+  $xml .= xml_mbfans();
+  $xml .= xml_mbvoltage();
+};
+if (isset($hddtemp_avail)) {
+  require_once(APP_ROOT . "/includes/mb/class.hddtemp.inc.php");
+  $hddtemp = new hddtemp($hddtemp_devices);
+  $xml .= xml_hddtemp($hddtemp);
+}
+$xml .= "</phpsysinfo>";
+
+if (TEMPLATE_SET == 'xml' and !$oreon) {
+  // just printout the XML and exit
+  Header("Content-Type: text/xml\n\n");
+  print $xml;
+} else {
+  $image_height = get_gif_image_height(APP_ROOT . '/templates/' . TEMPLATE_SET . '/images/bar_middle.gif');
+  define('BAR_HEIGHT', $image_height);
+
+  if (PHPGROUPWARE != 1) {
+    require_once(APP_ROOT . '/includes/class.Template.inc.php'); // template library
+  } 
+  // fire up the template engine
+  $tpl = new Template(APP_ROOT . '/templates/' . TEMPLATE_SET);
+  $tpl->set_file(array('form' => 'form.tpl')); 
+  // print out a box of information
+  function makebox ($title, $content)
+  {
+    if (empty($content)) {
+      return "";
+    } else {
+      global $webpath;
+      $textdir = direction();
+      $t = new Template(APP_ROOT . '/templates/' . TEMPLATE_SET);
+      $t->set_file(array('box' => 'box.tpl'));
+      $t->set_var('title', $title);
+      $t->set_var('content', $content);
+      $t->set_var('webpath', $webpath);
+      $t->set_var('text_dir', $textdir['direction']);
+      return $t->parse('out', 'box');
+    } 
+  } 
+  // Fire off the XPath class
+  require_once(APP_ROOT . '/includes/XPath.class.php');
+  $XPath = new XPath();
+  $XPath->importFromString($xml); 
+  // let the page begin.
+  require_once(APP_ROOT . '/includes/system_header.php');
+
+  $tpl->set_var('title', $text['title'] . ': ' . $XPath->getData('/phpsysinfo/Vitals/Hostname') . ' (' . $XPath->getData('/phpsysinfo/Vitals/IPAddr') . ')');
+  $tpl->set_var('vitals', makebox($text['vitals'], html_vitals()));
+  $tpl->set_var('network', makebox($text['netusage'], html_network()));
+  $tpl->set_var('hardware', makebox($text['hardware'], html_hardware()));
+  $tpl->set_var('memory', makebox($text['memusage'], html_memory()));
+  $tpl->set_var('filesystems', makebox($text['fs'], html_filesystems()));
+  // Timo van Roermund: change the condition for showing the temperature, voltage and fans section
+  $html_temp = "";
+  if (!empty($sensor_program)) {
+    if ($XPath->match("/phpsysinfo/MBinfo/Temperature/Item")) {
+      $html_temp = html_mbtemp();
+    }
+    if ($XPath->match("/phpsysinfo/MBinfo/Fans/Item")) {
+      $tpl->set_var('mbfans', makebox($text['fans'], html_mbfans()));
+    } else {
+      $tpl->set_var('mbfans', '');
+    };
+    if ($XPath->match("/phpsysinfo/MBinfo/Voltage/Item")) {
+      $tpl->set_var('mbvoltage', makebox($text['voltage'], html_mbvoltage()));
+    } else {
+      $tpl->set_var('mbvoltage', '');
+    };
+  }
+  if (isset($hddtemp_avail) && $hddtemp_avail) {
+    if ($XPath->match("/phpsysinfo/HDDTemp/Item")) {
+      $html_temp .= html_hddtemp();
+    };
+  }
+  if (strlen($html_temp) > 0) {
+    $tpl->set_var('mbtemp', makebox($text['temperature'], "\n<table width=\"100%\">\n" . $html_temp . "</table>\n"));
+  }
+  
+  // parse our the template
+  $tpl->pfp('out', 'form'); 
+ 
+  // finally our print our footer
+  if (PHPGROUPWARE == 1) {
+    $phpgw->common->phpgw_footer();
+  } else {
+    require_once(APP_ROOT . '/includes/system_footer.php');
+  } 
+} 
+
+?>
diff --git a/www/include/options/sysInfos/phpsysinfo.dtd b/www/include/options/sysInfos/phpsysinfo.dtd
new file mode 100644
index 0000000000000000000000000000000000000000..11243721b3fb99fce8ef26af199f1a2b1ee2c580
--- /dev/null
+++ b/www/include/options/sysInfos/phpsysinfo.dtd
@@ -0,0 +1,86 @@
+<!--
+
+  phpSysInfo - A PHP System Information Script
+  http://phpsysinfo.sourceforge.net/
+
+  $Id: phpsysinfo.dtd,v 1.10 2005/11/24 17:05:55 bigmichi1 Exp $
+
+-->
+<!ELEMENT phpsysinfo (Generation, Vitals, Network, Hardware, Memory, Swap, Swapdevices, FileSystem, MBinfo*, HDDTemp*)>
+  <!ELEMENT Generation EMPTY>
+    <!ATTLIST Generation version CDATA "2.3">
+    <!ATTLIST Generation timestamp CDATA "000000000">
+
+  <!ELEMENT Vitals (Hostname, IPAddr, Kernel, Distro, Distroicon, Uptime, Users, LoadAvg)>
+    <!ELEMENT Hostname (#PCDATA)>
+    <!ELEMENT IPAddr (#PCDATA)>
+    <!ELEMENT Kernel (#PCDATA)>
+    <!ELEMENT Distro (#PCDATA)>
+    <!ELEMENT Distroicon (#PCDATA)>
+    <!ELEMENT Uptime (#PCDATA)>
+    <!ELEMENT Users (#PCDATA)>
+    <!ELEMENT LoadAvg (#PCDATA)>
+
+  <!ELEMENT Network (NetDevice*)>
+    <!ELEMENT NetDevice (Name, RxBytes, TxBytes, Errors, Drops)>
+      <!ELEMENT Name (#PCDATA)>
+      <!ELEMENT RxBytes (#PCDATA)>
+      <!ELEMENT TxBytes (#PCDATA)>
+      <!ELEMENT Errors (#PCDATA)>
+      <!ELEMENT Drops (#PCDATA)>
+
+  <!ELEMENT Hardware (CPU*, PCI*, IDE*, SCSI*, USB*, SBUS*)>
+    <!ELEMENT CPU (Number*, Model*, Mhz*, Cpuspeed* ,Cache*, Bogomips*)>
+      <!ELEMENT Number (#PCDATA)>
+      <!ELEMENT Model (#PCDATA)>
+      <!ELEMENT Mhz (#PCDATA)>
+      <!ELEMENT Cpuspeed (#PCDATA)>
+      <!ELEMENT Cache (#PCDATA)>
+      <!ELEMENT Bogomips (#PCDATA)>
+    <!ELEMENT PCI (Device*)>
+      <!ELEMENT Device (Name, Capacity*)>
+	<!ELEMENT Capacity (#PCDATA)>
+    <!ELEMENT IDE (Device*)>
+    <!ELEMENT SCSI (Device*)>
+    <!ELEMENT USB (Device*)>
+    <!ELEMENT SBUS (Device*)>
+
+  <!ELEMENT Memory (Free, Used, Total, Percent, App*, AppPercent*, Buffers*, BuffersPercent*, Cached*, CachedPercent*)>
+    <!ELEMENT Free (#PCDATA)>
+    <!ELEMENT Used (#PCDATA)>
+    <!ELEMENT Total (#PCDATA)>
+    <!ELEMENT Percent (#PCDATA)>
+    <!ELEMENT App (#PCDATA)>
+    <!ELEMENT AppPercent (#PCDATA)>
+    <!ELEMENT Buffers (#PCDATA)>
+    <!ELEMENT BuffersPercent (#PCDATA)>
+    <!ELEMENT Cached (#PCDATA)>
+    <!ELEMENT CachedPercent (#PCDATA)>
+    
+
+  <!ELEMENT Swap (Free, Used, Total, Percent)>
+
+  <!ELEMENT Swapdevices (Mount*)>
+
+  <!ELEMENT FileSystem (Mount*)>
+    <!ELEMENT Mount (MountPointID, MountPoint*, Type, Device, Percent, Free, Used, Size, Options*)>
+      <!ELEMENT MountPointID (#PCDATA)>
+      <!ELEMENT MountPoint (#PCDATA)>
+      <!ELEMENT Type (#PCDATA)>
+      <!ELEMENT Size (#PCDATA)>
+      <!ELEMENT Options (#PCDATA)>
+
+  <!ELEMENT MBinfo (Temperature*, Fans*, Voltage*)>
+    <!ELEMENT Temperature (Item*)>
+      <!ELEMENT Item (Label, Value, Limit*, Min*, Max*, Div*, Model*)>
+        <!ELEMENT Label (#PCDATA)>
+	<!ELEMENT Value (#PCDATA)>
+	<!ELEMENT Limit (#PCDATA)>
+	<!ELEMENT Min (#PCDATA)>
+	<!ELEMENT Max (#PCDATA)>
+	<!ELEMENT Div (#PCDATA)>
+    <!ELEMENT Fans (Item*)>
+    <!ELEMENT Voltage (Item*)>
+    
+  <!ELEMENT HDDTemp (Item*)>
+  
\ No newline at end of file
diff --git a/www/include/options/sysInfos/templates/aq/aq.css b/www/include/options/sysInfos/templates/aq/aq.css
new file mode 100644
index 0000000000000000000000000000000000000000..60bf470db9d2bedde698e92c05b9a83a68db7ae8
--- /dev/null
+++ b/www/include/options/sysInfos/templates/aq/aq.css
@@ -0,0 +1,46 @@
+A {
+  text-decoration: none;
+}
+A:link {
+  color: #486591;
+}
+A:visited {
+  color: #6f6c81;
+}
+A:active {
+  color: blue;
+}
+body {
+  color: #000000;
+  background-color: #fefefe;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 10px;
+  font-weight: normal;
+}
+font {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+H1 {
+  color: #000000;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 20px;
+}
+select {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: normal;
+}
+input {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: bold;
+}
diff --git a/www/include/options/sysInfos/templates/aq/box.tpl b/www/include/options/sysInfos/templates/aq/box.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..f623162353e73e0cf17edde650f2831f9ae6f550
--- /dev/null
+++ b/www/include/options/sysInfos/templates/aq/box.tpl
@@ -0,0 +1,23 @@
+<!-- BEGIN portal -->
+
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+  <tr> 
+    <td width="15" height="15" style="background-image: url({webpath}templates/aq/images/coinsupg.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td height="15" style="background-image: url({webpath}templates/aq/images/sup.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td width="15" height="15" style="background-image: url({webpath}templates/aq/images/coinsupd.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+
+  <tr>
+   <td width="15" style="background-image: url({webpath}templates/aq/images/g.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+   <td style="background-image: url({webpath}templates/aq/images/fond.gif);" align="left" width="100%" dir="{text_dir}">{title}{content}</td>
+   <td width="15" style="background-image: url({webpath}templates/aq/images/d.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+
+  <tr> 
+    <td width="15" height="15" style="background-image: url({webpath}templates/aq/images/coininfg.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td height="15" style="background-image: url({webpath}templates/aq/images/inf.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td width="15" height="15" style="background-image: url({webpath}templates/aq/images/coininfd.gif);"><img src="{webpath}templates/aq/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+</table>
+
+<!-- END portal -->
diff --git a/www/include/options/sysInfos/templates/aq/form.tpl b/www/include/options/sysInfos/templates/aq/form.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..655a5f999ca30302dca921e2c55a3dc51a3f4938
--- /dev/null
+++ b/www/include/options/sysInfos/templates/aq/form.tpl
@@ -0,0 +1,47 @@
+<center><h1>{title}</h1></center>
+
+<table width="100%" align="center" cellpadding="0" cellspacing="2">
+ <tr>
+  <td width="50%" valign="top">
+   {vitals}
+   <table cellpadding="0" cellspacing="0">
+   <tr><td height="8"></td></tr>
+   </table>
+   {network}
+  </td>
+
+  <td width="50%" valign="top">
+   {hardware}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {memory}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {filesystems}
+  </td>
+ </tr>
+
+</table>
+
+<table width="100%" cellpadding="0" cellspacing="2">
+ <tr>
+  <td width="55%" valign="top">
+   {mbtemp}
+   <table cellpadding="0" cellspacing="0">
+   <tr><td height="8"></td></tr>
+   </table>
+   {mbfans}
+  </td>
+
+  <td width="45%" valign="top">
+   {mbvoltage}
+  </td>
+ </tr>
+</table>
+
diff --git a/www/include/options/sysInfos/templates/aq/images/aq_background.gif b/www/include/options/sysInfos/templates/aq/images/aq_background.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c34fa449ee6659e4a74ddd168f8028c4133a4f66
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/aq_background.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/bar_left.gif b/www/include/options/sysInfos/templates/aq/images/bar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..73bd0de0e73011b79c2106289ccd7c0ffe6d1c0d
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/bar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/bar_middle.gif b/www/include/options/sysInfos/templates/aq/images/bar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..bfe4bfa680b0849aa505218dfb8a3a4362294be3
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/bar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/bar_right.gif b/www/include/options/sysInfos/templates/aq/images/bar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..cf0bab00865d81a44b9d70995b23d869d9e6ede4
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/bar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/coininfd.gif b/www/include/options/sysInfos/templates/aq/images/coininfd.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5a9e30a85caf0d7d9b0ca61f959bd78c09ee0442
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/coininfd.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/coininfg.gif b/www/include/options/sysInfos/templates/aq/images/coininfg.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9185e611279a8065fd3194ca569ac2f765b9b10c
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/coininfg.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/coinsupd.gif b/www/include/options/sysInfos/templates/aq/images/coinsupd.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6d9b0f5fa26a700c98a8aa3d1aa419f2c248cf7f
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/coinsupd.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/coinsupg.gif b/www/include/options/sysInfos/templates/aq/images/coinsupg.gif
new file mode 100644
index 0000000000000000000000000000000000000000..aecc27168b4f4a1548ecbaee7963da1bdfd8bf84
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/coinsupg.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/d.gif b/www/include/options/sysInfos/templates/aq/images/d.gif
new file mode 100644
index 0000000000000000000000000000000000000000..72e3d65f52971294d1046f5c5607fba61a1fbee1
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/d.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/fond.gif b/www/include/options/sysInfos/templates/aq/images/fond.gif
new file mode 100644
index 0000000000000000000000000000000000000000..971a4a721632dd3245fb6c572db446569768f0c3
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/fond.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/g.gif b/www/include/options/sysInfos/templates/aq/images/g.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d98d7c3f177dffb5af6a800793ab3936578ddb0b
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/g.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/index.html b/www/include/options/sysInfos/templates/aq/images/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/aq/images/inf.gif b/www/include/options/sysInfos/templates/aq/images/inf.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ee1d7d5b6d2a2370f58810a66e62d4cb198ef450
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/inf.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/redbar_left.gif b/www/include/options/sysInfos/templates/aq/images/redbar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..31bfaf022a28aa839c715bb84137976cca725336
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/redbar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/redbar_middle.gif b/www/include/options/sysInfos/templates/aq/images/redbar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3be837dd2167387a8ea4970974e379f61de4f8ed
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/redbar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/redbar_right.gif b/www/include/options/sysInfos/templates/aq/images/redbar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..32826a974bb27da339b772e09a4e517a45e6c52c
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/redbar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/space15_15.gif b/www/include/options/sysInfos/templates/aq/images/space15_15.gif
new file mode 100644
index 0000000000000000000000000000000000000000..78d029c5dc084cbab91d82cec012b129376d4930
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/space15_15.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/images/sup.gif b/www/include/options/sysInfos/templates/aq/images/sup.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c7550a385e414a8598d308edbd8a9a026f69521a
Binary files /dev/null and b/www/include/options/sysInfos/templates/aq/images/sup.gif differ
diff --git a/www/include/options/sysInfos/templates/aq/index.html b/www/include/options/sysInfos/templates/aq/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/black/black.css b/www/include/options/sysInfos/templates/black/black.css
new file mode 100644
index 0000000000000000000000000000000000000000..1aef3f259ebae69e00313d8491b66037fafc5e9e
--- /dev/null
+++ b/www/include/options/sysInfos/templates/black/black.css
@@ -0,0 +1,54 @@
+A {
+  text-decoration: none;
+}
+A:link {
+  color: blue;
+}
+A:visited {
+  color: blue;
+}
+A:active {
+  color: blue;
+}
+body {
+  color: silver;
+  background-color: black;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 10px;
+  font-weight: normal;
+}
+font {
+    color:#c7c7c7;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 11px;
+    font-weight: normal;
+}
+H1 {
+    color:#FFFFFF;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 20px;
+}
+td {
+    color:#FFFFFF;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-weight: normal;
+    font-size: 20px;
+}
+select {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: normal;
+}
+input {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: bold;
+}
diff --git a/www/include/options/sysInfos/templates/black/box.tpl b/www/include/options/sysInfos/templates/black/box.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..26148a6b881736f2cc06e814e07325a3be59cea4
--- /dev/null
+++ b/www/include/options/sysInfos/templates/black/box.tpl
@@ -0,0 +1,23 @@
+<!-- BEGIN portal -->
+
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+  <tr> 
+    <td width="15" height="15" style="background-image: url({webpath}templates/black/images/coinsupg.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td height="15" style="background-image: url({webpath}templates/black/images/sup.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td width="15" height="15" style="background-image: url({webpath}templates/black/images/coinsupd.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+
+  <tr>
+   <td width="15" style="background-image: url({webpath}templates/black/images/g.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+   <td style="background-image: url({webpath}templates/black/images/fond.gif);" align="left" width="100%" dir="{text_dir}">{title}{content}</td>
+   <td width="15" style="background-image: url({webpath}templates/black/images/d.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+
+  <tr> 
+    <td width="15" height="15" style="background-image: url({webpath}templates/black/images/coininfg.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td height="15" style="background-image: url({webpath}templates/black/images/inf.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td width="15" height="15" style="background-image: url({webpath}templates/black/images/coininfd.gif);"><img src="{webpath}templates/black/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+</table>
+
+<!-- END portal -->
diff --git a/www/include/options/sysInfos/templates/black/form.tpl b/www/include/options/sysInfos/templates/black/form.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..70ec7ec0fecfc3a5875aa2ec109c4af788a99c69
--- /dev/null
+++ b/www/include/options/sysInfos/templates/black/form.tpl
@@ -0,0 +1,45 @@
+<center><h1>{title}</h1></center>
+
+<table width="100%" align="center" cellpadding="0" cellspacing="2">
+ <tr>
+  <td width="50%" valign="top">
+   {vitals}
+   <table cellpadding="0" cellspacing="0">
+   <tr><td height="8"></td></tr>
+   </table>
+   {network}
+  </td>
+
+  <td width="50%" valign="top">
+   {hardware}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {memory}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {filesystems}
+  </td>
+ </tr>
+</table>
+
+<table width="100%" cellpadding="0" cellspacing="2">
+ <tr>
+  <td width="55%" valign="top">
+   {mbtemp}
+   <table cellpadding="0" cellspacing="0">
+   <tr><td height="8"></td></tr>
+   </table>
+   {mbfans}
+  </td>
+
+  <td width="45%" valign="top">
+   {mbvoltage}
+  </td>
+ </tr>
+</table>
diff --git a/www/include/options/sysInfos/templates/black/images/aq_background.gif b/www/include/options/sysInfos/templates/black/images/aq_background.gif
new file mode 100644
index 0000000000000000000000000000000000000000..983b92bfb17b7cb5d2ce31f5021de0f7d27570a4
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/aq_background.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/bar_left.gif b/www/include/options/sysInfos/templates/black/images/bar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9e7ccc935d96909870d17cbbb3de0805ad3bed16
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/bar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/bar_middle.gif b/www/include/options/sysInfos/templates/black/images/bar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d10bbaeb69f3f3d8051befa54412f6ec35711f52
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/bar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/bar_right.gif b/www/include/options/sysInfos/templates/black/images/bar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e453636ee2c317769b0b7e187fb12ce581ec87d5
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/bar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/coininfd.gif b/www/include/options/sysInfos/templates/black/images/coininfd.gif
new file mode 100644
index 0000000000000000000000000000000000000000..cd90ac7b5b5e12bada5fb4d35f1f5fe1825d69c8
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/coininfd.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/coininfg.gif b/www/include/options/sysInfos/templates/black/images/coininfg.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2f540056ad7efc8013f40ecb75415dbb021980ac
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/coininfg.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/coinsupd.gif b/www/include/options/sysInfos/templates/black/images/coinsupd.gif
new file mode 100644
index 0000000000000000000000000000000000000000..18c78b7b462967eacad6bb5459de246fa9bc26d0
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/coinsupd.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/coinsupg.gif b/www/include/options/sysInfos/templates/black/images/coinsupg.gif
new file mode 100644
index 0000000000000000000000000000000000000000..8ccc2804b895d8eb19ca9551b8866436729d50cc
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/coinsupg.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/d.gif b/www/include/options/sysInfos/templates/black/images/d.gif
new file mode 100644
index 0000000000000000000000000000000000000000..cff70c2e71e37eb5c885e5479ebe282f9e78794d
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/d.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/fond.gif b/www/include/options/sysInfos/templates/black/images/fond.gif
new file mode 100644
index 0000000000000000000000000000000000000000..94cc46b83baac250675ef4aa53174f63dd00f5fa
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/fond.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/g.gif b/www/include/options/sysInfos/templates/black/images/g.gif
new file mode 100644
index 0000000000000000000000000000000000000000..23f6e09c2dabb1b58bdfe1cf2a800e28c38f0a81
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/g.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/index.html b/www/include/options/sysInfos/templates/black/images/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/black/images/inf.gif b/www/include/options/sysInfos/templates/black/images/inf.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4958049490bff0b3e21837d52210ddb217dddb5c
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/inf.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/redbar_left.gif b/www/include/options/sysInfos/templates/black/images/redbar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b60757e377734b1c8dc422cbc8e70886ee8e17c3
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/redbar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/redbar_middle.gif b/www/include/options/sysInfos/templates/black/images/redbar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..959ae3810a6f325767cc9c5815d997d8c91e0b98
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/redbar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/redbar_right.gif b/www/include/options/sysInfos/templates/black/images/redbar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ebc68481b6c4651df6df3a4342e7306b3274304d
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/redbar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/space15_15.gif b/www/include/options/sysInfos/templates/black/images/space15_15.gif
new file mode 100644
index 0000000000000000000000000000000000000000..78d029c5dc084cbab91d82cec012b129376d4930
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/space15_15.gif differ
diff --git a/www/include/options/sysInfos/templates/black/images/sup.gif b/www/include/options/sysInfos/templates/black/images/sup.gif
new file mode 100644
index 0000000000000000000000000000000000000000..981e5d983206e1a9f539effd4cd19bb019b7267e
Binary files /dev/null and b/www/include/options/sysInfos/templates/black/images/sup.gif differ
diff --git a/www/include/options/sysInfos/templates/black/index.html b/www/include/options/sysInfos/templates/black/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/blue/blue.css b/www/include/options/sysInfos/templates/blue/blue.css
new file mode 100644
index 0000000000000000000000000000000000000000..96b04bae278645ffd10570029584f6ea05952971
--- /dev/null
+++ b/www/include/options/sysInfos/templates/blue/blue.css
@@ -0,0 +1,71 @@
+A {
+  text-decoration: none;
+}
+A:link {
+  color: #486591;
+}
+A:visited {
+  color: #6f6c81;
+}
+A:active {
+  color: blue;
+}
+body {
+  color: #000000;
+  background-color: #fefefe;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 10px;
+  font-weight: normal;
+}
+font {
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+H1 {
+    color: #000000;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 20px;
+}
+select {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: normal;
+}
+input {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: bold;
+}
+table
+{
+  border: none;
+  margin: 0px;
+  padding: 0px;
+}
+table.box {
+  border-collapse: collapse;
+  background-color: transparent;
+  margin: 0px;
+  padding: 0px;
+  width: 100%;
+}
+tr.boxheader {
+  background-color: #bbeeff;
+}
+td.boxheader {
+  text-align: left;
+  background-color: #bbeeff;
+  padding: 5px;
+  border: solid black;
+  border-width: 1px 2px 2px 1px;
+}
+tr.boxbody {
+  background-color: #ddffff;
+}
diff --git a/www/include/options/sysInfos/templates/blue/box.tpl b/www/include/options/sysInfos/templates/blue/box.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..ae77293195beb61bbbe34bd520f150809a410bef
--- /dev/null
+++ b/www/include/options/sysInfos/templates/blue/box.tpl
@@ -0,0 +1,19 @@
+<table width="100%">
+ <tr>
+  <td>
+
+    <table class="box">
+
+     <tr class="boxheader">
+      <td class="boxheader">{title}</td>
+     </tr>
+
+     <tr class="boxbody">
+      <td dir="{text_dir}">{content}</td>
+     </tr>
+
+    </table>
+
+   </td>
+  </tr>
+</table>
diff --git a/www/include/options/sysInfos/templates/blue/form.tpl b/www/include/options/sysInfos/templates/blue/form.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..c98f4259a0035a883d1994689db3118e68d80358
--- /dev/null
+++ b/www/include/options/sysInfos/templates/blue/form.tpl
@@ -0,0 +1,40 @@
+<center><h1>{title}</h1></center>
+
+<table width="100%" align="center" cellpadding="0" cellspacing="10">
+ <tr>
+  <td width="50%" valign="top">
+   {vitals}
+   <br>
+   {network}
+  </td>
+
+  <td width="50%" valign="top">
+   {hardware}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {memory}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {filesystems}
+  </td>
+ </tr>
+</table>
+
+<table width="100%" cellpadding="0" cellspacing="10">
+ <tr>
+  <td width="55%" valign="top">
+   {mbtemp}
+   <br>
+   {mbfans}
+  </td>
+  <td width="45%" valign="top">
+   {mbvoltage}
+  </td>
+ </tr>
+</table>
diff --git a/www/include/options/sysInfos/templates/blue/images/bar_left.gif b/www/include/options/sysInfos/templates/blue/images/bar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..95c3ccd719094066c7a1a9cc925e0018ed805e92
Binary files /dev/null and b/www/include/options/sysInfos/templates/blue/images/bar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/blue/images/bar_middle.gif b/www/include/options/sysInfos/templates/blue/images/bar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f722e7149499d9a19677fddfea19cb0dea728962
Binary files /dev/null and b/www/include/options/sysInfos/templates/blue/images/bar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/blue/images/bar_right.gif b/www/include/options/sysInfos/templates/blue/images/bar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f7a79d740206c03b974d28b0599c2af790be93a1
Binary files /dev/null and b/www/include/options/sysInfos/templates/blue/images/bar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/blue/images/index.html b/www/include/options/sysInfos/templates/blue/images/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/blue/images/redbar_left.gif b/www/include/options/sysInfos/templates/blue/images/redbar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2f2b08b9fc8c0adc62718ac05d62e83c2c3fde9e
Binary files /dev/null and b/www/include/options/sysInfos/templates/blue/images/redbar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/blue/images/redbar_middle.gif b/www/include/options/sysInfos/templates/blue/images/redbar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..361f6679393e02990528513f60f4b56f4692a87d
Binary files /dev/null and b/www/include/options/sysInfos/templates/blue/images/redbar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/blue/images/redbar_right.gif b/www/include/options/sysInfos/templates/blue/images/redbar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..99229e68328682b1baac3887d00decded2fa2671
Binary files /dev/null and b/www/include/options/sysInfos/templates/blue/images/redbar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/blue/images/trans.gif b/www/include/options/sysInfos/templates/blue/images/trans.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5bfd67a2d6f72ac3a55cbfcea5866e841d22f5d9
Binary files /dev/null and b/www/include/options/sysInfos/templates/blue/images/trans.gif differ
diff --git a/www/include/options/sysInfos/templates/blue/index.html b/www/include/options/sysInfos/templates/blue/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/bulix/box.tpl b/www/include/options/sysInfos/templates/bulix/box.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..c3dd5d75a10b886a2e205a778c708153f6acf812
--- /dev/null
+++ b/www/include/options/sysInfos/templates/bulix/box.tpl
@@ -0,0 +1,13 @@
+<div class="box">
+
+<div class="boxheaderleft"></div>
+<div class="boxheaderright"></div>
+<div class="boxheadertext">
+{title}
+</div>
+
+<div class="boxcontent" dir="{text_dir}">
+{content}
+</div>
+
+</div>
diff --git a/www/include/options/sysInfos/templates/bulix/bulix.css b/www/include/options/sysInfos/templates/bulix/bulix.css
new file mode 100644
index 0000000000000000000000000000000000000000..f3396aa73144384d84a51ea207526e45ea2fcf28
--- /dev/null
+++ b/www/include/options/sysInfos/templates/bulix/bulix.css
@@ -0,0 +1,108 @@
+* {
+	font-family: Verdana,Helvetica,sans-serif;
+	font-size: 11px;
+	font-weight: normal;
+}
+
+a {
+  text-decoration: none;
+}
+
+a:link {
+        color: #09c;
+        background-color: transparent;
+}
+
+a:visited {
+        color: #09c;
+        background-color: transparent;
+}
+
+a:active {
+        color: blue;
+        background-color: transparent;
+}
+
+body {
+        background: #fff;
+}
+font {
+        text-decoration: none;
+        font-family: Verdana,Helvetica,sans-serif;
+        font-size: 11px;
+        font-weight: normal;
+}
+
+div.title {
+	font-size: 15pt;
+	font-weight: bold;
+	text-align: center;
+	padding: 10px;
+}
+
+select {
+        color: black;
+        text-decoration: none;
+        font-family: Verdana,Helvetica,sans-serif;
+        font-size: 10px;
+        font-weight: normal;
+}
+
+input {
+        color: black;
+        text-decoration: none;
+        font-family: Verdana,Helvetica,sans-serif;
+        font-size: 10px;
+        font-weight: bold;
+}
+table
+{
+        border: none;
+        margin: 0px;
+        padding: 0px;
+}
+
+div.box {
+	background: white;
+	width: 100%;
+}
+
+div.boxheaderleft
+{
+	background-image: url(images/left_bar.gif);
+	background-position: left top;
+	background-repeat: no-repeat;
+	height: 20px;
+	width: 20px;
+	float: left;
+}
+
+div.boxheaderright
+{
+	background-image: url(images/right_bar.gif);
+	background-position: right top;
+	background-repeat: no-repeat;
+	height: 20px;
+	width: 20px;
+	float: right;
+}
+
+div.boxheadertext
+{
+	font-weight: bold;
+	text-align: center;
+	border-right: 1px black solid;
+	height: 20px;
+	padding-top: 3px;
+	background-image: url(images/middle_bar.gif);
+	background-position: left top;
+	background-repeat: repeat-x;
+}
+
+div.boxcontent {
+	padding: 5px;
+	padding-top: 1em;
+	border: 1px #ccc solid;
+	border-top: none;
+	background: #efefef;
+}
diff --git a/www/include/options/sysInfos/templates/bulix/form.tpl b/www/include/options/sysInfos/templates/bulix/form.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..fbc27206b78ef8af26fa6c1eb804598ee4b7a698
--- /dev/null
+++ b/www/include/options/sysInfos/templates/bulix/form.tpl
@@ -0,0 +1,43 @@
+<div class="title">
+{title}
+</div>
+
+<table width="100%" align="center">
+ <tr>
+  <td width="50%" valign="top">
+   {vitals}
+   <br>
+   {network}
+   <br>
+   {memory}
+  </td>
+
+  <td width="50%" valign="top">
+   {hardware}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   <br>
+   {filesystems}
+  </td>
+ </tr>
+
+</table>
+
+<table width="100%" cellpadding="0" cellspacing="2">
+ <tr>
+  <td width="55%" valign="top">
+   {mbtemp}
+   <table>
+   <tr><td height="8"></td></tr>
+   </table>
+   {mbfans}
+  </td>
+ 
+  <td width="45%" valign="top">
+   {mbvoltage}
+  </td>
+ </tr>
+</table>
diff --git a/www/include/options/sysInfos/templates/bulix/images/bar_left.gif b/www/include/options/sysInfos/templates/bulix/images/bar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7e3a9896d0a42fe896bdee331dd2576bc5a01598
Binary files /dev/null and b/www/include/options/sysInfos/templates/bulix/images/bar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/bulix/images/bar_middle.gif b/www/include/options/sysInfos/templates/bulix/images/bar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7e3a9896d0a42fe896bdee331dd2576bc5a01598
Binary files /dev/null and b/www/include/options/sysInfos/templates/bulix/images/bar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/bulix/images/bar_right.gif b/www/include/options/sysInfos/templates/bulix/images/bar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7e3a9896d0a42fe896bdee331dd2576bc5a01598
Binary files /dev/null and b/www/include/options/sysInfos/templates/bulix/images/bar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/bulix/images/index.html b/www/include/options/sysInfos/templates/bulix/images/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/bulix/images/left_bar.gif b/www/include/options/sysInfos/templates/bulix/images/left_bar.gif
new file mode 100644
index 0000000000000000000000000000000000000000..8b3f4bcf8d9050851fa05048d653e4c6de696bde
Binary files /dev/null and b/www/include/options/sysInfos/templates/bulix/images/left_bar.gif differ
diff --git a/www/include/options/sysInfos/templates/bulix/images/middle_bar.gif b/www/include/options/sysInfos/templates/bulix/images/middle_bar.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a8555bd9326f1981b980653a60e9bb05ebf5bab9
Binary files /dev/null and b/www/include/options/sysInfos/templates/bulix/images/middle_bar.gif differ
diff --git a/www/include/options/sysInfos/templates/bulix/images/redbar_left.gif b/www/include/options/sysInfos/templates/bulix/images/redbar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a409b44195bb2063f10c98db57a0fb15860c1cd2
Binary files /dev/null and b/www/include/options/sysInfos/templates/bulix/images/redbar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/bulix/images/redbar_middle.gif b/www/include/options/sysInfos/templates/bulix/images/redbar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a409b44195bb2063f10c98db57a0fb15860c1cd2
Binary files /dev/null and b/www/include/options/sysInfos/templates/bulix/images/redbar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/bulix/images/redbar_right.gif b/www/include/options/sysInfos/templates/bulix/images/redbar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a409b44195bb2063f10c98db57a0fb15860c1cd2
Binary files /dev/null and b/www/include/options/sysInfos/templates/bulix/images/redbar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/bulix/images/right_bar.gif b/www/include/options/sysInfos/templates/bulix/images/right_bar.gif
new file mode 100644
index 0000000000000000000000000000000000000000..230d9859791a250f1b525aef8ace803b7217e9a8
Binary files /dev/null and b/www/include/options/sysInfos/templates/bulix/images/right_bar.gif differ
diff --git a/www/include/options/sysInfos/templates/bulix/images/trans.gif b/www/include/options/sysInfos/templates/bulix/images/trans.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5bfd67a2d6f72ac3a55cbfcea5866e841d22f5d9
Binary files /dev/null and b/www/include/options/sysInfos/templates/bulix/images/trans.gif differ
diff --git a/www/include/options/sysInfos/templates/bulix/index.html b/www/include/options/sysInfos/templates/bulix/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/classic/box.tpl b/www/include/options/sysInfos/templates/classic/box.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..a1d310fbe9f0be6d5de9504b16b78a83ee732c0f
--- /dev/null
+++ b/www/include/options/sysInfos/templates/classic/box.tpl
@@ -0,0 +1,14 @@
+<table width="100%">
+ <tr>
+  <td>
+    <table class="box">
+     <tr class="boxheader">
+      <td class="boxheader">{title}</td>
+     </tr>
+     <tr class="boxbody">
+      <td dir="{text_dir}">{content}</td>
+     </tr>
+    </table>
+   </td>
+  </tr>
+</table>
diff --git a/www/include/options/sysInfos/templates/classic/classic.css b/www/include/options/sysInfos/templates/classic/classic.css
new file mode 100644
index 0000000000000000000000000000000000000000..81216c20135a9280b0130d521219f42c3187c7a9
--- /dev/null
+++ b/www/include/options/sysInfos/templates/classic/classic.css
@@ -0,0 +1,66 @@
+A {
+  text-decoration: none;
+}
+A:link {
+  color: #486591;
+  background-color: transparent;
+}
+A:visited {
+  color: #6f6c81;
+  background-color: transparent;
+}
+A:active {
+  color: blue;
+  background-color: transparent;
+}
+font {
+  color: #000000;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+H1 {
+  padding-left:50px;
+  text-align:left;
+  color: #000000;
+  background-color: transparent;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 18px;
+}
+select {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: normal;
+}
+table
+{
+  border: none;
+  margin: 0px;
+  padding: 0px;
+}
+table.box {
+  color: #fefefe;
+  background-color: #486591;
+  border: none;
+  padding: 1px;
+  width: 100%;
+}
+tr.boxheader {
+  background-color: #486591;
+}
+td.boxheader {
+  text-align: center;
+  color:white;
+  font-weight: bold;
+}
+tr.boxbody {
+  color: #fefefe;
+  background-color: #e6e6e6;
+}
+title_sysInfo {
+	color:#ffffff;
+}
diff --git a/www/include/options/sysInfos/templates/classic/form.tpl b/www/include/options/sysInfos/templates/classic/form.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..42711fd36bc1b3477adaea8d96eb20464ff139a7
--- /dev/null
+++ b/www/include/options/sysInfos/templates/classic/form.tpl
@@ -0,0 +1,42 @@
+<center><h1>{title}</h1></center>
+
+<table width="100%" align="center">
+ <tr>
+  <td width="50%" valign="top">
+   {vitals}
+   <br>
+   {network}
+  </td>
+
+  <td width="50%" valign="top">
+   {hardware}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {memory}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {filesystems}
+  </td>
+ </tr>
+</table>
+
+<table width="100%">
+ <tr>
+  <td width="55%" valign="top">
+   {mbtemp}
+   <br>
+   {mbfans}
+  </td>
+
+  <td width="45%" valign="top">
+   {mbvoltage}
+  </td>
+ </tr>
+</table>
+
diff --git a/www/include/options/sysInfos/templates/classic/images/bar_left.gif b/www/include/options/sysInfos/templates/classic/images/bar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7e3a9896d0a42fe896bdee331dd2576bc5a01598
Binary files /dev/null and b/www/include/options/sysInfos/templates/classic/images/bar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/classic/images/bar_middle.gif b/www/include/options/sysInfos/templates/classic/images/bar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7e3a9896d0a42fe896bdee331dd2576bc5a01598
Binary files /dev/null and b/www/include/options/sysInfos/templates/classic/images/bar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/classic/images/bar_right.gif b/www/include/options/sysInfos/templates/classic/images/bar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7e3a9896d0a42fe896bdee331dd2576bc5a01598
Binary files /dev/null and b/www/include/options/sysInfos/templates/classic/images/bar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/classic/images/index.html b/www/include/options/sysInfos/templates/classic/images/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/classic/images/redbar_left.gif b/www/include/options/sysInfos/templates/classic/images/redbar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a409b44195bb2063f10c98db57a0fb15860c1cd2
Binary files /dev/null and b/www/include/options/sysInfos/templates/classic/images/redbar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/classic/images/redbar_middle.gif b/www/include/options/sysInfos/templates/classic/images/redbar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a409b44195bb2063f10c98db57a0fb15860c1cd2
Binary files /dev/null and b/www/include/options/sysInfos/templates/classic/images/redbar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/classic/images/redbar_right.gif b/www/include/options/sysInfos/templates/classic/images/redbar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a409b44195bb2063f10c98db57a0fb15860c1cd2
Binary files /dev/null and b/www/include/options/sysInfos/templates/classic/images/redbar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/classic/images/trans.gif b/www/include/options/sysInfos/templates/classic/images/trans.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5bfd67a2d6f72ac3a55cbfcea5866e841d22f5d9
Binary files /dev/null and b/www/include/options/sysInfos/templates/classic/images/trans.gif differ
diff --git a/www/include/options/sysInfos/templates/classic/index.html b/www/include/options/sysInfos/templates/classic/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/index.html b/www/include/options/sysInfos/templates/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/kde/box.tpl b/www/include/options/sysInfos/templates/kde/box.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..e72e8e55bde72cdb3afd2f4a3a98e1cb6e27b462
--- /dev/null
+++ b/www/include/options/sysInfos/templates/kde/box.tpl
@@ -0,0 +1,32 @@
+<!-- BEGIN portal -->
+
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+  <tr> 
+    <td width="29" height="29" style="background-image: url({webpath}templates/kde/images/coinsupg.gif);"><img src="{webpath}templates/kde/images/space15_15.gif" width="29" height="29" alt=""></td>
+    <td height="15" style="background-image: url({webpath}templates/kde/images/sup.gif);">
+      <table border="0" cellpadding="0" cellspacing="0">
+        <tr>
+          <td><img src="{webpath}templates/kde/images/title_left.gif" alt=""></td>
+          <td style="background-image: url({webpath}templates/kde/images/title_mid.gif);"><font size=-1 color="#FFFFFF"><b>{title}</b></font></td>
+          <td><img src="{webpath}templates/kde/images/title_right.gif" alt=""></td>
+        </tr>
+      </table>
+    </td>
+    <td align="right" style="background-image: url({webpath}templates/kde/images/sup.gif);"><img src="{webpath}templates/kde/images/icons.gif" alt=""></td>
+    <td width="29" height="29" style="background-image: url({webpath}templates/kde/images/coinsupd.gif);"><img src="{webpath}templates/kde/images/space15_15.gif" width="29" height="29" alt=""></td>
+  </tr>
+
+  <tr>
+   <td width="15" style="background-image: url({webpath}templates/kde/images/g.gif);"><img src="{webpath}templates/kde/images/space15_15.gif" width="15" height="15" alt=""></td>
+   <td colspan="2" style="background-image: url({webpath}templates/kde/images/fond.gif);" align="left" width="100%" dir="{text_dir}">{content}</td>
+   <td width="15" style="background-image: url({webpath}templates/kde/images/d.gif);"><img src="{webpath}templates/kde/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+
+  <tr> 
+    <td width="23" height="23" style="background-image: url({webpath}templates/kde/images/coininfg.gif);"><img src="{webpath}templates/kde/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td colspan="2" height="15" style="background-image: url({webpath}templates/kde/images/inf.gif);"></td>
+    <td width="24" height="23" style="background-image: url({webpath}templates/kde/images/coininfd.gif);"><img src="{webpath}templates/kde/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+</table>
+
+<!-- END portal -->
diff --git a/www/include/options/sysInfos/templates/kde/form.tpl b/www/include/options/sysInfos/templates/kde/form.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..70ec7ec0fecfc3a5875aa2ec109c4af788a99c69
--- /dev/null
+++ b/www/include/options/sysInfos/templates/kde/form.tpl
@@ -0,0 +1,45 @@
+<center><h1>{title}</h1></center>
+
+<table width="100%" align="center" cellpadding="0" cellspacing="2">
+ <tr>
+  <td width="50%" valign="top">
+   {vitals}
+   <table cellpadding="0" cellspacing="0">
+   <tr><td height="8"></td></tr>
+   </table>
+   {network}
+  </td>
+
+  <td width="50%" valign="top">
+   {hardware}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {memory}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {filesystems}
+  </td>
+ </tr>
+</table>
+
+<table width="100%" cellpadding="0" cellspacing="2">
+ <tr>
+  <td width="55%" valign="top">
+   {mbtemp}
+   <table cellpadding="0" cellspacing="0">
+   <tr><td height="8"></td></tr>
+   </table>
+   {mbfans}
+  </td>
+
+  <td width="45%" valign="top">
+   {mbvoltage}
+  </td>
+ </tr>
+</table>
diff --git a/www/include/options/sysInfos/templates/kde/images/background.gif b/www/include/options/sysInfos/templates/kde/images/background.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b4ae82b00a24f95a31fd36d94b23d322696371af
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/background.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/bar_left.gif b/www/include/options/sysInfos/templates/kde/images/bar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c6a1916d2bb568b657761d64c450fc6bf14e5b6c
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/bar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/bar_middle.gif b/www/include/options/sysInfos/templates/kde/images/bar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6f3dc84076b3853bad4b0a87626d86a985bc3860
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/bar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/bar_right.gif b/www/include/options/sysInfos/templates/kde/images/bar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..468309d6d936a935ca2c246d0c841988c798656f
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/bar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/coininfd.gif b/www/include/options/sysInfos/templates/kde/images/coininfd.gif
new file mode 100644
index 0000000000000000000000000000000000000000..cc1111e01de786f8f8f827eb551750a283afe194
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/coininfd.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/coininfg.gif b/www/include/options/sysInfos/templates/kde/images/coininfg.gif
new file mode 100644
index 0000000000000000000000000000000000000000..21b537fb57e6ba4e04b003c2fc69832419ed9a9d
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/coininfg.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/coinsupd.gif b/www/include/options/sysInfos/templates/kde/images/coinsupd.gif
new file mode 100644
index 0000000000000000000000000000000000000000..79f8212effaf1f38008853a381dac87f7a532723
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/coinsupd.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/coinsupg.gif b/www/include/options/sysInfos/templates/kde/images/coinsupg.gif
new file mode 100644
index 0000000000000000000000000000000000000000..dea8e046050cd8b8127fa2df612ca64982828c5a
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/coinsupg.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/d.gif b/www/include/options/sysInfos/templates/kde/images/d.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c9720318fe831423e024c0b51b2a80cc63684cf4
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/d.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/fond.gif b/www/include/options/sysInfos/templates/kde/images/fond.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2cdbb7866f8f6454991bb9243042e2c995744def
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/fond.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/g.gif b/www/include/options/sysInfos/templates/kde/images/g.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4bd5e32a916c07bf4a2deb76ddd3f88842ae829b
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/g.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/icons.gif b/www/include/options/sysInfos/templates/kde/images/icons.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4d1c581a3c8d4253d0a83a4d3ed61ec59d2452cd
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/icons.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/index.html b/www/include/options/sysInfos/templates/kde/images/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/kde/images/inf.gif b/www/include/options/sysInfos/templates/kde/images/inf.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4f7bf4992b5ce1bc8fc4270f41d1aae5eff39f58
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/inf.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/nobar_left.gif b/www/include/options/sysInfos/templates/kde/images/nobar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1841be9c2e6b73b098bfb11fa71f9b7f45835d32
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/nobar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/nobar_middle.gif b/www/include/options/sysInfos/templates/kde/images/nobar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4b10eb56baf801372611688cb35012030b88bdb3
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/nobar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/nobar_right.gif b/www/include/options/sysInfos/templates/kde/images/nobar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b7ce106e7055a49f634fdca98dbe7ce9063b7d7f
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/nobar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/redbar_left.gif b/www/include/options/sysInfos/templates/kde/images/redbar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..83cff83da9d98379684f6f0f43f67658e9d9cf9d
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/redbar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/redbar_middle.gif b/www/include/options/sysInfos/templates/kde/images/redbar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ab223d2bf79965822f6987b901d95734e75e51ca
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/redbar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/redbar_right.gif b/www/include/options/sysInfos/templates/kde/images/redbar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c836e2c9640e52707a9ce68442c15f7864c9e58d
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/redbar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/space15_15.gif b/www/include/options/sysInfos/templates/kde/images/space15_15.gif
new file mode 100644
index 0000000000000000000000000000000000000000..78d029c5dc084cbab91d82cec012b129376d4930
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/space15_15.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/sup.gif b/www/include/options/sysInfos/templates/kde/images/sup.gif
new file mode 100644
index 0000000000000000000000000000000000000000..21a26af1016bd0cd305b5f3e8591885325d681fd
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/sup.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/title_left.gif b/www/include/options/sysInfos/templates/kde/images/title_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3fcc74d50636a9c51dbc9dd4e972fbdd5f396069
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/title_left.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/title_mid.gif b/www/include/options/sysInfos/templates/kde/images/title_mid.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2ada2db553ff252534d6ec35159a7a6127c96e50
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/title_mid.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/images/title_right.gif b/www/include/options/sysInfos/templates/kde/images/title_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..22be5a845cae124508dcab72f7a7acee9f0b0f4c
Binary files /dev/null and b/www/include/options/sysInfos/templates/kde/images/title_right.gif differ
diff --git a/www/include/options/sysInfos/templates/kde/index.html b/www/include/options/sysInfos/templates/kde/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/kde/kde.css b/www/include/options/sysInfos/templates/kde/kde.css
new file mode 100644
index 0000000000000000000000000000000000000000..ccd76d244353e25b4b1e7f46b4031f76c5964267
--- /dev/null
+++ b/www/include/options/sysInfos/templates/kde/kde.css
@@ -0,0 +1,64 @@
+A {
+  text-decoration: none;
+}
+A:link {
+  color: blue;
+}
+A:visited {
+  color: blue;
+}
+A:active {
+  color: blue;
+}
+.itemtitle {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: none;
+}
+.itemtext {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+.tabletitles {
+  text-decoration: underline;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: bold;
+}
+body {
+  color: #000000;
+  background-color: #B0BAE4;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 10px;
+  font-weight: normal;
+}
+font {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+H1 {
+  color: #000000;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 20px;
+}
+select {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: normal;
+}
+input {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: bold;
+}
diff --git a/www/include/options/sysInfos/templates/metal/box.tpl b/www/include/options/sysInfos/templates/metal/box.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..0aa63802feff7877edd783fe1e0d3ea5234d423e
--- /dev/null
+++ b/www/include/options/sysInfos/templates/metal/box.tpl
@@ -0,0 +1,17 @@
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+  <tr> 
+    <td width="15" height="15" style="background-image: url({webpath}templates/metal/images/coinsupg.gif);"><img src="{webpath}templates/metal/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td height="15" style="background-image: url({webpath}templates/metal/images/sup.gif);"><img src="{webpath}templates/metal/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td width="15" height="15" style="background-image: url({webpath}templates/metal/images/coinsupd.gif);"><img src="{webpath}templates/metal/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+  <tr>
+   <td width="15" style="background-image: url({webpath}templates/metal/images/g.gif);"><img src="{webpath}templates/metal/images/space15_15.gif" width="15" height="15" alt=""></td>
+   <td style="background-image: url({webpath}templates/metal/images/fond.gif);" align="left" width="100%" dir="{text_dir}">{title}{content}</td>
+   <td width="15" style="background-image: url({webpath}templates/metal/images/d.gif);"><img src="{webpath}templates/metal/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+  <tr> 
+    <td width="15" height="15" style="background-image: url({webpath}templates/metal/images/coininfg.gif);"><img src="{webpath}templates/metal/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td height="15" style="background-image: url({webpath}templates/metal/images/inf.gif);"><img src="{webpath}templates/metal/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td width="15" height="15" style="background-image: url({webpath}templates/metal/images/coininfd.gif);"><img src="{webpath}templates/metal/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+</table>
diff --git a/www/include/options/sysInfos/templates/metal/form.tpl b/www/include/options/sysInfos/templates/metal/form.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..116aa97f87f7cf95e357906f25dbc0fa721d314d
--- /dev/null
+++ b/www/include/options/sysInfos/templates/metal/form.tpl
@@ -0,0 +1,45 @@
+<center><h1>{title}</h1></center>
+
+<table width="100%" align="center" cellpadding="0" cellspacing="2">
+ <tr>
+  <td width="50%" valign="top">
+   {vitals}
+   <table cellpadding="0" cellspacing="0">
+   <tr><td height="8"></td></tr>
+   </table>
+   {network}
+  </td>
+
+  <td width="50%" valign="top">
+   {hardware}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {memory}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {filesystems}
+  </td>
+ </tr>
+
+</table>
+
+<table width="100%" cellpadding="0" cellspacing="2">
+ <tr>
+  <td width="55%" valign="top">
+   {mbtemp}
+   <table cellpadding="0" cellspacing="0">
+   <tr><td height="8"></td></tr>
+   </table>
+   {mbfans}
+  </td>
+  <td width="45%" valign="top">
+   {mbvoltage}
+  </td>
+ </tr>
+</table>
diff --git a/www/include/options/sysInfos/templates/metal/images/bar_left.gif b/www/include/options/sysInfos/templates/metal/images/bar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ea4dd31425958f915a84572fd616fcaa3ec20c1a
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/bar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/bar_middle.gif b/www/include/options/sysInfos/templates/metal/images/bar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..257ce0b3bbb7ce96aad920bd02261b43140032d6
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/bar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/bar_right.gif b/www/include/options/sysInfos/templates/metal/images/bar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..706736679eeb2ca178ad138f0c24fbe180c4a65c
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/bar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/coininfd.gif b/www/include/options/sysInfos/templates/metal/images/coininfd.gif
new file mode 100644
index 0000000000000000000000000000000000000000..12ffd5547aae51f533f446ebb70944f049d8f846
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/coininfd.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/coininfg.gif b/www/include/options/sysInfos/templates/metal/images/coininfg.gif
new file mode 100644
index 0000000000000000000000000000000000000000..dad271e13ab19c91726358fba2fd019b71deaceb
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/coininfg.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/coinsupd.gif b/www/include/options/sysInfos/templates/metal/images/coinsupd.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c0dbf6db5ce3ef6b4c8314af9c1e690c8e487364
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/coinsupd.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/coinsupg.gif b/www/include/options/sysInfos/templates/metal/images/coinsupg.gif
new file mode 100644
index 0000000000000000000000000000000000000000..00fb42ddd23cc6a5ce4f61c38be98bf4566c9452
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/coinsupg.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/d.gif b/www/include/options/sysInfos/templates/metal/images/d.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d4fb3a8dc2de9ee39a89982fbab5f152f45bee0f
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/d.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/fond.gif b/www/include/options/sysInfos/templates/metal/images/fond.gif
new file mode 100644
index 0000000000000000000000000000000000000000..67a7c414ab9a65af7bc906abf176933f2a49e59b
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/fond.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/g.gif b/www/include/options/sysInfos/templates/metal/images/g.gif
new file mode 100644
index 0000000000000000000000000000000000000000..fd1754d69570398e308f6377629911f0eb92ac2c
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/g.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/index.html b/www/include/options/sysInfos/templates/metal/images/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/metal/images/inf.gif b/www/include/options/sysInfos/templates/metal/images/inf.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c5b002333765878414885e75d40ceb5f48b6c6aa
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/inf.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/metal_background.gif b/www/include/options/sysInfos/templates/metal/images/metal_background.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6cdadab2f4efd6993237a6d7445a70fcd19394f6
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/metal_background.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/redbar_left.gif b/www/include/options/sysInfos/templates/metal/images/redbar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..668a7ac5cb1e0d4c1eaa298b6a7b4518b927eae5
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/redbar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/redbar_middle.gif b/www/include/options/sysInfos/templates/metal/images/redbar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..743f6cda802cd15afbaae1e97eec5b4f753ef96d
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/redbar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/redbar_right.gif b/www/include/options/sysInfos/templates/metal/images/redbar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b142ddf02f932246a847d0e36b2ed873bfaca0c2
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/redbar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/space15_15.gif b/www/include/options/sysInfos/templates/metal/images/space15_15.gif
new file mode 100644
index 0000000000000000000000000000000000000000..78d029c5dc084cbab91d82cec012b129376d4930
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/space15_15.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/images/sup.gif b/www/include/options/sysInfos/templates/metal/images/sup.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ad86a98139e8316f7e2e5de7ce67ad256e3d2c2d
Binary files /dev/null and b/www/include/options/sysInfos/templates/metal/images/sup.gif differ
diff --git a/www/include/options/sysInfos/templates/metal/index.html b/www/include/options/sysInfos/templates/metal/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/metal/metal.css b/www/include/options/sysInfos/templates/metal/metal.css
new file mode 100644
index 0000000000000000000000000000000000000000..a9fdf04c3664a0890cd2397dadf88f646cc9a613
--- /dev/null
+++ b/www/include/options/sysInfos/templates/metal/metal.css
@@ -0,0 +1,50 @@
+A {
+  text-decoration: none;
+}
+A:link {
+  color: #486591;
+  background-color: transparent;
+}
+A:visited {
+  color: #6f6c81;
+  background-color: transparent;
+}
+A:active {
+  color: blue;
+  background-color: transparent;
+}
+body {
+  color: #000000;
+  background-color: #fefefe;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 10px;
+  font-weight: normal;
+}
+font {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+H1 {
+  color: #000000;
+  background-color: transparent;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 20px;
+}
+select {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: normal;
+}
+input {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: bold;
+}
diff --git a/www/include/options/sysInfos/templates/orange/box.tpl b/www/include/options/sysInfos/templates/orange/box.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..21f5c06f96dd79ade6e8ec88144a06e08d732444
--- /dev/null
+++ b/www/include/options/sysInfos/templates/orange/box.tpl
@@ -0,0 +1,19 @@
+<table width="100%">
+ <tr>
+  <td>
+
+    <table cellspacing="1"class="box">
+
+     <tr class="boxheader">
+      <td class="boxheader">{title}</td>
+     </tr>
+
+     <tr class="boxbody">
+      <td dir="{text_dir}">{content}</td>
+     </tr>
+
+    </table>
+
+   </td>
+  </tr>
+</table>
diff --git a/www/include/options/sysInfos/templates/orange/form.tpl b/www/include/options/sysInfos/templates/orange/form.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..42711fd36bc1b3477adaea8d96eb20464ff139a7
--- /dev/null
+++ b/www/include/options/sysInfos/templates/orange/form.tpl
@@ -0,0 +1,42 @@
+<center><h1>{title}</h1></center>
+
+<table width="100%" align="center">
+ <tr>
+  <td width="50%" valign="top">
+   {vitals}
+   <br>
+   {network}
+  </td>
+
+  <td width="50%" valign="top">
+   {hardware}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {memory}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {filesystems}
+  </td>
+ </tr>
+</table>
+
+<table width="100%">
+ <tr>
+  <td width="55%" valign="top">
+   {mbtemp}
+   <br>
+   {mbfans}
+  </td>
+
+  <td width="45%" valign="top">
+   {mbvoltage}
+  </td>
+ </tr>
+</table>
+
diff --git a/www/include/options/sysInfos/templates/orange/images/bar_left.gif b/www/include/options/sysInfos/templates/orange/images/bar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d21525239f87c1fb92c1b915e9036cb3df045133
Binary files /dev/null and b/www/include/options/sysInfos/templates/orange/images/bar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/orange/images/bar_middle.gif b/www/include/options/sysInfos/templates/orange/images/bar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7f63773692e974fc0fbd7dde8d5a1f4fb6a27ac5
Binary files /dev/null and b/www/include/options/sysInfos/templates/orange/images/bar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/orange/images/bar_right.gif b/www/include/options/sysInfos/templates/orange/images/bar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3363ad7bb81e054a58164e99ef5ddc18c05316f0
Binary files /dev/null and b/www/include/options/sysInfos/templates/orange/images/bar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/orange/images/index.html b/www/include/options/sysInfos/templates/orange/images/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/orange/images/redbar_left.gif b/www/include/options/sysInfos/templates/orange/images/redbar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..3d86cda1bbd9cb51f41b029f83e16bab22cc8737
Binary files /dev/null and b/www/include/options/sysInfos/templates/orange/images/redbar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/orange/images/redbar_middle.gif b/www/include/options/sysInfos/templates/orange/images/redbar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..48bbdd177772d953b5c5cda7453d332cae6f1036
Binary files /dev/null and b/www/include/options/sysInfos/templates/orange/images/redbar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/orange/images/redbar_right.gif b/www/include/options/sysInfos/templates/orange/images/redbar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..693804558df5d2badb77b0a0ef59e271c47b0878
Binary files /dev/null and b/www/include/options/sysInfos/templates/orange/images/redbar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/orange/images/trans.gif b/www/include/options/sysInfos/templates/orange/images/trans.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5bfd67a2d6f72ac3a55cbfcea5866e841d22f5d9
Binary files /dev/null and b/www/include/options/sysInfos/templates/orange/images/trans.gif differ
diff --git a/www/include/options/sysInfos/templates/orange/index.html b/www/include/options/sysInfos/templates/orange/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/orange/orange.css b/www/include/options/sysInfos/templates/orange/orange.css
new file mode 100644
index 0000000000000000000000000000000000000000..89183971b11b586d38f38969751147f1711b4b1a
--- /dev/null
+++ b/www/include/options/sysInfos/templates/orange/orange.css
@@ -0,0 +1,75 @@
+A {
+  text-decoration: none;
+}
+A:link {
+  color: #777777;
+  background-color: transparent;
+}
+A:visited {
+  color: #000000;
+  background-color: transparent;
+}
+A:active {
+  color: #000000;
+  background-color: transparent;
+}
+body {
+  color: #000000;
+  background-color: #fffae8;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+font {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+H1 {
+  color: #000000;
+  background-color: transparent;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 20px;
+}
+select {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: normal;
+}
+input {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: bold;
+}
+table
+{
+  border: none;
+  margin: 0px;
+  padding: 0px;
+}
+table.box {
+  color: #000000;
+	font-weight: bold;
+  background-color: #000000;
+  border: none;
+	border-spacing: 1px;
+  padding: 1px;
+  width: 100%;
+}
+tr.boxheader {
+  background-color: #ffa853;
+}
+td.boxheader {
+  text-align: center;
+}
+tr.boxbody {
+  color: #000;
+  background-color: #ffeacb;
+}
diff --git a/www/include/options/sysInfos/templates/typo3/box.tpl b/www/include/options/sysInfos/templates/typo3/box.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..ae77293195beb61bbbe34bd520f150809a410bef
--- /dev/null
+++ b/www/include/options/sysInfos/templates/typo3/box.tpl
@@ -0,0 +1,19 @@
+<table width="100%">
+ <tr>
+  <td>
+
+    <table class="box">
+
+     <tr class="boxheader">
+      <td class="boxheader">{title}</td>
+     </tr>
+
+     <tr class="boxbody">
+      <td dir="{text_dir}">{content}</td>
+     </tr>
+
+    </table>
+
+   </td>
+  </tr>
+</table>
diff --git a/www/include/options/sysInfos/templates/typo3/form.tpl b/www/include/options/sysInfos/templates/typo3/form.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..42711fd36bc1b3477adaea8d96eb20464ff139a7
--- /dev/null
+++ b/www/include/options/sysInfos/templates/typo3/form.tpl
@@ -0,0 +1,42 @@
+<center><h1>{title}</h1></center>
+
+<table width="100%" align="center">
+ <tr>
+  <td width="50%" valign="top">
+   {vitals}
+   <br>
+   {network}
+  </td>
+
+  <td width="50%" valign="top">
+   {hardware}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {memory}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {filesystems}
+  </td>
+ </tr>
+</table>
+
+<table width="100%">
+ <tr>
+  <td width="55%" valign="top">
+   {mbtemp}
+   <br>
+   {mbfans}
+  </td>
+
+  <td width="45%" valign="top">
+   {mbvoltage}
+  </td>
+ </tr>
+</table>
+
diff --git a/www/include/options/sysInfos/templates/typo3/images/bar_left.gif b/www/include/options/sysInfos/templates/typo3/images/bar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7e3a9896d0a42fe896bdee331dd2576bc5a01598
Binary files /dev/null and b/www/include/options/sysInfos/templates/typo3/images/bar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/typo3/images/bar_middle.gif b/www/include/options/sysInfos/templates/typo3/images/bar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..7e3a9896d0a42fe896bdee331dd2576bc5a01598
Binary files /dev/null and b/www/include/options/sysInfos/templates/typo3/images/bar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/typo3/images/bar_right.gif b/www/include/options/sysInfos/templates/typo3/images/bar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/typo3/images/index.html b/www/include/options/sysInfos/templates/typo3/images/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/typo3/images/redbar_left.gif b/www/include/options/sysInfos/templates/typo3/images/redbar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a409b44195bb2063f10c98db57a0fb15860c1cd2
Binary files /dev/null and b/www/include/options/sysInfos/templates/typo3/images/redbar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/typo3/images/redbar_middle.gif b/www/include/options/sysInfos/templates/typo3/images/redbar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a409b44195bb2063f10c98db57a0fb15860c1cd2
Binary files /dev/null and b/www/include/options/sysInfos/templates/typo3/images/redbar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/typo3/images/redbar_right.gif b/www/include/options/sysInfos/templates/typo3/images/redbar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..a409b44195bb2063f10c98db57a0fb15860c1cd2
Binary files /dev/null and b/www/include/options/sysInfos/templates/typo3/images/redbar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/typo3/images/trans.gif b/www/include/options/sysInfos/templates/typo3/images/trans.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5bfd67a2d6f72ac3a55cbfcea5866e841d22f5d9
Binary files /dev/null and b/www/include/options/sysInfos/templates/typo3/images/trans.gif differ
diff --git a/www/include/options/sysInfos/templates/typo3/index.html b/www/include/options/sysInfos/templates/typo3/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/typo3/typo3.css b/www/include/options/sysInfos/templates/typo3/typo3.css
new file mode 100644
index 0000000000000000000000000000000000000000..8ffa78d3b3435a475804d9541a8878dda6af6c2c
--- /dev/null
+++ b/www/include/options/sysInfos/templates/typo3/typo3.css
@@ -0,0 +1,76 @@
+A {
+  color: #000000;
+  text-decoration: none;
+}
+A:link {
+  color: #486591;
+  background-color: transparent;
+}
+A:visited {
+  color: #6f6c81;
+  background-color: transparent;
+}
+A:active {
+  
+  background-color: transparent;
+}
+body {
+  color: #000000;
+  background-color: #F7F3EF;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+font {
+  color: #000000;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+H1 {
+  color: #000000;
+  background-color: transparent;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 20px;
+}
+select {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: normal;
+}
+input {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: bold;
+}
+table
+{
+  border: none;
+  margin: 0px;
+  padding: 0px;
+}
+table.box {
+  color: #fefefe;
+  background-color: ;
+  border: none;
+  padding: 1px;
+  width: 100%;
+}
+tr.boxheader {
+  background-color: #9BA1A8;
+}
+td.boxheader {
+  color: #000000;
+  text-align: center;
+}
+tr.boxbody {
+  color: #000000;
+  background-color: #F7F3EF;
+}
diff --git a/www/include/options/sysInfos/templates/windows_classic/box.tpl b/www/include/options/sysInfos/templates/windows_classic/box.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..3a37db4aee625d767bfe33e8ba9f408d2b477999
--- /dev/null
+++ b/www/include/options/sysInfos/templates/windows_classic/box.tpl
@@ -0,0 +1,24 @@
+<!-- BEGIN portal -->
+
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+  <tr> 
+    <td width="23" height="25" style="background-image: url({webpath}templates/windows_classic/images/upper_left_corner.gif);"><img src="{webpath}templates/windows_classic/images/spacer.gif" width="23" height="25" alt=""></td>
+    <td height="25" style="background-image: url({webpath}templates/windows_classic/images/top.gif);"><font color="#FFFFFF"><b>&nbsp;&nbsp;{title}</b></font></td>
+    <td align="right" style="background-image: url({webpath}templates/windows_classic/images/top.gif);"><img src="{webpath}templates/windows_classic/images/min_max.gif" width="34" height="25" alt=""></td>
+    <td width="23" height="25" style="background-image: url({webpath}templates/windows_classic/images/upper_right_corner.gif);"><img src="{webpath}templates/windows_classic/images/spacer.gif" width="23" height="25" alt=""></td>
+  </tr>
+
+  <tr>
+   <td width="23" style="background-image: url({webpath}templates/windows_classic/images/left.gif);"><img src="{webpath}templates/windows_classic/images/spacer.gif" width="23" alt=""></td>
+   <td colspan="2" style="background-image: url({webpath}templates/windows_classic/images/middle.gif);" align="left" width="100%" dir="{text_dir}">{content}</td>
+   <td width="23" style="background-image: url({webpath}templates/windows_classic/images/right.gif);"><img src="{webpath}templates/windows_classic/images/spacer.gif" width="23" alt=""></td>
+  </tr>
+
+  <tr> 
+    <td width="23" height="26" style="background-image: url({webpath}templates/windows_classic/images/bottom_left_corner.gif);"><img src="{webpath}templates/windows_classic/images/spacer.gif" width="23" height="26" alt=""></td>
+    <td colspan="2" height="16" style="background-image: url({webpath}templates/windows_classic/images/bottom.gif);"></td>
+    <td width="24" height="26" style="background-image: url({webpath}templates/windows_classic/images/bottom_right_corner.gif);"><img src="{webpath}templates/windows_classic/images/spacer.gif" width="23" height="26" alt=""></td>
+  </tr>
+</table>
+
+<!-- END portal -->
diff --git a/www/include/options/sysInfos/templates/windows_classic/form.tpl b/www/include/options/sysInfos/templates/windows_classic/form.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..d5c55e58cd8d6153291b7d9927e8b2207e12591e
--- /dev/null
+++ b/www/include/options/sysInfos/templates/windows_classic/form.tpl
@@ -0,0 +1,46 @@
+<center><h1>{title}</h1></center>
+
+<table width="100%" align="center" cellpadding="0" cellspacing="2">
+ <tr>
+  <td width="50%" valign="top">
+   {vitals}
+   <table cellpadding="0" cellspacing="0">
+   <tr><td height="8"></td></tr>
+   </table>
+   {network}
+  </td>
+
+  <td width="50%" valign="top">
+   {hardware}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {memory}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {filesystems}
+  </td>
+ </tr>
+</table>
+
+<table width="100%" cellpadding="0" cellspacing="2">
+ <tr>
+  <td width="55%" valign="top">
+   {mbtemp}
+   <table cellpadding="0" cellspacing="0">
+   <tr><td height="8"></td></tr>
+   </table>
+   {mbfans}
+  </td>
+
+  <td width="45%" valign="top">
+   {mbvoltage}
+  </td>
+ </tr>
+
+</table>
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/bar_left.gif b/www/include/options/sysInfos/templates/windows_classic/images/bar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..06058f676b331fa14b942f495c5bc110cdca6aec
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/bar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/bar_middle.gif b/www/include/options/sysInfos/templates/windows_classic/images/bar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4b720ca3dadb18378c0080b96e615707805a08be
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/bar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/bar_right.gif b/www/include/options/sysInfos/templates/windows_classic/images/bar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9f0a02eb05390b394cc5c6fb4f086da309d9ce24
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/bar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/bottom.gif b/www/include/options/sysInfos/templates/windows_classic/images/bottom.gif
new file mode 100644
index 0000000000000000000000000000000000000000..30151d22d26c7825a34c975b418de81c7009c14c
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/bottom.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/bottom_left_corner.gif b/www/include/options/sysInfos/templates/windows_classic/images/bottom_left_corner.gif
new file mode 100644
index 0000000000000000000000000000000000000000..f6e3ea74fab19b65233ac6d94da7d56e079cb4d1
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/bottom_left_corner.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/bottom_right_corner.gif b/www/include/options/sysInfos/templates/windows_classic/images/bottom_right_corner.gif
new file mode 100644
index 0000000000000000000000000000000000000000..49f348fdea98e0f91b897f4d963c962b3903184f
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/bottom_right_corner.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/index.html b/www/include/options/sysInfos/templates/windows_classic/images/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/left.gif b/www/include/options/sysInfos/templates/windows_classic/images/left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..08d9010c3ab6391308dd6851b297ffb457f70eab
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/left.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/middle.gif b/www/include/options/sysInfos/templates/windows_classic/images/middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9f5259c87d4f8b6b9ccc75c7d06aeb13c73f55c0
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/middle.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/min_max.gif b/www/include/options/sysInfos/templates/windows_classic/images/min_max.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5f0223f3b3eb625b3d363ec576cd8ab7a8c1783c
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/min_max.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/nobar_left.gif b/www/include/options/sysInfos/templates/windows_classic/images/nobar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e5cf245004e3b75ac0faf740ce29196d38337120
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/nobar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/nobar_middle.gif b/www/include/options/sysInfos/templates/windows_classic/images/nobar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..63718e247e2579a5fbe7291e550499c410d76ffb
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/nobar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/nobar_right.gif b/www/include/options/sysInfos/templates/windows_classic/images/nobar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2198a4dcd86a99855029ceae4353a2497f68bfd1
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/nobar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/redbar_left.gif b/www/include/options/sysInfos/templates/windows_classic/images/redbar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..30541c45248dbcb9bbc117b0f1fd6d8560f85b40
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/redbar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/redbar_middle.gif b/www/include/options/sysInfos/templates/windows_classic/images/redbar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c5977119300ed53cbbdf3c7990b8e8d1cc9304b4
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/redbar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/redbar_right.gif b/www/include/options/sysInfos/templates/windows_classic/images/redbar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..516e779643a695bc082f1dee2051619fc8750422
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/redbar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/right.gif b/www/include/options/sysInfos/templates/windows_classic/images/right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9d22425dd98eeb3d90132c9a4130c1396b491f62
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/right.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/spacer.gif b/www/include/options/sysInfos/templates/windows_classic/images/spacer.gif
new file mode 100644
index 0000000000000000000000000000000000000000..78d029c5dc084cbab91d82cec012b129376d4930
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/spacer.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/top.gif b/www/include/options/sysInfos/templates/windows_classic/images/top.gif
new file mode 100644
index 0000000000000000000000000000000000000000..2986c92df4456be8b52c7602b4b6dd26634aba58
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/top.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/upper_left_corner.gif b/www/include/options/sysInfos/templates/windows_classic/images/upper_left_corner.gif
new file mode 100644
index 0000000000000000000000000000000000000000..54071955377bc3e006b190e430d84c720384e000
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/upper_left_corner.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/upper_right_corner.gif b/www/include/options/sysInfos/templates/windows_classic/images/upper_right_corner.gif
new file mode 100644
index 0000000000000000000000000000000000000000..561bcd915f28de9b61ba439105d8e81e35ae7c7e
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/upper_right_corner.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/yellowbar_left.gif b/www/include/options/sysInfos/templates/windows_classic/images/yellowbar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..92bd0f86eea6df93564096498069ecdc9d6a3390
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/yellowbar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/yellowbar_middle.gif b/www/include/options/sysInfos/templates/windows_classic/images/yellowbar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..cc6107a45ec02675f9c60355cddf17820b3b1e3c
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/yellowbar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/images/yellowbar_right.gif b/www/include/options/sysInfos/templates/windows_classic/images/yellowbar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..516e779643a695bc082f1dee2051619fc8750422
Binary files /dev/null and b/www/include/options/sysInfos/templates/windows_classic/images/yellowbar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/windows_classic/index.html b/www/include/options/sysInfos/templates/windows_classic/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/windows_classic/windows_classic.css b/www/include/options/sysInfos/templates/windows_classic/windows_classic.css
new file mode 100644
index 0000000000000000000000000000000000000000..f12ddae97ec160aa353ae83f53fa0d880ac5f6a0
--- /dev/null
+++ b/www/include/options/sysInfos/templates/windows_classic/windows_classic.css
@@ -0,0 +1,64 @@
+A {
+  text-decoration: none;
+}
+A:link {
+  color: #486591;
+}
+A:visited {
+  color: #A0AD81;
+}
+A:active {
+  color: blue;
+}
+.itemtitle {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: none;
+}
+.itemtext {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+.tabletitles {
+  text-decoration: underline;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: bold;
+}
+body {
+  color: #000000;
+  background-color: #008080;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 10px;
+  font-weight: normal;
+}
+font {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+H1 {
+  color: #FFFFFF;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 20px;
+}
+select {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: normal;
+}
+input {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: bold;
+}
diff --git a/www/include/options/sysInfos/templates/wintendoxp/box.tpl b/www/include/options/sysInfos/templates/wintendoxp/box.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..58ddda0ec50232a399e7a87dcba7858f7c2fd65e
--- /dev/null
+++ b/www/include/options/sysInfos/templates/wintendoxp/box.tpl
@@ -0,0 +1,24 @@
+<!-- BEGIN portal -->
+
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+  <tr> 
+    <td width="22" height="25" style="background-image: url(templates/wintendoxp/images/coinsupg.gif);"><img src="templates/wintendoxp/images/space15_15.gif" width="22" height="25" alt=""></td>
+    <td height="15" style="background-image: url(templates/wintendoxp/images/sup.gif);"><font color="#FFFFFF"><b>&nbsp;&nbsp;{title}</b></font></td>
+    <td align="right" style="background-image: url(templates/wintendoxp/images/sup.gif);"><img src="templates/wintendoxp/images/icons.gif" alt=""></td>
+    <td width="27" height="25" style="background-image: url(templates/wintendoxp/images/coinsupd.gif);"><img src="templates/wintendoxp/images/space15_15.gif" width="27" height="25" alt=""></td>
+  </tr>
+
+  <tr>
+   <td width="15" style="background-image: url(templates/wintendoxp/images/g.gif);"><img src="templates/wintendoxp/images/space15_15.gif" width="15" height="15" alt=""></td>
+   <td colspan="2" style="background-image: url(templates/wintendoxp/images/fond.gif);" align="left" width="100%" dir="{text_dir}">{content}</td>
+   <td width="15" style="background-image: url(templates/wintendoxp/images/d.gif);"><img src="templates/wintendoxp/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+
+  <tr> 
+    <td width="23" height="23" style="background-image: url(templates/wintendoxp/images/coininfg.gif);"><img src="templates/wintendoxp/images/space15_15.gif" width="15" height="15" alt=""></td>
+    <td colspan="2" height="15" style="background-image: url(templates/wintendoxp/images/inf.gif);"></td>
+    <td width="24" height="23" style="background-image: url(templates/wintendoxp/images/coininfd.gif);"><img src="templates/wintendoxp/images/space15_15.gif" width="15" height="15" alt=""></td>
+  </tr>
+</table>
+
+<!-- END portal -->
diff --git a/www/include/options/sysInfos/templates/wintendoxp/form.tpl b/www/include/options/sysInfos/templates/wintendoxp/form.tpl
new file mode 100644
index 0000000000000000000000000000000000000000..d5c55e58cd8d6153291b7d9927e8b2207e12591e
--- /dev/null
+++ b/www/include/options/sysInfos/templates/wintendoxp/form.tpl
@@ -0,0 +1,46 @@
+<center><h1>{title}</h1></center>
+
+<table width="100%" align="center" cellpadding="0" cellspacing="2">
+ <tr>
+  <td width="50%" valign="top">
+   {vitals}
+   <table cellpadding="0" cellspacing="0">
+   <tr><td height="8"></td></tr>
+   </table>
+   {network}
+  </td>
+
+  <td width="50%" valign="top">
+   {hardware}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {memory}
+  </td>
+ </tr>
+
+ <tr>
+  <td colspan="2">
+   {filesystems}
+  </td>
+ </tr>
+</table>
+
+<table width="100%" cellpadding="0" cellspacing="2">
+ <tr>
+  <td width="55%" valign="top">
+   {mbtemp}
+   <table cellpadding="0" cellspacing="0">
+   <tr><td height="8"></td></tr>
+   </table>
+   {mbfans}
+  </td>
+
+  <td width="45%" valign="top">
+   {mbvoltage}
+  </td>
+ </tr>
+
+</table>
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/aq_background.gif b/www/include/options/sysInfos/templates/wintendoxp/images/aq_background.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c34fa449ee6659e4a74ddd168f8028c4133a4f66
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/aq_background.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/background.gif b/www/include/options/sysInfos/templates/wintendoxp/images/background.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e093c8644ba2668289e4e504136018444c1cc039
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/background.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/bar_left.gif b/www/include/options/sysInfos/templates/wintendoxp/images/bar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..06058f676b331fa14b942f495c5bc110cdca6aec
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/bar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/bar_middle.gif b/www/include/options/sysInfos/templates/wintendoxp/images/bar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4b720ca3dadb18378c0080b96e615707805a08be
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/bar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/bar_right.gif b/www/include/options/sysInfos/templates/wintendoxp/images/bar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9f0a02eb05390b394cc5c6fb4f086da309d9ce24
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/bar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/coininfd.gif b/www/include/options/sysInfos/templates/wintendoxp/images/coininfd.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6825b54256cfb1269e745b827f8e6be7619af80c
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/coininfd.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/coininfg.gif b/www/include/options/sysInfos/templates/wintendoxp/images/coininfg.gif
new file mode 100644
index 0000000000000000000000000000000000000000..1f34f2a0c4699042b49b73b20db8cfe1fd2bf97a
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/coininfg.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/coinsupd.gif b/www/include/options/sysInfos/templates/wintendoxp/images/coinsupd.gif
new file mode 100644
index 0000000000000000000000000000000000000000..82b0a87118aac481c36caed8a1c94ad23c3acafb
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/coinsupd.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/coinsupg.gif b/www/include/options/sysInfos/templates/wintendoxp/images/coinsupg.gif
new file mode 100644
index 0000000000000000000000000000000000000000..bb5bb690ee70bc2b76d2387b01770e6915fa3f86
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/coinsupg.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/d.gif b/www/include/options/sysInfos/templates/wintendoxp/images/d.gif
new file mode 100644
index 0000000000000000000000000000000000000000..0e96b34739f1dd4fc01b5e2828e37034449912f1
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/d.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/fond.gif b/www/include/options/sysInfos/templates/wintendoxp/images/fond.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c05184a52776550c0bca9eda08d6fbaedfee4560
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/fond.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/g.gif b/www/include/options/sysInfos/templates/wintendoxp/images/g.gif
new file mode 100644
index 0000000000000000000000000000000000000000..273ce485f77541a7db244265a778f25f24e2aad0
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/g.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/icons.gif b/www/include/options/sysInfos/templates/wintendoxp/images/icons.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4e85accb54cbbb29aaef5a264970035f807328c8
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/icons.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/index.html b/www/include/options/sysInfos/templates/wintendoxp/images/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/inf.gif b/www/include/options/sysInfos/templates/wintendoxp/images/inf.gif
new file mode 100644
index 0000000000000000000000000000000000000000..8bc5ca0ce484d679cd903d7ff414436c76b4721f
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/inf.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/nobar_left.gif b/www/include/options/sysInfos/templates/wintendoxp/images/nobar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..e5cf245004e3b75ac0faf740ce29196d38337120
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/nobar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/nobar_middle.gif b/www/include/options/sysInfos/templates/wintendoxp/images/nobar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..63718e247e2579a5fbe7291e550499c410d76ffb
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/nobar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/nobar_right.gif b/www/include/options/sysInfos/templates/wintendoxp/images/nobar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..9f0a02eb05390b394cc5c6fb4f086da309d9ce24
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/nobar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/redbar_left.gif b/www/include/options/sysInfos/templates/wintendoxp/images/redbar_left.gif
new file mode 100644
index 0000000000000000000000000000000000000000..30541c45248dbcb9bbc117b0f1fd6d8560f85b40
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/redbar_left.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/redbar_middle.gif b/www/include/options/sysInfos/templates/wintendoxp/images/redbar_middle.gif
new file mode 100644
index 0000000000000000000000000000000000000000..c5977119300ed53cbbdf3c7990b8e8d1cc9304b4
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/redbar_middle.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/redbar_right.gif b/www/include/options/sysInfos/templates/wintendoxp/images/redbar_right.gif
new file mode 100644
index 0000000000000000000000000000000000000000..516e779643a695bc082f1dee2051619fc8750422
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/redbar_right.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/space15_15.gif b/www/include/options/sysInfos/templates/wintendoxp/images/space15_15.gif
new file mode 100644
index 0000000000000000000000000000000000000000..78d029c5dc084cbab91d82cec012b129376d4930
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/space15_15.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/images/sup.gif b/www/include/options/sysInfos/templates/wintendoxp/images/sup.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ca52f4666d034a381a848394958501d3dbe075d2
Binary files /dev/null and b/www/include/options/sysInfos/templates/wintendoxp/images/sup.gif differ
diff --git a/www/include/options/sysInfos/templates/wintendoxp/index.html b/www/include/options/sysInfos/templates/wintendoxp/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/options/sysInfos/templates/wintendoxp/wintendoxp.css b/www/include/options/sysInfos/templates/wintendoxp/wintendoxp.css
new file mode 100644
index 0000000000000000000000000000000000000000..259f94f17b80539c966aeda7f455493c56b383c0
--- /dev/null
+++ b/www/include/options/sysInfos/templates/wintendoxp/wintendoxp.css
@@ -0,0 +1,64 @@
+A {
+  text-decoration: none;
+}
+A:link {
+  color: #486591;
+}
+A:visited {
+  color: #A0AD81;
+}
+A:active {
+  color: blue;
+}
+.itemtitle {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: none;
+}
+.itemtext {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+.tabletitles {
+  text-decoration: underline;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: bold;
+}
+body {
+  color: #000000;
+  background-color: #0000a4;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 10px;
+  font-weight: normal;
+}
+font {
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 11px;
+  font-weight: normal;
+}
+H1 {
+  color: #FFFFFF;
+  text-decoration: none;
+  font-family: Verdana,Helvetica,sans-serif;
+  font-size: 20px;
+}
+select {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: normal;
+}
+input {
+    color: black;
+    text-decoration: none;
+    font-family: Verdana,Helvetica,sans-serif;
+    font-size: 10px;
+    font-weight: bold;
+}
diff --git a/www/include/reporting/ArchiveLogInDB.php b/www/include/reporting/ArchiveLogInDB.php
new file mode 100644
index 0000000000000000000000000000000000000000..ff58d84a21aad0e09a266b1b6ad237266b5a4ac2
--- /dev/null
+++ b/www/include/reporting/ArchiveLogInDB.php
@@ -0,0 +1,403 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf - Cedrick Facon
+
+Adapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+system("echo toto > /root/test");
+
+	function getLogData($time_event, $host, $service, $status, $output, $type){
+		global $lang;
+		$tab["time"] = date($lang["header_format"], $time_event);
+		$tab["timeb"] = $time_event;
+		$tab["host"] = $host;
+		$tab["service"] = $service;
+		$tab["status"] = $status;
+		$tab["output"] = $output;
+		$tab["type"] = $type;
+		return $tab ;
+	}
+	
+
+
+	// à recuperer dans nagios.cfg
+	$NagiosPathArchive = "/var/log/nagios/archives";
+	
+	require_once 'DB.php';	
+	include_once("/usr/local/oreon/www/oreon.conf.php");
+	/* Connect to oreon DB */
+	
+	$dsn = array(
+		     'phptype'  => 'mysql',
+		     'username' => $conf_oreon['user'],
+		     'password' => $conf_oreon['password'],
+		     'hostspec' => $conf_oreon['host'],
+		     'database' => $conf_oreon['db'],
+		     );
+	
+	$options = array(
+			 'debug'       => 2,
+			 'portability' => DB_PORTABILITY_ALL ^ DB_PORTABILITY_LOWERCASE,
+			 );
+	
+	$pearDB =& DB::connect($dsn, $options);
+	if (PEAR::isError($pearDB)) 
+	  die("Connecting probems with oreon database : " . $pearDB->getMessage());
+	
+	$pearDB->setFetchMode(DB_FETCHMODE_ASSOC);
+
+
+	function check_file_name_in_db($filename)
+	{
+		global $pearDB;
+		$res = $pearDB->query("SELECT * FROM log_archive_file_name WHERE file_name = '".$filename."'");
+		if ($res->numRows())
+			return $res;
+	}
+	function 	insert_file_name_in_db($key)
+	{
+		global $pearDB;
+		$date = time();
+		$sql = "INSERT INTO `log_archive_file_name` (`id_log_file`, `file_name`, `date`)" .
+				" VALUES(NULL , '$key','$date')";
+		$res = $pearDB->query($sql);
+				
+		if (PEAR::isError($res)){			
+			die($res->getMessage());		  
+		  }
+	}
+
+
+
+	
+	$tablist = array();
+	$h = array();
+	$host_list = array();
+	$res =& $pearDB->query('SELECT host_name, host_id FROM `host`');
+	if (PEAR::isError($res)){
+	  die($res->getMessage());
+	} else { 
+	  while ($h =& $res->fetchRow()){
+		$tablist[$h["host_name"]] = array();
+	    $host_list[$h["host_name"]] = $h["host_id"];
+	  }
+	}
+	
+	$service_list = array();
+	$res =& $pearDB->query('SELECT service_description, service_id FROM `service`');
+	if (PEAR::isError($res)){
+	  die($res->getMessage());
+	} else { 
+	  while ($s =& $res->fetchRow()){
+	    $service_list[$s["service_description"]] = $s["service_id"];
+	  }
+	}	
+	require_once '/usr/local/oreon/www/include/common/common-Func.php';
+
+
+	
+//!! penser a verifier en bdd si log deja inseré!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+	$tableFile2 = array();
+	if ($handle  = @opendir($NagiosPathArchive))	{
+		while ($file = @readdir($handle))
+			if (is_file($NagiosPathArchive."/$file"))	{
+				preg_match("/nagios\-([0-9]*)\-([0-9]*)\-([0-9]*)\-([0-9]*).log/", $file, $matches);
+				$time = mktime("0", "0", "0", $matches[1], $matches[2], $matches[3]) - 1;				
+				if(!check_file_name_in_db($NagiosPathArchive."/$file"))
+				$tableFile2[$NagiosPathArchive."/$file"] =  "  " . $time . " ";
+			}
+		@closedir($handle);
+	}
+	krsort($tableFile2);
+
+function trim_value(&$value)
+{
+   $value = trim($value);
+}
+
+
+
+function parseFile($file,$end_time){
+	$start_time = 0;
+	$log = NULL;
+	$matches = "";
+
+	if (file_exists($file) && !($log = fopen($file, "r")))
+		echo "pel_cant_open" . $file . "<br>";
+	$tab_log = array();	
+	$tab_svc_log = array();
+	$tablist = array();
+	$tab_host = array();
+	$tab_services = array();
+	$res1 = array();	
+
+	if ($log)
+		for ($a=0, $b= 0, $i = 0; $str = fgets($log); $i++){
+			if (preg_match("/^\[([0-9]*)\] (.+)/", $str, $matches)){				
+				$time_event = $matches[1];
+				$res = preg_split("/:/", $matches[2], 2);
+			if (isset($res[1]))
+				$res1 = preg_split("/;/", $res[1]);
+			$type = $res[0];
+				array_walk($res1, 'trim_value');
+
+
+			#
+			## find the log's start time
+			#				
+			if ($i == 0)// take start time
+			$start_time = $time_event;			
+
+
+
+			
+			if (!strncmp($type, "LOG ROTATION", 12))
+			{
+				if($res1[0] == "DAILY")
+					$start_time = $end_time - (24*60*60);
+				else
+					$start_time = $time_event;
+			}						
+			#
+			## host
+			#			
+			else if (!strncmp($type, "CURRENT HOST STATE", 18) || !strncmp($type, "INITIAL HOST STATE", 18)){
+				$tab_host[$res1[0]] = array();
+				$tab_host[$res1[0]]["current_time"] = $start_time;
+				$tab_host[$res1[0]]["current_state"] = $res1[1];
+				$tab_host[$res1[0]]["timeUP"] = 0;
+				$tab_host[$res1[0]]["timeDOWN"] = 0;
+				$tab_host[$res1[0]]["timeUNREACHABLE"] = 0;
+				$tab_host[$res1[0]]["timeNONE"] = 0;
+				$tab_host[$res1[0]]["start_time"] = $start_time;
+				$tab_host[$res1[0]]["tab_svc_log"] = array();
+			}
+			else if (!strncmp($type, "HOST ALERT", 10) )
+			{
+				if(!isset($tab_host[$res1[0]]))
+				{
+					$tab_host[$res1[0]] = array();
+					$tab_host[$res1[0]]["current_time"] = $start_time;
+					$tab_host[$res1[0]]["current_state"] = "NONE";
+					$tab_host[$res1[0]]["timeUP"] = 0;
+					$tab_host[$res1[0]]["timeDOWN"] = 0;
+					$tab_host[$res1[0]]["timeUNREACHABLE"] = 0;
+					$tab_host[$res1[0]]["timeNONE"] = 0;
+					$tab_host[$res1[0]]["start_time"] = $start_time;
+					$tab_host[$res1[0]]["tab_svc_log"] = array();					
+
+				}						
+				if(!strncmp($tab_host[$res1[0]]["current_state"], "UP", 2))
+				$tab_host[$res1[0]]["timeUP"] += ($time_event-$tab_host[$res1[0]]["current_time"]);
+				elseif(!strncmp($tab_host[$res1[0]]["current_state"], "DOWN", 4))
+				$tab_host[$res1[0]]["timeDOWN"] += ($time_event-$tab_host[$res1[0]]["current_time"]);
+				elseif(!strncmp($tab_host[$res1[0]]["current_state"], "UNREACHABLE", 11))
+				$tab_host[$res1[0]]["timeUNREACHABLE"] += ($time_event-$tab_host[$res1[0]]["current_time"]);
+				else
+				$tab_host[$res1[0]]["timeNONE"] += ($time_event-$tab_host[$res1[0]]["current_time"]);
+				
+				//$tab_log[$a++] = getLogData($time_event, $res1[0], "", $res1[1], $res1[4], $type);
+
+				$tab_host[$res1[0]]["current_state"] = $res1[1];
+				$tab_host[$res1[0]]["current_time"] = $time_event; //save time
+			}
+				
+			#
+			## services
+			#
+			else if (!strncmp($type, "CURRENT SERVICE STATE", 21) || !strncmp($type, "INITIAL SERVICE STATE", 21))
+			{
+				//echo "-----::::" . $res1[1] . "\n";
+				$tab_services[$res1[1]][$res1[0]] = array();
+				$tab_tmp = array();
+				$tab_tmp["current_state"] = $res1[2];
+				$tab_tmp["current_time"] = $start_time;
+				$tab_tmp["timeOK"] = 0;
+				$tab_tmp["timeWARNING"] = 0;
+				$tab_tmp["timeUNKNOWN"] = 0;
+				$tab_tmp["timeCRITICAL"] = 0;
+				$tab_tmp["timeNONE"] = 0;
+				$tab_tmp["start_time"] = $start_time;
+				$tab_tmp["service_id"] = getMyServiceID($res1[1],getMyHostID($res1[0]));
+				$tab_services[$res1[1]][$res1[0]] = $tab_tmp;
+			}			
+			else if (!strncmp($type, "SERVICE ALERT", 13))
+			{
+				if(isset($tab_services[$res1[1]][$res1[0]]))
+				{
+					$tab_tmp = array();
+					$tab_tmp = $tab_services[$res1[1]][$res1[0]];
+					if(!strncmp($tab_tmp["current_state"], "OK", 2))
+						$tab_tmp["timeOK"] += ($time_event-$tab_tmp["current_time"]);
+					elseif(!strncmp($tab_tmp["current_state"], "WARNING", 7))
+						$tab_tmp["timeWARNING"] += ($time_event-$tab_tmp["current_time"]);
+					elseif(!strncmp($tab_tmp["current_state"], "UNKNOWN", 7))
+						$tab_tmp["timeUNKNOWN"] += ($time_event-$tab_tmp["current_time"]);
+					elseif(!strncmp($tab_tmp["current_state"], "CRITICAL", 8))
+						$tab_tmp["timeCRITICAL"] += ($time_event-$tab_tmp["current_time"]);
+					else
+						$tab_tmp["timeNONE"] += ($time_event-$tab_tmp["current_time"]);
+					$tab_tmp["current_time"] = $time_event; //save time
+					$tab_tmp["current_state"] = $res1[2]; //save time
+					$tab_services[$res1[1]][$res1[0]] = $tab_tmp;
+				}
+			}
+		}
+	}
+	
+	$tablist["time_start"] = $start_time;
+	$tablist["tab_host"] = $tab_host;
+	$tablist["tab_services"] = $tab_services;
+	
+	return($tablist);
+}
+
+
+foreach($tableFile2 as $key => $time)
+{
+	$tmp = $NagiosPathArchive."/nagios-06-29-2006-00.log";
+
+
+/*
+	if($tmp == $key)
+	{
+	echo $tmp . "\n";
+	*/
+	$tab = array();
+	$tab = parseFile($key,$time);
+
+//	print_r($tab);
+
+	insert_file_name_in_db($key);
+	
+	$time_start = $tab["time_start"];
+	$tab_host = $tab["tab_host"];
+	$tab_services = $tab["tab_services"];
+	
+	
+	foreach($tab_host as $host => $htab)
+	{
+		if (isset($host_list[trim($host)]))
+		{	
+			#
+			## last host alert
+			#	
+			if(!strncmp($htab["current_state"], "UP", 2))
+				$htab["timeUP"] += ($time-$htab["current_time"]);
+			elseif(!strncmp($htab["current_state"], "DOWN", 4))
+				$htab["timeDOWN"] += ($time-$htab["current_time"]);
+			elseif(!strncmp($htab["current_state"], "UNREACHABLE", 11))
+				$htab["timeUNREACHABLE"] += ($time-$htab["current_time"]);
+			else
+				$htab["timeNONE"] += ($time-$htab["current_time"]);
+			#
+			## insert in db the host time
+			#		
+			$host_id = $host_list[trim($host)];
+			$Upsc =$htab["timeUP"];
+			$UpUnsc =$htab["timeUP"];
+			$DOWNsc =$htab["timeDOWN"];
+			$DOWNUnsc =$htab["timeDOWN"];
+			$UNREACHABLEsc = $htab["timeUNREACHABLE"];
+			$UNREACHABLEUnsc = $htab["timeUNREACHABLE"];
+			$NONEsc = $htab["timeNONE"];
+			$NONEUnsc = $htab["timeNONE"];
+
+			$sql = "INSERT INTO `log_archive_host` ( `log_id` , `host_id` ," .
+					" `UPTimeScheduled` , `UPTimeUnScheduled` ," .
+					" `DOWNTimeScheduled` , `DOWNTimeUnScheduled` ," .
+					" `UNREACHABLETimeScheduled` , `UNREACHABLETimeUnScheduled` ," .
+					" `UNDETERMINATETimeScheduled` , `UNDETERMINATETimeUnScheduled` ," .
+					" `date_end`, `date_start` ) VALUES" .
+				" (NULL , '$host_id'," .
+				" '$Upsc', '$UpUnsc'," .
+				" '$DOWNsc', '$DOWNUnsc'," .
+				" '$UNREACHABLEsc', '$UNREACHABLEUnsc'," .
+				" '$NONEsc', '$NONEUnsc'," .
+				" '$time', '$time_start')";
+
+			$result = $pearDB->query($sql);
+			if (PEAR::isError($res)){
+			  die($res->getMessage());}
+			  
+		}
+	}
+	foreach($tab_services as $svc => $htabsvc)
+	{
+		if (isset($service_list[trim($svc)]))
+		foreach($htabsvc as $host => $htab)
+		{
+			if (!isset($host_list[trim($host)]))
+			{
+				echo $host . "\n";
+			break;			
+			}
+			#
+			## last service alert
+			#	
+			if(!strncmp($htab["current_state"], "OK", 2))
+				$htab["timeOK"] += ($time-$htab["current_time"]);
+			elseif(!strncmp($htab["current_state"], "WARNING", 4))
+				$htab["timeWARNING"] += ($time-$htab["current_time"]);
+			elseif(!strncmp($htab["current_state"], "UNKNOWN", 11))
+				$htab["timeUNKNOWN"] += ($time-$htab["current_time"]);
+			elseif(!strncmp($htab["current_state"], "CRITICAL", 11))
+				$htab["timeCRITICAL"] += ($time-$htab["current_time"]);
+			else
+				$htab["timeNONE"] += ($time-$htab["current_time"]);
+
+
+			$host_id = $host_list[trim($host)];
+			
+			$service_id = $htab["service_id"];						
+			$OKsc =$htab["timeOK"];
+			$OKUnsc =$htab["timeOK"];
+			$WARNINGsc =$htab["timeWARNING"];
+			$WARNINGUnsc =$htab["timeWARNING"];
+			$UNKNOWNsc = $htab["timeUNKNOWN"];
+			$UNKNOWNUnsc = $htab["timeUNKNOWN"];
+			$CRITICALsc = $htab["timeCRITICAL"];
+			$CRITICALUnsc = $htab["timeCRITICAL"];
+			$NONEsc = $htab["timeNONE"];
+			$NONEUnsc = $htab["timeNONE"];
+
+			$sql = "INSERT INTO `log_archive_service` ( `log_id` , `host_id`, `service_id` ," .
+					" `OKTimeScheduled` , `OKTimeUnScheduled` ," .
+					" `WARNINGTimeScheduled` , `WARNINGTimeUnScheduled` ," .
+					" `UNKNOWNTimeScheduled` , `UNKNOWNTimeUnScheduled` ," .
+					" `CRITICALTimeScheduled` , `CRITICALTimeUnScheduled` ," .
+					"`UNDETERMINATETimeScheduled` ,`UNDETERMINATETimeUnScheduled` ," .
+					" `date_end`, `date_start` ) VALUES" .
+				" (NULL , '$host_id', '$service_id'," .
+				" '$OKsc', '$OKUnsc'," .
+				" '$WARNINGsc', '$WARNINGUnsc'," .
+				" '$UNKNOWNsc', '$UNKNOWNUnsc'," .
+				" '$CRITICALsc', '$CRITICALUnsc'," .
+				" '$NONEsc', '$NONEUnsc'," .
+				" '$time', '$time_start')";
+
+			$result = $pearDB->query($sql);
+			if (PEAR::isError($res)){
+			  die($res->getMessage());}
+
+		}		
+	}	
+
+	//}
+}
+	
+?>
diff --git a/www/include/reporting/alerts.php b/www/include/reporting/alerts.php
new file mode 100644
index 0000000000000000000000000000000000000000..07e1303f9dec8ac3a75a9abf51d40346f5db7a3a
--- /dev/null
+++ b/www/include/reporting/alerts.php
@@ -0,0 +1,145 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+
+	if (!isset($oreon))
+		exit();
+		
+	if (!isset($_GET["options"]) && !isset($_GET["update"]))	{
+		$options[0] = 1;
+		$options[1] = 0;
+		$options[2] = 0;
+		$options[3] = 0;
+		$options[4] = 0;
+		$options[5] = 0;
+	} else
+		$options = & $_GET["options"];
+
+	$log = NULL;	
+	if (!isset($oreon->Lca[$oreon->user->get_id()]) || (isset($oreon->Lca[$oreon->user->get_id()]) && !strcmp($oreon->Lca[$oreon->user->get_id()]->get_watch_log(), "1"))){
+		$ti = 0;
+		if (isset($_GET["o"]) && !strcmp($_GET["o"], "d") && isset($_GET["file"]) && strcmp($_GET["file"], "") && is_file($oreon->Nagioscfg->log_archive_path . $_GET["file"]))
+			$log = fopen($oreon->Nagioscfg->log_archive_path . $_GET["file"], "r");
+		else{
+			if (file_exists($oreon->Nagioscfg->log_file) && !($log = fopen($oreon->Nagioscfg->log_file, "r")))
+				echo $lang["pel_cant_open"];
+		}
+		if ($log)
+			$event_log = new TabEventLog($options, $log);
+		else
+			$event_log = NULL;
+	?>
+	<table border=0>
+		<tr>
+			<td valign="top">
+			<?
+				if (isset($_GET['file']) && strcmp($_GET['file'], "")){
+					preg_match("/^nagios\-([0-9]+)\-([0-9]+)\-([0-9]+)\-00\.log/", $_GET["file"], $matches);
+					$today_now = 1;
+				} else
+					$today_now = 0;
+			?>
+			<font class="text14b"><? echo $lang['pel_alerts_title']; ?><? if ($today_now == 1 && isset($matches[2]) && $matches[1] && $matches[3]) print $matches[2] - 1 . "/" . $matches[1] . "/" . $matches[3]; else print date("d/m/Y") ;?></b></font>
+			</td>
+		</tr>
+	<tr>
+		<td align="center">
+			<table border="0">
+				<tr>
+					<td class="tabTableTitle">
+						<?  
+						print $lang['hours'] . "&nbsp;:&nbsp;";
+						for ($t = 0; $t != 24; $t++)
+						{
+							if (isset($event_log->tab_hour[$t]) && $event_log->tab_hour[$t])
+								print "<a href='#$t' class='text11'>$t</a>";
+							if (isset($event_log->tab_hour[$t + 1]) && $event_log->tab_hour[$t + 1])
+								if (strcmp($event_log->tab_hour[$t + 1], ""))
+									print " - ";
+						}
+						?>
+					</td>
+				</tr>
+			</table><br><br>
+			<table>
+			<tr>
+				<td valign="top">
+					<? //include ("tab3Top.php"); 
+						$color[0] = "EAEAEA";
+						$color[1] = "DDDDDD"; 
+					?>
+					<table cellSpacing=1 cellPadding=1 border=0 style="border-width: thin; border-style: dashed; border-color=#9C9C9C;">
+						<tr>
+							<td bgcolor="#CCCCCC" width="50" class="text12b"><? echo $lang['date']; ?></td>
+							<td bgcolor="#CCCCCC" width="150" class="text12b"><? echo $lang['event']; ?></td>
+							<td bgcolor="#CCCCCC" width="75" class="text12b"><? echo $lang['h']; ?></td>
+							<td bgcolor="#CCCCCC" width="75" class="text12b"><? echo $lang['s']; ?></td>
+						</tr>
+					<?
+					$time_now = date("G");
+					$time_before = date("G");	
+					$c = -1;
+					$clr = 0;
+					for ($i = count($event_log->tab) - 1, $x = $i; $event_log && $i != 0; $i--){
+						$color_set = $color[$clr % 2];
+						$haut_i = $clr + 1;
+						$color_haut = $color[$haut_i % 2];
+						$time_now = date("G", $event_log->tab[$i]->time_event);
+						if ($event_log->tab[$i]->type){
+							$str = "";
+							if ($time_now != $time_before && $c != -1 && $c != $time_now){
+								$str =  "<td colspan=4 style='border-width: thin; border-bottom: 1px;border-top:0px;border-right:0px;border-left:0px; border-style: dashed; border-color=#9C9C9C;white-space:nowrap' bgcolor='#".$color_haut."' align='right'><a name='$time_now'></a><a href='#top' class='text9b'>".$lang['top']."</a>&nbsp;&nbsp;</td>\n" ;
+								$c = -1;
+							}
+							if (!strcmp($event_log->tab[$i]->type, "HOST ALERT")){
+								$c = $time_now;
+								$str = "<td style='white-space:nowrap' class='text9br' bgcolor='#".$color_set."'>" . $event_log->tab[$i]->type .  "</td><td colspan=2 class='text9' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->host . "</td></tr><tr><td>&nbsp;</td><td style='white-space:nowrap' class='text9' colspan='3' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->output ."</td>" ;
+							} else if (!strcmp($event_log->tab[$i]->type, "SERVICE ALERT")){
+								$c = $time_now;
+								$str =  "<td style='white-space:nowrap' class='text9br' bgcolor='#".$color_set."'>" . $event_log->tab[$i]->type .  "</td><td class='text9' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->host . "</td><td class='text9' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->service . "</td></tr><tr><td>&nbsp;</td><td style='white-space:nowrap' class='text9' colspan='3' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->output ."</td>" ;
+							}
+							if ($str){
+								if ($c == -1)
+									print "<tr><td style='white-space:nowrap' class='text9b'></td>" . $str . "</tr>";
+								else
+									print "<tr><td style='white-space:nowrap' class='text9b' bgcolor='#".$color_set."'>" . date("G:i:s", $event_log->tab[$i]->time_event) . "</td>" . $str . "</tr>";
+								 $clr++;
+							}
+							$time_before = $time_now;
+							$x--;
+						}
+					} 
+					print "<tr><td style='white-space:nowrap' class='text9b'></td><td colspan=4 style='border-width: thin; border-bottom: 1px;border-top:0px;border-right:0px;border-left:0px;white-space:nowrap' bgcolor='#".$color_set."' align='right'><a href='#top' class='text9b'>".$lang['top']."</a>&nbsp;&nbsp;</td></tr>";
+					?>
+					</table>
+				</td>
+				<td valign="top" align="center" style="padding-left: 20px;"> 
+					<table border="0" width="95%">
+						<tr>
+							<td valign="top" class="tabTableForTab">
+								<?	require_once './include/calendar/calendrier.php';
+									echo calendar($oreon);
+								?>
+							</td>
+						</tr>
+					</table>						
+				</td>
+			</tr>
+		</table>
+<? 	}
+	else
+		include("./include/security/error.php"); ?>
diff --git a/www/include/reporting/diff/list/DB-Func.php b/www/include/reporting/diff/list/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..2eeb6602bee62d5e964d34b088a39cf39f1634b9
--- /dev/null
+++ b/www/include/reporting/diff/list/DB-Func.php
@@ -0,0 +1,175 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function testExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('rtdl_id');
+		$res =& $pearDB->query("SELECT name, rtdl_id FROM reporting_diff_list WHERE name = '".htmlentities($name, ENT_QUOTES)."'");
+		$list =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $list["rtdl_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $list["rtdl_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function enableListInDB ($rtdl_id = null)	{
+		if (!$rtdl_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE reporting_diff_list SET activate = '1' WHERE rtdl_id = '".$rtdl_id."'");
+	}
+	
+	function disableListInDB ($rtdl_id = null)	{
+		if (!$rtdl_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE reporting_diff_list SET activate = '0' WHERE rtdl_id = '".$rtdl_id."'");
+	}
+	
+	function deleteListInDB ($lists = array())	{
+		global $pearDB;
+		foreach($lists as $key=>$value)
+			$pearDB->query("DELETE FROM reporting_diff_list WHERE rtdl_id = '".$key."'");
+	}
+	
+	function multipleListInDB ($lists = array(), $nbrDup = array())	{
+		foreach($lists as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM reporting_diff_list WHERE rtdl_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["rtdl_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "name" ? ($name = clone($value2 = $value2."_".$i)) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testExistence($name))	{
+					$val ? $rq = "INSERT INTO reporting_diff_list VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(rtdl_id) FROM reporting_diff_list");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(rtdl_id)"]))	{
+						$res =& $pearDB->query("SELECT DISTINCT rtde_id, oreon_contact FROM reporting_email_list_relation WHERE rtdl_id = '".$key."'");
+						while($res->fetchInto($mail))
+							$pearDB->query("INSERT INTO reporting_email_list_relation VALUES ('', '".$maxId["MAX(rtdl_id)"]."', '".$mail["rtde_id"]."', '".$mail["oreon_contact"]."')");
+						$res->free();
+					}
+				}
+			}
+		}
+	}
+	function updateListInDB ($rtdl_id = NULL)	{
+		if (!$rtdl_id) return;
+		updateList($rtdl_id);
+		updateListDiffMail($rtdl_id);
+		updateListDiffOreonMail($rtdl_id);
+	}	
+	
+	function insertListInDB ()	{
+		$rtdl_id = insertList();
+		updateListDiffMail($rtdl_id);
+		updateListDiffOreonMail($rtdl_id);
+		return ($rtdl_id);
+	}
+	
+	function insertList()	{
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO `reporting_diff_list` ( " .
+				"`rtdl_id` , `name`, `description`, `tp_id`, `activate`, `comment`)" .
+				"VALUES ( ";
+		$rq .= "NULL, ";
+		isset($ret["name"]) && $ret["name"] != NULL ? $rq .= "'".htmlentities($ret["name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["description"]) && $ret["description"] != NULL ? $rq .= "'".htmlentities($ret["description"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["tp_id"]) && $ret["tp_id"] != NULL ? $rq .= "'".$ret["tp_id"]."', ": $rq .= "NULL, ";
+		isset($ret["activate"]["activate"]) && $ret["activate"]["activate"] != NULL ? $rq .= "'".$ret["activate"]["activate"]."', ": $rq .= "NULL, ";
+		isset($ret["comment"]) && $ret["comment"] != NULL ? $rq .= "'".htmlentities($ret["comment"], ENT_QUOTES)."' ": $rq .= "NULL ";
+		$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(rtdl_id) FROM reporting_diff_list");
+		$rtdl_id = $res->fetchRow();
+		return ($rtdl_id["MAX(rtdl_id)"]);
+	}
+	
+	function updateList($rtdl_id = null)	{
+		if (!$rtdl_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE reporting_diff_list SET ";
+		$rq .= "name = ";
+		isset($ret["name"]) && $ret["name"] != NULL ? $rq .= "'".htmlentities($ret["name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "description = ";
+		isset($ret["description"]) && $ret["description"] != NULL ? $rq .= "'".htmlentities($ret["description"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "tp_id = ";
+		isset($ret["tp_id"]) && $ret["tp_id"] != NULL ? $rq .= "'".$ret["tp_id"]."', ": $rq .= "NULL, ";
+		$rq .= "activate = ";
+		isset($ret["activate"]["activate"]) && $ret["activate"]["activate"] != NULL ? $rq .= "'".$ret["activate"]["activate"]."', ": $rq .= "NULL, ";
+		$rq .= "comment = ";
+		isset($ret["comment"]) && $ret["comment"] != NULL ? $rq .= "'".htmlentities($ret["comment"], ENT_QUOTES)."' ": $rq .= "NULL ";
+		$rq .= "WHERE rtdl_id = '".$rtdl_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function updateListDiffMail($rtdl_id = null)	{
+		if (!$rtdl_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM reporting_email_list_relation ";
+		$rq .= "WHERE rtdl_id = '".$rtdl_id."' AND oreon_contact = '0'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("list_mails");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO reporting_email_list_relation ";
+			$rq .= "(rtdl_id, rtde_id, oreon_contact) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$rtdl_id."', '".$ret[$i]."', '0')";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function updateListDiffOreonMail($rtdl_id = null)	{
+		if (!$rtdl_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM reporting_email_list_relation ";
+		$rq .= "WHERE rtdl_id = '".$rtdl_id."' AND oreon_contact = '1'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("list_oreonMails");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO reporting_email_list_relation ";
+			$rq .= "(rtdl_id, rtde_id, oreon_contact) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$rtdl_id."', '".$ret[$i]."', '1')";
+			$pearDB->query($rq);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/reporting/diff/list/diff.php b/www/include/reporting/diff/list/diff.php
new file mode 100644
index 0000000000000000000000000000000000000000..ef03de2f54707b626ccc88474b469ee7ba943e2c
--- /dev/null
+++ b/www/include/reporting/diff/list/diff.php
@@ -0,0 +1,51 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["rtdl_id"]) ? $cG = $_GET["rtdl_id"] : $cG = NULL;
+	isset($_POST["rtdl_id"]) ? $cP = $_POST["rtdl_id"] : $cP = NULL;
+	$cG ? $rtdl_id = $cG : $rtdl_id = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	
+	#Path to the configuration dir
+	$path = "./include/reporting/diff/list/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formDiff.php"); break; #Add a Diffusion List
+		case "w" : require_once($path."formDiff.php"); break; #Watch a Diffusion List
+		case "c" : require_once($path."formDiff.php"); break; #Modify a Diffusion List
+		case "s" : enableListInDB($rtdl_id); require_once($path."listDiff.php"); break; #Activate a Diffusion List
+		case "u" : disableListInDB($rtdl_id); require_once($path."listDiff.php"); break; #Desactivate a Diffusion List
+		case "m" : multipleListInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listDiff.php"); break; #Duplicate n Diffusion Lists
+		case "d" : deleteListInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listDiff.php"); break; #Delete n Diffusion Lists
+		default : require_once($path."listDiff.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/reporting/diff/list/formDiff.ihtml b/www/include/reporting/diff/list/formDiff.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..a0f0dce324700698b0150275b6f99cfdd4fbe3b7
--- /dev/null
+++ b/www/include/reporting/diff/list/formDiff.ihtml
@@ -0,0 +1,31 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/masks.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/house.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.name.label}</td><td class="FormRowValue">{$form.name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.description.label}</td><td class="FormRowValue">{$form.description.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.tp_id.label}</td><td class="FormRowValue">{$form.tp_id.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.list_mails.label}</td><td class="FormRowValue">{$form.list_mails.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.list_oreonMails.label}</td><td class="FormRowValue">{$form.list_oreonMails.html}</td></tr>
+
+		<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/cookies.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.activate.label}</td><td class="FormRowValue">{$form.activate.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.comment.label}</td><td class="FormRowValue">{$form.comment.html}</td></tr>
+	 	
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p>{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p>{$form.change.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
+
diff --git a/www/include/reporting/diff/list/formDiff.php b/www/include/reporting/diff/list/formDiff.php
new file mode 100644
index 0000000000000000000000000000000000000000..869a3c2439bdff58f5c9e51950aff9444d67d423
--- /dev/null
+++ b/www/include/reporting/diff/list/formDiff.php
@@ -0,0 +1,186 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Contact
+	#
+	if ($o == "c" || $o == "w")	{	
+		function myDecode($arg)	{
+			return html_entity_decode($arg, ENT_QUOTES);
+		}
+		$res =& $pearDB->query("SELECT * FROM reporting_diff_list WHERE rtdl_id = '".$rtdl_id."' LIMIT 1");
+		# Set base value
+		$list = array_map("myDecode", $res->fetchRow());
+		# Set Mails List
+		$res =& $pearDB->query("SELECT DISTINCT rtde_id FROM reporting_email_list_relation WHERE rtdl_id = '".$rtdl_id."' AND oreon_contact = '0'");
+		for($i = 0; $res->fetchInto($mail); $i++)
+			$list["list_mails"][$i] = $mail["rtde_id"];
+		$res->free();
+		# Set Oreon Mails List
+		$res =& $pearDB->query("SELECT DISTINCT rtde_id FROM reporting_email_list_relation WHERE rtdl_id = '".$rtdl_id."' AND oreon_contact = '1'");
+		for($i = 0; $res->fetchInto($mail); $i++)
+			$list["list_oreonMails"][$i] = $mail["rtde_id"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Mail List comes from DB -> Store in $mails Array
+	$mails = array();
+	$res =& $pearDB->query("SELECT rtde_id, email FROM reporting_diff_email ORDER BY email");
+	while($res->fetchInto($email))
+		$mails[$email["rtde_id"]] = $email["email"];
+	$res->free();
+	# Oreon Mails List comes from DB -> Store in $oreonMails Array
+	$oreonMails = array();
+	$res =& $pearDB->query("SELECT contact_id, contact_email FROM contact ORDER BY contact_email");
+	while($res->fetchInto($email))
+		$oreonMails[$email["contact_id"]] = $email["contact_email"];
+	$res->free();
+	# Timeperiods comes from DB -> Store in $notifsTps Array
+	$notifTps = array();
+	$res =& $pearDB->query("SELECT tp_id, tp_name FROM timeperiod ORDER BY tp_name");
+	while($res->fetchInto($notifTp))
+		$notifTps[$notifTp["tp_id"]] = $notifTp["tp_name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 200px;");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["list_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["list_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["list_view"]);
+
+	#
+	## Contact basic information
+	#
+	$form->addElement('header', 'information', $lang['list_infos']);
+	$form->addElement('text', 'name', $lang["list_name"], $attrsText);
+	$form->addElement('text', 'description', $lang["list_description"], $attrsText);
+    $form->addElement('select', 'tp_id', $lang["list_period"], $notifTps);
+	
+    $ams3 =& $form->addElement('advmultiselect', 'list_mails', $lang["list_mails"], $mails, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+	
+    $ams3 =& $form->addElement('advmultiselect', 'list_oreonMails', $lang["list_oreonMails"], $oreonMails, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+	
+	#
+	## Further informations
+	#
+	$form->addElement('header', 'furtherInfos', $lang['further_infos']);
+	$listActivation[] = &HTML_QuickForm::createElement('radio', 'activate', null, $lang["enable"], '1');
+	$listActivation[] = &HTML_QuickForm::createElement('radio', 'activate', null, $lang["disable"], '0');
+	$form->addGroup($listActivation, 'activate', $lang["status"], '&nbsp;');
+	$form->setDefaults(array('activate' => '1', "action"=>'1'));
+	
+	$form->addElement('textarea', 'comment', $lang["cmt_comment"], $attrsTextarea);
+	
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+	
+	$form->addElement('hidden', 'rtdl_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('name', $lang['ErrName'], 'required');
+	$form->registerRule('exist', 'callback', 'testExistence');
+	$form->addRule('name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+	
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	# Just watch a contact information
+	if ($o == "w")	{		
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&rtdl_id=".$rtdl_id."'"));
+	    $form->setDefaults($list);
+		$form->freeze();
+	}
+	# Modify a contact information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($list);
+	}
+	# Add a contact information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	
+	$valid = false;
+	if ($form->validate())	{
+		$listObj =& $form->getElement('rtdl_id');
+		if ($form->getSubmitValue("submitA"))
+			$listObj->setValue(insertListInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateListInDB($listObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&rtdl_id=".$listObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listDiff.php");
+	else	{
+		#Apply a template definition	
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("formDiff.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/reporting/diff/list/listDiff.ihtml b/www/include/reporting/diff/list/listDiff.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..bca9e900ce50b3b02d47a4e5dfa57d9f13b4d03b
--- /dev/null
+++ b/www/include/reporting/diff/list/listDiff.ihtml
@@ -0,0 +1,44 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColCenter">{$headerMenu_icone}</td>
+			<td class="ListColLeft">{$headerMenu_name}</td>
+			<td class="ListColLeft">{$headerMenu_desc}</td>
+			<td class="ListColCenter">{$headerMenu_nbrMail}</td>
+			<td class="ListColCenter">{$headerMenu_status}</td>
+			<td class="ListColRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_description}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_nbrMail}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="3"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+
+{$form.hidden}
\ No newline at end of file
diff --git a/www/include/reporting/diff/list/listDiff.php b/www/include/reporting/diff/list/listDiff.php
new file mode 100644
index 0000000000000000000000000000000000000000..3db9caa348d745c2a0942ccaee7542f0cd58af8c
--- /dev/null
+++ b/www/include/reporting/diff/list/listDiff.php
@@ -0,0 +1,102 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/	$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM reporting_diff_list WHERE name LIKE '%".htmlentities($search, ENT_QUOTES)."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM reporting_diff_list");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+	
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_nbrMail", $lang["diffListNbrMail"]);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Contact list
+	if ($search)
+		$rq = "SELECT @nbr:=(SELECT DISTINCT COUNT(rtelr.rtde_id) FROM reporting_email_list_relation rtelr WHERE rtelr.rtdl_id = rtdl.rtdl_id) AS nbr, rtdl.rtdl_id, rtdl.name, rtdl.description, rtdl.activate FROM reporting_diff_list rtdl WHERE name LIKE '%".htmlentities($search, ENT_QUOTES)."%' ORDER BY  name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT @nbr:=(SELECT DISTINCT COUNT(rtelr.rtde_id) FROM reporting_email_list_relation rtelr WHERE rtelr.rtdl_id = rtdl.rtdl_id) AS nbr, rtdl.rtdl_id, rtdl.name, rtdl.description, rtdl.activate FROM reporting_diff_list rtdl ORDER BY name LIMIT ".$num * $limit.", ".$limit;
+	$res =& $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($list); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$list['rtdl_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&rtdl_id=".$list['rtdl_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&rtdl_id=".$list['rtdl_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&rtdl_id=".$list['rtdl_id']."&o=d&select[".$list['rtdl_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($list["activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&rtdl_id=".$list['rtdl_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&rtdl_id=".$list['rtdl_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$list['rtdl_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$list["name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&rtdl_id=".$list['rtdl_id'],
+						"RowMenu_description"=>$list["description"],
+						"RowMenu_nbrMail"=>isset($list["nbr"]) ? $list["nbr"] : "0",
+						"RowMenu_status"=>$list["activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";
+	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listDiff.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/include/reporting/diff/mailDB/DB-Func.php b/www/include/reporting/diff/mailDB/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..915ee59b3e2024479e66a6f7c4d844f286d68a91
--- /dev/null
+++ b/www/include/reporting/diff/mailDB/DB-Func.php
@@ -0,0 +1,144 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function testExistence ($email = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('rtde_id');
+		$res =& $pearDB->query("SELECT email, rtde_id FROM reporting_diff_email WHERE email = '".htmlentities($email, ENT_QUOTES)."'");
+		$email =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $email["rtde_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $email["rtde_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function enableMailInDB ($rtde_id = null)	{
+		if (!$rtde_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE reporting_diff_email SET activate = '1' WHERE rtde_id = '".$rtde_id."'");
+	}
+	
+	function disableMailInDB ($rtde_id = null)	{
+		if (!$rtde_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE reporting_diff_email SET activate = '0' WHERE rtde_id = '".$rtde_id."'");
+	}
+	
+	function deleteMailInDB ($contacts = array())	{
+		global $pearDB;
+		foreach($contacts as $key=>$value)	{
+			$pearDB->query("DELETE FROM reporting_diff_email WHERE rtde_id = '".$key."'");
+			$pearDB->query("DELETE FROM reporting_email_list_relation WHERE rtde_id = '".$key."'");
+		}
+	}
+	
+	function updateMailInDB ($rtde_id = NULL)	{
+		if (!$rtde_id) return;
+		updateMail($rtde_id);
+		updateMailDiffList($rtde_id);
+	}
+	
+	function mailOk($mail = NULL)	{
+		if (!$mail) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		if (testExistence($mail))	{
+			$rq = "INSERT INTO `reporting_diff_email` ( " .
+					"`rtde_id` , `email`  , `format` , `comment` , `activate` )" .
+					"VALUES ( ";
+			$rq .= "NULL, '".$mail."', '".$ret["format"]["format"]."', ";
+			isset($ret["comment"]) && $ret["comment"] != NULL ? $rq .= "'".htmlentities($ret["comment"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+			isset($ret["activate"]["activate"]) && $ret["activate"]["activate"] != NULL ? $rq .= "'".$ret["activate"]["activate"]."' ": $rq .= "NULL ";
+			$rq .= ")";
+			$pearDB->query($rq);
+			$res =& $pearDB->query("SELECT MAX(rtde_id) FROM reporting_diff_email");
+			$rtde_id = $res->fetchRow();
+			updateMailDiffList($rtde_id["MAX(rtde_id)"]);
+			return($rtde_id["MAX(rtde_id)"]);
+		}
+	}
+	
+	function insertMailInDB()	{
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		if (isset($ret["email"]) && $ret["email"])	{
+			$str = NULL;
+			for ($i = 0; $i < strlen($ret["email"]); $i++)	{
+				switch ($ret["email"][$i])	{
+					case " " : testExistence($str) ? mailOk($str) : NULL; $str = NULL; break;
+					case "," : testExistence($str) ? mailOk($str) : NULL; $str = NULL; break;
+					case ";" : testExistence($str) ? mailOk($str) : NULL; $str = NULL; break;
+					case "\t" : testExistence($str) ? mailOk($str) : NULL; $str = NULL; break;
+					case "\n" : testExistence($str) ? mailOk($str) : NULL; $str = NULL; break;
+					default : $str .= $ret["email"][$i]; break;
+				}
+			}
+			return(mailOk($str));			
+		}
+	}
+	
+	function updateMail($rtde_id = null)	{
+		if (!$rtde_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE reporting_diff_email SET ";
+		$rq .= "email = ";
+		isset($ret["email"]) && $ret["email"] != NULL ? $rq .= "'".htmlentities($ret["email"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+        $rq .= "format = ";
+        isset($ret["format"]["format"]) && $ret["format"]["format"] != NULL ? $rq .= "'".$ret["format"]["format"]."', ": $rq .= "NULL, ";
+		$rq .= "comment = ";
+		isset($ret["comment"]) && $ret["comment"] != NULL ? $rq .= "'".htmlentities($ret["comment"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "activate = ";
+		isset($ret["activate"]["activate"]) && $ret["activate"]["activate"] != NULL ? $rq .= "'".$ret["activate"]["activate"]."' ": $rq .= "NULL ";
+		$rq .= "WHERE rtde_id = '".$rtde_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function updateMailDiffList($rtde_id = null)	{
+		if (!$rtde_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM reporting_email_list_relation ";
+		$rq .= "WHERE rtde_id = '".$rtde_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("contact_lists");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO reporting_email_list_relation ";
+			$rq .= "(rtdl_id, rtde_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$ret[$i]."', '".$rtde_id."')";
+			$pearDB->query($rq);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/reporting/diff/mailDB/formMailDB.ihtml b/www/include/reporting/diff/mailDB/formMailDB.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..d8aed88db5c0af235bbad29852d59be14dde07dd
--- /dev/null
+++ b/www/include/reporting/diff/mailDB/formMailDB.ihtml
@@ -0,0 +1,33 @@
+{$form.javascript}
+<form {$form.attributes}>
+         <table id="ListTable">
+                <tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/flag_green.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+
+                <tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/user1.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+                <tr class="list_one">
+                        <td class="FormRowField">
+                                {$form.email.label}<br>
+                                {$form.header.emailInfos}
+                        </td>
+                        <td class="FormRowValue">{$form.email.html}</td></tr>
+                <tr class="list_two"><td class="FormRowField">{$form.format.label}</td><td class="FormRowValue">{$form.format.html}</td></tr>
+                <tr class="list_one"><td class="FormRowField">{$form.contact_lists.label}</td><td class="FormRowValue">{$form.contact_lists.html}</td></tr>
+
+                <tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/cookies.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+                <tr class="list_one"><td class="FormRowField">{$form.activate.label}</td><td class="FormRowValue">{$form.activate.html}</td></tr>
+                <tr class="list_two"><td class="FormRowField">{$form.comment.label}</td><td class="FormRowValue">{$form.comment.html}</td></tr>
+
+                {if $o == "a" || $o == "c"}
+                        <tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+                {/if}
+        </table>
+        <div id="validForm">
+        {if $o == "a" || $o == "c"}
+                <p>{$form.action.html}</p>
+                <p>{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+        {else if $o == "w"}
+                <p>{$form.change.html}</p>
+        {/if}
+        </div>
+        {$form.hidden}
+</form>
\ No newline at end of file
diff --git a/www/include/reporting/diff/mailDB/formMailDB.php b/www/include/reporting/diff/mailDB/formMailDB.php
new file mode 100644
index 0000000000000000000000000000000000000000..e27ab176e1f666fa070c8cfe1076714803166708
--- /dev/null
+++ b/www/include/reporting/diff/mailDB/formMailDB.php
@@ -0,0 +1,173 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information for Contact
+	#
+	$mail = array();
+	if ($o == "c" || $o == "w")	{	
+		function myDecode($arg)	{
+			return html_entity_decode($arg, ENT_QUOTES);
+		}
+		$res =& $pearDB->query("SELECT * FROM reporting_diff_email WHERE rtde_id = '".$rtde_id."' LIMIT 1");
+		# Set base value
+		$mail = array_map("myDecode", $res->fetchRow());
+		# Set Diffusion Lists
+		$res =& $pearDB->query("SELECT DISTINCT rtdl_id FROM reporting_email_list_relation WHERE rtde_id = '".$rtde_id."'");
+		for($i = 0; $res->fetchInto($list); $i++)
+			$mail["contact_lists"][$i] = $list["rtdl_id"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Diffusion List comes from DB -> Store in $difLists Array
+	$diffLists = array();
+	$res =& $pearDB->query("SELECT rtdl_id, name FROM reporting_diff_list ORDER BY name");
+	while($res->fetchInto($list))
+		$diffLists[$list["rtdl_id"]] = $list["name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang["mailDB_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["mailDB_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["mailDB_view"]);
+
+	#
+	## Contact basic information
+	#
+	$form->addElement('header', 'information', $lang['mailDB_infos']);
+	if ($o == "a")	{
+		$form->addElement('textarea', 'email', $lang["mailDB_mail"], $attrsTextarea);
+		$form->addElement('header', 'emailInfos', $lang["mailDB_mailTxt"]);
+	}
+	else
+		$form->addElement('text', 'email', $lang["mailDB_mail"], $attrsText);
+	
+	$tab = array();
+    $tab[] = &HTML_QuickForm::createElement('radio', 'format', null, $lang["mailDB_htmlType"], '1');
+    $tab[] = &HTML_QuickForm::createElement('radio', 'format', null, $lang["mailDB_textType"], '2');
+    $form->addGroup($tab, 'format', $lang["mailDB_receiptType"], '&nbsp;');
+    $form->setDefaults(array('format' => '1'));
+	
+    $ams3 =& $form->addElement('advmultiselect', 'contact_lists', $lang["mailDB_diffList"], $diffLists, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+	
+	#
+	## Further informations
+	#
+	$form->addElement('header', 'furtherInfos', $lang['further_infos']);
+	$mailActivation[] = &HTML_QuickForm::createElement('radio', 'activate', null, $lang["enable"], '1');
+	$mailActivation[] = &HTML_QuickForm::createElement('radio', 'activate', null, $lang["disable"], '0');
+	$form->addGroup($mailActivation, 'activate', $lang["status"], '&nbsp;');
+	$form->setDefaults(array('activate' => '1', "action"=>'1'));
+	
+	$form->addElement('textarea', 'comment', $lang["cmt_comment"], $attrsTextarea);
+	
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+	
+	$form->addElement('hidden', 'rtde_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	//$form->addRule('email', $lang['ErrEmail'], 'required');
+	//$form->registerRule('exist', 'callback', 'testExistence');
+	//$form->addRule('email', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+	
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	# Just watch a contact information
+	if ($o == "w")	{		
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&rtde_id=".$rtde_id."'"));
+	    $form->setDefaults($mail);
+		$form->freeze();
+	}
+	# Modify a contact information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($mail);
+	}
+	# Add a contact information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	
+	$valid = false;
+	if ($form->validate())	{
+		$mailObj =& $form->getElement('rtde_id');
+		if ($form->getSubmitValue("submitA"))
+			$mailObj->setValue(insertMailInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateMailInDB($mailObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&rtde_id=".$mailObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once($path."listMailDB.php");
+	else	{
+		#Apply a template definition	
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("formMailDB.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/reporting/diff/mailDB/listMailDB.ihtml b/www/include/reporting/diff/mailDB/listMailDB.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..0eaac35aa9f84be14245aa1bdb7cd8899fc453bd
--- /dev/null
+++ b/www/include/reporting/diff/mailDB/listMailDB.ihtml
@@ -0,0 +1,38 @@
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColCenter">{$headerMenu_icone}</td>
+			<td class="ListColLeft">{$headerMenu_email}</td>
+			<td class="ListColCenter">{$headerMenu_list}</td>
+			<td class="ListColCenter">{$headerMenu_status}</td>
+			<td class="ListColRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_list}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="2"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
\ No newline at end of file
diff --git a/www/include/reporting/diff/mailDB/listMailDB.php b/www/include/reporting/diff/mailDB/listMailDB.php
new file mode 100644
index 0000000000000000000000000000000000000000..1dbaeedfd465df91350859a00ece1c6f8bf5e7bb
--- /dev/null
+++ b/www/include/reporting/diff/mailDB/listMailDB.php
@@ -0,0 +1,93 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM reporting_diff_email WHERE email LIKE '%".htmlentities($search, ENT_QUOTES)."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM reporting_diff_email");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+	
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_email", $lang['name']);
+	$tpl->assign("headerMenu_list", $lang["mailDB_list"]);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	#Contact list
+	if ($search)
+		$rq = "SELECT @nbr:=(SELECT DISTINCT COUNT(rtelr.rtdl_id) FROM reporting_email_list_relation rtelr WHERE rtelr.rtde_id = rtde.rtde_id) AS nbr, rtde.rtde_id, rtde.email, rtde.activate FROM reporting_diff_email rtde WHERE email LIKE '%".htmlentities($search, ENT_QUOTES)."%' ORDER BY email LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT @nbr:=(SELECT DISTINCT COUNT(rtelr.rtdl_id) FROM reporting_email_list_relation rtelr WHERE rtelr.rtde_id = rtde.rtde_id) AS nbr, rtde.rtde_id, rtde.email, rtde.activate FROM reporting_diff_email rtde ORDER BY email LIMIT ".$num * $limit.", ".$limit;
+	$res =& $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($contact); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$contact['rtde_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&rtde_id=".$contact['rtde_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&rtde_id=".$contact['rtde_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&rtde_id=".$contact['rtde_id']."&o=d&select[".$contact['rtde_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		if ($contact["activate"])
+			$moptions .= "<a href='oreon.php?p=".$p."&rtde_id=".$contact['rtde_id']."&o=u&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_previous.gif' border='0' alt='".$lang['disable']."'></a>&nbsp;&nbsp;";
+		else
+			$moptions .= "<a href='oreon.php?p=".$p."&rtde_id=".$contact['rtde_id']."&o=s&limit=".$limit."&num=".$num."&search=".$search."'><img src='img/icones/16x16/element_next.gif' border='0' alt='".$lang['enable']."'></a>&nbsp;&nbsp;";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$contact["email"],
+						"RowMenu_link"=>"?p=".$p."&o=w&rtde_id=".$contact['rtde_id'],
+						"RowMenu_list"=>$contact["nbr"],
+						"RowMenu_status"=>$contact["activate"] ? $lang['enable'] : $lang['disable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";
+	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listMailDB.ihtml");
+	
+?>
\ No newline at end of file
diff --git a/www/include/reporting/diff/mailDB/mailDB.php b/www/include/reporting/diff/mailDB/mailDB.php
new file mode 100644
index 0000000000000000000000000000000000000000..d796c86d54b487fae11e622c46680cc1da791db9
--- /dev/null
+++ b/www/include/reporting/diff/mailDB/mailDB.php
@@ -0,0 +1,50 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["rtde_id"]) ? $cG = $_GET["rtde_id"] : $cG = NULL;
+	isset($_POST["rtde_id"]) ? $cP = $_POST["rtde_id"] : $cP = NULL;
+	$cG ? $rtde_id = $cG : $rtde_id = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	
+	#Path to the configuration dir
+	$path = "./include/reporting/diff/mailDB/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formMailDB.php"); break; #Add a contact
+		case "w" : require_once($path."formMailDB.php"); break; #Watch a contact
+		case "c" : require_once($path."formMailDB.php"); break; #Modify a contact
+		case "s" : enableMailInDB($rtde_id); require_once($path."listMailDB.php"); break; #Activate a contact
+		case "u" : disableMailInDB($rtde_id); require_once($path."listMailDB.php"); break; #Desactivate a contact
+		case "d" : deleteMailInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listMailDB.php"); break; #Delete n contacts
+		default : require_once($path."listMailDB.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/reporting/generateImages/graph_topology.php b/www/include/reporting/generateImages/graph_topology.php
new file mode 100644
index 0000000000000000000000000000000000000000..c4568b37fc6d9ef6d38bed6e7ea1d632d693e2f5
--- /dev/null
+++ b/www/include/reporting/generateImages/graph_topology.php
@@ -0,0 +1,74 @@
+<?php
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Service Level � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	require_once 'Image/GraphViz.php';
+	require_once 'DB.php';
+				
+	include("../../../oreon.conf.php");
+	require_once ("../../../$classdir/Session.class.php");
+	require_once ("../../../$classdir/Oreon.class.php");
+		
+	$dsn = array(
+	    'phptype'  => 'mysql',
+	    'username' => $conf_oreon['user'],
+	    'password' => $conf_oreon['password'],
+	    'hostspec' => $conf_oreon['host'],
+	    'database' => $conf_oreon['db'],
+	);
+	
+	$options = array(
+	    'debug'       => 2,
+	    'portability' => DB_PORTABILITY_ALL ^ DB_PORTABILITY_LOWERCASE,
+	);
+	
+	$db =& DB::connect($dsn, $options);
+	if (PEAR::isError($db)) die($db->getMessage());
+	    
+	$db->setFetchMode(DB_FETCHMODE_ASSOC);
+	
+	$session =& $db->query("SELECT * FROM `session` WHERE session_id = '".$_GET["session_id"]."'");
+	if ($session->numRows()){
+		
+		Session::start();
+		$oreon =& $_SESSION["oreon"];
+		
+		$str = "SELECT host_id,host_name FROM `host` WHERE host_activate = '1'";	
+		$res2 =& $db->query($str);
+		$host_data_id = array();
+		$host_data_name = array();
+		while ($res2->fetchInto($host)){
+			$host_data_id[$host["host_name"]] = $host["host_id"];
+			$host_data_name[$host["host_id"]] = $host["host_name"];
+		}
+		
+		$graph = new Image_GraphViz(TRUE, array("bgcolor" => "#BBFFBB"));
+		
+		foreach ($oreon->status_graph_host as $key => $h){
+			$color = $oreon->optGen["color_".strtolower($h["status"])];
+			$graph->addNode($h["host_name"],array('label' => $h["host_name"], "fillcolor"=>$color, "style"=>"filled", "fontsize"=>"6", "fontname"=>"Verdana")); // "margin"=>"0.04" 
+			$res =& $db->query("SELECT * FROM host_hostparent_relation WHERE host_host_id = '".$host_data_id[$h["host_name"]]."'");
+			while ($res->fetchInto($host_parents))
+				$graph->addEdge(array($host_data_name[$host_parents["host_parent_hp_id"]] => $h["host_name"]), array('color' => '#000000'));
+		}
+	 	$graph->image("gif");
+	}
+ ?>
+ 
\ No newline at end of file
diff --git a/www/include/reporting/generateImages/pie_chart_host.php b/www/include/reporting/generateImages/pie_chart_host.php
new file mode 100644
index 0000000000000000000000000000000000000000..80754f40b2e8e107701bf754c5d7b072876a9ad9
--- /dev/null
+++ b/www/include/reporting/generateImages/pie_chart_host.php
@@ -0,0 +1,109 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf - Cedrick Facon
+
+Adapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+
+	require_once 'Image/Graph.php';
+	
+	require_once ("../../../class/Session.class.php");
+	require_once ("../../../class/Oreon.class.php");
+
+/*
+	Session::start();
+	$oreon =& $_SESSION["oreon"];
+*/
+
+	// create the graph
+	$Graph =& Image_Graph::factory('graph', array(300, 200));
+	// add a TrueType font
+	$Font =& $Graph->addNew('font', 'Arial');
+	// set the font size to 11 pixels
+	$Font->setSize(7);
+	$Graph->setFont($Font);
+	
+	// setup the plotarea, legend and their layout
+	$Graph->add(
+	   Image_Graph::vertical(
+	      Image_Graph::factory('title', array('Host '.$_GET["host_name"], 10)),        
+	      Image_Graph::vertical(
+	         $Plotarea = Image_Graph::factory('plotarea'),
+	         $Legend = Image_Graph::factory('legend'),
+	         80
+	      ),10));
+	      
+	$Graph->setBackgroundColor('#FFFFFF');
+	$Legend->setPlotArea($Plotarea);
+	
+	$Plotarea->hideAxis();
+	$Plotarea->setBackgroundColor('#FFFFFF');
+	
+	$value = NULL;
+	$value =& $_GET["value"];
+	
+	$Dataset =& Image_Graph::factory('dataset', array($value));
+
+	// create the 1st plot as smoothed area chart using the 1st dataset
+	$Plot =& $Plotarea->addNew('Image_Graph_Plot_Pie', $Dataset);
+	
+	$Plot->Radius = 2;
+	    
+
+// set a line color
+$Plot->setLineColor('gray');
+
+// set a standard fill style
+$FillArray =& Image_Graph::factory('Image_Graph_Fill_Array');
+$Plot->setFillStyle($FillArray);
+$FillArray->addColor('green@0.2');
+$FillArray->addColor('blue@0.2');
+$FillArray->addColor('yellow@0.2');
+$FillArray->addColor('red@0.2');
+$FillArray->addColor('orange@0.2');
+$FillArray->addColor('black@0.2', 'rest'); 	
+	// set a standard fill style
+	
+
+/*	
+	foreach ($value as $key => $v)
+		$FillArray->addColor($oreon->optGen["color_".strtolower($key)]."@0.2");
+*/
+		$FillArray->addColor("40@0.2");
+		$FillArray->addColor("60@0.2");
+
+	$Plot->explode(4);
+	
+	
+	// create a Y data value marker
+	$Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_PCT_Y_TOTAL);
+	// fill it with white
+	$Marker->setFillColor('white');
+	// and use black border
+	$Marker->setBorderColor('black');
+	// and format it using a data preprocessor
+	$Marker->setDataPreprocessor(Image_Graph::factory('Image_Graph_DataPreprocessor_Formatted', '%0.1f%%'));
+	$Marker->setFontSize(7);
+	
+	// create a pin-point marker type
+	$PointingMarker =& $Plot->addNew('Image_Graph_Marker_Pointing_Angular', array(20, &$Marker));
+	// and use the marker on the plot
+	$Plot->setMarker($PointingMarker);
+	
+	// output the Graph
+	$Graph->done();
+?>
\ No newline at end of file
diff --git a/www/include/reporting/generateImages/pie_chart_service.php b/www/include/reporting/generateImages/pie_chart_service.php
new file mode 100644
index 0000000000000000000000000000000000000000..ef19807f706a018ada51ebcb35788df5c192c81d
--- /dev/null
+++ b/www/include/reporting/generateImages/pie_chart_service.php
@@ -0,0 +1,110 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf - Cedrick Facon
+
+Adapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+
+	require_once 'Image/Graph.php';
+	
+	require_once ("../../../class/Session.class.php");
+	require_once ("../../../class/Oreon.class.php");
+
+/*
+	Session::start();
+	$oreon =& $_SESSION["oreon"];
+*/
+
+	// create the graph
+	$Graph =& Image_Graph::factory('graph', array(300, 250));
+	// add a TrueType font
+	$Font =& $Graph->addNew('font', 'Arial');
+	// set the font size to 11 pixels
+	$Font->setSize(7);
+	$Graph->setFont($Font);
+	
+	// setup the plotarea, legend and their layout
+	$Graph->add(
+	   Image_Graph::vertical(
+	      Image_Graph::factory('title', array('Service '.$_GET["service_name"] . " on Host " .$_GET["host_name"], 10)),        
+       
+	      Image_Graph::vertical(
+	         $Plotarea = Image_Graph::factory('plotarea'),
+	         $Legend = Image_Graph::factory('legend'),
+	         80
+	      ),10));
+	      
+	$Graph->setBackgroundColor('#FFFFFF');
+	$Legend->setPlotArea($Plotarea);
+	
+	$Plotarea->hideAxis();
+	$Plotarea->setBackgroundColor('#FFFFFF');
+	
+	$value = NULL;
+	$value =& $_GET["value"];
+	
+	$Dataset =& Image_Graph::factory('dataset', array($value));
+
+	// create the 1st plot as smoothed area chart using the 1st dataset
+	$Plot =& $Plotarea->addNew('Image_Graph_Plot_Pie', $Dataset);
+	
+	$Plot->Radius = 2;
+	    
+
+// set a line color
+$Plot->setLineColor('gray');
+
+// set a standard fill style
+$FillArray =& Image_Graph::factory('Image_Graph_Fill_Array');
+$Plot->setFillStyle($FillArray);
+$FillArray->addColor('green@0.2');
+$FillArray->addColor('blue@0.2');
+$FillArray->addColor('yellow@0.2');
+$FillArray->addColor('red@0.2');
+$FillArray->addColor('orange@0.2');
+$FillArray->addColor('black@0.2', 'rest'); 	
+	// set a standard fill style
+	
+
+/*	
+	foreach ($value as $key => $v)
+		$FillArray->addColor($oreon->optGen["color_".strtolower($key)]."@0.2");
+*/
+		$FillArray->addColor("40@0.2");
+		$FillArray->addColor("60@0.2");
+
+	$Plot->explode(4);
+	
+	
+	// create a Y data value marker
+	$Marker =& $Plot->addNew('Image_Graph_Marker_Value', IMAGE_GRAPH_PCT_Y_TOTAL);
+	// fill it with white
+	$Marker->setFillColor('white');
+	// and use black border
+	$Marker->setBorderColor('black');
+	// and format it using a data preprocessor
+	$Marker->setDataPreprocessor(Image_Graph::factory('Image_Graph_DataPreprocessor_Formatted', '%0.1f%%'));
+	$Marker->setFontSize(7);
+	
+	// create a pin-point marker type
+	$PointingMarker =& $Plot->addNew('Image_Graph_Marker_Pointing_Angular', array(20, &$Marker));
+	// and use the marker on the plot
+	$Plot->setMarker($PointingMarker);
+	
+	// output the Graph
+	$Graph->done();
+?>
\ No newline at end of file
diff --git a/www/include/reporting/index.html b/www/include/reporting/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/reporting/lang/en.php b/www/include/reporting/lang/en.php
new file mode 100644
index 0000000000000000000000000000000000000000..e1762e4cdb641fa4b71072f1f22e5921ba242bb9
--- /dev/null
+++ b/www/include/reporting/lang/en.php
@@ -0,0 +1,70 @@
+<?
+# MailDB
+
+$lang["mailDB_list"] = "List";
+$lang['mailDB_add'] = "Add a Contact";
+$lang['mailDB_change'] = "Modify a Contact";
+$lang['mailDB_view'] = "View a Contact";
+$lang['mailDB_infos'] = "General Informations";
+$lang["mailDB_mail"] = "Email";
+$lang["mailDB_mailTxt"] = "1 to n mails, separated by : ' ',;-";
+$lang["mailDB_diffList"] = "Diffusion List";
+$lang["mailDB_receiptType"] = "Receipt type";
+$lang["mailDB_htmlType"] = "HTML";
+$lang["mailDB_textType"] = "TEXTE";
+
+# Diffusion List
+
+$lang["diffList"] = "Diffusion List";
+$lang["diffListNbrMail"] = "Mail number";
+$lang['list_add'] = "Add a Diffusion List";
+$lang['list_change'] = "Modify a Diffusion List";
+$lang['list_view'] = "View a Diffusion List";
+$lang['list_infos'] = "General Informations";
+$lang["list_name"] = "List Name";
+$lang["list_description"] = "List Description";
+$lang["list_period"] = "Sending Period";
+$lang["list_mails"] = "Contacts linked";
+$lang["list_oreonMails"] = "Oreon Contacts linked";
+
+# Message
+
+$lang["m_send"] = "Send";
+
+# Dashboard
+$lang["m_view"] = "View";
+$lang["m_start"] = "Begin date";
+$lang["m_end"] = "End date";
+$lang["m_predefinedPeriod"] = "Predefined:";
+$lang["m_customizedPeriod"] = "Customized";
+$lang["m_selectPeriodTitle"] = "Period Selection";
+$lang["m_hostResumeTitle"] = "Host state";
+$lang["m_serviceResumeTitle"] = "Host state";
+$lang["m_hostLogTitle"] = "service today log";
+$lang["m_serviceLogTitle"] = "service today log";
+$lang["m_hostSvcAssocied"] = "State Breakdowns For Host Services";
+
+
+$lang["m_serviceTilte"] = "Service";
+$lang["m_OKTitle"] = "OK";
+$lang["m_WarningTitle"] = "Warning";
+$lang["m_UnknownTitle"] = "Unknown";
+$lang["m_CriticalTitle"] = "Critical";
+$lang["m_PendingTitle"] = "Pending";
+$lang["m_UpTitle"] = "Up";
+$lang["m_DownTitle"] = "Down";
+$lang["m_UnreachableTitle"] = "Unreachable";
+
+$lang["m_StateTitle"] = "State";
+$lang["m_TimeTitle"] = "Time";
+$lang["m_TimeTotalTitle"] = "Total Time";
+$lang["m_KnownTimeTitle"] = "Known Time";
+		
+$lang["m_DateTitle"] = "Date";
+$lang["m_EventTitle"] = "Event";
+$lang["m_HostTitle"] = "Host";
+$lang["m_InformationsTitle"] = "Info";
+
+
+
+?>
\ No newline at end of file
diff --git a/www/include/reporting/lang/fr.php b/www/include/reporting/lang/fr.php
new file mode 100644
index 0000000000000000000000000000000000000000..b280b426b80fbe6849d50755cf2435c4ff86bb5e
--- /dev/null
+++ b/www/include/reporting/lang/fr.php
@@ -0,0 +1,69 @@
+<?
+# MailDB
+
+$lang["mailDB_list"] = "Liste";
+$lang['mailDB_add'] = "Ajouter un Contact";
+$lang['mailDB_change'] = "Modifier un Contact";
+$lang['mailDB_view'] = "Afficher un Contact";
+$lang['mailDB_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang["mailDB_mail"] = "Email";
+$lang["mailDB_mailTxt"] = "1 &agrave; n mails, s&eacute;parateur : ' ',;-";
+$lang["mailDB_diffList"] = "Liste de diffusion";
+$lang["mailDB_receiptType"] = "Format de r&eacute;ception";
+$lang["mailDB_htmlType"] = "HTML";
+$lang["mailDB_textType"] = "TEXTE";
+
+# Diffusion List
+
+$lang["diffList"] = "Liste de diffusion";
+$lang["diffListNbrMail"] = "Nombre de Mail";
+$lang['list_add'] = "Ajouter une Liste de Diffusion";
+$lang['list_change'] = "Modifier une Liste de Diffusion";
+$lang['list_view'] = "Afficher une Liste de Diffusion";
+$lang['list_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang["list_name"] = "Nom de la Liste";
+$lang["list_description"] = "Description de la Liste";
+$lang["list_period"] = "P&eacute;riode d'envoi";
+$lang["list_mails"] = "Contacts associ&eacute;s";
+$lang["list_oreonMails"] = "Contacts Oreon associ&eacute;s";
+
+# Message
+
+$lang["m_send"] = "Envoyer";
+
+
+# Dashboard
+$lang["m_view"] = "View";
+$lang["m_start"] = "Begin date";
+$lang["m_end"] = "End date";
+$lang["m_predefinedPeriod"] = "Predefined:";
+$lang["m_customizedPeriod"] = "Customized";
+$lang["m_selectPeriodTitle"] = "Period Selection";
+$lang["m_hostResumeTitle"] = "Host state";
+$lang["m_serviceResumeTitle"] = "Host state";
+$lang["m_hostLogTitle"] = "service today log";
+$lang["m_serviceLogTitle"] = "service today log";
+$lang["m_hostSvcAssocied"] = "State Breakdowns For Host Services";
+
+$lang["m_serviceTilte"] = "Service";
+$lang["m_OKTitle"] = "OK";
+$lang["m_WarningTitle"] = "Warning";
+$lang["m_UnknownTitle"] = "Unknown";
+$lang["m_CriticalTitle"] = "Critical";
+$lang["m_PendingTitle"] = "Pending";
+$lang["m_UpTitle"] = "Up";
+$lang["m_DownTitle"] = "Down";
+$lang["m_UnreachableTitle"] = "Unreachable";
+
+
+$lang["m_StateTitle"] = "State";
+$lang["m_TimeTitle"] = "Time";
+$lang["m_TimeTotalTitle"] = "Total Time";
+$lang["m_KnownTimeTitle"] = "Known Time";
+		
+$lang["m_DateTitle"] = "Date";
+$lang["m_EventTitle"] = "Event";
+$lang["m_HostTitle"] = "Host";
+$lang["m_InformationsTitle"] = "Info";
+			
+?>
\ No newline at end of file
diff --git a/www/include/reporting/live_report.php b/www/include/reporting/live_report.php
new file mode 100644
index 0000000000000000000000000000000000000000..cc02525de2b533f03c3f459aef00178bbc1fc249
--- /dev/null
+++ b/www/include/reporting/live_report.php
@@ -0,0 +1,155 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	if (!isset($oreon))
+		exit();
+
+	$hosts = & $oreon->hosts;
+	$services = & $oreon->services;
+	// Launch log analyse
+	$Logs = new Logs($oreon);
+?>
+	<table border="0" cellpadding="0" cellspacing="0" align="left">
+		<tr>
+			<td valign="top">
+				<table border="0" cellpadding="0" cellspacing="0" align="left" width="160">
+					<tr>
+						<td class="tabTableTitle"><? echo "<div style='white-space: nowrap;'>". $lang["lr_available"]."</div>" ; ?></td>
+					</tr>
+					<tr>
+						<td valign="top" class="tabTableMenu" style="padding-top:5px;padding-bottom:5px;">
+							<?	 if (isset($hosts) && count($hosts) != 0)
+									foreach ($hosts as $h){
+										if ($oreon->is_accessible($h->get_id())){
+											if ($h->get_register())	{?>
+											<div style="padding: 2px; white-space: nowrap" align="left">
+												<li>
+													<a href="oreon.php?p=501&h=<? echo $h->get_id(); ?>" class="text10" style="white-space: nowrap;">
+													<? echo $h->get_name(); ?>
+													</a>
+												</li>
+											</div>
+										<? unset($h);
+											}
+										}
+									}	?>
+						</td>
+					</tr>
+				</table>
+			</td>
+			<td style="width:20px;">&nbsp;</td>
+			<td valign="top" style="padding-left: 20px;">
+			 <? if (isset($_GET["h"])) {
+			 	
+				if (isset($_GET["h"]) && $oreon->is_accessible($_GET["h"])){
+					?>
+					<table cellpadding="0" cellspacing="0">
+						<tr>
+							<td>
+							<!-- host -->
+								<table cellpadding="0" cellspacing="0" width="100%">
+									<tr>
+										<td class='tabTableTitle'><? echo $lang["bbreporting"]; ?></td>
+									</tr>
+									<tr>
+										<td valign="top" class='tabTableForTab' style="border-bottom:0px;padding-left:20px;">
+											<div style="padding-left: 20px;padding:10px;float:left;width:300px;">
+												<span><li><? echo $lang["lr_host"]; ?></b><? print $oreon->hosts[$_GET["h"]]->get_name(); ?></li></span>
+												<span><li><? echo $lang["lr_alias"]; ?></b><? print $oreon->hosts[$_GET["h"]]->get_alias(); ?></li></span> 
+												<span><li><? echo $lang["lr_ip"]; ?></b><? print $oreon->hosts[$_GET["h"]]->get_address(); ?></li></span> 
+												<br><br>
+												<li class="text12b"><? echo $lang['options']; ?></li>
+												<ul>
+													<li type="square"><a href='./oreon.php?p=102&h=<? print $_GET["h"]; ?>&o=w' class='text10'><? echo $lang["lr_configure_host"]; ?></a></li>
+													<li type="square"><a href='./oreon.php?p=303&o=s&host_id=<? print $_GET["h"]; ?>' class='text10'><? echo $lang["lr_view_services"]; ?></a></li>
+													<li type="square"><a href='./oreon.php?p=314&h=<? print $_GET["h"]; ?>' class='text10'><? echo $lang["lr_details_host"]; ?></a></li>
+												</ul>
+											</div>
+											<div>
+										<?
+										if (isset($_GET["h"]	) && isset($Logs->log_h[$_GET["h"]])){
+											$x = 340;
+											$y = 150;
+											$fontcolor='000000';
+											$theme = "pastel";
+											$color = array($oreon->optGen->get_color_up(),$oreon->optGen->get_color_down(),$oreon->optGen->get_color_unreachable());
+											$h = & $Logs->log_h[$_GET["h"]];
+											$sn = $h->get_name() . " - " . $oreon->hosts[$h->get_id()]->get_address();
+											$total = $h->get_time_up() + $h->get_time_down() + $h->get_time_unrea();
+											if ($total == 0)
+												$total = 1;
+
+											$data = array($h->get_time_up() * 100 / $total, $h->get_time_down() * 100 / $total, $h->get_time_unrea() * 100 / $total);
+											if ($data[0] == 0 && $data[1] == 0 && $data[2] == 0)
+												$data[0] = 1;
+											$label = array("UP - ".round($data[0]), "DOWN - ".round($data[1]), "UNREACHABLE - ".round($data[2]));
+
+											$str = "<a href='./oreon.php?p=303&o=s&host_id=".$oreon->hosts[$_GET["h"]]->get_id()."'><img src='./include/reports/draw_graph_host.php?sn=$sn&coord_x=$x&coord_y=$y&fontcolor=";
+											$str .= "$fontcolor&theme=$theme&dataA=$data[0]&dataB=$data[1]&dataC=$data[2]&colorA=$color[0]&colorB=$color[1]";
+											$str .= "&colorC=$color[2]&labelA=$label[0]&labelB=$label[1]&labelC=$label[2]' border=0></a>";
+											print $str;
+										} ?>
+										</div>
+									</tr>
+								</table>
+							<!-- services -->
+								<table cellpadding="0" cellspacing="0" class='tabTableForTab' width="100%">
+									<tr>
+										<td>
+										<? if (isset($_GET["h"]	) && isset($Logs->log_h[$_GET["h"]]->log_s)){
+												$x = 340;
+												$y = 150;
+												$fontcolor='000000';
+												$theme = "pastel";
+												$color = array($oreon->optGen->get_color_ok(),$oreon->optGen->get_color_warning(),$oreon->optGen->get_color_critical(), $oreon->optGen->get_color_unknown());
+												$i = 0;
+												if (isset($Logs->log_h[$_GET["h"]]->log_s))
+													foreach ($Logs->log_h[$_GET["h"]]->log_s as $s){
+														if (isset($s)) {
+															$sn = $s->get_description() . " - " . $s->get_host_name();
+															$total = $s->get_time_ok() + $s->get_time_warning() + $s->get_time_critical() + $s->get_time_unknown() ;
+															if ($total == 0) $total = 1;
+
+															//print $total."|". $s->get_time_ok()."|".$s->get_time_critical()."|".$s->get_time_warning()."|".$s->get_time_unknown();
+															$data = array($s->get_time_ok() * 100 / $total, $s->get_time_warning() * 100 / $total, $s->get_time_critical() * 100 / $total, $s->get_time_unknown() * 100 / $total);
+															if ($data[0] == 0 && $data[3] == 0 && $data[1] == 0 && $data[2] == 0)
+																$data[0] = 1;
+															$label = array("OK - ".round($data[0]), "WARNING - ".round($data[1]), "CRITICAL - ".round($data[2]), "UNKNOWN	 - ".round($data[3]));
+
+															$str = "<img src='./include/reports/draw_graph_service.php?sn=$sn&coord_x=$x&coord_y=$y&fontcolor=";
+															$str .= "$fontcolor&theme=$theme&dataA=$data[0]&dataB=$data[1]&dataC=$data[2]&dataD=$data[3]&colorA=$color[0]&colorB=$color[1]";
+															$str .= "&colorC=$color[2]&colorD=$color[3]&labelA=$label[0]&labelB=$label[1]&labelC=$label[2]&labelD=$label[3]' style='padding:10px;'>";
+															if ($i % 2 == 1)
+																print $str . "<br>";
+															else
+																print $str . "&nbsp;";
+															$i++;
+														}
+													}
+											}  ?>
+										</td>
+									</tr>
+								</table>
+							</td>
+						</tr>
+					</table>
+			 <?	}
+			 } ?>
+			</td>
+		</tr>
+	</table>
+
diff --git a/www/include/reporting/message/DB-Func.php b/www/include/reporting/message/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..92f4bc1ccadf29e91920a4829a0c7713eaa7a218
--- /dev/null
+++ b/www/include/reporting/message/DB-Func.php
@@ -0,0 +1,142 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function testExistence ($email = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('rtde_id');
+		$res =& $pearDB->query("SELECT email, rtde_id FROM reporting_diff_email WHERE email = '".htmlentities($email, ENT_QUOTES)."'");
+		$email =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $email["rtde_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $email["rtde_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function enableMailInDB ($rtde_id = null)	{
+		if (!$rtde_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE reporting_diff_email SET activate = '1' WHERE rtde_id = '".$rtde_id."'");
+	}
+	
+	function disableMailInDB ($rtde_id = null)	{
+		if (!$rtde_id) return;
+		global $pearDB;
+		$pearDB->query("UPDATE reporting_diff_email SET activate = '0' WHERE rtde_id = '".$rtde_id."'");
+	}
+	
+	function deleteMailInDB ($contacts = array())	{
+		global $pearDB;
+		foreach($contacts as $key=>$value)	{
+			$pearDB->query("DELETE FROM reporting_diff_email WHERE rtde_id = '".$key."'");
+			$pearDB->query("DELETE FROM reporting_email_list_relation WHERE rtde_id = '".$key."'");
+		}
+	}
+	
+	function updateMailInDB ($rtde_id = NULL)	{
+		if (!$rtde_id) return;
+		updateMail($rtde_id);
+		updateMailDiffList($rtde_id);
+	}
+	
+	function mailOk($mail = NULL)	{
+		if (!$mail) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		if (testExistence($mail))	{
+			$rq = "INSERT INTO `reporting_diff_email` ( " .
+					"`rtde_id` , `email` , `comment` , `activate` )" .
+					"VALUES ( ";
+			$rq .= "NULL, '".$mail."', ";
+			isset($ret["comment"]) && $ret["comment"] != NULL ? $rq .= "'".htmlentities($ret["comment"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+			isset($ret["activate"]["activate"]) && $ret["activate"]["activate"] != NULL ? $rq .= "'".$ret["activate"]["activate"]."' ": $rq .= "NULL ";
+			$rq .= ")";
+			$pearDB->query($rq);
+			$res =& $pearDB->query("SELECT MAX(rtde_id) FROM reporting_diff_email");
+			$rtde_id = $res->fetchRow();
+			updateMailDiffList($rtde_id["MAX(rtde_id)"]);
+			return($rtde_id["MAX(rtde_id)"]);
+		}
+	}
+	
+	function insertMailInDB()	{
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		if (isset($ret["email"]) && $ret["email"])	{
+			$str = NULL;
+			for ($i = 0; $i < strlen($ret["email"]); $i++)	{
+				switch ($ret["email"][$i])	{
+					case " " : testExistence($str) ? mailOk($str) : NULL; $str = NULL; break;
+					case "," : testExistence($str) ? mailOk($str) : NULL; $str = NULL; break;
+					case ";" : testExistence($str) ? mailOk($str) : NULL; $str = NULL; break;
+					case "\t" : testExistence($str) ? mailOk($str) : NULL; $str = NULL; break;
+					case "\n" : testExistence($str) ? mailOk($str) : NULL; $str = NULL; break;
+					default : $str .= $ret["email"][$i]; break;
+				}
+			}
+			return(mailOk($str));			
+		}
+	}
+	
+	function updateMail($rtde_id = null)	{
+		if (!$rtde_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE reporting_diff_email SET ";
+		$rq .= "email = ";
+		isset($ret["email"]) && $ret["email"] != NULL ? $rq .= "'".htmlentities($ret["email"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "comment = ";
+		isset($ret["comment"]) && $ret["comment"] != NULL ? $rq .= "'".htmlentities($ret["comment"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "activate = ";
+		isset($ret["activate"]["activate"]) && $ret["activate"]["activate"] != NULL ? $rq .= "'".$ret["activate"]["activate"]."' ": $rq .= "NULL ";
+		$rq .= "WHERE rtde_id = '".$rtde_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function updateMailDiffList($rtde_id = null)	{
+		if (!$rtde_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM reporting_email_list_relation ";
+		$rq .= "WHERE rtde_id = '".$rtde_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("contact_lists");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO reporting_email_list_relation ";
+			$rq .= "(rtdl_id, rtde_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$ret[$i]."', '".$rtde_id."')";
+			$pearDB->query($rq);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/reporting/message/MAIL-Func.php b/www/include/reporting/message/MAIL-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..01afb1289f568f852c801e46113c809a84edef59
--- /dev/null
+++ b/www/include/reporting/message/MAIL-Func.php
@@ -0,0 +1,199 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick
+Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the
+quality,
+safety, contents, performance, merchantability, non-infringement or
+suitability for
+any particular or intended purpose of the Software found on the OREON web
+site.
+In no event will OREON be liable for any direct, indirect, punitive,
+special,
+incidental or consequential damages however they may arise and even if OREON
+has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+function array_to_string($array)
+ {
+ 	$flag=0;
+ 	$val2 = NULL;
+  foreach ($array as $index => $val)
+   {
+   	if($flag)
+   		$val2 .=",".$val;
+   	else
+   	{
+   		$val2 .=$val;
+		$flag=1;
+   	}
+   }
+  return $val2;
+}
+
+function send_simple_message($subject, $body, $contact_lists)
+{
+	global $pearDB;
+	global $oreon;
+		$crlf = "\r\n";
+
+
+	require_once 'Mail.php';
+	require_once 'Mail/mime.php';
+
+
+	#
+	## generate 'To' list for All Format
+	#
+	foreach($contact_lists as $clALLFORMAT)
+	{
+		$resALLFORMAT =& $pearDB->query("SELECT contact_id, contact_email FROM contact WHERE contact_id IN (SELECT rtde_id FROM reporting_email_list_relation where rtdl_id =".$clALLFORMAT.")");
+		$contactALLFORMAT = array();
+		while($resALLFORMAT->fetchInto($contactALLFORMAT))
+		{
+			$recipientsALLFORMAT[$contactALLFORMAT['contact_id']] = $contactALLFORMAT['contact_email'];
+		}
+	}
+
+
+	#
+	## mail txt format
+	#
+	foreach($contact_lists as $clTXT)
+	{
+		$resTXT =& $pearDB->query("SELECT contact_id, contact_email FROM contact WHERE contact_type_msg = 'txt' AND contact_id IN (SELECT rtde_id FROM reporting_email_list_relation where rtdl_id =".$clTXT.")");
+		$contactTXT = array();
+		while($resTXT->fetchInto($contactTXT))
+		{
+			$recipientsTXT[$contactTXT['contact_id']] = $contactTXT['contact_email'];
+		}
+	}
+	if(count($recipientsTXT) > 0)
+	{
+		$text = 'Text version of email'.$body;
+		$mimeTXT = new Mail_mime($crlf);
+		$mimeTXT->setTXTBody($text);
+		$bodyTXT = $mimeTXT->get();
+
+		$headersTXT['From']    = $oreon->user->get_email();
+		$headersTXT['Subject'] = $subject;
+		$headersTXT['To'] = array_to_string($recipientsALLFORMAT);
+
+		$headersTXT = $mimeTXT->headers($headersTXT);
+		$paramsTXT['host'] = 'smtp.wanadoo.fr';
+		$mail_objectTXT =& Mail::factory('smtp', $paramsTXT);
+		$tmpTXT = $mail_objectTXT->send($recipientsTXT, $headersTXT, $bodyTXT);
+
+		if (PEAR::isError($tmpTXT)) {
+		  echo "message error:";
+		  print($tmpTXT->getMessage());
+		  echo "<br>code error:";
+		  print($tmpTXT->getCode());
+		 }
+	}
+	#
+	## End mail Txt format
+	#
+
+
+
+	#
+	## mail Html format
+	#
+	$recipientsHTML = array();
+	foreach($contact_lists as $clHTML)
+	{
+		$resHTML =& $pearDB->query("SELECT contact_id, contact_email FROM contact WHERE contact_type_msg = 'html' AND contact_id IN (SELECT rtde_id FROM reporting_email_list_relation where rtdl_id =".$clHTML.")");
+		$contactHTML = array();
+		while($resHTML->fetchInto($contactHTML))
+		{
+			$recipientsHTML[$contactHTML['contact_id']] = $contactHTML['contact_email'];
+		}
+	}
+	if(count($recipientsHTML) > 0)
+	{
+		$html = "<html><body>Test html version oreon<br>".$body."<img src=\"logo_oreon.gif\"></body></html>";
+		$mimeHTML = new Mail_mime($crlf);
+
+
+		$mimeHTML->setHTMLBody($html);
+		#
+		## image html
+		#
+		$image = $path = $oreon->optGen["oreon_web_path"]."img/logo_oreon.gif";
+		$mimeHTML->addHTMLImage($image, 'image/gif');
+
+
+		$bodyHTML = $mimeHTML->get();
+
+		$headersHTML['From']    = $oreon->user->get_email();
+		$headersHTML['Subject'] = $subject;
+		$headersHTML['To'] = array_to_string($recipientsALLFORMAT);
+		$headersHTML = $mimeHTML->headers($headersHTML);
+		$paramsHTML['host'] = 'smtp.wanadoo.fr';
+		$mail_objectHTML =& Mail::factory('smtp', $paramsHTML);
+		$tmpHTML = $mail_objectHTML->send($recipientsHTML, $headersHTML, $bodyHTML);
+
+		if (PEAR::isError($tmpHTML)) {
+		  echo "message error:";
+		  print($tmpHTML->getMessage());
+		  echo "<br>code error:";
+		  print($tmpHTML->getCode());
+		 }
+	}
+	#
+	## End mail Html format
+	#
+
+
+/*
+		$mime->setHTMLBody($html);
+		#
+		## image html
+		#
+		$image = "/usr/local/oreon/www/img/logo_oreon.gif";
+		$mime->addHTMLImage($image, 'image/gif');
+
+
+
+	#
+	## make body
+	#
+	$body = $mime->get();
+
+
+	$headers['From']    = $oreon->user->get_email();
+//	$headers['To']      = $recipients;
+	$headers['Subject'] = $subject;
+//	$headers['Content-Type'] = 'text/html; charset=windows-1250';
+
+	$headers = $mime->headers($headers);
+
+
+	$params['host'] = 'smtp.wanadoo.fr';
+
+
+	$mail_object =& Mail::factory('smtp', $params);
+
+	$tmp = $mail_object->send($recipients, $headers, $body);
+
+
+	if (PEAR::isError($tmp)) {
+	  echo "message error:";
+	  print($tmp->getMessage());
+	  echo "<br>code error:";
+	  print($tmp->getCode());
+	 }
+*/
+}
+
+?>
\ No newline at end of file
diff --git a/www/include/reporting/message/formMail.ihtml b/www/include/reporting/message/formMail.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..20f2820da26fc32c7df7ee7af44f47647da0fb9a
--- /dev/null
+++ b/www/include/reporting/message/formMail.ihtml
@@ -0,0 +1,24 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/flag_green.gif'>
+	 	&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	
+		<tr class="list_one">
+			<td class="FormRowField">
+				{$form.subject.label}<br>
+			</td>
+			<td class="FormRowValue">{$form.subject.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.contact_lists.label}</td><td class="FormRowValue">{$form.contact_lists.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.body.label}</td><td class="FormRowValue">{$form.body.html}</td></tr>
+	 	
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+	<div id="validForm">
+		<p>{$form.submit.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	</div>
+	{$form.hidden}
+</form>
+
diff --git a/www/include/reporting/message/formMail.php b/www/include/reporting/message/formMail.php
new file mode 100644
index 0000000000000000000000000000000000000000..21bcd411fc0902be699695753d63c1b2f6c7dede
--- /dev/null
+++ b/www/include/reporting/message/formMail.php
@@ -0,0 +1,236 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+
+
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Diffusion List comes from DB -> Store in $difLists Array
+	$diffLists = array();
+	$res =& $pearDB->query("SELECT rtdl_id, name FROM reporting_diff_list ORDER BY name");
+	while($res->fetchInto($list))
+		$diffLists[$list["rtdl_id"]] = $list["name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+		$form->addElement('header', 'title', 'Send Mail Test');
+
+	#
+	## Mail content
+	#
+	
+	$form->addElement('text', 'subject', 'subject', $attrsText);
+
+
+    $ams3 =& $form->addElement('advmultiselect', 'contact_lists', $lang["mailDB_diffList"], $diffLists, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+
+
+
+
+	
+	$form->addElement('textarea', 'body', 'body', $attrsTextarea);
+	
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+	
+	$form->addElement('hidden', 'rtde_id');
+	
+	$o = 's';
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	//$form->addRule('email', $lang['ErrEmail'], 'required');
+	//$form->registerRule('exist', 'callback', 'testExistence');
+	//$form->addRule('email', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+	
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+		$subC =& $form->addElement('submit', 'submit', $lang["m_send"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+//	    $form->setDefaults($mail);
+
+	
+	$valid = false;
+		if ($form->validate())	{
+			/*
+	echo "send mail here !!";
+
+	print_r($form->getSubmitValue('contact_lists'));
+
+print "msg type:";
+ print_r($form->getSubmitValue('msg_type'));
+
+print "subject: ".$form->getSubmitValue('subject');
+print "body: ".$form->getSubmitValue('body');
+
+	require_once 'Mail.php';
+	require_once 'Mail/mime.php';
+
+	$recipients = 'cedrick.facon@gmail.com';
+	$from = 'cfacon@oreon-project.org';
+
+	$headers['From']    = $from;
+	$headers['To']      = $recipients;
+	$headers['Subject'] = 'Test message sub';
+	$headers['Content-Type'] = 'text/html; charset=windows-1250';
+	
+	$body = 'iciciciii';
+	
+	$params['host'] = 'smtp.wanadoo.fr';
+	
+	
+	$mail_object =& Mail::factory('smtp', $params);
+	
+//	$tmp = $mail_object->send($recipients, $headers, $body);
+	
+	
+	if (PEAR::isError($tmp)) {
+	  echo "message error:";
+	  print($tmp->getMessage());
+	  echo "<br>code error:";
+	  print($tmp->getCode());
+	 }
+*/
+
+/*
+ * 
+ * next old
+ * */
+
+
+/*
+	$text = 'Text version of email';
+	$html = "<html><body>Test html version oreon<br><img src=\"logo_oreon.gif\"></body></html>";
+	$crlf = "\n";
+	$hdrs = array(
+              'From'    => 'cfacon@oreon-project.org',
+              'Subject' => 'Test mime message plus piece jointe en theorie'
+              );
+	$mime = new Mail_mime($crlf);
+	$mime->setTXTBody($text);
+	$mime->setHTMLBody($html);
+	#
+	## image html
+	#
+	$image = "/usr/local/oreon/www/img/logo_oreon.gif";
+	$mime->addHTMLImage($image, 'image/gif'); 		
+	#
+	## piece jointe
+	#
+//	$file = '/usr/local/oreon/www/include/reporting/message/test.txt';
+//	$mime->addAttachment($file, 'text/plain');
+
+	$file = '/usr/local/oreon/www/img/logo_oreon.gif';
+	$mime->addAttachment($file, 'image/gif');
+		
+	$body = $mime->get();
+	$hdrs = $mime->headers($hdrs);
+	
+	
+	$params['host'] = 'smtp.wanadoo.fr';
+	$mail =& Mail::factory('smtp', $params);
+	
+	$mail->send('cedrick.facon@gmail.com', $hdrs, $body);
+	
+//	$tab = $form->getSubmitValue("contact_lists");
+//	print "->".$tab[0];
+*/
+
+/*
+$recipients = 'cedrick.facon@gmail.com';
+$from = 'cfacon@oreon-project.org';
+
+$headers['From']    = $from;
+$headers['To']      = $recipients;
+$headers['Subject'] = 'choisy mail test';
+//$headers['Content-Type'] = 'text/html; charset=windows-1250';
+
+$body = 'toto';
+
+//$params['host'] = 'smtp.gmail.com';
+
+$params['host'] = 'smtp.free.fr';
+
+//$params['host'] = 'smtp.free.fr';
+//$params['host'] = 'smtp.cnsi.fr';
+
+//$params['port'] = '25';
+//$params['auth'] = 'false';
+//$params['username'] = 'cfacon@oreon-project.org';
+//$params['password'] = 'oreon';
+
+$mail_object =& Mail::factory('smtp', $params);
+$tmp = $mail_object->send($recipients, $headers, $body);
+
+
+ if (PEAR::isError($tmp)) {
+ 	echo "message error:";
+ 	print($tmp->getMessage());
+ 	echo "<br>code error:";
+ 	print($tmp->getCode());
+ 	}
+*/
+	$valid = true;		
+	}
+
+	$action = $form->getSubmitValue("action");
+
+		#Apply a template definition	
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());	
+
+		$tpl->display("formMail.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/reporting/message/message.php b/www/include/reporting/message/message.php
new file mode 100644
index 0000000000000000000000000000000000000000..af61d2fc5ba8620116391c70f3647b332883390f
--- /dev/null
+++ b/www/include/reporting/message/message.php
@@ -0,0 +1,57 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick
+Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the
+quality,
+safety, contents, performance, merchantability, non-infringement or
+suitability for
+any particular or intended purpose of the Software found on the OREON web
+site.
+In no event will OREON be liable for any direct, indirect, punitive,
+special,
+incidental or consequential damages however they may arise and even if OREON
+has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset ($oreon))
+		exit ();
+
+#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	
+	#Path to the configuration dir
+	$path = "./include/reporting/message/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	require_once $path."MAIL-Func.php";
+
+	
+			switch ($o)	{
+
+				case "s" : send_simple_message(
+				isset($_POST["subject"]) ? $_POST["subject"]: NULL,
+				isset($_POST["body"]) ? $_POST["body"]: NULL,
+				isset($_POST["contact_lists"]) ? $_POST["contact_lists"]: array());
+				  require_once($path."formMail.php"); break; #send mail
+
+				default : require_once($path."formMail.php"); break;
+			}
+
+
+?>
diff --git a/www/include/reporting/message/oldformMail.php b/www/include/reporting/message/oldformMail.php
new file mode 100644
index 0000000000000000000000000000000000000000..12b8809646887f36282922237deccc26ab0f33fc
--- /dev/null
+++ b/www/include/reporting/message/oldformMail.php
@@ -0,0 +1,139 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+
+
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Diffusion List comes from DB -> Store in $difLists Array
+	$diffLists = array();
+	$res =& $pearDB->query("SELECT rtdl_id, name FROM reporting_diff_list ORDER BY name");
+	while($res->fetchInto($list))
+		$diffLists[$list["rtdl_id"]] = $list["name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+		$form->addElement('header', 'title', 'Send Mail Test');
+
+	#
+	## Mail content
+	#
+	
+	$form->addElement('text', 'subject', 'subject', $attrsText);
+
+    $ams3 =& $form->addElement('advmultiselect', 'contact_lists', $lang["mailDB_diffList"], $diffLists, $attrsAdvSelect);
+	$ams3->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams3->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams3->setElementTemplate($template);
+	echo $ams3->getElementJs(false);
+
+
+
+	$mailActivation[] = &HTML_QuickForm::createElement('radio', 'activate', null, 'text', '1');
+	$mailActivation[] = &HTML_QuickForm::createElement('radio', 'activate', null, 'html', '0');
+	$form->addGroup($mailActivation, 'msg_type', 'msg type', '&nbsp;');
+	$form->setDefaults(array('activate' => '1', "action"=>'1'));
+
+	
+	$form->addElement('textarea', 'body', 'body', $attrsTextarea);
+	
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+	
+	$form->addElement('hidden', 'rtde_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	//$form->addRule('email', $lang['ErrEmail'], 'required');
+	//$form->registerRule('exist', 'callback', 'testExistence');
+	//$form->addRule('email', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+	
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+		$subC =& $form->addElement('submit', 'submitC', $lang["send"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+//	    $form->setDefaults($mail);
+
+	
+	$valid = false;
+		if ($form->validate())	{
+/*
+require_once 'Mail.php';
+$from = "diablo@oreon.com";
+$subject = "oreon mail de test";
+$to = "cedrick.facon@gmail.com";
+
+
+ $headers = array(
+ 'From' => $from,
+ 'Subject' => $subject,
+ 'To' => $to);
+
+$mail = Mail::factory('smtp', array(
+        'host' => 'smtp.free.fr',
+        'auth' => false,
+        'username' => 'oreon',
+        'password' => 'fouchoisy'));
+
+$body = "boodddy";                        
+ $send = $mail->send($to, $headers, $body);
+ if (PEAR::isError($send)) { print($send->getMessage());}
+*/
+		$valid = true;
+	}	
+
+	$action = $form->getSubmitValue("action");
+
+		#Apply a template definition	
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		$tpl->assign('form', $renderer->toArray());	
+
+		$tpl->display("formMail.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/reporting/message/test.txt b/www/include/reporting/message/test.txt
new file mode 100644
index 0000000000000000000000000000000000000000..d5c7bddbc5ba4078e59e213809f119a31f47f0eb
--- /dev/null
+++ b/www/include/reporting/message/test.txt
@@ -0,0 +1 @@
+test a la con ki saoul sa race
\ No newline at end of file
diff --git a/www/include/reporting/notifications.php b/www/include/reporting/notifications.php
new file mode 100644
index 0000000000000000000000000000000000000000..02f34f7f63a605298abc2c862829550689c6652b
--- /dev/null
+++ b/www/include/reporting/notifications.php
@@ -0,0 +1,148 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf - Cedrick Facon
+
+Adapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+		
+	if (!isset($_GET["options"]) && !isset($_GET["update"]))	{
+		$options[0] = 0;
+		$options[1] = 0;
+		$options[2] = 0;
+		$options[3] = 0;
+		$options[4] = 1;
+		$options[5] = 0;
+	} else
+		$options = & $_GET["options"];
+
+
+	$log = NULL;	
+	if (!isset($oreon->Lca[$oreon->user->get_id()]) || (isset($oreon->Lca[$oreon->user->get_id()]) && !strcmp($oreon->Lca[$oreon->user->get_id()]->get_watch_log(), "1"))){
+		$ti = 0;
+		if (isset($_GET["o"]) && !strcmp($_GET["o"], "d") && isset($_GET["file"]) && strcmp($_GET["file"], "") && is_file($oreon->Nagioscfg->log_archive_path . $_GET["file"]))
+			$log = fopen($oreon->Nagioscfg->log_archive_path . $_GET["file"], "r");
+		else{
+			if (file_exists($oreon->Nagioscfg->log_file) && !($log = fopen($oreon->Nagioscfg->log_file, "r")))
+				echo $lang["pel_cant_open"];
+		}
+		if ($log)
+			$event_log = new TabEventLog($options, $log);
+		else
+			$event_log = NULL;
+	?>
+	<table border=0>
+		<tr>
+			<td valign="top">
+			<?
+				if (isset($_GET['file']) && strcmp($_GET['file'], "")){
+					preg_match("/^nagios\-([0-9]+)\-([0-9]+)\-([0-9]+)\-00\.log/", $_GET["file"], $matches);
+					$today_now = 1;
+				} else
+					$today_now = 0;
+			?>
+			<font class="text14b"><? echo $lang['pel_notify_title']; ?><? if ($today_now == 1 && isset($matches[2]) && $matches[1] && $matches[3]) print $matches[2] - 1 . "/" . $matches[1] . "/" . $matches[3]; else print date("d/m/Y") ;?></b></font>
+			</td>
+		</tr>
+	<tr>
+		<td align="center">
+			<table border="0">
+				<tr>
+					<td class="tabTableTitle">
+						<?  
+						print $lang['hours'] . "&nbsp;:&nbsp;";
+						for ($t = 0; $t != 24; $t++)
+						{
+							if (isset($event_log->tab_hour[$t]) && $event_log->tab_hour[$t])
+								print "<a href='#$t' class='text11'>$t</a>";
+							if (isset($event_log->tab_hour[$t + 1]) && $event_log->tab_hour[$t + 1])
+								if (strcmp($event_log->tab_hour[$t + 1], ""))
+									print " - ";
+						}
+						?>
+					</td>
+				</tr>
+			</table><br><br>
+			<table>
+			<tr>
+				<td valign="top">
+					<? //include ("tab3Top.php"); 
+						$color[0] = "EAEAEA";
+						$color[1] = "DDDDDD"; 
+					?>
+					<table cellSpacing=1 cellPadding=1 border=0 style="border-width: thin; border-style: dashed; border-color=#9C9C9C;">
+						<tr>
+							<td bgcolor="#CCCCCC" width="50" class="text12b"><? echo $lang['date']; ?></td>
+							<td bgcolor="#CCCCCC" width="150" class="text12b"><? echo $lang['event']; ?></td>
+							<td bgcolor="#CCCCCC" width="75" class="text12b"><? echo $lang['h']; ?></td>
+							<td bgcolor="#CCCCCC" width="75" class="text12b"><? echo $lang['s']; ?></td>
+						</tr>
+					<?
+					$time_now = date("G");
+					$time_before = date("G");	
+					$c = -1;
+					$clr = 0;
+					for ($i = count($event_log->tab) - 1, $x = $i; $event_log && $i != 0; $i--){
+						$color_set = $color[$clr % 2];
+						$haut_i = $clr + 1;
+						$color_haut = $color[$haut_i % 2];
+						$time_now = date("G", $event_log->tab[$i]->time_event);
+						if ($event_log->tab[$i]->type){
+							$str = "";
+							if ($time_now != $time_before && $c != -1 && $c != $time_now){
+								$str =  "<td colspan=4 style='border-width: thin; border-bottom: 1px;border-top:0px;border-right:0px;border-left:0px; border-style: dashed; border-color=#9C9C9C;white-space:nowrap' bgcolor='#".$color_haut."' align='right'><a name='$time_now'></a><a href='#top' class='text9b'>".$lang['top']."</a>&nbsp;&nbsp;</td>\n" ;
+								$c = -1;
+							}
+							if (!strcmp($event_log->tab[$i]->type, "HOST NOTIFICATION")){
+								$c = $time_now;
+								$str = "<td style='white-space:nowrap' class='text9br' bgcolor='#".$color_set."'>" . $event_log->tab[$i]->type .  "</td><td colspan=2 class='text9' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->host . "</td></tr><tr><td>&nbsp;</td><td style='white-space:nowrap' class='text9' colspan='3' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->output ."</td>" ;
+							} else if (!strcmp($event_log->tab[$i]->type, "SERVICE NOTIFICATION")){
+								$c = $time_now;
+								$str =  "<td style='white-space:nowrap' class='text9br' bgcolor='#".$color_set."'>" . $event_log->tab[$i]->type .  "</td><td class='text9' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->host . "</td><td class='text9' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->service . "</td></tr><tr><td>&nbsp;</td><td style='white-space:nowrap' class='text9' colspan='3' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->output ."</td>" ;
+							}
+							if ($str){
+								if ($c == -1)
+									print "<tr><td style='white-space:nowrap' class='text9b'></td>" . $str . "</tr>";
+								else
+									print "<tr><td style='white-space:nowrap' class='text9b' bgcolor='#".$color_set."'>" . date("G:i:s", $event_log->tab[$i]->time_event) . "</td>" . $str . "</tr>";
+								$clr++;
+							}
+							$time_before = $time_now;
+							$x--;
+						}
+					} 
+					print "<tr><td style='white-space:nowrap' class='text9b'></td><td colspan=4 style='border-width: thin; border-bottom: 1px;border-top:0px;border-right:0px;border-left:0px;white-space:nowrap' bgcolor='#".$color_set."' align='right'><a href='#top' class='text9b'>".$lang['top']."</a>&nbsp;&nbsp;</td></tr>";
+					?>
+					</table>
+				</td>
+				<td valign="top" align="center" style="padding-left: 20px;"> 
+					<table border="0" width="95%">
+						<tr>
+							<td valign="top" class="tabTableForTab">
+								<?	require_once './include/calendar/calendrier.php';
+									echo calendar($oreon);
+								?>
+							</td>
+						</tr>
+					</table>						
+				</td>
+			</tr>
+		</table>
+<? 	}
+	else
+		include("./include/security/error.php"); ?>
\ No newline at end of file
diff --git a/www/include/reporting/parseeventlog.php b/www/include/reporting/parseeventlog.php
new file mode 100644
index 0000000000000000000000000000000000000000..f320eacc972e5ea0be5efeb6ffc086067406a0ba
--- /dev/null
+++ b/www/include/reporting/parseeventlog.php
@@ -0,0 +1,179 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf - Cedrick Facon
+
+Adapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+		
+	if (!isset($_GET["options"]) && !isset($_GET["update"]))	{
+		$options[0] = 1;
+		$options[1] = 1;
+		$options[2] = 1;
+		$options[3] = 1;
+		$options[4] = 1;
+		$options[5] = 1;
+	} else
+		$options = & $_GET["options"];
+
+	$log = NULL;	
+	if (!isset($oreon->Lca[$oreon->user->get_id()]) || (isset($oreon->Lca[$oreon->user->get_id()]) && !strcmp($oreon->Lca[$oreon->user->get_id()]->get_watch_log(), "1"))){
+		$ti = 0;
+		if (isset($_GET["o"]) && !strcmp($_GET["o"], "d") && isset($_GET["file"]) && strcmp($_GET["file"], "") && is_file($oreon->Nagioscfg->log_archive_path . $_GET["file"]))
+			$log = fopen($oreon->Nagioscfg->log_archive_path . $_GET["file"], "r");
+		else{
+			if (file_exists($oreon->Nagioscfg->log_file) && !($log = fopen($oreon->Nagioscfg->log_file, "r")))
+				echo $lang["pel_cant_open"];
+		}
+		if ($log)
+			$event_log = new TabEventLog($options, $log);
+		else
+			$event_log = NULL;
+	?>
+	<table border=0>
+		<tr>
+			<td valign="top">
+			<?
+				if (isset($_GET['file']) && strcmp($_GET['file'], "")){
+					preg_match("/^nagios\-([0-9]+)\-([0-9]+)\-([0-9]+)\-00\.log/", $_GET["file"], $matches);
+					$today_now = 1;
+				} else
+					$today_now = 0;
+			?>
+			<font class="text14b"><? echo $lang['pel_l_details']; ?><? if ($today_now == 1 && isset($matches[2]) && $matches[1] && $matches[3]) print $matches[2] - 1 . "/" . $matches[1] . "/" . $matches[3]; else print date("d/m/Y") ;?></b></font>
+			</td>
+		</tr>
+	<tr>
+		<td align="center">
+			<table border="0">
+				<tr>
+					<td class="tabTableTitle">
+						<? 
+						print $lang['hours'] . "&nbsp;:&nbsp;";
+						for ($t = 0; $t != 24; $t++)
+						{
+							if (isset($event_log->tab_hour[$t]) && $event_log->tab_hour[$t])
+								print "<a href='#$t' class='text11'>$t</a>";
+							if (isset($event_log->tab_hour[$t + 1]) && $event_log->tab_hour[$t + 1])
+								if (strcmp($event_log->tab_hour[$t + 1], ""))
+									print " - ";
+						}
+						?>
+					</td>
+				</tr>
+			</table><br><br>
+			<table>
+			<tr>
+				<td valign="top">
+					<? //include ("tab3Top.php"); 
+						$color[0] = "EAEAEA";
+						$color[1] = "DDDDDD"; 
+					?>
+					<table cellSpacing=1 cellPadding=1 border=0 style="border-width: thin; border-style: dashed; border-color=#9C9C9C;">
+						<tr>
+							<td bgcolor="#CCCCCC" width="50" class="text12b"><? echo $lang['date']; ?></td>
+							<td bgcolor="#CCCCCC" width="150" class="text12b"><? echo $lang['event']; ?></td>
+							<td bgcolor="#CCCCCC" width="75" class="text12b"><? echo $lang['h']; ?></td>
+							<td bgcolor="#CCCCCC" width="75" class="text12b"><? echo $lang['s']; ?></td>
+						</tr>
+					<?
+					$time_now = date("G");
+					$time_before = date("G");	
+					for ($i = count($event_log->tab) - 1, $x = $i; $event_log && $i != 0; $i--){
+						$color_set = $color[$x % 2];
+						$time_now = date("G", $event_log->tab[$i]->time_event);
+						if ($event_log->tab[$i]->type){
+							if ($time_now != $time_before)
+								print 	$str =  "<td colspan=4 style='border-width: thin; border-bottom: 1px;border-top:0px;border-right:0px;border-left:0px; border-style: dashed; border-color=#9C9C9C;white-space:nowrap' bgcolor='#".$color_set."' align='right'><a name='$time_now'></a><a href='#top' class='text9b'>".$lang['top']."</a>&nbsp;&nbsp;</td>" ;
+							$str = "";
+							if ((!strncmp($event_log->tab[$i]->type, "HOST NOTIFICATION", 17) && $options[4]) || (!strncmp($event_log->tab[$i]->type, "HOST ALERT", 10) && $options[0]))
+								$str = "<td style='white-space:nowrap' class='text9br' bgcolor='#".$color_set."'>" . $event_log->tab[$i]->type .  "</td><td colspan=2 class='text9' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->host . "</td></tr><tr><td>&nbsp;</td><td style='white-space:nowrap' class='text9' colspan='3' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->output ."</td>" ;
+							else if ((!strcmp($event_log->tab[$i]->type, "SERVICE NOTIFICATION") && $options[4]) || (!strncmp($event_log->tab[$i]->type, "SERVICE ALERT", 13) && $options[0]))
+								$str =  "<td style='white-space:nowrap' class='text9br' bgcolor='#".$color_set."'>" . $event_log->tab[$i]->type .  "</td><td class='text9' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->host . "</td><td class='text9' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->service . "</td></tr><tr><td>&nbsp;</td><td style='white-space:nowrap' class='text9' colspan='3' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->output ."</td>" ;
+							else if ((!strcmp($event_log->tab[$i]->type, "EXTERNAL COMMAND") && $options[4]))
+								$str =  "<td style='white-space:nowrap' class='text9bv' bgcolor='#".$color_set."' colspan=4>" . $event_log->tab[$i]->type .  "</td></tr><tr><td>&nbsp;</td><td class='text9' colspan='3' bgcolor='#".$color_set."'>&nbsp;" . $event_log->tab[$i]->output . "</td>" ;
+							else if (!strncmp($event_log->tab[$i]->type, "Auto-save", 9))
+								$str =  "<td colspan=4 style='white-space:nowrap' class='text9b' bgcolor='#".$color_set."'>" . $event_log->tab[$i]->type . "</td>" ;
+							else if (!strncmp($event_log->tab[$i]->type, "Warning", 7) || !strncmp($event_log->tab[$i]->type, "Error", 5))
+								$str =  "<td colspan=4 style='white-space:nowrap' class='text9bo' bgcolor='#".$color_set."'>" . $event_log->tab[$i]->type . "</td></tr><tr><td>&nbsp;</td><td class='text9' colspan=3 bgcolor='#".$color_set."'>&nbsp;".$event_log->tab[$i]->output."</td>" ;
+							else
+								$str =  "<td colspan=4 style='white-space:nowrap' bgcolor='#".$color_set."'>" . $event_log->tab[$i]->type . "</td>" ;
+							if ($str)
+								print "<tr><td style='white-space:nowrap' class='text9b' bgcolor='#".$color_set."'>" . date("G:i:s", $event_log->tab[$i]->time_event) . "</td>" . $str . "</tr>";
+							$time_before = $time_now;
+							$x--;
+						}
+					} ?>
+					</table>
+				</td>
+				<td valign="top" align="center" style="padding-left: 20px;"> 
+					<table border="0" width="95%">
+						<tr>
+							<td valign="top" class="tabTableTable">
+								<? 	
+									require_once './include/calendar/calendrier.php';
+									echo calendar($oreon); ?>
+							</td>
+						</tr>
+						<tr>
+						<td valign="top" style="padding-top: 10px;">
+							<form action="" method="get"><input name="o" type="hidden" value="d"><input name="p" type="hidden" value="304"><input name="file" type="hidden" value="<? 			
+							if (isset($_GET["file"])) 
+								print $_GET["file"]; 
+							?>"><input name="date" type="hidden" value="<? if (isset($_GET["date"])) print $_GET["date"]; else print date('Y').date('m').date('d'); ?>">
+							<table width="100%" border="0" class='tabTableTitle'>
+								<tr>
+									<td align="center" colspan="2"><b><? echo $lang["pel_sort"]; ?></b><br></td>
+								</tr>
+							</table>
+							<table width="100%" border="0" class='tabTableMenu'>
+								<tr>
+									<td align="right"><input name="options[0]" type="checkbox" value="1"<? if (isset($options[0]) && $options[0] == 1) print " Checked"; ?>></td><td> Alert</td>
+								</tr>
+								<tr>
+									<td align="right"><input name="options[1]" type="checkbox" value="1"<? if (isset($options[1]) && $options[1] == 1) print " Checked"; ?>></td><td> Warning</td>
+								</tr>
+								<tr>
+									<td align="right"><input name="options[2]" type="checkbox" value="1"<? if (isset($options[2]) && $options[2] == 1) print " Checked"; ?>></td><td> External Command</td>
+								</tr>
+								<tr>
+									<td align="right"><input name="options[3]" type="checkbox" value="1"<? if (isset($options[3]) && $options[3] == 1) print " Checked"; ?>></td><td> Error</td>
+								</tr>
+								<tr>
+									<td align="right"><input name="options[4]" type="checkbox" value="1"<? if (isset($options[4]) && $options[4] == 1) print " Checked"; ?>></td><td> Notification</td>
+								</tr>
+								<!--<tr>
+									<td align="right"><input name="options[5]" type="checkbox" value="1"<? if (isset($options[5]) && $options[5] == 1) print " Checked"; ?>></td><td>Auto Save</td>
+								</tr>-->
+								<tr>
+									<td colspan="2" align="center"><br><input name="update" type="submit" value="update"></td>
+								</tr>
+							</table>
+							</form>
+							</td>
+						</tr>
+					</table>						
+				</td>
+			</tr>
+		</table>
+<? 	}
+	else
+		include("./include/security/error.php"); 
+	
+	unset ($oreon->Logs);	
+		?>
\ No newline at end of file
diff --git a/www/include/reporting/viewHostLog.ihtml b/www/include/reporting/viewHostLog.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..02d02981b6c75d5e55ff8112f8100ed29dbdf413
--- /dev/null
+++ b/www/include/reporting/viewHostLog.ihtml
@@ -0,0 +1,148 @@
+<script language='javascript' src='./include/common/javascript/datePicker.js'></script>
+<link href="./include/common/javascript/datePicker.css" rel="stylesheet" type="text/css"/>
+{$form.javascript}
+<script type="text/javascript" src="include/configuration/changetab.js"></script>
+{$styleB}
+<table style='width:100%;'>
+<tr>
+	<td  rowspan=3 style='width:300px; padding:5px'>
+		<table class="ListTable" >
+			<tr class='ListHeader'>
+				<td class="ListColHeaderCenter"></td>
+			</tr>
+			<tr>
+				<td class='list_one'>
+					<form {$formHost.attributes}>
+						<b>{$formHost.host.label}</b>&nbsp;&nbsp;{$formHost.host.html}
+		    			{$formHost.hidden}
+					</form>						
+				</td>
+			</tr>
+			<tr>
+				<td class='list_one'>
+					{$infosTitle}
+				</td>
+			</tr>
+			<tr class='list_two'>
+				<td class="ListColCenter"><img src='./include/reporting/generateImages/pie_chart_host.php?host_name={$host_name}{$status}'></td>					
+			</tr>
+		</table>
+	</td>
+</tr>
+<tr>
+	<td style=' padding:5px;'>
+		<table class="ListTable" >
+			<tr class='ListHeader'>
+				<td colspan=4>{$periodTitle}</td>
+			</tr>	
+			<tr class='list_lvl_1'>
+				<td colspan=2 & class="ListColHeaderLeft">{$formPeriod1.header.title}</td>
+			</tr>
+	        <tr class="list_one">
+		        <td colspan=2>
+			        <form {$formPeriod1.attributes}>
+			        	{$formPeriod1.period.label}{$formPeriod1.period.html}
+			        	
+			        		{$formPeriod1.hidden}
+					</form>
+		        </td>
+	        </tr>
+			<tr class='list_lvl_1' >
+				<td  colspan=2 class="ListColHeaderLeft">{$formPeriod2.header.title}</td>
+			</tr>
+			<tr class="list_two">
+				<td>	        <form {$formPeriod2.attributes}>			
+				{$formPeriod2.start.label}</td>
+				<td>{$formPeriod2.start.html}&nbsp;&nbsp;{$formPeriod2.startD.html}</td>
+			</tr>
+			<tr class="list_one">
+				<td>{$formPeriod2.end.label}</td>
+				<td>{$formPeriod2.end.html}&nbsp;&nbsp;{$formPeriod2.endD.html}</td>
+			</tr>
+			<tr class="list_one">
+				<td colspan=2>{$formPeriod2.submit.html}&nbsp;&nbsp;&nbsp;&nbsp;{$formPeriod2.reset.html}
+		        		{$formPeriod2.hidden}
+				</form>
+				</td>
+			</tr>
+		</table>
+	</td>
+</tr>
+<tr>
+	<td style='vertical-align:top;padding:5px;'>
+		<table class="ListTable">
+			<tr class='ListHeader'>
+				<td colspan=4>{$resumeTitle}</td>
+			</tr>
+			<tr class='list_lvl_1'>
+				<td class="ListColHeaderCenter">{$StateTitle}</td>
+				<td class="ListColHeaderCenter">{$TimeTitle}</td>
+				<td class="ListColHeaderCenter">{$TimeTotalTitle}</td>
+				<td class="ListColHeaderCenter">{$KnownTimeTitle}</td>
+			</tr>
+			{foreach item=tb from=$tab_resume}
+			<tr class={cycle values="list_two, list_one"}>
+				<td {$tb.style}>{$tb.state}</td>
+				<td {$tb.style} >{$tb.time}</td>
+				<td {$tb.style}>{$tb.pourcentTime}</td>
+				<td {$tb.style}>{$tb.pourcentkTime}</td>
+			</tr>
+			{/foreach}
+		</table>
+	</td>
+</tr>
+<tr>
+	<td colspan=2 style=' padding:5px;'>
+		<table class="ListTable">
+			<tr class='ListHeader'>
+				<td class="FormHeader" colspan=6>{$svcTitle}</td>
+			</tr>
+			<tr class='list_lvl_1'>
+				<td class="ListColHeaderCenter">{$serviceTilte}</td>
+				<td class="ListColHeaderCenter">{$OKTitle}</td>
+				<td class="ListColHeaderCenter">{$WarningTitle}</td>
+				<td class="ListColHeaderCenter">{$UnknownTitle}</td>
+				<td class="ListColHeaderCenter">{$CriticalTitle}</td>
+				<td class="ListColHeaderCenter">{$PendingTitle}</td>
+			</tr>
+			{foreach item=tb from=$tab_svc}
+			<tr class={cycle values="list_two, list_one"}>
+				<td class="ListColHeaderCenter"><a href="oreon.php?p=30702&host={$host_name}&service={$tb.svcName}">{$tb.svcName}</a></td>
+				<td {$style_ok}>{$tb.PtimeOK}</td>
+				<td {$style_warning}>{$tb.PtimeWARNING}</td>
+				<td {$style_unknown}>{$tb.PtimeUNKNOWN}</td>
+				<td {$style_critical}>{$tb.PtimeCRITICAL}</td>
+				<td {$style_pending}>{$tb.PtimeNONE}</td>
+			</tr>
+			{/foreach}
+		</table>
+	</td>
+</tr>
+<tr>
+	<td colspan=2 style=' padding:5px;'>
+		<table class="ListTable" class="left">
+			<tr class='ListHeader'>
+				<td class="FormHeader"colspan=5>{$logTitle}</td>
+			</tr>
+			<tr class='list_lvl_1'>
+				<td class="ListColHeaderCenter">&nbsp;</td>
+				<td class="ListColHeaderCenter">{$DateTitle}</td>
+				<td class="ListColHeaderCenter">{$EventTitle}</td>
+				<td class="ListColHeaderCenter">{$HostTitle}</td>
+				<td class="ListColHeaderCenter">{$InformationsTitle}</td>
+			</tr>
+			{foreach item=tb from=$tab_log}
+			{if $tb.type eq "HOST ALERT" or $tb.type eq "CURRENT HOST STATE"}
+			<tr class={cycle values="list_two, list_one"}>
+				<td class="ListColHeaderCenter"><img src={$tb.img}></td>
+				<td class="ListColLeft">{$tb.time}</td>
+				<td class="ListColLeft">{$tb.status}</td>
+				<td class="ListColLeft">{$tb.host}</td>
+				<td class="ListColNoWrap">{$tb.output}</td>
+			</tr>
+			{/if}
+			{/foreach}
+		</table>
+	</td>
+</tr>
+</table>
\ No newline at end of file
diff --git a/www/include/reporting/viewHostLog.php b/www/include/reporting/viewHostLog.php
new file mode 100644
index 0000000000000000000000000000000000000000..276eabc07e4a14508df26cbab8267d763f92ba83
--- /dev/null
+++ b/www/include/reporting/viewHostLog.php
@@ -0,0 +1,599 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf - Cedrick Facon
+
+Adapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	
+
+
+	$path = "./include/reporting/";
+	# Smarty template Init
+	$tpl =& new Smarty();
+	$tpl =& initSmartyTpl($path, $tpl, "");
+
+	$tpl->assign('o', $o);
+
+	function my_getTimeTamps($dateSTR)
+	{
+		list($m,$d,$y) = split('/',$dateSTR);
+		return (mktime(0,0,0,$m,$d,$y));
+	}
+	function trim_value(&$value)
+	{
+	   $value = trim($value);
+	}
+	function getLogData($time_event, $host, $service, $status, $output, $type){
+		global $lang;
+		$tab_img = array("UP" => './img/icones/12x12/recovery.gif',
+						"DOWN" => './img/icones/12x12/alert.gif',
+						"UNREACHABLE" => './img/icones/12x12/queue.gif',
+						"NONE" => './img/icones/12x12/info.gif',
+						);
+
+		$tab["time"] = date($lang["header_format"], $time_event);
+		$tab["timeb"] = $time_event;
+		$tab["host"] = $host;
+		$tab["service"] = $service;
+		$tab["status"] = $status;
+		$tab["output"] = $output;
+		$tab["type"] = $type;
+		$tab["img"] = $tab_img[$status];
+		return $tab ;
+	}
+		
+	isset ($_GET["host"]) ? $mhost = $_GET["host"] : $mhost = NULL;
+	isset ($_POST["host"]) ? $mhost = $_POST["host"] : $mhost = $mhost;
+
+
+
+	require_once './class/other.class.php';
+	require_once './include/common/common-Func.php';
+	include("./include/monitoring/log/choose_log_file.php");
+
+
+
+if(!is_null($mhost))
+{	
+	$day = date("d",time());
+	$year = date("Y",time());
+	$month = date("m",time());
+	$hour = date("G",time());
+	$minute = date("i",time());
+	$second = date("s",time());
+	$start_date_day = mktime(0, 0, 0, $month, $day, $year);
+	if(isset($_POST["period"])){
+		if($_POST["period"] == "today"){
+			$start_date_select = mktime(0, 0, 0, $month, $day, $year);
+			$end_date_select = time();
+		} else if($_POST["period"] == "last24hours"){
+			$start_date_select = time() - (24*60*60);
+			$end_date_select = time();
+		} else if($_POST["period"] == "yesterday"){
+			$start_date_select = mktime(0, 0, 0, $month, $day-1, $year);
+			$end_date_select = mktime(0, 0, 0, $month, $day, $year);
+		} else if($_POST["period"] == "thisweek"){//a fair
+			$dd = (date("D",mktime(0, 0, 0, $month, $day, $year)));
+			for($ct = 1; $dd != "Mon" ;$ct++)
+				$dd = (date("D",mktime(0, 0, 0, $month, ($day-$ct), $year)));
+			$start_date_select = mktime(0, 0, 0, $month, $day-$ct, $year);
+			$end_date_select = time();
+		} else if($_POST["period"] == "last7days"){
+			$start_date_select = mktime($hour, $minute, $second, $month, $day-7, $year);
+			$end_date_select = mktime($hour, $minute, $second, $month, $day, $year);
+		} else if($_POST["period"] == "last30days"){// attention au 31 
+			$start_date_select = mktime($hour, $minute, $second, $month, $day-30, $year);
+			$end_date_select = mktime($hour, $minute, $second, $month, $day, $year);
+		} else if($_POST["period"] == "lastyear"){// attention au 31 
+			$start_date_select = mktime(23, 59, 60, 12, 31, $year-1);
+			$end_date_select = mktime(23, 59, 60, 12, 31, $year);
+		} else if($_POST["period"] == "thismonth") {
+			$start_date_select = mktime(0, 0, 0, $month, 0, $year);
+			$end_date_select = mktime($hour, $minute, $second, $month, $day, $year);
+		} else if($_POST["period"] == "thisyear"){
+			$start_date_select = mktime(0, 0, 0, 0, 0, $year);
+			$end_date_select = mktime($hour, $minute, $second, $month, $day, $year);
+		} else { // lastmonth
+			$start_date_select = mktime(23, 59, 60, $month-1, 0, $year);
+			$end_date_select = mktime(23, 59, 60, $month, 0, $year);
+		}		
+	} else {
+		$start_date_select = mktime(0, 0, 0, $month, $day, $year);
+		$end_date_select = time();
+	}
+
+	if(isset($_POST["end"]) && isset($_POST["start"])){
+		if(!$_POST["end"])
+			$end = time();
+		else
+			$end = my_getTimeTamps($_POST["end"]);
+			
+		$endday = date("d",$end);
+		$endyear = date("Y",$end);
+		$endmonth = date("m",$end);
+		$endhour = date("G",$end);
+		$endminute = date("i",$end);
+		$endsecond = date("s",$end);
+		$end_date_select = mktime(23, 59, 59, $endmonth, $endday, $endyear);
+		if(!$_POST["start"])
+			$start = mktime(0, 0, 0, $endmonth, $endday, $endyear);
+		else
+			$start = my_getTimeTamps($_POST["start"]);
+		$start_date_select = $start;
+	}
+
+	$host_id = getMyHostID($mhost);
+
+
+#
+## recupere les log host en base
+#
+$rq = 'SELECT ' .
+	'sum(UPTimeScheduled)' .
+	' as Tup,' .				
+	'sum(DOWNTimeScheduled)' .
+	' as Tdown,' .
+	'sum(UNREACHABLETimeScheduled)' .
+	' as Tunreach, ' .				
+	'sum(UNDETERMINATETimeScheduled)' .
+	' as Tnone, ' .
+	'min(date_start) as log_date_start,' .
+	'max(date_end) as log_date_end,' .
+	'sum(UNREACHABLETimeScheduled) as unreach FROM `log_archive_host` WHERE host_id = ' . $host_id  .
+	' AND date_start >=  ' . ($start_date_select-1) .
+	' AND date_end <= ' . $end_date_select;
+
+	$res = & $pearDB->query($rq);
+	if (PEAR::isError($res)){
+	  die($res->getMessage());
+	} else {
+	  while ($h =& $res->fetchRow()){
+
+	$Tup = 0 + $h["Tup"];
+	$Tdown = 0 + $h["Tdown"];
+	$Tunreach = 0 + $h["Tunreach"];
+	$Tnone = 0 + $h["Tnone"];
+
+
+	
+	  }
+	}
+#
+## recupere les log svc en base
+#
+$rq = 'SELECT ' .
+	'service_id, ' .
+	'sum(OKTimeScheduled)' .
+	' as Tok,' .				
+	'sum(WARNINGTimeScheduled)' .
+	' as Twarn,' .
+	'sum(UNKNOWNTimeScheduled)' .
+	' as Tunknown, ' .				
+	'sum(UNDETERMINATETimeScheduled)' .
+	' as Tnone, ' .
+	'sum(CRITICALTimeScheduled)' .
+	' as Tcri, ' .
+	'min(date_start) as log_date_start,' .
+	'max(date_end) as log_date_end' .
+	' FROM `log_archive_service` WHERE host_id = ' . $host_id  .
+	' AND date_start >=  ' . ($start_date_select-1) .
+	' AND date_end <= ' . $end_date_select .
+	' GROUP BY service_id';
+	$res = & $pearDB->query($rq);
+	$tab_svc_bdd = array();
+	if (PEAR::isError($res)){
+	  die($res->getMessage());
+	} else { 
+	  while ($s =& $res->fetchRow()){
+	  	
+		$tab_svc_bdd[$s["service_id"]]["Tok"] = 0 + $s["Tok"];
+		$tab_svc_bdd[$s["service_id"]]["Twarn"] = 0 + $s["Twarn"];
+		$tab_svc_bdd[$s["service_id"]]["Tunknown"] = 0 + $s["Tunknown"];
+		$tab_svc_bdd[$s["service_id"]]["Tnone"] = 0 + $s["Tnone"];
+		$tab_svc_bdd[$s["service_id"]]["Tcri"] = 0 + $s["Tcri"];
+	  }
+	}
+
+}
+
+	#
+	## Selection de l'host
+	#
+
+	$formHost = new HTML_QuickForm('formHost', 'post', "?p=".$p);
+	$formHost->addElement('header', 'title', "...selection host...");
+
+	isset($_POST["period"]) ? $formHost->addElement('hidden', 'period', $_POST["period"]) : NULL;
+	isset($_POST["end"]) ? $formHost->addElement('hidden', 'end', $_POST["end"]) : NULL;
+	isset($_POST["start"]) ? $formHost->addElement('hidden', 'start', $_POST["start"]) : NULL;
+	
+	$res =& $pearDB->query("SELECT host_name FROM host where host_activate = '1' and host_register = '1' ORDER BY host_name");
+	while ($res->fetchInto($h))
+		$host[$h["host_name"]] = $h["host_name"];	
+	$selHost =& $formHost->addElement('select', 'host', $lang["h"], $host, array("onChange" =>"this.form.submit();"));
+
+	if (isset($_POST["host"])){
+		$formHost->setDefaults(array('host' => $_POST["host"]));
+	}else if (isset($_GET["host"])){
+		$formHost->setDefaults(array('host' => $_GET["host"]));
+	}
+//	$formHost->Display();
+
+
+	
+	#
+	## fourchette de temps
+	#	
+	$period["today"] = "Today";
+	$period["last24hours"] = "Last 24 Hours";
+	$period["yesterday"] = "Yesterday";
+	$period["thisweek"] = "This Week";
+	$period["last7days"] = "Last 7 Days";
+	$period["thismonth"] = "This Month";
+	$period["last30days"] = "Last 30 Days";
+	$period["lastmonth"] = "Last Month";
+	$period["thisyear"] = "This Year";
+	$period["lastyear"] = "Last Year";
+
+
+	$formPeriod1 = new HTML_QuickForm('FormPeriod1', 'post', "?p=".$p);
+
+	isset($mhost) ? $formPeriod1->addElement('hidden', 'host', $mhost) : NULL;
+	
+	$formPeriod1->addElement('header', 'title', $lang["m_predefinedPeriod"]);
+	$selHost =& $formPeriod1->addElement('select', 'period', $lang["m_predefinedPeriod"], $period, array("onChange" =>"this.form.submit();"));	
+
+
+	$formPeriod2 = new HTML_QuickForm('FormPeriod2', 'post', "?p=".$p);
+	isset($mhost) ? $formPeriod2->addElement('hidden', 'host', $mhost) : NULL;
+	$formPeriod2->addElement('header', 'title', $lang["m_customizedPeriod"]);
+	$formPeriod2->addElement('text', 'start', $lang["m_start"]);
+	$formPeriod2->addElement('button', "startD", $lang['modify'], array("onclick"=>"displayDatePicker('start')"));
+	$formPeriod2->addElement('text', 'end', $lang["m_end"]);
+	$formPeriod2->addElement('button', "endD", $lang['modify'], array("onclick"=>"displayDatePicker('end')"));
+
+	$sub =& $formPeriod2->addElement('submit', 'submit', $lang["m_view"]);
+	$res =& $formPeriod2->addElement('reset', 'reset', $lang["reset"]);
+
+if(!is_null($mhost))
+{
+
+
+// parser que pour l'host demandé
+function parseFile($file,$end_time, $mhost){
+	$start_time = 0;
+	$log = NULL;
+	$matches = "";
+
+	if (file_exists($file) && !($log = fopen($file, "r")))
+		echo "pel_cant_open" . $file . "<br>";
+	$tab_log = array();	
+	$tab_svc_log = array();
+	$tablist = array();
+	$res1 = array();	
+
+	if ($log)
+		for ($a=0, $b= 0, $i = 0; $str = fgets($log); $i++){
+			if (preg_match("/^\[([0-9]*)\] (.+)/", $str, $matches)){				
+				$time_event = $matches[1];
+				$res = preg_split("/:/", $matches[2], 2);
+			if (isset($res[1]))
+				$res1 = preg_split("/;/", $res[1]);
+			$type = $res[0];
+				array_walk($res1, 'trim_value');
+			#
+			## find the log's start time
+			#
+			if ($i == 0)// take start time
+			$start_time = $time_event;
+			if (!strncmp($type, "LOG ROTATION", 12))
+			{
+					$start_time = $time_event;
+			}
+			else if (!strncmp($type, "CURRENT HOST STATE", 18) || !strncmp($type, "INITIAL HOST STATE", 18)){
+				$tablist[$res1[0]] = array();
+				$tablist[$res1[0]]["current_time"] = $start_time;
+				$tablist[$res1[0]]["current_state"] = $res1[1];
+				$tablist[$res1[0]]["timeUP"] = 0;
+				$tablist[$res1[0]]["timeDOWN"] = 0;
+				$tablist[$res1[0]]["timeUNREACHABLE"] = 0;
+				$tablist[$res1[0]]["timeNONE"] = 0;
+				$tablist[$res1[0]]["start_time"] = $start_time;
+				$tablist[$res1[0]]["tab_svc_log"] = array();
+
+				if($res1[0] == $mhost)
+					$tab_log[$a++] = getLogData($time_event, $res1[0], "", $res1[1], $res1[4], $type);
+				
+			}
+			if (!strncmp($type, "CURRENT SERVICE STATE", 21) || !strncmp($type, "INITIAL SERVICE STATE", 21))
+			{
+				$tablist[$res1[0]]["tab_svc_log"][$res1[1]] = array();
+				$tab_tmp = array();
+				$tab_tmp["current_state"] = $res1[2];
+				$tab_tmp["current_time"] = $start_time;
+				$tab_tmp["timeOK"] = 0;
+				$tab_tmp["timeWARNING"] = 0;
+				$tab_tmp["timeUNKNOWN"] = 0;
+				$tab_tmp["timeCRITICAL"] = 0;
+				$tab_tmp["timeNONE"] = 0;
+				$tab_tmp["service_id"] = getMyServiceID($res1[1],getMyHostID($res1[0]));				
+				$tablist[$res1[0]]["tab_svc_log"][$res1[1]] = $tab_tmp;
+			}
+			#
+			## host
+			#
+			if (!strncmp($type, "HOST ALERT", 10) )
+			{
+				if(!isset($tablist[$res1[0]]))
+				{
+					$tablist[$res1[0]] = array();
+					$tablist[$res1[0]]["current_time"] = $start_time;
+					$tablist[$res1[0]]["current_state"] = "NONE";
+					$tablist[$res1[0]]["timeUP"] = 0;
+					$tablist[$res1[0]]["timeDOWN"] = 0;
+					$tablist[$res1[0]]["timeUNREACHABLE"] = 0;
+					$tablist[$res1[0]]["timeNONE"] = 0;
+					$tablist[$res1[0]]["start_time"] = $start_time;
+					$tablist[$res1[0]]["tab_svc_log"] = array();
+				}						
+				if(!strncmp($tablist[$res1[0]]["current_state"], "UP", 2))
+				$tablist[$res1[0]]["timeUP"] += ($time_event-$tablist[$res1[0]]["current_time"]);
+				elseif(!strncmp($tablist[$res1[0]]["current_state"], "DOWN", 4))
+				$tablist[$res1[0]]["timeDOWN"] += ($time_event-$tablist[$res1[0]]["current_time"]);
+				elseif(!strncmp($tablist[$res1[0]]["current_state"], "UNREACHABLE", 11))
+				$tablist[$res1[0]]["timeUNREACHABLE"] += ($time_event-$tablist[$res1[0]]["current_time"]);
+				else				
+				$tablist[$res1[0]]["timeNONE"] += ($time_event-$tablist[$res1[0]]["current_time"]);
+
+				if($res1[0] == $mhost)
+					$tab_log[$a++] = getLogData($time_event, $res1[0], "", $res1[1], $res1[4], $type);
+
+				$tablist[$res1[0]]["current_state"] = $res1[1];
+				$tablist[$res1[0]]["current_time"] = $time_event; //save time
+			}
+			#
+			## services associed
+			#
+			else if (!strncmp($type, "SERVICE ALERT", 13))
+			{
+				if(isset($tablist[$res1[0]]["tab_svc_log"][$res1[1]]))
+				{
+					$tab_tmp = array();
+					$tab_tmp = $tablist[$res1[0]]["tab_svc_log"][$res1[1]];
+					if(!strncmp($tab_tmp["current_state"], "OK", 2))
+						$tab_tmp["timeOK"] += ($time_event-$tab_tmp["current_time"]);
+					elseif(!strncmp($tab_tmp["current_state"], "WARNING", 7))
+						$tab_tmp["timeWARNING"] += ($time_event-$tab_tmp["current_time"]);
+					elseif(!strncmp($tab_tmp["current_state"], "UNKNOWN", 7))
+						$tab_tmp["timeUNKNOWN"] += ($time_event-$tab_tmp["current_time"]);
+					elseif(!strncmp($tab_tmp["current_state"], "CRITICAL", 8))
+						$tab_tmp["timeCRITICAL"] += ($time_event-$tab_tmp["current_time"]);
+					else
+						$tab_tmp["timeNONE"] += ($time_event-$tab_tmp["current_time"]);
+					$tab_tmp["current_time"] = $time_event; //save time
+					$tab_tmp["current_state"] = $res1[2]; //save time
+					$tablist[$res1[0]]["tab_svc_log"][$res1[1]] = $tab_tmp;
+				}
+			}
+		}
+	}
+	$tablist["time_start"] = $start_time;
+	$tablist["tab_log"] = $tab_log;
+	return($tablist);
+}
+
+
+#
+## if today is include in the time period
+#
+$tab_log = array();
+
+if($start_date_day < ($end_date_select))
+{
+
+	#
+	## ?????????log path ??????????????
+	#
+	$tmp = "/var/log/nagios/nagios.log";
+	$tab = parseFile($tmp,time(), $mhost);
+	
+	
+	
+	$time_start = $tab["time_start"];
+	$tab_log = $tab["tab_log"];
+	foreach($tab as $host => $htab)
+	{
+		if ($host == $mhost)
+		{
+			#
+			## last host alert
+			#
+			if(!strncmp($htab["current_state"], "UP", 2))
+				$htab["timeUP"] += ($end_date_select-$htab["current_time"]);
+			elseif(!strncmp($htab["current_state"], "DOWN", 4))
+				$htab["timeDOWN"] += ($end_date_select-$htab["current_time"]);
+			elseif(!strncmp($htab["current_state"], "UNREACHABLE", 11))
+				$htab["timeUNREACHABLE"] += ($end_date_select-$htab["current_time"]);
+			else
+				$htab["timeNONE"] += ($end_date_select-$htab["current_time"]);
+				
+			#
+			## add log day
+			#		
+			$Tup += $htab["timeUP"];
+			$Tdown += $htab["timeDOWN"];
+			$Tunreach += $htab["timeUNREACHABLE"];
+			$Tnone += (($end_date_select - $start_date_select) - ($Tup + $Tdown + $Tunreach));
+			$tab_svc =array();
+			$i = 0;			
+			while (list($key, $value) = each($htab["tab_svc_log"])) {
+				$tab_tmp = $value;
+				$tab_tmp["svcName"] = $key;
+				if(!strncmp($tab_tmp["current_state"], "OK", 2))
+					$tab_tmp["timeOK"] += (time()-$tab_tmp["current_time"]);
+				elseif(!strncmp($tab_tmp["current_state"], "WARNING", 7))
+					$tab_tmp["timeWARNING"] += (time()-$tab_tmp["current_time"]);
+				elseif(!strncmp($tab_tmp["current_state"], "UNKNOWN", 7))
+					$tab_tmp["timeUNKNOWN"] += (time()-$tab_tmp["current_time"]);
+				elseif(!strncmp($tab_tmp["current_state"], "CRITICAL", 8))
+					$tab_tmp["timeCRITICAL"] += (time()-$tab_tmp["current_time"]);
+				else
+					$tab_tmp["timeNONE"] += (time()-$tab_tmp["current_time"]);	
+						
+				$tt = $end_date_select - $start_date_select;
+				$svc_id = $tab_tmp["service_id"];				
+				$archive_svc_ok =  isset($tab_svc_bdd[$svc_id]["Tok"]) ? $tab_svc_bdd[$svc_id]["Tok"] : 0;
+				$archive_svc_warn = isset($tab_svc_bdd[$svc_id]["Twarn"]) ? $tab_svc_bdd[$svc_id]["Twarn"] : 0;
+				$archive_svc_unknown = isset($tab_svc_bdd[$svc_id]["Tunknown"]) ? $tab_svc_bdd[$svc_id]["Tunknown"] : 0;
+				$archive_svc_cri = isset($tab_svc_bdd[$svc_id]["Tcri"]) ? $tab_svc_bdd[$svc_id]["Tcri"] : 0;
+				$tab_tmp["PtimeOK"] = round(($archive_svc_ok +$tab_tmp["timeOK"]) / $tt *100,3);
+				$tab_tmp["PtimeWARNING"] = round(($archive_svc_warn+$tab_tmp["timeWARNING"]) / $tt *100,3);
+				$tab_tmp["PtimeUNKNOWN"] = round(($archive_svc_unknown+$tab_tmp["timeUNKNOWN"]) / $tt *100,3);
+				$tab_tmp["PtimeCRITICAL"] = round(($archive_svc_cri+$tab_tmp["timeCRITICAL"]) / $tt *100,3);
+				$tab_tmp["PtimeNONE"] = round( ( $tt - (($archive_svc_ok+$tab_tmp["timeOK"]) 
+													 + ($archive_svc_warn+$tab_tmp["timeWARNING"])
+													 + ($archive_svc_unknown+$tab_tmp["timeUNKNOWN"])
+													 + ($archive_svc_cri+$tab_tmp["timeCRITICAL"])))  / $tt *100,3);				
+				$tab_svc[$i++] = $tab_tmp;
+			}
+		}
+	}
+}
+else // today is not in the period
+{
+	$i=0;
+	foreach($tab_svc_bdd as $svc_id => $tab)
+	{
+		$tab_tmp = array();
+		$tab_tmp["svcName"] = getMyServiceName($svc_id);
+		$tt = $end_date_select - $start_date_select;
+		$tab_tmp["PtimeOK"] = round($tab["Tok"] / $tt *100,3);
+		$tab_tmp["PtimeWARNING"] = round( $tab["Twarn"]/ $tt *100,3);
+		$tab_tmp["PtimeUNKNOWN"] = round( $tab["Tunknown"]/ $tt *100,3);
+		$tab_tmp["PtimeCRITICAL"] = round( $tab["Tcri"]/ $tt *100,3);
+		$tab_tmp["PtimeNONE"] = round( ( $tt - ($tab["Tok"] + $tab["Twarn"] + $tab["Tunknown"] + $tab["Tcri"])
+											 )  / $tt *100,3);
+
+		$tab_svc[$i++] = $tab_tmp;
+	}
+}
+#
+## calculate host %
+#
+$tab_resume = array();
+$tab = array();
+$timeTOTAL = $end_date_select - $start_date_select;
+$Tnone = $timeTOTAL - ($Tup + $Tdown + $Tunreach);
+if($Tnone < 0)
+$Tnone = 0;
+
+
+$tab["state"] = $lang["m_UpTitle"];
+$tab["time"] = Duration::toString($Tup);
+$tab["pourcentTime"] = round($Tup/$timeTOTAL*100,2);
+$tab["pourcentkTime"] = round($Tup/$timeTOTAL*100,2);
+$tab["style"] = "class='ListColCenter' style='background:" . $oreon->optGen["color_up"]."'";
+$tab_resume[0] = $tab;
+
+$tab["state"] = $lang["m_DownTitle"];
+$tab["time"] = Duration::toString($Tdown);
+$tab["pourcentTime"] = round($Tdown/$timeTOTAL*100,2);
+$tab["pourcentkTime"] = round($Tdown/$timeTOTAL*100,2);
+$tab["style"] = "class='ListColCenter' style='background:" . $oreon->optGen["color_down"]."'";
+$tab_resume[1] = $tab;
+
+$tab["state"] = $lang["m_UnreachableTitle"];
+$tab["time"] = Duration::toString($Tunreach);
+$tab["pourcentTime"] = round($Tunreach/$timeTOTAL*100,2);
+$tab["pourcentkTime"] = round($Tunreach/$timeTOTAL*100,2);
+$tab["style"] = "class='ListColCenter' style='background:" . $oreon->optGen["color_unreachable"]."'";
+$tab_resume[2] = $tab;
+
+$tab["state"] = $lang["m_PendingTitle"];
+$tab["time"] = Duration::toString($Tnone);
+$tab["pourcentTime"] = round($Tnone/$timeTOTAL*100,2);
+$tab["pourcentkTime"] = round($Tnone/$timeTOTAL*100,2);
+$tab["style"] = "class='ListColCenter' style='background:" . $oreon->optGen["color_unknown"]."'";
+$tab_resume[3] = $tab;
+
+
+	$start_date_select = date("d/m/Y G:i:s", $start_date_select);
+	$end_date_select =  date("d/m/Y G:i:s", $end_date_select);
+
+	$tpl->assign('host_name', $mhost);		
+	$status = "";
+	foreach ($tab_resume  as $tb)
+		if($tb["pourcentTime"] > 0)
+			$status .= "&value[".$tb["state"]."]=".$tb["pourcentTime"];  
+        
+	$tpl->assign('status', $status);		
+	$tpl->assign("tab_resume", $tab_resume);
+	if(isset($tab_svc))
+	$tpl->assign("tab_svc", $tab_svc);		
+	$tpl->assign("tab_log", $tab_log);
+	$tpl->assign('infosTitle', $start_date_select." -> ".$end_date_select."<br><br>");		
+}## end of period requirement
+
+	$tpl->assign('style_ok', "class='ListColCenter' style='background:" . $oreon->optGen["color_up"]."'");
+	$tpl->assign('style_warning' , "class='ListColCenter' style='background:" . $oreon->optGen["color_warning"]."'");
+	$tpl->assign('style_critical' , "class='ListColCenter' style='background:" . $oreon->optGen["color_critical"]."'");
+	$tpl->assign('style_unknown' , "class='ListColCenter' style='background:" . $oreon->optGen["color_unknown"]."'");
+	$tpl->assign('style_pending' , "class='ListColCenter' style='background:" . $oreon->optGen["color_pending"]."'");
+
+
+	$tpl->assign('serviceTilte', $lang["m_serviceTilte"]);
+	$tpl->assign('OKTitle', $lang["m_OKTitle"]);
+	$tpl->assign('WarningTitle', $lang["m_WarningTitle"]);
+	$tpl->assign('UnknownTitle', $lang["m_UnknownTitle"]);
+	$tpl->assign('CriticalTitle', $lang["m_CriticalTitle"]);
+	$tpl->assign('PendingTitle', $lang["m_PendingTitle"]);
+
+	$tpl->assign('StateTitle', $lang["m_StateTitle"]);
+	$tpl->assign('TimeTitle', $lang["m_TimeTitle"]);
+	$tpl->assign('TimeTotalTitle', $lang["m_TimeTotalTitle"]);
+	$tpl->assign('KnownTimeTitle', $lang["m_KnownTimeTitle"]);
+			
+	$tpl->assign('DateTitle', $lang["m_DateTitle"]);
+	$tpl->assign('EventTitle', $lang["m_EventTitle"]);
+	$tpl->assign('HostTitle', $lang["m_HostTitle"]);
+	$tpl->assign('InformationsTitle', $lang["m_InformationsTitle"]);
+			
+	$tpl->assign('periodTitle', $lang["m_selectPeriodTitle"]);
+	$tpl->assign('resumeTitle', $lang["m_hostResumeTitle"]);
+	$tpl->assign('logTitle', $lang["m_hostLogTitle"]);
+	$tpl->assign('svcTitle', $lang["m_hostSvcAssocied"]);
+
+
+	$renderer1 =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$formPeriod1->accept($renderer1);
+	$tpl->assign('formPeriod1', $renderer1->toArray());	
+	$renderer2 =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$formPeriod2->accept($renderer2);	
+	$tpl->assign('formPeriod2', $renderer2->toArray());
+
+
+	#Apply a template definition
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$formHost->accept($renderer);
+	$tpl->assign('formHost', $renderer->toArray());
+
+
+	$tpl->assign('lang', $lang);
+	$tpl->assign("p", $p);
+	$tpl->display("viewHostLog.ihtml");
+
+
+?>
\ No newline at end of file
diff --git a/www/include/reporting/viewServicesLog.ihtml b/www/include/reporting/viewServicesLog.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..84bae3c72d3aca5b00af0b0e03d4e73dcc91281f
--- /dev/null
+++ b/www/include/reporting/viewServicesLog.ihtml
@@ -0,0 +1,125 @@
+<script language='javascript' src='./include/common/javascript/datePicker.js'></script>
+<link href="./include/common/javascript/datePicker.css" rel="stylesheet" type="text/css"/>
+{$form.javascript}
+<script type="text/javascript" src="include/configuration/changetab.js"></script>
+
+
+
+
+
+<table style='width:100%'>
+<tr>
+	<td  rowspan=3 style='width:300px; padding:5px'>
+
+				<table class="ListTable" >
+					<tr class='ListHeader'>
+						<td class="ListColHeaderCenter"></td>
+					</tr>
+					<tr>
+						<td class='list_one'>
+						{$infosTitle}
+						</td>
+					</tr>
+					<tr class='list_one'>
+						<td class="ListColCenter"><img src='./include/reporting/generateImages/pie_chart_service.php?service_name={$service_name}&host_name={$host_name}{$status}'></td>					
+					</tr>
+				</table>
+	</td>
+
+</tr>
+
+<tr>
+<td style=' padding:5px;'>
+
+	<table class="ListTable" >
+		<tr class='ListHeader'>
+			<td colspan=4>{$periodTitle}</td>
+		</tr>	
+		<tr class='list_lvl_1'>
+			<td colspan=2 & class="ListColHeaderLeft">{$formPeriod1.header.title}</td>
+		</tr>
+        <tr class="list_one">
+	        <td colspan=2>
+		        <form {$formPeriod1.attributes}>
+		        	{$formPeriod1.period.label}{$formPeriod1.period.html}
+		        	
+		        		{$formPeriod1.hidden}
+				</form>
+	        </td>
+        </tr>
+		<tr class='list_lvl_1' >
+			<td  colspan=2 class="ListColHeaderLeft">{$formPeriod2.header.title}</td>
+		</tr>
+
+		<tr class="list_two">
+			<td>	        <form {$formPeriod2.attributes}>			
+			{$formPeriod2.start.label}</td>
+			<td>{$formPeriod2.start.html}&nbsp;&nbsp;{$formPeriod2.startD.html}</td>
+		</tr>
+		<tr class="list_one">
+			<td>{$formPeriod2.end.label}</td>
+			<td>{$formPeriod2.end.html}&nbsp;&nbsp;{$formPeriod2.endD.html}</td>
+		</tr>
+		<tr class="list_one">
+			<td colspan=2>{$formPeriod2.submit.html}&nbsp;&nbsp;&nbsp;&nbsp;{$formPeriod2.reset.html}
+	        		{$formPeriod2.hidden}
+			</form>
+			</td>
+		</tr>
+	</table>
+
+</td>
+</tr>
+<tr>
+<td style='vertical-align:top;padding:5px;'>
+	<table class="ListTable">
+		<tr class='ListHeader'>
+			<td colspan=4>{$resumeTitle}</td>
+		</tr>
+		<tr class='list_lvl_1'>
+			<td class="ListColHeaderCenter">{$StateTitle}</td>
+			<td class="ListColHeaderCenter">{$TimeTitle}</td>
+			<td class="ListColHeaderCenter">{$TimeTotalTitle}</td>
+			<td class="ListColHeaderCenter">{$KnownTimeTitle}</td>
+		</tr>
+		{foreach item=tb from=$tab_resume}
+		<tr class={cycle values="list_two, list_one"}>
+			<td {$tb.style}>{$tb.state}</td>
+			<td {$tb.style} >{$tb.time}</td>
+			<td {$tb.style}>{$tb.pourcentTime}</td>
+			<td {$tb.style}>{$tb.pourcentkTime}</td>
+		</tr>
+		{/foreach}
+	</table>
+</td>
+</tr>
+
+
+<tr>
+<td colspan=2 style=' padding:5px;'>
+	<table class="ListTable" class="left">
+		<tr class='ListHeader'>
+			<td class="FormHeader"colspan=5>{$logTitle}</td>
+		</tr>
+		<tr class='list_lvl_1'>
+			<td class="ListColHeaderCenter">&nbsp;</td>
+			<td class="ListColHeaderCenter">{$DateTitle}</td>
+			<td class="ListColHeaderCenter">{$EventTitle}</td>
+			<td class="ListColHeaderCenter">{$HostTitle}</td>
+			<td class="ListColHeaderCenter">{$InformationsTitle}</td>
+		</tr>
+		{foreach item=tb from=$tab_log}
+		{if $tb.type eq "HOST ALERT" or $tb.type eq "CURRENT HOST STATE"}
+		<tr class={cycle values="list_two, list_one"}>
+			<td class="ListColHeaderCenter"><img src={$tb.img}></td>
+			<td class="ListColLeft">{$tb.time}</td>
+			<td class="ListColLeft">{$tb.status}</td>
+			<td class="ListColLeft">{$tb.host}</td>
+			<td class="ListColNoWrap">{$tb.output}</td>
+		</tr>
+		{/if}
+		{/foreach}
+	</table>
+</td></tr>
+</table>
+
diff --git a/www/include/reporting/viewServicesLog.php b/www/include/reporting/viewServicesLog.php
new file mode 100644
index 0000000000000000000000000000000000000000..540579645e884b10590d3fef2a8df16352206545
--- /dev/null
+++ b/www/include/reporting/viewServicesLog.php
@@ -0,0 +1,600 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf - Cedrick Facon
+
+Adapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function my_getTimeTamps($dateSTR)
+	{
+		list($m,$d,$y) = split('/',$dateSTR);
+		return (mktime(0,0,0,$m,$d,$y));
+	}
+	function trim_value(&$value)
+	{
+	   $value = trim($value);
+	}
+	function getLogData($time_event, $host, $service, $status, $output, $type){
+		global $lang;
+		$tab_img = array("UP" => './img/icones/12x12/recovery.gif',
+						"DOWN" => './img/icones/12x12/alert.gif',
+						"UNREACHABLE" => './img/icones/12x12/queue.gif',
+						"NONE" => './img/icones/12x12/info.gif',
+						);
+		$tab["time"] = date($lang["header_format"], $time_event);
+		$tab["timeb"] = $time_event;
+		$tab["host"] = $host;
+		$tab["service"] = $service;
+		$tab["status"] = $status;
+		$tab["output"] = $output;
+		$tab["type"] = $type;
+		$tab["img"] = $tab_img[$status];		
+		return $tab ;
+	}
+		
+	isset ($_GET["host"]) ? $mhost = $_GET["host"] : $mhost = NULL;
+	isset ($_POST["host"]) ? $mhost = $_POST["host"] : $mhost = $mhost;
+
+	isset ($_GET["service"]) ? $mservice = $_GET["service"] : $mservice = NULL;
+	isset ($_POST["service"]) ? $mservice = $_POST["service"] : $mservice = $mservice;
+
+	require_once './class/other.class.php';
+	require_once './include/common/common-Func.php';
+	include("./include/monitoring/log/choose_log_file.php");
+
+	$day = date("d",time());
+	$year = date("Y",time());
+	$month = date("m",time());
+	$hour = date("G",time());
+	$minute = date("i",time());
+	$second = date("s",time());
+	$start_date_day = mktime(0, 0, 0, $month, $day, $year);
+	if(isset($_POST["period"]))
+	{
+		if($_POST["period"] == "today")
+		{
+			$start_date_select = mktime(0, 0, 0, $month, $day, $year);
+			$end_date_select = time();
+		}
+		else if($_POST["period"] == "last24hours")
+		{
+			$start_date_select = time() - (24*60*60);
+			$end_date_select = time();
+		}
+		else if($_POST["period"] == "yesterday")
+		{
+			$start_date_select = mktime(0, 0, 0, $month, $day-1, $year);
+			$end_date_select = mktime(0, 0, 0, $month, $day, $year);
+		}
+		else if($_POST["period"] == "thisweek")//a fair
+		{
+			$dd = (date("D",mktime(0, 0, 0, $month, $day, $year)));
+			for($ct = 1; $dd != "Mon" ;$ct++)
+				$dd = (date("D",mktime(0, 0, 0, $month, ($day-$ct), $year)));
+			$start_date_select = mktime(0, 0, 0, $month, $day-$ct, $year);
+			$end_date_select = time();
+		}
+		else if($_POST["period"] == "last7days")
+		{
+			$start_date_select = mktime($hour, $minute, $second, $month, $day-7, $year);
+			$end_date_select = mktime($hour, $minute, $second, $month, $day, $year);
+		}
+		else if($_POST["period"] == "last30days")// attention au 31
+		{
+			$start_date_select = mktime($hour, $minute, $second, $month, $day-30, $year);
+			$end_date_select = mktime($hour, $minute, $second, $month, $day, $year);
+		}
+		else if($_POST["period"] == "lastyear")// attention au 31
+		{
+			$start_date_select = mktime(23, 59, 60, 12, 31, $year-1);
+			$end_date_select = mktime(23, 59, 60, 12, 31, $year);
+		}
+		else if($_POST["period"] == "thismonth")
+		{
+			$start_date_select = mktime(0, 0, 0, $month, 0, $year);
+			$end_date_select = mktime($hour, $minute, $second, $month, $day, $year);
+		}
+		else if($_POST["period"] == "thisyear")
+		{
+			$start_date_select = mktime(0, 0, 0, 0, 0, $year);
+			$end_date_select = mktime($hour, $minute, $second, $month, $day, $year);
+		}
+		else // lastmonth
+		{
+			$start_date_select = mktime(23, 59, 60, $month-1, 0, $year);
+			$end_date_select = mktime(23, 59, 60, $month, 0, $year);
+		}		
+	}
+		else
+		{
+			$start_date_select = mktime(0, 0, 0, $month, $day, $year);
+			$end_date_select = time();
+		}
+
+	if(isset($_POST["end"]) && isset($_POST["start"]))
+	{
+		if(!$_POST["end"])
+			$end = time();
+		else
+			$end = my_getTimeTamps($_POST["end"]);
+			
+		$endday = date("d",$end);
+		$endyear = date("Y",$end);
+		$endmonth = date("m",$end);
+		$endhour = date("G",$end);
+		$endminute = date("i",$end);
+		$endsecond = date("s",$end);
+		$end_date_select = mktime(23, 59, 59, $endmonth, $endday, $endyear);
+		if(!$_POST["start"])
+			$start = mktime(0, 0, 0, $endmonth, $endday, $endyear);
+		else
+			$start = my_getTimeTamps($_POST["start"]);
+		$start_date_select = $start;
+	}
+
+	$host_id = getMyHostID($mhost);
+	$service_id = getMyServiceID($mservice, $host_id);
+
+//echo $service_id . "**<br>";
+
+
+#
+## recupere les log host en base
+#
+$rq = 'SELECT ' .
+	'sum(UPTimeScheduled)' .
+	' as Tup,' .				
+	'sum(DOWNTimeScheduled)' .
+	' as Tdown,' .
+	'sum(UNREACHABLETimeScheduled)' .
+	' as Tunreach, ' .				
+	'sum(UNDETERMINATETimeScheduled)' .
+	' as Tnone, ' .
+	'min(date_start) as log_date_start,' .
+	'max(date_end) as log_date_end,' .
+	'sum(UNREACHABLETimeScheduled) as unreach FROM `log_archive_host` WHERE host_id = ' . $host_id  .
+	' AND date_start >=  ' . $start_date_select .
+	' AND date_end <= ' . $end_date_select;
+
+	$res = & $pearDB->query($rq);
+	if (PEAR::isError($res)){
+	  die($res->getMessage());
+	} else {
+	  while ($h =& $res->fetchRow()){
+
+	$Tup = 0 + $h["Tup"];
+	$Tdown = 0 + $h["Tdown"];
+	$Tunreach = 0 + $h["Tunreach"];
+	$Tnone = 0 + $h["Tnone"];
+	
+	  }
+	}
+#
+## recupere les log svc en base
+#
+$rq = 'SELECT ' .
+	'sum(OKTimeScheduled)' .
+	' as Tok,' .				
+	'sum(WARNINGTimeScheduled)' .
+	' as Twarn,' .
+	'sum(UNKNOWNTimeScheduled)' .
+	' as Tunknown, ' .				
+	'sum(UNDETERMINATETimeScheduled)' .
+	' as Tnone, ' .
+	'sum(CRITICALTimeScheduled)' .
+	' as Tcri, ' .
+	'min(date_start) as log_date_start,' .
+	'max(date_end) as log_date_end' .
+	' FROM `log_archive_service` WHERE host_id = ' . $host_id  .
+	' AND service_id =  ' . $service_id .
+	' AND date_start >=  ' . $start_date_select .
+	' AND date_end <= ' . $end_date_select;
+
+	$res = & $pearDB->query($rq);
+	$tab_svc_bdd = array();
+	if (PEAR::isError($res)){
+	  die($res->getMessage());
+	} else { 
+	  while ($s =& $res->fetchRow()){
+		$tab_svc_bdd["Tok"] = 0 + $s["Tok"];
+		$tab_svc_bdd["Twarn"] = 0 + $s["Twarn"];
+		$tab_svc_bdd["Tunknown"] = 0 + $s["Tunknown"];
+		$tab_svc_bdd["Tnone"] = 0 + $s["Tnone"];
+		$tab_svc_bdd["Tcri"] = 0 + $s["Tcri"];
+		
+		
+	  }
+	}
+
+	#
+	## fourchette de temps
+	#	
+	$period["today"] = "Today";
+	$period["last24hours"] = "Last 24 Hours";
+	$period["yesterday"] = "Yesterday";
+	$period["thisweek"] = "This Week";
+	$period["last7days"] = "Last 7 Days";
+	$period["thismonth"] = "This Month";
+	$period["last30days"] = "Last 30 Days";
+	$period["lastmonth"] = "Last Month";
+	$period["thisyear"] = "This Year";
+	$period["lastyear"] = "Last Year";
+
+
+	$formPeriod1 = new HTML_QuickForm('FormPeriod1', 'post', "?p=".$p);
+
+	isset($mhost) ? $formPeriod1->addElement('hidden', 'host', $mhost) : NULL;
+	isset($mservice) ? $formPeriod1->addElement('hidden', 'service', $mservice) : NULL;
+	
+	$formPeriod1->addElement('header', 'title', $lang["m_predefinedPeriod"]);
+	$selHost =& $formPeriod1->addElement('select', 'period', $lang["m_predefinedPeriod"], $period, array("onChange" =>"this.form.submit();"));	
+
+
+	$formPeriod2 = new HTML_QuickForm('FormPeriod2', 'post', "?p=".$p);
+	isset($mhost) ? $formPeriod2->addElement('hidden', 'host', $mhost) : NULL;
+	isset($mservice) ? $formPeriod2->addElement('hidden', 'service', $mservice) : NULL;
+	$formPeriod2->addElement('header', 'title', $lang["m_customizedPeriod"]);
+	$formPeriod2->addElement('text', 'start', $lang["m_start"]);
+	$formPeriod2->addElement('button', "startD", $lang['modify'], array("onclick"=>"displayDatePicker('start')"));
+	$formPeriod2->addElement('text', 'end', $lang["m_end"]);
+	$formPeriod2->addElement('button', "endD", $lang['modify'], array("onclick"=>"displayDatePicker('end')"));
+
+	$sub =& $formPeriod2->addElement('submit', 'submit', $lang["m_view"]);
+	$res =& $formPeriod2->addElement('reset', 'reset', $lang["reset"]);
+
+
+
+
+// parser que pour l'host demandé
+function parseFile($file,$end_time){
+	$start_time = 0;
+	$log = NULL;
+	$matches = "";
+
+	if (file_exists($file) && !($log = fopen($file, "r")))
+		echo "pel_cant_open" . $file . "<br>";
+	$tab_log = array();	
+	$tab_svc_log = array();
+	$tablist = array();
+	$res1 = array();	
+
+	if ($log)
+		for ($a=0, $b= 0, $i = 0; $str = fgets($log); $i++){
+			if (preg_match("/^\[([0-9]*)\] (.+)/", $str, $matches)){				
+				$time_event = $matches[1];
+				$res = preg_split("/:/", $matches[2], 2);
+			if (isset($res[1]))
+				$res1 = preg_split("/;/", $res[1]);
+			$type = $res[0];
+				array_walk($res1, 'trim_value');
+			#
+			## find the log's start time
+			#
+			if ($i == 0)// take start time
+			$start_time = $time_event;
+			if (!strncmp($type, "LOG ROTATION", 12))
+			{
+					$start_time = $time_event;
+			}
+			else if (!strncmp($type, "CURRENT HOST STATE", 18) || !strncmp($type, "INITIAL HOST STATE", 18)){
+				$tablist[$res1[0]] = array();
+				$tablist[$res1[0]]["current_time"] = $start_time;
+				$tablist[$res1[0]]["current_state"] = $res1[1];
+				$tablist[$res1[0]]["timeUP"] = 0;
+				$tablist[$res1[0]]["timeDOWN"] = 0;
+				$tablist[$res1[0]]["timeUNREACHABLE"] = 0;
+				$tablist[$res1[0]]["timeNONE"] = 0;
+				$tablist[$res1[0]]["start_time"] = $start_time;
+				$tablist[$res1[0]]["tab_svc_log"] = array();
+			}
+			if (!strncmp($type, "CURRENT SERVICE STATE", 21) || !strncmp($type, "INITIAL SERVICE STATE", 21))
+			{
+				$tablist[$res1[0]]["tab_svc_log"][$res1[1]] = array();
+				$tab_tmp = array();
+				$tab_tmp["current_state"] = $res1[2];
+				$tab_tmp["current_time"] = $start_time;
+				$tab_tmp["timeOK"] = 0;
+				$tab_tmp["timeWARNING"] = 0;
+				$tab_tmp["timeUNKNOWN"] = 0;
+				$tab_tmp["timeCRITICAL"] = 0;
+				$tab_tmp["timeNONE"] = 0;
+				$tab_tmp["service_id"] = getMyServiceID($res1[1],getMyHostID($res1[0]));				
+				$tablist[$res1[0]]["tab_svc_log"][$res1[1]] = $tab_tmp;
+			}
+			#
+			## host
+			#
+			if (!strncmp($type, "HOST ALERT", 10) )
+			{
+				if(!isset($tablist[$res1[0]]))
+				{
+					$tablist[$res1[0]] = array();
+					$tablist[$res1[0]]["current_time"] = $start_time;
+					$tablist[$res1[0]]["current_state"] = "NONE";
+					$tablist[$res1[0]]["timeUP"] = 0;
+					$tablist[$res1[0]]["timeDOWN"] = 0;
+					$tablist[$res1[0]]["timeUNREACHABLE"] = 0;
+					$tablist[$res1[0]]["timeNONE"] = 0;
+					$tablist[$res1[0]]["start_time"] = $start_time;
+					$tablist[$res1[0]]["tab_svc_log"] = array();
+				}						
+				if(!strncmp($tablist[$res1[0]]["current_state"], "UP", 2))
+				$tablist[$res1[0]]["timeUP"] += ($time_event-$tablist[$res1[0]]["current_time"]);
+				elseif(!strncmp($tablist[$res1[0]]["current_state"], "DOWN", 4))
+				$tablist[$res1[0]]["timeDOWN"] += ($time_event-$tablist[$res1[0]]["current_time"]);
+				elseif(!strncmp($tablist[$res1[0]]["current_state"], "UNREACHABLE", 11))
+				$tablist[$res1[0]]["timeUNREACHABLE"] += ($time_event-$tablist[$res1[0]]["current_time"]);
+				else				
+				$tablist[$res1[0]]["timeNONE"] += ($time_event-$tablist[$res1[0]]["current_time"]);
+				$tab_log[$a++] = getLogData($time_event, $res1[0], "", $res1[1], $res1[4], $type);
+				$tablist[$res1[0]]["current_state"] = $res1[1];
+				$tablist[$res1[0]]["current_time"] = $time_event; //save time
+			}
+			#
+			## services associed
+			#
+			else if (!strncmp($type, "SERVICE ALERT", 13))
+			{
+				if(isset($tablist[$res1[0]]["tab_svc_log"][$res1[1]]))
+				{
+					$tab_tmp = array();
+					$tab_tmp = $tablist[$res1[0]]["tab_svc_log"][$res1[1]];
+					if(!strncmp($tab_tmp["current_state"], "OK", 2))
+						$tab_tmp["timeOK"] += ($time_event-$tab_tmp["current_time"]);
+					elseif(!strncmp($tab_tmp["current_state"], "WARNING", 7))
+						$tab_tmp["timeWARNING"] += ($time_event-$tab_tmp["current_time"]);
+					elseif(!strncmp($tab_tmp["current_state"], "UNKNOWN", 7))
+						$tab_tmp["timeUNKNOWN"] += ($time_event-$tab_tmp["current_time"]);
+					elseif(!strncmp($tab_tmp["current_state"], "CRITICAL", 8))
+						$tab_tmp["timeCRITICAL"] += ($time_event-$tab_tmp["current_time"]);
+					else
+					{
+						echo "none: " . $tab_tmp["current_state"] . "<br>";
+						$tab_tmp["timeNONE"] += ($time_event-$tab_tmp["current_time"]);
+						
+					}						
+					$tab_tmp["current_time"] = $time_event; //save time
+					$tab_tmp["current_state"] = $res1[2]; //save time
+					$tablist[$res1[0]]["tab_svc_log"][$res1[1]] = $tab_tmp;
+				}
+			}
+		}
+	}
+	$tablist["time_start"] = $start_time;
+	$tablist["tab_log"] = $tab_log;
+	return($tablist);
+}
+
+
+#
+## if today is include in the time period
+#
+$tab_log = array();
+if((time() - (24*60*60)) < $end_date_select)
+{
+	#
+	## ?????????log path ??????????????
+	#
+	$tmp = "/var/log/nagios/nagios.log";
+	$tab = parseFile($tmp,time());
+	
+	
+	$time_start = $tab["time_start"];
+	$tab_log = $tab["tab_log"];
+	foreach($tab as $host => $htab)
+	{
+		if ($host == $mhost)
+		{
+			/*
+			#
+			## last host alert
+			#
+			if(!strncmp($htab["current_state"], "UP", 2))
+				$htab["timeUP"] += ($end_date_select-$htab["current_time"]);
+			elseif(!strncmp($htab["current_state"], "DOWN", 4))
+				$htab["timeDOWN"] += ($end_date_select-$htab["current_time"]);
+			elseif(!strncmp($htab["current_state"], "UNREACHABLE", 11))
+				$htab["timeUNREACHABLE"] += ($end_date_select-$htab["current_time"]);
+			else
+				$htab["timeNONE"] += ($end_date_select-$htab["current_time"]);
+				
+			#
+			## add log day
+			#		
+			$Tup += $htab["timeUP"];
+			$Tdown += $htab["timeDOWN"];
+			$Tunreach += $htab["timeUNREACHABLE"];
+			$Tnone += (($end_date_select - $start_date_select) - ($Tup + $Tdown + $Tunreach));
+			$tab_svc =array();
+			$i = 0;			
+			*/
+			while (list($key, $value) = each($htab["tab_svc_log"])) {
+				if($key == $mservice)
+				{
+					$tab_tmp = $value;
+					$tab_tmp["svcName"] = $key;
+					if(!strncmp($tab_tmp["current_state"], "OK", 2))
+						$tab_svc_bdd["Tok"] += (time()-$tab_tmp["current_time"]);
+					elseif(!strncmp($tab_tmp["current_state"], "WARNING", 7))
+						$tab_svc_bdd["Twarn"] += (time()-$tab_tmp["current_time"]);
+					elseif(!strncmp($tab_tmp["current_state"], "UNKNOWN", 7))
+						$tab_svc_bdd["Tunknown"]  += (time()-$tab_tmp["current_time"]);
+					elseif(!strncmp($tab_tmp["current_state"], "CRITICAL", 8))
+						$tab_svc_bdd["Tcri"] += (time()-$tab_tmp["current_time"]);
+					else
+						$tab_svc_bdd["Tnone"] += (time()-$tab_tmp["current_time"]);	
+				}
+			}
+		}
+	}
+}
+
+else // today is not in the period
+{
+	/*
+	$i=0;
+	foreach($tab_svc_bdd as $svc_id => $tab)
+	{
+		$tab_tmp = array();
+		$tab_tmp["svcName"] = getMyServiceName($svc_id);
+		$tt = $end_date_select - $start_date_select;
+		$tab_tmp["PtimeOK"] = round($tab["Tok"] / $tt *100,3);
+		$tab_tmp["PtimeWARNING"] = round( $tab["Twarn"]/ $tt *100,3);
+		$tab_tmp["PtimeUNKNOWN"] = round( $tab["Tunknown"]/ $tt *100,3);
+		$tab_tmp["PtimeCRITICAL"] = round( $tab["Tcri"]/ $tt *100,3);
+		$tab_tmp["PtimeNONE"] = round( ( $tt - ($tab["Tok"] + $tab["Twarn"] + $tab["Tunknown"] + $tab["Tcri"])
+											 )  / $tt *100,3);
+		$tab_svc[$i++] = $tab_tmp;
+	}
+	*/
+}
+
+
+#
+## calculate service  resume
+#
+$tab_resume = array();
+$tab = array();
+$timeTOTAL = $end_date_select - $start_date_select;
+
+/*
+$tab_svc_bdd["Tok"]
+		$tab_svc_bdd["Twarn"] 
+		$tab_svc_bdd["Tunknown"] 
+		$tab_svc_bdd["Tnone"] 
+		$tab_svc_bdd["Tcri"]
+*/
+
+$Tnone = $timeTOTAL - ($tab_svc_bdd["Tok"]
++ $tab_svc_bdd["Twarn"]
++$tab_svc_bdd["Tunknown"]
++$tab_svc_bdd["Tnone"]
++$tab_svc_bdd["Tcri"]);
+
+$tab["state"] = $lang["m_OKTitle"];
+$tab["time"] = Duration::toString($tab_svc_bdd["Tok"]);
+$tab["pourcentTime"] = round($tab_svc_bdd["Tok"]/$timeTOTAL*100,2);
+$tab["pourcentkTime"] = round($tab_svc_bdd["Tok"]/$timeTOTAL*100,2);
+$tab["style"] = "class='ListColCenter' style='background:" . $oreon->optGen["color_ok"]."'";
+$tab_resume[0] = $tab;
+
+$tab["state"] = $lang["m_WarningTitle"];
+$tab["time"] = Duration::toString($tab_svc_bdd["Twarn"]);
+$tab["pourcentTime"] = round($tab_svc_bdd["Twarn"]/$timeTOTAL*100,2);
+$tab["pourcentkTime"] = round($tab_svc_bdd["Twarn"]/$timeTOTAL*100,2);
+$tab["style"] = "class='ListColCenter' style='background:" . $oreon->optGen["color_warning"]."'";
+$tab_resume[1] = $tab;
+
+$tab["state"] = $lang["m_UnknownTitle"];
+$tab["time"] = Duration::toString($tab_svc_bdd["Tunknown"] );
+$tab["pourcentTime"] = round($tab_svc_bdd["Tunknown"] /$timeTOTAL*100,2);
+$tab["pourcentkTime"] = round($tab_svc_bdd["Tunknown"] /$timeTOTAL*100,2);
+$tab["style"] = "class='ListColCenter' style='background:" . $oreon->optGen["color_unknown"]."'";
+$tab_resume[2] = $tab;
+
+$tab["state"] = $lang["m_CriticalTitle"];
+$tab["time"] = Duration::toString($tab_svc_bdd["Tcri"]);
+$tab["pourcentTime"] = round($tab_svc_bdd["Tcri"]/$timeTOTAL*100,2);
+$tab["pourcentkTime"] = round($tab_svc_bdd["Tcri"]/$timeTOTAL*100,2);
+$tab["style"] = "class='ListColCenter' style='background:" . $oreon->optGen["color_critical"]."'";
+$tab_resume[3] = $tab;
+
+$tab["state"] = $lang["m_PendingTitle"];
+$tab["time"] = Duration::toString($Tnone);
+$tab["pourcentTime"] = round($Tnone/$timeTOTAL*100,2);
+$tab["pourcentkTime"] = round($Tnone/$timeTOTAL*100,2);
+$tab["style"] = "class='ListColCenter' style='background:" . $oreon->optGen["color_pending"]."'";
+$tab_resume[4] = $tab;
+
+
+$start_date_select = date("d/m/Y G:i:s", $start_date_select);
+$end_date_select =  date("d/m/Y G:i:s", $end_date_select);
+
+
+
+
+	$path = "./include/reporting/";
+	# Smarty template Init
+	$tpl =& new Smarty();
+	$tpl =& initSmartyTpl($path, $tpl, "");
+
+	$tpl->assign('o', $o);
+	
+
+	$tpl->assign('periodTitle', $lang["m_selectPeriodTitle"]);
+	$tpl->assign('resumeTitle', $lang["m_serviceResumeTitle"]);
+	$tpl->assign('logTitle', $lang["m_hostLogTitle"]);
+	$tpl->assign('svcTitle', $lang["m_hostSvcAssocied"]);
+	$tpl->assign('style_ok', "class='ListColCenter' style='background:" . $oreon->optGen["color_up"]."'");
+	$tpl->assign('style_warning' , "class='ListColCenter' style='background:" . $oreon->optGen["color_warning"]."'");
+	$tpl->assign('style_critical' , "class='ListColCenter' style='background:" . $oreon->optGen["color_critical"]."'");
+	$tpl->assign('style_unknown' , "class='ListColCenter' style='background:" . $oreon->optGen["color_unknown"]."'");
+	$tpl->assign('style_pending' , "class='ListColCenter' style='background:" . $oreon->optGen["color_pending"]."'");
+
+
+	$tpl->assign('serviceTilte', $lang["m_serviceTilte"]);
+	$tpl->assign('OKTitle', $lang["m_OKTitle"]);
+	$tpl->assign('WarningTitle', $lang["m_WarningTitle"]);
+	$tpl->assign('UnknownTitle', $lang["m_UnknownTitle"]);
+	$tpl->assign('CriticalTitle', $lang["m_CriticalTitle"]);
+	$tpl->assign('PendingTitle', $lang["m_PendingTitle"]);
+
+	$tpl->assign('StateTitle', $lang["m_StateTitle"]);
+	$tpl->assign('TimeTitle', $lang["m_TimeTitle"]);
+	$tpl->assign('TimeTotalTitle', $lang["m_TimeTotalTitle"]);
+	$tpl->assign('KnownTimeTitle', $lang["m_KnownTimeTitle"]);
+	$tpl->assign('DateTitle', $lang["m_DateTitle"]);
+	$tpl->assign('EventTitle', $lang["m_EventTitle"]);
+	$tpl->assign('HostTitle', $lang["m_HostTitle"]);
+	$tpl->assign('InformationsTitle', $lang["m_InformationsTitle"]);
+
+
+	$tpl->assign('infosTitle', $mhost."<br>".$start_date_select." -> ".$end_date_select);		
+	$tpl->assign('host_name', $mhost);		
+	$tpl->assign('service_name', $mservice);		
+
+
+
+
+	$status = "";
+	foreach ($tab_resume  as $tb)
+		if($tb["pourcentTime"] > 0)
+			$status .= "&value[".$tb["state"]."]=".$tb["pourcentTime"];  
+        
+	$tpl->assign('status', $status);		
+
+
+
+
+
+	$renderer1 =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$formPeriod1->accept($renderer1);
+	$tpl->assign('formPeriod1', $renderer1->toArray());	
+
+	$renderer2 =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$formPeriod2->accept($renderer2);	
+	$tpl->assign('formPeriod2', $renderer2->toArray());
+
+
+	$tpl->assign("tab_resume", $tab_resume);
+	$tpl->assign("tab_log", $tab_log);
+
+	$tpl->assign('lang', $lang);
+	$tpl->assign("p", $p);
+	$tpl->display("viewServicesLog.ihtml");
+
+
+?>
\ No newline at end of file
diff --git a/www/include/reporting/viewStatusMap.ihtml b/www/include/reporting/viewStatusMap.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..bacc6aab9f0107cac0a1f30718e60ee0e3b5e075
--- /dev/null
+++ b/www/include/reporting/viewStatusMap.ihtml
@@ -0,0 +1,10 @@
+<div align="center" style="padding-bottom: 20px;margin:1px;">
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td><img src='./img/icones/16x16/server_network.gif'>&nbsp;Host Status Map</td>
+		</tr>
+		<tr class='list_two'>
+			<td class='ListColCenter'><img src='./include/reporting/generateImages/graph_topology.php?session_id={ $session_id }'></td>
+		</tr>
+	</table>
+</div>
diff --git a/www/include/reporting/viewStatusMap.php b/www/include/reporting/viewStatusMap.php
new file mode 100644
index 0000000000000000000000000000000000000000..773690ffcb47ca83ed2b254c3aad18da6b02ab43
--- /dev/null
+++ b/www/include/reporting/viewStatusMap.php
@@ -0,0 +1,32 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf - Cedrick Facon
+
+Adapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick Facon
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit(); 
+		
+	$path = "./include/reporting/";
+		
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "./");
+	
+	$tpl->assign('session_id', session_id());
+	$tpl->display("viewStatusMap.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/tools/lang/en.php b/www/include/tools/lang/en.php
new file mode 100644
index 0000000000000000000000000000000000000000..58e1523cfff6d996a09ec37c88d9e8cf2a844211
--- /dev/null
+++ b/www/include/tools/lang/en.php
@@ -0,0 +1,26 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+$lang ["m_mon_tools"] = "Tools";
+$lang ["m_mon_tools_ping"] = "Ping";
+$lang ["m_mon_tools_tracert"] = "Tracert";
+$lang ["m_mon_tools_result"] = "Result";
+$lang ["m_mon_tools_command"] = "Command";
+$lang ["m_mon_waiting"] = "Please wait...";
+
+?>
\ No newline at end of file
diff --git a/www/include/tools/lang/fr.php b/www/include/tools/lang/fr.php
new file mode 100644
index 0000000000000000000000000000000000000000..abfd82d93c84c8a0fa88bc84beb4597af57d0b24
--- /dev/null
+++ b/www/include/tools/lang/fr.php
@@ -0,0 +1,26 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+$lang ["m_mon_tools"] = "Utilitaires";
+$lang ["m_mon_tools_ping"] = "Ping";
+$lang ["m_mon_tools_tracert"] = "Traceroute";
+$lang ["m_mon_tools_result"] = "Resultat";
+$lang ["m_mon_tools_command"] = "Commande";
+$lang ["m_mon_waiting"] = "Merci de patienter...";
+
+?>
\ No newline at end of file
diff --git a/www/include/tools/minTools.ihtml b/www/include/tools/minTools.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..6e2ddf8276bc110ef6878ef3245fb4f4e6dc74f0
--- /dev/null
+++ b/www/include/tools/minTools.ihtml
@@ -0,0 +1,15 @@
+{$form.javascript}
+<script type="text/javascript" src="include/common/javascript/functions.js"></script>
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/tool.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+		<tr class="list_lvl_1"><td class="ListColLvl1_name"  colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.host_information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.host_name.label}</td><td class="FormRowValue">{$host_name}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.host_ip.label}</td><td class="FormRowValue">{$host_ip}</td></tr>
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name"  colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.command_tool.label}</td><td class="FormRowValue">{$command_tool}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.command_help.label}</td><td class="FormRowValue"><div id='tools'></div></td></tr>
+	</table>
+	{$form.hidden}
+</form>
+{$initJS}
diff --git a/www/include/tools/minTools.php b/www/include/tools/minTools.php
new file mode 100644
index 0000000000000000000000000000000000000000..167cd7cf7a8524d3cf73aeda83169ccf5affcef5
--- /dev/null
+++ b/www/include/tools/minTools.php
@@ -0,0 +1,109 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (isset($_GET["host_id"]))
+		$host_id = $_GET["host_id"];
+	else if (isset($_POST["host_id"]))
+		$host_id = $_POST["host_id"];
+	else
+		$host_id = NULL;
+
+	$msg ='';
+
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Host comes from DB
+	$Host = array();
+	$res =& $pearDB->query("SELECT host_id, host_name, host_address, host_snmp_community, host_snmp_version FROM host WHERE host_id =". $host_id ."");
+	$Host  = array(NULL=>NULL);
+	$res->fetchInto($Host);
+	//while()
+	//	$checkCmds[$checkCmd["command_id"]] = $checkCmd["command_name"];
+	$res->free();
+
+		switch ($o)	{
+			case "p" : $tool_cmd_script = "include/tools/ping.php?host=".$Host["host_address"]; $tool = $lang ["m_mon_tools_ping"]; break;
+			case "tr" : $tool_cmd_script = "include/tools/traceroute.php?host=".$Host["host_address"]; $tool = $lang ["m_mon_tools_tracert"]; break;
+			default :  $tool_cmd_script = "include/tools/ping.php?host=".$Host["host_address"]; $tool = $lang ["m_mon_tools_ping"]; break;
+		}
+
+//	require_once("ping.php");
+
+
+	$attrsText 		= array("size"=>"15");
+
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	$form->addElement('header', 'title',$lang["m_mon_tools"]);
+
+	#
+	## Command information
+	#
+	$form->addElement('header', 'host_information', $lang['m_mon_host_info']);
+
+	$form->addElement('text', 'host_name', $lang ["m_mon_host"], $attrsText);
+	$form->addElement('text', 'host_ip', $lang ["m_mon_address_ip"], $attrsText);
+
+	#
+	## Command information
+	#
+	$form->addElement('header', 'information', $lang["m_mon_tools_result"]);
+
+	$form->addElement('text', 'command_tool', $lang["m_mon_tools_command"], $attrsText);
+	$form->addElement('text', 'command_help', $lang['cmd_output'], $attrsText);
+
+	#
+	## Further informations
+	#
+
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	$tpl->assign('host_name', $Host["host_name"]);
+	$tpl->assign('host_ip',$Host["host_address"] );
+	$tpl->assign('command_tool',$tool );
+
+
+	$tpl->assign("initJS", "<script type='text/javascript'>
+		display('".$lang ["m_mon_waiting"]."<br><br><img src=\'./img/wait.gif\'>','tools');
+//		display('".$lang ["m_mon_waiting"]."','tools');
+		loadXMLDoc('".$tool_cmd_script."','tools');
+		</script>");
+
+
+
+	//if ($msg)
+	//	$tpl->assign('msg', $msg);
+
+	#
+	##Apply a template definition
+	#
+
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->assign('o', $o);
+	$tpl->display("minTools.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/tools/ping.php b/www/include/tools/ping.php
new file mode 100644
index 0000000000000000000000000000000000000000..6ff9c7324406f5a360f4cf98305a8bc2f4028464
--- /dev/null
+++ b/www/include/tools/ping.php
@@ -0,0 +1,59 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+
+ include("../../oreon.conf.php");
+ require_once ("../../$classdir/Session.class.php");
+ require_once ("../../$classdir/Oreon.class.php");
+ Session::start();
+
+ if (!isset($_SESSION["oreon"])) {
+ 	// Quick dirty protection
+ 	header("Location: ../../index.php");
+ 	//exit();
+ }else {
+ 	$oreon =& $_SESSION["oreon"];
+ }
+
+
+	if (isset($_GET["host"]))
+		$host = $_GET["host"];
+	else if (isset($_POST["host"]))
+		$host = $_POST["host"];
+	else {
+		print "Bad Request !";
+		exit;
+	}
+
+
+	require ("Net/Ping.php");
+	$ping = Net_Ping::factory();
+
+	if(!PEAR::isError($ping))
+	{
+    	$ping->setArgs(array("count" => 4));
+		$response = $ping->ping($host);
+		foreach ($response->getRawData() as $key => $data) {
+   			$msg .= $data ."<br>";
+		}
+		print $msg;
+	}
+
+?>
\ No newline at end of file
diff --git a/www/include/tools/tools.php b/www/include/tools/tools.php
new file mode 100644
index 0000000000000000000000000000000000000000..1e6cf8aae3552046a430e8d71fd7294db3cdebdd
--- /dev/null
+++ b/www/include/tools/tools.php
@@ -0,0 +1,41 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+
+	isset($_GET["host_id"]) ? $hostG = $_GET["host_id"] : $hostG = NULL;
+	isset($_POST["host_id"]) ? $hostP = $_POST["host_id"] : $hostP = NULL;
+	$hostG ? $host_id = $hostG : $host_id = $hostP;
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+
+	#Path to the configuration dir
+	$path = "./include/tools/";
+
+	#PHP functions
+	//require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+
+	if ($min)
+		require_once($path."minTools.php");
+
+?>
\ No newline at end of file
diff --git a/www/include/tools/traceroute.php b/www/include/tools/traceroute.php
new file mode 100644
index 0000000000000000000000000000000000000000..0fb75b2350fb5813b05e0859beccd33e23b5d3ce
--- /dev/null
+++ b/www/include/tools/traceroute.php
@@ -0,0 +1,57 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+ include("../../oreon.conf.php");
+ require_once ("../../$classdir/Session.class.php");
+ require_once ("../../$classdir/Oreon.class.php");
+ Session::start();
+
+ if (!isset($_SESSION["oreon"])) {
+ 	// Quick dirty protection
+ 	header("Location: ../../index.php");
+ 	//exit();
+ }else {
+ 	$oreon =& $_SESSION["oreon"];
+ }
+
+	if (isset($_GET["host"]))
+		$host = $_GET["host"];
+	else if (isset($_POST["host"]))
+		$host = $_POST["host"];
+	else {
+		print "Bad Request !";
+		exit;
+	}
+
+	include("Net/Traceroute.php");
+
+	$tr = Net_Traceroute::factory();
+
+	if(!PEAR::isError($tr))
+	{
+		$tr->setArgs(array('timeout' => 5));
+	    $response = $tr->traceroute($host);
+		foreach ($response->getRawData() as $key => $data) {
+   			$msg .= $data ."<br>";
+		}
+		print $msg;
+	}
+
+?>
\ No newline at end of file
diff --git a/www/include/version/index.html b/www/include/version/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/www/include/version/version.php b/www/include/version/version.php
new file mode 100644
index 0000000000000000000000000000000000000000..392408887b203859ad91a8ceb19d95cc2e1221c7
--- /dev/null
+++ b/www/include/version/version.php
@@ -0,0 +1,19 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+?>
+v1.3-RC2
diff --git a/www/include/views/graphs/componentTemplates/DB-Func.php b/www/include/views/graphs/componentTemplates/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..d7be619b6f954da64b7041309dfe3ea25cb53763
--- /dev/null
+++ b/www/include/views/graphs/componentTemplates/DB-Func.php
@@ -0,0 +1,219 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function testExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('compo_id');
+		$res =& $pearDB->query("SELECT compo_id, name FROM giv_components_template WHERE name = '".htmlentities($name, ENT_QUOTES)."'");
+		$compo =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $compo["compo_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $compo["compo_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function deleteComponentTemplateInDB ($compos = array())	{
+		global $pearDB;
+		foreach($compos as $key=>$value)
+			$pearDB->query("DELETE FROM giv_components_template WHERE compo_id = '".$key."'");
+		defaultOreonGraph();
+		defaultPluginsGraph();
+	}	
+	
+	function defaultOreonGraph ()	{
+		global $pearDB;
+		$rq = "SELECT DISTINCT compo_id FROM giv_components_template WHERE default_tpl1 = '1'";
+		$res =& $pearDB->query($rq);
+		if (!$res->numRows())	{
+			$rq = "UPDATE giv_components_template SET default_tpl1 = '1' LIMIT 1";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function defaultPluginsGraph ()	{
+		global $pearDB;
+		$rq = "SELECT DISTINCT compo_id FROM giv_components_template WHERE default_tpl2 = '1'";
+		$res =& $pearDB->query($rq);
+		if (!$res->numRows())	{
+			$rq = "UPDATE giv_components_template SET default_tpl2 = '1' LIMIT 1";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function noDefaultOreonGraph ()	{
+		global $pearDB;
+		$rq = "UPDATE giv_components_template SET default_tpl1 = '0'";
+		$pearDB->query($rq);
+	}
+	
+	function noDefaultPluginsGraph ()	{
+		global $pearDB;
+		$rq = "UPDATE giv_components_template SET default_tpl2 = '0'";
+		$pearDB->query($rq);
+	}
+	
+	function multipleComponentTemplateInDB ($compos = array(), $nbrDup = array())	{
+		foreach($compos as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM giv_components_template WHERE compo_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["compo_id"] = '';
+			$row["default_tpl1"] = '0';
+			$row["default_tpl2"] = '0';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "name" ? ($name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testExistence($name))	{
+					$val ? $rq = "INSERT INTO giv_components_template VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+				}
+			}
+		}
+	}
+	
+	function updateComponentTemplateInDB ($compo_id = NULL)	{
+		if (!$compo_id) return;
+		updateComponentTemplate($compo_id);
+		updateGraphParents($compo_id);
+	}	
+	
+	function insertComponentTemplateInDB ()	{
+		$compo_id = insertComponentTemplate();
+		updateGraphParents($compo_id);
+		return ($compo_id);
+	}
+	
+	function insertComponentTemplate()	{
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		if ($ret["default_tpl1"]["default_tpl1"])
+			noDefaultOreonGraph();
+		if ($ret["default_tpl2"]["default_tpl2"])
+			noDefaultPluginsGraph();
+		$rq = "INSERT INTO `giv_components_template` ( `compo_id` , `name` , `ds_order` , `ds_name` , " .
+				"`ds_legend` , `ds_color_line` , `ds_color_area` , `ds_filled` , `ds_max` , `ds_min` , `ds_average` , `ds_last` , `ds_tickness` , `ds_transparency`, `ds_invert`," .
+				"`default_tpl1`, `default_tpl2`, `comment` ) ";
+		$rq .= "VALUES (";
+		$rq .= "NULL, ";
+		isset($ret["name"]) && $ret["name"] != NULL ? $rq .= "'".htmlentities($ret["name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ds_order"]) && $ret["ds_order"] != NULL ? $rq .= "'".htmlentities($ret["ds_order"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ds_name"]) && $ret["ds_name"] != NULL ? $rq .= "'".$ret["ds_name"]."', ": $rq .= "NULL, ";
+		isset($ret["ds_legend"]) && $ret["ds_legend"] != NULL ? $rq .= "'".htmlentities($ret["ds_legend"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ds_color_line"]) && $ret["ds_color_line"] != NULL ? $rq .= "'".htmlentities($ret["ds_color_line"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ds_color_area"]) && $ret["ds_color_area"] != NULL ? $rq .= "'".htmlentities($ret["ds_color_area"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ds_filled"]["ds_filled"]) && $ret["ds_filled"]["ds_filled"] != NULL ? $rq .= "'".htmlentities($ret["ds_filled"]["ds_filled"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ds_max"]["ds_max"]) && $ret["ds_max"]["ds_max"] != NULL ? $rq .= "'".htmlentities($ret["ds_max"]["ds_max"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ds_min"]["ds_min"]) && $ret["ds_min"]["ds_min"] != NULL ? $rq .= "'".htmlentities($ret["ds_min"]["ds_min"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ds_average"]["ds_average"]) && $ret["ds_average"]["ds_average"] != NULL ? $rq .= "'".htmlentities($ret["ds_average"]["ds_average"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ds_last"]["ds_last"]) && $ret["ds_last"]["ds_last"] != NULL ? $rq .= "'".htmlentities($ret["ds_last"]["ds_last"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ds_tickness"]) && $ret["ds_tickness"] != NULL ? $rq .= "'".htmlentities($ret["ds_tickness"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ds_transparency"]) && $ret["ds_transparency"] != NULL ? $rq .= "'".htmlentities($ret["ds_transparency"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["ds_invert"]) && $ret["ds_invert"] != NULL ? $rq .= "'".$ret["ds_invert"]["ds_invert"]."', ": $rq .= "NULL, ";
+		isset($ret["default_tpl1"]["default_tpl1"]) && $ret["default_tpl1"]["default_tpl1"] != NULL ? $rq .= "'".$ret["default_tpl1"]["default_tpl1"]."', ": $rq .= "NULL, ";
+		isset($ret["default_tpl2"]["default_tpl2"]) && $ret["default_tpl2"]["default_tpl2"] != NULL ? $rq .= "'".$ret["default_tpl2"]["default_tpl2"]."', ": $rq .= "NULL, ";
+		isset($ret["comment"]) && $ret["comment"] != NULL ? $rq .= "'".htmlentities($ret["comment"], ENT_QUOTES)."'": $rq .= "NULL";
+		$rq .= ")";
+		$pearDB->query($rq);
+		defaultOreonGraph();
+		defaultPluginsGraph();
+		$res =& $pearDB->query("SELECT MAX(compo_id) FROM giv_components_template");
+		$compo_id = $res->fetchRow();
+		return ($compo_id["MAX(compo_id)"]);
+	}
+	
+	function updateComponentTemplate($compo_id = null)	{
+		if (!$compo_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		if ($ret["default_tpl1"]["default_tpl1"])
+			noDefaultOreonGraph();
+		if ($ret["default_tpl2"]["default_tpl2"])
+			noDefaultPluginsGraph();
+		$rq = "UPDATE giv_components_template ";
+		$rq .= "SET name = ";
+		isset($ret["name"]) && $ret["name"] != NULL ? $rq .= "'".htmlentities($ret["name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "`ds_order` = ";
+		isset($ret["ds_order"]) && $ret["ds_order"] != NULL ? $rq .= "'".htmlentities($ret["ds_order"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .=	"ds_name = ";
+		isset($ret["ds_name"]) && $ret["ds_name"] != NULL ? $rq .= "'".htmlentities($ret["ds_name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= 	"ds_legend = ";
+		isset($ret["ds_legend"]) && $ret["ds_legend"] != NULL ? $rq .= "'".$ret["ds_legend"]."', ": $rq .= "NULL, ";
+		$rq .= "ds_color_line = ";
+		isset($ret["ds_color_line"]) && $ret["ds_color_line"] != NULL ? $rq .= "'".$ret["ds_color_line"]."', ": $rq .= "NULL, ";
+		$rq .= "ds_color_area = ";
+		isset($ret["ds_color_area"]) && $ret["ds_color_area"] != NULL ? $rq .= "'".$ret["ds_color_area"]."', ": $rq .= "NULL, ";
+		$rq .= "ds_filled = ";
+		isset($ret["ds_filled"]["ds_filled"]) && $ret["ds_filled"]["ds_filled"] != NULL ? $rq .= "'".$ret["ds_filled"]["ds_filled"]."', ": $rq .= "NULL, ";
+		$rq .= "ds_max = ";
+		isset($ret["ds_max"]["ds_max"]) && $ret["ds_max"]["ds_max"] != NULL ? $rq .= "'".$ret["ds_max"]["ds_max"]."', ": $rq .= "NULL, ";
+		$rq .= "ds_min = ";
+		isset($ret["ds_min"]["ds_min"]) && $ret["ds_min"]["ds_min"] != NULL ? $rq .= "'".$ret["ds_min"]["ds_min"]."', ": $rq .= "NULL, ";
+		$rq .= "ds_average = ";
+		isset($ret["ds_average"]["ds_average"]) && $ret["ds_average"]["ds_average"] != NULL ? $rq .= "'".$ret["ds_average"]["ds_average"]."', ": $rq .= "NULL, ";
+		$rq .= "ds_last = ";
+		isset($ret["ds_last"]["ds_last"]) && $ret["ds_last"]["ds_last"] != NULL ? $rq .= "'".$ret["ds_last"]["ds_last"]."', ": $rq .= "NULL, ";
+		$rq .= 	"ds_tickness = ";
+		isset($ret["ds_tickness"]) && $ret["ds_tickness"] != NULL ? $rq .= "'".$ret["ds_tickness"]."', ": $rq .= "NULL, ";
+		$rq .= 	"ds_transparency = ";
+		isset($ret["ds_transparency"]) && $ret["ds_transparency"] != NULL ? $rq .= "'".$ret["ds_transparency"]."', ": $rq .= "NULL, ";
+		$rq .= 	"ds_invert = ";
+		isset($ret["ds_invert"]) && $ret["ds_invert"] != NULL ? $rq .= "'".$ret["ds_invert"]["ds_invert"]."', ": $rq .= "NULL, ";
+		$rq .= "default_tpl1 = ";
+		isset($ret["default_tpl1"]["default_tpl1"]) && $ret["default_tpl1"]["default_tpl1"] != NULL ? $rq .= "'".$ret["default_tpl1"]["default_tpl1"]."', ": $rq .= "NULL, ";
+		$rq .= "default_tpl2 = ";
+		isset($ret["default_tpl2"]["default_tpl2"]) && $ret["default_tpl2"]["default_tpl2"] != NULL ? $rq .= "'".$ret["default_tpl2"]["default_tpl2"]."', ": $rq .= "NULL, ";
+		$rq .= "comment = ";
+		isset($ret["comment"]) && $ret["comment"] != NULL ? $rq .= "'".htmlentities($ret["comment"], ENT_QUOTES)."' ": $rq .= "NULL ";
+		$rq .= "WHERE compo_id = '".$compo_id."'";
+		$pearDB->query($rq);
+		defaultOreonGraph();
+		defaultPluginsGraph();
+	}		
+	
+	function updateGraphParents($compo_id = null)	{
+		if (!$compo_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM giv_graphT_componentT_relation ";
+		$rq .= "WHERE gc_compo_id = '".$compo_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("compo_graphs");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO giv_graphT_componentT_relation ";
+			$rq .= "(gg_graph_id, gc_compo_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$ret[$i]."', '".$compo_id."')";
+			$pearDB->query($rq);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/componentTemplates/componentTemplates.php b/www/include/views/graphs/componentTemplates/componentTemplates.php
new file mode 100644
index 0000000000000000000000000000000000000000..2c9f2679c2bc18a7fb9bab9b81a0f7d3cc8238bc
--- /dev/null
+++ b/www/include/views/graphs/componentTemplates/componentTemplates.php
@@ -0,0 +1,49 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["compo_id"]) ? $cG = $_GET["compo_id"] : $cG = NULL;
+	isset($_POST["compo_id"]) ? $cP = $_POST["compo_id"] : $cP = NULL;
+	$cG ? $compo_id = $cG : $compo_id = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/views/graphs/componentTemplates/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formComponentTemplate.php"); break; #Add a Component Template
+		case "w" : require_once($path."formComponentTemplate.php"); break; #Watch a Component Template
+		case "c" : require_once($path."formComponentTemplate.php"); break; #Modify a Component Template
+		case "s" : enableComponentTemplateInDB($lca_id); require_once($path."listComponentTemplates.php"); break; #Activate a Component Template
+		case "u" : disableComponentTemplateInDB($lca_id); require_once($path."listComponentTemplates.php"); break; #Desactivate a Component Template
+		case "m" : multipleComponentTemplateInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listComponentTemplates.php"); break; #Duplicate n Component Templates
+		case "d" : deleteComponentTemplateInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listComponentTemplates.php"); break; #Delete n Component Templates
+		default : require_once($path."listComponentTemplates.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/componentTemplates/formComponentTemplate.ihtml b/www/include/views/graphs/componentTemplates/formComponentTemplate.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..6da338f87104d62919b4c2fe3445b434b420d7bd
--- /dev/null
+++ b/www/include/views/graphs/componentTemplates/formComponentTemplate.ihtml
@@ -0,0 +1,64 @@
+<script type="text/javascript" src="include/configuration/changetab.js"></script>
+{$colorJS}
+{$form.javascript}
+<form {$form.attributes}>
+<div>
+<ul id="mainnav">
+	<li class="a" id='c1'><a href="#"  onclick="javascript:montre('1');">{$sort1}</a></li>
+	<li class="b" id='c2'><a href="#" onclick="javascript:montre('2');">{$sort2}</a></li>
+</ul>
+</div>
+<div id='tab1' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/layout_horizontal.gif'>&nbsp;&nbsp;{$form.header.ftitle}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+	 	
+		<tr class="list_one"><td class="FormRowField">{$form.name.label}</td><td class="FormRowValue">{$form.name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.ds_name.label}</td><td class="FormRowValue">{$form.ds_name.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.ds_order.label}</td><td class="FormRowValue">{$form.ds_order.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.ds_legend.label}</td><td class="FormRowValue">{$form.ds_legend.html}</td></tr>
+		<tr class="list_one">
+			<td class="FormRowField">{$form.ds_color_line.label}</td>
+			<td class="FormRowValue">{$form.ds_color_line.html}&nbsp;&nbsp;{$form.ds_color_line_color.html}&nbsp;&nbsp;{$form.ds_color_line_modify.html}</td>
+		</tr>
+		<tr class="list_two">
+			<td class="FormRowField">{$form.ds_color_area.label}</td>
+			<td class="FormRowValue">{$form.ds_color_area.html}&nbsp;&nbsp;{$form.ds_color_area_color.html}&nbsp;&nbsp;{$form.ds_color_area_modify.html}</td>
+		</tr>
+		<tr class="list_one"><td class="FormRowField">{$form.ds_transparency.label}</td><td class="FormRowValue">{$form.ds_transparency.html}%</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.ds_invert.label}</td><td class="FormRowValue">{$form.ds_invert.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.ds_filled.label}</td><td class="FormRowValue">{$form.ds_filled.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.ds_max.label}</td><td class="FormRowValue">{$form.ds_max.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.ds_min.label}</td><td class="FormRowValue">{$form.ds_min.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.ds_average.label}</td><td class="FormRowValue">{$form.ds_average.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.ds_last.label}</td><td class="FormRowValue">{$form.ds_last.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.ds_tickness.label}</td><td class="FormRowValue">{$form.ds_tickness.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.default_tpl1.label}</td><td class="FormRowValue">{$form.default_tpl1.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.default_tpl2.label}</td><td class="FormRowValue">{$form.default_tpl2.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.comment.label}</td><td class="FormRowValue">{$form.comment.html}</td></tr>
+
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+</div>
+<div id='tab2' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/layout_horizontal.gif'>&nbsp;&nbsp;{$form.header.ftitle}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/layout_vertical.gif'>&nbsp;&nbsp;{$form.header.graphs}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.compo_graphs.label}</td><td class="FormRowValue">{$form.compo_graphs.html}</td></tr>
+	</table>
+</div>
+<div id="validForm">
+{if $o == "a" || $o == "c"}
+	<p>{$form.action.html}</p>
+	<p>{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+{else if $o == "w"}
+	<p>{$form.change.html}</p>
+{/if}
+</div>
+{$form.hidden}
+</form>
+
diff --git a/www/include/views/graphs/componentTemplates/formComponentTemplate.php b/www/include/views/graphs/componentTemplates/formComponentTemplate.php
new file mode 100644
index 0000000000000000000000000000000000000000..fe4d9e3703b9844d37809f3f0a09192cf54339c6
--- /dev/null
+++ b/www/include/views/graphs/componentTemplates/formComponentTemplate.php
@@ -0,0 +1,256 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information
+	#
+	$compo = array();
+	if (($o == "c" || $o == "w") && $compo_id)	{
+		$res =& $pearDB->query("SELECT * FROM giv_components_template WHERE compo_id = '".$compo_id."' LIMIT 1");
+		# Set base value
+		$compo = array_map("myDecode", $res->fetchRow());
+		# Set Components relations
+		$res =& $pearDB->query("SELECT DISTINCT gg_graph_id FROM giv_graphT_componentT_relation WHERE gc_compo_id = '".$compo_id."'");
+		for($i = 0; $res->fetchInto($graph); $i++)
+			$compo["compo_graphs"][$i] = $graph["gg_graph_id"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Graphs comes from DB -> Store in $graphs Array
+	$graphs = array();
+	$res =& $pearDB->query("SELECT graph_id, name FROM giv_graphs_template ORDER BY name");
+	while($res->fetchInto($graph))
+		$graphs[$graph["graph_id"]] = $graph["name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsText2 	= array("size"=>"10");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"3", "cols"=>"30");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'ftitle', $lang["giv_ct_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'ftitle', $lang["giv_ct_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'ftitle', $lang["giv_ct_view"]);
+
+	#
+	## Basic information
+	#
+	$form->addElement('header', 'information', $lang['giv_ct_infos']);
+	$form->addElement('text', 'name', $lang["giv_ct_name"], $attrsText);
+	for ($cpt = 1; $cpt <= 100; $cpt++)
+		$orders[$cpt] = $cpt;
+	$form->addElement('select', 'ds_order', $lang['giv_ct_order'], $orders);
+	$form->addElement('text', 'ds_name', $lang["giv_ct_dsName"], $attrsText);
+	$form->addElement('text', 'ds_legend', $lang["giv_ct_legend"], $attrsText);
+
+	$TabColorNameAndLang 	= array("ds_color_line"=>"giv_ct_lineClr",
+                                    	"ds_color_area"=>"giv_ct_areaClr",
+					);
+
+	while (list($nameColor, $val) = each($TabColorNameAndLang))	{
+		$nameLang = $lang[$val];
+		isset($compo[$nameColor]) ?	$codeColor = $compo[$nameColor] : $codeColor = NULL;
+		$title = $lang["genOpt_colorPicker"];
+		$attrsText3 	= array("value"=>$codeColor,"size"=>"9","maxlength"=>"7");
+		$form->addElement('text', $nameColor, $nameLang,  $attrsText3);
+		//if ($form->validate())	{
+		//	$colorColor = $form->exportValue($nameColor);
+		//}
+		$attrsText4 	= array("style"=>"width:50px; height:18px; background: ".$codeColor." url() left repeat-x 0px; border-color:".$codeColor.";");
+		$attrsText5 	= array("onclick"=>"popup_color_picker('$nameColor','$nameLang','$title');");
+		$form->addElement('button', $nameColor.'_color', "", $attrsText4);
+		//if (!$form->validate())	{
+		if ($o == "c" || $o == "a")	{
+			$form->addElement('button', $nameColor.'_modify', $lang['modify'], $attrsText5);
+		}
+	}
+
+	$form->addElement('text', 'ds_transparency', $lang["giv_ct_transparency"], $attrsText3);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'ds_filled', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'ds_filled', null, $lang["no"], '0');
+	$form->addGroup($tab, 'ds_filled', $lang["giv_ct_filled"], '&nbsp;');
+	$form->setDefaults(array('ds_filled' => '0'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'ds_max', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'ds_max', null, $lang["no"], '0');
+	$form->addGroup($tab, 'ds_max', $lang["giv_ct_max"], '&nbsp;');
+	$form->setDefaults(array('ds_max' => '1'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'ds_min', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'ds_min', null, $lang["no"], '0');
+	$form->addGroup($tab, 'ds_min', $lang["giv_ct_min"], '&nbsp;');
+	$form->setDefaults(array('ds_min' => '1'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'ds_average', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'ds_average', null, $lang["no"], '0');
+	$form->addGroup($tab, 'ds_average', $lang["giv_ct_avg"], '&nbsp;');
+	$form->setDefaults(array('ds_average' => '0'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'ds_last', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'ds_last', null, $lang["no"], '0');
+	$form->addGroup($tab, 'ds_last', $lang["giv_ct_last"], '&nbsp;');
+	$form->setDefaults(array('ds_last' => '0'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'ds_invert', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'ds_invert', null, $lang["no"], '0');
+	$form->addGroup($tab, 'ds_invert', $lang["giv_ct_invert"], '&nbsp;');
+	$form->setDefaults(array('ds_invert' => '0'));
+	
+	$form->addElement('select', 'ds_tickness', $lang["giv_ct_tickness"], array("1"=>"1", "2"=>"2", "3"=>"3"));
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'default_tpl1', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'default_tpl1', null, $lang["no"], '0');
+	$form->addGroup($tab, 'default_tpl1', $lang["giv_gt_defaultTpl1"], '&nbsp;');
+	$form->setDefaults(array('default_tpl1' => '0'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'default_tpl2', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'default_tpl2', null, $lang["no"], '0');
+	$form->addGroup($tab, 'default_tpl2', $lang["giv_gt_defaultTpl2"], '&nbsp;');
+	$form->setDefaults(array('default_tpl2' => '0'));
+
+	$form->addElement('textarea', 'comment', $lang["giv_gt_comment"], $attrsTextarea);
+
+	#
+	## Components linked with
+	#
+	$form->addElement('header', 'graphs', $lang["giv_graphChoice"]);
+    $ams1 =& $form->addElement('advmultiselect', 'compo_graphs', $lang["giv_graphList"], $graphs, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+
+	$form->addElement('hidden', 'compo_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('name', $lang['ErrName'], 'required');
+	$form->addRule('ds_name', $lang['ErrRequired'], 'required');
+	$form->addRule('ds_legend', $lang['ErrRequired'], 'required');
+	$form->addRule('ds_color_line', $lang['ErrRequired'], 'required');
+    $form->addRule('ds_color_area', $lang['ErrRequired'], 'required');
+
+	$form->registerRule('exist', 'callback', 'testExistence');
+	$form->addRule('name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Just watch
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&compo_id=".$compo_id."'"));
+	    $form->setDefaults($compo);
+		$form->freeze();
+	}
+	# Modify
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["delete"]);
+	    $form->setDefaults($compo);
+	}
+	# Add
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["delete"]);
+	}
+	$tpl->assign('msg', array ("changeL"=>"?p=".$p."&o=c&compo_id=".$compo_id, "changeT"=>$lang['modify']));
+
+	$tpl->assign("sort1", $lang['giv_ct_properties']);
+	$tpl->assign("sort2", $lang["giv_graphs"]);
+
+	#
+	##Picker Color JS
+	#
+	$tpl->assign('colorJS',"
+	<script type='text/javascript'>
+		function popup_color_picker(t,name,title)
+		{
+			var width = 400;
+			var height = 300;
+			window.open('./include/common/javascript/color_picker.php?n='+t+'&name='+name+'&title='+title, 'cp', 'resizable=no, location=no, width='
+						+width+', height='+height+', menubar=no, status=yes, scrollbars=no, menubar=no');
+		}
+	</script>
+    "
+    );
+	#
+	##End of Picker Color
+	#
+
+	$valid = false;
+	if ($form->validate())	{
+		$compoObj =& $form->getElement('compo_id');
+		if ($form->getSubmitValue("submitA"))
+			$compoObj->setValue(insertComponentTemplateInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateComponentTemplateInDB($compoObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&compo_id=".$compoObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once("listComponentTemplates.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->display("formComponentTemplate.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/componentTemplates/listComponentTemplates.ihtml b/www/include/views/graphs/componentTemplates/listComponentTemplates.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..f9592e131b17a7145c85e4a73c3215301f69a0ef
--- /dev/null
+++ b/www/include/views/graphs/componentTemplates/listComponentTemplates.ihtml
@@ -0,0 +1,55 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_graph}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_tpl1}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_tpl2}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td align="center">			
+				<table>
+					<tr>
+					<td width="10" height="10" bgcolor="{$elemArr[elem].RowMenu_clrLine}"></td>
+					</tr><tr>
+					<td width="10" height="10" bgcolor="{$elemArr[elem].RowMenu_clrArea}"></td>
+					</tr>
+				</table>
+			</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_graph}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_tpl1}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_tpl2}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="3">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="4"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
\ No newline at end of file
diff --git a/www/include/views/graphs/componentTemplates/listComponentTemplates.php b/www/include/views/graphs/componentTemplates/listComponentTemplates.php
new file mode 100644
index 0000000000000000000000000000000000000000..d15eedcc85e96f76599782b72edc72cea347e717
--- /dev/null
+++ b/www/include/views/graphs/componentTemplates/listComponentTemplates.php
@@ -0,0 +1,99 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+$pagination = "maxViewConfiguration";
+	!isset ($_GET["limit"]) ? $limit = 20 : $limit = $_GET["limit"];
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM giv_components_template WHERE name LIKE '%".$search."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM giv_components_template");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['giv_ct_dsName']);
+	$tpl->assign("headerMenu_graph", $lang["giv_graphNbr"]);
+	$tpl->assign("headerMenu_tpl1", $lang['giv_tpl1']);
+	$tpl->assign("headerMenu_tpl2", $lang['giv_tpl2']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+
+	#List
+	if ($search)
+		$rq = "SELECT @nbr:=(SELECT COUNT(gg_graph_id) FROM giv_graphT_componentT_relation ggcr WHERE ggcr.gc_compo_id = gc.compo_id) AS nbr, compo_id, name, ds_name, ds_color_line, ds_color_area, default_tpl1, default_tpl2 FROM giv_components_template gc WHERE name LIKE '%".$search."%' ORDER BY name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT @nbr:=(SELECT COUNT(gg_graph_id) FROM giv_graphT_componentT_relation ggcr WHERE ggcr.gc_compo_id = gc.compo_id) AS nbr, compo_id, name, ds_name, ds_color_line, ds_color_area, default_tpl1, default_tpl2 FROM giv_components_template gc ORDER BY name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($compo); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$compo['compo_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&compo_id=".$compo['compo_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&compo_id=".$compo['compo_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&compo_id=".$compo['compo_id']."&o=d&select[".$compo['compo_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$compo['compo_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$compo["name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&compo_id=".$compo['compo_id'],
+						"RowMenu_desc"=>$compo["ds_name"],
+						"RowMenu_graph"=>$compo["nbr"],
+						"RowMenu_clrLine"=>$compo["ds_color_line"],
+						"RowMenu_clrArea"=>$compo["ds_color_area"],
+						"RowMenu_tpl1"=>$compo["default_tpl1"] ? $lang["yes"] : $lang["no"],
+						"RowMenu_tpl2"=>$compo["default_tpl2"] ? $lang["yes"] : $lang["no"],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";
+	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listComponentTemplates.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
diff --git a/www/include/views/graphs/generateImage/generateRRDImage.php b/www/include/views/graphs/generateImage/generateRRDImage.php
new file mode 100644
index 0000000000000000000000000000000000000000..5306e50fd38c7ec776c7cc3c4996fc12666787f7
--- /dev/null
+++ b/www/include/views/graphs/generateImage/generateRRDImage.php
@@ -0,0 +1,187 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function escape_command($command) {
+		return ereg_replace("(\\\$|`)", "", $command);
+	}
+	
+	require_once 'DB.php';
+	require_once ("../../../../class/Session.class.php");
+	require_once ("../../../../class/Oreon.class.php");
+
+	Session::start();
+	$oreon =& $_SESSION["oreon"];
+
+	/* Connect to Oreon DB */
+	
+	include("../../../../oreon.conf.php");
+	is_file ("../../../../lang/".$oreon->user->get_lang().".php") ? include_once ("../../../../lang/".$oreon->user->get_lang().".php") : include_once ("../../../../lang/en.php");	
+	require_once "../../../common/common-Func.php";
+	
+	$dsn = array(
+	    'phptype'  => 'mysql',
+	    'username' => $conf_oreon['user'],
+	    'password' => $conf_oreon['password'],
+	    'hostspec' => $conf_oreon['host'],
+	    'database' => $conf_oreon['db'],
+	);
+	
+	$options = array(
+	    'debug'       => 2,
+	    'portability' => DB_PORTABILITY_ALL ^ DB_PORTABILITY_LOWERCASE,
+	);
+	
+	$pearDB =& DB::connect($dsn, $options);
+	if (PEAR::isError($pearDB))
+	    die("Unable to connect : " . $pearDB->getMessage());
+	
+	$pearDB->setFetchMode(DB_FETCHMODE_ASSOC);
+	
+	$session =& $pearDB->query("SELECT * FROM `session` WHERE session_id = '".$_GET["session_id"]."'");
+	if (!$session->numRows()){
+		exit;
+	} else {
+
+		if (!isset($_GET["template_id"])){
+			# Get service id 
+			$res =& $pearDB->query("SELECT service.service_id FROM service,host,host_service_relation WHERE service.service_id = host_service_relation.service_service_id AND host.host_id = host_service_relation.host_host_id AND host.host_name = '".$_GET["host_name"]."' AND service.service_description = '".$_GET["service_description"]."'");
+			$res->fetchInto($service);
+			$template_id = getDefaultGraph($service["service_id"], 1);
+		} else 
+			$template_id = $_GET["template_id"];
+		
+		include_once("../../../../DBPerfparseConnect.php");
+		
+		$command_line = " graph - --start=".$_GET["start"]. " --end=".$_GET["end"];
+		
+		# get all template infos
+		$res =& $pearDB->query("SELECT * FROM giv_graphs_template WHERE graph_id = '".$template_id."' LIMIT 1");
+		$res->fetchInto($GraphTemplate);
+		if (isset($_GET["service_description"]) && strstr($_GET["service_description"], "meta_")){
+			$tab_name = spliti("_", $_GET["service_description"]);
+			$res_meta =& $pearDB->query("SELECT meta_name FROM meta_service WHERE meta_id = '".$tab_name[1]."'");
+			$res_meta->fetchInto($meta_data);
+			$command_line .= " --interlaced --width=".$GraphTemplate["width"]." --height=".$GraphTemplate["height"]." --title='Graph Meta Service ".$meta_data["meta_name"]."' --vertical-label='".$GraphTemplate["vertical_label"]."' ";
+		} else
+			$command_line .= " --interlaced --width=".$GraphTemplate["width"]." --height=".$GraphTemplate["height"]." --title='Graph ".$_GET["service_description"]." on Host ".$_GET["host_name"]."' --vertical-label='".$GraphTemplate["vertical_label"]."' ";
+		
+		# Init Graph Template Value
+		$command_line .= "--color CANVAS".$GraphTemplate["bg_grid_color"]." ";
+		$command_line .= "--color BACK".$GraphTemplate["bg_color"]." ";
+		$command_line .= "--color FONT".$GraphTemplate["police_color"]." ";
+		$command_line .= "--color MGRID".$GraphTemplate["grid_main_color"]." ";
+		$command_line .= "--color GRID".$GraphTemplate["grid_sec_color"]." ";
+		$command_line .= "--color FRAME".$GraphTemplate["contour_cub_color"]." ";
+		$command_line .= "--color ARROW".$GraphTemplate["col_arrow"]." ";
+		$command_line .= "--color SHADEA".$GraphTemplate["col_top"]." ";
+		$command_line .= "--color SHADEB".$GraphTemplate["col_bot"]." ";
+		
+		if (isset($GraphTemplate["upper_limit"]) && $GraphTemplate["upper_limit"] != NULL)
+			$command_line .= "--upper-limit=".$GraphTemplate["upper_limit"]." ";
+		else
+			$command_line .= "--alt-autoscale-max "; 
+		if (isset($GraphTemplate["lower_limit"]) && $GraphTemplate["lower_limit"] != NULL)
+			$command_line .= "--lower-limit=".$GraphTemplate["lower_limit"]." ";
+		
+		# Init DS template For each curv
+		$ppMetrics = array();
+		$res =& $pearDBpp->query("SELECT DISTINCT metric_id, metric, unit FROM perfdata_service_metric WHERE host_name = '".$_GET["host_name"]."' AND service_description = '".$_GET["service_description"]."'");
+		$cpt = 0;
+		while($res->fetchInto($ppMetric))	{
+			$ppMetrics[$ppMetric["metric_id"]]["metric"] = $ppMetric["metric"];
+			$ppMetrics[$ppMetric["metric_id"]]["unit"] = $ppMetric["unit"];
+			$ds = getDefaultDS($template_id, $cpt, 1);
+			$ppMetrics[$ppMetric["metric_id"]]["ds_id"] = $ds;
+
+			$res_ds =& $pearDB->query("SELECT * FROM giv_components_template WHERE compo_id = '".$ds."'");
+			$res_ds->fetchInto($ds_data);
+			foreach ($ds_data as $key => $ds_d)
+				$ppMetrics[$ppMetric["metric_id"]][$key] = $ds_d;
+			
+			$ppMetrics[$ppMetric["metric_id"]]["legend"] = $ds_data["name"];
+			if (strcmp($ppMetric["unit"], ""))
+				$ppMetrics[$ppMetric["metric_id"]]["legend"] .= " (".$ppMetric["unit"].") ";
+			$ppMetrics[$ppMetric["metric_id"]]["legend_len"] = strlen($ppMetrics[$ppMetric["metric_id"]]["legend"]);
+			$cpt++;
+		}
+		$res->free();	
+
+		$cpt = 0;
+		$longer = 0;
+		foreach ($ppMetrics as $tm){
+			if (isset($tm["ds_invert"]) && $tm["ds_invert"]){
+				$command_line .= " DEF:va".$cpt."=".$oreon->optGen["oreon_path"]."filesGeneration/graphs/simpleRenderer/rrdDB/".str_replace(" ", "-",$_GET["host_name"])."_".str_replace(" ", "-",$_GET["service_description"]).".rrd:".$tm["metric"].":LAST ";
+				$command_line .= " CDEF:v".$cpt."=va".$cpt.",-1,* ";
+			} else 
+				$command_line .= " DEF:v".$cpt."=".$oreon->optGen["oreon_path"]."filesGeneration/graphs/simpleRenderer/rrdDB/".str_replace(" ", "-",$_GET["host_name"])."_".str_replace(" ", "-",$_GET["service_description"]).".rrd:".$tm["metric"].":LAST ";
+			if ($tm["legend_len"] > $longer)
+				$longer = $tm["legend_len"];
+			$cpt++;
+		}	
+		
+		# Add Comments
+		$rrd_time  = addslashes(date("d\/m\/Y G:i", $_GET["start"])) ;
+		$rrd_time = str_replace(":", "\:", $rrd_time);
+		$rrd_time2 = addslashes(date("d\/m\/Y G:i", $_GET["end"])) ;
+		$rrd_time2 = str_replace(":", "\:", $rrd_time2);
+		$command_line .= " COMMENT:\" \\c\" COMMENT:\" From  $rrd_time to $rrd_time2 \\c\" COMMENT:\" \\c\" ";
+		
+		# Create Legende
+		$cpt = 1;
+		foreach ($ppMetrics as $key => $tm){
+			if ($ppMetrics[$key]["ds_filled"])
+				$command_line .= " AREA:v".($cpt-1)."".$tm["ds_color_area"]." ";	
+			$command_line .= " LINE".$tm["ds_tickness"].":v".($cpt-1);
+			$command_line .= $tm["ds_color_line"].":\"";
+			$command_line .= $ppMetrics[$key]["legend"];
+			for ($i = $ppMetrics[$key]["legend_len"]; $i != $longer + 1; $i++)
+				$command_line .= " ";
+			$command_line .= "\"";
+			if ($tm["ds_average"]){
+				$command_line .= " GPRINT:v".($cpt-1).":AVERAGE:\"Average\:%8.2lf%s";
+				$tm["ds_min"] || $tm["ds_max"] || $tm["ds_last"] ? $command_line .= "\"" : $command_line .= "\\l\" ";
+			}
+			if ($tm["ds_min"]){
+				$command_line .= " GPRINT:v".($cpt-1).":MIN:\"Min\:%8.2lf%s";
+				$tm["ds_max"] || $tm["ds_last"] ? $command_line .= "\"" : $command_line .= "\\l\" ";
+			}
+			if ($tm["ds_max"]){
+				$command_line .= " GPRINT:v".($cpt-1).":MAX:\"Max\:%8.2lf%s";
+				$tm["ds_last"] ? $command_line .= "\"" : $command_line .= "\\l\" ";
+			}
+			if ($tm["ds_last"])
+				$command_line .= " GPRINT:v".($cpt-1).":LAST:\"Last\:%8.2lf%s\\l\"";
+			$cpt++;
+		}
+		
+		$command_line = $oreon->optGen["rrdtool_path_bin"].$command_line." 2>&1";
+		$command_line = escape_command("$command_line");
+		//print $command_line;
+		$fp = popen($command_line  , 'r');
+		if (isset($fp) && $fp ) {
+			$str ='';
+			while (!feof ($fp)) {
+		  		$buffer = fgets($fp, 4096);
+		 		$str = $str . $buffer ;
+			}
+			print $str;
+		}	
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/generateImage/generateRRDImageCustom.php b/www/include/views/graphs/generateImage/generateRRDImageCustom.php
new file mode 100644
index 0000000000000000000000000000000000000000..ab18614818c50478037b8613c47b7891fab40efa
--- /dev/null
+++ b/www/include/views/graphs/generateImage/generateRRDImageCustom.php
@@ -0,0 +1,242 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function escape_command($command) {
+		return ereg_replace("(\\\$|`)", "", $command);
+	}
+	
+	require_once 'DB.php';
+	require_once ("../../../../class/Session.class.php");
+	require_once ("../../../../class/Oreon.class.php");
+
+	Session::start();
+	$oreon =& $_SESSION["oreon"];
+
+	/* Connect to Oreon DB */
+	
+	include("../../../../oreon.conf.php");
+	is_file ("../../../../lang/".$oreon->user->get_lang().".php") ? include_once ("../../../../lang/".$oreon->user->get_lang().".php") : include_once ("../../../../lang/en.php");	
+	require_once "../../../common/common-Func.php";
+	
+	$dsn = array(
+	    'phptype'  => 'mysql',
+	    'username' => $conf_oreon['user'],
+	    'password' => $conf_oreon['password'],
+	    'hostspec' => $conf_oreon['host'],
+	    'database' => $conf_oreon['db'],
+	);
+	
+	$options = array(
+	    'debug'       => 2,
+	    'portability' => DB_PORTABILITY_ALL ^ DB_PORTABILITY_LOWERCASE,
+	);
+	
+	$pearDB =& DB::connect($dsn, $options);
+	if (PEAR::isError($pearDB))
+	    die("Unable to connect : " . $pearDB->getMessage());
+	
+	$pearDB->setFetchMode(DB_FETCHMODE_ASSOC);
+	
+	$session =& $pearDB->query("SELECT * FROM `session` WHERE session_id = '".$_GET["session_id"]."'");
+	if (!$session->numRows()){
+		exit;
+	} else {
+		
+		include_once("../../../../DBPerfparseConnect.php");
+		
+		$graph_id = $_GET["graph_id"];
+		$command_line = " graph - ";
+		
+		if ($_GET["start"])
+			$command_line .= " --start=".$_GET["start"]. " --end=".$_GET["end"];
+		
+		# Get Graph Data
+		$graphCustom_d =& $pearDB->query("SELECT * FROM `giv_graphs` WHERE `graph_id` = '".$graph_id."'");
+		$graphCustom_d->fetchInto($graphCustom);
+		
+		if (!$graphCustom['grapht_graph_id']){
+			$graph = getDefaultGraph($graph_id, 3);
+		} else {
+			$graph = array("graph_id" => $graphCustom['grapht_graph_id'], "name" => "");
+		}
+		
+		$res =& $pearDB->query("SELECT * FROM `giv_graphs_template` WHERE graph_id = '".$graph["graph_id"]."'");
+		$res->fetchInto($GraphTemplate);
+		
+		# Create command line for graph properties
+		$command_line .= " --interlaced --width=".$GraphTemplate["width"]." --height=".$GraphTemplate["height"]." --title='Graph ".$GraphTemplate["title"]."' --alt-autoscale-max --vertical-label='".$GraphTemplate["vertical_label"]."' ";
+		$command_line .= "--color CANVAS".$GraphTemplate["bg_grid_color"]." ";
+		$command_line .= "--color BACK".$GraphTemplate["bg_color"]." ";
+		$command_line .= "--color FONT".$GraphTemplate["police_color"]." ";
+		$command_line .= "--color MGRID".$GraphTemplate["grid_main_color"]." ";
+		$command_line .= "--color GRID".$GraphTemplate["grid_sec_color"]." ";
+		$command_line .= "--color FRAME".$GraphTemplate["contour_cub_color"]." ";
+		$command_line .= "--color ARROW".$GraphTemplate["col_arrow"]." ";
+		$command_line .= "--color SHADEA".$GraphTemplate["col_top"]." ";
+		$command_line .= "--color SHADEB".$GraphTemplate["col_bot"]." ";
+		
+		$ppMetrics = array();
+		$rq = 	"SELECT compo_id, pp_metric_id, compot_compo_id FROM giv_components gc ".
+				"WHERE gc.graph_id = '".$graph_id."' ORDER BY ds_order";
+				
+		$res =& $pearDB->query($rq);
+		$cpt = 0;
+		while($res->fetchInto($ppMetric))	{
+			$ppMetrics[$ppMetric["pp_metric_id"]]["pp_metric_id"] = $ppMetric["pp_metric_id"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["compot_compo_id"] = $ppMetric["compot_compo_id"];
+			
+			$res2 =& $pearDBpp->query("SELECT * FROM `perfdata_service_metric` WHERE metric_id = '".$ppMetric["pp_metric_id"]."'");
+			$res2->fetchInto($metric_info);
+			
+			# Get Metric Infos 
+			if (!$ppMetric["compot_compo_id"])
+				$ppMetric["compot_compo_id"] = getDefaultDS($graph["graph_id"], $cpt);
+			//print $metric_info["metric"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["metric"] = $metric_info["metric"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["host_name"] = $metric_info["host_name"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["service_description"] = $metric_info["service_description"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["ds_id"] 	= $ppMetric["compot_compo_id"];
+			
+			# Get DS Data
+			$res_ds =& $pearDB->query("SELECT * FROM giv_components_template WHERE compo_id = '".$ppMetric["compot_compo_id"]."'");
+			$res_ds->fetchInto($ds_data);
+			$ppMetrics[$ppMetric["pp_metric_id"]]["ds_name"] = $ds_data["ds_name"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["ds_tickness"] = $ds_data["ds_tickness"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["ds_color_area"] = $ds_data["ds_color_area"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["ds_color_line"] = $ds_data["ds_color_line"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["ds_average"] = $ds_data["ds_average"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["ds_min"] = $ds_data["ds_min"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["ds_max"] = $ds_data["ds_max"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["ds_last"] = $ds_data["ds_last"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["ds_filled"] = $ds_data["ds_filled"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["ds_transparency"] = $ds_data["ds_transparency"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["ds_invert"] = $ds_data["ds_invert"];
+			
+			$ppMetrics[$ppMetric["pp_metric_id"]]["legend"] = $ds_data["name"];
+			$ppMetrics[$ppMetric["pp_metric_id"]]["legend_len"] = strlen($ppMetrics[$ppMetric["pp_metric_id"]]["legend"]);
+			$cpt++;
+		}
+		$res->free();	
+		
+		$cpt = 0;
+		$longer = 0;
+		foreach ($ppMetrics as $key => $tm){
+			if (isset($tm["ds_invert"]) && $tm["ds_invert"]){
+				$command_line .= " DEF:va".$cpt."=".$oreon->optGen["oreon_path"]."filesGeneration/graphs/graphCustoms/".$key.".rrd:ds".$key.":LAST ";
+				$command_line .= " CDEF:v".$cpt."=va".$cpt.",-1,* ";
+			} else 
+				$command_line .= " DEF:v".$cpt."=".$oreon->optGen["oreon_path"]."filesGeneration/graphs/graphCustoms/".$key.".rrd:ds".$key.":LAST ";
+			if ($tm["legend_len"] > $longer)
+				$longer = $tm["legend_len"];
+			$cpt++;
+		}	
+		if ($GraphTemplate["stacked"]){		
+			$cpt = 0;
+			$command_line .= " CDEF:total=";
+			foreach ($ppMetrics as $key => $tm){
+				if ($cpt)
+					$command_line .= ",";
+				$nameDEF = "v".$cpt;
+				$command_line .= "TIME,".$_GET['start'].",GT,$nameDEF,$nameDEF,UN,0,$nameDEF,IF,IF";
+				$cpt++;
+			}
+			for ($cpt2 = 1;$cpt2 != $cpt;$cpt2++)
+				$command_line .= ",+";
+			$command_line .= " ";
+		}
+		
+		$rrd_time  = addslashes(date("d\/m\/Y G:i", $_GET["start"])) ;
+		$rrd_time = str_replace(":", "\:", $rrd_time);
+		$rrd_time2 = addslashes(date("d\/m\/Y G:i", $_GET["end"])) ;
+		$rrd_time2 = str_replace(":", "\:", $rrd_time2);
+		$command_line .= " COMMENT:\" \\c\" COMMENT:\" From  $rrd_time to $rrd_time2 \\c\" COMMENT:\" \\c\" ";
+		
+		$cpt = 1;
+		foreach ($ppMetrics as $key => $tm){
+			$space_added = NULL;
+			
+			$legend = "\"";
+			$legend .= $ppMetrics[$key]["legend"];
+			for ($i = $ppMetrics[$key]["legend_len"]; $i != $longer + 1; $i++)
+				$legend .= " ";
+			$legend .= "\"";
+			
+			
+			//$legend = "\"".$tm["host_name"]." - ".$tm["service_description"]." (" . $tm["metric"].")\"";
+			/*
+			if ($GraphTemplate["stacked"] != "0"){
+				if ($ppMetrics[$key]["ds_filled"])
+					$command_line .= " AREA:v".($cpt-1)."".$tm["ds_color_area"]." ";
+				$command_line .= " LINE".$tm["ds_tickness"].":v".($cpt-1);
+			} else {
+				if (!$cpt){
+					$command_line .= " AREA:v".$graph_id."#".$tm["ds_color_area"].":".$legend."$space_added\"";
+				} else {
+					$command_line .= " STACK:v".$graph_id."#".$tm["ds_color_area"].":".$legend."$space_added\"";
+				}
+			} 
+			*/
+			if ($ppMetrics[$key]["ds_filled"] && $GraphTemplate["stacked"] == "0"){
+				$command_line .= " AREA:v".($cpt-1)."".$tm["ds_color_area"];
+				if (isset($tm["ds_transparency"]) && $tm["ds_transparency"] && !strcmp($oreon->optGen["rrdtool_version"], '1.2'))
+					;//$command_line .= $tm["ds_transparency"];
+				$command_line .= " ";
+			} else if ($GraphTemplate["stacked"] == "1")
+				$command_line .= " STACK:v".($cpt-1).$tm["ds_color_area"].":".$legend;
+			if ($GraphTemplate["stacked"] == "0"){
+				$command_line .= " LINE".$tm["ds_tickness"].":v".($cpt-1);
+				$command_line .= $tm["ds_color_line"].":".$legend;
+			}
+			if ($tm["ds_average"]){
+				$command_line .= " GPRINT:v".($cpt-1).":AVERAGE:\"Average\:%8.2lf%s";
+				$tm["ds_min"] || $tm["ds_max"] || $tm["ds_last"] ? $command_line .= "\"" : $command_line .= "\\l\" ";
+			}
+			if ($tm["ds_min"]){
+				$command_line .= " GPRINT:v".($cpt-1).":MIN:\"Min\:%8.2lf%s";
+				$tm["ds_max"] || $tm["ds_last"] ? $command_line .= "\"" : $command_line .= "\\l\" ";
+			}
+			if ($tm["ds_max"]){
+				$command_line .= " GPRINT:v".($cpt-1).":MAX:\"Max\:%8.2lf%s";
+				$tm["ds_last"] ? $command_line .= "\"" : $command_line .= "\\l\" ";
+			}
+			if ($tm["ds_last"])
+				$command_line .= " GPRINT:v".($cpt-1).":LAST:\"Last\:%8.2lf%s\\l\"";
+			$cpt++;
+		}
+		if (isset($GraphTemplate["stacked"]) && $GraphTemplate["stacked"]){
+			$space_added = NULL;
+			$command_line .= " LINE1:total#000000:\"Total$space_added\" GPRINT:total:AVERAGE:\"Average\:%8.2lf%s\" GPRINT:total:MIN:\"Min\:%8.2lf%s\" GPRINT:total:MAX:\"Max\:%8.2lf%s\" GPRINT:total:LAST:\"Last\:%8.2lf%s\\l\" ";	
+		}
+		$command_line = $oreon->optGen["rrdtool_path_bin"] . $command_line .  " 2>&1";
+		$command_line = escape_command("$command_line") ;
+		
+		// print $command_line;
+		
+		$fp = popen($command_line  , 'r');
+		if (isset($fp) && $fp ) {
+			$str ='';
+			while (!feof ($fp)) {
+		  		$buffer = fgets($fp, 4096);
+		 		$str = $str . $buffer ;
+			}
+			print $str;
+		}	
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/generateImage/generateRRDImagePlugins.php b/www/include/views/graphs/generateImage/generateRRDImagePlugins.php
new file mode 100644
index 0000000000000000000000000000000000000000..52ab38689066af96a1f64383131cd368a0252957
--- /dev/null
+++ b/www/include/views/graphs/generateImage/generateRRDImagePlugins.php
@@ -0,0 +1,235 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function escape_command($command) {
+		return ereg_replace("(\\\$|`)", "", $command);
+	}
+	
+	require_once 'DB.php';
+	
+	require_once ("../../../../class/Session.class.php");
+	require_once ("../../../../class/Oreon.class.php");
+
+	Session::start();
+	$oreon =& $_SESSION["oreon"];
+
+	/* Connect to Oreon DB */
+	
+	include("../../../../oreon.conf.php");
+	is_file ("../../../../lang/".$oreon->user->get_lang().".php") ? include_once ("../../../../lang/".$oreon->user->get_lang().".php") : include_once ("../../../../lang/en.php");	
+	
+	require_once "../../../common/common-Func.php";
+	
+	$dsn = array(
+	    'phptype'  => 'mysql',
+	    'username' => $conf_oreon['user'],
+	    'password' => $conf_oreon['password'],
+	    'hostspec' => $conf_oreon['host'],
+	    'database' => $conf_oreon['db'],
+	);
+	
+	$options = array(
+	    'debug'       => 2,
+	    'portability' => DB_PORTABILITY_ALL ^ DB_PORTABILITY_LOWERCASE,
+	);
+	
+	$pearDB =& DB::connect($dsn, $options);
+	if (PEAR::isError($pearDB))
+	    die("Unable to connect : " . $pearDB->getMessage());
+	
+	$pearDB->setFetchMode(DB_FETCHMODE_ASSOC);
+	
+	$session =& $pearDB->query("SELECT * FROM `session` WHERE session_id = '".$_GET["session_id"]."'");
+	if (!$session->numRows()){
+		exit;		// Session expired or invalide -> exit 
+	} else {		// Session Ok -> create image
+		$tab_id = split("\_", $_GET["database"]);
+		$res =& $pearDB->query("SELECT service_description FROM service WHERE service_id = '".$tab_id[1]."'");
+		$res->fetchInto($r);
+		$service_description = $r["service_description"];
+		$res =& $pearDB->query("SELECT host_name FROM host WHERE host_id = '".$tab_id[0]."'");
+		$res->fetchInto($r);
+		$host_name = $r["host_name"];
+		
+		if (!$_GET["template_id"])
+			$template_id = getDefaultGraph($tab_id[1], 2);
+		else 
+			$template_id = $_GET["template_id"];
+		$return = shell_exec($oreon->optGen['rrdtool_path_bin'] . " info " . $oreon->optGen["oreon_rrdbase_path"].$_GET["database"] . " ");
+		
+		// Recupe le Graph template
+		$tab_return = preg_split("/\n/", $return);
+		$tab_ds = array();
+		foreach ($tab_return as $tr)
+			if (preg_match("/^ds\[([a-zA-Z0-9]*)\].*/", $tr, $matches))
+				$tab_ds[$matches['1']] = $matches['1'];
+		
+		// Recupe les noms des legendes
+		// Recupe le DS (nombre et name)
+	
+		$ppMetrics = array();	
+		$cpt = 0;
+		foreach ($tab_ds as $t){		
+			# Get Metric Infos 
+			$ppMetrics[$t] = array();
+			$ppMetrics[$t]["ds_id"] = getDefaultDS($template_id, $cpt, 2);
+			# Get DS Data
+			$res_ds =& $pearDB->query("SELECT * FROM giv_components_template WHERE compo_id = '".$ppMetrics[$t]["ds_id"]."'");
+			$res_ds->fetchInto($ds_data);
+			foreach ($ds_data as $key => $ds_d)
+				$ppMetrics[$t][$key] = $ds_d;
+			$ppMetrics[$t]["legend"] = $ds_data["name"];
+			$ppMetrics[$t]["legend_len"] = strlen($ppMetrics[$t]["legend"]);
+			$cpt++;
+		}
+	
+		$command_line = " graph - ";
+		if (isset($_GET["start"]) && $_GET["start"])
+			$command_line .= " --start=".$_GET["start"]. " --end=".$_GET["end"];
+		else {
+			$res =& $pearDB->query("SELECT graph_id FROM extended_service_information WHERE service_service_id = '".$tab_id[1]."'");
+			$res->fetchInto($service_ext);
+			if (!$service_ext["graph_id"])
+				$period = 86400;
+			else {	
+				$res =& $pearDB->query("SELECT period FROM giv_graphs_template WHERE graph_id = '".$service_ext["graph_id"]."'");
+				$res->fetchInto($graph);
+				$period = $graph["period"];
+			}
+			$_GET["start"] = time() - ($period + 120);
+			$_GET["end"] = time();
+			$command_line .= " --start=".$_GET["start"]. " --end=".$_GET["end"];
+		}
+			
+		# Get Graph Data
+		
+		$res =& $pearDB->query("SELECT * FROM `giv_graphs_template` WHERE graph_id = '".$template_id."'");
+		$res->fetchInto($GraphTemplate);
+		
+		if (isset($_GET["nbgraph"])) {
+	    	if($_GET["nbgraph"]==2){
+	        	$GraphTemplate["width"] = $GraphTemplate["width"]/2; 
+	        	$GraphTemplate["height"] = $GraphTemplate["height"]/2;
+	        }
+	    }
+		
+		# Create command line for graph properties
+		$command_line .= " --interlaced --width=".$GraphTemplate["width"]." --height=".$GraphTemplate["height"]." --title='Graph ".$service_description." on ".$host_name." ' --vertical-label='".$GraphTemplate["vertical_label"]."' ";
+		$command_line .= "--color CANVAS".$GraphTemplate["bg_grid_color"]." ";
+		$command_line .= "--color BACK".$GraphTemplate["bg_color"]." ";
+		$command_line .= "--color FONT".$GraphTemplate["police_color"]." ";
+		$command_line .= "--color MGRID".$GraphTemplate["grid_main_color"]." ";
+		$command_line .= "--color GRID".$GraphTemplate["grid_sec_color"]." ";
+		$command_line .= "--color FRAME".$GraphTemplate["contour_cub_color"]." ";
+		$command_line .= "--color ARROW".$GraphTemplate["col_arrow"]." ";
+		$command_line .= "--color SHADEA".$GraphTemplate["col_top"]." ";
+		$command_line .= "--color SHADEB".$GraphTemplate["col_bot"]." ";
+		if (isset($GraphTemplate["upper_limit"]) && $GraphTemplate["upper_limit"] != NULL)
+			$command_line .= "--upper-limit=".$GraphTemplate["upper_limit"]." ";
+		else
+			$command_line .= " --alt-autoscale-max ";
+		if (isset($GraphTemplate["lower_limit"]) && $GraphTemplate["lower_limit"] != NULL)
+			$command_line .= "--lower-limit=".$GraphTemplate["lower_limit"]." ";
+		
+			
+		$cpt = 0;
+		$longer = 0;
+		foreach ($ppMetrics as $key => $tm){
+			if (isset($tm["ds_invert"]) && $tm["ds_invert"]){
+				$command_line .= " DEF:va".$cpt."=".$oreon->optGen["oreon_rrdbase_path"].$_GET["database"].":".$key.":AVERAGE ";
+				$command_line .= " CDEF:v".$cpt."=va".$cpt.",-1,* ";
+			} else 
+				$command_line .= " DEF:v".$cpt."=".$oreon->optGen["oreon_rrdbase_path"].$_GET["database"].":".$key.":AVERAGE ";
+			if ($tm["legend_len"] > $longer)
+				$longer = $tm["legend_len"];
+			$cpt++;
+		}	
+		
+		if ($GraphTemplate["stacked"]){		
+			$cpt = 0;
+			$command_line .= " CDEF:total=";
+			foreach ($ppMetrics as $key => $tm){
+				if ($cpt)
+					$command_line .= ",";
+				$nameDEF = "v".$cpt;
+				$command_line .= "TIME,".$_GET['start'].",GT,$nameDEF,$nameDEF,UN,0,$nameDEF,IF,IF";
+				$cpt++;
+			}
+			for ($cpt2 = 1;$cpt2 != $cpt;$cpt2++)
+				$command_line .= ",+";
+			$command_line .= " ";
+		}
+		
+		$rrd_time  = addslashes(date("d\/m\/Y G:i", $_GET["start"])) ;
+		$rrd_time = str_replace(":", "\:", $rrd_time);
+		$rrd_time2 = addslashes(date("d\/m\/Y G:i", $_GET["end"])) ;
+		$rrd_time2 = str_replace(":", "\:", $rrd_time2);
+		$command_line .= " COMMENT:\" \\c\" COMMENT:\" From  $rrd_time to $rrd_time2 \\c\" COMMENT:\" \\c\" ";
+		
+		$cpt = 1;
+		foreach ($ppMetrics as $key => $tm){
+			$space_added = NULL;
+			$legend = "\"" . $ppMetrics[$key]["legend"];
+			for ($i = $ppMetrics[$key]["legend_len"]; $i != $longer + 1; $i++)
+				$legend .= " ";
+			$legend .= "\"";
+			if ($ppMetrics[$key]["ds_filled"] && $GraphTemplate["stacked"] == "0"){
+				$command_line .= " AREA:v".($cpt-1)."".$tm["ds_color_area"];
+				$command_line .= " ";
+			} else if ($GraphTemplate["stacked"] == "1")
+				$command_line .= " STACK:v".($cpt-1).$tm["ds_color_area"].":".html_entity_decode($legend);
+			if ($GraphTemplate["stacked"] == "0"){
+				$command_line .= " LINE".$tm["ds_tickness"].":v".($cpt-1);
+				$command_line .= $tm["ds_color_line"].":".$legend;
+			}
+			if ($tm["ds_average"]){
+				$command_line .= " GPRINT:v".($cpt-1).":AVERAGE:\"Average\:%8.2lf%s";
+				$tm["ds_min"] || $tm["ds_max"] || $tm["ds_last"] ? $command_line .= "\"" : $command_line .= "\\l\" ";
+			}
+			if ($tm["ds_min"]){
+				$command_line .= " GPRINT:v".($cpt-1).":MIN:\"Min\:%8.2lf%s";
+				$tm["ds_max"] || $tm["ds_last"] ? $command_line .= "\"" : $command_line .= "\\l\" ";
+			}
+			if ($tm["ds_max"]){
+				$command_line .= " GPRINT:v".($cpt-1).":MAX:\"Max\:%8.2lf%s";
+				$tm["ds_last"] ? $command_line .= "\"" : $command_line .= "\\l\" ";
+			}
+			if ($tm["ds_last"])
+				$command_line .= " GPRINT:v".($cpt-1).":LAST:\"Last\:%8.2lf%s\\l\"";
+			$cpt++;
+		}
+		
+		if (isset($GraphTemplate["stacked"]) && $GraphTemplate["stacked"]){
+			$space_added = NULL;
+			$command_line .= " LINE1:total#000000:\"Total$space_added\" GPRINT:total:AVERAGE:\"Average\:%8.2lf%s\" GPRINT:total:MIN:\"Min\:%8.2lf%s\" GPRINT:total:MAX:\"Max\:%8.2lf%s\" GPRINT:total:LAST:\"Last\:%8.2lf%s\\l\" ";	
+		}
+		
+		$command_line = $oreon->optGen["rrdtool_path_bin"] . $command_line;// .  " 2>&1";
+		$command_line = escape_command("$command_line") ;		
+		$fp = popen($command_line  , 'r');
+		if (isset($fp) && $fp ){
+			for ($str = '';!feof ($fp);) {
+		  		$buffer = fgets($fp, 4096);
+		 		$str = $str . $buffer ;
+			}
+			print $str;
+		}	
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/graphCustoms/DB-Func.php b/www/include/views/graphs/graphCustoms/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..fe43b67c6093b4e10e762bb564a3248070940f3b
--- /dev/null
+++ b/www/include/views/graphs/graphCustoms/DB-Func.php
@@ -0,0 +1,314 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function testExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('graph_id');
+		$res =& $pearDB->query("SELECT graph_id, name FROM giv_graphs WHERE name = '".htmlentities($name, ENT_QUOTES)."'");
+		$graph =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $graph["graph_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $graph["graph_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function deleteGraphInDB ($graphs = array())	{
+		global $pearDB;
+		foreach($graphs as $key=>$value)
+			$pearDB->query("DELETE FROM giv_graphs WHERE graph_id = '".$key."'");
+	}
+	
+	function deleteMetricInDB ($compos = array())	{
+		global $pearDB;
+		foreach($compos as $key=>$value)
+			$pearDB->query("DELETE FROM giv_components WHERE compo_id = '".$key."'");
+	}
+	
+	function upMetricInDB($graph_id = NULL, $compo_id = NULL)	{
+		global $pearDB;
+		if (!$compo_id || !$graph_id) return;
+		$rq = "SELECT compo_id, ds_order FROM giv_components gc WHERE gc.graph_id = '".$graph_id."' ORDER BY ds_order";
+		$res =& $pearDB->query($rq);
+		$cpt = 20;
+		while ($res->fetchInto($compo))	{
+			$up = 0;
+			if ($compo_id == $compo["compo_id"])
+				$up = 15;
+			$rq = "UPDATE giv_components SET ds_order = '".($cpt-$up)."' WHERE compo_id = '".$compo["compo_id"]."'";
+			$pearDB->query($rq);
+			$cpt += 10;
+		}
+		$res->free();
+	}
+	
+	function downMetricInDB($graph_id = NULL, $compo_id = NULL)	{
+		global $pearDB;
+		if (!$compo_id || !$graph_id) return;
+		$rq = "SELECT compo_id, ds_order FROM giv_components gc WHERE gc.graph_id = '".$graph_id."' ORDER BY ds_order";
+		$res =& $pearDB->query($rq);
+		$cpt = 20;
+		while ($res->fetchInto($compo))	{
+			$up = 0;
+			if ($compo_id == $compo["compo_id"])
+				$up = 15;
+			$rq = "UPDATE giv_components SET ds_order = '".($cpt+$up)."' WHERE compo_id = '".$compo["compo_id"]."'";
+			$pearDB->query($rq);
+			$cpt += 10;
+		}
+		$res->free();
+		
+	}
+	
+	function multipleGraphInDB ($graphs = array(), $nbrDup = array())	{
+		foreach($graphs as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM giv_graphs WHERE graph_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["graph_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "name" ? ($name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testExistence($name))	{
+					$val ? $rq = "INSERT INTO giv_graphs VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(graph_id) FROM giv_graphs");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(graph_id)"]))	{
+						$res =& $pearDB->query("SELECT * FROM giv_components WHERE graph_id = '".$key."'");
+						while($res->fetchInto($compo))	{
+							$val = null;
+							$compo["compo_id"] = '';
+							$compo["graph_id"] = $maxId["MAX(graph_id)"];			
+							foreach ($compo as $key2=>$value2)
+								$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+							$val ? $rq = "INSERT INTO giv_components VALUES (".$val.")" : $rq = null;
+							$pearDB->query($rq);
+						}
+					}
+				}
+			}
+		}
+	}
+	
+	function updateGraphInDB ($graph_id = NULL)	{
+		if (!$graph_id) return;
+		updateGraph($graph_id);
+	}	
+	
+	function insertGraphInDB ()	{
+		$graph_id = insertGraph();
+		return ($graph_id);
+	}	
+	
+	function insertMetricsInDB ()	{
+		insertMetric();
+	}
+	
+	function updateMetricsInDB ($compo_id)	{
+		updateMetric($compo_id);
+	}
+	
+	function insertGraph()	{
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO `giv_graphs` ( `graph_id` , `name`, `grapht_graph_id` , `comment` ) ";
+		$rq .= "VALUES (";
+		$rq .= "NULL, ";
+		isset($ret["name"]) && $ret["name"] != NULL ? $rq .= "'".htmlentities($ret["name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["grapht_graph_id"]) && $ret["grapht_graph_id"] != NULL ? $rq .= "'".$ret["grapht_graph_id"]."', ": $rq .= "NULL, ";
+		isset($ret["comment"]) && $ret["comment"] != NULL ? $rq .= "'".htmlentities($ret["comment"], ENT_QUOTES)."'": $rq .= "NULL";
+		$rq .= ")";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(graph_id) FROM giv_graphs");
+		$graph_id = $res->fetchRow();
+		return ($graph_id["MAX(graph_id)"]);
+	}
+	
+	function updateGraph($graph_id = null)	{
+		if (!$graph_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE giv_graphs ";
+		$rq .= "SET name = ";
+		isset($ret["name"]) && $ret["name"] != NULL ? $rq .= "'".htmlentities($ret["name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .=	"grapht_graph_id = ";
+		isset($ret["grapht_graph_id"]) && $ret["grapht_graph_id"] != NULL ? $rq .= "'".$ret["grapht_graph_id"]."', ": $rq .= "NULL, ";
+		$rq .= "comment = ";
+		isset($ret["comment"]) && $ret["comment"] != NULL ? $rq .= "'".htmlentities($ret["comment"], ENT_QUOTES)."' ": $rq .= "NULL ";
+		$rq .= "WHERE graph_id = '".$graph_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function insertMetric()	{
+		global $form1;
+		global $pearDB;
+		$ret = array();
+		$ret = $form1->getSubmitValues();
+		$arr1 = array();
+		$arr2 = array();
+		$arr3 = array();
+		if (isset($ret["metric_sel1"]))
+			$arr1 =& $ret["metric_sel1"];
+		if (isset($ret["metric_sel2"]))
+			$arr2 =& $ret["metric_sel2"];
+		if (isset($ret["metric_sel3"]))
+			$arr3 =& $ret["metric_sel3"];
+		
+		if ($arr1)	{
+			$rq = "INSERT INTO `giv_components` ( `compo_id` , `ds_order`, `graph_id` , `compot_compo_id`, `pp_metric_id` ) ";
+			$rq .= "VALUES (";
+			$rq .= "NULL, NULL,";
+			isset($ret["graph_id"]) && $ret["graph_id"] != NULL ? $rq .= "'".$ret["graph_id"]."', ": $rq .= "NULL, ";
+			isset($ret["compot_1"]) && $ret["compot_1"] != NULL ? $rq .= "'".$ret["compot_1"]."', ": $rq .= "NULL, ";
+			isset($arr1[1]) && $arr1[1] != NULL ? $rq .= "'".$arr1[1]."'": $rq .= "NULL";
+			$rq .= ")";
+			$pearDB->query($rq);				
+		}
+		if ($arr2)	{
+			$rq = "INSERT INTO `giv_components` ( `compo_id` , `ds_order`, `graph_id` , `compot_compo_id`, `pp_metric_id` ) ";
+			$rq .= "VALUES (";
+			$rq .= "NULL, NULL,";
+			isset($ret["graph_id"]) && $ret["graph_id"] != NULL ? $rq .= "'".$ret["graph_id"]."', ": $rq .= "NULL, ";
+			isset($ret["compot_2"]) && $ret["compot_2"] != NULL ? $rq .= "'".$ret["compot_2"]."', ": $rq .= "NULL, ";
+			isset($arr2) && $arr2 != NULL ? $rq .= "'".$arr2."'": $rq .= "NULL";
+			$rq .= ")";
+			$pearDB->query($rq);				
+		}
+		if ($arr3)	{
+			$rq = "INSERT INTO `giv_components` ( `compo_id` , `ds_order`, `graph_id` , `compot_compo_id`, `pp_metric_id` ) ";
+			$rq .= "VALUES (";
+			$rq .= "NULL, NULL,";
+			isset($ret["graph_id"]) && $ret["graph_id"] != NULL ? $rq .= "'".$ret["graph_id"]."', ": $rq .= "NULL, ";
+			isset($ret["compot_3"]) && $ret["compot_3"] != NULL ? $rq .= "'".$ret["compot_3"]."', ": $rq .= "NULL, ";
+			isset($arr3) && $arr3 != NULL ? $rq .= "'".$arr3."'": $rq .= "NULL";
+			$rq .= ")";
+			$pearDB->query($rq);				
+		}
+	}
+	
+	function updateMetric($compo_id)	{
+		global $form1;
+		global $pearDB;
+		$ret = array();
+		$ret = $form1->getSubmitValues();
+		$arr1 = array();
+		$arr2 = array();
+		$arr3 = array();
+		if (isset($ret["metric_sel1"]))
+			$arr1 =& $ret["metric_sel1"];
+		if (isset($ret["metric_sel2"]))
+			$arr2 =& $ret["metric_sel2"];
+		if (isset($ret["metric_sel3"]))
+			$arr3 =& $ret["metric_sel3"];
+		
+		if ($arr1)	{
+			$rq = "UPDATE `giv_components` SET ";
+			$rq .= "`compot_compo_id` = ";
+			isset($ret["compot_1"]) && $ret["compot_1"] != NULL ? $rq .= "'".$ret["compot_1"]."', ": $rq .= "NULL, ";
+			$rq .= "`pp_metric_id` = ";
+			isset($arr1[1]) && $arr1[1] != NULL ? $rq .= "'".$arr1[1]."' ": $rq .= "NULL ";
+			$rq .= "WHERE compo_id = '".$compo_id."'";
+			$pearDB->query($rq);
+		}
+		if ($arr2)	{
+			$rq = "UPDATE `giv_components` SET ";
+			$rq .= "`compot_compo_id` = ";
+			isset($ret["compot_2"]) && $ret["compot_2"] != NULL ? $rq .= "'".$ret["compot_2"]."', ": $rq .= "NULL, ";
+			$rq .= "`pp_metric_id` = ";
+			isset($arr2) && $arr2 != NULL ? $rq .= "'".$arr2."' ": $rq .= "NULL ";
+			$rq .= "WHERE compo_id = '".$compo_id."'";
+			$pearDB->query($rq);	
+		}
+		if ($arr3)	{
+			$rq = "UPDATE `giv_components` SET ";
+			$rq .= "`compot_compo_id` = ";
+			isset($ret["compot_3"]) && $ret["compot_3"] != NULL ? $rq .= "'".$ret["compot_3"]."', ": $rq .= "NULL, ";
+			$rq .= "`pp_metric_id` = ";
+			isset($arr3) && $arr3 != NULL ? $rq .= "'".$arr3."' ": $rq .= "NULL ";
+			$rq .= "WHERE compo_id = '".$compo_id."'";
+			$pearDB->query($rq);		
+		}
+	}
+/*	
+	function getDefaultGraph ($graph_id = NULL)	{		
+		if (!$graph_id)	return;
+		global $pearDB;
+		$gt = array("graph_id"=>NULL, "name"=>NULL);
+		$res =& $pearDB->query("SELECT ggt.graph_id, ggt.name FROM giv_graphs_template ggt, giv_graphs gg WHERE gg.graph_id = '".$graph_id."' AND gg.grapht_graph_id = ggt.graph_id");
+		if ($res->numRows())	{
+			$gt =& $res->fetchRow();
+			$res->free();
+			return $gt;
+		}
+		$res =& $pearDB->query("SELECT graph_id, name FROM giv_graphs_template WHERE default_tpl1 = '1' LIMIT 1");
+		if ($res->numRows())	{
+			$gt =& $res->fetchRow();
+			$res->free();
+			return $gt;
+		} else	{
+			$res =& $pearDB->query("SELECT graph_id, nameFROM giv_graphs_template LIMIT 1");
+			if ($res->numRows())	{
+				$gt =& $res->fetchRow();
+				$res->free();
+				return $gt;
+			}			
+		}
+		return $gt;
+	}
+	
+	
+	function getDefaultDS ($graph_id = NULL, $current_ds = NULL)	{
+		if (!$graph_id) return NULL;
+		global $pearDB;
+		$ds = array();
+		$res =& $pearDB->query("SELECT gct.compo_id FROM giv_components_template gct, giv_graphT_componentT_relation ggcr WHERE ggcr.gg_graph_id = '".$graph_id."' AND ggcr.gc_compo_id = gct.compo_id ORDER BY gct.ds_order");
+		$cpt = 0;
+		$sum = $res->numRows();
+		while ($res->fetchInto($ds))	{
+			if ($current_ds == $cpt)
+				return $ds["compo_id"];
+			$cpt++;				 
+		}
+		$res =& $pearDB->query("SELECT compo_id FROM giv_components_template WHERE default_tpl1 = '1' LIMIT 1");
+		if ($res->numRows())	{
+			$ds =& $res->fetchRow();
+				return $ds["compo_id"];
+		}
+		$res =& $pearDB->query("SELECT compo_id FROM giv_components_template LIMIT 1");
+		if ($res->numRows())	{
+			$ds =& $res->fetchRow();
+				return $ds["compo_id"];
+		}
+		return NULL;
+	}
+*/
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/graphCustoms/formGraphCustom.ihtml b/www/include/views/graphs/graphCustoms/formGraphCustom.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..57267db2769b2748bc74a7f4c8f53b1309a61972
--- /dev/null
+++ b/www/include/views/graphs/graphCustoms/formGraphCustom.ihtml
@@ -0,0 +1,30 @@
+{$form.javascript}
+<form {$form.attributes}>
+<div>
+</div>
+<div id='tab1' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/chart.gif'>&nbsp;&nbsp;{$form.header.ftitle}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+	 	
+		<tr class="list_one"><td class="FormRowField">{$form.name.label}</td><td class="FormRowValue">{$form.name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.grapht_graph_id.label}</td><td class="FormRowValue">{$form.grapht_graph_id.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.comment.label}</td><td class="FormRowValue">{$form.comment.html}</td></tr>
+
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+</div>
+<div id="validForm">
+{if $o == "a" || $o == "c"}
+	<p>{$form.action.html}</p>
+	<p>{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+{else if $o == "w"}
+	<p>{$form.change.html}</p>
+{/if}
+</div>
+{$form.hidden}
+</form>
+
diff --git a/www/include/views/graphs/graphCustoms/formGraphCustom.php b/www/include/views/graphs/graphCustoms/formGraphCustom.php
new file mode 100644
index 0000000000000000000000000000000000000000..2ffd263a5a9ff4ade9a7ab1169dd1fe07ba28014
--- /dev/null
+++ b/www/include/views/graphs/graphCustoms/formGraphCustom.php
@@ -0,0 +1,145 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information
+	#
+	$graph = array();
+	if (($o == "c" || $o == "w") && $graph_id)	{	
+		$res =& $pearDB->query("SELECT * FROM giv_graphs WHERE graph_id = '".$graph_id."' LIMIT 1");
+		# Set base value
+		$graph = array_map("myDecode", $res->fetchRow());	
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Components comes from DB -> Store in $compos Array
+	$graphTs = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT graph_id, name FROM giv_graphs_template ORDER BY name");
+	while($res->fetchInto($graphT))
+		$graphTs[$graphT["graph_id"]] = $graphT["name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsText2 	= array("size"=>"6");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"3", "cols"=>"30");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'ftitle', $lang["giv_gg_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'ftitle', $lang["giv_gg_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'ftitle', $lang["giv_gg_view"]);
+
+	#
+	## Basic information
+	#
+	$form->addElement('header', 'information', $lang['giv_gg_infos']);
+	$form->addElement('text', 'name', $lang["giv_gg_name"], $attrsText);	
+	$form->addElement('select', 'grapht_graph_id', $lang["giv_gg_tpl"], $graphTs);
+	$form->addElement('textarea', 'comment', $lang["giv_gg_comment"], $attrsTextarea);
+	
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+
+	$form->addElement('hidden', 'graph_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('name', $lang['ErrName'], 'required');
+	$form->registerRule('exist', 'callback', 'testExistence');
+	$form->addRule('name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+	
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Just watch
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&graph_id=".$graph_id."'"));
+	    $form->setDefaults($graph);
+		$form->freeze();
+	}
+	# Modify
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["delete"]);
+	    $form->setDefaults($graph);
+	}
+	# Add
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["delete"]);
+	}
+	$tpl->assign('msg', array ("changeL"=>"?p=".$p."&o=c&graph_id=".$graph_id, "changeT"=>$lang['modify']));
+	
+	#
+	##End of Picker Color
+	#
+	
+	$valid = false;
+	if ($form->validate())	{
+		$graphObj =& $form->getElement('graph_id');
+		if ($form->getSubmitValue("submitA"))
+			$graphObj->setValue(insertGraphInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateGraphInDB($graphObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&graph_id=".$graphObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once("listGraphCustoms.php");
+	else	{
+		#Apply a template definition	
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("formGraphCustom.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/graphCustoms/graphCustoms.php b/www/include/views/graphs/graphCustoms/graphCustoms.php
new file mode 100644
index 0000000000000000000000000000000000000000..b5bdc43223b93d645c8efcd3254c3e78a37c1eb5
--- /dev/null
+++ b/www/include/views/graphs/graphCustoms/graphCustoms.php
@@ -0,0 +1,70 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["compo_id"]) ? $cG = $_GET["compo_id"] : $cG = NULL;
+	isset($_POST["compo_id"]) ? $cP = $_POST["compo_id"] : $cP = NULL;
+	$cG ? $compo_id = $cG : $compo_id = $cP;
+	
+	isset($_GET["graph_id"]) ? $cG = $_GET["graph_id"] : $cG = NULL;
+	isset($_POST["graph_id"]) ? $cP = $_POST["graph_id"] : $cP = NULL;
+	$cG ? $graph_id = $cG : $graph_id = $cP;
+	
+	isset($_GET["host_name"]) ? $cG = $_GET["host_name"] : $cG = NULL;
+	isset($_POST["host_name"]) ? $cP = $_POST["host_name"] : $cP = NULL;
+	$cG ? $host_name = $cG : $host_name = $cP;
+	
+	isset($_GET["meta_service"]) ? $cG = $_GET["meta_service"] : $cG = NULL;
+	isset($_POST["meta_service"]) ? $cP = $_POST["meta_service"] : $cP = NULL;
+	$cG ? $meta_service = $cG : $meta_service = $cP;
+	
+	isset($_GET["osl"]) ? $cG = $_GET["osl"] : $cG = NULL;
+	isset($_POST["osl"]) ? $cP = $_POST["osl"] : $cP = NULL;
+	$cG ? $osl = $cG : $osl = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/views/graphs/graphCustoms/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formGraphCustom.php"); break; #Add a Graph Customs
+		case "w" : require_once($path."viewGraphCustoms.php"); break; #Watch aGraph Customs
+		case "c" : require_once($path."formGraphCustom.php"); break; #Modify a Graph Customs
+		case "m" : multipleGraphInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listGraphCustoms.php"); break; #Duplicate n Graph Customs
+		case "d" : deleteGraphInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listGraphCustoms.php"); break; #Delete n Graph Customs
+		case "cm" : require_once($path."listMetrics.php"); break; #Show Metrics
+		case "mm" : require_once($path."listMetrics.php"); break; #Modify a Metric
+		case "dm" : deleteMetricInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listMetrics.php"); break; #Delete n Metrics
+		case "up" : upMetricInDB($graph_id, $compo_id); require_once($path."listMetrics.php"); break; #Metric Up
+		case "down" : downMetricInDB($graph_id, $compo_id); require_once($path."listMetrics.php"); break; #Metric Down
+		case "wup" : upMetricInDB($graph_id, $compo_id); require_once($path."viewGraphCustoms.php"); break; #Watch aGraph Customs
+		case "wdown" : downMetricInDB($graph_id, $compo_id);require_once($path."viewGraphCustoms.php"); break; #Watch aGraph Customs
+		default : require_once($path."listGraphCustoms.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/graphCustoms/listGraphCustoms.ihtml b/www/include/views/graphs/graphCustoms/listGraphCustoms.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..7214ba3a43b57a5073775652c14e515b6df456fc
--- /dev/null
+++ b/www/include/views/graphs/graphCustoms/listGraphCustoms.ihtml
@@ -0,0 +1,42 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_tpl}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_compo}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_tpl}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_compo}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="2"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
\ No newline at end of file
diff --git a/www/include/views/graphs/graphCustoms/listGraphCustoms.php b/www/include/views/graphs/graphCustoms/listGraphCustoms.php
new file mode 100644
index 0000000000000000000000000000000000000000..3aec42f0b395b5fc59fda8637468e5c56619c6df
--- /dev/null
+++ b/www/include/views/graphs/graphCustoms/listGraphCustoms.php
@@ -0,0 +1,95 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM giv_graphs WHERE name LIKE '%".$search."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM giv_graphs");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_tpl", $lang['giv_gg_tpl']);
+	$tpl->assign("headerMenu_compo", $lang['giv_compo']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+
+	#List
+	if ($search)
+		$rq = "SELECT @nbr:=(SELECT COUNT(graph_id) FROM giv_components gc WHERE gc.graph_id = gg.graph_id) AS nbr, @tpl:=(SELECT name FROM giv_graphs_template ggt WHERE ggt.graph_id = gg.grapht_graph_id) AS tpl, graph_id, name FROM giv_graphs gg WHERE name LIKE '%".$search."%' ORDER BY name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT @nbr:=(SELECT COUNT(graph_id) FROM giv_components gc WHERE gc.graph_id = gg.graph_id) AS nbr, @tpl:=(SELECT name FROM giv_graphs_template ggt WHERE ggt.graph_id = gg.grapht_graph_id) AS tpl, graph_id, name FROM giv_graphs gg ORDER BY name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($graph); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$graph['graph_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&graph_id=".$graph['graph_id']."&o=cm&search=".$search."'><img src='img/icones/16x16/signpost.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&graph_id=".$graph['graph_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&graph_id=".$graph['graph_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&graph_id=".$graph['graph_id']."&o=d&select[".$graph['graph_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$graph['graph_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$graph["name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&graph_id=".$graph['graph_id'],
+						"RowMenu_tpl"=>$graph["tpl"] ? $graph["tpl"] : $lang["none"],
+						"RowMenu_compo"=>$graph["nbr"],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";
+	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listGraphCustoms.ihtml");
+	
+?>
diff --git a/www/include/views/graphs/graphCustoms/listMetrics.ihtml b/www/include/views/graphs/graphCustoms/listMetrics.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..5c9108fcabab98c37af9b060bb77637665e0f627
--- /dev/null
+++ b/www/include/views/graphs/graphCustoms/listMetrics.ihtml
@@ -0,0 +1,73 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<div>
+	{$form1.javascript}
+    <form {$form1.attributes}>
+        <table id="ListTable">
+                <tr class="ListHeader">
+                	<td class="FormHeader" colspan="2">{$form1.header.title}</td>
+                <tr>
+                <tr class="list_one">
+            		<td>{$form1.host_name.label}/{$form1.metric_sel1.label}</td>
+            		<td>{$form1.host_name.html}&nbsp;&nbsp;{$form1.metric_sel1.html}</td>
+                </tr>
+                <tr class="list_two">
+            		<td>{$form1.compot_1.label}</td>
+            		<td>{$form1.compot_1.html}</td>
+                </tr>
+                <tr class="list_one">
+                    <td>{$form1.meta_service.label}</td>
+            		<td>{$form1.meta_service.html}&nbsp;&nbsp;{$form1.metric_sel2.html}</td>
+                </tr>
+                <tr class="list_two">
+                    <td>{$form1.compot_2.label}</td>
+            		<td>{$form1.compot_2.html}</td>
+                </tr>
+                <tr class="list_one">
+                    <td>{$form1.osl.label}</td>
+            		<td>{$form1.osl.html}&nbsp;&nbsp;{$form1.metric_sel3.html}</td>
+                </tr>
+                <tr class="list_two">
+                    <td>{$form1.compot_3.label}</td>
+            		<td>{$form1.compot_3.html}</td>
+                </tr>
+        </table>
+        <div id="validForm">
+        	<p>{$form1.submitA.html}&nbsp;&nbsp;&nbsp;{$form1.reset.html}</p>
+        </div>
+        {$form1.hidden}
+    </form>
+</div>
+<br><br><br><br>
+<div>
+	<form {$form2_attributes}>
+		{$form2.hidden}
+		<table id="ListTable">
+			<tr class="ListHeader">
+				<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+				<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+				<td class="ListColHeaderCenter">{$headerMenu_desc}</td>
+				<td class="ListColHeaderCenter">{$headerMenu_metric}</td>
+				<td class="ListColHeaderCenter">{$headerMenu_compo}</td>
+				<td class="ListColHeaderRight">{$headerMenu_options}</td>
+			</tr>
+			{section name=elem loop=$elemArr}
+			<tr class={$elemArr[elem].MenuClass}>
+				<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+				<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+				<td class="ListColCenter">{$elemArr[elem].RowMenu_desc}</td>
+				<td class="ListColCenter">{$elemArr[elem].RowMenu_metric}</td>
+				<td class="ListColCenter">{$elemArr[elem].RowMenu_compo}</td>
+				<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+			</tr>
+			{/section}
+			<tr>
+				<td class="ListColFooterLeft" align="left" colspan="4">
+					&nbsp;&nbsp;&nbsp;
+					<input type="image" name="o" value="dm" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+				</td>
+				<td class="ListColFooterCenter" colspan="1"></td>
+				<td class="ListColFooterRight" align="right"></td>
+			</tr>		
+		</table>
+	</form>
+</div>
\ No newline at end of file
diff --git a/www/include/views/graphs/graphCustoms/listMetrics.php b/www/include/views/graphs/graphCustoms/listMetrics.php
new file mode 100644
index 0000000000000000000000000000000000000000..36ada8e6d199e9494325e249041089be27eeaa8c
--- /dev/null
+++ b/www/include/views/graphs/graphCustoms/listMetrics.php
@@ -0,0 +1,238 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	require_once("./DBPerfparseConnect.php");
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	$form1 = new HTML_QuickForm('select_form', 'POST', "?p=".$p);
+
+	if ($o == "mm" && $compo_id)	{
+		$res =& $pearDB->query("SELECT DISTINCT compot_compo_id, pp_metric_id FROM giv_components WHERE compo_id = '".$compo_id."'");
+		$compo =& $res->fetchRow();
+		$res =& $pearDBpp->query("SELECT * FROM perfdata_service_metric WHERE metric_id = '".$compo["pp_metric_id"]."'");
+		if ($res->numRows())	{
+			$metric =& $res->fetchRow();
+			$def = array();
+			if ($metric["host_name"] == "Meta_Module")	{
+				$form1->setDefaults(array("meta_service"=>$metric["service_description"], "metric_sel2"=>$metric["metric"], "compot_2"=>$compo["compot_compo_id"]));
+				$meta_service = $metric["service_description"];
+			}
+			else if ($metric["host_name"] == "OSL_Module")	{
+				$form1->setDefaults(array("osl"=>$metric["service_description"], "metric_sel3"=>$metric["metric"], "compot_3"=>$compo["compot_compo_id"]));
+				$osl = $metric["service_description"];
+			}
+			else	{
+				$form1->setDefaults(array("host_name"=>$metric["host_name"], "metric_sel1"=>array(0=>$metric["service_description"], 1=>$metric["metric"]), "compot_1"=>$compo["compot_compo_id"]));
+				$host_name = $metric["host_name"];
+			}
+		}
+		
+		$res->free();
+	}
+		
+	if (isset($_POST["submitA"]) && $_POST["submitA"] && $form1->validate() && $compo_id)	{
+		updateMetricsInDB($compo_id);
+		$o = "cm";
+		$compo_id = NULL;
+	}	
+	else if (isset($_POST["submitA"]) && $_POST["submitA"] && $form1->validate())	{
+		insertMetricsInDB();
+	}
+	
+	#
+	## Form
+	#
+	#
+		## Database retrieve information for differents elements list we need on the page
+
+		#	
+		# Components from DB -> Store in $compos Array
+		$compos = array(NULL=>NULL);
+		$res =& $pearDB->query("SELECT DISTINCT compo_id, name FROM giv_components_template ORDER BY name");
+		while($res->fetchInto($compo))
+			$compos[$compo["compo_id"]] = $compo["name"];
+		$res->free();		
+
+		#	
+		# Resources comes from DB -> Store in $ppHosts Array
+		$ppHosts = array(NULL=>NULL);
+		$res =& $pearDBpp->query("SELECT DISTINCT host_name FROM perfdata_service_metric ORDER BY host_name");
+		while($res->fetchInto($ppHost))	{
+			if (array_search($ppHost["host_name"], $oreon->user->lcaHost))
+				$ppHosts[$ppHost["host_name"]] = $ppHost["host_name"]; 
+			else if ($ppHost["host_name"] == "Meta_Module")	{
+				
+			}
+		}
+		$res->free();		
+		$ppServices1 = array();
+		$ppServices2 = array();
+		if ($host_name)	{
+			# Perfparse Host comes from DB -> Store in $ppHosts Array
+			$ppServices = array(NULL=>NULL);
+			$res =& $pearDBpp->query("SELECT DISTINCT metric_id, service_description, metric, unit FROM perfdata_service_metric WHERE host_name = '".$host_name."' ORDER BY host_name");
+			while($res->fetchInto($ppService))	{
+				$ppServices1[$ppService["service_description"]] = $ppService["service_description"];
+				$ppServices2[$ppService["service_description"]][$ppService["metric_id"]] = $ppService["metric"]."  (".$ppService["unit"].")";
+			}
+			$res->free();		
+		}
+		
+		# Perfparse Meta Services comes from DB -> Store in $ppMSs Array
+		$ppMSs = array(NULL=>NULL);
+		$res =& $pearDBpp->query("SELECT DISTINCT service_description FROM perfdata_service_metric WHERE host_name = 'Meta_Module' ORDER BY service_description");
+		while($res->fetchInto($ppMS))	{
+			$id = explode("_", $ppMS["service_description"]);
+			$res2 =& $pearDB->query("SELECT meta_name FROM meta_service WHERE meta_id = '".$id[1]."'");
+			$meta =& $res2->fetchRow();
+			$ppMSs[$ppMS["service_description"]] = $meta["meta_name"];
+			$res2->free();
+		}
+		$res->free();
+		$ppServices3 = array();
+		if ($meta_service)	{
+			$ppServices = array(NULL=>NULL);
+			$res =& $pearDBpp->query("SELECT DISTINCT metric_id, metric, unit FROM perfdata_service_metric WHERE host_name = 'Meta_Module' AND service_description = '".$meta_service."' ORDER BY metric");
+			while($res->fetchInto($ppService))	
+				$ppServices3[$ppService["metric_id"]] = $ppService["metric"]."  (".$ppService["unit"].")";
+			$res->free();		
+		}
+		
+		# Perfparse OSL comes from DB -> Store in $ppOSLs Array
+		$ppOSLs = array(NULL=>NULL);
+		$res =& $pearDBpp->query("SELECT DISTINCT service_description FROM perfdata_service_metric WHERE host_name = 'OSL_Module' ORDER BY service_description");
+		while($res->fetchInto($ppOSL))	{
+			$id = explode("_", $ppOSL["service_description"]);
+			$res2 =& $pearDB->query("SELECT name FROM osl WHERE osl_id = '".$id[1]."'");
+			$OSL =& $res2->fetchRow();
+			$ppOSLs[$ppOSL["service_description"]] = $OSL["name"];
+			$res2->free();
+		}
+		$res->free();
+		$ppServices4 = array();
+		if ($osl)	{
+			$ppServices = array(NULL=>NULL);
+			$res =& $pearDBpp->query("SELECT DISTINCT metric_id, metric, unit FROM perfdata_service_metric WHERE host_name = 'OSL_Module' AND service_description = '".$osl."' ORDER BY metric");
+			while($res->fetchInto($ppService))	
+				$ppServices4[$ppService["metric_id"]] = $ppService["metric"]."  (".$ppService["unit"].")";
+			$res->free();		
+		}
+	
+	
+	$form1->addElement('header', 'title', $lang["mss_add"]);
+	$form1->addElement('select', 'host_name', $lang["h"], $ppHosts, array("onChange"=>"this.form.submit()"));
+	$sel =& $form1->addElement('hierselect', 'metric_sel1', $lang["sv"]);
+	$sel->setOptions(array($ppServices1, $ppServices2));
+	$form1->addElement('select', 'compot_1', $lang['giv_ct_name'], $compos);
+	$form1->addElement('select', 'meta_service', $lang["ms"], $ppMSs, array("onChange"=>"this.form.submit()"));
+	$form1->addElement('select', 'metric_sel2', NULL, $ppServices3);
+	$form1->addElement('select', 'compot_2', $lang['giv_ct_name'], $compos);
+	$form1->addElement('select', 'osl', $lang["giv_sr_osl"], $ppOSLs, array("onChange"=>"this.form.submit()"));
+	$form1->addElement('select', 'metric_sel3', NULL, $ppServices4);
+	$form1->addElement('select', 'compot_3', $lang['giv_ct_name'], $compos);
+	$form1->addElement('submit', 'submitA', $lang["save"]);
+	$form1->addElement('reset', 'reset', $lang["reset"]);
+
+	#
+	## Metric List
+	#
+	
+		# start header menu
+		$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+		$tpl->assign("headerMenu_name", $lang['name']);
+		$tpl->assign("headerMenu_desc", $lang['description']);
+		$tpl->assign("headerMenu_compo", $lang["giv_gg_tpl"]);
+		$tpl->assign("headerMenu_metric", $lang['giv_ct_metric']);
+		$tpl->assign("headerMenu_options", $lang['options']);
+		# end header menu
+	
+		#List
+		$rq = "SELECT compo_id, pp_metric_id, compot_compo_id FROM giv_components gc WHERE gc.graph_id = '".$graph_id."' ORDER BY ds_order";
+		$res = & $pearDB->query($rq);
+		
+		$form2 = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+		#Different style between each lines
+		$style = "one";
+		#Fill a tab with a mutlidimensionnal Array we put in $tpl
+		$elemArr = array();
+		for ($i = 0; $res->fetchInto($metric); $i++) {
+			$res1 =& $pearDBpp->query("SELECT DISTINCT host_name, service_description, metric FROM perfdata_service_metric WHERE metric_id = '".$metric["pp_metric_id"]."'");
+			$ppMetric =& $res1->fetchRow();
+			$selectedElements =& $form2->addElement('checkbox', "select[".$metric['compo_id']."]");	
+			$moptions = "<a href='oreon.php?p=".$p."&graph_id=".$graph_id."&compo_id=".$metric['compo_id']."&o=up'><img src='img/icones/16x16/arrow_up_green.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+			$moptions .= "<a href='oreon.php?p=".$p."&graph_id=".$graph_id."&compo_id=".$metric['compo_id']."&o=down'><img src='img/icones/16x16/arrow_down_green.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+			$moptions .= "<a href='oreon.php?p=".$p."&graph_id=".$graph_id."&compo_id=".$metric['compo_id']."&o=mm'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+			$moptions .= "<a href='oreon.php?p=".$p."&graph_id=".$graph_id."&compo_id=".$metric['compo_id']."&o=dm&select[".$metric['compo_id']."]=1' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+			if ($ppMetric["host_name"] == "Meta_Module")	{
+				$name = explode("_", $ppMetric["service_description"]);
+				$res2 =& $pearDB->query("SELECT DISTINCT meta_name FROM meta_service WHERE meta_id = '".$name[1]."'");
+				$name =& $res2->fetchRow();
+				$ppMetric["service_description"] = $name["meta_name"];
+				$host_name = $lang["giv_gg_ms"];
+			}
+			else if ($ppMetric["host_name"] == "OSL_Module")	{
+				$host_name = $lang["giv_gg_osl"];
+				$name = explode("_", $ppMetric["service_description"]);
+				$res2 =& $pearDB->query("SELECT DISTINCT name FROM osl WHERE osl_id = '".$name[1]."'");
+				$name =& $res2->fetchRow();
+				$ppMetric["service_description"] = $name["name"];
+			}
+			else
+				$host_name = $ppMetric["host_name"];
+			$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+							"RowMenu_select"=>$selectedElements->toHtml(),
+							"RowMenu_name"=> $host_name,
+							"RowMenu_link"=>"?p=".$p."&o=w&graph_id=".$metric['compo_id'],
+							"RowMenu_desc"=>$ppMetric["service_description"],
+							"RowMenu_metric"=>$ppMetric["metric"],
+							"RowMenu_compo"=>$metric["compot_compo_id"] ? $lang["yes"] : $lang["no"],
+							"RowMenu_options"=>$moptions);
+			$style != "two" ? $style = "two" : $style = "one";
+		}
+		$tpl->assign("elemArr", $elemArr);
+		#Different messages we put in the template
+		$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+	#Element we need when we reload the page
+	$form1->addElement('hidden', 'p');
+	$form2->addElement('hidden', 'p');
+	$form1->addElement('hidden', 'o');
+	$form1->addElement('hidden', 'graph_id');
+	if ($o== "mm")
+		$form1->addElement('hidden', 'compo_id');
+	$tab1 = array ("p" => $p, "o" => $o, "graph_id"=>$graph_id, "compo_id"=>$compo_id);
+	$tab2 = array ("p" => $p);
+	$form1->setDefaults($tab1);	
+	$form2->setDefaults($tab2);	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form2->accept($renderer);	
+	$form1->accept($renderer);
+	$tpl->assign('form1', $renderer->toArray());
+	$tpl->assign('form2', $renderer->toArray());
+	$tpl->display("listMetrics.ihtml");
+?>
diff --git a/www/include/views/graphs/graphCustoms/viewGraphCustoms.ihtml b/www/include/views/graphs/graphCustoms/viewGraphCustoms.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..6a915f395d1275a5f76a1ebc40100f3a51cbb716
--- /dev/null
+++ b/www/include/views/graphs/graphCustoms/viewGraphCustoms.ihtml
@@ -0,0 +1,77 @@
+<script language='javascript' src='./include/common/javascript/datePicker.js'></script>
+<link href="./include/common/javascript/datePicker.css" rel="stylesheet" type="text/css"/>
+<div>
+	<table id="ListTable">
+        <tr class="ListHeader">
+        	<td class="FormHeader" colspan="2"><img src='./img/icones/16x16/chart.gif'>&nbsp;{$graph_name}</td>
+        <tr>
+        <tr>
+    		<td colspan="2" class='ListColCenter'>
+				<img src='./include/views/graphs/generateImage/generateRRDImageCustom.php?session_id={$session_id}&graph_id={$graph_id}&template_id={$defaultGraph.graph_id}&end={$end}&start={$start}'><br>
+    		</td>
+        </tr>
+        <tr class="list_one">
+    		<td colspan="2" class='ListColCenter'>{$cpt_total_graphed_values}/{$cpt_total_values} {$graphed_values}</b></td>
+        </tr>
+    </table>
+</div>
+<br>
+<div style="padding-top: 20px;">
+    <form {$form.attributes}>
+        <table id="ListTable">
+                <tr class="ListHeader">
+                	<td class="FormHeader" colspan="2">{$form.header.title}</td>
+                <tr>
+                <tr class="list_two"><td>{$form.period.label}</td><td>{$form.period.html}</td></tr>
+				<tr class="list_one">
+					<td>{$form.start.label}</td>
+					<td>{$form.start.html}&nbsp;&nbsp;{$form.startD.html}</td>
+				</tr>
+				<tr class="list_two">
+					<td>{$form.end.label}</td>
+					<td>{$form.end.html}&nbsp;&nbsp;{$form.endD.html}</td>
+				</tr>
+                <tr class="list_one"><td>{$form.step.label}</td><td>{$form.step.html}</td></tr>
+        </table>
+        <div id="validForm">
+        	<p>{$form.submitC.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+        </div>
+        {$form.hidden}
+    </form>
+</div>
+<br><br><br><br>
+<div>
+	<div>
+	<form {$form2_attributes}>
+		{$form2.hidden}
+		<table id="ListTable">
+			<tr class="ListHeader">
+				<td class="ListColHeaderCenter">{$headerMenu_icone}</td>
+				<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+				<td class="ListColHeaderCenter">{$headerMenu_desc}</td>
+				<td class="ListColHeaderCenter">{$headerMenu_metric}</td>
+				<td class="ListColHeaderCenter">{$headerMenu_compo}</td>
+				<td class="ListColHeaderRight">{$headerMenu_options}</td>
+			</tr>
+			{section name=elem loop=$elemArr}
+			<tr class={$elemArr[elem].MenuClass}>
+				<td class="ListColCenter">{$elemArr[elem].RowMenu_select}</td>
+				<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+				<td class="ListColCenter">{$elemArr[elem].RowMenu_desc}</td>
+				<td class="ListColCenter">{$elemArr[elem].RowMenu_metric}</td>
+				<td class="ListColCenter">{$elemArr[elem].RowMenu_compo}</td>
+				<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+			</tr>
+			{/section}
+			<tr>
+				<td class="ListColFooterLeft" align="left" colspan="4">
+					&nbsp;&nbsp;&nbsp;
+					<input type="image" name="o" value="dm" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+				</td>
+				<td class="ListColFooterCenter" colspan="1"></td>
+				<td class="ListColFooterRight" align="right">&nbsp;</td>
+			</tr>		
+		</table>
+	</form>
+</div>
+</div>
\ No newline at end of file
diff --git a/www/include/views/graphs/graphCustoms/viewGraphCustoms.php b/www/include/views/graphs/graphCustoms/viewGraphCustoms.php
new file mode 100644
index 0000000000000000000000000000000000000000..5603e06e32d844f494cce28ec142890b7916ddea
--- /dev/null
+++ b/www/include/views/graphs/graphCustoms/viewGraphCustoms.php
@@ -0,0 +1,312 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	# Smarty template Init
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	require_once("./DBPerfparseConnect.php");
+
+	$form = new HTML_QuickForm('Form', 'get', "?p=".$p);
+	$form->addElement('header', 'title', $lang["giv_sr_period"]);
+	#
+	## Indicator basic information
+	#
+	
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);	
+	$page =& $form->addElement('hidden', 'p');
+	$page->setValue($p);	
+	$gid =& $form->addElement('hidden', 'graph_id');
+	$gid->setValue($graph_id);
+   
+   	# "3600"=>$lang["giv_sr_p1h"],
+   
+	$periods = array(
+				"10800"=>$lang["giv_sr_p3h"],
+				"21600"=>$lang["giv_sr_p6h"],
+				"43200"=>$lang["giv_sr_p12h"],
+				"86400"=>$lang["giv_sr_p24h"],
+				"172800"=>$lang["giv_sr_p2d"],
+				"302400"=>$lang["giv_sr_p4d"],	
+				"604800"=>$lang["giv_sr_p7d"],
+				"1209600"=>$lang["giv_sr_p14d"],
+				"2419200"=>$lang["giv_sr_p28d"],
+				"2592000"=>$lang["giv_sr_p30d"],
+				"2678400"=>$lang["giv_sr_p31d"],
+				"5184000"=>$lang["giv_sr_p2m"],
+				"10368000"=>$lang["giv_sr_p4m"],
+				"15552000"=>$lang["giv_sr_p6m"],
+				"31104000"=>$lang["giv_sr_p1y"]);
+
+	$sel =& $form->addElement('select', 'period', $lang["giv_sr_period"], $periods);	
+	$form->setDefaults(array('period' =>'10800'));
+	
+	$form->addElement('text', 'start', $lang['giv_gt_start']);
+	$form->addElement('button', "startD", $lang['modify'], array("onclick"=>"displayDatePicker('start')"));
+	$form->addElement('text', 'end', $lang['giv_gt_end']);
+	$form->addElement('button', "endD", $lang['modify'], array("onclick"=>"displayDatePicker('end')"));
+	
+	$steps = array(
+					"0"=>$lang["giv_sr_noStep"],
+					"2"=>"2",
+					"6"=>"6",
+					"10"=>"10",
+					"20"=>"20",
+					"50"=>"50",
+					"100"=>"100"			
+	);
+	$sel =& $form->addElement('select', 'step', $lang["giv_sr_step"], $steps);
+	
+	$subC =& $form->addElement('submit', 'submitC', $lang["giv_sr_button"]);
+	$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+
+	
+	#Different style between each lines
+	$style = "one";
+	
+	$graph_id = $_GET["graph_id"];
+	
+	# Get graph name
+	
+	$res_gr =& $pearDB->query("SELECT name FROM giv_graphs WHERE graph_id = '".$graph_id."'");
+	$res_gr->fetchInto($graph_data);
+	$graph_name = $graph_data["name"];
+	
+	#
+	
+	$ppMetrics = array();
+	$rq = 	"SELECT pp_metric_id FROM giv_components gc ".
+			"WHERE gc.graph_id = '".$graph_id."' ORDER BY ds_order";
+	$res =& $pearDB->query($rq);
+	$cpt = 0;
+	while($res->fetchInto($ppMetric))	{
+		$ppMetrics[$ppMetric["pp_metric_id"]] = array();	
+		$ppMetrics[$ppMetric["pp_metric_id"]]["metric_id"] = $ppMetric["pp_metric_id"];
+	}
+	$res->free();
+	$tpl->assign("metrics", $ppMetrics);
+	
+	# Creating rrd DB
+	
+	$label = NULL;
+	isset($ret["step"]) && $ret["step"] != 0 ? $time_between_two_values = 600 * $ret["step"] : $time_between_two_values = 600;
+	
+	if (isset($_GET["start"]) && $_GET["start"]){
+		preg_match("/^([0-9]*)\/([0-9]*)\/([0-9]*)/", $_GET["start"], $matches);
+		$start = mktime("0", "0", "0", $matches[1], $matches[2], $matches[3], 1) ;
+	}
+	if (isset($_GET["end"]) && $_GET["end"]){
+		preg_match("/^([0-9]*)\/([0-9]*)\/([0-9]*)/", $_GET["end"], $matches);
+		$end = mktime("23", "59", "59", $matches[1], $matches[2], $matches[3], 1)  + 10;
+	}
+	
+	if (!isset($_GET["start"]) && !isset($_GET["end"]) && !isset($_GET["period"]) )
+		$_GET["period"] = 21600;
+		
+	if (!isset($start))
+		$start = time() - ($_GET["period"] + 30);
+	if (!isset($end))
+		$end = time() + 120;
+	
+	$start_create = $start - 200000;
+	
+	$tab_metric = array();
+	foreach ($ppMetrics as $key => $metric){
+		if (file_exists($oreon->optGen["oreon_path"]."filesGeneration/graphs/graphCustoms/".$metric["metric_id"].".rrd"))
+			unlink($oreon->optGen["oreon_path"]."filesGeneration/graphs/graphCustoms/".$metric["metric_id"].".rrd");
+		$cmd = $oreon->optGen["rrdtool_path_bin"] . " create ".$oreon->optGen["oreon_path"]."filesGeneration/graphs/graphCustoms/".$metric["metric_id"].".rrd --start $start_create "; 	
+		$cmd .= " DS:ds".$metric["metric_id"].":GAUGE:$time_between_two_values:U:U";
+		$cmd .=  " RRA:AVERAGE:0.5:1:8960";
+		$cmd .=  " RRA:LAST:0.5:1:8960";
+		system($cmd, $return);
+	}
+		
+	# Mise en memoire des valeurs remont s de la base de donn e MySQL
+	# Init Lower Value
+	$GMT = "0";
+	$lower = 0;
+	$tab_bin = array();
+	$cpt_total_values = 0;
+	$cpt_total_graphed_values = 0;
+	$i = 1;
+	$ret["step"] = 0;
+	if ($i)
+	foreach ($ppMetrics as $key => $value){
+		$res =& $pearDBpp->query("SELECT * FROM `perfdata_service_metric` WHERE metric_id = '".$key."'");
+		$res->fetchInto($metric_info);
+		$get = 	"SELECT value,ctime FROM `perfdata_service_bin` WHERE `metric` = '".$metric_info["metric"]."' AND `host_name` = '".$metric_info["host_name"]."' AND `service_description` = '".$metric_info["service_description"]."' ".
+				"AND `ctime` >= '".date("Y-m-d G:i:s", $start)."' AND `ctime` <= '".date("Y-m-d G:i:s", $end)."' ORDER BY ctime";
+	
+		$str = NULL;
+		$r = NULL;
+		$cpt = 0;
+
+		$cpt_real = 0;
+		if (!isset($_GET["step"]))
+			$_GET["step"] = 0; 
+
+		$req =& $pearDBpp->query($get);
+		for ($cpt = 0;$r =& $req->fetchRow();$cpt++){
+			preg_match("/^([0-9]*)-([0-9]*)-([0-9]*) ([0-9]*):([0-9]*):([0-9]*)/", $r["ctime"], $matches);
+			$time_temp = mktime($matches[4],$matches[5],$matches[6],$matches[2],$matches[3],$matches[1], 1);
+			$time_temp2 = $time_temp + (3600 * $GMT);
+			$str .= " ".$time_temp2.":".$r["value"];
+			if (isset($_GET["step"]) && $_GET["step"] == "1"){
+				if ($value < $lower)
+					$lower = $r["value"];
+				$cpt_real++;
+			} else if ($cpt % $_GET["step"] == 0){
+				if ($value < $lower)
+					$lower = $r["value"];
+				$cpt_real++;
+			}
+		}
+		$cpt_total_values += $cpt;
+		$cpt_total_graphed_values += $cpt_real;
+		$update_cmd = "rrdtool update ".$oreon->optGen["oreon_path"]."filesGeneration/graphs/graphCustoms/".$key.".rrd " . $str . " 2>&1";
+		system($update_cmd, $ret);
+		if ($ret)
+			print $ret;
+	}
+	
+	
+	#
+	## Metric List
+	#
+	
+		# start header menu
+		$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+		$tpl->assign("headerMenu_name", $lang['name']);
+		$tpl->assign("headerMenu_desc", $lang['description']);
+		$tpl->assign("headerMenu_metric", $lang['giv_ct_metric']);
+		$tpl->assign("headerMenu_compo", $lang["giv_gg_tpl"]);
+		$tpl->assign("headerMenu_options", $lang['options']);
+		# end header menu
+	
+		#List
+		$rq = "SELECT compo_id, pp_metric_id, compot_compo_id FROM giv_components gc WHERE gc.graph_id = '".$graph_id."' ORDER BY ds_order";
+		$res = & $pearDB->query($rq);
+		
+		$form2 = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+		#Different style between each lines
+		$style = "one";
+		#Fill a tab with a mutlidimensionnal Array we put in $tpl
+		$elemArr = array();
+		$nb_entry = $res->numRows();
+		for ($i = 0; $res->fetchInto($metric); $i++) {
+			$moptions = NULL;
+			$res1 =& $pearDBpp->query("SELECT DISTINCT host_name, service_description, metric FROM perfdata_service_metric WHERE metric_id = '".$metric["pp_metric_id"]."'");
+			$ppMetric =& $res1->fetchRow();
+			$selectedElements =& $form2->addElement('checkbox', "select[".$metric['compo_id']."]");	
+			if ($i != 0){
+				$moptions .= "<a href='oreon.php?p=".$p."&graph_id=".$graph_id."&compo_id=".$metric['compo_id']."&o=wup";
+				if (isset($_GET["period"]) && $_GET["period"])
+					$moptions .= "&period=" . $_GET["period"];
+				else
+					$moptions .= "&end=".$_GET["end"]."&start=".$_GET["start"];
+				$moptions .= "'><img src='img/icones/16x16/arrow_up_green.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+				$moptions .= "";
+			}
+			if ($i != ($nb_entry - 1)){
+				$moptions .= "<a href='oreon.php?p=".$p."&graph_id=".$graph_id."&compo_id=".$metric['compo_id']."&o=wdown";
+				if (isset($_GET["period"]) && $_GET["period"])
+					$moptions .= "&period=" . $_GET["period"];
+				else
+					$moptions .= "&end=".$_GET["end"]."&start=".$_GET["start"];
+				$moptions .= "'><img src='img/icones/16x16/arrow_down_green.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+				$moptions .= "";
+			} else
+				$moptions .= "<img src='./img/icones/1x1/blank.gif' width=16 height=16>&nbsp;&nbsp;";
+			//	$moptions .= "<a href='oreon.php?p=".$p."&graph_id=".$graph_id."&compo_id=".$metric['compo_id']."&o=wdown&end=".$end."&start=".$start."'><img src='img/icones/16x16/arrow_down_green.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+			
+			if ($ppMetric["host_name"] == "Meta_Module")	{
+				$host_name = $lang["giv_gg_ms"];
+				$name = explode("_", $ppMetric["service_description"]);
+				$res2 =& $pearDB->query("SELECT DISTINCT meta_name FROM meta_service WHERE meta_id = '".$name[1]."'");
+				$name =& $res2->fetchRow();
+				$ppMetric["service_description"] = $name["meta_name"];
+
+			}
+			else if ($ppMetric["host_name"] == "OSL_Module")	{
+				$host_name = $lang["giv_gg_osl"];
+				$name = explode("_", $ppMetric["service_description"]);
+				$res2 =& $pearDB->query("SELECT DISTINCT name FROM osl WHERE osl_id = '".$name[1]."'");
+				$name =& $res2->fetchRow();
+				$ppMetric["service_description"] = $name["name"];
+			}
+			else
+				$host_name = $ppMetric["host_name"];
+			$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+							"RowMenu_select"=>$selectedElements->toHtml(),
+							"RowMenu_name"=> $host_name,
+							"RowMenu_link"=>"?p=".$p."&o=w&graph_id=".$metric['compo_id'],
+							"RowMenu_desc"=>$ppMetric["service_description"],
+							"RowMenu_metric"=>$ppMetric["metric"],
+							"RowMenu_compo"=>$metric["compot_compo_id"] ? $lang["yes"] : $lang["no"],
+							"RowMenu_options"=>$moptions);
+			$style != "two" ? $style = "two" : $style = "one";
+		}
+		$tpl->assign("elemArr", $elemArr);
+		#Different messages we put in the template
+		$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+	#Element we need when we reload the page
+	$form2->addElement('hidden', 'p');
+	$tab1 = array ("p" => $p, "o" => $o, "graph_id"=>$graph_id);
+	$tab2 = array ("p" => $p);
+	$form2->setDefaults($tab2);	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form2->accept($renderer);	
+	$tpl->assign('form2', $renderer->toArray());
+	
+	
+	
+	# RRDTool Data base Created.
+	
+	#
+	## Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->assign('graph_name', $graph_name);
+	$tpl->assign('graph_id', $_GET["graph_id"]);
+	if (isset($_GET["period"]))
+		$tpl->assign('period', $_GET["period"]);
+	$tpl->assign('end', $end);
+	$tpl->assign('start', $start);
+	$tpl->assign('session_id', session_id());
+	$tpl->assign('cpt_total_values', $cpt_total_values);
+	$tpl->assign('cpt_total_graphed_values', $cpt_total_graphed_values);
+	$tpl->assign("graphed_values", $lang["giv_sr_gValues"]);
+	$tpl->display("viewGraphCustoms.ihtml");
+
+?>
diff --git a/www/include/views/graphs/graphPlugins/graphPlugins.php b/www/include/views/graphs/graphPlugins/graphPlugins.php
new file mode 100644
index 0000000000000000000000000000000000000000..382508d667440f9fcf21e8f47123c20a8a881002
--- /dev/null
+++ b/www/include/views/graphs/graphPlugins/graphPlugins.php
@@ -0,0 +1,48 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["graph_id"]) ? $cG = $_GET["graph_id"] : $cG = NULL;
+	isset($_POST["graph_id"]) ? $cP = $_POST["graph_id"] : $cP = NULL;
+	$cG ? $graph_id = $cG : $graph_id = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/views/graphs/graphPlugins/";
+	
+	#PHP functions
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formGraphPlugins.php"); break; #Add a Graph Plugins
+		case "w" : require_once($path."formGraphPlugins.php"); break; #Watch aGraph Plugins
+		case "c" : require_once($path."formGraphPlugins.php"); break; #Modify a Graph Plugins
+		case "s" : enableGraphTemplateInDB($lca_id); require_once($path."listGraphPlugins.php"); break; #Activate a Graph Plugins
+		case "u" : disableGraphTemplateInDB($lca_id); require_once($path."listGraphPlugins.php"); break; #Desactivate a Graph Plugins
+		case "m" : multipleGraphTemplateInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listGraphPlugins.php"); break; #Duplicate n Graph Plugins
+		case "d" : deleteGraphTemplateInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listGraphPlugins.php"); break; #Delete n Graph Plugins
+		default : require_once($path."listGraphPlugins.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/graphPlugins/listGraphPlugins.ihtml b/www/include/views/graphs/graphPlugins/listGraphPlugins.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..d9c07306899bb0a2d068da31a25de054cf8b0f0b
--- /dev/null
+++ b/www/include/views/graphs/graphPlugins/listGraphPlugins.ihtml
@@ -0,0 +1,57 @@
+<script language='javascript' src='./include/common/javascript/datePicker.js'></script>
+<script language='javascript' src='./include/common/javascript/hidden_div.js'></script>
+<link href="./include/common/javascript/datePicker.css" rel="stylesheet" type="text/css"/>
+{$form.javascript}
+<div>
+{if $database_name}
+	<table id="ListTable">
+        <tr class="ListHeader">
+        	<td class="FormHeader" colspan="2"><img src='./img/icones/16x16/line-chart.gif'>&nbsp;{$title2} - {$database_name}</td>
+        </tr>
+        <tr>
+    		<td colspan="2" class='ListColCenter'>
+    			<img src='./include/views/graphs/generateImage/generateRRDImagePlugins.php?session_id={$session_id}&database={$databaseSH}&template_id={$graph_graph_id}{if $end}&end={$end}{/if}{if $start}&start={$start}{/if}'><br>
+    		</td>
+        </tr>
+    </table>
+{/if}
+</div>
+<div style="padding-top: 20px;">
+    <form {$form.attributes}>
+        <div>
+       		<table id="ListTable">
+                <tr class="ListHeader">
+                	<td class="FormHeader" colspan="2">{$form.header.title}</td>
+                </tr>
+                <tr class="list_one">
+            		<td>{$form.database.label}</td>
+            		<td>{$form.database.html}</td>
+                </tr>
+        	</table>
+        </div>
+        <div id="validForm">
+        	<p>{$form.submitC.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}&nbsp;&nbsp;&nbsp;{$form.advanced.html}</p><br />
+        </div><br>
+        <div name="div1" id="div1" class='cachediv' {if !$title2}style="padding-top:34px;"{/if}>
+        	<table id="ListTable">
+                <tr class="ListHeader">
+                	<td class="FormHeader" colspan="2">{$lang.advanced}</td>
+                </tr>
+                <tr class="list_two">
+                	<td>{$form.grapht_graph_id.label}</td>
+                	<td>{$form.grapht_graph_id.html}</td>
+                </tr>
+                <tr class="list_one"><td>{$form.period.label}</td><td>{$form.period.html}</td></tr>
+				<tr class="list_two">
+					<td>{$form.start.label}</td>
+					<td>{$form.start.html}&nbsp;&nbsp;{$form.startD.html}</td>
+				</tr>
+				<tr class="list_one">
+					<td>{$form.end.label}</td>
+					<td>{$form.end.html}&nbsp;&nbsp;{$form.endD.html}</td>
+				</tr>
+        	</table>
+        </div>
+        {$form.hidden}
+    </form>
+</div>
\ No newline at end of file
diff --git a/www/include/views/graphs/graphPlugins/listGraphPlugins.php b/www/include/views/graphs/graphPlugins/listGraphPlugins.php
new file mode 100644
index 0000000000000000000000000000000000000000..b4d6a3da4d4b003f3f1a016a33faae907fca336c
--- /dev/null
+++ b/www/include/views/graphs/graphPlugins/listGraphPlugins.php
@@ -0,0 +1,205 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+
+	isset($_GET["service_id"]) ? $cG = $_GET["service_id"] : $cG = NULL;
+	isset($_POST["service_id"]) ? $cP = $_POST["service_id"] : $cP = NULL;
+	$cG ? $service_id = $cG : $service_id = $cP;
+
+	isset($_GET["service_description"]) ? $cG = $_GET["service_description"] : $cG = NULL;
+	isset($_POST["service_description"]) ? $cP = $_POST["service_description"] : $cP = NULL;
+	$cG ? $service_description = $cG : $service_description = $cP;
+
+	isset($_GET["host_name"]) ? $cG = $_GET["host_name"] : $cG = NULL;
+	isset($_POST["host_name"]) ? $cP = $_POST["host_name"] : $cP = NULL;
+	$cG ? $host_name = $cG : $host_name = $cP;
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+
+	#Path to the configuration dir
+	$path = "./include/views/graphs/graphPlugins/";
+
+	#PHP functions
+	require_once "./include/common/common-Func.php";
+
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+
+	$graphTs = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT graph_id, name FROM giv_graphs_template ORDER BY name");
+	while($res->fetchInto($graphT))
+		$graphTs[$graphT["graph_id"]] = $graphT["name"];
+	$res->free();
+
+	$tableFile1 = array();
+	$tableFile2 = array();
+	if ($handle  = @opendir($oreon->optGen["oreon_rrdbase_path"]))	{
+		while ($file = @readdir($handle))
+			if (is_file($oreon->optGen["oreon_rrdbase_path"]."/$file"))	{
+				preg_match("([0-9\_]+)", $file, $matches);
+				$split = preg_split("/\_/", $matches[0]);
+				if (count($split) == 2 && $split[0] && $split[1]){
+					$host_name = getMyHostName($split[0]);
+					$service_description = getMyServiceName($split[1]);
+					if (array_search($host_name, $oreon->user->lcaHost) && getMyServiceID($service_description, $split[0]))	{
+						$tableFile1[$host_name] =  $host_name;
+						$tableFile2[$host_name][$file] = $service_description;
+					}
+				}
+			}
+		@closedir($handle);
+	}
+
+	asort($tableFile1);
+	asort($tableFile2);
+
+	$debug = 0;
+	$attrsTextI		= array("size"=>"3");
+	$attrsText 		= array("size"=>"30");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+ 
+ 	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "./");
+
+	#
+	## Form begin
+	#
+
+	$form = new HTML_QuickForm('Form', 'get', "?p=".$p);
+	$form->addElement('header', 'title', $lang["giv_sr_infos"]);
+	#
+	## Indicator basic information
+	#
+
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	$page =& $form->addElement('hidden', 'p');
+	$page->setValue($p);
+	$minF =& $form->addElement('hidden', 'min');
+	$minF->setValue($min);
+
+	$sel =& $form->addElement('hierselect', 'database', "Host / Service");
+	$sel->setOptions(array($tableFile1, $tableFile2));
+	$form->addElement('select', 'grapht_graph_id', $lang["giv_gg_tpl"], $graphTs);
+
+	$periods = array(	""=>"",
+						"10800"=>$lang["giv_sr_p3h"],
+						"21600"=>$lang["giv_sr_p6h"],
+						"43200"=>$lang["giv_sr_p12h"],
+						"86400"=>$lang["giv_sr_p24h"],
+						"172800"=>$lang["giv_sr_p2d"],
+						"302400"=>$lang["giv_sr_p4d"],
+						"604800"=>$lang["giv_sr_p7d"],
+						"1209600"=>$lang["giv_sr_p14d"],
+						"2419200"=>$lang["giv_sr_p28d"],
+						"2592000"=>$lang["giv_sr_p30d"],
+						"2678400"=>$lang["giv_sr_p31d"],
+						"5184000"=>$lang["giv_sr_p2m"],
+						"10368000"=>$lang["giv_sr_p4m"],
+						"15552000"=>$lang["giv_sr_p6m"],
+						"31104000"=>$lang["giv_sr_p1y"]);
+						
+	$sel =& $form->addElement('select', 'period', $lang["giv_sr_period"], $periods);
+	//$form->setDefaults(array('period' =>'10800'));
+
+	$form->addElement('text', 'start', $lang['giv_gt_start']);
+	$form->addElement('button', "startD", $lang['modify'], array("onclick"=>"displayDatePicker('start')"));
+	$form->addElement('text', 'end', $lang['giv_gt_end']);
+	$form->addElement('button', "endD", $lang['modify'], array("onclick"=>"displayDatePicker('end')"));
+
+
+	$subC =& $form->addElement('submit', 'submitC', $lang["giv_sr_button"]);
+	$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+  	$res =& $form->addElement('reset', 'advanced', $lang["advanced"], array("onclick"=>"DivStatus( 'div', '1' )"));
+
+	if (((isset($_GET["submitC"]) && $_GET["submitC"]) || $min == 1))
+		if ($form->validate())	{
+		$ret = $form->getsubmitValues();
+		$case = NULL;
+		$rrDB = array(0=>NULL, 1=>NULL);
+		//$_GET["database"] = array("0" => getHostID($_GET["host_name"]) . "_" . getServiceID($_GET["host_name"], $_GET["service_description"]) . ".rrd", "1" => $_GET["host_name"]);
+
+		$rrdDB = $_GET["database"];
+		preg_match("([0-9\_]+)", $rrdDB[1], $matches);
+		$split = preg_split("/\_/", $matches[0]);
+		if (count($split) == 2 && $split[0] && $split[1]){
+			//if ()
+			$host_name = getMyHostName($split[0]);
+			$service_description = getMyServiceName($split[1]);
+			$case = $host_name . " / " . $service_description;
+		}
+		if (array_search($host_name, $oreon->user->lcaHost) && $case)	{
+
+			# 1 for +1 and -1 for -1 and 0 for GMT
+			$GMT = "0";
+
+			if (((isset($_GET["submitC"]) && $_GET["submitC"]) || $min == 1))
+				$form->setDefaults(array('database' => $split[0]."_".$split[1]));
+
+			# Init variable in the page
+			$tpl->assign("title2", $lang["giv_sr_rendTitle"]);
+			$tpl->assign("res", $case);
+			$tpl->assign("period", $periods[$ret["period"]]);
+
+			# Grab default Graph Template Model and default Data Source Template Model
+			$tpl->assign("lgGraph", $lang['giv_gt_name']);
+			$tpl->assign("lgMetric", $lang['giv_ct_metric']);
+			$tpl->assign("lgCompoTmp", $lang['giv_ct_name']);
+
+			# Init
+
+			if (isset($_GET["start"]) && $_GET["start"] && isset($_GET["end"]) && $_GET["end"]){
+				preg_match("/^([0-9]*)\/([0-9]*)\/([0-9]*)/", $_GET["start"], $matches);
+				$start = mktime("0", "0", "0", $matches[1], $matches[2], $matches[3], 1) ;
+				preg_match("/^([0-9]*)\/([0-9]*)\/([0-9]*)/", $_GET["end"], $matches);
+				$end = mktime("23", "59", "59", $matches[1], $matches[2], $matches[3], 1)  + 10;
+			} else if (isset($_GET["period"]) && $_GET["period"]){
+				$start = time() - ($_GET["period"] + 120);
+				$end = time() + 120;
+			} 
+
+			if ($case)
+				$tpl->assign('database_name', $case);
+			$tpl->assign('databaseSH', $rrdDB[1]);
+			if (isset($end) && isset($start)){
+				$tpl->assign("end", $end);
+				$tpl->assign("start", $start);
+			}
+			$tpl->assign('graph_graph_id', $_GET["grapht_graph_id"]);
+		}
+    }
+
+	#Apply a template definition
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+	$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+	$form->accept($renderer);
+
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->assign('o', $o);
+	$tpl->assign('lang', $lang);
+	$tpl->assign('session_id', session_id());
+	$tpl->display("listGraphPlugins.ihtml");
+?>
diff --git a/www/include/views/graphs/graphSummary/DB-Func.php b/www/include/views/graphs/graphSummary/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..7f07cd89d468584ebe5e2e8a5602c25d47cc61fa
--- /dev/null
+++ b/www/include/views/graphs/graphSummary/DB-Func.php
@@ -0,0 +1,40 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+		
+	function getHostID($host_name){
+		global $pearDB;
+		if (!$host_name) 
+			return NULL;
+		$res =& $pearDB->query("SELECT * FROM host WHERE host_name = '".$host_name."' LIMIT 1");
+		$res->fetchInto($host_id);
+		return $host_id["host_id"];
+	}
+	
+	function getServiceID($host_name, $service_description){
+		global $pearDB;
+		if (!$host_name) 
+			return NULL;
+		$res =& $pearDB->query("SELECT service.service_id FROM host,service,host_service_relation WHERE host.host_name = '".$host_name."' AND service.service_description = '".$service_description."' AND host_service_relation.host_host_id = host.host_id AND host_service_relation.service_service_id = service.service_id");
+		$res->fetchInto($service_id);
+		return $service_id["service_id"];
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/graphSummary/graphSummary.php b/www/include/views/graphs/graphSummary/graphSummary.php
new file mode 100644
index 0000000000000000000000000000000000000000..976cc12616f1ee5b5e9d4d5e758e6ca9e44721d6
--- /dev/null
+++ b/www/include/views/graphs/graphSummary/graphSummary.php
@@ -0,0 +1,74 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset($oreon))
+		exit();
+		
+	require("./include/views/graphs/graphSummary/DB-Func.php");
+
+	function return_period($service_id){
+		global $pearDB;
+		$res =& $pearDB->query("SELECT graph_id FROM extended_service_information WHERE service_service_id = '".$service_id."'");
+		$res->fetchInto($service_ext);
+		$res =& $pearDB->query("SELECT period FROM giv_graphs_template WHERE graph_id = '".$service_ext["graph_id"]."'");
+		$res->fetchInto($graph);
+		return $graph["period"];
+	}
+
+	if (isset($_GET["host_name"]))
+		$host_id = getHostID($_GET["host_name"]);
+	else if (isset($_GET["host_id"]))
+		$host_id = $_GET["host_id"];
+	else
+		$host_id = NULL;
+
+	if (isset($_GET["service_description"]))
+		$service_id = getServiceID($_GET["host_name"], $_GET["service_description"]);
+	else if (isset($_GET["service_id"]))
+		$service_id = $_GET["service_id"];
+	else
+		$service_id = NULL;
+	
+	if (!isset($_GET["steps"]))
+		$_GET["steps"] = 0;
+	
+	if (array_key_exists($host_id, $oreon->user->lcaHost))	{
+		$_GET["period"] = return_period($service_id);
+		$_GET["submitC"] = "Grapher";
+		$_GET["grapht_graph_id"] = "";
+		if (!$oreon->optGen["perfparse_installed"]){
+			if (isset($_GET["host_name"]) && isset($_GET["service_description"])){
+				$_GET["database"] = array("1" => $host_id."_".$service_id.".rrd", "0" => $_GET["host_name"]);
+				$_GET["p"] = "40203";
+				require_once("./include/views/graphs/graphPlugins/graphPlugins.php");
+			}
+		} else {
+			clearstatcache();
+			if (file_exists($oreon->optGen["oreon_rrdbase_path"].$host_id."_".$service_id.".rrd")){
+				$_GET["database"] = array("1" => $host_id."_".$service_id.".rrd", "0" => $_GET["host_name"]);
+				$_GET["p"] = "40203";
+				require_once("./include/views/graphs/graphPlugins/graphPlugins.php");
+			} else	{
+				$_GET["p"] = "40202";
+				require_once("./include/views/graphs/simpleRenderer/simpleRenderer.php");
+			}
+		}
+	} else
+		require_once("./alt_error.php");
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/graphTemplates/DB-Func.php b/www/include/views/graphs/graphTemplates/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..57ddf30addbba7822bed7712e2b473d1e8272e42
--- /dev/null
+++ b/www/include/views/graphs/graphTemplates/DB-Func.php
@@ -0,0 +1,245 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function testExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('graph_id');
+		$res =& $pearDB->query("SELECT graph_id, name FROM giv_graphs_template WHERE name = '".htmlentities($name, ENT_QUOTES)."'");
+		$graph =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $graph["graph_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $graph["graph_id"] != $id)
+			return false;
+		else
+			return true;
+	}
+	
+	function deleteGraphTemplateInDB ($graphs = array())	{
+		global $pearDB;
+		foreach($graphs as $key=>$value)
+			$pearDB->query("DELETE FROM giv_graphs_template WHERE graph_id = '".$key."'");
+		defaultOreonGraph();
+		defaultPluginsGraph();
+	}
+	
+	function multipleGraphTemplateInDB ($graphs = array(), $nbrDup = array())	{
+		foreach($graphs as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM giv_graphs_template WHERE graph_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["graph_id"] = '';
+			$row["default_tpl1"] = '0';
+			$row["default_tpl2"] = '0';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "name" ? ($name = $value2 = $value2."_".$i) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testExistence($name))	{
+					$val ? $rq = "INSERT INTO giv_graphs_template VALUES (".$val.")" : $rq = null;
+					$pearDB->query($rq);
+					$res =& $pearDB->query("SELECT MAX(graph_id) FROM giv_graphs_template");
+					$maxId =& $res->fetchRow();
+					if (isset($maxId["MAX(graph_id)"]))	{
+						$res =& $pearDB->query("SELECT DISTINCT gc_compo_id FROM giv_graphT_componentT_relation WHERE gg_graph_id = '".$key."'");
+						while($res->fetchInto($graph))
+							$pearDB->query("INSERT INTO giv_graphT_componentT_relation VALUES ('', '".$maxId["MAX(graph_id)"]."', '".$graph["gc_compo_id"]."')");
+					}
+				}
+			}
+		}
+	}
+	
+	function defaultOreonGraph ()	{
+		global $pearDB;
+		$rq = "SELECT DISTINCT graph_id FROM giv_graphs_template WHERE default_tpl1 = '1'";
+		$res =& $pearDB->query($rq);
+		if (!$res->numRows())	{
+			$rq = "UPDATE giv_graphs_template SET default_tpl1 = '1' LIMIT 1";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function defaultPluginsGraph ()	{
+		global $pearDB;
+		$rq = "SELECT DISTINCT graph_id FROM giv_graphs_template WHERE default_tpl2 = '1'";
+		$res =& $pearDB->query($rq);
+		if (!$res->numRows())	{
+			$rq = "UPDATE giv_graphs_template SET default_tpl2 = '1' LIMIT 1";
+			$pearDB->query($rq);
+		}
+	}
+	
+	function noDefaultOreonGraph ()	{
+		global $pearDB;
+		$rq = "UPDATE giv_graphs_template SET default_tpl1 = '0'";
+		$pearDB->query($rq);
+	}
+	
+	function noDefaultPluginsGraph ()	{
+		global $pearDB;
+		$rq = "UPDATE giv_graphs_template SET default_tpl2 = '0'";
+		$pearDB->query($rq);
+	}
+	
+	function updateGraphTemplateInDB ($graph_id = NULL)	{
+		if (!$graph_id) return;
+		updateGraphTemplate($graph_id);
+		updateComponentChilds($graph_id);
+	}	
+	
+	function insertGraphTemplateInDB ()	{
+		$graph_id = insertGraphTemplate();
+		updateComponentChilds($graph_id);
+		return ($graph_id);
+	}
+	
+	function insertGraphTemplate()	{
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		if ($ret["default_tpl1"]["default_tpl1"])
+			noDefaultOreonGraph();
+		if ($ret["default_tpl2"]["default_tpl2"])
+			noDefaultPluginsGraph();
+		$rq = "INSERT INTO `giv_graphs_template` ( `graph_id` , `name` , `title` , `img_format` , " .
+				"`vertical_label` ,`period` ,`step` , `width` , `height` , `lower_limit`, `upper_limit` , `bg_grid_color` , `bg_color` , `police_color` , `grid_main_color` , " .
+				"`grid_sec_color` , `contour_cub_color` , `col_arrow` , `col_top` , `col_bot` , `default_tpl1` , `default_tpl2` , " .
+				"`stacked` , `comment` ) ";
+		$rq .= "VALUES (";
+		$rq .= "NULL, ";
+		isset($ret["name"]) && $ret["name"] != NULL ? $rq .= "'".htmlentities($ret["name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["title"]) && $ret["title"] != NULL ? $rq .= "'".htmlentities($ret["title"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["img_format"]) && $ret["img_format"] != NULL ? $rq .= "'".$ret["img_format"]."', ": $rq .= "NULL, ";
+		isset($ret["vertical_label"]) && $ret["vertical_label"] != NULL ? $rq .= "'".htmlentities($ret["vertical_label"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["period"]) && $ret["period"] != NULL ? $rq .= "'".htmlentities($ret["period"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["step"]) && $ret["step"] != NULL ? $rq .= "'".htmlentities($ret["step"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["width"]) && $ret["width"] != NULL ? $rq .= "'".htmlentities($ret["width"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["height"]) && $ret["height"] != NULL ? $rq .= "'".htmlentities($ret["height"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["lower_limit"]) && $ret["lower_limit"] != NULL ? $rq .= "'".$ret["lower_limit"]."', ": $rq .= "NULL, ";
+		isset($ret["upper_limit"]) && $ret["upper_limit"] != NULL ? $rq .= "'".$ret["upper_limit"]."', ": $rq .= "NULL, ";
+		isset($ret["bg_grid_color"]) && $ret["bg_grid_color"] != NULL ? $rq .= "'".htmlentities($ret["bg_grid_color"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["bg_color"]) && $ret["bg_color"] != NULL ? $rq .= "'".htmlentities($ret["bg_color"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["police_color"]) && $ret["police_color"] != NULL ? $rq .= "'".htmlentities($ret["police_color"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["grid_main_color"]) && $ret["grid_main_color"] != NULL ? $rq .= "'".htmlentities($ret["grid_main_color"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["grid_sec_color"]) && $ret["grid_sec_color"] != NULL ? $rq .= "'".htmlentities($ret["grid_sec_color"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["contour_cub_color"]) && $ret["contour_cub_color"] != NULL ? $rq .= "'".htmlentities($ret["contour_cub_color"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["col_arrow"]) && $ret["col_arrow"] != NULL ? $rq .= "'".htmlentities($ret["col_arrow"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["col_top"]) && $ret["col_top"] != NULL ? $rq .= "'".htmlentities($ret["col_top"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["col_bot"]) && $ret["col_bot"] != NULL ? $rq .= "'".htmlentities($ret["col_bot"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["default_tpl1"]["default_tpl1"]) && $ret["default_tpl1"]["default_tpl1"] != NULL ? $rq .= "'".$ret["default_tpl1"]["default_tpl1"]."', ": $rq .= "NULL, ";
+		isset($ret["default_tpl2"]["default_tpl2"]) && $ret["default_tpl2"]["default_tpl2"] != NULL ? $rq .= "'".$ret["default_tpl2"]["default_tpl2"]."', ": $rq .= "NULL, ";
+		isset($ret["stacked"]["stacked"]) && $ret["stacked"]["stacked"] != NULL ? $rq .= "'".htmlentities($ret["stacked"]["stacked"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		isset($ret["comment"]) && $ret["comment"] != NULL ? $rq .= "'".htmlentities($ret["comment"], ENT_QUOTES)."'": $rq .= "NULL";
+		$rq .= ")";
+		$pearDB->query($rq);
+		defaultOreonGraph();
+		defaultPluginsGraph();
+		$res =& $pearDB->query("SELECT MAX(graph_id) FROM giv_graphs_template");
+		$graph_id = $res->fetchRow();
+		return ($graph_id["MAX(graph_id)"]);
+	}
+	
+	function updateGraphTemplate($graph_id = null)	{
+		if (!$graph_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		if ($ret["default_tpl1"]["default_tpl1"])
+			noDefaultOreonGraph();
+		if ($ret["default_tpl2"]["default_tpl2"])
+			noDefaultPluginsGraph();
+		$rq = "UPDATE giv_graphs_template ";
+		$rq .= "SET name = ";
+		isset($ret["name"]) && $ret["name"] != NULL ? $rq .= "'".htmlentities($ret["name"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "title = ";
+		isset($ret["title"]) && $ret["title"] != NULL ? $rq .= "'".htmlentities($ret["title"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .=	"img_format = ";
+		isset($ret["img_format"]) && $ret["img_format"] != NULL ? $rq .= "'".$ret["img_format"]."', ": $rq .= "NULL, ";
+		$rq .= 	"vertical_label = ";
+		isset($ret["vertical_label"]) && $ret["vertical_label"] != NULL ? $rq .= "'".htmlentities($ret["vertical_label"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= 	"period = ";
+		isset($ret["period"]) && $ret["period"] != NULL ? $rq .= "'".$ret["period"]."', ": $rq .= "NULL, ";
+		$rq .= 	"step = ";
+		isset($ret["step"]) && $ret["step"] != NULL ? $rq .= "'".$ret["step"]."', ": $rq .= "NULL, ";
+		$rq .= "width = ";
+		isset($ret["width"]) && $ret["width"] != NULL ? $rq .= "'".$ret["width"]."', ": $rq .= "NULL, ";
+		$rq .= "height = ";
+		isset($ret["height"]) && $ret["height"] != NULL ? $rq .= "'".$ret["height"]."', ": $rq .= "NULL, ";
+		$rq .= "lower_limit = ";
+		isset($ret["lower_limit"]) && $ret["lower_limit"] != NULL ? $rq .= "'".$ret["lower_limit"]."', ": $rq .= "NULL, ";
+		$rq .= "upper_limit = ";
+		isset($ret["upper_limit"]) && $ret["upper_limit"] != NULL ? $rq .= "'".$ret["upper_limit"]."', ": $rq .= "NULL, ";
+		$rq .= "bg_grid_color = ";
+		isset($ret["bg_grid_color"]) && $ret["bg_grid_color"] != NULL ? $rq .= "'".htmlentities($ret["bg_grid_color"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "bg_color = ";
+		isset($ret["bg_color"]) && $ret["bg_color"] != NULL ? $rq .= "'".htmlentities($ret["bg_color"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "police_color = ";
+		isset($ret["police_color"]) && $ret["police_color"] != NULL ? $rq .= "'".htmlentities($ret["police_color"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "grid_main_color = ";
+		isset($ret["grid_main_color"]) && $ret["grid_main_color"] != NULL ? $rq .= "'".htmlentities($ret["grid_main_color"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "grid_sec_color = ";
+		isset($ret["grid_sec_color"]) && $ret["grid_sec_color"] != NULL ? $rq .= "'".htmlentities($ret["grid_sec_color"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "contour_cub_color = ";
+		isset($ret["contour_cub_color"]) && $ret["contour_cub_color"] != NULL ? $rq .= "'".htmlentities($ret["contour_cub_color"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "col_arrow = ";
+		isset($ret["col_arrow"]) && $ret["col_arrow"] != NULL ? $rq .= "'".htmlentities($ret["col_arrow"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "col_top = ";
+		isset($ret["col_top"]) && $ret["col_top"] != NULL ? $rq .= "'".htmlentities($ret["col_top"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "col_bot = ";
+		isset($ret["col_bot"]) && $ret["col_bot"] != NULL ? $rq .= "'".htmlentities($ret["col_bot"], ENT_QUOTES)."', ": $rq .= "NULL, ";
+		$rq .= "default_tpl1 = ";
+		isset($ret["default_tpl1"]["default_tpl1"]) && $ret["default_tpl1"]["default_tpl1"] != NULL ? $rq .= "'".$ret["default_tpl1"]["default_tpl1"]."', ": $rq .= "NULL, ";
+		$rq .= "default_tpl2 = ";
+		isset($ret["default_tpl2"]["default_tpl2"]) && $ret["default_tpl2"]["default_tpl2"] != NULL ? $rq .= "'".$ret["default_tpl2"]["default_tpl2"]."', ": $rq .= "NULL, ";
+		$rq .= "stacked = ";
+		isset($ret["stacked"]["stacked"]) && $ret["stacked"]["stacked"] != NULL ? $rq .= "'".$ret["stacked"]["stacked"]."', ": $rq .= "NULL, ";
+		$rq .= "comment = ";
+		isset($ret["comment"]) && $ret["comment"] != NULL ? $rq .= "'".htmlentities($ret["comment"], ENT_QUOTES)."' ": $rq .= "NULL ";
+		$rq .= "WHERE graph_id = '".$graph_id."'";
+		$pearDB->query($rq);
+		defaultOreonGraph();
+		defaultPluginsGraph();
+	}			
+	
+	function updateComponentChilds($graph_id = null)	{
+		if (!$graph_id) return;
+		global $form;
+		global $pearDB;
+		$rq = "DELETE FROM giv_graphT_componentT_relation ";
+		$rq .= "WHERE gg_graph_id = '".$graph_id."'";
+		$pearDB->query($rq);
+		$ret = array();
+		$ret = $form->getSubmitValue("graph_compos");
+		for($i = 0; $i < count($ret); $i++)	{
+			$rq = "INSERT INTO giv_graphT_componentT_relation ";
+			$rq .= "(gg_graph_id, gc_compo_id) ";
+			$rq .= "VALUES ";
+			$rq .= "('".$graph_id."', '".$ret[$i]."')";
+			$pearDB->query($rq);
+		}
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/graphTemplates/formGraphTemplate.ihtml b/www/include/views/graphs/graphTemplates/formGraphTemplate.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..6f9f7e45285ca13d8e7edd9c11e505a56f915514
--- /dev/null
+++ b/www/include/views/graphs/graphTemplates/formGraphTemplate.ihtml
@@ -0,0 +1,91 @@
+<script type="text/javascript" src="include/configuration/changetab.js"></script>
+{$colorJS}
+{$form.javascript}
+<form {$form.attributes}>
+<div>
+<ul id="mainnav">
+	<li class="a" id='c1'><a href="#"  onclick="javascript:montre('1');">{$sort1}</a></li>
+	<li class="b" id='c2'><a href="#" onclick="javascript:montre('2');">{$sort2}</a></li>
+</ul>
+</div>
+<div id='tab1' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/layout_vertical.gif'>&nbsp;&nbsp;{$form.header.ftitle}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+	 	
+		<tr class="list_one"><td class="FormRowField">{$form.name.label}</td><td class="FormRowValue">{$form.name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.title.label}</td><td class="FormRowValue">{$form.title.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.img_format.label}</td><td class="FormRowValue">{$form.img_format.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.vertical_label.label}</td><td class="FormRowValue">{$form.vertical_label.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.width.label}</td><td class="FormRowValue">{$form.width.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.height.label}</td><td class="FormRowValue">{$form.height.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.lower_limit.label}</td><td class="FormRowValue">{$form.lower_limit.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.upper_limit.label}</td><td class="FormRowValue">{$form.upper_limit.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.period.label}</td><td class="FormRowValue">{$form.period.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.step.label}</td><td class="FormRowValue">{$form.step.html}</td></tr>
+		<tr class="list_one">
+			<td class="FormRowField">{$form.bg_grid_color.label}</td>
+			<td class="FormRowValue">{$form.bg_grid_color.html}&nbsp;&nbsp;{$form.bg_grid_color_color.html}&nbsp;&nbsp;{$form.bg_grid_color_modify.html}</td>
+		</tr>
+		<tr class="list_two">
+			<td class="FormRowField">{$form.grid_main_color.label}</td>
+			<td class="FormRowValue">{$form.grid_main_color.html}&nbsp;&nbsp;{$form.grid_main_color_color.html}&nbsp;&nbsp;{$form.grid_main_color_modify.html}</td>
+		</tr>
+		<tr class="list_one">
+			<td class="FormRowField">{$form.grid_sec_color.label}</td>
+			<td class="FormRowValue">{$form.grid_sec_color.html}&nbsp;&nbsp;{$form.grid_sec_color_color.html}&nbsp;&nbsp;{$form.grid_sec_color_modify.html}</td>
+		</tr>
+		<tr class="list_two">
+			<td class="FormRowField">{$form.contour_cub_color.label}</td>
+			<td class="FormRowValue">{$form.contour_cub_color.html}&nbsp;&nbsp;{$form.contour_cub_color_color.html}&nbsp;&nbsp;{$form.contour_cub_color_modify.html}</td>
+		</tr>
+		<tr class="list_one">
+			<td class="FormRowField">{$form.bg_color.label}</td>
+			<td class="FormRowValue">{$form.bg_color.html}&nbsp;&nbsp;{$form.bg_color_color.html}&nbsp;&nbsp;{$form.bg_color_modify.html}</td>
+		</tr>
+		<tr class="list_two">
+			<td class="FormRowField">{$form.police_color.label}</td>
+			<td class="FormRowValue">{$form.police_color.html}&nbsp;&nbsp;{$form.police_color_color.html}&nbsp;&nbsp;{$form.police_color_modify.html}</td>
+		</tr>
+		<tr class="list_one">
+			<td class="FormRowField">{$form.col_arrow.label}</td>
+			<td class="FormRowValue">{$form.col_arrow.html}&nbsp;&nbsp;{$form.col_arrow_color.html}&nbsp;&nbsp;{$form.col_arrow_modify.html}</td>
+		</tr>
+		<tr class="list_two">
+			<td class="FormRowField">{$form.col_top.label}</td>
+			<td class="FormRowValue">{$form.col_top.html}&nbsp;&nbsp;{$form.col_top_color.html}&nbsp;&nbsp;{$form.col_top_modify.html}</td>
+		</tr>
+		<tr class="list_one">
+			<td class="FormRowField">{$form.col_bot.label}</td>
+			<td class="FormRowValue">{$form.col_bot.html}&nbsp;&nbsp;{$form.col_bot_color.html}&nbsp;&nbsp;{$form.col_bot_modify.html}</td>
+		</tr>
+		<tr class="list_two"><td class="FormRowField">{$form.stacked.label}</td><td class="FormRowValue">{$form.stacked.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.default_tpl1.label}</td><td class="FormRowValue">{$form.default_tpl1.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.default_tpl2.label}</td><td class="FormRowValue">{$form.default_tpl2.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.comment.label}</td><td class="FormRowValue">{$form.comment.html}</td></tr>
+
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+</div>
+<div id='tab2' class="tab">
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/layout_vertical.gif'>&nbsp;&nbsp;{$form.header.ftitle}</td></tr>
+
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/layout_horizontal.gif'>&nbsp;&nbsp;{$form.header.compos}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.graph_compos.label}</td><td class="FormRowValue">{$form.graph_compos.html}</td></tr>
+	</table>
+</div>
+<div id="validForm">
+{if $o == "a" || $o == "c"}
+	<p>{$form.action.html}</p>
+	<p>{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+{else if $o == "w"}
+	<p>{$form.change.html}</p>
+{/if}
+</div>
+{$form.hidden}
+</form>
+
diff --git a/www/include/views/graphs/graphTemplates/formGraphTemplate.php b/www/include/views/graphs/graphTemplates/formGraphTemplate.php
new file mode 100644
index 0000000000000000000000000000000000000000..28c2c8571b69b6582c65ea8fa1739a09f1ac438c
--- /dev/null
+++ b/www/include/views/graphs/graphTemplates/formGraphTemplate.php
@@ -0,0 +1,267 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information
+	#
+	$graph = array();
+	if (($o == "c" || $o == "w") && $graph_id)	{
+		$res =& $pearDB->query("SELECT * FROM giv_graphs_template WHERE graph_id = '".$graph_id."' LIMIT 1");
+		# Set base value
+		$graph = array_map("myDecode", $res->fetchRow());
+		# Set Components relations
+		$res =& $pearDB->query("SELECT DISTINCT gc_compo_id FROM giv_graphT_componentT_relation WHERE gg_graph_id = '".$graph_id."'");
+		for($i = 0; $res->fetchInto($compo); $i++)
+			$graph["graph_compos"][$i] = $compo["gc_compo_id"];
+		$res->free();
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	# Components comes from DB -> Store in $compos Array
+	$compos = array();
+	$res =& $pearDB->query("SELECT compo_id, name FROM giv_components_template ORDER BY name");
+	while($res->fetchInto($compo))
+		$compos[$compo["compo_id"]] = $compo["name"];
+	$res->free();
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"30");
+	$attrsText2 	= array("size"=>"6");
+	$attrsAdvSelect = array("style" => "width: 200px; height: 100px;");
+	$attrsTextarea 	= array("rows"=>"3", "cols"=>"30");
+	$template 		= "<table><tr><td>{unselected}</td><td align='center'>{add}<br><br><br>{remove}</td><td>{selected}</td></tr></table>";
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'ftitle', $lang["giv_gt_add"]);
+	else if ($o == "c")
+		$form->addElement('header', 'ftitle', $lang["giv_gt_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'ftitle', $lang["giv_gt_view"]);
+
+	#
+	## Basic information
+	#
+	$form->addElement('header', 'information', $lang['giv_gt_infos']);
+	$form->addElement('text', 'name', $lang["giv_gt_name"], $attrsText);
+	$form->addElement('text', 'title', $lang["giv_gt_title"], $attrsText);
+
+	$form->addElement('select', 'img_format', $lang["giv_gt_imgFormat"], array("PNG"=>"PNG", "GIF"=>"GIF"));
+	$form->addElement('text', 'vertical_label', $lang["giv_gt_vLabel"], $attrsText);
+	$form->addElement('text', 'width', $lang["giv_gt_width"], $attrsText2);
+	$form->addElement('text', 'height', $lang["giv_gt_height"], $attrsText2);
+	$form->addElement('text', 'lower_limit', $lang["giv_gt_lower_limit"], $attrsText2);
+	$form->addElement('text', 'upper_limit', $lang["giv_gt_upper_limit"], $attrsText2);
+	$periods = array(	"10800"=>$lang["giv_sr_p3h"],
+						"21600"=>$lang["giv_sr_p6h"],
+						"43200"=>$lang["giv_sr_p12h"],
+						"86400"=>$lang["giv_sr_p24h"],
+						"172800"=>$lang["giv_sr_p2d"],
+						"302400"=>$lang["giv_sr_p4d"],	
+						"604800"=>$lang["giv_sr_p7d"],
+						"1209600"=>$lang["giv_sr_p14d"],
+						"2419200"=>$lang["giv_sr_p28d"],
+						"2592000"=>$lang["giv_sr_p30d"],
+						"2678400"=>$lang["giv_sr_p31d"],
+						"5184000"=>$lang["giv_sr_p2m"],
+						"10368000"=>$lang["giv_sr_p4m"],
+						"15552000"=>$lang["giv_sr_p6m"],
+						"31104000"=>$lang["giv_sr_p1y"]);	
+	$sel =& $form->addElement('select', 'period', $lang["giv_sr_period"], $periods);
+	$steps = array(	"0"=>$lang["giv_sr_noStep"],
+				"2"=>"2",
+				"6"=>"6",
+				"10"=>"10",
+				"20"=>"20",
+				"50"=>"50",
+				"100"=>"100");					
+	$sel =& $form->addElement('select', 'step', $lang["giv_sr_step"], $steps);
+	$TabColorNameAndLang 	= array("bg_grid_color"=>"giv_gt_bgGridClr",
+                                    	"grid_main_color"=>"giv_gt_bgGridPClr",
+                                    	"grid_sec_color"=>"giv_gt_bgGridSClr",
+                                    	"contour_cub_color"=>"giv_gt_bgContClr",
+                                    	"bg_color"=>"giv_gt_bgClr",
+                                    	"police_color"=>"giv_gt_bgPol",
+                                    	"col_arrow"=>"giv_gt_arrClr",
+                                    	"col_top"=>"giv_gt_topClr",
+                                    	"col_bot"=>"giv_gt_botClr",
+					);
+
+	while (list($nameColor, $val) = each($TabColorNameAndLang))	{
+		$nameLang = $lang[$val];
+		isset($graph[$nameColor]) ?	$codeColor = $graph[$nameColor] : $codeColor = NULL;
+		$title = $lang["genOpt_colorPicker"];
+		$attrsText3 	= array("value"=>$codeColor,"size"=>"8","maxlength"=>"7");
+		$form->addElement('text', $nameColor, $nameLang,  $attrsText3);
+		//if ($form->validate())	{
+		//	$colorColor = $form->exportValue($nameColor);
+		//}
+		$attrsText4 	= array("style"=>"width:50px; height:18px; background: ".$codeColor." url() left repeat-x 0px; border-color:".$codeColor.";");
+		$attrsText5 	= array("onclick"=>"popup_color_picker('$nameColor','$nameLang','$title');");
+		$form->addElement('button', $nameColor.'_color', "", $attrsText4);
+		//if (!$form->validate())	{
+		if ($o == "c" || $o == "a")	{
+			$form->addElement('button', $nameColor.'_modify', $lang['modify'], $attrsText5);
+		}
+	}
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'stacked', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'stacked', null, $lang["no"], '0');
+	$form->addGroup($tab, 'stacked', $lang["giv_gt_stacked"], '&nbsp;');
+	$form->setDefaults(array('stacked' => '0'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'default_tpl1', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'default_tpl1', null, $lang["no"], '0');
+	$form->addGroup($tab, 'default_tpl1', $lang["giv_gt_defaultTpl1"], '&nbsp;');
+	$form->setDefaults(array('default_tpl1' => '0'));
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'default_tpl2', null, $lang["yes"], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'default_tpl2', null, $lang["no"], '0');
+	$form->addGroup($tab, 'default_tpl2', $lang["giv_gt_defaultTpl2"], '&nbsp;');
+	$form->setDefaults(array('default_tpl2' => '0'));
+	$form->addElement('textarea', 'comment', $lang["giv_gt_comment"], $attrsTextarea);
+
+	#
+	## Components linked with
+	#
+	$form->addElement('header', 'compos', $lang["giv_compoChoice"]);
+    $ams1 =& $form->addElement('advmultiselect', 'graph_compos', $lang["giv_compoList"], $compos, $attrsAdvSelect);
+	$ams1->setButtonAttributes('add', array('value' =>  $lang['add']));
+	$ams1->setButtonAttributes('remove', array('value' => $lang['delete']));
+	$ams1->setElementTemplate($template);
+	echo $ams1->getElementJs(false);
+
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+
+	$form->addElement('hidden', 'graph_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('name', $lang['ErrName'], 'required');
+	$form->addRule('vertical_label', $lang['ErrRequired'], 'required');
+	$form->addRule('width', $lang['ErrRequired'], 'required');
+	$form->addRule('height', $lang['ErrRequired'], 'required');
+	$form->addRule('bg_grid_color', $lang['ErrRequired'], 'required');
+    $form->addRule('grid_main_color', $lang['ErrRequired'], 'required');
+	$form->addRule('grid_sec_color', $lang['ErrRequired'], 'required');
+    $form->addRule('contour_cub_color', $lang['ErrRequired'], 'required');
+    $form->addRule('bg_color', $lang['ErrRequired'], 'required');
+    $form->addRule('police_color', $lang['ErrRequired'], 'required');
+    $form->addRule('col_arrow', $lang['ErrRequired'], 'required');
+    $form->addRule('col_top', $lang['ErrRequired'], 'required');
+    $form->addRule('col_bot', $lang['ErrRequired'], 'required');
+
+	$form->addRule('title', $lang['ErrRequired'], 'required');
+	$form->registerRule('exist', 'callback', 'testExistence');
+	$form->addRule('name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	#
+	##End of form definition
+	#
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# Just watch
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&graph_id=".$graph_id."'"));
+	    $form->setDefaults($graph);
+		$form->freeze();
+	}
+	# Modify
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["delete"]);
+	    $form->setDefaults($graph);
+	}
+	# Add
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["delete"]);
+	}
+	$tpl->assign('msg', array ("changeL"=>"?p=".$p."&o=c&graph_id=".$graph_id, "changeT"=>$lang['modify']));
+
+	$tpl->assign("sort1", $lang['giv_gt_properties']);
+	$tpl->assign("sort2", $lang["giv_compo"]);
+
+	#
+	##Picker Color JS
+	#
+	$tpl->assign('colorJS',"
+	<script type='text/javascript'>
+		function popup_color_picker(t,name,title)
+		{
+			var width = 400;
+			var height = 300;
+			window.open('./include/common/javascript/color_picker.php?n='+t+'&name='+name+'&title='+title, 'cp', 'resizable=no, location=no, width='
+						+width+', height='+height+', menubar=no, status=yes, scrollbars=no, menubar=no');
+		}
+	</script>
+    "
+    );
+	#
+	##End of Picker Color
+	#
+
+	$valid = false;
+	if ($form->validate())	{
+		$graphObj =& $form->getElement('graph_id');
+		if ($form->getSubmitValue("submitA"))
+			$graphObj->setValue(insertGraphTemplateInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateGraphTemplateInDB($graphObj->getValue());
+		$o = "w";
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&graph_id=".$graphObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once("listGraphTemplates.php");
+	else	{
+		#Apply a template definition
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->display("formGraphTemplate.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/graphTemplates/graphTemplates.php b/www/include/views/graphs/graphTemplates/graphTemplates.php
new file mode 100644
index 0000000000000000000000000000000000000000..1f028d5eadb92dc7a4025fbfca88d8c1fcf8e33f
--- /dev/null
+++ b/www/include/views/graphs/graphTemplates/graphTemplates.php
@@ -0,0 +1,49 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["graph_id"]) ? $cG = $_GET["graph_id"] : $cG = NULL;
+	isset($_POST["graph_id"]) ? $cP = $_POST["graph_id"] : $cP = NULL;
+	$cG ? $graph_id = $cG : $graph_id = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/views/graphs/graphTemplates/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	
+	switch ($o)	{
+		case "a" : require_once($path."formGraphTemplate.php"); break; #Add a Graph Template
+		case "w" : require_once($path."formGraphTemplate.php"); break; #Watch aGraph Template
+		case "c" : require_once($path."formGraphTemplate.php"); break; #Modify a Graph Template
+		case "s" : enableGraphTemplateInDB($lca_id); require_once($path."listGraphTemplates.php"); break; #Activate a Graph Template
+		case "u" : disableGraphTemplateInDB($lca_id); require_once($path."listGraphTemplates.php"); break; #Desactivate a Graph Template
+		case "m" : multipleGraphTemplateInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listGraphTemplates.php"); break; #Duplicate n Graph Templates
+		case "d" : deleteGraphTemplateInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listGraphTemplates.php"); break; #Delete n Graph Templates
+		default : require_once($path."listGraphTemplates.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/graphTemplates/listGraphTemplates.ihtml b/www/include/views/graphs/graphTemplates/listGraphTemplates.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..73559cbe339c675d1b810d30e84750e59ab1b4e4
--- /dev/null
+++ b/www/include/views/graphs/graphTemplates/listGraphTemplates.ihtml
@@ -0,0 +1,45 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_compo}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_tpl1}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_tpl2}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_compo}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_tpl1}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_tpl2}</td>
+			<td class="ListColRight">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">
+			</td>
+			<td class="ListColFooterCenter" colspan="4"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
\ No newline at end of file
diff --git a/www/include/views/graphs/graphTemplates/listGraphTemplates.php b/www/include/views/graphs/graphTemplates/listGraphTemplates.php
new file mode 100644
index 0000000000000000000000000000000000000000..e61b0cfd53511e89635458c4f9ed8808e5b54a09
--- /dev/null
+++ b/www/include/views/graphs/graphTemplates/listGraphTemplates.php
@@ -0,0 +1,103 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+$pagination = "maxViewConfiguration";
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM giv_graphs_template WHERE name LIKE '%".$search."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM giv_graphs_template");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_compo", $lang['giv_compo']);
+	$tpl->assign("headerMenu_tpl1", $lang['giv_tpl1']);
+	$tpl->assign("headerMenu_tpl2", $lang['giv_tpl2']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+
+	#List
+	if ($search)
+		$rq = "SELECT @nbr:=(SELECT COUNT(gc_compo_id) FROM giv_graphT_componentT_relation ggcr WHERE ggcr.gg_graph_id = gg.graph_id) AS nbr, graph_id, name, title, default_tpl1, default_tpl2 FROM giv_graphs_template gg WHERE name LIKE '%".$search."%' ORDER BY name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT @nbr:=(SELECT COUNT(gc_compo_id) FROM giv_graphT_componentT_relation ggcr WHERE ggcr.gg_graph_id = gg.graph_id) AS nbr, graph_id, name, title, default_tpl1, default_tpl2 FROM giv_graphs_template gg ORDER BY name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($graph); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$graph['graph_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&graph_id=".$graph['graph_id']."&o=w&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&graph_id=".$graph['graph_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&graph_id=".$graph['graph_id']."&o=d&select[".$graph['graph_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$graph['graph_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$graph["name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&graph_id=".$graph['graph_id'],
+						"RowMenu_desc"=>$graph["title"],
+						"RowMenu_compo"=>$graph["nbr"],
+						"RowMenu_tpl1"=>$graph["default_tpl1"] ? $lang["yes"] : $lang["no"],
+						"RowMenu_tpl2"=>$graph["default_tpl2"] ? $lang["yes"] : $lang["no"],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";
+	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listGraphTemplates.ihtml");
+
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+	
+?>
diff --git a/www/include/views/graphs/hostGraphs/hostGraphs.ihtml b/www/include/views/graphs/hostGraphs/hostGraphs.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..b130174dbd24d6ba08669cd64956dd1afad1fd1a
--- /dev/null
+++ b/www/include/views/graphs/hostGraphs/hostGraphs.ihtml
@@ -0,0 +1,60 @@
+<script type="text/javascript" src='./include/common/javascript/datePicker.js'></script>
+<script type="text/javascript" src='./include/common/javascript/hidden_div.js'></script>
+<link href="./include/common/javascript/datePicker.css" rel="stylesheet" type="text/css"/>
+{$form.javascript}
+<div>
+{if $rrd}
+	<table id="ListTable">
+		<tr class='ListHeader'>
+			<td class="ListColHeaderLeft" colspan="3"><img src='./img/icones/16x16/line-chart.gif'>&nbsp;&nbsp;Rendu Graphique</td>
+		</tr>
+ 
+		<tr>
+			<td class='ListColCenter'>
+				{foreach item=h from=$rrd }
+					<div style="position: relative; list-style-type: none;"><img src='./include/views/graphs/generateImage/generateRRDImagePlugins.php?nbgraph={$nbGraph}&session_id={$session_id}&database={$h.host_id}_{$h.service_service_id}.rrd&template_id={$h.graph_id}&end={$end}&start={$start}'></div>
+				{/foreach}
+			</td>
+		</tr>
+	</table>
+<br>
+
+{/if}
+
+</div>
+<div style="padding-top: 20px;">
+    <form {$form.attributes}>
+        <div>
+       		<table id="ListTable">
+                <tr class="ListHeader">
+                	<td class="FormHeader" colspan="2">{$form.header.title}</td>
+                </tr>
+                <tr class="list_one">
+            		<td>{$form.host_name.label}</td>
+            		<td>{$form.host_name.html}</td>
+                </tr>
+        	</table>
+        </div>
+        <div id="validForm">
+        	<p>{$form.submitC.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}&nbsp;&nbsp;&nbsp;{$form.advanced.html}</p><br />
+        </div><br /><br /><br /><br />
+        <div name="div1" id="div1" class='cachediv'>
+        	<table id="ListTable">
+                <tr class="ListHeader">
+                	<td class="FormHeader" colspan="2">{$lang.advanced}</td>
+                </tr>
+                <tr class="list_two"><td>{$form.period.label}</td><td>{$form.period.html}</td></tr>
+                <tr class="list_one"><td>{$form.nbGraph.label}</td><td>{$form.nbGraph.html}</td></tr>
+				<tr class="list_two">
+					<td>{$form.start.label}</td>
+					<td>{$form.start.html}&nbsp;&nbsp;{$form.startD.html}</td>
+				</tr>
+				<tr class="list_one">
+					<td>{$form.end.label}</td>
+					<td>{$form.end.html}&nbsp;&nbsp;{$form.endD.html}</td>
+				</tr>
+        	</table>
+        </div>
+        {$form.hidden}
+    </form>
+</div>
diff --git a/www/include/views/graphs/hostGraphs/hostGraphs.php b/www/include/views/graphs/hostGraphs/hostGraphs.php
new file mode 100644
index 0000000000000000000000000000000000000000..2cf75745831c0803e5735649dc8a3543428422f7
--- /dev/null
+++ b/www/include/views/graphs/hostGraphs/hostGraphs.php
@@ -0,0 +1,193 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+
+	isset($_GET["service_id"]) ? $cG = $_GET["service_id"] : $cG = NULL;
+	isset($_POST["service_id"]) ? $cP = $_POST["service_id"] : $cP = NULL;
+	$cG ? $service_id = $cG : $service_id = $cP;
+
+	isset($_GET["service_description"]) ? $cG = $_GET["service_description"] : $cG = NULL;
+	isset($_POST["service_description"]) ? $cP = $_POST["service_description"] : $cP = NULL;
+	$cG ? $service_description = $cG : $service_description = $cP;
+
+	isset($_GET["host_name"]) ? $cG = $_GET["host_name"] : $cG = NULL;
+	isset($_POST["host_name"]) ? $cP = $_POST["host_name"] : $cP = NULL;
+	$cG ? $host_name = $cG : $host_name = $cP;
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+
+	#Path to the configuration dir
+	$path = "./include/views/graphs/hostGraphs/";
+
+	#PHP functions
+	require_once "./include/common/common-Func.php";
+
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+
+	$res =& $pearDB->getAssoc("SELECT DISTINCT h.host_name, h.host_name 
+									  	FROM host h, host_service_relation hs, service s, command c, hostgroup_relation hgr, extended_service_information e
+										WHERE  (
+														hs.host_host_id = h.host_id
+														OR (
+															hgr.host_host_id = h.host_id
+															AND hs.hostgroup_hg_id = hgr.hostgroup_hg_id
+															)
+													)
+												AND s.service_id = hs.service_service_id
+												AND e.service_service_id = hs.service_service_id
+												AND c.command_id = s.command_command_id
+												AND c.command_name LIKE 'check_graph%'");
+
+
+	$debug = 0;
+	$attrsTextI		= array("size"=>"3");
+	$attrsText 		= array("size"=>"30");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl, "./");
+
+	#
+	## Form begin
+	#
+
+	$form = new HTML_QuickForm('Form', 'get', "?p=".$p);
+	$form->addElement('header', 'title', $lang["giv_sr_infos"]);
+	#
+	## Indicator basic information
+	#
+
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	$page =& $form->addElement('hidden', 'p');
+	$page->setValue($p);
+	$minF =& $form->addElement('hidden', 'min');
+	$minF->setValue($min);
+
+	$sel =& $form->addElement('select', 'host_name', "Host", $res);
+
+	# "3600"=>$lang["giv_sr_p1h"],
+
+	$periods = array(
+				"10800"=>$lang["giv_sr_p3h"],
+				"21600"=>$lang["giv_sr_p6h"],
+				"43200"=>$lang["giv_sr_p12h"],
+				"86400"=>$lang["giv_sr_p24h"],
+				"172800"=>$lang["giv_sr_p2d"],
+				"302400"=>$lang["giv_sr_p4d"],
+				"604800"=>$lang["giv_sr_p7d"],
+				"1209600"=>$lang["giv_sr_p14d"],
+				"2419200"=>$lang["giv_sr_p28d"]
+	);
+	$sel =& $form->addElement('select', 'period', $lang["giv_sr_period"], $periods);
+	$form->setDefaults(array('period' =>'10800'));
+
+	$form->addElement('text', 'start', $lang['giv_gt_start']);
+	$form->addElement('button', "startD", $lang['modify'], array("onclick"=>"displayDatePicker('start')"));
+	$form->addElement('text', 'end', $lang['giv_gt_end']);
+	$form->addElement('button', "endD", $lang['modify'], array("onclick"=>"displayDatePicker('end')"));
+
+
+	$nbGraph[] = &HTML_QuickForm::createElement('radio', 'nbGraph', null, 1, '1');
+	$nbGraph[] = &HTML_QuickForm::createElement('radio', 'nbGraph', null, 2, '2');
+	$form->addGroup($nbGraph, 'nbGraph', $lang['giv_hg_nbGraph'], '&nbsp;&nbsp;&nbsp;&nbsp;');
+	$form->setDefaults(array('nbGraph' => '2'));
+
+	$subC =& $form->addElement('submit', 'submitC', $lang["giv_sr_button"]);
+	$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+  	$res =& $form->addElement('button', 'advanced', $lang["advanced"], array("onclick"=>"DivStatus( 'div', '1' )"));
+
+	if (((isset($_GET["submitC"]) && $_GET["submitC"]) || $min == 1))
+		if ($form->validate())	{
+		$ret = $form->getsubmitValues();
+
+		$res =& $pearDB->query("SELECT DISTINCT h.host_id, hs.service_service_id,e.graph_id 
+									  	FROM host h, host_service_relation hs, service s, command c, hostgroup_relation hgr, extended_service_information e
+										WHERE h.host_name = '".$_GET["host_name"]."'
+												AND (
+														hs.host_host_id = h.host_id
+														OR (
+															hgr.host_host_id = h.host_id
+															AND hs.hostgroup_hg_id = hgr.hostgroup_hg_id
+															)
+													)
+												AND s.service_id = hs.service_service_id
+												AND e.service_service_id = hs.service_service_id
+												AND c.command_id = s.command_command_id
+												AND c.command_name LIKE 'check_graph%'");
+		$i=0;
+		while($rrd[$i]=$res->fetchRow()){
+			if (!file_exists($oreon->optGen["oreon_rrdbase_path"].$rrd[$i]["host_id"]."_".$rrd[$i]["service_service_id"].".rrd"))
+				print ("rrd file not found");
+		$i++;
+		}
+
+
+		//$_GET["database"] = array("0" => getHostID($_GET["host_name"]) . "_" . getServiceID($_GET["host_name"], $_GET["service_description"]) . ".rrd", "1" => $_GET["host_name"]);
+
+			# Init variable in the page
+			$tpl->assign("period", $periods[$ret["period"]]);
+
+
+			# Init
+
+			if (isset($_GET["start"]) && $_GET["start"]){
+				preg_match("/^([0-9]*)\/([0-9]*)\/([0-9]*)/", $_GET["start"], $matches);
+				$start = mktime("0", "0", "0", $matches[1], $matches[2], $matches[3], 1) ;
+			}
+			if (isset($_GET["end"]) && $_GET["end"]){
+				preg_match("/^([0-9]*)\/([0-9]*)\/([0-9]*)/", $_GET["end"], $matches);
+				$end = mktime("23", "59", "59", $matches[1], $matches[2], $matches[3], 1)  + 10;
+			}
+
+			if (!isset($start))
+				$start = time() - ($ret["period"] + 120);
+			if (!isset($end))
+				$end = time() + 120;
+
+
+			$tpl->assign("nbGraph", $_GET["nbGraph"]["nbGraph"]);
+			$tpl->assign("end", $end);
+			$tpl->assign("start", $start);
+			if (isset($_GET["grapht_graph_id"]))
+				$tpl->assign('graph_graph_id', $_GET["grapht_graph_id"]);
+    }
+
+	#Apply a template definition
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+	$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+	$form->accept($renderer);
+	
+	if (isset($rrd))
+		$tpl->assign("rrd", $rrd);
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->assign('o', $o);
+	$tpl->assign('lang', $lang);
+	$tpl->assign('session_id', session_id());
+	$tpl->display("hostGraphs.ihtml");
+?>
diff --git a/www/include/views/graphs/simpleRenderer/DB-Func.php b/www/include/views/graphs/simpleRenderer/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..457cfe7d5be5cc192828b5916638391811d1170b
--- /dev/null
+++ b/www/include/views/graphs/simpleRenderer/DB-Func.php
@@ -0,0 +1,62 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+/*
+	function getDefaultGraph ()	{
+		global $pearDB;
+		$gt = array("graph_id"=>NULL, "name"=>NULL);
+		$res =& $pearDB->query("SELECT graph_id, name FROM giv_graphs_template WHERE default_tpl1 = '1' LIMIT 1");
+		if ($res->numRows())	{
+			$gt =& $res->fetchRow();
+			$res->free();
+			return $gt;
+		}
+		$res =& $pearDB->query("SELECT graph_id, name FROM giv_graphs_template LIMIT 1");
+		if ($res->numRows())	{
+			$gt =& $res->fetchRow();
+			$res->free();
+			return $gt;
+		}
+		return $gt;
+	}
+	
+	function getDefaultDS ($graph_id = NULL, $current_ds = NULL)	{
+		if (!$graph_id) return NULL;
+		global $pearDB;
+		$ds = array();
+		$res =& $pearDB->query("SELECT gct.compo_id, gct.name FROM giv_components_template gct, giv_graphT_componentT_relation ggcr WHERE ggcr.gg_graph_id = '".$graph_id."' AND ggcr.gc_compo_id = gct.compo_id ORDER BY gct.ds_order");
+		$cpt = 0;
+		$sum = $res->numRows();
+		while ($res->fetchInto($ds))	{
+			if ($current_ds == $cpt)
+				return $ds;
+			$cpt++;				 
+		}
+		$res =& $pearDB->query("SELECT compo_id, name FROM giv_components_template WHERE default_tpl1 = '1' LIMIT 1");
+		if ($res->numRows())	{
+			$ds =& $res->fetchRow();
+			return $ds;
+		}
+		$res =& $pearDB->query("SELECT compo_id, name FROM giv_components_template LIMIT 1");
+		if ($res->numRows())	{
+			$ds =& $res->fetchRow();
+			return $ds;
+		}
+		return NULL;
+	}
+*/
+?>
\ No newline at end of file
diff --git a/www/include/views/graphs/simpleRenderer/simpleRenderer.ihtml b/www/include/views/graphs/simpleRenderer/simpleRenderer.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..23649c96870f25b1482ae9c3490bfe8b2f128e6d
--- /dev/null
+++ b/www/include/views/graphs/simpleRenderer/simpleRenderer.ihtml
@@ -0,0 +1,74 @@
+<script language='javascript' src='./include/common/javascript/datePicker.js'></script>
+<script language='javascript' src='./include/common/javascript/hidden_div.js'></script>
+<link href="./include/common/javascript/datePicker.css" rel="stylesheet" type="text/css"/>
+{$form.javascript}
+<div>
+{if $title2}
+	<table id="ListTable">
+        <tr class="ListHeader">
+        	<td class="FormHeader" colspan="2"><img src='./img/icones/16x16/column-chart.gif'>&nbsp;{$title2} - {$res}</td>
+        </tr>
+        <tr>
+    		<td colspan="2" class='ListColCenter'>
+    			{if $isAvl}
+					<img src='./include/views/graphs/generateImage/generateRRDImage.php?session_id={$session_id}&host_name={$host_name}&service_description={$service_description}{if $defaultGraph.graph_id}&template_id={$defaultGraph.graph_id}{/if}&end={$end}&start={$start}'><br>
+    			{/if}
+    		</td>
+        </tr>
+        <tr class="list_one">
+    		<td colspan="2" class='ListColCenter'>{$cpt_total_graphed_values}/{$cpt_total_values} {$graphed_values}</b></td>
+        </tr>
+    </table>
+{/if}
+</div>
+<div style="padding-top: 20px;">
+    <form {$form.attributes}>
+    	{if $title2}<div id="validForm"><p>{$form.submitC.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}&nbsp;&nbsp;&nbsp;{$form.advanced.html}</p></div>{/if}
+       	<div>
+       		<br><br><br><br>
+	        <table id="ListTable">
+                <tr class="ListHeader">
+                	<td class="FormHeader" colspan="2">{$form.header.title}</td>
+                </tr>
+                <tr class="list_one">
+            		<td>{$form.host_name.label}/{$form.service_description.label}</td>
+            		<td>{$form.host_name.html}&nbsp;&nbsp;{$form.service_description.html}</td>
+                </tr>
+                <tr class="list_two">
+                    <td>{$form.meta_service.label}</td>
+            		<td>{$form.meta_service.html}</td>
+                </tr>
+               <!-- <tr class="list_one">
+                    <td>{$form.osl.label}</td>
+            		<td>{$form.osl.html}</td>
+                </tr>-->
+    	    </table>
+    	  	{if !$title2}
+    		<div id="validForm"><p>{$form.submitC.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}&nbsp;&nbsp;&nbsp;{$form.advanced.html}</p><br><br><br><br></div>
+     	   	{/if}
+    	    <br>
+    	    <div id="div1" class="cachediv" {if !$title2}style="padding-top:34px;"{/if}>
+	    	    <table id="ListTable">
+	                <tr class="ListHeader">
+	                	<td class="FormHeader" colspan="2">{$lang.advanced}</td>
+	                <tr>
+	                <tr class="list_two">
+	            		<td>{$form.grapht_graph_id.label}</td>
+	            		<td>{$form.grapht_graph_id.html}</td>
+	                </tr>
+	                <tr class="list_one"><td>{$form.period.label}</td><td>{$form.period.html}</td></tr>
+					<tr class="list_two">
+						<td>{$form.start.label}</td>
+						<td>{$form.start.html}&nbsp;&nbsp;{$form.startD.html}</td>
+					</tr>
+					<tr class="list_one">
+						<td>{$form.end.label}</td>
+						<td>{$form.end.html}&nbsp;&nbsp;{$form.endD.html}</td>
+					</tr>
+	                <tr class="list_two"><td>{$form.step.label}</td><td>{$form.step.html}</td></tr>
+	        	</table>
+        	</div>
+        </div>
+        {$form.hidden}
+    </form>
+</div>
\ No newline at end of file
diff --git a/www/include/views/graphs/simpleRenderer/simpleRenderer.php b/www/include/views/graphs/simpleRenderer/simpleRenderer.php
new file mode 100644
index 0000000000000000000000000000000000000000..82531fe7e1e970ce91b50a16bbb29d57986b915d
--- /dev/null
+++ b/www/include/views/graphs/simpleRenderer/simpleRenderer.php
@@ -0,0 +1,357 @@
+	<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset($oreon))
+		exit ();
+	
+	isset($_GET["service_id"]) ? $cG = $_GET["service_id"] : $cG = NULL;
+	isset($_POST["service_id"]) ? $cP = $_POST["service_id"] : $cP = NULL;
+	$cG ? $service_id = $cG : $service_id = $cP;
+	
+	isset($_GET["service_description"]) ? $cG = $_GET["service_description"] : $cG = NULL;
+	isset($_POST["service_description"]) ? $cP = $_POST["service_description"] : $cP = NULL;
+	$cG ? $service_description = $cG : $service_description = $cP;
+
+	isset($_GET["host_name"]) ? $cG = $_GET["host_name"] : $cG = NULL;
+	isset($_POST["host_name"]) ? $cP = $_POST["host_name"] : $cP = NULL;
+	$cG ? $host_name = $cG : $host_name = $cP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the configuration dir
+	$path = "./include/views/graphs/simpleRenderer/";
+	
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+	require_once("./DBPerfparseConnect.php");
+
+	
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#	
+	# Resources comes from DB -> Store in $ppHosts Array
+	$ppHosts = array(NULL=>NULL);
+	$res =& $pearDBpp->query("SELECT DISTINCT host_name FROM perfdata_service_metric ORDER BY host_name");
+	while($res->fetchInto($ppHost))	{
+		if (array_search($ppHost["host_name"], $oreon->user->lcaHost))
+			$ppHosts[$ppHost["host_name"]] = $ppHost["host_name"];
+	}
+	$res->free();
+	
+	$graphTs = array(NULL=>NULL);
+	$res =& $pearDB->query("SELECT graph_id, name FROM giv_graphs_template ORDER BY name");
+	while($res->fetchInto($graphT))
+		$graphTs[$graphT["graph_id"]] = $graphT["name"];
+	$res->free();
+	
+	$ppServices1 = array();
+	$ppServices2 = array();
+	if ($host_name && array_search($host_name, $oreon->user->lcaHost))	{
+		# Perfparse Host comes from DB -> Store in $ppHosts Array
+		$ppServices = array(NULL=>NULL);
+		$res =& $pearDBpp->query("SELECT DISTINCT metric_id, service_description, metric, unit FROM perfdata_service_metric WHERE host_name = '".$host_name."' ORDER BY host_name");
+		while($res->fetchInto($ppService))
+			$ppServices1[$ppService["service_description"]] = $ppService["service_description"];
+		$res->free();		
+	}
+	
+	# Perfparse Meta Services comes from DB -> Store in $ppMSs Array
+	$ppMSs = array(NULL=>NULL);
+	$res =& $pearDBpp->query("SELECT DISTINCT service_description FROM perfdata_service_metric WHERE host_name = 'Meta_Module' ORDER BY service_description");
+	while($res->fetchInto($ppMS))	{
+		$id = explode("_", $ppMS["service_description"]);
+		$res2 =& $pearDB->query("SELECT meta_name FROM meta_service WHERE meta_id = '".$id[1]."'");
+		if ($res2->numRows())	{
+			$meta =& $res2->fetchRow();
+			$ppMSs[$ppMS["service_description"]] = $meta["meta_name"];
+		}
+		$res2->free();
+	}
+	$res->free();
+	
+	$debug = 0;
+	$attrsTextI		= array("size"=>"3");
+	$attrsText 		= array("size"=>"30");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"50");
+	
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	#
+	## Form begin
+	#
+	
+	$form = new HTML_QuickForm('Form', 'get', "?p=".$p);
+	$form->addElement('header', 'title', $lang["giv_sr_infos"]);
+
+	#
+	## Indicator basic information
+	#
+	
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);	
+	$page =& $form->addElement('hidden', 'p');
+	$page->setValue($p);	
+	$minF =& $form->addElement('hidden', 'min');
+	$minF->setValue($min);
+   
+	$form->addElement('select', 'host_name', $lang["h"], $ppHosts, array("onChange"=>"this.form.submit()"));
+	$form->addElement('select', 'service_description', $lang["sv"], $ppServices1);
+	$form->addElement('select', 'meta_service', $lang["ms"], $ppMSs);
+	$form->addElement('select', 'grapht_graph_id', $lang["giv_gg_tpl"], $graphTs);
+	
+	$periods = array(	""=>"",
+						"10800"=>$lang["giv_sr_p3h"],
+						"21600"=>$lang["giv_sr_p6h"],
+						"43200"=>$lang["giv_sr_p12h"],
+						"86400"=>$lang["giv_sr_p24h"],
+						"172800"=>$lang["giv_sr_p2d"],
+						"302400"=>$lang["giv_sr_p4d"],	
+						"604800"=>$lang["giv_sr_p7d"],
+						"1209600"=>$lang["giv_sr_p14d"],
+						"2419200"=>$lang["giv_sr_p28d"],
+						"2592000"=>$lang["giv_sr_p30d"],
+						"2678400"=>$lang["giv_sr_p31d"],
+						"5184000"=>$lang["giv_sr_p2m"],
+						"10368000"=>$lang["giv_sr_p4m"],
+						"15552000"=>$lang["giv_sr_p6m"],
+						"31104000"=>$lang["giv_sr_p1y"]);
+	$sel =& $form->addElement('select', 'period', $lang["giv_sr_period"], $periods);	
+	
+	$form->addElement('text', 'start', $lang['giv_gt_start']);
+	$form->addElement('button', "startD", $lang['modify'], array("onclick"=>"displayDatePicker('start')"));
+	$form->addElement('text', 'end', $lang['giv_gt_end']);
+	$form->addElement('button', "endD", $lang['modify'], array("onclick"=>"displayDatePicker('end')"));
+	
+	$steps = array(	"0"=>$lang["giv_sr_noStep"],
+					"2"=>"2",
+					"6"=>"6",
+					"10"=>"10",
+					"20"=>"20",
+					"50"=>"50",
+					"100"=>"100");
+					
+	$sel =& $form->addElement('select', 'step', $lang["giv_sr_step"], $steps);
+	$subC =& $form->addElement('submit', 'submitC', $lang["giv_sr_button"]);
+	$form->addElement('reset', 'reset', $lang["reset"]);
+  	$form->addElement('button', 'advanced', $lang["advanced"], array("onclick"=>"DivStatus( 'div', '1' )"));
+  
+	if (((isset($_GET["submitC"]) && $_GET["submitC"]) || $min == 1))	
+		$nb_rsp = 0;
+	if (isset($_GET["service_description"]) && $_GET["service_description"]){
+		$verify =& $pearDBpp->query("SELECT * FROM `perfdata_service` WHERE host_name = '".str_replace(" ", "\ ", $_GET["host_name"])."' AND service_description = '".str_replace(" ", "\ ", $_GET["service_description"])."'");
+		$nb_rsp = $verify->numRows();
+	} else if (isset($_GET["meta_service"]) && $_GET["meta_service"]){
+		$verify =& $pearDBpp->query("SELECT * FROM `perfdata_service` WHERE host_name = 'Meta_Module' AND service_description = '".$_GET["meta_service"]."'");
+		$nb_rsp = $verify->numRows();
+	}
+
+	if ($form->validate() && isset($nb_rsp) && $nb_rsp)	{
+		$ret =& $form->getsubmitValues();
+		$case = NULL;
+		if ($ret["host_name"] && isset($ret["service_description"]))
+			$case = str_replace(" ", "\ ",$ret["host_name"])." / ".str_replace(" ", "\ ",$ret["service_description"]);
+		else if ($_GET["meta_service"])	{	
+			$ret["host_name"] = "Meta_Module";
+			$ret["service_description"] = $_GET["meta_service"];		
+			$id = explode("_", $_GET["meta_service"]);
+			$res2 =& $pearDB->query("SELECT meta_name FROM meta_service WHERE meta_id = '".$id[1]."'");
+			$meta =& $res2->fetchRow();
+			$case = $lang["ms"]." : ".$meta["meta_name"];
+			$res2->free();
+		}
+		if (array_search($host_name, $oreon->user->lcaHost) && $case)	{
+			if (isset($_GET["service_description"])){
+				$res =& $pearDB->query("SELECT service.service_id, service.service_normal_check_interval, service.service_active_checks_enabled FROM service,host,host_service_relation WHERE service.service_id = host_service_relation.service_service_id AND host.host_id = host_service_relation.host_host_id AND host.host_name = '".$_GET["host_name"]."' AND service.service_description = '".$_GET["service_description"]."'");
+				$res->fetchInto($service);
+			}
+			
+			# Init variable in the page
+			$tpl->assign("title2", $lang["giv_sr_rendTitle"]);
+			$tpl->assign("res", $case);
+			if (isset($_GET["period"]))
+				$tpl->assign("period", $periods[$_GET["period"]]);
+			
+			# Grab default Graph Template Model and default Data Source Template Model
+			if (isset($_GET["grapht_graph_id"]) && $_GET["grapht_graph_id"])
+				$graph = array("graph_id" => $_GET["grapht_graph_id"], "name" => "");
+			
+			if (isset($graph)) 
+				$tpl->assign("graph", $graph["name"]);
+			$tpl->assign("lgGraph", $lang['giv_gt_name']);
+			$tpl->assign("lgMetric", $lang['giv_ct_metric']);
+			$tpl->assign("lgCompoTmp", $lang['giv_ct_name']);
+			
+			# Init
+			$ppMetrics = array();
+			$isAvl = false;
+			$cpt_total_values = 0;
+			$cpt_total_graphed_values = 0;
+			
+			$res =& $pearDBpp->query("SELECT DISTINCT metric_id, metric, unit FROM perfdata_service_metric WHERE host_name = '".$ret["host_name"]."' AND service_description = '".$ret["service_description"]."'");
+			if ($res->numRows())	{
+				$cpt = 0;
+				$isAvl = true;
+				while($res->fetchInto($ppMetric))	{
+					$ppMetrics[$ppMetric["metric_id"]]["metric"] = $ppMetric["metric"];
+					$ppMetrics[$ppMetric["metric_id"]]["unit"] = $ppMetric["unit"];
+					$cpt++;
+				}
+				$res->free();
+				$tpl->assign("metrics", $ppMetrics);
+				
+				# Creating rrd DB
+				
+				if (file_exists($oreon->optGen["oreon_path"]."filesGeneration/graphs/simpleRenderer/rrdDB/".str_replace(" ", "-",$ret["host_name"])."_".str_replace(" ", "-",$ret["service_description"]).".rrd"))
+					unlink($oreon->optGen["oreon_path"]."filesGeneration/graphs/simpleRenderer/rrdDB/".str_replace(" ", "-",$ret["host_name"])."_".str_replace(" ", "-",$ret["service_description"]).".rrd");
+				
+				$label = NULL;
+				
+				if (isset($_GET["meta_service"]) && $_GET["meta_service"]) {
+					$tab_meta = split("\_", $_GET["meta_service"]);
+					$res =& $pearDB->query("SELECT retry_check_interval FROM meta_service WHERE meta_id = '".$tab_meta[1]."'");
+					$res->fetchInto($meta);
+					$len = $meta["retry_check_interval"] * 120;			
+				} else if (($service["service_active_checks_enabled"] == 0) || (!$service["service_normal_check_interval"] && !isset($service["service_normal_check_interval"])) || $service["service_normal_check_interval"] == ""){
+					$service["service_normal_check_interval"] = 5;
+					$len = $service["service_normal_check_interval"] * 120;
+				} else 
+					$len = 5 * 120;
+				
+				isset($ret["step"]) && $ret["step"] != 0 ? $time_between_two_values = $len * $ret["step"] : $time_between_two_values = $len;
+								
+				# create period				
+				if (isset($_GET["start"]) && isset($_GET["end"]) && $_GET["start"] && $_GET["end"]){
+					preg_match("/^([0-9]*)\/([0-9]*)\/([0-9]*)/", $_GET["start"], $matches);
+					$start = mktime("0", "0", "0", $matches[1], $matches[2], $matches[3], 1) ;
+					preg_match("/^([0-9]*)\/([0-9]*)\/([0-9]*)/", $_GET["end"], $matches);
+					$end = mktime("23", "59", "59", $matches[1], $matches[2], $matches[3], 1)  + 10;
+				} else if (!$_GET["period"]){
+					$res =& $pearDB->query("SELECT graph_id FROM extended_service_information WHERE service_service_id = '".$service["service_id"]."'");
+					$res->fetchInto($service_ext);
+					if (!$service_ext["graph_id"])
+						$period = 86400;
+					else {	
+						$res =& $pearDB->query("SELECT period FROM giv_graphs_template WHERE graph_id = '".$service_ext["graph_id"]."'");
+						$res->fetchInto($graph);
+						$period = $graph["period"];
+					}
+				} else if ($_GET["period"])
+					$period = 	$_GET["period"];
+				
+				if (!isset($start) && !isset($end)){
+					$start = time() - ($period + 120);
+					$end = time() + 120;
+				}
+				$start_create = $start - 200000;
+	 			
+				# Mise en memoire des valeurs remontees de la base de donnees MySQL
+				# Init Lower Value
+				$GMT = 0;
+				$lower = 0;
+				$tab_bin = array();				 
+				foreach ($ppMetrics as $key => $value){
+					$get = 	"SELECT value,ctime FROM `perfdata_service_bin` WHERE `host_name` = '".$ret["host_name"]."' ".
+						"AND `service_description` = '".$ret["service_description"]."' AND `metric` = '".$value["metric"]."' ".
+						"AND `ctime` >= '".date("Y-m-d G:i:s", $start)."' AND `ctime` <= '".date("Y-m-d G:i:s", $end)."' ORDER BY ctime";
+	 				$req =& $pearDBpp->query($get);
+					$r = $str = NULL;
+					$cpt = 0;
+					$cpt_real = 0;
+					$req =& $pearDBpp->query($get);
+					while ($r =& $req->fetchRow()){
+						preg_match("/^([0-9]*)-([0-9]*)-([0-9]*) ([0-9]*):([0-9]*):([0-9]*)/", $r["ctime"], $matches);
+						$time_temp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1], 1);
+						if ((isset($ret["step"]) && $ret["step"] == "1") || (isset($ret["step"]) && ($cpt % $ret["step"] == 0)) || (!isset($ret["step"]))){
+							$tab_bin[$time_temp + (3600 * $GMT)][$value["metric"]] = $r["value"];
+							$cpt_real++;
+						}
+						$cpt++;
+					}
+					$cpt_total_values += $cpt;
+					$cpt_total_graphed_values += $cpt_real;
+				}
+				
+				# Create RRDTool DB
+	 			$cmd = $oreon->optGen["rrdtool_path_bin"] . " create ".$oreon->optGen["oreon_path"]."filesGeneration/graphs/simpleRenderer/rrdDB/".str_replace(" ", "-",$ret["host_name"])."_".str_replace(" ", "-",$ret["service_description"]).".rrd --start $start_create "; 
+				$nb_ds = 0;
+				foreach ($ppMetrics as $key => $metric){
+					$cmd .= " DS:".$metric["metric"].":GAUGE:$time_between_two_values:U:U";
+					$nb_ds++;
+				}
+				$cpt_total_graphed_values_for_rrd = $cpt_total_values + 100;
+				$cmd .=  " RRA:LAST:0.5:1:".$cpt_total_graphed_values_for_rrd;
+				system($cmd, $return);
+				###################
+				
+				$cpt_data = 0;
+				foreach ($tab_bin as $key => $value){
+					$str .= " ".$key;
+					$strtemp = NULL;
+					$nb = 0;
+					foreach ($value as $metric => $tm){
+						$strtemp .= ":".$value[$metric];
+						$nb++;
+					}	
+					if ($nb < $nb_ds){
+						for ($p = $nb; $p != $nb_ds; $p++)
+							$strtemp .= ":0";
+						$strtemp .= " ";
+					}
+					$str .= $strtemp;
+					$cpt_data++;
+					if ($cpt_data % 700 == 0 || $cpt_data == count($tab_bin) || $cpt_data % 700 == count($tab_bin)){
+						system("rrdtool update ".$oreon->optGen["oreon_path"]."filesGeneration/graphs/simpleRenderer/rrdDB/".str_replace(" ", "-",$ret["host_name"])."_".str_replace(" ", "-",$ret["service_description"]).".rrd ".$str . " 2>&1", $return);
+						$str = "";
+					}
+				}
+				$res->free();
+			}
+			
+			$tpl->assign('cpt_total_values', $cpt_total_values);
+			$tpl->assign('cpt_total_graphed_values', $cpt_total_graphed_values);
+			$tpl->assign('isAvl', $isAvl);
+			$tpl->assign('host_name', $ret["host_name"]);
+			$tpl->assign('service_description', $ret["service_description"]);
+			$tpl->assign('end', $end);
+			$tpl->assign('start', $start);
+			if (isset($graph))
+				$tpl->assign('defaultGraph', $graph);
+		}
+    }
+	
+	#Apply a template definition	
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+	$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+	$form->accept($renderer);	
+	
+	$tpl->assign('form', $renderer->toArray());	
+	$tpl->assign('o', $o);
+	$tpl->assign('lang', $lang);
+	$tpl->assign("graphed_values", $lang["giv_sr_gValues"]);
+	$tpl->assign('session_id', session_id());
+	$tpl->display("simpleRenderer.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/views/lang/en.php b/www/include/views/lang/en.php
new file mode 100644
index 0000000000000000000000000000000000000000..c4be4755f19951d7f5e34a55ca483422dd94c492
--- /dev/null
+++ b/www/include/views/lang/en.php
@@ -0,0 +1,139 @@
+<?
+# Country
+$lang['views_ct_infos'] = "General Informations";
+$lang['views_ct_add'] = "Add a Country";
+$lang['views_ct_change'] = "Modify a Country";
+$lang['views_ct_view'] = "View a Country";
+$lang['views_ct_name'] = "Country";
+$lang['views_ct_alias'] = "Alias";
+$lang['views_ct_cities'] = "Cities File";
+$lang['views_ct_citiesCmt1'] = "GEOnet Names Server (GNS)";
+$lang['views_ct_citiesCmt2'] = "http://earth-info.nga.mil/gns/html/cntry_files.html";
+$lang['views_ct_comment'] = "Comment";
+$lang['views_ct_cty'] = "City number for this Country";
+$lang['views_ct_init'] = "Reset Cities for this Country";
+
+# Map
+$lang['views_map_infos'] = "General Informations";
+$lang['views_map_add'] = "Add a Map";
+$lang['views_map_change'] = "Modify  a Map";
+$lang['views_map_view'] = "View a Map";
+$lang['views_map_img'] = "Image";
+$lang['views_map_imgName'] = "File Name";
+$lang['views_map_imgPath'] = "File Path";
+$lang['views_map_name'] = "Name";
+$lang['views_map_desc'] = "Description";
+$lang['views_map_comment'] = "Comment";
+
+# Oreon Graph Plugins
+$lang["giv_gp_size"] = "Size";
+
+# Graph redirection
+$lang["view_redirect_graph"] = "Graph Redirection (hidden)";
+
+# Oreon Graph Customs
+$lang["giv_gg_infos"] = "General Informations";
+$lang['giv_gg_add'] = "Add a Custom Graph";
+$lang['giv_gg_change'] = "Modify a Custom Graph";
+$lang['giv_gg_view'] = "View a Custom Graph";
+$lang['giv_gg_name'] = "Graph Name";
+$lang['giv_gg_tpl'] = "Template linked";
+$lang['giv_gg_comment'] = "Comment";
+$lang["giv_gg_osl"] = "OSL";
+$lang["giv_gg_ms"] = "Meta Service";
+$lang["giv_gg_tpl"] = "Template";
+
+# Oreon Simple Renderer
+$lang["giv_sr_infos"] = "Choose the source to graph";
+$lang["giv_sr_period"] = "Graph Period";
+$lang["giv_sr_p1h"] = "Last Hour";
+$lang["giv_sr_p3h"] = "Last 3 Hours";
+$lang["giv_sr_p6h"] = "Last 6 Hours";
+$lang["giv_sr_p12h"] = "Last 12 Hours";
+$lang["giv_sr_p24h"] = "Last 24 Hours";
+$lang["giv_sr_p2d"] = "Last 2 Days";
+$lang["giv_sr_p4d"] = "Last 4 Days";
+$lang["giv_sr_p7d"] = "Last 7 Days";
+$lang["giv_sr_p14d"] = "Last 14 Days";
+$lang["giv_sr_p28d"] = "Last 28 Days";
+$lang["giv_sr_p30d"] = "Last 30 Days";
+$lang["giv_sr_p31d"] = "Last 31 Days";
+$lang["giv_sr_p2m"] = "2 Last Months";
+$lang["giv_sr_p4m"] = "4 Last Months";
+$lang["giv_sr_p6m"] = "6 Last Months";
+$lang["giv_sr_p1y"] = "Last Year";
+$lang["giv_sr_step"] = "Recovery Step";
+$lang["giv_sr_noStep"] = "No Step";
+$lang["giv_sr_button"] = "Graph";
+$lang["giv_sr_osl"] = "Oreon Service Level (OSL)";
+$lang["giv_sr_rendTitle"] = "Graph Renderer";
+$lang["giv_sr_gValues"] = "Graphed Values";
+
+# Graph Templates
+$lang["giv_compoNbr"] = "Number of Data Source";
+$lang["giv_compoChoice"] = "Data Source Choice";
+$lang["giv_compoList"] = "Data Source List";
+$lang["giv_compo"] = "Data Sources";
+$lang['giv_tpl1'] = "Oreon Graph Template";
+$lang['giv_tpl2'] = "Oreon Graph Plugin Template";
+$lang['giv_gt_infos'] = "General Informations";
+$lang['giv_gt_properties'] = "Properties";
+$lang['giv_gt_add'] = "Add a Graph Template";
+$lang['giv_gt_change'] = "Modify a Graph Template";
+$lang['giv_gt_view'] = "View a Graph Template";
+$lang['giv_gt_name'] = "Template Name";
+$lang['giv_gt_title'] = "Graph Title";
+$lang["giv_gt_imgFormat"] = "Image Type";
+$lang["giv_gt_vLabel"] = "Vertical Label";
+$lang["giv_gt_width"] = "Width";
+$lang["giv_gt_height"] = "Height";
+$lang['giv_gt_bgGridClr'] = "Grid background color";
+$lang['giv_gt_bgGridPClr'] = "Grid main color";
+$lang['giv_gt_bgGridSClr'] = "Grid supplementary color";
+$lang['giv_gt_bgContClr'] = "Outline color";
+$lang['giv_gt_bgClr'] = "Background color";
+$lang['giv_gt_bgPol'] = "Text color";
+$lang['giv_gt_arrClr'] = "Arrow color";
+$lang['giv_gt_topClr'] = "Top color";
+$lang['giv_gt_botClr'] = "Bottom color";
+$lang['giv_gt_comment'] = "Comment";
+$lang['giv_gt_start'] = "Begin Date";
+$lang['giv_gt_end'] = "End Date";
+$lang['giv_gt_stacked'] = "Stacking";
+$lang['giv_gt_defaultTpl1'] = "Default Oreon Graph Template";
+$lang['giv_gt_defaultTpl2'] = "Default Oreon Graph Plugin Template";
+$lang['giv_gt_lower_limit'] = "Lower Limit";
+$lang['giv_gt_upper_limit'] = "Upper Limit";
+
+# Component Templates
+$lang["giv_graphNbr"] = "Use";
+$lang["giv_graphChoice"] = "Graphs Choice";
+$lang["giv_graphList"] = "Graphs List";
+$lang["giv_graphs"] = "Graphs";
+$lang['giv_ct_infos'] = "General Informations";
+$lang['giv_ct_properties'] = "Properties";
+$lang['giv_ct_add'] = "Add a Data Source Template";
+$lang['giv_ct_change'] = "Modify a Data Source Template";
+$lang['giv_ct_view'] = "View a Data Source Template";
+$lang['giv_ct_name'] = "Template Name";
+$lang['giv_ct_dsName'] = "Data Source Name";
+$lang['giv_ct_order'] = "Order";
+$lang['giv_ct_legend'] = "Legend";
+$lang['giv_ct_lineClr'] = "Data Source color";
+$lang['giv_ct_areaClr'] = "Color of the Filling";
+$lang['giv_ct_filled'] = "Filling";
+$lang['giv_ct_max'] = "Print Max value";
+$lang['giv_ct_min'] = "Print Min value";
+$lang['giv_ct_avg'] = "Print Average";
+$lang['giv_ct_last'] = "Print Last Value";
+$lang["giv_ct_tickness"] = "Thickness";
+$lang['giv_ct_comment'] = "Comment";
+$lang['giv_ct_metric'] = "Metric";
+$lang['giv_ct_transparency'] = 'Transparency';
+$lang['giv_ct_invert'] = 'Invert';
+
+# Graphs by hosts
+
+$lang["m_host_graph"] = "Graphs By Hosts";
+$lang["giv_hg_nbGraph"] = "Nomber of graphs";
+?>
\ No newline at end of file
diff --git a/www/include/views/lang/fr.php b/www/include/views/lang/fr.php
new file mode 100644
index 0000000000000000000000000000000000000000..c8ea19a20c67153fd754a4f60f7204655545a61f
--- /dev/null
+++ b/www/include/views/lang/fr.php
@@ -0,0 +1,139 @@
+<?
+# Country
+$lang['views_ct_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang['views_ct_add'] = "Ajouter un Pays";
+$lang['views_ct_change'] = "Modifier un Pays";
+$lang['views_ct_view'] = "Afficher un Pays";
+$lang['views_ct_name'] = "Pays";
+$lang['views_ct_alias'] = "Alias";
+$lang['views_ct_cities'] = "Fichier de villes";
+$lang['views_ct_citiesCmt1'] = "GEOnet Names Server (GNS)";
+$lang['views_ct_citiesCmt2'] = "http://earth-info.nga.mil/gns/html/cntry_files.html";
+$lang['views_ct_comment'] = "Commentaire";
+$lang['views_ct_cty'] = "Nombre de villes pour ce pays";
+$lang['views_ct_init'] = "R&eacute;initialiser les villes pour ce pays";
+
+# Map
+$lang['views_map_infos'] = "Informations g&eacute;n&eacute;rales";
+$lang['views_map_add'] = "Ajouter une Carte";
+$lang['views_map_change'] = "Modifier une Carte";
+$lang['views_map_view'] = "Afficher une Carte";
+$lang['views_map_img'] = "Image";
+$lang['views_map_imgName'] = "Nom du Fichier";
+$lang['views_map_imgPath'] = "Chemin du Fichier";
+$lang['views_map_name'] = "Nom";
+$lang['views_map_desc'] = "Description";
+$lang['views_map_comment'] = "Commentaire";
+
+# Oreon Graph Plugins
+$lang["giv_gp_size"] = "Taille";
+
+# Graph redirection
+$lang["view_redirect_graph"] = "Redirection Graph (cach&eacute;)";
+
+# Oreon Graph Customs
+$lang["giv_gg_infos"] = "Informations G&eacute;n&eacute;rales";
+$lang['giv_gg_add'] = "Ajouter un Graph Personnalis&eacute;";
+$lang['giv_gg_change'] = "Modifier un Graph Personnalis&eacute;";
+$lang['giv_gg_view'] = "Afficher un Graph Personnalis&eacute;";
+$lang['giv_gg_name'] = "Nom du Graph";
+$lang['giv_gg_tpl'] = "Template Associ&eacute;";
+$lang['giv_gg_comment'] = "Commentaire";
+$lang["giv_gg_osl"] = "OSL";
+$lang["giv_gg_ms"] = "Meta Service";
+$lang["giv_gg_tpl"] = "Template";
+
+# Oreon Simple Renderer
+$lang["giv_sr_infos"] = "Choisir la Ressource &agrave; grapher";
+$lang["giv_sr_period"] = "P&eacute;riode &agrave; grapher";
+$lang["giv_sr_p1h"] = "Derni&egrave;re Heure";
+$lang["giv_sr_p3h"] = "Derni&egrave;res 3 Heures";
+$lang["giv_sr_p6h"] = "Derni&egrave;res 6 Heures";
+$lang["giv_sr_p12h"] = "Derni&egrave;res 12 Heures";
+$lang["giv_sr_p24h"] = "Derni&egrave;res 24 Heures";
+$lang["giv_sr_p2d"] = "2 Derniers Jours";
+$lang["giv_sr_p4d"] = "4 Derniers Jours";
+$lang["giv_sr_p7d"] = "7 Derniers Jours";
+$lang["giv_sr_p14d"] = "14 Derniers Jours";
+$lang["giv_sr_p28d"] = "28 Derniers Jours";
+$lang["giv_sr_p30d"] = "30 Derniers Jours";
+$lang["giv_sr_p31d"] = "31 Derniers Jours";
+$lang["giv_sr_p2m"] = "2 Derniers Mois";
+$lang["giv_sr_p4m"] = "4 Derniers Mois";
+$lang["giv_sr_p6m"] = "6 Derniers Mois";
+$lang["giv_sr_p1y"] = "Derni&egrave;re Ann&eacute;e";
+$lang["giv_sr_step"] = "Pas de r&eacute;cup&eacute;ration";
+$lang["giv_sr_noStep"] = "Pas de pas";
+$lang["giv_sr_button"] = "Grapher";
+$lang["giv_sr_osl"] = "Qualit&eacute; de Service Oreon (OSL)";
+$lang["giv_sr_rendTitle"] = "Rendu Graphique";
+$lang["giv_sr_gValues"] = "Valeurs Graph&eacute;es";
+
+# Graph Templates
+$lang["giv_compoNbr"] = "Nombre de Composantes";
+$lang["giv_compoChoice"] = "Choix des Composantes";
+$lang["giv_compoList"] = "Liste des Composantes";
+$lang["giv_compo"] = "Composantes";
+$lang['giv_tpl1'] = "Template des graphs Oreon";
+$lang['giv_tpl2'] = "Template des sondes Graphiques";
+$lang['giv_gt_infos'] = "Informations G&eacute;n&eacute;rales";
+$lang['giv_gt_properties'] = "Propri&eacute;t&eacute;s";
+$lang['giv_gt_add'] = "Ajouter un Template de Graph";
+$lang['giv_gt_change'] = "Modifier un Template de Graph";
+$lang['giv_gt_view'] = "Afficher un Template de Graph";
+$lang['giv_gt_name'] = "Nom du Template";
+$lang['giv_gt_title'] = "Titre du Graph";
+$lang["giv_gt_imgFormat"] = "Format de l'image";
+$lang["giv_gt_vLabel"] = "Titre Vertical";
+$lang["giv_gt_width"] = "Largeur";
+$lang["giv_gt_height"] = "Hauteur";
+$lang['giv_gt_bgGridClr'] = "Couleur de fond de la Grille";
+$lang['giv_gt_bgGridPClr'] = "Couleur Principale de la Grille";
+$lang['giv_gt_bgGridSClr'] = "Seconde Couleur de la Grille";
+$lang['giv_gt_bgContClr'] = "Couleur du Contour";
+$lang['giv_gt_bgClr'] = "Couleur de fond";
+$lang['giv_gt_bgPol'] = "Couleur de la Police";
+$lang['giv_gt_arrClr'] = "Couleur de la Fl&egrave;che";
+$lang['giv_gt_topClr'] = "Couleur du Haut";
+$lang['giv_gt_botClr'] = "Couleur du Bas";
+$lang['giv_gt_comment'] = "Commentaire";
+$lang['giv_gt_start'] = "Date de d&eacute;but";
+$lang['giv_gt_end'] = "Date de fin";
+$lang['giv_gt_stacked'] = "Empilage";
+$lang['giv_gt_defaultTpl1'] = "Template par d&eacute;faut des graphs Oreon";
+$lang['giv_gt_defaultTpl2'] = "Template par d&eacute;faut des sondes Graphiques";
+$lang['giv_gt_lower_limit'] = "Limite Basse";
+$lang['giv_gt_upper_limit'] = "Limite Haute";
+
+# Component Templates
+$lang["giv_graphNbr"] = "Utilisation";
+$lang["giv_graphChoice"] = "Choix des Graphs";
+$lang["giv_graphList"] = "Liste des Graphs";
+$lang["giv_graphs"] = "Graphs";
+$lang['giv_ct_infos'] = "Informations G&eacute;n&eacute;rales";
+$lang['giv_ct_properties'] = "Propri&eacute;t&eacute;s";
+$lang['giv_ct_add'] = "Ajouter un Template de Courbe";
+$lang['giv_ct_change'] = "Modifier un Template de Courbe";
+$lang['giv_ct_view'] = "Afficher un Template de Courbe";
+$lang['giv_ct_name'] = "Nom du Template";
+$lang['giv_ct_dsName'] = "Nom de la Courbe";
+$lang['giv_ct_order'] = "Ordre";
+$lang['giv_ct_legend'] = "L&eacute;gende";
+$lang['giv_ct_lineClr'] = "Couleur de la Courbe";
+$lang['giv_ct_areaClr'] = "Couleur du Remplissage";
+$lang['giv_ct_filled'] = "Remplissage";
+$lang['giv_ct_max'] = "Afficher la valeur Max";
+$lang['giv_ct_min'] = "Afficher la valeur Min";
+$lang['giv_ct_avg'] = "Afficher la Moyenne";
+$lang['giv_ct_last'] = "Afficher la derni&egrave;re Valeur";
+$lang["giv_ct_tickness"] = "Epaisseur";
+$lang['giv_ct_comment'] = "Commentaire";
+$lang['giv_ct_metric'] = "Metric";
+$lang['giv_ct_transparency'] = 'Transparence';
+$lang['giv_ct_invert'] = 'Inverser';
+
+# Graphs by hosts
+
+$lang["m_host_graph"] = "Graphs par Hosts";
+$lang["giv_hg_nbGraph"] = "Nombre de graphs";
+?>
\ No newline at end of file
diff --git a/www/include/views/localisation/countries/DB-Func.php b/www/include/views/localisation/countries/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..da63c1898a5f62027349dfa1bd13e588de96aad3
--- /dev/null
+++ b/www/include/views/localisation/countries/DB-Func.php
@@ -0,0 +1,101 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Status Map � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function testExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('country_id');
+		$res =& $pearDB->query("SELECT country_name, country_id FROM view_country WHERE country_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$country =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $country["country_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $country["country_id"] != $id)	
+			return false;
+		else
+			return true;
+	}
+
+	function deleteCountryInDB ($countries = array())	{
+		global $pearDB;
+		foreach($countries as $key=>$value)
+			$pearDB->query("DELETE FROM view_country WHERE country_id = '".$key."'");
+	}
+	
+	function multipleCountryInDB ($countries = array(), $nbrDup = array())	{
+		foreach($countries as $key=>$value)	{
+			global $pearDB;
+			$res =& $pearDB->query("SELECT * FROM view_country WHERE country_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			$row["country_id"] = '';
+			for ($i = 1; $i <= $nbrDup[$key]; $i++)	{
+				$val = null;
+				foreach ($row as $key2=>$value2)	{
+					$key2 == "country_name" ? ($country_name = clone($value2 = $value2."_".$i)) : null;
+					$val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL");
+				}
+				if (testExistence($country_name))
+					$pearDB->query($val ? $rq = "INSERT INTO view_country VALUES (".$val.")" : $rq = null);
+			}
+		}
+	}
+	
+	function updateCountryInDB ($country_id = NULL)	{
+		if (!$country_id) return;
+		updateCountry($country_id);
+	}
+	
+	function updateCountry($country_id)	{
+		if (!$country_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "UPDATE view_country ";
+		$rq .= "SET country_name = '".htmlentities($ret["country_name"], ENT_QUOTES)."', " .
+				"country_alias = '".htmlentities($ret["country_alias"], ENT_QUOTES)."' " .
+				"WHERE country_id = '".$country_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function insertCountryInDB ()	{
+		$country_id = insertCountry();
+		return ($country_id);
+	}
+	
+	function insertCountry()	{
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret = $form->getSubmitValues();
+		$rq = "INSERT INTO view_country ";
+		$rq .= "(country_name, country_alias) ";
+		$rq .= "VALUES ";
+		$rq .= "('".htmlentities($ret["country_name"], ENT_QUOTES)."', '".htmlentities($ret["country_alias"], ENT_QUOTES)."')";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(country_id) FROM view_country");
+		$country_id = $res->fetchRow();
+		return ($country_id["MAX(country_id)"]);
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/localisation/countries/country.php b/www/include/views/localisation/countries/country.php
new file mode 100644
index 0000000000000000000000000000000000000000..0370691638b2c8e2fa2d78abef2895324b12b844
--- /dev/null
+++ b/www/include/views/localisation/countries/country.php
@@ -0,0 +1,47 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Status Map � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["country_id"]) ? $countryG = $_GET["country_id"] : $countryG = NULL;
+	isset($_POST["country_id"]) ? $countryP = $_POST["country_id"] : $countryP = NULL;
+	$countryG ? $country_id = $countryG : $country_id = $countryP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the cities dir
+	$path = "./include/views/localisation/countries/";
+
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+
+	switch ($o)	{
+		case "a" : require_once($path."formCountry.php"); break; #Add a Country
+		case "w" : require_once($path."formCountry.php"); break; #Watch a Country
+		case "c" : require_once($path."formCountry.php"); break; #Modify a Country
+		case "m" : multipleCountryInDB(isset($_GET["select"]) ? $_GET["select"] : array(), $_GET["dupNbr"]); require_once($path."listCountry.php"); break; #Duplicate n Countrys
+		case "d" : deleteCountryInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listCountry.php"); break; #Delete n Countrys
+		default : require_once($path."listCountry.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/localisation/countries/def/load_cities.php b/www/include/views/localisation/countries/def/load_cities.php
new file mode 100644
index 0000000000000000000000000000000000000000..0a7443ca7b730282dd34356a4322d882b0400408
--- /dev/null
+++ b/www/include/views/localisation/countries/def/load_cities.php
@@ -0,0 +1,62 @@
+<?
+
+$local_file = "fr.txt";
+$country_id = "1";
+//$absPath_to_OreonOconf = $path = $oreon->optGen["oreon_web_path"]."oreon.conf.php";
+$absPath_to_OreonOconf = "/usr/local/oreon/www/oreon.conf.php";
+
+function microtime_float() {
+  list($usec, $sec) = explode(" ", microtime());
+  return ((float)$usec + (float)$sec);
+}
+
+$time_start = microtime_float();
+set_time_limit(3000);
+
+$log_file = fopen($local_file, "r");
+
+require_once('DB.php');
+require_once($absPath_to_OreonOconf );
+
+$dsn = array(
+	     'phptype'  => 'mysql',
+	     'username' => $conf_oreon['user'],
+	     'password' => $conf_oreon['password'],
+	     'hostspec' => $conf_oreon['host'],
+	     'database' => $conf_oreon['db'],
+	     );
+
+$options = array(
+		 'debug'       => 2,
+		 'portability' => DB_PORTABILITY_ALL ^ DB_PORTABILITY_LOWERCASE,
+		 );
+
+$db =& DB::connect($dsn, $options);
+if (PEAR::isError($db)) {
+  die($db->getMessage());
+}
+
+$db->setFetchMode(DB_FETCHMODE_ASSOC);
+
+$insert = false;
+$current = array();
+$cmp = array();
+if ($log_file)	{
+	while ($str = fgets($log_file))	{
+	    $tab = split("\t", $str);
+	   /* foreach ($tab as $key=>$value)	{
+	    	print "key :".$key." value:".$value."\n";
+	    }*/
+	    if ($tab[23] != "FULL_NAME_ND")	{
+			$date = explode("-", $tab[24]);
+			$date = mktime(0, 0, 0, $date[1], $date[2], $date[0]);
+			//print "INSERT INTO `view_city` ( `city_id` , `country_id` , `city_name` , `city_zipcode` , `city_lat` , `city_long`, `city_date`) VALUES ('', '".$country_id."', '".$tab[23]."', NULL , '".$tab[3]."', '".$tab[4]."', '".$date."')\n";
+			$db->query("INSERT INTO `view_city` ( `city_id` , `country_id` , `city_name` , `city_zipcode` , `city_lat` , `city_long`, `city_date`) VALUES ('', '".$country_id."', '".$tab[23]."', NULL , '".$tab[3]."', '".$tab[4]."', '".$date."')");
+		}
+	}
+}
+$time_end = microtime_float();
+$now = $time_end - $time_start;
+print round($now,3) . "secondes";
+
+?>
\ No newline at end of file
diff --git a/www/include/views/localisation/countries/formCountry.ihtml b/www/include/views/localisation/countries/formCountry.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..85d0fc6c28d71036db294579cb7031b9c67f83eb
--- /dev/null
+++ b/www/include/views/localisation/countries/formCountry.ihtml
@@ -0,0 +1,31 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/earth_location.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.country_name.label}</td><td class="FormRowValue">{$form.country_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.country_alias.label}</td><td class="FormRowValue">{$form.country_alias.html}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.nbr.label}</td><td class="FormRowValue">{$form.nbr.html}</td></tr>
+			<tr class="list_two">
+			<td class="FormRowField">
+				{$form.country_cities.label}<br>
+				<a href="{$url}" target="_blank">{$urlText}</a>
+			</td>
+			<td class="FormRowValue"><a href="{$url}" target="_blank">{$url}</a></td>
+		</tr>
+	 	
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p>{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p>{$form.change.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
diff --git a/www/include/views/localisation/countries/formCountry.php b/www/include/views/localisation/countries/formCountry.php
new file mode 100644
index 0000000000000000000000000000000000000000..ce37992c3a908c76c141bfb99c513cc6d4f0cc1d
--- /dev/null
+++ b/www/include/views/localisation/countries/formCountry.php
@@ -0,0 +1,161 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Status Map � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information
+	#
+	if ($o == "c" || $o == "w")	{	
+		$res =& $pearDB->query("SELECT * FROM view_country WHERE country_id = '".$country_id."' LIMIT 1");
+		# Set base value
+		$country = array_map("myDecode", $res->fetchRow());
+		$res =& $pearDB->query("SELECT DISTINCT COUNT(city_name) AS nbr FROM view_city WHERE country_id = '".$country_id."'");
+		$nbrCities =& $res->fetchRow();
+		$country["nbr"] = $nbrCities["nbr"];
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"35");
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang['views_ct_add']);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["views_ct_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["views_ct_view"]);
+
+	#
+	## Basic information
+	#
+	$form->addElement('header', 'information', $lang['views_ct_infos']);
+	$form->addElement('text', 'country_name', $lang["views_ct_name"], $attrsText);
+	$form->addElement('text', 'country_alias', $lang["views_ct_alias"], $attrsText);
+	$elem1 =& $form->addElement('text', 'nbr', $lang['views_ct_cty'], $attrsText);
+	$elem1->freeze();
+	
+	#
+	## Big new Def
+	#
+	/*
+	$form->addElement('header', 'furtherInfos', $lang['further_infos']);
+	$newCt[] = &HTML_QuickForm::createElement('radio', 'country_new', null, $lang["yes"], '1');
+	$newCt[] = &HTML_QuickForm::createElement('radio', 'country_new', null, $lang["no"], '0');
+	$form->addGroup($newCt, 'country_new', $lang['views_ct_init'], '&nbsp;');
+	$form->setDefaults(array('country_new' => '1'));
+	$form->addElement('file', 'country_cities', $lang["views_ct_cities"], $attrsText);
+	*/
+	
+	#
+	## Further informations
+	#
+	
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+	
+	$form->addElement('hidden', 'country_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	function myReplace()	{
+		global $form;
+		$ret = $form->getSubmitValues();
+		return (str_replace(" ", "_", $ret["country_name"]));
+	}
+	$form->applyFilter('_ALL_', 'trim');
+	$form->applyFilter('country_name', 'myReplace');
+	$form->addRule('country_name', $lang['ErrName'], 'required');
+	$form->addRule('country_alias', $lang['ErrAlias'], 'required');
+	$form->registerRule('exist', 'callback', 'testExistence');
+	$form->addRule('country_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+		
+	$tpl->assign("urlText", $lang['views_ct_citiesCmt1']);
+	$tpl->assign("url", $lang['views_ct_citiesCmt2']);
+	
+	# Just watch an information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&country_id=".$country_id."'"));
+	    $form->setDefaults($country);
+		$form->freeze();
+	}
+	# Modify an information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($country);
+	}
+	# Add an information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	
+	$valid = false;
+	if ($form->validate())	{
+		$countryObj =& $form->getElement('country_id');
+		if ($form->getSubmitValue("submitA"))
+			$countryObj->setValue(insertCountryInDB());
+		else if ($form->getSubmitValue("submitC"))
+			updateCountryInDB($countryObj->getValue());
+		$o = "w";	
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&country_id=".$countryObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once("listCountry.php");
+	else	{
+		#Apply a template definition	
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("formCountry.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/localisation/countries/listCountry.ihtml b/www/include/views/localisation/countries/listCountry.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..e48c0c99045f70b3587cb449f826551efa9721e1
--- /dev/null
+++ b/www/include/views/localisation/countries/listCountry.ihtml
@@ -0,0 +1,42 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderCenter">{$headerMenu_icone}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColRight" align="right">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="m" src="./img/icones/16x16/document_exchange.gif">
+				&nbsp;&nbsp;&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">				
+			</td>
+			<td class="ListColFooterCenter" colspan="2"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
diff --git a/www/include/views/localisation/countries/listCountry.php b/www/include/views/localisation/countries/listCountry.php
new file mode 100644
index 0000000000000000000000000000000000000000..a1386f06494754663fb7a3df97142ebc9abd8da2
--- /dev/null
+++ b/www/include/views/localisation/countries/listCountry.php
@@ -0,0 +1,90 @@
+<?php
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Drill Down Map � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/$pagination = "maxViewConfiguration";
+	!isset ($_GET["limit"]) ? $limit = 20 : $limit = $_GET["limit"];
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM view_country WHERE country_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM view_country");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	# Country list
+	if ($search)
+		$rq = "SELECT country_id, country_name, country_alias FROM view_country WHERE country_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' ORDER BY country_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT country_id, country_name, country_alias FROM view_country ORDER BY country_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();	for ($i = 0; $res->fetchInto($country); $i++) {
+		$selectedElements =& $form->addElement('checkbox', "select[".$country['country_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&country_id=".$country['country_id']."&o=w&&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&country_id=".$country['country_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&country_id=".$country['country_id']."&o=d&select[".$country['country_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		$moptions .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+		$moptions .= "<select style='width:35; margin-bottom: 3px;' name='dupNbr[".$country['country_id']."]'><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>10</option></select>";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$country["country_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&country_id=".$country['country_id'],
+						"RowMenu_desc"=>$country["country_alias"],
+						"RowMenu_status"=>$lang['enable'],
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listCountry.ihtml");
+	
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+?>
\ No newline at end of file
diff --git a/www/include/views/localisation/maps/DB-Func.php b/www/include/views/localisation/maps/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..afb7cc0d7c468fd71089da43e1caaacb18757c9d
--- /dev/null
+++ b/www/include/views/localisation/maps/DB-Func.php
@@ -0,0 +1,106 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Status Map � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	function testExistence ($name = NULL)	{
+		global $pearDB;
+		global $form;
+		$id = NULL;
+		if (isset($form))
+			$id = $form->getSubmitValue('map_id');
+		$res =& $pearDB->query("SELECT map_name, map_id FROM view_map WHERE map_name = '".htmlentities($name, ENT_QUOTES)."'");
+		$map =& $res->fetchRow();
+		#Modif case
+		if ($res->numRows() >= 1 && $map["map_id"] == $id)	
+			return true;
+		#Duplicate entry
+		else if ($res->numRows() >= 1 && $map["map_id"] != $id)	
+			return false;
+		else
+			return true;
+	}
+
+	function deleteMapInDB ($maps = array())	{
+		global $pearDB;
+		foreach($maps as $key=>$value)	{
+			$res =& $pearDB->query("SELECT map_path FROM view_map WHERE map_id = '".$key."' LIMIT 1");
+			$row = $res->fetchRow();
+			if (is_file($row["map_path"]))
+				unlink($row["map_path"]);
+			$pearDB->query("DELETE FROM view_map WHERE map_id = '".$key."'");
+		}
+	}
+	
+	function updateMapInDB ($map_id = NULL, $file = NULL)	{
+		if (!$map_id) return;
+		updateMap($map_id, $file);
+	}
+	
+	function updateMap($map_id, $file = NULL)	{
+		if (!$map_id) return;
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret["map_path"] = NULL;
+		$ret = $form->getSubmitValues();
+		if ($file->isUploadedFile())	{
+			$res =& $pearDB->query("SELECT map_path FROM view_map WHERE map_id = '".$map_id."' LIMIT 1");
+			$row = $res->fetchRow();
+			if (is_file($row["map_path"]))
+				unlink($row["map_path"]);
+			$file->moveUploadedFile("./ext/osm/maps/");
+			$fDataz =& $file->getValue();
+			$ret["map_path"] = "./ext/osm/maps/".$fDataz["name"];
+		}
+		$rq = "UPDATE view_map ";
+		$rq .= "SET map_name = '".htmlentities($ret["map_name"], ENT_QUOTES)."', ";
+		$rq	.= "map_description = '".htmlentities($ret["map_description"], ENT_QUOTES)."', ";
+		$ret["map_path"] ? $rq	.= "map_path = '".$ret["map_path"]."', " : NULL;
+		$rq	.= "map_comment = '".htmlentities($ret["map_comment"], ENT_QUOTES)."' ";
+		$rq	.= "WHERE map_id = '".$map_id."'";
+		$pearDB->query($rq);
+	}
+	
+	function insertMapInDB ($file = NULL)	{
+		$map_id = insertMap($file);
+		return ($map_id);
+	}
+	
+	function insertMap($file = NULL)	{
+		global $form;
+		global $pearDB;
+		$ret = array();
+		$ret["map_path"] = NULL;
+		$ret = $form->getSubmitValues();
+		if ($file)	{
+			$file->moveUploadedFile("./ext/osm/maps/");
+			$fDataz =& $file->getValue();
+			$ret["map_path"] = "./ext/osm/maps/".$fDataz["name"];
+		}
+		$rq = "INSERT INTO view_map ";
+		$rq .= "(map_name, map_description, map_path, map_comment) ";
+		$rq .= "VALUES ";
+		$rq .= "('".htmlentities($ret["map_name"], ENT_QUOTES)."', '".htmlentities($ret["map_description"], ENT_QUOTES)."', '".$ret["map_path"]."', '".htmlentities($ret["map_comment"], ENT_QUOTES)."')";
+		$pearDB->query($rq);
+		$res =& $pearDB->query("SELECT MAX(map_id) FROM view_map");
+		$map_id = $res->fetchRow();
+		return ($map_id["MAX(map_id)"]);
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/localisation/maps/formMap.ihtml b/www/include/views/localisation/maps/formMap.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..cbd632a049f333dcf785298fcbc3243be65c4311
--- /dev/null
+++ b/www/include/views/localisation/maps/formMap.ihtml
@@ -0,0 +1,35 @@
+{$form.javascript}
+<form {$form.attributes}>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/download.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+	 	
+	 	<tr class="list_lvl_1"><td class="ListColLvl1_name" colspan="2"><img src='./img/icones/16x16/note.gif'>&nbsp;&nbsp;{$form.header.information}</td></tr>
+		<tr class="list_one"><td class="FormRowField">{$form.map_name.label}</td><td class="FormRowValue">{$form.map_name.html}</td></tr>
+		<tr class="list_two"><td class="FormRowField">{$form.map_description.label}</td><td class="FormRowValue">{$form.map_description.html}</td></tr>
+		<tr class="list_one">
+			<td class="FormRowField">{$form.filename.label}</td>
+			<td class="FormRowValue">
+				{if $o == "a" || $o == "c"}
+					{$form.filename.html}
+				{else if $o == "w"}
+					{$form.map_path.html}<br>
+					<img src='{$form.map_path.label}'>
+				{/if}
+			</td>
+		</tr>
+		<tr class="list_two"><td class="FormRowField">{$form.map_comment.label}</td><td class="FormRowValue">{$form.map_comment.html}</td></tr>
+		
+		{if $o == "a" || $o == "c"}
+			<tr class="list_lvl_2"><td class="ListColLvl2_name" colspan="2">{$form.required._note}</td></tr>
+		{/if}
+	</table>
+	<div id="validForm">
+	{if $o == "a" || $o == "c"}
+		<p>{$form.action.html}</p>
+		<p>{$form.submitC.html}{$form.submitA.html}&nbsp;&nbsp;&nbsp;{$form.reset.html}</p>
+	{else if $o == "w"}
+		<p>{$form.change.html}</p>
+	{/if}
+	</div>
+	{$form.hidden}
+</form>
diff --git a/www/include/views/localisation/maps/formMap.php b/www/include/views/localisation/maps/formMap.php
new file mode 100644
index 0000000000000000000000000000000000000000..009c70b8d793c762493008a029e389af66aa8dd4
--- /dev/null
+++ b/www/include/views/localisation/maps/formMap.php
@@ -0,0 +1,140 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Status Map � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	#
+	## Database retrieve information
+	#
+	$map = array("map_path"=>NULL);
+	if ($o == "c" || $o == "w")	{
+		$res =& $pearDB->query("SELECT * FROM view_map WHERE map_id = '".$map_id."' LIMIT 1");
+		# Set base value
+		$map = array_map("myDecode", $res->fetchRow());
+	}
+	#
+	## Database retrieve information for differents elements list we need on the page
+	#
+	
+	#
+	# End of "database-retrieved" information
+	##########################################################
+	##########################################################
+	# Var information to format the element
+	#
+	$attrsText 		= array("size"=>"35");
+	$attrsTextarea 	= array("rows"=>"5", "cols"=>"40");
+
+	#
+	## Form begin
+	#
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	if ($o == "a")
+		$form->addElement('header', 'title', $lang['views_map_add']);
+	else if ($o == "c")
+		$form->addElement('header', 'title', $lang["views_map_change"]);
+	else if ($o == "w")
+		$form->addElement('header', 'title', $lang["views_map_view"]);
+
+	#
+	## Basic information
+	#
+	$form->addElement('header', 'information', $lang['views_map_infos']);
+	$form->addElement('text', 'map_name', $lang["views_map_name"], $attrsText);
+	$form->addElement('text', 'map_description', $lang["views_map_desc"], $attrsText);	
+	$file =& $form->addElement('file', 'filename', $lang["views_map_img"]);
+	$form->addElement('text', 'map_path', $map["map_path"], NULL);	
+	$form->addElement('textarea', 'map_comment', $lang['views_map_comment'], $attrsTextarea);	
+
+	#
+	## Further informations
+	#
+	
+	$tab = array();
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionList'], '1');
+	$tab[] = &HTML_QuickForm::createElement('radio', 'action', null, $lang['actionForm'], '0');
+	$form->addGroup($tab, 'action', $lang["action"], '&nbsp;');
+	$form->setDefaults(array('action'=>'1'));
+	
+	$form->addElement('hidden', 'map_id');
+	$redirect =& $form->addElement('hidden', 'o');
+	$redirect->setValue($o);
+	
+	#
+	## Form Rules
+	#
+	$form->applyFilter('_ALL_', 'trim');
+	$form->addRule('map_name', $lang['ErrName'], 'required');
+	$form->addRule('map_description', $lang['ErrRequired'], 'required');
+	$form->registerRule('exist', 'callback', 'testExistence');
+	$form->addRule('map_name', $lang['ErrAlreadyExist'], 'exist');
+	$form->setRequiredNote($lang['requiredFields']);
+
+	# 
+	##End of form definition
+	#
+	
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+	
+	# Just watch an information
+	if ($o == "w")	{
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&map_id=".$map_id."'"));
+	    $form->setDefaults($map);
+		$form->freeze();
+	}
+	# Modify an information
+	else if ($o == "c")	{
+		$subC =& $form->addElement('submit', 'submitC', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	    $form->setDefaults($map);
+	}
+	# Add an information
+	else if ($o == "a")	{
+		$subA =& $form->addElement('submit', 'submitA', $lang["save"]);
+		$res =& $form->addElement('reset', 'reset', $lang["reset"]);
+	}
+	
+	$valid = false;
+	if ($form->validate())	{
+		$mapObj =& $form->getElement('map_id');
+		if ($form->getSubmitValue("submitA"))
+			$mapObj->setValue(insertMapInDB($file));
+		else if ($form->getSubmitValue("submitC"))
+			updateMapInDB($mapObj->getValue(), $file);
+		$o = "w";	
+		$form->addElement("button", "change", $lang['modify'], array("onClick"=>"javascript:window.location.href='?p=".$p."&o=c&map_id=".$mapObj->getValue()."'"));
+		$form->freeze();
+		$valid = true;
+	}
+	$action = $form->getSubmitValue("action");
+	if ($valid && $action["action"]["action"])
+		require_once("listMap.php");
+	else	{
+		#Apply a template definition	
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$renderer->setRequiredTemplate('{$label}&nbsp;<font color="red" size="1">*</font>');
+		$renderer->setErrorTemplate('<font color="red">{$error}</font><br />{$html}');
+		$form->accept($renderer);	
+		$tpl->assign('form', $renderer->toArray());	
+		$tpl->assign('o', $o);		
+		$tpl->display("formMap.ihtml");
+	}
+?>
\ No newline at end of file
diff --git a/www/include/views/localisation/maps/listMap.ihtml b/www/include/views/localisation/maps/listMap.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..f03871aff3df123cf69318f2a208cef2f57703b4
--- /dev/null
+++ b/www/include/views/localisation/maps/listMap.ihtml
@@ -0,0 +1,39 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+<input name="p" value="{$p}" type="hidden">
+{php}
+   include('./include/common/pagination.php');
+{/php}
+{$form.hidden}
+</form>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderCenter">{$headerMenu_icone}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_img}</td>
+			<td class="ListColHeaderRight">{$headerMenu_options}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_img}</td>
+			<td class="ListColRight" align="right">{$elemArr[elem].RowMenu_options}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="2">
+				&nbsp;
+				<input type="image" name="o" value="d" src="./img/icones/16x16/selection_delete.gif" onclick="return confirm('{$msg.delConfirm}')">				
+			</td>
+			<td class="ListColFooterCenter" colspan="2"></td>
+			<td class="ListColFooterRight" align="right"><a href="{$msg.addL}">{$msg.addT}</a></td>
+		</tr>		
+	</table>
+{php}
+   include('./include/common/pagination.php');
+{/php}{$form.hidden}
+</form>
diff --git a/www/include/views/localisation/maps/listMap.php b/www/include/views/localisation/maps/listMap.php
new file mode 100644
index 0000000000000000000000000000000000000000..97a42aeb85168648f09e95fdec18cead28e1fcf0
--- /dev/null
+++ b/www/include/views/localisation/maps/listMap.php
@@ -0,0 +1,88 @@
+<?php
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Drill Down Map � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/$pagination = "maxViewConfiguration";
+	!isset ($_GET["limit"]) ? $limit = 20 : $limit = $_GET["limit"];
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	if ($search)
+		$res = & $pearDB->query("SELECT COUNT(*) FROM view_map WHERE map_name LIKE '%".htmlentities($search, ENT_QUOTES)."%'");
+	else
+		$res = & $pearDB->query("SELECT COUNT(*) FROM view_map");
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_img", $lang['views_map_img']);
+	$tpl->assign("headerMenu_options", $lang['options']);
+	# end header menu
+	# map list
+	if ($search)
+		$rq = "SELECT map_id, map_name, map_description, map_path FROM view_map WHERE map_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' ORDER BY map_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT map_id, map_name, map_description, map_path FROM view_map ORDER BY map_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+	$elemArr = array();	for ($i = 0; $res->fetchInto($map); $i++) {
+		$selectedElements =& $form->addElement('checkbox', "select[".$map['map_id']."]");	
+		$moptions = "<a href='oreon.php?p=".$p."&map_id=".$map['map_id']."&o=w&&search=".$search."'><img src='img/icones/16x16/view.gif' border='0' alt='".$lang['view']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&map_id=".$map['map_id']."&o=c&search=".$search."'><img src='img/icones/16x16/document_edit.gif' border='0' alt='".$lang['modify']."'></a>&nbsp;&nbsp;";
+		$moptions .= "<a href='oreon.php?p=".$p."&map_id=".$map['map_id']."&o=d&select[".$map['map_id']."]=1&num=".$num."&limit=".$limit."&search=".$search."' onclick=\"return confirm('".$lang['confirm_removing']."')\"><img src='img/icones/16x16/delete.gif' border='0' alt='".$lang['delete']."'></a>&nbsp;&nbsp;";
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$map["map_name"],
+						"RowMenu_link"=>"?p=".$p."&o=w&map_id=".$map['map_id'],
+						"RowMenu_desc"=>$map["map_description"],
+						"RowMenu_img"=>basename($map["map_path"]),
+						"RowMenu_options"=>$moptions);
+		$style != "two" ? $style = "two" : $style = "one";	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listMap.ihtml");
+	
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");
+	?>
\ No newline at end of file
diff --git a/www/include/views/localisation/maps/map.php b/www/include/views/localisation/maps/map.php
new file mode 100644
index 0000000000000000000000000000000000000000..724d052da288ed16657f9b393fe966b2597dc2d2
--- /dev/null
+++ b/www/include/views/localisation/maps/map.php
@@ -0,0 +1,46 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Status Map � is developped by Merethis company for Lafarge Group, 
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["map_id"]) ? $mapG = $_GET["map_id"] : $mapG = NULL;
+	isset($_POST["map_id"]) ? $mapP = $_POST["map_id"] : $mapP = NULL;
+	$mapG ? $map_id = $mapG : $map_id = $mapP;
+		
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+	
+	#Path to the cities dir
+	$path = "./include/views/localisation/maps/";
+
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+
+	switch ($o)	{
+		case "a" : require_once($path."formMap.php"); break; #Add a Map
+		case "w" : require_once($path."formMap.php"); break; #Watch a Map
+		case "c" : require_once($path."formMap.php"); break; #Modify a Map
+		case "d" : deleteMapInDB(isset($_GET["select"]) ? $_GET["select"] : array()); require_once($path."listMap.php"); break; #Delete n Maps
+		default : require_once($path."listMap.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/index.php b/www/index.php
new file mode 100644
index 0000000000000000000000000000000000000000..ab08755a89bfc624a14fc2e3194826dee8dee4c9
--- /dev/null
+++ b/www/index.php
@@ -0,0 +1,162 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!file_exists("./oreon.conf.php"))
+		header("Location: ./install/setup.php");
+	elseif (file_exists("./oreon.conf.php") && is_dir('install'))
+		header("Location: ./install/upgrade.php");
+	else
+		require_once ("./oreon.conf.php");
+
+	require_once ("$classdir/Session.class.php");
+	require_once ("$classdir/Oreon.class.php");
+	require_once("DBconnect.php");
+
+	// detect installation dir
+	$file_install_acces = 0;
+	if (file_exists("./install/setup.php")){
+		$error_msg = "Installation Directory '". getcwd() ."/install/' is accessible. Delete this directory to prevent security problem.";
+		$file_install_acces = 1;
+	}
+
+	Session::start();
+	if (isset($_GET["disconnect"])) {
+		$oreon = & $_SESSION["oreon"];
+		$pearDB->query("DELETE FROM session WHERE session_id = '".session_id()."'");
+		Session::stop();
+		Session::start();
+	}
+
+	if (isset($_SESSION["oreon"])) {	// already connected
+		$oreon = & $_SESSION["oreon"];
+		$pearDB->query("DELETE FROM session WHERE session_id = '".session_id()."'");
+		Session::stop();
+		Session::start();
+	}
+
+	if (isset($_POST["submit"])) {
+		require_once("DBconnect.php");
+		$res =& $pearDB->query("SELECT ldap_host, ldap_port, ldap_base_dn, ldap_login_attrib, ldap_ssl, ldap_auth_enable  FROM general_opt LIMIT 1");
+		$res->fetchInto($ldap_auth);
+
+		$res =& $pearDB->query("SELECT * FROM contact WHERE contact_alias='".htmlentities($_POST["useralias"], ENT_QUOTES)."' AND contact_activate = '1' LIMIT 1");
+		if($res->numRows()) {
+			while($contact =& $res->fetchRow()) {
+				if(isset($contact['contact_auth_type']) && $contact['contact_auth_type']=='ldap' && $ldap_auth['ldap_auth_enable']=='1' ) {
+
+					if ($ldap_auth['ldap_ssl'] == "0") $ldapuri = "ldap://" ;
+					if ($ldap_auth['ldap_ssl'] == "1") $ldapuri = "ldaps://" ;
+     				// if no LDAP connection, use local mysql authentication
+					$ds = ldap_connect($ldapuri . $ldap_auth['ldap_host'].":".$ldap_auth['ldap_port']) or $contact['contact_auth_type']='local' ;
+					if($ds) {
+						$userdn = $contact['contact_ldap_dn'];
+						$r = @ldap_bind($ds,$userdn,$_POST['password']) ;
+						if($r) {
+							//update password in mysql database to provide login even if there is LDAP connection
+							$pearDB->query("UPDATE contact set contact_passwd = '".md5($_POST['password'])."' WHERE contact_alias ='".$contact['contact_alias']."' ");
+
+							$res =& $pearDB->query("SELECT * FROM contact WHERE contact_alias='".htmlentities($_POST["useralias"], ENT_QUOTES)."' and contact_passwd='".md5($_POST["password"])."' AND contact_activate = '1' LIMIT 1");
+
+							if ($res->numRows()) {
+								global $oreon;
+								$res2 =& $pearDB->query("SELECT nagios_version FROM general_opt");
+								$version = $res2->fetchRow();
+								$user =& new User($res->fetchRow(), $version["nagios_version"]);
+								$user->createLCA($pearDB);
+								$oreon = new Oreon($user);
+								$_SESSION["oreon"] =& $oreon;
+								$res =& $pearDB->query("SELECT session_expire FROM general_opt LIMIT 1");
+								$session_expire =& $res->fetchRow();
+								$res =& $pearDB->query("SELECT * FROM session");
+								while ($session =& $res->fetchRow())
+									if ($session["last_reload"] + ($session_expire["session_expire"] * 60) <= time())
+										$pearDB->query("DELETE FROM session WHERE session_id = '".$session["session_id"]."'");
+								$res =& $pearDB->query("INSERT INTO `session` (`session_id` , `user_id` , `current_page` , `last_reload`, `ip_address`) VALUES ('".session_id()."', '".$oreon->user->user_id."', '1', '".time()."', '".$_SERVER["REMOTE_ADDR"]."')");
+								header("Location: ./oreon.php?p=1");
+							}
+						}
+					ldap_close($ds);
+					} else {
+						$msg_error = "Enable to connect to LDAP Server for authentification";
+					}
+				}
+				if((!isset($contact['contact_auth_type'])) || ($contact['contact_auth_type']=='') || (isset($contact['contact_auth_type']) && $contact['contact_auth_type']=='local')) {
+
+					$res =& $pearDB->query("SELECT * FROM contact WHERE contact_alias='".htmlentities($_POST["useralias"], ENT_QUOTES)."' and contact_passwd='".md5($_POST["password"])."' AND contact_activate = '1' LIMIT 1");
+					if ($res->numRows()) {
+						global $oreon;
+						$res2 =& $pearDB->query("SELECT nagios_version FROM general_opt");
+						$version = $res2->fetchRow();
+						$user =& new User($res->fetchRow(), $version["nagios_version"]);
+						$user->createLCA($pearDB);
+						$oreon = new Oreon($user);
+						$_SESSION["oreon"] =& $oreon;
+						$res =& $pearDB->query("SELECT session_expire FROM general_opt LIMIT 1");
+						$session_expire =& $res->fetchRow();
+						$res =& $pearDB->query("SELECT * FROM session");
+						while ($session =& $res->fetchRow())
+							if ($session["last_reload"] + ($session_expire["session_expire"] * 60) <= time())
+								$pearDB->query("DELETE FROM session WHERE session_id = '".$session["session_id"]."'");
+						$res =& $pearDB->query("INSERT INTO `session` (`session_id` , `user_id` , `current_page` , `last_reload`, `ip_address`) VALUES ('".session_id()."', '".$oreon->user->user_id."', '1', '".time()."', '".$_SERVER["REMOTE_ADDR"]."')");
+
+						header("Location: ./oreon.php?p=1");
+					}
+				}
+			}
+		}
+	}
+	else if (isset($_GET["autologin"]) && isset($_GET["p"]) && $_GET["autologin"] && $_GET["p"])	{
+		require_once("DBconnect.php");
+		$res =& $pearDB->query("SELECT * FROM contact WHERE MD5(contact_alias)='".$_GET["useralias"]."' and contact_passwd='".$_GET["password"]."' AND contact_activate = '1' LIMIT 1");
+		if ($res->numRows()) {
+			global $oreon;
+			$res2 =& $pearDB->query("SELECT nagios_version FROM general_opt");
+			$version = $res2->fetchRow();
+			$user =& new User($res->fetchRow(), $version["nagios_version"]);
+			$user->createLCA($pearDB);
+			$oreon = new Oreon($user);
+			$_SESSION["oreon"] =& $oreon;
+			$res =& $pearDB->query("SELECT session_expire FROM general_opt LIMIT 1");
+			$session_expire =& $res->fetchRow();
+			$res =& $pearDB->query("SELECT * FROM session");
+			while ($session =& $res->fetchRow())
+				if ($session["last_reload"] + ($session_expire["session_expire"] * 60) <= time())
+					$pearDB->query("DELETE FROM session WHERE session_id = '".$session["session_id"]."'");
+			$res =& $pearDB->query("INSERT INTO `session` (`session_id` , `user_id` , `current_page` , `last_reload`, `ip_address`) VALUES ('".session_id()."', '".$oreon->user->user_id."', '1', '".time()."', '".$_SERVER["REMOTE_ADDR"]."')");
+			$args = NULL;
+			foreach($_GET as $key=>$value)
+				$args ? $args .= "&".$key."=".$value : $args = $key."=".$value;
+			header("Location: ./oreon.php?".$args."");
+		}
+	}
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>Oreon - Nagios Solution</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<link href="./Themes/Basic/login.css" rel="stylesheet" type="text/css">
+<link rel="shortcut icon" href="./img/iconOreon.ico">
+</head>
+<body OnLoad="document.login.useralias.focus();">
+<? include_once("./login.php"); ?>
+</body>
+</html>
+
diff --git a/www/install/.htaccess b/www/install/.htaccess
new file mode 100644
index 0000000000000000000000000000000000000000..46d92e12db7b629b2316fc8a1732362e280e4add
--- /dev/null
+++ b/www/install/.htaccess
@@ -0,0 +1 @@
+php_flag magic_quotes_gpc off
diff --git a/www/install/DB-Func.php b/www/install/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..444451ade77e16948a9d712f3db0947c3c4cdcde
--- /dev/null
+++ b/www/install/DB-Func.php
@@ -0,0 +1,90 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+function Connexion ($pNom, $pMotPasse, $pServeur)	{
+	$msg = '';
+	$connexion = @mysql_pconnect($pServeur, $pNom, $pMotPasse) or ($msg = mysql_error());
+	return array ($connexion, $msg);
+}
+
+function aff_header($str, $str2, $nb){
+?>
+<html>
+<head>
+   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+   <meta http-equiv="Content-Style-Type" content="text/css">
+   <title><? print $str; ?></title>
+   <link rel="shortcut icon" href="../img/favicon.ico">
+   <link rel="stylesheet" href="./install.css" type="text/css">
+   <SCRIPT language='javascript'>
+	function LicenceAccepted(){
+		var theForm     = document.forms[0];
+		var nextButton  = document.getElementById("button_next");
+
+		if( theForm.setup_license_accept.checked ){
+			nextButton.disabled = '';
+			nextButton.focus();
+		}
+		else {
+			nextButton.disabled = "disabled";
+		}
+	}
+	</SCRIPT>
+</head>
+<body rightmargin="0" topmargin="0" leftmargin="0">
+<table cellspacing="0" cellpadding="0" border="0" align="center" class="shell">
+<tr height="83" style=" background-image: url('../img/bg_banner.gif');">
+  <th width="400" height="83"><? print $nb . ". " . $str2; ?></th>
+  <th width="200" height="83" style="text-align: right; padding: 0px;">
+		<a href="http://www.oreon-project.org" target="_blank"><IMG src="../img/logo_oreon.gif" alt="Oreon" border="0"></a>
+  </th>
+</tr>
+<tr>
+  <td colspan="2" width="600" style="background-position : right; background-color: #DDDDDD; background-repeat : no-repeat;">
+	<form action="setup.php" method="post" name="theForm" id="theForm">
+	<input type="hidden" name="step" value="<? print $nb; ?>">
+<?
+}
+
+function aff_middle(){
+?>
+  </td>
+</tr>
+<tr>
+  <td align="right" colspan="2" height="20">
+	<hr>
+	<table cellspacing="0" cellpadding="0" border="0" class="stdTable">
+	  <tr>
+		<td>
+<?
+}
+
+function aff_footer(){
+?>				</td>
+			  </tr>
+		</table>
+		</form>
+	  </td>
+	</tr>
+  </table>
+</body>
+</html>
+<?
+}
+
+?>
\ No newline at end of file
diff --git a/www/install/LICENSE.txt b/www/install/LICENSE.txt
new file mode 100644
index 0000000000000000000000000000000000000000..b8602677e0980076f7617bb74a921885983282b9
--- /dev/null
+++ b/www/install/LICENSE.txt
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/www/install/createTables.sql b/www/install/createTables.sql
new file mode 100644
index 0000000000000000000000000000000000000000..74e72707b286234e93854f754c796287c33d9296
--- /dev/null
+++ b/www/install/createTables.sql
@@ -0,0 +1,2190 @@
+--
+-- Generated le : Vendredi 30 Juin 2006 12:36
+--
+
+--
+-- Base de donn�es: `oreon`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `cfg_cgi`
+--
+
+CREATE TABLE `cfg_cgi` (
+  `cgi_id` int(11) NOT NULL auto_increment,
+  `cgi_name` varchar(255) default NULL,
+  `main_config_file` varchar(255) default NULL,
+  `physical_html_path` varchar(255) default NULL,
+  `url_html_path` varchar(255) default NULL,
+  `nagios_check_command` varchar(255) default NULL,
+  `use_authentication` enum('0','1') default NULL,
+  `default_user_name` varchar(255) default NULL,
+  `authorized_for_system_information` text,
+  `authorized_for_system_commands` text,
+  `authorized_for_configuration_information` text,
+  `authorized_for_all_hosts` text,
+  `authorized_for_all_host_commands` text,
+  `authorized_for_all_services` text,
+  `authorized_for_all_service_commands` text,
+  `statusmap_background_image` varchar(255) default NULL,
+  `default_statusmap_layout` enum('0','1','2','3','4','5','6') default '2',
+  `statuswrl_include` varchar(255) default NULL,
+  `default_statuswrl_layout` enum('0','1','2','3','4') default '2',
+  `refresh_rate` int(11) default NULL,
+  `host_unreachable_sound` varchar(255) default NULL,
+  `host_down_sound` varchar(255) default NULL,
+  `service_critical_sound` varchar(255) default NULL,
+  `service_warning_sound` varchar(255) default NULL,
+  `service_unknown_sound` varchar(255) default NULL,
+  `ping_syntax` text,
+  `cgi_comment` text,
+  `cgi_activate` enum('0','1') default NULL,
+  PRIMARY KEY  (`cgi_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `cfg_nagios`
+--
+
+CREATE TABLE `cfg_nagios` (
+  `nagios_id` int(11) NOT NULL auto_increment,
+  `nagios_name` varchar(255) default NULL,
+  `log_file` varchar(255) default NULL,
+  `cfg_dir` varchar(255) default NULL,
+  `object_cache_file` varchar(255) default NULL,
+  `temp_file` varchar(255) default NULL,
+  `status_file` varchar(255) default NULL,
+  `p1_file` varchar(255) default NULL,
+  `aggregate_status_updates` enum('0','1','2') default NULL,
+  `status_update_interval` int(11) default NULL,
+  `nagios_user` varchar(255) default NULL,
+  `nagios_group` varchar(255) default NULL,
+  `enable_notifications` enum('0','1','2') default NULL,
+  `execute_service_checks` enum('0','1','2') default NULL,
+  `accept_passive_service_checks` enum('0','1','2') default NULL,
+  `execute_host_checks` enum('0','1','2') default NULL,
+  `accept_passive_host_checks` enum('0','1','2') default NULL,
+  `enable_event_handlers` enum('0','1','2') default NULL,
+  `log_rotation_method` varchar(255) default NULL,
+  `log_archive_path` varchar(255) default NULL,
+  `check_external_commands` enum('0','1','2') default NULL,
+  `command_check_interval` varchar(255) default NULL,
+  `command_file` varchar(255) default NULL,
+  `downtime_file` varchar(255) default NULL,
+  `comment_file` varchar(255) default NULL,
+  `lock_file` varchar(255) default NULL,
+  `retain_state_information` enum('0','1','2') default NULL,
+  `state_retention_file` varchar(255) default NULL,
+  `retention_update_interval` int(11) default NULL,
+  `use_retained_program_state` enum('0','1','2') default NULL,
+  `use_retained_scheduling_info` enum('0','1','2') default NULL,
+  `use_syslog` enum('0','1','2') default NULL,
+  `log_notifications` enum('0','1','2') default NULL,
+  `log_service_retries` enum('0','1','2') default NULL,
+  `log_host_retries` enum('0','1','2') default NULL,
+  `log_event_handlers` enum('0','1','2') default NULL,
+  `log_initial_states` enum('0','1','2') default NULL,
+  `log_external_commands` enum('0','1','2') default NULL,
+  `log_passive_service_checks` enum('0','1','2') default NULL,
+  `log_passive_checks` enum('0','1','2') default NULL,
+  `global_host_event_handler` int(11) default NULL,
+  `global_service_event_handler` int(11) default NULL,
+  `sleep_time` VARCHAR(10) default NULL,
+  `inter_check_delay_method` varchar(255) default NULL,
+  `service_inter_check_delay_method` varchar(255) default NULL,
+  `host_inter_check_delay_method` varchar(255) default NULL,
+  `service_interleave_factor` varchar(255) default NULL,
+  `max_concurrent_checks` int(11) default NULL,
+  `max_service_check_spread` int(11) default NULL,
+  `max_host_check_spread` int(11) default NULL,
+  `service_reaper_frequency` int(11) default NULL,
+  `interval_length` int(11) default NULL,
+  `auto_reschedule_checks` enum('0','1','2') default NULL,
+  `auto_rescheduling_interval` int(11) default NULL,
+  `auto_rescheduling_window` int(11) default NULL,
+  `use_agressive_host_checking` enum('0','1','2') default NULL,
+  `enable_flap_detection` enum('0','1','2') default NULL,
+  `low_service_flap_threshold` varchar(255) default NULL,
+  `high_service_flap_threshold` varchar(255) default NULL,
+  `low_host_flap_threshold` varchar(255) default NULL,
+  `high_host_flap_threshold` varchar(255) default NULL,
+  `soft_state_dependencies` enum('0','1','2') default NULL,
+  `service_check_timeout` int(11) default NULL,
+  `host_check_timeout` int(11) default NULL,
+  `event_handler_timeout` int(11) default NULL,
+  `notification_timeout` int(11) default NULL,
+  `ocsp_timeout` int(11) default NULL,
+  `ochp_timeout` int(11) default NULL,
+  `perfdata_timeout` int(11) default NULL,
+  `obsess_over_services` enum('0','1','2') default NULL,
+  `ocsp_command` int(11) default NULL,
+  `obsess_over_hosts` enum('0','1','2') default NULL,
+  `ochp_command` int(11) default NULL,
+  `process_performance_data` enum('0','1','2') default NULL,
+  `host_perfdata_command` int(11) default NULL,
+  `service_perfdata_command` int(11) default NULL,
+  `host_perfdata_file` varchar(255) default NULL,
+  `service_perfdata_file` varchar(255) default NULL,
+  `host_perfdata_file_template` text,
+  `service_perfdata_file_template` text,
+  `host_perfdata_file_mode` enum('a','w','2') default NULL,
+  `service_perfdata_file_mode` enum('a','w','2') default NULL,
+  `host_perfdata_file_processing_interval` int(11) default NULL,
+  `service_perfdata_file_processing_interval` int(11) default NULL,
+  `host_perfdata_file_processing_command` int(11) default NULL,
+  `service_perfdata_file_processing_command` int(11) default NULL,
+  `check_for_orphaned_services` enum('0','1','2') default NULL,
+  `check_service_freshness` enum('0','1','2') default NULL,
+  `service_freshness_check_interval` int(11) default NULL,
+  `freshness_check_interval` int(11) default NULL,
+  `check_host_freshness` enum('0','1','2') default NULL,
+  `host_freshness_check_interval` int(11) default NULL,
+  `date_format` varchar(255) default NULL,
+  `illegal_object_name_chars` varchar(255) default NULL,
+  `illegal_macro_output_chars` varchar(255) default NULL,
+  `use_regexp_matching` enum('0','1','2') default NULL,
+  `use_true_regexp_matching` enum('0','1','2') default NULL,
+  `admin_email` varchar(255) default NULL,
+  `admin_pager` varchar(255) default NULL,
+  `nagios_comment` text,
+  `nagios_activate` enum('0','1') default NULL,
+  PRIMARY KEY  (`nagios_id`),
+  KEY `cmd1_index` (`global_host_event_handler`),
+  KEY `cmd2_index` (`global_service_event_handler`),
+  KEY `cmd3_index` (`ocsp_command`),
+  KEY `cmd4_index` (`ochp_command`),
+  KEY `cmd5_index` (`host_perfdata_command`),
+  KEY `cmd6_index` (`service_perfdata_command`),
+  KEY `cmd7_index` (`host_perfdata_file_processing_command`),
+  KEY `cmd8_index` (`service_perfdata_file_processing_command`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `cfg_perfparse`
+--
+
+CREATE TABLE `cfg_perfparse` (
+  `perfparse_id` int(11) NOT NULL auto_increment,
+  `perfparse_name` varchar(255) default NULL,
+  `Server_Port` int(11) default NULL,
+  `Service_Log` varchar(255) default NULL,
+  `Service_Log_Position_Mark_Path` varchar(255) default NULL,
+  `Error_Log` varchar(255) default NULL,
+  `Error_Log_Rotate` enum('0','1') default '1',
+  `Error_Log_Keep_N_Days` int(11) default NULL,
+  `Drop_File` varchar(255) default NULL,
+  `Drop_File_Rotate` enum('0','1') default '1',
+  `Drop_File_Keep_N_Days` int(11) default NULL,
+  `Lock_File` varchar(255) default NULL,
+  `Show_Status_Bar` enum('0','1') default '1',
+  `Do_Report` enum('0','1') default '1',
+  `Default_user_permissions_Policy` enum('1','2','3') default '1',
+  `Default_user_permissions_Host_groups` enum('1','2','3') default '1',
+  `Default_user_permissions_Summary` enum('1','2','3') default '1',
+  `Output_Log_File` enum('0','1') default '1',
+  `Output_Log_Filename` varchar(255) default NULL,
+  `Output_Log_Rotate` enum('0','1') default '1',
+  `Output_Log_Keep_N_Days` int(11) default NULL,
+  `Use_Storage_Socket_Output` enum('0','1') default '1',
+  `Storage_Socket_Output_Host_Name` varchar(255) default NULL,
+  `Storage_Socket_Output_Port` int(11) default NULL,
+  `Use_Storage_Mysql` enum('0','1') default '1',
+  `No_Raw_Data` enum('0','1') default '1',
+  `No_Bin_Data` enum('0','1') default '1',
+  `DB_User` varchar(255) default NULL,
+  `DB_Pass` varchar(255) default NULL,
+  `DB_Name` varchar(255) default NULL,
+  `DB_Host` varchar(255) default NULL,
+  `Dummy_Hostname` varchar(255) default NULL,
+  `Storage_Modules_Load` varchar(255) default NULL,
+  `perfparse_comment` text,
+  `perfparse_activate` enum('0','1') default NULL,
+  PRIMARY KEY  (`perfparse_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `cfg_resource`
+--
+
+CREATE TABLE `cfg_resource` (
+  `resource_id` int(11) NOT NULL auto_increment,
+  `resource_name` varchar(255) default NULL,
+  `resource_line` varchar(255) default NULL,
+  `resource_comment` varchar(255) default NULL,
+  `resource_activate` enum('0','1') default NULL,
+  PRIMARY KEY  (`resource_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `command`
+--
+
+CREATE TABLE `command` (
+  `command_id` int(11) NOT NULL auto_increment,
+  `command_name` varchar(200) default NULL,
+  `command_line` text,
+  `command_example` varchar(254) default NULL,
+  `command_type` tinyint(4) default NULL,
+  PRIMARY KEY  (`command_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `contact`
+--
+
+CREATE TABLE `contact` (
+  `contact_id` int(11) NOT NULL auto_increment,
+  `timeperiod_tp_id` int(11) default NULL,
+  `timeperiod_tp_id2` int(11) default NULL,
+  `contact_name` varchar(200) default NULL,
+  `contact_alias` varchar(200) default NULL,
+  `contact_passwd` varchar(255) default NULL,
+  `contact_lang` varchar(255) default NULL,
+  `contact_host_notification_options` varchar(200) default NULL,
+  `contact_service_notification_options` varchar(200) default NULL,
+  `contact_email` varchar(200) default NULL,
+  `contact_pager` varchar(200) default NULL,
+  `contact_comment` text,
+  `contact_oreon` enum('0','1') default NULL,
+  `contact_admin` enum('0','1') default '0',
+  `contact_type_msg` enum('txt','html','pdf') default 'txt',
+  `contact_activate` enum('0','1') default NULL,
+  `contact_auth_type` varchar(255) default '',
+  `contact_ldap_dn` varchar(255) default NULL,
+  PRIMARY KEY  (`contact_id`),
+  KEY `name_index` (`contact_name`),
+  KEY `alias_index` (`contact_alias`),
+  KEY `tp1_index` (`timeperiod_tp_id`),
+  KEY `tp2_index` (`timeperiod_tp_id2`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `contact_hostcommands_relation`
+--
+
+CREATE TABLE `contact_hostcommands_relation` (
+  `chr_id` int(11) NOT NULL auto_increment,
+  `contact_contact_id` int(11) default NULL,
+  `command_command_id` int(11) default NULL,
+  PRIMARY KEY  (`chr_id`),
+  KEY `contact_index` (`contact_contact_id`),
+  KEY `command_index` (`command_command_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `contact_servicecommands_relation`
+--
+
+CREATE TABLE `contact_servicecommands_relation` (
+  `csc_id` int(11) NOT NULL auto_increment,
+  `contact_contact_id` int(11) default NULL,
+  `command_command_id` int(11) default NULL,
+  PRIMARY KEY  (`csc_id`),
+  KEY `contact_index` (`contact_contact_id`),
+  KEY `command_index` (`command_command_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `contactgroup`
+--
+
+CREATE TABLE `contactgroup` (
+  `cg_id` int(11) NOT NULL auto_increment,
+  `cg_name` varchar(200) default NULL,
+  `cg_alias` varchar(200) default NULL,
+  `cg_comment` text,
+  `cg_activate` enum('0','1') default NULL,
+  PRIMARY KEY  (`cg_id`),
+  KEY `name_index` (`cg_name`),
+  KEY `alias_index` (`cg_alias`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `contactgroup_contact_relation`
+--
+
+CREATE TABLE `contactgroup_contact_relation` (
+  `cgr_id` int(11) NOT NULL auto_increment,
+  `contact_contact_id` int(11) default NULL,
+  `contactgroup_cg_id` int(11) default NULL,
+  PRIMARY KEY  (`cgr_id`),
+  KEY `contact_index` (`contact_contact_id`),
+  KEY `contactgroup_index` (`contactgroup_cg_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `contactgroup_host_relation`
+--
+
+CREATE TABLE `contactgroup_host_relation` (
+  `cghr_id` int(11) NOT NULL auto_increment,
+  `host_host_id` int(11) default NULL,
+  `contactgroup_cg_id` int(11) default NULL,
+  PRIMARY KEY  (`cghr_id`),
+  KEY `host_index` (`host_host_id`),
+  KEY `contactgroup_index` (`contactgroup_cg_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `contactgroup_hostgroup_relation`
+--
+
+CREATE TABLE `contactgroup_hostgroup_relation` (
+  `cghgr_id` int(11) NOT NULL auto_increment,
+  `contactgroup_cg_id` int(11) default NULL,
+  `hostgroup_hg_id` int(11) default NULL,
+  PRIMARY KEY  (`cghgr_id`),
+  KEY `contactgroup_index` (`contactgroup_cg_id`),
+  KEY `hostgroup_index` (`hostgroup_hg_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `contactgroup_service_relation`
+--
+
+CREATE TABLE `contactgroup_service_relation` (
+  `cgsr_id` int(11) NOT NULL auto_increment,
+  `contactgroup_cg_id` int(11) default NULL,
+  `service_service_id` int(11) default NULL,
+  PRIMARY KEY  (`cgsr_id`),
+  KEY `contactgroup_index` (`contactgroup_cg_id`),
+  KEY `service_index` (`service_service_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `contactgroup_servicegroup_relation`
+--
+
+CREATE TABLE `contactgroup_servicegroup_relation` (
+  `cgsgr_id` int(11) NOT NULL auto_increment,
+  `servicegroup_sg_id` int(11) default NULL,
+  `contactgroup_cg_id` int(11) default NULL,
+  PRIMARY KEY  (`cgsgr_id`),
+  KEY `servicegroup_index` (`servicegroup_sg_id`),
+  KEY `contactgroup_index` (`contactgroup_cg_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `cron_operation`
+--
+
+CREATE TABLE `cron_operation` (
+  `id` int(11) NOT NULL auto_increment,
+  `name` varchar(254) default NULL,
+  `command` varchar(254) default NULL,
+  `time_launch` varchar(254) default NULL,
+  `last_modification` int(11) default '0',
+  `system` enum('0','1') default NULL,
+  `module` enum('0','1') default NULL,
+  `activate` enum('0','1') default NULL,
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `dependency`
+--
+
+CREATE TABLE `dependency` (
+  `dep_id` int(11) NOT NULL auto_increment,
+  `dep_name` varchar(255) default NULL,
+  `dep_description` varchar(255) default NULL,
+  `inherits_parent` enum('0','1') default NULL,
+  `execution_failure_criteria` varchar(255) default NULL,
+  `notification_failure_criteria` varchar(255) default NULL,
+  `dep_comment` text,
+  PRIMARY KEY  (`dep_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `dependency_hostChild_relation`
+--
+
+CREATE TABLE `dependency_hostChild_relation` (
+  `dhcr_id` int(11) NOT NULL auto_increment,
+  `dependency_dep_id` int(11) default NULL,
+  `host_host_id` int(11) default NULL,
+  PRIMARY KEY  (`dhcr_id`),
+  KEY `dependency_index` (`dependency_dep_id`),
+  KEY `host_index` (`host_host_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `dependency_hostParent_relation`
+--
+
+CREATE TABLE `dependency_hostParent_relation` (
+  `dhpr_id` int(11) NOT NULL auto_increment,
+  `dependency_dep_id` int(11) default NULL,
+  `host_host_id` int(11) default NULL,
+  PRIMARY KEY  (`dhpr_id`),
+  KEY `dependency_index` (`dependency_dep_id`),
+  KEY `host_index` (`host_host_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `dependency_hostgroupChild_relation`
+--
+
+CREATE TABLE `dependency_hostgroupChild_relation` (
+  `dhgcr_id` int(11) NOT NULL auto_increment,
+  `dependency_dep_id` int(11) default NULL,
+  `hostgroup_hg_id` int(11) default NULL,
+  PRIMARY KEY  (`dhgcr_id`),
+  KEY `dependency_index` (`dependency_dep_id`),
+  KEY `hostgroup_index` (`hostgroup_hg_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `dependency_hostgroupParent_relation`
+--
+
+CREATE TABLE `dependency_hostgroupParent_relation` (
+  `dhgpr_id` int(11) NOT NULL auto_increment,
+  `dependency_dep_id` int(11) default NULL,
+  `hostgroup_hg_id` int(11) default NULL,
+  PRIMARY KEY  (`dhgpr_id`),
+  KEY `dependency_index` (`dependency_dep_id`),
+  KEY `hostgroup_index` (`hostgroup_hg_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `dependency_metaserviceChild_relation`
+--
+
+CREATE TABLE `dependency_metaserviceChild_relation` (
+  `dmscr_id` int(11) NOT NULL auto_increment,
+  `dependency_dep_id` int(11) default NULL,
+  `meta_service_meta_id` int(11) default NULL,
+  PRIMARY KEY  (`dmscr_id`),
+  KEY `dependency_index` (`dependency_dep_id`),
+  KEY `meta_service_index` (`meta_service_meta_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `dependency_metaserviceParent_relation`
+--
+
+CREATE TABLE `dependency_metaserviceParent_relation` (
+  `dmspr_id` int(11) NOT NULL auto_increment,
+  `dependency_dep_id` int(11) default NULL,
+  `meta_service_meta_id` int(11) default NULL,
+  PRIMARY KEY  (`dmspr_id`),
+  KEY `dependency_index` (`dependency_dep_id`),
+  KEY `meta_service_index` (`meta_service_meta_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `dependency_oslChild_relation`
+--
+
+CREATE TABLE `dependency_oslChild_relation` (
+  `docr_id` int(11) NOT NULL auto_increment,
+  `dependency_dep_id` int(11) default NULL,
+  `osl_osl_id` int(11) default NULL,
+  PRIMARY KEY  (`docr_id`),
+  KEY `dependency_index` (`dependency_dep_id`),
+  KEY `osl_index` (`osl_osl_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `dependency_oslParent_relation`
+--
+
+CREATE TABLE `dependency_oslParent_relation` (
+  `dopr_id` int(11) NOT NULL auto_increment,
+  `dependency_dep_id` int(11) default NULL,
+  `osl_osl_id` int(11) default NULL,
+  PRIMARY KEY  (`dopr_id`),
+  KEY `dependency_index` (`dependency_dep_id`),
+  KEY `osl_index` (`osl_osl_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `dependency_serviceChild_relation`
+--
+
+CREATE TABLE `dependency_serviceChild_relation` (
+  `dscr_id` int(11) NOT NULL auto_increment,
+  `dependency_dep_id` int(11) default NULL,
+  `service_service_id` int(11) default NULL,
+  PRIMARY KEY  (`dscr_id`),
+  KEY `dependency_index` (`dependency_dep_id`),
+  KEY `service_index` (`service_service_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `dependency_serviceParent_relation`
+--
+
+CREATE TABLE `dependency_serviceParent_relation` (
+  `dspr_id` int(11) NOT NULL auto_increment,
+  `dependency_dep_id` int(11) default NULL,
+  `service_service_id` int(11) default NULL,
+  PRIMARY KEY  (`dspr_id`),
+  KEY `dependency_index` (`dependency_dep_id`),
+  KEY `service_index` (`service_service_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `dependency_servicegroupChild_relation`
+--
+
+CREATE TABLE `dependency_servicegroupChild_relation` (
+  `dsgcr_id` int(11) NOT NULL auto_increment,
+  `dependency_dep_id` int(11) default NULL,
+  `servicegroup_sg_id` int(11) default NULL,
+  PRIMARY KEY  (`dsgcr_id`),
+  KEY `dependency_index` (`dependency_dep_id`),
+  KEY `sg_index` (`servicegroup_sg_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `dependency_servicegroupParent_relation`
+--
+
+CREATE TABLE `dependency_servicegroupParent_relation` (
+  `dsgpr_id` int(11) NOT NULL auto_increment,
+  `dependency_dep_id` int(11) default NULL,
+  `servicegroup_sg_id` int(11) default NULL,
+  PRIMARY KEY  (`dsgpr_id`),
+  KEY `dependency_index` (`dependency_dep_id`),
+  KEY `sg_index` (`servicegroup_sg_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `downtime`
+--
+
+CREATE TABLE `downtime` (
+  `downtime_id` int(11) NOT NULL auto_increment,
+  `host_id` int(11) NOT NULL default '0',
+  `service_id` int(11) default NULL,
+  `entry_time` timestamp NOT NULL default '0000-00-00 00:00:00',
+  `author` varchar(254) NOT NULL default '',
+  `comment` varchar(254) NOT NULL default '',
+  `start_time` varchar(15) NOT NULL default '',
+  `end_time` varchar(15) NOT NULL default '',
+  `fixed` enum('0','1') NOT NULL default '0',
+  `duration` int(11) NOT NULL default '0',
+  `deleted` enum('0','1') NOT NULL default '0',
+  PRIMARY KEY  (`downtime_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `escalation`
+--
+
+CREATE TABLE `escalation` (
+  `esc_id` int(11) NOT NULL auto_increment,
+  `esc_name` varchar(255) default NULL,
+  `first_notification` int(11) default NULL,
+  `last_notification` int(11) default NULL,
+  `notification_interval` int(11) default NULL,
+  `escalation_period` int(11) default NULL,
+  `escalation_options1` varchar(255) default NULL,
+  `escalation_options2` varchar(255) default NULL,
+  `esc_comment` text,
+  PRIMARY KEY  (`esc_id`),
+  KEY `period_index` (`escalation_period`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `escalation_contactgroup_relation`
+--
+
+CREATE TABLE `escalation_contactgroup_relation` (
+  `ecgr_id` int(11) NOT NULL auto_increment,
+  `escalation_esc_id` int(11) default NULL,
+  `contactgroup_cg_id` int(11) default NULL,
+  PRIMARY KEY  (`ecgr_id`),
+  KEY `escalation_index` (`escalation_esc_id`),
+  KEY `cg_index` (`contactgroup_cg_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `escalation_host_relation`
+--
+
+CREATE TABLE `escalation_host_relation` (
+  `ehr_id` int(11) NOT NULL auto_increment,
+  `escalation_esc_id` int(11) default NULL,
+  `host_host_id` int(11) default NULL,
+  PRIMARY KEY  (`ehr_id`),
+  KEY `escalation_index` (`escalation_esc_id`),
+  KEY `host_index` (`host_host_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `escalation_hostgroup_relation`
+--
+
+CREATE TABLE `escalation_hostgroup_relation` (
+  `ehgr_id` int(11) NOT NULL auto_increment,
+  `escalation_esc_id` int(11) default NULL,
+  `hostgroup_hg_id` int(11) default NULL,
+  PRIMARY KEY  (`ehgr_id`),
+  KEY `escalation_index` (`escalation_esc_id`),
+  KEY `hg_index` (`hostgroup_hg_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `escalation_meta_service_relation`
+--
+
+CREATE TABLE `escalation_meta_service_relation` (
+  `emsr_id` int(11) NOT NULL auto_increment,
+  `escalation_esc_id` int(11) default NULL,
+  `meta_service_meta_id` int(11) default NULL,
+  PRIMARY KEY  (`emsr_id`),
+  KEY `escalation_index` (`escalation_esc_id`),
+  KEY `meta_service_index` (`meta_service_meta_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `escalation_service_relation`
+--
+
+CREATE TABLE `escalation_service_relation` (
+  `esr_id` int(11) NOT NULL auto_increment,
+  `escalation_esc_id` int(11) default NULL,
+  `service_service_id` int(11) default NULL,
+  PRIMARY KEY  (`esr_id`),
+  KEY `escalation_index` (`escalation_esc_id`),
+  KEY `service_index` (`service_service_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `extended_host_information`
+--
+
+CREATE TABLE `extended_host_information` (
+  `ehi_id` int(11) NOT NULL auto_increment,
+  `host_host_id` int(11) default NULL,
+  `ehi_notes` varchar(200) default NULL,
+  `ehi_notes_url` varchar(200) default NULL,
+  `ehi_action_url` varchar(200) default NULL,
+  `ehi_icon_image` varchar(200) default NULL,
+  `ehi_icon_image_alt` varchar(200) default NULL,
+  `ehi_vrml_image` varchar(200) default NULL,
+  `ehi_statusmap_image` varchar(200) default NULL,
+  `ehi_2d_coords` varchar(200) default NULL,
+  `ehi_3d_coords` varchar(200) default NULL,
+  `country_id` int(11) unsigned default NULL,
+  `city_id` int(11) unsigned default NULL,
+  PRIMARY KEY  (`ehi_id`),
+  KEY `host_index` (`host_host_id`),
+  KEY `country_index` (`country_id`),
+  KEY `city_index` (`city_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `extended_service_information`
+--
+
+CREATE TABLE `extended_service_information` (
+  `esi_id` int(11) NOT NULL auto_increment,
+  `service_service_id` int(11) default NULL,
+  `esi_notes` varchar(200) default NULL,
+  `esi_notes_url` varchar(200) default NULL,
+  `esi_action_url` varchar(200) default NULL,
+  `esi_icon_image` varchar(200) default NULL,
+  `esi_icon_image_alt` varchar(200) default NULL,
+  `graph_id` int(11) default NULL,
+  PRIMARY KEY  (`esi_id`),
+  KEY `service_index` (`service_service_id`),
+  KEY `graph_index` (`graph_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `general_opt`
+--
+
+CREATE TABLE `general_opt` (
+  `gopt_id` int(11) NOT NULL auto_increment,
+  `nagios_path` varchar(255) default NULL,
+  `nagios_path_bin` varchar(255) default NULL,
+  `nagios_path_img` varchar(255) default NULL,
+  `nagios_path_plugins` varchar(255) default NULL,
+  `nagios_version` enum('1','2','3') default NULL,
+  `snmp_community` varchar(255) default NULL,
+  `snmp_version` varchar(255) default NULL,
+  `snmp_trapd_path_daemon` varchar(255) default NULL,
+  `snmp_trapd_path_conf` varchar(255) default NULL,
+  `mailer_path_bin` varchar(255) default NULL,
+  `rrdtool_path_bin` varchar(255) default NULL,
+  `rrdtool_version` varchar(255) default NULL,
+  `oreon_path` varchar(255) default NULL,
+  `oreon_web_path` varchar(255) default NULL,
+  `oreon_rrdbase_path` varchar(255) default NULL,
+  `oreon_refresh` int(11) default NULL,
+  `color_up` varchar(50) default NULL,
+  `color_down` varchar(50) default NULL,
+  `color_unreachable` varchar(50) default NULL,
+  `color_ok` varchar(50) default NULL,
+  `color_warning` varchar(50) default NULL,
+  `color_critical` varchar(50) default NULL,
+  `color_pending` varchar(50) default NULL,
+  `color_unknown` varchar(50) default NULL,
+  `session_expire` int(11) default NULL,
+  `perfparse_installed` enum('0','1') default NULL,
+  `maxViewMonitoring` int(11) NOT NULL default '50',
+  `maxViewConfiguration` int(11) NOT NULL default '20',
+  `template` varchar(254) default 'Basic',
+  `ldap_host` varchar(254) default NULL,
+  `ldap_port` varchar(5) default '389',
+  `ldap_base_dn` varchar(254) default NULL,
+  `ldap_login_attrib` varchar(254) default 'dn',
+  `ldap_ssl` enum('0','1') default NULL,
+  `ldap_auth_enable` enum('0','1') default NULL,
+  PRIMARY KEY  (`gopt_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `giv_components`
+--
+
+CREATE TABLE `giv_components` (
+  `compo_id` int(11) NOT NULL auto_increment,
+  `ds_order` int(11) default NULL,
+  `graph_id` int(11) default NULL,
+  `compot_compo_id` int(11) default NULL,
+  `pp_metric_id` int(11) default NULL,
+  PRIMARY KEY  (`compo_id`),
+  KEY `graph_index` (`graph_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `giv_components_template`
+--
+
+CREATE TABLE `giv_components_template` (
+  `compo_id` int(11) NOT NULL auto_increment,
+  `name` varchar(255) default NULL,
+  `ds_order` int(11) default NULL,
+  `ds_name` varchar(200) default NULL,
+  `ds_legend` varchar(200) default NULL,
+  `ds_color_line` varchar(255) default NULL,
+  `ds_color_area` varchar(255) default NULL,
+  `ds_filled` enum('0','1') default NULL,
+  `ds_max` enum('0','1') default NULL,
+  `ds_min` enum('0','1') default NULL,
+  `ds_average` enum('0','1') default NULL,
+  `ds_last` enum('0','1') default NULL,
+  `ds_tickness` int(11) default NULL,
+  `ds_transparency` varchar(254) default NULL,
+  `ds_invert` enum('0','1') default NULL,
+  `default_tpl1` enum('0','1') default NULL,
+  `default_tpl2` enum('0','1') default NULL,
+  `comment` text,
+  PRIMARY KEY  (`compo_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `giv_graphT_componentT_relation`
+--
+
+CREATE TABLE `giv_graphT_componentT_relation` (
+  `ggcr_id` int(11) NOT NULL auto_increment,
+  `gg_graph_id` int(11) default NULL,
+  `gc_compo_id` int(11) default NULL,
+  PRIMARY KEY  (`ggcr_id`),
+  KEY `graph_index` (`gg_graph_id`),
+  KEY `compo_index` (`gc_compo_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `giv_graphs`
+--
+
+CREATE TABLE `giv_graphs` (
+  `graph_id` int(11) NOT NULL auto_increment,
+  `name` varchar(200) default NULL,
+  `grapht_graph_id` int(11) default NULL,
+  `comment` text,
+  PRIMARY KEY  (`graph_id`),
+  KEY `graph_template_index` (`grapht_graph_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `giv_graphs_template`
+--
+
+CREATE TABLE `giv_graphs_template` (
+  `graph_id` int(11) NOT NULL auto_increment,
+  `name` varchar(200) default NULL,
+  `title` varchar(50) default NULL,
+  `img_format` varchar(4) default NULL,
+  `vertical_label` varchar(200) default NULL,
+  `period` int(11) default NULL,
+  `step` int(11) default NULL,
+  `width` int(11) default NULL,
+  `height` int(11) default NULL,
+  `lower_limit` int(11) default NULL,
+  `upper_limit` int(11) default NULL,
+  `bg_grid_color` varchar(200) default NULL,
+  `bg_color` varchar(200) default NULL,
+  `police_color` varchar(200) default NULL,
+  `grid_main_color` varchar(200) default NULL,
+  `grid_sec_color` varchar(200) default NULL,
+  `contour_cub_color` varchar(200) default NULL,
+  `col_arrow` varchar(200) default NULL,
+  `col_top` varchar(200) default NULL,
+  `col_bot` varchar(200) default NULL,
+  `default_tpl1` enum('0','1') default NULL,
+  `default_tpl2` enum('0','1') default NULL,
+  `stacked` enum('0','1') default NULL,
+  `comment` text,
+  PRIMARY KEY  (`graph_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `host`
+--
+
+CREATE TABLE `host` (
+  `host_id` int(11) NOT NULL auto_increment,
+  `host_template_model_htm_id` int(11) default NULL,
+  `command_command_id` int(11) default NULL,
+  `timeperiod_tp_id` int(11) default NULL,
+  `timeperiod_tp_id2` int(11) default NULL,
+  `purge_policy_id` int(11) default NULL,
+  `command_command_id2` int(11) default NULL,
+  ` command_command_id_arg2` text,
+  `host_name` varchar(200) default NULL,
+  `host_alias` varchar(200) default NULL,
+  `host_address` varchar(255) default NULL,
+  `host_max_check_attempts` int(11) default NULL,
+  `host_check_interval` int(11) default NULL,
+  `host_active_checks_enabled` enum('0','1','2') default NULL,
+  `host_passive_checks_enabled` enum('0','1','2') default NULL,
+  `host_checks_enabled` enum('0','1','2') default NULL,
+  `host_obsess_over_host` enum('0','1','2') default NULL,
+  `host_check_freshness` enum('0','1','2') default NULL,
+  `host_freshness_threshold` int(11) default NULL,
+  `host_event_handler_enabled` enum('0','1','2') default NULL,
+  `host_low_flap_threshold` int(11) default NULL,
+  `host_high_flap_threshold` int(11) default NULL,
+  `host_flap_detection_enabled` enum('0','1','2') default NULL,
+  `host_process_perf_data` enum('0','1','2') default NULL,
+  `host_retain_status_information` enum('0','1','2') default NULL,
+  `host_retain_nonstatus_information` enum('0','1','2') default NULL,
+  `host_notification_interval` int(11) default NULL,
+  `host_notification_options` varchar(200) default NULL,
+  `host_notifications_enabled` enum('0','1','2') default NULL,
+  `host_stalking_options` varchar(200) default NULL,
+  `host_snmp_community` varchar(255) default NULL,
+  `host_snmp_version` varchar(255) default NULL,
+  `host_comment` text,
+  `host_register` enum('0','1') default NULL,
+  `host_activate` enum('0','1') default '1',
+  PRIMARY KEY  (`host_id`),
+  KEY `htm_index` (`host_template_model_htm_id`),
+  KEY `cmd1_index` (`command_command_id`),
+  KEY `cmd2_index` (`command_command_id2`),
+  KEY `tp1_index` (`timeperiod_tp_id`),
+  KEY `tp2_index` (`timeperiod_tp_id2`),
+  KEY `name_index` (`host_name`),
+  KEY `alias_index` (`host_alias`),
+  KEY `purge_index` (`purge_policy_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `host_hostparent_relation`
+--
+
+CREATE TABLE `host_hostparent_relation` (
+  `hhr_id` int(11) NOT NULL auto_increment,
+  `host_parent_hp_id` int(11) default NULL,
+  `host_host_id` int(11) default NULL,
+  PRIMARY KEY  (`hhr_id`),
+  KEY `host1_index` (`host_parent_hp_id`),
+  KEY `host2_index` (`host_host_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `host_service_relation`
+--
+
+CREATE TABLE `host_service_relation` (
+  `hsr_id` int(11) NOT NULL auto_increment,
+  `hostgroup_hg_id` int(11) default NULL,
+  `host_host_id` int(11) default NULL,
+  `servicegroup_sg_id` int(11) default NULL,
+  `service_service_id` int(11) default NULL,
+  PRIMARY KEY  (`hsr_id`),
+  KEY `hostgroup_index` (`hostgroup_hg_id`),
+  KEY `host_index` (`host_host_id`),
+  KEY `servicegroup_index` (`servicegroup_sg_id`),
+  KEY `service_index` (`service_service_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `hostgroup`
+--
+
+CREATE TABLE `hostgroup` (
+  `hg_id` int(11) NOT NULL auto_increment,
+  `hg_name` varchar(200) default NULL,
+  `hg_alias` varchar(200) default NULL,
+  `country_id` int(10) unsigned default NULL,
+  `city_id` int(10) unsigned default NULL,
+  `hg_comment` text,
+  `hg_activate` enum('0','1') NOT NULL default '1',
+  PRIMARY KEY  (`hg_id`),
+  KEY `name_index` (`hg_name`),
+  KEY `alias_index` (`hg_alias`),
+  KEY `country_index` (`country_id`),
+  KEY `city_index` (`city_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `hostgroup_relation`
+--
+
+CREATE TABLE `hostgroup_relation` (
+  `hgr_id` int(11) NOT NULL auto_increment,
+  `hostgroup_hg_id` int(11) default NULL,
+  `host_host_id` int(11) default NULL,
+  PRIMARY KEY  (`hgr_id`),
+  KEY `hostgroup_index` (`hostgroup_hg_id`),
+  KEY `host_index` (`host_host_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `inventory_index`
+--
+
+CREATE TABLE `inventory_index` (
+  `id` int(11) NOT NULL auto_increment,
+  `host_id` int(11) default NULL,
+  `name` varchar(254) default NULL,
+  `contact` varchar(254) default NULL,
+  `description` text,
+  `location` varchar(254) default NULL,
+  `manufacturer` varchar(254) default NULL,
+  `serial_number` varchar(254) default NULL,
+  `os` text,
+  `os_revision` varchar(254) default NULL,
+  `type_ressources` int(11) default NULL,
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `host_id` (`host_id`),
+  KEY `manufacturer_index` (`type_ressources`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `inventory_log`
+--
+
+CREATE TABLE `inventory_log` (
+  `id` int(11) NOT NULL auto_increment,
+  `host_id` int(11) default NULL,
+  `type` varchar(20) default NULL,
+  `replaced_value` text,
+  `value` text,
+  `ctime` int(11) default NULL,
+  PRIMARY KEY  (`id`),
+  KEY `host_id` (`host_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `inventory_mac_address`
+--
+
+CREATE TABLE `inventory_mac_address` (
+  `id` int(11) NOT NULL auto_increment,
+  `mac_address_begin` varchar(8) default NULL,
+  `manufacturer` int(11) default NULL,
+  PRIMARY KEY  (`id`),
+  KEY `manufacturer` (`manufacturer`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `inventory_manufacturer`
+--
+
+CREATE TABLE `inventory_manufacturer` (
+  `id` int(11) NOT NULL auto_increment,
+  `name` varchar(254) default NULL,
+  `alias` varchar(254) default NULL,
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `lca_define`
+--
+
+CREATE TABLE `lca_define` (
+  `lca_id` int(11) NOT NULL auto_increment,
+  `lca_name` varchar(255) default NULL,
+  `lca_comment` text,
+  `lca_hg_childs` enum('0','1') default NULL,
+  `lca_activate` enum('0','1') default NULL,
+  PRIMARY KEY  (`lca_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `lca_define_contactgroup_relation`
+--
+
+CREATE TABLE `lca_define_contactgroup_relation` (
+  `ldcgr_id` int(11) NOT NULL auto_increment,
+  `lca_define_lca_id` int(11) default NULL,
+  `contactgroup_cg_id` int(11) default NULL,
+  PRIMARY KEY  (`ldcgr_id`),
+  KEY `lca_index` (`lca_define_lca_id`),
+  KEY `cg_index` (`contactgroup_cg_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `lca_define_host_relation`
+--
+
+CREATE TABLE `lca_define_host_relation` (
+  `ldhr_id` int(11) NOT NULL auto_increment,
+  `lca_define_lca_id` int(11) default NULL,
+  `host_host_id` int(11) default NULL,
+  PRIMARY KEY  (`ldhr_id`),
+  KEY `lca_index` (`lca_define_lca_id`),
+  KEY `host_index` (`host_host_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `lca_define_hostgroup_relation`
+--
+
+CREATE TABLE `lca_define_hostgroup_relation` (
+  `ldhgr_id` int(11) NOT NULL auto_increment,
+  `lca_define_lca_id` int(11) default NULL,
+  `hostgroup_hg_id` int(11) default NULL,
+  PRIMARY KEY  (`ldhgr_id`),
+  KEY `lca_index` (`lca_define_lca_id`),
+  KEY `hg_index` (`hostgroup_hg_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `lca_define_servicegroup_relation`
+--
+
+CREATE TABLE `lca_define_servicegroup_relation` (
+  `ldsgr_id` int(11) NOT NULL auto_increment,
+  `lca_define_lca_id` int(11) default NULL,
+  `servicegroup_sg_id` int(11) default NULL,
+  PRIMARY KEY  (`ldsgr_id`),
+  KEY `lca_index` (`lca_define_lca_id`),
+  KEY `sg_index` (`servicegroup_sg_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `lca_define_topology_relation`
+--
+
+CREATE TABLE `lca_define_topology_relation` (
+  `ldtr_id` int(11) NOT NULL auto_increment,
+  `lca_define_lca_id` int(11) default NULL,
+  `topology_topology_id` int(11) default NULL,
+  PRIMARY KEY  (`ldtr_id`),
+  KEY `lca_index` (`lca_define_lca_id`),
+  KEY `topology_index` (`topology_topology_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `log_archive_file_name`
+--
+
+CREATE TABLE `log_archive_file_name` (
+  `id_log_file` int(11) NOT NULL auto_increment,
+  `file_name` varchar(200) default NULL,
+  `date` int(11) default NULL,
+  PRIMARY KEY  (`id_log_file`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `log_archive_host`
+--
+
+CREATE TABLE `log_archive_host` (
+  `log_id` int(11) NOT NULL auto_increment,
+  `host_id` int(11) default NULL,
+  `UPTimeScheduled` int(11) default NULL,
+  `UPTimeUnScheduled` int(11) default NULL,
+  `DOWNTimeScheduled` int(11) default NULL,
+  `DOWNTimeUnScheduled` int(11) default NULL,
+  `UNREACHABLETimeScheduled` int(11) default NULL,
+  `UNREACHABLETimeUnScheduled` int(11) default NULL,
+  `UNDETERMINATETimeScheduled` int(11) default NULL,
+  `UNDETERMINATETimeUnScheduled` int(11) default NULL,
+  `date_end` int(11) default NULL,
+  `date_start` int(11) default NULL,
+  PRIMARY KEY  (`log_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `log_archive_service`
+--
+
+CREATE TABLE `log_archive_service` (
+  `log_id` int(11) NOT NULL auto_increment,
+  `host_id` int(11) NOT NULL default '0',
+  `service_id` int(11) NOT NULL default '0',
+  `OKTimeScheduled` int(11) NOT NULL default '0',
+  `OKTimeUnScheduled` int(11) NOT NULL default '0',
+  `WARNINGTimeScheduled` int(11) NOT NULL default '0',
+  `WARNINGTimeUnScheduled` int(11) NOT NULL default '0',
+  `UNKNOWNTimeScheduled` int(11) NOT NULL default '0',
+  `UNKNOWNTimeUnScheduled` int(11) NOT NULL default '0',
+  `CRITICALTimeScheduled` int(11) NOT NULL default '0',
+  `CRITICALTimeUnScheduled` int(11) NOT NULL default '0',
+  `UNDETERMINATETimeScheduled` int(11) NOT NULL default '0',
+  `UNDETERMINATETimeUnScheduled` int(11) NOT NULL default '0',
+  `date_start` int(11) default NULL,
+  `date_end` int(11) default NULL,
+  PRIMARY KEY  (`log_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `meta_contactgroup_relation`
+--
+
+CREATE TABLE `meta_contactgroup_relation` (
+  `mcr_id` int(11) NOT NULL auto_increment,
+  `meta_id` int(11) default NULL,
+  `cg_cg_id` int(11) default NULL,
+  PRIMARY KEY  (`mcr_id`),
+  KEY `meta_index` (`meta_id`),
+  KEY `cg_index` (`cg_cg_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `meta_service`
+--
+
+CREATE TABLE `meta_service` (
+  `meta_id` int(11) NOT NULL auto_increment,
+  `meta_name` varchar(254) default NULL,
+  `check_period` int(11) default NULL,
+  `max_check_attempts` int(11) default NULL,
+  `normal_check_interval` int(11) default NULL,
+  `retry_check_interval` int(11) default NULL,
+  `notification_interval` int(11) default NULL,
+  `notification_period` int(11) default NULL,
+  `notification_options` varchar(255) default NULL,
+  `notifications_enabled` enum('0','1','2') default NULL,
+  `calcul_type` enum('SOM','AVE','MIN','MAX') default NULL,
+  `meta_select_mode` enum('1','2') default '1',
+  `regexp_str` varchar(254) default NULL,
+  `metric` varchar(255) default NULL,
+  `warning` varchar(254) default NULL,
+  `critical` varchar(254) default NULL,
+  `meta_comment` text,
+  `meta_activate` enum('0','1') default NULL,
+  PRIMARY KEY  (`meta_id`),
+  KEY `name_index` (`meta_name`),
+  KEY `check_period_index` (`check_period`),
+  KEY `notification_period_index` (`notification_period`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `meta_service_relation`
+--
+
+CREATE TABLE `meta_service_relation` (
+  `msr_id` int(11) NOT NULL auto_increment,
+  `meta_id` int(11) default NULL,
+  `host_id` int(11) default NULL,
+  `metric_id` int(11) default NULL,
+  `msr_comment` text,
+  `activate` enum('0','1') default NULL,
+  PRIMARY KEY  (`msr_id`),
+  KEY `meta_index` (`meta_id`),
+  KEY `metric_index` (`metric_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `nagios_macro`
+--
+
+CREATE TABLE `nagios_macro` (
+  `macro_id` int(11) NOT NULL auto_increment,
+  `macro_name` varchar(255) default NULL,
+  PRIMARY KEY  (`macro_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `nagios_server`
+--
+
+CREATE TABLE `nagios_server` (
+  `id` int(11) NOT NULL auto_increment,
+  `name` varchar(40) default NULL,
+  `last_restart` int(11) default NULL,
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `osl`
+--
+
+CREATE TABLE `osl` (
+  `osl_id` int(11) NOT NULL auto_increment,
+  `name` varchar(254) default NULL,
+  `description` varchar(254) default NULL,
+  `level_w` int(11) default NULL,
+  `level_c` int(11) default NULL,
+  `id_notification_period` int(11) default NULL,
+  `id_check_period` int(11) default NULL,
+  `notification_interval` int(11) default NULL,
+  `notification_options` varchar(255) default NULL,
+  `notifications_enabled` enum('0','1','2') default NULL,
+  `max_check_attempts` int(11) default NULL,
+  `normal_check_interval` int(11) default NULL,
+  `retry_check_interval` int(11) default NULL,
+  `current_level` float default NULL,
+  `calculate` enum('0','1') NOT NULL default '0',
+  `downtime` enum('0','100') NOT NULL default '0',
+  `displayed` enum('1','0') NOT NULL default '1',
+  `dependency_dep_id` int(11) default NULL,
+  `osl_activate` enum('1','0') default NULL,
+  `osl_comment` text,
+  PRIMARY KEY  (`osl_id`),
+  KEY `name_index` (`name`),
+  KEY `description_index` (`description`),
+  KEY `calculate_index` (`calculate`),
+  KEY `currentlevel_index` (`current_level`),
+  KEY `levelw_index` (`level_w`),
+  KEY `levelc_index` (`level_c`),
+  KEY `id_notification_period` (`id_notification_period`),
+  KEY `id_check_period` (`id_check_period`),
+  KEY `dependency_index` (`dependency_dep_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `osl_contactgroup_relation`
+--
+
+CREATE TABLE `osl_contactgroup_relation` (
+  `ocgr_id` int(11) NOT NULL auto_increment,
+  `id_osl` int(11) default NULL,
+  `id_contactgroup` int(11) default NULL,
+  PRIMARY KEY  (`ocgr_id`),
+  KEY `osl_index` (`id_osl`),
+  KEY `contactgroup_index` (`id_contactgroup`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `osl_escalation_relation`
+--
+
+CREATE TABLE `osl_escalation_relation` (
+  `oer_id` int(11) NOT NULL auto_increment,
+  `escalation_esc_id` int(11) default NULL,
+  `osl_id` int(11) default NULL,
+  PRIMARY KEY  (`oer_id`),
+  KEY `escalation_index` (`escalation_esc_id`),
+  KEY `osl_index` (`osl_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `osl_escalations`
+--
+
+CREATE TABLE `osl_escalations` (
+  `osl_e_id` int(11) NOT NULL auto_increment,
+  `timeperiod_id` int(11) default NULL,
+  `se_first_notification` int(11) default NULL,
+  `se_last_notification` int(11) default NULL,
+  `se_notification_intervale` int(11) default NULL,
+  `se_escalation_options` varchar(255) default NULL,
+  `osl_id` int(11) default NULL,
+  PRIMARY KEY  (`osl_e_id`),
+  KEY `osl_id` (`osl_id`),
+  KEY `tp_id` (`timeperiod_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `osl_indicator`
+--
+
+CREATE TABLE `osl_indicator` (
+  `indicator_id` int(11) NOT NULL auto_increment,
+  `block` enum('0','1') NOT NULL default '0',
+  `weight` int(11) default NULL,
+  `host_id` int(11) default NULL,
+  `service_id` int(11) default NULL,
+  `id_indicator_osl` int(11) default NULL,
+  `id_osl` int(11) default NULL,
+  `use_osl_value` enum('0','1') NOT NULL default '0',
+  `meta_id` int(11) default NULL,
+  `comment` text,
+  `activate` enum('0','1') default '1',
+  PRIMARY KEY  (`indicator_id`),
+  KEY `osl_index` (`id_osl`),
+  KEY `oslindicator_index` (`id_indicator_osl`),
+  KEY `host_id` (`host_id`),
+  KEY `svc_id` (`service_id`),
+  KEY `ms_index` (`meta_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `purge_policy`
+--
+
+CREATE TABLE `purge_policy` (
+  `purge_policy_id` int(11) NOT NULL auto_increment,
+  `purge_policy_name` varchar(255) default NULL,
+  `purge_policy_alias` varchar(255) default NULL,
+  `purge_policy_retention` int(11) default NULL,
+  `purge_policy_raw` enum('0','1') default '0',
+  `purge_policy_bin` enum('0','1') default '0',
+  `purge_policy_metric` enum('0','1') default '0',
+  `purge_policy_service` enum('0','1') default '0',
+  `purge_policy_host` enum('0','1') default '0',
+  `purge_policy_comment` text,
+  PRIMARY KEY  (`purge_policy_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `reporting_diff_email`
+--
+
+CREATE TABLE `reporting_diff_email` (
+  `rtde_id` int(11) NOT NULL auto_increment,
+  `email` varchar(255) default NULL,
+  `format` enum('1','2') default '2',
+  `comment` text,
+  `activate` enum('0','1') default NULL,
+  PRIMARY KEY  (`rtde_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `reporting_diff_list`
+--
+
+CREATE TABLE `reporting_diff_list` (
+  `rtdl_id` int(11) NOT NULL auto_increment,
+  `name` varchar(255) default NULL,
+  `description` varchar(255) default NULL,
+  `tp_id` int(11) default NULL,
+  `activate` enum('0','1') default NULL,
+  `comment` text,
+  PRIMARY KEY  (`rtdl_id`),
+  KEY `timeperiod_index` (`tp_id`),
+  KEY `name_index` (`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `reporting_email_list_relation`
+--
+
+CREATE TABLE `reporting_email_list_relation` (
+  `rtelr_id` int(11) NOT NULL auto_increment,
+  `rtdl_id` int(11) default NULL,
+  `rtde_id` int(11) default NULL,
+  `oreon_contact` enum('0','1') default '0',
+  PRIMARY KEY  (`rtelr_id`),
+  KEY `list_index` (`rtdl_id`),
+  KEY `email_index` (`rtde_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `service`
+--
+
+CREATE TABLE `service` (
+  `service_id` int(11) NOT NULL auto_increment,
+  `service_template_model_stm_id` int(11) default NULL,
+  `command_command_id` int(11) default NULL,
+  `timeperiod_tp_id` int(11) default NULL,
+  `command_command_id2` int(11) default NULL,
+  `timeperiod_tp_id2` int(11) default NULL,
+  `purge_policy_id` int(11) default NULL,
+  `service_description` varchar(200) default NULL,
+  `service_is_volatile` enum('0','1','2') default '2',
+  `service_max_check_attempts` int(11) default NULL,
+  `service_normal_check_interval` int(11) default NULL,
+  `service_retry_check_interval` int(11) default NULL,
+  `service_active_checks_enabled` enum('0','1','2') default '2',
+  `service_passive_checks_enabled` enum('0','1','2') default '2',
+  `service_parallelize_check` enum('0','1','2') default '2',
+  `service_obsess_over_service` enum('0','1','2') default '2',
+  `service_check_freshness` enum('0','1','2') default '2',
+  `service_freshness_threshold` int(11) default NULL,
+  `service_event_handler_enabled` enum('0','1','2') default '2',
+  `service_low_flap_threshold` int(11) default NULL,
+  `service_high_flap_threshold` int(11) default NULL,
+  `service_flap_detection_enabled` enum('0','1','2') default '2',
+  `service_process_perf_data` enum('0','1','2') default '2',
+  `service_retain_status_information` enum('0','1','2') default '2',
+  `service_retain_nonstatus_information` enum('0','1','2') default '2',
+  `service_notification_interval` int(11) default NULL,
+  `service_notification_options` varchar(200) default NULL,
+  `service_notifications_enabled` enum('0','1','2') default '2',
+  `service_stalking_options` varchar(200) default NULL,
+  `service_comment` text,
+  `command_command_id_arg` text,
+  `command_command_id_arg2` text,
+  `service_register` enum('0','1') NOT NULL default '0',
+  `service_activate` enum('0','1') NOT NULL default '1',
+  PRIMARY KEY  (`service_id`),
+  KEY `stm_index` (`service_template_model_stm_id`),
+  KEY `cmd1_index` (`command_command_id`),
+  KEY `cmd2_index` (`command_command_id2`),
+  KEY `tp1_index` (`timeperiod_tp_id`),
+  KEY `tp2_index` (`timeperiod_tp_id2`),
+  KEY `description_index` (`service_description`),
+  KEY `purge_index` (`purge_policy_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `servicegroup`
+--
+
+CREATE TABLE `servicegroup` (
+  `sg_id` int(11) NOT NULL auto_increment,
+  `sg_name` varchar(200) default NULL,
+  `sg_alias` varchar(200) default NULL,
+  `country_id` int(10) unsigned default NULL,
+  `city_id` int(10) unsigned default NULL,
+  `sg_comment` text,
+  `sg_activate` enum('0','1') NOT NULL default '1',
+  PRIMARY KEY  (`sg_id`),
+  KEY `name_index` (`sg_name`),
+  KEY `alias_index` (`sg_alias`),
+  KEY `country_index` (`country_id`),
+  KEY `city_index` (`city_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `servicegroup_relation`
+--
+
+CREATE TABLE `servicegroup_relation` (
+  `sgr_id` int(11) NOT NULL auto_increment,
+  `service_service_id` int(11) default NULL,
+  `servicegroup_sg_id` int(11) default NULL,
+  PRIMARY KEY  (`sgr_id`),
+  KEY `service_index` (`service_service_id`),
+  KEY `servicegroup_index` (`servicegroup_sg_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `session`
+--
+
+CREATE TABLE `session` (
+  `id` int(11) NOT NULL auto_increment,
+  `session_id` varchar(40) default NULL,
+  `user_id` int(11) default NULL,
+  `current_page` int(11) default NULL,
+  `last_reload` int(11) default NULL,
+  `ip_address` varchar(16) default NULL,
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `timeperiod`
+--
+
+CREATE TABLE `timeperiod` (
+  `tp_id` int(11) NOT NULL auto_increment,
+  `tp_name` varchar(200) default NULL,
+  `tp_alias` varchar(200) default NULL,
+  `tp_sunday` varchar(200) default NULL,
+  `tp_monday` varchar(200) default NULL,
+  `tp_tuesday` varchar(200) default NULL,
+  `tp_wednesday` varchar(200) default NULL,
+  `tp_thursday` varchar(200) default NULL,
+  `tp_friday` varchar(200) default NULL,
+  `tp_saturday` varchar(200) default NULL,
+  PRIMARY KEY  (`tp_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `topology`
+--
+
+CREATE TABLE `topology` (
+  `topology_id` int(11) NOT NULL auto_increment,
+  `topology_name` varchar(255) default NULL,
+  `topology_icone` varchar(255) default NULL,
+  `topology_parent` int(11) default NULL,
+  `topology_page` int(11) default NULL,
+  `topology_order` int(11) default NULL,
+  `topology_group` int(11) default NULL,
+  `topology_url` varchar(255) default NULL,
+  `topology_url_opt` varchar(255) default NULL,
+  `topology_popup` enum('0','1') default NULL,
+  `topology_modules` enum('0','1') default NULL,
+  `topology_show` enum('0','1') default '1',
+  PRIMARY KEY  (`topology_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `traps`
+--
+
+CREATE TABLE `traps` (
+  `traps_id` int(11) NOT NULL auto_increment,
+  `traps_name` varchar(255) default NULL,
+  `traps_oid` varchar(255) default NULL,
+  `traps_handler` varchar(255) default NULL,
+  `traps_args` varchar(255) default NULL,
+  `traps_comments` varchar(255) default NULL,
+  UNIQUE KEY `traps_name` (`traps_name`),
+  KEY `traps_id` (`traps_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `traps_service_relation`
+--
+
+CREATE TABLE `traps_service_relation` (
+  `tsr_id` int(11) NOT NULL auto_increment,
+  `traps_id` int(11) default NULL,
+  `service_id` int(11) default NULL,
+  PRIMARY KEY  (`tsr_id`),
+  KEY `service_index` (`service_id`),
+  KEY `traps_index` (`traps_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `view_city`
+--
+
+CREATE TABLE `view_city` (
+  `city_id` int(10) unsigned NOT NULL auto_increment,
+  `country_id` int(11) unsigned default NULL,
+  `city_name` varchar(255) default NULL,
+  `city_zipcode` smallint(6) default NULL,
+  `city_lat` varchar(255) default NULL,
+  `city_long` varchar(255) default NULL,
+  `city_date` int(11) default NULL,
+  PRIMARY KEY  (`city_id`),
+  KEY `name_index` (`city_name`),
+  KEY `country_index` (`country_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `view_country`
+--
+
+CREATE TABLE `view_country` (
+  `country_id` int(10) unsigned NOT NULL auto_increment,
+  `country_name` varchar(255) default NULL,
+  `country_alias` varchar(255) default NULL,
+  PRIMARY KEY  (`country_id`),
+  KEY `name_index` (`country_name`),
+  KEY `alias_index` (`country_alias`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `view_map`
+--
+
+CREATE TABLE `view_map` (
+  `map_id` int(11) NOT NULL auto_increment,
+  `map_name` varchar(255) default NULL,
+  `map_description` varchar(255) default NULL,
+  `map_path` varchar(255) default NULL,
+  `map_comment` text,
+  PRIMARY KEY  (`map_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+--
+-- Contraintes pour les tables exportées
+--
+
+--
+-- Contraintes pour la table `cfg_nagios`
+--
+ALTER TABLE `cfg_nagios`
+  ADD CONSTRAINT `cfg_nagios_ibfk_1` FOREIGN KEY (`global_host_event_handler`) REFERENCES `command` (`command_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `cfg_nagios_ibfk_2` FOREIGN KEY (`global_service_event_handler`) REFERENCES `command` (`command_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `cfg_nagios_ibfk_3` FOREIGN KEY (`ocsp_command`) REFERENCES `command` (`command_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `cfg_nagios_ibfk_4` FOREIGN KEY (`ochp_command`) REFERENCES `command` (`command_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `cfg_nagios_ibfk_5` FOREIGN KEY (`host_perfdata_command`) REFERENCES `command` (`command_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `cfg_nagios_ibfk_6` FOREIGN KEY (`service_perfdata_command`) REFERENCES `command` (`command_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `cfg_nagios_ibfk_7` FOREIGN KEY (`service_perfdata_command`) REFERENCES `command` (`command_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `cfg_nagios_ibfk_8` FOREIGN KEY (`host_perfdata_file_processing_command`) REFERENCES `command` (`command_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `cfg_nagios_ibfk_9` FOREIGN KEY (`service_perfdata_file_processing_command`) REFERENCES `command` (`command_id`) ON DELETE SET NULL;
+
+--
+-- Contraintes pour la table `contact`
+--
+ALTER TABLE `contact`
+  ADD CONSTRAINT `contact_ibfk_1` FOREIGN KEY (`timeperiod_tp_id`) REFERENCES `timeperiod` (`tp_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `contact_ibfk_2` FOREIGN KEY (`timeperiod_tp_id2`) REFERENCES `timeperiod` (`tp_id`) ON DELETE SET NULL;
+
+--
+-- Contraintes pour la table `contact_hostcommands_relation`
+--
+ALTER TABLE `contact_hostcommands_relation`
+  ADD CONSTRAINT `contact_hostcommands_relation_ibfk_1` FOREIGN KEY (`contact_contact_id`) REFERENCES `contact` (`contact_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `contact_hostcommands_relation_ibfk_2` FOREIGN KEY (`command_command_id`) REFERENCES `command` (`command_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `contact_servicecommands_relation`
+--
+ALTER TABLE `contact_servicecommands_relation`
+  ADD CONSTRAINT `contact_servicecommands_relation_ibfk_1` FOREIGN KEY (`contact_contact_id`) REFERENCES `contact` (`contact_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `contact_servicecommands_relation_ibfk_2` FOREIGN KEY (`command_command_id`) REFERENCES `command` (`command_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `contactgroup_contact_relation`
+--
+ALTER TABLE `contactgroup_contact_relation`
+  ADD CONSTRAINT `contactgroup_contact_relation_ibfk_1` FOREIGN KEY (`contact_contact_id`) REFERENCES `contact` (`contact_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `contactgroup_contact_relation_ibfk_2` FOREIGN KEY (`contactgroup_cg_id`) REFERENCES `contactgroup` (`cg_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `contactgroup_host_relation`
+--
+ALTER TABLE `contactgroup_host_relation`
+  ADD CONSTRAINT `contactgroup_host_relation_ibfk_1` FOREIGN KEY (`host_host_id`) REFERENCES `host` (`host_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `contactgroup_host_relation_ibfk_2` FOREIGN KEY (`contactgroup_cg_id`) REFERENCES `contactgroup` (`cg_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `contactgroup_hostgroup_relation`
+--
+ALTER TABLE `contactgroup_hostgroup_relation`
+  ADD CONSTRAINT `contactgroup_hostgroup_relation_ibfk_1` FOREIGN KEY (`contactgroup_cg_id`) REFERENCES `contactgroup` (`cg_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `contactgroup_hostgroup_relation_ibfk_2` FOREIGN KEY (`hostgroup_hg_id`) REFERENCES `hostgroup` (`hg_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `contactgroup_service_relation`
+--
+ALTER TABLE `contactgroup_service_relation`
+  ADD CONSTRAINT `contactgroup_service_relation_ibfk_1` FOREIGN KEY (`contactgroup_cg_id`) REFERENCES `contactgroup` (`cg_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `contactgroup_service_relation_ibfk_2` FOREIGN KEY (`service_service_id`) REFERENCES `service` (`service_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `contactgroup_servicegroup_relation`
+--
+ALTER TABLE `contactgroup_servicegroup_relation`
+  ADD CONSTRAINT `contactgroup_servicegroup_relation_ibfk_1` FOREIGN KEY (`contactgroup_cg_id`) REFERENCES `contactgroup` (`cg_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `contactgroup_servicegroup_relation_ibfk_2` FOREIGN KEY (`servicegroup_sg_id`) REFERENCES `servicegroup` (`sg_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `dependency_hostChild_relation`
+--
+ALTER TABLE `dependency_hostChild_relation`
+  ADD CONSTRAINT `dependency_hostChild_relation_ibfk_1` FOREIGN KEY (`dependency_dep_id`) REFERENCES `dependency` (`dep_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `dependency_hostChild_relation_ibfk_2` FOREIGN KEY (`host_host_id`) REFERENCES `host` (`host_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `dependency_hostParent_relation`
+--
+ALTER TABLE `dependency_hostParent_relation`
+  ADD CONSTRAINT `dependency_hostParent_relation_ibfk_1` FOREIGN KEY (`dependency_dep_id`) REFERENCES `dependency` (`dep_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `dependency_hostParent_relation_ibfk_2` FOREIGN KEY (`host_host_id`) REFERENCES `host` (`host_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `dependency_hostgroupChild_relation`
+--
+ALTER TABLE `dependency_hostgroupChild_relation`
+  ADD CONSTRAINT `dependency_hostgroupChild_relation_ibfk_1` FOREIGN KEY (`dependency_dep_id`) REFERENCES `dependency` (`dep_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `dependency_hostgroupChild_relation_ibfk_2` FOREIGN KEY (`hostgroup_hg_id`) REFERENCES `hostgroup` (`hg_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `dependency_hostgroupParent_relation`
+--
+ALTER TABLE `dependency_hostgroupParent_relation`
+  ADD CONSTRAINT `dependency_hostgroupParent_relation_ibfk_1` FOREIGN KEY (`dependency_dep_id`) REFERENCES `dependency` (`dep_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `dependency_hostgroupParent_relation_ibfk_2` FOREIGN KEY (`hostgroup_hg_id`) REFERENCES `hostgroup` (`hg_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `dependency_metaserviceChild_relation`
+--
+ALTER TABLE `dependency_metaserviceChild_relation`
+  ADD CONSTRAINT `dependency_metaserviceChild_relation_ibfk_1` FOREIGN KEY (`dependency_dep_id`) REFERENCES `dependency` (`dep_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `dependency_metaserviceChild_relation_ibfk_2` FOREIGN KEY (`meta_service_meta_id`) REFERENCES `meta_service` (`meta_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `dependency_metaserviceParent_relation`
+--
+ALTER TABLE `dependency_metaserviceParent_relation`
+  ADD CONSTRAINT `dependency_metaserviceParent_relation_ibfk_1` FOREIGN KEY (`dependency_dep_id`) REFERENCES `dependency` (`dep_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `dependency_metaserviceParent_relation_ibfk_2` FOREIGN KEY (`meta_service_meta_id`) REFERENCES `meta_service` (`meta_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `dependency_oslChild_relation`
+--
+ALTER TABLE `dependency_oslChild_relation`
+  ADD CONSTRAINT `dependency_oslChild_relation_ibfk_1` FOREIGN KEY (`dependency_dep_id`) REFERENCES `dependency` (`dep_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `dependency_oslChild_relation_ibfk_2` FOREIGN KEY (`osl_osl_id`) REFERENCES `osl` (`osl_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `dependency_oslParent_relation`
+--
+ALTER TABLE `dependency_oslParent_relation`
+  ADD CONSTRAINT `dependency_oslParent_relation_ibfk_1` FOREIGN KEY (`dependency_dep_id`) REFERENCES `dependency` (`dep_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `dependency_oslParent_relation_ibfk_2` FOREIGN KEY (`osl_osl_id`) REFERENCES `osl` (`osl_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `dependency_serviceChild_relation`
+--
+ALTER TABLE `dependency_serviceChild_relation`
+  ADD CONSTRAINT `dependency_serviceChild_relation_ibfk_1` FOREIGN KEY (`dependency_dep_id`) REFERENCES `dependency` (`dep_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `dependency_serviceChild_relation_ibfk_2` FOREIGN KEY (`service_service_id`) REFERENCES `service` (`service_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `dependency_serviceParent_relation`
+--
+ALTER TABLE `dependency_serviceParent_relation`
+  ADD CONSTRAINT `dependency_serviceParent_relation_ibfk_1` FOREIGN KEY (`dependency_dep_id`) REFERENCES `dependency` (`dep_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `dependency_serviceParent_relation_ibfk_2` FOREIGN KEY (`service_service_id`) REFERENCES `service` (`service_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `dependency_servicegroupChild_relation`
+--
+ALTER TABLE `dependency_servicegroupChild_relation`
+  ADD CONSTRAINT `dependency_servicegroupChild_relation_ibfk_1` FOREIGN KEY (`dependency_dep_id`) REFERENCES `dependency` (`dep_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `dependency_servicegroupChild_relation_ibfk_2` FOREIGN KEY (`servicegroup_sg_id`) REFERENCES `servicegroup` (`sg_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `dependency_servicegroupParent_relation`
+--
+ALTER TABLE `dependency_servicegroupParent_relation`
+  ADD CONSTRAINT `dependency_servicegroupParent_relation_ibfk_1` FOREIGN KEY (`dependency_dep_id`) REFERENCES `dependency` (`dep_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `dependency_servicegroupParent_relation_ibfk_2` FOREIGN KEY (`servicegroup_sg_id`) REFERENCES `servicegroup` (`sg_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `escalation`
+--
+ALTER TABLE `escalation`
+  ADD CONSTRAINT `escalation_ibfk_1` FOREIGN KEY (`escalation_period`) REFERENCES `timeperiod` (`tp_id`) ON DELETE SET NULL;
+
+--
+-- Contraintes pour la table `escalation_contactgroup_relation`
+--
+ALTER TABLE `escalation_contactgroup_relation`
+  ADD CONSTRAINT `escalation_contactgroup_relation_ibfk_1` FOREIGN KEY (`escalation_esc_id`) REFERENCES `escalation` (`esc_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `escalation_contactgroup_relation_ibfk_2` FOREIGN KEY (`contactgroup_cg_id`) REFERENCES `contactgroup` (`cg_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `escalation_host_relation`
+--
+ALTER TABLE `escalation_host_relation`
+  ADD CONSTRAINT `escalation_host_relation_ibfk_1` FOREIGN KEY (`escalation_esc_id`) REFERENCES `escalation` (`esc_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `escalation_host_relation_ibfk_2` FOREIGN KEY (`host_host_id`) REFERENCES `host` (`host_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `escalation_hostgroup_relation`
+--
+ALTER TABLE `escalation_hostgroup_relation`
+  ADD CONSTRAINT `escalation_hostgroup_relation_ibfk_1` FOREIGN KEY (`escalation_esc_id`) REFERENCES `escalation` (`esc_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `escalation_hostgroup_relation_ibfk_2` FOREIGN KEY (`hostgroup_hg_id`) REFERENCES `hostgroup` (`hg_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `escalation_meta_service_relation`
+--
+ALTER TABLE `escalation_meta_service_relation`
+  ADD CONSTRAINT `escalation_meta_service_relation_ibfk_1` FOREIGN KEY (`escalation_esc_id`) REFERENCES `escalation` (`esc_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `escalation_meta_service_relation_ibfk_2` FOREIGN KEY (`meta_service_meta_id`) REFERENCES `meta_service` (`meta_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `escalation_service_relation`
+--
+ALTER TABLE `escalation_service_relation`
+  ADD CONSTRAINT `escalation_service_relation_ibfk_1` FOREIGN KEY (`escalation_esc_id`) REFERENCES `escalation` (`esc_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `escalation_service_relation_ibfk_2` FOREIGN KEY (`service_service_id`) REFERENCES `service` (`service_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `extended_host_information`
+--
+ALTER TABLE `extended_host_information`
+  ADD CONSTRAINT `extended_host_information_ibfk_1` FOREIGN KEY (`host_host_id`) REFERENCES `host` (`host_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `extended_host_information_ibfk_2` FOREIGN KEY (`country_id`) REFERENCES `view_country` (`country_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `extended_host_information_ibfk_3` FOREIGN KEY (`city_id`) REFERENCES `view_city` (`city_id`) ON DELETE SET NULL;
+
+--
+-- Contraintes pour la table `extended_service_information`
+--
+ALTER TABLE `extended_service_information`
+  ADD CONSTRAINT `extended_service_information_ibfk_1` FOREIGN KEY (`graph_id`) REFERENCES `giv_graphs_template` (`graph_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `extended_service_information_ibfk_2` FOREIGN KEY (`service_service_id`) REFERENCES `service` (`service_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `giv_components`
+--
+ALTER TABLE `giv_components`
+  ADD CONSTRAINT `giv_components_ibfk_1` FOREIGN KEY (`graph_id`) REFERENCES `giv_graphs` (`graph_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `giv_graphT_componentT_relation`
+--
+ALTER TABLE `giv_graphT_componentT_relation`
+  ADD CONSTRAINT `giv_graphT_componentT_relation_ibfk_1` FOREIGN KEY (`gg_graph_id`) REFERENCES `giv_graphs_template` (`graph_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `giv_graphT_componentT_relation_ibfk_2` FOREIGN KEY (`gc_compo_id`) REFERENCES `giv_components_template` (`compo_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `giv_graphs`
+--
+ALTER TABLE `giv_graphs`
+  ADD CONSTRAINT `giv_graphs_ibfk_1` FOREIGN KEY (`grapht_graph_id`) REFERENCES `giv_graphs_template` (`graph_id`) ON DELETE SET NULL;
+
+--
+-- Contraintes pour la table `host`
+--
+ALTER TABLE `host`
+  ADD CONSTRAINT `host_ibfk_1` FOREIGN KEY (`command_command_id`) REFERENCES `command` (`command_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `host_ibfk_2` FOREIGN KEY (`command_command_id2`) REFERENCES `command` (`command_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `host_ibfk_3` FOREIGN KEY (`timeperiod_tp_id`) REFERENCES `timeperiod` (`tp_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `host_ibfk_4` FOREIGN KEY (`timeperiod_tp_id2`) REFERENCES `timeperiod` (`tp_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `host_ibfk_5` FOREIGN KEY (`purge_policy_id`) REFERENCES `purge_policy` (`purge_policy_id`) ON DELETE SET NULL;
+
+--
+-- Contraintes pour la table `host_hostparent_relation`
+--
+ALTER TABLE `host_hostparent_relation`
+  ADD CONSTRAINT `host_hostparent_relation_ibfk_1` FOREIGN KEY (`host_parent_hp_id`) REFERENCES `host` (`host_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `host_hostparent_relation_ibfk_2` FOREIGN KEY (`host_host_id`) REFERENCES `host` (`host_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `host_service_relation`
+--
+ALTER TABLE `host_service_relation`
+  ADD CONSTRAINT `host_service_relation_ibfk_1` FOREIGN KEY (`hostgroup_hg_id`) REFERENCES `hostgroup` (`hg_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `host_service_relation_ibfk_2` FOREIGN KEY (`host_host_id`) REFERENCES `host` (`host_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `host_service_relation_ibfk_3` FOREIGN KEY (`servicegroup_sg_id`) REFERENCES `servicegroup` (`sg_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `host_service_relation_ibfk_4` FOREIGN KEY (`service_service_id`) REFERENCES `service` (`service_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `hostgroup`
+--
+ALTER TABLE `hostgroup`
+  ADD CONSTRAINT `hostgroup_ibfk_1` FOREIGN KEY (`country_id`) REFERENCES `view_country` (`country_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `hostgroup_ibfk_2` FOREIGN KEY (`city_id`) REFERENCES `view_city` (`city_id`) ON DELETE SET NULL;
+
+--
+-- Contraintes pour la table `hostgroup_relation`
+--
+ALTER TABLE `hostgroup_relation`
+  ADD CONSTRAINT `hostgroup_relation_ibfk_1` FOREIGN KEY (`hostgroup_hg_id`) REFERENCES `hostgroup` (`hg_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `hostgroup_relation_ibfk_2` FOREIGN KEY (`host_host_id`) REFERENCES `host` (`host_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `inventory_index`
+--
+ALTER TABLE `inventory_index`
+  ADD CONSTRAINT `inventory_index_ibfk_1` FOREIGN KEY (`host_id`) REFERENCES `host` (`host_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `inventory_index_ibfk_2` FOREIGN KEY (`type_ressources`) REFERENCES `inventory_manufacturer` (`id`) ON DELETE SET NULL;
+
+--
+-- Contraintes pour la table `inventory_log`
+--
+ALTER TABLE `inventory_log`
+  ADD CONSTRAINT `inventory_log_ibfk_1` FOREIGN KEY (`host_id`) REFERENCES `host` (`host_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `inventory_mac_address`
+--
+ALTER TABLE `inventory_mac_address`
+  ADD CONSTRAINT `inventory_mac_address_ibfk_1` FOREIGN KEY (`manufacturer`) REFERENCES `inventory_manufacturer` (`id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `lca_define_contactgroup_relation`
+--
+ALTER TABLE `lca_define_contactgroup_relation`
+  ADD CONSTRAINT `lca_define_contactgroup_relation_ibfk_1` FOREIGN KEY (`lca_define_lca_id`) REFERENCES `lca_define` (`lca_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `lca_define_contactgroup_relation_ibfk_2` FOREIGN KEY (`contactgroup_cg_id`) REFERENCES `contactgroup` (`cg_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `lca_define_host_relation`
+--
+ALTER TABLE `lca_define_host_relation`
+  ADD CONSTRAINT `lca_define_host_relation_ibfk_1` FOREIGN KEY (`lca_define_lca_id`) REFERENCES `lca_define` (`lca_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `lca_define_host_relation_ibfk_2` FOREIGN KEY (`host_host_id`) REFERENCES `host` (`host_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `lca_define_hostgroup_relation`
+--
+ALTER TABLE `lca_define_hostgroup_relation`
+  ADD CONSTRAINT `lca_define_hostgroup_relation_ibfk_1` FOREIGN KEY (`lca_define_lca_id`) REFERENCES `lca_define` (`lca_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `lca_define_hostgroup_relation_ibfk_2` FOREIGN KEY (`hostgroup_hg_id`) REFERENCES `hostgroup` (`hg_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `lca_define_servicegroup_relation`
+--
+ALTER TABLE `lca_define_servicegroup_relation`
+  ADD CONSTRAINT `lca_define_servicegroup_relation_ibfk_1` FOREIGN KEY (`lca_define_lca_id`) REFERENCES `lca_define` (`lca_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `lca_define_servicegroup_relation_ibfk_2` FOREIGN KEY (`servicegroup_sg_id`) REFERENCES `servicegroup` (`sg_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `lca_define_topology_relation`
+--
+ALTER TABLE `lca_define_topology_relation`
+  ADD CONSTRAINT `lca_define_topology_relation_ibfk_1` FOREIGN KEY (`lca_define_lca_id`) REFERENCES `lca_define` (`lca_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `lca_define_topology_relation_ibfk_2` FOREIGN KEY (`topology_topology_id`) REFERENCES `topology` (`topology_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `meta_contactgroup_relation`
+--
+ALTER TABLE `meta_contactgroup_relation`
+  ADD CONSTRAINT `meta_contactgroup_relation_ibfk_1` FOREIGN KEY (`meta_id`) REFERENCES `meta_service` (`meta_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `meta_contactgroup_relation_ibfk_2` FOREIGN KEY (`cg_cg_id`) REFERENCES `contactgroup` (`cg_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `meta_service`
+--
+ALTER TABLE `meta_service`
+  ADD CONSTRAINT `meta_service_ibfk_1` FOREIGN KEY (`check_period`) REFERENCES `timeperiod` (`tp_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `meta_service_ibfk_2` FOREIGN KEY (`notification_period`) REFERENCES `timeperiod` (`tp_id`) ON DELETE SET NULL;
+
+--
+-- Contraintes pour la table `osl`
+--
+ALTER TABLE `osl`
+  ADD CONSTRAINT `osl_ibfk_1` FOREIGN KEY (`id_notification_period`) REFERENCES `timeperiod` (`tp_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `osl_ibfk_2` FOREIGN KEY (`id_check_period`) REFERENCES `timeperiod` (`tp_id`) ON DELETE SET NULL;
+
+--
+-- Contraintes pour la table `osl_contactgroup_relation`
+--
+ALTER TABLE `osl_contactgroup_relation`
+  ADD CONSTRAINT `osl_contactgroup_relation_ibfk_1` FOREIGN KEY (`id_osl`) REFERENCES `osl` (`osl_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `osl_contactgroup_relation_ibfk_2` FOREIGN KEY (`id_contactgroup`) REFERENCES `contactgroup` (`cg_id`) ON DELETE SET NULL;
+
+--
+-- Contraintes pour la table `osl_escalation_relation`
+--
+ALTER TABLE `osl_escalation_relation`
+  ADD CONSTRAINT `osl_escalation_relation_ibfk_1` FOREIGN KEY (`escalation_esc_id`) REFERENCES `escalation` (`esc_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `osl_escalation_relation_ibfk_2` FOREIGN KEY (`osl_id`) REFERENCES `osl` (`osl_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `osl_escalations`
+--
+ALTER TABLE `osl_escalations`
+  ADD CONSTRAINT `osl_escalations_ibfk_1` FOREIGN KEY (`timeperiod_id`) REFERENCES `timeperiod` (`tp_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `osl_escalations_ibfk_2` FOREIGN KEY (`osl_id`) REFERENCES `osl` (`osl_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `osl_indicator`
+--
+ALTER TABLE `osl_indicator`
+  ADD CONSTRAINT `osl_indicator_ibfk_3` FOREIGN KEY (`host_id`) REFERENCES `host` (`host_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `osl_indicator_ibfk_4` FOREIGN KEY (`service_id`) REFERENCES `service` (`service_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `osl_indicator_ibfk_5` FOREIGN KEY (`id_indicator_osl`) REFERENCES `osl` (`osl_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `osl_indicator_ibfk_6` FOREIGN KEY (`id_osl`) REFERENCES `osl` (`osl_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `osl_indicator_ibfk_7` FOREIGN KEY (`meta_id`) REFERENCES `meta_service` (`meta_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `reporting_diff_list`
+--
+ALTER TABLE `reporting_diff_list`
+  ADD CONSTRAINT `reporting_diff_list_ibfk_1` FOREIGN KEY (`tp_id`) REFERENCES `timeperiod` (`tp_id`) ON DELETE SET NULL;
+
+--
+-- Contraintes pour la table `reporting_email_list_relation`
+--
+ALTER TABLE `reporting_email_list_relation`
+  ADD CONSTRAINT `reporting_email_list_relation_ibfk_1` FOREIGN KEY (`rtdl_id`) REFERENCES `reporting_diff_list` (`rtdl_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `service`
+--
+ALTER TABLE `service`
+  ADD CONSTRAINT `service_ibfk_5` FOREIGN KEY (`purge_policy_id`) REFERENCES `purge_policy` (`purge_policy_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `service_ibfk_1` FOREIGN KEY (`command_command_id`) REFERENCES `command` (`command_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `service_ibfk_2` FOREIGN KEY (`command_command_id2`) REFERENCES `command` (`command_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `service_ibfk_3` FOREIGN KEY (`timeperiod_tp_id`) REFERENCES `timeperiod` (`tp_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `service_ibfk_4` FOREIGN KEY (`timeperiod_tp_id2`) REFERENCES `timeperiod` (`tp_id`) ON DELETE SET NULL;
+
+--
+-- Contraintes pour la table `servicegroup`
+--
+ALTER TABLE `servicegroup`
+  ADD CONSTRAINT `servicegroup_ibfk_1` FOREIGN KEY (`country_id`) REFERENCES `view_country` (`country_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `servicegroup_ibfk_2` FOREIGN KEY (`city_id`) REFERENCES `view_city` (`city_id`) ON DELETE SET NULL;
+
+--
+-- Contraintes pour la table `servicegroup_relation`
+--
+ALTER TABLE `servicegroup_relation`
+  ADD CONSTRAINT `servicegroup_relation_ibfk_1` FOREIGN KEY (`service_service_id`) REFERENCES `service` (`service_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `servicegroup_relation_ibfk_2` FOREIGN KEY (`servicegroup_sg_id`) REFERENCES `servicegroup` (`sg_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `traps_service_relation`
+--
+ALTER TABLE `traps_service_relation`
+  ADD CONSTRAINT `traps_service_relation_ibfk_2` FOREIGN KEY (`service_id`) REFERENCES `service` (`service_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `traps_service_relation_ibfk_3` FOREIGN KEY (`traps_id`) REFERENCES `traps` (`traps_id`) ON DELETE CASCADE;
+
+--
+-- Contraintes pour la table `view_city`
+--
+ALTER TABLE `view_city`
+  ADD CONSTRAINT `view_city_ibfk_1` FOREIGN KEY (`country_id`) REFERENCES `view_country` (`country_id`) ON DELETE CASCADE;
\ No newline at end of file
diff --git a/www/install/insertBaseConf.sql b/www/install/insertBaseConf.sql
new file mode 100644
index 0000000000000000000000000000000000000000..72bcffe69e753568bd871104a42eeda6ed5f5686
--- /dev/null
+++ b/www/install/insertBaseConf.sql
@@ -0,0 +1,483 @@
+--
+-- G�n�r� le : Vendredi 24 Mars 2006 � 16:06
+--
+
+--
+-- Contenu de la table `cfg_cgi`
+--
+
+INSERT INTO `cfg_cgi` VALUES (10, 'CGI.cfg', '/usr/local/nagios/etc/nagios.cfg', '/usr/local/nagios/share', '/nagios', '/usr/local/nagios/libexec/check_nagios /usr/local/nagios/var/status.log 5 &#039;/usr/local/nagios/bin/nagios&#039;', '1', 'nagiosadmin', 'nagiosadmin', 'nagiosadmin', 'nagiosadmin', 'nagiosadmin', 'nagiosadmin', 'nagiosadmin', 'nagiosadmin', 'logofullsize.jpg', '4', NULL, '4', 90, NULL, NULL, NULL, NULL, NULL, '/bin/ping -n -U -c 5 $HOSTADDRESS$', 'Install Nagios TGZ - RHAS3', '1');
+
+--
+-- Contenu de la table `cfg_nagios`
+--
+
+INSERT INTO `cfg_nagios` VALUES (1, 'Nagios CFG 1', '/usr/local/nagios/var/nagios.log', '/usr/local/nagios/etc/', NULL, '/usr/local/nagios/var/nagios.tmp', '/usr/local/nagios/var/status.log', '', '0', 15, 'nagios', 'nagios', '1', '1', '1', '2', '2', '1', 'd', '/usr/local/nagios/var/archives/', '1', '1s', '/usr/local/nagios/var/rw/nagios.cmd', '/usr/local/nagios/var/downtime.log', '/usr/local/nagios/var/comment.log', '/usr/local/nagios/var/nagios.lock', '1', '/usr/local/nagios/var/status.sav', 60, '1', '2', '0', '1', '1', '1', '1', '1', '1', '1', '2', NULL, NULL, 1, 's', NULL, NULL, 's', 20, NULL, NULL, 10, 60, '2', NULL, NULL, '1', '0', '25.0', '50.0', '25.0', '50.0', '0', 60, 60, 60, 60, 1, NULL, 5, '0', NULL, '2', NULL, '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '1', NULL, 60, '2', NULL, 'euro', '~!$%^&amp;*&quot;|&#039;&lt;&gt;?,()=', '`~$^&amp;&quot;|&#039;&lt;&gt;', '2', '2', 'admin', 'admin@localhost', 'TGZ Install RHAS3', '1');
+
+--
+-- Contenu de la table `cfg_perfparse`
+--
+
+INSERT INTO `cfg_perfparse` VALUES (2, 'Perfparse CFG 1', 1976, '-', '/usr/local/nagios/var/serviceperf.log/', 'perfparse.log', '1', 7, '/tmp/perfparse.drop', '1', 7, '/var/lock/perfparse.lock', '1', '1', '2', '2', '2', '0', '/var/log/perfparse_output_log', '1', 7, '0', 'localhost', 1974, '1', '1', '0', 'root', NULL, 'perfparse', 'localhost', 'dummy', 'mysql', 'Install TGZ - RHAS3', '1');
+
+--
+-- Contenu de la table `cfg_resource`
+--
+
+INSERT INTO `cfg_resource` VALUES (1, '$USER1$', '$USER1$=/usr/local/nagios/libexec', 'path to the plugins', '1');
+
+--
+-- Contenu de la table `general_opt`
+--
+
+INSERT INTO `general_opt` VALUES (1, '/usr/local/nagios/', '/usr/local/nagios/bin/nagios', '/usr/local/nagios/share/images/', '/usr/local/nagios/libexec/', NULL, 'public', '1',  NULL, '/etc/snmp/snmptrapd.conf', '/bin/mail', '/usr/bin/rrdtool', '1.0','/usr/local/oreon/', '/usr/local/oreon/www/', '/usr/local/oreon/rrd/', 10, '#19EE11', '#F91E05', '#82CFD8', '#13EB3A', '#F8C706', '#F91D05', '#2AD1D4', '#D4D5CC', 120, '0', '20', '50', 'Basic_light', '','','','uid','0','0');
+
+--
+-- Contenu de la table `nagios_server`
+--
+
+INSERT INTO `nagios_server` VALUES (1, 'Oreon Nagios', NULL);
+
+--
+-- Contenu de la table `giv_graphs_template`
+--
+
+INSERT INTO `giv_graphs_template` VALUES (1, 'Default_Graph', 'Default_Graph', 'PNG', 'Value', 86400, 0, 600, 200, 0, NULL, '#FFFFFF', '#FEFEFE', '#000000', '#800000', '#808080', '#000000', '#FFFFFF', '#C0C0C0', '#909090', '1', '1', '0', NULL);
+INSERT INTO `giv_graphs_template` VALUES (2, 'Latency', 'Latency', 'PNG', 'Latency', 86400, 0, 600, 200, 0, NULL, '#FFFFFF', '#F3F6F6', '#3C3334', '#800000', '#808080', '#000000', '#FFFFFF', '#6E917F', '#4B75B3', '0', '0', '0', NULL);
+INSERT INTO `giv_graphs_template` VALUES (3, 'Storage', 'Storage', 'PNG', 'Storage', 86400, 0, 600, 200, 0, NULL, '#FFFFFF', '#F3F6F6', '#3C3334', '#800000', '#808080', '#000000', '#FFFFFF', '#6E917F', '#4B75B3', '0', '0', '0', NULL);
+INSERT INTO `giv_graphs_template` VALUES (4, 'Memory', 'Memory', 'PNG', 'Memory', 86400, 0, 600, 200, 0, NULL, '#FFFFFF', '#F3F6F6', '#3C3334', '#800000', '#808080', '#000000', '#FFFFFF', '#6E917F', '#4B75B3', '0', '0', '0', NULL);
+INSERT INTO `giv_graphs_template` VALUES (5, 'CPU', 'CPU', 'PNG', 'CPU (%)', 86400, 0, 600, 200, 0, NULL, '#FFFFFF', '#F3F6F6', '#3C3334', '#800000', '#808080', '#000000', '#FFFFFF', '#6E917F', '#4B75B3', '0', '0', '0', NULL);
+INSERT INTO `giv_graphs_template` VALUES (6, 'Uptime', 'Uptime', 'PNG', 'Uptime', 86400, 0, 600, 200, 0, NULL, '#FFFFFF', '#F3F6F6', '#3C3334', '#800000', '#808080', '#000000', '#FFFFFF', '#6E917F', '#4B75B3', '0', '0', '0', NULL);
+INSERT INTO `giv_graphs_template` VALUES (7, 'Traffic', 'Traffic', 'PNG', 'Traffic', 86400, 0, 600, 200, 0, NULL, '#FFFFFF', '#F3F6F6', '#3C3334', '#800000', '#808080', '#000000', '#FFFFFF', '#6E917F', '#4B75B3', '0', '0', '0', NULL);
+INSERT INTO `giv_graphs_template` VALUES (8, 'Load_Average', 'Load_Average', 'PNG', 'Load_Average', 86400, 0, 600, 200, 0, NULL, '#FFFFFF', '#F3F6F6', '#3C3334', '#800000', '#808080', '#000000', '#FFFFFF', '#6E917F', '#4B75B3', '0', '0', '0', NULL);
+INSERT INTO `giv_graphs_template` VALUES (9, 'OSL', 'OSL', 'PNG', 'OSL', 86400, 0, 600, 200, 0, NULL, '#FFFFFF', '#F3F6F6', '#3C3334', '#800000', '#808080', '#000000', '#FFFFFF', '#6E917F', '#4B75B3', '0', '0', '0', NULL);
+
+--
+-- Contenu de la table `giv_components_template`
+--
+INSERT INTO `giv_components_template` VALUES (1, 'Default_DS1', 1, 'DS1', 'DS1', '#1183EE', '#FFFFFF', '0', '1', '1', '1', '1', 2, NULL, NULL, '1', '1', NULL);
+INSERT INTO `giv_components_template` VALUES (2, 'Default_DS2', 2, 'DS2', 'DS2', '#18E631', '#FFFFFF', '0', '1', '1', '1', '1', 2, NULL, NULL, '0', '0', NULL);
+INSERT INTO `giv_components_template` VALUES (3, 'Default_DS3', 3, 'DS3', 'DS3', '#E84D17', '#FFFFFF', '0', '1', '1', '1', '1', 2, NULL, NULL, '0', '0', NULL);
+INSERT INTO `giv_components_template` VALUES (4, 'Default_DS4', 4, 'DS4', 'DS4', '#C438C7', '#FFFFFF', '0', '1', '1', '1', '1', 2, NULL, NULL, '0', '0', NULL);
+INSERT INTO `giv_components_template` VALUES (5, 'Ping', 1, 'Ping', 'Ping', '#1EE045', '#1EE045', '0', '0', '0', '1', '0', 2, '25', '0', '0', '0', NULL);
+INSERT INTO `giv_components_template` VALUES (6, 'Mem_Total', 1, 'Mem_Total', 'Mem_Total', '#F33E0B', '#FFFFFF', '0', '0', '0', '1', '1', 2, NULL, '0', '0', '0', NULL);
+INSERT INTO `giv_components_template` VALUES (7, 'Mem_Used', 2, 'Mem_Used', 'Mem_Used', '#2B28D7', '#FFFFFF', '0', '0', '0', '1', '1', 2, NULL, '0', '0', '0', NULL);
+INSERT INTO `giv_components_template` VALUES (8, 'Mem_Free', 3, 'Mem_Free', 'Mem_Free', '#30D22D', '#FFFFFF', '0', '0', '0', '1', '1', 2, NULL, '0', '0', '0', NULL);
+INSERT INTO `giv_components_template` VALUES (9, 'CPU', 1, 'CPU', 'CPU', '#FF0000', '#FFFFFF', '0', '0', '0', '0', '0', 2, NULL, '0', '0', '0', NULL);
+INSERT INTO `giv_components_template` VALUES (10, 'UPTIME', 1, 'UPTIME', 'UPTIME', '#FF0000', '#FF0000', '1', '1', '1', '1', '0', 2, NULL, '0', '0', '0', NULL);
+INSERT INTO `giv_components_template` VALUES (11, 'Traffic_In', 1, 'Traffic_In', 'Traffic_In', '#FF0000', '#FF0000', '0', '1', '0', '1', '0', 1, NULL, NULL, '0', '0', NULL);
+INSERT INTO `giv_components_template` VALUES (12, 'Traffic_Out', 2, 'Traffic_Out', 'Traffic_Out', '#1EE045', '#1EE045', '0', '1', '0', '1', '1', 2, '25', '0', '0', '0', NULL);
+INSERT INTO `giv_components_template` VALUES (13, 'Load_1', 1, 'Load_1', 'Load_1', '#1EE045', '#1EE045', '0', '0', '0', '1', '0', 2, '25', '0', '0', '0', NULL);
+INSERT INTO `giv_components_template` VALUES (14, 'Load_5', 2, 'Load_5', 'Load_5', '#D2822D', '#D2822D', '0', '0', '0', '1', '0', 2, '25', '0', '0', '0', NULL);
+INSERT INTO `giv_components_template` VALUES (15, 'Load_15', 3, 'Load_15', 'Load_15', '#DF1FC4', '#DF1FC4', '0', '0', '0', '1', '0', 2, '25', '0', '0', '0', NULL);
+INSERT INTO `giv_components_template` VALUES (16, 'OSL_DOWNTIME', 1, 'OSL_DOWNTIME', 'DOWNTIME', '#E64A18', '#E64A18', '1', '1', '1', '1', '0', 1, NULL, '0', '0', '0', NULL);
+INSERT INTO `giv_components_template` VALUES (17, 'OSL_VALUE', 2, 'OSL_VALUE', 'VALUE', '#61D22D', '#61D22D', '1', '1', '1', '1', '0', 1, NULL, '0', '0', '0', NULL);
+
+
+--
+-- Contenu de la table `giv_graphT_componentT_relation`
+--
+
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '1', '1');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '1', '2');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '1', '3');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '1', '4');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '2', '5');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '3', '6');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '3', '7');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '3', '8');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '4', '6');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '4', '7');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '4', '8');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '5', '9');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '6', '10');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '7', '11');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '7', '12');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '8', '13');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '8', '14');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '8', '15');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '9', '16');
+INSERT INTO `giv_graphT_componentT_relation` ( `ggcr_id` , `gg_graph_id` , `gc_compo_id` ) VALUES (NULL , '9', '17');
+
+--
+-- Contenu de la table `inventory_manufacturer`
+--
+
+INSERT INTO `inventory_manufacturer` (`name`, `alias`) VALUES ('cisco', 'Cisco Networks');
+INSERT INTO `inventory_manufacturer` (`name`, `alias`) VALUES ('hp', 'HP Networks');
+INSERT INTO `inventory_manufacturer` (`name`, `alias`) VALUES ('3com', '3Com');
+INSERT INTO `inventory_manufacturer` (`name`, `alias`) VALUES ('ciscolinksys', 'Cisco-Linksys');
+INSERT INTO `inventory_manufacturer` (`name`, `alias`) VALUES ('allied', 'Allied Telesyn');
+-- INSERT INTO `inventory_manufacturer` (`name`, `alias`) VALUES ('dell', 'Dell');
+-- INSERT INTO `inventory_manufacturer` (`name`, `alias`) VALUES ('saintsongcorp', 'Saint Song Corp');
+
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:00:0C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:42', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:43', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:63', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:64', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:96', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:97', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:C7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:C9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:16', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:17', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:4A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:4B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:7D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:7E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:B9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:BA', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:FC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:FD', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:31', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:32', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:6B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:6C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:9F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:A0', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:E3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:E4', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:FD', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:FE', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:27', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:28', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:4D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:4E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:6D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:6E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:9A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:9B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:C0', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:C1', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:DD', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:DE', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:00', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:01', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:31', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:32', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:5E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:5F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:73', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:74', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:9A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:9B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:DC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:DD', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:28', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:2A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:52', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:53', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:7C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:C1', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:D6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:D7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:01', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:0D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:0E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:4F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:50', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:84', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:85', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:B3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:B4', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:EB', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:EC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:20', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:21', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:7C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:7D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:A3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:A4', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:C2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:E2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:E3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:11', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:12', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:43', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:44', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:7B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:7C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:B6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:B7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:E8', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:E9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:41', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:42', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:8A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:8B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:B7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:B8', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:F3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:F4', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:45', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:46', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:5F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:60', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:BE', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:BF', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:FC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:FD', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:30', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:31', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:85', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:86', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:CE', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:CF', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:28', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:29', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:65', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:66', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:38', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:39', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:83', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:84', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:D6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:D7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:23', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:24', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:34', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:35', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:8F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:90', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:F7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:F8', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:07', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:0B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:0D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:11', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:14', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:1F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:29', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:2F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:54', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:79', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:7B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:A6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:F6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:FF', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:20', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:21', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:5C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:5D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:92', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:93', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:BB', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:BC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:00', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:01', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:17', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:43', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:44', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:7F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:80', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:D9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:DA', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:10', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:19', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:1A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:5F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:60', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:7F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:80', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:C3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:C4', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:1B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:1C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:69', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:6A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:A8', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:A9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:BF', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:F1', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:F2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:2B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:2C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:62', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:63', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:C6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:C7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:F9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:FA', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:46', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:47', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:9C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:9D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:B6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:C7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:C8', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:19', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:24', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:40', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:71', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:78', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:7B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:80', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:85', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:94', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:96', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:A3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:B6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:F2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:0B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:0F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:14', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:2A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:3E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:50', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:53', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:54', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:73', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:80', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:A2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:A7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:BD', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:D1', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:E2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:F0', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:09', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:2F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:3E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:47', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:5C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:70', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:83', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:80:1C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:0C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:21', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:2B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:5F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:6D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:6F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:86', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:92', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:A6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:AB', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:B1', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:BF', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:D9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:F2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:B0:4A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:B0:64', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:B0:8E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:B0:C2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:06', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:58', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:63', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:79', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:90', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:97', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:BA', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:BB', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:BC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:C0', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:D3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:E4', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:FF', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:14', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:1E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:34', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:4F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:8F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:A3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:B0', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:F7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:F9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:FE', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:BC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:BD', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:EC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:ED', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:02', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:03', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:9C', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:0B', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:1A', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:8C', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:04', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:5E', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:AC', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:54', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:6A', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:CB', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:4B', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:5A', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:A9', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:7C', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:E0', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:20:AF', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:26:54', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:1E', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:04', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:99', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:DA', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:08', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:8C', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:97', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:04', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:A0:24', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:96', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:D8', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '02:60:60', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '02:60:8C', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '02:C0:8C', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '08:00:4E', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:00:63', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:0D', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:B0', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '08:00:09', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '10:00:90', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:CD', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:E6', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:E7', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:EA', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:83', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:57', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:83', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:C1', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:7F', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:20', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:0A', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:85', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:79', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:21', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:38', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:C2', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:60', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:35', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:6E', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:9D', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:5A', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:25', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:41', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:66', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:17', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:10', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:BF', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:B6', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:00:CD', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:00:F4', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:71', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:AE', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:41', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:47', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:25', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:46', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:DA', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:30', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:77', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:20:58', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:84', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:99', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:A0:D2', 5);
+-- INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:5B', 6);
+-- INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:74', 6);
+-- INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:DB', 6);
+-- INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:56', 6);
+-- INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:43', 6);
+-- INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:3F', 6);
+-- INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:72', 6);
+-- INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:22', 6);
+-- INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:C5', 6);
+-- INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:B0:D0', 6);
+-- INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:C0:4F', 6);
diff --git a/www/install/insertCmd-Tps.sql b/www/install/insertCmd-Tps.sql
new file mode 100644
index 0000000000000000000000000000000000000000..a2e6fc28962295e92db2f8e7ed594d521e515ba2
--- /dev/null
+++ b/www/install/insertCmd-Tps.sql
@@ -0,0 +1,57 @@
+--
+-- Commands and Timeperiods
+--
+
+INSERT INTO `command` VALUES (1, 'check_cpu_load', '$USER1$#S#check_nt -H $HOSTADDRESS$ -v CPULOAD -l $ARG1$ -s &quot;public&quot;', '', 2);
+INSERT INTO `command` VALUES (2, 'check_disk_smb', '$USER1$/check_disk_smb -H $ARG1$ -s $ARG2$ -u $ARG3$ -p $ARG4$ -w $ARG5$', '', 2);
+INSERT INTO `command` VALUES (3, 'check_disk_space', '$USER1$#S#check_nt -H $HOSTADDRESS$ -v USEDDISKSPACE -l $ARG1$ -w $ARG2$ -c $ARG3$ -s &quot;public&quot;', '', 2);
+INSERT INTO `command` VALUES (4, 'check_distant_disk_space', '$USER1$/check_distant_disk_space -H $HOSTADDRESS$ -C $ARG1$ -p $ARG2$ -w $ARG3$ -c $ARG4$', '', 2);
+INSERT INTO `command` VALUES (5, 'check_dns', '$USER1$/check_dns -H $ARG1$ -s $HOSTADDRESS$', '', 2);
+INSERT INTO `command` VALUES (6, 'check_ftp', '$USER1$/check_ftp -H $HOSTADDRESS$', '!127.0.0.1', 2);
+INSERT INTO `command` VALUES (7, 'check_graph_load_average', '$USER1$/check_graph_load_average.pl $HOSTADDRESS$ -v $ARG1$ -W -C $ARG2$ -g -S $ARG3$', '', 2);
+INSERT INTO `command` VALUES (8, 'check_graph_ping', '$USER1$#S#check_graph_ping.pl -H $HOSTADDRESS$ -w 200,20% -c 500,40% -f -n $ARG1$ -g -S $ARG2$', '!3', 2);
+INSERT INTO `command` VALUES (9, 'check_graph_process', '$USER1$/check_graph_process.pl $HOSTADDRESS$ -v $ARG1$ -C $ARG2$ -n -g -S $ARG3$', '!2c!public', 2);
+INSERT INTO `command` VALUES (10, 'check_graph_remote_storage', '$USER1$/check_graph_remote_storage.pl $HOSTADDRESS$ -d $ARG1$  -C $ARG2$ -w $ARG3$ -c $ARG4$ -v $ARG5$ -g -S $ARG6$', '!1!public!80!90!1', 2);
+INSERT INTO `command` VALUES (11, 'check_graph_traffic', '$USER1$/check_graph_traffic.pl -H $HOSTADDRESS$ -i $ARG1$ -w $ARG2$ -c $ARG3$ -C $ARG4$ -v $ARG5$ -g -S $ARG6$', '!2!80!90!public!1', 2);
+INSERT INTO `command` VALUES (12, 'check_host_alive', '$USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1', '', 2);
+INSERT INTO `command` VALUES (13, 'check_hpjd', '$USER1$/check_hpjd -H $HOSTADDRESS$ -C public', '', 2);
+INSERT INTO `command` VALUES (14, 'check_http', '$USER1$/check_http -H $HOSTADDRESS$ -s $ARG1$ -v', '127.0.0.1', 2);
+INSERT INTO `command` VALUES (15, 'check_https', '$USER1$/check_http -S $HOSTADDRESS$', '', 2);
+INSERT INTO `command` VALUES (16, 'check_http_up', '$USER1$/check_http -H $HOSTADDRESS$', '', 2);
+INSERT INTO `command` VALUES (17, 'check_load_average', '$USER1$/check_load $HOSTADDRESS$ -w $ARG1$ -c $ARG2$', '', 2);
+INSERT INTO `command` VALUES (18, 'check_local_disk', '$USER1$/check_disk -w $ARG2$ -c $ARG3$ -p $ARG1$', '', 2);
+INSERT INTO `command` VALUES (19, 'check_local_load', '$USER1$/check_load -w $ARG1$ -c $ARG2$', '', 2);
+INSERT INTO `command` VALUES (20, 'check_local_procs', '$USER1$/check_procs -w $ARG1$ -c $ARG2$ -u $ARG3$', '', 2);
+INSERT INTO `command` VALUES (21, 'check_local_users', '$USER1$/check_users -w $ARG1$ -c $ARG2$', '', 2);
+INSERT INTO `command` VALUES (22, 'check_memuse', '$USER1$#S#check_nt -H $HOSTADDRESS$ -v MEMUSE -s &quot;public&quot;', '', 2);
+INSERT INTO `command` VALUES (23, 'check_nntp', '$USER1$/check_nntp -H $HOSTADDRESS$', '', 2);
+INSERT INTO `command` VALUES (24, 'check_pop', '$USER1$/check_pop -H $HOSTADDRESS$', '', 2);
+INSERT INTO `command` VALUES (26, 'check_process', '$USER1$/check_graph_process.pl $HOSTADDRESS$ -v $ARG1$ -C $ARG2$ -p $ARG3$', '!1!public!httpd', 2);
+INSERT INTO `command` VALUES (27, 'check_snmp', '$USER1$/check_snmp -H $HOSTADDRESS$ -o $ARG1$ -w $ARG2$ -C $ARG3$', '', 2);
+INSERT INTO `command` VALUES (28, 'check_snmp_disk', '$USER1$/check_disk_space.pl $HOSTADDRESS$ $ARG1$ $ARG2$  $ARG3$ $ARG4$', '', 2);
+INSERT INTO `command` VALUES (29, 'check_swap', '$USER1$/check_swap -w $ARG1$ -c $ARG2$ -v', '!80!90', 2);
+INSERT INTO `command` VALUES (30, 'check_tcp', '$USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ -w $ARG2$ -c $ARG3$', '', 2);
+INSERT INTO `command` VALUES (31, 'check_telnet', '$USER1$/check_tcp -H $HOSTADDRESS$ -p 23', '', 2);
+INSERT INTO `command` VALUES (32, 'check_udp', '$USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$', '', 2);
+INSERT INTO `command` VALUES (33, 'check_uptime', '$USER1$/check_uptime.pl $HOSTADDRESS$ $ARG1$ $ARG2$', '', 2);
+INSERT INTO `command` VALUES (34, 'host-notify-by-email', '/usr/bin/printf "%b" "***** Oreon *****Notification\\nType:$NOTIFICATIONTYPE$\\n Host: $HOSTNAME$\\nState: $HOSTSTATE$Address: $HOSTADDRESS$\\nInfo: $OUTPUT$\\nDate/Time: $DATETIME$" | @MAILER@ -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$', '', 1);
+INSERT INTO `command` VALUES (35, 'host-notify-by-epager', '#S#usr#S#bin#S#printf #BS#&quot;%b#BS#&quot; #BS#&quot;Host #BS#&#039;$HOSTALIAS$#BS#&#039; is $HOSTSTATE$#BR#Info: $OUTPUT$#BR#Time: $DATETIME$#BS#&quot; | @MAILER@ -s #BS#&quot;$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$#BS#&quot; $CONTACTPAGER$', '', 1);
+INSERT INTO `command` VALUES (36, 'notify-by-email', '/usr/bin/printf "%b" "***** Oreon  *****\\n\\nNotification Type: $NOTIFICATIONTYPE$\\n\\nService: $SERVICEDESC$\\nHost: $HOSTALIAS$\\nAddress: $HOSTADDRESS$\\nState: $SERVICESTATE$\\n\\nDate/Time: $DATETIME$\\n\\nAdditional Info:\\n\\n$OUTPUT$" | @MAILER@ -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$', '', 1);
+INSERT INTO `command` VALUES (37, 'notify-by-epager', '/usr/bin/printf "%b" "Service: $SERVICEDESC$\\nHost: $HOSTNAME$\\nAddress: $HOSTADDRESS$\\nState: $SERVICESTATE$\\nInfo: $OUTPUT$\\nDate: $DATETIME$" | @MAILER@ -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$', '', 1);
+INSERT INTO `command` VALUES (38, 'process-host-perfdata', '#S#usr#S#bin#S#printf #BS#&quot;%b#BS#&quot; #BS#&quot;$LASTCHECK$t$HOSTNAME$#T#$HOSTSTATE$#T#$HOSTATTEMPT$#T#$STATETYPE$#T#$EXECUTIONTIME$#T#$OUTPUT$#T#$PERFDATA$#BS#&quot; &gt;&gt; #S#usr#S#local#S#nagios#S#var#S#host-perfdata.out', '', 1);
+INSERT INTO `command` VALUES (39, 'process-service-perfdata', '#S#usr#S#local#S#nagios#S#libexec#S#process-service-perfdata  &quot;$LASTCHECK$&quot; &quot;$HOSTNAME$&quot; &quot;$SERVICEDESC$&quot; &quot;$OUTPUT$&quot; &quot;$SERVICESTATE$&quot; &quot;$PERFDATA$&quot;', '', 1);
+INSERT INTO `command` VALUES (40, 'check_graph_nt', '$USER1$/check_graph_nt.pl -H $HOSTADDRESS$ -p 1248 -v $ARG1$ -l $ARG2$ -s $ARG3$ -w $ARG4$ -c $ARG5$ -g -S $ARG6$', '', 2);
+INSERT INTO `command` VALUES (41, 'check_graph_uptime', '$USER1$/check_graph_uptime.pl -H $HOSTADDRESS$ -C $ARG1$ -v $ARG2$ -d -g -S $ARG3$', '', 2);
+INSERT INTO `command` VALUES (42, 'check_graph_http', '$USER1$#S#check_graph_http.pl -H $HOSTADDRESS$ -f', '', 2);
+INSERT INTO `command` VALUES (44, 'check_service_state', '$USER1$#S#check_nt -H $HOSTADDRESS$ -v SERVICESTATE -l $ARG1$ -s &quot;public&quot;', '', 2);
+INSERT INTO `command` VALUES (45, 'check_users', '$USER1$#S#check_users -H $HOSTADDRESS$ -w 3 -c 5', '', 2);
+INSERT INTO `command` VALUES (46, 'check_http2', '$USER1$#S#check_http -I $HOSTADDRESS$ -u $ARG1$', '', 2);
+
+--
+-- table `timeperiod`
+--
+
+INSERT INTO `timeperiod` VALUES (1, '24x7', '24_Hours_A_Day,_7_Days_A_Week', '00:00-24:00', '00:00-24:00', '00:00-24:00', '00:00-24:00', '00:00-24:00', '00:00-24:00', '00:00-24:00');
+INSERT INTO `timeperiod` VALUES (2, 'none', 'No Time Is A Good Time', '', '', '', '', '', '', '');
+INSERT INTO `timeperiod` VALUES (3, 'nonworkhours', 'Non-Work Hours', '00:00-24:00', '00:00-09:00,17:00-24:00', '00:00-09:00,17:00-24:00', '00:00-09:00,17:00-24:00', '00:00-09:00,17:00-24:00', '00:00-09:00,17:00-24:00', '00:00-24:00');
+INSERT INTO `timeperiod` VALUES (4, 'workhours', 'Work hours', '', '09:00-17:00', '09:00-17:00', '09:00-17:00', '09:00-17:00', '09:00-17:00', '');
diff --git a/www/install/insertMacros.sql b/www/install/insertMacros.sql
new file mode 100644
index 0000000000000000000000000000000000000000..ecdf04fe2ab59914cce1dd6bab2ab9313f661d27
--- /dev/null
+++ b/www/install/insertMacros.sql
@@ -0,0 +1,108 @@
+-- 
+-- Generated le : Vendredi 17 Mars 2006 à 10:01
+--
+
+-- 
+-- Contenu de la table `nagios_macro`
+-- 
+
+INSERT INTO `nagios_macro` (`macro_id`, `macro_name`) VALUES (1, '$HOSTNAME$'),
+(2, '$HOSTALIAS$'),
+(3, '$HOSTADDRESS$'),
+(4, '$HOSTSTATE$'),
+(5, '$HOSTSTATEID$'),
+(6, '$HOSTSTATETYPE$'),
+(7, '$HOSTATTEMPT$'),
+(8, '$HOSTLATENCY$'),
+(9, '$HOSTEXECUTIONTIME$'),
+(10, '$HOSTDURATION$'),
+(11, '$HOSTDURATIONSEC$'),
+(12, '$HOSTDOWNTIME$'),
+(13, '$HOSTPERCENTCHANGE$'),
+(14, '$HOSTGROUPNAME$'),
+(15, '$HOSTGROUPALIAS$'),
+(16, '$LASTHOSTCHECK$'),
+(17, '$LASTHOSTSTATECHANGE$'),
+(18, '$LASTHOSTUP$'),
+(19, '$LASTHOSTDOWN$'),
+(20, '$LASTHOSTUNREACHABLE$'),
+(21, '$HOSTOUTPUT$'),
+(22, '$HOSTPERFDATA$'),
+(23, '$HOSTCHECKCOMMAND$'),
+(24, '$HOSTACKAUTHOR$'),
+(25, '$HOSTACKCOMMENT$'),
+(26, '$HOSTACTIONURL$'),
+(27, '$HOSTNOTESURL$'),
+(28, '$HOSTNOTES$'),
+(29, '$SERVICEDESC$'),
+(30, '$SERVICESTATE$'),
+(31, '$SERVICESTATEID$'),
+(32, '$SERVICESTATETYPE$'),
+(33, '$SERVICEATTEMPT$'),
+(34, '$SERVICELATENCY$'),
+(35, '$SERVICEEXECUTIONTIME$'),
+(36, '$SERVICEDURATION$'),
+(37, '$SERVICEDURATIONSEC$'),
+(38, '$SERVICEDOWNTIME$'),
+(39, '$SERVICEPERCENTCHANGE$'),
+(40, '$SERVICEGROUPNAME$'),
+(41, '$SERVICEGROUPALIAS$'),
+(42, '$LASTSERVICECHECK$'),
+(43, '$LASTSERVICESTATECHANGE$'),
+(44, '$LASTSERVICEOK$'),
+(45, '$LASTSERVICEWARNING$'),
+(46, '$LASTSERVICEUNKNOWN$'),
+(47, '$LASTSERVICECRITICAL$'),
+(48, '$SERVICEOUTPUT$'),
+(49, '$SERVICEPERFDATA$'),
+(50, '$SERVICECHECKCOMMAND$'),
+(51, '$SERVICEACKAUTHOR$'),
+(52, '$SERVICEACKCOMMENT$'),
+(53, '$SERVICEACTIONURL$'),
+(54, '$SERVICENOTESURL$'),
+(55, '$SERVICENOTES$'),
+(56, '$TOTALHOSTSUP$'),
+(57, '$TOTALHOSTSDOWN$'),
+(58, '$TOTALHOSTSUNREACHABLE$'),
+(59, '$TOTALHOSTSDOWNUNHANDLED$'),
+(60, '$TOTALHOSTSUNREACHABLEUNHANDLED$ 	'),
+(61, '$TOTALHOSTPROBLEMS$'),
+(62, '$TOTALHOSTPROBLEMSUNHANDLED$'),
+(63, '$TOTALSERVICESOK$'),
+(64, '$TOTALSERVICESWARNING$'),
+(65, '$TOTALSERVICESCRITICAL$'),
+(66, '$TOTALSERVICESUNKNOWN$'),
+(67, '$TOTALSERVICESWARNINGUNHANDLED$'),
+(68, '$TOTALSERVICESCRITICALUNHANDLED$'),
+(69, '$TOTALSERVICESUNKNOWNUNHANDLED$'),
+(70, '$TOTALSERVICEPROBLEMS$'),
+(71, '$TOTALSERVICEPROBLEMSUNHANDLED$'),
+(72, '$NOTIFICATIONTYPE$'),
+(73, '$NOTIFICATIONNUMBER$'),
+(74, '$CONTACTNAME$'),
+(75, '$CONTACTALIAS$'),
+(76, '$CONTACTEMAIL$'),
+(77, '$CONTACTPAGER$'),
+(78, '$CONTACTADDRESSn$'),
+(79, '$LONGDATETIME$'),
+(80, '$SHORTDATETIME$'),
+(81, '$DATE$'),
+(82, '$TIME$'),
+(83, '$TIMET$'),
+(84, '$MAINCONFIGFILE$'),
+(85, '$STATUSDATAFILE$'),
+(86, '$COMMENTDATAFILE$'),
+(87, '$DOWNTIMEDATAFILE$'),
+(88, '$RETENTIONDATAFILE$'),
+(89, '$OBJECTCACHEFILE$'),
+(90, '$TEMPFILE$'),
+(91, '$LOGFILE$'),
+(92, '$RESOURCEFILE$'),
+(93, '$COMMANDFILE$'),
+(94, '$HOSTPERFDATAFILE$'),
+(95, '$SERVICEPERFDATAFILE$'),
+(96, '$PROCESSSTARTTIME$'),
+(97, '$ADMINEMAIL$'),
+(98, '$ADMINPAGER$'),
+(99, '$ARGn$'),
+(100, '$USERn$');
diff --git a/www/install/insertTopology.sql b/www/install/insertTopology.sql
new file mode 100644
index 0000000000000000000000000000000000000000..f78119984d2dbf68bd9eaabab64db9f149678f8d
--- /dev/null
+++ b/www/install/insertTopology.sql
@@ -0,0 +1,170 @@
+--
+-- Base de donn�es: `oreon`
+--
+
+--
+-- Contenu de la table `topology`
+--
+
+--
+-- Top Level Menu
+--
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_home', NULL, NULL, 1, 10, 1, './include/home/home.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_monitoring', NULL, NULL, 2, 20, 1, './include/monitoring/status/monitoringService.php', '&o=svcpb', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_reporting', NULL, NULL, 3, 30, 1, './modules/osl/osl_view.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_views', NULL, NULL, 4, 40, 1, './include/views/graphs/graphPlugins/graphPlugins.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_options', NULL, NULL, 5, 50, 1, './include/options/oreon/myAccount/formMyAccount.php', '&o=c', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_configuration', NULL, NULL, 6, 60, 1, './include/configuration/configObject/host/host.php', NULL, '0', '0', '1');
+
+--
+-- Monitoring
+--
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'h_host_data', NULL, 20201, 2020101, 10, 1, './include/monitoring/objectDetails/hostDetails.php', '&o=hd', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_service_data', NULL, 20201, 2020101, 20, 1, './include/monitoring/objectDetails/serviceDetails.php', '&o=svcd', '0', '0', '1');
+
+-- hosts
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_host_detail', NULL, 2, 201, 20, 1, './include/monitoring/status/monitoringHost.php', '&o=h', NULL, NULL, '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_host_detail', './img/icones/16x16/server_network.gif', 201, 20102, 20, 1, './include/monitoring/status/monitoringHost.php', '&o=h', NULL, NULL, '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_hostgroup_detail', './img/icones/16x16/server_client.gif', 201, 20104, 30, 1, './include/monitoring/status/monitoringHostGroup.php', '&o=hg', NULL, NULL, '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_hosts_problems', './img/icones/16x16/server_network_problem.gif', 201, 20103, 20, 1, './include/monitoring/status/monitoringHost.php', '&o=hpb', NULL, NULL, '1');
+
+-- Services
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_service_detail', NULL, 2, 202, 10, 1, './include/monitoring/status/monitoringService.php', '&o=svcpb', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_service_detail', './img/icones/16x16/element_new_after.gif', 202, 20201, 10, 1, './include/monitoring/status/monitoringService.php', '&o=svc', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_services_problems', './img/icones/16x16/element_new_after.gif', 202, 20202, 20, 1, './include/monitoring/status/monitoringService.php', '&o=svcpb', NULL, NULL, '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_status_grid', './img/icones/16x16/branch_element.gif', 202, 20203, 30, 1, './include/monitoring/status/monitoringService.php', '&o=svcgrid', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_status_resume', './img/icones/16x16/branch_element.gif', 202, 20204, 40, 1, './include/monitoring/status/monitoringService.php', '&o=svcOV', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_status_summary', './img/icones/16x16/branch_element.gif', 202, 20205, 50, 1, './include/monitoring/status/monitoringService.php', '&o=svcSum', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_status_scheduling', './img/icones/16x16/branch_element.gif', 202, 20207, 60, 1, './include/monitoring/status/monitoringService.php', '&o=svcSch', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_meta_service', './img/icones/16x16/workstation2.gif', 202, 20206, 61, 1, './include/monitoring/status/monitoringService.php', '&o=meta', '0', '0', '1');
+
+-- logs
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_event_log', NULL, 2, 203, 30, 1, './include/monitoring/log/viewLog.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_all_logs', './img/icones/16x16/index.gif', 203, 20301, 10, 1, './include/monitoring/log/viewLog.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_notify_logs', './img/icones/16x16/mail_attachment.gif', 203, 20302, 20, 1, './include/monitoring/log/viewNotifyLog.php', NULL, NULL, NULL, '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_alerts_log', './img/icones/16x16/loudspeaker.gif', 203, 20303, 30, 1, './include/monitoring/log/viewAlertLog.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_warning_log', './img/icones/16x16/oszillograph.gif', 203, 20304, 40, 1, './include/monitoring/log/viewWarnLog.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_downtime', './img/icones/16x16/warning.gif', 203, 20305, 50, 1, './include/monitoring/downtime.php', NULL, NULL, NULL, '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_comments', './img/icones/16x16/messages.gif', 203, 20306, 60, 1, './include/monitoring/comments.php', NULL, '0', '0', '1');
+
+--
+-- Configuration
+--
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_host', NULL, 6, 601, 10, 1, './include/configuration/configObject/host/host.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_service', NULL, 6, 602, 20, 1, './include/configuration/configObject/service/serviceByHost.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_notification', NULL, 6, 603, 30, 1, './include/configuration/configObject/contactgroup/contactGroup.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_escalation', NULL, 6, 604, 40, 1, './include/configuration/configObject/escalation/escalation.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_dependencies', NULL, 6, 605, 50, 1, './include/configuration/configObject/host_dependency/hostDependency.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_template', NULL, 6, 606, 60, 1, './include/configuration/configObject/host_template_model/hostTemplateModel.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_host', './img/icones/16x16/server_network.gif', 601, 60101, 10, 1, './include/configuration/configObject/host/host.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_hostgroup', './img/icones/16x16/clients.gif', 601, 60102, 20, 1, './include/configuration/configObject/hostgroup/hostGroup.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_nagios', NULL, 6, 607, 70, 1, './include/configuration/configGenerate/generateFiles.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_serviceByHost', './img/icones/16x16/element_new_after.gif', 602, 60201, 10, 1, './include/configuration/configObject/service/serviceByHost.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_serviceByHostGroup', './img/icones/16x16/elements1.gif', 602, 60202, 20, 1, './include/configuration/configObject/service/serviceByHostGroup.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_servicegroup', './img/icones/16x16/branch_element.gif', 602, 60203, 30, 1, './include/configuration/configObject/servicegroup/serviceGroup.php', NULL, '0', '0', '1');
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_contactgroup', './img/icones/16x16/users_family.gif', 603, 60301, 10, 1, './include/configuration/configObject/contactgroup/contactGroup.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_contact', './img/icones/16x16/user1.gif', 603, 60302, 20, 1, './include/configuration/configObject/contact/contact.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_timeperiod', './img/icones/16x16/calendar.gif', 603, 60304, 40, 1, './include/configuration/configObject/timeperiod/timeperiod.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_commandNotif', './img/icones/16x16/exchange.gif', 603, 60305, 50, 1, './include/configuration/configObject/command/command.php', '&type=1', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_host_template_model', './img/icones/16x16/server_client_ext.gif', 606, 60601, 10, 1, './include/configuration/configObject/host_template_model/hostTemplateModel.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_service_template_model', './img/icones/16x16/element_template.gif', 606, 60602, 20, 1, './include/configuration/configObject/service_template_model/serviceTemplateModel.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_gen_nagios', './img/icones/16x16/component_green.gif', 607, 60701, 10, 1, './include/configuration/configGenerate/generateFiles.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_load_nagios', './img/icones/16x16/component_add.gif', 607, 60702, 20, 1, './include/configuration/configLoad/loadFiles.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_nagiosCFG', './img/icones/16x16/text_code_colored.gif', 607, 60703, 30, 1, './include/configuration/configNagios/nagios.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_resource', './img/icones/16x16/text_code.gif', 607, 60704, 40, 1, './include/configuration/configResources/resources.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_perfparse', './img/icones/16x16/text_code_java2.gif', 607, 60705, 50, 1, './include/configuration/configPerfparse/perfparse.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_escalation', './img/icones/16x16/bookmark.gif', 604, 60401, 10, 1, './include/configuration/configObject/escalation/escalation.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_hostesc', './img/icones/16x16/bookmarks.gif', 604, 60402, 20, 1, './include/configuration/configObject/escalation/escalation.php', '&list=h', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_serviceesc', './img/icones/16x16/bookmarks.gif', 604, 60403, 30, 1, './include/configuration/configObject/escalation/escalation.php', '&list=sv', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_hostgroupesc', './img/icones/16x16/bookmarks.gif', 604, 60404, 40, 1, './include/configuration/configObject/escalation/escalation.php', '&list=hg', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'h', './img/icones/16x16/server_network.gif', 605, 60501, 10, 1, './include/configuration/configObject/host_dependency/hostDependency.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'hg', './img/icones/16x16/clients.gif', 605, 60502, 20, 1, './include/configuration/configObject/hostgroup_dependency/hostGroupDependency.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'sv', './img/icones/16x16/element_new_after.gif', 605, 60503, 30, 1, './include/configuration/configObject/service_dependency/serviceDependency.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'sg', './img/icones/16x16/branch_element.gif', 605, 60504, 40, 1, './include/configuration/configObject/servicegroup_dependency/serviceGroupDependency.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_cgi', './img/icones/16x16/text_code_c.gif', 607, 60707, 55, 1, './include/configuration/configCGI/CGI.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_meta_service', './img/icones/16x16/workstation2.gif', 602, 60204, 40, 1, './include/configuration/configObject/meta_service/metaService.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_metaserviceesc', './img/icones/16x16/bookmarks.gif', 604, 60405, 50, 1, './include/configuration/configObject/escalation/escalation.php', '&list=ms', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'ms', './img/icones/16x16/workstation2.gif', 605, 60505, 50, 1, './include/configuration/configObject/metaservice_dependency/MetaServiceDependency.php', NULL, '0', '0', '1');
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_traps_command', './img/icones/16x16/funnel_new.gif', 602, 60205, 50, 2, './include/configuration/configObject/traps/traps.php', NULL, NULL, NULL, '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'mod_purgePolicy', './img/icones/16x16/data_down.gif', '606', '60603', '30', '1', './modules/purge/purgePolicy/purgePolicy.php', NULL , '0', '0', '1');
+
+--
+-- Options
+--
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_opt_conf', NULL, 5, 501, 10, 1, './include/options/oreon/myAccount/formMyAccount.php', '&o=c', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_general', './img/icones/16x16/lifebelt.gif', 501, 50101, 10, 1, './include/options/oreon/generalOpt/generalOpt.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_commandCheck', './img/icones/16x16/exchange.gif', 607, 60706, 60, 1, './include/configuration/configObject/command/command.php', '&type=2', '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_lang', './img/icones/16x16/about.gif', 501, 50102, 20, 1, './include/options/oreon/language/lang.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_menu', './img/icones/16x16/press.gif', 501, 50103, 30, 1, './include/options/oreon/menu/menu.php', NULL, NULL, NULL, '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_acl', NULL, 5, 502, 10, 1, './include/options/LCA/define/lca.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_db', NULL, 5, 503, 10, 1, './include/options/db/extractDB/extractDB.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_extract_db', './img/icones/16x16/undo.gif', 503, 50301, 10, 1, './include/options/db/extractDB/extractDB.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_sessions', NULL, 5, 504, 10, 1, './include/options/session/connected_user.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_server_status', NULL, 5, 505, 10, 1, './include/options/sysInfos/index.php', NULL, '0', '0', '1');
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_web', './img/icones/16x16/earth2.gif', 506, 50602, 20, 1, 'http://www.oreon-project.org', NULL, '1', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_forum', './img/icones/16x16/book_yellow.gif', 506, 50602, 30, 1, 'http://forum.oreon-project.org', NULL, '1', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_views_map', './img/icones/16x16/download.gif', 401, 40102, 20, 1, './include/views/localisation/maps/map.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_wiki', './img/icones/16x16/book_green.gif', 506, 50604, 40, 1, 'http://wiki.oreon-project.org', NULL, '1', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_bug', './img/icones/16x16/trafficlight_on.gif', 506, 50605, 50, 1, 'http://bugs.oreon-project.org', NULL, '1', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_donate', './img/icones/16x16/flower_white.gif', 506, 50606, 60, 1, 'http://sourceforge.net/donate/index.php?group_id=140316', NULL, '1', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_pro', './img/icones/16x16/cd_gold.gif', 506, 50607, 70, 1, 'http://www.oreon-services.com', NULL, '1', '0', '1');
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_about', NULL, 5, 506, 10, 1, './include/options/about/about.php', NULL, NULL, NULL, '1');
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_myAccount', './img/icones/16x16/user1_message.gif', 501, 50104, 40, 1, './include/options/oreon/myAccount/formMyAccount.php', '&o=c', '0', '0', '1');
+
+--
+-- Reporting
+--
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_report', NULL, 3, 302, 10, 1, './include/reporting/reports/list/list.php', NULL, '0', '0', '0');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_rtList', './img/icones/16x16/thermometer.gif', 302, 30201, 10, 1, './include/reporting/reports/list/list.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_rtNotif', NULL, 3, 303, 20, 1, './include/reporting/diff/list/diff.php', NULL, '0', '0', '0');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_rtMailList', './img/icones/16x16/masks.gif', 303, 30301, 10, 1, './include/reporting/diff/list/diff.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_rtMail', './img/icones/16x16/flag_green.gif', 303, 30302, 20, 1, './include/reporting/diff/mailDB/mailDB.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_rtStat', './img/icones/16x16/form_green.gif', 302, 30202, 20, 1, './include/reporting/reports/list/list.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_message', NULL, 3, 304, 40, 1, './include/reporting/message/message.php', NULL, '0', '0', '0');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_cartography', NULL, 3, 305, 50, 1, './include/reporting/viewStatusMap.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_status_map', './img/icones/16x16/server_network.gif', 302, 30203, 30, 1, './include/reporting/viewStatusMap.php', NULL, '0', '0', '1');
+
+
+--
+-- Oreon Views
+--
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_views_loc', NULL, 4, 401, 30, 1, './include/views/localisation/countries/country.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_views_cty', './img/icones/16x16/earth_location.gif', 401, 40101, 10, 1, './include/views/localisation/countries/country.php', NULL, '0', '0', '1');
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_views_graphs', NULL, 4, 402, 10, 1, './include/views/graphs/graphPlugins/graphPlugins.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_views_graphCustom', './img/icones/16x16/chart.gif', 402, 40201, 10, 1, './include/views/graphs/graphCustoms/graphCustoms.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_views_graphShow', './img/icones/16x16/column-chart.gif', 402, 40202, 20, 1, './include/views/graphs/simpleRenderer/simpleRenderer.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_views_graphPlu', './img/icones/16x16/line-chart.gif', 402, 40203, 30, 1, './include/views/graphs/graphPlugins/graphPlugins.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_views_graphTmp', './img/icones/16x16/layout_vertical.gif', 402, 40204, 40, 1, './include/views/graphs/graphTemplates/graphTemplates.php', NULL, '0', '0', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_views_compoTmp', './img/icones/16x16/layout_horizontal.gif', 402, 40205, 50, 1, './include/views/graphs/componentTemplates/componentTemplates.php', NULL, '0', '0', '1');
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_views_mine', './img/icones/16x16/presentation_chart.gif', 402, 40206, 5, 1, './include/views/graphs/myViews/myViews.php', NULL, '0', '0', '0');
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'view_redirect_graph', NULL , '402', '40207', '70', 1, './include/views/graphs/graphSummary/graphSummary.php', NULL , '0', '0', '0');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_host_graph','./img/icones/16x16/column-chart.gif',402,40208,32,1, './include/views/graphs/hostGraphs/hostGraphs.php',NULL,'0','0','1');
+
+
+--
+-- Id Cards
+--
+
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_idCards', NULL, NULL, 7, 45, 1, './modules/inventory/inventory.php', NULL, '0', '1', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_id_serv', NULL, 7, 701, 10, 1, './modules/inventory/inventory.php', '&o=s', '0', '1', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_id_network', NULL, 7, 702, 20, 1, './modules/inventory/inventory.php', '&o=n', '0', '1', '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_other_ressources', NULL, 7, 701, 30, 1, './modules/inventory/inventory.php', '&o=o', NULL, NULL, '1');
+INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('', 'm_idUpdate', NULL, 7, 701, 40, 1, './modules/inventory/inventory.php', '&o=u', NULL, NULL, '1');
+
diff --git a/www/install/install.css b/www/install/install.css
new file mode 100644
index 0000000000000000000000000000000000000000..12598ceb55dcb61cb0180a4ebc4e538c774f8f26
--- /dev/null
+++ b/www/install/install.css
@@ -0,0 +1,143 @@
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+
+BODY {
+	margin: 0px 0px 0px 0px;
+	background-color : #888888 ;
+	color : #333333;
+	}
+
+
+tr,td,th,table {
+	font-family: Arial, Verdana, Helvetica, sans-serif;
+	font-size: 12px;
+	color: #333333;
+	vertical-align: top;
+	}
+
+p {MARGIN-TOP: 0px; MARGIN-BOTTOM: 10px}
+
+hr  {
+	color: #888888;
+	width: 100%;
+	height: 1px;
+	margin: 0px;
+	}
+
+a:link, a:visited {
+	font-size: 12px; color: #333333; text-decoration: none;
+	font-family:  Arial, Verdana, Helvetica, sans-serif;
+    text-decoration: underline;
+	}
+
+a:hover {
+	color: #EA1313;	text-decoration: none;
+    text-decoration: underline;
+	}
+
+input,select {
+	border: 1px solid #888888;
+	font-size: 11px;
+	background-color: #ffffff;
+	}
+
+textarea {
+	border: 1px solid #888888;
+	color: #222222;
+	font-size: 11px;
+	background-color: #ffffff;
+	}
+
+.checkbox {
+	border:0px;
+	background-color: transparent;
+	}
+
+.button {
+	border: 1px solid #888888;
+	font-size: 12px;
+	color: #ffffff;
+	background-color: #444444;
+	font-weight: bold;
+	}
+/* custom */
+
+table.shell {
+	/*background-color: #ffffff;*/
+	width: 600px;
+	height: 300px;
+	margin-top: 20px;
+	margin-bottom: 100px;
+	border: 1px solid #111111;
+	}
+
+table.shell th {
+	border-bottom: 1px solid #888888;
+	/*background-color: #ffffff;*/
+	color: #888888;
+	font-size: 16px;
+	font-weight: bold;
+	padding: 6px;
+	text-align: left;
+	}
+
+table.shell td {
+	padding: 6px;
+	background-color: #dddddd;
+
+	}
+
+table.stdTable td {
+
+	padding: 2px;
+	}
+table.stdTable th {
+
+	padding: 2px;
+
+	}
+
+table.StyleDottedHr td {
+border-bottom: 1px dotted #cccccc;
+	padding: 2px;
+	}
+table.StyleDottedHr th {
+
+	padding: 2px;
+	background-color: #444444;
+	font-size: 14px;
+	color: #dddddd;
+	}
+
+
+.small {
+	font-size: 10px;
+	}
+.stop {
+	color: #cc0000;
+	}
+.warning {
+	color: #DE9F25;
+	}
+.go {
+	color: #00cc00;
+	}
+.required {
+	color: #ff2222;
+	font-weight: bold;
+	}
+
diff --git a/www/install/pear_module.conf.php b/www/install/pear_module.conf.php
new file mode 100644
index 0000000000000000000000000000000000000000..52e16c18afe0ee9b764e6bc7c2695e5289855ede
--- /dev/null
+++ b/www/install/pear_module.conf.php
@@ -0,0 +1,145 @@
+<?
+$pear_module[0]["name"] = "DB";
+$pear_module[0]["version"] = "1.7.6";
+$pear_module[0]["file"] = "DB-1.7.6.tgz";
+$pear_module[0]["path"] = "DB.php";
+
+$pear_module[1]["name"] = "DB_DataObject";
+$pear_module[1]["version"] = "1.8.4";
+$pear_module[1]["file"] = "DB_DataObject-1.8.4.tgz";
+$pear_module[1]["path"] = "DB/DataObject.php";
+
+$pear_module[2]["name"] = "DB_DataObject_FormBuilder";
+$pear_module[2]["version"] = "1.0.0RC4";
+$pear_module[2]["file"] = "DB_DataObject_FormBuilder-1.0.0RC4.tgz";
+$pear_module[2]["path"] = "DB/DataObject/FormBuilder.php";
+
+$pear_module[3]["name"] = "MDB2";
+$pear_module[3]["version"] = "2.0.0";
+$pear_module[3]["file"] = "MDB2-2.0.0.tgz";
+$pear_module[3]["path"] = "MDB2.php";
+
+$pear_module[4]["name"] = "Date";
+$pear_module[4]["version"] = "1.4.6";
+$pear_module[4]["file"] = "Date-1.4.6.tgz";
+$pear_module[4]["path"] = "Date.php";
+
+$pear_module[5]["name"] = "Numbers_Roman";
+$pear_module[5]["version"] = "1.0.1";
+$pear_module[5]["file"] = "Numbers_Roman-1.0.1.tgz";
+$pear_module[5]["path"] = "Numbers/Roman.php";
+
+$pear_module[6]["name"] = "Numbers_Words";
+$pear_module[6]["version"] = "0.14.0";
+$pear_module[6]["file"] = "Numbers_Words-0.14.0.tgz";
+$pear_module[6]["path"] = "Numbers/Words.php";
+
+$pear_module[7]["name"] = "HTML_Common";
+$pear_module[7]["version"] = "1.2.2";
+$pear_module[7]["file"] = "HTML_Common-1.2.2.tgz";
+$pear_module[7]["path"] = "HTML/Common.php";
+
+$pear_module[8]["name"] = "HTML_QuickForm";
+$pear_module[8]["version"] = "3.2.5";
+$pear_module[8]["file"] = "HTML_QuickForm-3.2.5.tgz";
+$pear_module[8]["path"] = "HTML/QuickForm.php";
+
+$pear_module[9]["name"] = "HTML_QuickForm_advmultiselect";
+$pear_module[9]["version"] = "1.1.0";
+$pear_module[9]["file"] = "HTML_QuickForm_advmultiselect-1.1.0.tgz";
+$pear_module[9]["path"] = "HTML/QuickForm/advmultiselect.php";
+
+$pear_module[10]["name"] = "HTML_Table";
+$pear_module[10]["version"] = "1.6.1";
+$pear_module[10]["file"] = "HTML_Table-1.6.1.tgz";
+$pear_module[10]["path"] = "HTML/Table.php";
+
+$pear_module[11]["name"] = "Archive_Tar";
+$pear_module[11]["version"] = "1.1";
+$pear_module[11]["file"] = "Archive_Tar-1.1.tgz";
+$pear_module[11]["path"] = "Archive/Tar.php";
+
+$pear_module[12]["name"] = "Auth_SASL";
+$pear_module[12]["version"] = "1.0.1";
+$pear_module[12]["file"] = "Auth_SASL-1.0.1.tgz";
+$pear_module[12]["path"] = "Auth/SASL.php";
+
+$pear_module[13]["name"] = "Console_Getopt";
+$pear_module[13]["version"] = "1.2";
+$pear_module[13]["file"] = "Console_Getopt-1.2.tgz";
+$pear_module[13]["path"] = "Console/Getopt.php";
+
+$pear_module[14]["name"] = "HTTP";
+$pear_module[14]["version"] = "1.2.2";
+$pear_module[14]["file"] = "HTTP-1.2.2.tgz";
+$pear_module[14]["path"] = "HTTP.php";
+
+$pear_module[15]["name"] = "Image_Canvas";
+$pear_module[15]["version"] = "0.2.4";
+$pear_module[15]["file"] = "Image_Canvas-0.2.4.tgz";
+$pear_module[15]["path"] = "Image/Canvas.php";
+
+$pear_module[16]["name"] = "Image_Color";
+$pear_module[16]["version"] = "1.0.2";
+$pear_module[16]["file"] = "Image_Color-1.0.2.tgz";
+$pear_module[16]["path"] = "Image/Color.php";
+
+$pear_module[17]["name"] = "Image_Graph";
+$pear_module[17]["version"] = "0.7.1";
+$pear_module[17]["file"] = "Image_Graph-0.7.1.tgz";
+$pear_module[17]["path"] = "Image/Graph.php";
+
+$pear_module[18]["name"] = "Image_GraphViz";
+$pear_module[18]["version"] = "1.1.0";
+$pear_module[18]["file"] = "Image_GraphViz-1.1.0.tgz";
+$pear_module[18]["path"] = "Image/GraphViz.php";
+
+$pear_module[19]["name"] = "Mail";
+$pear_module[19]["version"] = "1.1.9";
+$pear_module[19]["file"] = "Mail-1.1.9.tgz";
+$pear_module[19]["path"] = "Mail.php";
+
+$pear_module[20]["name"] = "Mail_Mime";
+$pear_module[20]["version"] = "1.3.1";
+$pear_module[20]["file"] = "Mail_Mime-1.3.1.tgz";
+$pear_module[20]["path"] = "Mail/mime.php";
+
+$pear_module[21]["name"] = "Net_SMTP";
+$pear_module[21]["version"] = "1.2.8";
+$pear_module[21]["file"] = "Net_SMTP-1.2.8.tgz";
+$pear_module[21]["path"] = "Net/SMTP.php";
+
+$pear_module[22]["name"] = "Net_Socket";
+$pear_module[22]["version"] = "1.0.1";
+$pear_module[22]["file"] = "Net_Socket-1.0.1.tgz";
+$pear_module[22]["path"] = "Net/Socket.php";
+
+$pear_module[23]["name"] = "Net_Traceroute";
+$pear_module[23]["version"] = "0.21";
+$pear_module[23]["file"] = "Net_Traceroute-0.21";
+$pear_module[23]["path"] = "Net/Traceroute.php";
+
+$pear_module[24]["name"] = "Net_Ping";
+$pear_module[24]["version"] = "2.4.1";
+$pear_module[24]["file"] = "Net_Ping-2.4.1.tgz";
+$pear_module[24]["path"] = "Net/Ping.php";
+
+$pear_module[25]["name"] = "Validate";
+$pear_module[25]["version"] = "0.6.2";
+$pear_module[25]["file"] = "Validate-0.6.2.tgz";
+$pear_module[25]["path"] = "Validate.php";
+
+/*
+  
+$pear_module[26]["name"] = "XML_Parser";
+$pear_module[26]["version"] = "1.0.1";
+$pear_module[26]["file"] = "XML_Parser-1.0.1.tgz";
+$pear_module[26]["path"] = "XML/Parser.php";
+
+*/
+
+$pear_module[27]["name"] = "XML_RPC";
+$pear_module[27]["version"] = "1.4.5";
+$pear_module[27]["file"] = "XML_RPC-1.4.5.tgz";
+$pear_module[27]["path"] = "XML/RPC.php";
+?>
\ No newline at end of file
diff --git a/www/install/php/update-1.3-RC2.php b/www/install/php/update-1.3-RC2.php
new file mode 100644
index 0000000000000000000000000000000000000000..e2414aee709794d860766898ad560b659fc55c6b
--- /dev/null
+++ b/www/install/php/update-1.3-RC2.php
@@ -0,0 +1,12 @@
+<?
+$oreon = NULL;
+require_once ("../../oreon.conf.php");
+require_once ("../../DBconnect.php");
+
+$res =& $pearDB->query("SELECT service_id FROM service");
+while($res->fetchInto($service))	{
+	$rq = "INSERT INTO `extended_service_information` ( `esi_id` , `service_service_id` , `esi_notes` , `esi_notes_url` , `esi_action_url` , `esi_icon_image` , `esi_icon_image_alt` ) ";
+	$rq .= "VALUES (NULL , '".$service["service_id"]."', NULL , NULL , NULL , NULL , NULL);";
+	$pearDB->query($rq);	
+}
+?>
\ No newline at end of file
diff --git a/www/install/setup.php b/www/install/setup.php
new file mode 100644
index 0000000000000000000000000000000000000000..ffb99173b6a117299177f340663d308a00fe67eb
--- /dev/null
+++ b/www/install/setup.php
@@ -0,0 +1,91 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+// configuration
+
+	include_once ("../class/Session.class.php");
+	include_once ("DB-Func.php");
+	Session::start();
+	ini_set("track_errors",true);
+	if (file_exists("installoreon.conf.php")) {
+	   include_once ("installoreon.conf.php");
+	}
+	// Pear Modules Management
+	if (file_exists("pear_module.conf.php")) {
+	   include_once ("pear_module.conf.php");
+	}
+
+	$DEBUG = 0;
+	$msg = NULL;
+	$return_false = NULL;
+
+	$pear_path = $conf_installoreon['pear_dir'];
+
+
+	if (isset($_POST["step"]) && $_POST["step"] == 4 && isset($_POST["Recheck"]))
+		 $_POST["step"] = 3;
+	if (isset($_POST["step"]) && $_POST["step"] == 5 && isset($_POST["Recheck"]))
+		 $_POST["step"] = 4;
+	if (isset($_POST["step"]) && $_POST["step"] == 7 && isset($_POST["Recheck"]))
+		 $_POST["step"] = 6;
+	if (isset($_POST["step"]) && $_POST["step"] == 10 && isset($_POST["Recheck"]))
+		 $_POST["step"] = 9;
+/*	if (isset($_POST["install_missing_pear_module"]) && isset($_POST["pear_module"]) && $_POST["step"] == 5) {
+/		 $_POST["step"] = 4;
+
+		exec('sudo pear install '. $pear_module["$package_file"]);
+
+	}*/
+
+	if (isset($_POST["goto"]) && !strcmp($_POST["goto"], "Back"))
+		 $_POST["step"] -= 2;
+	if (isset($_POST["step"]) && $_POST["step"] == 6 && isset($_POST["pwdOreonDB"]) && strcmp($_POST["pwdOreonDB"], $_POST["pwdOreonDB2"])){
+		$_POST["step"] = 5;
+		$passwd_error = "Password not confirmed correctly.";
+	}
+	if (isset($_POST["step"]) && $_POST["step"] == 7 && isset($_POST["oreonpasswd"])  && strcmp($_POST["oreonpasswd"], $_POST["oreonpasswd2"])){
+		$_POST["step"] = 6;
+		$passwd_error = "Password not confirmed correctly.";
+	}
+
+	if (!isset($_POST["step"]))
+		include("./steps/step1.php");
+	else if (isset($_POST["step"]) && $_POST["step"] == 1)
+		include("./steps/step2.php");
+	else if (isset($_POST["step"]) && $_POST["step"] == 2)
+		include("./steps/step3.php");
+	else if (isset($_POST["step"]) && $_POST["step"] == 3)
+		include("./steps/step4.php");
+	else if (isset($_POST["step"]) && $_POST["step"] == 4)
+		include("./steps/step5.php");
+	else if (isset($_POST["step"]) && $_POST["step"] == 5)
+		include("./steps/step6.php");
+	else if (isset($_POST["step"]) && $_POST["step"] == 6)
+		include("./steps/step7.php");
+	else if (isset($_POST["step"]) && $_POST["step"] == 7)
+		include("./steps/step8.php");
+	else if (isset($_POST["step"]) && $_POST["step"] == 8)
+		include("./steps/step9.php");
+	else if (isset($_POST["step"]) && $_POST["step"] == 9)
+		include("./steps/step10.php");
+	else if (isset($_POST["step"]) && $_POST["step"] == 10)
+		include("./steps/step11.php");
+	else if (isset($_POST["step"]) && $_POST["step"] == 11)
+		include("./steps/step12.php");
+		ini_set("track_errors",false);
+	exit();
+?>
diff --git a/www/install/sql/UpdateDB-1.3-RC2.sql b/www/install/sql/UpdateDB-1.3-RC2.sql
new file mode 100644
index 0000000000000000000000000000000000000000..370d37fe4afa037774c912787cf82e1ba1d0fbed
--- /dev/null
+++ b/www/install/sql/UpdateDB-1.3-RC2.sql
@@ -0,0 +1,180 @@
+ALTER TABLE `giv_components_template` ADD `ds_invert` ENUM( '0', '1' ) NULL AFTER `ds_transparency` ;
+
+
+
+ALTER TABLE `extended_service_information` DROP FOREIGN KEY `extended_service_information_ibfk_1`;
+ALTER TABLE `extended_service_information` DROP INDEX `host_index`;
+ALTER TABLE `extended_service_information` DROP `host_host_id`;
+ALTER TABLE `extended_service_information` ADD `graph_id` INT NULL ;
+ALTER TABLE `extended_service_information`  ADD KEY graph_index( graph_id );
+ALTER TABLE `extended_service_information`  ADD CONSTRAINT `extended_service_information_ibfk_1` FOREIGN KEY ( `graph_id` ) REFERENCES `giv_graphs_template` ( `graph_id` ) ON DELETE SET NULL ;
+ALTER TABLE `giv_graphs_template` ADD `period` INT NULL AFTER `vertical_label` ;
+ALTER TABLE `giv_graphs_template` ADD `step` INT NULL AFTER `period` ;
+ALTER TABLE `giv_graphs_template` ADD `lower_limit` INT NULL AFTER `height` , ADD `upper_limit` INT NULL AFTER `lower_limit` ;
+
+-- 27/06/2006 ----------
+
+-- Add Authentification type for LDAP compatibility --
+
+ALTER TABLE `contact` ADD `contact_auth_type` VARCHAR( 255 ) NULL AFTER `contact_activate`;
+ALTER TABLE `contact` ADD `contact_ldap_dn` varchar(255) NULL AFTER `contact_auth_type`;
+
+ALTER TABLE  `general_opt` ADD `ldap_host` varchar(254) default NULL AFTER `template` ;
+ALTER TABLE  `general_opt` ADD `ldap_port` varchar(5) default '389' AFTER `ldap_host`;
+ALTER TABLE  `general_opt` ADD `ldap_base_dn` varchar(254) default NULL AFTER `ldap_port`;
+ALTER TABLE  `general_opt` ADD `ldap_login_attrib` varchar(254) default 'dn' AFTER `ldap_base_dn`;
+ALTER TABLE  `general_opt` ADD `ldap_ssl` enum('0','1') default NULL AFTER `ldap_login_attrib`;
+ALTER TABLE  `general_opt` ADD `ldap_auth_enable` enum('0','1') default NULL AFTER `ldap_ssl`;
+
+-- Template added --
+
+ALTER TABLE `general_opt` ADD `template` VARCHAR( 255 ) NULL AFTER `maxViewConfiguration`;
+UPDATE `general_opt` SET `template` = 'Basic_light' WHERE `gopt_id` =1 LIMIT 1 ;
+
+-- Trap Module --
+
+ALTER TABLE `general_opt` ADD `snmp_trapd_path_daemon` VARCHAR( 255 ) NULL AFTER `snmp_version` ,
+ADD `snmp_trapd_path_conf` VARCHAR( 255 ) NULL AFTER `snmp_trapd_path_daemon` ;
+
+
+CREATE TABLE `traps_service_relation` (
+  `tsr_id` int(11) NOT NULL auto_increment,
+  `traps_id` int(11) default NULL,
+  `service_id` int(11) default NULL,
+  PRIMARY KEY  (`tsr_id`),
+  KEY `service_index` (`service_id`),
+  KEY `traps_index` (`traps_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
+
+
+CREATE TABLE `traps` (
+  `traps_id` int(11) NOT NULL auto_increment,
+  `traps_name` varchar(255) default NULL,
+  `traps_oid` varchar(255) default NULL,
+  `traps_handler` varchar(255) default NULL,
+  `traps_args` varchar(255) default NULL,
+  `traps_comments` varchar(255) default NULL,
+  UNIQUE KEY `traps_name` (`traps_name`),
+  KEY `traps_id` (`traps_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+ALTER TABLE `traps_service_relation`
+  ADD CONSTRAINT `traps_service_relation_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `service` (`service_id`) ON DELETE CASCADE,
+  ADD CONSTRAINT `traps_service_relation_ibfk_2` FOREIGN KEY (`traps_id`) REFERENCES `traps` (`traps_id`) ON DELETE CASCADE;
+
+------------------------
+-- 28/06/2006
+
+ALTER TABLE `topology` ADD `topology_group` INT NULL AFTER `topology_order` ;
+UPDATE topology SET topology_group = '1';
+
+INSERT INTO `topology` (`topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES
+('m_traps_command', './img/icones/16x16/funnel_new.gif', 602, 60205, 50, 2, './include/configuration/configObject/traps/traps.php', NULL, NULL, NULL, '1');
+
+
+-- 29/06/2006
+
+CREATE TABLE `purge_policy` (
+  `purge_policy_id` int(11) NOT NULL auto_increment,
+  `purge_policy_name` varchar(255) default NULL,
+  `purge_policy_alias` varchar(255) default NULL,
+  `purge_policy_retention` int(11) default NULL,
+  `purge_policy_raw` enum('0','1') default '0',
+  `purge_policy_bin` enum('0','1') default '0',
+  `purge_policy_metric` enum('0','1') default '0',
+  `purge_policy_service` enum('0','1') default '0',
+  `purge_policy_host` enum('0','1') default '0',
+  `purge_policy_comment` text,
+  PRIMARY KEY  (`purge_policy_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO `topology` ( `topology_id` , `topology_name` , `topology_icone` , `topology_parent` , `topology_page` , `topology_order` , `topology_group` , `topology_url` , `topology_url_opt` , `topology_popup` , `topology_modules` , `topology_show` )
+VALUES (
+NULL , 'mod_purgePolicy', './img/icones/16x16/data_down.gif', '606', '60603', '30', '1', './include/configuration/configObject/purgePolicy/purgePolicy.php', NULL , '0', '0', '1'
+);
+
+ALTER TABLE `service` ADD `purge_policy_id` INT NULL AFTER `timeperiod_tp_id2` ;
+ALTER TABLE `service` ADD INDEX `purge_index` ( `purge_policy_id` ) ;
+ALTER TABLE `service`   ADD  FOREIGN KEY (`purge_policy_id`) REFERENCES `purge_policy` (`purge_policy_id`) ON DELETE SET NULL;
+ALTER TABLE `host` ADD `purge_policy_id` INT NULL AFTER `timeperiod_tp_id2` ;
+ALTER TABLE `host` ADD INDEX `purge_index` ( `purge_policy_id` ) ;
+ALTER TABLE `host`
+  ADD CONSTRAINT `host_ibfk_1` FOREIGN KEY (`command_command_id`) REFERENCES `command` (`command_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `host_ibfk_2` FOREIGN KEY (`command_command_id2`) REFERENCES `command` (`command_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `host_ibfk_3` FOREIGN KEY (`timeperiod_tp_id`) REFERENCES `timeperiod` (`tp_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `host_ibfk_4` FOREIGN KEY (`timeperiod_tp_id2`) REFERENCES `timeperiod` (`tp_id`) ON DELETE SET NULL,
+  ADD CONSTRAINT `host_ibfk_5` FOREIGN KEY (`purge_policy_id`) REFERENCES `purge_policy` (`purge_policy_id`) ON DELETE SET NULL;
+
+
+--
+-- Structure de la table `log_archive_file_name`
+--
+
+CREATE TABLE `log_archive_file_name` (
+  `id_log_file` int(11) NOT NULL auto_increment,
+  `file_name` varchar(200) default NULL,
+  `date` int(11) default NULL,
+  PRIMARY KEY  (`id_log_file`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=65 ;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `log_archive_host`
+--
+
+CREATE TABLE `log_archive_host` (
+  `log_id` int(11) NOT NULL auto_increment,
+  `host_id` int(11) default NULL,
+  `UPTimeScheduled` int(11) default NULL,
+  `UPTimeUnScheduled` int(11) default NULL,
+  `DOWNTimeScheduled` int(11) default NULL,
+  `DOWNTimeUnScheduled` int(11) default NULL,
+  `UNREACHABLETimeScheduled` int(11) default NULL,
+  `UNREACHABLETimeUnScheduled` int(11) default NULL,
+  `UNDETERMINATETimeScheduled` int(11) default NULL,
+  `UNDETERMINATETimeUnScheduled` int(11) default NULL,
+  `date_end` int(11) default NULL,
+  `date_start` int(11) default NULL,
+  PRIMARY KEY  (`log_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=42398 ;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `log_archive_service`
+--
+
+CREATE TABLE `log_archive_service` (
+  `log_id` int(11) NOT NULL auto_increment,
+  `host_id` int(11) NOT NULL default '0',
+  `service_id` int(11) NOT NULL default '0',
+  `OKTimeScheduled` int(11) NOT NULL default '0',
+  `OKTimeUnScheduled` int(11) NOT NULL default '0',
+  `WARNINGTimeScheduled` int(11) NOT NULL default '0',
+  `WARNINGTimeUnScheduled` int(11) NOT NULL default '0',
+  `UNKNOWNTimeScheduled` int(11) NOT NULL default '0',
+  `UNKNOWNTimeUnScheduled` int(11) NOT NULL default '0',
+  `CRITICALTimeScheduled` int(11) NOT NULL default '0',
+  `CRITICALTimeUnScheduled` int(11) NOT NULL default '0',
+  `UNDETERMINATETimeScheduled` int(11) NOT NULL default '0',
+  `UNDETERMINATETimeUnScheduled` int(11) NOT NULL default '0',
+  `date_start` int(11) default NULL,
+  `date_end` int(11) default NULL,
+  PRIMARY KEY  (`log_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=19692 ;
+
+-- --------------------------------------------------------
+--05 07 06
+
+UPDATE topology SET topology_name = 'view_redirect_graph' WHERE topology_page = '40207';
+
+
+
+-- 07 07 06
+
+ALTER TABLE `cfg_nagios` CHANGE `sleep_time` `sleep_time` VARCHAR(10) NULL DEFAULT NULL;
+INSERT INTO `topology` (`topology_name`, `topology_icone`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`) VALUES ('m_host_graph','./img/icones/16x16/column-chart.gif',402,40208,32,1, './include/views/graphs/hostGraphs/hostGraphs.php',NULL,'0','0','1');
+
+
+-- --------------------------------------------------------
\ No newline at end of file
diff --git a/www/install/sql/UpdateDB-1.3beta2.sql b/www/install/sql/UpdateDB-1.3beta2.sql
new file mode 100644
index 0000000000000000000000000000000000000000..434fe255726c6823851efbf4c2e9ad6f258c07ac
--- /dev/null
+++ b/www/install/sql/UpdateDB-1.3beta2.sql
@@ -0,0 +1,108 @@
+INSERT INTO `topology` ( `topology_id` , `topology_name` , `topology_icone` , `topology_parent` , `topology_page` , `topology_order` , `topology_url` , `topology_url_opt` , `topology_popup` , `topology_modules` , `topology_show` )
+VALUES (
+NULL , 'graph', NULL , '402', '40207', '60', './include/views/graphs/graphSummary/graphSummary.php', NULL , '0', '0', '0'
+);
+
+INSERT INTO `topology` ( `topology_id` , `topology_name` , `topology_icone` , `topology_parent` , `topology_page` , `topology_order` , `topology_url` , `topology_url_opt` , `topology_popup` , `topology_modules` , `topology_show` )
+VALUES (
+'', 'm_idUpdate', NULL, 7, 701, 40, './modules/inventory/inventory.php', '&o=u', NULL, NULL, '1'
+);
+
+
+ALTER TABLE `general_opt` ADD `maxViewMonitoring` INT NOT NULL DEFAULT '50',
+ADD `maxViewConfiguration` INT NOT NULL DEFAULT '20';
+
+
+ALTER TABLE `giv_components_template` ADD `ds_invert` INT NULL DEFAULT 'NULL' AFTER `ds_transparency` ;
+
+ALTER TABLE `command` ADD `command_example` VARCHAR( 254 ) NULL AFTER `command_line` ;
+
+ALTER TABLE `cfg_nagios` ADD `p1_file` VARCHAR( 255 ) NULL AFTER `status_file` ;
+
+-- -------------------------------------------------------
+
+-- 
+-- Structure de la table `downtime`
+-- 
+
+CREATE TABLE `downtime` (
+  `downtime_id` int(11) NOT NULL auto_increment,
+  `host_id` int(11) NOT NULL default '0',
+  `service_id` int(11) default NULL,
+  `entry_time` timestamp NOT NULL default '0000-00-00 00:00:00',
+  `author` varchar(254) NOT NULL default '',
+  `comment` varchar(254) NOT NULL default '',
+  `start_time` varchar(15) NOT NULL default '',
+  `end_time` varchar(15) NOT NULL default '',
+  `fixed` enum('0','1') NOT NULL default '0',
+  `duration` int(11) NOT NULL default '0',
+  `deleted` enum('0','1') NOT NULL default '0',
+  PRIMARY KEY  (`downtime_id`)
+) TYPE=InnoDB;
+
+UPDATE `topology` SET `topology_icone` = NULL ,
+`topology_parent` = NULL ,
+`topology_url_opt` = NULL ,
+`topology_show` = '0' WHERE `topology_page` = '3' LIMIT 1 ;
+
+-- 
+-- Structure de la table `log_archive_file_name`
+-- 
+
+CREATE TABLE `log_archive_file_name` (
+  `id_log_file` int(11) NOT NULL auto_increment,
+  `file_name` varchar(200) default NULL,
+  `date` int(11) default NULL,
+  PRIMARY KEY  (`id_log_file`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=65 ;
+
+-- --------------------------------------------------------
+
+-- 
+-- Structure de la table `log_archive_host`
+-- 
+
+CREATE TABLE `log_archive_host` (
+  `log_id` int(11) NOT NULL auto_increment,
+  `host_id` int(11) default NULL,
+  `UPTimeScheduled` int(11) default NULL,
+  `UPTimeUnScheduled` int(11) default NULL,
+  `DOWNTimeScheduled` int(11) default NULL,
+  `DOWNTimeUnScheduled` int(11) default NULL,
+  `UNREACHABLETimeScheduled` int(11) default NULL,
+  `UNREACHABLETimeUnScheduled` int(11) default NULL,
+  `UNDETERMINATETimeScheduled` int(11) default NULL,
+  `UNDETERMINATETimeUnScheduled` int(11) default NULL,
+  `date_end` int(11) default NULL,
+  `date_start` int(11) default NULL,
+  PRIMARY KEY  (`log_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=42398 ;
+
+-- --------------------------------------------------------
+
+-- 
+-- Structure de la table `log_archive_service`
+-- 
+
+CREATE TABLE `log_archive_service` (
+  `log_id` int(11) NOT NULL auto_increment,
+  `host_id` int(11) NOT NULL default '0',
+  `service_id` int(11) NOT NULL default '0',
+  `OKTimeScheduled` int(11) NOT NULL default '0',
+  `OKTimeUnScheduled` int(11) NOT NULL default '0',
+  `WARNINGTimeScheduled` int(11) NOT NULL default '0',
+  `WARNINGTimeUnScheduled` int(11) NOT NULL default '0',
+  `UNKNOWNTimeScheduled` int(11) NOT NULL default '0',
+  `UNKNOWNTimeUnScheduled` int(11) NOT NULL default '0',
+  `CRITICALTimeScheduled` int(11) NOT NULL default '0',
+  `CRITICALTimeUnScheduled` int(11) NOT NULL default '0',
+  `UNDETERMINATETimeScheduled` int(11) NOT NULL default '0',
+  `UNDETERMINATETimeUnScheduled` int(11) NOT NULL default '0',
+  `date_start` int(11) default NULL,
+  `date_end` int(11) default NULL,
+  PRIMARY KEY  (`log_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=19692 ;
+
+-- --------------------------------------------------------
+
+
diff --git a/www/install/steps/step1.php b/www/install/steps/step1.php
new file mode 100644
index 0000000000000000000000000000000000000000..956b520b5a47d80bc3d013e6d64aa206903edd87
--- /dev/null
+++ b/www/install/steps/step1.php
@@ -0,0 +1,25 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	aff_header("Oreon Setup Wizard", "Welcome to Oreon Setup", 1);
+	print "<p>This installer creates the Oreon database tables and sets the configuration variables that you need to start. The entire process should take about ten minutes.</p>";
+	aff_middle();
+	print "<input class='button' type='submit' name='goto' value='Start' id='defaultFocus' /></td>";
+	aff_footer();
+
+?>
\ No newline at end of file
diff --git a/www/install/steps/step10.php b/www/install/steps/step10.php
new file mode 100644
index 0000000000000000000000000000000000000000..6aa3894fcd8254f2e01aea7693262c509a7d0c81
--- /dev/null
+++ b/www/install/steps/step10.php
@@ -0,0 +1,126 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+if (isset($_POST["goto"]) && strcmp($_POST["goto"], "Back")){
+	$_SESSION["ldap_auth_enable"] = $_POST["ldap_auth_enable"];
+	$_SESSION["ldap_host"] = $_POST["ldap_host"];
+	$_SESSION["ldap_port"] = $_POST["ldap_port"];
+	$_SESSION["ldap_base_dn"] = $_POST["ldap_base_dn"];
+	$_SESSION["ldap_login_attrib"] = $_POST["ldap_login_attrib"];
+	$_SESSION["ldap_ssl"] = $_POST["ldap_ssl"];
+}
+
+aff_header("Oreon Setup Wizard", "Oreon Configuration File", 10);
+?>
+<table cellpadding="0" cellspacing="0" border="0" width="80%" class="StyleDottedHr" align="center">
+  <tr>
+    <th align="left">Component</th>
+    <th style="text-align: right;">Status</th>
+  </tr>
+  <tr>
+		<td><b>Writable Oreon Configuration File (oreon.conf.php)</b></td>
+		<td align="right"><?
+       	$uid = posix_getpwuid (fileowner($_SESSION["oreon_dir_www"]));
+		$gid = posix_getgrgid (filegroup($_SESSION["oreon_dir_www"]));
+       	$perms = substr(sprintf('%o', fileperms($_SESSION["oreon_dir_www"])), -3) ;
+	if( (strcmp($perms,'775') == 0 )  && (strcmp($_SESSION['apache_user'], $uid['name']) == 0 ) && (strcmp($_SESSION['apache_group'], $gid['name']) == 0) ){
+          	echo '<b><span class="go">OK</font></b>';
+        	 $msg =  '';
+		} else {
+          	echo '<b><span class="stop">Critical: Not Writeable</font></b>';
+          	$msg =  $uid['name'] .':'. $gid['name'] .'&nbsp;(' .$perms. ')</b>';
+          	$msg .=  '<br>Should be '. $_SESSION['apache_user'].':'.$_SESSION['apache_group'].' (775)';
+		    $return_false = 1;
+       }
+    ?></td>
+  </tr>
+  <tr>
+    <td>&nbsp;&nbsp;&nbsp;<? echo $_SESSION["oreon_dir_www"]; ?></td>
+    <td align="right"><b><?
+	   echo $msg ;
+    ?></b></td>
+  </tr>
+  <tr>
+		<td><b>Generate configuration file</b></td>
+		<td align="right">
+ <?
+
+	$file[0] = "<?\n";
+	$file[1] = "/**\n";
+	$file[2] = "Oreon is developped with GPL Licence 2.0 :\n";
+	$file[3] = "http://www.gnu.org/licenses/gpl.txt\n";
+	$file[4] = "Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf\n";
+	$file[5] = "\n";
+	$file[6] = "The Software is provided to you AS IS and WITH ALL FAULTS.\n";
+	$file[7] = "OREON makes no representation and gives no warranty whatsoever,\n";
+	$file[8] = "whether express or implied, and without limitation, with regard to the quality,\n";
+	$file[9] = "safety, contents, performance, merchantability, non-infringement or suitability for\n";
+	$file[10] = "any particular or intended purpose of the Software found on the OREON web site.\n";
+	$file[11] = "In no event will OREON be liable for any direct, indirect, punitive, special,\n";
+	$file[12] = "incidental or consequential damages however they may arise and even if OREON has\n";
+	$file[13] = "been previously advised of the possibility of such damages.\n";
+	$file[14] = "\n";
+	$file[15] = "For information : contact@oreon-project.org\n";
+	$file[16] = "	*/\n";
+	$file[17] = "\n\n";
+	$file[18] = "// \tDatabase\n";
+	$file[19] = "\$conf_oreon['host'] = \"". $_SESSION["dbLocation"] ."\";\n";
+	$file[20] = "\$conf_oreon['user'] = \"". $_SESSION["nameOreonDB"] . "\";\n";
+	$file[21] = "\$conf_oreon['password'] = \"". $_SESSION["pwdOreonDB"] . "\";\n";
+	$file[22] = "\$conf_oreon['db'] = \"". $_SESSION["nameOreonDB"] . "\";\n";
+	$file[23] = "\n\n";
+	$file[24] = "// path to classes\n";
+	$file[25] = "\$classdir='./class';\n";
+
+	if ($fd = fopen($_SESSION["oreon_dir_www"]."oreon.conf.php", "w"))	{
+		for ($i = 0; $i <= 25; $i++)
+			fwrite ($fd, $file[$i]);
+		fclose ($fd);
+		echo '<b><span class="go">OK</b>';
+	} else {
+	   echo '<b><span class="stop">Critical: Can\'t create file</font></b>';
+          	$msg =  $php_errormsg;
+          	//$msg .=  '<br>Should be '. $_SESSION['apache_user'].':'.$_SESSION['apache_group'].' (775)';
+		    $return_false = 1;
+		//echo '<b><span class="stop">Critical: Can\'t create file</b></td></tr>';
+		?>
+		</td>
+	  </tr>
+	<!--	<tr>
+	    	<td>&nbsp;&nbsp;&nbsp;<? echo $_SESSION["oreon_dir_www"].'oreon.conf.php'; ?></td>
+            <td align="right"><b>Can't create file</b></td>
+    	 </tr>-->
+     <tr>
+	    <td>&nbsp;&nbsp;&nbsp;<? echo $_SESSION["oreon_dir_www"].'oreon.conf.php'; ?></td>
+	    <td align="right"><b><?
+	   		echo $msg ;
+    		?></b></td>
+ 	</tr>
+
+<?	}
+	aff_middle();
+	$str = '';
+	if (isset($return_false))
+		$str = "<input class='button' type='submit' name='Recheck' value='Recheck' />";
+	$str .= "<input class='button' type='submit' name='goto' value='Back' /><input class='button' type='submit' name='goto' value='Next' id='button_next' ";
+	if ($return_false)
+		$str .= " disabled";
+	$str .= " />";
+		print $str;
+		aff_footer();
+?>
\ No newline at end of file
diff --git a/www/install/steps/step11.php b/www/install/steps/step11.php
new file mode 100644
index 0000000000000000000000000000000000000000..d22a5debaf94b44567e66f19785d30b9ac6e1f12
--- /dev/null
+++ b/www/install/steps/step11.php
@@ -0,0 +1,390 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+/*if (isset($_POST["goto"]) && strcmp($_POST["goto"], "Back")){
+	$_SESSION["oreonlogin"] = $_POST["oreonlogin"];
+	$_SESSION["oreonpasswd"] = $_POST["oreonpasswd"];
+	$_SESSION["oreonfirstname"] = $_POST["oreonfirstname"];
+	$_SESSION["oreonlastname"] = $_POST["oreonlastname"];
+	$_SESSION["oreonemail"] = $_POST["oreonemail"];
+	$_SESSION["oreonlang"] = $_POST["oreonlang"];
+}*/
+
+aff_header("Oreon Setup Wizard", "Creating Database", 11);
+
+?>
+<table cellpadding="0" cellspacing="0" border="0" width="80%" class="StyleDottedHr" align="center">
+  <tr>
+    <th align="left">Component</th>
+    <th style="text-align: right;">Status</th>
+  </tr>
+  <tr>
+		<td><b>Database : Connection</b></td>
+  <?
+	$res = connexion('root', (isset($_SESSION["pwdroot"]) ? $_SESSION["pwdroot"] : '' ) , $_SESSION["dbLocation"]) ;
+	$mysql_msg = $res['1'];
+
+	if ($mysql_msg == '') {
+		echo '<td align="right"><b><span class="go">OK</b></td></tr>';
+
+	?>
+
+	<tr>
+		<td><b>Database &#146;<? echo $_SESSION["nameOreonDB"] ; ?>&#146; : Creation</b></td>
+ <?
+
+	//	$requete =  "USE ". $_SESSION["nameOreonDB"] . ";";
+	//	if ($DEBUG) print $requete . "<br>";
+	//	$usedb = mysql_query($requete, $res['0'])  or ( $mysql_msg= mysql_error());
+		$usedb = mysql_select_db($_SESSION["nameOreonDB"], $res['0']) or ( $mysql_msg = mysql_error());
+
+	if (!$usedb)  {
+		$requete = "CREATE DATABASE ". $_SESSION["nameOreonDB"] . ";";
+		if ($DEBUG) print $requete . "<br>";
+		@mysql_query($requete, $res['0']);
+		echo '<td align="right"><b><span class="go">OK</b></td></tr>';
+	?>
+	<tr>
+		<td><b>Database &#146;<? echo $_SESSION["nameOreonDB"] ; ?>&#146; : Users Management</b></td>
+<?
+	// http://dev.mysql.com/doc/refman/5.0/en/old-client.html
+
+	$mysql_msg = '';
+	$requete = "GRANT ALL PRIVILEGES ON `". $_SESSION["nameOreonDB"] . "` . * TO `". $_SESSION["nameOreonDB"] . "`@`". $_SESSION["nagiosLocation"] . "` IDENTIFIED BY '". $_SESSION["pwdOreonDB"] . "' WITH GRANT OPTION";
+	if ($DEBUG) print $requete. "<br>";
+	mysql_query($requete, $res['0']) or ( $mysql_msg= mysql_error());
+	$mysql_msg = $res['1'];
+	if ($_SESSION["mysqlVersion"] == "2")	{
+        $requete = "UPDATE mysql.user SET Password = OLD_PASSWORD('". $_SESSION["pwdOreonDB"] ."') WHERE User = '". $_SESSION["nameOreonDB"] ."'";
+        @mysql_query($requete, $res['0']) or ( $mysql_msg= mysql_error());
+        $requete = "FLUSH PRIVILEGES";
+        @mysql_query($requete, $res['0']) or ( $mysql_msg= mysql_error());
+		$mysql_msg = $res['1'];
+	}
+	@mysql_select_db($_SESSION["nameOreonDB"], $res['0']) or ( $mysql_msg= mysql_error());
+	$mysql_msg = $res['1'];
+
+	if ($mysql_msg == '') {
+		echo '<td align="right"><b><span class="go">OK</b></td></tr>';
+	} else {
+		echo '<td align="right"><b><span class="stop">CRITICAL</span></b></td></tr>';
+	    $return_false = 1;
+	?>
+	<tr>
+        <td colspan="2" align="left"><span class="small"><? echo $mysql_msg; ?></span></td>
+	</tr>
+
+<?	} ?>
+	<tr>
+		<td><b>Database &#146;<? echo $_SESSION["nameOreonDB"]; ?>&#146; : Schema Creation</b></td>
+<?
+	$mysql_msg = '';
+	$file_sql = file("./createTables.sql");
+    $str = NULL;
+    for ($i = 0; $i <= count($file_sql) - 1; $i++){
+        $line = $file_sql[$i];
+        if (($line[0] != '#' ) and ( $line[0] != '-' )  )    {
+            $pos = strrpos($line, ";");
+            if ($pos != false)      {
+                $str .= $line;
+                $str = chop ($str);
+  				if ($DEBUG) print $str . "<br>";
+                $result = @mysql_query($str, $res['0']) or ( $mysql_msg= $mysql_msg . "$str<br><span class='warning'>->" . mysql_error() ."</span><br>");
+                $str = NULL;
+            }
+            else
+            	$str .= $line;
+        }
+    }
+
+	if ($mysql_msg == '') {
+		echo '<td align="right"><b><span class="go">OK</b></td></tr>';
+	} else {
+		echo '<td align="right"><b><span class="stop">CRITICAL</span></b></td></tr>';
+	    $return_false = 1;
+	?>
+	<tr>
+        <td colspan="2" align="left"><span class="small"><? echo $mysql_msg; ?></span></td>
+	</tr>
+	<?	} ?>
+	<tr>
+		<td><b>Database &#146;<? echo $_SESSION["nameOreonDB"]; ?>&#146; : Command and Timeperiod Creation</b></td>
+<?
+	$mysql_msg = '';
+	$file_sql = file("./insertCmd-Tps.sql");
+    $str = NULL;
+    for ($i = 0; $i <= count($file_sql) - 1; $i++){
+        $line = $file_sql[$i];
+        if (($line[0] != '#' ) and ( $line[0] != '-' )  )    {
+            $pos = strrpos($line, ";");
+            if ($pos != false)      {
+                $str .= $line;
+                $str = chop ($str);
+  				if ($DEBUG) print $str . "<br>";
+                $result = @mysql_query($str, $res['0']) or ( $mysql_msg= $mysql_msg . "$str<br><span class='warning'>->" . mysql_error() ."</span><br>");
+                $str = NULL;
+            }
+            else
+            	$str .= $line;
+        }
+    }
+
+	if ($mysql_msg == '') {
+		echo '<td align="right"><b><span class="go">OK</b></td></tr>';
+	} else {
+		echo '<td align="right"><b><span class="stop">CRITICAL</span></b></td></tr>';
+	    $return_false = 1;
+	?>
+	<tr>
+        <td colspan="2" align="left"><span class="small"><? echo $mysql_msg; ?></span></td>
+	</tr>
+<?	} ?>
+	<tr>
+		<td><b>Database &#146;<? echo $_SESSION["nameOreonDB"]; ?>&#146; : Macros Creation</b></td>
+<?
+	$mysql_msg = '';
+	$file_sql = file("./insertMacros.sql");
+    $str = NULL;
+    for ($i = 0; $i <= count($file_sql) - 1; $i++){
+        $line = $file_sql[$i];
+        if (($line[0] != '#' ) and ( $line[0] != '-' )  )    {
+            $pos = strrpos($line, ";");
+            if ($pos != false)      {
+                $str .= $line;
+                $str = chop ($str);
+  				if ($DEBUG) print $str . "<br>";
+                $result = @mysql_query($str, $res['0']) or ( $mysql_msg= $mysql_msg . "$str<br><span class='warning'>->" . mysql_error() ."</span><br>");
+                $str = NULL;
+            }
+            else
+            	$str .= $line;
+        }
+    }
+
+	if ($mysql_msg == '') {
+		echo '<td align="right"><b><span class="go">OK</b></td></tr>';
+	} else {
+		echo '<td align="right"><b><span class="stop">CRITICAL</span></b></td></tr>';
+	    $return_false = 1;
+	?>
+	<tr>
+        <td colspan="2" align="left"><span class="small"><? echo $mysql_msg; ?></span></td>
+	</tr>
+	<?	} ?>
+	<tr>
+		<td><b>Database &#146;<? echo $_SESSION["nameOreonDB"]; ?>&#146; : Basic Config Insertion</b></td>
+<?
+	$mysql_msg = '';
+	$file_sql = file("./insertBaseConf.sql");
+    $str = NULL;
+    for ($i = 0; $i <= count($file_sql) - 1; $i++){
+        $line = $file_sql[$i];
+        if (($line[0] != '#' ) and ( $line[0] != '-' )  )    {
+            $pos = strrpos($line, ";");
+            if ($pos != false)      {
+                $str .= $line;
+                $str = chop ($str);
+  				if ($DEBUG) print $str . "<br>";
+                $result = @mysql_query($str, $res['0']) or ( $mysql_msg= $mysql_msg . "$str<br><span class='warning'>->" . mysql_error() ."</span><br>");
+                $str = NULL;
+            }
+            else
+            	$str .= $line;
+        }
+    }
+
+
+	if ($mysql_msg == '') {
+		echo '<td align="right"><b><span class="go">OK</b></td></tr>';
+	} else {
+		echo '<td align="right"><b><span class="stop">CRITICAL</span></b></td></tr>';
+	    $return_false = 1;
+	?>
+	<tr>
+        <td colspan="2" align="left"><span class="small"><? echo $mysql_msg; ?></span></td>
+	</tr>
+<?	} ?>
+<tr>
+		<td><b>Database &#146;<? echo $_SESSION["nameOreonDB"]; ?>&#146; : Topology Insertion</b></td>
+<?
+	$mysql_msg = '';
+	$file_sql = file("./insertTopology.sql");
+    $str = NULL;
+    for ($i = 0; $i <= count($file_sql) - 1; $i++){
+        $line = $file_sql[$i];
+        if (($line[0] != '#' ) and ( $line[0] != '-' )  )    {
+            $pos = strrpos($line, ";");
+            if ($pos != false)      {
+                $str .= $line;
+                $str = chop ($str);
+  				if ($DEBUG) print $str . "<br>";
+                $result = @mysql_query($str, $res['0']) or ( $mysql_msg= $mysql_msg . "$str<br><span class='warning'>->" . mysql_error() ."</span><br>");
+                $str = NULL;
+            }
+            else
+            	$str .= $line;
+        }
+    }
+
+	if ($mysql_msg == '') {
+		echo '<td align="right"><b><span class="go">OK</b></td></tr>';
+	} else {
+		echo '<td align="right"><b><span class="stop">CRITICAL</span></b></td></tr>';
+	    $return_false = 1;
+	?>
+	<tr>
+        <td colspan="2" align="left"><span class="small"><? echo $mysql_msg; ?></span></td>
+	</tr>
+<?	} ?>
+	<tr>
+		<td><b>Database &#146;<? echo $_SESSION["nameOreonDB"]; ?>&#146; : Oreon User Creation</b></td>
+	<?
+	$res = connexion($_SESSION["nameOreonDB"], $_SESSION["pwdOreonDB"], $_SESSION["dbLocation"]);
+	@mysql_select_db($_SESSION["nameOreonDB"], $res['0']) or ( $mysql_msg= mysql_error());
+	$req = "SELECT * FROM `contact` WHERE contact_alias = '". htmlentities($_SESSION["oreonlogin"], ENT_QUOTES)."' ";
+	$r = @mysql_query($req, $res['0']);
+//	if (!$r)
+//		@print mysql_error($res['0']);
+	$nb = @mysql_num_rows($r);
+	while ($tab = @mysql_fetch_array($r))
+		break;
+	if (!$tab && !$nb){
+		$requete = "INSERT INTO `contact` (`contact_name` , `contact_alias` , `contact_passwd` , `contact_lang` , `contact_email` , `contact_oreon` , `contact_admin` , `contact_activate` ) VALUES ";
+		$requete .= "('".htmlentities($_SESSION["oreonfirstname"], ENT_QUOTES). " " .htmlentities($_SESSION["oreonlastname"], ENT_QUOTES)."', '". htmlentities($_SESSION["oreonlogin"], ENT_QUOTES)."', '". md5($_SESSION["oreonpasswd"]) ."', '".$_SESSION["oreonlang"]."', '".$_SESSION['oreonemail']."', '1', '1', '1');";
+		if ($DEBUG) print $requete . "<br>";
+		$result = @mysql_query($requete, $res['0']);
+		htmlentities($_SESSION["oreonfirstname"], ENT_QUOTES);
+	}else {
+		$requete = "UPDATE `contact` SET `user_firstname` = '". htmlentities($_SESSION["oreonfirstname"], ENT_QUOTES)."',`user_lastname` = '". htmlentities($_SESSION["oreonlastname"], ENT_QUOTES)  ."',`user_alias` = '". htmlentities($_SESSION["oreonlogin"], ENT_QUOTES) ."',`user_passwd` = '". md5($_SESSION["oreonpasswd"]) ."',`user_mail` = '".$_SESSION['oreonemail']."',`user_status` = '32',`user_lang` = '".$_SESSION["oreonlang"]."' WHERE `user_id` =1 LIMIT 1 ;";
+		if ($DEBUG) print $requete . "<br>";
+		$result = @mysql_query($requete, $res['0']);
+	}
+	if ($mysql_msg == '') {
+		echo '<td align="right"><b><span class="go">OK</b></td></tr>';
+	} else {
+		echo '<td align="right"><b><span class="stop">CRITICAL</span></b></td></tr>';
+	    $return_false = 1;
+	?>
+	<tr>
+        <td colspan="2" align="left"><span class="small"><? echo $mysql_msg; ?></span></td>
+	</tr>
+
+	<? }
+	@mysql_close($res['0']);
+	?>
+
+	<tr>
+		<td><b>Database &#146;<? echo $_SESSION["nameOreonDB"]; ?>&#146; : Customization</b></td>
+<?
+	$mysql_msg = '';
+	$res = connexion($_SESSION["nameOreonDB"], $_SESSION["pwdOreonDB"], $_SESSION["dbLocation"]);
+	@mysql_select_db($_SESSION["nameOreonDB"], $res['0']) or ( $mysql_msg= mysql_error());
+
+	$conf_installoreon['physical_html_path'] = ($conf_installoreon['physical_html_path'] === "" ?  "/usr/local/nagios/share/images/logo/" : $conf_installoreon['physical_html_path']."/images/logo/");
+	$conf_installoreon['nagios'] = ($conf_installoreon['nagios'] === "" ?  "/usr/local/nagios/" : $conf_installoreon['nagios']);
+	$conf_installoreon['mail'] = ($conf_installoreon['mail'] === "" ?  "/usr/bin/mail" : $conf_installoreon['mail']);
+//			$conf_installoreon['rrdtool'] = ($conf_installoreon['rrdtool'] === "" ?  "/usr/bin/rrdtool" : $conf_installoreon['rrdtool']);
+
+	$requete = "UPDATE `general_opt` SET `nagios_path_img` = '".$conf_installoreon['physical_html_path']."'";
+	$requete .= ", `nagios_path` = '".$conf_installoreon['nagios']."'";
+	$requete .= ", `nagios_path_bin` = '".$conf_installoreon['nagios_bin']."nagios'";
+	$requete .= ", `nagios_path_plugins` = '".$_SESSION["nagios_plugins"]."'";
+	$requete .= ", `oreon_path` = '".$_SESSION["oreon_dir"]."'";
+	$requete .= ", `oreon_web_path` = '/oreon/'";
+	$requete .= ", `oreon_rrdbase_path` = '".$_SESSION["oreon_dir_rrd"]."'";
+	$requete .= ", `rrdtool_path_bin` = '".$_SESSION["rrdtool_dir"]."'";
+	$requete .= ", `nagios_version` = '".$_SESSION["nagios_version"]."'";
+	$requete .= ", `mailer_path_bin` = '".$conf_installoreon['mail']."' ";
+	$requete .= ", `ldap_host` = '".htmlentities($_SESSION["ldap_host"], ENT_QUOTES)."'";
+	$requete .= ", `ldap_port` = '".htmlentities($_SESSION["ldap_port"], ENT_QUOTES)."'";
+	$requete .= ", `ldap_base_dn` = '".htmlentities($_SESSION["ldap_base_dn"], ENT_QUOTES)."'";
+	$requete .= ", `ldap_login_attrib` = '".htmlentities($_SESSION["ldap_login_attrib"], ENT_QUOTES)."'";
+	$requete .= ", `ldap_ssl` = '".htmlentities($_SESSION["ldap_ssl"], ENT_QUOTES)."'";
+	$requete .= ", `ldap_auth_enable` = '".htmlentities($_SESSION["ldap_auth_enable"], ENT_QUOTES)."' ;";
+
+	if ($DEBUG) print $requete . "<br>";
+	$result = @mysql_query($requete, $res['0'])or ( $mysql_msg= mysql_error());
+
+	$conf_installoreon['status_file'] = ($conf_installoreon['status_file'] === "" ?  "/usr/local/nagios/var/status.log" : $conf_installoreon['status_file']);
+	$conf_installoreon['command_file'] = ($conf_installoreon['command_file'] === "" ?  "/usr/local/nagios/var/rw/nagios.cmd" : $conf_installoreon['command_file']);
+	$conf_installoreon['log_archive_path'] = ($conf_installoreon['log_archive_path'] === "" ?  "/usr/local/nagios/var/archives/" : $conf_installoreon['log_archive_path']);
+	$conf_installoreon['state_retention_file'] = ($conf_installoreon['state_retention_file'] === "" ?  "/usr/local/nagios/var/status.sav" : $conf_installoreon['state_retention_file']);
+	$conf_installoreon['comment_file'] = ($conf_installoreon['comment_file'] === "" ?  "/usr/local/nagios/var/comment.log" : $conf_installoreon['comment_file']);
+	$conf_installoreon['downtime_file'] = ($conf_installoreon['downtime_file'] === "" ?  "/usr/local/nagios/var/downtime.log" : $conf_installoreon['downtime_file']);
+	$conf_installoreon['lock_file'] = ($conf_installoreon['lock_file'] === "" ?  "/usr/local/nagios/var/nagios.lock" : $conf_installoreon['lock_file']);
+	$conf_installoreon['temp_file'] = ($conf_installoreon['temp_file'] === "" ?  "/usr/local/nagios/var/rw/nagios.tmp" : $conf_installoreon['temp_file']);
+	$conf_installoreon['log_file'] = ($conf_installoreon['log_file'] === "" ?  "/usr/local/nagios/var/nagios.log" : $conf_installoreon['log_file']);
+
+//	$requete = "UPDATE `nagioscfg` SET `nagios_user` = '".$_SESSION["nagios_user"]."',`nagios_group` = '".$_SESSION["nagios_group"]."',`cfg_pwd` = '".$_SESSION["nagios_conf"]."',`status_file` = '". $conf_installoreon['status_file'] ."',`command_file` = '".$conf_installoreon['command_file']."', ";
+//	$requete .= "`log_archive_path` = '".$conf_installoreon['log_archive_path']."', `state_retention_file` = '".$conf_installoreon['state_retention_file']."',`comment_file` = '".$conf_installoreon['comment_file']."',`downtime_file` = '".$conf_installoreon['downtime_file']."',`lock_file` = '".$conf_installoreon['lock_file']."',`temp_file` = '". $conf_installoreon['temp_file']."', `log_file` = '".$conf_installoreon['log_file']."' ;";
+
+	$requete = "UPDATE `cfg_nagios` SET `nagios_user` = '".$_SESSION["nagios_user"]."',`nagios_group` = '".$_SESSION["nagios_group"]."',`cfg_dir` = '".$_SESSION["nagios_conf"]."',`status_file` = '". $conf_installoreon['status_file'] ."',`command_file` = '".$conf_installoreon['command_file']."', ";
+	$requete .= "`log_archive_path` = '".$conf_installoreon['log_archive_path']."', `state_retention_file` = '".$conf_installoreon['state_retention_file']."',`comment_file` = '".$conf_installoreon['comment_file']."',`downtime_file` = '".$conf_installoreon['downtime_file']."',`lock_file` = '".$conf_installoreon['lock_file']."',`temp_file` = '". $conf_installoreon['temp_file']."',`log_file` = '".$conf_installoreon['log_file']."' ";
+	$requete .= " WHERE `nagios_activate` =1 LIMIT 1;";
+
+	if ($DEBUG) print $requete . "<br>";
+	$result = @mysql_query($requete, $res['0']) or ( $mysql_msg= mysql_error());
+
+	$requete = "UPDATE `cfg_resource` SET `resource_line` = '\$USER1\$=".$_SESSION["nagios_plugins"]."' WHERE `resource_id` =1 LIMIT 1  ;";
+	//$requete = "UPDATE `resources` SET `resource_line` = '\$USER1\$=".$_SESSION["nagios_plugins"]."' WHERE `resource_id` =1 LIMIT 1  ;";
+	if ($DEBUG) print $requete . "<br>";
+	$result = @mysql_query($requete, $res['0']) or ( $mysql_msg= mysql_error());
+
+	if (!$mysql_msg) {
+		echo '<td align="right"><b><span class="go">OK</b></td></tr>';
+	} else {
+		echo '<td align="right"><b><span class="stop">CRITICAL</span></b></td></tr>';
+	    $return_false = 1;
+	?>
+	<tr>
+        <td colspan="2" align="left"><span class="small"><? echo $mysql_msg; ?></span></td>
+	</tr>
+
+<? }
+
+} else {
+			echo '<td align="right"><b><span class="stop">CRITICAL</span></b></td></tr>';
+	    $return_false = 1;
+	?>
+	<tr>
+    	<td>&nbsp;</td>
+        <td align="right"><? echo ( "'".$_SESSION["nameOreonDB"]."' already exist !") ; ?></td>
+        <? $return_false = 1; ?>
+	</tr>
+
+<?	}
+
+} else {
+	echo '<td align="right"><b><span class="stop">CRITICAL</span></b></td></tr>';
+$return_false = 1;
+?>
+<tr>
+    <td colspan="2" align="right"><? echo $mysql_msg; ?></td>
+</tr>
+<?
+}
+		@mysql_close($res['0']);
+// end last code
+aff_middle();
+$str = "<input class='button' type='submit' name='goto' value='Back' /><input class='button' type='submit' name='goto' value='Finish' id='button_next' ";
+if ($return_false)
+	$str .= " disabled";
+$str .= " />";
+		print $str;
+		aff_footer();
+?>
\ No newline at end of file
diff --git a/www/install/steps/step12.php b/www/install/steps/step12.php
new file mode 100644
index 0000000000000000000000000000000000000000..9ed10eecd293479eff55612d46ac631c5fa1b6ac
--- /dev/null
+++ b/www/install/steps/step12.php
@@ -0,0 +1,25 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	session_destroy();
+	$tmpfname = tempnam("", "");
+	@unlink($tmpfname);
+	@rename(getcwd(), realpath("..")."/".basename($tmpfname) );
+	header("Location: ../index.php");
+	
+?>
\ No newline at end of file
diff --git a/www/install/steps/step2.php b/www/install/steps/step2.php
new file mode 100644
index 0000000000000000000000000000000000000000..2732ce199bab78d91c0018e80e4b8cc6dfee5209
--- /dev/null
+++ b/www/install/steps/step2.php
@@ -0,0 +1,30 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+aff_header("Oreon Setup Wizard", "Licence", 2);
+$license_file_name = "./LICENSE.txt";
+$fh = fopen( $license_file_name, 'r' ) or die( "License file not found!" );
+$license_file = fread( $fh, filesize( $license_file_name ) );
+fclose( $fh );
+$str = "<textarea cols='80' rows='20' readonly>".$license_file."</textarea>";
+print $str . "</td></tr><tr><td align=left><input type='checkbox' class='checkbox' name='setup_license_accept' onClick='LicenceAccepted();' value='0' /><a href='javascript:void(0)' onClick='document.getElementById('button_next').disabled = false;'>I Accept</a></td><td align=right>&nbsp;</td></tr>";
+aff_middle();
+print "<input class='button' type='submit' name='goto' value='Next' id='button_next' disabled='disabled' />";
+aff_footer();
+
+?>
\ No newline at end of file
diff --git a/www/install/steps/step3.php b/www/install/steps/step3.php
new file mode 100644
index 0000000000000000000000000000000000000000..7a54b40b6235865bd004173c4233814d5a693bd9
--- /dev/null
+++ b/www/install/steps/step3.php
@@ -0,0 +1,73 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+aff_header("Oreon Setup Wizard", "Environment Configuration", 3);   ?>
+In order for your Oreon installation to function properly, please complete the following fields.<br><br>
+<table cellpadding="0" cellspacing="0" border="0" width="80%" class="StyleDottedHr" align="center">
+  <tr>
+    <th style="padding-left:20px " colspan="2">Environment Configurations</th>
+  </tr>
+  <tr>
+    <td style="padding-left:50px ">Nagios user</td>
+	<td><input name="nagios_user" type="text" value="<? echo (isset($_SESSION["nagios_user"]) ?  $_SESSION["nagios_user"]  : (isset($conf_installoreon['nagios_user']) ?  $conf_installoreon['nagios_user']  : "nagios" ) );?>"></td>
+  </tr>
+  <tr>
+    <td style="padding-left:50px ">Nagios group</td>
+	<td><input name="nagios_group" type="text" value="<? echo (isset($_SESSION["nagios_group"]) ?  $_SESSION["nagios_group"]  : (isset($conf_installoreon["nagios_group"]) ?  $conf_installoreon["nagios_group"]  : "nagios" ) );?>"></td>
+  </tr>
+ <tr>
+    <td style="padding-left:50px ">Apache User</td>
+	<td><input name="apache_user" type="text" value="<? echo (isset($_SESSION["apache_user"]) ?  $_SESSION["apache_user"]  : (isset($conf_installoreon["apache_user"]) ?  $conf_installoreon["apache_user"]  : "apache" ) );?>"></td>
+  </tr>
+  <tr>
+    <td style="padding-left:50px ">Apache Group</td>
+	<td><input name="apache_group" type="text" value="<? echo (isset($_SESSION["apache_group"]) ?  $_SESSION["apache_group"]  : (isset($conf_installoreon["apache_group"]) ?  $conf_installoreon["apache_group"]  : "apache" ) );?>"></td>
+  </tr>
+  <tr>
+    <td style="padding-left:50px ">Nagios Version</td>
+	<td>
+		<select name="nagios_version">
+    		<option value="1" <? if (isset($_SESSION["nagios_version"]) && $_SESSION["nagios_version"] == "1") print "selected"; else if (!isset($_SESSION["nagios_version"])) print "selected"; ?>>1.x</option>
+    		<option value="2" <? if (isset($_SESSION["nagios_version"]) && $_SESSION["nagios_version"] == "2") print "selected"; ?>>2.x</option>
+    	<!--	<option value="3" <? if (isset($_SESSION["nagios_version"]) && $_SESSION["nagios_version"] == "3") print "selected"; ?>>3.x</option>-->
+    	</select>
+	</td>
+  </tr>
+  <tr>
+    <td style="padding-left:50px ">Nagios configuration directory</td>
+	<td><input name="nagios_conf" type="text" value="<? echo (isset($_SESSION["nagios_conf"]) ?  $_SESSION["nagios_conf"]  : (isset($conf_installoreon["nagios_conf"]) ?  $conf_installoreon["nagios_conf"]  : "/usr/local/nagios/etc/" ) );?>" size="40"></td>
+  </tr>
+  <tr>
+    <td style="padding-left:50px ">Nagios plugins</td>
+	<td><input name="nagios_plugins" type="text" value="<? echo (isset($_SESSION["nagios_plugins"]) ?  $_SESSION["nagios_plugins"]  : (isset($conf_installoreon["nagios_plugins"]) ?  $conf_installoreon["nagios_plugins"]  : "/usr/local/nagios/libexec/" ) );?>" size="40"></td>
+  </tr>
+  <tr>
+    <td style="padding-left:50px ">RRDTool binary</td>
+	<td><input name="rrdtool_dir" type="text" value="<? echo (isset($_SESSION["rrdtool_dir"]) ?  $_SESSION["rrdtool_dir"]  : (isset($conf_installoreon["rrdtool_dir"]) ?  $conf_installoreon["rrdtool_dir"]  : "/usr/bin/rrdtool" ) );?>" size="40"></td>
+  </tr>
+ <!-- <tr>
+    <td style="padding-left:50px ">SNMP binary path</td>
+	<td><input name="snmp_dir" type="text" value="<? echo (isset($_SESSION["snmp_dir"]) ?  $_SESSION["snmp_dir"]  : (isset($conf_installoreon["snmp_dir"]) ?  $conf_installoreon["snmp_dir"]  : "/usr/local/bin" ) );?>" size="40"></td>
+  </tr> -->
+</table>
+<?
+aff_middle();
+print "<input class='button' type='submit' name='goto' value='Back' /><input class='button' type='submit' name='goto' value='Next' id='button_next' />";
+aff_footer();
+
+?>
\ No newline at end of file
diff --git a/www/install/steps/step4.php b/www/install/steps/step4.php
new file mode 100644
index 0000000000000000000000000000000000000000..b0a528ae6db5a5d6244d3a8c58e20f9e5dec72cf
--- /dev/null
+++ b/www/install/steps/step4.php
@@ -0,0 +1,217 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+if (isset($_POST["goto"]) && strcmp($_POST["goto"], "Back")){
+	$_SESSION["nagios_user"] = $_POST["nagios_user"];
+	$_SESSION["nagios_group"] = $_POST["nagios_group"];
+	$_SESSION["apache_user"] = $_POST["apache_user"];
+	$_SESSION["apache_group"] = $_POST["apache_group"];
+	$_SESSION["nagios_version"] = $_POST["nagios_version"];
+	$_SESSION["nagios_conf"] = $_POST["nagios_conf"];
+	$_SESSION["nagios_plugins"] = $_POST["nagios_plugins"];
+	$_SESSION["rrdtool_dir"] = $_POST["rrdtool_dir"];
+//	$_SESSION["snmp_dir"] = $_POST["snmp_dir"];
+	chdir('..');
+	$_SESSION["oreon_dir_www"] = getcwd() . '/';
+	chdir('..');
+	$_SESSION["oreon_dir"] = getcwd() . '/' ;
+	$_SESSION["oreon_dir_rrd"] = getcwd() . '/rrd/';
+	chdir('www/install');
+}
+aff_header("Oreon Setup Wizard", "Verifying Configuration", 4);	?>
+<table cellpadding="0" cellspacing="0" border="0" width="100%" class="StyleDottedHr">
+  	<tr>
+    	<th align="left">Component</th>
+    	<th style="text-align: right;">Status</th>
+  	</tr>
+  	<tr>
+   		<td><b>PHP Version 4.2.x or 5.x</b></td>
+    	<td align="right"><?
+			$php_version = phpversion();
+	       	if(str_replace(".", "", $php_version) < "420" ){
+	         	echo "<b><span class=stop>Invalid version ($php_version) Installed</span></b>";
+			  	$return_false = 1;
+	       	} else {
+	          	echo "<b><span class=go>OK (ver $php_version)</span></b>";
+	       	}?>
+     	</td>
+  </tr>
+  <tr>
+    	<td><b>PHP Extension</b></td>
+    	<td align="right">&nbsp;</td>
+  </tr>
+  <tr>
+    	<td><b>&nbsp;&nbsp;&nbsp;MySQL</b></td>
+    	<td align="right"><?
+			if (extension_loaded('mysql')) {
+          		echo '<b><span class="go">OK</font></b>';
+			} else {
+				echo '<b><span class="stop">Critical: mysql.so not loaded in php.ini</font></b>';
+		    	$return_false = 1;
+			}?>
+		</td>
+  </tr>
+  <tr>
+    	<td><b>&nbsp;&nbsp;&nbsp;GD</b></td>
+    	<td align="right"><?
+			if (extension_loaded('gd')) {
+          		echo '<b><span class="go">OK</font></b>';
+			} else {
+				echo '<b><span class="stop">Critical: gd.so not loaded in php.ini</font></b>';
+		    	$return_false = 1;
+			}?>
+		</td>
+  </tr>
+  <tr>
+    	<td><b>&nbsp;&nbsp;&nbsp;LDAP</b></td>
+    	<td align="right"><?
+			if (extension_loaded('ldap')) {
+          		echo '<b><span class="go">OK</font></b>';
+			} else {
+				echo '<b><span class="warning">Warning: ldap.so not loaded in php.ini</font></b>';
+		    	//$return_false = 1;
+			}?>
+		</td>
+  </tr>
+  <tr>
+    	<td><b>&nbsp;&nbsp;&nbsp;SNMP</b></td>
+    	<td align="right"><?
+			if (extension_loaded('snmp'))
+          		echo '<b><span class="go">OK</font></b>';
+			else {
+				echo '<b><span class="warning">Warning: snmp.so not loaded in php.ini</font></b>';
+		   	 	//$return_false = 1;
+			}?>
+		</td>
+  </tr>
+  <tr>
+    	<td><b>&nbsp;&nbsp;&nbsp;XML</b></td>
+    	<td align="right"><?
+			if (extension_loaded('xml'))
+          		echo '<b><span class="go">OK</font></b>';
+			else
+				echo '<b><span class="warning">Warning: xml.so not loaded in php.ini</font></b>';?>
+		</td>
+  </tr>
+  <tr>
+		<td><b>&nbsp;&nbsp;&nbsp;PEAR</b></td>
+    	<td align="right"><?
+			if (file_exists($pear_path. '/PEAR.php')){
+//				if ( strstr (strtoupper( ini_get('include_path')),"PEAR") || strstr (strtoupper( ini_get('include_path')),"PHP")) {
+				echo '<b><span class="go">OK</font></b>';
+			} else {
+				echo '<b><span class="stop">Warning: PHP Pear not found <br>'. $pear_path . '/PEAR.php</font></b>';
+			    $return_false = 1;
+			}?>
+		</td>
+  </tr>
+  <tr>
+    <td><b>Writable Nagios Config Directory</b></td>
+    <td align="right"><?
+
+	    if (is_dir($_SESSION['nagios_conf'])) {
+	       $uid = posix_getpwuid (fileowner($_SESSION['nagios_conf']));
+			$gid = posix_getgrgid (filegroup($_SESSION['nagios_conf']));
+	       $perms = substr(sprintf('%o', fileperms($_SESSION['nagios_conf'])), -3) ;
+		if( (strcmp($perms,'775') == 0 )  && (strcmp($_SESSION['apache_user'], $uid['name']) == 0 ) && (strcmp($_SESSION['nagios_group'], $gid['name']) == 0) ){
+	          	echo '<b><span class="go">OK</font></b>';
+	          	 $msg =  '';
+			} else {
+	            echo '<b><span class="stop">Critical: Not Writeable</font></b>';
+	          	$msg =  $uid['name'] .':'. $gid['name'] .'&nbsp;(' .$perms. ')</b>' ;
+	          	$msg .=  '<br>Should be '. $_SESSION['apache_user'].':'.$_SESSION['nagios_group'].' (775)';
+			    $return_false = 1;
+	       }
+	    } else {
+	      echo '<b><span class="stop">Critical: Directory not exist</font></b>';
+	      $msg =  '';
+		  $return_false = 1;
+	    } ?>
+		</td>
+  </tr>
+  <tr>
+    	<td>&nbsp;&nbsp;&nbsp;<? echo $_SESSION['nagios_conf']; ?></td>
+    	<td align="right"><b><?  echo  $msg ;  ?></td>
+  </tr>
+  <tr>
+    	<td><b>Writable Nagios Plugins Directory</b></td>
+    	<td align="right"><?
+		    if (is_dir($_SESSION['nagios_plugins'])) {
+		       $uid = posix_getpwuid (fileowner($_SESSION['nagios_plugins']));
+		       $gid = posix_getgrgid (filegroup($_SESSION['nagios_plugins']));
+		       $perms = substr(sprintf('%o', fileperms($_SESSION['nagios_plugins'])), -3) ;
+				if( (strcmp($perms,'775') == 0 )  && (strcmp($_SESSION['apache_user'], $uid['name']) == 0 ) && (strcmp($_SESSION['nagios_group'], $gid['name']) == 0) ){
+		              	echo '<b><span class="go">OK</font></b>';
+		              	$msg ='';
+					} else {
+		              	echo '<b><span class="stop">Critical: Not Writeable</font></b>';
+		              	$msg = $uid['name'] .':'. $gid['name'] .'&nbsp;(' .$perms. ')</b>';
+		              	$msg .=  '<br>Should be '. $_SESSION['apache_user'].':'.$_SESSION['nagios_group'].' (775)';
+					    $return_false = 1;
+		           }
+		    } else {
+		    	echo '<b><span class="stop">Critical: Directory not exist</font></b>';
+		        $msg =  '';
+			    $return_false = 1;
+		    }	?>
+		 </td>
+  </tr>
+  <tr>
+    	<td>&nbsp;&nbsp;&nbsp;<? echo $_SESSION['nagios_plugins']; ?></td>
+    	<td align="right"><b><? echo  $msg ; ?></td>
+  </tr>
+  <tr>
+    	<td><b>Writable Directory for Graphical plugins</b></td>
+    	<td align="right"><?
+		     if (is_dir($_SESSION["oreon_dir_rrd"])) {
+		           $uid = posix_getpwuid (fileowner($_SESSION["oreon_dir_rrd"]));
+		           $gid = posix_getgrgid (filegroup($_SESSION["oreon_dir_rrd"]));
+		           $perms = substr(sprintf('%o', fileperms($_SESSION["oreon_dir_rrd"])), -3) ;
+					if((strcmp($perms,'775') == 0 )  && (strcmp($_SESSION['nagios_user'], $uid['name']) == 0 ) && (strcmp($_SESSION['nagios_group'], $gid['name']) == 0) ){
+		              	echo '<b><span class="go">OK</font></b>';
+		              	$msg ='';
+					} else {
+		              	echo '<b><span class="stop">Critical: Not Writeable</font></b>';
+		              	$msg = $uid['name'] .':'. $gid['name'] .'&nbsp;(' .$perms. ')</b>';
+		              	$msg .=  '<br>Should be '. $_SESSION['nagios_user'].':'.$_SESSION['nagios_group'].' (775)';
+						$return_false = 1;
+		           }
+		      } else {
+		      	echo '<b><span class="stop">Critical: Directory not exist</font></b>';
+				$msg =  '';
+				$return_false = 1;
+		      }?>
+		</td>
+  </tr>
+  <tr>
+    	<td>&nbsp;&nbsp;&nbsp;<? echo $_SESSION["oreon_dir_rrd"]; ?></td>
+    	<td align="right"><b><?  echo  $msg ; ?></td>
+  </tr>
+</table>
+<?
+aff_middle();
+$str = '';
+if (isset($return_false))
+	$str = "<input class='button' type='submit' name='Recheck' value='Recheck' />";
+$str .= "<input class='button' type='submit' name='goto' value='Back' /><input class='button' type='submit' name='goto' value='Next' id='button_next'";
+if ($return_false)
+	$str .= " disabled";
+$str .= " />";
+print $str;
+aff_footer();
+?>
\ No newline at end of file
diff --git a/www/install/steps/step5.php b/www/install/steps/step5.php
new file mode 100644
index 0000000000000000000000000000000000000000..7f6dd65a0789491dc40c88536d04b33453729c69
--- /dev/null
+++ b/www/install/steps/step5.php
@@ -0,0 +1,74 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+//$include_paths = explode(":", ini_get('include_path'));
+
+aff_header("Oreon Setup Wizard", "Verifying PHP Pear Component", 5);
+/*foreach($include_paths as $key => $value) {
+	if ( strstr (strtoupper($value),"PEAR") || strstr (strtoupper( $value),"PHP"))
+  		$pear_path = $value;
+}*/
+
+?>
+<table cellpadding="0" cellspacing="0" border="0" width="100%" class="StyleDottedHr">
+  <tr>
+    <th align="left">Component</th>
+    <th style="text-align: right;">Status</th>
+  </tr>
+  <tr>
+    <td><b>PHP Pear Extension</b></td>
+    <td align="right">&nbsp;</td>
+  </tr>
+
+<?
+  foreach ($pear_module as $module) {
+  $msg = NULL;
+?>
+   <tr>
+    <td><b>&nbsp;&nbsp;&nbsp;<? echo $module["name"] ?></b></td>
+    <td align="right"><?
+    	if (file_exists($pear_path. '/'.$module["path"])) {
+          	echo '<b><span class="go">OK</font></b>';
+		} else {
+			echo '<b><span class="stop">Failed</font></b>';
+			$msg ="Need " . $module["name"] . "-" . $module["version"];
+		    $return_false = 1;
+		}
+		?></td>
+  </tr>
+  <? if($msg)  { ?>
+  <tr>
+    <td align="right" colspan="2"><? echo $msg ; ?></td>
+  </tr>
+  <? } ?>
+
+  <? } ?>
+</table>
+<?
+
+aff_middle();
+$str = '';
+if (isset($return_false))
+	$str = "<input class='button' type='submit' name='Recheck' value='Recheck' />";
+$str .= "<input class='button' type='submit' name='goto' value='Back' /><input class='button' type='submit' name='goto' value='Next' id='button_next'";
+if ($return_false)
+	$str .= " disabled";
+$str .= " />";
+print $str;
+aff_footer();
+?>
\ No newline at end of file
diff --git a/www/install/steps/step6.php b/www/install/steps/step6.php
new file mode 100644
index 0000000000000000000000000000000000000000..7ca02b76277b24dbf49c3af5a4377b0393d6b9d5
--- /dev/null
+++ b/www/install/steps/step6.php
@@ -0,0 +1,73 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+aff_header("Oreon Setup Wizard", "DataBase Configuration", 6);
+if (isset($passwd_error) && $passwd_error)
+	print "<center><b><span class=\"stop\">$passwd_error</span></b></center><br>";
+?>
+<table cellpadding="0" cellspacing="0" border="0" width="80%" class="StyleDottedHr" align="center">
+  <tr>
+    <th align="left">Component</th>
+    <th style="text-align: right;">Status</th>
+  </tr>
+  <tr>
+    <td><b>Root password for Mysql</b></td>
+    <td align="right"><input type="password" name="pwdroot" value="<? if (isset($_SESSION["pwdroot"])) print $_SESSION["pwdroot"]; ?>"></td>
+  </tr>
+  <tr>
+    <td><b>Oreon Database Name</b></td>
+    <td align="right"><input type="text" name="nameOreonDB" value="<? if (isset($_SESSION["nameOreonDB"])) print $_SESSION["nameOreonDB"]; ?>"></td>
+  </tr>
+  <tr>
+    <td><b>Oreon Database Password</b></td>
+    <td align="right"><input type="password" name="pwdOreonDB" value="<? if (isset($_SESSION["pwdOreonDB"])) print $_SESSION["pwdOreonDB"]; ?>"></td>
+  </tr>
+  <tr>
+    <td><b>Confirm it</b></td>
+    <td align="right"><input type="password" name="pwdOreonDB2" value="<? if (isset($_SESSION["pwdOreonDB2"])) print $_SESSION["pwdOreonDB2"]; ?>"></td>
+  </tr>
+  <tr>
+    <td><b>Database location (localhost)</b></td>
+    <td align="right"><input type="text" name="dbLocation" disabled value="<? if (isset($_SESSION["dbLocation"])) print $_SESSION["dbLocation"]; ?>"></td>
+  </tr>
+  <tr>
+    <td><b>Nagios location (localhost)</b></td>
+    <td align="right"><input type="text" name="nagiosLocation" disabled value="<? if (isset($_SESSION["nagiosLocation"])) print $_SESSION["nagiosLocation"]; ?>"></td>
+  </tr>
+ <!--  <tr>
+    <td><b>Nagios version</b></td>
+    <td align="right">1.x <input type="radio" name="nagiosVersion" value="1" checked> - 2.x <input type="radio" name="nagiosVersion" value="2" <? if (isset($_SESSION["nagiosVersion"]) && $_SESSION["nagiosVersion"] == 2) print "checked"; ?>></td>
+  </tr> -->
+   <tr>
+    <td><b>MySQL Client version (Password Haching Changes)</b></td>
+    <td align="right">
+    	<select name="mysqlVersion">
+    		<option value="1" <? if (isset($_SESSION["mysqlVersion"]) && $_SESSION["mysqlVersion"] == "1") print "selected"; else if (!isset($_SESSION["mysqlVersion"])) print "selected"; ?>>3.x</option>
+    		<option value="2" <? if (isset($_SESSION["mysqlVersion"]) && $_SESSION["mysqlVersion"] == "2") print "selected"; ?>>>= 4.1 - OLD_PASSWORD()</option>
+    		<option value="3" <? if (isset($_SESSION["mysqlVersion"]) && $_SESSION["mysqlVersion"] == "3") print "selected"; ?>>>= 4.1 - PASSWORD()</option>
+    	</select>
+   	</td>
+  </tr>
+  <!--<input type="hidden" name="mysqlVersion" value="3">-->
+</table>
+<?
+aff_middle();
+$str = "<input class='button' type='submit' name='goto' value='Back' /><input class='button' type='submit' name='goto' value='Next' id='button_next' />";
+print $str;
+aff_footer();
+?>
\ No newline at end of file
diff --git a/www/install/steps/step7.php b/www/install/steps/step7.php
new file mode 100644
index 0000000000000000000000000000000000000000..8ea636b020c157e814d82319577f87193b6508f3
--- /dev/null
+++ b/www/install/steps/step7.php
@@ -0,0 +1,82 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+if (isset($_POST["goto"]) && strcmp($_POST["goto"], "Back")){
+	if (isset($_POST["nagiosLocation"]) && strcmp($_POST["nagiosLocation"], ""))
+		$_SESSION["nagiosLocation"] = $_POST["nagiosLocation"];
+	else
+		$_SESSION["nagiosLocation"] = "localhost";
+	if (isset($_POST["dbLocation"]) && strcmp($_POST["dbLocation"], ""))
+		$_SESSION["dbLocation"] = $_POST["dbLocation"];
+	else
+		$_SESSION["dbLocation"] = "localhost";
+	if (isset($_POST["pwdOreonDB"])) $_SESSION["pwdOreonDB"] = $_POST["pwdOreonDB"];
+	if (isset($_POST["pwdOreonDB2"])) $_SESSION["pwdOreonDB2"] = $_POST["pwdOreonDB2"];
+	if (isset($_POST["pwdroot"])) $_SESSION["pwdroot"] = $_POST["pwdroot"];
+	if (isset($_POST["nameOreonDB"])) $_SESSION["nameOreonDB"] = $_POST["nameOreonDB"];
+	if (isset($_POST["nagiosVersion"])) $_SESSION["nagiosVersion"] = $_POST["nagiosVersion"];
+	if (isset($_POST["mysqlVersion"])) $_SESSION["mysqlVersion"] = $_POST["mysqlVersion"];
+}
+aff_header("Oreon Setup Wizard", "DataBase Verification", 7);
+
+?>
+<table cellpadding="0" cellspacing="0" border="0" width="80%" class="StyleDottedHr" align="center">
+  <tr>
+    <th align="left">Component</th>
+    <th style="text-align: right;">Status</th>
+  </tr>
+   <tr>
+    <td><b>MySQL version</b></td>
+  <?
+	$res = connexion('root', (isset($_SESSION["pwdroot"]) ? $_SESSION["pwdroot"] : '' ) , $_SESSION["dbLocation"]) ;
+	$mysql_msg = $res['1'];
+
+	if ($mysql_msg == '') {
+
+		$requete = "SELECT VERSION() AS mysql_version;";
+		if ($DEBUG) print $requete . "<br>";
+		$result = mysql_query($requete, $res['0']);
+		$row = mysql_fetch_assoc($result);
+		if(preg_match("/^(4\.1|5\.)/", $row['mysql_version'])){
+			echo '<td align="right"><b><span class="go">OK ('.$row['mysql_version'].')</b></td></tr>';
+		} else {
+			echo '<td align="right"><b><span class="stop">CRITICAL ('.$row['mysql_version'].')</b></td></tr>';
+			$mysql_msg = "MySQL 4.1 or newer needed";
+			$return_false = 1;
+		}
+	?>
+  <? } else {
+  		echo '<td align="right"><b><span class="stop">CRITICAL</span></b></td></tr>';
+		$return_false = 1;
+	 } ?>
+	<tr>
+    	<td colspan="2" align="right"><? echo $mysql_msg; ?></td>
+	</tr>
+</table>
+<?
+aff_middle();
+$str ='';
+if ($return_false)
+	$str .= "<input class='button' type='submit' name='Recheck' value='Recheck' />";
+$str .= "<input class='button' type='submit' name='goto' value='Back' /><input class='button' type='submit' name='goto' value='Next' id='button_next' ";
+if ($return_false)
+	$str .= " disabled";
+$str .= " />";
+		print $str;
+		aff_footer();
+?>
\ No newline at end of file
diff --git a/www/install/steps/step8.php b/www/install/steps/step8.php
new file mode 100644
index 0000000000000000000000000000000000000000..e484b178b3a86ec82f0f40ea14cb7d121915e4cd
--- /dev/null
+++ b/www/install/steps/step8.php
@@ -0,0 +1,78 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+aff_header("Oreon Setup Wizard", "User Interface Configuration", 8);
+if (isset($passwd_error) && $passwd_error)
+	print "<center><b><span class=\"stop\">$passwd_error</span></b></center><br>";
+?>
+<table cellpadding="0" cellspacing="0" border="0" width="80%" class="StyleDottedHr" align="center">
+  <tr>
+    <th align="left">Component</th>
+    <th style="text-align: right;">Status</th>
+  </tr>
+  <tr>
+    <td><b>Administrator login for Oreon</b></td>
+    <td align="right"><input type="text" name="oreonlogin" value="<? if (isset($_SESSION["oreonlogin"])) print $_SESSION["oreonlogin"]; ?>"></td>
+  </tr>
+  <tr>
+    <td><b>Administrator password for Oreon</b></td>
+    <td align="right"><input type="password" name="oreonpasswd" value="<? if (isset($_SESSION["oreonpasswd"])) print $_SESSION["oreonpasswd"]; ?>"></td>
+  </tr>
+  <tr>
+    <td><b>Confirm Password</b></td>
+    <td align="right"><input type="password" name="oreonpasswd2" value="<? if (isset($_SESSION["oreonpasswd"])) print $_SESSION["oreonpasswd"]; ?>"></td>
+  </tr>
+  <tr>
+    <td><b>Administrator firstname for Oreon</b></td>
+    <td align="right"><input type="text" name="oreonfirstname" value="<? if (isset($_SESSION["oreonfirstname"])) print $_SESSION["oreonfirstname"]; ?>"></td>
+  </tr>
+  <tr>
+    <td><b>Administrator lastname for Oreon</b></td>
+    <td align="right"><input type="text" name="oreonlastname" value="<? if (isset($_SESSION["oreonlastname"])) print $_SESSION["oreonlastname"]; ?>"></td>
+  </tr>
+  <tr>
+    <td><b>Administrator Email for Oreon</b></td>
+    <td align="right"><input type="text" name="oreonemail" value="<? if (isset($_SESSION["oreonemail"])) print $_SESSION["oreonemail"]; ?>"></td>
+  </tr>
+  <tr>
+    <td><b>Administrator language for Oreon</b></td>
+    <td align="right"><select name="oreonlang">
+			<?
+			$chemintotal = "../lang/";
+			if ($handle  = opendir($chemintotal))	{
+				while ($file = readdir($handle))
+					if	(!is_dir("$chemintotal/$file") && strcmp($file, "index.php")) {
+						$tab = split('\.', $file);
+						print "<option ";
+						if (isset($_SESSION["oreonlang"]) && !strcmp($_SESSION["oreonlang"], $tab[0]))
+							print "selected";
+						print ">" . $tab[0] . "</option>";
+					}
+				closedir($handle);
+			}
+			?>
+			</select>
+	</td>
+  </tr>
+</table>
+<?
+aff_middle();
+$str = "<input class='button' type='submit' name='goto' value='Back' /><input class='button' type='submit' name='goto' value='Next' id='button_next' />";
+print $str;
+aff_footer();
+?>
\ No newline at end of file
diff --git a/www/install/steps/step9.php b/www/install/steps/step9.php
new file mode 100644
index 0000000000000000000000000000000000000000..6509282e5b792856823dd2d1615272fd78a2ad35
--- /dev/null
+++ b/www/install/steps/step9.php
@@ -0,0 +1,77 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+if (isset($_POST["goto"]) && strcmp($_POST["goto"], "Back")){
+	$_SESSION["oreonlogin"] = $_POST["oreonlogin"];
+	$_SESSION["oreonpasswd"] = $_POST["oreonpasswd"];
+	$_SESSION["oreonfirstname"] = $_POST["oreonfirstname"];
+	$_SESSION["oreonlastname"] = $_POST["oreonlastname"];
+	$_SESSION["oreonemail"] = $_POST["oreonemail"];
+	$_SESSION["oreonlang"] = $_POST["oreonlang"];
+}
+aff_header("Oreon Setup Wizard", "LDAP Authentification", 9);   ?>
+If you want enable LDAP authentification, please complete the following fields. If you don't, leave blank.<br><br>
+<table cellpadding="0" cellspacing="0" border="0" width="80%" class="StyleDottedHr" align="center">
+  <tr>
+    <th style="padding-left:20px " colspan="2">LDAP Configuration</th>
+  </tr>
+   <tr>
+    <td style="padding-left:50px ">Enable LDAP Authentification ?</td>
+	<td>
+		<input type="radio" name="ldap_auth_enable"  value="0" <? if (isset($_SESSION["ldap_auth_enable"]) && $_SESSION["ldap_auth_enable"] == "0") { print "checked"; $display ="none" ;} else if (!isset($_SESSION["ldap_auth_enable"])) { print "checked"; $display ="none";} ?> onClick="document.getElementById('ldap_settings').style.display = 'none';" >No
+    	<input type="radio" name="ldap_auth_enable"  value="1" <? if (isset($_SESSION["ldap_auth_enable"]) && $_SESSION["ldap_auth_enable"] == "1") { print "checked"; $display ="block"; }?>  onClick="document.getElementById('ldap_settings').style.display = 'block';" >Yes
+
+  </tr>
+  <tr>
+  	<td colspan="2">
+		<div id='ldap_settings' style="display: <? echo $display; ?>;">
+		<table cellpadding="0" cellspacing="0" border="0" width="90%" class="StyleDottedHr" align="center">
+		  <tr>
+		    <td style="padding-left:50px ">LDAP Host</td>
+			<td><input name="ldap_host" type="text" value="<? echo (isset($_SESSION["ldap_host"]) ?  $_SESSION["ldap_host"]  : "localhost" );?>"></td>
+		  </tr>
+		  <tr>
+		    <td style="padding-left:50px ">LDAP Port</td>
+			<td><input name="ldap_port" type="text" value="<? echo (isset($_SESSION["ldap_port"]) ?  $_SESSION["ldap_port"]  :  "389" );?>"></td>
+		  </tr>
+		 <tr>
+		    <td style="padding-left:50px ">LDAP Base DN</td>
+			<td><input name="ldap_base_dn" type="text" value="<? echo (isset($_SESSION["ldap_base_dn"]) ?  $_SESSION["ldap_base_dn"]  : "dc=foo,dc=fr" );?>"></td>
+		  </tr>
+		  <tr>
+		    <td style="padding-left:50px ">LDAP Login Attribut</td>
+			<td><input name="ldap_login_attrib" type="text" value="<? echo (isset($_SESSION["ldap_login_attrib"]) ?  $_SESSION["ldap_login_attrib"]  : "uid" );?>"></td>
+		  </tr>
+		  <td style="padding-left:50px ">LDAP use SSL ?</td>
+			<td>
+				<input type="radio" name="ldap_ssl" value="0" <? if (isset($_SESSION["ldap_ssl"]) && $_SESSION["ldap_ssl"] == "0") print "checked"; else if (!isset($_SESSION["ldap_ssl"])) print "checked"; ?>>No
+		    	<input type="radio" name="ldap_ssl" value="1" <? if (isset($_SESSION["ldap_ssl"]) && $_SESSION["ldap_ssl"] == "1") print "checked"; ?>>Yes
+
+			</td>
+		  </tr>
+		 </table>
+	</div>
+   </td>
+  </tr>
+</table>
+<?
+aff_middle();
+$str = "<input class='button' type='submit' name='goto' value='Back' /><input class='button' type='submit' name='goto' value='Next' id='button_next' />";
+print $str;
+aff_footer();
+
+?>
\ No newline at end of file
diff --git a/www/install/upgrade.php b/www/install/upgrade.php
new file mode 100644
index 0000000000000000000000000000000000000000..a61f50b23cb408e0aa3c853f832c478d0040c523
--- /dev/null
+++ b/www/install/upgrade.php
@@ -0,0 +1,251 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon.org
+*/
+	// configuration
+include_once ("../class/Session.class.php");
+
+Session::start();
+
+include_once ("../oreon.conf.php");
+
+$DEBUG = 0;
+
+function Connexion ($pNom, $pMotPasse, $pServeur)	{
+	$connexion = @mysql_pconnect($pServeur, $pNom, $pMotPasse) or ($msg = mysql_error());
+	return array ($connexion, $msg);
+}
+
+function aff_header($str, $str2, $nb){
+?>
+<html>
+<head>
+   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+   <meta http-equiv="Content-Style-Type" content="text/css">
+   <title><? print $str; ?></title>
+   <link rel="shortcut icon" href="../img/favicon.ico">
+   <link rel="stylesheet" href="./install.css" type="text/css">
+   <SCRIPT language='javascript' src='../include/javascript/functions.js'></SCRIPT>
+   <SCRIPT language='javascript'>
+	function LicenceAccepted(){
+		var theForm     = document.forms[0];
+		var nextButton  = document.getElementById("button_next");
+
+		if( theForm.setup_license_accept.checked ){
+			nextButton.disabled = '';
+			nextButton.focus();
+		}
+		else {
+			nextButton.disabled = "disabled";
+		}
+	}
+	</SCRIPT>
+</head>
+<body rightmargin="0" topmargin="0" leftmargin="0">
+<table cellspacing="0" cellpadding="0" border="0" align="center" class="shell">
+<tr height="83" style=" background-image: url('../img/bg_banner.gif');">
+  <th width="400" height="83"><? print $nb . ". " . $str2; ?></th>
+  <th width="200" height="83" style="text-align: right; padding: 0px;">
+		<a href="http://www.oreon-project.org" target="_blank"><IMG src="../img/logo_oreon.gif" alt="Oreon" border="0"></a>
+  </th>
+</tr>
+<tr>
+  <td colspan="2" width="600" style="background-position : right; background-color: #DDDDDD; background-repeat : no-repeat;">
+	<form action="upgrade.php" method="post" name="theForm" id="theForm">
+	<input type="hidden" name="step" value="<? print $nb; ?>">
+<?
+}
+
+function aff_middle(){
+?>
+  </td>
+</tr>
+<tr>
+  <td align="right" colspan="2" height="20">
+	<hr>
+	<table cellspacing="0" cellpadding="0" border="0" class="stdTable">
+	  <tr>
+		<td>
+<?
+}
+
+function aff_footer(){
+?>				</td>
+			  </tr>
+		</table>
+		</form>
+	  </td>
+	</tr>
+  </table>
+</body>
+</html>
+<?
+}
+
+	if (isset($_POST["Recheck"]))
+		 $_POST["step"] = 3;
+	if (isset($_POST["goto"]) && !strcmp($_POST["goto"], "Back"))
+		 $_POST["step"] -= 2;
+	if (isset($_POST["step"]) && isset($_POST["pwdOreonDB"])&& $_POST["step"] == 5 && strcmp($_POST["pwdOreonDB"], $_POST["pwdOreonDB2"])){
+		$_POST["step"] = 4;
+		$passwd_error = "Password not confimed correctly.";
+	}
+	if (isset($_POST["step"]) && $_POST["step"] == 6 && strcmp($_POST["oreonpasswd"], $_POST["oreonpasswd2"])){
+		$_POST["step"] = 5;
+		$passwd_error = "Password not confimed correctly.";
+	}
+	if (!isset($_POST["step"])){
+		aff_header("Oreon Upgrade Wizard", "Welcome to Oreon Upgrade Setup", 1);
+		$str = "<p>This installer updates the Oreon database tables. The entire process
+        should take about 2 minutes.</p>";
+		print $str;
+		aff_middle();
+		$str = "<input class='button' type='submit' name='goto' value='Start' id='defaultFocus' /></td>";
+		print $str;
+		aff_footer();
+	} else if (isset($_POST["step"]) && $_POST["step"] == 1){
+		aff_header("Oreon Upgrade Wizard", "Licence", 2);
+		$license_file_name = "./LICENSE.txt";
+		$fh = fopen( $license_file_name, 'r' ) or die( "License file not found!" );
+		$license_file = fread( $fh, filesize( $license_file_name ) );
+		fclose( $fh );
+		$str = "<textarea cols='80' rows='20' readonly>".$license_file."</textarea>";
+		$str .= "</td>
+		</tr>
+		<tr>
+		  <td align=left>
+			<input type='checkbox' class='checkbox' name='setup_license_accept' onClick='LicenceAccepted();' value='0' /><a href='javascript:void(0)' onClick='document.getElementById('button_next').disabled = false;'>I Accept</a>
+		  </td>
+		  <td align=right>
+			&nbsp;
+		  </td>
+		</tr>";
+		print $str;
+		aff_middle();
+		$str = "<input class='button' type='submit' name='goto' value='Next' id='button_next' disabled='disabled' />";
+		print $str;
+		aff_footer();
+	} else if (isset($_POST["step"]) && $_POST["step"] == 2){
+		aff_header("Oreon Upgrade Wizard", "Select Version", 3); ?>
+					In order for your Oreon upgrade to function properly, please select the mysql script file.<br><br>
+		<table cellpadding="0" cellspacing="0" border="0" width="80%" class="StyleDottedHr" align="center">
+          <tr>
+            <th style="padding-left:20px " colspan="2">Upgrade SQL Scripts</th>
+          </tr>
+		  <tr>
+            <td><b>MySQL Scripts</b></td>
+            <td align="right">
+            	<select name="mysqlscript">
+            	<?
+            		chdir('sql');
+            		foreach (glob("*.sql") as $filename) {
+   					echo '<option value="'.$filename.'">'.$filename.'</option>'; }
+            	?>
+            	</select>
+           	</td>
+          </tr>
+		</table>
+		<?
+		aff_middle();
+		$str = "<input class='button' type='submit' name='goto' value='Back' /><input class='button' type='submit' name='goto' value='Next' id='button_next' />";
+		print $str;
+		aff_footer();
+	} else if (isset($_POST["step"]) && $_POST["step"] == 3){
+			if (isset($_POST["goto"]) && strcmp($_POST["goto"], "Back")) {
+			$_SESSION["mysqlscript"] = $_POST["mysqlscript"]; }
+
+		aff_header("Oreon Setup Wizard", "Creating Database", 4);
+		?>
+	<table cellpadding="0" cellspacing="0" border="0" width="80%" class="StyleDottedHr" align="center">
+          <tr>
+            <th align="left">Component</th>
+            <th style="text-align: right;">Status</th>
+          </tr>
+			<tr>
+				<td><b>Database &#146;<? echo $conf_oreon['db'] ; ?>&#146; : Upgrade</b></td>
+<?
+/*
+        	$conf_oreon['host']
+        	$conf_oreon['user']
+        	$conf_oreon['password']
+        	$conf_oreon['db']
+*/
+			$res = connexion($conf_oreon['user'], $conf_oreon['password']  , $conf_oreon['host']) ;
+			$mysql_msg = $res['1'];
+
+			$usedb = mysql_select_db($conf_oreon['db'] , $res['0']) or ( $mysql_msg= mysql_error());
+
+			if ($usedb) {
+				$file_sql = file("./sql/".$_SESSION["mysqlscript"], "r");
+	            $str = NULL;
+	            for ($i = 0; $i <= count($file_sql) - 1; $i++){
+		            $line = $file_sql[$i];
+		            if ($line[0] != '#')    {
+		                $pos = strrpos($line, ";");
+		                if ($pos != false)      {
+		                    $str .= $line;
+		                    $str = chop ($str);
+		                    $result = mysql_query($str, $res['0']) or ( $mysql_msg = $mysql_msg ."<br>" . mysql_error());
+		                    $str = NULL;
+		                }
+		                else
+		                	$str .= $line;
+		            }
+	            }
+			@mysql_close($res['0']);
+
+			if (!$mysql_msg) {
+     			echo '<td align="right"><b><span class="go">OK</b></td></tr>';
+			} else {
+				echo '<td align="right"><b><span class="stop">CRITICAL</span></b></td></tr>';
+			    $return_false = 1;
+			?>
+			<tr>
+		    	<td>&nbsp;</td>
+	            <td align="right"><? echo $mysql_msg; ?></td>
+			</tr>
+
+			<? }
+
+			} else {
+				echo '<td align="right"><b><span class="stop">CRITICAL</span></b></td></tr>';
+			    $return_false = 1;
+			?>
+			<tr>
+		    	<td>&nbsp;</td>
+	            <td align="right"><? echo $mysql_msg ; ?></td>
+	            <? 	$return_false = 1; ?>
+			</tr>
+
+		<?	}
+			@mysql_close($res['0']);
+		// end last code
+		aff_middle();
+		$str = "<input class='button' type='submit' name='goto' value='Back' /><input class='button' type='submit' name='goto' value='Next' id='button_next' ";
+		if ($return_false)
+			$str .= " disabled";
+		$str .= " />";
+		print $str;
+		aff_footer();
+	} else if (isset($_POST["step"]) && $_POST["step"] == 4){
+		session_destroy();
+		$tmpfname = tempnam("", "");
+		@unlink($tmpfname);
+		@rename(getcwd(), realpath("..")."/".basename($tmpfname ));
+		header("Location: ../index.php");
+	}
+	exit();
+?>
diff --git a/www/lang/en.php b/www/lang/en.php
new file mode 100644
index 0000000000000000000000000000000000000000..ebb91c5ab89d2cbebc24647207d7fbcbff0c70e7
--- /dev/null
+++ b/www/lang/en.php
@@ -0,0 +1,1012 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+/*
+This file contains all Oreon's text. This method facilitate us to do a multi-language tool.
+It will be easy to guess what variables are corresponding to.
+*/
+
+/* Error Code */
+
+$lang['not_allowed'] = "You are not allowed to reach this page";
+$lang['not_dbPPConnect'] = "Problem with Perfparse Database connection";
+$lang['errCode'][-2] = "Object definition not complete";
+$lang['errCode'][-3] = "Object definition already exist";
+$lang['errCode'][-4] = "Invalid Email, xxx@xxx.xx format";
+$lang['errCode'][-5] = "Definition is circular";
+$lang['errCode'][-6] = "You have to choose a Host or a Hostgroup";
+$lang['errCode'][-7] = "Password is not correct";
+$lang['errCode'][-8] = "The date of beginning must be lower than the completion date";
+$lang['errCode'][-9] = "Some values are missing";
+$lang['errCode'][2] = "Object definition has been changed";
+$lang['errCode'][3] = "Object definition has been created";
+$lang['errCode'][4] = "Password has been changed";
+$lang['errCode'][5] = "Host has been duplicated";
+
+# Menu Level 1
+
+$lang['m_home'] = "Home";
+$lang['m_configuration'] = "Configuration";
+$lang['m_monitoring'] = "Monitoring";
+$lang['m_reporting'] = "Reporting";
+$lang['m_views'] = "Oreon' views";
+$lang['m_options'] = "Options";
+$lang['m_logout'] = "Logout";
+$lang['m_help'] = "Help";
+
+
+# Menu Level 3
+
+$lang["m_main_menu"] = "Main Menu";
+$lang["m_connected_users"] = "Online Users";
+
+# Monitoring menu
+
+$lang["m_host_detail"] = "Host detail";
+$lang["m_hosts_problems"] = "Hosts problems";
+$lang["m_hostgroup_detail"] = "Host Group detail";
+
+$lang["m_service_detail"] = "Service detail";
+$lang["m_services_problems"] = "Services problems";
+$lang["m_servicegroup_detail"] = "Service Group detail";
+$lang["m_service_by_service_group"] = "Services by Svc Grp";
+
+$lang["m_status_scheduling"] = "Status and scheduling";
+$lang["m_status_summary"] = "Status Summary";
+$lang["m_status_resume"] = "Status Resume";
+
+$lang["m_status_grid"] = "Status Grid";
+$lang["m_scheduling"] = "Scheduling Queue";
+
+$lang['m_tools'] = "Tools";
+$lang["m_process_info"] = "Process Info";
+$lang["m_event_log"] = "Event Log";
+$lang["m_downtime"] = "Downtime";
+$lang["m_comments"] = "Comments";
+
+$lang["m_alerts"] = "Alerts history";
+
+# Log Menu
+
+$lang["m_all_logs"] = "All Logs";
+$lang["m_notify_logs"] = "Notifications";
+$lang["m_alerts_log"] = "Alerts";
+$lang["m_warning_log"] = "Errors/Warnings";
+
+# Reporting menu
+
+$lang["m_report"] = "Reports";
+$lang["m_rtList"] = "Report List";
+$lang["m_rtStat"] = "Stats";
+
+$lang["m_rtNotif"] = "Diffusion";
+$lang["m_rtMailList"] = "Diffusion List";
+$lang["m_rtMail"] = "Mail DB";
+
+$lang["m_message"] = "Message";
+$lang["m_status_map"] = "Carte de Status des Hosts";
+$lang["m_cartography"] = "Cartography";
+$lang["m_dashboard"] = "Dashboard";
+$lang["m_dashboardHost"] = "Host";
+$lang["m_dashboardService"] = "Service";
+
+# Graph menu
+
+$lang['m_views_loc'] = "Localisation";
+$lang['m_views_cty'] = "Countries & Cities";
+$lang['m_views_map'] = "Maps";
+$lang['m_views_graphs'] = "RRD Engine";
+$lang['m_views_graphCustom'] = "Custom Graphs";
+$lang['m_views_graphShow'] = "Simple Graphs Renderer";
+$lang['m_views_graphPlu'] = "Graphs Plugins";
+$lang['m_views_graphTmp'] = "Graphs Templates";
+$lang['m_views_compoTmp'] = "Components Templates";
+$lang['m_views_mine'] = "My Views";
+
+# Options menu
+
+$lang['m_opt_conf'] = "Oreon";
+$lang['m_general'] = "General Options";
+$lang['m_lang'] = "Language";
+$lang['m_menu'] = "Menu";
+$lang['m_plugins'] = "Plugins";
+$lang['m_myAccount'] = "My Account";
+
+$lang['m_acl'] = "ACL";
+$lang["lca_list"] = "Access Control Lists";
+
+$lang['m_db'] = "Database";
+$lang['m_extract_db'] = "Extract Database";
+
+$lang['m_server_status'] = "System";
+
+$lang['m_about'] = "About";
+$lang['m_web'] = "Site Web";
+$lang['m_forum'] = "Forum";
+$lang['m_wiki'] = "Wiki";
+$lang['m_bug'] = "Bug Track";
+$lang['m_donate'] = "Donation";
+$lang['m_pro'] = "Professional";
+
+$lang['m_sessions'] = "Sessions";
+
+# Configuration menu
+
+$lang['m_host'] = "Hosts";
+$lang['m_hostgroup'] = "Host Groups";
+$lang['m_host_extended_info'] = "Host Extended Infos";
+
+$lang['m_service'] = "Services";
+$lang['m_serviceByHost'] = "Services By Host";
+$lang['m_serviceByHostGroup'] = "Services By Host Group";
+$lang['m_servicegroup'] = "Service Groups";
+$lang['m_service_extended_info'] = "Service Extended Infos";
+$lang['m_meta_service'] = "Meta Services";
+
+$lang['m_notification'] = "Users";
+$lang['m_contact'] = "Contacts";
+$lang['m_contactgroup'] = "Contact Groups";
+$lang['m_timeperiod'] = "Time Periods";
+$lang['m_commandNotif'] = "Notification Commands";
+
+$lang['m_escalation'] = "Escalations";
+$lang['m_hostgroupesc'] = "Host Group Escalations";
+$lang['m_hostesc'] = "Host Escalations";
+$lang['m_serviceesc'] = "Service Escalations";
+$lang['m_metaserviceesc'] = "Meta Service Escalations";
+
+$lang['m_dependencies'] = "Dependencies";
+$lang['m_service_dependencies'] = "Service Dependencies";
+$lang['m_host_dependencies'] = "Host Dependencies";
+
+$lang['m_template'] = "Templates";
+$lang['m_host_template_model'] = "Host Template Models";
+$lang['m_service_template_model'] = "Service Template Models";
+
+$lang['m_nagios'] = "Nagios";
+$lang['m_nagiosCFG'] = "Nagios CFG";
+$lang['m_cgi'] = "CGI CFG";
+$lang['m_resource'] = "Resource CFG";
+$lang['m_perfparse'] = "Perfparse CFG";
+$lang['m_load_nagios'] = "Load";
+$lang['m_gen_nagios'] = "Generate";
+$lang['m_commandCheck'] = "Check Command";
+
+/* ID Menu */
+
+$lang["m_idCards"] = "ID Cards";
+$lang["m_id_serv"] = "Servers";
+$lang["m_id_network"] = "Network Equipments";
+$lang["m_idUpdate"] = "Manual Update";
+$lang["m_id_manu"] = "Manufacturer";
+
+/* Plugins */
+
+$lang["plugins1"] = "Plugins deleted";
+$lang["plugins2"] = "Are you sure you want to delete this plugin ? ";
+$lang["plugins3"] = "Plugin sent";
+$lang["plugins4"] = "A error occured during Plugin upload. May be a right problem";
+$lang["plugins5"] = "A error occured during &#146;oreon.conf&#146; file creation. May be a right problem";
+$lang["plugins6"] = "Generated file";
+$lang["plugins_add"] = "Add plugins for Nagios";
+$lang["plugins"] = "Plugins";
+$lang["plugins_list"] = "List of plugins";
+$lang["plugins_pm_conf"] = "Oreon.conf";
+$lang["plugins_pm_conf_desc"] = "Generate configuration file for Oreon.pm with informations include in General menu";
+
+/* index100 */
+
+$lang['ind_infos'] = "In this section, you can configure all Nagios items";
+$lang['ind_detail'] = "Ressources are linked together, be careful when you modify or delete one item, related items will be removed too.";
+
+/* index */
+
+$lang['ind_first'] = "You are already connected to OREON, firstly, close the other session<br>If this window is only the first windo you&acute;ve got, click";
+
+/* alt main */
+
+$lang['am_intro'] = "monitoring now :";
+$lang['host_health'] = "Host health";
+$lang['service_health'] = "Service health";
+$lang['network_health'] = "Network health";
+$lang['am_hg_vdetail'] = 'View Hostgroup details';
+$lang['am_sg_vdetail'] = 'View Servicegroup details';
+$lang['am_hg_detail'] = 'Hostgroup details';
+$lang['am_sg_detail'] = 'Servicegroup details';
+
+/* Monitoring */
+
+$lang['mon_last_update'] = "Last update :";
+$lang['mon_up'] = "UP";
+$lang['mon_down'] = "DOWN";
+$lang['mon_unreachable'] = "UNREACHABLE";
+$lang['mon_ok'] = "OK";
+$lang['mon_critical'] = "CRITICAL";
+$lang['mon_warning'] = "WARNING";
+$lang['mon_pending'] = "PENDING";
+$lang['mon_unknown'] = "UNKNOWN";
+$lang['mon_status'] = "Status";
+$lang['mon_ip'] = "IP";
+$lang['mon_last_check'] = "Last Check";
+$lang['mon_next_check'] = "Next Check";
+$lang['mon_active_check'] = "Active Check";
+$lang['mon_duration'] = "Duration";
+$lang['mon_retry'] = "Retry";
+$lang['mon_status_information'] = "Status information";
+$lang['mon_service_overview_fah'] = "Service Overview For All Host Groups";
+$lang['mon_service_overview_fas'] = "Service Overview For All Service Groups";
+$lang['mon_status_summary_foh'] = "Status Summary For All Host Groups";
+$lang['mon_status_grid_fah'] = "Status Grid for ALL Host Groups";
+$lang['mon_sv_hg_detail1'] = "Service details";
+$lang['mon_sv_hg_detail2'] = "for Host Group";
+$lang['mon_sv_hg_detail3'] = "for Host";
+$lang['mon_host_status_total'] = "Host Status Total";
+$lang['mon_service_status_total'] = "Service Status Total";
+$lang['mon_scheduling'] = "Scheduling queue";
+$lang['mon_actions'] = "Actions";
+$lang['mon_active'] = "ACTIVE";
+$lang['mon_inactive'] = "INACTIVE";
+$lang['mon_request_submit_host'] = "Your request had been submitted. <br><br>You&#146;re gonna be send at the Host page'.";
+$lang['Details'] = "Details";
+$lang['mon_checkOutput'] = "check output";
+$lang['mon_dataPerform'] = "data perform";
+
+/* Monitoring command */
+
+$lang['mon_hg_commands'] = "Host Group Commands";
+$lang['mon_h_commands'] = "Host Commands";
+$lang['mon_sg_commands'] = "Service Group Commands";
+$lang['mon_s_commands'] = "Service Commands";
+$lang['mon_no_stat_for_host'] = "No stat for this Host.<br><br> Think has generate the configuration files.";
+$lang['mon_no_stat_for_service'] = "No stat for this Service.<br><br> Think has generate the configuration files.";
+$lang['mon_hg_cmd1'] = "Schedule downtime for all hosts in this hostgroup";
+$lang['mon_hg_cmd2'] = "Schedule downtime for all services in this hostgroup";
+$lang['mon_hg_cmd3'] = "Enable notifications for all hosts in this hostgroup";
+$lang['mon_hg_cmd4'] = "Disable notifications for all hosts in this hostgroup";
+$lang['mon_hg_cmd5'] = "Enable notifications for all services in this hostgroup";
+$lang['mon_hg_cmd6'] = "Disable notifications for all services in this hostgroup";
+$lang['mon_hg_cmd7'] = "Enable checks of all services in this hostgroup";
+$lang['mon_hg_cmd8'] = "Disable checks of all services in this hostgroup";
+$lang['mon_host_state_info'] = "Host State Information";
+$lang['mon_hostgroup_state_info'] = "Hostgroup State Information";
+$lang['mon_host_status'] = "Host Status";
+$lang['mon_status_info'] = "Status Information";
+$lang['mon_last_status_check'] = "Last Status Check";
+$lang['mon_status_data_age'] = "Status Data Age";
+$lang['mon_current_state_duration'] = "Current State Duration";
+$lang['mon_last_host_notif'] = "Last Host Notification";
+$lang['mon_current_notif_nbr'] = "Current Notification Number";
+$lang['mon_is_host_flapping'] = "Is This Host Flapping ?";
+$lang['mon_percent_state_change'] = "Percent State Change";
+$lang['mon_is_sched_dt'] = "Is Scheduled Downtime ?";
+$lang['mon_last_update'] = "Last Update";
+$lang['mon_sch_imm_cfas'] = "Schedule an immediate check of all services";
+$lang['mon_sch_dt'] = "Schedule downtime";
+$lang['mon_dis_notif_fas'] = "Disable notifications for all services";
+$lang['mon_enable_notif_fas'] = "Enable notifications for all services";
+$lang['mon_dis_checks_fas'] = "Disable checks of all services";
+$lang['mon_enable_checks_fas'] = "Enable checks of all services";
+$lang['mon_service_state_info'] = "Service State Information";
+$lang['mon_service_status'] = "Service State";
+$lang['mon_current_attempt'] = "Current Attempt";
+$lang['mon_state_type'] = "State Type";
+$lang['mon_last_check_type'] = "Last Check Type";
+$lang['mon_last_check_time'] = "Last Check Time";
+$lang['mon_next_sch_active_check'] = "Next Scheduled Active Check";
+$lang['mon_last_service_notif'] = "Last Service Notification";
+$lang['mon_is_service_flapping'] = "Is This Service Flapping ?";
+$lang['mon_percent_state_change'] = "Percent State Change";
+$lang['mon_checks_for_service'] = "checks of this service";
+$lang['mon_accept_pass_check'] = "accepting passive checks for this service";
+$lang['mon_notif_service'] = "notifications for this service";
+$lang['mon_eh_service'] = "event handler for this service";
+$lang['mon_fp_service'] = "flap detection for this service";
+$lang['mon_submit_pass_check_service'] = "Submit passive check result for this service";
+$lang['mon_sch_dt_service'] = "Schedule downtime for this service";
+$lang['mon_service_check_executed'] = "Service Checks Being Executed";
+$lang['mon_passive_service_check_executed'] = "Passive Service Checks Being Accepted";
+$lang['mon_eh_enabled'] = "Event Handlers Enabled";
+$lang['mon_obess_over_services'] = "Obsessing Over Services";
+$lang['mon_fp_detection_enabled'] = "Flap Detection Enabled";
+$lang['mon_perf_data_process'] = "Performance Data Being Processed";
+$lang['mon_request_submit_host'] = "Your request has been recorded<br><br>You&#146;re gonna be redirected to the host page.";
+$lang['mon_process_infos'] = "Process Informations";
+$lang['mon_process_start_time'] = "Program Start Time";
+$lang['mon_total_run_time'] = "Total Running Time";
+$lang['mon_last_ext_command_check'] = "Last External Command Check";
+$lang['mon_last_log_file_rotation'] = "Last Log File Rotation";
+$lang['mon_nagios_pid'] = "Nagios PID";
+$lang['mon_process_cmds'] = "Process Commands";
+$lang['mon_stop_nagios_proc'] = "Stop the Nagios Process";
+$lang['mon_start_nagios_proc'] = "Start the Nagios Process";
+$lang['mon_restart_nagios_proc'] = "Restart the Nagios Process";
+$lang['mon_proc_options'] = "Process Options";
+$lang['mon_notif_enabled'] = "Notifications Enabled";
+$lang['mon_notif_disabled'] = "Notifications Disabled";
+$lang['mon_service_check_disabled'] = "Service Check Disabled";
+$lang['mon_service_check_passice_only'] = "Passive Check Only";
+$lang['mon_service_view_graph'] = "View graph";
+$lang['mon_service_sch_check'] = "Schedule an immediate check of this service";
+
+/* comments */
+
+$lang['cmt_service_comment'] = "Service Comments";
+$lang['cmt_host_comment'] = "Host Comments";
+$lang['cmt_addH'] = "Add a Host comment";
+$lang['cmt_addS'] = "Add a Service comment";
+$lang["cmt_added"] = "Comment added with succes. <br><br>Click <a href='./oreon.php?p=307' class='text11b'>here</a> to return to the comments page. ";
+$lang["cmt_del"] = "Comment deleted with succes. <br><br>Click <a href='./oreon.php?p=307' class='text11b'>here</a> to return to the comments page. ";
+$lang["cmt_del_all"] = "All Comments deleted with succes. <br><br>Click <a href='./oreon.php?p=307' class='text11b'>here</a> to return to the comments page. ";
+$lang['cmt_host_name'] = "Host Name";
+$lang['cmt_service_descr'] = "Services";
+$lang['cmt_entry_time'] = "Entry Time";
+$lang['cmt_author'] = "Author";
+$lang['cmt_comment'] = "Comment";
+$lang['cmt_persistent'] = "Persistent";
+$lang['cmt_actions'] = "Actions";
+
+/* downtime */
+
+$lang['dtm_addH'] = "Add a Host downtime";
+$lang['dtm_addS'] = "Add a Service downtime";
+$lang['dtm_addHG'] = "Add a Host Group downtime";
+$lang['dtm_added'] = "Downtime added with succes. <br><br>Click <a href='./oreon.php?p=308' class='text11b'>here</a> to return to the Downtimes page. ";
+$lang['dtm_del'] = "Downtime deleted with succes. <br><br>Click <a href='./oreon.php?p=308' class='text11b'>here</a> to return to the Downtimes page. ";
+$lang['dtm_start_time'] = "Start Time";
+$lang['dtm_end_time'] = "End Time";
+$lang['dtm_fixed'] = "Fixed";
+$lang['dtm_duration'] = "Duration";
+$lang['dtm_sch_dt_fht'] = "Schedule Downtime For Hosts Too";
+$lang['dtm_host_downtimes'] = "Host Downtimes";
+$lang['dtm_service_downtimes'] = "Service Downtimes";
+$lang['dtm_dt_no_file'] = "Downtime file not found";
+$lang['dtm_host_delete'] = "Delete host downtime";
+
+/* cmd externe */
+
+$lang['cmd_utils'] = 'Useful';
+$lang["cmd_send"] = "Your command has been send";
+$lang["cmd_ping"] = "Ping";
+$lang["cmd_traceroute"] = "Traceroute.";
+
+/* actions & recurrent text */
+
+$lang['home'] = "Home";
+$lang['oreon'] = "Oreon";
+$lang['add'] = "Add";
+$lang['dup'] = "Duplicate";
+$lang['save'] = "Save";
+$lang['modify'] = "Modify";
+$lang['delete'] = "Delete";
+$lang['update'] = "Update";
+$lang['ex'] = "Example ";
+$lang['name'] = "Name ";
+$lang['alias'] = "Alias ";
+$lang['user'] = "User ";
+$lang['here'] = "here";
+$lang['this'] = "this";
+$lang['confirm_removing'] = "Are you sure you want to delete this item ?";
+$lang['confirm_update'] = "Are you sure you want to update the traffic map ?";
+$lang['file_exist'] = "Sorry the file already exist.";
+$lang['uncomplete_form'] = "Uncomplete form or invalid";
+$lang['none'] = "none";
+$lang['already_logged'] = "You are already connected to OREON, close firstly the other session. <br> If this window is the only Oreon window, click <br><a href='?disconnect=1' class='text11b'>here</a>";
+$lang['usage_stats'] = "Statistics usage";
+$lang['check'] = "Check";
+$lang['uncheck'] = "Uncheck";
+$lang['options'] = "Options";
+$lang['status'] = "Status";
+$lang['status_options'] = "Status and options";
+$lang['details'] = "D&eacute;tails";
+$lang['back'] = "Retour";
+$lang['view'] = "View";
+$lang['choose'] = "Choose";
+$lang['enable'] = "Enabled";
+$lang['disable'] = "Disabled";
+$lang['yes'] = "Yes";
+$lang['no'] = "No";
+$lang['description'] = "Description";
+$lang['page'] = "Page";
+$lang['required'] = "<font color='red'>*</font> required";
+$lang['nbr_per_page'] = "Nbr per page";
+$lang['reset'] = "Reset";
+$lang['time_sec'] = " secondes ";
+$lang['time_min'] = " minutes ";
+$lang['time_hours'] = " Hours ";
+$lang['time_days'] = " Days ";
+$lang['size'] = "Size";
+$lang['close'] = "Close";
+
+/* host */
+
+$lang['h_available'] = "Available Host";
+$lang['h'] = "Host ";
+$lang['h_services'] = "Associated Service(s)";
+$lang['h_hostgroup'] = "Associated Host Group(s)";
+$lang['h_dependancy'] = "Belonging Host Groups ";
+$lang['h_nbr_dup'] = "Quantity to duplicate";
+
+/* extended host infos */
+
+$lang['ehi'] = "Extended Host Informations";
+$lang['ehi_available'] = "Available extended informations for Hosts ";
+$lang['ehi_notes'] = "Note";
+$lang['ehi_notes_url'] = "Note address";
+$lang['ehi_action_url'] = "Action url";
+$lang['ehi_icon_image'] = "Icon image";
+$lang['ehi_icon_image_alt'] = "Icon image alt";
+
+/* host template model*/
+
+$lang['htm_available'] = "Host(s) Template(s) Model(s) available(s)";
+$lang['htm'] = "Host Template Model ";
+$lang['htm_use'] = "Use a Host Template Model";
+$lang['htm_stats1'] = "This Template Model is used by ";
+
+/* host group */
+
+$lang['hg_title'] = "Host Groups ";
+$lang['hg_available'] = "Available Host Group(s)";
+$lang['hg'] = "Host Groups";
+$lang['hg_belong'] = "Host Groups belonged";
+
+/* host group escalation */
+
+$lang['hge'] = "Host Group Escalations";
+$lang['hge_available'] = "Available(s) Host Group escalation";
+
+/* host escalation */
+
+$lang['he'] = "Host Escalations";
+$lang['he_available'] = "Available(s) Host Escalation";
+
+/* host dependencies */
+
+$lang['hd'] = "Host Dependencies";
+$lang['hd_available'] = "available Host Dependencies";
+$lang['hd_dependent'] = "Host Dependent";
+
+/* host template model */
+
+$lang['htm'] = "Host Template Model";
+$lang['htm_u'] = "Use as a Host Template Model";
+$lang['htm_v'] = "Use Template in Host monitoring";
+
+/* service escalation */
+
+$lang['se'] = "Service Escalation";
+$lang['se_available'] = "Available(s) Service Escalation";
+
+/* service */
+
+$lang['s_ping_response'] = "ping response";
+$lang['s_logged_users'] = "logged users";
+$lang['s_free_disk_space'] = "free disk space";
+$lang['s_available'] = "Available Services";
+$lang['s_contact_groups'] = "Contact Groups :";
+$lang['s'] = "Service";
+
+/* extended service infos */
+
+$lang['esi'] = "Extended Service Informations";
+$lang['esi_available'] = "Available Extended Informations for Services ";
+$lang['esi_notes'] = "Note";
+$lang['esi_notes_url'] = "Note address";
+$lang['esi_action_url'] = "Action url";
+$lang['esi_icon_image'] = "Icon image";
+$lang['esi_icon_image_alt'] = "Icon image alt";
+
+/* service template model*/
+
+$lang['stm_available'] = "Service(s) Template(s) Model(s) available(s)";
+$lang['stm'] = "Service Template Model ";
+$lang['stm_use'] = "Use a Service Template Model";
+$lang['stm_stats1'] = "This Template Model is used by ";
+
+/* service dependencies */
+
+$lang['sd'] = "Service Dependencie";
+$lang['sd_available'] = "available Service Dependencies";
+$lang['sd_dependent'] = "Service Dependent";
+
+/* service group*/
+
+$lang['sg_available'] = "Available Service Group";
+$lang['sg'] = "Service Group";
+
+/* contact */
+
+$lang['c_available'] = "Available Contact(s)";
+$lang['c'] = "Contact";
+$lang['c_use'] = "This Contact is use in the Contact Groups :";
+
+/* contact group */
+
+$lang['cg_title'] = "Contact Group";
+$lang['cg_available'] = "Availables Contact Groups";
+$lang['cg'] = "Contact Group";
+$lang['cg_related'] = " is used with ";
+
+/* time period */
+
+$lang['tp_title'] = "Time Period";
+$lang['tp_notifications'] = "notifications ";
+$lang['tp_service_check'] = "service check ";
+$lang['tp_name'] = "Time Period name";
+$lang['tp_alias'] = "Alias ";
+$lang['tp_sunday'] = "Sunday ";
+$lang['tp_monday'] = "Monday ";
+$lang['tp_tuesday'] = "Tuesday ";
+$lang['tp_wednesday'] = "Wednesday ";
+$lang['tp_thursday'] = "Thursday ";
+$lang['tp_friday'] = "Friday ";
+$lang['tp_saturday'] = "Saturday ";
+$lang['tp_available'] = "Available Time Period";
+$lang['tp'] = "Time Period(s) ";
+$lang['tp_more_ex'] = " is used like a check Command on following Hosts :";
+$lang['tp_more_ex2'] ="is like an event handler on following Hosts :";
+
+/* command */
+
+$lang['cmd_title'] = "Command";
+$lang['cmd_notifications'] = "Service notifications ";
+$lang['cmd_service_check'] = "Service check ";
+$lang['cmd_event'] = "Service event handler ";
+$lang['cmd_host_check'] = "Host check ";
+$lang['cmd_host_notifications'] = "Host notifications ";
+$lang['cmd_host_event_handler'] = "Host event handler ";
+$lang['cmd_comment'] = "Command definitions can contain macros, but you must make sure that you include only those macros that are &quot;valid&quot; for the circumstances when the command will be used.";
+$lang['cmd_macro_infos'] = "More informations about macro can be found here :";
+$lang['ckcmd_available'] = "Available Check-Command(s)";
+$lang['ntcmd_available'] = "Available Notification-Command(s)";
+$lang['cmd_name'] = "Command name";
+$lang['cmd_line'] = "Command line ";
+$lang['cmd'] = "Command(s) ";
+$lang['cmd_more_ex'] = " is used like a check command on following hosts :";
+$lang['cmd_more_ex2'] =" is used like an event_Handler on following hosts :";
+$lang['cmd_type'] = "Command type";
+
+/* Load Nagios CFG */
+
+$lang['nfc_generated_by_oreon'] = 'Are the files generated with Oreon ?';
+$lang['nfc_targz'] = 'You have to upload a tar.gz file';
+$lang['nfc_limit'] = 'To load a Nagios configuration, you have to :<ul><li>Specify at least the misccommands.cfg and checkcommands.cfg files</li><li>Other definition can be in any file you want</li><li>Oreon doesn\'t manage the Nagios time-saving tricks</li></ul>';
+$lang['nfc_enum'] = "Hosts, services, contacts, commands, escalations, templates....";
+$lang['nfc_ncfg'] = "Nagios.cfg";
+$lang['nfc_rcfg'] = "Resource.cfg";
+$lang['nfc_ncfgFile'] = "Nagios.cfg file";
+$lang['nfc_rcfgFile'] = "Resource.cfg file";
+$lang['nfc_fileUploaded'] = "Files uploaded correctly";
+$lang['nfc_extractComplete'] = "Extract Complete";
+$lang['nfc_unzipComplete'] = "Unzip Complete";
+$lang['nfc_unzipUncomplete'] = "Unzip Uncomplete";
+$lang['nfc_uploadComplete'] = "Upload Complete";
+
+/* profile */
+
+$lang['profile_h_name'] = "Name";
+$lang['profile_h_contact'] = "Contact";
+$lang['profile_h_location'] = "Location";
+$lang['profile_h_uptime'] = "Uptime";
+$lang['profile_h_os'] = "Operating system";
+$lang['profile_h_interface'] = "Interface";
+$lang['profile_h_ram'] = "Memory";
+$lang['profile_h_disk'] = "Disk";
+$lang['profile_h_software'] = "Software";
+$lang['profile_h_update'] = "Windows update";
+$lang['profile_s_network'] = "By network";
+$lang['profile_s_os'] = "By operating system";
+$lang['profile_s_software'] = "By software";
+$lang['profile_s_update'] = "By Windows update";
+$lang['profile_s_submit'] = "search";
+$lang['profile_o_system'] = "System";
+$lang['profile_o_network'] = "Network";
+$lang['profile_o_storage'] = "Storage";
+$lang['profile_o_software'] = "Software";
+$lang['profile_o_live_update'] = "Live update";
+$lang['profile_h_ip'] = "IP";
+$lang['profile_h_speed'] = "Speed";
+$lang['profile_h_mac'] = "Mac";
+$lang['profile_h_status'] = "Status";
+$lang['profile_h_used_space'] = "Used space";
+$lang['profile_h_size'] = "Size";
+$lang['profile_h_partition'] = "Partition";
+$lang['profile_h_list_host'] = "Select your server";
+$lang['profile_menu_list'] = "Hosts";
+$lang['profile_menu_search'] = "Search";
+$lang['profile_menu_options'] = "Inventory";
+$lang['profile_search_results'] = "Search results for :";
+$lang['profile_title_partition'] = "Partition";
+$lang['profile_title_size'] = "Size";
+$lang['profile_title_used_space'] = "Used space";
+$lang['profile_title_free_space'] = "Free space";
+$lang['profile_error_snmp'] = "The SNMP deamon does not seem to running on host target";
+
+/* db */
+
+$lang['db_cannot_open'] = "File cannot be open :";
+$lang['db_cannot_write'] = "Unable to write into file :";
+$lang['db_genesis'] = "Generate configuration files";
+$lang['db_file_state'] = "Generated files's current state :";
+$lang['db_create_backup'] = "You should backup before creating new configuration file";
+$lang['db_create'] = "Create Database";
+$lang['db_generate'] = "Generate";
+$lang['db_nagiosconf_backup'] = "Nagios configuration backup ";
+$lang['db_backup'] = "All Oreon's database backup";
+$lang['db_nagiosconf_backup_on_server'] = "Backup Nagios configuration on server.";
+$lang['db_backup_spec_users'] = "backup user's configuration ";
+$lang['db_insert_new_database'] = "Insert a new database";
+$lang['db_reset_old_conf'] = "Load an old registered configuration";
+$lang['db_extract'] = "Extract";
+$lang['db_execute'] = "Execute";
+$lang['db_save'] = "Save";
+$lang["DB_status"] = "DataBase Statistics";
+$lang["db_lenght"] = "Lenght";
+$lang["db_nb_entry"] = "Entries Number";
+
+/* user */
+
+$lang['u_list'] = "Users&acute;s list";
+$lang['u_admin_list'] = "Administrator list";
+$lang['u_sadmin_list'] = "Super administrator list";
+$lang['u_user'] = "User";
+$lang['u_administrator'] = "Administrator";
+$lang['u_sadministrator'] = "Super administrator";
+$lang['u_profile'] = "Your profile";
+$lang['u_new_profile'] = "New profile";
+$lang['u_some_profile'] = "Profile for ";
+$lang['u_name'] = "Name ";
+$lang['u_lastname'] = "Lastname ";
+$lang['u_login'] = "Login ";
+$lang['u_passwd'] = "Password ";
+$lang['u_cpasswd'] = "Change password";
+$lang['u_ppasswd'] = "Confirm password ";
+$lang['u_email'] = "Email ";
+$lang['u_lang'] = "Choosen language ";
+$lang['u_status'] = "Status ";
+$lang['u_delete_profile'] = "delete this profile";
+
+/* lang */
+
+$lang['lang_infos'] = "There is already ";
+$lang['lang_infos2'] = "different languages reday to use.";
+$lang['lang_infos3'] = "If you want to add a new one. You have to upload a file in the following form";
+$lang['lang_detail'] = "This file should have same fields like ";
+$lang['lang_detail2'] = "in the choosen language";
+
+/* bug resolver */
+
+$lang['bug_infos'] = "On this page, you can erase all relations beetween ressources and database content which can contents errors if there is a bug.";
+$lang['bug_action'] = "Click here if you want to reset database if you get bugs while tests step, thanks to report us which step failed.";
+$lang['bug_kick'] = "Reset it";
+
+/* Parseenevlog */
+
+$lang['hours'] = "Hours";
+
+/* Log report */
+
+$lang['add_report'] = "The report has been added";
+$lang['change_report'] = "The report has been changed";
+$lang['add_reportHost'] = "A new Host has been added";
+$lang['add_reportService'] = "Service(s) has been added";
+$lang['daily_report'] = "Daily report (choose format)";
+$lang['report_select_host'] = "select host";
+$lang['report_select_service'] = "one of his services (not required)";
+$lang['report_select_period'] = "select a period";
+$lang['report_sp'] = "start period";
+$lang['report_ep'] = "end period";
+$lang['report_generate_pdf'] = "Generate PDF report";
+$lang['custom_start_date'] = "custom start date";
+$lang['custom_end_date'] = "custom end date";
+$lang['report_change_host'] = "change host";
+$lang['custom_report'] = "Custom Report";
+$lang['report_color_up'] = "Color UP";
+$lang['report_color_down'] = "Color DOWN";
+$lang['report_color_unreachable'] = "Color UNREACHABLE";
+$lang['report_color_ok'] = "Color OK";
+$lang['report_color_warning'] = "Color WARNING";
+$lang['report_color_critical'] = "Color CRITICAL";
+$lang['report_color_unknown'] = "Color UNKNOWN";
+$lang['report_kindof_report'] = "There is 3 kind of report";
+$lang['report_daily_report'] = "The Actual Nagios status Report";
+$lang['report_daily_report_explain'] = "It interprets this file :";
+$lang['report_daily_report_availability'] = "Available in those formats :";
+$lang['report_spec_info'] = "The specific information report";
+$lang['report_spec_info_explain'] = "You can easily check immediately an host or/and his associated service(s) like :";
+$lang['report_spec_info_ex1'] = "Host status during a specific period";
+$lang['report_spec_info_ex2'] = "Service status during a specific period";
+$lang['report_spec_info_ex3'] = "All services status associated to a host during a specific period";
+$lang['available'] = "Available in those formas :";
+$lang['report_cont_info'] = "The continous information report";
+$lang['report_cont_info_explain'] = "Used if you want to get information on each interval you have selected, it works like :";
+$lang['report_cont_info_ex1'] = "notification by mail every day of status from the day before of a host(s)/services(s) selection";
+$lang['report_cont_info_ex2'] = "notification by mail every week of status from the week before of a host(s)/services(s) selection";
+$lang['report_cont_info_ex3'] = "notification by mail everymonth of status from the month before of a host(s)/services(s) selection";
+$lang['report_logs_explain'] = "Those logs restart every time Nagios is shutting down";
+
+/* Traffic Map */
+
+$lang['tm_update'] = "The Traffic Map has been updated";
+$lang['tm_available'] = "Traffic Map available";
+$lang['tm_add'] = "Traffic Map add";
+$lang['tm_modify'] = "Traffic Map modify";
+$lang['tm_delete'] = "Traffic Map removed";
+$lang['tm_addHost'] = "A new Host had been added to the traffic map";
+$lang['tm_changeHost'] = "The Host has been changed";
+$lang['tm_deleteHost'] = "The Host has been removed";
+$lang['tm_addRelation'] = "A new relation had been added";
+$lang['tm_changeRelation'] = "The relation has been changed";
+$lang['tm_deleteRelation'] = "The relation has been removed";
+$lang['tm_hostServiceAssociated'] = "Hosts with a service check_traffic associated";
+$lang['tm_checkTrafficAssociated'] = "Check_traffic associated";
+$lang['tm_other'] = "Other ressources (without check_traffic)";
+$lang['tm_networkEquipment'] = "Network equipment";
+$lang['tm_selected'] = "selected";
+$lang['tm_maxBWIn'] = "Max bandwith possible In (Kbps)";
+$lang['tm_maxBWOut'] = "Max bandwith possible Out (Kbps)";
+$lang['tm_background'] = "Background image";
+$lang['tm_relations'] = "Relation(s)";
+$lang['tm_hostsAvailables'] = "Host(s) Available";
+$lang['tm_labelsWarning'] = "Veuillez saisir un label sans accents";
+
+/* Graphs */
+
+$lang['graph'] = "Graph";
+$lang['graphs'] = "Graphs";
+$lang['g_title'] = "Graphs";
+$lang['g_available'] = "Graphs available";
+$lang['g_path'] = "Path of the RRDtool data-base";
+$lang['g_imgformat'] = "Picture format";
+$lang['g_verticallabel'] = "Vertical label";
+$lang['g_width'] = "Picture size - width";
+$lang['g_height'] = "Picture size - height";
+$lang['g_lowerlimit'] = "Lower limit";
+$lang['g_Couleurs'] = "Colors : ";
+$lang['g_ColGrilFond'] = "Central graph background color";
+$lang['g_ColFond'] = "Background color";
+$lang['g_ColPolice'] = "Font color";
+$lang['g_ColGrGril'] = "Main grid color";
+$lang['g_ColPtGril'] = "Second grid color";
+$lang['g_ColContCub'] = "Cube color";
+$lang['g_ColArrow'] = "Arrow option color";
+$lang['g_ColImHau'] = "Up picture - color";
+$lang['g_ColImBa'] = "Down picture - color";
+$lang['g_dsname'] = "Name of the data source";
+$lang['g_ColDs'] = "Data source color";
+$lang['g_flamming'] = "Flamming color";
+$lang['g_Area'] = "Area";
+$lang['g_tickness'] = "Tickness";
+$lang['g_gprintlastds'] = "Show the last calculated value";
+$lang['g_gprintminds'] = "Show the min calculated value";
+$lang['g_gprintaverageds'] = "Show the average calculated value";
+$lang['g_gprintmaxds'] = "Show the max calculated value";
+$lang['g_graphorama'] = "GraphsVision";
+$lang['g_graphoramaerror'] = "The date of beginning must be lower than the completion date";
+$lang['g_date_begin'] = "Start time";
+$lang['g_date_end'] = "End time";
+$lang['g_hours'] = "Hours";
+$lang['g_number_per_line'] = "Number per line";
+$lang['g_height'] = "Weight";
+$lang['g_width'] = "Width";
+$lang['g_basic_conf'] = "Basic configuration :";
+$lang['g_ds'] = "Data source";
+$lang['g_lcurrent'] = "Current";
+$lang['g_lday'] = "Last day";
+$lang['g_lweek'] = "last week";
+$lang['g_lyear'] = "Last year";
+$lang['g_see'] = "See graph associated";
+$lang['g_from'] = "From ";
+$lang['g_to'] = " To ";
+$lang['g_current'] = "Current:";
+$lang['g_average'] = "Average:";
+$lang['g_no_graphs'] = "No graph available";
+$lang['g_no_access_file'] = "File %s is not accessible";
+
+/* Graph Models */
+
+$lang['gmod'] =  'Basic properties';
+$lang['gmod_ds'] =  'Data source';
+$lang['gmod_available'] = 'Graph properties models available';
+$lang['gmod_ds_available'] = 'Graph DS models available';
+$lang['gmod_use_model'] = 'Use a model';
+
+/* Colors */
+$lang['colors'] =  "Colors";
+$lang['hexa'] =  "Color in hexadecimal";
+
+/* Nagios.cfg */
+
+$lang['nagios_save'] = 'La configuration a &eacute;t&eacute; sauvegard&eacute;.<br> Vous devez maintenant d&eacute;placer les fichiers et relancer Nagios pour que les changements soient pris en compte.';
+
+/* Ressources.cfg */
+
+$lang['resources_example'] = 'Resource file example';
+$lang['resources_add'] = 'Add a new resource';
+$lang['resources_new'] = 'A new resource has been added';
+
+/* lca */
+
+$lang['lca_user'] = 'User :';
+$lang['lca_user_access'] = 'has acces to ';
+$lang['lca_profile'] = 'profile';
+$lang['lca_user_restriction'] = 'Users with access restrictions';
+$lang['lca_access_comment'] = 'Enable acces to Comment :';
+$lang['lca_access_downtime'] = 'Enable acces to Downtime :';
+$lang['lca_access_watchlog'] = 'Enable to watch log :';
+$lang['lca_access_trafficMap'] = 'Enable to watch traffic map :';
+$lang['lca_access_processInfo'] = 'Enable to acces to process info :';
+$lang['lca_add_user_access'] = 'Add attributs to an User';
+$lang['lca_apply_restrictions'] = 'Apply restrictions';
+$lang['lca_action_on_profile'] = 'Actions';
+
+/* History */
+
+$lang['log_detail'] = "Logs Detail for ";
+
+/* General Options */
+
+$lang["opt_gen"] = "General Options";
+$lang["nagios_version"] = "Nagios version : ";
+$lang["oreon_path"] = "Oreon installation folder";
+$lang["oreon_path_tooltip"] = "Where Oreon is installed ?";
+$lang["nagios_path"] = "Nagios installation folder";
+$lang["nagios_path_tooltip"] = "Where is Nagios folder ?";
+$lang["refresh_interface"] = "Interface refresh";
+$lang["refresh_interface_tooltip"] = "Frontend reload frequency";
+$lang["snmp_com"] = "SNMP community";
+$lang["snmp_com_tooltip"] = "Default SNMP community";
+$lang["snmp_version"] = "SNMP version";
+$lang["snmp_path"] = "SNMP installation folder";
+$lang["snmp_path_tooltip"] = "Where are snmpwalk and snmpget binary ?";
+$lang["cam_color"] = "Pie Colors";
+$lang["for_hosts"] = "For hosts";
+$lang["for_services"] = "For services";
+$lang["rrd_path"] = "RRDToolsPath/rrdtool";
+$lang["rrd_path_tooltip"] = "Where rrdtool is installed ?";
+$lang["rrd_base_path"] = "RRDTool base location";
+$lang["rrd_base_path_tooltip"] = "Where the rrd databases are generated ?";
+$lang["mailer"] = "Mailer";
+$lang["mailer_tooltip"] = "Where mail binary is installed ?";
+$lang["opt_gen_save"] = "General Options saved.<br>You don't have to generate the files.";
+$lang["session_expire"] = "Session expiration time";
+$lang["session_expire_unlimited"] = "unlimited";
+$lang["binary_path"] = "Nagios Binary path";
+$lang["binary_path_tooltip"] = "Where is Nagios binary ?";
+$lang["images_logo_path"] = "Nagios picture path";
+$lang["images_logo_path_tooltip"] = "Where are Nagios pictures ?";
+$lang["plugins_path"] = "Nagios Plugins Path";
+$lang["plugins_path_tooltip"] = "Where are Nagios plugins installed ?";
+$lang["path_error_legend"] = "Color of the errors";
+$lang["invalid_path"] = "The directory or file do not exist";
+$lang["executable_binary"] = "The file is not executable";
+$lang["writable_path"] = "The directory or file is not writable";
+$lang["readable_path"] = "The directory is not readable";
+$lang["rrdtool_version"] = "RRDTool version";
+$lang["nmap_path"] = "Nmap binary path";
+$lang["nmap_path_tooltip"] = "Where is nmap binary ?";
+
+/* Auto Detect */
+
+$lang['ad_title'] = "Automatic Host research";
+$lang['ad_title2'] = "Automatic research";
+$lang['ad_ser_result'] = "Automatic research discovered the following Services : ";
+$lang['ad_ser_result2'] = "This list is not an exhaustive list and includes only<br> the services networks having opened a port network on the host.";
+$lang['ad_infos1'] = "To make automatic research,<br>please fill the fields following with :";
+$lang['ad_infos2'] = 'Maybe with an address IP (ex : 192.168.1.45),';
+$lang['ad_infos3'] = 'Maybe with IP fields (ex : 192.168.1.1-254),';
+$lang['ad_infos4'] = 'Maybe with an IP list :';
+$lang['ad_infos5'] = '192.168.1.1,24,38';
+$lang['ad_infos6'] = '192.168.*.*';
+$lang['ad_infos7'] = '192.168.10-34.23-25,29-32';
+$lang['ad_ip'] = 'IP';
+$lang['ad_res_result'] = 'Research result';
+$lang['ad_found'] = "found(s)";
+$lang['ad_number'] = "Number";
+$lang['ad_dns'] = "DNS";
+$lang['ad_actions'] = "Actions";
+$lang['ad_port'] = "Port";
+$lang['ad_name'] = "Name";
+
+/* Export DB */
+
+$lang['edb_file_already_exist'] = "This file already exist, please enter a new name for your backup";
+$lang['edb_file_move'] = "Moved files";
+$lang['edb_file_ok'] = "Generated and moved files";
+$lang['edb_file_nok'] = "Error during the generation or the displacement of the files";
+$lang['edb_restart'] = "Host restart";
+$lang['edb_save'] = "Make a backup";
+$lang['edb_nagios_restart'] = "Restart Nagios";
+$lang['edb_nagios_restart_ok'] = "Nagios restart";
+$lang['edb_restart'] = "Restart";
+
+/* User_online */
+
+$lang["wi_user"] = "Users";
+$lang["wi_where"] = "Where";
+$lang["wi_last_req"] = "Last Requete";
+
+/* Reporting */
+
+$lang["pie_unavailable"] = "No Pie available for the moment";
+
+/* Configuration Stats */
+
+$lang['conf_stats_category'] = "Category";
+
+/* Pictures */
+
+$lang["pict_title"] = "Oreon Extended Infos Pictures";
+$lang["pict_new_image"] = "New image (only .png)";
+
+/* About */
+
+$lang["developped"] = "Developed by";
+
+/* Live Report */
+
+$lang["lr_available"] = "Available  Hosts";
+$lang["live_report"] = "Live Report";
+$lang["bbreporting"] = "Reporting";
+$lang["lr_host"] = "Host :";
+$lang["lr_alias"] = "Alias :";
+$lang["lr_ip"] = "IP Address :";
+$lang["lr_view_services"] = "View Services Details for this host";
+$lang["lr_configure_host"] = "Configure this host";
+$lang["lr_details_host"] = "View host Informations";
+
+/* Date and Time Format */
+
+$lang["date_format"] = "Y/m/d";
+$lang["time_format"] = "H:i:s";
+$lang["header_format"] = "Y/m/d G:i";
+$lang["date_time_format"] = "Y/m/d - H:i:s";
+$lang["date_time_format_status"] = "Y/m/d H:i:s";
+$lang["date_time_format_g_comment"] = "Y/m/d H:i";
+
+/* */
+
+$lang["top"] = "Top";
+$lang["event"] = "Events";
+$lang["date"] = "Date";
+$lang["pel_l_details"] = "Logs Details for ";
+$lang["pel_sort"] = "Filters";
+$lang["pel_alerts_title"] = "Alerts for ";
+$lang["pel_notify_title"] = "Notifications for ";
+
+/* perfparse */
+
+$lang["perfparse_installed"] = "Is Perfparse installed ?";
+$lang["service_logged"] = "Logged services";
+
+/* legend */
+
+$lang["lgd_legend"] = " Legend";
+$lang["lgd_delOne"] = " Delete";
+$lang["lgd_delAll"] = " Delete";
+$lang["lgd_duplicate"] = " Duplicate";
+$lang["lgd_view"] = " View";
+$lang["lgd_edit"] = " Modify";
+$lang["lgd_signpost"] = " Detail";
+$lang["lgd_next"] = " Next";
+$lang["lgd_prev"] = " Previous";
+$lang["lgd_on"] = " Enable";
+$lang["lgd_off"] = " Disable";
+
+$lang["advanced"] = "Advanced >>";
+?>
\ No newline at end of file
diff --git a/www/lang/fr.php b/www/lang/fr.php
new file mode 100644
index 0000000000000000000000000000000000000000..8dd350dc0c9ce6ec8179a193061d3b76ee732364
--- /dev/null
+++ b/www/lang/fr.php
@@ -0,0 +1,864 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+/*
+Ce fichier contient le contenu texte utilis&eacute; pour l'outil Oreon. Les tables de hash permettent facilement de cr&eacuteer un programme multi-langage.
+Les variables pr&eacute;sentes sont parlantes. Il ne devrait pas exister de difficult&eacute;s pour savoir &agrave; quoi elles correspondent.
+*/
+
+/* Error Code */
+
+$lang['not_allowed'] = "Vous n'&ecirc;tes pas autoris&eacute; &agrave; acc&eacute;der &agrave; cette page";
+$lang['not_dbPPConnect'] = "Probl&egrave;me avec la base Perfparse";
+$lang['errCode'][-2] = "La d&eacute;finition n&#146;est pas compl&egrave;te";
+$lang['errCode'][-3] = "Cette d&eacute;finition existe d&eacute;ja";
+$lang['errCode'][-4] = "Le format de l'email est invalid, xxx@xxx.xx";
+$lang['errCode'][-5] = "La d&eacute;finition est circulaire";
+$lang['errCode'][-6] = "Vous devez choisir soit un Host, soit un Hostgroup";
+$lang['errCode'][-7] = "Le mot de passe est incorrect";
+$lang['errCode'][-8] = "La date de d&eacute;but doit &ecirc;tre inf&eacute;rieur &agrave; la date de fin";
+$lang['errCode'][-9] = "Des valeurs sont manquantes";
+$lang['errCode'][2] = "La d&eacute;finition a &eacute;t&eacute; modifi&eacute;e";
+$lang['errCode'][3] = "La d&eacute;finition a &eacute;t&eacute; enregistr&eacute;e";
+$lang['errCode'][4] = "Le mot de passe a &eacute;t&eacute; modifi&eacute;";
+$lang['errCode'][5] = "L&#146;Host a &eacute;t&eacute; dupliqu&eacute;";
+
+# Menu Level 1
+
+$lang['m_home'] = "Accueil";
+$lang['m_configuration'] = "Configuration";
+$lang['m_monitoring'] = "Monitoring";
+$lang['m_reporting'] = "Reporting";
+$lang['m_views'] = "Vues Oreon";
+$lang['m_options'] = "Options";
+$lang['m_logout'] = "D&eacute;connexion";
+$lang['m_help'] = "Aide";
+
+# Menu Level 3
+
+$lang["m_main_menu"] = "Menu Principal";
+$lang["m_connected_users"] = "Connect&eacute;s";
+
+# Monitoring menu
+
+$lang["m_host_detail"] = "Hosts D&eacute;tails";
+$lang["m_hosts_problems"] = "Hosts Probl&egrave;mes";
+$lang["m_hostgroup_detail"] = "HostGroups D&eacute;tails";
+
+$lang["m_service_detail"] = "Services D&eacute;tails";
+$lang["m_services_problems"] = "Services Probl&egrave;mes";
+$lang["m_servicegroup_detail"] = "ServiceGroups D&eacute;tails";
+$lang["m_service_by_service_group"] = "Services par Svc Grp";
+
+$lang["m_status_scheduling"] = "Status et Ordonnancement";
+$lang["m_status_summary"] = "Sommaire des Status";
+$lang["m_status_resume"] = "R&eacute;sum&eacute; des Status";
+
+$lang["m_status_grid"] = "Grille de Status";
+$lang["m_scheduling"] = "Ordonnancement";
+
+$lang['m_tools'] = "Outils";
+$lang["m_process_info"] = "Informations sur les Processus";
+$lang["m_event_log"] = "Gestionnaire d'&eacute;v&egrave;nements";
+$lang["m_downtime"] = "Temps d'arrets";
+$lang["m_comments"] = "Commentaires";
+
+$lang["m_alerts"] = "Alertes";
+
+# Log Menu
+
+$lang["m_all_logs"] = "Tous les Logs";
+$lang["m_notify_logs"] = "Notifications";
+$lang["m_alerts_log"] = "Alertes";
+$lang["m_warning_log"] = "Erreurs/Avertissements";
+
+# Reporting menu
+
+$lang["m_report"] = "Rapports";
+$lang["m_rtList"] = "Listes des rapports";
+$lang["m_rtStat"] = "Statistiques";
+
+$lang["m_rtNotif"] = "Diffusion";
+$lang["m_rtMailList"] = "Liste de diffusion";
+$lang["m_rtMail"] = "Base Mail";
+
+$lang["m_message"] = "Message";
+$lang["m_status_map"] = "Carte de Status des Hosts";
+$lang["m_cartography"] = "Cartographie";
+
+$lang["m_dashboard"] = "Dashboard";
+$lang["m_dashboardHost"] = "Host";
+$lang["m_dashboardService"] = "Service";
+
+# Graph menu
+
+$lang['m_views_loc'] = "Localisation";
+$lang['m_views_cty'] = "Pays & Villes";
+$lang['m_views_map'] = "Cartes";
+$lang['m_views_graphs'] = "Moteur Graphique";
+$lang['m_views_graphCustom'] = "Graphs Personnalis&eacute;s";
+$lang['m_views_graphShow'] = "Graphs Simples";
+$lang['m_views_graphPlu'] = "Sondes Graphique";
+$lang['m_views_graphTmp'] = "Graphs Templates";
+$lang['m_views_compoTmp'] = "Courbes Templates";
+$lang['m_views_mine'] = "Mes Vues";
+
+# Options menu
+
+$lang['m_opt_conf'] = "Oreon";
+$lang['m_general'] = "Options G&eacute;n&eacute;rales";
+$lang['m_lang'] = "Langues";
+$lang['m_menu'] = "Menu";
+$lang['m_plugins'] = "Sondes";
+$lang['m_myAccount'] = "Mon Compte";
+
+$lang['m_acl'] = "LCA";
+$lang["lca_list"] = "Listes de controles d'acc&egrave;s";
+
+$lang['m_db'] = "Database";
+$lang['m_extract_db'] = "Extraction de la Database";
+
+$lang['m_server_status'] = "Syst&egrave;me";
+
+$lang['m_about'] = "A propos...";
+$lang['m_web'] = "Site Web";
+$lang['m_forum'] = "Forum";
+$lang['m_wiki'] = "Wiki";
+$lang['m_bug'] = "Bug Track";
+$lang['m_donate'] = "Donation";
+$lang['m_pro'] = "Professionel";
+
+$lang['m_sessions'] = "Sessions";
+
+# Configuration menu
+
+$lang['m_host'] = "Hosts";
+$lang['m_hostgroup'] = "Host Groups";
+$lang['m_host_extended_info'] = "Host Informations Etendues";
+
+$lang['m_service'] = "Services";
+$lang['m_serviceByHost'] = "Services par Host";
+$lang['m_serviceByHostGroup'] = "Services par Host Group";
+$lang['m_servicegroup'] = "Service Groups";
+$lang['m_service_extended_info'] = "Service Informations Etendues";
+$lang['m_meta_service'] = "Meta Services";
+
+$lang['m_notification'] = "Utilisateurs";
+$lang['m_contact'] = "Utilisateurs";
+$lang['m_contactgroup'] = "Groupes Utilisateurs";
+$lang['m_timeperiod'] = "Plage Horaires";
+$lang['m_commandNotif'] = "Commandes de Notification";
+
+$lang['m_escalation'] = "Escalades";
+$lang['m_hostgroupesc'] = "Host Group Escalades";
+$lang['m_hostesc'] = "Host Escalades";
+$lang['m_serviceesc'] = "Service Escalades";
+$lang['m_metaserviceesc'] = "Meta Service Escalades";
+
+$lang['m_dependencies'] = "D&eacute;pendances";
+$lang['m_service_dependencies'] = "D&eacute;pendances de Service";
+$lang['m_host_dependencies'] = "D&eacute;pendances d'Host";
+
+$lang['m_template'] = "Mod&egrave;les";
+$lang['m_host_template_model'] = "Mod&egrave;les d'Host";
+$lang['m_service_template_model'] = "Mod&egrave;les de Service";
+
+$lang['m_nagios'] = "Nagios";
+$lang['m_nagiosCFG'] = "Nagios CFG";
+$lang['m_cgi'] = "CGI CFG";
+$lang['m_resource'] = "Resource CFG";
+$lang['m_perfparse'] = "Perfparse CFG";
+$lang['m_load_nagios'] = "Importer";
+$lang['m_gen_nagios'] = "Exporter";
+$lang['m_commandCheck'] = "Commande de Check";
+
+/* ID Menu */
+
+$lang["m_idCards"] = "Fiches d'identit&eacute;s";
+$lang["m_id_serv"] = "Serveurs";
+$lang["m_id_network"] = "Equipements Reseaux";
+$lang["m_idUpdate"] = "Mise a jour manuelle";
+$lang["m_id_manu"] = "Constructeur";
+
+/* Plugins */
+
+$lang["plugins1"] = "Sonde effac&eacute;e";
+$lang["plugins2"] = "Etes vous sur de vouloir supprimer cette sonde ? ";
+$lang["plugins3"] = "Sonde envoy&eacute;e";
+$lang["plugins4"] = "Une erreur est survenue durant l'enregistrement de la sonde. Il s&#146;agit peut etre d'un probl&egrave;me de droits";
+$lang["plugins5"] = "Une erreur est survenue durant l'enregistrement du fichier &#146;oreon.conf&#146;. Il s&#146;agit peut etre d'un probl&egrave;me de droits";
+$lang["plugins6"] = "Fichier g&eacute;n&eacute;r&eacute;";
+$lang["plugins_add"] = "Ajout de sondes pour Nagios";
+$lang["plugins"] = "Sondes";
+$lang["plugins_list"] = "Liste des sondes";
+$lang["plugins_pm_conf"] = "Oreon.conf";
+$lang["plugins_pm_conf_desc"] = "G&eacute;n&eacute;re le fichier de configuration pour &#146;Oreon.pm&#146; avec les informations contenues dans le menu G&eacute;n&eacute;ral";
+
+/* index100 */
+
+$lang['ind_infos'] = "Dans cette partie vous pouvez configurer toutes les ressources de Nagios.";
+$lang['ind_detail'] = "Les ressources sont li&eacute;es entre elles pour la plupart, n&acute;oubliez pas que la suppression d&acute;une ressource peut impacter, <br>et donc supprimer de nombreuses autres.";
+
+/* index */
+
+$lang['ind_first'] = "Vous &ecirc;tes d&eacute;j&agrave; connect&eacute; &agrave; OREON, fermez d&acute;abord l&acute;autre session<br>Si c&acute;est la seule fen&ecirc;tre d&acute;ouverte, cliquez";
+
+/* alt main */
+
+$lang['am_intro'] = "g&egrave;re actuellement :";
+$lang['host_health'] = "Etat des ressources";
+$lang['service_health'] = "Etat des services";
+$lang['network_health'] = "Etat du r&eacute;seau";
+$lang['am_hg_vdetail'] = 'Voir le d&eacute;tail par Hostgroup';
+$lang['am_sg_vdetail'] = 'Voir le d&eacute;tail par Servicegroup';
+$lang['am_hg_detail'] = 'D&eacute;tails des Hostgroup';
+$lang['am_sg_detail'] = 'D&eacute;tails des Servicegroup';
+
+/* Monitoring */
+
+$lang['mon_last_update'] = "Derni&egrave;re mise &agrave; jour :";
+$lang['mon_up'] = "UP";
+$lang['mon_down'] = "DOWN";
+$lang['mon_unreachable'] = "INACCESSIBLE";
+$lang['mon_ok'] = "OK";
+$lang['mon_critical'] = "CRITIQUE";
+$lang['mon_warning'] = "ATTENTION";
+$lang['mon_pending'] = "EN SUSPENS";
+$lang['mon_unknown'] = "INCONNU";
+$lang['mon_status'] = "Status";
+$lang['mon_ip'] = "IP";
+$lang['mon_last_check'] = "Dernier controle";
+$lang['mon_next_check'] = "Prochain controle";
+$lang['mon_active_check'] = "Check actif";
+$lang['mon_duration'] = "Dur&eacute;e";
+$lang['mon_retry'] = "Essai";
+$lang['mon_status_information'] = "Informations";
+$lang['mon_service_overview_fah'] = "Vue d'ensemble des services pour les Host Groups";
+$lang['mon_service_overview_fas'] = "Vue d'ensemble des services pour les Service Groups";
+$lang['mon_status_summary_foh'] = "Informations de status de tous les Host Groups";
+$lang['mon_status_grid_fah'] = "Grille de status pour tous les Host Groups";
+$lang['mon_sv_hg_detail1'] = "D&eacute;tail des services";
+$lang['mon_sv_hg_detail2'] = "pour l&#146;Host Group";
+$lang['mon_sv_hg_detail3'] = "pour l&#146;Host";
+$lang['mon_host_status_total'] = "Total Host Status";
+$lang['mon_service_status_total'] = "Total Service Status";
+$lang['mon_scheduling'] = "Ordre d'ordonnancement";
+$lang['mon_actions'] = "Actions";
+$lang['mon_active'] = "ACTIF";
+$lang['mon_inactive'] = "INACTIF";
+$lang['mon_request_submit_host'] = "Votre demande a bien &eacute;t&eacute; trait&eacute;e. <br><br>Vous allez &ecirc;tre redirig&eacute; vers la page des Hosts.";
+$lang['Details'] = "D&eacute;tails";
+$lang['mon_checkOutput'] = "check output";
+$lang['mon_dataPerform'] = "data perform";
+
+/* Monitoring commands */
+
+$lang['mon_hg_commands'] = "Commandes pour l'Host Group";
+$lang['mon_h_commands'] = "Commandes pour l'Host";
+$lang['mon_sg_commands'] = "Commandes pour le Service Group";
+$lang['mon_s_commands'] = "Commandes pour le Service";
+$lang['mon_no_stat_for_host'] = "Pas de stat pour cet Host.<br><br>Pensez &agrave; g&eacute;n&eacute;rer les fichiers de configuration.";
+$lang['mon_no_stat_for_service'] = "Aucune stat pour ce service.<br><br> Pensez a gnrer les fichiers de configuration.";
+$lang['mon_hg_cmd1'] = "Programmer un arr&ecirc;t pour tous les Hosts de ce Host Group";
+$lang['mon_hg_cmd2'] = "Programmer un arr&ecirc;t pour tous les Services de cet Host Group";
+$lang['mon_hg_cmd3'] = "Activer les notifications pour tous les Hosts de cet Host Group";
+$lang['mon_hg_cmd4'] = "D&eacute;sactiver les notifications pour tous les Hosts de cet Host Group";
+$lang['mon_hg_cmd5'] = "Activer les notifications pour tous les Services de cet Host Group";
+$lang['mon_hg_cmd6'] = "D&eacute;sactiver les notifications pour tous les Services de cet Host Group";
+$lang['mon_hg_cmd7'] = "Activer les checks pour tous les Services de cet Host Group";
+$lang['mon_hg_cmd8'] = "D&eacute;sactiver les checks pour les Services de cet Host Group";
+$lang['mon_host_state_info'] = "Information sur l&#146;&eacute;tat de l&#146;Host";
+$lang['mon_hostgroup_state_info'] = "Information sur l&#146;&eacute;tat de l&#146;Hostgroup";
+$lang['mon_host_status'] = "Etat de l&#146;Host";
+$lang['mon_status_info'] = "Informations sur l&#146;&eacute;tat";
+$lang['mon_status_info'] = "Informations sur l&#146;&eacute;tat";
+$lang['mon_last_status_check'] = "Last Status Check";
+$lang['mon_status_data_age'] = "Status Data Age";
+$lang['mon_current_state_duration'] = "Current State Duration";
+$lang['mon_last_host_notif'] = "Last Host Notification";
+$lang['mon_current_notif_nbr'] = "Current Notification Number";
+$lang['mon_is_host_flapping'] = "Is This Host Flapping ?";
+$lang['mon_percent_state_change'] = "Percent State Change";
+$lang['mon_is_sched_dt'] = "Est ce qu&#146;un arr&ecirc;t est programm&eacute; ?";
+$lang['mon_last_update'] = "Derni&egrave;re mise &agrave; jour";
+$lang['mon_sch_imm_cfas'] = "Programmer un check imm&eacute;diat pour tous les services";
+$lang['mon_sch_dt'] = "Arr&ecirc;t programm&eacute;";
+$lang['mon_dis_notif_fas'] = "D&eacute;sactiver la notification pour tous les Services";
+$lang['mon_enable_notif_fas'] = "Activer la notification pour tous les Services";
+$lang['mon_dis_checks_fas'] = "D&eacute;sactiver les checks pour tous les Services";
+$lang['mon_enable_checks_fas'] = "Activer les checks pour tous les Services";
+$lang['mon_service_state_info'] = "Information sur l&#146;&eacute;tat du Service";
+$lang['mon_service_status'] = "Etat du Service";
+$lang['mon_current_attempt'] = "Current Attempt";
+$lang['mon_state_type'] = "State Type";
+$lang['mon_last_check_type'] = "Dernier type de check";
+$lang['mon_last_check_time'] = "Derni&egrave;re heure de check";
+$lang['mon_next_sch_active_check'] = "Prochain check actif programm&eacute;";
+$lang['mon_last_service_notif'] = "Derni&egrave;re notification de Service";
+$lang['mon_is_service_flapping'] = "Is This Service Flapping ?";
+$lang['mon_percent_state_change'] = "Percent State Change";
+$lang['mon_checks_for_service'] = "check de ce service";
+$lang['mon_accept_pass_check'] = "les passives checks pour ce Service";
+$lang['mon_notif_service'] = "les notifications pour ce Service";
+$lang['mon_eh_service'] = "l&#146;event handler pour ce Service";
+$lang['mon_fp_service'] = "Flap detection pour ce Service";
+$lang['mon_submit_pass_check_service'] = "Submit passive check result for this service";
+$lang['mon_sch_dt_service'] = "Programmer un arr&ecirc;t pour ce Service";
+$lang['mon_service_check_executed'] = "Les checks de Service ont &eacute;t&eacute; ex&eacute;cut&eacute;s";
+$lang['mon_passive_service_check_executed'] = "Les checks passifs de Service ont &eacute;t&eacute; ex&eacute;cut&eacute;s";
+$lang['mon_eh_enabled'] = "Event Handlers activ&eacute;s";
+$lang['mon_obess_over_services'] = "Obsessing Over Services";
+$lang['mon_fp_detection_enabled'] = "Flap Detection Enabled";
+$lang['mon_perf_data_process'] = "Performance Data Being Processed";
+$lang['mon_request_submit_host'] = "Your request has been recorded<br><br>You&#146;re gonna be redirected to the host page.";
+$lang['mon_process_infos'] = "Informations sur les processus";
+$lang['mon_process_start_time'] = "D&eacute;but du programme";
+$lang['mon_total_run_time'] = "Temps total de fonctionnement";
+$lang['mon_last_ext_command_check'] = "Last External Command Check";
+$lang['mon_last_log_file_rotation'] = "Last Log File Rotation";
+$lang['mon_nagios_pid'] = "Nagios PID";
+$lang['mon_process_cmds'] = "Process Commands";
+$lang['mon_stop_nagios_proc'] = "Arr&eacute;ter le processus Nagios";
+$lang['mon_start_nagios_proc'] = "D&eacute;marrer le processus Nagios";
+$lang['mon_restart_nagios_proc'] = "Red&eacute;marrer le processus Nagios";
+$lang['mon_proc_options'] = "Options des processus";
+$lang['mon_notif_enabled'] = "Notifications activ&eacute;es";
+$lang['mon_notif_disabled'] = "Notifications D&eacute;sactiv&eacute;es";
+$lang['mon_service_check_disabled'] = "Check Service D&eacute;sactiv&eacute;";
+$lang['mon_service_check_passice_only'] = "Passive Check Uniquement";
+$lang['mon_service_view_graph'] = "Visualisation du graphique";
+$lang['mon_service_sch_check'] = "Programmer un check imm&eacute;diat pour ce service";
+
+/* comments */
+
+$lang['cmt_service_comment'] = "Commentaires de Services";
+$lang['cmt_host_comment'] = "Commentaires d&#146;Hosts";
+$lang['cmt_addH'] = "Ajouter une commentaired'Host";
+$lang['cmt_addS'] = "Ajouter un commentaire de Service";
+$lang["cmt_added"] = "Commentaire ajout&eacute; avec succ&egrave;s .<br><br> Cliquez <a href='./oreon.php?p=307' class='text11b'>ici</a> pour retourner a la page des commentaires ";
+$lang["cmt_del"] = "Commentaire supprim&eacute; avec succ&egrave;s .<br><br> Cliquez <a href='./oreon.php?p=307' class='text11b'>ici</a> pour retourner a la page des commentaires ";
+$lang["cmt_del_all"] = "Tous les Commentaires ont &eacute;t&eacute; supprim&eacute;s avec succ&egrave;s .<br><br> Cliquez <a href='./oreon.php?p=307'>ici</a> pour retourner a la page des commentaires ";
+$lang['cmt_host_name'] = "Nom de l&#146;Host";
+$lang['cmt_service_descr'] = "Services";
+$lang['cmt_entry_time'] = "Date de saisie";
+$lang['cmt_author'] = "Auteur";
+$lang['cmt_comment'] = "Commentaire";
+$lang['cmt_persistent'] = "Persistent";
+$lang['cmt_actions'] = "Actions";
+
+/* downtimes */
+
+$lang['dtm_addH'] = "Ajouter un arr&ecirc;t d&#146;Host";
+$lang['dtm_addS'] = "Ajouter un arr&ecirc;t de Service";
+$lang['dtm_addHG'] = "Ajouter un arr&ecirc;t de Host Group";
+$lang["dtm_added"] = "Downtime ajout&eacute; avec succ&egrave;s .<br><br> Cliquez <a href='./oreon.php?p=308' class='text11b'>ici</a> pour retourner a la page des Downtimes ";
+$lang["dtm_del"] = "Downtime supprim&eacute; avec succ&egrave;s .<br><br> Cliquez <a href='./oreon.php?p=308' class='text11b'>ici</a> pour retourner a la page des Downtimes ";
+$lang['dtm_start_time'] = "Date de d&eacute;but";
+$lang['dtm_end_time'] = "Date de fin";
+$lang['dtm_fixed'] = "Fix&eacute;";
+$lang['dtm_duration'] = "Dur&eacute;e";
+$lang['dtm_sch_dt_fht'] = "Programmer un arr&ecirc;t pour les Hosts &eacute;galement";
+$lang['dtm_host_downtimes'] = "Arr&ecirc;ts de l&#146;Host";
+$lang['dtm_service_downtimes'] = "Arr&ecirc;ts du Service";
+$lang['dtm_dt_no_file'] = "Fichier d&#146;arr&ecirc;t introuvable";
+$lang['dtm_host_delete'] = "Effacer l&#146;arr&ecirc;t d&#146;Host";
+
+/* cmd externe */
+
+$lang['cmd_utils'] = 'Utilitaires';
+$lang["cmd_send"] = "Votre commande a &eacute;t&eacute; envoy&eacute;e.";
+$lang["cmd_ping"] = "Ping";
+$lang["cmd_traceroute"] = "Traceroute.";
+
+/* actions & recurrent text */
+
+$lang['home'] = "Accueil ";
+$lang['oreon'] = "Oreon";
+$lang['add'] = "Ajouter";
+$lang['dup'] = "Dupliquer";
+$lang['save'] = "Sauvegarder";
+$lang['modify'] = "Modifier";
+$lang['delete'] = "Supprimer";
+$lang['update'] = "Mettre &agrave; jour";
+$lang['ex'] = "Exemple ";
+$lang['name'] = "Nom ";
+$lang['alias'] = "Alias";
+$lang['user'] = "Utilisateur ";
+$lang['here'] = "ici";
+$lang['this'] = "celui-ci";
+$lang['confirm_removing'] = "Etes vous s&ucirc;r de vouloir supprimer cet &eacute;l&eacute;ment ?";
+$lang['confirm_update'] = "Etes vous s&ucirc;r de vouloir mettre &agrave; jour la traffic map ?";
+$lang['file_exist'] = "D&eacute;sol&eacute; le fichier existe d&eacute;j&agrave;.";
+$lang['uncomplete_form'] = "Formulaire incomplet ou erron&eacute;";
+$lang['none'] = "Aucun";
+$lang['already_logged'] = "Vous &ecirc;tes d&eacute;j&agrave; connect&eacute; &agrave; OREON, fermez d&acute;abord l&acute;autre session <br>Si c&acute;est la seule fen&ecirc;tre d&acute;ouverte, cliquez<br><a href='?disconnect=1' class='text11b'>ici</a>";
+$lang['usage_stats'] = "Statistiques d'utilisation";
+$lang['check'] = "Cocher";
+$lang['uncheck'] = "D&eacute;cocher";
+$lang['options'] = "Options";
+$lang['status'] = "Etat";
+$lang['status_options'] = "Etat et Options";
+$lang['details'] = "D&eacute;tails";
+$lang['back'] = "Retour";
+$lang['view'] = "Voir";
+$lang['choose'] = "Choisir";
+$lang['enable'] = "Activ&eacute;";
+$lang['disable'] = "D&eacute;sactiv&eacute;";
+$lang['yes'] = "Oui";
+$lang['no'] = "Non";
+$lang['description'] = "Description";
+$lang['page'] = "Page";
+$lang['required'] = "<font color='red'>*</font> obligatoire";
+$lang['nbr_per_page'] = "Limite";
+$lang['reset'] = "Effacer";
+$lang['time_sec'] = " secondes ";
+$lang['time_min'] = " minutes ";
+$lang['time_hours'] = " Heures ";
+$lang['time_days'] = " Jours ";
+$lang['size'] = "Taille";
+$lang['close'] = "Fermer";
+
+/* Load Nagios CFG */
+
+$lang['nfc_generated_by_oreon'] = 'Est ce que les fichiers ont &eacute;t&eacute; g&eacute;n&eacute;r&eacute;s par Oreon ?';
+$lang['nfc_targz'] = 'Vous devez charger une archive tar.gz';
+$lang['nfc_limit'] = 'Pour charger une configuration de Nagios vous devez :<ul><li>Specifier au moins les fichiers misccommands.cfg et checkcommands.cfg</li><li>Les autres d&eacute;finitions peuvent &ecirc;tre plac&eacute;es dans n&#146;importe quelle fichier .cfg</li><li>Oreon ne g&egrave;re pas les Nagios time-saving tricks</li></ul>';
+$lang['nfc_enum'] = "Hosts, services, contacts, commands, escalations, templates....";
+$lang['nfc_ncfg'] = "Nagios.cfg";
+$lang['nfc_rcfg'] = "Resource.cfg";
+$lang['nfc_ncfgFile'] = "Nagios.cfg fichier";
+$lang['nfc_rcfgFile'] = "Resource.cfg fichier";
+$lang['nfc_fileUploaded'] = "Fichiers upload&eacute;s avec succ&egrave;s";
+$lang['nfc_extractComplete'] = "Extraction Compl&egrave;te";
+$lang['nfc_unzipComplete'] = "Unzip Complet";
+$lang['nfc_unzipUncomplete'] = "Unzip Incomplet";
+$lang['nfc_uploadComplete'] = "Upload Compl&egrave;t";
+
+/* profile */
+
+$lang['profile_h_name'] = "Nom";
+$lang['profile_h_contact'] = "Contact";
+$lang['profile_h_location'] = "Lieu";
+$lang['profile_h_uptime'] = "Uptime";
+$lang['profile_h_os'] = "Systeme d&#146;exploitation";
+$lang['profile_h_interface'] = "Interface";
+$lang['profile_h_ram'] = "M&eacute;moire";
+$lang['profile_h_disk'] = "Disque";
+$lang['profile_h_software'] = "Logiciels";
+$lang['profile_h_update'] = "Mises &agrave; jour";
+$lang['profile_s_network'] = "Par r&eacute;seau";
+$lang['profile_s_os'] = "Par syst&egrave;me d'exploitation";
+$lang['profile_s_software'] = "Par logiciel";
+$lang['profile_s_update'] = "Par mises &agrave; jour";
+$lang['profile_s_submit'] = "rechercher";
+$lang['profile_o_system'] = "Syst&egrave;me";
+$lang['profile_o_network'] = "R&eacute;seau";
+$lang['profile_o_storage'] = "Espace disque";
+$lang['profile_o_software'] = "Logicels";
+$lang['profile_o_live_update'] = "Mise &agrave; jour des informations";
+$lang['profile_h_ip'] = "IP";
+$lang['profile_h_speed'] = "Vitesse";
+$lang['profile_h_mac'] = "Mac";
+$lang['profile_h_status'] = "Statut";
+$lang['profile_h_used_space'] = "Espace utilis&eacute;";
+$lang['profile_h_size'] = "Taille";
+$lang['profile_h_partition'] = "Partition";
+$lang['profile_h_list_host'] = "Selectionner le serveur";
+$lang['profile_menu_list'] = "Serveurs";
+$lang['profile_menu_search'] = "Recherche";
+$lang['profile_menu_options'] = "Inventaire";
+$lang['profile_search_results'] = "R&eacute;sultat de la recherche pour :";
+$lang['profile_title_partition'] = "Partition";
+$lang['profile_title_size'] = "Taille";
+$lang['profile_title_used_space'] = "Espace Utilis&eacute;";
+$lang['profile_title_free_space'] = "Espace Libre";
+$lang['profile_error_snmp'] = "La machine cible ne r&eacute;pond pas aux requ&ecirc;tes SNMP";
+
+/* db */
+
+$lang['db_cannot_open'] = "Impossible d&acute;ouvrir le fichier :";
+$lang['db_cannot_write'] = "Impossible d&acute;&eacute;crire dans le fichier :";
+$lang['db_genesis'] = "G&eacute;n&eacute;rer les fichiers de configuration";
+$lang['db_file_state'] = "Etat des fichiers de configurations g&eacute;n&eacute;r&eacute;s par Oreon :";
+$lang['db_create_backup'] = "Cr&eacute;er une sauvegarde avant de cr&eacute;er les nouveaux fichiers de configuration";
+$lang['db_create'] = "Cr&eacute;er une nouvelle sauvegarde";
+$lang['db_generate'] = "G&eacute;n&eacute;rer";
+$lang['db_nagiosconf_backup'] = "Sauvegarde des Configurations de Nagios ";
+$lang['db_backup'] = "Sauvegarde de toute la base de donn&eacute;es destin&eacute;e &agrave; Oreon";
+$lang['db_nagiosconf_backup_on_server'] = "Sauvegader les configurations de nagios sur le serveur (permet par la suite de les remettre en marche).";
+$lang['db_backup_spec_users'] = "Sauvegarder uniquement la configuration des utilisateurs ayant acc&egrave;s a l&acute;interface ";
+$lang['db_insert_new_database'] = "Ins&eacute;rer une nouvelle base de donn&eacute;es";
+$lang['db_reset_old_conf'] = "Remettre en service des configurations d&eacute;j&agrave; en memoire sur le serveur";
+$lang['db_extract'] = "Extraire";
+$lang['db_execute'] = "Executer";
+$lang['db_save'] = "Sauvegarder";
+$lang["DB_status"] = "Statistiques de la base de Donn&eacute;es";
+$lang["db_lenght"] = "Taille";
+$lang["db_nb_entry"] = "Nombre D'entr&eacute;es";
+
+/* user */
+
+$lang['u_list'] = "Liste des utilisateurs";
+$lang['u_admin_list'] = "Liste des administrateurs";
+$lang['u_sadmin_list'] = "Liste des supers administrateurs";
+$lang['u_user'] = "Utilisateur";
+$lang['u_administrator'] = "Administrateur";
+$lang['u_sadministrator'] = "Super administrateur";
+$lang['u_profile'] = "Votre profil";
+$lang['u_new_profile'] = "Nouveau profil";
+$lang['u_some_profile'] = "Profil de ";
+$lang['u_name'] = "Nom ";
+$lang['u_lastname'] = "Pr&eacute;nom ";
+$lang['u_login'] = "Login ";
+$lang['u_passwd'] = "Mot de passe ";
+$lang['u_cpasswd'] = "Changer le mot de passe ";
+$lang['u_ppasswd'] = "Confirmez le mot de passe ";
+$lang['u_email'] = "e-mail ";
+$lang['u_lang'] = "Langue ";
+$lang['u_status'] = "Etat ";
+$lang['u_delete_profile'] = "supprimer cet utilisateur";
+
+/* lang */
+
+$lang['lang_infos'] = "Il y a actuellement ";
+$lang['lang_infos2'] = "langues diff&eacute;rentes de mises en service pour l'utilisation d&acute;Oreon.";
+$lang['lang_infos3'] = "Si vous d&eacute;sirez en rajouter, c&acute;est tres simple : il suffit d&acute;uploader un fichier dans le formulaire ci-dessous. ";
+$lang['lang_detail'] = "Ce fichier doit respecter les m&ecirc;mes champs que ";
+$lang['lang_detail2'] = "mais traduits dans la langue d&eacute;sir&eacute;e";
+
+/* bug resolver */
+
+$lang['bug_infos'] = "Sur cette page vous pouvez effacer toutes les relations entre les ressources et le contenu des tables qui pr&eacute;sente s&ucirc;rement probl&egrave;me en cas de bug.";
+$lang['bug_action'] = "Si vous souhaitez r&eacute;initialiser la base de donn&eacute;es parce que vous avez obtenu des bugs pendant la phase de test, merci de nous indiquer &agrave; quel endroit le bug a eu lieu. Et cliquez ici";
+$lang['bug_kick'] = "R&eacute;initialiser la base";
+
+/* Parseenevlog */
+
+$lang['hours'] = "Heures";
+
+/* Log report */
+
+$lang['add_report'] = "Le report a &eacute;t&eacute; ajout&eacute;";
+$lang['change_report'] = "Le report a &eacute;t&eacute; modifi&eacute;";
+$lang['add_reportHost'] = "Un Host a &eacute;t&eacute; ajout&eacute;";
+$lang['add_reportService'] = "L&#146;ajout de Service a &eacute;t&eacute; fait";
+$lang['daily_report'] = "Rapport journalier (diff&eacute;rents formats)";
+$lang['report_select_host'] = "Selectionnez un host";
+$lang['report_select_service'] = "Un de ses services (facultatif)";
+$lang['report_select_period'] = "Selectionnez une p&eacute;riode";
+$lang['report_sp'] = "Debut de la p&eacute;riode";
+$lang['report_ep'] = "Fin de la p&eacute;riode";
+$lang['report_generate_pdf'] = "G&eacute;n&eacute;rer le rapport PDF";
+$lang['custom_start_date'] = "date de d&eacute;but";
+$lang['custom_end_date'] = "date de fin";
+$lang['report_change_host'] = "Modifier l&acute;host";
+$lang['custom_report'] = "Rapport personnalis&eacute;";
+$lang['report_color_up'] = "Color UP";
+$lang['report_color_down'] = "Color DOWN";
+$lang['report_color_unreachable'] = "Color UNREACHABLE";
+$lang['report_color_ok'] = "Color OK";
+$lang['report_color_warning'] = "Color WARNING";
+$lang['report_color_critical'] = "Color CRITICAL";
+$lang['report_color_unknown'] = "Color UNKNOWN";
+$lang['report_kindof_report'] = "Il existe 3 types de rapport";
+$lang['report_daily_report'] = "Le rapport actuel de Nagios";
+$lang['report_daily_report_explain'] = "Il s&#146;agit d&acute;interpreter le fichier";
+$lang['report_daily_report_availability'] = "Disponible ici sous plusieurs formats :";
+$lang['report_spec_info'] = "Le rapport d&acute;informations specifiques";
+$lang['report_spec_info_explain'] = "Il donne un accs direct  l'information. Utilis&eacute; pour recup&eacute;rer des informations precises comme :";
+$lang['report_spec_info_ex1'] = "l&acute;etat d&acute;un host pendant une p&eacute;riode pr&eacute;cise";
+$lang['report_spec_info_ex2'] = "l&acute;etat d&acute;un service pendant une p&eacute;riode pr&eacute;cise";
+$lang['report_spec_info_ex3'] = "l&acute;etat des services d&acute;un host pendant une p&eacute;riode pr&eacute;cise";
+$lang['report_cont_info'] = "Le rapport d&acute;information continue";
+$lang['report_cont_info_explain'] = "Utilis&eacute; pour suivre les informations des hosts/services selectionn&eacute;s comme :";
+$lang['report_cont_info_ex1'] = "recevoir par mail chaque jour l&acute;etat d'une selection d'hosts/services de la veille";
+$lang['report_cont_info_ex2'] = "recevoir par mail chaque semaine l&acute;etat d'une selection d'hosts/services de la semaine pass&eacute;e";
+$lang['report_cont_info_ex3'] = "recevoir par mail chaque mois l&acute;etat d'une selection d'hosts/services pendant le mois pass&eacute;";
+$lang['report_logs_explain'] = "Ces logs interpretent le fichier status.log de Nagios, ce fichier est g&eacute;n&eacute;r&eacute; &agrave; chaque redemarrage de Nagios";
+
+/* Traffic Map */
+
+$lang['tm_update'] = "La Traffic Map a &eacute;t&eacute; mise &agrave; jour";
+$lang['tm_available'] = "Traffic Map disponibles";
+$lang['tm_add'] = "Traffic Map ajout&eacute;e";
+$lang['tm_modify'] = "Traffic Map modifi&eacute;e";
+$lang['tm_delete'] = "Traffic Map supprim&eacute;e";
+$lang['tm_addHost'] = "Ajout d&#146;un Host &agrave; la traffic map";
+$lang['tm_changeHost'] = "L&#146;Host a &eacute;t&eacute; modifi&eacute;";
+$lang['tm_deleteHost'] = "L&#146;Host a &eacute;t&eacute; supprim&eacute;";
+$lang['tm_addRelation'] = "Une nouvelle relation a &eacute;t&eacute; ajout&eacute;e";
+$lang['tm_changeRelation'] = "La relation a &eacute;t&eacute; modifi&eacute;e";
+$lang['tm_deleteRelation'] = "La relation a &eacute;t&eacute; supprim&eacute;e";
+$lang['tm_hostServiceAssociated'] = "Hosts avec un service check_traffic associ&eacute;";
+$lang['tm_checkTrafficAssociated'] = "Check_traffic associ&eacute;";
+$lang['tm_other'] = "Autres ressources (sans check_traffic)";
+$lang['tm_networkEquipment'] = "Equipement r&eacute;seau";
+$lang['tm_selected'] = "s&eacute;lectionn&eacute;s";
+$lang['tm_maxBWIn'] = "Maximum bande passante entrante (Kbps)";
+$lang['tm_maxBWOut'] = "Maximum bande passante sortante (Kbps)";
+$lang['tm_background'] = "Image de fond";
+$lang['tm_relations'] = "Relation(s)";
+$lang['tm_hostsAvailables'] = "Host(s) disponible(s)";
+$lang['tm_labelsWarning'] = "Veuillez saisir un label sans accents";
+
+/* Graphs */
+
+$lang['graph'] = "Graphique";
+$lang['graphs'] = "Graphiques";
+$lang['g_title'] = "Graphiques";
+$lang['g_available'] = "Graphiques disponibles";
+$lang['g_path'] = "Chemin de la base RRD";
+$lang['g_imgformat'] = "Format de l&acute;image affich&eacute;e";
+$lang['g_verticallabel'] = "Titre vertical";
+$lang['g_width'] = "Taille de l&acute;image en largeur";
+$lang['g_height'] = "Taille de l&acute;image en hauteur";
+$lang['g_lowerlimit'] = "Limite basse";
+$lang['g_Couleurs'] = "Couleurs : ";
+$lang['g_ColGrilFond'] = "Couleur de fond du graph central";
+$lang['g_ColFond'] = "Couleur du fond";
+$lang['g_ColPolice'] = "Couleur de la police";
+$lang['g_ColGrGril'] = "Couleur de la grille principale";
+$lang['g_ColPtGril'] = "Couleur de la grille secondaire";
+$lang['g_ColContCub'] = "Couleur du contour de la l&eacute;gende";
+$lang['g_ColArrow'] = "Couleur de l&acute;option arrow";
+$lang['g_ColImHau'] = "Couleur du cadre haut";
+$lang['g_ColImBa'] = "Couleur du cadre bas";
+$lang['g_dsname'] = "Nom de la source de donn&eacute;e ";
+$lang['g_ColDs'] = "Couleur de la source de donn&eacute;e ";
+$lang['g_flamming'] = "Couleur flamming";
+$lang['g_Area'] = "Remplissage (no = courbe)";
+$lang['g_tickness'] = "Epaisseur de la courbe";
+$lang['g_gprintlastds'] = "Affichage de la derniere valeur calcul&eacute;e";
+$lang['g_gprintminds'] = "Affichage de la valeur la plus basse";
+$lang['g_gprintaverageds'] = "Affichage de la valeur moyenne";
+$lang['g_gprintmaxds'] = "Affichage de la valeur la plus haute";
+$lang['g_graphorama'] = "GraphsVision";
+$lang['g_graphoramaerror'] = "La date de d&eacute;but est superieure ou &eacute;gale  la date de fin";
+$lang['g_date_begin'] = "Date de d&eacute;but";
+$lang['g_date_end'] = "Date de fin";
+$lang['g_hours'] = "Heures";
+$lang['g_number_per_line'] = "Nombre par ligne";
+$lang['g_height'] = "Hauteur";
+$lang['g_width'] = "Largeur";
+$lang['g_basic_conf'] = "Configuration de base :";
+$lang['g_ds'] = "Source de donn&eacute;es";
+$lang['g_lcurrent'] = "Courant";
+$lang['g_lday'] = "Derni&egrave;re journ&eacute;e";
+$lang['g_lweek'] = "Derni&egrave;re semaine";
+$lang['g_lyear'] = "Derni&egrave;re ann&eacute;e";
+$lang['g_see'] = "Voir le graphique associ&eacute;";
+$lang['g_from'] = "Du ";
+$lang['g_to'] = " Au ";
+$lang['g_current'] = "Actuel :";
+$lang['g_average'] = "Moyen :";
+$lang['g_no_graphs'] = "Pas de graphique disponible";
+$lang['g_no_access_file'] = "Le fichier %s n&#146;est pas accessible";
+
+/* Graph Models */
+
+$lang['gmod'] =  'Propri&eacute;t&eacute;s de base';
+$lang['gmod_ds'] =  'Source de donn&eacute;es';
+$lang['gmod_available'] = 'Mod&egrave;les de propri&eacute;t&eacute;s de Graphique disponibles';
+$lang['gmod_ds_available'] = 'Mod&egrave;les de DS de Graphique disponibles';
+$lang['gmod_use_model'] = 'Utiliser un mod&egrave;le';
+
+/* Colors */
+$lang['colors'] =  'Couleurs';
+$lang['hexa'] =  'Couleur en hexadecimal';
+
+/* Nagios.cfg */
+
+$lang['nagios_save'] = 'La configuration a &eacute;t&eacute; sauv&eacute;e.<br> Vous devez maintenant d&eacute;placer le fichier et red&eacute;marrer Nagios pour prendre les changements en compte.';
+
+/* Resource.cfg */
+
+$lang['resources_example'] = 'Exemple de ressource';
+$lang['resources_add'] = 'Ajouter une nouvelle ressource';
+$lang['resources_new'] = 'Une nouvelle ressource a &eacute;t&eacute; ajout&eacute;e';
+
+/* lca */
+
+$lang['lca_user'] = 'Utilisateur :';
+$lang['lca_user_access'] = 'a acc&egrave;s &agrave; :';
+$lang['lca_profile'] = 'profil';
+$lang['lca_user_restriction'] = 'Utilisateurs poss&eacute;dant des restrictions';
+$lang['lca_access_comment'] = 'Autoriser l&#146;acc&egrave;s aux commentaires :';
+$lang['lca_access_downtime'] = 'Autoriser l&#146;acc&egrave;s aux downtimes :';
+$lang['lca_access_watchlog'] = 'Autoriser l&#146;acc&egrave;s &agrave; la lecture des logs :';
+$lang['lca_access_trafficMap'] = 'Autoriser l&#146;acc&egrave;s &agrave; la vision des Traffic Maps :';
+$lang['lca_access_processInfo'] = 'Autoriser l&#146;acc&egrave;s sur les process info :';
+$lang['lca_add_user_access'] = 'Ajouter des restrictions &agrave; un utilisateur';
+$lang['lca_apply_restrictions'] = 'Appliquer les restrictions';
+$lang['lca_action_on_profile'] = 'Actions' ;
+
+/* History */
+
+$lang['log_detail'] = "D&eacute;tails de logs pour ";
+
+/* Options General */
+
+$lang["opt_gen"] = "Options G&eacute;n&eacute;rales";
+$lang["nagios_version"] = "Version de nagios en cours d&#146;utilisation : ";
+$lang["oreon_path"] = "R&eacute;pertoire d&#146;installation de Oreon";
+$lang["oreon_path_tooltip"] = "O&#249; est install&eacute; Oreon ?";
+$lang["nagios_path"] = "R&eacute;pertoire d&#146;installation de Nagios";
+$lang["nagios_path_tooltip"] = "O&#249; est le r&eacute;pertoire de Nagios ?";
+$lang["refresh_interface"] = "Rafra&icirc;chissement de l&#146;interface";
+$lang["refresh_interface_tooltip"] = "Fr&eacute;quence &#224; laquelle l&#146;interface est rafraichie";
+$lang["snmp_com"] = "Communaut&eacute; SNMP";
+$lang["snmp_com_tooltip"] = "Communaut&eacute; SNMP utilis&eacute;e par d&eacute;faut";
+$lang["snmp_version"] = "Version de SNMP";
+$lang["snmp_path"] = "R&eacute;pertoire d&#146;installation de SNMP";
+$lang["snmp_path_tooltip"] = "O&#249; se trouvent les binaires snmpget et snmpwalk ?";
+$lang["cam_color"] = "Couleurs des Camemberts";
+$lang["for_hosts"] = "Pour les hosts";
+$lang["for_services"] = "Pour les services";
+$lang["rrd_path"] = "RRDToolsPath/rrdtool";
+$lang["rrd_path_tooltip"] = "O&#249; est install&eacute; rrdtool ?";
+$lang["rrd_base_path"] = "Bases RRDTool";
+$lang["rrd_base_path_tooltip"] = "O&#249; sont g&eacute;n&eacute;r&eacute;s les fichiers rrd ?";
+$lang["mailer"] = "Mailer";
+$lang["mailer_tooltip"] = "O&#249; se trouve le binaire mail ?";
+$lang["opt_gen_save"] = "Options G&eacute;n&eacute;rales sauv&eacute;es.<br>Vous n&#146;avez pas besoin de reg&eacute;n&eacute;rer.";
+$lang["session_expire"] = "Temps d'expiration des sessions";
+$lang["session_expire_unlimited"] = "illimit&eacute;";
+$lang["binary_path"] = "R&eacute;pertoire du binaire de Nagios";
+$lang["binary_path_tooltip"] = "O&#249; se trouve le binaire nagios ?";
+$lang["images_logo_path"] = "R&eacute;pertoire des images de Nagios";
+$lang["images_logo_path_tooltip"] = "O&#249; se trouve le r&eacute;pertoire des images Nagios  ?";
+$lang["plugins_path"] = "R&eacute;pertoire des sondes Nagios";
+$lang["plugins_path_tooltip"] = "O&#249; se trouvent les sondes Nagios ?";
+$lang["path_error_legend"] = "Code Couleurs des erreurs";
+$lang["invalid_path"] = "Le r&eacute;pertoire ou le fichier n&#146;existe pas";
+$lang["executable_binary"] = "Le fichier n&#146;est pas ex&eacute;cutable";
+$lang["writable_path"] = "Le r&eacute;pertoire ou le fichier n&#146;est pas modifiable";
+$lang["readable_path"] = "Le r&eacute;pertoire et son contenu ne sont pas lisibles";
+$lang["rrdtool_version"] = "Version de RRDTool";
+$lang["nmap_path"] = "Chemin du binaire de Nmap";
+$lang["nmap_path_tooltip"] = "O&#249; est install&eacute; nmap ?";
+
+/* Auto Detect */
+
+$lang['ad_title'] = "D&eacute;tection automatique des Hosts";
+$lang['ad_title2'] = "D&eacute;tection automatique";
+$lang['ad_ser_result'] = "La recherche automatique a d&eacute;couvert les services suivants sur ";
+$lang['ad_ser_result2'] = "Cette liste n'est pas une liste exhaustive et ne comprend que <br>les services r&eacute;seaux ayant ouvert un port r&eacute;seau sur l'host.";
+$lang['ad_infos1'] = "Pour faire la recherche automatique,<br>veuillez remplir le champs suivant avec :";
+$lang['ad_infos2'] = 'soit avec une adresse IP (ex : 192.168.1.45),';
+$lang['ad_infos3'] = 'soit une plage IP (ex : 192.168.1.1-254),';
+$lang['ad_infos4'] = 'soit une liste d\'IP :';
+$lang['ad_infos5'] = '192.168.1.1,24,38';
+$lang['ad_infos6'] = '192.168.*.*';
+$lang['ad_infos7'] = '192.168.10-34.23-25,29-32';
+$lang['ad_ip'] = 'IP';
+$lang['ad_res_result'] = 'R&eacute;sultat de la recherche';
+$lang['ad_found'] = "trouv&eacute;(s)";
+$lang['ad_number'] = "Num&eacute;ro";
+$lang['ad_dns'] = "DNS";
+$lang['ad_actions'] = "Actions";
+$lang['ad_port'] = "Port";
+$lang['ad_name'] = "Nom";
+
+/* Export DB */
+
+$lang['edb_file_already_exist'] = "Ce fichier existe deja, veuillez ressaisir un autre nom de sauvegarde";
+$lang['edb_file_move'] = "Fichiers d&eacute;plac&eacute;s";
+$lang['edb_file_ok'] = "Fichiers g&eacute;n&eacute;r&eacute;s et d&eacute;plac&eacute;s";
+$lang['edb_file_nok'] = "Erreur lors de la g&eacute;n&eacute;ration ou le d&eacute;placement des fichiers";
+$lang['edb_restart'] = "Red&eacute;marre le serveur";
+$lang['edb_save'] = "Cr&eacute;er une sauvegarde";
+$lang['edb_nagios_restart'] = "Red&eacute;marre le serveur Nagios";
+$lang['edb_nagios_restart_ok'] = "Nagios red&eacute;marr&eacute;";
+$lang['edb_restart'] = "Red&eacute;marrer";
+
+/* user Online */
+
+$lang["wi_user"] = "Utilisateurs";
+$lang["wi_where"] = "Localisation";
+$lang["wi_last_req"] = "Derni&egrave;re Requ&ecirc;te";
+
+/* Reporting */
+
+$lang["pie_unavailable"] = "Pas de camembert accessible pour le moment";
+
+/* Configuration Stats */
+
+$lang['conf_stats_category'] = "Cat&eacute;gorie";
+
+/* Pictures */
+
+$lang["pict_title"] = "Oreon - Images pour les informations &eacute;tendues";
+$lang["pict_new_image"] = "Nouvelle image (.png seulement)";
+
+/* About */
+
+$lang["developped"] = "D&eacute;velopp&eacute; par";
+
+/* Live Report */
+
+$lang["lr_available"] = "Hosts Disponibles";
+$lang["live_report"] = "Rapport en direct";
+$lang["bbreporting"] = "Rapports";
+$lang["lr_host"] = "Host :";
+$lang["lr_alias"] = "Alias :";
+$lang["lr_ip"] = "Adresse IP :";
+$lang["lr_view_services"] = "Visualiser les d&eacute;tails de services pour cet host";
+$lang["lr_configure_host"] = "Configurer cet host";
+$lang["lr_details_host"] = "Visualiser les informations de l'host";
+
+
+/* Date and Time Format */
+
+$lang["date_format"] = "d/m/Y";
+$lang["time_format"] = "H:i:s";
+$lang["header_format"] = "d/m/Y G:i";
+$lang["date_time_format"] = "d/m/Y - H:i:s";
+$lang["date_time_format_status"] = "d/m/Y H:i:s";
+$lang["date_time_format_g_comment"] = "d/m/Y H:i";
+
+/* */
+
+$lang["top"] = "Haut";
+$lang["event"] = "Ev&eacute;nements";
+$lang["date"] = "Date";
+$lang["pel_l_details"] = "D&eacute;tail des logs pour le ";
+$lang["pel_sort"] = "Filtres";
+$lang["pel_alerts_title"] = "Alertes du ";
+$lang["pel_notify_title"] = "Notifications du ";
+
+/* perfparse */
+
+$lang["perfparse_installed"] = "Perfparse est installe ?";
+$lang["service_logged"] = "Services loggs";
+
+/* legend */
+
+$lang["lgd_legend"] = " L&eacute;gende";
+$lang["lgd_delOne"] = " Supprimer";
+$lang["lgd_delAll"] = " Supprimer";
+$lang["lgd_duplicate"] = " Dupliquer";
+$lang["lgd_view"] = " Voir";
+$lang["lgd_edit"] = " Modifier";
+$lang["lgd_signpost"] = " D&eacute;tail";
+$lang["lgd_next"] = " Suivant";
+$lang["lgd_prev"] = " Pr&eacute;c&eacute;dent";
+$lang["lgd_on"] = " Activer";
+$lang["lgd_off"] = " D&eacute;sactiver";
+
+$lang["advanced"] = "Options Avancees >>";
+?>
diff --git a/www/login.php b/www/login.php
new file mode 100644
index 0000000000000000000000000000000000000000..85b4de252268afcefde1c914f6cace51b60d2476
--- /dev/null
+++ b/www/login.php
@@ -0,0 +1,73 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	$date = date("d/m/Y");
+	if (isset($msg_error))
+		echo "<div style='padding-top: 10px;' class='text12bc'>$msg_error</div>";
+	else if (isset($_POST["submit"]))
+		echo "<div style='padding-top: 10px;' class='text12bc'>Invalid user</div>";
+	?>  
+	<form action="./index.php" method="post" name="login">
+	<?
+		if (isset($_GET["disconnect"]) && $_GET["disconnect"] == 2)
+			print "<center><span class='msg'>Session Expired.</span></center>";
+		if ($file_install_acces)
+			print "<center><span class='msg'>$error_msg</span></center>";
+	?>
+<div id="LoginInvit">
+	<table id="logintab1">
+		<tr>
+			<td class="LoginInvitLogo" colspan="2"><img src="img/LogoOreon.png" alt="Oreon logo" title="Oreon Logo"></td>
+		</tr>
+		<tr>
+			<td class="LoginInvitVersion"><br><? include("include/version/version.php");  ?></td>
+			<td class="LoginInvitDate"><br><? echo $date; ?></td>
+		</tr>
+		<tr>
+			<td colspan="2">
+				<table id="logintab2">
+					<tr>
+						<td><label for="useralias">Login:</label></td>
+						<td><input type="text" name="useralias" value="" class="inputclassic"></td>
+					</tr>
+					<tr>
+						<td><label for="password">Password:</label></td>
+						<td><input type="password" name="password" value="" class="inputclassic"></td>
+					</tr>
+					<tr>
+						<td  colspan="2" id="sublogin">
+							<input type="Submit" name="submit" value="Login" <? if ($file_install_acces) print "disabled"; ?> >
+						</td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+		<tr>
+			<td id="LoginInvitcpy" colspan="2">
+				<a href="mailto:infos@oreon-project.org">Oreon</a> - <a href="http://www.nagios.org">Nagios</a> - &copy; 2004-2006 <br><a href="http://www.oreon-project.org" target="_blank">Oreon</a> All Rights Reserved.<br />
+			</td>
+		</tr>
+	</table>
+</form>
+</div>
+
+
+<?
+?>
diff --git a/www/menu/BlockMenuType1.ihtml b/www/menu/BlockMenuType1.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..4a295da3374008e9fe5a022bd99ca66b53ee4f75
--- /dev/null
+++ b/www/menu/BlockMenuType1.ihtml
@@ -0,0 +1,15 @@
+<div id="{$Menu1ID}">
+    <div id="{$Menu1Color}">
+        <ul>
+        {section name=elem1 loop=$elemArr1}
+            <li><div id="{$elemArr1[elem1].Menu1ClassImg}"><a href={$elemArr1[elem1].Menu1Url}>{$elemArr1[elem1].Menu1Name}</a></div></li>
+		{/section}
+        </ul>
+		<div id="logli">
+	       <a href="{$UserInfoUrl}">{$UserName}</a>
+	       &nbsp;-&nbsp;{$Date}
+	       &nbsp;-&nbsp;<a href="{$LogOutUrl}">{$LogOut}</a>
+        </div>
+    </div>
+</div>
+
diff --git a/www/menu/BlockMenuType2.ihtml b/www/menu/BlockMenuType2.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..96dbc4e93dec7f07949d5dc04763909255a8ac30
--- /dev/null
+++ b/www/menu/BlockMenuType2.ihtml
@@ -0,0 +1,10 @@
+<div id={$Menu2Color}>
+    <div id={$Menu2ID}>
+        {section name=elem2 loop=$elemArr2}
+            <span class="separator_menu">{$elemArr2[elem2].Menu2Sep}</span>
+            <span class="span2">
+  	          {if $elemArr2[elem2].Menu2UrlPopup}<a href='{$elemArr2[elem2].Menu2UrlPopupOpen}' target="_blank" style="white-space:nowrap;">{$elemArr2[elem2].Menu2Name}</a>{else}<a href='{$elemArr2[elem2].Menu2Url}' style="white-space:nowrap;">{$elemArr2[elem2].Menu2Name}</a></li>{/if}
+  	        </span>
+		{/section}
+    </div>
+</div>
diff --git a/www/menu/BlockMenuType3.ihtml b/www/menu/BlockMenuType3.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..23ed4fe22b7c9fa73f9f07eef718087523c81624
--- /dev/null
+++ b/www/menu/BlockMenuType3.ihtml
@@ -0,0 +1,79 @@
+<div id="contener"><!-- begin contener -->
+
+<table id="Tcontener">
+<tr>
+<td id="Tmenu" class="TcTD">
+<div id="{$Menu3Color}">
+	<div>
+	    <div id="{$Menu3ID}">
+
+
+{assign var="c" value="0"}
+{foreach from=$elemArr3 item=curr_id}
+
+		<table class="Tmenu3" width="100%">
+		<tr class="top">
+			<td class="left"></td>
+			<td class="center"></td>
+			<td class="right"></td>
+		</tr>
+		<tr class="middle">
+			<td class="left"></td>
+			<td class="center">
+{if $c == 0 }
+				<img src='./img/icones/12x12/doublearrowsnav.gif' title='{$user.ip}'>&nbsp;{$main_menu}<br><br>
+{assign var="c" value="1"}
+{/if}
+
+
+	       		<ul>
+					{foreach from=$curr_id item=curr_id2}					
+	                    <li>
+	                    {if $curr_id2.Menu3Icone}<img src='{$curr_id2.Menu3Icone}'>{/if}&nbsp;{if $curr_id2.Menu3Popup}<a href={$curr_id2.Menu3UrlPopup} target="_blank" style="white-space:nowrap;">{$curr_id2.Menu3Name}</a></li>{else}<a href={$curr_id2.Menu3Url} style="white-space:nowrap;">{$curr_id2.Menu3Name}</a></li>{/if}
+					{/foreach}
+	            </ul>
+	        </td>  
+	        <td class="right"></td>
+	    </tr>
+	   	<tr class="bottom">
+			<td class="left"></td>
+			<td class="center"></td>
+			<td class="right"></td>
+		</tr>
+		</table>
+<br>
+
+{/foreach}
+
+		<table class="Tmenu3" width="100%">
+		<tr class="top">
+			<td class="left"></td>
+			<td class="center"></td>
+			<td class="right"></td>
+		</tr>
+		<tr class="middle">
+			<td class="left"></td>
+			<td class="center">
+				<img src='./img/icones/12x12/doublearrowsnav.gif' title='{$user.ip}'>&nbsp;{$connected_users} <br><br>
+  	             	<ul>
+  	              { foreach item=user from=$tab_user }
+  	             	{if $user.admin}
+  	             	<li><img src='./img/icones/16x16/guard.gif' title='{$user.ip}' style='padding:1px;'>&nbsp;{$user.alias}</li>
+  	             	{else}
+  	             	<li><img src='./img/icones/16x16/user1.gif' title='{$user.ip}' style='padding:1px;'>&nbsp;{$user.alias}</li>
+  	           		{/if}
+  	              {/foreach} 
+					</ul>
+			</td>
+			<td class="right" width='15'></td>
+		</tr>
+		<tr class="bottom">
+			<td class="left"></td>
+			<td class="center"></td>
+			<td class="right"></td>
+		</tr>
+		</table>
+   </div>
+</div>
+</td>
+<td id="Tmainpage" class="TcTD" valign="top">
diff --git a/www/menu/Menu.php b/www/menu/Menu.php
new file mode 100644
index 0000000000000000000000000000000000000000..bcdd738bb8d76376110f87ce2c24f8a8d21cfea2
--- /dev/null
+++ b/www/menu/Menu.php
@@ -0,0 +1 @@
+<?/**Oreon is developped with GPL Licence 2.0 :http://www.gnu.org/licenses/gpl.txtDevelopped by : Julien Mathis - Romain Le Merlus - Christophe CoraboeufAdapted to Pear library Quickform & Template_PHPLIB by Merethis company, under direction of Cedrick FaconThe Software is provided to you AS IS and WITH ALL FAULTS.OREON makes no representation and gives no warranty whatsoever,whether express or implied, and without limitation, with regard to the quality,safety, contents, performance, merchantability, non-infringement or suitability forany particular or intended purpose of the Software found on the OREON web site.In no event will OREON be liable for any direct, indirect, punitive, special,incidental or consequential damages however they may arise and even if OREON hasbeen previously advised of the possibility of such damages.For information : contact@oreon-project.org*/	if (!isset($oreon))		exit();	?>	<div id="header">	<img src=<? echo $skin.'Images/logo_oreon.gif'?> alt='Oreon logo' title='Oreon Logo'>	<!--<a href="#" class="help" onclick="DisplayHidden('legend');">Help</a>-->	<img onclick="DisplayHidden('legend');" class="help" src="./img/icones/16x16/about.gif" alt='<? echo $lang['m_help']; ?>' title='<? echo $lang['lgd_legend']; ?>'>	</div>	<?	# Path to the configuration dir	$path = "./menu/";	require_once ("./include/common/common-Func.php");	# Smarty template Init	$tpl = new Smarty();	$tpl = initSmartyTpl($path, $tpl);	# Var init	$sep = NULL;	$elemArr = array(1=>array(), 2=>array(), 3=>array());	# Special Case	# Put the contact_id in the URL	$cct_id = NULL;	# Put the authentification in the URL	$auth = NULL;	# Grab elements for level 1	$rq = "SELECT * FROM topology WHERE topology_parent IS NULL AND topology_id IN (".$oreon->user->lcaTStr.") AND topology_show = '1' ORDER BY topology_order";	$res =& $pearDB->query($rq);	for($i = 0; $res->numRows() && $res->fetchInto($elem);)	{			if (!$oreon->optGen["perfparse_installed"] && $elem["topology_page"] == 3)				;			else	{				$elem["topology_url"] == "./include/options/oreon/myAccount/formMyAccount.php" ? $cct_id = "&contact_id=".$oreon->user->get_id() : $cct_id = NULL;				$elemArr[1][$i] = array("Menu1ClassImg" => $level1 == $elem["topology_page"] ? "menu1_bgimg" : NULL,										"Menu1Url" => "oreon.php?p=".$elem["topology_page"].$elem["topology_url_opt"].$cct_id,										"Menu1Name" => array_key_exists($elem["topology_name"], $lang) ? $lang[$elem["topology_name"]] : "#UNDEF#");				$i++;			}	}	$userUrl = "oreon.php?p=50104&o=c&contact_id=";    $userUrl .= $oreon->user->get_id();	$userName = $oreon->user->get_name();    $userName .= " ( ";    $userName .= $oreon->user->get_alias();    $userName .= " )";    $logDate= date($lang['header_format']);    $logOut= $lang['m_logout'];    $logOutUrl= "index.php?disconnect=1";	# Grab elements for level 2	$rq = "SELECT * FROM topology WHERE topology_parent = '".$level1."' AND topology_id IN (".$oreon->user->lcaTStr.") AND topology_show = '1'  ORDER BY topology_order";	$res2 =& $pearDB->query($rq);	$firstP = NULL;	$sep = "&nbsp;";	for($i = 0; $res2->numRows() && $res2->fetchInto($elem); $i++)	{		$elem["topology_url"] == "./ext/osm/osm_jnlp.php" ? $auth = "?al=".md5($oreon->user->get_alias())."&pwd=".$oreon->user->get_passwd() : $auth = NULL;		$elem["topology_url"] == "./include/options/oreon/myAccount/formMyAccount.php" ? $cct_id = "&contact_id=".$oreon->user->get_id() : $cct_id = NULL;		$firstP ? null : $firstP = $elem["topology_page"];	    $elemArr[2][$i] = array("Menu2Sep" => $sep,								"Menu2Url" => "oreon.php?p=".$elem["topology_page"].$elem["topology_url_opt"].$cct_id,								"Menu2UrlPopup" => $elem["topology_popup"],								"Menu2UrlPopupOpen" => $elem["topology_url"].$auth,								"Menu2Name" => array_key_exists($elem["topology_name"], $lang) ? $lang[$elem["topology_name"]] : "#UNDEF#",								"Menu2Popup" => $elem["topology_popup"] ? true : false);		$sep = "|";	}	# Grab elements for level 3	$rq = "SELECT * FROM topology WHERE topology_parent = '".($level2 ? $level1.$level2 : $firstP)."' AND topology_id IN (".$oreon->user->lcaTStr.") AND topology_show = '1' ORDER BY topology_order";	$res3 =& $pearDB->query($rq);	for($i = 0; $res3->fetchInto($elem);)	{		if (!$oreon->optGen["perfparse_installed"] && ($elem["topology_page"] == 60204 || $elem["topology_page"] == 60405 || $elem["topology_page"] == 60505 || $elem["topology_page"] == 20206 || $elem["topology_page"] == 40201 || $elem["topology_page"] == 40202 || $elem["topology_page"] == 60603))			;		else	{			$elem["topology_url"] == "./include/options/oreon/myAccount/formMyAccount.php" ? $cct_id = "&contact_id=".$oreon->user->get_id() : $cct_id = NULL;		    $elemArr[3][$elem["topology_group"]][$i] = array("Menu3Icone" => $elem["topology_icone"],									"Menu3Url" => "oreon.php?p=".$elem["topology_page"].$elem["topology_url_opt"].$cct_id,									"Menu3UrlPopup" => $elem["topology_url"],									"Menu3Name" => array_key_exists($elem["topology_name"], $lang) ? $lang[$elem["topology_name"]] : "#UNDEF#",									"Menu3Popup" => $elem["topology_popup"] ? true : false);			 $i++;		}	}	# Create Menu Level 1-2-3	$tpl->assign("Menu1Color", "menu_1");	$tpl->assign("Menu1ID", "menu1_bgcolor");	$tpl->assign("UserInfoUrl", $userUrl);	$tpl->assign("UserName", $userName);	$tpl->assign("Date", $logDate);	$tpl->assign("LogOut", $logOut);	$tpl->assign("LogOutUrl", $logOutUrl);	$tpl->assign("Menu2Color", "menu_2");	$tpl->assign("Menu2ID", "menu2_bgcolor");	$tpl->assign("Menu3Color", "menu_3");	$tpl->assign("Menu3ID", "menu3_bgcolor");	$tpl->assign("connected_users", $lang["m_connected_users"]);	$tpl->assign("main_menu", $lang["m_main_menu"]);	# Assign for Smarty Template	$tpl->assign("elemArr1", $elemArr[1]);	count($elemArr[2]) ? $tpl->assign("elemArr2", $elemArr[2]) : NULL;	count($elemArr[3]) ? $tpl->assign("elemArr3", $elemArr[3]) : NULL;	# User Online		$tab_user = array();	$res =& $pearDB->query("SELECT session.session_id, contact.contact_alias, contact.contact_admin, session.user_id, session.ip_address FROM session, contact WHERE contact.contact_id = session.user_id");	while ($res->fetchInto($session)){		$tab_user[$session["user_id"]] = array();		$tab_user[$session["user_id"]]["ip"] = $session["ip_address"];		$tab_user[$session["user_id"]]["id"] = $session["user_id"];		$tab_user[$session["user_id"]]["alias"] = $session["contact_alias"];		$tab_user[$session["user_id"]]["admin"] = $session["contact_admin"];	}		$tpl->assign("tab_user", $tab_user);	# Display	$tpl->display("BlockMenuType1.ihtml");	count($elemArr[2]) ? $tpl->display("BlockMenuType2.ihtml") : NULL;	count($elemArr[3]) ? $tpl->display("BlockMenuType3.ihtml") : print '<div id="contener"><!-- begin contener --><table id="Tcontener"><tr><td id="Tmainpage" class="TcTD">';	?>
\ No newline at end of file
diff --git a/www/modules/inventory/DB-Func.php b/www/modules/inventory/DB-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..849d36e8fd1c95bb170cc3660155e61ea3cba039
--- /dev/null
+++ b/www/modules/inventory/DB-Func.php
@@ -0,0 +1,34 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Inventory � is developped by Merethis company for Lafarge Group,
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	function change_manufacturer($hosts = array(), $manufacturer_id = NULL)		{
+		global $pearDB;
+		if (!$manufacturer_id) $manufacturer_id = "NULL";
+		else $manufacturer_id = "'".$manufacturer_id."'";
+		foreach($hosts as $key=>$value)	{
+			$str = "UPDATE `inventory_index` SET `type_ressources` = ".$manufacturer_id." WHERE `host_id` = ".$key;
+			$pearDB->query($str);
+		}
+	}	
+?>	
\ No newline at end of file
diff --git a/www/modules/inventory/common-Func.php b/www/modules/inventory/common-Func.php
new file mode 100644
index 0000000000000000000000000000000000000000..573865cd0ac6c314b4e3b2d119ff2ee7abd05423
--- /dev/null
+++ b/www/modules/inventory/common-Func.php
@@ -0,0 +1,160 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Inventory � is developped by Merethis company for Lafarge Group,
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	/*
+	 * Include function For SNMPWALK and SNMPGET
+	 */
+
+	function get_snmp_value($oid, $replace_string){
+		global $address, $community, $timeout, $retries;
+		$str = @snmpget($address, $community, $oid, $timeout , $retries);
+		//print "[".$str."]";
+		if ($str == FALSE)
+			return FALSE;
+		else
+			return str_replace($replace_string, '', $str);
+	}
+
+	function walk_snmp_value($oid, $replace_string){
+		global $address, $community, $timeout, $retries;
+		$tab = @snmpwalk($address, $community, $oid, $timeout , $retries);
+		if ($tab){
+			$cpt = 0;
+			if ($tab)
+				foreach ($tab as $t){
+					$tab_ret[$cpt] = str_replace($replace_string, '', $t);
+					$cpt++;
+				}
+			return $tab_ret;
+		} else
+			return FALSE;
+	}
+
+	/*
+	 * Get manufacturer ID with mac address
+	 */
+
+	function get_manufacturer(){
+		global $address;
+		global $pearDB;
+		$str = walk_snmp_value("1.3.6.1.2.1.2.2.1.6", "STRING: ");
+		if (isset($str) && $str)
+			foreach ($str as $ifTab_address){
+				if (isset($ifTab_address) && strcmp("", $ifTab_address) && strcmp("0:1", $ifTab_address)){
+					preg_match("/^([0-9A-Fa-f]*\:[0-9A-Fa-f]*\:[0-9A-Fa-f]*).*/", $ifTab_address, $matches);
+					$tab = split(":", substr($matches[1], 0, 8));
+					foreach ($tab as $key => $t)
+						if (strlen($t) == 1)
+							$tab[$key] = strtoupper("0" . $t);
+					$res =& $pearDB->query("SELECT manufacturer,mac_address_begin FROM inventory_mac_address WHERE mac_address_begin LIKE '".$tab[0].":".$tab[1].":".$tab[2]."' ");
+					while ($r =& $res->fetchRow())
+						if ($r["manufacturer"])
+							return $r["manufacturer"];
+					break;
+				}
+			}
+		return 0;
+	}
+
+	function get_hwaddress(){
+		global $address;
+		global $pearDB;
+		$str = walk_snmp_value("1.3.6.1.2.1.2.2.1.6", "STRING: ");
+		if (isset($str) && $str)
+			foreach ($str as $ifTab_address){
+				if (isset($ifTab_address) && strcmp("", $ifTab_address)){
+					preg_match("/^([0-9A-Fa-f]*\:[0-9A-Fa-f]*\:[0-9A-Fa-f]*\:[0-9A-Fa-f]*\:[0-9A-Fa-f]*\:[0-9A-Fa-f]*).*/", $ifTab_address, $matches);
+					//print "-" . $address . "->" . substr($matches[1], 0, 8) ."|". $ifTab_address ."\n";
+					$tab = split(":", $matches[1]);
+					foreach ($tab as $key => $t) {
+						if (strlen($t) == 1)
+							$tab[$key] = strtoupper("0" . $t);
+					}
+					$hwaddress = $tab[0].":".$tab[1].":".$tab[2].":".$tab[3].":".$tab[4].":".$tab[5];
+					return $hwaddress ;
+					break;
+				}
+			}
+		return 0;
+	}
+
+
+	function verify_data($host_id){
+		global $pearDB, $debug;
+		global $sysName,$sysContact,$sysDescr,$sysLocation,$Manufacturer,$SerialNumber,$SwitchVersion,$RomVersion;
+
+		/*
+    	 * Recuprer les donnes pour faire un diff de donnes qui ont change.
+    	 */
+
+    	$resLogCurrent =& $pearDB->query("SELECT * FROM `inventory_index` WHERE `host_id` = '".$host_id."' LIMIT 1");
+    	$rLC =& $resLogCurrent->fetchRow();
+    	/*
+    	if ($rLC["type_ressources"] == NULL){
+	    	//$manufacturer = get_manufacturer();
+	    	$res =& $pearDB->query("UPDATE `inventory_index` SET `type_ressources` = '".$manufacturer."' WHERE `host_id` = '".$host_id."' LIMIT 1 ;") ;
+			if (PEAR::isError($res)) print ("type_ressources : " . $res->getMessage());
+    	}
+    	*/
+    	/*
+    	 * Selectionner les infos qui different et mettre un log en place pour l'historique de modifs
+    	 */
+
+    	if (strcmp($rLC["name"], $sysName)) {
+    		$res =& $pearDB->query("UPDATE `inventory_index` SET `name` = '".$sysName."' WHERE `host_id` = '".$host_id."' LIMIT 1 ;") ;
+    		$res =& $pearDB->query("INSERT INTO `inventory_log` (`id`, `host_id`, `type`, `replaced_value`, `value`, `ctime`) VALUES ('', '".$host_id."', 'name', '".$rLC["name"]."', '".$sysName."', '".time()."')");
+       	}
+    	if (strcmp($rLC["contact"], $sysContact))  {
+	    	$res =& $pearDB->query("UPDATE `inventory_index` SET `contact` = '".$sysContact."' WHERE `host_id` = '".$host_id."' LIMIT 1 ;") ;
+    		$res =& $pearDB->query("INSERT INTO `inventory_log` (`id`, `host_id`, `type`, `replaced_value`, `value`, `ctime`) VALUES ('', '".$host_id."', 'contact', '".$rLC["contact"]."', '".$sysContact."', '".time()."')");
+    	}
+    	if (strcmp($rLC["description"], $sysDescr)) {
+   	    	$res =& $pearDB->query("UPDATE `inventory_index` SET `description` = '".$sysDescr."' WHERE `host_id` = '".$host_id."' LIMIT 1 ;") ;
+    		$res =& $pearDB->query("INSERT INTO `inventory_log` (`id`, `host_id`, `type`, `replaced_value`, `value`, `ctime`) VALUES ('', '".$host_id."', 'description', '".$rLC["description"]."', '".$sysDescr."', '".time()."')");
+    	}
+    	if (strcmp($rLC["location"], $sysLocation)) {
+	    	$res =& $pearDB->query("UPDATE `inventory_index` SET `location` = '".$sysLocation."' WHERE `host_id` = '".$host_id."' LIMIT 1 ;") ;
+    		$res =& $pearDB->query("INSERT INTO `inventory_log` (`id`, `host_id`, `type`, `replaced_value`, `value`, `ctime`) VALUES ('', '".$host_id."', 'location', '".$rLC["location"]."', '".$sysLocation."', '".time()."')");
+    	}
+    	if (strcmp($rLC["manufacturer"], $Manufacturer)) {
+	    	$res =& $pearDB->query("UPDATE `inventory_index` SET `manufacturer` = '".$Manufacturer."' WHERE `host_id` = '".$host_id."' LIMIT 1 ;") ;
+    		$res =& $pearDB->query("INSERT INTO `inventory_log` (`id`, `host_id`, `type`, `replaced_value`, `value`, `ctime`) VALUES ('', '".$host_id."', 'manufacturer', '".$rLC["manufacturer"]."', '".$Manufacturer."', '".time()."')");
+    	}
+    	$SerialNumber = str_replace(" ", "", $SerialNumber);
+    	if (strcmp($rLC["serial_number"], $SerialNumber)) {
+    		$res =& $pearDB->query("UPDATE `inventory_index` SET `serial_number` = '".$SerialNumber."' WHERE `host_id` = '".$host_id."' LIMIT 1 ;") ;
+    		$res =& $pearDB->query("INSERT INTO `inventory_log` (`id`, `host_id`, `type`, `replaced_value`, `value`, `ctime`) VALUES ('', '".$host_id."', 'servial_number', '".$rLC["serial_number"]."', '".$SerialNumber."', '".time()."')");
+    	}
+    	$SwitchVersion = str_replace(" ", "", $SwitchVersion);
+    	if (strcmp($rLC["os"], $SwitchVersion)) {
+	    	$res =& $pearDB->query("UPDATE `inventory_index` SET `os` = '".$SwitchVersion."' WHERE `host_id` = '".$host_id."' LIMIT 1 ;") ;
+    		$res =& $pearDB->query("INSERT INTO `inventory_log` (`id`, `host_id`, `type`, `replaced_value`, `value`, `ctime`) VALUES ('', '".$host_id."', 'os', '".$rLC["os"]."', '".$SwitchVersion."', '".time()."')");
+    	}
+    	$RomVersion = str_replace(" ", "", $RomVersion);
+    	if (strcmp($rLC["os_revision"], $RomVersion)) {
+	    	$res =& $pearDB->query("UPDATE `inventory_index` SET `os_revision` = '".$RomVersion."' WHERE `host_id` = '".$host_id."' LIMIT 1 ;") ;
+    		$res =& $pearDB->query("INSERT INTO `inventory_log` (`id`, `host_id`, `type`, `replaced_value`, `value`, `ctime`) VALUES ('', '".$host_id."', 'os_revision', '".$rLC["os_revision"]."', '".$RomVersion."', '".time()."')");
+    	}
+    	if ($debug) print "update -> $sysName \n";
+    }
+
+
+?>
\ No newline at end of file
diff --git a/www/modules/inventory/cron/inventory_cron_update.php b/www/modules/inventory/cron/inventory_cron_update.php
new file mode 100644
index 0000000000000000000000000000000000000000..d0b0b9e0a6088fbbd72ef03c03ec897921a5577c
--- /dev/null
+++ b/www/modules/inventory/cron/inventory_cron_update.php
@@ -0,0 +1,153 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Inventory � is developped by Merethis company for Lafarge Group,
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	$path = "/usr/local/oreon/www/";
+
+ 	include($path."oreon.conf.php");
+ 	require_once ($path."class/Session.class.php");
+ 	require_once ($path."class/Oreon.class.php");
+
+ 	require_once 'DB.php';
+
+  	## Init Microtime
+  	$begin_time = microtime();
+
+  	## Debug mode activation
+ 	 $debug = 0;
+
+  	include($path."modules/inventory/common-Func.php");
+  	require_once $path."include/common/common-Func.php";
+  	$dsn = array(
+      'phptype'  => 'mysql',
+      'username' => $conf_oreon['user'],
+      'password' => $conf_oreon['password'],
+      'hostspec' => $conf_oreon['host'],
+      'database' => $conf_oreon['db'],
+  	);
+  	$options = array('debug' => 2, 'portability' => DB_PORTABILITY_ALL ^ DB_PORTABILITY_LOWERCASE);
+  	$pearDB =& DB::connect($dsn, $options);
+  	if (PEAR::isError($pearDB))
+      	die("pb connexion : ".$pearDB->getMessage());
+
+  	$pearDB->setFetchMode(DB_FETCHMODE_ASSOC);
+
+  	$timeout = 30 * 1000;
+  	$retries = 5;
+
+  	if (!isset($oreon))
+   	 	$oreon = 1;
+
+ 	$msg = '';
+
+  	include($path."modules/inventory/inventory_oid_library.php");
+
+  	$optres =& $pearDB->query("SELECT snmp_community,snmp_version FROM general_opt LIMIT 1");
+  	$optr =& $optres->fetchRow();
+  	$globalCommunity = $optr["snmp_community"];
+  	$globalVersion = $optr["snmp_version"];
+
+  	$resHost =& $pearDB->query("SELECT * FROM host WHERE host_register= '1'");
+
+while ($r =& $resHost->fetchRow()){
+	$host_id = $r["host_id"];
+    $address = $r["host_address"];
+
+  	if (!$r["host_snmp_community"]){
+		$community = getMySnmpCommunity($r["host_id"]);
+		if ($community == "")
+			$community = $oreon->optGen["snmp_community"];
+	} else
+		$community = $r["host_snmp_community"];
+
+	if (!$r["host_snmp_version"]){
+		$version = getMySnmpVersion($r["host_id"]);
+		if ($version == "")
+			$version = $oreon->optGen["snmp_version"];
+	} else 
+		$version = $r["host_snmp_version"];
+
+   $uptime =  get_snmp_value(".1.3.6.1.2.1.1.3.0", "STRING: ");
+
+    if ($uptime != FALSE){
+		$host_inv =& $pearDB->query("SELECT * FROM inventory_index WHERE host_id = '$host_id'");
+      	if ($host_inv->numRows() == 0){
+        	$Constructor = get_manufacturer();
+        	//$hwaddress = get_hwaddress();
+        	$constr =& $pearDB->query(	"SELECT inventory_manufacturer.name,inventory_manufacturer.alias FROM inventory_manufacturer,inventory_index ".
+                      "WHERE inventory_manufacturer.id = '".$Constructor."'");
+          	$m =& $constr->fetchRow();
+          	$Constructor_name = $m["name"];
+          	$Constructor_alias = $m["alias"];
+      	} else {
+        	$constr =& $pearDB->query(	"SELECT inventory_manufacturer.name,inventory_manufacturer.alias FROM inventory_manufacturer,inventory_index ".
+                      "WHERE inventory_manufacturer.id = inventory_index.type_ressources ".
+                      "AND inventory_index.host_id = '".$host_id."'");
+          	$m =& $constr->fetchRow();
+          	$Constructor_name = $m["name"];
+          	$Constructor_alias = $m["alias"];
+          	//$hwaddress = get_hwaddress();
+      	}
+	      /*
+	       * Get Data
+	       */
+		$sysLocation 	= get_snmp_value(".1.3.6.1.2.1.1.6.0", "STRING: ");
+		$sysDescr 	= get_snmp_value(".1.3.6.1.2.1.1.1.0", "STRING: ");
+		$sysName 		= get_snmp_value(".1.3.6.1.2.1.1.5.0", "STRING: ");
+		$sysContact 	= get_snmp_value(".1.3.6.1.2.1.1.4.0", "STRING: ");
+
+    	if ( isset($Constructor_name)&& ($Constructor_name)) {
+			$str = get_snmp_value($oid[$Constructor_name]["SwitchVersion"], "STRING: ");
+      		if ($str)
+        		$SwitchVersion = str_replace("\"", "", $str);
+        	$str = get_snmp_value($oid[$Constructor_name]["RomVersion"], "STRING: ");
+	        if ($str)
+	        	$RomVersion = str_replace("\"", "", $str);
+	        $str = get_snmp_value($oid[$Constructor_name]["SerialNumber"], "STRING: ");
+	        if ($str)
+	        	$SerialNumber = str_replace("\"", "", $str);
+	        $str = get_snmp_value($oid[$Constructor_name]["manufacturer"], "STRING: ");
+	        if ($str)
+	        	$Manufacturer = str_replace("\"", "", $str);
+    		} else {
+				$SwitchVersion = '';
+		        $RomVersion = '';
+		        $SerialNumber = '';
+		        $Manufacturer = '';
+    		}
+	    	$res =& $pearDB->query("SELECT * FROM inventory_index WHERE host_id = '".$r["host_id"]."'");
+			if (!$res->numRows()){
+				if (!isset($Constructor) || ($Constructor == 0 ))
+	        		$Constructor = "NULL";
+	        	else
+	            	$Constructor = "'".$Constructor."'";
+		        $res =& $pearDB->query(	"INSERT INTO `inventory_index` (`id`, `host_id`, `name`, `contact`, `description`, `location`, `manufacturer`, `serial_number`, `os`, `os_revision`, `type_ressources`) " .
+		                      			"VALUES ('', '".$r["host_id"]."', '".$sysName."', '".$sysContact."', '".$sysDescr."', '".$sysLocation."', '".$Manufacturer."', '".$SerialNumber."', '".$SwitchVersion."', '".$RomVersion."', ".$Constructor.")");
+		        if (PEAR::isError($res))
+		        	print ($res->getMessage());
+	    	} else
+	      		verify_data($r["host_id"]);
+    	} else {
+      		;
+    	}
+  	}
+	$end_time = microtime();
+	$time_len = $end_time - $begin_time;
+?>
diff --git a/www/modules/inventory/infosNetwork.ihtml b/www/modules/inventory/infosNetwork.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..28d84c579c256761b93b7ed13e3fc44bdd01484d
--- /dev/null
+++ b/www/modules/inventory/infosNetwork.ihtml
@@ -0,0 +1,104 @@
+<script type="text/javascript" src="include/configuration/changetab.js"></script>
+{$initJS}
+<div>
+<ul id="mainnav">
+	<li class="a" id='c1'><a href="#" onclick="javascript:montre('1');">{$sort1}</a></li>
+	<li class="b" id='c2'><a href="#" onclick="javascript:montre('2');">{$sort2}</a></li>
+	<li class="b" id='c3'><a href="#" onclick="javascript:montre('3');">{$sort3}</a></li>
+	<li class="b" id='c4'><a href="#" onclick="javascript:montre('4');">{$sort4}</a></li>
+</ul>
+</div>
+<div id='tab1' class='tab'>
+	 <table class="ListTable">
+	 	<tr class="list_one"><td class="ListColLeft">{$sysNamelabel} :</td><td class="ListColLeft">{$sysName}</td></tr>
+	 	<tr class="list_two"><td class="ListColLeft">{$sysDescrlabel} :</td><td class="ListColLeft">{ $sysDescr }</td></tr>
+	 	<tr class="list_one"><td class="ListColLeft">{$sysContactlabel} :</td><td class="ListColLeft">{$sysContact}</td></tr>
+	 	<tr class="list_two"><td class="ListColLeft">{$sysLocationlabel} : </td><td class="ListColLeft">{$sysLocation}</td></tr>
+	 	<tr class="list_one"><td class="ListColLeft">{$sysUpTimelabel} : </td><td class="ListColLeft">{$sysUpTime}</td></tr>
+	{ if $Health != 0 }
+	 	<tr class="list_two"><td class="ListColLeft">{$sysHealthlabel} :</td><td class="ListColLeft">{$Health}</td></tr>
+	{/if}
+	{ if $const == "hp" }
+	 	<tr class="list_one"><td class="ListColLeft">{$sysCPUStatlabel} :</td><td class="ListColLeft">{$CPUStat}</td></tr>
+	 	<tr class="list_two"><td class="ListColLeft">{$sysTelnetEnablelabel} : </td><td class="ListColLeft">{$TelnetEnable}</td></tr>
+	 	<tr class="list_one"><td class="ListColLeft">{$sysSSHEnablelabel} :</td><td class="ListColLeft">{ $enable[$SSHEnable] } ({$sysSSHPortlabel} : { $SSHPort }) &nbsp;</td></tr>
+	 	<tr class="list_two"><td class="ListColLeft">{$sysSerialNumberlabel} : </td><td class="ListColLeft">{$SerialNumber }</td></tr>
+	{/if}
+	 	<tr class="list_one"><td class="ListColLeft">{$sysManufacturerlabel} : </td><td class="ListColLeft">{$Manufacturer }</td></tr>
+	 	<!--<tr class="list_two"><td class="ListColLeft">{$sysSerieTypelabel} :</td><td class="ListColLeft">{$SerieType}</td></tr>-->
+	 	<tr class="list_one"><td class="ListColLeft">{$sysRomVersionlabel} : </td><td class="ListColLeft">{$RomVersion}</td></tr>
+	 	<tr class="list_two"><td class="ListColLeft">{$sysSwitchVersionlabel} : </td><td class="ListColLeft">{$SwitchVersion}</td></tr>
+	</table>
+</div>
+<div id='tab2' class='tab'>
+	 <table class="ListTable">
+{ foreach name=outer item=it from=$ifTab }
+	{if $it.type_interface == 1}
+		<tr class="ListHeader">
+			<td colspan="2">{ $it.ifDescr } ({$it.ifVlan})</td>
+			<td td colspan="2"> {$Statuslabel} : { $it.ifOperStatus } ({ $it.ifAdminStatus })&nbsp;</td>
+		</tr>
+		<tr class={$it.Color}>
+			<td> {$PhysAddresslabel} : </td>
+			<td>{ $it.ifPhysAddress }&nbsp;</td>
+			<td>IP Address : </td><td>{ $it.ipInterface }&nbsp;</td>
+		</tr>
+		<tr class={$it.Color}>
+			<td> {$Typelabel}:</td><td> { $it.ifType }</td>
+			<td>Speed :</td><td> {$it.ifSpeed }&nbsp;{$it.ifSpeedUnit}&nbsp;</td>
+		</tr>
+		<tr class={$it.Color}>
+			<td colspan="2"> {$Trafficlabel} - {$Inlabel} : { $it.ifInOctets }&nbsp; / {$Outlabel} : { $it.ifOutOctets }&nbsp;</td>
+			<td colspan="2">{$Errorlabel} - {$Inlabel} : { $it.ifInError }&nbsp; / {$Outlabel} : { $it.ifOutError }&nbsp;</td>
+		</tr>
+	{/if}
+{/foreach}
+</table>
+</div>
+<div id='tab3' class='tab'>
+	 <table class="ListTable">
+{ foreach name=outer item=it from=$ifTab }
+	{if $it.type_interface == 2}
+			<tr class="ListHeader">
+				<td colspan="2">{ $it.ifDescr }</td>
+				<td td colspan="2"> {$Statuslabel} : { $it.ifOperStatus } ({ $it.ifAdminStatus })&nbsp;</td>
+			</tr>
+			<tr class={$it.Color}>
+				<td> {$PhysAddresslabel} : </td>
+				<td>{ $it.ifPhysAddress }&nbsp;</td>
+				<td>IP Address : </td><td>{ $it.ipInterface }&nbsp;</td>
+			</tr>
+			<tr class={$it.Color}>
+				<td> {$Typelabel}:</td>
+				<td> { $it.ifType }</td>
+				<td>Speed :</td>
+				<td> {$it.ifSpeed }&nbsp;{$it.ifSpeedUnit}&nbsp;</td>
+			</tr>
+			<tr class={$it.Color}>
+				<td> {$Trafficlabel} - {$Inlabel} :{ $it.ifInOctets }&nbsp;</td>
+				<td> / {$Outlabel} : { $it.ifOutOctets }&nbsp;</td>
+				<td>{$Errorlabel}  {$Inlabel} : { $it.ifInError }&nbsp;</td>
+				<td> / {$Outlabel} : { $it.ifOutError }&nbsp;</td>
+			</tr>
+	{/if}
+{/foreach}
+</table>
+</div>
+<div id='tab4' class='tab'>
+	 <table class="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderLeft">{$Datelabel}</td>
+			<td class="ListColHeaderLeft">{$Objectlabel}</td>
+			<td class="ListColHeaderLeft">{$Beforelabel}</td>
+			<td class="ListColHeaderLeft">{$Afterlabel}</td>
+		</tr>
+	{ foreach name=outer item=la from=$log_array }
+		<tr class={cycle values="list_one,list_two"}>
+			<td class="ListColLeft">&nbsp;&nbsp;{ $la.ctime }</td>
+			<td class="ListColLeft">{ $la.type }</td>
+			<td class="ListColLeft">{$la.replaced_value}</td>
+			<td class="ListColLeft">{$la.value}</td>
+		</tr>
+	{ /foreach }
+	</table>
+</div>
\ No newline at end of file
diff --git a/www/modules/inventory/infosNetwork.php b/www/modules/inventory/infosNetwork.php
new file mode 100644
index 0000000000000000000000000000000000000000..1da2ead5c341139bca8a918eae5225ec84f030ec
--- /dev/null
+++ b/www/modules/inventory/infosNetwork.php
@@ -0,0 +1,287 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Inventory � is developped by Merethis company for Lafarge Group,
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the
+quality,safety, contents, performance, merchantability, non-infringement or
+suitability for any particular or intended purpose of the Software found on the OREON web
+site. In no event will OREON be liable for any direct, indirect, punitive,
+special, incidental or consequential damages however they may arise and even if OREON
+has been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!$oreon)
+		exit();
+
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+
+	isset($_GET["host_id"]) ? $hG = $_GET["host_id"] : $hG = NULL;
+	isset($_POST["host_id"]) ? $hP = $_POST["host_id"] : $hP = NULL;
+	$hG ? $host_id = $hG : $host_id = $hP;
+
+	!isset ($_GET["limit"]) ? $limit = 20 : $limit = $_GET["limit"];
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	isset($type) ? $type = $type : $type = "Server";
+
+	$t = microtime();
+
+	$enable = array("1" => $lang["yes"], "2" => $lang["no"]);
+
+	if (!$min)	{
+		# start quickSearch form
+		include_once("./include/common/quickSearch.php");
+		# end quickSearch form
+	}
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	if (isset($host_id))	{
+		include_once("./modules/inventory/inventory_oid_library.php");
+		include_once("./modules/inventory/inventory_library.php");
+
+		$timeout = 30 * 1000;
+	    $retries = 5;
+	    $ret =& $pearDB->query("SELECT host_address,host_snmp_community,host_snmp_version,host_template_model_htm_id FROM host WHERE host_id = '".$host_id."'");
+	    $r =& $ret->fetchRow();
+
+		if (!$r["host_snmp_community"]){
+			$community = getMySnmpCommunity($r["host_id"]);
+			if ($community == "")
+				$community = $oreon->optGen["snmp_community"];
+		} else
+			$community = $r["host_snmp_community"];
+
+		if (!$r["host_snmp_version"]){
+			$version = getMySnmpVersion($r["host_id"]);
+			if ($version == "")
+				$version = $oreon->optGen["snmp_version"];
+		} else 
+			$version = $r["host_snmp_version"];
+	    $address = $r["host_address"];
+
+	    $resData =& $pearDB->query("SELECT * FROM `inventory_index` WHERE host_id = '".$host_id."'");
+	    $rD =& $resData->fetchRow();
+
+		$tpl->assign("sort1", $lang["s_description"]);
+		$tpl->assign("sort2", $lang["s_network"]);
+		$tpl->assign("sort3", $lang["s_vlan"]);
+		$tpl->assign("sort4", $lang["s_changeLog"]);
+
+
+		$tpl->assign("sysName", $rD["name"]);
+		$tpl->assign("sysNamelabel", $lang["s_name"]);
+
+		$tpl->assign("sysDescr", $rD["description"]);
+		$tpl->assign("sysDescrlabel", $lang["s_description"]);
+
+		$tpl->assign("sysContact", $rD["contact"]);
+		$tpl->assign("sysContactlabel", $lang["s_contact"]);
+
+		$tpl->assign("sysLocation", $rD["location"]);
+		$tpl->assign("sysLocationlabel", $lang["s_location"]);
+
+		$sysUpTime =  get_snmp_value(".1.3.6.1.2.1.1.3.0", "STRING: ");
+		$tpl->assign("sysUpTime", $sysUpTime);
+		$tpl->assign("sysUpTimelabel", $lang["s_uptime"]);
+
+	    if ($sysUpTime || $rD["description"]) {
+
+	    	$change_value = array("NetRessource" => "1", "Server" => "2");
+	    	$tpl->assign("Type", $change_value[$type]);
+	    	$hp_status = array("1" => "unknown", "2" => "information", "3" => "ok", "4" => "warning", "5" => "critical", "6" => "nonrecoverable");
+
+	    	$constr =& $pearDB->query("SELECT name FROM inventory_manufacturer WHERE id = '".$rD["type_ressources"]."'");
+	    	$manufacturer =& $constr->fetchRow();
+	    	if (isset($oid[$manufacturer["name"]]["CPUStat"]))
+	    		$tpl->assign("CPUStat", get_snmp_value($oid[$manufacturer["name"]]["CPUStat"], "INTEGER: "));
+			$tpl->assign("sysCPUStatlabel", $lang["s_CPUStat"]);
+	    	if (isset($oid[$manufacturer["name"]]["TelnetEnabled"]))
+	    		$tpl->assign("TelnetEnable", $enable[get_snmp_value($oid[$manufacturer["name"]]["TelnetEnabled"], "INTEGER: ")]);
+			$tpl->assign("sysTelnetEnablelabel", $lang["s_TelnetEnable"]);
+	    	if (isset($oid[$manufacturer["name"]]["SSH"]))
+	    		$tpl->assign("SSHEnable", get_snmp_value($oid[$manufacturer["name"]]["SSH"], "INTEGER: "));
+			$tpl->assign("sysSSHEnablelabel", $lang["s_SSHEnable"]);
+	    	if (isset($oid[$manufacturer["name"]]["SSHPort"]))
+	    		$tpl->assign("SSHPort", get_snmp_value($oid[$manufacturer["name"]]["SSHPort"], "INTEGER: "));
+			$tpl->assign("sysSSHPortlabel", $lang["s_SSHPort"]);
+	    	if (isset($oid[$manufacturer["name"]]["SwitchVersion"]))
+	    		$tpl->assign("SwitchVersion", str_replace("\"", "", get_snmp_value($oid[$manufacturer["name"]]["SwitchVersion"], "STRING: ")));
+			$tpl->assign("sysSwitchVersionlabel", $lang["s_SwitchVersion"]);
+	    	if (isset($oid[$manufacturer["name"]]["RomVersion"]))
+	    		$tpl->assign("RomVersion", str_replace("\"", "", get_snmp_value($oid[$manufacturer["name"]]["RomVersion"], "STRING: ")));
+			$tpl->assign("sysRomVersionlabel", $lang["s_RomVersion"]);
+	    	if (isset($oid[$manufacturer["name"]]["SerialNumber"]))
+	    		$tpl->assign("SerialNumber", str_replace("\"", "", get_snmp_value($oid[$manufacturer["name"]]["SerialNumber"], "STRING: ")));
+			$tpl->assign("sysSerialNumberlabel", $lang["s_SerialNumber"]);
+	    	if (isset($oid[$manufacturer["name"]]["manufacturer"]))
+	    		$tpl->assign("Manufacturer", str_replace("\"", "", get_snmp_value($oid[$manufacturer["name"]]["manufacturer"], "STRING: ")));
+			$tpl->assign("sysManufacturerlabel", $lang["s_Manufacturer"]);
+	    	if (isset($oid[$manufacturer["name"]]["manufacturer"]))
+	    		$manufacturer_temp = str_replace("\"", "", get_snmp_value($oid[$manufacturer["name"]]["manufacturer"], "STRING: "));
+	    	if (!$manufacturer_temp)
+	    		$manufacturer_temp = $manufacturer["name"];
+		    $tpl->assign("Manufacturer", $manufacturer_temp);
+
+	    	$tab_unitO = array("0"=>"o", "1"=>"Ko","2"=>"Mo","3"=>"Go");
+	    	$tab_unitB = array("0"=>"bits", "1"=>"Kbits","2"=>"Mbits","3"=>"Gbits");
+
+	    	$ifTab = walk_snmp_value(".1.3.6.1.2.1.2.2.1.1", "INTEGER: ");
+		    if ($ifTab)
+			    foreach ($ifTab as $key => $it){
+			    	$ifTab[$key] = array();
+			    	$ifTab[$key]["ifIndex"] = $it;
+			    	$ifTab[$key]["ifDescr"] = get_snmp_value("1.3.6.1.2.1.2.2.1.2.".$it, "STRING: ");
+			    	$iftype = get_snmp_value("1.3.6.1.2.1.2.2.1.3.".$it, "INTEGER: ");
+			    	$r = preg_match("/([A-Za-z\-]*)\(?([0-9]+)\)?/", $iftype, $matches);
+			    	if (isset($ifType[$matches[2]]))
+				    	$ifTab[$key]["ifType"] = $ifType[$matches[2]];
+					else
+						$ifTab[$key]["ifType"] = "";
+			    	if (strstr(strtolower($ifTab[$key]["ifDescr"]), "vlan") || strstr(strtolower($ifTab[$key]["ifType"]), 'virtual'))
+			    		$ifTab[$key]["type_interface"] = 2;
+			    	else
+			    		$ifTab[$key]["type_interface"] = 1;
+			    	$ifTab[$key]["ifMtu"] = get_snmp_value("1.3.6.1.2.1.2.2.1.4.".$it, "INTEGER: ");
+
+			    	$tpl->assign("Statuslabel", $lang["s_status"]);
+					$tpl->assign("Outlabel", $lang["s_Out"]);
+					$tpl->assign("Inlabel", $lang["s_In"]);
+					$tpl->assign("errorlabel", $lang["s_Error"]);
+					$tpl->assign("PhysAddresslabel", $lang["s_PhysAddress"]);
+					$tpl->assign("Typelabel", $lang["s_Type"]);
+					$tpl->assign("Trafficlabel", $lang["s_traffic"]);
+					$tpl->assign("Errorlabel", $lang["s_pkt_error"]);
+
+			    	#
+			    	# Speed
+			    	#
+
+			    	$ifSpeed = get_snmp_value("1.3.6.1.2.1.2.2.1.5.".$it, "Gauge32: ");
+			    	for ($cpt = 0,$value = $ifSpeed; $value >= 1000 ; $value /= 1000)
+						$cpt++;
+					$ifTab[$key]["ifSpeed"] = $value;
+					$ifTab[$key]["ifSpeedUnit"] = $tab_unitB[$cpt];
+			    	$ifTab[$key]["ifPhysAddress"] = get_snmp_value("1.3.6.1.2.1.2.2.1.6.".$it, "STRING: ");
+
+			    	#
+			    	# In Octets
+			    	#
+
+			    	$ifinoctets = get_snmp_value("1.3.6.1.2.1.2.2.1.10.".$it, "Counter32: ");
+			    	for ($cpt = 0,$value = $ifinoctets; $value >= 1024 ; $value /= 1024)
+						$cpt++;
+					$ifTab[$key]["ifInOctets"] = round($value,2) . " " . $tab_unitO[$cpt];
+
+			    	#
+			    	# Out Octets
+			    	#
+
+			    	$ifoutoctets = get_snmp_value("1.3.6.1.2.1.2.2.1.16.".$it, "Counter32: ");
+			    	for ($cpt = 0,$value = $ifoutoctets; $value >= 1024 ; $value /= 1024)
+						$cpt++;
+					$ifTab[$key]["ifOutOctets"] = round($value,2) . " " . $tab_unitO[$cpt];
+
+					#
+					# Packets Errors
+					#
+
+					$ifTab[$key]["ifInError"] = get_snmp_value("1.3.6.1.2.1.2.2.1.14.".$it, "Counter32: ") . " Pkts";
+			    	$ifTab[$key]["ifOutError"] = get_snmp_value("1.3.6.1.2.1.2.2.1.20.".$it, "Counter32: ") . " Pkts";
+
+					$ifTab[$key]["ifAdminStatus"] = get_snmp_value("1.3.6.1.2.1.2.2.1.7.".$it, "INTEGER: ");
+			    	preg_match("/([A-Za-z\-]*)\(?([0-9]+)\)?/", $ifTab[$key]["ifAdminStatus"], $matches);
+			    	$ifTab[$key]["ifAdminStatus"] = $ifAdminStatus[$matches[2]];
+			    	$operstatus = get_snmp_value("1.3.6.1.2.1.2.2.1.8.".$it, "INTEGER: ");
+    			   	preg_match("/([A-Za-z\-]*)\(?([0-9]+)\)?/", $operstatus, $matches);
+			    	$ifTab[$key]["ifOperStatus"] = $ifOperStatus[$matches[2]];
+//			    	strstr($operstatus, "up") ? $ifTab[$key]["Color"] = "list_three" : $ifTab[$key]["Color"] = "list_four";
+					($matches[2] == 1 ) ? $ifTab[$key]["Color"] = "list_three" : $ifTab[$key]["Color"] = "list_four";
+			    	$ifTab[$key]["ifLastChange"] = get_snmp_value("1.3.6.1.2.1.2.2.1.6.".$it, "STRING: ");
+
+
+			    	#
+			    	# If Cisco regarder le port vers quel VLAN est rattach
+			    	# 1.3.6.1.4.1.9.9.68.1.2.2.1.2.
+			    	#
+			    	# pour HP 1.3.6.1.4.1.11.2.14.11.5.1.9.16.1.1.1. + id VLAN + id interface
+			    	# Mais id VLAN est different de celui de Iftable.
+			    	#
+			    }
+
+			    $tab_array_index = array();
+
+			    foreach ($ifTab as $key => $it)
+			    	$tab_array_index[$it["ifIndex"]] = $key;
+
+			    foreach ($ifTab as $key => $it){
+			    	if (isset($oid[$manufacturer["name"]]) && isset($oid[$manufacturer["name"]]["VlanAssign"]) &&  $oid[$manufacturer["name"]]["VlanAssign"]){
+			    		$returned_value = get_snmp_value($oid[$manufacturer["name"]]["VlanAssign"].$it["ifIndex"], "INTEGER: ");
+			    		$ifTab[$key]["ifVLan"] = $ifTab[$tab_array_index[$returned_value]]["ifDescr"];
+			    	}
+	   			}
+
+			    $ipInterface_data = walk_snmp_value("1.3.6.1.2.1.4.20.1.1", "IpAddress: ");
+			  	if ($ipInterface_data){
+			    	foreach ($ipInterface_data as $iI){
+			    		$index = get_snmp_value("1.3.6.1.2.1.4.20.1.2.".$iI, "INTEGER: ");
+			    		$ipInterface[$index] = array();
+			    		$ipInterface[$index]["ipIP"] = $iI;
+			    		$ipInterface[$index]["ipIndex"] = $index;
+			    		$ipInterface[$index]["ipNetMask"] = get_snmp_value("1.3.6.1.2.1.4.20.1.3.".$iI, "IpAddress: ");
+			    	}
+			    }
+
+	    		if (isset($ifTab))
+		    		foreach ($ifTab as $key => $it){
+		    			if (isset($ipInterface[$it["ifIndex"]]) && $ipInterface[$it["ifIndex"]]["ipIP"])
+				    		$ifTab[$key]["ipInterface"] = $ipInterface[$it["ifIndex"]]["ipIP"]."&nbsp;/&nbsp;".$ipInterface[$it["ifIndex"]]["ipNetMask"];
+				    	else
+				    		$ifTab[$key]["ipInterface"] = "Not Defined";
+		    		}
+			    $tpl->assign("ifTab", $ifTab);
+	    }
+	}
+
+	if (isset($host_id)){
+		$res =& $pearDB->query("SELECT ctime,replaced_value,value,type FROM inventory_log WHERE host_id = '".$host_id."' ORDER BY ctime DESC");
+		$log_array = array();
+		for ($cpt = 0; $r =& $res->fetchRow(); $cpt++){
+			$r["ctime"] = date("d/m/Y", $r["ctime"]);
+			$log_array[$cpt] = $r;
+		}
+		$tpl->assign("log_array", $log_array);
+	}
+
+	function get_snmp_value($oid, $replace_string){
+		global $address, $community, $timeout, $retries;
+		return str_replace($replace_string, '', @snmpget($address, $community, $oid, $timeout , $retries));
+	}
+
+	function walk_snmp_value($oid, $replace_string){
+		global $address, $community, $timeout, $retries;
+		$tab = @snmpwalk($address, $community, $oid, $timeout , $retries);
+		$cpt = 0;
+		if ($tab)
+			foreach ($tab as $t){
+				$tab_ret[$cpt] = str_replace($replace_string, '', $t);
+				$cpt++;
+			}
+		return $tab_ret;
+	}
+
+	if (isset($tpl) && $host_id && $sysUpTime)
+		$tpl->display('infosNetwork.ihtml');
+	else
+		print $lang['profile_error_snmp'];
+
+?>
diff --git a/www/modules/inventory/infosServer.ihtml b/www/modules/inventory/infosServer.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..3be57a85f364567d46376220d950c706b89ba6a8
--- /dev/null
+++ b/www/modules/inventory/infosServer.ihtml
@@ -0,0 +1,115 @@
+<script type="text/javascript" src="include/configuration/changetab.js"></script>
+{$initJS}
+
+<div>
+<ul id="mainnav">
+	<li class="a" id='c1'><a href="#" onclick="javascript:montre('1');">{$sort1}</a></li>
+	<li class="b" id='c2'><a href="#" onclick="javascript:montre('2');">{$sort2}</a></li>
+	<li class="b" id='c3'><a href="#" onclick="javascript:montre('3');">{$sort3}</a></li>
+	<li class="b" id='c4'><a href="#" onclick="javascript:montre('4');">{$sort4}</a></li>
+	<li class="b" id='c5'><a href="#" onclick="javascript:montre('5');">{$sort5}</a></li>
+	<li class="b" id='c6'><a href="#" onclick="javascript:montre('6');">{$sort6}</a></li>
+</ul>
+</div>
+
+<div id='tab1' class='tab'>
+	 <table class="ListTable">
+	 	<tr class="list_one"><td class="ListColLeft">{$sysNamelabel} :</td><td class="ListColLeft">{$sysName}</td></tr>
+	 	<tr class="list_two"><td class="ListColLeft">{$sysDescrlabel} :</td><td class="ListColLeft">{ $sysDescr }</td></tr>
+	 	<tr class="list_one"><td class="ListColLeft">{$sysContactlabel} :</td><td class="ListColLeft">{$sysContact}</td></tr>
+	 	<tr class="list_two"><td class="ListColLeft">{$sysLocationlabel} : </td><td class="ListColLeft">{$sysLocation}</td></tr>
+	 	<tr class="list_one"><td class="ListColLeft">{$sysUpTimelabel} : </td><td class="ListColLeft">{$sysUpTime}</td></tr>
+	</table>
+</div>
+
+<div id='tab2' class='tab'>
+	 <table class="ListTable">
+{ foreach name=outer item=it from=$ifTab }
+		<tr class="ListHeader">
+			<td colspan="2">{ $it.ifDescr }</td><td td colspan="2"> {$Statuslabel} : { $it.ifOperStatus } ({ $it.ifAdminStatus })&nbsp;</td>
+		</tr>
+		<tr class={$it.Color}>
+			<td> {$PhysAddresslabel} : </td><td>{ $it.ifPhysAddress }&nbsp;</td><td>IP Address : </td><td>{ $it.ipInterface }&nbsp;</td>
+		</tr>
+		<tr class={$it.Color}>
+			<td> {$Typelabel}:</td><td> { $it.ifType }</td><td>Speed :</td><td> {$it.ifSpeed }&nbsp;{$it.ifSpeedUnit}&nbsp;</td>
+		</tr>
+		<tr class={$it.Color}>
+			<td colspan='2'> {$Trafficlabel} - {$Inlabel} : { $it.ifInOctets }&nbsp; / {$Outlabel} : { $it.ifOutOctets }&nbsp;</td>
+			<td colspan='2'>{$Errorlabel}  {$Inlabel} : { $it.ifInError }&nbsp; / {$Outlabel} : { $it.ifOutError }&nbsp;</td>
+		</tr>
+{/foreach }
+</table>
+</div>
+<div id='tab3' class='tab'>
+	 <table class="ListTable">
+	<tr class="ListHeader">
+		<td class="ListColHeaderLeft">{$mntPointlabel}</td>
+		<td class="ListColHeaderLeft">{$Typelabel}</td>
+		<td class="ListColHeaderLeft">{$Utilisationlabel}</td>
+		<td class="ListColHeaderLeft">{$Freelabel}</td>
+		<td class="ListColHeaderLeft">{$Usedlabel}</td>
+		<td class="ListColHeaderLeft">{$Sizelabel}</td>
+	</tr>
+{ foreach name=outer item=si from=$hrStorageIndex }
+	<tr class={cycle values="list_one,list_two"}>
+		<td class="ListColLeft">{ $si.hsStorageDescr }</td>
+		<td class="ListColLeft">{ $si.hsStorageType } {if $si.hsFSBootable == "true(1)"} (Bootable) {/if}</td>
+		<td class="ListColLeft">{if $si.hsStorageUsedPercent}<img height="10" src="./include/options/sysInfos/templates/classic/images/{if $si.hsStorageUsedPercent >= 85}red{/if}bar_left.gif" alt=""><img height="10" src="./include/options/sysInfos/templates/classic/images/{if $si.hsStorageUsedPercent >= 85}red{/if}bar_middle.gif" width="{$si.hsStorageUsedlen}" alt=""><img height="10" src="./include/options/sysInfos/templates/classic/images/{if $si.hsStorageUsedPercent >= 85}red{/if}bar_right.gif" alt="">&nbsp;&nbsp;{$si.hsStorageUsedPercent}% {/if}</td>
+		<td class="ListColLeft">{if $si.hsStorageFree}{$si.hsStorageFree}{/if}</td>
+		<td class="ListColLeft">{if $si.hsStorageUsed}{$si.hsStorageUsed}{/if}</td>
+		<td class="ListColLeft">{if $si.hsStorageSize}{$si.hsStorageSize}{/if}</td>
+	</tr>
+{/foreach}
+</table>
+</div>
+<div id='tab4' class='tab'>
+	 <table class="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderLeft">{$Softwarelabel}</td>
+			<td class="ListColHeaderLeft">{$Typelabel}</td>
+		</tr>
+	{ foreach name=outer item=swi from=$hrSWInstalled }
+		{if $swi.hrSWInstalledName != "" }
+		<tr class={cycle values="list_one,list_two"}>
+			<td class="ListColLeft">{ $swi.hrSWInstalledName }</td>
+			<td class="ListColLeft">{ $swi.hrSWInstalledType }</td>
+		</tr>
+		{/if}
+	{ /foreach }
+	</table>
+</div>
+<div id='tab5' class='tab'>
+	 <table class="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderLeft">{$Softwarelabel}</td>
+			<td class="ListColHeaderLeft">{$MermoryUsedlabel}</td>
+			<td class="ListColHeaderLeft">{$Pathlabel}</td>
+		</tr>
+	{ foreach name=outer item=swr from=$hrSWRun }
+		<tr class={cycle values="list_one,list_two"}>
+			<td class="ListColLeft">&nbsp;&nbsp;{ $swr.hrSWRunName }</td>
+			<td class="ListColLeft">{ $swr.hrSWRunPerfMem }</td>
+			<td class="ListColLeft">{ $swr.hrSWRunPath } {if $swr.hrSWRunParameters} {$swr.hrSWRunParameters} {/if}</td>
+		</tr>
+	{ /foreach }
+	</table>
+</div>
+<div id='tab6' class='tab'>
+	 <table class="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderLeft">{$Datelabel}</td>
+			<td class="ListColHeaderLeft">{$Objectlabel}</td>
+			<td class="ListColHeaderLeft">{$Beforelabel}</td>
+			<td class="ListColHeaderLeft">{$Afterlabel}</td>
+		</tr>
+	{ foreach name=outer item=la from=$log_array }
+		<tr class={cycle values="list_one,list_two"}>
+			<td class="ListColLeft">&nbsp;&nbsp;{ $la.ctime }</td>
+			<td class="ListColLeft">{ $la.type }</td>
+			<td class="ListColLeft">{$la.replaced_value}</td>
+			<td class="ListColLeft">{$la.value}</td>
+		</tr>
+	{ /foreach }
+	</table>
+</div>
\ No newline at end of file
diff --git a/www/modules/inventory/infosServer.php b/www/modules/inventory/infosServer.php
new file mode 100644
index 0000000000000000000000000000000000000000..84f0d6bdc1519edf4d1e08200f22e62d18f051d0
--- /dev/null
+++ b/www/modules/inventory/infosServer.php
@@ -0,0 +1,347 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called « Oreon Inventory » is developped by Merethis company for Lafarge Group,
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to thequality,
+safety, contents, performance, merchantability, non-infringement or
+suitability for any particular or intended purpose of the Software found on the OREON web
+site. In no event will OREON be liable for any direct, indirect, punitive,
+special, incidental or consequential damages however they may arise and even if OREON
+has been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!$oreon)
+		exit();
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+
+	isset($_GET["host_id"]) ? $hG = $_GET["host_id"] : $hG = NULL;
+	isset($_POST["host_id"]) ? $hP = $_POST["host_id"] : $hP = NULL;
+	$hG ? $host_id = $hG : $host_id = $hP;
+
+	!isset ($_GET["limit"]) ? $limit = 20 : $limit = $_GET["limit"];
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+	isset($type) ? $type = $type : $type = "Server";
+
+	$t = microtime();
+
+	$enable = array("1" => $lang["yes"], "2" => $lang["no"]);
+
+	if (!$min)	{
+		# start quickSearch form
+		include_once("./include/common/quickSearch.php");
+		# end quickSearch form
+	}
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	if (isset($host_id))	{
+		include_once("./modules/inventory/inventory_oid_library.php");
+		include_once("./modules/inventory/inventory_library.php");
+
+		$timeout = 100 * 1000;
+	    $retries = 10;
+	    $ret =& $pearDB->query("SELECT host_id,host_address,host_snmp_community,host_snmp_version,host_template_model_htm_id FROM host WHERE host_id = '".$host_id."'");
+	    $r =& $ret->fetchRow();
+
+		if (!$r["host_snmp_community"]){
+			$community = getMySnmpCommunity($r["host_id"]);
+			if ($community == "")
+				$community = $oreon->optGen["snmp_community"];
+		} else
+			$community = $r["host_snmp_community"];
+
+		if (!$r["host_snmp_version"]){
+			$version = getMySnmpVersion($r["host_id"]);
+			if ($version == "")
+				$version = $oreon->optGen["snmp_version"];
+		} else 
+			$version = $r["host_snmp_version"];
+
+	    $address = $r["host_address"];
+
+	  	//$community = $r["host_snmp_community"];
+		//$version = $r["host_snmp_version"];
+
+	    $resData =& $pearDB->query("SELECT * FROM `inventory_index` WHERE host_id = '".$host_id."'");
+	    $rD =& $resData->fetchRow();
+
+		$tpl->assign("sort1", $lang["s_description"]);
+		$tpl->assign("sort2", $lang["s_network"]);
+		$tpl->assign("sort3", $lang["s_storageDevice"]);
+		$tpl->assign("sort4", $lang["s_softwareInstalled"]);
+		$tpl->assign("sort5", $lang["s_runningProcessus"]);
+		$tpl->assign("sort6", $lang["s_changeLog"]);
+
+
+		$tpl->assign("sysName", $rD["name"]);
+		$tpl->assign("sysNamelabel", $lang["s_name"]);
+
+		$tpl->assign("sysDescr", $rD["description"]);
+		$tpl->assign("sysDescrlabel", $lang["s_description"]);
+
+		$tpl->assign("sysContact", $rD["contact"]);
+		$tpl->assign("sysContactlabel", $lang["s_contact"]);
+
+		$tpl->assign("sysLocation", $rD["location"]);
+		$tpl->assign("sysLocationlabel", $lang["s_location"]);
+
+		$sysUpTime =  get_snmp_value(".1.3.6.1.2.1.1.3.0", "STRING: ");
+		$tpl->assign("sysUpTime", $sysUpTime);
+		$tpl->assign("sysUpTimelabel", $lang["s_uptime"]);
+
+	    if ($sysUpTime /*|| $rD["description"]*/) {
+
+	    	//$tpl->assign("Type", $change_value[$type]);
+	    	$tab_unit = array("0"=>"bits", "1"=>"Kbits","2"=>"Mbits","3"=>"Gbits");
+
+	    	$ifTab = walk_snmp_value(".1.3.6.1.2.1.2.2.1.1", "INTEGER: ");
+		    if ($ifTab)
+			    foreach ($ifTab as $key => $it){
+			    	$ifTab[$key] = array();
+			    	$ifTab[$key]["ifIndex"] = $it;
+			    	$ifTab[$key]["ifDescr"] = htmlentities($lang["s_interface"]." : ".get_snmp_value("1.3.6.1.2.1.2.2.1.2.".$it, "STRING: "));
+			    	$iftype = get_snmp_value("1.3.6.1.2.1.2.2.1.3.".$it, "INTEGER: ");
+			    	$r = preg_match("/([A-Za-z\-]*)\(?([0-9]+)\)?/", $iftype, $matches);
+			    	if (isset($ifType[$matches[2]]) && $ifType[$matches[2]])
+				    	$ifTab[$key]["ifType"] = $ifType[$matches[2]];
+			    	else
+			    		$ifTab[$key]["ifType"] = "";
+			    	$ifTab[$key]["ifMtu"] = get_snmp_value("1.3.6.1.2.1.2.2.1.4.".$it, "INTEGER: ");
+
+					$tpl->assign("Statuslabel", $lang["s_status"]);
+					$tpl->assign("Outlabel", $lang["s_Out"]);
+					$tpl->assign("Inlabel", $lang["s_In"]);
+					$tpl->assign("errorlabel", $lang["s_Error"]);
+					$tpl->assign("PhysAddresslabel", $lang["s_PhysAddress"]);
+					$tpl->assign("Typelabel", $lang["s_Type"]);
+			    	$tpl->assign("Trafficlabel", $lang["s_traffic"]);
+					$tpl->assign("Errorlabel", $lang["s_pkt_error"]);
+			    	/*
+			    	 * Speed
+			    	 */
+
+			    	$ifSpeed = get_snmp_value("1.3.6.1.2.1.2.2.1.5.".$it, "Gauge32: ");
+			    	for ($cpt = 0,$value = $ifSpeed; $value >= 1000 ; $value /= 1000)
+						$cpt++;
+					$ifTab[$key]["ifSpeed"] = $value;
+					$ifTab[$key]["ifSpeedUnit"] = $tab_unit[$cpt];
+			    	$ifTab[$key]["ifPhysAddress"] = get_snmp_value("1.3.6.1.2.1.2.2.1.6.".$it, "STRING: ");
+
+			    	/*
+			    	 * In Octets
+			    	 */
+
+			    	$ifinoctets = get_snmp_value("1.3.6.1.2.1.2.2.1.10.".$it, "Counter32: ");
+			    	for ($cpt = 0,$value = $ifinoctets; $value >= 1024 ; $value /= 1024)
+						$cpt++;
+					$ifTab[$key]["ifInOctets"] = round($value,2) . " " . $tab_unit[$cpt];
+
+			    	/*
+			    	 * Out Octets
+			    	 */
+
+			    	$ifoutoctets = get_snmp_value("1.3.6.1.2.1.2.2.1.16.".$it, "Counter32: ");
+			    	for ($cpt = 0,$value = $ifoutoctets; $value >= 1024 ; $value /= 1024)
+						$cpt++;
+					$ifTab[$key]["ifOutOctets"] = round($value,2) . " " . $tab_unit[$cpt];
+
+					/*
+					 * Packets Errors
+					 */
+
+					$ifTab[$key]["ifInError"] = get_snmp_value("1.3.6.1.2.1.2.2.1.14.".$it, "Counter32: ") . " Pkts";
+			    	$ifTab[$key]["ifOutError"] = get_snmp_value("1.3.6.1.2.1.2.2.1.20.".$it, "Counter32: ") . " Pkts";
+
+					$ifTab[$key]["ifAdminStatus"] = get_snmp_value("1.3.6.1.2.1.2.2.1.7.".$it, "INTEGER: ");
+			    	preg_match("/([A-Za-z\-]*)\(?([0-9]+)\)?/", $ifTab[$key]["ifAdminStatus"], $matches);
+			    	$ifTab[$key]["ifAdminStatus"] = $ifAdminStatus[$matches[2]];
+			    	$operstatus = get_snmp_value("1.3.6.1.2.1.2.2.1.8.".$it, "INTEGER: ");
+			    	preg_match("/([A-Za-z\-]*)\(?([0-9]+)\)?/", $operstatus, $matches);
+			    	$ifTab[$key]["ifOperStatus"] = $ifOperStatus[$matches[2]];
+//			    	strstr($operstatus, "up") ? $ifTab[$key]["Color"] = "list_three" : $ifTab[$key]["Color"] = "list_four";
+					($matches[2] == 1 ) ? $ifTab[$key]["Color"] = "list_three" : $ifTab[$key]["Color"] = "list_four";
+			    	$ifTab[$key]["ifLastChange"] = get_snmp_value("1.3.6.1.2.1.2.2.1.6.".$it, "STRING: ");
+
+			    }
+
+			    $ipInterface_data = walk_snmp_value("1.3.6.1.2.1.4.20.1.1", "IpAddress: ");
+			  	if ($ipInterface_data){
+			    	foreach ($ipInterface_data as $iI){
+			    		$index = get_snmp_value("1.3.6.1.2.1.4.20.1.2.".$iI, "INTEGER: ");
+			    		$ipInterface[$index] = array();
+			    		$ipInterface[$index]["ipIP"] = $iI;
+			    		$ipInterface[$index]["ipIndex"] = $index;
+			    		$ipInterface[$index]["ipNetMask"] = get_snmp_value("1.3.6.1.2.1.4.20.1.3.".$iI, "IpAddress: ");
+			    	}
+			    }
+
+	    		if (isset($ifTab))
+		    		foreach ($ifTab as $key => $it){
+		    			if (isset($ipInterface[$it["ifIndex"]]) && $ipInterface[$it["ifIndex"]]["ipIP"])
+				    		$ifTab[$key]["ipInterface"] = $ipInterface[$it["ifIndex"]]["ipIP"]."&nbsp;/&nbsp;".$ipInterface[$it["ifIndex"]]["ipNetMask"];
+				    	else
+				    		$ifTab[$key]["ipInterface"] = "Not Defined";
+		    		}
+
+			    $tpl->assign("ifTab", $ifTab);
+
+				$tab_unit = array("0" => "o", "1" => "Ko","2" => "Mo","3" => "Go","4" => "To");
+
+			    $hrStorageIndex = walk_snmp_value(".1.3.6.1.2.1.25.2.3.1.1", "INTEGER: ");
+
+
+				$tpl->assign("mntPointlabel",$lang["s_mntPoint"]);
+				$tpl->assign("Typelabel",$lang["s_Type"]);
+				$tpl->assign("Utilisationlabel",$lang["s_Utilisation"]);
+				$tpl->assign("Freelabel",$lang["s_Free"]);
+				$tpl->assign("Usedlabel",$lang["s_Used"]);
+				$tpl->assign("Sizelabel",$lang["s_Size"]);
+
+
+
+			    if ($hrStorageIndex)
+				    foreach ($hrStorageIndex as $key => $SI){
+				    	$hrStorageIndex[$key] = array();
+				    	$hrStorageIndex[$key]["Index"] = $SI;
+				    	$hrStorageIndex[$key]["hsStorageSize"] = get_snmp_value("1.3.6.1.2.1.25.2.3.1.4.".$SI, "INTEGER: ");
+				    	if ($hrStorageIndex[$key]["hsStorageSize"] != 256){
+				    		$hrStorageIndex[$key]["hsStorageType"] = get_snmp_value("1.3.6.1.2.1.25.2.3.1.2.".$SI, "OID: HOST-RESOURCES-TYPES::");
+				    		if (!strcmp($hrStorageIndex[$key]["hsStorageType"], "hrStorageFixedDisk")){
+			    				$hrStorageIndex[$key]["hrFSAccess"] = get_snmp_value("1.3.6.1.2.1.25.3.8.1.5.".$SI, "INTEGER: ");
+			    				$hrStorageIndex[$key]["hrFSBootable"] = get_snmp_value("1.3.6.1.2.1.25.3.8.1.6.".$SI, "INTEGER: ");
+				    			$hrStorageIndex[$key]["hsFSType"] = get_snmp_value("1.3.6.1.2.1.25.3.8.1.4.".$SI, "OID: HOST-RESOURCES-TYPES::");
+					    		$hrStorageIndex[$key]["hsFSBootable"] = get_snmp_value("1.3.6.1.2.1.25.3.8.1.6.".$SI, "INTEGER: ");
+				    		}
+				    		$hrStorageIndex[$key]["hsStorageDescr"] = get_snmp_value("1.3.6.1.2.1.25.2.3.1.3.".$SI, "STRING: ");
+				    		$block = get_snmp_value("1.3.6.1.2.1.25.2.3.1.4.".$SI, "INTEGER: ");
+					    	$hrStorageIndex[$key]["hsStorageSize"] = $block * get_snmp_value("1.3.6.1.2.1.25.2.3.1.5.".$SI, "INTEGER: ");
+					    	$hrStorageIndex[$key]["hsStorageUsed"] = $block * get_snmp_value("1.3.6.1.2.1.25.2.3.1.6.".$SI, "INTEGER: ");
+					    	$hrStorageIndex[$key]["hsStorageFree"] = $hrStorageIndex[$key]["hsStorageSize"] - $hrStorageIndex[$key]["hsStorageUsed"];
+					    	if ($hrStorageIndex[$key]["hsStorageSize"]){
+						    	$hrStorageIndex[$key]["hsStorageUsedPercent"] =  round($hrStorageIndex[$key]["hsStorageUsed"] / $hrStorageIndex[$key]["hsStorageSize"] * 100);
+						    	$hrStorageIndex[$key]["hsStorageUsedlen"] = $hrStorageIndex[$key]["hsStorageUsedPercent"] * 2;
+						    	$hrStorageIndex[$key]["hsStorageNotUsedlen"] = 200 - ($hrStorageIndex[$key]["hsStorageUsedPercent"] * 2);
+					    	}
+					    	if 	($hrStorageIndex[$key]["hsStorageSize"]){
+						    	for ($cpt = 0; $hrStorageIndex[$key]["hsStorageSize"] >= 1024; $cpt++)
+						    		$hrStorageIndex[$key]["hsStorageSize"] /= 1024;
+						    	$hrStorageIndex[$key]["hsStorageSize"] = round($hrStorageIndex[$key]["hsStorageSize"], 2) . " " . $tab_unit[$cpt];
+					    	}
+					    	if 	($hrStorageIndex[$key]["hsStorageUsed"]){
+						    	for ($cpt = 0; $hrStorageIndex[$key]["hsStorageUsed"] >= 1024; $cpt++)
+						    		$hrStorageIndex[$key]["hsStorageUsed"] /= 1024;
+						    	$hrStorageIndex[$key]["hsStorageUsed"] = round($hrStorageIndex[$key]["hsStorageUsed"], 2) ." " . $tab_unit[$cpt];
+				    		}
+					    	if 	($hrStorageIndex[$key]["hsStorageFree"]){
+						    	for ($cpt = 0; $hrStorageIndex[$key]["hsStorageFree"] >= 1024; $cpt++)
+						    		$hrStorageIndex[$key]["hsStorageFree"] /= 1024;
+						    	$hrStorageIndex[$key]["hsStorageFree"] = round($hrStorageIndex[$key]["hsStorageFree"], 2) ." " . $tab_unit[$cpt];
+					    	}
+					    }
+				    }
+
+			    $tpl->assign("hrStorageIndex", $hrStorageIndex);
+
+			    $hrDeviceIndex = walk_snmp_value("1.3.6.1.2.1.25.3.2.1.1", "INTEGER: ");
+			    if ($hrDeviceIndex)
+				    foreach ($hrDeviceIndex as $key => $SD){
+				    	$hrDeviceIndex[$key] = array();
+				    	$hrDeviceIndex[$key]["Index"] = $SD;
+				    	$hrDeviceIndex[$key]["hsDeviceType"] = get_snmp_value("1.3.6.1.2.1.25.3.2.1.2.".$SD, "OID: HOST-RESOURCES-TYPES::");
+			    		if (!strcmp($hrDeviceIndex[$key]["hsDeviceType"], "hrDeviceDiskStorage")){
+			    			// Disk de Stockage
+			    			$hrDeviceIndex[$key]["hrDiskStorageAccess"] = get_snmp_value("1.3.6.1.2.1.25.3.6.1.1.".$SD, "INTEGER: ");
+			    			$hrDeviceIndex[$key]["hrDiskStorageMedia"] = get_snmp_value("1.3.6.1.2.1.25.3.6.1.2.".$SD, "INTEGER: ");
+			    			$hrDeviceIndex[$key]["hrDiskStorageRemovable"] = get_snmp_value("1.3.6.1.2.1.25.3.6.1.3.".$SD, "INTEGER: ");
+			    		}
+				    }
+			    $tpl->assign("hrDeviceIndex", $hrDeviceIndex);
+
+				$tpl->assign("Softwarelabel",$lang["s_Software"]);
+				$tpl->assign("MermoryUsedlabel",$lang["s_MermoryUsed"]);
+				$tpl->assign("Pathlabel",$lang["s_Path"]);
+
+
+
+			    $hrSWRun = walk_snmp_value("1.3.6.1.2.1.25.4.2.1.1", "INTEGER: ");
+			    if ($hrSWRun)
+				    foreach ($hrSWRun as $key => $SWR){
+				    	$hrSWRun[$key] = array();
+				    	$hrSWRun[$key]["Index"] = $SWR;
+				    	$hrSWRun[$key]["hrSWRunName"] =  str_replace("\"", "", get_snmp_value("1.3.6.1.2.1.25.4.2.1.2.".$SWR, "STRING: "));
+				    	$hrSWRun[$key]["hrSWRunPath"] =  str_replace("\"", "", get_snmp_value("1.3.6.1.2.1.25.4.2.1.4.".$SWR, "STRING: "));
+				    	//$hrSWRun[$key]["hrSWRunParameters"] = get_snmp_value("1.3.6.1.2.1.25.4.2.1.5.".$SWR, "STRING: ");
+				    	//$hrSWRun[$key]["hrSWRunType"] = get_snmp_value("1.3.6.1.2.1.25.4.2.1.6.".$SWR, "INTEGER: ");
+				    	//$hrSWRun[$key]["hrSWRunStatus"] = get_snmp_value("1.3.6.1.2.1.25.4.2.1.7.".$SWR, "INTEGER: ");
+				    	//$hrSWRun[$key]["hrSWRunPerfCPU"] = get_snmp_value("1.3.6.1.2.1.25.5.1.1.1.".$SWR, "INTEGER: ");
+				    	$hrSWRun[$key]["hrSWRunPerfMem"] = get_snmp_value("1.3.6.1.2.1.25.5.1.1.2.".$SWR, "INTEGER: ");
+				    }
+				$tpl->assign("hrSWRun", $hrSWRun);
+
+			   	$hrSWInstalled = walk_snmp_value("1.3.6.1.2.1.25.6.3.1.1", "INTEGER: ");
+			   	$hrSWInstalledName = walk_snmp_value("1.3.6.1.2.1.25.6.3.1.2", "STRING: ");
+			   	$hrSWInstalledType = walk_snmp_value("1.3.6.1.2.1.25.6.3.1.4", "INTEGER: ");
+			   	if ($hrSWInstalled)
+					foreach ($hrSWInstalled as $key => $SWI){
+				    	$hrSWInstalled[$key] = array();
+				    	$hrSWInstalled[$key]["Index"] = $SWI;
+				    	if (isset($hrSWInstalledName[$key]) && !strstr($hrSWInstalledName[$key], "Hex-")){
+				    		$hrSWInstalled[$key]["hrSWInstalledName"] = str_replace("\"", "", $hrSWInstalledName[$key]);
+				    	}
+				    	isset($hrSWInstalled[$key]["hrSWInstalledType"]) ? $hrSWInstalled[$key]["hrSWInstalledType"] = $hrSWInstalledType[$key] : NULL;
+					}
+				$tpl->assign("hrSWInstalled", $hrSWInstalled);
+
+				$tpl->assign("Datelabel",$lang["s_Date"]);
+				$tpl->assign("Objectlabel",$lang["s_Object"]);
+				$tpl->assign("Beforelabel",$lang["s_Before"]);
+				$tpl->assign("Afterlabel",$lang["s_After"]);
+
+
+	    }
+
+	}
+	if ($host_id){
+		$res =& $pearDB->query("SELECT ctime,replaced_value,value,type FROM inventory_log WHERE host_id = '".$host_id."' ORDER BY ctime DESC");
+		$log_array = array();
+		for ($cpt = 0; $r =& $res->fetchRow(); $cpt++){
+			$r["ctime"] = date("d/m/Y", $r["ctime"]);
+			$log_array[$cpt] = $r;
+		}
+		$tpl->assign("log_array", $log_array);
+	}
+
+	function get_snmp_value($oid, $replace_string){
+		global $address, $community, $timeout, $retries;
+		return str_replace($replace_string, '', @snmpget($address, $community, $oid, $timeout , $retries));
+	}
+
+	function walk_snmp_value($oid, $replace_string){
+		$tab_ret = array();
+		global $address, $community, $timeout, $retries;
+		$tab = @snmpwalk($address, $community, $oid, $timeout , $retries);
+		$cpt = 0;
+		if ($tab)
+			foreach ($tab as $t){
+				$tab_ret[$cpt] = str_replace($replace_string, '', $t);
+				$cpt++;
+			}
+		return $tab_ret;
+	}
+
+	if (isset($tpl) && $host_id && $sysUpTime)
+		$tpl->display("infosServer.ihtml");
+	else
+		print $lang['profile_error_snmp'];
+?>
\ No newline at end of file
diff --git a/www/modules/inventory/inventory.php b/www/modules/inventory/inventory.php
new file mode 100644
index 0000000000000000000000000000000000000000..ff2731659823d530e065018df7e4ade5ade9340f
--- /dev/null
+++ b/www/modules/inventory/inventory.php
@@ -0,0 +1,72 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called « Oreon Inventory » is developped by Merethis company for Lafarge Group,
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the
+quality,
+safety, contents, performance, merchantability, non-infringement or
+suitability for
+any particular or intended purpose of the Software found on the OREON web
+site.
+In no event will OREON be liable for any direct, indirect, punitive,
+special,
+incidental or consequential damages however they may arise and even if OREON
+has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+
+	isset($_GET["host_id"]) ? $hG = $_GET["host_id"] : $hG = NULL;
+	isset($_POST["host_id"]) ? $hP = $_POST["host_id"] : $hP = NULL;
+	$hG ? $host_id = $hG : $host_id = $hP;
+
+	#Pear library
+	require_once "HTML/QuickForm.php";
+	require_once 'HTML/QuickForm/advmultiselect.php';
+	require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+
+	#Path to the configuration dir
+	global $path;
+	$path = "./modules/inventory/";
+
+	#PHP functions
+	require_once $path."DB-Func.php";
+	require_once "./include/common/common-Func.php";
+
+	if ($o == "q")	{
+		$res =& $pearDB->query("SELECT type_ressources FROM inventory_index WHERE host_id = '".$host_id."'");
+		if ($res->numRows())	{
+			$host =& $res->fetchRow();
+			$host["type_ressources"] ? $o = "o" : $o = "t";
+		}
+		else
+			$o = "b";
+		$res->free();
+	}
+
+	switch ($o)	{
+		case "u" : require_once($path."inventoryUpdate.php"); break; #Update Inventory
+
+		case "t" : require_once($path."infosServer.php"); break; #Watch  server
+		case "o" : require_once($path."infosNetwork.php"); break; #Watch  network
+
+		case "b" : require_once($path."inventoryBlanck.php"); break; #No ID Card
+
+		case "s" : require_once($path."listServer.php"); break; #list of server
+		case "n" : require_once($path."listNetwork.php"); break; #list of network
+
+		case "c" : change_manufacturer(isset($_GET["select"]) ? $_GET["select"]: array() , $_GET["select_manufacturer"]); require_once($path."listServer.php"); break; #change manufacturer
+		case "d" : change_manufacturer(isset($_GET["select"]) ? $_GET["select"]: array(), $_GET["select_manufacturer"]); require_once($path."listNetwork.php"); break; #change manufacturer
+		default : require_once($path."listServer.php"); break;
+	}
+?>
\ No newline at end of file
diff --git a/www/modules/inventory/inventoryBlanck.php b/www/modules/inventory/inventoryBlanck.php
new file mode 100644
index 0000000000000000000000000000000000000000..d08b293a9b1454c1525af0527f864d58659e2ce5
--- /dev/null
+++ b/www/modules/inventory/inventoryBlanck.php
@@ -0,0 +1,22 @@
+<?
+/** 
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset($oreon))
+		exit();
+	
+	echo "<div class='msg' align='center'>".$lang["s_notAvl"]."</div>";
+?>
diff --git a/www/modules/inventory/inventoryUpdate.ihtml b/www/modules/inventory/inventoryUpdate.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..7c13af88eda9234be2e0e688b2067f0806c9df50
--- /dev/null
+++ b/www/modules/inventory/inventoryUpdate.ihtml
@@ -0,0 +1,15 @@
+<script type="text/javascript" src="include/common/javascript/functions.js"></script>
+	 <table id="ListTable">
+	 	<tr class="ListHeader"><td class="FormHeader" colspan="2"><img src='./img/icones/16x16/wrench.gif'>&nbsp;&nbsp;{$form.header.title}</td></tr>
+		<tr class="list_one">
+			<td class="FormRowField">{$form.inventory.label}</td>
+			<td class="FormRowValue">
+				<div id='inventory'></div>
+			</td>
+		</tr>
+	</table>
+{$initJS}
+
+
+
+
diff --git a/www/modules/inventory/inventoryUpdate.php b/www/modules/inventory/inventoryUpdate.php
new file mode 100644
index 0000000000000000000000000000000000000000..0d0ca59e277c60e9d5e16772cbc43e0e81c17756
--- /dev/null
+++ b/www/modules/inventory/inventoryUpdate.php
@@ -0,0 +1,64 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Inventory � is developped by Merethis company for Lafarge Group,
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the
+quality,safety, contents, performance, merchantability, non-infringement or
+suitability for any particular or intended purpose of the Software found on the OREON web
+site. In no event will OREON be liable for any direct, indirect, punitive,
+special, incidental or consequential damages however they may arise and even if OREON
+has been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!$oreon)
+		exit();
+
+	$t = microtime();
+
+	$form = new HTML_QuickForm('Form', 'post', "?p=".$p);
+	$form->addElement('header', 'title',$lang['s_header_inventory'] );
+
+	#
+	## Inventory information
+	#
+
+	$form->addElement('text', 'inventory', $lang['s_output_inventory'], "");
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+//	$tpl->assign("headerMenu_name", $lang['name']);
+//	$tpl->assign("headerMenu_desc", $lang['description']);
+//	$tpl->assign("headerMenu_address", $lang['h_address']);
+//	$tpl->assign("headerMenu_status", $lang['status']);
+//	$tpl->assign("headerMenu_manu", $lang['s_manufacturer']);
+//	$tpl->assign("headerMenu_type", $lang['s_type']);
+	# end header menu
+
+
+		$tpl->assign("initJS", "<script type='text/javascript'>
+		display('". $lang['s_waiting'] ."<br><br><img src=\'./img/icones/48x48/stopwatch.gif\'>','inventory');
+		//display('Please wait during inventory...','inventory');
+		loadXMLDoc('modules/inventory/inventory_cron_update.php','inventory');
+		</script>");
+
+		$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+		$form->accept($renderer);
+		$tpl->assign('form', $renderer->toArray());
+		$tpl->assign('o', $o);
+		$tpl->display("inventoryUpdate.ihtml");
+
+
+?>
\ No newline at end of file
diff --git a/www/modules/inventory/inventory_configure.php b/www/modules/inventory/inventory_configure.php
new file mode 100644
index 0000000000000000000000000000000000000000..8d29e504a0c24182fb77449ef5395fc014acbd7c
--- /dev/null
+++ b/www/modules/inventory/inventory_configure.php
@@ -0,0 +1,48 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called « Oreon Inventory » is developped by Merethis company for Lafarge Group,
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the
+quality,
+safety, contents, performance, merchantability, non-infringement or
+suitability for
+any particular or intended purpose of the Software found on the OREON web
+site.
+In no event will OREON be liable for any direct, indirect, punitive,
+special,
+incidental or consequential damages however they may arise and even if OREON
+has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!$oreon)
+		exit();
+
+	$res =& $pearDB->query("SELECT * FROM inventory_manufacturer");
+	$manu_array = array();
+	$manu_array[0] = "Server";
+	while ($r =& $res->fetchRow())
+		$manu_array[$r["id"]] = $r["alias"];
+
+	$res =& $pearDB->query("SELECT host_id, type_ressources FROM inventory_index");
+	while ($r =& $res->fetchRow()){
+		$resHost =& $pearDB->query("SELECT host_name FROM host WHERE host_id = '".$r["host_id"]."'");
+		$rH =& $resHost->fetchRow();
+		if (isset($manu_array[$r["type_ressources"]]))
+			print $rH["host_name"] . " - " . $manu_array[$r["type_ressources"]] . "<br>";
+		else
+			print $rH["host_name"] . " - " . "Not defined" . "<br>";
+	}
+
+
+		
+?>
\ No newline at end of file
diff --git a/www/modules/inventory/inventory_cron_update.php b/www/modules/inventory/inventory_cron_update.php
new file mode 100644
index 0000000000000000000000000000000000000000..fcbee6d98ef537faa6bd76cfe41a11d5a64521fa
--- /dev/null
+++ b/www/modules/inventory/inventory_cron_update.php
@@ -0,0 +1,189 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called � Oreon Inventory � is developped by Merethis company for Lafarge Group,
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+
+ include("../../oreon.conf.php");
+ require_once ("../../$classdir/Session.class.php");
+ require_once ("../../$classdir/Oreon.class.php");
+ Session::start();
+
+ if (!isset($_SESSION["oreon"])) {
+ 	// Quick dirty protection
+ 	header("Location: ./index.php");
+ 	//exit();
+ }else {
+ 	$oreon =& $_SESSION["oreon"];
+ }
+ is_file ("../../lang/".$oreon->user->get_lang().".php") ? include_once ("../../lang/".$oreon->user->get_lang().".php") : include_once ("../../lang/en.php");
+ is_file ("../../include/configuration/lang/".$oreon->user->get_lang().".php") ? include_once ("../../include/configuration/lang/".$oreon->user->get_lang().".php") : include_once ("../../include/configuration/lang/en.php");
+ is_file ("lang/".$oreon->user->get_lang().".php") ? include_once ("lang/".$oreon->user->get_lang().".php") : include_once ("lang/en.php");
+
+  require_once 'DB.php';
+
+  ## Init Microtime
+  $begin_time = microtime();
+
+  ## Debug mode activation
+  $debug = 0;
+
+  include("./common-Func.php");
+  require_once "../../include/common/common-Func.php";
+
+  $dsn = array(
+      'phptype'  => 'mysql',
+      'username' => $conf_oreon['user'],
+      'password' => $conf_oreon['password'],
+      'hostspec' => $conf_oreon['host'],
+      'database' => $conf_oreon['db'],
+  );
+
+  $options = array('debug' => 2, 'portability' => DB_PORTABILITY_ALL ^ DB_PORTABILITY_LOWERCASE);
+
+  $pearDB =& DB::connect($dsn, $options);
+
+  if (PEAR::isError($pearDB))
+      die("pb connexion : ".$pearDB->getMessage());
+
+  $pearDB->setFetchMode(DB_FETCHMODE_ASSOC);
+
+  $timeout = 30 * 1000;
+  $retries = 5;
+
+  if (!isset($oreon))
+    $oreon = 1;
+
+  $msg = '';
+
+  include("inventory_oid_library.php");
+
+  $optres =& $pearDB->query("SELECT snmp_community,snmp_version FROM general_opt LIMIT 1");
+  $optr =& $optres->fetchRow();
+  $globalCommunity = $optr["snmp_community"];
+  $globalVersion = $optr["snmp_version"];
+
+
+  $resHost =& $pearDB->query("SELECT * FROM host WHERE host_register= '1'");
+
+ print "<table id='ListTable'>\n";
+ print "	<tr class='ListHeader'>\n";
+ print "		<td class='ListColHeaderLeft'>".$lang['name']."</td>\n";
+ print "		<td class='ListColHeaderLeft'>".$lang['h_address']."</td>\n";
+ print "		<td class='ListColHeaderLeft'>".$lang['s_type']." / ".$lang['s_manufacturer']."</td>\n";
+ print "	</tr>\n";
+
+  while ($r =& $resHost->fetchRow()){
+    $host_id = $r["host_id"];
+    $address = $r["host_address"];
+
+  	if (!$r["host_snmp_community"]){
+		$community = getMySnmpCommunity($r["host_id"]);
+		if ($community == "")
+			$community = $oreon->optGen["snmp_community"];
+	} else
+		$community = $r["host_snmp_community"];
+
+	if (!$r["host_snmp_version"]){
+		$version = getMySnmpVersion($r["host_id"]);
+		if ($version == "")
+			$version = $oreon->optGen["snmp_version"];
+	} else 
+		$version = $r["host_snmp_version"];
+
+
+  /*  if ($r["host_snmp_community"])
+        $community = $r["host_snmp_community"];
+      else
+        $community = $globalCommunity;*/
+    $uptime =  get_snmp_value(".1.3.6.1.2.1.1.3.0", "STRING: ");
+
+    if ($uptime != FALSE){
+      $host_inv =& $pearDB->query("SELECT * FROM inventory_index WHERE host_id = '$host_id'");
+      if ($host_inv->numRows() == 0){
+        $Constructor = get_manufacturer();
+       $constr =& $pearDB->query(	"SELECT inventory_manufacturer.name,inventory_manufacturer.alias FROM inventory_manufacturer,inventory_index ".
+                      "WHERE inventory_manufacturer.id = '".$Constructor."'");
+          $m =& $constr->fetchRow();
+          $Constructor_name = $m["name"];
+          $Constructor_alias = $m["alias"];
+      } else {
+        $constr =& $pearDB->query(	"SELECT inventory_manufacturer.name,inventory_manufacturer.alias FROM inventory_manufacturer,inventory_index ".
+                      "WHERE inventory_manufacturer.id = inventory_index.type_ressources ".
+                      "AND inventory_index.host_id = '".$host_id."'");
+          $m =& $constr->fetchRow();
+          $Constructor_name = $m["name"];
+          $Constructor_alias = $m["alias"];
+      }
+      /*
+         * Get Data
+         */
+
+      print "<tr class='list_one'>\n";
+      print "		<td class='ListColLeft'>".$r['host_name']."</td>\n";
+	  print "		<td class='ListColLeft'>".$address."</td>\n";
+      print "		<td class='ListColLeft'>".$Constructor_alias."</td>\n";
+      print "	</tr>\n";
+
+	  $sysLocation =  get_snmp_value(".1.3.6.1.2.1.1.6.0", "STRING: ");
+      $sysDescr =  	get_snmp_value(".1.3.6.1.2.1.1.1.0", "STRING: ");
+      $sysName =  	get_snmp_value(".1.3.6.1.2.1.1.5.0", "STRING: ");
+      $sysContact =  	get_snmp_value(".1.3.6.1.2.1.1.4.0", "STRING: ");
+
+      if ( isset($Constructor_name)&& ($Constructor_name)) {
+        $str = get_snmp_value($oid[$Constructor_name]["SwitchVersion"], "STRING: ");
+        if ($str)
+          $SwitchVersion = str_replace("\"", "", $str);
+        $str = get_snmp_value($oid[$Constructor_name]["RomVersion"], "STRING: ");
+        if ($str)
+          $RomVersion = str_replace("\"", "", $str);
+        $str = get_snmp_value($oid[$Constructor_name]["SerialNumber"], "STRING: ");
+        if ($str)
+          $SerialNumber = str_replace("\"", "", $str);
+        $str = get_snmp_value($oid[$Constructor_name]["manufacturer"], "STRING: ");
+        if ($str)
+          $Manufacturer = str_replace("\"", "", $str);
+      } else {
+        $SwitchVersion = '';
+        $RomVersion = '';
+        $SerialNumber = '';
+        $Manufacturer = '';
+      }
+
+      $res =& $pearDB->query("SELECT * FROM inventory_index WHERE host_id = '".$r["host_id"]."'");
+        if (!$res->numRows()){
+          if (!isset($Constructor) || ($Constructor == 0 ))
+            $Constructor = "NULL";
+          else
+            $Constructor = "'".$Constructor."'";
+          $res =& $pearDB->query(	"INSERT INTO `inventory_index` (`id`, `host_id`, `name`, `contact`, `description`, `location`, `manufacturer`, `serial_number`, `os`, `os_revision`, `type_ressources`) " .
+                      "VALUES ('', '".$r["host_id"]."', '".$sysName."', '".$sysContact."', '".$sysDescr."', '".$sysLocation."', '".$Manufacturer."', '".$SerialNumber."', '".$SwitchVersion."', '".$RomVersion."', ".$Constructor.")");
+           if (PEAR::isError($res))
+          print ($res->getMessage());
+      } else {
+        verify_data($r["host_id"]);
+        }
+    } else {
+      ;//print "host : ".$r["host_name"]." n'a pas snmp;\n";
+    }
+  }
+   print "</table>\n";
+  $end_time = microtime();
+  $time_len = $end_time - $begin_time;
+?>
diff --git a/www/modules/inventory/inventory_library.php b/www/modules/inventory/inventory_library.php
new file mode 100644
index 0000000000000000000000000000000000000000..f7a5bfd8be59e478fa191acf170f3ba1b5e6e2f0
--- /dev/null
+++ b/www/modules/inventory/inventory_library.php
@@ -0,0 +1,78 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called « Oreon Inventory » is developped by Merethis company for Lafarge Group,
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the
+quality,
+safety, contents, performance, merchantability, non-infringement or
+suitability for
+any particular or intended purpose of the Software found on the OREON web
+site.
+In no event will OREON be liable for any direct, indirect, punitive,
+special,
+incidental or consequential damages however they may arise and even if OREON
+has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!$oreon)
+		exit();
+
+	/*
+	 * The type of interface, distinguished according to
+     * the physical/link protocol(s) immediately `below'
+     * the network layer in the protocol stack.
+	 */
+
+	$ifType[1] = "other";
+	$ifType[2] = "regular1822";
+	$ifType[3] = "hdh1822";
+	$ifType[4] = "ddn-x25";
+	$ifType[5] = "rfc877-x25";
+	$ifType[6] = "ethernet-csmacd";
+	$ifType[7] = "iso88023-csmacd";
+	$ifType[8] = "iso88024-tokenBus";
+	$ifType[9] = "iso88025-tokenRing";
+	$ifType[10] = "iso88026-man";
+	$ifType[11] = "starLan";
+	$ifType[12] = "proteon-10Mbit";
+	$ifType[13] = "proteon-80Mbit";
+	$ifType[14] = "hyperchannel";
+	$ifType[15] = "fddi";
+	$ifType[16] = "lapb";
+	$ifType[17] = "sdlc";
+	$ifType[18] = "ds1";
+	$ifType[19] = "e1";
+	$ifType[20] = "basicISDN";
+	$ifType[21] = "primaryISDN";
+	$ifType[22] = "propPointToPointSerial";
+	$ifType[23] = "ppp";
+	$ifType[24] = "softwareLoopback";
+	$ifType[25] = "eon";
+	$ifType[26] = "ethernet-3Mbit";
+	$ifType[27] = "nsip";
+	$ifType[28] = "slip";
+	$ifType[29] = "ultra";
+	$ifType[30] = "ds3";
+	$ifType[31] ="sip";
+	$ifType[32] = "frame-relay";
+
+	$ifAdminStatus[1] = "Up";
+	$ifAdminStatus[2] = "Down";
+	$ifAdminStatus[3] = "Testing";
+
+	$ifOperStatus[1] = "Up";
+	$ifOperStatus[2] = "Down";
+	$ifOperStatus[3] = "Testing";
+
+
+?>
\ No newline at end of file
diff --git a/www/modules/inventory/inventory_oid_library.php b/www/modules/inventory/inventory_oid_library.php
new file mode 100644
index 0000000000000000000000000000000000000000..83c56ca5e6e091a6d2ab7235bf1d0e7fcf4eae69
--- /dev/null
+++ b/www/modules/inventory/inventory_oid_library.php
@@ -0,0 +1,104 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called « Oreon Inventory » is developped by Merethis company for Lafarge Group,
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the
+quality,
+safety, contents, performance, merchantability, non-infringement or
+suitability for
+any particular or intended purpose of the Software found on the OREON web
+site.
+In no event will OREON be liable for any direct, indirect, punitive,
+special,
+incidental or consequential damages however they may arise and even if OREON
+has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!$oreon)
+		exit();
+
+	/*
+	 * Ventilo
+	 */
+
+	$oid["hp"]["SensorIndex"] = ".1.3.6.1.4.1.11.2.14.11.1.2.6.id.1";
+	$oid["hp"]["SensorDescr"] = ".1.3.6.1.4.1.11.2.14.11.1.2.6.id.7";
+	$oid["hp"]["SensorStatus"] = ".1.3.6.1.4.1.11.2.14.11.1.2.6.id.4";
+
+	/*
+	 * Version
+	 */
+
+	$oid["hp"]["SwitchVersion"] = ".1.3.6.1.4.1.11.2.14.11.5.1.1.3.0";
+	$oid["hp"]["RomVersion"] = ".1.3.6.1.4.1.11.2.14.11.5.1.1.4.0";
+	$oid["cisco"]["SwitchVersion"] = "1.3.6.1.4.1.9.3.6.5.0";
+	$oid["cisco"]["RomVersion"] = "1.3.6.1.4.1.9.3.6.4.0";
+	$oid["3com"]["SwitchVersion"] = "1.3.6.1.4.1.43.10.27.1.1.1.10.1.0";
+	$oid["3com"]["RomVersion"] = "1.3.6.1.4.1.43.10.27.1.1.1.12.1.0";
+	$oid["ciscolinksys"]["SwitchVersion"] = "1.3.6.1.4.1.3955.1.2";
+	$oid["ciscolinksys"]["RomVersion"] = "1.3.6.1.4.1.3955.1.3";
+
+	/*
+	 * Telnet enabled
+	 */
+
+	$oid["hp"]["TelnetEnabled"] = ".1.3.6.1.4.1.11.2.14.11.5.1.7.1.2.1.0";
+
+	/*
+	 * SSH Enabled
+	 */
+
+	$oid["hp"]["SSH"] = ".1.3.6.1.4.1.11.2.14.11.5.1.7.1.20.1.0";
+	$oid["hp"]["SSHPort"] = ".1.3.6.1.4.1.11.2.14.11.5.1.7.1.20.4.0";
+
+	/*
+	 * CPU Stat
+	 */
+
+	$oid["hp"]["CPUStat"] = ".1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0";
+
+	/*
+	 * Spanning Tree protocole
+	 */
+
+	$oid["hp"]["SpanningTreeProtocol"] = ".1.3.6.1.4.1.11.2.14.11.5.1.9.5.1.0";
+
+	/*
+	 * Ports Switchs
+	 */
+
+	$oid["hp"]["VlanAssign"] = "";
+	$oid["cisco"]["VlanAssign"] = "1.3.6.1.4.1.9.9.68.1.2.2.1.2.";
+
+	/*
+	 * Serial Number
+	 */
+
+	$oid["hp"]["manufacturer"] = ".1.3.6.1.4.1.11.2.36.1.1.2.4.0";
+	$oid["hp"]["SerialNumber"] = ".1.3.6.1.4.1.11.2.36.1.1.2.9.0";
+	$oid["hp"]["SerieType"] = ".1.3.6.1.4.1.11.2.36.1.1.5.1.1.9.1";
+
+	$oid["cisco"]["manufacturer"] = ".1.3.6.1.4.1.3.6.14.0";
+	$oid["cisco"]["SerialNumber"] = ".1.3.6.1.4.1.9.3.6.3.0";
+	$oid["cisco"]["SerieType"] = "1.3.6.1.4.1.9.9.23.1.2.1.1.8.1.1";
+
+	$oid["3com"]["manufacturer"] = "";
+	$oid["3com"]["SerialNumber"] = "1.3.6.1.4.1.43.10.27.1.1.1.19.1";
+	$oid["3com"]["SerieType"] = "1.3.6.1.4.1.43.10.27.1.1.1.5.1";
+
+	$oid["ciscolinksys"]["manufacturer"] = "";
+	$oid["ciscolinksys"]["SerialNumber"] = "";
+	$oid["ciscolinksys"]["SerieType"] = "";
+
+
+?>
\ No newline at end of file
diff --git a/www/modules/inventory/inventory_server.php b/www/modules/inventory/inventory_server.php
new file mode 100644
index 0000000000000000000000000000000000000000..ab0c55ab6e13b1a4674823a83915a48e127c4663
--- /dev/null
+++ b/www/modules/inventory/inventory_server.php
@@ -0,0 +1,55 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called « Oreon Inventory » is developped by Merethis company for Lafarge Group,
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the
+quality,
+safety, contents, performance, merchantability, non-infringement or
+suitability for
+any particular or intended purpose of the Software found on the OREON web
+site.
+In no event will OREON be liable for any direct, indirect, punitive,
+special,
+incidental or consequential damages however they may arise and even if OREON
+has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset ($oreon))
+		exit ();
+	
+	isset($_GET["host_id"]) ? $hG = $_GET["host_id"] : $hG = NULL;
+	isset($_POST["host_id"]) ? $hP = $_POST["host_id"] : $hP = NULL;
+	$hG ? $host_id = $hG : $host_id = $hP;
+
+	# HOST LCA	
+	if (!array_key_exists($host_id, $oreon->user->lcaHost))	{
+		#Pear library
+		require_once "HTML/QuickForm.php";
+		require_once 'HTML/QuickForm/advmultiselect.php';
+		require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
+		
+		#Path to the configuration dir
+		#Path to the configuration dir
+		global $path;		
+		$path = "./modules/inventory/server/";		
+
+		#PHP functions
+		//require_once $path."DB-Func.php";
+		require_once "./include/common/common-Func.php";
+		
+			switch ($o)	{
+				case "w" : require_once($path."infosServer.php"); break; #Watch a host
+				default : require_once($path."listServer.php"); break;
+			}
+	}
+?>
\ No newline at end of file
diff --git a/www/modules/inventory/inventory_tpl.php b/www/modules/inventory/inventory_tpl.php
new file mode 100644
index 0000000000000000000000000000000000000000..409f047c92ca7c1d60f1a777e36ec1fb28bd17d4
--- /dev/null
+++ b/www/modules/inventory/inventory_tpl.php
@@ -0,0 +1,114 @@
+<div>
+	<div class='text12b' style='padding-top:15px;'><img src="img/picto1.gif"> Host</div>
+	<div style='padding-left:20px;float:left;width:140px;'>Name : </div><div><? print $sysName; ?>&nbsp;</div>
+	<div style='padding-left:20px;float:left;width:140px;'>Description : </div><div><? print $sysDescr; ?>&nbsp;</div>
+	<div style='padding-left:20px;float:left;width:140px;'>Contact : </div><div><? print $sysContact; ?>&nbsp;</div>
+	<div style='padding-left:20px;float:left;width:140px;'>Location : </div><div><? print $sysLocation; ?>&nbsp;</div>
+	<div style='padding-left:20px;float:left;width:140px;'>Uptime : </div><div><? print $sysUpTime; ?>&nbsp;</div>
+<?	if (!strcmp("NetRessource", $_GET["Type"])) { ?>
+	<div style='padding-left:20px;float:left;width:140px;'>Health : </div><div><? print $Health; ?>&nbsp;</div>
+	<div style='padding-left:20px;float:left;width:140px;'>CPU Use : </div><div><? print $CPUStat; ?>%&nbsp;</div>
+	<div style='padding-left:20px;float:left;width:140px;'>Telnet Enable : </div><div><? print $enable[$TelnetEnable]; ?>&nbsp;</div>
+	<div style='padding-left:20px;float:left;width:140px;'>SSH Enable : </div><div><? print $enable[$SSHEnable]." (Port : $SSHPort)"; ?>&nbsp;</div>
+	<div style='padding-left:20px;float:left;width:140px;'>Serial Number : </div><div><? print $SerialNumber . " ($GlobalDeviceUniqueID)"; ?>&nbsp;</div>
+	<div style='padding-left:20px;float:left;width:140px;'>Manufacturer : </div><div><? print $Manufacturer; ?>&nbsp;</div>
+	<div style='padding-left:20px;float:left;width:140px;'>Serie Type : </div><div><? print $SerieType; ?>&nbsp;</div>
+	<div style='padding-left:20px;float:left;width:140px;'>Rom Version : </div><div><? print $RomVersion; ?>&nbsp;</div>
+	<div style='padding-left:20px;float:left;width:140px;'>Switch Version : </div><div><? print $SwitchVersion; ?>&nbsp;</div>
+<? 	
+	} ?>
+	<div class='text12b' style='padding-top:10px;'><img style="cursor: hand;" id="handle1" name="handle1" src="img/picto1.gif" alt="" onclick='hideobject("InvNetWork", "showInvNetWork", "handle1", "./img/picto1.gif");'>&nbsp;&nbsp;<a onclick="hideobject('InvNetWork', 'showInvNetWork', 'handle1', './img/picto1.gif');">Network</a></div>
+	<div style="display: none;padding:0px;padding-top:15px;" id="InvNetWork">
+	<?
+	
+	$tab_unit = array("0"=>"bits", "1"=>"Kbits","2"=>"Mbits","3"=>"Gbits");
+	
+	if ($ifTab)
+		foreach ($ifTab as $it){?>
+		<div style='padding-top:15px;'>
+			<div style='padding-left:10px;width:100px;'><span class='text11b'>Name :</span> <? print $it["ifDescr"]; ?>&nbsp; (<? $r = preg_match("/([A-Za-z]+)\([0-9]+\)/", $it["ifType"], $matches); print $matches["1"]; ?>)</div>
+			<?
+				for ($cpt = 0,$value = $it["ifSpeed"]; $value >= 1000 ; $value /= 1000)
+					$cpt++;
+			?>
+			<div style='padding-left:10px;width:100px;'><span class='text11b'>Speed :</span> <? print $value . "&nbsp;".$tab_unit[$cpt]; ?>&nbsp;</div>
+			<div style='padding-left:10px;width:100px;'><span class='text11b'>IP Address :</span> <? if ($ipInterface[$it["ifIndex"]]["ipIP"]){ print $ipInterface[$it["ifIndex"]]["ipIP"]."&nbsp;/&nbsp;".$ipInterface[$it["ifIndex"]]["ipNetMask"];} else {print "Not Defined";} ?></div>
+			<div style='padding-left:10px;width:100px;'><span class='text11b'>PhysAddress :</span> <? print $it["ifPhysAddress"]; ?>&nbsp;</div>
+			<div style='padding-left:10px;width:100px;'><span class='text11b'>Status :</span> <? print $it["ifAdminStatus"]; ?> / <? print $it["ifOperStatus"]; ?>&nbsp;</div>
+		</div>
+	<? 	}	?>
+	</div>
+<? 	if ($hrStorageIndex) { ?>
+	<div class='text12b'><img style="cursor: hand;" id="handle1" name="handle1" src="img/picto1.gif" alt="" onclick='hideobject("InvStorage", "showInvStorage", "handle1", "./img/picto1.gif");'>&nbsp;&nbsp;<a onclick="hideobject('InvStorage', 'showInvStorage', 'handle1', './img/picto1.gif');">Storage Device</a></div>
+	<div style="display: none;padding:0px;" id="InvStorage">
+	<?
+		foreach ($hrStorageIndex as $SI){?>
+		<div style='padding-top:15px;'>
+			<div style='padding-left:10px;float:left;width:100px;' class='text10b'>Name</div><div><? print $SI["hsStorageDescr"]; ?>&nbsp;</div>
+			<div style='padding-left:10px;float:left;width:100px;' class='text10b'>Type</div><div><? print $SI["hsStorageType"]; if ($SI["hsFSBootable"] == "true(1)") print "(Bootable)"; ?>&nbsp;</div>
+			<div style='padding-left:10px;float:left;width:100px;' class='text10b'>Size</div><div><? print $SI["hsStorageSize"]; ?>&nbsp;</div>
+			<div style='padding-left:10px;float:left;width:100px;' class='text10b'>Used</div><div><? print $SI["hsStorageUsed"]; ?>&nbsp;</div>
+		<? 	if ($SI["hrFSAccess"]) { ?>
+			<div style='padding-left:10px;float:left;width:100px;' class='text10b'>Acces Permissions</div><div><? print $SI["hrFSAccess"]; ?>&nbsp;</div>
+		<?	}	?>
+		</div>
+	<? 	}	?>
+	</div>
+<?	}
+ 	if ($hrSWRun) { ?>
+	<div class='text12b'><img style="cursor: hand;" id="handle1" name="handle1" src="img/picto1.gif" alt="" onclick='hideobject("InvRunProc", "showInvRunProc", "handle1", "./img/picto1.gif");'>&nbsp;&nbsp;<a onclick="hideobject('InvRunProc', 'showInvRunProc', 'handle1', './img/picto1.gif');">Running Process</a></div>
+	<div style="display: none;padding:0px;padding-top:15px;" id="InvRunProc">
+	<?
+		foreach ($hrSWRun as $SWR){?>
+		<div style='padding-top:15px;'>
+			<div style='padding-left:10px;float:left;width:100px;' class='text10b'>Name</div><div><? print $SWR["hrSWRunName"]; ?>&nbsp;</div>
+			<div style='padding-left:10px;float:left;width:100px;' class='text10b'>Path</div><div><? print $SWR["hrSWRunPath"]; if ($SI["hrSWRunParameters"]) print " " . $SWR["hrSWRunParameters"]; ?>&nbsp;</div>
+			<div style='padding-left:10px;float:left;width:100px;' class='text10b'>Status</div><div><? print $SWR["hrSWRunStatus"]; ?>&nbsp;</div>
+			<div style='padding-left:10px;float:left;width:100px;' class='text10b'>Memory Used</div><div><? print $SWR["hrSWRunPerfMem"]; ?>&nbsp;</div>
+		<? 	if ($SIWR["hrSWRunPerfCPU"]) { ?>
+			<div style='padding-left:10px;float:left;width:100px;' class='text10b'>Acces Permissions</div><div><? print $SWR["hrSWRunPerfCPU"]; ?>&nbsp;</div>
+		<?	}	?>
+		</div>
+	<? 	}	?>
+	</div>
+<?	}	?>
+	
+</div>
+<script language="Javascript">
+if (!Get_Cookie('showInvNetWork')) {
+	Set_Cookie('showInvNetWork','true',30,'/','','');
+}
+var show = Get_Cookie('showInvNetWork');
+
+if (show == 'true') {
+	this.document.getElementById('InvNetWork').style.display='inline';
+	document['handle1'].src = './img/picto1.gif';
+} else {
+	this.document.getElementById('InvNetWork').style.display='none';
+	document['handle1'].src = './img/picto1.gif';	
+}
+if (!Get_Cookie('showInvStorage')) {
+	Set_Cookie('showInvStorage','true',30,'/','','');
+}
+var show = Get_Cookie('showInvStorage');
+
+if (show == 'true') {
+	this.document.getElementById('InvStorage').style.display='inline';
+	document['handle1'].src = './img/picto1.gif';
+} else {
+	this.document.getElementById('InvStorage').style.display='none';
+	document['handle1'].src = './img/picto1.gif';	
+}
+if (!Get_Cookie('showInvRunProc')) {
+	Set_Cookie('showInvRunProc','true',30,'/','','');
+}
+var show = Get_Cookie('showInvRunProc');
+
+if (show == 'true') {
+	this.document.getElementById('InvRunProc').style.display='inline';
+	document['handle1'].src = './img/picto1.gif';
+} else {
+	this.document.getElementById('InvRunProc').style.display='none';
+	document['handle1'].src = './img/picto1.gif';	
+}
+</script>
\ No newline at end of file
diff --git a/www/modules/inventory/lang/en.php b/www/modules/inventory/lang/en.php
new file mode 100644
index 0000000000000000000000000000000000000000..f2aaf5a577bda1d4a54d49578c6c5ae9578223f6
--- /dev/null
+++ b/www/modules/inventory/lang/en.php
@@ -0,0 +1,59 @@
+<?
+/* Server */
+
+$lang['s_name'] = "Name";
+$lang['s_description'] = "Description";
+$lang['s_contact'] = "Contact";
+$lang['s_location'] = "Location";
+$lang['s_uptime'] = "Uptime";
+$lang['s_CPUStat'] = "CPUStat";
+$lang['s_TelnetEnable'] = "TelnetEnable";
+$lang['s_SSHEnable'] = "SSHEnable";
+$lang['s_SSHPort'] = "SSHPort";
+$lang['s_SwitchVersion'] = "SwitchVersion";
+$lang['s_RomVersion'] = "RomVersion";
+$lang['s_SerialNumber'] = "SerialNumber";
+$lang['s_Manufacturer'] = "Manufacturer";
+$lang['s_Health'] = "Health";
+$lang['s_SerieType'] = "SerieType";
+$lang['s_GlobalDeviceUniqueID'] = "Global Device UniqueID";
+$lang['s_network'] = "Network";
+$lang['s_vlan'] = "VLAN";
+$lang['s_storageDevice'] = "Storage Device";
+$lang['s_softwareInstalled'] = "Software Installed";
+$lang['s_runningProcessus'] = "Running Processus";
+$lang['s_changeLog'] = "ChangeLog";
+$lang['s_In'] = "In";
+$lang['s_Out'] = "Out";
+$lang['s_interface'] = "Interface";
+$lang['s_PhysAddress'] = "PhysAddress";
+$lang['s_Type'] = "Type";
+$lang['s_Error'] = "Error";
+$lang['s_status'] = "Status";
+$lang['s_mntPoint'] = "mntPointlabel";
+$lang['s_Utilisation'] = "Utilisation";
+$lang['s_Free'] = "Free";
+$lang['s_Used'] = "Used";
+$lang['s_Size'] = "Size";
+$lang['s_Software'] = "Software";
+$lang['s_MermoryUsed'] = "Mermory Used";
+$lang['s_Path'] = "Path";
+$lang['s_Date'] = "Date";
+$lang['s_Object'] = "Object";
+$lang['s_Before'] = "Before";
+$lang['s_After'] = "After";
+$lang['s_manufacturer'] = "Manufacturer";
+$lang['s_server'] = "Server";
+$lang['s_type'] = "Type";
+$lang['s_none'] = "None";
+
+$lang['s_traffic'] = "Traffic";
+$lang['s_pkt_error'] = "Error Packet";
+
+$lang["s_notAvl"] = "This ID Card is not available";
+$lang["m_other_ressources"] = "Others Ressources";
+
+$lang['s_waiting'] = "Please, Wait during the inventory ";
+$lang['s_header_inventory'] = "Inventory";
+$lang['s_output_inventory'] = "Output Inventory";
+?>
\ No newline at end of file
diff --git a/www/modules/inventory/lang/fr.php b/www/modules/inventory/lang/fr.php
new file mode 100644
index 0000000000000000000000000000000000000000..be4f80f8e554305f7d24d116440c57e7b9aa2650
--- /dev/null
+++ b/www/modules/inventory/lang/fr.php
@@ -0,0 +1,59 @@
+<?
+/* Server */
+
+$lang['s_name'] = "Nom";
+$lang['s_description'] = "Description";
+$lang['s_contact'] = "Contact";
+$lang['s_location'] = "Location";
+$lang['s_uptime'] = "Uptime";
+$lang['s_CPUStat'] = "CPUStat";
+$lang['s_TelnetEnable'] = "TelnetEnable";
+$lang['s_SSHEnable'] = "SSHEnable";
+$lang['s_SSHPort'] = "SSHPort";
+$lang['s_SwitchVersion'] = "SwitchVersion";
+$lang['s_RomVersion'] = "RomVersion";
+$lang['s_SerialNumber'] = "SerialNumber";
+$lang['s_Manufacturer'] = "Manufacturer";
+$lang['s_Health'] = "Health";
+$lang['s_SerieType'] = "SerieType";
+$lang['s_GlobalDeviceUniqueID'] = "Global Device UniqueID";
+$lang['s_network'] = "Network";
+$lang['s_vlan'] = "VLAN";
+$lang['s_storageDevice'] = "Storage Device";
+$lang['s_softwareInstalled'] = "Software Installed";
+$lang['s_runningProcessus'] = "Running Processus";
+$lang['s_changeLog'] = "ChangeLog";
+$lang['s_In'] = "In";
+$lang['s_Out'] = "Out";
+$lang['s_interface'] = "Interface";
+$lang['s_PhysAddress'] = "PhysAddress";
+$lang['s_Type'] = "Type";
+$lang['s_Error'] = "Erreur";
+$lang['s_status'] = "Status";
+$lang['s_mntPoint'] = "Point de montage";
+$lang['s_Utilisation'] = "Utilisation";
+$lang['s_Free'] = "Libre";
+$lang['s_Used'] = "Utilis&eacute;";
+$lang['s_Size'] = "Taille";
+$lang['s_Software'] = "Application";
+$lang['s_MermoryUsed'] = "M&eacute;moire Utilis&eacute;";
+$lang['s_Path'] = "Chemin";
+$lang['s_Date'] = "Date";
+$lang['s_Object'] = "Object";
+$lang['s_Before'] = "Avant";
+$lang['s_After'] = "Apr&egrave;s";
+$lang['s_manufacturer'] = "Constructeur";
+$lang['s_server'] = "Serveur";
+$lang['s_type'] = "Type";
+$lang['s_none'] = "Aucun";
+
+$lang['s_traffic'] = "Trafic";
+$lang['s_pkt_error'] = "Paquet Erreur";
+
+$lang["s_notAvl"] = "Cette fiche d'identit&eacute; n'est pas disponible";
+$lang["m_other_ressources"] = "Autres ressources";
+
+$lang['s_waiting'] = "Merci de bien vouloir patienter durant l&#146;inventaire";
+$lang['s_header_inventory'] = "Inventaire";
+$lang['s_output_inventory'] = "Sortie de l'inventaire";
+?>
\ No newline at end of file
diff --git a/www/modules/inventory/listNetwork.ihtml b/www/modules/inventory/listNetwork.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..c1526dde59338ef203ac54702a32fd13b22983a0
--- /dev/null
+++ b/www/modules/inventory/listNetwork.ihtml
@@ -0,0 +1,55 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_address}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_manu}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_address}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_manu}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="6">
+			{$form.select_manufacturer.label}&nbsp;{$form.select_manufacturer.html}&nbsp;
+			<input type="image" name="o" value="d" src="./img/icones/16x16/refresh.gif">
+			</td>
+		</tr>
+		
+	</table>
+	<table class="TableFooter">
+	<tr>
+	<td class="limitPage">{$form.limit.label}</b>&nbsp;&nbsp;{$form.limit.html}</td>
+	<td class="pagination">
+		{if $pagePrev}
+		&nbsp;<a href="{$pagePrev}"><img src="./img/icones/16x16/arrow_left_blue.png"  alt='{$previous}' title='{$previous}'></a>
+		{/if}
+
+		{section name=elem loop=$pageArr}
+		{if $pageArr[elem].num != $num}
+		&nbsp;&nbsp;<a href="{$pageArr[elem].url_page}" class="otherPageNumber">{$pageArr[elem].label_page}</a>&nbsp;
+		{else}
+		&nbsp;&nbsp;<b class="currentPageNumber">{$pageArr[elem].label_page}</b>&nbsp;
+		{/if}
+		{/section}
+
+		{if $pageNext}
+		&nbsp;<a href="{$pageNext}"><img src="./img/icones/16x16/arrow_right_blue.png"  alt='{$next}' title='{$next}'></a>
+		{/if}	
+	</td>
+	<td class="pageNumber">Page {$pageNumber}</td>
+	</tr>
+	</table>
+{$form.hidden}
+</form>
+
diff --git a/www/modules/inventory/listNetwork.php b/www/modules/inventory/listNetwork.php
new file mode 100644
index 0000000000000000000000000000000000000000..9443ab93e79e5ff45a22feee490086a35b2c7a36
--- /dev/null
+++ b/www/modules/inventory/listNetwork.php
@@ -0,0 +1,150 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called  Oreon Inventory  is developped by Merethis company for Lafarge Group,
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+
+	if ($search)
+		$rq = "SELECT COUNT(*) FROM host h, inventory_index ii, inventory_manufacturer im WHERE h.host_id = ii.host_id AND " .
+			  " h.host_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' AND h.host_id IN (".$oreon->user->lcaHStr.") " .
+			  " AND ii.type_ressources";
+	else
+		$rq = "SELECT COUNT(*) FROM host h, inventory_index ii, inventory_manufacturer im WHERE h.host_id = ii.host_id AND " .
+				" h.host_id IN (".$oreon->user->lcaHStr.") AND im.id = ii.type_ressources";
+	$res =& $pearDB->query($rq);
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_address", $lang['h_address']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_manu", $lang['s_manufacturer']);
+	# end header menu
+
+	#Host list
+	if ($search)
+		$rq = "SELECT h.host_id, h.host_name, h.host_alias, h.host_address, h.host_activate, im.alias AS manu_alias FROM host h, inventory_index ii, inventory_manufacturer im WHERE h.host_id = ii.host_id AND " .
+			  " h.host_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' AND h.host_id IN (".$oreon->user->lcaHStr.") " .
+			  " AND ii.type_ressources ORDER BY h.host_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT h.host_id, h.host_name, h.host_alias, h.host_address, h.host_activate, im.alias AS manu_alias FROM host h, inventory_index ii, inventory_manufacturer im WHERE h.host_id = ii.host_id AND " .
+				" h.host_id IN (".$oreon->user->lcaHStr.") AND im.id = ii.type_ressources  " .
+				" ORDER BY h.host_name LIMIT ".$num * $limit.", ".$limit;
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($host); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$host['host_id']."]");	
+		if (!$host["host_name"])
+			$host["host_name"] = getMyHostName($host["host_template_model_htm_id"]);
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$host["host_name"],
+						"RowMenu_link"=>"?p=".$p."&o=o&host_id=".$host['host_id']."&search=".$search,
+						"RowMenu_desc"=>$host["host_alias"],
+						"RowMenu_address"=>$host["host_address"],
+						"RowMenu_status"=>$host["host_activate"] ? $lang["enable"] : $lang["disable"],
+						"RowMenu_manu"=>$host["manu_alias"]);
+		$style != "two" ? $style = "two" : $style = "one";
+	}
+	$tpl->assign("elemArr", $elemArr);
+
+	
+	#Fill a tab with different page numbers and link
+	$pageArr = array();
+	for ($i = 0; $i < ($rows / $limit); $i++)
+		$pageArr[$i] = array("url_page"=>"./oreon.php?p=".$p."&num=$i&limit=".$limit."&search=".$search,
+							"label_page"=>"<b>".($i +1)."</b>",
+"num"=> $i);
+							
+	if($i > 1)							
+	$tpl->assign("pageArr", $pageArr);
+
+	$tpl->assign("num", $num);
+	$tpl->assign("previous", $lang["previous"]);
+	$tpl->assign("next", $lang["next"]);
+
+	if(($prev = $num - 1) >= 0)
+	$tpl->assign('pagePrev', ("./oreon.php?p=".$p."&num=$prev&limit=".$limit."&search=".$search));
+	if(($next = $num + 1) < ($rows/$limit))
+	$tpl->assign('pageNext', ("./oreon.php?p=".$p."&num=$next&limit=".$limit."&search=".$search));
+	$tpl->assign('pageNumber', ($num +1)."/".ceil($rows / $limit));
+	
+	#form select host
+	$req = "SELECT id, alias FROM inventory_manufacturer ";
+	$res = & $pearDB->query($req);
+
+	$option = array(NULL=>$lang['s_none']);
+	for ($i=0;$res->fetchInto($host);$i++) 
+    	$option[$host['id']] = $host['alias'];
+
+	$form->addElement('select', 'select_manufacturer', $lang['s_manufacturer'], $option);
+		
+	#Select field to change the number of row on the page
+	for ($i = 10; $i <= 100; $i = $i +10)
+		$select[$i]=$i;
+	$select[$gopt["maxViewConfiguration"]]=$gopt["maxViewConfiguration"];
+	ksort($select);
+	$selLim =& $form->addElement('select', 'limit', $lang['nbr_per_page'], $select, array("onChange" => "this.form.submit('')"));
+	$selLim->setSelected($limit);
+	
+	#Element we need when we reload the page
+	$form->addElement('hidden', 'p');
+	$form->addElement('hidden', 'search');
+	$form->addElement('hidden', 'num');
+	$tab = array ("p" => $p, "search" => $search, "num"=>$num);
+	$form->setDefaults($tab);	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listNetwork.ihtml");
+	
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/modules/inventory/listServer.ihtml b/www/modules/inventory/listServer.ihtml
new file mode 100644
index 0000000000000000000000000000000000000000..a7704e8316484d4b95fc44282ea7cfb0e619448c
--- /dev/null
+++ b/www/modules/inventory/listServer.ihtml
@@ -0,0 +1,54 @@
+<script type="text/javascript" src="./include/common/javascript/tool.js"></script>
+<form {$form_attributes}>
+	<table id="ListTable">
+		<tr class="ListHeader">
+			<td class="ListColHeaderPicker"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
+			<td class="ListColHeaderLeft">{$headerMenu_name}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_desc}</td>
+			<td class="ListColHeaderLeft">{$headerMenu_address}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_status}</td>
+			<td class="ListColHeaderCenter">{$headerMenu_type}</td>
+		</tr>
+		{section name=elem loop=$elemArr}
+		<tr class={$elemArr[elem].MenuClass}>
+			<td class="ListColPicker">{$elemArr[elem].RowMenu_select}</td>
+			<td class="ListColLeft"><a href="{$elemArr[elem].RowMenu_link}">{$elemArr[elem].RowMenu_name}</a></td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_desc}</td>
+			<td class="ListColLeft">{$elemArr[elem].RowMenu_address}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_status}</td>
+			<td class="ListColCenter">{$elemArr[elem].RowMenu_type}</td>
+		</tr>
+		{/section}
+		<tr>
+			<td class="ListColFooterLeft" align="left" colspan="6">
+			{$form.select_manufacturer.label}&nbsp;{$form.select_manufacturer.html}&nbsp;
+			<input type="image" name="o" value="c" src="./img/icones/16x16/refresh.gif">
+			</td>
+		</tr>
+	</table>
+	<table class="TableFooter">
+	<tr>
+	<td class="limitPage">{$form.limit.label}</b>&nbsp;&nbsp;{$form.limit.html}</td>
+	<td class="pagination">
+		{if $pagePrev}
+		&nbsp;<a href="{$pagePrev}"><img src="./img/icones/16x16/arrow_left_blue.png"  alt='{$previous}' title='{$previous}'></a>
+		{/if}
+
+		{section name=elem loop=$pageArr}
+		{if $pageArr[elem].num != $num}
+		&nbsp;&nbsp;<a href="{$pageArr[elem].url_page}" class="otherPageNumber">{$pageArr[elem].label_page}</a>&nbsp;
+		{else}
+		&nbsp;&nbsp;<b class="currentPageNumber">{$pageArr[elem].label_page}</b>&nbsp;
+		{/if}
+		{/section}
+
+		{if $pageNext}
+		&nbsp;<a href="{$pageNext}"><img src="./img/icones/16x16/arrow_right_blue.png"  alt='{$next}' title='{$next}'></a>
+		{/if}	
+	</td>
+	<td class="pageNumber">Page {$pageNumber}</td>
+	</tr>
+	</table>
+{$form.hidden}
+</form>
+
diff --git a/www/modules/inventory/listServer.php b/www/modules/inventory/listServer.php
new file mode 100644
index 0000000000000000000000000000000000000000..6692ebaed68638a6bcfe570692a203dc4f8a24de
--- /dev/null
+++ b/www/modules/inventory/listServer.php
@@ -0,0 +1,154 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus
+
+This unit, called  Oreon Inventory  is developped by Merethis company for Lafarge Group,
+under the direction of Jean Baptiste Sarrodie <jean-baptiste@sarrodie.org>
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	if (!isset ($oreon))
+		exit ();
+
+	# set limit
+	$res =& $pearDB->query("SELECT maxViewConfiguration FROM general_opt LIMIT 1");
+	$gopt = array_map("myDecode", $res->fetchRow());		
+	!isset ($_GET["limit"]) ? $limit = $gopt["maxViewConfiguration"] : $limit = $_GET["limit"];
+	isset ($_GET["num"]) ? $num = $_GET["num"] : $num = 0;
+	isset ($_GET["search"]) ? $search = $_GET["search"] : $search = NULL;
+
+	if ($search)
+		$rq = "SELECT COUNT(*) FROM host h, inventory_index ii WHERE h.host_id = ii.host_id AND ii.type_ressources IS NULL AND" .
+			  " h.host_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' AND h.host_id IN (".$oreon->user->lcaHStr.") " .
+			  " AND host_register = '1'";
+	else
+		$rq = "SELECT COUNT(*) FROM host h, inventory_index ii WHERE h.host_id = ii.host_id AND ii.type_ressources IS NULL AND" .
+				" h.host_id IN (".$oreon->user->lcaHStr.") AND host_register = '1'";
+	$res =& $pearDB->query($rq);
+	$tmp = & $res->fetchRow();
+	$rows = $tmp["COUNT(*)"];
+
+	# start quickSearch form
+	include_once("./include/common/quickSearch.php");
+	# end quickSearch form
+
+	# Smarty template Init
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl($path, $tpl);
+
+	# start header menu
+	$tpl->assign("headerMenu_icone", "<img src='./img/icones/16x16/pin_red.gif'>");
+	$tpl->assign("headerMenu_name", $lang['name']);
+	$tpl->assign("headerMenu_desc", $lang['description']);
+	$tpl->assign("headerMenu_address", $lang['h_address']);
+	$tpl->assign("headerMenu_status", $lang['status']);
+	$tpl->assign("headerMenu_type", $lang['s_type']);
+	# end header menu
+
+	#Host list
+	if ($search)
+		$rq = "SELECT ii.*, h.host_id, h.host_name, h.host_alias, h.host_address, h.host_activate FROM host h, inventory_index ii WHERE h.host_id = ii.host_id AND ii.type_ressources IS NULL AND" .
+			  " h.host_name LIKE '%".htmlentities($search, ENT_QUOTES)."%' AND h.host_id IN (".$oreon->user->lcaHStr.") " .
+			  " AND host_register = '1' ORDER BY h.host_name LIMIT ".$num * $limit.", ".$limit;
+	else
+		$rq = "SELECT ii.*, h.host_id, h.host_name, h.host_alias, h.host_address, h.host_activate FROM host h, inventory_index ii WHERE h.host_id = ii.host_id AND ii.type_ressources IS NULL AND" .
+				" h.host_id IN (".$oreon->user->lcaHStr.") AND host_register = '1' " .
+				" ORDER BY h.host_name LIMIT ".$num * $limit.", ".$limit;
+
+	$res = & $pearDB->query($rq);
+	
+	$form = new HTML_QuickForm('select_form', 'GET', "?p=".$p);
+	#Different style between each lines
+	$style = "one";
+	#Fill a tab with a mutlidimensionnal Array we put in $tpl
+
+	$elemArr = array();
+	for ($i = 0; $res->fetchInto($host); $i++) {		
+		$selectedElements =& $form->addElement('checkbox', "select[".$host['host_id']."]");	
+
+		if (!$host["host_name"])
+			$host["host_name"] = getMyHostName($host["host_template_model_htm_id"]);
+		$elemArr[$i] = array("MenuClass"=>"list_".$style, 
+						"RowMenu_select"=>$selectedElements->toHtml(),
+						"RowMenu_name"=>$host["host_name"],
+						"RowMenu_link"=>"?p=".$p."&o=t&host_id=".$host['host_id']."&search=".$search,
+						"RowMenu_desc"=>$host["host_alias"],
+						"RowMenu_address"=>$host["host_address"],
+						"RowMenu_status"=>$host["host_activate"] ? $lang["enable"] : $lang["disable"],
+						"RowMenu_type"=>$lang['s_server']);
+		$style != "two" ? $style = "two" : $style = "one";
+	}
+	$tpl->assign("elemArr", $elemArr);
+	#Different messages we put in the template
+	$tpl->assign('msg', array ("addL"=>"?p=".$p."&o=a", "addT"=>$lang['add'], "delConfirm"=>$lang['confirm_removing']));
+	
+	#Fill a tab with different page numbers and link
+	$pageArr = array();
+	for ($i = 0; $i < ($rows / $limit); $i++)
+		$pageArr[$i] = array("url_page"=>"./oreon.php?p=".$p."&num=$i&limit=".$limit."&search=".$search,
+							"label_page"=>"<b>".($i +1)."</b>",
+"num"=> $i);
+							
+	if($i > 1)							
+	$tpl->assign("pageArr", $pageArr);
+
+	$tpl->assign("num", $num);
+	$tpl->assign("previous", $lang["previous"]);
+	$tpl->assign("next", $lang["next"]);
+
+	if(($prev = $num - 1) >= 0)
+	$tpl->assign('pagePrev', ("./oreon.php?p=".$p."&num=$prev&limit=".$limit."&search=".$search));
+	if(($next = $num + 1) < ($rows/$limit))
+	$tpl->assign('pageNext', ("./oreon.php?p=".$p."&num=$next&limit=".$limit."&search=".$search));
+	$tpl->assign('pageNumber', ($num +1)."/".ceil($rows / $limit));
+	
+	#form select host
+	$req = "SELECT id, alias FROM inventory_manufacturer ";
+	$res = & $pearDB->query($req);
+
+	$option = array();
+	while ($res->fetchInto($const)) 
+    	$option[$const['id']] = $const['alias'];
+    
+    $form->addElement('select', 'select_manufacturer', $lang['s_manufacturer'], $option);
+	
+	#Select field to change the number of row on the page
+	for ($i = 10; $i <= 100; $i = $i +10)
+		$select[$i]=$i;
+	$select[$gopt["maxViewConfiguration"]]=$gopt["maxViewConfiguration"];
+	ksort($select);
+	$selLim =& $form->addElement('select', 'limit', $lang['nbr_per_page'], $select, array("onChange" => "this.form.submit('')"));
+	$selLim->setSelected($limit);
+	
+	#Element we need when we reload the page
+	$form->addElement('hidden', 'p');
+	$form->addElement('hidden', 'search');
+	$form->addElement('hidden', 'num');
+	$tab = array ("p" => $p, "search" => $search, "num"=>$num);
+	$form->setDefaults($tab);	
+
+	#
+	##Apply a template definition
+	#
+	
+	$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
+	$form->accept($renderer);	
+	$tpl->assign('form', $renderer->toArray());
+	$tpl->display("listServer.ihtml");
+	
+	$tpl = new Smarty();
+	$tpl = initSmartyTpl("./", $tpl);
+	$tpl->assign('lang', $lang);
+	$tpl->display("include/common/legend.ihtml");	
+?>
\ No newline at end of file
diff --git a/www/modules/inventory/sql/create.sql b/www/modules/inventory/sql/create.sql
new file mode 100644
index 0000000000000000000000000000000000000000..71f0712179fe47e941ed8effa579a31cbd050a43
--- /dev/null
+++ b/www/modules/inventory/sql/create.sql
@@ -0,0 +1,461 @@
+-- phpMyAdmin SQL Dump
+-- version 2.6.4-pl3
+-- http://www.phpmyadmin.net
+--
+-- Serveur: localhost
+-- G�n�r� le : Jeudi 16 F�vrier 2006 � 18:00
+-- Version du serveur: 4.1.15
+-- Version de PHP: 4.4.0
+--
+-- Base de donn�es: `oreon`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `inventory_index`
+--
+
+CREATE TABLE `inventory_index` (
+  `id` int(11) NOT NULL auto_increment,
+  `host_id` int(11) default NULL,
+  `name` varchar(254) default NULL,
+  `contact` varchar(254) default NULL,
+  `description` text,
+  `location` varchar(254) default NULL,
+  `manufacturer` varchar(254) default NULL,
+  `serial_number` varchar(254) default NULL,
+  `os` text,
+  `os_revision` varchar(254) default NULL,
+  `type_ressources` int(11) default NULL,
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `host_id` (`host_id`)
+) TYPE=InnoDB;
+
+
+--
+-- Structure de la table `inventory_log`
+--
+
+CREATE TABLE `inventory_log` (
+  `id` int(11) NOT NULL auto_increment,
+  `host_id` int(11) default NULL,
+  `type` varchar(20) default NULL,
+  `replaced_value` text,
+  `value` text,
+  `ctime` int(11) default '0',
+  PRIMARY KEY  (`id`)
+) TYPE=InnoDB;
+
+
+--
+-- Structure de la table `inventory_manufacturer`
+--
+
+CREATE TABLE `inventory_manufacturer` (
+  `id` int(11) NOT NULL auto_increment,
+  `name` varchar(254) default NULL,
+  `alias` varchar(254) default NULL,
+  PRIMARY KEY  (`id`)
+) TYPE=InnoDB;
+
+--
+-- Contenu de la table `inventory_manufacturer`
+--
+
+INSERT INTO `inventory_manufacturer` (`name`, `alias`) VALUES ('cisco', 'Cisco Networks');
+INSERT INTO `inventory_manufacturer` (`name`, `alias`) VALUES ('hp', 'HP Networks');
+INSERT INTO `inventory_manufacturer` (`name`, `alias`) VALUES ('3com', '3Com');
+INSERT INTO `inventory_manufacturer` (`name`, `alias`) VALUES ('ciscolinksys', 'Cisco-Linksys');
+INSERT INTO `inventory_manufacturer` (`name`, `alias`) VALUES ('allied', 'Allied Telesyn');
+INSERT INTO `inventory_manufacturer` (`name`, `alias`) VALUES ('dell', 'Dell');
+INSERT INTO `inventory_manufacturer` (`name`, `alias`) VALUES ('saintsongcorp', 'Saint Song Corp');
+
+--
+-- Structure de la table `inventory_mac_address`
+--
+
+CREATE TABLE `inventory_mac_address` (
+  `id` int(11) NOT NULL auto_increment,
+  `mac_address_begin` varchar(8) default NULL,
+  `manufacturer` int(11) default NULL,
+  PRIMARY KEY  (`id`)
+) TYPE=InnoDB;
+
+--
+-- Contenu de la table `inventory_mac_address`
+--
+
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:00:0C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:42', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:43', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:63', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:64', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:96', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:97', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:C7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:C9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:16', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:17', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:4A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:4B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:7D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:7E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:B9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:BA', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:FC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:FD', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:31', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:32', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:6B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:6C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:9F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:A0', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:E3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:E4', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:FD', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:FE', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:27', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:28', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:4D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:4E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:6D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:6E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:9A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:9B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:C0', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:C1', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:DD', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:DE', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:00', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:01', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:31', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:32', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:5E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:5F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:73', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:74', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:9A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:9B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:DC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:DD', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:28', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:2A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:52', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:53', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:7C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:C1', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:D6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:D7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:01', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:0D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:0E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:4F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:50', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:84', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:85', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:B3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:B4', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:EB', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:07:EC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:20', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:21', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:7C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:7D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:A3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:A4', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:C2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:E2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:E3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:11', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:12', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:43', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:44', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:7B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:7C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:B6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:B7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:E8', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:E9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:41', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:42', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:8A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:8B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:B7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:B8', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:F3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:F4', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:45', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:46', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:5F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:60', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:BE', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:BF', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:FC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:FD', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:30', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:31', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:85', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:86', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:CE', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:CF', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:28', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:29', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:65', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:66', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:38', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:39', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:83', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:84', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:D6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:D7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:23', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:24', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:34', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:35', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:8F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:90', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:F7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:F8', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:07', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:0B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:0D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:11', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:14', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:1F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:29', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:2F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:54', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:79', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:7B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:A6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:F6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:FF', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:20', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:21', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:5C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:5D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:92', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:93', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:BB', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:BC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:00', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:01', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:17', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:43', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:44', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:7F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:80', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:D9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:DA', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:10', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:19', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:1A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:5F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:60', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:7F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:80', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:C3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:C4', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:1B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:1C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:69', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:6A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:A8', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:A9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:BF', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:F1', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:F2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:2B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:2C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:62', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:63', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:C6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:C7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:F9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:FA', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:46', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:47', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:9C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:9D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:B6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:C7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:C8', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:19', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:24', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:40', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:71', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:78', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:7B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:80', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:85', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:94', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:96', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:A3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:B6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:F2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:0B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:0F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:14', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:2A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:3E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:50', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:53', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:54', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:73', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:80', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:A2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:A7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:BD', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:D1', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:E2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:F0', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:09', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:2F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:3E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:47', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:5C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:70', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:83', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:80:1C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:0C', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:21', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:2B', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:5F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:6D', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:6F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:86', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:92', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:A6', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:AB', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:B1', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:BF', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:D9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:F2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:B0:4A', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:B0:64', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:B0:8E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:B0:C2', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:06', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:58', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:63', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:79', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:90', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:97', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:BA', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:BB', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:BC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:C0', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:D3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:E4', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:FF', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:14', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:1E', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:34', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:4F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:8F', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:A3', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:B0', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:F7', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:F9', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:E0:FE', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:BC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:BD', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:EC', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:ED', 1);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:02', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:03', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:02:9C', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:0B', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:05:1A', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:8C', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:04', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:5E', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:AC', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:54', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:6A', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:CB', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:4B', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:5A', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:A9', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:7C', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:E0', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:20:AF', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:26:54', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:1E', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:04', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:99', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:50:DA', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:08', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:8C', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:97', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:04', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:A0:24', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:96', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:D0:D8', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '02:60:60', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '02:60:8C', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '02:C0:8C', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '08:00:4E', 3);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:00:63', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:0D', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:60:B0', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '08:00:09', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '10:00:90', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:CD', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:E6', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:E7', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:EA', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:83', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:57', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:10:83', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:C1', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0E:7F', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:20', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:0A', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:85', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:79', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:21', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:38', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:C2', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:60', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:35', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:6E', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:9D', 2);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:04:5A', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:25', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:41', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0F:66', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:17', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:10', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:BF', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:16:B6', 4);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:00:CD', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:00:F4', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:01:71', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:AE', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:09:41', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0A:47', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:25', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0C:46', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:DA', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:30', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:77', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:20:58', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:30:84', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:90:99', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:A0:D2', 5);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:06:5B', 6);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:08:74', 6);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0B:DB', 6);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:0D:56', 6);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:11:43', 6);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:12:3F', 6);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:13:72', 6);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:14:22', 6);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:15:C5', 6);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:B0:D0', 6);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:C0:4F', 6);
+INSERT INTO `inventory_mac_address` (`mac_address_begin`, `manufacturer`) VALUES ( '00:03:5C', 7);
+
+
diff --git a/www/modules/inventory/sql/menu.sql b/www/modules/inventory/sql/menu.sql
new file mode 100644
index 0000000000000000000000000000000000000000..3107dc7215aa6e1ef2290ea5ea8868db7de1bf5a
--- /dev/null
+++ b/www/modules/inventory/sql/menu.sql
@@ -0,0 +1,4 @@
+
+INSERT INTO `redirect_pages` VALUES (88, 320, './modules/inventory/inventory_server.php', 1);
+INSERT INTO `redirect_pages` VALUES (89, 321, './modules/inventory/inventory_network_ressource.php', 1);
+INSERT INTO `redirect_pages` VALUES (90, 322, './modules/inventory/inventory_configure.php', 1);
diff --git a/www/modules/purge/deleteDB.pl b/www/modules/purge/deleteDB.pl
new file mode 100644
index 0000000000000000000000000000000000000000..ba522e2fb7b38e0697de1366bbc18b427d0c91fd
--- /dev/null
+++ b/www/modules/purge/deleteDB.pl
@@ -0,0 +1,680 @@
+#! /usr/bin/perl -w
+#
+# $Id: purgeDB.pl,v 1.2 2005/07/27 22:21:49 kyo $
+#
+# Oreon's plugins are developped with GPL Licence :
+# http://www.fsf.org/licenses/gpl.txt
+# Developped by : Julien Mathis - Romain Le Merlus
+#
+# Modified by Merethis SARL for perfparse compatibility
+#
+# The Software is provided to you AS IS and WITH ALL FAULTS.
+# OREON makes no representation and gives no warranty whatsoever,
+# whether express or implied, and without limitation, with regard to the quality,
+# safety, contents, performance, merchantability, non-infringement or suitability for
+# any particular or intended purpose of the Software found on the OREON web site.
+# In no event will OREON be liable for any direct, indirect, punitive, special,
+# incidental or consequential damages however they may arise and even if OREON has
+# been previously advised of the possibility of such damages.
+
+##
+## Plugin init
+##
+
+use strict;
+use DBI;
+use vars qw($dbh $opt_V $opt_h $opt_f $opt_sf);
+use FileHandle;
+use Getopt::Long;
+
+##
+## lock file must be set in PutLogInDB.pl !
+##
+
+my $NagiosInstallFolder = "/usr/local/nagios/";
+my $file_lock = "/usr/local/nagios/var/purge.lock";
+
+##
+## Configuration init base oreon
+##
+
+my $User = "root";
+my $Password = "";
+my $DataBase = "purge_oreon";
+my $Host = "localhost";
+
+##
+## Configuration init base perfparse
+##
+
+my $Userpp = "root";
+my $Passwordpp = "";
+my $DataBasepp = "perfparse";
+my $Hostpp = "localhost";
+
+######## init connection database oreon and perfparse #######
+
+my $dbh = DBI->connect("DBI:mysql:database=$DataBase;host=$Host",
+                         "$User", "$Password",
+                         {'RaiseError' => 1});
+
+my $dbpp = DBI->connect("DBI:mysql:database=$DataBasepp;host=$Hostpp",
+                         "$Userpp", "$Passwordpp",
+                         {'RaiseError' => 1});
+##
+## Set this variable to 1 in order to display debug display
+##
+
+my $debug=1;
+
+##
+##
+##
+
+# other function
+
+sub print_usage () {
+    print "Usage:\n";
+    print " ./deleteDB.pl\n";
+    print "   -V (--version)    Plugin version\n";
+    print "   -h (--help)       usage help\n";
+    print "   -f (--force)	Delete Data useless\n";
+}
+
+sub print_help ()
+{
+    print "###########################################\n";
+    print "#                                         #\n";
+    print "#  Copyright (c) 2006 Merethis            #\n";
+    print "#  Bugs to http://www.oreon-services.com  #\n";
+    print "#                                         #\n";
+    print "###########################################\n";
+    print_usage();
+    print "\n";
+}
+
+sub create_lock_file(){
+
+    system("touch  $file_lock") == 0
+	 or die "system touch $file_lock failed: $?";
+}
+
+sub delete_lock_file(){
+    system("rm -rf  $file_lock") == 0
+	or die "system rm $file_lock failed: $?";
+}
+
+sub return_eval($)
+{
+     if (defined($_[0])){
+	 return $_[0];
+      }
+      else
+      {
+	  return "";
+      }
+}
+
+# retrieve and stock all purge_policy
+
+	# define
+my $purge_policy_id = 0;
+my $purge_policy_retention = 1;
+my $purge_policy_raw = 2;
+my $purge_policy_bin = 3;
+my $purge_policy_metric = 4;
+my $purge_policy_service = 5;
+my $purge_policy_host = 6;
+
+my %hashPolicy;
+sub	getPolicy()
+{
+    my $cmd = "SELECT purge_policy_id, purge_policy_retention, purge_policy_raw, purge_policy_bin, ";
+    $cmd .= "purge_policy_metric, purge_policy_service, purge_policy_host FROM purge_policy";
+    my $policy = $dbh->prepare($cmd);
+    if (!$policy) {die "Error:" . $dbh->errstr . "\n";}
+    if (!$policy->execute) {die "Error:" . $dbh->errstr . "\n";}
+
+    while (my @arrPolicy = $policy->fetchrow_array)
+    {
+	$hashPolicy{$arrPolicy[0]} = [@arrPolicy];
+    }
+}
+
+# retrieve and stock all host_id and hostname
+
+my %hashHostname;
+sub	getHostname()
+{
+    my $retrieve_host = "SELECT host_id, host_name from host";
+    my $r_host = $dbh->prepare($retrieve_host);
+    if (!$r_host) {die "Error:" . $dbh->errstr . "\n";}
+    if (!$r_host->execute) {die "Error:" . $dbh->errstr . "\n";}
+    while (my @arrhost = $r_host->fetchrow_array)
+    {
+	$hashHostname{$arrhost[0]} = $arrhost[1];
+    }
+}
+
+my %hashForceHostname;
+sub	getForceHostname()
+{
+    my $retrieve_host = "SELECT host_name from host";
+    my $r_host = $dbh->prepare($retrieve_host);
+    if (!$r_host) {die "Error:" . $dbh->errstr . "\n";}
+    if (!$r_host->execute) {die "Error:" . $dbh->errstr . "\n";}
+    while (my @arrhost = $r_host->fetchrow_array)
+    {
+	$hashForceHostname{$arrhost[0]} = $arrhost[0];
+    }
+}
+
+my %hashForceService;
+sub	getForceService()
+{
+    my $retrieve_service = "SELECT service_description from service";
+    my $r_service = $dbh->prepare($retrieve_service);
+    if (!$r_service) {die "Error:" . $dbh->errstr . "\n";}
+    if (!$r_service->execute) {die "Error:" . $dbh->errstr . "\n";}
+    while (my @arrservice = $r_service->fetchrow_array)
+    {
+	$hashForceService{$arrservice[0]} = $arrservice[0];
+    }
+}
+
+# retrieve purge policy for host
+
+sub getMyHostPolicy($)
+{
+    my $host_id = $_[0];
+
+    while(1)
+    {
+	my $cmd = "SELECT purge_policy_id, host_template_model_htm_id ";
+	$cmd .= "FROM host ";
+	$cmd .= "WHERE host_id = '".$host_id."' LIMIT 1";
+	my $policy = $dbh->prepare($cmd);
+	if (!$policy) {die "Error:" . $dbh->errstr . "\n";}
+	if (!$policy->execute) {die "Error:" . $dbh->errstr . "\n";}
+	my @row = $policy->fetchrow_array;
+	if (defined($row[0]))
+	{return $row[0];}
+	elsif (defined($row[1]))
+	{$host_id = $row[1];}
+	else
+	{last;}
+    }
+    return ("");
+}
+
+# retrieve purge policy for service
+
+sub getMyServicePolicy($)
+{
+    my $service_id = $_[0];
+
+    while(1)
+    {
+	my $cmd = "SELECT purge_policy_id, service_template_model_stm_id ";
+	$cmd .= "FROM service ";
+	$cmd .= "WHERE service_id = '".$service_id."' LIMIT 1";
+	my $policy = $dbh->prepare($cmd);
+	if (!$policy) {die "Error:" . $dbh->errstr . "\n";}
+	if (!$policy->execute) {die "Error:" . $dbh->errstr . "\n";}
+	my @row = $policy->fetchrow_array;
+	if (defined($row[0]))
+	{return $row[0];}
+	elsif (defined($row[1]))
+	{$service_id = $row[1];}
+	else
+	{last;}
+    }
+    return ("");
+}
+
+# retrieve all host for a service
+
+sub getAllMyServiceHosts($)
+{
+    my %hostslist;
+    my $service_id = $_[0];
+    my $cmd = "SELECT host_host_id, hostgroup_hg_id ";
+    $cmd .= "FROM host_service_relation hsr ";
+    $cmd .= "WHERE hsr.service_service_id = '".$service_id."'";
+    my $host = $dbh->prepare($cmd);
+    if (!$host) {die "Error:" . $dbh->errstr . "\n";}
+    if (!$host->execute) {die "Error:" . $dbh->errstr . "\n";}
+
+    my $cmd2 = "";
+    while (my @elem = $host->fetchrow_array)
+    {
+	if ($elem[0])
+	{
+	    $hostslist{$elem[0]} = $hashHostname{$elem[0]};
+	}
+	elsif ($elem[1])
+	{
+	    $cmd2 = "SELECT host_host_id ";
+	    $cmd2 .= "FROM hostgroup_relation hgr ";
+	    $cmd2 .= "WHERE hgr.hostgroup_hg_id = '".$elem[1]."'";
+	    my $hostgroup = $dbh->prepare($cmd2);
+	    if (!$hostgroup) {die "Error:" . $dbh->errstr . "\n";}
+	    if (!$hostgroup->execute) {die "Error:" . $dbh->errstr . "\n";}
+	    while (my @elem2 = $hostgroup->fetchrow_array)
+	    {
+		$hostslist{$elem2[0]} = $hashHostname{$elem2[0]};
+	    }
+
+	}
+    }
+    return %hostslist;
+}
+
+########################## elementary delete fonction #########################
+
+sub delete_bin(@)
+{
+    my $host_name = $_[0];
+    my $svc_desc = $_[1];
+    my $metric = $_[2];
+    my $retain = $_[3];
+    my $cmd = "DELETE from perfdata_service_bin where host_name = \'$host_name\'";
+    if ($svc_desc ne ""){
+	$cmd .= " and service_description = \'$svc_desc\'";}
+    if ($metric ne ""){
+	$cmd .= " and metric = \'$metric\'";}
+    if ($retain ne ""){
+	$cmd .= " and ctime <= \'$retain\'";}
+    if ($debug) {print $cmd . "\n";}
+    my $req = $dbpp->prepare($cmd);
+    if (!$req) {die "Error:" . $dbpp->errstr . "\n";}
+    if (!$req->execute) {die "Error:" . $dbpp->errstr . "\n";}
+}
+
+sub delete_raw(@)
+{
+    my $host_name = $_[0];
+    my $svc_desc = $_[1];
+    my $retain = $_[2];
+
+    my $cmd = "DELETE from perfdata_service_raw where host_name = \'$host_name\'";
+    if ($svc_desc ne ""){
+	$cmd .= " and service_description = \'$svc_desc\'";}
+    if ($retain ne ""){
+	$cmd .= " and ctime <= \'$retain\'";}
+    if ($debug) {print $cmd . "\n";}
+    my $req = $dbpp->prepare($cmd);
+    if (!$req) {die "Error:" . $dbpp->errstr . "\n";}
+    if (!$req->execute) {die "Error:" . $dbpp->errstr . "\n";}
+}
+
+sub delete_metric(@)
+{
+    my $host_name = $_[0];
+    my $svc_desc = $_[1];
+    my $metric = $_[2];
+    my $cmd = "DELETE from perfdata_service_metric where host_name = \'$host_name\'";
+    if ($svc_desc ne ""){
+	$cmd .= " and service_description = \'$svc_desc\'";}
+    if ($metric ne ""){
+	$cmd .= " and metric = \'$metric\'";}
+    if ($debug) {print $cmd . "\n";}
+    my $req = $dbpp->prepare($cmd);
+    if (!$req) {die "Error:" . $dbpp->errstr . "\n";}
+    if (!$req->execute) {die "Error:" . $dbpp->errstr . "\n";}
+}
+
+sub delete_raw_summary($)
+{
+    my $id_service = $_[0];
+    my $cmd = "DELETE from perfdata_raw_summary where service_id = \'$id_service\'";
+    if ($debug) {print $cmd . "\n";}
+    my $req = $dbpp->prepare($cmd);
+    if (!$req) {die "Error:" . $dbpp->errstr . "\n";}
+    if (!$req->execute) {die "Error:" . $dbpp->errstr . "\n";}
+}
+
+sub delete_raw_summary_data($)
+{
+    my $id_service = $_[0];
+    my $cmd = "DELETE from perfdata_raw_summary_data where service_id = \'$id_service\'";
+    if ($debug) {print $cmd . "\n";}
+    my $req = $dbpp->prepare($cmd);
+    if (!$req) {die "Error:" . $dbpp->errstr . "\n";}
+    if (!$req->execute) {die "Error:" . $dbpp->errstr . "\n";}
+}
+
+sub search_raw_summary(@)
+{
+    my $host_name = $_[0];
+    my $svc_desc = $_[1];
+
+    my $cmd = "SELECT service_id from perfdata_service where host_name = \'$host_name\'";
+    if ($svc_desc ne ""){
+	$cmd .= " and service_description = \'$svc_desc\'";}
+    if ($debug) {print $cmd . "\n";}
+    my $req = $dbpp->prepare($cmd);
+    if (!$req) {die "Error:" . $dbpp->errstr . "\n";}
+    if (!$req->execute) {die "Error:" . $dbpp->errstr . "\n";}
+    while (my @row_ary  = $req->fetchrow_array)
+    {
+	delete_raw_summary_data($row_ary[0]);
+	delete_raw_summary($row_ary[0]);
+    }
+}
+
+sub delete_service(@)
+{
+    my $host_name = $_[0];
+    my $svc_desc = $_[1];
+
+    #delete raw summary
+    search_raw_summary($host_name, $svc_desc);
+    #
+    my $cmd = "DELETE from perfdata_service where host_name = \'$host_name\'";
+    if ($svc_desc ne ""){
+	$cmd .= " and service_description = \'$svc_desc\'";}
+    if ($debug) {print $cmd . "\n";}
+    my $req = $dbpp->prepare($cmd);
+    if (!$req) {die "Error:" . $dbpp->errstr . "\n";}
+    if (!$req->execute) {die "Error:" . $dbpp->errstr . "\n";}
+}
+
+sub delete_host($)
+{
+    my $host_name = $_[0];
+    my $cmd = "DELETE from perfdata_host where host_name = \'$host_name\'";
+    if ($debug) {print $cmd . "\n";}
+    my $req = $dbpp->prepare($cmd);
+    if (!$req) {die "Error:" . $dbpp->errstr . "\n";}
+    if (!$req->execute) {die "Error:" . $dbpp->errstr . "\n";}
+
+}
+
+################## end of elementary delete fonction #####################
+################ delete dust use of perfparse-db-purge #########################
+
+sub is_delete_host($)
+{
+    my $host_id_pp = $_[0];
+    my $cmd_del = "UPDATE perfdata_host SET is_deleted=1 where host_id = '".$host_id_pp."'";
+    if ($debug) {print $cmd_del. "\n";}
+    my $req = $dbpp->prepare($cmd_del);
+    if (!$req) {die "Error:" . $dbpp->errstr . "\n";}
+    if (!$req->execute) {die "Error:" . $dbpp->errstr . "\n";}
+}
+
+sub check_data_host()
+{
+    getForceHostname();
+    my $cmd = "SELECT host_id, host_name from perfdata_host";
+    if ($debug) {print $cmd. "\n";}
+    my $req = $dbpp->prepare($cmd);
+    if (!$req) {die "Error:" . $dbpp->errstr . "\n";}
+    if (!$req->execute) {die "Error:" . $dbpp->errstr . "\n";}
+    while (my @host_ary = $req->fetchrow_array)
+    {
+	if (!defined($hashForceHostname{$host_ary[1]}))
+	{
+	    is_delete_host($host_ary[0]);
+	}
+    }
+}
+
+sub is_delete_service($)
+{
+    my $service_id_pp = $_[0];
+    my $cmd_del = "UPDATE perfdata_service SET is_deleted=1 where service_id = '".$service_id_pp."'";
+    if ($debug) {print $cmd_del. "\n";}
+    my $req = $dbpp->prepare($cmd_del);
+    if (!$req) {die "Error:" . $dbpp->errstr . "\n";}
+    if (!$req->execute) {die "Error:" . $dbpp->errstr . "\n";}
+}
+
+sub check_data_service()
+{
+    getForceService();
+    my $cmd = "SELECT service_id, service_description from perfdata_service";
+    if ($debug) {print $cmd. "\n";}
+    my $req = $dbpp->prepare($cmd);
+    if (!$req) {die "Error:" . $dbpp->errstr . "\n";}
+    if (!$req->execute) {die "Error:" . $dbpp->errstr . "\n";}
+    while (my @service_ary = $req->fetchrow_array)
+    {
+	if (!defined($hashForceService{$service_ary[1]}))
+	{
+	    is_delete_service($service_ary[0]);
+	}
+    }
+}
+
+sub complete_deletion()
+{
+    if ($Passwordpp ne "") {
+	system($NagiosInstallFolder."bin/perfparse-db-purge -D $DataBasepp -U $Userpp -P $Passwordpp -H $Hostpp");
+    }else{
+	system($NagiosInstallFolder."bin/perfparse-db-purge -D $DataBasepp -U $Userpp -H $Hostpp");}
+}
+
+
+################ end delete dust #########################
+################ SELF delete dust use of DELETE FROM WHERE  #########################
+
+sub self_check_data_host()
+{
+    getForceHostname();
+    my $cmd = "SELECT host_name from perfdata_host";
+    if ($debug) {print $cmd. "\n";}
+    my $req = $dbpp->prepare($cmd);
+    if (!$req) {die "Error:" . $dbpp->errstr . "\n";}
+    if (!$req->execute) {die "Error:" . $dbpp->errstr . "\n";}
+    while (my @host_ary = $req->fetchrow_array)
+    {
+	if (!defined($hashForceHostname{$host_ary[0]}))
+	{
+	    delete_by_host($host_ary[0], "", "", "");
+	}
+    }
+}
+
+sub self_check_data_service()
+{
+    getForceService();
+    my $cmd = "SELECT host_name, service_description from perfdata_service";
+    if ($debug) {print $cmd. "\n";}
+    my $req = $dbpp->prepare($cmd);
+    if (!$req) {die "Error:" . $dbpp->errstr . "\n";}
+    if (!$req->execute) {die "Error:" . $dbpp->errstr . "\n";}
+    while (my @service_ary = $req->fetchrow_array)
+    {
+	if (!defined($hashForceService{$service_ary[1]}))
+	{
+	    delete_by_service($service_ary[0], $service_ary[1], "", "");
+	}
+    }
+}
+
+################ end SELF delete dust #########################
+
+
+
+sub delete_by_host(@)
+{
+    my $hostname = $_[0];
+    my $svc_desc = $_[1];
+    my $metric = $_[2];
+    my $retain = $_[3];
+    delete_bin($hostname, $svc_desc, $metric, $retain);
+    delete_raw($hostname, $svc_desc, $retain);
+    delete_metric($hostname, $svc_desc, $metric);
+    delete_service($hostname, $svc_desc);
+    delete_host($hostname);
+}
+
+sub delete_by_service(@)
+{
+    my $hostname = $_[0];
+    my $svc_desc = $_[1];
+    my $metric = $_[2];
+    my $retain = $_[3];
+
+    delete_bin($hostname, $svc_desc, $metric, $retain);
+    delete_raw($hostname, $svc_desc, $retain);
+    delete_metric($hostname, $svc_desc, $metric);
+    delete_service($hostname, $svc_desc);
+}
+
+sub delete_by_metric(@)
+{
+    my $hostname = $_[0];
+    my $svc_desc = $_[1];
+    my $metric = $_[2];
+    my $retain = $_[3];
+
+    delete_bin($hostname, $svc_desc, $metric, $retain);
+    delete_raw($hostname, $svc_desc, $retain);
+    delete_metric($hostname, $svc_desc, $metric);
+}
+
+sub	make_date($)
+{
+    if ($_[0] ne "")
+    {
+ 	my $timestamp_cur = time;
+	$timestamp_cur -= $_[0];
+	(my $sec,my $min, my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime($timestamp_cur);
+	$year+=1900;
+	$mon+=1;
+	my $result = "$year-$mon-$mday $hour:$min:$sec";
+	return ($result);
+    }
+}
+
+sub	delete_motor(@)
+{
+    my $id_policy = $_[0];
+    my $hostname = $_[1];
+    my $svc_desc = $_[2];
+    my $retain = $_[3];
+    my $flag = 0;
+    if ($hashPolicy{$id_policy}[$purge_policy_host] eq "1" && $svc_desc eq "")
+    {
+	delete_by_host($hostname, $svc_desc, "", "");
+	$flag++;
+    }
+    elsif ($hashPolicy{$id_policy}[$purge_policy_service] eq "1")
+    {
+	delete_by_service($hostname, $svc_desc, "", "");
+	$flag++;
+    }
+    elsif ($hashPolicy{$id_policy}[$purge_policy_metric] eq "1")
+    {
+	delete_by_metric($hostname, $svc_desc, "", "");
+	$flag++;
+    }
+    elsif ($flag == 0)
+    {
+	if ($hashPolicy{$id_policy}[$purge_policy_raw] eq "1")
+	{
+	    delete_raw($hostname, $svc_desc, $retain);
+	}
+	if ($hashPolicy{$id_policy}[$purge_policy_bin] eq "1")
+	{
+	    delete_bin($hostname, $svc_desc, "", $retain);
+	}
+    }
+}
+
+# purge hosts
+
+my $cmd_host = "SELECT host_id, host_name ";
+$cmd_host .= "FROM host ";
+$cmd_host .= "WHERE host_register = \'1\' ";
+my $host = $dbh->prepare($cmd_host);
+if (!$host) {die "Error:" . $dbh->errstr . "\n";}
+if (!$host->execute) {die "Error:" . $dbh->errstr . "\n";}
+
+sub	purge_host()
+{
+    while (my @row_ary = $host->fetchrow_array)
+    {
+	my $id_policy = getMyHostPolicy($row_ary[0]);
+	if ($id_policy ne "")
+	{
+	    my $hostname =  return_eval($row_ary[1]);
+	    my $retain = make_date(return_eval($hashPolicy{$id_policy}[1]));
+	    delete_motor($id_policy, $hostname, "", $retain);
+	}
+	print ".";
+    }
+}
+
+# purge services
+
+my $cmd_service = "SELECT service_id, service_description ";
+$cmd_service .= "FROM service ";
+$cmd_service .= "WHERE service_register = \'1\' ";
+my $svc = $dbh->prepare($cmd_service);
+if (!$svc) {die "Error:" . $dbh->errstr . "\n";}
+if (!$svc->execute) {die "Error:" . $dbh->errstr . "\n";}
+
+sub	purge_service()
+{
+    while (my @svc_ary = $svc->fetchrow_array)
+    {
+	my $id_policy = getMyServicePolicy($svc_ary[0]);
+	if ($id_policy ne ""){
+	    my %hostslist = getAllMyServiceHosts($svc_ary[0]);
+	    my $retain = make_date(return_eval($hashPolicy{$id_policy}[1]));
+	    while ((my $clef, my $valeur) = each(%hostslist)) {
+		delete_motor($id_policy, $valeur, $svc_ary[1], $retain);
+	    }
+	}
+	print ".";
+    }
+}
+
+sub	main()
+{
+    create_lock_file();
+    if ($opt_f)
+    {
+	check_data_host();
+	check_data_service();
+	complete_deletion();
+    }
+    elsif ($opt_sf)
+    {
+	self_check_data_host();
+	self_check_data_service();
+    }
+    autoflush STDOUT 1;
+    getPolicy();
+    getHostname();
+    purge_host();
+    purge_service();
+    delete_lock_file();
+    print "Finish!\n";
+}
+
+Getopt::Long::Configure('bundling');
+GetOptions
+    ("h" => \$opt_h,
+     "help" => \$opt_h,
+     "V" => \$opt_V,
+     "version" => \$opt_V,
+     "f" => \$opt_f,
+     "force" => \$opt_f,
+     "self" => \$opt_sf);
+
+if ($opt_h) {
+    print_help();
+    exit(0);
+}
+
+if ($opt_V) {
+    print "Version plugin V1.0.2 (2006/07/06)\n";
+    exit(0);
+}
+
+main();
diff --git a/www/oreon.php b/www/oreon.php
new file mode 100644
index 0000000000000000000000000000000000000000..67dc9c99ad894804af498cacfed2757912d40404
--- /dev/null
+++ b/www/oreon.php
@@ -0,0 +1,70 @@
+<?
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+	# xdebug_start_trace();
+	
+	# Clean Var	
+	if (isset($_GET["p"]))
+		$p = $_GET["p"];
+	else if (isset($_POST["p"]))
+		$p = $_POST["p"];
+	if (isset($_GET["o"]))
+		$o = $_GET["o"];
+	else if (isset($_POST["o"]))
+		$o = $_POST["o"];
+	else
+		$o = NULL;
+	if (isset($_GET["min"]))
+		$min = $_GET["min"];
+	else if (isset($_POST["min"]))
+		$min = $_POST["min"];
+	else
+		$min = NULL;
+
+	if (isset($_GET["AutoLogin"]) && $_GET["AutoLogin"])
+		print $_GET["AutoLogin"];
+		 
+	# header html
+	require_once ("./header.php");
+
+	# Menu
+	if (!$min)
+		require_once ("menu/Menu.php");
+
+	$rq = "SELECT topology_parent,topology_name,topology_id, topology_url FROM topology WHERE topology_page = '".$p."'";
+	$res =& $pearDB->query($rq);
+	$redirect =& $res->fetchRow();
+	
+	if($min != 1)
+		include("pathWay.php");
+	
+	if (file_exists($redirect["topology_url"]) && array_key_exists($redirect["topology_id"], $oreon->user->lcaTopo))
+		require_once($redirect["topology_url"]);
+	else
+		require_once("./alt_error.php");
+?>
+
+			</td>
+		</tr>
+	</table>
+</div><!-- end contener -->
+<?
+	if (!$min)
+		require_once("footer.php");
+?>
\ No newline at end of file
diff --git a/www/pathWay.php b/www/pathWay.php
new file mode 100644
index 0000000000000000000000000000000000000000..f01c49ac07663cb94c5bfae5c393ad26a97c1b1a
--- /dev/null
+++ b/www/pathWay.php
@@ -0,0 +1,89 @@
+<?php
+/**
+Oreon is developped with GPL Licence 2.0 :
+http://www.gnu.org/licenses/gpl.txt
+Developped by : Julien Mathis - Romain Le Merlus - Christophe Coraboeuf
+
+Adapted to Pear library by Merethis company, under direction of Cedrick Facon, Romain Le Merlus, Julien Mathis
+
+The Software is provided to you AS IS and WITH ALL FAULTS.
+OREON makes no representation and gives no warranty whatsoever,
+whether express or implied, and without limitation, with regard to the quality,
+safety, contents, performance, merchantability, non-infringement or suitability for
+any particular or intended purpose of the Software found on the OREON web site.
+In no event will OREON be liable for any direct, indirect, punitive, special,
+incidental or consequential damages however they may arise and even if OREON has
+been previously advised of the possibility of such damages.
+
+For information : contact@oreon-project.org
+*/
+
+	if (!isset($oreon))
+		exit();
+
+	function getTopologyParent($p)	{
+		global $pearDB;
+		$rqPath = "SELECT topology_url, topology_url_opt, topology_parent, topology_id, topology_name, topology_page FROM topology WHERE topology_page = '".$p."' ORDER BY topology_page";
+		$resPath =& $pearDB->query($rqPath);
+		$redirectPath =& $resPath->fetchRow();
+		return $redirectPath;
+	}
+	
+	$tab = getTopologyParent($p);
+	$tabPath = array();
+	$tabPath[$tab["topology_page"]] = array();
+	$tabPath[$tab["topology_page"]]["name"] = $lang[$tab["topology_name"]];
+	$tabPath[$tab["topology_page"]]["opt"] = $tab["topology_url_opt"];
+	$tabPath[$tab["topology_page"]]["page"] = $tab["topology_page"];
+
+	while($tab["topology_parent"]){
+		$tab = getTopologyParent($tab["topology_parent"]);
+		$tabPath[$tab["topology_page"]] = array();
+		$tabPath[$tab["topology_page"]]["name"] = $lang[$tab["topology_name"]];
+		$tabPath[$tab["topology_page"]]["opt"] = $tab["topology_url_opt"];
+		$tabPath[$tab["topology_page"]]["page"] = $tab["topology_page"];
+	}
+	ksort($tabPath);
+
+	$res =& $pearDB->query("SELECT * FROM topology WHERE topology_page = '".$p."'");
+	$res->fetchInto($current);
+	
+	if ($current["topology_url_opt"])
+		$req = "SELECT * FROM topology WHERE topology_url = '".$current["topology_url"]."' AND topology_url_opt = '".$current["topology_url_opt"]."' AND topology_page > '".$p."' ORDER BY topology_page ASC";
+	else
+		$req = "SELECT * FROM topology WHERE topology_url = '".$current["topology_url"]."' AND topology_url_opt is NULL AND topology_page > '".$p."' ORDER BY topology_page ASC";
+	$res =& $pearDB->query($req);
+	while ($res->fetchInto($new_url)){
+		if (isset($lang[$new_url["topology_name"]]))
+			$tabPath[$new_url["topology_page"]] = array();
+			$tabPath[$new_url["topology_page"]]["name"] = $lang[$new_url["topology_name"]];
+			$tabPath[$new_url["topology_page"]]["opt"] = $new_url["topology_url_opt"];
+			$tabPath[$new_url["topology_page"]]["page"] = $new_url["topology_page"];
+	}
+	
+
+	
+	$tmp = array();
+	foreach($tabPath as $k => $v){
+		$ok = 0;
+		foreach ($tmp as $key => $value)
+			if ($value["name"] == $v["name"])
+				$ok = 1;
+		if ($ok == 0)
+			$tmp[$k] = $v;
+	}
+	$tabPath = $tmp;
+	
+	$flag = '&nbsp;<img src="./img/icones/8x14/pathWayBlueStart.png" alt="" class="imgPathWay">&nbsp;';
+	foreach ($tabPath as $cle => $valeur){
+		echo $flag;
+		?><a href="oreon.php?p=<? echo $cle.$valeur["opt"]; ?>" class="pathWay" ><? echo $valeur["name"]; ?></a><?
+		$flag = '&nbsp;<img src="./img/icones/8x14/pathWayBlue.png" alt="" class="imgPathWay">&nbsp;';
+	}
+
+	if(isset($_GET["host_id"]))	{
+		echo '&nbsp;<img src="./img/icones/8x14/pathWayBlue.png" alt="" class="imgPathWay">&nbsp;';
+		echo getMyHostName($_GET["host_id"]);
+	}
+?>
+<hr><br>
\ No newline at end of file
diff --git a/www/robots.txt b/www/robots.txt
new file mode 100644
index 0000000000000000000000000000000000000000..70c2374d7b6ba4aaca3d91abbe29d86659bdd4e5
--- /dev/null
+++ b/www/robots.txt
@@ -0,0 +1,2 @@
+User-agent: *
+Disallow: /
diff --git a/www/stat.php b/www/stat.php
new file mode 100644
index 0000000000000000000000000000000000000000..ad5df493060116f6f72d85c368e49a9c0229272d
--- /dev/null
+++ b/www/stat.php
@@ -0,0 +1,183 @@
+<?php
+//
+// phpSysInfo - A PHP System Information Script
+// http://phpsysinfo.sourceforge.net/
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+//
+// $Id: stat.php,v 1.1 2005/11/30 23:57:14 julio234 Exp $
+//
+
+// our version number
+$VERSION="2.1";
+
+// reassign HTTP variables (incase register_globals is off)
+if (!empty($HTTP_GET_VARS)) while(list($name, $value) = each($HTTP_GET_VARS)) $$name = $value;
+if (!empty($HTTP_POST_VARS)) while(list($name, $value) = each($HTTP_POST_VARS)) $$name = $value;
+
+// Check to see if where running inside of phpGroupWare
+if (isset($sessionid) && $sessionid && $kp3 && $domain) {
+    define('PHPGROUPWARE', 1);
+    $phpgw_info['flags'] = array(
+        'currentapp' => 'phpsysinfo-dev'
+    );
+    include('../header.inc.php');
+} else {
+    define('PHPGROUPWARE', 0);
+}
+
+define('APP_ROOT', dirname(__FILE__));
+
+// check to see if we have a random template first
+if (isset($template) && $template == 'random') {
+    $dir = opendir('sysinfo/templates/');
+    while (($file = readdir($dir))!=false) {
+        if ($file != 'CVS' && $file != '.' && $file != '..') {
+            $buf[] = $file;
+        }
+    }
+    $template = $buf[array_rand($buf, 1)];
+    $random = True;
+}
+
+    $template = 'classic';
+
+define('TEMPLATE_SET', $template);
+
+// get our current language
+// default to english, but this is negotiable.
+if (!(isset($lng) && file_exists('./sysinfo/includes/lang/' . $oreon->user->get_lang() . '.php'))) {
+    $lng = 'en';
+    // see if the browser knows the right languange.
+    if(isset($HTTP_ACCEPT_LANGUAGE)) {
+        $plng = split(',', $HTTP_ACCEPT_LANGUAGE);
+        if(count($plng) > 0) {
+            while(list($k,$v) = each($plng)) {
+                $k = split(';', $v, 1);
+                $k = split('-', $k[0]);
+                if(file_exists('./sysinfo/includes/lang/' . $k[0] . '.php')) {
+                    $lng = $k[0];
+                    break;
+                }
+            }
+        }
+    }
+}
+
+require('./sysinfo/includes/lang/' . $lng . '.php');   // get our language include
+
+// Figure out which OS where running on, and detect support
+if (file_exists(dirname(__FILE__) . '/sysinfo/includes/os/class.' . PHP_OS . '.inc.php')) {
+    require('./sysinfo/includes/os/class.' . PHP_OS . '.inc.php');
+    $sysinfo = new sysinfo;
+} else {
+    echo '<center><b>Error: ' . PHP_OS . ' is not currently supported</b></center>';
+    exit;
+}
+
+require('./sysinfo/includes/common_functions.php'); // Set of common functions used through out the app
+require('./sysinfo/includes/xml/vitals.php');
+require('./sysinfo/includes/xml/network.php');
+require('./sysinfo/includes/xml/hardware.php');
+require('./sysinfo/includes/xml/memory.php');
+require('./sysinfo/includes/xml/filesystems.php');
+
+$xml = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
+$xml .= "<!DOCTYPE phpsysinfo SYSTEM \"phpsysinfo.dtd\">\n\n";
+$xml .= created_by();
+$xml .= "<phpsysinfo>\n";
+$xml .= "  <Generation version=\"$VERSION\" timestamp=\"" . time() . "\"/>\n";
+$xml .= xml_vitals();
+$xml .= xml_network();
+$xml .= xml_hardware();
+$xml .= xml_memory();
+$xml .= xml_filesystems();
+$xml .= "</phpsysinfo>";
+
+
+if ($template == 'xml') {
+    // just printout the XML and exit
+    print $xml;
+} else {
+    // If they have GD complied into PHP, find out the height of the image to make this cleaner
+    if (function_exists('getimagesize') && $template != 'xml') {
+        $image_prop = getimagesize(APP_ROOT . '/sysinfo/templates/' . TEMPLATE_SET . '/images/bar_middle.gif');
+        define('BAR_HEIGHT', $image_prop[1]);
+        unset($image_prop);
+    } else {
+        // Until they complie GD into PHP, this could look ugly
+        define('BAR_HEIGHT', 16);
+    }
+
+    // Store the current template name in a cookie, set expire date to one month later
+    // Store 'random' if we want a random template
+    if ($random) {
+        setcookie("template", 'random', (time() + 2592000));
+    } else {
+        setcookie("template", $template, (time() + 2592000));
+    }
+
+    if (PHPGROUPWARE != 1) {
+        require('./sysinfo/includes/class.Template.inc.php');  // template library
+    }
+
+    // fire up the template engine
+    $tpl = new Template(dirname(__FILE__) . '/sysinfo/templates/' . TEMPLATE_SET);
+    $tpl->set_file(array(
+        'form' => 'form.tpl'
+    ));
+
+    // print out a box of information
+    function makebox ($title, $content) {
+        $t = new Template(dirname(__FILE__) . '/sysinfo/templates/' . TEMPLATE_SET);
+
+        $t->set_file(array(
+            'box'  => 'box.tpl'
+        ));
+
+        $t->set_var('title', $title);
+        $t->set_var('content', $content);
+
+        return $t->parse('out', 'box');
+    }
+
+    // Fire off the XPath class
+    require('./sysinfo/includes/XPath.class.php');
+    $XPath = new XPath();
+    $XPath->importFromString($xml);
+
+    // let the page begin.
+    require('./sysinfo/includes/system_header.php');
+
+    $tpl->set_var('title', $text['title'] . ': ' . $XPath->getData('/phpsysinfo/Vitals/Hostname') . ' (' . $XPath->getData('/phpsysinfo/Vitals/IPAddr') . ')');
+
+    $tpl->set_var('vitals', makebox($text['vitals'], html_vitals(), '100%'));
+    $tpl->set_var('network', makebox($text['netusage'], html_network(), '100%'));
+    $tpl->set_var('hardware', makebox($text['hardware'], html_hardware(), '100%'));
+    $tpl->set_var('memory', makebox($text['memusage'], html_memory(), '100%'));
+    $tpl->set_var('filesystems', makebox($text['fs'], html_filesystems(), '100%'));
+
+    // parse our the template
+    $tpl->pparse('out', 'form');
+
+    // finally our print our footer
+    if (PHPGROUPWARE == 1) {
+        $phpgw->common->phpgw_footer();
+    } else {
+        require('./sysinfo/includes/system_footer.php');
+    }
+}
+
+?>