function user_groups($username,$recursive=NULL){
        if ($username==NULL){ return (false); }
        if ($recursive==NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
        if (!$this->_bind){ return (false); }
        
        //search the directory for their information
        $info=@$this->user_info($username,array($this->_group_attribute,"member","primarygroupid"));
        
        $groups=$this->nice_names($info[0][$this->_group_attribute]); //presuming the entry returned is our guy (unique usernames)

        if ($recursive){
            foreach ($groups as $id => $group_name){
                $extra_groups=$this->recursive_groups($group_name);
                $groups=array_merge($groups,$extra_groups);
            }
        }
        return ($groups);
    }
function user_groups($username,$recursive=NULL){
        if ($username==NULL){ return (false); }
        if ($recursive==NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
        if (!$this->_bind){ return (false); }
        
        //search the directory for their information
        $info=@$this->user_info($username,array($this->_group_attribute,"member","primarygroupid"));
        
        $groups=$this->nice_names($info[0][$this->_group_attribute]); //presuming the entry returned is our guy (unique usernames)

        if ($recursive){
            foreach ($groups as $id => $group_name){
                $extra_groups=$this->recursive_groups($group_name);
                $groups=array_merge($groups,$extra_groups);
            }
        }
        return ($groups);
    }
function user_groups ( $ username , $ recursive = NULL ) { if ( $ username == NULL ) { return ( false ) ; } if ( $ recursive == NULL ) { $ recursive = $ this -> _recursive_groups ; } //use the default option if they haven't set it if ( ! $ this -> _bind ) { return ( false ) ; } //search the directory for their information $ info = @ $ this -> user_info ( $ username , array ( $ this -> _group_attribute , "member" , "primarygroupid" ) ) ; $ groups = $ this -> nice_names ( $ info [ 0 ] [ $ this -> _group_attribute ] ) ; //presuming the entry returned is our guy (unique usernames) if ( $ recursive ) { foreach ( $ groups as $ id => $ group_name ) { $ extra_groups = $ this -> recursive_groups ( $ group_name ) ; $ groups = array_merge ( $ groups , $ extra_groups ) ; } } return ( $ groups ) ; }
Returns an array of groups that a user is a member off
Returns an array of groups that a user is a member off