Merge pull request #64 from fsr/portunus-givenname
patch portunus to make givenname optional
This commit is contained in:
commit
5f99060d2b
34
modules/ldap/0004-make-givenName-optional.patch
Normal file
34
modules/ldap/0004-make-givenName-optional.patch
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
diff --git a/internal/core/user.go b/internal/core/user.go
|
||||||
|
index e74ccfe..ce03eeb 100644
|
||||||
|
--- a/internal/core/user.go
|
||||||
|
+++ b/internal/core/user.go
|
||||||
|
@@ -64,7 +64,6 @@ func (u User) RenderToLDAP(suffix string, allGroups map[string]Group) LDAPObject
|
||||||
|
"uid": {u.LoginName},
|
||||||
|
"cn": {u.FullName()},
|
||||||
|
"sn": {u.FamilyName},
|
||||||
|
- "givenName": {u.GivenName},
|
||||||
|
"userPassword": {u.PasswordHash},
|
||||||
|
"isMemberOf": memberOfGroupDNames,
|
||||||
|
"objectClass": {"portunusPerson", "inetOrgPerson", "organizationalPerson", "person", "top"},
|
||||||
|
@@ -74,6 +73,9 @@ func (u User) RenderToLDAP(suffix string, allGroups map[string]Group) LDAPObject
|
||||||
|
if u.EMailAddress != "" {
|
||||||
|
obj.Attributes["mail"] = []string{u.EMailAddress}
|
||||||
|
}
|
||||||
|
+ if u.GivenName != "" {
|
||||||
|
+ obj.Attributes["givenName"] = []string{u.GivenName}
|
||||||
|
+ }
|
||||||
|
if len(u.SSHPublicKeys) > 0 {
|
||||||
|
obj.Attributes["sshPublicKey"] = u.SSHPublicKeys
|
||||||
|
}
|
||||||
|
diff --git a/internal/frontend/users.go b/internal/frontend/users.go
|
||||||
|
index 225c5b3..1a961ca 100644
|
||||||
|
--- a/internal/frontend/users.go
|
||||||
|
+++ b/internal/frontend/users.go
|
||||||
|
@@ -168,7 +168,6 @@ func buildUserMasterdataFieldset(e core.Engine, u *core.User, state *h.FormState
|
||||||
|
Name: "given_name",
|
||||||
|
Label: "Given name",
|
||||||
|
Rules: []h.ValidationRule{
|
||||||
|
- core.MustNotBeEmpty,
|
||||||
|
core.MustNotHaveSurroundingSpaces,
|
||||||
|
},
|
||||||
|
},
|
|
@ -60,6 +60,7 @@ in
|
||||||
./0001-update-user-validation-regex.patch
|
./0001-update-user-validation-regex.patch
|
||||||
./0002-both-ldap-and-ldaps.patch
|
./0002-both-ldap-and-ldaps.patch
|
||||||
./0003-gecos-ascii-escape.patch
|
./0003-gecos-ascii-escape.patch
|
||||||
|
./0004-make-givenName-optional.patch
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue