You are here

public function LdapServer::groupRemoveGroup in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_servers/LdapServer.class.php \LdapServer::groupRemoveGroup()

NOT TESTED remove a group entry.

Parameters

string $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

File

ldap_servers/LdapServer.class.php, line 1540
Defines server classes and related functions.

Class

LdapServer
LDAP Server Class.

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
    ->delete($group_dn);
}