(objectName string, parentDN string, dynamicTTL int)
| 729 | } |
| 730 | |
| 731 | func (lc *LDAPConn) AddComputer(objectName string, parentDN string, dynamicTTL int) error { |
| 732 | addRequest := ldap.NewAddRequest("CN="+objectName+","+parentDN, nil) |
| 733 | computerTemplate := GetComputerTemplate(objectName) |
| 734 | if dynamicTTL > 0 { |
| 735 | computerTemplate["entryTTL"] = []string{strconv.Itoa(dynamicTTL)} |
| 736 | computerTemplate["objectClass"] = append(computerTemplate["objectClass"], "dynamicObject") |
| 737 | } |
| 738 | |
| 739 | AddEntriesToRequest(addRequest, computerTemplate) |
| 740 | return lc.Conn.Add(addRequest) |
| 741 | } |
| 742 | |
| 743 | func (lc *LDAPConn) AddUser(objectName string, parentDN string, dynamicTTL int) error { |
| 744 | addRequest := ldap.NewAddRequest("CN="+objectName+","+parentDN, nil) |
no test coverage detected