Commit 54f86104 authored by Mac Newbold's avatar Mac Newbold

Last round of changes so that all proj/group roots get mail about certain

things. Now whenever someone joins a project, it goes to everyone that
can approve them, and when an approval happens, it gets cc'd to the same
list, so they all know it happened and what permissions were given.
parent 589caa98
...@@ -340,10 +340,9 @@ while (list ($header, $value) = each ($HTTP_POST_VARS)) { ...@@ -340,10 +340,9 @@ while (list ($header, $value) = each ($HTTP_POST_VARS)) {
TBUserInfo($uid, $uid_name, $uid_email); TBUserInfo($uid, $uid_name, $uid_email);
# #
# Email info for the group leader too. # Email info for the proj/group leaders too.
# #
TBGroupLeader($project, $group, $groupleader); $leaders = TBLeaderMailList($project,$group);
TBUserInfo($groupleader, $phead_name, $phead_email);
# #
# Well, looks like everything is okay. Change the project membership # Well, looks like everything is okay. Change the project membership
...@@ -374,7 +373,7 @@ while (list ($header, $value) = each ($HTTP_POST_VARS)) { ...@@ -374,7 +373,7 @@ while (list ($header, $value) = each ($HTTP_POST_VARS)) {
"Thanks,\n". "Thanks,\n".
"Testbed Operations\n", "Testbed Operations\n",
"From: $uid_name <$uid_email>\n". "From: $uid_name <$uid_email>\n".
"Cc: $phead_name <$phead_email>\n". "Cc: $leaders\n".
"Bcc: $TBMAIL_AUDIT\n". "Bcc: $TBMAIL_AUDIT\n".
"Errors-To: $TBMAIL_WWW"); "Errors-To: $TBMAIL_WWW");
...@@ -484,7 +483,7 @@ while (list ($header, $value) = each ($HTTP_POST_VARS)) { ...@@ -484,7 +483,7 @@ while (list ($header, $value) = each ($HTTP_POST_VARS)) {
"Thanks,\n". "Thanks,\n".
"Testbed Operations\n", "Testbed Operations\n",
"From: $uid_name <$uid_email>\n". "From: $uid_name <$uid_email>\n".
"Cc: $phead_name <$phead_email>\n". "Cc: $leaders\n".
"Bcc: $TBMAIL_AUDIT\n". "Bcc: $TBMAIL_AUDIT\n".
"Errors-To: $TBMAIL_WWW"); "Errors-To: $TBMAIL_WWW");
......
...@@ -909,7 +909,7 @@ function TBLeaderMailList($pid, $gid) ...@@ -909,7 +909,7 @@ function TBLeaderMailList($pid, $gid)
$mailstr=""; $mailstr="";
while ($row = mysql_fetch_array($query_result)) { while ($row = mysql_fetch_array($query_result)) {
if ($mailstr != "") { $mailstr .=", "; } if ($mailstr != "") { $mailstr .=", "; }
$mailstr .= $row[usr_name]." (".$row[uid].") <".$row[usr_email].">"; $mailstr .= '"'.$row[usr_name]." (".$row[uid].")\" <".$row[usr_email].">";
} }
return $mailstr; return $mailstr;
} }
......
...@@ -627,7 +627,7 @@ if (! TBGroupMember($joining_uid, $pid, $pid, $approved)) { ...@@ -627,7 +627,7 @@ if (! TBGroupMember($joining_uid, $pid, $pid, $approved)) {
} }
# #
# Generate an email message to the group leader. # Generate an email message to the proj/group leaders.
# #
$query_result = $query_result =
DBQueryFatal("select usr_name,usr_email,leader from users as u ". DBQueryFatal("select usr_name,usr_email,leader from users as u ".
...@@ -640,6 +640,8 @@ $leader_name = $row[0]; ...@@ -640,6 +640,8 @@ $leader_name = $row[0];
$leader_email = $row[1]; $leader_email = $row[1];
$leader_uid = $row[2]; $leader_uid = $row[2];
$allleaders = TBLeaderMailList($pid,$gid);
# #
# The mail message to the leader. We send this for returning users # The mail message to the leader. We send this for returning users
# who are are also verified, since they could not use this page # who are are also verified, since they could not use this page
...@@ -666,6 +668,7 @@ if ($returning) { ...@@ -666,6 +668,7 @@ if ($returning) {
"Thanks,\n". "Thanks,\n".
"Testbed Operations\n", "Testbed Operations\n",
"From: $TBMAIL_APPROVAL\n". "From: $TBMAIL_APPROVAL\n".
"Cc: $allleaders\n".
"Bcc: $TBMAIL_AUDIT\n". "Bcc: $TBMAIL_AUDIT\n".
"Errors-To: $TBMAIL_WWW"); "Errors-To: $TBMAIL_WWW");
} }
......
...@@ -90,6 +90,8 @@ function INFORMLEADERS($uid) { ...@@ -90,6 +90,8 @@ function INFORMLEADERS($uid) {
TBGroupLeader($pid, $gid, $leader_uid); TBGroupLeader($pid, $gid, $leader_uid);
TBUserInfo($leader_uid, $leader_name, $leader_email); TBUserInfo($leader_uid, $leader_name, $leader_email);
$allleaders = TBLeaderMailList($pid,$gid);
if (strcmp($leader_uid, $uid)) { if (strcmp($leader_uid, $uid)) {
# #
# Send email only if this is not the group leader verifying # Send email only if this is not the group leader verifying
...@@ -117,6 +119,7 @@ function INFORMLEADERS($uid) { ...@@ -117,6 +119,7 @@ function INFORMLEADERS($uid) {
"Thanks,\n". "Thanks,\n".
"Testbed Operations\n", "Testbed Operations\n",
"From: $TBMAIL_APPROVAL\n". "From: $TBMAIL_APPROVAL\n".
"Cc: $allleaders\n".
"Bcc: $TBMAIL_AUDIT\n". "Bcc: $TBMAIL_AUDIT\n".
"Errors-To: $TBMAIL_WWW"); "Errors-To: $TBMAIL_WWW");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment