Unverified Commit 273678ff authored by dmorley's avatar dmorley

fixes

parent 9b64b7ff
...@@ -52,7 +52,7 @@ $numrows = pg_num_rows($result); ...@@ -52,7 +52,7 @@ $numrows = pg_num_rows($result);
$row['score'] $row['score']
); );
echo '<tr><td><a class="green" target="_self" href="https://' $row['domain'] . '">' . $row['domain'] . '<div title="' . $tip . '" class="tipsy" style="display: inline-block">?</div></a></td>'; echo '<tr><td><a class="text-success" target="_self" href="https://' $row['domain'] . '">' . $row['domain'] . '<div title="' . $tip . '" class="tipsy" style="display: inline-block">?</div></a></td>';
if (stristr($row['shortversion'], 'head')) { if (stristr($row['shortversion'], 'head')) {
$version = '.dev'; $version = '.dev';
...@@ -65,9 +65,9 @@ $numrows = pg_num_rows($result); ...@@ -65,9 +65,9 @@ $numrows = pg_num_rows($result);
$pre = 'This pod runs production code'; $pre = 'This pod runs production code';
} }
if ($row['shortversion'] === $row['masterversion'] && $row['shortversion'] !== '') { if ($row['shortversion'] === $row['masterversion'] && $row['shortversion'] !== '') {
$classver = 'green'; $classver = 'text-success';
} elseif ($verdiff > 6) { } elseif ($verdiff > 6) {
$classver = 'red'; $classver = 'text-warning';
} else { } else {
$classver = 'black'; $classver = 'black';
} }
......
...@@ -29,7 +29,6 @@ if (strlen($_url) < 14) { ...@@ -29,7 +29,6 @@ if (strlen($_url) < 14) {
die('API key bad needs to be like m58978-80abdb799f6ccf15e3e3787ee'); die('API key bad needs to be like m58978-80abdb799f6ccf15e3e3787ee');
} }
$dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass"); $dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass");
$dbh || die('Error in connection: ' . pg_last_error()); $dbh || die('Error in connection: ' . pg_last_error());
...@@ -48,7 +47,6 @@ while ($row = pg_fetch_array($result)) { ...@@ -48,7 +47,6 @@ while ($row = pg_fetch_array($result)) {
} }
} }
//curl the header of pod with and without https
$chss = curl_init(); $chss = curl_init();
curl_setopt($chss, CURLOPT_URL, 'https://' . $_domain . '/nodeinfo/1.0'); curl_setopt($chss, CURLOPT_URL, 'https://' . $_domain . '/nodeinfo/1.0');
curl_setopt($chss, CURLOPT_POST, 0); curl_setopt($chss, CURLOPT_POST, 0);
...@@ -59,13 +57,10 @@ curl_setopt($chss, CURLOPT_NOBODY, 0); ...@@ -59,13 +57,10 @@ curl_setopt($chss, CURLOPT_NOBODY, 0);
$outputssl = curl_exec($chss); $outputssl = curl_exec($chss);
curl_close($chss); curl_close($chss);
$valid = false;
if (stristr($outputssl, 'nodeName')) { if (stristr($outputssl, 'nodeName')) {
$log->lwrite('Your pod has ssl and is valid ' . $_domain); $log->lwrite('Your pod has ssl and is valid ' . $_domain);
echo 'Your pod has ssl and is valid<br>'; echo 'Your pod has ssl and is valid<br>';
$valid = true;
}
if ($valid) {
$sql = 'INSERT INTO pods (domain, stats_apikey, email, terms) VALUES ($1, $2, $3, $4)'; $sql = 'INSERT INTO pods (domain, stats_apikey, email, terms) VALUES ($1, $2, $3, $4)';
$result = pg_query_params($dbh, $sql, [$_domain, $_url, $_email, $_terms]); $result = pg_query_params($dbh, $sql, [$_domain, $_url, $_email, $_terms]);
$result || die('Error in SQL query: ' . pg_last_error()); $result || die('Error in SQL query: ' . pg_last_error());
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
strlen($_token) > 6 || die('bad token'); strlen($_token) > 6 || die('bad token');
// Other parameters. // Other parameters.
$_save = $_GET['save'] ?? ''; $_save = $_GET['save'] ?? '';
$_delete = $_GET['delete'] ?? ''; $_delete = $_GET['delete'] ?? '';
$_weight = $_GET['weight'] ?? ''; $_weight = $_GET['weight'] ?? '';
$_email = $_GET['email'] ?? ''; $_email = $_GET['email'] ?? '';
$_oldemail = $_GET['oldemail'] ?? ''; $_oldemail = $_GET['oldemail'] ?? '';
$_stats_apikey = $_GET['stats_apikey'] ?? ''; $_stats_apikey = $_GET['stats_apikey'] ?? '';
$_terms = $_GET['terms'] ?? ''; $_terms = $_GET['terms'] ?? '';
require_once __DIR__ . '/../config.php'; require_once __DIR__ . '/../config.php';
......
...@@ -42,7 +42,7 @@ $numrows = pg_num_rows($result); ...@@ -42,7 +42,7 @@ $numrows = pg_num_rows($result);
$row['uptime_alltime'], $row['uptime_alltime'],
$row['score'] $row['score']
); );
echo '<tr><td><div title="' . $tip . '" data-toggle="tooltip" data-placement="bottom"><a class="' . $class . ' url" target="_self" href="/go.php?url=https://' . $row['domain'] . '">' . $row['domain'] . '</a></div></td>'; echo '<tr><td><div title="' . $tip . '" data-toggle="tooltip" data-placement="bottom"><a class="text-success' url" target="_self" href="/go.php?url=https://' . $row['domain'] . '">' . $row['domain'] . '</a></div></td>';
echo '<td>' . $row['uptime_alltime'] . '%</td>'; echo '<td>' . $row['uptime_alltime'] . '%</td>';
echo '<td data-toggle="tooltip" data-placement="bottom" title="active six months: ' . $row['active_users_halfyear'] . ', active one month: ' . $row['active_users_monthly'] . '">' . $row['active_users_halfyear'] . '</td>'; echo '<td data-toggle="tooltip" data-placement="bottom" title="active six months: ' . $row['active_users_halfyear'] . ', active one month: ' . $row['active_users_monthly'] . '">' . $row['active_users_halfyear'] . '</td>';
......
...@@ -46,7 +46,7 @@ $numrows = pg_num_rows($result); ...@@ -46,7 +46,7 @@ $numrows = pg_num_rows($result);
$tip = "\n This {$row['softwarename']} pod {$pod_name} has been watched for {$row['monthsmonitored']} months with an overall uptime of {$row['uptime_alltime']}% and a response time average today of {$row['responsetime']}ms was last checked on {$row['dateupdated']}. "; $tip = "\n This {$row['softwarename']} pod {$pod_name} has been watched for {$row['monthsmonitored']} months with an overall uptime of {$row['uptime_alltime']}% and a response time average today of {$row['responsetime']}ms was last checked on {$row['dateupdated']}. ";
$tip .= "On a scale of 100 this pod is a {$row['score']} right now"; $tip .= "On a scale of 100 this pod is a {$row['score']} right now";
echo '<tr><td><a title="' . $tip . '" data-toggle="tooltip" data-placement="bottom" class="' . $class . '" target="_self" href="/go.php?url=https://' . $row['domain'] . '">' . $row['domain'] . '</a></td>'; echo '<tr><td><a title="' . $tip . '" data-toggle="tooltip" data-placement="bottom" class="text-success" target="_self" href="/go.php?url=https://' . $row['domain'] . '">' . $row['domain'] . '</a></td>';
if ($row['shortversion'] > $row['masterversion']) { if ($row['shortversion'] > $row['masterversion']) {
$version = $row['shortversion']; $version = $row['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