Skip to content

Commit 3c8149e

Browse files
committed
don't disable PIs in user-mgmt
1 parent 5b1134f commit 3c8149e

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

webroot/admin/user-mgmt.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
UnityHTTPD::forbidden("not an admin", "You are not an admin.");
1111
}
1212

13+
$pi_uids = $LDAP->getAllNonDisabledPIGroupOwnerUIDs();
1314
$users_with_flags = [];
1415
foreach (UserFlag::cases() as $flag) {
1516
$users_with_flags[$flag->value] = $LDAP->userFlagGroups[$flag->value]->getMemberUIDs();
@@ -126,6 +127,13 @@ class="stripe compact hover"
126127
$access_button_disabled = "";
127128
[$action, $action_lowercase, $form_type] = ["Lock", "lock", "lockUser"];
128129
}
130+
if (in_array($uid, $pi_uids)) {
131+
$disable_button_disabled = "disabled";
132+
$disable_button_title = "PI group owners cannot be disabled.";
133+
} else {
134+
$disable_button_disabled = "";
135+
$disable_button_title = "";
136+
}
129137
echo "
130138
<div style='display: flex; gap: 5px;'>
131139
<form action='' method='POST'>
@@ -152,7 +160,14 @@ class="stripe compact hover"
152160
$CSRFTokenHiddenFormInput
153161
<input type='hidden' name='form_type' value='disableUser'>
154162
<input type='hidden' name='uid' value='$uid'>
155-
<input type='submit' name='action' value='Disable' class='danger'>
163+
<input
164+
type='submit'
165+
name='action'
166+
value='Disable'
167+
class='danger'
168+
title='$disable_button_title'
169+
$disable_button_disabled
170+
>
156171
</form>
157172
</div>
158173
";

0 commit comments

Comments
 (0)