diff --git a/dashboard/changes.txt b/dashboard/changes.txt index 727e0b5..2bba828 100755 --- a/dashboard/changes.txt +++ b/dashboard/changes.txt @@ -1,6 +1,16 @@ +xlx db v2.3.8 + +add support for network traffic statistics via vnstat. + +- "config.inc.php" +- "index.php" +- "functions.php" + +add traffic.php + xlx db v2.3.7 -add background button color change on active page. +add background color change on active page. - "config.inc.php" - "layout.css" diff --git a/dashboard/index.php b/dashboard/index.php index 6509be5..f64d1ab 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"); @@ -12,6 +12,8 @@ if (!class_exists('Station')) require_once("./pgs/class.station.php"); if (!class_exists('Peer')) require_once("./pgs/class.peer.php"); if (!class_exists('Interlink')) require_once("./pgs/class.interlink.php"); +setlocale(LC_ALL, $VNStat['Locale']); + $Reflector = new xReflector(); $Reflector->SetFlagFile("./pgs/country.csv"); $Reflector->SetPIDFile($Service['PIDFile']); @@ -19,38 +21,23 @@ $Reflector->SetXMLFile($Service['XMLFile']); $Reflector->LoadXML(); -if ($CallingHome['Active']) { - +if ($CallingHome['Active']) { + $CallHomeNow = false; if (!file_exists($CallingHome['HashFile'])) { $Hash = CreateCode(16); $LastSync = 0; - $Ressource = @fopen($CallingHome['HashFile'],"w"); - if ($Ressource) { - @fwrite($Ressource, "'); - @fclose($Ressource); - @exec("chmod 777 ".$CallingHome['HashFile']); - $CallHomeNow = true; - } + UpdateHashFile($CallingHome['HashFile'], $LastSync, $Hash); + $CallHomeNow = true; } else { include($CallingHome['HashFile']); - if ($LastSync < (time() - $CallingHome['PushDelay'])) { - $Ressource = @fopen($CallingHome['HashFile'],"w"); - if ($Ressource) { - @fwrite($Ressource, "'); - @fclose($Ressource); - } + if ($LastSync < (time() - $CallingHome['PushDelay'])) { + UpdateHashFile($CallingHome['HashFile'], time(), $Hash); $CallHomeNow = true; } } - + if ($CallHomeNow || isset($_GET['callhome'])) { $Reflector->SetCallingHome($CallingHome, $Hash); $Reflector->ReadInterlinkFile(); @@ -58,14 +45,13 @@ if ($CallingHome['Active']) { $Reflector->PrepareReflectorXML(); $Reflector->CallHome(); } + } else { $Hash = ""; } - - ?> @@ -76,7 +62,7 @@ else { - +