debian-sf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Debian-sf-devel] Re: [Debian-sf-users] new project notification?


From: Mathieu Peltier
Subject: [Debian-sf-devel] Re: [Debian-sf-users] new project notification?
Date: 11 Sep 2002 11:02:22 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

Roland Mas <address@hidden> writes:

> Mathieu Peltier (2002-08-09 16:46:46 +0200) :
> 
> > Just a question: is the server_admin user supposed to receive a
> > notification when someone submit a new project? 
> 
> Not as far as I know.  That's a feature I've meant to implement at
> some point, though.
> 
> > If yes, which php file does this work in /usr/lib/sourceforge/www/
> > directory?
> 
>   None yet.  Should you want to implement it, I think it sould go in
> the www/register/confirmation.php file.  If you do, please submit a
> patch against the current 2.6 version, and I'll integrate it into the
> package.

Yes, sorry for the delay...

I have submitted a patch for the 2.6 version on savannah.gnu.org. Be careful, I
have *not* really test the code because I have not yet unfortunately a working
installation of debian-sf 2.6 package. The modified file is:
debian-sf/sourceforge/common/include/Group.class

For info, here is also the patch for the 2.5 package (this has been tested!):

Modified files: 
/usr/lib/sourceforge/www/include/proj_email.php
/usr/lib/sourceforge/www/register/confirmation.php

# diff proj_email.php proj_email.php.old
98,131d97
< /*
<  * This function sends out a notification to SourceForge Admin (admin
<  * user) when someone submits a new project.
<  */
< function send_project_notification($group_id)
< {
<         // Get the admin email
<         $admin_email = db_result(db_query("SELECT u.email AS admin_email FROM 
users u WHERE u.user_name='admin';"),0,"admin_email");
<
<         // Get the email addr of the user who wants to register the project.
<         $email = db_result(db_query("SELECT u.email AS email FROM users u, 
user_group ug WHERE ug.group_id='$group_id' AND 
u.user_id=ug.user_id;"),0,"email");
<
<       $res_grp = db_query("SELECT * FROM groups WHERE group_id='$group_id'");
<       if (db_numrows($res_grp) < 1) {
<               echo ("Group [ $group_id ] does not exist. Shame on you, 
sysadmin.");
<       }
<       $row_grp = db_fetch_array($res_grp);
<
<       $message =
< 'New SourceForge project submitted
<
< Project full name: '.$row_grp['group_name'].'
< Submitted description: '.$row_grp[register_purpose].'
< License: '.$row_grp['license'].'
<
< Please visit the following URL to approve or reject this project:
< https://'.$GLOBALS['sys_default_domain'].'/admin/approve-pending.php';
<
<       // send mail
<         mail($admin_email, "New SourceForge project submitted", $message, 
"From: $email");
<
<         return true;
< }
<


# diff confirmation.php confirmation.php.old
13d12
< require ('proj_email.php');
110,112d108
<
<       // send notification to the SourceForge admin
<       send_project_notification($group_id);

-- 
Mathieu Peltier
INRIA Rhône-Alpes - ObjectWeb Consortium
http://www.inrialpes.fr - http://www.objectweb.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]