Commit f3886f24 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add a little ditty to send a test message to a user (hung off the

Manage User Profile) menu.
parent 5cf8cbc1
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003, 2005 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
#
# Only known and logged in users can do this.
#
$uid = GETLOGIN();
LOGGEDINORDIE($uid);
$isadmin = ISADMIN($uid);
#
# Verify form arguments.
#
if (!isset($target_uid) ||
strcmp($target_uid, "") == 0) {
USERERROR("You must provide a User ID.", 1);
}
PAGEHEADER("Send a Test Message");
if (!$isadmin) {
USERERROR("You do not have permission to view this page!", 1);
}
if (! TBCurrentUser($target_uid)) {
USERERROR("$target_uid is not a valid user ID!", 1);
}
# Get email info and Key,
TBUserInfo($target_uid, $usr_name, $usr_email);
$key = TBGetVerificationKey($target_uid);
if (!$key || !strcmp($key, "")) {
USERERROR("$target_uid does not have a valid verification key!", 1);
}
# Send the email.
TBMAIL("$usr_name '$target_uid' <$usr_email>",
"This is a test",
"\n".
"Dear $usr_name ($target_uid):\n".
"\n".
"This is a test message to validate the email address that we\n".
"(Emulab) have in our database. Please respond to this message\n".
"as soon as you receive it. If we do not hear back from you, we\n".
"may be forced to freeze your account!\n".
"\n".
"Thank you very much!\n".
"\n".
"Testbed Operations\n",
"From: $TBMAIL_OPS\n".
"Bcc: $TBMAIL_OPS\n".
"Errors-To: $TBMAIL_WWW");
echo "<center>
<h2>Done!</h2>
</center><br>\n";
#
# Standard Testbed Footer
#
PAGEFOOTER();
?>
......@@ -210,6 +210,10 @@ if ($isadmin) {
WRITESUBMENUBUTTON("Resend Verification Key",
"resendkey.php3?target_uid=$target_uid");
}
else {
WRITESUBMENUBUTTON("Send Test Email Message",
"sendtestmsg.php3?target_uid=$target_uid");
}
}
SUBMENUEND();
......
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