cvs: SVNROOT / commit-email.php
[email protected] ("Gwynne Raskind") Sat, 20 Dec 2008 19:08:03 -0000
| Newsgroups | svn.migration |
|---|---|
| Message-ID | <cvsgwynne1229800083@cvsserver> |
gwynne Sat Dec 20 19:08:03 2008 UTC
Modified files:
/SVNROOT commit-email.php
Log:
determine from address from user db
http://cvs.php.net/viewvc.cgi/SVNROOT/commit-email.php?r1=1.6&r2=1.7&diff_format=u
Index: SVNROOT/commit-email.php
diff -u SVNROOT/commit-email.php:1.6 SVNROOT/commit-email.php:1.7
--- SVNROOT/commit-email.php:1.6 Sat Dec 20 00:28:43 2008
+++ SVNROOT/commit-email.php Sat Dec 20 19:08:03 2008
@@ -7,7 +7,7 @@
// -----------------------------------------------------------------------------------------------------------------------------
// Constants
-$version = substr('$Revision: 1.6 $', strlen('$Revision: '), -2);
+$version = substr('$Revision: 1.7 $', strlen('$Revision: '), -2);
$smtp_server = '127.0.0.1';
$commit_email_list = array(
// FastCGI ISAPI
@@ -105,7 +105,14 @@
// -----------------------------------------------------------------------------------------------------------------------------
// Determine "from" address
// Various repositories can play with this to read from their equivelant of the old cvsusers folder, or whatever else they like
-$from = '[email protected]';
+$usersDB = file(dirname(__FILE__) . '/users.db');
+foreach ($usersDB as $userline) {
+ list ($username, $fullname, $email) = explode(":", $userline);
+ if ($username == $commit_user) {
+ $from = "\"{$fullname}\" <$email>";
+ break;
+ }
+}
// -----------------------------------------------------------------------------------------------------------------------------
// Build list of e-mail addresses and parent changed path