diff --git a/resources/lib/UnityGroup.php b/resources/lib/UnityGroup.php index d1616225..02b9cbdc 100644 --- a/resources/lib/UnityGroup.php +++ b/resources/lib/UnityGroup.php @@ -198,47 +198,47 @@ public function denyGroup($operator = null, $send_mail = true) } } - /** - * This method will delete the group, either by admin action or PI action - */ - public function removeGroup($send_mail = true) - { - // remove any pending requests - // this will silently fail if the request doesn't exist (which is what we want) - $this->SQL->removeRequests($this->pi_uid); - - // we don't need to do anything extra if the group is already deleted - if (!$this->exists()) { - return; - } - - // first, we must record the users in the group currently - $users = $this->getGroupMembers(); - - // now we delete the ldap entry - $ldapPiGroupEntry = $this->getLDAPPiGroup(); - if ($ldapPiGroupEntry->exists()) { - if (!$ldapPiGroupEntry->delete()) { - throw new Exception("Unable to delete PI ldap group"); - } - - $this->REDIS->removeCacheArray("sorted_groups", "", $this->getPIUID()); - foreach ($users as $user) { - $this->REDIS->removeCacheArray($user->getUID(), "groups", $this->getPIUID()); - } - } - - // send email to every user of the now deleted PI group - if ($send_mail) { - foreach ($users as $user) { - $this->MAILER->sendMail( - $user->getMail(), - "group_disband", - array("group_name" => $this->pi_uid) - ); - } - } - } + // /** + // * This method will delete the group, either by admin action or PI action + // */ + // public function removeGroup($send_mail = true) + // { + // // remove any pending requests + // // this will silently fail if the request doesn't exist (which is what we want) + // $this->SQL->removeRequests($this->pi_uid); + + // // we don't need to do anything extra if the group is already deleted + // if (!$this->exists()) { + // return; + // } + + // // first, we must record the users in the group currently + // $users = $this->getGroupMembers(); + + // // now we delete the ldap entry + // $ldapPiGroupEntry = $this->getLDAPPiGroup(); + // if ($ldapPiGroupEntry->exists()) { + // if (!$ldapPiGroupEntry->delete()) { + // throw new Exception("Unable to delete PI ldap group"); + // } + + // $this->REDIS->removeCacheArray("sorted_groups", "", $this->getPIUID()); + // foreach ($users as $user) { + // $this->REDIS->removeCacheArray($user->getUID(), "groups", $this->getPIUID()); + // } + // } + + // // send email to every user of the now deleted PI group + // if ($send_mail) { + // foreach ($users as $user) { + // $this->MAILER->sendMail( + // $user->getMail(), + // "group_disband", + // array("group_name" => $this->pi_uid) + // ); + // } + // } + // } /** * This method is executed when a user is approved to join the group (either by admin or the group owner) diff --git a/webroot/admin/pi-mgmt.php b/webroot/admin/pi-mgmt.php index bb13b828..c12878dd 100644 --- a/webroot/admin/pi-mgmt.php +++ b/webroot/admin/pi-mgmt.php @@ -26,11 +26,6 @@ $group->denyGroup($OPERATOR); } - break; - case "remGroup": - $remGroup = new UnityGroup($_POST["pi"], $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK); - $remGroup->removeGroup(); - break; case "reqChild": $parent_group = new UnityGroup($_POST["pi"], $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK); @@ -128,15 +123,6 @@ " " . $pi_user->getLastname() . ""; echo "