Skip to content

Commit 7b65b64

Browse files
committed
deactivate/reactivate -> disable/reenable
1 parent fa64b02 commit 7b65b64

File tree

9 files changed

+31
-31
lines changed

9 files changed

+31
-31
lines changed

LDAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Terminology:
33
- **qualified user**: a user who is currently a PI or a member of at least one PI group
44
- **native user**: a user who's entries exist in the OUs given in `config.ini`
55
- it is up to the administrator to ensure that no non-native entries exist in these OUs
6-
- **defunct group**: a PI group that was deactivated by its owner or had its owner deactivated
6+
- **defunct group**: a PI group that was disabled by its owner or had its owner disabled
77
- memberuid attribute should be empty

resources/lib/UnityGroup.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ public function requestGroup(?bool $send_mail_to_admins = null, bool $send_mail
6363
}
6464
}
6565

66-
public function deactivate(bool $send_mail = true): void
66+
public function disable(bool $send_mail = true): void
6767
{
68-
$this->SQL->addLog("deactivate_pi_group", $this->gid);
68+
$this->SQL->addLog("disable_pi_group", $this->gid);
6969
$memberuids = $this->getMemberUIDs();
7070
if ($send_mail) {
7171
$member_attributes = $this->LDAP->getUsersAttributes($memberuids, ["mail"]);
7272
$member_mails = array_map(fn($x) => $x["mail"][0], $member_attributes);
73-
$this->MAILER->sendMail($member_mails, "group_deactivated", [
73+
$this->MAILER->sendMail($member_mails, "group_disabled", [
7474
"group_name" => $this->gid,
7575
]);
7676
}
@@ -89,11 +89,11 @@ public function deactivate(bool $send_mail = true): void
8989
// }
9090
}
9191

92-
private function reactivate(bool $send_mail = true)
92+
private function reenable(bool $send_mail = true)
9393
{
94-
$this->SQL->addLog("reactivated_pi_group", $this->gid);
94+
$this->SQL->addLog("reenabled_pi_group", $this->gid);
9595
if ($send_mail) {
96-
$this->MAILER->sendMail($this->getOwner()->getMail(), "group_reactivated", [
96+
$this->MAILER->sendMail($this->getOwner()->getMail(), "group_reenabled", [
9797
"group_name" => $this->gid,
9898
]);
9999
}
@@ -117,7 +117,7 @@ public function approveGroup(bool $send_mail = true): void
117117
if (!$this->entry->exists()) {
118118
$this->init();
119119
} elseif ($this->getIsDefunct()) {
120-
$this->reactivate();
120+
$this->reenable();
121121
} else {
122122
throw new Exception("cannot approve group that already exists and is not defunct");
123123
}
@@ -236,7 +236,7 @@ public function removeUser(UnityUser $new_user, bool $send_mail = true): void
236236
return;
237237
}
238238
if ($new_user->uid == $this->getOwner()->uid) {
239-
throw new Exception("Cannot delete group owner from group. Deactivate group instead");
239+
throw new Exception("Cannot delete group owner from group. Disable group instead");
240240
}
241241
// remove request, this will fail silently if the request doesn't exist
242242
$this->removeMemberUID($new_user->uid);
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
// This template is sent to all users of a group when that group is deactivated
4-
$this->Subject = "PI Group Deactivated"; ?>
3+
// This template is sent to all users of a group when that group is disabled
4+
$this->Subject = "PI Group Disabled"; ?>
55

66
<p>Hello,</p>
77

8-
<p>Your PI group, <?php echo $data["group_name"]; ?>, has been deactivated on the UnityHPC Platform.
8+
<p>Your PI group, <?php echo $data["group_name"]; ?>, has been disabled on the UnityHPC Platform.
99
Any jobs associated with this PI account have been killed.</p>
1010

1111
<p>If you believe this to be a mistake, please reply to this email</p>
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
// This template is sent to the group owner when that group is re-activated
4-
$this->Subject = "PI Group Re-Activated"; ?>
3+
// This template is sent to the group owner when that group is re-enabled
4+
$this->Subject = "PI Group Re-Enabled"; ?>
55

66
<p>Hello,</p>
77

88
<p>
9-
Your PI group, <?php echo $data["group_name"]; ?>, has been reactivated on the UnityHPC Platform.
9+
Your PI group, <?php echo $data["group_name"]; ?>, has been reenabled on the UnityHPC Platform.
1010
</p>
1111

1212
<p>If you believe this to be a mistake, please reply to this email</p>

resources/mail/user_flag_removed.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php use UnityWebPortal\lib\UserFlag; ?>
22
<?php switch ($data["flag"]):
33
case UserFlag::QUALIFIED: ?>
4-
<?php $this->Subject = "User Deactivated"; ?>
4+
<?php $this->Subject = "User Disabled"; ?>
55
<p>Hello,</p>
6-
<p>Your account on the UnityHPC Platform has been deactivated.</p>
6+
<p>Your account on the UnityHPC Platform has been disabled.</p>
77
<p>If you believe this to be a mistake, please reply to this email as soon as possible.</p>
88
<?php break; ?>
99

test/functional/PIBecomeApproveTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function testApprovePI()
7676
}
7777
}
7878

79-
public function testReactivateGroup()
79+
public function testReenableGroup()
8080
{
8181
global $USER, $SSO, $LDAP, $SQL, $MAILER, $WEBHOOK;
8282
$this->switchUser("ResurrectedOwnerOfDefunctPIGroup");

test/functional/PIDeactivateTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
use UnityWebPortal\lib\UserFlag;
33

4-
class PIDeactivateTest extends UnityWebPortalTestCase
4+
class PIDisableTest extends UnityWebPortalTestCase
55
{
6-
public function testDeactivateGroupByAdmin()
6+
public function testDisableGroupByAdmin()
77
{
88
global $USER, $LDAP;
99
$this->switchUser("EmptyPIGroupOwner");
@@ -32,7 +32,7 @@ public function testDeactivateGroupByAdmin()
3232
}
3333
}
3434

35-
public function testDeactivateGroupByOwner()
35+
public function testDisableGroupByOwner()
3636
{
3737
global $USER, $LDAP;
3838
$this->switchUser("EmptyPIGroupOwner");

webroot/admin/pi-mgmt.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
$parent = new UnityGroup($_POST["pi"], $LDAP, $SQL, $MAILER, $WEBHOOK);
4545
$parent->removeUser($form_user);
4646
break;
47-
case "deactivate":
47+
case "disable":
4848
$group = new UnityGroup(UnityHTTPD::getPostData("pi"), $LDAP, $SQL, $MAILER, $WEBHOOK);
49-
$group->deactivate();
49+
$group->disable();
5050
break;
5151
}
5252
}
@@ -139,13 +139,13 @@ class="filterSearch"
139139
action=''
140140
method='POST'
141141
onsubmit='
142-
return confirm(\"Are you sure you want to deactivate group $gid?\")
142+
return confirm(\"Are you sure you want to disable group $gid?\")
143143
'
144144
>
145145
$CSRFTokenHiddenFormInput
146-
<input type='hidden' name='form_type' value='deactivate'>
146+
<input type='hidden' name='form_type' value='disable'>
147147
<input type='hidden' name='pi' value='$gid'>
148-
<input type='submit' value='Deactivate Group'>
148+
<input type='submit' value='Disable Group'>
149149
</form>
150150
";
151151
echo "</td>";

webroot/panel/pi.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
$group->removeUser($form_user);
3434

3535
break;
36-
case "deactivate":
37-
$group->deactivate();
36+
case "disable":
37+
$group->disable();
3838
UnityHTTPD::redirect(getURL("panel/account.php"));
3939
break; /** @phpstan-ignore deadCode.unreachable */
4040
}
@@ -136,11 +136,11 @@
136136
<form
137137
action=''
138138
method='POST'
139-
onsubmit='return confirm(\"Are you sure you want to deactivate your PI group?\")'
139+
onsubmit='return confirm(\"Are you sure you want to disable your PI group?\")'
140140
>
141141
$CSRFTokenHiddenFormInput
142-
<input type='hidden' name='form_type' value='deactivate'>
143-
<input type='submit' value='Deactivate PI Account'>
142+
<input type='hidden' name='form_type' value='disable'>
143+
<input type='submit' value='Disable PI Account'>
144144
</form>
145145
";
146146

0 commit comments

Comments
 (0)