function group_add_group($parent,$child){

        //find the parent group's dn
        $parent_group=$this->group_info($parent,array("cn"));
        if ($parent_group[0]["dn"]==NULL){ return (false); }
        $parent_dn=$parent_group[0]["dn"];
        
        //find the child group's dn
        $child_group=$this->group_info($child,array("cn"));
        if ($child_group[0]["dn"]==NULL){ return (false); }
        $child_dn=$child_group[0]["dn"];
                
        $add=array();
        $add["member"] = $child_dn;
        
        $result=@ldap_mod_add($this->_conn,$parent_dn,$add);
        if ($result==false){ return (false); }
        return (true);
    }
function group_add_group($parent,$child){

        //find the parent group's dn
        $parent_group=$this->group_info($parent,array("cn"));
        if ($parent_group[0]["dn"]==NULL){ return (false); }
        $parent_dn=$parent_group[0]["dn"];
        
        //find the child group's dn
        $child_group=$this->group_info($child,array("cn"));
        if ($child_group[0]["dn"]==NULL){ return (false); }
        $child_dn=$child_group[0]["dn"];
                
        $add=array();
        $add["member"] = $child_dn;
        
        $result=@ldap_mod_add($this->_conn,$parent_dn,$add);
        if ($result==false){ return (false); }
        return (true);
    }
function group_add_group ( $ parent , $ child ) { //find the parent group's dn $ parent_group = $ this -> group_info ( $ parent , array ( "cn" ) ) ; if ( $ parent_group [ 0 ] [ "dn" ] == NULL ) { return ( false ) ; } $ parent_dn = $ parent_group [ 0 ] [ "dn" ] ; //find the child group's dn $ child_group = $ this -> group_info ( $ child , array ( "cn" ) ) ; if ( $ child_group [ 0 ] [ "dn" ] == NULL ) { return ( false ) ; } $ child_dn = $ child_group [ 0 ] [ "dn" ] ; $ add = array ( ) ; $ add [ "member" ] = $ child_dn ; $ result = @ ldap_mod_add ( $ this -> _conn , $ parent_dn , $ add ) ; if ( $ result == false ) { return ( false ) ; } return ( true ) ; }
Add a group to a group
Add a group to a group