Commit 68f7a2e8 authored by dmorley's avatar dmorley

set a non-static date

parent d60b588e
......@@ -48,7 +48,7 @@ try {
if (!(new CrawlerDetect())->isCrawler()) {
R::store($c);
}
setcookie("domain", $domain, 2147483647);
setcookie("domain", $domain, Carbon::now()->addCentury()->timestamp);
header('Location: https://' . $domain);
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
......
......@@ -47,7 +47,7 @@ try {
$pod_name = htmlentities($pod['name'], ENT_QUOTES);
$humanmonitored = Carbon::now()->subDays($pod['daysmonitored'])->diffForHumans(null, true);
$tip = "This {$pod['softwarename']} pod's uptime is {$pod['uptime_alltime']}% over {$humanmonitored}.";
if ($_COOKIE["domain"] === $pod['domain']) {
if ($_COOKIE['domain'] ?? null === $pod['domain']) {
echo '<tr><td class="bg-success"><div title="This is the last pod you visited from this site. ' . $tip . '" data-toggle="tooltip" data-placement="bottom"><a class="text-body url" target="_self" href="/go.php?domain=' . $pod['domain'] . '">' . $pod['domain'] . '</a></div></td>';
} else {
echo '<tr><td><div title="' . $tip . '" data-toggle="tooltip" data-placement="bottom"><a class="text-success url" target="_self" href="/go.php?domain=' . $pod['domain'] . '">' . $pod['domain'] . '</a></div></td>';
......
......@@ -59,7 +59,7 @@ try {
$humanlastcheck = (new Carbon($pod['date_updated']))->diffForHumans();
$humansslexpire = (new Carbon($pod['sslexpire']))->diffForHumans();
$tip = "\nOver the last {$humanmonitored} pod uptime was {$pod['uptime_alltime']}% and response time from Los Angeles was {$pod['latency']}ms, with a SSL cert that expires {$humansslexpire}. This pod was last checked {$humanlastcheck}";
if ($_COOKIE["domain"] === $pod['domain']) {
if ($_COOKIE['domain'] ?? null === $pod['domain']) {
echo '<tr><td class="bg-success"><a title="This is the last pod you visited from this site. ' . $tip . '" class="text-body url" data-toggle="tooltip" data-placement="bottom" target="_self" href="/go.php?domain=' . $pod['domain'] . '">' . $pod['domain'] . '</a></td>';
} else {
echo '<tr><td><a title="' . $tip . '" class="text-success url" data-toggle="tooltip" data-placement="bottom" target="_self" href="/go.php?domain=' . $pod['domain'] . '">' . $pod['domain'] . '</a></td>';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment