Armando L. Caro, Jr. wrote:
For each project creation, I would like to setup our Savane server to
automatically create a mailing list for cvs/svn commits and
automatically configure cvs/svn to send mail to that list when commits
occur. Has anyone written such a script(s)? I thought I'd ask before I
take up the task of writing my own.
Thanks.
See my attached admin/proj_email.txt for the creation of the
mailinglist. However I still manually have to configure the sending of
the emails.
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Rudy Gevaert e-mail: [EMAIL PROTECTED]
Directie ICT, Afdeling Infrastructuur
Groep Systemen tel: +32 9 264 4734
Universiteit Gent / Ghent University fax: +32 9 264 4994
Krijgslaan 281, gebouw S9, 9000 Gent, Belgie www.UGent.be
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
<?php
// This file is part of the Savane project
// <http://gna.org/projects/savane/>
//
// $Id: proj_email.txt,v 1.3 2005/12/01 09:15:12 rgevaert Exp $
//
// Savannah - Project registration STEP 6 Confirmation mail
// Here, you can configure the mail sent to user and admins.
// BEWARE, this file content must be PHP, with no parse-error.
// Do not modify it until you really know what you're doing.
//
// we include this as function, it's easier to work with vars
// in this way
function approval_gen_email ($group_name, $unix_group_name) {
// When sending the approval mail, create a mailing list for cvs commits
$group_id = group_getid($unix_group_name);
$list_password = substr(md5($GLOBALS['session_hash'] . time() .
rand(0,40000)),0,16);
$admins = db_query("SELECT user.user_id AS user_id,user.user_name AS
user_name, user.realname AS realname, user.email AS email FROM user,user_group
WHERE user_group.user_id=user.user_id AND user_group.group_id=".$group_id." AND
user_group.admin_flags = 'A'");
$row_admins = db_fetch_array($admins);
$sql = "INSERT INTO mail_group_list "
. "(group_id,list_name,is_public,password,list_admin,status,description)
VALUES ('"
. $group_id."',"
. "'".$unix_group_name."-commit',"
. "'1',"
. "'$list_password',"
. "'".$row_admins[user_id]."',"
. "1,"
. "'".htmlspecialchars("Commits on the $group_name repositories.")."')";
db_query($sql);
$message = '
Your project registration for '.$GLOBALS['sys_name'].' has been approved.
Project Full Name: '.$group_name.'
Project System Name: '.$unix_group_name.'
Project page: '.$GLOBALS['sys_home'].'projects/'.$unix_group_name.'
Please note that it may take a few hours for the system files to
be updated (CVS repository creation for instance) after receiving this mail.
Enjoy the system, and please tell others about '.$GLOBALS['sys_name'].'. Let us
know if there is anything we can do to help you.
-- the '.$GLOBALS['sys_name'].' team
';
return $message;
}
//
?>
_______________________________________________
Savane-help mailing list
[email protected]
https://mail.gna.org/listinfo/savane-help