Commit 82e86dba authored by Leigh Stoller's avatar Leigh Stoller

Add TBExptLogFile() function and use that in spewlogfile instead of

the actual query.
parent 61480857
......@@ -1122,6 +1122,20 @@ function TBUserPCs($uid)
return mysql_num_rows($query_result);
}
function TBExptLogFile($pid, $eid)
{
$query_result =
DBQueryFatal("select logfile from experiments ".
"where pid='$pid' and eid='$eid' and ".
" logfile is not null");
if (mysql_num_rows($query_result) == 0) {
return 0;
}
$row = mysql_fetch_row($query_result);
return $row[0];
}
function TBWebdbAllowed($uid) {
$query_result =
DBQueryFatal("select dbedit from users ".
......
......@@ -45,11 +45,7 @@ if (! TBExptAccessCheck($uid, $pid, $eid, $TB_EXPT_READINFO)) {
# Check for a logfile. This file is transient, so it could be gone by
# the time we get to reading it.
#
$query_result =
DBQueryFatal("select logfile from experiments ".
"where pid='$pid' and eid='$eid' and logfile is not null");
if (mysql_num_rows($query_result) == 0) {
if (! TBExptLogFile($pid, $eid)) {
USERERROR("Experiment $pid/$eid is no longer in transition!", 1);
}
......
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