Commit c2a5152e authored by dmorley's avatar dmorley
Browse files

cleanup

parent 1070eac2
...@@ -83,7 +83,7 @@ if ($valid=="1") { ...@@ -83,7 +83,7 @@ if ($valid=="1") {
$to = $adminemail; $to = $adminemail;
$cc = $_POST["email"]; $cc = $_POST["email"];
$subject = "New pod added to podupti.me "; $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!"; $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"; $headers = "From: ".$_POST["email"]."\r\nReply-To: ".$_POST["email"]."\r\nCc: " . $_POST["email"] . "\r\n";
@mail( $to, $subject, $message, $headers ); @mail( $to, $subject, $message, $headers );
......
<?php <?php
include('config.php'); include('config.php');
$systemTimeZone = system('date +%Z');
if (!$_POST['domain']){ if (!$_POST['domain']){
echo "no pod domain given"; echo "no pod domain given";
die; die;
...@@ -28,7 +29,7 @@ if ($_POST['email']){ ...@@ -28,7 +29,7 @@ if ($_POST['email']){
$uuid = md5(uniqid($domain, true)); $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'"; $sql = "UPDATE pods SET token=$1, tokenexpire=$2 WHERE domain = '$domain'";
$result = pg_query_params($dbh, $sql, array($uuid,$expire)); $result = pg_query_params($dbh, $sql, array($uuid,$expire));
if (!$result) { if (!$result) {
...@@ -36,7 +37,7 @@ $expire = date("Y-m-d H:i:s", time() + 700); ...@@ -36,7 +37,7 @@ $expire = date("Y-m-d H:i:s", time() + 700);
} }
$to = $_POST["email"]; $to = $_POST["email"];
$subject = "Temporary edit key for podupti.me"; $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"; $headers = "From: support@diasp.org\r\nBcc: support@diasp.org\r\n";
@mail( $to, $subject, $message, $headers ); @mail( $to, $subject, $message, $headers );
...@@ -45,7 +46,7 @@ $expire = date("Y-m-d H:i:s", time() + 700); ...@@ -45,7 +46,7 @@ $expire = date("Y-m-d H:i:s", time() + 700);
} elseif (!$_POST['email']){ } elseif (!$_POST['email']){
$uuid = md5(uniqid($domain, true)); $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'"; $sql = "UPDATE pods SET token=$1, tokenexpire=$2 WHERE domain = '$domain'";
$result = pg_query_params($dbh, $sql, array($uuid,$expire)); $result = pg_query_params($dbh, $sql, array($uuid,$expire));
if (!$result) { if (!$result) {
...@@ -53,7 +54,7 @@ $expire = date("Y-m-d H:i:s", time() + 1700); ...@@ -53,7 +54,7 @@ $expire = date("Y-m-d H:i:s", time() + 1700);
} }
$to = "support@diasp.org"; $to = "support@diasp.org";
$subject = "FORWARD REQUEST: Temporary edit key for podupti.me"; $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"; $headers = "From: support@diasp.org\r\nBcc: support@diasp.org\r\n";
@mail( $to, $subject, $message, $headers ); @mail( $to, $subject, $message, $headers );
......
...@@ -119,8 +119,9 @@ EOF; ...@@ -119,8 +119,9 @@ EOF;
</div> </div>
<div id="info"> <div id="info">
Data last refreshed at: <?php echo date("F d Y H:i:s.", filemtime($lastfile)) ?> Pacific Time<br> 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> 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>
Questions on how this works? <a href="https://github.com/diasporg/Poduptime/wiki">Wiki</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> <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>
<div id="howto" style="display:none; margin-left:50px"> <div id="howto" style="display:none; margin-left:50px">
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
if (!$dbh) { if (!$dbh) {
die("Error in connection: " . pg_last_error()); 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); $result = pg_query($dbh, $sql);
if (!$result) { if (!$result) {
die("Error in SQL query1: " . pg_last_error()); 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