Unverified Commit 9b0f7215 authored by Armando Lüscher's avatar Armando Lüscher Committed by GitHub

Merge pull request #177 from diasporg/gocookie

Simple cookie hint
parents 3cd60e3e 68f7a2e8
......@@ -48,7 +48,7 @@ try {
if (!(new CrawlerDetect())->isCrawler()) {
R::store($c);
}
setcookie("domain", $domain, Carbon::now()->addCentury()->timestamp);
header('Location: https://' . $domain);
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
......
......@@ -47,8 +47,11 @@ 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}.";
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>';
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>';
}
echo '<td>' . $pod['uptime_alltime'] . '%</td>';
if ($pod['active_users_halfyear'] > 0) {
echo '<td data-toggle="tooltip" data-placement="bottom" title="Active users six months: ' . $pod['active_users_halfyear'] . ', Active users one month: ' . $pod['active_users_monthly'] . '">' . $pod['active_users_halfyear'] . '</td>';
......
......@@ -59,8 +59,11 @@ 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}";
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>';
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>';
}
if ($pod['shortversion'] > $pod['masterversion']) {
$version = $pod['shortversion'];
......
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