mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-01 10:30:40 -06:00
Omitempty givenName attribute when creating user #5431
This commit is contained in:
6
changelog/unreleased/fix-omitempty-givenName.md
Normal file
6
changelog/unreleased/fix-omitempty-givenName.md
Normal file
@@ -0,0 +1,6 @@
|
||||
Bugfix: Fix the empty string givenName attribute when creating user
|
||||
|
||||
Omitempty givenName attribute when creating user
|
||||
|
||||
https://github.com/owncloud/ocis/issues/5431
|
||||
https://github.com/owncloud/ocis/pull/6259
|
||||
@@ -784,7 +784,6 @@ func (i *LDAP) createUserModelFromLDAP(e *ldap.Entry) *libregraph.User {
|
||||
if err != nil {
|
||||
i.logger.Warn().Str("dn", e.DN).Str(i.userAttributeMap.id, e.GetAttributeValue(i.userAttributeMap.id)).Msg("Invalid User. Cannot convert UUID")
|
||||
}
|
||||
givenName := e.GetEqualFoldAttributeValue(i.userAttributeMap.givenName)
|
||||
surname := e.GetEqualFoldAttributeValue(i.userAttributeMap.surname)
|
||||
|
||||
if id != "" && opsan != "" {
|
||||
@@ -793,7 +792,7 @@ func (i *LDAP) createUserModelFromLDAP(e *ldap.Entry) *libregraph.User {
|
||||
Mail: pointerOrNil(e.GetEqualFoldAttributeValue(i.userAttributeMap.mail)),
|
||||
OnPremisesSamAccountName: &opsan,
|
||||
Id: &id,
|
||||
GivenName: &givenName,
|
||||
GivenName: pointerOrNil(e.GetEqualFoldAttributeValue(i.userAttributeMap.givenName)),
|
||||
Surname: &surname,
|
||||
UserType: pointerOrNil(e.GetEqualFoldAttributeValue(i.userAttributeMap.userType)),
|
||||
AccountEnabled: booleanOrNil(e.GetEqualFoldAttributeValue(i.userAttributeMap.accountEnabled)),
|
||||
|
||||
@@ -308,6 +308,7 @@ func TestUpdateUser(t *testing.T) {
|
||||
displayName string
|
||||
onPremisesSamAccountName string
|
||||
accountEnabled *bool
|
||||
givenName *string
|
||||
userType *string
|
||||
}
|
||||
type args struct {
|
||||
@@ -1441,7 +1442,7 @@ func TestUpdateUser(t *testing.T) {
|
||||
DisplayName: &tt.want.displayName,
|
||||
OnPremisesSamAccountName: &tt.want.onPremisesSamAccountName,
|
||||
Surname: &emptyString,
|
||||
GivenName: &emptyString,
|
||||
GivenName: tt.want.givenName,
|
||||
UserType: tt.want.userType,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user