Unverified Commit 4b48762b authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:sparkles: feat(core) Add configuration option for avatar max size

Avoid hard-coded limits and instead have a configuration option to set
 maximum size for user avatars

issue #6049
Showing with 14 additions and 2 deletions
+14 -2
...@@ -155,6 +155,12 @@ attributetype ( 1.3.6.1.4.1.38414.8.12.21 NAME 'fdPostalAddressPattern' ...@@ -155,6 +155,12 @@ attributetype ( 1.3.6.1.4.1.38414.8.12.21 NAME 'fdPostalAddressPattern'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE) SINGLE-VALUE)
attributetype ( 1.3.6.1.4.1.38414.8.12.22 NAME 'fdMaxAvatarSize'
DESC 'FusionDirectory - Maximum user picture width and height in pixels'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
SINGLE-VALUE)
# Password # Password
attributetype ( 1.3.6.1.4.1.38414.8.13.1 NAME 'fdPasswordDefaultHash' attributetype ( 1.3.6.1.4.1.38414.8.13.1 NAME 'fdPasswordDefaultHash'
...@@ -584,7 +590,8 @@ objectclass ( 1.3.6.1.4.1.38414.8.2.1 NAME 'fusionDirectoryConf' ...@@ -584,7 +590,8 @@ objectclass ( 1.3.6.1.4.1.38414.8.2.1 NAME 'fusionDirectoryConf'
fdStrictNamingRules $ fdMinId $ fdUidNumberBase $ fdStrictNamingRules $ fdMinId $ fdUidNumberBase $
fdGidNumberBase $ fdUserRDN $ fdGroupRDN $ fdIdAllocationMethod $ fdGidNumberBase $ fdUserRDN $ fdGroupRDN $ fdIdAllocationMethod $
fdGidNumberPoolMin $ fdUidNumberPoolMin $ fdGidNumberPoolMax $ fdUidNumberPoolMax $ fdGidNumberPoolMin $ fdUidNumberPoolMin $ fdGidNumberPoolMax $ fdUidNumberPoolMax $
fdAclRoleRDN $ fdCnPattern $ fdRestrictRoleMembers $ fdSplitPostalAddress $ fdPostalAddressPattern $ fdAclRoleRDN $ fdCnPattern $ fdRestrictRoleMembers $
fdSplitPostalAddress $ fdPostalAddressPattern $ fdMaxAvatarSize $
fdPasswordDefaultHash $ fdPasswordMinLength $ fdPasswordMinDiffer $ fdPasswordDefaultHash $ fdPasswordMinLength $ fdPasswordMinDiffer $
fdHandleExpiredAccounts $ fdSaslRealm $ fdSaslExop $ fdHandleExpiredAccounts $ fdSaslRealm $ fdSaslExop $
fdForcePasswordDefaultHash $ fdPasswordAllowedHashes $ fdForcePasswordDefaultHash $ fdPasswordAllowedHashes $
......
...@@ -286,6 +286,11 @@ class configInLdap extends simplePlugin ...@@ -286,6 +286,11 @@ class configInLdap extends simplePlugin
_('Postal address pattern'), _('When using separate address fields, you can use a pattern to fill postalAddress field.'), _('Postal address pattern'), _('When using separate address fields, you can use a pattern to fill postalAddress field.'),
'fdPostalAddressPattern' 'fdPostalAddressPattern'
), ),
new IntAttribute(
_('Avatar max size'), _('Maximum user picture width and height in pixels. Bigger uploaded pictures will be resized.'),
'fdMaxAvatarSize', FALSE,
1, FALSE, 200
),
] ]
], ],
'debug' => [ 'debug' => [
......
...@@ -106,7 +106,7 @@ class user extends simplePlugin ...@@ -106,7 +106,7 @@ class user extends simplePlugin
new ImageAttribute( new ImageAttribute(
_('Picture'), _('The avatar for this user'), _('Picture'), _('The avatar for this user'),
'jpegPhoto', FALSE, 'jpegPhoto', FALSE,
150, 200, 'jpeg' $config->get_cfg_value('MaxAvatarSize', 200), $config->get_cfg_value('MaxAvatarSize', 200), 'jpeg'
), ),
] ]
], ],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment