Commit c2a5152e authored by dmorley's avatar dmorley

cleanup

parent 1070eac2
......@@ -83,7 +83,7 @@ if ($valid=="1") {
$to = $adminemail;
$cc = $_POST["email"];
$subject = "New pod added to podupti.me ";
$message.= "http://podupti.me\n\n Stats Url: http://api.uptimerobot.com/getMonitors?format=json&customUptimeRatio=7-30-60-90&apiKey=" . $_POST["url"] . "\n\n Pod: http://podupti.me/db/pull.php?debug=1&domain=" . $_POST["domain"] . "\n\n";
$message.= "https://podupti.me\n\n Stats Url: https://api.uptimerobot.com/getMonitors?format=json&customUptimeRatio=7-30-60-90&apiKey=" . $_POST["url"] . "\n\n Pod: https://podupti.me/db/pull.php?debug=1&domain=" . $_POST["domain"] . "\n\n";
$message.= "Your pod will not show right away, needs to pass a few checks, Give it a few hours!";
$headers = "From: ".$_POST["email"]."\r\nReply-To: ".$_POST["email"]."\r\nCc: " . $_POST["email"] . "\r\n";
@mail( $to, $subject, $message, $headers );
......
<?php
include('config.php');
$systemTimeZone = system('date +%Z');
if (!$_POST['domain']){
echo "no pod domain given";
die;
......@@ -28,7 +29,7 @@ if ($_POST['email']){
$uuid = md5(uniqid($domain, true));
$expire = date("Y-m-d H:i:s", time() + 700);
$expire = date("Y-m-d H:i:s", time() + 2700);
$sql = "UPDATE pods SET token=$1, tokenexpire=$2 WHERE domain = '$domain'";
$result = pg_query_params($dbh, $sql, array($uuid,$expire));
if (!$result) {
......@@ -36,7 +37,7 @@ $expire = date("Y-m-d H:i:s", time() + 700);
}
$to = $_POST["email"];
$subject = "Temporary edit key for podupti.me";
$message = "Link: https://podupti.me/db/edit.php?domain=" . $_POST["domain"] . "&token=" . $uuid . " Expires: " . $expire . "\n\n";
$message = "Link: https://podupti.me/db/edit.php?domain=" . $_POST["domain"] . "&token=" . $uuid . " Expires: " . $expire . " " . $systemTimeZone ."\n\n";
$headers = "From: support@diasp.org\r\nBcc: support@diasp.org\r\n";
@mail( $to, $subject, $message, $headers );
......@@ -45,7 +46,7 @@ $expire = date("Y-m-d H:i:s", time() + 700);
} elseif (!$_POST['email']){
$uuid = md5(uniqid($domain, true));
$expire = date("Y-m-d H:i:s", time() + 1700);
$expire = date("Y-m-d H:i:s", time() + 9700);
$sql = "UPDATE pods SET token=$1, tokenexpire=$2 WHERE domain = '$domain'";
$result = pg_query_params($dbh, $sql, array($uuid,$expire));
if (!$result) {
......@@ -53,7 +54,7 @@ $expire = date("Y-m-d H:i:s", time() + 1700);
}
$to = "support@diasp.org";
$subject = "FORWARD REQUEST: Temporary edit key for podupti.me";
$message = "User trying to edit pod without email address. Email found: " . $row["email"] . " Link: https://podupti.me/db/edit.php?domain=" . $_POST["domain"] . "&token=" . $uuid . " Expires: " . $expire . "\n\n";
$message = "User trying to edit pod without email address. Email found: " . $row["email"] . " Link: https://podupti.me/db/edit.php?domain=" . $_POST["domain"] . "&token=" . $uuid . " Expires: " . $expire . " " . $systemTimeZone ."\n\n";
$headers = "From: support@diasp.org\r\nBcc: support@diasp.org\r\n";
@mail( $to, $subject, $message, $headers );
......
......@@ -119,8 +119,9 @@ EOF;
</div>
<div id="info">
Data last refreshed at: <?php echo date("F d Y H:i:s.", filemtime($lastfile)) ?> Pacific Time<br>
Poduptime is run by <a href="https://diasp.org/u/davidmorley" target=_new>David Morley</a> and is open source on <a href="https://github.com/diasporg/Poduptime">GitHub</a> Feel free to contribute with pull requests or bug reports!<br>
Questions on how this works? <a href="https://github.com/diasporg/Poduptime/wiki">Wiki</a><br>
Want more stats? <a href="https://the-federation.info/">https://the-federation.info/</a> | <a href="https://diapod.net/active/">https://diapod.net/active/</a><br>
Poduptime is open source on <a href="https://github.com/diasporg/Poduptime">GitHub</a> Feel free to contribute with pull requests or bug reports!<br>
Questions on how this site works? <a href="https://github.com/diasporg/Poduptime/wiki">Wiki</a><br>
<a href="https://diasporafoundation.org/">More about Diaspora</a><br><a href="http://friendica.com/">More about Friendica</a><br><a href="http://hubzilla.org/">More about Hubzilla(redmatrix)</a>
</div>
<div id="howto" style="display:none; margin-left:50px">
......
......@@ -4,7 +4,7 @@
if (!$dbh) {
die("Error in connection: " . pg_last_error());
}
$sql = "SELECT * FROM pods WHERE adminrating <> -1 AND hidden <> 'yes' AND uptimelast7 > 95 AND status = 'up' AND masterversion = shortversion AND signup = 1 ORDER BY RANDOM() LIMIT 1";
$sql = "SELECT * FROM pods WHERE adminrating <> -1 AND hidden <> 'yes' AND uptimelast7 > 95 AND masterversion = shortversion AND signup = 1 ORDER BY RANDOM() LIMIT 1";
$result = pg_query($dbh, $sql);
if (!$result) {
die("Error in SQL query1: " . pg_last_error());
......
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