Commit 0c8a345c authored by Mac Newbold's avatar Mac Newbold

First set of changes for proj head and all group roots in the group to get

mail instead of just the proj head. So far, the only mail that really does
it is the swap requests, but others are coming soon, especially new user
application mail and the like.

Also clarified some of the documentation about students starting projects.
New project page says they can't, and that their advisor has to do it,
then links to auth.html, which says they can with prior special
permission. Hopefully we won't get too many more students making project
apps and messing things up.
parent b182c977
......@@ -9,11 +9,21 @@
</h1>
</center>
<p>
We use a hierarchical structure: we authorize a project under a
principal investigator (e.g. a faculty member) and delegate authority
to that person to authorize the project's members-- and accountability
for their behavior.
<h3>Who can start a project?</h3>
<p>
In general, a faculty memeber or well-known senior staff member must
start each project. Students cannot lead projects unless they
have had prior approval by the
<a href="mailto:testbed-approval@flux.cs.utah.edu">
Emulab Approval Committee</a>. See the next section for the
reasoning behind this rule.
<h3>How do I get started?</h3>
<p>
Briefly, you use the links at your left to create and join
......@@ -97,8 +107,7 @@ or supercomputer.
<p>
We are certainly open to suggestions, however.
<p>
<li><h4>I've been approved. How do I use my account?</h4>
<h3>I've been approved. How do I use my account?</h3>
<p>
The first step would be to come back here and log in to the Web
interface. That will update the list of options in the side bar.
......
......@@ -314,6 +314,22 @@ function TBProjAccessCheck($uid, $pid, $gid, $access_type)
return TBMinTrust(TBGrpTrust($uid, $pid, $gid), $mintrust);
}
# Usage: TBExptGroup($pid, $eid, &$gid)
# returns 0 if expt doesn't exist.
# returns 1 if expt exists.
function TBExptGroup($pid, $eid, &$gid)
{
$query_result =
DBQueryFatal("SELECT gid FROM experiments WHERE ".
"eid='$eid' and pid='$pid'");
if (mysql_num_rows($query_result) == 0) {
return 0;
}
$row = mysql_fetch_array($query_result);
$gid = $row[gid];
return 1;
}
#
# Experiment permission checks.
#
......@@ -868,6 +884,36 @@ function TBValidNodeName($node)
return 1;
}
#
# Return mail addresses for project_root and group_root people.
#
# usage TBLeaderMailList($pid, $gid)
# Uses default group (pid=gid) if gid not given.
# returns string like "Leader Name (uid) <email>[, ...]"
# returns 0 if not valid
function TBLeaderMailList($pid, $gid)
{
# No group, then use the default group.
if (! $gid) { $gid = $pid; }
$query_result =
DBQueryFatal("select distinct usr_name,u.uid,usr_email from users as u ".
"left join group_membership as gm on gm.uid=u.uid ".
"where (trust='". TBDB_TRUSTSTRING_PROJROOT .
"' and pid='$pid') or (trust='". TBDB_TRUSTSTRING_GROUPROOT .
"' and gid='$gid') order by trust DESC, usr_name");
if (mysql_num_rows($query_result) == 0) {
return 0;
}
$mailstr="";
while ($row = mysql_fetch_array($query_result)) {
if ($mailstr != "") { $mailstr .=", "; }
$mailstr .= $row[usr_name]." (".$row[uid].") <".$row[usr_email].">";
}
return $mailstr;
}
#
# Return Project Leader.
#
......
......@@ -45,9 +45,11 @@ function SPITFORM($formfields, $returning, $errors)
PAGEHEADER("Start a New Testbed Project");
echo "<center><font size=+1>
If you are a student
<font color=red>(undergrad or graduate)</font>, please
<a href=auth.html>read this first</a>!
If you are a <font color=red>student
(undergrad or graduate)</font>, please
do not try to start a project! <br>Your advisor must do it.
<a href=docwrapper.php3?docname=auth.html>
Read this for more info.</a>
</font></center><br>\n";
if ($errors) {
......
......@@ -81,7 +81,7 @@ $r=mysql_fetch_array($q);
$c=$r["c"];
if (!$confirmed) {
echo "<center><h2><br>
echo "<center><h3><br>
Experiment '$eid' in project '$pid' has $c Emulab node".($c!=1?"s":"").
" reserved, \nand has been sent $swap_requests swap request".
($swap_requests!=1?"s":"")." since it went idle.\n";
......@@ -94,7 +94,7 @@ Experiment '$eid' in project '$pid' has $c Emulab node".($c!=1?"s":"").
echo "<p>
Are you sure you want to send an email message requesting that<br>
experiment '$eid' be swapped or terminated?
</h2>\n";
</h3>\n";
#
# Dump experiment record.
......@@ -125,7 +125,13 @@ TBUserInfo($expleader, $expleader_name, $expleader_email);
if (! TBProjLeader($pid, $projleader)) {
TBERROR("Could not determine project leader!", 1);
}
TBUserInfo($projleader, $projleader_name, $projleader_email);
if (! TBExptGroup($pid,$eid,$gid)) {
TBERROR("Could not determine experiment group!", 1);
}
$leaders = TBLeaderMailList($pid,$gid);
if (! $leaders) {
TBERROR("Could not get leader emails!", 1);
}
TBMAIL("$expleader_name <$expleader_email>",
"$pid/$eid ($c PC".($c!=1?"s":"")."): Please Swap or Terminate Experiment",
......@@ -165,7 +171,7 @@ TBMAIL("$expleader_name <$expleader_email>",
"Testbed Operations\n",
"From: $TBMAIL_OPS\n".
( $swap_requests >= $tell_proj_head
? "Cc: $projleader_name <$projleader_email>\n"
? "Cc: $leaders\n"
: "") .
"Bcc: $TBMAIL_OPS\n".
"X-NetBed: request_swapexp.php3\n".
......
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