From 11666090206b84e97b0cd822ca1053aa9d7f53b3 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 19 Apr 2001 18:59:10 +0000 Subject: - Addition: added new "cvs.module" to display and mail drupal's CVS log messages. Our additional Perl script that hooks into the CVS repository is also provided in ./scripts. Requires a SQL update, see 2.00-to-x.xx.sql. --- modules/cvs.module | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 modules/cvs.module (limited to 'modules/cvs.module') diff --git a/modules/cvs.module b/modules/cvs.module new file mode 100644 index 000000000..5deee6d53 --- /dev/null +++ b/modules/cvs.module @@ -0,0 +1,43 @@ + "cvs_cron", + "conf" => "cvs_conf", + "page" => "cvs_page"); + +function cvs_cron() { + $result = db_query("SELECT * FROM cvs WHERE status = '0' ORDER BY timestamp DESC LIMIT 50"); + + while ($cvs = db_fetch_object($result)) { + $body .= "File: $cvs->files\nDate: ". format_date($cvs->timestamp) ."\nUser: $cvs->user\n\n$cvs->message\n----------------------------------------------------------------------\n"; + } + + $result = db_query("UPDATE cvs SET status = '1'"); + + if ($body) mail(variable_get(cvs_mail, "root@localhost"), "CVS log messages", $body, "From: no-reply"); +} + +function cvs_conf() { + $output .= "Recepient for log messages:
\n"; + $output .= "
\n"; + $output .= "The e-mail address to mail the CVS log messages to. Multiple recipients can be specified by putting a comma between each address.

\n"; + return $output; +} + +function cvs_page() { + global $theme; + + $result = db_query("SELECT * FROM cvs ORDER BY timestamp DESC LIMIT 50"); + + while ($cvs = db_fetch_object($result)) { + $output .= "File: $cvs->files
"; + $output .= "Date: ". format_date($cvs->timestamp) ."
"; + $output .= "User: $cvs->user
"; + $output .= "\n". htmlentities($cvs->message) ."


"; + } + + $theme->header(); + $theme->box("CVS commit messages", "
$output
"); + $theme->footer(); +} + +?> \ No newline at end of file -- cgit v1.2.3