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

Change Vis test to allow vis in most states, since a top file is no

longer necessary.
parent 868b972e
......@@ -104,6 +104,8 @@ $TB_IMAGEID_MIN = $TB_IMAGEID_READINFO;
$TB_IMAGEID_MAX = $TB_IMAGEID_DESTROY;
# Experiment states (that matter to us).
$TB_EXPTSTATE_NEW = "new";
$TB_EXPTSTATE_PRERUN = "prerunning";
$TB_EXPTSTATE_SWAPPING = "swapping";
$TB_EXPTSTATE_SWAPPED = "swapped";
$TB_EXPTSTATE_ACTIVATING = "activating";
......@@ -933,6 +935,7 @@ function TBProjList($uid, $access_type)
global $TB_PROJECT_MAKEGROUP;
global $TB_PROJECT_READINFO;
$result = array();
$user_clause = "where uid='$uid' and";
if ($access_type == $TB_PROJECT_READINFO) {
$trust_clause = "trust!='none'";
......@@ -940,19 +943,27 @@ function TBProjList($uid, $access_type)
elseif ($access_type == $TB_PROJECT_MAKEGROUP) {
$trust_clause = "trust='project_root'";
}
elseif ($access_type == $TB_PROJECT_CREATEEXPT ||
$access_type == $TB_PROJECT_MAKEOSID ||
$access_type == $TB_PROJECT_MAKEIMAGEID) {
elseif ($access_type == $TB_PROJECT_CREATEEXPT) {
$trust_clause = "(trust='project_root' or trust='group_root' or ".
" trust='local_root')";
}
elseif ($access_type == $TB_PROJECT_MAKEOSID ||
$access_type == $TB_PROJECT_MAKEIMAGEID) {
if (ISADMIN($uid)) {
$user_clause = "";
}
else {
$trust_clause = "(trust='project_root' or trust='group_root' or ".
" trust='local_root')";
}
}
else {
TBERROR("Invalid access type $access_type!", 1);
}
$query_result =
DBQueryFatal("SELECT distinct pid,gid FROM group_membership ".
"WHERE uid='$uid' and $trust_clause order by pid");
"$user_clause $trust_clause order by pid");
if (mysql_num_rows($query_result) == 0) {
return $result;
......
......@@ -73,8 +73,8 @@ elseif (TBEventCount($pid, $eid)) {
# Spit out an image that refers to a php script. That script will run and
# send back the GIF image contents.
#
if (strcmp($expstate, $TB_EXPTSTATE_ACTIVE) == 0 ||
strcmp($expstate, $TB_EXPTSTATE_SWAPPED) == 0) {
if (strcmp($expstate, $TB_EXPTSTATE_NEW) &&
strcmp($expstate, $TB_EXPTSTATE_PRERUN)) {
echo "<br>
<center>
<img src='top2image.php3?pid=$pid&eid=$eid&zoom=$zoom&detail=$detail' align=center>
......
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