Commit 4e5adc47 authored by Leigh Stoller's avatar Leigh Stoller

Force admins/studs onto new reservation path so that I ca get some feedback.

parent 4e5fec9c
......@@ -42,7 +42,7 @@ $isadmin = (ISADMIN() ? 1 : 0);
$optargs = OptionalPageArguments("cluster", PAGEARG_STRING,
"force" , PAGEARG_BOOLEAN);
if (!$isadmin || !$force) {
if ($isadmin || $this_user->admin() || $this_user->stud()) {
header("Location: list-resgroups.php");
return;
}
......
......@@ -450,7 +450,7 @@ echo "
<ul class='dropdown-menu'>
<li><a href='instantiate.php'>Start Experiment</a></li>
<li><a href='manage_profile.php'>Create Experiment Profile</a></li>
<li><a href='resgroup.php'>Reserve Nodes</a></li>
<li><a href='reserve.php'>Reserve Nodes</a></li>
<li><a href='resinfo.php'>Resource Availability</a></li>
<li><a href='cluster-status.php'>Cluster Status</a></li>
";
......
......@@ -29,6 +29,17 @@ include_once("instance_defs.php");
# We will set this in CheckForm();
$target_project = null;
# Temporary.
function AllowedToUse()
{
global $this_user;
if (1 || ISADMIN() || $this_user->admin() || $this_user->stud()) {
return 1;
}
return 0;
}
#
# Validate a reservation.
#
......@@ -53,7 +64,7 @@ function Do_Reserve()
#
# This interface is being phased out, mere users no longer allowed.
#
if (!ISADMIN()) {
if (!AllowedToUse()) {
SPITAJAX_ERROR(-1, "No permission to use this interface");
return;
}
......@@ -255,7 +266,7 @@ function Do_Delete()
#
# This interface is being phased out, mere users no longer allowed.
#
if (!ISADMIN()) {
if (!AllowedToUse()) {
SPITAJAX_ERROR(-1, "No permission to use this interface");
return;
}
......@@ -370,7 +381,7 @@ function Do_InfoOrWarn($warning = false)
#
# This interface is being phased out, mere users no longer allowed.
#
if (!ISADMIN()) {
if (!AllowedToUse()) {
SPITAJAX_ERROR(-1, "No permission to use this interface");
return;
}
......@@ -686,7 +697,7 @@ function Do_ListReservations()
#
# This interface is being phased out, mere users no longer allowed.
#
if (!ISADMIN()) {
if (!AllowedToUse()) {
SPITAJAX_ERROR(-1, "No permission to use this interface");
return;
}
......@@ -752,7 +763,7 @@ function Do_GetReservation()
#
# This interface is being phased out, mere users no longer allowed.
#
if (!ISADMIN()) {
if (!AllowedToUse()) {
SPITAJAX_ERROR(-1, "No permission to use this interface");
return;
}
......
......@@ -62,14 +62,12 @@ if ($edit) {
#
$resgroup = ReservationGroup::LookupByMemberReservation($uuid);
if ($resgroup) {
if (!$isadmin) {
header("Location: resgroup.php?edit=1&uuid=" . $resgroup->uuid());
exit();
}
header("Location: resgroup.php?edit=1&uuid=" . $resgroup->uuid());
exit();
}
}
if (!$isadmin) {
SPITUSERERROR("No permission to use this interface.");
if ($isadmin || $this_user->admin() || $this_user->stud()) {
header("Location: resgroup.php");
exit();
}
if (isset($cluster)) {
......
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