diff --git a/www/resendapproval.php b/www/resendapproval.php new file mode 100644 index 0000000000000000000000000000000000000000..77d0dd0e38a58941f0f2bd5be568417a30f24671 --- /dev/null +++ b/www/resendapproval.php @@ -0,0 +1,71 @@ +<?php +# +# EMULAB-COPYRIGHT +# Copyright (c) 2000-2003, 2005, 2006 University of Utah and the Flux Group. +# All rights reserved. +# +include("defs.php3"); + +# +# Only known and logged in users can do this. +# +$this_user = CheckLoginOrDie(); +$uid = $this_user->uid(); +$isadmin = ISADMIN(); + +PAGEHEADER("Resend Project Approval Message"); + +if (!$isadmin) { + USERERROR("You do not have permission to access this page!", 1); +} + +# +# Verify form arguments. +# +if (!isset($pid) || + strcmp($pid, "") == 0) { + USERERROR("You must provide a Project ID.", 1); +} + +# +# Confirm target is a real project, +# +if (! ($target_project = Project::Lookup($pid))) { + USERERROR("The project $pid is not a valid project", 1); +} +if (! ($leader = $target_project->GetLeader())) { + TBERROR("Error getting leader for $pid", 1); +} +$headuid = $leader->uid(); +$headuid_email = $leader->email(); +$headname = $leader->name(); + +TBMAIL("$headname '$headuid' <$headuid_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". + "\n". + " ${TBBASE}/joinproject.php3?target_pid=$pid\n". + "\n". + "Thanks,\n". + "Testbed Operations\n", + "From: $TBMAIL_APPROVAL\n". + "Bcc: $TBMAIL_APPROVAL\n". + "Errors-To: $TBMAIL_WWW"); + +echo "<center> + <h2>Done!</h2> + </center><br>\n"; + +sleep(1); + +PAGEREPLACE(CreateURL("showproject", $target_project)); + +# +# Standard Testbed Footer +# +PAGEFOOTER(); +?> diff --git a/www/showproject.php3 b/www/showproject.php3 index 0aa747a5c8cbc5e1954b7a3f0247569b1579886f..f9889034525f3f9d4dab20300b953e46a1dd5c61 100644 --- a/www/showproject.php3 +++ b/www/showproject.php3 @@ -69,6 +69,8 @@ if ($isadmin) { WRITESUBMENUDIVIDER(); WRITESUBMENUBUTTON("Delete this project", "deleteproject.php3?pid=$pid"); + WRITESUBMENUBUTTON("Resend Approval Message", + "resendapproval.php?pid=$pid"); } SUBMENUEND();