MCPcopy Create free account
hub / github.com/Macmod/godap / AddComputer

Method AddComputer

pkg/ldaputils/actions.go:731–741  ·  view source on GitHub ↗
(objectName string, parentDN string, dynamicTTL int)

Source from the content-addressed store, hash-verified

729}
730
731func (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
743func (lc *LDAPConn) AddUser(objectName string, parentDN string, dynamicTTL int) error {
744 addRequest := ldap.NewAddRequest("CN="+objectName+","+parentDN, nil)

Callers 1

openCreateObjectFormFunction · 0.80

Calls 3

GetComputerTemplateFunction · 0.85
AddEntriesToRequestFunction · 0.85
AddMethod · 0.80

Tested by

no test coverage detected