Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
fc7aec1c
Commit
fc7aec1c
authored
Mar 05, 2003
by
Leigh B. Stoller
Browse files
Add per-group email lists as per payment by Eric.
parent
3175c488
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/genelists.in
View file @
fc7aec1c
...
...
@@ -25,6 +25,7 @@ my $USERS = "@USERNODE@";
my
$TBACTIVE
=
"
@TBACTIVEARCHIVE
@
";
my
$TBALL
=
"
@TBUSERSARCHIVE
@
";
my
$PROJROOT
=
"
/proj
";
my
$GRPROOT
=
"
/groups
";
# Note no -n option. We redirect stdin from the new exports file below.
my
$SSH
=
"
$TB
/bin/sshtb -l root -host
$USERS
";
...
...
@@ -53,7 +54,7 @@ if ($EUID != 0) {
"
Must be root! Maybe its a development version?
\n
");
}
# XXX Hacky!
if
(
1
&&
$TB
ne
"
/usr/testbed
")
{
if
(
0
&&
$TB
ne
"
/usr/testbed
")
{
die
("
*** $0:
\n
"
.
"
Wrong version. Maybe its a development version?
\n
");
}
...
...
@@ -211,31 +212,38 @@ if (defined($newuser) || defined($allprojects)) {
if
(
defined
(
$newuser
))
{
$proj_result
=
DBQueryFatal
("
select pid from group_membership
"
.
"
where uid='
$newuser
'
and pid=gid
");
DBQueryFatal
("
select pid
,gid
from group_membership
"
.
"
where uid='
$newuser
'
");
}
else
{
$proj_result
=
DBQueryFatal
("
select pid from
p
ro
ject
s
");
DBQueryFatal
("
select pid
,gid
from
g
ro
up
s
");
}
while
(
(
$p
id
)
=
$proj_result
->
fetchrow_array
)
{
print
"
Getting project members for
$pid
\n
"
if
$d
;
while
(
my
(
$pid
,
$g
id
)
=
$proj_result
->
fetchrow_array
)
{
print
"
Getting project members for
$pid
/
$gid
\n
"
if
$d
;
my
$query_result
=
DBQueryFatal
("
SELECT distinct u.usr_email from
"
.
"
group_membership as p
"
.
"
left join users as u on u.uid=p.uid
"
.
"
where p.pid='
$pid
' and p.
p
id=
p.
gid and
"
.
"
where p.pid='
$pid
' and p.
g
id=
'
$
gid
'
and
"
.
"
p.trust!='none'
"
.
"
order by u.usr_email
");
if
(
$query_result
->
numrows
)
{
my
$archive
=
"
$PROJROOT
/
$pid
/
$pid
-users.mail
";
my
$archive
;
if
(
$pid
eq
$gid
)
{
$archive
=
"
$PROJROOT
/
$pid
/
$pid
-users.mail
";
}
else
{
$archive
=
"
$GRPROOT
/
$pid
/
$gid
/
$pid
-
$gid
.mail
";
}
#
# This would be nice, but will not work since the mailer daemon
# cannot access files in /proj/$pid
.
# cannot access files in /proj/$pid
or /groups/$pid
#
if
(
0
&&
!
-
e
$archive
)
{
open
(
ARCHIVE
,
"
>>
$archive
")
or
...
...
@@ -245,7 +253,12 @@ if (defined($newuser) || defined($allprojects)) {
chmod
(
0666
,
"
$archive
")
or
fatal
("
Could not chmod(666)
$archive
: $!
");
}
genelist
(
$query_result
,
undef
,
"
$pid
-users
");
if
(
$pid
eq
$gid
)
{
genelist
(
$query_result
,
undef
,
"
$pid
-users
");
}
else
{
genelist
(
$query_result
,
undef
,
"
$pid
-
$gid
-users
");
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment