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

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

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