@param null|\Zend\Ldap\Dn|string $groupSearchDn

@throws Exception\InvalidArgumentException
188839
public function setGroupSearchDn($groupSearchDn)
    {
        if ($groupSearchDn === null) {
            $this->groupSearchDn = null;
            $this->onConfigChanged();
            return;
        }

        $groupSearchDn = $this->normalizeDn($groupSearchDn, '$groupSearchDn');

        if (Dn::isChildOf($groupSearchDn, $this->baseDn)) {
            $this->groupSearchDn = $groupSearchDn;
        } else {
            throw new Exception\InvalidArgumentException('$groupSearchDn must be a child of baseDn');
        }

        $this->onConfigChanged();
    }
422169
public function load($locale, $group, $namespace = null)
	{
		if (is_null($namespace) || $namespace == '*')
		{
			return $this->loadData($locale, $group);
		}

		return $this->loadNamespaced($locale, $group, $namespace);
	}
770917
public function addGroup($groupName)
    {
        if (true === is_string($groupName) && false === in_array($groupName, $this->groups)) {
            $this->groups[] = $groupName;
        }
        return $this;
    }
971060
public function setGroupName($groupName)
    {
        $group = posix_getgrnam($groupName);
        if (! isset($group['gid'])) {
            throw new InvalidArgumentException(sprintf('"%s" is not a valid group name', $groupName));
        }

        $this->setGroupId($group['gid']);
    }
371596
public function removeByLoginName($groupName)
    {
        $qry = new InvokePostMethodQuery($this->getResourcePath(), "removeByLoginName", array($groupName));
        $this->getContext()->addQuery($qry);
    }
35062
public function checkUserExistenceByUsername($username, $parentGroupName = null)
    {
        if ($parentGroupName) {
            // find parent group name
            $searchResults = $this->searchUserGroups($parentGroupName);
            if (empty($searchResults)) {
                // group not found, so return immediately
                return false;
            }
            $groupId = $searchResults[0]->valueObject->contentInfo->id;
        } else {
            $groupId = null;
        }
        $searchResults = $this->searchUserByLogin($username, $groupId);

        return empty($searchResults) ? false : true;
    }
714618
public function getGroup($groupName, $file = null, $siteaccess = null)
    {
        if ($file === null && $siteaccess === null) {
            // in this case we want the "global" value, no need to use the
            // legacy kernel, the legacy resolver is enough
            return $this->legacyResolver->getGroup($groupName);
        }

        return $this->legacyKernel->runCallback(
            static function () use ($file, $groupName, $siteaccess) {
                // @todo: do reset injected settings everytime
                // and make sure to restore the previous injected settings
                eZINI::injectSettings([]);

                return eZSiteAccess::getIni($siteaccess, $file)->group($groupName);
            },
            false,
            false
        );
    }
476476
function group_del_user($group,$user){

        //find the parent dn
        $group_info=$this->group_info($group,array("cn"));
        if ($group_info[0]["dn"]==NULL){ return (false); }
        $group_dn=$group_info[0]["dn"];
        
        //find the child dn
        $user_info=$this->user_info($user,array("cn"));
        if ($user_info[0]["dn"]==NULL){ return (false); }
        $user_dn=$user_info[0]["dn"];

        $del=array();
        $del["member"] = $user_dn;
        
        $result=@ldap_mod_del($this->_conn,$group_dn,$del);
        if ($result==false){ return (false); }
        return (true);
    }
1340086
static function getGroupNameByDN( $ds, $groupDN )
    {
        $LDAPIni = eZINI::instance( 'ldap.ini' );
        $LDAPGroupNameAttribute = $LDAPIni->variable( 'LDAPSettings', 'LDAPGroupNameAttribute' );

        // First, try to see if the $LDAPGroupNameAttribute is contained within the DN, in that case we can read it directly
        $groupDNParts = ldap_explode_dn( $groupDN, 0 );
        list( $firstName, $firstValue ) = explode( '=', $groupDNParts[0] );

        if ( $firstName = $LDAPGroupNameAttribute ) // Read the group name attribute directly from the group DN
        {
            $groupName = $firstValue;
        }
        else // Read the LDAP group object, get the group name attribute from it
        {
            $sr = ldap_read( $ds, $groupDN, "($LDAPGroupNameAttribute=*)", array( $LDAPGroupNameAttribute ) );
            $info = ldap_get_entries( $ds, $sr );

            if ( $info['count'] < 1 or $info[0]['count'] < 1 )
            {
                eZDebug::writeWarning( 'LDAP group not found, tried DN: ' . $groupDN, __METHOD__ );
                return false;
            }

            $groupName = $info[0][$LDAPGroupNameAttribute];
            if ( is_array( $groupName ) ) // This may be a string or an array of strings, depending on LDAP setup
                $groupName = $groupName[0]; // At least one must exist, since we specified it in the search filter
        }

        return $groupName;
    }
349068
public function getGroup ($groupID)
    {
        $groups = $this->getAllGroups();
        
        foreach ($groups as $group) {
            if ($group->getID() == $groupID) {
                return $group;
            }
        }
        
        return null;
    }
756513
public function getRouteGroup(string $groupName): \Nofuzz\Route\Group
  {
    foreach ($this->routeGroups as $routeGroup)
    {
      if ( strcasecmp($routeGroup->getName(),$groupName)==0 ) {
        return $routeGroup;
      }
    }

    return null;
  }
608700
protected function _checkGroupMembership(Zend_Ldap $ldap, $canonicalName, $dn, array $adapterOptions)
    {
        if ($adapterOptions['group'] === null) {
            return true;
        }

        if ($adapterOptions['memberIsDn'] === false) {
            $user = $canonicalName;
        } else {
            $user = $dn;
        }

        /**
         * @see Zend_Ldap_Filter
         */
        require_once 'Zend/Ldap/Filter.php';
        $groupName = Zend_Ldap_Filter::equals($adapterOptions['groupAttr'], $adapterOptions['group']);
        $membership = Zend_Ldap_Filter::equals($adapterOptions['memberAttr'], $user);
        $group = Zend_Ldap_Filter::andFilter($groupName, $membership);
        $groupFilter = $adapterOptions['groupFilter'];
        if (!empty($groupFilter)) {
            $group = $group->addAnd($groupFilter);
        }

        $result = $ldap->count($group, $adapterOptions['groupDn'], $adapterOptions['groupScope']);

        if ($result === 1) {
            return true;
        } else {
            return 'Failed to verify group membership with ' . $group->toString();
        }
    }
854834
public function isInGroup(string $groupName, int $fd): bool
    {
        return $this->useRedis(function($resource, $redis) use($groupName, $fd){
            $key = $this->getGroupNameKey($groupName);
            $redis->sIsMember($key, $fd);
        });
    }
604938
public function load($groupName)
    {
        if (! count($this->readers)) {
            throw new \RuntimeException('No config readers attached');
        }

        if (! $groupName) {
            throw new \InvalidArgumentException('No config group specified');
        }

        if (! is_string($groupName)) {
            throw new \InvalidArgumentException('Config group must be a string');
        }

        if (isset($this->groups[$groupName])) {
            return $this->groups[$groupName];
        }

        $config = [];

        foreach ($this->readers as $reader) {
            if ($groupConfig = $reader->load($groupName)) {
                $config = array_replace_recursive($config, $groupConfig);
            }
        }

        $this->groups[$groupName] = $config;

        return $this->groups[$groupName];
    }
213830
public static function Connect ($dsn) {
		try {
			$dsn = static::DsnFilter($dsn);
			return new static (
				static::MakeDsn($dsn),
				$dsn['password'] ?? null,
				static::MakeOptionList($dsn['options'] ?? [])
			);
		} catch (CoreException $core_e) {
 			throw new \Exception(sprintf(
 				'%s dsn=%s password=%s options=%s',
 				$pdo_e->getMessage(),
 				static::MakeDsn($dsn),
 				$dsn['password'] ?? '<not set>',
 				implode(', ', static::MakeOptionList($dsn['options'] ?? []))
 			), 0, $core_e);
		}
	}
1224917
public function resourceGroupExists($groupName) {
        $this->validateResourceGroupName($groupName);

        return $this->resourceExists($this->getResourceGroupUrl($groupName));
    }
1047013
public function groupby($groupBy = null): Select
    {
        if (!\is_string($groupBy) && !\is_array($groupBy)) {
            throw new InvalidArgumentException('$groupBy has to be an array or a string');
        }
        $this->groupBy = $this->namesClass->parse($groupBy);

        return $this;
    }