From 9f20c90c320140dbcaa9acfa6a58fea3e40f6806 Mon Sep 17 00:00:00 2001 From: arf20 Date: Sun, 28 Apr 2024 04:30:56 +0200 Subject: Add PHP script for mailing list announcement --- publishannouncement.php | 95 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 publishannouncement.php (limited to 'publishannouncement.php') diff --git a/publishannouncement.php b/publishannouncement.php new file mode 100644 index 0000000..76c934a --- /dev/null +++ b/publishannouncement.php @@ -0,0 +1,95 @@ +fetch_all(MYSQLI_ASSOC); + +/* + * Announce to + * - mailing list (hereby the announcement archive at lists.arf20.com) + * - discord webhook + * - irc (bridged) announcement notice + * - NNTP? + * - phpBB? + * - another, custom, archive ARFNET-ly + */ + +// POST actions +if ($_SERVER["REQUEST_METHOD"] == "POST") { + /* Send email */ + $mailer->addAddress(MAIL_ANNOUNCE_ADDRESS); + $mailer->addReplyTo(getuserbyid($id)["email"]); + $mailer->Subject = "[ARFNET Announcement] ".$_POST["subject"]; + $mailer->Body = $_POST["body"]; + + if (!$mailer->send()) { + echo 'Mailer Error [ask arf20]: ' . $mailer->ErrorInfo; + } else header("location: ".$_SERVER['SCRIPT_NAME']); +} + + +function getuserbyid($id) { + global $users; + foreach ($users as $user) { + if ($user["id"] == $id) { + return $user; + } + } +} + +?> + + + + + + + ARFNET CSTIMS + + +
+ ARFNET +
+
+
+
+
+

ARFNET Client Service Ticket and Invoice Management System

+

panel

+

Publish announcement

+
" method="post"> +
+
+

+
+
+
+
+
+

Logged as

+

Logout

+

Back to admin panel

+
+
+
+ + + -- cgit v1.2.3