added displayName
This commit is contained in:
parent
4131d5fe6c
commit
c1d09bba09
|
@ -1,6 +1,7 @@
|
||||||
March 2020 7.1
|
March 2020 7.1
|
||||||
- PHP 7 required
|
- PHP 7 required
|
||||||
- Webauthn/FIDO2 support for 2-factor-authentication (requires PHP 7.2)
|
- Webauthn/FIDO2 support for 2-factor-authentication (requires PHP 7.2)
|
||||||
|
- Personal: support display name (hidden by default in server profile)
|
||||||
|
|
||||||
|
|
||||||
21.12.2019 7.0
|
21.12.2019 7.0
|
||||||
|
|
|
@ -6,7 +6,7 @@ use LAM\PDF\PDFImage;
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2003 - 2006 Tilo Lutz
|
Copyright (C) 2003 - 2006 Tilo Lutz
|
||||||
2005 - 2019 Roland Gruber
|
2005 - 2020 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -163,12 +163,12 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
'location' => _('Location'), 'state' => _('State'), 'officeName' => _('Office name'), 'businessCategory' => _('Business category'),
|
'location' => _('Location'), 'state' => _('State'), 'officeName' => _('Office name'), 'businessCategory' => _('Business category'),
|
||||||
'departmentNumber' => _('Department'), 'initials' => _('Initials'), 'title' => _('Job title'), 'labeledURI' => _('Web site'),
|
'departmentNumber' => _('Department'), 'initials' => _('Initials'), 'title' => _('Job title'), 'labeledURI' => _('Web site'),
|
||||||
'userCertificate' => _('User certificates'), 'o' => _('Organisation'), 'ou' => _('Organisational unit'), 'description' => _('Description'),
|
'userCertificate' => _('User certificates'), 'o' => _('Organisation'), 'ou' => _('Organisational unit'), 'description' => _('Description'),
|
||||||
'uid' => _('User name'));
|
'uid' => _('User name'), 'displayName' => _('Display name'));
|
||||||
// possible self service read-only fields
|
// possible self service read-only fields
|
||||||
$return['selfServiceReadOnlyFields'] = array('firstName', 'lastName', 'mail', 'telephoneNumber', 'mobile', 'faxNumber', 'pager', 'street',
|
$return['selfServiceReadOnlyFields'] = array('firstName', 'lastName', 'mail', 'telephoneNumber', 'mobile', 'faxNumber', 'pager', 'street',
|
||||||
'postalAddress', 'registeredAddress', 'postalCode', 'postOfficeBox', 'jpegPhoto', 'homePhone', 'roomNumber', 'carLicense',
|
'postalAddress', 'registeredAddress', 'postalCode', 'postOfficeBox', 'jpegPhoto', 'homePhone', 'roomNumber', 'carLicense',
|
||||||
'location', 'state', 'officeName', 'businessCategory', 'departmentNumber', 'initials', 'title', 'labeledURI', 'userCertificate',
|
'location', 'state', 'officeName', 'businessCategory', 'departmentNumber', 'initials', 'title', 'labeledURI', 'userCertificate',
|
||||||
'o', 'ou', 'description', 'uid');
|
'o', 'ou', 'description', 'uid', 'displayName');
|
||||||
// profile checks and mappings
|
// profile checks and mappings
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideInitials')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideInitials')) {
|
||||||
$return['profile_mappings']['inetOrgPerson_initials'] = 'initials';
|
$return['profile_mappings']['inetOrgPerson_initials'] = 'initials';
|
||||||
|
@ -681,6 +681,10 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
"Headline" => _("Common name"), 'attr' => 'cn',
|
"Headline" => _("Common name"), 'attr' => 'cn',
|
||||||
"Text" => _("This is the natural name of the user. If empty, the first and last name is used.")
|
"Text" => _("This is the natural name of the user. If empty, the first and last name is used.")
|
||||||
),
|
),
|
||||||
|
'displayName' => array (
|
||||||
|
"Headline" => _("Display name"), 'attr' => 'displayName',
|
||||||
|
"Text" => _("This is the user's preferred name to be used when displaying entries.")
|
||||||
|
),
|
||||||
'uid' => array(
|
'uid' => array(
|
||||||
"Headline" => _("User name"), 'attr' => 'uid',
|
"Headline" => _("User name"), 'attr' => 'uid',
|
||||||
"Text" => _("User name of the user who should be created. Valid characters are: a-z,A-Z,0-9, @.-_.")
|
"Text" => _("User name of the user who should be created. Valid characters are: a-z,A-Z,0-9, @.-_.")
|
||||||
|
@ -807,6 +811,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (!$this->isUnixActive()) {
|
if (!$this->isUnixActive()) {
|
||||||
$attrs[] = 'cn';
|
$attrs[] = 'cn';
|
||||||
}
|
}
|
||||||
|
if (!$this->isSamba3Active()) {
|
||||||
|
$attrs[] = 'displayName';
|
||||||
|
}
|
||||||
return $attrs;
|
return $attrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1017,6 +1024,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!$this->isSamba3Active() && !$this->isBooleanConfigOptionSet('inetOrgPerson_hidedisplayName', true)) {
|
||||||
|
$this->attributes['displayName'][0] = $_POST['displayName'];
|
||||||
|
}
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideTelephoneNumber') && !$this->isAdminReadOnly('telephoneNumber')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideTelephoneNumber') && !$this->isAdminReadOnly('telephoneNumber')) {
|
||||||
$this->processMultiValueInputTextField('telephoneNumber', $errors, 'telephone');
|
$this->processMultiValueInputTextField('telephoneNumber', $errors, 'telephone');
|
||||||
}
|
}
|
||||||
|
@ -1221,6 +1231,10 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
$this->addMultiValueInputTextField($fieldContainer, 'cn', _('Common name'), true);
|
$this->addMultiValueInputTextField($fieldContainer, 'cn', _('Common name'), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// display name
|
||||||
|
if (!$this->isSamba3Active() && !$this->isBooleanConfigOptionSet('inetOrgPerson_hidedisplayName', true)) {
|
||||||
|
$this->addSimpleInputTextField($fieldContainer, 'displayName', _('Display name'));
|
||||||
|
}
|
||||||
// description
|
// description
|
||||||
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideDescription')) {
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideDescription')) {
|
||||||
if ($this->isAdminReadOnly('description')) {
|
if ($this->isAdminReadOnly('description')) {
|
||||||
|
@ -1934,6 +1948,11 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
$fields['cn'] = _('Common name');
|
$fields['cn'] = _('Common name');
|
||||||
$fields['userPassword'] = _('Password');
|
$fields['userPassword'] = _('Password');
|
||||||
}
|
}
|
||||||
|
if (!$this->isSamba3Active($modules)) {
|
||||||
|
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hidedisplayName', true)) {
|
||||||
|
$fields['displayName'] = _('Display name');
|
||||||
|
}
|
||||||
|
}
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1976,6 +1995,7 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
$this->addSimplePDFField($return, 'initials', _('Initials'));
|
$this->addSimplePDFField($return, 'initials', _('Initials'));
|
||||||
$this->addSimplePDFField($return, 'labeledURI', _('Web site'));
|
$this->addSimplePDFField($return, 'labeledURI', _('Web site'));
|
||||||
$this->addSimplePDFField($return, 'departmentNumber', _('Department'));
|
$this->addSimplePDFField($return, 'departmentNumber', _('Department'));
|
||||||
|
$this->addSimplePDFField($return, 'displayName', _('Display name'));
|
||||||
if (isset($this->clearTextPassword)) {
|
if (isset($this->clearTextPassword)) {
|
||||||
$this->addPDFKeyValue($return, 'userPassword', _('Password'), $this->clearTextPassword);
|
$this->addPDFKeyValue($return, 'userPassword', _('Password'), $this->clearTextPassword);
|
||||||
}
|
}
|
||||||
|
@ -2193,6 +2213,14 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
'example' => _('secret'),
|
'example' => _('secret'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (!$this->isSamba3Active() && !$this->isBooleanConfigOptionSet('inetOrgPerson_hidedisplayName', true)) {
|
||||||
|
$return[] = array(
|
||||||
|
'name' => 'inetOrgPerson_displayName',
|
||||||
|
'description' => _('Display name'),
|
||||||
|
'help' => 'displayName',
|
||||||
|
'example' => _('Steve Miller'),
|
||||||
|
);
|
||||||
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2255,6 +2283,8 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (isset($ids['inetOrgPerson_initials']) && ($rawAccounts[$i][$ids['inetOrgPerson_initials']] != "")) {
|
if (isset($ids['inetOrgPerson_initials']) && ($rawAccounts[$i][$ids['inetOrgPerson_initials']] != "")) {
|
||||||
$partialAccounts[$i]['initials'] = preg_split('/;[ ]*/', $rawAccounts[$i][$ids['inetOrgPerson_initials']]);
|
$partialAccounts[$i]['initials'] = preg_split('/;[ ]*/', $rawAccounts[$i][$ids['inetOrgPerson_initials']]);
|
||||||
}
|
}
|
||||||
|
// display name
|
||||||
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'inetOrgPerson_displayName', 'displayName');
|
||||||
// description
|
// description
|
||||||
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'inetOrgPerson_description', 'description');
|
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'inetOrgPerson_description', 'description');
|
||||||
// title
|
// title
|
||||||
|
@ -2540,7 +2570,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('firstName', $fields)) {
|
if (in_array('firstName', $fields)) {
|
||||||
$firstName = '';
|
$firstName = '';
|
||||||
if (isset($attributes['givenName'][0])) $firstName = $attributes['givenName'][0];
|
if (isset($attributes['givenName'][0])) {
|
||||||
|
$firstName = $attributes['givenName'][0];
|
||||||
|
}
|
||||||
$firstNameField = new htmlInputField('inetOrgPerson_firstName', $firstName);
|
$firstNameField = new htmlInputField('inetOrgPerson_firstName', $firstName);
|
||||||
if (in_array('firstName', $readOnlyFields)) {
|
if (in_array('firstName', $readOnlyFields)) {
|
||||||
$firstNameField = new htmlOutputText($firstName);
|
$firstNameField = new htmlOutputText($firstName);
|
||||||
|
@ -2551,7 +2583,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('lastName', $fields)) {
|
if (in_array('lastName', $fields)) {
|
||||||
$lastName = '';
|
$lastName = '';
|
||||||
if (isset($attributes['sn'][0])) $lastName = $attributes['sn'][0];
|
if (isset($attributes['sn'][0])) {
|
||||||
|
$lastName = $attributes['sn'][0];
|
||||||
|
}
|
||||||
$lastNameField = new htmlInputField('inetOrgPerson_lastName', $lastName);
|
$lastNameField = new htmlInputField('inetOrgPerson_lastName', $lastName);
|
||||||
if (in_array('lastName', $readOnlyFields)) {
|
if (in_array('lastName', $readOnlyFields)) {
|
||||||
$lastNameField = new htmlOutputText($lastName);
|
$lastNameField = new htmlOutputText($lastName);
|
||||||
|
@ -2562,7 +2596,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('mail', $fields)) {
|
if (in_array('mail', $fields)) {
|
||||||
$mail = '';
|
$mail = '';
|
||||||
if (isset($attributes['mail'][0])) $mail = $attributes['mail'][0];
|
if (isset($attributes['mail'][0])) {
|
||||||
|
$mail = $attributes['mail'][0];
|
||||||
|
}
|
||||||
$mailField = new htmlInputField('inetOrgPerson_mail', $mail);
|
$mailField = new htmlInputField('inetOrgPerson_mail', $mail);
|
||||||
if (in_array('mail', $readOnlyFields)) {
|
if (in_array('mail', $readOnlyFields)) {
|
||||||
$mailField = new htmlOutputText($mail);
|
$mailField = new htmlOutputText($mail);
|
||||||
|
@ -2573,7 +2609,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('labeledURI', $fields)) {
|
if (in_array('labeledURI', $fields)) {
|
||||||
$labeledURI = '';
|
$labeledURI = '';
|
||||||
if (isset($attributes['labeledURI'][0])) $labeledURI = implode('; ', $attributes['labeledURI']);
|
if (isset($attributes['labeledURI'][0])) {
|
||||||
|
$labeledURI = implode('; ', $attributes['labeledURI']);
|
||||||
|
}
|
||||||
$labeledURIField = new htmlInputField('inetOrgPerson_labeledURI', $labeledURI);
|
$labeledURIField = new htmlInputField('inetOrgPerson_labeledURI', $labeledURI);
|
||||||
if (in_array('labeledURI', $readOnlyFields)) {
|
if (in_array('labeledURI', $readOnlyFields)) {
|
||||||
$labeledURIField = new htmlOutputText($labeledURI);
|
$labeledURIField = new htmlOutputText($labeledURI);
|
||||||
|
@ -2584,7 +2622,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('telephoneNumber', $fields)) {
|
if (in_array('telephoneNumber', $fields)) {
|
||||||
$telephoneNumber = '';
|
$telephoneNumber = '';
|
||||||
if (isset($attributes['telephoneNumber'][0])) $telephoneNumber = $attributes['telephoneNumber'][0];
|
if (isset($attributes['telephoneNumber'][0])) {
|
||||||
|
$telephoneNumber = $attributes['telephoneNumber'][0];
|
||||||
|
}
|
||||||
$telephoneNumberField = new htmlInputField('inetOrgPerson_telephoneNumber', $telephoneNumber);
|
$telephoneNumberField = new htmlInputField('inetOrgPerson_telephoneNumber', $telephoneNumber);
|
||||||
if (in_array('telephoneNumber', $readOnlyFields)) {
|
if (in_array('telephoneNumber', $readOnlyFields)) {
|
||||||
$telephoneNumberField = new htmlOutputText($telephoneNumber);
|
$telephoneNumberField = new htmlOutputText($telephoneNumber);
|
||||||
|
@ -2595,7 +2635,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('homePhone', $fields)) {
|
if (in_array('homePhone', $fields)) {
|
||||||
$homePhone = '';
|
$homePhone = '';
|
||||||
if (isset($attributes['homePhone'][0])) $homePhone = $attributes['homePhone'][0];
|
if (isset($attributes['homePhone'][0])) {
|
||||||
|
$homePhone = $attributes['homePhone'][0];
|
||||||
|
}
|
||||||
$homePhoneField = new htmlInputField('inetOrgPerson_homePhone', $homePhone);
|
$homePhoneField = new htmlInputField('inetOrgPerson_homePhone', $homePhone);
|
||||||
if (in_array('homePhone', $readOnlyFields)) {
|
if (in_array('homePhone', $readOnlyFields)) {
|
||||||
$homePhoneField = new htmlOutputText($homePhone);
|
$homePhoneField = new htmlOutputText($homePhone);
|
||||||
|
@ -2606,7 +2648,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('mobile', $fields)) {
|
if (in_array('mobile', $fields)) {
|
||||||
$mobile = '';
|
$mobile = '';
|
||||||
if (isset($attributes['mobile'][0])) $mobile = $attributes['mobile'][0];
|
if (isset($attributes['mobile'][0])) {
|
||||||
|
$mobile = $attributes['mobile'][0];
|
||||||
|
}
|
||||||
$mobileField = new htmlInputField('inetOrgPerson_mobile', $mobile);
|
$mobileField = new htmlInputField('inetOrgPerson_mobile', $mobile);
|
||||||
if (in_array('mobile', $readOnlyFields)) {
|
if (in_array('mobile', $readOnlyFields)) {
|
||||||
$mobileField = new htmlOutputText($mobile);
|
$mobileField = new htmlOutputText($mobile);
|
||||||
|
@ -2617,7 +2661,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('faxNumber', $fields)) {
|
if (in_array('faxNumber', $fields)) {
|
||||||
$faxNumber = '';
|
$faxNumber = '';
|
||||||
if (isset($attributes['facsimileTelephoneNumber'][0])) $faxNumber = $attributes['facsimileTelephoneNumber'][0];
|
if (isset($attributes['facsimileTelephoneNumber'][0])) {
|
||||||
|
$faxNumber = $attributes['facsimileTelephoneNumber'][0];
|
||||||
|
}
|
||||||
$faxNumberField = new htmlInputField('inetOrgPerson_faxNumber', $faxNumber);
|
$faxNumberField = new htmlInputField('inetOrgPerson_faxNumber', $faxNumber);
|
||||||
if (in_array('faxNumber', $readOnlyFields)) {
|
if (in_array('faxNumber', $readOnlyFields)) {
|
||||||
$faxNumberField = new htmlOutputText($faxNumber);
|
$faxNumberField = new htmlOutputText($faxNumber);
|
||||||
|
@ -2628,7 +2674,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('pager', $fields)) {
|
if (in_array('pager', $fields)) {
|
||||||
$pager = '';
|
$pager = '';
|
||||||
if (isset($attributes['pager'][0])) $pager = $attributes['pager'][0];
|
if (isset($attributes['pager'][0])) {
|
||||||
|
$pager = $attributes['pager'][0];
|
||||||
|
}
|
||||||
$pagerField = new htmlInputField('inetOrgPerson_pager', $pager);
|
$pagerField = new htmlInputField('inetOrgPerson_pager', $pager);
|
||||||
if (in_array('pager', $readOnlyFields)) {
|
if (in_array('pager', $readOnlyFields)) {
|
||||||
$pagerField = new htmlOutputText($pager);
|
$pagerField = new htmlOutputText($pager);
|
||||||
|
@ -2639,7 +2687,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('street', $fields)) {
|
if (in_array('street', $fields)) {
|
||||||
$street = '';
|
$street = '';
|
||||||
if (isset($attributes['street'][0])) $street = $attributes['street'][0];
|
if (isset($attributes['street'][0])) {
|
||||||
|
$street = $attributes['street'][0];
|
||||||
|
}
|
||||||
$streetField = new htmlInputField('inetOrgPerson_street', $street);
|
$streetField = new htmlInputField('inetOrgPerson_street', $street);
|
||||||
if (in_array('street', $readOnlyFields)) {
|
if (in_array('street', $readOnlyFields)) {
|
||||||
$streetField = new htmlOutputText($street);
|
$streetField = new htmlOutputText($street);
|
||||||
|
@ -2650,7 +2700,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('postalAddress', $fields)) {
|
if (in_array('postalAddress', $fields)) {
|
||||||
$postalAddress = '';
|
$postalAddress = '';
|
||||||
if (isset($attributes['postalAddress'][0])) $postalAddress = $attributes['postalAddress'][0];
|
if (isset($attributes['postalAddress'][0])) {
|
||||||
|
$postalAddress = $attributes['postalAddress'][0];
|
||||||
|
}
|
||||||
$postalAddressField = new htmlInputField('inetOrgPerson_postalAddress', $postalAddress);
|
$postalAddressField = new htmlInputField('inetOrgPerson_postalAddress', $postalAddress);
|
||||||
if (in_array('postalAddress', $readOnlyFields)) {
|
if (in_array('postalAddress', $readOnlyFields)) {
|
||||||
$postalAddressField = new htmlOutputText($postalAddress);
|
$postalAddressField = new htmlOutputText($postalAddress);
|
||||||
|
@ -2661,7 +2713,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('registeredAddress', $fields)) {
|
if (in_array('registeredAddress', $fields)) {
|
||||||
$registeredAddress = '';
|
$registeredAddress = '';
|
||||||
if (isset($attributes['registeredAddress'][0])) $registeredAddress = $attributes['registeredAddress'][0];
|
if (isset($attributes['registeredAddress'][0])) {
|
||||||
|
$registeredAddress = $attributes['registeredAddress'][0];
|
||||||
|
}
|
||||||
$registeredAddressField = new htmlInputField('inetOrgPerson_registeredAddress', $registeredAddress);
|
$registeredAddressField = new htmlInputField('inetOrgPerson_registeredAddress', $registeredAddress);
|
||||||
if (in_array('registeredAddress', $readOnlyFields)) {
|
if (in_array('registeredAddress', $readOnlyFields)) {
|
||||||
$registeredAddressField = new htmlOutputText($registeredAddress);
|
$registeredAddressField = new htmlOutputText($registeredAddress);
|
||||||
|
@ -2672,7 +2726,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('postalCode', $fields)) {
|
if (in_array('postalCode', $fields)) {
|
||||||
$postalCode = '';
|
$postalCode = '';
|
||||||
if (isset($attributes['postalCode'][0])) $postalCode = $attributes['postalCode'][0];
|
if (isset($attributes['postalCode'][0])) {
|
||||||
|
$postalCode = $attributes['postalCode'][0];
|
||||||
|
}
|
||||||
$postalCodeField = new htmlInputField('inetOrgPerson_postalCode', $postalCode);
|
$postalCodeField = new htmlInputField('inetOrgPerson_postalCode', $postalCode);
|
||||||
if (in_array('postalCode', $readOnlyFields)) {
|
if (in_array('postalCode', $readOnlyFields)) {
|
||||||
$postalCodeField = new htmlOutputText($postalCode);
|
$postalCodeField = new htmlOutputText($postalCode);
|
||||||
|
@ -2683,7 +2739,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('postOfficeBox', $fields)) {
|
if (in_array('postOfficeBox', $fields)) {
|
||||||
$postOfficeBox = '';
|
$postOfficeBox = '';
|
||||||
if (isset($attributes['postOfficeBox'][0])) $postOfficeBox = $attributes['postOfficeBox'][0];
|
if (isset($attributes['postOfficeBox'][0])) {
|
||||||
|
$postOfficeBox = $attributes['postOfficeBox'][0];
|
||||||
|
}
|
||||||
$postOfficeBoxField = new htmlInputField('inetOrgPerson_postOfficeBox', $postOfficeBox);
|
$postOfficeBoxField = new htmlInputField('inetOrgPerson_postOfficeBox', $postOfficeBox);
|
||||||
if (in_array('postOfficeBox', $readOnlyFields)) {
|
if (in_array('postOfficeBox', $readOnlyFields)) {
|
||||||
$postOfficeBoxField = new htmlOutputText($postOfficeBox);
|
$postOfficeBoxField = new htmlOutputText($postOfficeBox);
|
||||||
|
@ -2694,7 +2752,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('roomNumber', $fields)) {
|
if (in_array('roomNumber', $fields)) {
|
||||||
$roomNumber = '';
|
$roomNumber = '';
|
||||||
if (isset($attributes['roomNumber'][0])) $roomNumber = $attributes['roomNumber'][0];
|
if (isset($attributes['roomNumber'][0])) {
|
||||||
|
$roomNumber = $attributes['roomNumber'][0];
|
||||||
|
}
|
||||||
$roomNumberField = new htmlInputField('inetOrgPerson_roomNumber', $roomNumber);
|
$roomNumberField = new htmlInputField('inetOrgPerson_roomNumber', $roomNumber);
|
||||||
if (in_array('roomNumber', $readOnlyFields)) {
|
if (in_array('roomNumber', $readOnlyFields)) {
|
||||||
$roomNumberField = new htmlOutputText($roomNumber);
|
$roomNumberField = new htmlOutputText($roomNumber);
|
||||||
|
@ -2705,7 +2765,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('location', $fields)) {
|
if (in_array('location', $fields)) {
|
||||||
$l = '';
|
$l = '';
|
||||||
if (isset($attributes['l'][0])) $l = $attributes['l'][0];
|
if (isset($attributes['l'][0])) {
|
||||||
|
$l = $attributes['l'][0];
|
||||||
|
}
|
||||||
$lField = new htmlInputField('inetOrgPerson_location', $l);
|
$lField = new htmlInputField('inetOrgPerson_location', $l);
|
||||||
if (in_array('location', $readOnlyFields)) {
|
if (in_array('location', $readOnlyFields)) {
|
||||||
$lField = new htmlOutputText($l);
|
$lField = new htmlOutputText($l);
|
||||||
|
@ -2716,7 +2778,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('state', $fields)) {
|
if (in_array('state', $fields)) {
|
||||||
$st = '';
|
$st = '';
|
||||||
if (isset($attributes['st'][0])) $st = $attributes['st'][0];
|
if (isset($attributes['st'][0])) {
|
||||||
|
$st = $attributes['st'][0];
|
||||||
|
}
|
||||||
$stField = new htmlInputField('inetOrgPerson_state', $st);
|
$stField = new htmlInputField('inetOrgPerson_state', $st);
|
||||||
if (in_array('state', $readOnlyFields)) {
|
if (in_array('state', $readOnlyFields)) {
|
||||||
$stField = new htmlOutputText($st);
|
$stField = new htmlOutputText($st);
|
||||||
|
@ -2727,7 +2791,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('carLicense', $fields)) {
|
if (in_array('carLicense', $fields)) {
|
||||||
$carLicense = '';
|
$carLicense = '';
|
||||||
if (isset($attributes['carLicense'][0])) $carLicense = $attributes['carLicense'][0];
|
if (isset($attributes['carLicense'][0])) {
|
||||||
|
$carLicense = $attributes['carLicense'][0];
|
||||||
|
}
|
||||||
$carLicenseField = new htmlInputField('inetOrgPerson_carLicense', $carLicense);
|
$carLicenseField = new htmlInputField('inetOrgPerson_carLicense', $carLicense);
|
||||||
if (in_array('carLicense', $readOnlyFields)) {
|
if (in_array('carLicense', $readOnlyFields)) {
|
||||||
$carLicenseField = new htmlOutputText($carLicense);
|
$carLicenseField = new htmlOutputText($carLicense);
|
||||||
|
@ -2738,7 +2804,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('officeName', $fields)) {
|
if (in_array('officeName', $fields)) {
|
||||||
$physicalDeliveryOfficeName = '';
|
$physicalDeliveryOfficeName = '';
|
||||||
if (isset($attributes['physicalDeliveryOfficeName'][0])) $physicalDeliveryOfficeName = $attributes['physicalDeliveryOfficeName'][0];
|
if (isset($attributes['physicalDeliveryOfficeName'][0])) {
|
||||||
|
$physicalDeliveryOfficeName = $attributes['physicalDeliveryOfficeName'][0];
|
||||||
|
}
|
||||||
$physicalDeliveryOfficeNameField = new htmlInputField('inetOrgPerson_officeName', $physicalDeliveryOfficeName);
|
$physicalDeliveryOfficeNameField = new htmlInputField('inetOrgPerson_officeName', $physicalDeliveryOfficeName);
|
||||||
if (in_array('officeName', $readOnlyFields)) {
|
if (in_array('officeName', $readOnlyFields)) {
|
||||||
$physicalDeliveryOfficeNameField = new htmlOutputText($physicalDeliveryOfficeName);
|
$physicalDeliveryOfficeNameField = new htmlOutputText($physicalDeliveryOfficeName);
|
||||||
|
@ -2749,7 +2817,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('businessCategory', $fields)) {
|
if (in_array('businessCategory', $fields)) {
|
||||||
$businessCategory = '';
|
$businessCategory = '';
|
||||||
if (isset($attributes['businessCategory'][0])) $businessCategory = $attributes['businessCategory'][0];
|
if (isset($attributes['businessCategory'][0])) {
|
||||||
|
$businessCategory = $attributes['businessCategory'][0];
|
||||||
|
}
|
||||||
$businessCategoryField = new htmlInputField('inetOrgPerson_businessCategory', $businessCategory);
|
$businessCategoryField = new htmlInputField('inetOrgPerson_businessCategory', $businessCategory);
|
||||||
if (in_array('businessCategory', $readOnlyFields)) {
|
if (in_array('businessCategory', $readOnlyFields)) {
|
||||||
$businessCategoryField = new htmlOutputText($businessCategory);
|
$businessCategoryField = new htmlOutputText($businessCategory);
|
||||||
|
@ -2775,7 +2845,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('departmentNumber', $fields)) {
|
if (in_array('departmentNumber', $fields)) {
|
||||||
$departmentNumber = '';
|
$departmentNumber = '';
|
||||||
if (isset($attributes['departmentNumber'][0])) $departmentNumber = implode('; ', $attributes['departmentNumber']);
|
if (isset($attributes['departmentNumber'][0])) {
|
||||||
|
$departmentNumber = implode('; ', $attributes['departmentNumber']);
|
||||||
|
}
|
||||||
$departmentNumberField = new htmlInputField('inetOrgPerson_departmentNumber', $departmentNumber);
|
$departmentNumberField = new htmlInputField('inetOrgPerson_departmentNumber', $departmentNumber);
|
||||||
if (in_array('departmentNumber', $readOnlyFields)) {
|
if (in_array('departmentNumber', $readOnlyFields)) {
|
||||||
$departmentNumberField = new htmlOutputText($departmentNumber);
|
$departmentNumberField = new htmlOutputText($departmentNumber);
|
||||||
|
@ -2786,7 +2858,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('initials', $fields)) {
|
if (in_array('initials', $fields)) {
|
||||||
$initials = '';
|
$initials = '';
|
||||||
if (isset($attributes['initials'][0])) $initials = implode('; ', $attributes['initials']);
|
if (isset($attributes['initials'][0])) {
|
||||||
|
$initials = implode('; ', $attributes['initials']);
|
||||||
|
}
|
||||||
$initialsField = new htmlInputField('inetOrgPerson_initials', $initials);
|
$initialsField = new htmlInputField('inetOrgPerson_initials', $initials);
|
||||||
if (in_array('initials', $readOnlyFields)) {
|
if (in_array('initials', $readOnlyFields)) {
|
||||||
$initialsField = new htmlOutputText($initials);
|
$initialsField = new htmlOutputText($initials);
|
||||||
|
@ -2797,7 +2871,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
}
|
}
|
||||||
if (in_array('title', $fields)) {
|
if (in_array('title', $fields)) {
|
||||||
$title = '';
|
$title = '';
|
||||||
if (isset($attributes['title'][0])) $title = $attributes['title'][0];
|
if (isset($attributes['title'][0])) {
|
||||||
|
$title = $attributes['title'][0];
|
||||||
|
}
|
||||||
$titleField = new htmlInputField('inetOrgPerson_title', $title);
|
$titleField = new htmlInputField('inetOrgPerson_title', $title);
|
||||||
if (in_array('title', $readOnlyFields)) {
|
if (in_array('title', $readOnlyFields)) {
|
||||||
$titleField = new htmlOutputText($title);
|
$titleField = new htmlOutputText($title);
|
||||||
|
@ -2835,7 +2911,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
// o
|
// o
|
||||||
if (in_array('o', $fields)) {
|
if (in_array('o', $fields)) {
|
||||||
$o = '';
|
$o = '';
|
||||||
if (isset($attributes['o'][0])) $o = $attributes['o'][0];
|
if (isset($attributes['o'][0])) {
|
||||||
|
$o = $attributes['o'][0];
|
||||||
|
}
|
||||||
if (in_array('o', $readOnlyFields)) {
|
if (in_array('o', $readOnlyFields)) {
|
||||||
$oField = new htmlOutputText(getAbstractDN($o));
|
$oField = new htmlOutputText(getAbstractDN($o));
|
||||||
}
|
}
|
||||||
|
@ -2871,7 +2949,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
// ou
|
// ou
|
||||||
if (in_array('ou', $fields)) {
|
if (in_array('ou', $fields)) {
|
||||||
$ou = '';
|
$ou = '';
|
||||||
if (isset($attributes['ou'][0])) $ou = $attributes['ou'][0];
|
if (isset($attributes['ou'][0])) {
|
||||||
|
$ou = $attributes['ou'][0];
|
||||||
|
}
|
||||||
if (in_array('ou', $readOnlyFields)) {
|
if (in_array('ou', $readOnlyFields)) {
|
||||||
$ouField = new htmlOutputText(getAbstractDN($ou));
|
$ouField = new htmlOutputText(getAbstractDN($ou));
|
||||||
}
|
}
|
||||||
|
@ -2907,7 +2987,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
// description
|
// description
|
||||||
if (in_array('description', $fields)) {
|
if (in_array('description', $fields)) {
|
||||||
$description = '';
|
$description = '';
|
||||||
if (isset($attributes['description'][0])) $description = $attributes['description'][0];
|
if (isset($attributes['description'][0])) {
|
||||||
|
$description = $attributes['description'][0];
|
||||||
|
}
|
||||||
$descriptionField = new htmlInputField('inetOrgPerson_description', $description);
|
$descriptionField = new htmlInputField('inetOrgPerson_description', $description);
|
||||||
if (in_array('description', $readOnlyFields)) {
|
if (in_array('description', $readOnlyFields)) {
|
||||||
$descriptionField = new htmlOutputText($description);
|
$descriptionField = new htmlOutputText($description);
|
||||||
|
@ -2919,7 +3001,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
// uid
|
// uid
|
||||||
if (in_array('uid', $fields)) {
|
if (in_array('uid', $fields)) {
|
||||||
$uid = '';
|
$uid = '';
|
||||||
if (isset($attributes['uid'][0])) $uid = $attributes['uid'][0];
|
if (isset($attributes['uid'][0])) {
|
||||||
|
$uid = $attributes['uid'][0];
|
||||||
|
}
|
||||||
$uidField = new htmlInputField('inetOrgPerson_uid', $uid);
|
$uidField = new htmlInputField('inetOrgPerson_uid', $uid);
|
||||||
if (in_array('uid', $readOnlyFields)) {
|
if (in_array('uid', $readOnlyFields)) {
|
||||||
$uidField = new htmlOutputText($uid);
|
$uidField = new htmlOutputText($uid);
|
||||||
|
@ -2928,6 +3012,19 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
new htmlOutputText($this->getSelfServiceLabel('uid', _('User name'))), $uidField
|
new htmlOutputText($this->getSelfServiceLabel('uid', _('User name'))), $uidField
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (in_array('displayName', $fields)) {
|
||||||
|
$displayName = '';
|
||||||
|
if (isset($attributes['displayName'][0])) {
|
||||||
|
$displayName = $attributes['displayName'][0];
|
||||||
|
}
|
||||||
|
$displayNameField = new htmlInputField('inetOrgPerson_displayName', $displayName);
|
||||||
|
if (in_array('displayName', $readOnlyFields)) {
|
||||||
|
$displayNameField = new htmlOutputText($displayName);
|
||||||
|
}
|
||||||
|
$return['displayName'] = new htmlResponsiveRow(
|
||||||
|
new htmlOutputText($this->getSelfServiceLabel('displayName', _('Display name'))), $displayNameField
|
||||||
|
);
|
||||||
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3174,17 +3271,27 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (in_array('firstName', $fields) && !in_array('firstName', $readOnlyFields)) {
|
if (in_array('firstName', $fields) && !in_array('firstName', $readOnlyFields)) {
|
||||||
$attributeNames[] = 'givenName';
|
$attributeNames[] = 'givenName';
|
||||||
if (isset($_POST['inetOrgPerson_firstName']) && ($_POST['inetOrgPerson_firstName'] != '')) {
|
if (isset($_POST['inetOrgPerson_firstName']) && ($_POST['inetOrgPerson_firstName'] != '')) {
|
||||||
if (!get_preg($_POST['inetOrgPerson_firstName'], 'realname')) $return['messages'][] = $this->messages['givenName'][0];
|
if (!get_preg($_POST['inetOrgPerson_firstName'], 'realname')) {
|
||||||
else $attributesNew['givenName'][0] = $_POST['inetOrgPerson_firstName'];
|
$return['messages'][] = $this->messages['givenName'][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$attributesNew['givenName'][0] = $_POST['inetOrgPerson_firstName'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($attributes['givenName'])) {
|
||||||
|
unset($attributesNew['givenName']);
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['givenName'])) unset($attributesNew['givenName']);
|
|
||||||
}
|
}
|
||||||
// last name
|
// last name
|
||||||
if (in_array('lastName', $fields) && !in_array('lastName', $readOnlyFields)) {
|
if (in_array('lastName', $fields) && !in_array('lastName', $readOnlyFields)) {
|
||||||
$attributeNames[] = 'sn';
|
$attributeNames[] = 'sn';
|
||||||
if (isset($_POST['inetOrgPerson_lastName']) && ($_POST['inetOrgPerson_lastName'] != '')) {
|
if (isset($_POST['inetOrgPerson_lastName']) && ($_POST['inetOrgPerson_lastName'] != '')) {
|
||||||
if (!get_preg($_POST['inetOrgPerson_lastName'], 'realname')) $return['messages'][] = $this->messages['lastname'][0];
|
if (!get_preg($_POST['inetOrgPerson_lastName'], 'realname')) {
|
||||||
else $attributesNew['sn'][0] = $_POST['inetOrgPerson_lastName'];
|
$return['messages'][] = $this->messages['lastname'][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$attributesNew['sn'][0] = $_POST['inetOrgPerson_lastName'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// last name is required attribute
|
// last name is required attribute
|
||||||
|
@ -3195,10 +3302,16 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (in_array('mail', $fields) && !in_array('mail', $readOnlyFields)) {
|
if (in_array('mail', $fields) && !in_array('mail', $readOnlyFields)) {
|
||||||
$attributeNames[] = 'mail';
|
$attributeNames[] = 'mail';
|
||||||
if (isset($_POST['inetOrgPerson_mail']) && ($_POST['inetOrgPerson_mail'] != '')) {
|
if (isset($_POST['inetOrgPerson_mail']) && ($_POST['inetOrgPerson_mail'] != '')) {
|
||||||
if (!get_preg($_POST['inetOrgPerson_mail'], 'email')) $return['messages'][] = $this->messages['email'][0];
|
if (!get_preg($_POST['inetOrgPerson_mail'], 'email')) {
|
||||||
else $attributesNew['mail'][0] = $_POST['inetOrgPerson_mail'];
|
$return['messages'][] = $this->messages['email'][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$attributesNew['mail'][0] = $_POST['inetOrgPerson_mail'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($attributes['mail'])) {
|
||||||
|
unset($attributesNew['mail']);
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['mail'])) unset($attributesNew['mail']);
|
|
||||||
}
|
}
|
||||||
// labeledURI
|
// labeledURI
|
||||||
if (in_array('labeledURI', $fields) && !in_array('labeledURI', $readOnlyFields)) {
|
if (in_array('labeledURI', $fields) && !in_array('labeledURI', $readOnlyFields)) {
|
||||||
|
@ -3206,88 +3319,144 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (isset($_POST['inetOrgPerson_labeledURI']) && ($_POST['inetOrgPerson_labeledURI'] != '')) {
|
if (isset($_POST['inetOrgPerson_labeledURI']) && ($_POST['inetOrgPerson_labeledURI'] != '')) {
|
||||||
$attributesNew['labeledURI'] = preg_split('/;[ ]*/', $_POST['inetOrgPerson_labeledURI']);
|
$attributesNew['labeledURI'] = preg_split('/;[ ]*/', $_POST['inetOrgPerson_labeledURI']);
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['labeledURI'])) unset($attributesNew['labeledURI']);
|
elseif (isset($attributes['labeledURI'])) {
|
||||||
|
unset($attributesNew['labeledURI']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// telephone number
|
// telephone number
|
||||||
if (in_array('telephoneNumber', $fields) && !in_array('telephoneNumber', $readOnlyFields)) {
|
if (in_array('telephoneNumber', $fields) && !in_array('telephoneNumber', $readOnlyFields)) {
|
||||||
$attributeNames[] = 'telephoneNumber';
|
$attributeNames[] = 'telephoneNumber';
|
||||||
if (isset($_POST['inetOrgPerson_telephoneNumber']) && ($_POST['inetOrgPerson_telephoneNumber'] != '')) {
|
if (isset($_POST['inetOrgPerson_telephoneNumber']) && ($_POST['inetOrgPerson_telephoneNumber'] != '')) {
|
||||||
if (!get_preg($_POST['inetOrgPerson_telephoneNumber'], 'telephone')) $return['messages'][] = $this->messages['telephoneNumber'][0];
|
if (!get_preg($_POST['inetOrgPerson_telephoneNumber'], 'telephone')) {
|
||||||
else $attributesNew['telephoneNumber'][0] = $_POST['inetOrgPerson_telephoneNumber'];
|
$return['messages'][] = $this->messages['telephoneNumber'][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$attributesNew['telephoneNumber'][0] = $_POST['inetOrgPerson_telephoneNumber'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($attributes['telephoneNumber'])) {
|
||||||
|
unset($attributesNew['telephoneNumber']);
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['telephoneNumber'])) unset($attributesNew['telephoneNumber']);
|
|
||||||
}
|
}
|
||||||
// home telephone number
|
// home telephone number
|
||||||
if (in_array('homePhone', $fields) && !in_array('homePhone', $readOnlyFields)) {
|
if (in_array('homePhone', $fields) && !in_array('homePhone', $readOnlyFields)) {
|
||||||
$attributeNames[] = 'homePhone';
|
$attributeNames[] = 'homePhone';
|
||||||
if (isset($_POST['inetOrgPerson_homePhone']) && ($_POST['inetOrgPerson_homePhone'] != '')) {
|
if (isset($_POST['inetOrgPerson_homePhone']) && ($_POST['inetOrgPerson_homePhone'] != '')) {
|
||||||
if (!get_preg($_POST['inetOrgPerson_homePhone'], 'telephone')) $return['messages'][] = $this->messages['homePhone'][0];
|
if (!get_preg($_POST['inetOrgPerson_homePhone'], 'telephone')) {
|
||||||
else $attributesNew['homePhone'][0] = $_POST['inetOrgPerson_homePhone'];
|
$return['messages'][] = $this->messages['homePhone'][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$attributesNew['homePhone'][0] = $_POST['inetOrgPerson_homePhone'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($attributes['homePhone'])) {
|
||||||
|
unset($attributesNew['homePhone']);
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['homePhone'])) unset($attributesNew['homePhone']);
|
|
||||||
}
|
}
|
||||||
// fax number
|
// fax number
|
||||||
if (in_array('faxNumber', $fields) && !in_array('faxNumber', $readOnlyFields)) {
|
if (in_array('faxNumber', $fields) && !in_array('faxNumber', $readOnlyFields)) {
|
||||||
$attributeNames[] = 'facsimileTelephoneNumber';
|
$attributeNames[] = 'facsimileTelephoneNumber';
|
||||||
if (isset($_POST['inetOrgPerson_faxNumber']) && ($_POST['inetOrgPerson_faxNumber'] != '')) {
|
if (isset($_POST['inetOrgPerson_faxNumber']) && ($_POST['inetOrgPerson_faxNumber'] != '')) {
|
||||||
if (!get_preg($_POST['inetOrgPerson_faxNumber'], 'telephone')) $return['messages'][] = $this->messages['facsimileNumber'][0];
|
if (!get_preg($_POST['inetOrgPerson_faxNumber'], 'telephone')) {
|
||||||
else $attributesNew['facsimileTelephoneNumber'][0] = $_POST['inetOrgPerson_faxNumber'];
|
$return['messages'][] = $this->messages['facsimileNumber'][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$attributesNew['facsimileTelephoneNumber'][0] = $_POST['inetOrgPerson_faxNumber'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($attributes['facsimileTelephoneNumber'])) {
|
||||||
|
$attributesNew['facsimileTelephoneNumber'] = array();
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['facsimileTelephoneNumber'])) $attributesNew['facsimileTelephoneNumber'] = array();
|
|
||||||
}
|
}
|
||||||
// mobile telephone number
|
// mobile telephone number
|
||||||
if (in_array('mobile', $fields) && !in_array('mobile', $readOnlyFields)) {
|
if (in_array('mobile', $fields) && !in_array('mobile', $readOnlyFields)) {
|
||||||
$attributeNames[] = 'mobile';
|
$attributeNames[] = 'mobile';
|
||||||
if (isset($_POST['inetOrgPerson_mobile']) && ($_POST['inetOrgPerson_mobile'] != '')) {
|
if (isset($_POST['inetOrgPerson_mobile']) && ($_POST['inetOrgPerson_mobile'] != '')) {
|
||||||
if (!get_preg($_POST['inetOrgPerson_mobile'], 'telephone')) $return['messages'][] = $this->messages['mobileTelephone'][0];
|
if (!get_preg($_POST['inetOrgPerson_mobile'], 'telephone')) {
|
||||||
else $attributesNew['mobile'][0] = $_POST['inetOrgPerson_mobile'];
|
$return['messages'][] = $this->messages['mobileTelephone'][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$attributesNew['mobile'][0] = $_POST['inetOrgPerson_mobile'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($attributes['mobile'])) {
|
||||||
|
unset($attributesNew['mobile']);
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['mobile'])) unset($attributesNew['mobile']);
|
|
||||||
}
|
}
|
||||||
// pager
|
// pager
|
||||||
if (in_array('pager', $fields) && !in_array('pager', $readOnlyFields)) {
|
if (in_array('pager', $fields) && !in_array('pager', $readOnlyFields)) {
|
||||||
$attributeNames[] = 'pager';
|
$attributeNames[] = 'pager';
|
||||||
if (isset($_POST['inetOrgPerson_pager']) && ($_POST['inetOrgPerson_pager'] != '')) {
|
if (isset($_POST['inetOrgPerson_pager']) && ($_POST['inetOrgPerson_pager'] != '')) {
|
||||||
if (!get_preg($_POST['inetOrgPerson_pager'], 'telephone')) $return['messages'][] = $this->messages['pager'][0];
|
if (!get_preg($_POST['inetOrgPerson_pager'], 'telephone')) {
|
||||||
else $attributesNew['pager'][0] = $_POST['inetOrgPerson_pager'];
|
$return['messages'][] = $this->messages['pager'][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$attributesNew['pager'][0] = $_POST['inetOrgPerson_pager'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($attributes['pager'])) {
|
||||||
|
unset($attributesNew['pager']);
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['pager'])) unset($attributesNew['pager']);
|
|
||||||
}
|
}
|
||||||
// street
|
// street
|
||||||
if (in_array('street', $fields) && !in_array('street', $readOnlyFields)) {
|
if (in_array('street', $fields) && !in_array('street', $readOnlyFields)) {
|
||||||
$attributeNames[] = 'street';
|
$attributeNames[] = 'street';
|
||||||
if (isset($_POST['inetOrgPerson_street']) && ($_POST['inetOrgPerson_street'] != '')) {
|
if (isset($_POST['inetOrgPerson_street']) && ($_POST['inetOrgPerson_street'] != '')) {
|
||||||
if (!get_preg($_POST['inetOrgPerson_street'], 'street')) $return['messages'][] = $this->messages['street'][0];
|
if (!get_preg($_POST['inetOrgPerson_street'], 'street')) {
|
||||||
else $attributesNew['street'][0] = $_POST['inetOrgPerson_street'];
|
$return['messages'][] = $this->messages['street'][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$attributesNew['street'][0] = $_POST['inetOrgPerson_street'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($attributes['street'])) {
|
||||||
|
unset($attributesNew['street']);
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['street'])) unset($attributesNew['street']);
|
|
||||||
}
|
}
|
||||||
// postal address
|
// postal address
|
||||||
if (in_array('postalAddress', $fields) && !in_array('postalAddress', $readOnlyFields)) {
|
if (in_array('postalAddress', $fields) && !in_array('postalAddress', $readOnlyFields)) {
|
||||||
$attributeNames[] = 'postalAddress';
|
$attributeNames[] = 'postalAddress';
|
||||||
if (isset($_POST['inetOrgPerson_postalAddress']) && ($_POST['inetOrgPerson_postalAddress'] != '')) {
|
if (isset($_POST['inetOrgPerson_postalAddress']) && ($_POST['inetOrgPerson_postalAddress'] != '')) {
|
||||||
if (!get_preg($_POST['inetOrgPerson_postalAddress'], 'postalAddress')) $return['messages'][] = $this->messages['postalAddress'][0];
|
if (!get_preg($_POST['inetOrgPerson_postalAddress'], 'postalAddress')) {
|
||||||
else $attributesNew['postalAddress'][0] = $_POST['inetOrgPerson_postalAddress'];
|
$return['messages'][] = $this->messages['postalAddress'][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$attributesNew['postalAddress'][0] = $_POST['inetOrgPerson_postalAddress'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($attributes['postalAddress'])) {
|
||||||
|
$attributesNew['postalAddress'] = array();
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['postalAddress'])) $attributesNew['postalAddress'] = array();
|
|
||||||
}
|
}
|
||||||
// registered address
|
// registered address
|
||||||
if (in_array('registeredAddress', $fields) && !in_array('registeredAddress', $readOnlyFields)) {
|
if (in_array('registeredAddress', $fields) && !in_array('registeredAddress', $readOnlyFields)) {
|
||||||
$attributeNames[] = 'registeredAddress';
|
$attributeNames[] = 'registeredAddress';
|
||||||
if (isset($_POST['inetOrgPerson_registeredAddress']) && ($_POST['inetOrgPerson_registeredAddress'] != '')) {
|
if (isset($_POST['inetOrgPerson_registeredAddress']) && ($_POST['inetOrgPerson_registeredAddress'] != '')) {
|
||||||
if (!get_preg($_POST['inetOrgPerson_registeredAddress'], 'postalAddress')) $return['messages'][] = $this->messages['registeredAddress'][0];
|
if (!get_preg($_POST['inetOrgPerson_registeredAddress'], 'postalAddress')) {
|
||||||
else $attributesNew['registeredAddress'][0] = $_POST['inetOrgPerson_registeredAddress'];
|
$return['messages'][] = $this->messages['registeredAddress'][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$attributesNew['registeredAddress'][0] = $_POST['inetOrgPerson_registeredAddress'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($attributes['registeredAddress'])) {
|
||||||
|
$attributesNew['registeredAddress'] = array();
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['registeredAddress'])) $attributesNew['registeredAddress'] = array();
|
|
||||||
}
|
}
|
||||||
// postal code
|
// postal code
|
||||||
if (in_array('postalCode', $fields) && !in_array('postalCode', $readOnlyFields)) {
|
if (in_array('postalCode', $fields) && !in_array('postalCode', $readOnlyFields)) {
|
||||||
$attributeNames[] = 'postalCode';
|
$attributeNames[] = 'postalCode';
|
||||||
if (isset($_POST['inetOrgPerson_postalCode']) && ($_POST['inetOrgPerson_postalCode'] != '')) {
|
if (isset($_POST['inetOrgPerson_postalCode']) && ($_POST['inetOrgPerson_postalCode'] != '')) {
|
||||||
if (!get_preg($_POST['inetOrgPerson_postalCode'], 'postalCode')) $return['messages'][] = $this->messages['postalCode'][0];
|
if (!get_preg($_POST['inetOrgPerson_postalCode'], 'postalCode')) {
|
||||||
else $attributesNew['postalCode'][0] = $_POST['inetOrgPerson_postalCode'];
|
$return['messages'][] = $this->messages['postalCode'][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$attributesNew['postalCode'][0] = $_POST['inetOrgPerson_postalCode'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($attributes['postalCode'])) {
|
||||||
|
unset($attributesNew['postalCode']);
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['postalCode'])) unset($attributesNew['postalCode']);
|
|
||||||
}
|
}
|
||||||
// post office box
|
// post office box
|
||||||
if (in_array('postOfficeBox', $fields) && !in_array('postOfficeBox', $readOnlyFields)) {
|
if (in_array('postOfficeBox', $fields) && !in_array('postOfficeBox', $readOnlyFields)) {
|
||||||
|
@ -3295,7 +3464,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (isset($_POST['inetOrgPerson_postOfficeBox']) && ($_POST['inetOrgPerson_postOfficeBox'] != '')) {
|
if (isset($_POST['inetOrgPerson_postOfficeBox']) && ($_POST['inetOrgPerson_postOfficeBox'] != '')) {
|
||||||
$attributesNew['postOfficeBox'][0] = $_POST['inetOrgPerson_postOfficeBox'];
|
$attributesNew['postOfficeBox'][0] = $_POST['inetOrgPerson_postOfficeBox'];
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['postOfficeBox'])) unset($attributesNew['postOfficeBox']);
|
elseif (isset($attributes['postOfficeBox'])) {
|
||||||
|
unset($attributesNew['postOfficeBox']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// room number
|
// room number
|
||||||
if (in_array('roomNumber', $fields) && !in_array('roomNumber', $readOnlyFields)) {
|
if (in_array('roomNumber', $fields) && !in_array('roomNumber', $readOnlyFields)) {
|
||||||
|
@ -3303,7 +3474,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (isset($_POST['inetOrgPerson_roomNumber']) && ($_POST['inetOrgPerson_roomNumber'] != '')) {
|
if (isset($_POST['inetOrgPerson_roomNumber']) && ($_POST['inetOrgPerson_roomNumber'] != '')) {
|
||||||
$attributesNew['roomNumber'][0] = $_POST['inetOrgPerson_roomNumber'];
|
$attributesNew['roomNumber'][0] = $_POST['inetOrgPerson_roomNumber'];
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['roomNumber'])) unset($attributesNew['roomNumber']);
|
elseif (isset($attributes['roomNumber'])) {
|
||||||
|
unset($attributesNew['roomNumber']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// l
|
// l
|
||||||
if (in_array('location', $fields) && !in_array('location', $readOnlyFields)) {
|
if (in_array('location', $fields) && !in_array('location', $readOnlyFields)) {
|
||||||
|
@ -3311,7 +3484,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (isset($_POST['inetOrgPerson_location']) && ($_POST['inetOrgPerson_location'] != '')) {
|
if (isset($_POST['inetOrgPerson_location']) && ($_POST['inetOrgPerson_location'] != '')) {
|
||||||
$attributesNew['l'][0] = $_POST['inetOrgPerson_location'];
|
$attributesNew['l'][0] = $_POST['inetOrgPerson_location'];
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['l'])) unset($attributesNew['l']);
|
elseif (isset($attributes['l'])) {
|
||||||
|
unset($attributesNew['l']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// st
|
// st
|
||||||
if (in_array('state', $fields) && !in_array('state', $readOnlyFields)) {
|
if (in_array('state', $fields) && !in_array('state', $readOnlyFields)) {
|
||||||
|
@ -3319,7 +3494,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (isset($_POST['inetOrgPerson_state']) && ($_POST['inetOrgPerson_state'] != '')) {
|
if (isset($_POST['inetOrgPerson_state']) && ($_POST['inetOrgPerson_state'] != '')) {
|
||||||
$attributesNew['st'][0] = $_POST['inetOrgPerson_state'];
|
$attributesNew['st'][0] = $_POST['inetOrgPerson_state'];
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['st'])) unset($attributesNew['st']);
|
elseif (isset($attributes['st'])) {
|
||||||
|
unset($attributesNew['st']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// car license
|
// car license
|
||||||
if (in_array('carLicense', $fields) && !in_array('carLicense', $readOnlyFields)) {
|
if (in_array('carLicense', $fields) && !in_array('carLicense', $readOnlyFields)) {
|
||||||
|
@ -3327,7 +3504,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (isset($_POST['inetOrgPerson_carLicense']) && ($_POST['inetOrgPerson_carLicense'] != '')) {
|
if (isset($_POST['inetOrgPerson_carLicense']) && ($_POST['inetOrgPerson_carLicense'] != '')) {
|
||||||
$attributesNew['carLicense'][0] = $_POST['inetOrgPerson_carLicense'];
|
$attributesNew['carLicense'][0] = $_POST['inetOrgPerson_carLicense'];
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['carLicense'])) unset($attributesNew['carLicense']);
|
elseif (isset($attributes['carLicense'])) {
|
||||||
|
unset($attributesNew['carLicense']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// office name
|
// office name
|
||||||
if (in_array('officeName', $fields) && !in_array('officeName', $readOnlyFields)) {
|
if (in_array('officeName', $fields) && !in_array('officeName', $readOnlyFields)) {
|
||||||
|
@ -3335,7 +3514,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (isset($_POST['inetOrgPerson_officeName']) && ($_POST['inetOrgPerson_officeName'] != '')) {
|
if (isset($_POST['inetOrgPerson_officeName']) && ($_POST['inetOrgPerson_officeName'] != '')) {
|
||||||
$attributesNew['physicalDeliveryOfficeName'][0] = $_POST['inetOrgPerson_officeName'];
|
$attributesNew['physicalDeliveryOfficeName'][0] = $_POST['inetOrgPerson_officeName'];
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['physicalDeliveryOfficeName'])) unset($attributesNew['physicalDeliveryOfficeName']);
|
elseif (isset($attributes['physicalDeliveryOfficeName'])) {
|
||||||
|
unset($attributesNew['physicalDeliveryOfficeName']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// business category
|
// business category
|
||||||
if (in_array('businessCategory', $fields) && !in_array('businessCategory', $readOnlyFields)) {
|
if (in_array('businessCategory', $fields) && !in_array('businessCategory', $readOnlyFields)) {
|
||||||
|
@ -3348,7 +3529,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
$attributesNew['businessCategory'][0] = $_POST['inetOrgPerson_businessCategory'];
|
$attributesNew['businessCategory'][0] = $_POST['inetOrgPerson_businessCategory'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['businessCategory'])) unset($attributesNew['businessCategory']);
|
elseif (isset($attributes['businessCategory'])) {
|
||||||
|
unset($attributesNew['businessCategory']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// photo
|
// photo
|
||||||
if (in_array('jpegPhoto', $fields) && !in_array('jpegPhoto', $readOnlyFields)) {
|
if (in_array('jpegPhoto', $fields) && !in_array('jpegPhoto', $readOnlyFields)) {
|
||||||
|
@ -3394,7 +3577,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (isset($_POST['inetOrgPerson_departmentNumber']) && ($_POST['inetOrgPerson_departmentNumber'] != '')) {
|
if (isset($_POST['inetOrgPerson_departmentNumber']) && ($_POST['inetOrgPerson_departmentNumber'] != '')) {
|
||||||
$attributesNew['departmentNumber'] = preg_split('/;[ ]*/', $_POST['inetOrgPerson_departmentNumber']);
|
$attributesNew['departmentNumber'] = preg_split('/;[ ]*/', $_POST['inetOrgPerson_departmentNumber']);
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['departmentNumber'])) unset($attributesNew['departmentNumber']);
|
elseif (isset($attributes['departmentNumber'])) {
|
||||||
|
unset($attributesNew['departmentNumber']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// initials
|
// initials
|
||||||
if (in_array('initials', $fields) && !in_array('initials', $readOnlyFields)) {
|
if (in_array('initials', $fields) && !in_array('initials', $readOnlyFields)) {
|
||||||
|
@ -3402,16 +3587,24 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (isset($_POST['inetOrgPerson_initials']) && ($_POST['inetOrgPerson_initials'] != '')) {
|
if (isset($_POST['inetOrgPerson_initials']) && ($_POST['inetOrgPerson_initials'] != '')) {
|
||||||
$attributesNew['initials'] = preg_split('/;[ ]*/', $_POST['inetOrgPerson_initials']);
|
$attributesNew['initials'] = preg_split('/;[ ]*/', $_POST['inetOrgPerson_initials']);
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['initials'])) unset($attributesNew['initials']);
|
elseif (isset($attributes['initials'])) {
|
||||||
|
unset($attributesNew['initials']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// title
|
// title
|
||||||
if (in_array('title', $fields) && !in_array('title', $readOnlyFields)) {
|
if (in_array('title', $fields) && !in_array('title', $readOnlyFields)) {
|
||||||
$attributeNames[] = 'title';
|
$attributeNames[] = 'title';
|
||||||
if (isset($_POST['inetOrgPerson_title']) && ($_POST['inetOrgPerson_title'] != '')) {
|
if (isset($_POST['inetOrgPerson_title']) && ($_POST['inetOrgPerson_title'] != '')) {
|
||||||
if (!get_preg($_POST['inetOrgPerson_title'], 'title')) $return['messages'][] = $this->messages['title'][0];
|
if (!get_preg($_POST['inetOrgPerson_title'], 'title')) {
|
||||||
else $attributesNew['title'][0] = $_POST['inetOrgPerson_title'];
|
$return['messages'][] = $this->messages['title'][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$attributesNew['title'][0] = $_POST['inetOrgPerson_title'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($attributes['title'])) {
|
||||||
|
unset($attributesNew['title']);
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['title'])) unset($attributesNew['title']);
|
|
||||||
}
|
}
|
||||||
// user certificates
|
// user certificates
|
||||||
if (in_array('userCertificate', $fields)) {
|
if (in_array('userCertificate', $fields)) {
|
||||||
|
@ -3434,7 +3627,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (!empty($_POST['inetOrgPerson_description'])) {
|
if (!empty($_POST['inetOrgPerson_description'])) {
|
||||||
$attributesNew['description'][0] = $_POST['inetOrgPerson_description'];
|
$attributesNew['description'][0] = $_POST['inetOrgPerson_description'];
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['description'])) unset($attributesNew['description']);
|
elseif (isset($attributes['description'])) {
|
||||||
|
unset($attributesNew['description']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// ou
|
// ou
|
||||||
if (in_array('ou', $fields) && !in_array('ou', $readOnlyFields)) {
|
if (in_array('ou', $fields) && !in_array('ou', $readOnlyFields)) {
|
||||||
|
@ -3442,7 +3637,9 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (!empty($_POST['inetOrgPerson_ou'])) {
|
if (!empty($_POST['inetOrgPerson_ou'])) {
|
||||||
$attributesNew['ou'][0] = $_POST['inetOrgPerson_ou'];
|
$attributesNew['ou'][0] = $_POST['inetOrgPerson_ou'];
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['ou'])) unset($attributesNew['ou']);
|
elseif (isset($attributes['ou'])) {
|
||||||
|
unset($attributesNew['ou']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// o
|
// o
|
||||||
if (in_array('o', $fields) && !in_array('o', $readOnlyFields)) {
|
if (in_array('o', $fields) && !in_array('o', $readOnlyFields)) {
|
||||||
|
@ -3450,16 +3647,34 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
if (!empty($_POST['inetOrgPerson_o'])) {
|
if (!empty($_POST['inetOrgPerson_o'])) {
|
||||||
$attributesNew['o'][0] = $_POST['inetOrgPerson_o'];
|
$attributesNew['o'][0] = $_POST['inetOrgPerson_o'];
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['o'])) unset($attributesNew['o']);
|
elseif (isset($attributes['o'])) {
|
||||||
|
unset($attributesNew['o']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// uid
|
// uid
|
||||||
if (in_array('uid', $fields) && !in_array('uid', $readOnlyFields)) {
|
if (in_array('uid', $fields) && !in_array('uid', $readOnlyFields)) {
|
||||||
$attributeNames[] = 'uid';
|
$attributeNames[] = 'uid';
|
||||||
if (isset($_POST['inetOrgPerson_uid']) && ($_POST['inetOrgPerson_uid'] != '')) {
|
if (isset($_POST['inetOrgPerson_uid']) && ($_POST['inetOrgPerson_uid'] != '')) {
|
||||||
if (!get_preg($_POST['inetOrgPerson_uid'], 'username')) $return['messages'][] = $this->messages['uid'][0];
|
if (!get_preg($_POST['inetOrgPerson_uid'], 'username')) {
|
||||||
else $attributesNew['uid'][0] = $_POST['inetOrgPerson_uid'];
|
$return['messages'][] = $this->messages['uid'][0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$attributesNew['uid'][0] = $_POST['inetOrgPerson_uid'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (isset($attributes['uid'])) {
|
||||||
|
unset($attributesNew['uid']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// display name
|
||||||
|
if (in_array('displayName', $fields) && !in_array('displayName', $readOnlyFields)) {
|
||||||
|
$attributeNames[] = 'displayName';
|
||||||
|
if (!empty($_POST['inetOrgPerson_displayName'])) {
|
||||||
|
$attributesNew['displayName'][0] = $_POST['inetOrgPerson_displayName'];
|
||||||
|
}
|
||||||
|
elseif (isset($attributes['displayName'])) {
|
||||||
|
unset($attributesNew['displayName']);
|
||||||
}
|
}
|
||||||
elseif (isset($attributes['uid'])) unset($attributesNew['uid']);
|
|
||||||
}
|
}
|
||||||
// find differences
|
// find differences
|
||||||
for ($i = 0; $i < sizeof($attributeNames); $i++) {
|
for ($i = 0; $i < sizeof($attributeNames); $i++) {
|
||||||
|
@ -3886,9 +4101,12 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
$configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideuserCertificate', false, _('User certificates'), null, true), 12, 4);
|
$configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideuserCertificate', false, _('User certificates'), null, true), 12, 4);
|
||||||
$configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hidejpegPhoto', false, _('Photo'), null, true), 12, 4);
|
$configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hidejpegPhoto', false, _('Photo'), null, true), 12, 4);
|
||||||
if (isset($_SESSION['conf_config'])) {
|
if (isset($_SESSION['conf_config'])) {
|
||||||
$confActiveUnixUserModules = $_SESSION['conf_config']->get_AccountModules('user');
|
$confActiveUserModules = $_SESSION['conf_config']->get_AccountModules('user');
|
||||||
|
if (!in_array('sambaSamAccount', $confActiveUserModules)) {
|
||||||
|
$configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hidedisplayName', true, _('Display name'), null, true), 12, 4);
|
||||||
|
}
|
||||||
// option to hide uid
|
// option to hide uid
|
||||||
if (!in_array('posixAccount', $confActiveUnixUserModules)) {
|
if (!in_array('posixAccount', $confActiveUserModules)) {
|
||||||
$configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideUID', false, _('User name'), null, true), 12, 4);
|
$configContainer->add(new htmlResponsiveInputCheckbox('inetOrgPerson_hideUID', false, _('User name'), null, true), 12, 4);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -3969,6 +4187,23 @@ class inetOrgPerson extends baseModule implements passwordService {
|
||||||
return in_array('posixAccount', $modules);
|
return in_array('posixAccount', $modules);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns if the Samba 3 module is also active.
|
||||||
|
*
|
||||||
|
* @param string[] $modules active account mdules
|
||||||
|
* @return boolean Samba 3 is active
|
||||||
|
*/
|
||||||
|
private function isSamba3Active($modules = null) {
|
||||||
|
if (!empty($modules)) {
|
||||||
|
return in_array('sambaSamAccount', $modules);
|
||||||
|
}
|
||||||
|
if ($this->getAccountContainer() == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$modules = $this->getAccountContainer()->get_type()->getModules();
|
||||||
|
return in_array('sambaSamAccount', $modules);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue