-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add additional user profile attributes from LDAP #41793
Conversation
14e328f
to
3cad7c7
Compare
Thank you 👍 Will try to give it a test next week. I see a few failing tests. Index: tests/lib/Accounts/AccountManagerTest.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/tests/lib/Accounts/AccountManagerTest.php b/tests/lib/Accounts/AccountManagerTest.php
--- a/tests/lib/Accounts/AccountManagerTest.php (revision 7eaa573bac0f82b5b2b837104a508dab37c6e231)
+++ b/tests/lib/Accounts/AccountManagerTest.php (date 1701547210963)
@@ -632,6 +632,18 @@
'scope' => IAccountManager::SCOPE_LOCAL,
],
+ [
+ 'name' => IAccountManager::PROPERTY_BIRTHDATE,
+ 'value' => '',
+ 'scope' => IAccountManager::SCOPE_LOCAL,
+ ],
+
+ [
+ 'name' => IAccountManager::PROPERTY_ANNIVERSARYDATE,
+ 'value' => '',
+ 'scope' => IAccountManager::SCOPE_LOCAL,
+ ],
+
[
'name' => IAccountManager::PROPERTY_PROFILE_ENABLED,
'value' => '1',
|
This should fix the second failing tests by updating the expected data. Index: apps/settings/tests/UserMigration/assets/account.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/apps/settings/tests/UserMigration/assets/account.json b/apps/settings/tests/UserMigration/assets/account.json
--- a/apps/settings/tests/UserMigration/assets/account.json (revision 7eaa573bac0f82b5b2b837104a508dab37c6e231)
+++ b/apps/settings/tests/UserMigration/assets/account.json (date 1701548042464)
@@ -1,1 +1,0 @@
-{"displayname":{"name":"displayname","value":"Emma Jones","scope":"v2-federated","verified":"0","verificationData":""},"address":{"name":"address","value":"920 Grass St","scope":"v2-local","verified":"0","verificationData":""},"website":{"name":"website","value":"","scope":"v2-local","verified":"0","verificationData":""},"email":{"name":"email","value":"","scope":"v2-federated","verified":"0","verificationData":""},"avatar":{"name":"avatar","value":"","scope":"v2-federated","verified":"0","verificationData":""},"phone":{"name":"phone","value":"","scope":"v2-local","verified":"0","verificationData":""},"twitter":{"name":"twitter","value":"","scope":"v2-local","verified":"0","verificationData":""},"fediverse":{"name":"fediverse","value":"","scope":"v2-local","verified":"0","verificationData":""},"organisation":{"name":"organisation","value":"","scope":"v2-local","verified":"0","verificationData":""},"role":{"name":"role","value":"","scope":"v2-local","verified":"0","verificationData":""},"headline":{"name":"headline","value":"","scope":"v2-local","verified":"0","verificationData":""},"biography":{"name":"biography","value":"","scope":"v2-local","verified":"0","verificationData":""},"profile_enabled":{"name":"profile_enabled","value":"1","scope":"v2-local","verified":"0","verificationData":""},"additional_mail":[]}
\ No newline at end of file
Index: apps/settings/tests/UserMigration/assets/account-complex.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/apps/settings/tests/UserMigration/assets/account-complex.json b/apps/settings/tests/UserMigration/assets/account-complex.json
--- a/apps/settings/tests/UserMigration/assets/account-complex.json (revision 7eaa573bac0f82b5b2b837104a508dab37c6e231)
+++ b/apps/settings/tests/UserMigration/assets/account-complex.json (date 1701548067344)
@@ -1,1 +1,0 @@
-{"displayname":{"name":"displayname","value":"Steve Smith","scope":"v2-local","verified":"0","verificationData":""},"address":{"name":"address","value":"123 Water St","scope":"v2-local","verified":"0","verificationData":""},"website":{"name":"website","value":"https:\/\/example.org","scope":"v2-local","verified":"0","verificationData":""},"email":{"name":"email","value":"[email protected]","scope":"v2-federated","verified":"0","verificationData":""},"avatar":{"name":"avatar","value":"","scope":"v2-local","verified":"0","verificationData":""},"phone":{"name":"phone","value":"+12178515387","scope":"v2-private","verified":"0","verificationData":""},"twitter":{"name":"twitter","value":"steve","scope":"v2-federated","verified":"0","verificationData":""},"fediverse":{"name":"fediverse","value":"@[email protected]","scope":"v2-federated","verified":"0","verificationData":""},"organisation":{"name":"organisation","value":"Mytery Machine","scope":"v2-private","verified":"0","verificationData":""},"role":{"name":"role","value":"Manager","scope":"v2-private","verified":"0","verificationData":""},"headline":{"name":"headline","value":"I am Steve","scope":"v2-local","verified":"0","verificationData":""},"biography":{"name":"biography","value":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris porttitor ullamcorper dictum. Sed fermentum ut ligula scelerisque semper. Aliquam interdum convallis tellus eu dapibus. Integer in justo sollicitudin, hendrerit ligula sit amet, blandit sem.\n\nSuspendisse consectetur ultrices accumsan. Quisque sagittis bibendum lectus ut placerat. Mauris tincidunt ornare neque, et pulvinar tortor porttitor eu.","scope":"v2-local","verified":"0","verificationData":""},"profile_enabled":{"name":"profile_enabled","value":"1","scope":"v2-local","verified":"0","verificationData":""},"additional_mail":[{"name":"additional_mail","value":"[email protected]","scope":"v2-published","verified":"0","verificationData":""},{"name":"additional_mail","value":"[email protected]","scope":"v2-local","verified":"0","verificationData":""}]}
\ No newline at end of file
|
Side note: I thought the |
Good catch, sounds good to me. @miaulalala @ChristophWurst mapping the about field from our profile, which should be populated from the ldap biography field if available, to the notes field in vcard. Wdyt? |
I think we should map LDAP attributes to profile properties, and profile properties to the system contact. Then users can set the scope of the birthday and anniversary fields. Without a scope setting we either
|
cc38d6a
to
5674b2d
Compare
I added back the scoping as suggested to the code I already wrote. I'm not as familiar with the frontend and would find it difficult to add these features correctly to the profile page. Can someone assist with that portion? Or can we split that into a separate PR? |
Signed-off-by: Jake Nabasny <[email protected]>
Signed-off-by: Jake Nabasny <[email protected]>
Signed-off-by: Jake Nabasny <[email protected]>
Signed-off-by: Jake Nabasny <[email protected]>
Signed-off-by: Jake Nabasny <[email protected]>
Remove properties from PersonalInfo, since not visible in profile Signed-off-by: Jake Nabasny <[email protected]>
- Add back including the birthdate and anniversary in the profile Signed-off-by: Jake Nabasny <[email protected]>
Signed-off-by: Jake Nabasny <[email protected]>
Signed-off-by: Jake Nabasny <[email protected]>
7cbd75a
to
459355f
Compare
This reverts commit 459355f. Signed-off-by: Jake Nabasny <[email protected]>
Signed-off-by: Jake Nabasny <[email protected]>
Signed-off-by: Jake Nabasny <[email protected]>
Hey @slapcat, a colleague of mine and me hacked together a birthday field and added it to the profile a while ago. Perhaps the frontend code could be reused here to allow configuring the birthday and set the scope. There is also working backend code for saving a user's birthday property. The frontend is mostly in: The full PR is at: #39592 |
The alternative PR including a documentation PR are merged. Ref #45512 |
Thanks @st3iny ! |
Summary
Checklist
Code is properly formatted
Sign-off message is added to all commits
Tests (unit, integration, api and/or acceptance) are included
Screenshots before/after for front-end changes:
Documentation (manuals or wiki) has been updated or is not required
EDIT: Documentation PR #11323
Backports requested where applicable (ex: critical bugfixes)