Commit 5ac5c4ad authored by Leigh Stoller's avatar Leigh Stoller

Send project approval email from cloudlab-ops or aptlab-ops, for

cloudlab/aptlab generated projects.
parent a2c2d060
<?php
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -124,6 +124,15 @@ if (! $this_project->IsMember($leader, $ignore)) {
USERERROR("User $headuid is not the leader of project $pid.", 1);
}
# For email below
$APPROVAL_MAIL = $TBMAIL_APPROVAL;
if ($this_project->isAPT()) {
$APPROVAL_MAIL = "aptlab-approval@aptlab.net";
}
elseif ($this_project->isCloud()) {
$APPROVAL_MAIL = "cloudlab-approval@cloudlab.us";
}
#
# Well, looks like everything is okay. Change the project approval
# value appropriately.
......@@ -164,7 +173,7 @@ if ($approval == "postpone") {
}
elseif (strcmp($approval, "moreinfo") == 0) {
SendProjAdminMail
($pid, "ADMIN", "$headname '$headuid' <$headuid_email>",
($this_project, "ADMIN", "$headname '$headuid' <$headuid_email>",
"Project '$pid' Approval Postponed",
"\n".
"This message is to notify you that your project application\n".
......@@ -173,8 +182,7 @@ elseif (strcmp($approval, "moreinfo") == 0) {
"to provide that information or report your actions.\n".
"\n$message".
"\n\n".
"Thanks,\n".
"Testbed Operations\n");
"Thanks!\n");
echo "<p><h3>
Project approval for project $pid (User: $headuid) was
......@@ -235,9 +243,8 @@ elseif ((strcmp($approval, "deny") == 0) ||
"This message is to notify you that your account has \n".
"been terminated because your project $pid was denied.\n".
"\n\n".
"Thanks,\n".
"Testbed Operations\n",
"From: $TBMAIL_APPROVAL\n".
"Thanks\n",
"From: $APPROVAL_MAIL\n".
"Bcc: $TBMAIL_APPROVAL\n".
"Errors-To: $TBMAIL_WWW");
}
......@@ -265,9 +272,8 @@ elseif ((strcmp($approval, "deny") == 0) ||
"for $pid has been denied.\n".
"\n$message".
"\n\n".
"Thanks,\n".
"Testbed Operations\n",
"From: $TBMAIL_APPROVAL\n".
"Thanks\n",
"From: $APPROVAL_MAIL\n".
"Bcc: $TBMAIL_APPROVAL\n".
"Errors-To: $TBMAIL_WWW");
}
......
......@@ -341,7 +341,7 @@ if (!$this_user) {
$args["affiliation"] = $formfields["affiliation"];
$args["password"] = $formfields["password1"];
# Flag to the backend.
$args["viaAPT"] = 1;
$args["genesis"] = ($ISAPT ? "aptlab" : "cloudlab");
#
# Backend verifies pubkey and returns error. We first look for a
......@@ -427,14 +427,14 @@ $args["linkedtous"] = 1;
$args["plab"] = 0;
$args["ron"] = 0;
$args["funders"] = "None";
$args["whynotpublic"] = "APT";
$args["whynotpublic"] = ($ISAPT ? "aptlab" : "cloudlab");
# Flag to the backend.
$args["viaAPT"] = 1;
$args["genesis"] = ($ISAPT ? "aptlab" : "cloudlab");
if (! ($project = Project::NewNewProject($args, $error))) {
$errors["error"] = $error;
if ($suexec_retval < 0) {
TBERROR("Error Creating APT Project\n${error}\n\n" .
TBERROR("Error Creating APT/CloudLab Project\n${error}\n\n" .
print_r($args, TRUE), 0);
}
SPITFORM($formfields, 0, $errors);
......
......@@ -244,11 +244,17 @@ function TBMAIL($to, $subject, $message, $headers = 0)
# Identical to perl function of the same name
#
#
function SendProjAdminMail($proj, $from, $to, $subject, $message, $headers = "")
function SendProjAdminMail($project, $from, $to,
$subject, $message, $headers = "")
{
global $MAILMANSUPPORT, $TBMAIL_APPROVAL, $TBMAIL_AUDIT, $OURDOMAIN, $TBMAIL_WWW;
$projadminmail = 0 && $MAILMANSUPPORT ?
"$proj-admin@$OURDOMAIN" : $TBMAIL_APPROVAL;
global $MAILMANSUPPORT, $TBMAIL_APPROVAL, $TBMAIL_AUDIT;
global $OURDOMAIN, $TBMAIL_WWW;
$pid = $project->pid();
$projadminmail =
($project->isAPT() ? "aptlab-approval@aptlab.net" :
$project->isCloud() ? "cloudlab-approval@cloudlab.us" :
$TBMAIL_APPROVAL);
if ($headers) {
$headers .= "\n";
}
......
<?php
#
# Copyright (c) 2003-2012 University of Utah and the Flux Group.
# Copyright (c) 2003-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -128,7 +128,7 @@ $headuid_email = $leader->email();
$headname = $leader->name();
SendProjAdminMail(
$pid,
$project,
"ADMIN",
"$headname '$headuid' <$headuid_email>",
"Project '$pid' Approval",
......
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