You are here

public function Server::groupRemoveGroup in Lightweight Directory Access Protocol (LDAP) 8.3

Remove a group entry.

Functionality is not in use, only called by server test form.

Parameters

string $group_dn: Group DN as LDAP dn.

bool $only_if_group_empty: TRUE = group should not be removed if not empty FALSE = groups should be deleted regardless of members.

Return value

bool Removal result.

File

ldap_servers/src/Entity/Server.php, line 1903

Class

Server
Defines the Server entity.

Namespace

Drupal\ldap_servers\Entity

Code

public function groupRemoveGroup($group_dn, $only_if_group_empty = TRUE) {
  if ($only_if_group_empty) {
    $members = $this
      ->groupAllMembers($group_dn);
    if (is_array($members) && count($members) > 0) {
      return FALSE;
    }
  }
  return $this
    ->deleteLdapEntry($group_dn);
}