Commit bfa612ba authored by Mike Hibler's avatar Mike Hibler
Browse files

Make permission checks consistent with linktest_control

parent d90b5619
...@@ -51,17 +51,20 @@ $linktest_pid = 0; ...@@ -51,17 +51,20 @@ $linktest_pid = 0;
# #
function CHECKPAGEARGS() { function CHECKPAGEARGS() {
global $this_user, $TB_EXPTSTATE_ACTIVE, $TB_EXPT_MODIFY; global $this_user, $TB_EXPTSTATE_ACTIVE, $TB_EXPT_MODIFY;
global $TB_EXPTSTATE_ACTIVATING, $TB_EXPTSTATE_MODIFY_RESWAP;
global $pid, $eid, $experiment; global $pid, $eid, $experiment;
global $unix_gid, $linktest_level, $linktest_pid; global $unix_gid, $linktest_level, $linktest_pid;
$reqargs = RequiredPageArguments("experiment", PAGEARG_EXPERIMENT); $reqargs = RequiredPageArguments("experiment", PAGEARG_EXPERIMENT);
if (!$experiment->AccessCheck($this_user, $TB_EXPT_MODIFY)) { if (!$experiment->AccessCheck($this_user, $TB_EXPT_MODIFY)) {
USERERROR("You do not have permission to run linktest ". USERERROR("You do not have permission to start/stop linktest ".
"on $pid/$eid!", 1); "on $pid/$eid!", 1);
} }
if ($experiment->state() != $TB_EXPTSTATE_ACTIVE) { if ($experiment->state() != $TB_EXPTSTATE_ACTIVE &&
USERERROR("Experiment $eid must be active to run linktest!", 1); $experiment->state() != $TB_EXPTSTATE_ACTIVATING &&
$experiment->state() != $TB_EXPTSTATE_MODIFY_RESWAP) {
USERERROR("Experiment $eid must be active to start/stop linktest!", 1);
} }
$pid = $experiment->pid(); $pid = $experiment->pid();
$eid = $experiment->eid(); $eid = $experiment->eid();
......
Supports Markdown
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