added l, st, carLicense and physicalDeliveryOfficeName

This commit is contained in:
Roland Gruber 2008-02-09 18:01:29 +00:00
parent cc5a2a5fdc
commit bb0ecf864f
1 changed files with 203 additions and 28 deletions

View File

@ -140,7 +140,8 @@ class inetOrgPerson extends baseModule {
// managed attributes // managed attributes
$return['attributes'] = array('uid', 'cn', 'employeeType', 'givenName', 'jpegPhoto', 'mail', 'manager', 'mobile', $return['attributes'] = array('uid', 'cn', 'employeeType', 'givenName', 'jpegPhoto', 'mail', 'manager', 'mobile',
'title', 'telephoneNumber', 'facsimileTelephoneNumber', 'street', 'postOfficeBox', 'postalCode', 'postalAddress', 'title', 'telephoneNumber', 'facsimileTelephoneNumber', 'street', 'postOfficeBox', 'postalCode', 'postalAddress',
'sn', 'userPassword', 'description', 'homePhone', 'roomNumber', 'businessCategory'); 'sn', 'userPassword', 'description', 'homePhone', 'roomNumber', 'businessCategory', 'l', 'st', 'physicalDeliveryOfficeName',
'carLicense');
if (($_SESSION['loggedIn']) && $this->supportUnixHosts()) { if (($_SESSION['loggedIn']) && $this->supportUnixHosts()) {
$return['attributes'][] = 'host'; $return['attributes'][] = 'host';
} }
@ -151,9 +152,18 @@ class inetOrgPerson extends baseModule {
'mail' => _('eMail address'), 'telephoneNumber' => _('Telephone number'), 'mobile' => _('Mobile number'), 'mail' => _('eMail address'), 'telephoneNumber' => _('Telephone number'), 'mobile' => _('Mobile number'),
'faxNumber' => _('Fax number'), 'street' => _('Street'), 'postalAddress' => _('Postal address'), 'faxNumber' => _('Fax number'), 'street' => _('Street'), 'postalAddress' => _('Postal address'),
'postalCode' => _('Postal code'), 'postOfficeBox' => _('Post office box'), 'jpegPhoto' => _('Photo'), 'postalCode' => _('Postal code'), 'postOfficeBox' => _('Post office box'), 'jpegPhoto' => _('Photo'),
'homePhone' => _('Home telephone number'), 'roomNumber' => _('Room number')); 'homePhone' => _('Home telephone number'), 'roomNumber' => _('Room number'), 'carLicense' => _('Car license'),
'location' => _('Location'), 'state' => _('State'), 'officeName' => _('Office name'));
// profile elements // profile elements
$return['profile_options'] = array( $return['profile_options'] = array(
array(
array('kind' => 'text', 'text' => _('Location') . ":"),
array('kind' => 'input', 'name' => 'inetOrgPerson_l', 'type' => 'text', 'size' => '30', 'maxlength' => '255'),
array('kind' => 'help', 'value' => 'l')),
array(
array('kind' => 'text', 'text' => _('State') . ":"),
array('kind' => 'input', 'name' => 'inetOrgPerson_st', 'type' => 'text', 'size' => '30', 'maxlength' => '255'),
array('kind' => 'help', 'value' => 'st')),
array( array(
array('kind' => 'text', 'text' => _('Job title') . ":"), array('kind' => 'text', 'text' => _('Job title') . ":"),
array('kind' => 'input', 'name' => 'inetOrgPerson_title', 'type' => 'text', 'size' => '30', 'maxlength' => '255'), array('kind' => 'input', 'name' => 'inetOrgPerson_title', 'type' => 'text', 'size' => '30', 'maxlength' => '255'),
@ -174,6 +184,8 @@ class inetOrgPerson extends baseModule {
'error_message' => $this->messages['employeeType'][0]); 'error_message' => $this->messages['employeeType'][0]);
// profile mappings // profile mappings
$return['profile_mappings'] = array( $return['profile_mappings'] = array(
'inetOrgPerson_l' => 'l',
'inetOrgPerson_st' => 'st',
'inetOrgPerson_title' => 'title', 'inetOrgPerson_title' => 'title',
'inetOrgPerson_employeeType' => 'employeeType' 'inetOrgPerson_employeeType' => 'employeeType'
); );
@ -281,6 +293,30 @@ class inetOrgPerson extends baseModule {
'description' => _('Room number'), 'description' => _('Room number'),
'help' => 'roomNumber', 'help' => 'roomNumber',
'example' => 'A 2.24' 'example' => 'A 2.24'
),
array(
'name' => 'inetOrgPerson_l',
'description' => _('Location'),
'help' => 'l',
'example' => _('MyCity')
),
array(
'name' => 'inetOrgPerson_st',
'description' => _('State'),
'help' => 'st',
'example' => _('New York')
),
array(
'name' => 'inetOrgPerson_carLicense',
'description' => _('Car license'),
'help' => 'carLicense',
'example' => _('yes')
),
array(
'name' => 'inetOrgPerson_physicalDeliveryOfficeName',
'description' => _('Office name'),
'help' => 'physicalDeliveryOfficeName',
'example' => _('YourCompany, Human Resources')
) )
); );
// cn and uid for upload (only if posixAccount is not loaded) // cn and uid for upload (only if posixAccount is not loaded)
@ -334,7 +370,11 @@ class inetOrgPerson extends baseModule {
'mail', 'mail',
'homePhone', 'homePhone',
'roomNumber', 'roomNumber',
'businessCategory' 'businessCategory',
'location',
'state',
'carLicense',
'officeName'
); );
if ($_SESSION['loggedIn']) { if ($_SESSION['loggedIn']) {
$modules = $_SESSION['config']->get_AccountModules($this->get_scope()); $modules = $_SESSION['config']->get_AccountModules($this->get_scope());
@ -433,6 +473,22 @@ class inetOrgPerson extends baseModule {
'businessCategory' => array( 'businessCategory' => array(
"Headline" => _("Business category"), "Headline" => _("Business category"),
"Text" => _("Business category (e.g. Administration, IT-Services, Manangement, ...)") "Text" => _("Business category (e.g. Administration, IT-Services, Manangement, ...)")
),
'l' => array(
"Headline" => _("Location"),
"Text" => _("This describes the location of the user.")
),
'st' => array(
"Headline" => _("State"),
"Text" => _("The state where the user resides or works.")
),
'carLicense' => array(
"Headline" => _("Car license"),
"Text" => _("This can be used to specify if the user has a car license.")
),
'physicalDeliveryOfficeName' => array(
"Headline" => _("Office name"),
"Text" => _("The office name of the user (e.g. YourCompany, Human Resources).")
) )
) )
); );
@ -550,6 +606,10 @@ class inetOrgPerson extends baseModule {
$this->attributes['homePhone'][0] = $_POST['homePhone']; $this->attributes['homePhone'][0] = $_POST['homePhone'];
$this->attributes['roomNumber'][0] = $_POST['roomNumber']; $this->attributes['roomNumber'][0] = $_POST['roomNumber'];
$this->attributes['businessCategory'][0] = $_POST['businessCategory']; $this->attributes['businessCategory'][0] = $_POST['businessCategory'];
$this->attributes['l'][0] = $_POST['l'];
$this->attributes['st'][0] = $_POST['st'];
$this->attributes['carLicense'][0] = $_POST['carLicense'];
$this->attributes['physicalDeliveryOfficeName'][0] = $_POST['physicalDeliveryOfficeName'];
if ($_POST['manager'] != '-') { if ($_POST['manager'] != '-') {
$this->attributes['manager'][0] = $_POST['manager']; $this->attributes['manager'][0] = $_POST['manager'];
} }
@ -723,6 +783,20 @@ class inetOrgPerson extends baseModule {
array('kind' => 'input', 'name' => 'postalCode', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'postalCode', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $postalCode), 'maxlength' => '255', 'value' => $postalCode),
array('kind' => 'help', 'value' => 'postalCode')); array('kind' => 'help', 'value' => 'postalCode'));
$l = '';
if (isset($this->attributes['l'][0])) $l = $this->attributes['l'][0];
$return[] = array(
array('kind' => 'text', 'text' => _('Location')),
array('kind' => 'input', 'name' => 'l', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $l),
array('kind' => 'help', 'value' => 'l'));
$st = '';
if (isset($this->attributes['st'][0])) $st = $this->attributes['st'][0];
$return[] = array(
array('kind' => 'text', 'text' => _('State')),
array('kind' => 'input', 'name' => 'st', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $st),
array('kind' => 'help', 'value' => 'st'));
$postalAddress = ''; $postalAddress = '';
if (isset($this->attributes['postalAddress'][0])) $postalAddress = $this->attributes['postalAddress'][0]; if (isset($this->attributes['postalAddress'][0])) $postalAddress = $this->attributes['postalAddress'][0];
$return[] = array( $return[] = array(
@ -730,6 +804,13 @@ class inetOrgPerson extends baseModule {
array('kind' => 'input', 'name' => 'postalAddress', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'postalAddress', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $postalAddress), 'maxlength' => '255', 'value' => $postalAddress),
array('kind' => 'help', 'value' => 'postalAddress')); array('kind' => 'help', 'value' => 'postalAddress'));
$physicalDeliveryOfficeName = '';
if (isset($this->attributes['physicalDeliveryOfficeName'][0])) $physicalDeliveryOfficeName = $this->attributes['physicalDeliveryOfficeName'][0];
$return[] = array(
array('kind' => 'text', 'text' => _('Office name')),
array('kind' => 'input', 'name' => 'physicalDeliveryOfficeName', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $physicalDeliveryOfficeName),
array('kind' => 'help', 'value' => 'physicalDeliveryOfficeName'));
$roomNumber = ''; $roomNumber = '';
if (isset($this->attributes['roomNumber'][0])) $roomNumber = $this->attributes['roomNumber'][0]; if (isset($this->attributes['roomNumber'][0])) $roomNumber = $this->attributes['roomNumber'][0];
$return[] = array( $return[] = array(
@ -737,6 +818,9 @@ class inetOrgPerson extends baseModule {
array('kind' => 'input', 'name' => 'roomNumber', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'roomNumber', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $roomNumber), 'maxlength' => '255', 'value' => $roomNumber),
array('kind' => 'help', 'value' => 'roomNumber')); array('kind' => 'help', 'value' => 'roomNumber'));
$return[] = array(0 => array('kind' => 'text', 'td' => array('colspan' => 3)));
$telephone = ''; $telephone = '';
if (isset($this->attributes['telephoneNumber'][0])) $telephone = $this->attributes['telephoneNumber'][0]; if (isset($this->attributes['telephoneNumber'][0])) $telephone = $this->attributes['telephoneNumber'][0];
$return[] = array( $return[] = array(
@ -782,6 +866,13 @@ class inetOrgPerson extends baseModule {
array('kind' => 'input', 'name' => 'title', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'title', 'type' => 'text', 'size' => '30',
'value' => $title), 'value' => $title),
array('kind' => 'help', 'value' => 'title')); array('kind' => 'help', 'value' => 'title'));
$carLicense = '';
if (isset($this->attributes['carLicense'][0])) $carLicense = $this->attributes['carLicense'][0];
$return[] = array(
array('kind' => 'text', 'text' => _('Car license')),
array('kind' => 'input', 'name' => 'carLicense', 'type' => 'text', 'size' => '30',
'value' => $carLicense),
array('kind' => 'help', 'value' => 'carLicense'));
$employeeType = ''; $employeeType = '';
if (isset($this->attributes['employeeType'][0])) $employeeType = $this->attributes['employeeType'][0]; if (isset($this->attributes['employeeType'][0])) $employeeType = $this->attributes['employeeType'][0];
$return[] = array( $return[] = array(
@ -956,7 +1047,11 @@ class inetOrgPerson extends baseModule {
get_class($this) . '_cn' => array('<block><key>' . _('Common name') . '</key><value>' . $this->attributes['cn'][0] . '</value></block>'), get_class($this) . '_cn' => array('<block><key>' . _('Common name') . '</key><value>' . $this->attributes['cn'][0] . '</value></block>'),
get_class($this) . '_roomNumber' => array('<block><key>' . _('Room number') . '</key><value>' . $this->attributes['roomNumber'][0] . '</value></block>'), get_class($this) . '_roomNumber' => array('<block><key>' . _('Room number') . '</key><value>' . $this->attributes['roomNumber'][0] . '</value></block>'),
get_class($this) . '_businessCategory' => array('<block><key>' . _('Business category') . '</key><value>' . $this->attributes['businessCategory'][0] . '</value></block>'), get_class($this) . '_businessCategory' => array('<block><key>' . _('Business category') . '</key><value>' . $this->attributes['businessCategory'][0] . '</value></block>'),
get_class($this) . '_uid' => array('<block><key>' . _('User name') . '</key><value>' . $this->attributes['uid'][0] . '</value></block>')); get_class($this) . '_uid' => array('<block><key>' . _('User name') . '</key><value>' . $this->attributes['uid'][0] . '</value></block>'),
get_class($this) . '_carLicense' => array('<block><key>' . _('Car license') . '</key><value>' . $this->attributes['carLicense'][0] . '</value></block>'),
get_class($this) . '_location' => array('<block><key>' . _('Location') . '</key><value>' . $this->attributes['l'][0] . '</value></block>'),
get_class($this) . '_state' => array('<block><key>' . _('State') . '</key><value>' . $this->attributes['st'][0] . '</value></block>'),
get_class($this) . '_officeName' => array('<block><key>' . _('Office name') . '</key><value>' . $this->attributes['physicalDeliveryOfficeName'][0] . '</value></block>'));
} }
/** /**
@ -1066,6 +1161,22 @@ class inetOrgPerson extends baseModule {
if ($rawAccounts[$i][$ids['inetOrgPerson_roomNumber']] != "") { if ($rawAccounts[$i][$ids['inetOrgPerson_roomNumber']] != "") {
$partialAccounts[$i]['roomNumber'] = $rawAccounts[$i][$ids['inetOrgPerson_roomNumber']]; $partialAccounts[$i]['roomNumber'] = $rawAccounts[$i][$ids['inetOrgPerson_roomNumber']];
} }
// location
if ($rawAccounts[$i][$ids['inetOrgPerson_l']] != "") {
$partialAccounts[$i]['l'] = $rawAccounts[$i][$ids['inetOrgPerson_l']];
}
// state
if ($rawAccounts[$i][$ids['inetOrgPerson_st']] != "") {
$partialAccounts[$i]['st'] = $rawAccounts[$i][$ids['inetOrgPerson_st']];
}
// physicalDeliveryOfficeName
if ($rawAccounts[$i][$ids['inetOrgPerson_physicalDeliveryOfficeName']] != "") {
$partialAccounts[$i]['physicalDeliveryOfficeName'] = $rawAccounts[$i][$ids['inetOrgPerson_physicalDeliveryOfficeName']];
}
// carLicense
if ($rawAccounts[$i][$ids['inetOrgPerson_carLicense']] != "") {
$partialAccounts[$i]['carLicense'] = $rawAccounts[$i][$ids['inetOrgPerson_carLicense']];
}
// postal code // postal code
if ($rawAccounts[$i][$ids['inetOrgPerson_postalCode']] != "") { if ($rawAccounts[$i][$ids['inetOrgPerson_postalCode']] != "") {
if (get_preg($rawAccounts[$i][$ids['inetOrgPerson_postalCode']], 'postalCode')) { if (get_preg($rawAccounts[$i][$ids['inetOrgPerson_postalCode']], 'postalCode')) {
@ -1215,98 +1326,130 @@ class inetOrgPerson extends baseModule {
$firstName = ''; $firstName = '';
if (isset($attributes['givenName'][0])) $firstName = $attributes['givenName'][0]; if (isset($attributes['givenName'][0])) $firstName = $attributes['givenName'][0];
$return['firstName'] = array( $return['firstName'] = array(
0 => array('kind' => 'text', 'text' => _('First name')), array('kind' => 'text', 'text' => _('First name')),
1 => array('kind' => 'input', 'name' => 'inetOrgPerson_firstName', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'inetOrgPerson_firstName', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $firstName)); 'maxlength' => '255', 'value' => $firstName));
} }
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];
$return['lastName'] = array( $return['lastName'] = array(
0 => array('kind' => 'text', 'text' => _('Last name')), array('kind' => 'text', 'text' => _('Last name')),
1 => array('kind' => 'input', 'name' => 'inetOrgPerson_lastName', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'inetOrgPerson_lastName', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $lastName)); 'maxlength' => '255', 'value' => $lastName));
} }
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];
$return['mail'] = array( $return['mail'] = array(
0 => array('kind' => 'text', 'text' => _('eMail address')), array('kind' => 'text', 'text' => _('eMail address')),
1 => array('kind' => 'input', 'name' => 'inetOrgPerson_mail', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'inetOrgPerson_mail', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $mail)); 'maxlength' => '255', 'value' => $mail));
} }
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];
$return['telephoneNumber'] = array( $return['telephoneNumber'] = array(
0 => array('kind' => 'text', 'text' => _('Telephone number')), array('kind' => 'text', 'text' => _('Telephone number')),
1 => array('kind' => 'input', 'name' => 'inetOrgPerson_telephoneNumber', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'inetOrgPerson_telephoneNumber', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $telephoneNumber)); 'maxlength' => '255', 'value' => $telephoneNumber));
} }
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];
$return['homePhone'] = array( $return['homePhone'] = array(
0 => array('kind' => 'text', 'text' => _('Home telephone number')), array('kind' => 'text', 'text' => _('Home telephone number')),
1 => array('kind' => 'input', 'name' => 'inetOrgPerson_homePhone', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'inetOrgPerson_homePhone', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $homePhone)); 'maxlength' => '255', 'value' => $homePhone));
} }
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];
$return['mobile'] = array( $return['mobile'] = array(
0 => array('kind' => 'text', 'text' => _('Mobile telephone number')), array('kind' => 'text', 'text' => _('Mobile telephone number')),
1 => array('kind' => 'input', 'name' => 'inetOrgPerson_mobile', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'inetOrgPerson_mobile', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $mobile)); 'maxlength' => '255', 'value' => $mobile));
} }
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];
$return['faxNumber'] = array( $return['faxNumber'] = array(
0 => array('kind' => 'text', 'text' => _('Fax number')), array('kind' => 'text', 'text' => _('Fax number')),
1 => array('kind' => 'input', 'name' => 'inetOrgPerson_faxNumber', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'inetOrgPerson_faxNumber', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $faxNumber)); 'maxlength' => '255', 'value' => $faxNumber));
} }
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];
$return['street'] = array( $return['street'] = array(
0 => array('kind' => 'text', 'text' => _('Street')), array('kind' => 'text', 'text' => _('Street')),
1 => array('kind' => 'input', 'name' => 'inetOrgPerson_street', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'inetOrgPerson_street', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $street)); 'maxlength' => '255', 'value' => $street));
} }
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];
$return['postalAddress'] = array( $return['postalAddress'] = array(
0 => array('kind' => 'text', 'text' => _('Postal address')), array('kind' => 'text', 'text' => _('Postal address')),
1 => array('kind' => 'input', 'name' => 'inetOrgPerson_postalAddress', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'inetOrgPerson_postalAddress', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $postalAddress)); 'maxlength' => '255', 'value' => $postalAddress));
} }
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];
$return['postalCode'] = array( $return['postalCode'] = array(
0 => array('kind' => 'text', 'text' => _('Postal code')), array('kind' => 'text', 'text' => _('Postal code')),
1 => array('kind' => 'input', 'name' => 'inetOrgPerson_postalCode', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'inetOrgPerson_postalCode', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $postalCode)); 'maxlength' => '255', 'value' => $postalCode));
} }
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];
$return['postOfficeBox'] = array( $return['postOfficeBox'] = array(
0 => array('kind' => 'text', 'text' => _('Post office box')), array('kind' => 'text', 'text' => _('Post office box')),
1 => array('kind' => 'input', 'name' => 'inetOrgPerson_postOfficeBox', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'inetOrgPerson_postOfficeBox', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $postOfficeBox)); 'maxlength' => '255', 'value' => $postOfficeBox));
} }
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];
$return['roomNumber'] = array( $return['roomNumber'] = array(
0 => array('kind' => 'text', 'text' => _('Room number')), array('kind' => 'text', 'text' => _('Room number')),
1 => array('kind' => 'input', 'name' => 'inetOrgPerson_roomNumber', 'type' => 'text', 'size' => '30', array('kind' => 'input', 'name' => 'inetOrgPerson_roomNumber', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $roomNumber)); 'maxlength' => '255', 'value' => $roomNumber));
} }
if (in_array('location', $fields)) {
$l = '';
if (isset($attributes['l'][0])) $l = $attributes['l'][0];
$return['location'] = array(
array('kind' => 'text', 'text' => _('Location')),
array('kind' => 'input', 'name' => 'inetOrgPerson_location', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $l));
}
if (in_array('state', $fields)) {
$st = '';
if (isset($attributes['st'][0])) $st = $attributes['st'][0];
$return['state'] = array(
array('kind' => 'text', 'text' => _('State')),
array('kind' => 'input', 'name' => 'inetOrgPerson_state', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $st));
}
if (in_array('carLicense', $fields)) {
$carLicense = '';
if (isset($attributes['carLicense'][0])) $carLicense = $attributes['carLicense'][0];
$return['carLicense'] = array(
array('kind' => 'text', 'text' => _('Car license')),
array('kind' => 'input', 'name' => 'inetOrgPerson_carLicense', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $carLicense));
}
if (in_array('officeName', $fields)) {
$physicalDeliveryOfficeName = '';
if (isset($attributes['physicalDeliveryOfficeName'][0])) $physicalDeliveryOfficeName = $attributes['physicalDeliveryOfficeName'][0];
$return['officeName'] = array(
array('kind' => 'text', 'text' => _('Office name')),
array('kind' => 'input', 'name' => 'inetOrgPerson_officeName', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $physicalDeliveryOfficeName));
}
if (in_array('jpegPhoto', $fields)) { if (in_array('jpegPhoto', $fields)) {
if (isset($attributes['jpegPhoto'][0])) { if (isset($attributes['jpegPhoto'][0])) {
$jpeg_filename = 'jpegPhoto' . session_id() . '.jpg'; $jpeg_filename = 'jpegPhoto' . session_id() . '.jpg';
@ -1463,6 +1606,38 @@ class inetOrgPerson extends baseModule {
} }
elseif (isset($attributes['roomNumber'])) unset($attributesNew['roomNumber']); elseif (isset($attributes['roomNumber'])) unset($attributesNew['roomNumber']);
} }
// l
if (in_array('location', $fields)) {
$attributeNames[] = 'l';
if (isset($_POST['inetOrgPerson_location']) && ($_POST['inetOrgPerson_location'] != '')) {
$attributesNew['l'][0] = $_POST['inetOrgPerson_location'];
}
elseif (isset($attributes['l'])) unset($attributesNew['l']);
}
// st
if (in_array('state', $fields)) {
$attributeNames[] = 'st';
if (isset($_POST['inetOrgPerson_state']) && ($_POST['inetOrgPerson_state'] != '')) {
$attributesNew['st'][0] = $_POST['inetOrgPerson_state'];
}
elseif (isset($attributes['st'])) unset($attributesNew['st']);
}
// car license
if (in_array('carLicense', $fields)) {
$attributeNames[] = 'carLicense';
if (isset($_POST['inetOrgPerson_carLicense']) && ($_POST['inetOrgPerson_carLicense'] != '')) {
$attributesNew['carLicense'][0] = $_POST['inetOrgPerson_carLicense'];
}
elseif (isset($attributes['carLicense'])) unset($attributesNew['carLicense']);
}
// office name
if (in_array('officeName', $fields)) {
$attributeNames[] = 'physicalDeliveryOfficeName';
if (isset($_POST['inetOrgPerson_officeName']) && ($_POST['inetOrgPerson_officeName'] != '')) {
$attributesNew['physicalDeliveryOfficeName'][0] = $_POST['inetOrgPerson_officeName'];
}
elseif (isset($attributes['physicalDeliveryOfficeName'])) unset($attributesNew['physicalDeliveryOfficeName']);
}
// photo // photo
if (in_array('jpegPhoto', $fields)) { if (in_array('jpegPhoto', $fields)) {
if ($_FILES['photoFile'] && ($_FILES['photoFile']['size'] > 0)) { if ($_FILES['photoFile'] && ($_FILES['photoFile']['size'] > 0)) {