Commit 3c32126a authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Fix some copy/paste errors, fix project removal code.

parent e56ec37f
<?php <?php
# #
# Copyright (c) 2000-2016 University of Utah and the Flux Group. # Copyright (c) 2000-2017 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -381,15 +381,15 @@ function Do_EditMembership() ...@@ -381,15 +381,15 @@ function Do_EditMembership()
SPITAJAX_ERROR(-1, "User is still heading up experiments: $uid"); SPITAJAX_ERROR(-1, "User is still heading up experiments: $uid");
return -1; return -1;
} }
# Check trust values. # Check trust values unless removing from the group/project.
if (!array_key_exists($trust, $newTrustMap)) { if ($action != "remove" &&
!array_key_exists($trust, $newTrustMap)) {
SPITAJAX_ERROR(-1, "Invalid privilege: $trust"); SPITAJAX_ERROR(-1, "Invalid privilege: $trust");
return -1; return -1;
} }
} }
reset($users); reset($users);
foreach ($users as $uid => $trust) { foreach ($users as $uid => $trust) {
$trust = $newTrustMap[$trust];
$target_user = User::LookupByUid($uid); $target_user = User::LookupByUid($uid);
if (!$target_user) { if (!$target_user) {
SPITAJAX_ERROR(-1, "Unknown target user uid: $uid"); SPITAJAX_ERROR(-1, "Unknown target user uid: $uid");
...@@ -405,6 +405,7 @@ function Do_EditMembership() ...@@ -405,6 +405,7 @@ function Do_EditMembership()
$action == "add" ? "-a" : "-r"); $action == "add" ? "-a" : "-r");
$args = "$pid:$gid"; $args = "$pid:$gid";
if ($action == "add" || $action == "approve") { if ($action == "add" || $action == "approve") {
$trust = $newTrustMap[$trust];
$args .= ":$trust"; $args .= ":$trust";
} }
$retval = SUEXEC($this_user->uid(), $pid, $retval = SUEXEC($this_user->uid(), $pid,
......
...@@ -376,8 +376,8 @@ $(function () ...@@ -376,8 +376,8 @@ $(function ()
}); });
// Enable the remove button when users are selected. // Enable the remove button when users are selected.
$('#members_table .subgroup-checkbox').change(function () { $('#members_table .remove-checkbox').change(function () {
$('#subgroup-delete-button').removeAttr("disabled"); $('#remove-users-button').removeAttr("disabled");
}); });
// Handler for the remove button. // Handler for the remove button.
$('#confirm-remove-users').click(function () { $('#confirm-remove-users').click(function () {
......
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