Commit b538978f authored by Leigh Stoller's avatar Leigh Stoller

Add some hacky stuff to allow people in NSDI temporary project to

see experiments of other people in the NSDI project.

Added sitevar "general/open_showexplist" which when set to the name of
a project (NSDI), will allow users in that project to view all the
experiments that are swapped in by other members of the project, even
if the experiments are within another project.

Also quickly hacked showuser page to only show project/group listing
of overlapping projects, not all projects. This avoids some leakage.
parent 597d966a
......@@ -62,3 +62,4 @@ INSERT INTO sitevariables VALUES ('general/version/build','06/17/2005','','Build
INSERT INTO sitevariables VALUES ('general/version/major','1','','Source code major revision number');
INSERT INTO sitevariables VALUES ('general/mailman/password','','','Admin password for Emulab generated lists');
INSERT INTO sitevariables VALUES ('general/linux_endnodeshaping','1','1','Use this sitevar to disable endnodeshaping on linux globally on your testbed');
INSERT INTO sitevariables VALUES ('general/open_showexplist',NULL,'','Allow members of this experiment to view all running experiments on the experiment list page');
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
......@@ -23,6 +23,20 @@ $having = "";
$active = 0;
$idle = 0;
#
# Hack for NSDI deadline. Generalize later.
#
$openlist = TBGetSiteVar("general/open_showexplist");
$openlist_member = 0;
if (!$isadmin && isset($openlist) && $openlist != "") {
$openlist_member =
TBMinTrust(TBProjTrust($uid,$openlist), $TBDB_TRUST_USER);
$openlist_join =
" left join group_membership as g on ".
" g.uid=e.expt_swap_uid and g.pid='$openlist' and g.pid=g.gid ";
$openlist_clause = " and g.uid is not null ";
}
if (! isset($showtype))
$showtype="active";
if (! isset($sortby))
......@@ -218,7 +232,7 @@ if ($clause) {
# - idle is fudged by 121 seconds so that in the five minutes between
# slothd reports we do not get active expts showing up as idle for 0.1 hrs
if ($isadmin) {
if ($isadmin || $openlist_member) {
$experiments_result =
DBQueryFatal("
select e.*, date_format(expt_swapped,'%Y-%m-%d') as d,
......@@ -234,7 +248,8 @@ left join reserved as r on e.pid=r.pid and e.eid=r.eid
left join experiment_stats as s on e.idx=s.exptidx
left join nodes as n on r.node_id=n.node_id
left join node_activity as na on r.node_id=na.node_id
where (n.type!='dnard' or n.type is null) $clause
$openlist_join
where (n.type!='dnard' or n.type is null) $clause $openlist_clause
group by e.pid,e.eid $having order by $order");
}
else {
......@@ -452,11 +467,15 @@ if ($thumb && !$idle) {
echo "<th width=4% align=center>Swap Requests</th>\n";
}
echo " <th width=60%>
<a class='static' href='showexp_list.php3?showtype=$showtype&sortby=name$ni'>
Description</a></th>
<th width=4%>
<a class='static' href='showexp_list.php3?showtype=$showtype&sortby=uid$ni'>
if (! $openlist_member) {
echo "<th width=60%>
<a class='static' ".
"href='showexp_list.php3?showtype=$showtype".
"&sortby=name$ni'>Description</a></th>\n";
}
echo " <th width=4%>
<a class='static' ".
"href='showexp_list.php3?showtype=$showtype&sortby=uid$ni'>
Head UID</a></th>
</tr>\n";
......@@ -606,10 +625,12 @@ if ($thumb && !$idle) {
if ($showlastlogin) echo "$lastlogin\n";
if ($idle) echo "$foo\n";
echo "<td>$name</td>
<td><A href='showuser.php3?target_uid=$huid'>
$huid</A></td>
</tr>\n";
if (! $openlist_member) {
echo "<td>$name</td>\n";
}
echo "<td><A href='showuser.php3?target_uid=$huid'>$huid</A></td>\n";
echo "</tr>\n";
}
echo "</table>\n";
......
......@@ -102,8 +102,10 @@ $query_result =
"left join groups as gr on gr.pid=g.pid and gr.gid=g.gid ".
"left join experiments as e on g.pid=e.pid and g.gid=e.gid ".
"left join reserved as r on e.pid=r.pid and e.eid=r.eid ".
"where uid='$target_uid' and ".
"trust!='" . TBDB_TRUSTSTRING_NONE . "' ".
"left join group_membership as g2 on g2.pid=g.pid and ".
" g2.gid=g.gid and g2.uid='$uid' ".
"where g.uid='$target_uid' and g2.uid is not null and ".
"g.trust!='" . TBDB_TRUSTSTRING_NONE . "' ".
"group by g.pid, g.gid ".
"order by g.pid,gr.created");
......
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