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

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
parent 912644a8
......@@ -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
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
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'
fdStrictNamingRules $ fdMinId $ fdUidNumberBase $
fdGidNumberBase $ fdUserRDN $ fdGroupRDN $ fdIdAllocationMethod $
fdGidNumberPoolMin $ fdUidNumberPoolMin $ fdGidNumberPoolMax $ fdUidNumberPoolMax $
fdAclRoleRDN $ fdCnPattern $ fdRestrictRoleMembers $ fdSplitPostalAddress $ fdPostalAddressPattern $
fdAclRoleRDN $ fdCnPattern $ fdRestrictRoleMembers $
fdSplitPostalAddress $ fdPostalAddressPattern $ fdMaxAvatarSize $
fdPasswordDefaultHash $ fdPasswordMinLength $ fdPasswordMinDiffer $
fdHandleExpiredAccounts $ fdSaslRealm $ fdSaslExop $
fdForcePasswordDefaultHash $ fdPasswordAllowedHashes $
......
......@@ -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.'),
'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' => [
......
......@@ -106,7 +106,7 @@ class user extends simplePlugin
new ImageAttribute(
_('Picture'), _('The avatar for this user'),
'jpegPhoto', FALSE,
150, 200, 'jpeg'
$config->get_cfg_value('MaxAvatarSize', 200), $config->get_cfg_value('MaxAvatarSize', 200), 'jpeg'
),
]
],
......
Markdown is supported
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