Commit bd9aff96 authored by Leigh Stoller's avatar Leigh Stoller

When removing a user from a project, let new modgroups script do most

of the work (consolodating group_membership mods in one place).
parent 113bacef
......@@ -212,40 +212,32 @@ if (AuditStart(0)) {
# Set the status to frozen if user being removed completely. This
# prevents possible race conditions since the user is no longer able
# to access the web interface and tmcd will no longer return account
# info for the user. In pidmode, just remove the user from the specific
# project (tmcd will return the new group membership).
# info for the user.
#
# In pidmode (removed from a project), hand the operation of too modgroups
# to do the rest.
#
if ($pidmode) {
DBQueryFatal("delete from group_membership ".
"where uid='$user' and pid='$pid'");
#
# Drop root for calling modgroups.
#
$EUID = $UID;
system("$MODGROUPS -r $pid:$pid $user");
exit($? >> 8)
if (!$nuke);
$EUID = 0;
}
else {
DBQueryFatal("update users set status='" . TBDB_USERSTATUS_FROZEN . "'" .
"where uid='$user'");
}
#
# Now schedule account updates on all the nodes that this person has
# an account on (remaining project/group membership).
#
# XXX This is broken. Once the user is removed from the group membership,
# the list of nodes will change, and those nodes for which the user is
# suddenly no longer allowed an account on, will not be updated.
#
TBNodeUpdateAccountsByUID($user);
#
# In pidmode, call modgroups to alter the users membership on boss/ops.
# Thats all that needs to be done.
#
if ($pidmode && !$nuke) {
#
# Drop root for calling modgroups.
# Now schedule account updates; Once the user is frozen, all accounts
# will be terminated.
#
$EUID = $UID;
system("$MODGROUPS -r $pid:$pid $user");
exit($? >> 8);
TBNodeUpdateAccountsByUID($user);
}
#
......
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