Commit 7d82bdb6 authored by Leigh Stoller's avatar Leigh Stoller

Send email when profile created.

parent e195996f
......@@ -946,7 +946,28 @@ sub Publish($)
$self->{'DBROW'}->{'published'} = time();
return 0;
}
}
#
# Manage URL
#
sub AdminURL($)
{
my ($self) = @_;
my $uuid = $self->uuid();
require Project;
my $project = Project->Lookup($self->pid_idx());
return undef
if (!defined($project));
my $wwwbase = $project->wwwBase();
$wwwbase .= "/apt"
if ($project->Brand()->isEmulab());
return $wwwbase . "/manage_profile.php?uuid=$uuid";
}
# _Always_ make sure that this 1 is at the end of the file...
1;
......@@ -57,6 +57,7 @@ my $webtask_id;
#
my $TB = "@prefix@";
my $TBOPS = "@TBOPSEMAIL@";
my $TBLOGS = "@TBLOGSEMAIL@";
my $MANAGEINSTANCE = "$TB/bin/manage_instance";
#
......@@ -475,6 +476,20 @@ if (defined($instance)) {
if (!defined($webtask_id));
exit(0);
}
my $portalLogs =
($project->isAPT() ? "aptnet-logs\@flux.utah.edu" :
$project->isCloud() ? "cloudlab-logs\@flux.utah.edu" : $TBLOGS);
$project->SendEmail($portalLogs, "New Profile Created",
"Name: ". $profile->name() . "\n".
"User: ". $profile->creator() . "\n".
"Project: ". $profile->pid() .
" (" . $project->Brand()->brand() . ")\n".
"UUID: ". $profile->uuid() . "\n".
"URL: ". $profile->AdminURL() . "\n",
$TBOPS);
exit(0);
sub fatal($)
......
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