|
@@ -2,6 +2,9 @@
|
|
|
session_start();
|
|
session_start();
|
|
|
error_reporting(0);
|
|
error_reporting(0);
|
|
|
header('Content-Type: text/html; charset=utf-8');
|
|
header('Content-Type: text/html; charset=utf-8');
|
|
|
|
|
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
|
|
|
|
|
+header("Cache-Control: post-check=0, pre-check=0", false);
|
|
|
|
|
+header("Pragma: no-cache");
|
|
|
?>
|
|
?>
|
|
|
<!DOCTYPE html>
|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
<html>
|
|
@@ -54,6 +57,7 @@ header('Content-Type: text/html; charset=utf-8');
|
|
|
<h1>HTML5 Speedtest - Stats</h1>
|
|
<h1>HTML5 Speedtest - Stats</h1>
|
|
|
<?php
|
|
<?php
|
|
|
include_once("telemetry_settings.php");
|
|
include_once("telemetry_settings.php");
|
|
|
|
|
+require "idObfuscation.php";
|
|
|
if($stats_password=="PASSWORD"){
|
|
if($stats_password=="PASSWORD"){
|
|
|
?>
|
|
?>
|
|
|
Please set $stats_password in telemetry_settings.php to enable access.
|
|
Please set $stats_password in telemetry_settings.php to enable access.
|
|
@@ -61,7 +65,7 @@ if($stats_password=="PASSWORD"){
|
|
|
}else if($_SESSION["logged"]===true){
|
|
}else if($_SESSION["logged"]===true){
|
|
|
if($_GET["op"]=="logout"){
|
|
if($_GET["op"]=="logout"){
|
|
|
$_SESSION["logged"]=false;
|
|
$_SESSION["logged"]=false;
|
|
|
- ?><script type="text/javascript">window.location.search=""</script><?php
|
|
|
|
|
|
|
+ ?><script type="text/javascript">window.location=location.protocol+"//"+location.host+location.pathname;</script><?php
|
|
|
}else{
|
|
}else{
|
|
|
$conn=null;
|
|
$conn=null;
|
|
|
if($db_type=="mysql"){
|
|
if($db_type=="mysql"){
|
|
@@ -76,20 +80,22 @@ if($stats_password=="PASSWORD"){
|
|
|
$conn = new PDO("pgsql:$conn_host;$conn_db;$conn_user;$conn_password");
|
|
$conn = new PDO("pgsql:$conn_host;$conn_db;$conn_user;$conn_password");
|
|
|
}else die();
|
|
}else die();
|
|
|
?>
|
|
?>
|
|
|
- <form action="stats.php?op=logout" method="POST"><input type="submit" value="Logout" /></form>
|
|
|
|
|
- <form action="stats.php?op=id" method="POST">
|
|
|
|
|
|
|
+ <form action="stats.php" method="GET"><input type="hidden" name="op" value="logout" /><input type="submit" value="Logout" /></form>
|
|
|
|
|
+ <form action="stats.php" method="GET">
|
|
|
<h3>Search test results</h6>
|
|
<h3>Search test results</h6>
|
|
|
|
|
+ <input type="hidden" name="op" value="id" />
|
|
|
<input type="text" name="id" id="id" placeholder="Test ID" value=""/>
|
|
<input type="text" name="id" id="id" placeholder="Test ID" value=""/>
|
|
|
<input type="submit" value="Find" />
|
|
<input type="submit" value="Find" />
|
|
|
<input type="submit" onclick="document.getElementById('id').value=''" value="Show last 100 tests" />
|
|
<input type="submit" onclick="document.getElementById('id').value=''" value="Show last 100 tests" />
|
|
|
</form>
|
|
</form>
|
|
|
<?php
|
|
<?php
|
|
|
$q=null;
|
|
$q=null;
|
|
|
- if($_GET["op"]=="id"&&!empty($_POST["id"])){
|
|
|
|
|
- $id=$_POST["id"];
|
|
|
|
|
|
|
+ if($_GET["op"]=="id"&&!empty($_GET["id"])){
|
|
|
|
|
+ $id=$_GET["id"];
|
|
|
|
|
+ if($enable_id_obfuscation) $id=deobfuscateId($id);
|
|
|
if($db_type=="mysql"){
|
|
if($db_type=="mysql"){
|
|
|
$q=$conn->prepare("select id,timestamp,ip,ispinfo,ua,lang,dl,ul,ping,jitter,log,extra from speedtest_users where id=?");
|
|
$q=$conn->prepare("select id,timestamp,ip,ispinfo,ua,lang,dl,ul,ping,jitter,log,extra from speedtest_users where id=?");
|
|
|
- $q->bind_param("i",$_POST["id"]);
|
|
|
|
|
|
|
+ $q->bind_param("i",$id);
|
|
|
$q->execute();
|
|
$q->execute();
|
|
|
$q->store_result();
|
|
$q->store_result();
|
|
|
$q->bind_result($id,$timestamp,$ip,$ispinfo,$ua,$lang,$dl,$ul,$ping,$jitter,$log,$extra);
|
|
$q->bind_result($id,$timestamp,$ip,$ispinfo,$ua,$lang,$dl,$ul,$ping,$jitter,$log,$extra);
|
|
@@ -129,7 +135,7 @@ if($stats_password=="PASSWORD"){
|
|
|
}else die();
|
|
}else die();
|
|
|
?>
|
|
?>
|
|
|
<table>
|
|
<table>
|
|
|
- <tr><th>Test ID</th><td><?=htmlspecialchars($id, ENT_HTML5, 'UTF-8') ?></td></tr>
|
|
|
|
|
|
|
+ <tr><th>Test ID</th><td><?=htmlspecialchars(($enable_id_obfuscation?obfuscateId($id):$id), ENT_HTML5, 'UTF-8') ?></td></tr>
|
|
|
<tr><th>Date and time</th><td><?=htmlspecialchars($timestamp, ENT_HTML5, 'UTF-8') ?></td></tr>
|
|
<tr><th>Date and time</th><td><?=htmlspecialchars($timestamp, ENT_HTML5, 'UTF-8') ?></td></tr>
|
|
|
<tr><th>IP and ISP Info</th><td><?=$ip ?><br/><?=htmlspecialchars($ispinfo, ENT_HTML5, 'UTF-8') ?></td></tr>
|
|
<tr><th>IP and ISP Info</th><td><?=$ip ?><br/><?=htmlspecialchars($ispinfo, ENT_HTML5, 'UTF-8') ?></td></tr>
|
|
|
<tr><th>User agent and locale</th><td><?=$ua ?><br/><?=htmlspecialchars($lang, ENT_HTML5, 'UTF-8') ?></td></tr>
|
|
<tr><th>User agent and locale</th><td><?=$ua ?><br/><?=htmlspecialchars($lang, ENT_HTML5, 'UTF-8') ?></td></tr>
|
|
@@ -148,7 +154,7 @@ if($stats_password=="PASSWORD"){
|
|
|
}else{
|
|
}else{
|
|
|
if($_GET["op"]=="login"&&$_POST["password"]===$stats_password){
|
|
if($_GET["op"]=="login"&&$_POST["password"]===$stats_password){
|
|
|
$_SESSION["logged"]=true;
|
|
$_SESSION["logged"]=true;
|
|
|
- ?><script type="text/javascript">window.location.search=""</script><?php
|
|
|
|
|
|
|
+ ?><script type="text/javascript">window.location=location.protocol+"//"+location.host+location.pathname;</script><?php
|
|
|
}else{
|
|
}else{
|
|
|
?>
|
|
?>
|
|
|
<form action="stats.php?op=login" method="POST">
|
|
<form action="stats.php?op=login" method="POST">
|