Files
archived-web-master/scripts/event-weekly-email
Nikita Popov 2a21449000 Move to public/ directory
Move everything that should be accessible from the webserver into
a public/ directory. Previously the document root was the root
of the repository, which is not great.
2021-04-07 12:12:02 +02:00

30 lines
692 B
Plaintext
Executable File

<?php
/*
This checks for unapproved events, and emails php-webmaster@ if they exist.
It should be checked weekly (via cron).
*/
require dirname(__DIR__).'/include/functions.inc';
db_connect();
$query = 'SELECT COUNT(*) FROM phpcal WHERE NOT approved';
$count = db_get_one($query);
if ($count > 0) {
$subject = "Pending unapproved events notice";
$message = "
Greetings PHP Webmasters;
There are roughly [$count] unapproved events awaiting moderation. Please check the queue:
https://main.php.net/manage/event.php?unapproved=1
Thanks!";
$headers = "From: php-webmaster@lists.php.net";
mail('php-webmaster@lists.php.net', $subject, $message, $headers, "-fnoreply@php.net");
}