function group_users($group_name=NUL){
        $result = array();
        if ($group_name==NULL){ return (false); }
        if (!$this->_bind){ return (false); }
        $filter="(&(|(objectClass=posixGroup)(objectClass=groupofNames))(".$this->_group_cn_identifier."=".$this->ldap_search_encode($group_name)."))";

        $fields=array("member","memberuid");
        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
        $entries = $this->ldap_get_entries_raw($sr);

        // DEBUG
        if (0 == count($entries)) {
            $this->_warning_message = "group_users: No entry for the specified filter $filter";
            echo "DEBUG: ".$this->_warning_message;
        }

        if (isset($entries[0]["member"][0]))
        {
            $result = $this->nice_names($entries[0]["member"]);
            /*
            for ($i=0; $i++; $i < $entries[0]["member"][count])
            {
                $result[] == ($entries[0]["member"][$i]);
            }
            */
        }
        elseif (isset($entries[0]["memberuid"][0]))
        {
            $result = $this->nice_names($entries[0]["memberuid"]);
        }
        else
        {
            $result = array();
        }
        return ($result);
    }
function group_users($group_name=NUL){
        $result = array();
        if ($group_name==NULL){ return (false); }
        if (!$this->_bind){ return (false); }
        $filter="(&(|(objectClass=posixGroup)(objectClass=groupofNames))(".$this->_group_cn_identifier."=".$this->ldap_search_encode($group_name)."))";

        $fields=array("member","memberuid");
        $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
        $entries = $this->ldap_get_entries_raw($sr);

        // DEBUG
        if (0 == count($entries)) {
            $this->_warning_message = "group_users: No entry for the specified filter $filter";
            echo "DEBUG: ".$this->_warning_message;
        }

        if (isset($entries[0]["member"][0]))
        {
            $result = $this->nice_names($entries[0]["member"]);
            /*
            for ($i=0; $i++; $i < $entries[0]["member"][count])
            {
                $result[] == ($entries[0]["member"][$i]);
            }
            */
        }
        elseif (isset($entries[0]["memberuid"][0]))
        {
            $result = $this->nice_names($entries[0]["memberuid"]);
        }
        else
        {
            $result = array();
        }
        return ($result);
    }
function group_users ( $ group_name = NUL ) { $ result = array ( ) ; if ( $ group_name == NULL ) { return ( false ) ; } if ( ! $ this -> _bind ) { return ( false ) ; } $ filter = "(&(|(objectClass=posixGroup)(objectClass=groupofNames))(" . $ this -> _group_cn_identifier . "=" . $ this -> ldap_search_encode ( $ group_name ) . "))" ; $ fields = array ( "member" , "memberuid" ) ; $ sr = ldap_search ( $ this -> _conn , $ this -> _base_dn , $ filter , $ fields ) ; $ entries = $ this -> ldap_get_entries_raw ( $ sr ) ; // DEBUG if ( 0 == count ( $ entries ) ) { $ this -> _warning_message = "group_users: No entry for the specified filter $filter" ; echo "DEBUG: " . $ this -> _warning_message ; } if ( isset ( $ entries [ 0 ] [ "member" ] [ 0 ] ) ) { $ result = $ this -> nice_names ( $ entries [ 0 ] [ "member" ] ) ; /*
            for ($i=0; $i++; $i < $entries[0]["member"][count])
            {
                $result[] == ($entries[0]["member"][$i]);
            }
            */ } elseif ( isset ( $ entries [ 0 ] [ "memberuid" ] [ 0 ] ) ) { $ result = $ this -> nice_names ( $ entries [ 0 ] [ "memberuid" ] ) ; } else { $ result = array ( ) ; } return ( $ result ) ; }
Returns an array of users that are members of a group
Returns an array of users that are members of a group