...
 
Commits (7)
......@@ -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 $
......
......@@ -426,8 +426,11 @@ class msgPool
*
* \param string $example Example of a right submited data
*/
public static function invalid (string $name, string $data = '', string $example = ''): string
public static function invalid (string $name, $data = '', string $example = ''): string
{
if (!is_string($data)) {
$data = var_export($data, TRUE);
}
$error = sprintf(_('The field "%s" contains an invalid value.'), htmlentities($name, ENT_COMPAT, 'UTF-8'));
$error .= '<br/><br/> "'.htmlentities($data, ENT_COMPAT, 'UTF-8').'"';
......
......@@ -181,7 +181,7 @@ class SelectAttribute extends Attribute
$smartyOutputs[] = $this->outputs[$choice];
}
} else {
$smartyOutputs = $this->choices;
$smartyOutputs = $smartyChoices;
}
if (!empty($currentValue) && !in_array($currentValue, $smartyChoices)) {
......
......@@ -753,7 +753,9 @@ class Attribute
function foreignKeyUpdate ($oldvalue, $newvalue, array $source)
{
if ($source['MODE'] == 'move') {
if ($source['FIELD'] == 'dn') {
if ($newvalue === NULL) {
$this->resetToDefault();
} elseif ($source['FIELD'] == 'dn') {
$value = $this->getInitialValue();
$value = preg_replace('/'.preg_quote($oldvalue, '/').'$/', $newvalue, $value, -1, $count);
if ($count > 0) {
......
......@@ -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'
),
]
],
......