示例#1
0
func (l *LdifBackend) Modify(w ldap.ResponseWriter, m *ldap.Message) {
	r := m.GetModifyRequest()
	l.Log.Debug("Modify entry", log.Ctx{"entry": r.Object()})

	for _, change := range r.Changes() {
		modification := change.Modification()
		var operationString string
		switch change.Operation() {
		case ldap.ModifyRequestChangeOperationAdd:
			operationString = "Add"
		case ldap.ModifyRequestChangeOperationDelete:
			operationString = "Delete"
		case ldap.ModifyRequestChangeOperationReplace:
			operationString = "Replace"
		}

		l.Log.Debug("attribute change", log.Ctx{"operation": operationString, "type": modification.Type_()})
		for _, attributeValue := range modification.Vals() {
			l.Log.Debug("value", log.Ctx{"value": attributeValue})
		}

	}

	res := ldap.NewModifyResponse(ldap.LDAPResultSuccess)
	w.Write(res)
}
示例#2
0
func (l *LdifBackend) ModifyDN(w ldap.ResponseWriter, m *ldap.Message) {
	//r := m.GetModifyDNRequest()
	l.Log.Debug("ModifyDN entry")
	res := ldap.NewModifyResponse(ldap.LDAPResultSuccess)
	w.Write(res)
}
示例#3
0
func (d *DebugBackend) ModifyDN(w ldap.ResponseWriter, m *ldap.Message) {
	r := m.GetModifyDNRequest()
	dump(r)
	res := ldap.NewModifyResponse(ldap.LDAPResultSuccess)
	w.Write(res)
}