Skip to content

Commit b221f48

Browse files
committed
remove disband PI
1 parent 5216a1b commit b221f48

File tree

2 files changed

+41
-56
lines changed

2 files changed

+41
-56
lines changed

resources/lib/UnityGroup.php

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -198,47 +198,47 @@ public function denyGroup($operator = null, $send_mail = true)
198198
}
199199
}
200200

201-
/**
202-
* This method will delete the group, either by admin action or PI action
203-
*/
204-
public function removeGroup($send_mail = true)
205-
{
206-
// remove any pending requests
207-
// this will silently fail if the request doesn't exist (which is what we want)
208-
$this->SQL->removeRequests($this->pi_uid);
209-
210-
// we don't need to do anything extra if the group is already deleted
211-
if (!$this->exists()) {
212-
return;
213-
}
214-
215-
// first, we must record the users in the group currently
216-
$users = $this->getGroupMembers();
217-
218-
// now we delete the ldap entry
219-
$ldapPiGroupEntry = $this->getLDAPPiGroup();
220-
if ($ldapPiGroupEntry->exists()) {
221-
if (!$ldapPiGroupEntry->delete()) {
222-
throw new Exception("Unable to delete PI ldap group");
223-
}
224-
225-
$this->REDIS->removeCacheArray("sorted_groups", "", $this->getPIUID());
226-
foreach ($users as $user) {
227-
$this->REDIS->removeCacheArray($user->getUID(), "groups", $this->getPIUID());
228-
}
229-
}
230-
231-
// send email to every user of the now deleted PI group
232-
if ($send_mail) {
233-
foreach ($users as $user) {
234-
$this->MAILER->sendMail(
235-
$user->getMail(),
236-
"group_disband",
237-
array("group_name" => $this->pi_uid)
238-
);
239-
}
240-
}
241-
}
201+
// /**
202+
// * This method will delete the group, either by admin action or PI action
203+
// */
204+
// public function removeGroup($send_mail = true)
205+
// {
206+
// // remove any pending requests
207+
// // this will silently fail if the request doesn't exist (which is what we want)
208+
// $this->SQL->removeRequests($this->pi_uid);
209+
210+
// // we don't need to do anything extra if the group is already deleted
211+
// if (!$this->exists()) {
212+
// return;
213+
// }
214+
215+
// // first, we must record the users in the group currently
216+
// $users = $this->getGroupMembers();
217+
218+
// // now we delete the ldap entry
219+
// $ldapPiGroupEntry = $this->getLDAPPiGroup();
220+
// if ($ldapPiGroupEntry->exists()) {
221+
// if (!$ldapPiGroupEntry->delete()) {
222+
// throw new Exception("Unable to delete PI ldap group");
223+
// }
224+
225+
// $this->REDIS->removeCacheArray("sorted_groups", "", $this->getPIUID());
226+
// foreach ($users as $user) {
227+
// $this->REDIS->removeCacheArray($user->getUID(), "groups", $this->getPIUID());
228+
// }
229+
// }
230+
231+
// // send email to every user of the now deleted PI group
232+
// if ($send_mail) {
233+
// foreach ($users as $user) {
234+
// $this->MAILER->sendMail(
235+
// $user->getMail(),
236+
// "group_disband",
237+
// array("group_name" => $this->pi_uid)
238+
// );
239+
// }
240+
// }
241+
// }
242242

243243
/**
244244
* This method is executed when a user is approved to join the group (either by admin or the group owner)

webroot/panel/pi.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
// remove user button clicked
3030
$group->removeUser($form_user);
3131

32-
break;
33-
case "disband":
34-
$group->removeGroup();
35-
UnitySite::redirect($CONFIG["site"]["prefix"] . "/panel/account.php");
36-
3732
break;
3833
}
3934
}
@@ -110,17 +105,7 @@
110105
}
111106

112107
echo "</table>";
113-
114-
echo "<h5>Danger Zone</h5>";
115-
116-
echo
117-
"<form action='' method='POST' onsubmit='return confirm(\"Are you sure you want to disband your PI group?\")'>
118-
<input type='hidden' name='form_name' value='disband'>
119-
<input type='submit' value='Disband PI Account'>
120-
</form>
121-
";
122108
?>
123-
</table>
124109

125110
<?php
126111
include $LOC_FOOTER;

0 commit comments

Comments
 (0)