src/Classes/AdldapGroups.php
public function recursiveGroups($groupName)
    {
        $groups = [];

        $info = $this->find($groupName);

        if (is_array($info) && array_key_exists('cn', $info)) {
            $groups[] = $info['cn'];

            if (array_key_exists('memberof', $info)) {
                if (is_array($info['memberof'])) {
                    foreach ($info['memberof'] as $group) {
                        $explodedDn = $this->connection->explodeDn($group);

                        $groups = array_merge($groups, $this->recursiveGroups($explodedDn[0]));
                    }
                }
            }
        }

        return $groups;
    }
public function recursiveGroups($groupName)
    {
        $groups = [];

        $info = $this->find($groupName);

        if (is_array($info) && array_key_exists('cn', $info)) {
            $groups[] = $info['cn'];

            if (array_key_exists('memberof', $info)) {
                if (is_array($info['memberof'])) {
                    foreach ($info['memberof'] as $group) {
                        $explodedDn = $this->connection->explodeDn($group);

                        $groups = array_merge($groups, $this->recursiveGroups($explodedDn[0]));
                    }
                }
            }
        }

        return $groups;
    }
public function recursiveGroups ( $ groupName ) { $ groups = [ ] ; $ info = $ this -> find ( $ groupName ) ; if ( is_array ( $ info ) && array_key_exists ( 'cn' , $ info ) ) { $ groups [ ] = $ info [ 'cn' ] ; if ( array_key_exists ( 'memberof' , $ info ) ) { if ( is_array ( $ info [ 'memberof' ] ) ) { foreach ( $ info [ 'memberof' ] as $ group ) { $ explodedDn = $ this -> connection -> explodeDn ( $ group ) ; $ groups = array_merge ( $ groups , $ this -> recursiveGroups ( $ explodedDn [ 0 ] ) ) ; } } } } return $ groups ; }
Return a complete list of "groups in groups".

@param string $groupName The group to get the list from

@return array|bool
Return a complete list of groups in groups .