Commit fe829f66 authored by Leigh Stoller's avatar Leigh Stoller

Allow OPSGUYs to free nodes from emulab-ops experiments.

parent 0c28a478
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002, 2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2002, 2004, 2005 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
......@@ -25,14 +25,6 @@ if (!isset($node_id) || !strcmp($node_id, "") || !TBValidNodeName($node_id)) {
USERERROR("The node '$node_id' is not a valid node!", 1);
}
#
# Only admin users can do this.
#
if (! $isadmin) {
USERERROR("Only administrators can free nodes from the web interface!",
1);
}
#
# Has to be reserved of course!
#
......@@ -46,6 +38,13 @@ $row = mysql_fetch_array($query_result);
$pid = $row[pid];
$eid = $row[eid];
#
# Perm check.
#
if (! ($isadmin || (OPSGUY()) && $pid == $TBOPSPID)) {
USERERROR("Not enough permission to free nodes from the web interface!", 1);
}
#
# We run this twice. The first time we are checking for a confirmation
# by putting up a form. The next time through the confirmation will be
......
......@@ -149,14 +149,14 @@ if ($isadmin || OPSGUY()) {
WRITESUBMENUBUTTON("Show Node History",
"shownodehistory.php3?node_id=$node_id");
}
if ($isadmin) {
if (isset($pid) && ($isadmin || (OPSGUY()) && $pid == $TBOPSPID)) {
WRITESUBMENUBUTTON("Free Node",
"freenode.php3?node_id=$node_id");
WRITESUBMENUBUTTON("Set Node Location",
"setnodeloc.php3?node_id=$node_id");
}
if ($isadmin || STUDLY() || OPSGUY()) {
WRITESUBMENUBUTTON("Set Node Location",
"setnodeloc.php3?node_id=$node_id");
WRITESUBMENUBUTTON("Update Power State",
"powertime.php3?node_id=$node_id");
}
......
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