6 || die('bad token'); // Other parameters. $_action = $_GET['action'] ?? ''; $_weight = $_GET['weight'] ?? 10; $_email = $_GET['email'] ?? ''; $_podmin_statement = $_GET['podmin_statement'] ?? ''; $_podmin_notify = $_GET['podmin_notify'] ?? 0; require_once __DIR__ . '/../config.php'; $dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass"); $dbh || die('Error in connection: ' . pg_last_error()); $sql = 'SELECT domain,email,token,tokenexpire,weight,podmin_statement,podmin_notify FROM pods WHERE domain = $1'; $result = pg_query_params($dbh, $sql, [$_domain]); $result || die('Error in SQL query: ' . pg_last_error()); while ($row = pg_fetch_array($result)) { $row['token'] === $_token || die('token mismatch'); $row['tokenexpire'] >= date('Y-m-d H:i:s') || die('token expired'); // Delete and exit. if ('delete' === $_action) { $sql = 'DELETE FROM pods WHERE domain = $1'; $result = pg_query_params($dbh, $sql, [$_domain]); $result || die('Error in SQL query: ' . pg_last_error()); die('pod removed from DB'); } // Save and exit if ('save' === $_action) { $_weight <= 10 || die('10 is max weight'); $sql = 'UPDATE pods SET email = $1, weight = $2, podmin_statement = $3, podmin_notify = $4 WHERE domain = $5'; $result = pg_query_params($dbh, $sql, [$_email, $_weight, $_podmin_statement, $_podmin_notify, $_domain]); $result || die('Error in SQL query: ' . pg_last_error()); $to = $_email; $headers = ['From: ' . $adminemail, 'Cc: ' . $row['email'], 'Bcc: ' . $adminemail]; $subject = 'Edit notice from poduptime'; $message = 'Data for ' . $_domain . ' updated. If it was not you reply and let me know!'; @mail($to, $subject, $message, implode("\r\n", $headers)); die('Data saved. Will go into effect on next hourly change'); } // Forms. ?> Authorized to edit until







WARNING: This can not be undone, you will need to add your pod again if you want back on list: