00001 <?php
00002 # This file is part of the Savane project
00003 # <http://gna.org/projects/savane/>
00004 #
00005 # $Id: proj_email.php 5187 2005-12-01 16:22:29Z yeupou $
00006 #
00007 # Copyright 1999-2000 (c) The SourceForge Crew
00008 # Copyright 2000-2003 (c) Free Software Foundation
00009 #
00010 # Copyright 2003-2004 (c) Mathieu Roy <yeupou--at--gnu.org>
00011 #
00012 # The Savane project is free software; you can redistribute it and/or
00013 # modify it under the terms of the GNU General Public License
00014 # as published by the Free Software Foundation; either version 2
00015 # of the License, or (at your option) any later version.
00016 #
00017 # The Savane project is distributed in the hope that it will be useful,
00018 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00020 # GNU General Public License for more details.
00021 #
00022 # You should have received a copy of the GNU General Public License
00023 # along with the Savane project; if not, write to the Free Software
00024 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00025
00026
00027 function send_new_project_email($group_id)
00028 {
00029 $res_grp = db_query("SELECT * FROM groups WHERE group_id='$group_id'");
00030
00031 if (db_numrows($res_grp) < 1) {
00032 echo ("Group [ $group_id ] does not exist. Shame on you, sysadmin.");
00033 }
00034
00035 $row_grp = db_fetch_array($res_grp);
00036
00037 $res_admins = db_query("SELECT user.user_name,user.email FROM user,user_group WHERE "
00038 . "user.user_id=user_group.user_id AND user_group.group_id='$group_id' AND "
00039 . "user_group.admin_flags='A'");
00040
00041 if (db_numrows($res_admins) < 1) {
00042 echo ("Group [ $group_id ] does not seem to have any administrators.");
00043 }
00044
00045 # send one email per admin
00046 utils_get_content("admin/proj_email");
00047 while ($row_admins = db_fetch_array($res_admins)) {
00048 $message = approval_gen_email($row_grp['group_name'],$row_grp['unix_group_name']);
00049
00050
00051 sendmail_mail($GLOBALS['sys_email_adress'],
00052 $row_admins['email'],
00053 "Project Approved",
00054 $message);
00055
00056 }
00057 }
00058
00059 ?>