diff --git a/dashboard/changes.txt b/dashboard/changes.txt index 2bba828..2eb06ce 100755 --- a/dashboard/changes.txt +++ b/dashboard/changes.txt @@ -1,3 +1,11 @@ +xlx db v2.3.9 + +redesign for the callinghome.php + +- "config.inc.php" +- "index.php" +- "functions.php" + xlx db v2.3.8 add support for network traffic statistics via vnstat. diff --git a/dashboard/index.php b/dashboard/index.php index a71586a..a8021ab 100755 --- a/dashboard/index.php +++ b/dashboard/index.php @@ -2,8 +2,8 @@ session_start(); -if (file_exists("./pgs/functions.php")) { require_once("./pgs/functions.php"); } else { die("functions.php does not exist."); } -if (file_exists("./pgs/config.inc.php")) { require_once("./pgs/config.inc.php"); } else { die("config.inc.php does not exist."); } +if (file_exists("./pgs/functions.php")) { require_once("./pgs/functions.php"); } else { die("functions.php does not exist."); } +if (file_exists("./pgs/config.inc.php")) { require_once("./pgs/config.inc.php"); } else { die("config.inc.php does not exist."); } if (!class_exists('ParseXML')) require_once("./pgs/class.parsexml.php"); if (!class_exists('Node')) require_once("./pgs/class.node.php"); @@ -19,23 +19,49 @@ $Reflector->SetXMLFile($Service['XMLFile']); $Reflector->LoadXML(); -if ($CallingHome['Active']) { - +if ($CallingHome['Active']) { + $CallHomeNow = false; + $LastSync = 0; + $Hash = ""; + if (!file_exists($CallingHome['HashFile'])) { - $Hash = CreateCode(16); - $LastSync = 0; - UpdateHashFile($CallingHome['HashFile'], $LastSync, $Hash); - $CallHomeNow = true; + $Ressource = fopen($CallingHome['HashFile'], "w+"); + if ($Ressource) { + $Hash = CreateCode(16); + @fwrite($Ressource, "'); + @fflush($Ressource); + @fclose($Ressource); + @chmod($HashFile, 0777); + } } else { - include($CallingHome['HashFile']); - if ($LastSync < (time() - $CallingHome['PushDelay'])) { - UpdateHashFile($CallingHome['HashFile'], time(), $Hash); - $CallHomeNow = true; + require_once($CallingHome['HashFile']); + } + + if (@file_exists($CallingHome['LastCallHomefile'])) { + if (@is_readable($CallingHome['LastCallHomefile'])) { + $tmp = @file($CallingHome['LastCallHomefile']); + if (isset($tmp[0])) { + $LastSync = $tmp[0]; + } + unset($tmp); } } - + + if ($LastSync < (time() - $CallingHome['PushDelay'])) { + $CallHomeNow = true; + $Ressource = @fopen($CallingHome['LastCallHomefile'], "w+"); + if ($Ressource) { + @fwrite($Ressource, time()); + @fflush($Ressource); + @fclose($Ressource); + @chmod($HashFile, 0777); + } + } + if ($CallHomeNow || isset($_GET['callhome'])) { $Reflector->SetCallingHome($CallingHome, $Hash); $Reflector->ReadInterlinkFile(); @@ -43,7 +69,7 @@ if ($CallingHome['Active']) { $Reflector->PrepareReflectorXML(); $Reflector->CallHome(); } - + } else { $Hash = ""; @@ -60,7 +86,7 @@ else { - +