Skip to content

Commit 459355f

Browse files
committed
Fixing merged code
Signed-off-by: Jake Nabasny <jake@nabasny.com>
1 parent dac4817 commit 459355f

File tree

5 files changed

+27
-25
lines changed

5 files changed

+27
-25
lines changed

apps/settings/src/constants/AccountPropertyConstants.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export const ACCOUNT_PROPERTY_ENUM = Object.freeze({
4343
ROLE: 'role',
4444
TWITTER: 'twitter',
4545
WEBSITE: 'website',
46+
BIRTHDATE: 'birthdate',
47+
ANNIVERSARYDATE: 'anniversarydate',
4648
})
4749

4850
/** Enum of account properties to human readable account property names */
@@ -61,6 +63,8 @@ export const ACCOUNT_PROPERTY_READABLE_ENUM = Object.freeze({
6163
TWITTER: t('settings', 'X (formerly Twitter)'),
6264
FEDIVERSE: t('settings', 'Fediverse (e.g. Mastodon)'),
6365
WEBSITE: t('settings', 'Website'),
66+
BIRTHDATE: t('settings', 'Birthday'),
67+
ANNIVERSARYDATE: t('settings', 'Anniversary'),
6468
})
6569

6670
export const NAME_READABLE_ENUM = Object.freeze({
@@ -78,6 +82,8 @@ export const NAME_READABLE_ENUM = Object.freeze({
7882
[ACCOUNT_PROPERTY_ENUM.TWITTER]: ACCOUNT_PROPERTY_READABLE_ENUM.TWITTER,
7983
[ACCOUNT_PROPERTY_ENUM.FEDIVERSE]: ACCOUNT_PROPERTY_READABLE_ENUM.FEDIVERSE,
8084
[ACCOUNT_PROPERTY_ENUM.WEBSITE]: ACCOUNT_PROPERTY_READABLE_ENUM.WEBSITE,
85+
[ACCOUNT_PROPERTY_ENUM.BIRTHDATE]: ACCOUNT_PROPERTY_READABLE_ENUM.BIRTHDATE,
86+
[ACCOUNT_PROPERTY_ENUM.ANNIVERSARYDATE]: ACCOUNT_PROPERTY_READABLE_ENUM.ANNIVERSARYDATE,
8187
})
8288

8389
/** Enum of profile specific sections to human readable names */
@@ -101,6 +107,8 @@ export const PROPERTY_READABLE_KEYS_ENUM = Object.freeze({
101107
[ACCOUNT_PROPERTY_READABLE_ENUM.TWITTER]: ACCOUNT_PROPERTY_ENUM.TWITTER,
102108
[ACCOUNT_PROPERTY_READABLE_ENUM.FEDIVERSE]: ACCOUNT_PROPERTY_ENUM.FEDIVERSE,
103109
[ACCOUNT_PROPERTY_READABLE_ENUM.WEBSITE]: ACCOUNT_PROPERTY_ENUM.WEBSITE,
110+
[ACCOUNT_PROPERTY_READABLE_ENUM.BIRTHDATE]: ACCOUNT_PROPERTY_ENUM.BIRTHDATE,
111+
[ACCOUNT_PROPERTY_READABLE_ENUM.ANNIVERSARYDATE]: ACCOUNT_PROPERTY_ENUM.ANNIVERSARYDATE,
104112
})
105113

106114
/**
@@ -143,6 +151,8 @@ export const PROPERTY_READABLE_SUPPORTED_SCOPES_ENUM = Object.freeze({
143151
[ACCOUNT_PROPERTY_READABLE_ENUM.TWITTER]: [SCOPE_ENUM.LOCAL, SCOPE_ENUM.PRIVATE],
144152
[ACCOUNT_PROPERTY_READABLE_ENUM.FEDIVERSE]: [SCOPE_ENUM.LOCAL, SCOPE_ENUM.PRIVATE],
145153
[ACCOUNT_PROPERTY_READABLE_ENUM.WEBSITE]: [SCOPE_ENUM.LOCAL, SCOPE_ENUM.PRIVATE],
154+
[ACCOUNT_PROPERTY_READABLE_ENUM.BIRTHDATE]: [SCOPE_ENUM.LOCAL, SCOPE_ENUM.PRIVATE],
155+
[ACCOUNT_PROPERTY_READABLE_ENUM.ANNIVERSARYDATE]: [SCOPE_ENUM.LOCAL, SCOPE_ENUM.PRIVATE],
146156
})
147157

148158
/** List of readable account properties which aren't published to the lookup server */

apps/user_ldap/lib/Configuration.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,9 @@ class Configuration {
134134
'ldapAttributeRole' => null,
135135
'ldapAttributeHeadline' => null,
136136
'ldapAttributeBiography' => null,
137-
<<<<<<< HEAD
138137
'ldapAdminGroup' => '',
139-
=======
140138
'ldapAttributeBirthDate' => null,
141139
'ldapAttributeAnniversaryDate' => null,
142-
>>>>>>> 06dd76fd26 (Add additional user profile attributes from LDAP)
143140
];
144141

145142
public function __construct(string $configPrefix, bool $autoRead = true) {
@@ -496,18 +493,9 @@ public function getDefaults(): array {
496493
'ldap_attr_role' => '',
497494
'ldap_attr_headline' => '',
498495
'ldap_attr_biography' => '',
499-
<<<<<<< HEAD
500-
<<<<<<< HEAD
501496
'ldap_admin_group' => '',
502-
=======
503497
'ldap_attr_birthdate' => '',
504498
'ldap_attr_anniversarydate' => '',
505-
>>>>>>> 06dd76fd26 (Add additional user profile attributes from LDAP)
506-
=======
507-
'ldap_attr_birthdate' => '',
508-
'ldap_attr_anniversarydate' => '',
509-
'ldap_admin_group' => '',
510-
>>>>>>> 7eaa573bac (resolve other conflicts)
511499
];
512500
}
513501

@@ -584,18 +572,9 @@ public function getConfigTranslationArray(): array {
584572
'ldap_attr_role' => 'ldapAttributeRole',
585573
'ldap_attr_headline' => 'ldapAttributeHeadline',
586574
'ldap_attr_biography' => 'ldapAttributeBiography',
587-
<<<<<<< HEAD
588-
<<<<<<< HEAD
589575
'ldap_admin_group' => 'ldapAdminGroup',
590-
=======
591576
'ldap_attr_birthdate' => 'ldapAttributeBirthDate',
592577
'ldap_attr_anniversarydate' => 'ldapAttributeAnniversaryDate',
593-
>>>>>>> 06dd76fd26 (Add additional user profile attributes from LDAP)
594-
=======
595-
'ldap_attr_birthdate' => 'ldapAttributeBirthDate',
596-
'ldap_attr_anniversarydate' => 'ldapAttributeAnniversaryDate',
597-
'ldap_admin_group' => 'ldapAdminGroup',
598-
>>>>>>> 7eaa573bac (resolve other conflicts)
599578
];
600579
return $array;
601580
}

apps/user_ldap/lib/Connection.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,11 @@
8383
* @property string ldapAttributeRole
8484
* @property string ldapAttributeHeadline
8585
* @property string ldapAttributeBiography
86-
<<<<<<< HEAD
8786
* @property string ldapAdminGroup
88-
=======
8987
* @property string ldapAttributeBirthDate
9088
* @property string ldapAttributeAnniversaryDate
91-
>>>>>>> 06dd76fd26 (Add additional user profile attributes from LDAP)
92-
*/
89+
*/
90+
9391
class Connection extends LDAPUtility {
9492
/**
9593
* @var resource|\LDAP\Connection|null

lib/private/Profile/ProfileManager.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ class ProfileManager implements IProfileManager {
8383
IAccountManager::PROPERTY_HEADLINE,
8484
IAccountManager::PROPERTY_ORGANISATION,
8585
IAccountManager::PROPERTY_ROLE,
86+
IAccountManager::PROPERTY_BIRTHDATE,
87+
IAccountManager::PROPERTY_ANNIVERSARYDATE,
8688
];
8789

8890
public function __construct(
@@ -268,6 +270,8 @@ public function getProfileFields(IUser $targetUser, ?IUser $visitingUser): array
268270
// Add avatar visibility
269271
$profileParameters['isUserAvatarVisible'] = $this->isProfileFieldVisible($property, $targetUser, $visitingUser);
270272
break;
273+
case IAccountManager::PROPERTY_BIRTHDATE:
274+
case IAccountManager::PROPERTY_ANNIVERSARYDATE:
271275
}
272276
}
273277

@@ -416,6 +420,15 @@ public function getProfileConfigWithMetadata(IUser $targetUser, ?IUser $visiting
416420
'appId' => self::CORE_APP_ID,
417421
'displayId' => $this->l10nFactory->get('lib')->t('Role'),
418422
],
423+
IAccountManager::PROPERTY_BIRTHDATE => [
424+
'appId' => self::CORE_APP_ID,
425+
'displayId' => $this->l10nFactory->get('lib')->t('Birthday'),
426+
],
427+
IAccountManager::PROPERTY_ANNIVERSARYDATE => [
428+
'appId' => self::CORE_APP_ID,
429+
'displayId' => $this->l10nFactory->get('lib')->t('Anniversary'),
430+
],
431+
419432
];
420433

421434
$paramMetadata = array_merge($actionsMetadata, $propertiesMetadata);

lib/public/Profile/IProfileManager.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ interface IProfileManager {
7171
IAccountManager::PROPERTY_PHONE => self::VISIBILITY_SHOW_USERS_ONLY,
7272
IAccountManager::PROPERTY_TWITTER => self::VISIBILITY_SHOW,
7373
IAccountManager::PROPERTY_WEBSITE => self::VISIBILITY_SHOW,
74+
IAccountManager::PROPERTY_BIRTHDATE => self::VISIBILITY_SHOW_USERS_ONLY,
75+
IAccountManager::PROPERTY_ANNIVERSARYDATE => self::VISIBILITY_SHOW_USERS_ONLY,
7476
];
7577

7678
/**

0 commit comments

Comments
 (0)