Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
a57e6737
Commit
a57e6737
authored
Aug 27, 2014
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More tweaks to email from address.
parent
2ded1b43
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
25 deletions
+57
-25
db/Group.pm.in
db/Group.pm.in
+3
-2
db/Project.pm.in
db/Project.pm.in
+39
-2
tbsetup/libtestbed.pm.in
tbsetup/libtestbed.pm.in
+8
-14
tbsetup/mkproj.in
tbsetup/mkproj.in
+7
-6
www/approveproject.php3
www/approveproject.php3
+0
-1
No files found.
db/Group.pm.in
View file @
a57e6737
#
!/usr/bin/perl -wT
#
#
Copyright
(
c
)
2005
-
201
3
University
of
Utah
and
the
Flux
Group
.
#
Copyright
(
c
)
2005
-
201
4
University
of
Utah
and
the
Flux
Group
.
#
#
{{{
EMULAB
-
LICENSE
#
...
...
@@ -972,6 +972,7 @@ sub SendApprovalEmail($$$)
my
$
gid
=
$
self
->
gid
();
my
$
allleaders
=
$
self
->
LeaderMailList
();
my
$
membership
=
$
self
->
LookupUser
($
target_user
);
my
$
project
=
$
self
->
GetProject
();
return
-
1
if
(
!defined($membership));
...
...
@@ -987,7 +988,7 @@ sub SendApprovalEmail($$$)
"
\n\n
"
.
"Thanks,
\n
"
.
"Testbed Operations
\n
"
,
undef
,
$
project
->
ApprovalEmailAddress
()
,
"CC: $allleaders
\n
"
.
"Bcc: $TBAUDIT"
);
...
...
db/Project.pm.in
View file @
a57e6737
...
...
@@ -144,11 +144,48 @@ sub IsNonLocal($) { return (defined($_[0]->nonlocal_id()) ? 1 : 0); };
sub
nonlocal_id
($)
{
return
field
($
_
[
0
],
"nonlocal_id"
);
}
sub
nonlocal_type
($)
{
return
field
($
_
[
0
],
"nonlocal_type"
);
}
sub
manager_urn
($)
{
return
field
($
_
[
0
],
"manager_urn"
);
}
sub
genesis
($)
{
return
field
($
_
[
0
],
"genesis"
);
}
sub
isAPT
($)
{
return
$
_
[
0
]->
genesis
()
eq
"aptlab"
?
1
:
0
;
}
sub
isCloud
($)
{
return
$
_
[
0
]->
genesis
()
eq
"cloudlab"
?
1
:
0
;
}
#
These
come
from
the
group
not
the
project
.
sub
unix_gid
($)
{
return
$
_
[
0
]->{
'GROUP'
}->
unix_gid
();
}
sub
unix_name
($)
{
return
$
_
[
0
]->{
'GROUP'
}->
unix_name
();
}
#
In
general
,
not
be
used
directly
,
use
SendProjAdminMail
sub
ApprovalEmailAddress
($)
{
my
($
self
)
=
@
_
;
return
($
self
->
isAPT
()
?
"aptlab-approval\@aptlab.net"
:
$
self
->
isCloud
()
?
"cloudlab-approval\@cloudlab.us"
:
"@TBAPPROVALEMAIL@"
);
}
sub
EmailTag
($)
{
my
($
self
)
=
@
_
;
return
($
self
->
isAPT
()
?
"aptlab.net"
:
$
self
->
isCloud
()
?
"cloudlab.us"
:
"@THISHOMEBASE@"
);
}
sub
wwwBase
($)
{
my
($
self
)
=
@
_
;
return
($
self
->
isAPT
()
?
"https://www.aptlab.net"
:
$
self
->
isCloud
()
?
"https://www.cloudlab.us"
:
$
TBBASE
);
}
sub
SignupURL
($)
{
my
($
self
)
=
@
_
;
my
$
wwwbase
=
$
self
->
wwwBase
();
my
$
pid
=
$
self
->
pid
();
return
($
self
->
isAPT
()
||
$
self
->
isCloud
()
?
"${wwwbase}/signup.php?pid=$pid"
:
"${wwwbase}/joinproject.php3?target_pid=$pid"
);
}
#
#
Lookup
given
pid
For
backwards
compat
.
#
...
...
@@ -478,7 +515,7 @@ sub SendNewProjectEmail($;$)
if
($
returning
||
$
firstproject
)
{
SendProjAdminMail
($
pid
,
"$usr_name '$usr_uid' <$usr_email>"
,
"ADMIN"
,
($
self
,
"$usr_name '$usr_uid' <$usr_email>"
,
"ADMIN"
,
"New Project '$pid' ($usr_uid)"
,
"'$usr_name' wants to start project '$pid'.
\n
"
.
"
\n
"
.
...
...
@@ -515,7 +552,7 @@ sub SendNewProjectEmail($;$)
}
else
{
SendProjAdminMail
($
pid
,
"$usr_name '$usr_uid' <$usr_email>"
,
"ADMIN"
,
($
self
,
"$usr_name '$usr_uid' <$usr_email>"
,
"ADMIN"
,
"New Project '$pid' ($usr_uid)"
,
"'$usr_name' wants to start project '$pid'.
\n
"
.
"
\n
"
.
...
...
tbsetup/libtestbed.pm.in
View file @
a57e6737
...
...
@@ -39,9 +39,6 @@ use Exporter;
TBValidUserDir
TBValidUserDirList
TBMakeTempFile
NewUUID
System
SendProjAdminMail
ReOpenLog
CheckDaemonRunning
MarkDaemonRunning
MarkDaemonStopped
);
@
EXPORT_OK
=
qw
(
TBMAIL_PROJADMIN
);
#
After
package
decl
.
use
English
;
...
...
@@ -51,11 +48,8 @@ use Fcntl;
use
Fcntl
':flock'
;
use
File
::
Basename
;
use
Time
::
HiRes
qw
(
gettimeofday
);
use
vars
qw
(@
EXPORT_OK
);
my
$
TB
=
"@prefix@"
;
#
my
$
MAILTAG
=
"@OURDOMAIN@"
;
my
$
MAILTAG
=
"@THISHOMEBASE@"
;
my
$
BOSSNODE
=
"@BOSSNODE@"
;
my
$
TIMESTAMPS
=
"@TIMESTAMPS@"
;
my
$
TBOPSEMAIL
=
"@TBOPSEMAIL@"
;
...
...
@@ -65,6 +59,10 @@ my $UUIDGEN = "@UUIDGEN@";
my
$
NOREPLY
=
"no-reply\@@OURDOMAIN@"
;
my
$
SCRIPTNAME
=
"Unknown"
;
#
So
we
can
localize
this
variable
.
use
vars
qw
($
MAILTAG
);
$
MAILTAG
=
"@THISHOMEBASE@"
;
#
Exported
.
$
SYSTEM_DEBUG
=
0
;
@
EXPORT_OK
=
qw
($
SYSTEM_DEBUG
);
...
...
@@ -104,12 +102,6 @@ sub TB_AUDITEMAIL() { $TBAUDITEMAIL; }
sub
TBMAIL_OPS
()
{
"Testbed Ops <$TBOPSEMAIL>"
;
}
sub
TBMAIL_WWW
()
{
"Testbed WWW <$TBWWWEMAIL>"
;
}
sub
TBMAIL_AUDIT
()
{
"Testbed Audit <$TBAUDITEMAIL>"
}
#
TBMAIL_PROJADMIN
should
,
in
general
,
not
be
used
directly
,
use
#
SendProjAdminMail
sub
TBMAIL_PROJADMIN
($)
{
0
&&
@
MAILMANSUPPORT
@
?
"$_[0]-admin\@@OURDOMAIN@"
:
"@TBAPPROVALEMAIL@"
;
}
sub
TBMAIL_APPROVAL
()
{
"@TBAPPROVALEMAIL@"
;
}
...
...
@@ -237,6 +229,7 @@ sub OPENMAIL($$;$$)
{
my
($
To
,
$
Subject
,
$
From
,
$
Headers
)
=
@
_
;
local
*
MAIL
;
my
$
tag
=
uc
($
MAILTAG
);
if
(
! open(MAIL, "|/usr/sbin/sendmail -i -t")) {
print
STDERR
"OPENMAIL: Could not start sendmail: $!
\n
"
;
...
...
@@ -271,8 +264,9 @@ sub OPENMAIL($$;$$)
sub
SendProjAdminMail
($$$$$;$)
{
my
($
proj
,
$
from
,
$
to
,
$
subject
,
$
message
,
$
headers
)
=
@
_
;
my
$
projadminmail
=
TBMAIL_PROJADMIN
($
proj
);
my
($
project
,
$
from
,
$
to
,
$
subject
,
$
message
,
$
headers
)
=
@
_
;
my
$
projadminmail
=
$
project
->
ApprovalEmailAddress
();
local
$
MAILTAG
=
$
project
->
EmailTag
();
$
headers
.=
"
\n
"
if
defined
$
headers
;
if
($
from
eq
'ADMIN'
)
{
$
from
=
$
projadminmail
;
...
...
tbsetup/mkproj.in
View file @
a57e6737
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-201
1
University of Utah and the Flux Group.
# Copyright (c) 2000-201
4
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -558,21 +558,22 @@ if (! ($ELABINELAB || $isnonlocal)) {
if
(
!
$silent
)
{
my
$leader_name
=
$leader
->
name
();
my
$leader_email
=
$leader
->
email
();
my
$wwwbase
=
$target_project
->
wwwBase
();
my
$signupurl
=
$target_project
->
SignupURL
();
SendProjAdminMail
(
$
pid
,
"
ADMIN
",
"
$leader_name
<
$leader_email
>
",
(
$
target_project
,
"
ADMIN
",
"
$leader_name
<
$leader_email
>
",
"
Project '
$pid
' Approval
",
"
\n
"
.
"
This message is to notify you that your project '
$pid
'
\n
"
.
"
has been approved. We recommend that you save this link so that
\n
"
.
"
you can send it to people you wish to have join your project.
\n
"
.
"
Otherwise, tell them to go to
${
TBBASE
}
and join it.
\n
"
.
"
Otherwise, tell them to go to
${
wwwbase
}
and join it.
\n
"
.
"
\n
"
.
"
$
{TBBASE}
/joinproject.php3?target_pid=
$pid
\n
"
.
"
$
signupurl
\n
"
.
(
defined
(
$message
)
?
"
\n
${message}
\n
"
:
"")
.
"
\n
"
.
"
Thanks,
\n
"
.
"
Testbed Operations
\n
",
"
Thanks!
\n
",
"
Bcc:
$TBAPPROVAL
");
#
...
...
www/approveproject.php3
View file @
a57e6737
...
...
@@ -175,7 +175,6 @@ elseif (strcmp($approval, "moreinfo") == 0) {
SendProjAdminMail
(
$this_project
,
"ADMIN"
,
"
$headname
'
$headuid
' <
$headuid_email
>"
,
"Project '
$pid
' Approval Postponed"
,
"
\n
"
.
"This message is to notify you that your project application
\n
"
.
"for
$pid
has been postponed until we have more information
\n
"
.
"or you take certain actions. You can just reply to this message
\n
"
.
...
...
Write
Preview
Markdown
is supported
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