diff --git a/www/templates/layouts/default.php b/www/templates/layouts/default.php index 8998cf0571..b84a85eb00 100644 --- a/www/templates/layouts/default.php +++ b/www/templates/layouts/default.php @@ -1,30 +1,35 @@ - - + + global $USER_EMAIL; + global $supportsAuth; + global $supportsSaml; + global $supportsCPAuth; + global $request_context; + global $_SESSION; + global $client_error; + global $test_is_private; + global $noanalytics; + + $page_title = $page_title ? $page_title : 'WebPageTest'; + $body_class = $body_class ? ' class="' . $body_class . '"' : ''; + + ?> <?php echo $page_title; ?> - - - -
+ + +> + +
- - + + + \ No newline at end of file diff --git a/www/templates/testhistory/user.php b/www/templates/testhistory/user.php new file mode 100644 index 0000000000..40ae4ba187 --- /dev/null +++ b/www/templates/testhistory/user.php @@ -0,0 +1,90 @@ +
+

Test History

+ +
+ + +
+

Test history is available for up to 30 days as long as your storage isn't cleared. By registering for a free account, you can keep test history for longer, compare tests, and review changes. Additionally, you will also be able to post on the WebPageTest Forum and contribute to the discussions there about features, test results and more.

+ " class="btn-primary">Get Free Access +
+ +
+ + + + + + +
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Select to compareURLRun DateRun FromLabel
getUrl() ?>getStartTime()), 'M d, Y g:i:s A e') ?>getLocation() ?>getLabel() ?>
+
+ '; + } + if (isset($priority)) { + echo ''; + } + ?> +
+
+ + \ No newline at end of file diff --git a/www/testlog.php b/www/testlog.php index 293a05f398..fc35adcd55 100644 --- a/www/testlog.php +++ b/www/testlog.php @@ -5,6 +5,7 @@ // found in the LICENSE.md file. require_once __DIR__ . '/common.inc'; +use WebPageTest\Template; use WebPageTest\Util; $host = Util::getSetting('host'); @@ -37,7 +38,7 @@ exit; } -$page_keywords = array('Log','History','WebPageTest','Website Speed Test'); +$page_keywords = array('Log', 'History', 'WebPageTest', 'Website Speed Test'); $page_description = "History of website performance speed tests run on WebPageTest."; $supportsGrep = false; @@ -84,217 +85,129 @@ function check_it($val) } } +// single user history +if (!$cvs && ($is_logged_in || (!isset($user) && !isset($_COOKIE['google_email']) && Util::getSetting('localHistory')))) { + $GLOBALS['tab'] = 'Test History'; + $tpl = new Template('testhistory'); + $tpl->setLayout('default'); + echo $tpl->render('user', array( + 'is_logged_in' => $is_logged_in, + 'protocol' => $protocol, + 'host' => $host, + 'days' => $days, + 'test_history' => $test_history, + 'priority' => $priority, + 'local' => isset($_REQUEST['local']) && $_REQUEST['local'], + 'body_class' => 'history', + 'page_title' => 'WebPageTest - Test History', + )); + exit(); +} + if ($csv) { header("Content-type: text/csv"); echo '"Date/Time","Location","Test ID","URL","Label"' . "\r\n"; -} elseif ($is_logged_in || (!isset($user) && !isset($_COOKIE['google_email']) && Util::getSetting('localHistory'))) { +} else { ?> - - + + + WebPageTest - Test Log - - -
-

Test History

+ + +

Test History

+
- - -
-

Test history is available for up to 30 days as long as your storage isn’t cleared. By registering for a free account, you can keep test history for longer, compare tests, and review changes. Additionally, you will also be able to post on the WebPageTest Forum and contribute to the discussions there about features, test results and more.

- " class="btn-primary">Get Free Access -
- -
- - - - - - - -
-
-
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - -
Select to compareURLRun DateRun FromLabel
getUrl() ?>getStartTime()), 'M d, Y g:i:s A e') ?>getLocation() ?>getLabel() ?>
-
+ test log for URLs containing + +
+    + '; + } if (isset($_REQUEST['local']) && $_REQUEST['local']) { echo ''; } - if (isset($priority)) { - echo ''; - } ?> -
-
- - - - - - - - - - WebPageTest - Test Log - - - - -

Test History

-
-
- View test log for URLs containing - -
- -    - '; - } - if (isset($_REQUEST['local']) && $_REQUEST['local']) { - echo ''; - } - ?> -    - - +    + +
-
-
+
+
- - - - - - - - Requested By'; - } - if ($admin) { - echo ''; - echo ''; - } - ?> - - - - + +
Select to CompareDate/TimeFromUserPage LoadsLabelURL
+ + + + + + Requested By'; + } + if ($admin) { + echo ''; + echo ''; + } + ?> + + + + format("Ymd") . '.log'); if ($fileName !== false) { - // load the log file into an array of lines + // load the log file into an array of lines if (isset($lines)) { unset($lines); } if ($supportsGrep) { - $ok = false; - $patterns = array(); + $ok = false; + $patterns = array(); if (isset($filterstr) && strlen($filterstr)) { $patterns[] = $filterstr; } elseif (!$all) { if (isset($user)) { - $patterns[] = "\t$user\t"; + $patterns[] = "\t$user\t"; } if (isset($owner) && strlen($owner)) { $patterns[] = "\t$owner\t"; @@ -303,11 +216,11 @@ function check_it($val) if (count($patterns)) { $command = "grep -a -i -F"; foreach ($patterns as $pattern) { - $pattern = str_replace('"', '\\"', $pattern); - $command .= " -e " . escapeshellarg($pattern); + $pattern = str_replace('"', '\\"', $pattern); + $command .= " -e " . escapeshellarg($pattern); } - $command .= " '$fileName'"; - exec($command, $lines, $result_code); + $command .= " '$fileName'"; + exec($command, $lines, $result_code); if ($result_code === 0 && is_array($lines) && count($lines)) { $ok = true; } @@ -316,16 +229,16 @@ function check_it($val) $ok = true; } } else { - $ok = true; - $file = file_get_contents($fileName); + $ok = true; + $file = file_get_contents($fileName); if ($filterstr) { $ok = false; if (stristr($file, $filterstr)) { - $ok = true; + $ok = true; } } - $lines = explode("\n", $file); - unset($file); + $lines = explode("\n", $file); + unset($file); } if (count($lines) && $ok) { // walk through them backwards @@ -365,9 +278,9 @@ function check_it($val) if (!$private) { $atPos = strpos($url, '@'); if ($atPos !== false) { - $queryPos = strpos($url, '?'); + $queryPos = strpos($url, '?'); if ($queryPos === false || $queryPos > $atPos) { - $private = 1; + $private = 1; } } } @@ -431,7 +344,7 @@ function check_it($val) } else { echo ''; echo '
Select to CompareDate/TimeFromUserPage LoadsLabelURL
'; - if (isset($guid) && $video && !( $url == "Bulk Test" || $url == "Multiple Locations test" )) { + if (isset($guid) && $video && !($url == "Bulk Test" || $url == "Multiple Locations test")) { echo ""; if ($repeat) { echo ""; @@ -518,10 +431,11 @@ function check_it($val) if (!$csv) { ?>
-
-
- + +
+ - + +