fixed self-service

This commit is contained in:
Roland Gruber 2010-07-03 12:31:55 +00:00
parent d012e97218
commit 457ef980c1
3 changed files with 123 additions and 141 deletions

View File

@ -1380,130 +1380,114 @@ 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];
$return['lastName'] = array( $return['lastName'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Last name')), new htmlTableExtendedInputField(_('Last name'), 'inetOrgPerson_lastName', $lastName)
array('kind' => 'input', 'name' => 'inetOrgPerson_lastName', 'type' => 'text', 'size' => '30', ));
'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'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Email address')), new htmlTableExtendedInputField(_('Email address'), 'inetOrgPerson_mail', $mail)
array('kind' => 'input', 'name' => 'inetOrgPerson_mail', 'type' => 'text', 'size' => '30', ));
'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'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Telephone number')), new htmlTableExtendedInputField(_('Telephone number'), 'inetOrgPerson_telephoneNumber', $telephoneNumber)
array('kind' => 'input', 'name' => 'inetOrgPerson_telephoneNumber', 'type' => 'text', 'size' => '30', ));
'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'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Home telephone number')), new htmlTableExtendedInputField(_('Home telephone number'), 'inetOrgPerson_homePhone', $homePhone)
array('kind' => 'input', 'name' => 'inetOrgPerson_homePhone', 'type' => 'text', 'size' => '30', ));
'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'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Mobile telephone number')), new htmlTableExtendedInputField(_('Mobile telephone number'), 'inetOrgPerson_mobile', $mobile)
array('kind' => 'input', 'name' => 'inetOrgPerson_mobile', 'type' => 'text', 'size' => '30', ));
'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'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Fax number')), new htmlTableExtendedInputField(_('Fax number'), 'inetOrgPerson_faxNumber', $faxNumber)
array('kind' => 'input', 'name' => 'inetOrgPerson_faxNumber', 'type' => 'text', 'size' => '30', ));
'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'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Street')), new htmlTableExtendedInputField(_('Street'), 'inetOrgPerson_street', $street)
array('kind' => 'input', 'name' => 'inetOrgPerson_street', 'type' => 'text', 'size' => '30', ));
'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'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Postal address')), new htmlTableExtendedInputField(_('Postal address'), 'inetOrgPerson_postalAddress', $postalAddress)
array('kind' => 'input', 'name' => 'inetOrgPerson_postalAddress', 'type' => 'text', 'size' => '30', ));
'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'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Postal code')), new htmlTableExtendedInputField(_('Postal code'), 'inetOrgPerson_postalCode', $postalCode)
array('kind' => 'input', 'name' => 'inetOrgPerson_postalCode', 'type' => 'text', 'size' => '30', ));
'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'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Post office box')), new htmlTableExtendedInputField(_('Post office box'), 'inetOrgPerson_postOfficeBox', $postOfficeBox)
array('kind' => 'input', 'name' => 'inetOrgPerson_postOfficeBox', 'type' => 'text', 'size' => '30', ));
'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'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Room number')), new htmlTableExtendedInputField(_('Room number'), 'inetOrgPerson_roomNumber', $roomNumber)
array('kind' => 'input', 'name' => 'inetOrgPerson_roomNumber', 'type' => 'text', 'size' => '30', ));
'maxlength' => '255', 'value' => $roomNumber));
} }
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];
$return['location'] = array( $return['location'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Location')), new htmlTableExtendedInputField(_('Location'), 'inetOrgPerson_location', $l)
array('kind' => 'input', 'name' => 'inetOrgPerson_location', 'type' => 'text', 'size' => '30', ));
'maxlength' => '255', 'value' => $l));
} }
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];
$return['state'] = array( $return['state'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('State')), new htmlTableExtendedInputField(_('State'), 'inetOrgPerson_state', $st)
array('kind' => 'input', 'name' => 'inetOrgPerson_state', 'type' => 'text', 'size' => '30', ));
'maxlength' => '255', 'value' => $st));
} }
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];
$return['carLicense'] = array( $return['carLicense'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Car license')), new htmlTableExtendedInputField(_('Car license'), 'inetOrgPerson_carLicense', $carLicense)
array('kind' => 'input', 'name' => 'inetOrgPerson_carLicense', 'type' => 'text', 'size' => '30', ));
'maxlength' => '255', 'value' => $carLicense));
} }
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];
$return['officeName'] = array( $return['officeName'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Office name')), new htmlTableExtendedInputField(_('Office name'), 'inetOrgPerson_officeName', $physicalDeliveryOfficeName)
array('kind' => 'input', 'name' => 'inetOrgPerson_officeName', 'type' => 'text', 'size' => '30', ));
'maxlength' => '255', 'value' => $physicalDeliveryOfficeName));
} }
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];
$return['businessCategory'] = array( $return['businessCategory'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Business category')), new htmlTableExtendedInputField(_('Business category'), 'inetOrgPerson_businessCategory', $businessCategory)
array('kind' => 'input', 'name' => 'inetOrgPerson_businessCategory', 'type' => 'text', 'size' => '30', ));
'maxlength' => '255', 'value' => $businessCategory));
} }
if (in_array('jpegPhoto', $fields)) { if (in_array('jpegPhoto', $fields)) {
if (isset($attributes['jpegPhoto'][0])) { if (isset($attributes['jpegPhoto'][0])) {
@ -1512,39 +1496,30 @@ class inetOrgPerson extends baseModule implements passwordService {
fwrite($outjpeg, $attributes['jpegPhoto'][0]); fwrite($outjpeg, $attributes['jpegPhoto'][0]);
fclose ($outjpeg); fclose ($outjpeg);
$photoFile = '../../tmp/' . $jpeg_filename; $photoFile = '../../tmp/' . $jpeg_filename;
$return['jpegPhoto'] = array( $photoSub = new htmlTable();
array('kind' => 'text', 'text' => _('Photo')), $photoSub->addElement(new htmlImage($photoFile), true);
array('kind' => 'table', 'value' => array( $photoSubSub = new htmlTable();
array( $photoSubSub->addElement(new htmlTableExtendedInputCheckbox('removeReplacePhoto', false, _('Remove/replace photo'), null, false));
array('kind' => 'image', 'alt' => _('Photo'), 'path' => $photoFile) $photoSubSub->addElement(new htmlInputFileUpload('replacePhotoFile'));
), $photoSub->addElement($photoSubSub);
array( $photoRowCells = array(new htmlOutputText(_('Photo')), $photoSub);
array('kind' => 'table', 'value' => array(array( $photoRow = new htmlTableRow($photoRowCells);
array('kind' => 'input', 'type' => 'checkbox', 'name' => 'removeReplacePhoto'), $return['jpegPhoto'] = $photoRow;
array('kind' => 'text', 'text' => _('Remove/replace photo')),
array('kind' => 'input', 'name' => 'replacePhotoFile', 'type' => 'file')
))),
)
))
);
} }
else { else {
$return['jpegPhoto'] = array( $photoSub = new htmlTable();
array('kind' => 'text', 'text' => _('Photo')), $photoSub->addElement(new htmlTableExtendedInputFileUpload('photoFile', _('Add photo')));
array('kind' => 'table', 'value' => array(array( $photoRowCells = array(new htmlOutputText(_('Photo')), $photoSub);
array('kind' => 'text', 'text' => _('Add photo')), $photoRow = new htmlTableRow($photoRowCells);
array('kind' => 'input', 'name' => 'photoFile', 'type' => 'file') $return['jpegPhoto'] = $photoRow;
)))
);
} }
} }
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']);
$return['departmentNumber'] = array( $return['departmentNumber'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Department(s)')), new htmlTableExtendedInputField(_('Department(s)'), 'inetOrgPerson_departmentNumber', $departmentNumber)
array('kind' => 'input', 'name' => 'inetOrgPerson_departmentNumber', 'type' => 'text', 'size' => '30', ));
'maxlength' => '255', 'value' => $departmentNumber));
} }
return $return; return $return;
} }
@ -1716,7 +1691,7 @@ class inetOrgPerson extends baseModule implements passwordService {
} }
// photo // photo
if (in_array('jpegPhoto', $fields)) { if (in_array('jpegPhoto', $fields)) {
if ($_FILES['photoFile'] && ($_FILES['photoFile']['size'] > 0)) { if (isset($_FILES['photoFile']) && ($_FILES['photoFile']['size'] > 0)) {
$handle = fopen($_FILES['photoFile']['tmp_name'], "r"); $handle = fopen($_FILES['photoFile']['tmp_name'], "r");
$data = fread($handle, 1000000); $data = fread($handle, 1000000);
fclose($handle); fclose($handle);

View File

@ -284,9 +284,13 @@ class kolabUser extends baseModule {
return $return; return $return;
} }
// country // country
$country = '';
if (isset($this->attributes['c'][0])) {
$country = $this->attributes['c'][0];
}
$return[] = array( $return[] = array(
array('kind' => 'text', 'text' => _('Country')), array('kind' => 'text', 'text' => _('Country')),
array('kind' => 'input', 'name' => 'country', 'type' => 'text', 'value' => $this->attributes['c'][0]), array('kind' => 'input', 'name' => 'country', 'type' => 'text', 'value' => $country),
array('kind' => 'help', 'value' => 'country')); array('kind' => 'help', 'value' => 'country'));
// mailbox server // mailbox server
if (!isset($this->orig['kolabHomeServer'][0])) { // value currently not set if (!isset($this->orig['kolabHomeServer'][0])) { // value currently not set
@ -302,14 +306,22 @@ class kolabUser extends baseModule {
array('kind' => 'help', 'value' => 'homeServer')); array('kind' => 'help', 'value' => 'homeServer'));
} }
// Cyrus mail quota // Cyrus mail quota
$userquota = '';
if (isset($this->attributes['cyrus-userquota'][0])) {
$userquota = $this->attributes['cyrus-userquota'][0];
}
$return[] = array( $return[] = array(
array('kind' => 'text', 'text' => _('Mail quota')), array('kind' => 'text', 'text' => _('Mail quota')),
array('kind' => 'input', 'name' => 'quota', 'type' => 'text', 'value' => $this->attributes['cyrus-userquota'][0]), array('kind' => 'input', 'name' => 'quota', 'type' => 'text', 'value' => $userquota),
array('kind' => 'help', 'value' => 'quota')); array('kind' => 'help', 'value' => 'quota'));
// free/busy future // free/busy future
$freebusyfuture = '';
if (isset($this->attributes['kolabFreeBusyFuture'][0])) {
$freebusyfuture = $this->attributes['kolabFreeBusyFuture'][0];
}
$return[] = array( $return[] = array(
array('kind' => 'text', 'text' => _('Free/Busy interval')), array('kind' => 'text', 'text' => _('Free/Busy interval')),
array('kind' => 'input', 'name' => 'freeBusy', 'type' => 'text', 'value' => $this->attributes['kolabFreeBusyFuture'][0]), array('kind' => 'input', 'name' => 'freeBusy', 'type' => 'text', 'value' => $freebusyfuture),
array('kind' => 'help', 'value' => 'freeBusy')); array('kind' => 'help', 'value' => 'freeBusy'));
// invitation policies // invitation policies
$returnPol = array(); $returnPol = array();
@ -351,11 +363,13 @@ class kolabUser extends baseModule {
$return[] = $returnPol; $return[] = $returnPol;
// mail aliases // mail aliases
$returnAliases = array(); $returnAliases = array();
for ($i = 0; $i < sizeof($this->attributes['alias']); $i++) { if (isset($this->attributes['alias'])) {
$returnAliases[] = array( for ($i = 0; $i < sizeof($this->attributes['alias']); $i++) {
array('kind' => 'input', 'name' => 'alias' . $i, 'type' => 'text', 'value' => $this->attributes['alias'][$i]), $returnAliases[] = array(
array('kind' => 'input', 'type' => 'submit', 'name' => 'delAlias' . $i, 'value' => _("Remove")), array('kind' => 'input', 'name' => 'alias' . $i, 'type' => 'text', 'value' => $this->attributes['alias'][$i]),
array('kind' => 'help', 'value' => 'alias')); array('kind' => 'input', 'type' => 'submit', 'name' => 'delAlias' . $i, 'value' => _("Remove")),
array('kind' => 'help', 'value' => 'alias'));
}
} }
// input box for new mail alias // input box for new mail alias
$returnAliases[] = array( $returnAliases[] = array(
@ -377,11 +391,13 @@ class kolabUser extends baseModule {
sort($delegates); sort($delegates);
} }
$returnDelegates = array(); $returnDelegates = array();
for ($i = 0; $i < sizeof($this->attributes['kolabDelegate']); $i++) { if (isset($this->attributes['kolabDelegate'])) {
$returnDelegates[] = array( for ($i = 0; $i < sizeof($this->attributes['kolabDelegate']); $i++) {
array('kind' => 'select', 'name' => 'delegate' . $i, 'options' => $delegates, 'options_selected' => array($this->attributes['kolabDelegate'][$i])), $returnDelegates[] = array(
array('kind' => 'input', 'type' => 'submit', 'name' => 'delDelegate' . $i, 'value' => _("Remove")), array('kind' => 'select', 'name' => 'delegate' . $i, 'options' => $delegates, 'options_selected' => array($this->attributes['kolabDelegate'][$i])),
array('kind' => 'help', 'value' => 'delegate')); array('kind' => 'input', 'type' => 'submit', 'name' => 'delDelegate' . $i, 'value' => _("Remove")),
array('kind' => 'help', 'value' => 'delegate'));
}
} }
// input box for new delegate // input box for new delegate
$returnDelegates[] = array( $returnDelegates[] = array(
@ -823,10 +839,9 @@ class kolabUser extends baseModule {
if (isset($attributes['kolabFreeBusyFuture'][0])) { if (isset($attributes['kolabFreeBusyFuture'][0])) {
$kolabFreeBusyFuture = $attributes['kolabFreeBusyFuture'][0]; $kolabFreeBusyFuture = $attributes['kolabFreeBusyFuture'][0];
} }
$return['kolabFreeBusyFuture'] = array( $return['kolabFreeBusyFuture'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Free/Busy interval')), new htmlTableExtendedInputField(_('Free/Busy interval'), 'kolabUser_kolabFreeBusyFuture', $kolabFreeBusyFuture)
array('kind' => 'input', 'name' => 'kolabUser_kolabFreeBusyFuture', 'type' => 'text', 'size' => '30', ));
'maxlength' => '255', 'value' => $kolabFreeBusyFuture));
} }
// delegates // delegates
if (in_array('kolabDelegate', $fields)) { if (in_array('kolabDelegate', $fields)) {
@ -856,25 +871,22 @@ class kolabUser extends baseModule {
sort($kolabDelegate); sort($kolabDelegate);
$_SESSION['kolabUser_kolabDelegate'] = $kolabDelegate; $_SESSION['kolabUser_kolabDelegate'] = $kolabDelegate;
$delegateFields = array(); $delegateFields = array();
$delegateContainer = new htmlTable();
for ($i = 0; $i < sizeof($kolabDelegate); $i++) { for ($i = 0; $i < sizeof($kolabDelegate); $i++) {
$delegateFields[] = array( $delegateContainer->addElement(new htmlTableExtendedInputCheckbox('delDelegate_' . $i, false, $kolabDelegate[$i]));
array('kind' => 'text', 'text' => $kolabDelegate[$i]), $delegateContainer->addElement(new htmlOutputText(_('Delete')), true);
array('kind' => 'input', 'type' => 'checkbox', 'name' => 'delDelegate_' . $i),
array('kind' => 'text', 'text' => _('Delete'))
);
} }
$delegateFields[] = array( $delegateContainer->addElement(new htmlSelect('new_delegate_value', $delegates, null));
array('kind' => 'select', 'name' => 'new_delegate_value', 'options' => $delegates), $delegateContainer->addElement(new htmlTableExtendedInputCheckbox('new_delegate', false, _("Add"), null, false), true);
array('kind' => 'input', 'type' => 'checkbox', 'name' => 'new_delegate'), $delegateLabel = new htmlOutputText(_('Delegates'));
array('kind' => 'text', 'text' => _("Add")) $delegateLabel->alignment = htmlElement::ALIGN_TOP;
); $return['kolabDelegate'] = new htmlTableRow(array(
$return['kolabDelegate'] = array( $delegateLabel, $delegateContainer
array('kind' => 'fieldset', 'value' => $delegateFields, 'legend' => _('Delegates'), 'td' => array('colspan' => 2)) ));
);
} }
// invitation policies // invitation policies
if (in_array('kolabInvitationPolicy', $fields)) { if (in_array('kolabInvitationPolicy', $fields)) {
$returnPol = array(); $invitationContainer = new htmlTable();
// default invitation policy // default invitation policy
$defaultInvPol = $this->invitationPolicies['ACT_MANUAL']; $defaultInvPol = $this->invitationPolicies['ACT_MANUAL'];
for ($i = 0; $i < sizeof($attributes['kolabInvitationPolicy']); $i++) { for ($i = 0; $i < sizeof($attributes['kolabInvitationPolicy']); $i++) {
@ -886,19 +898,14 @@ class kolabUser extends baseModule {
break; break;
} }
} }
$returnPol[] = array( $invitationContainer->addElement(new htmlTableExtendedSelect('defaultInvPol', array_values($this->invitationPolicies), array($defaultInvPol), _('Anyone')), true);
array('kind' => 'text', 'text' => _('Anyone')),
array('kind' => 'select', 'name' => 'defaultInvPol', 'options' => array_values($this->invitationPolicies), 'options_selected' => $defaultInvPol),
array('kind' => 'text', 'text' => ''));
// other invitation policies // other invitation policies
for ($i = 0; $i < sizeof($attributes['kolabInvitationPolicy']); $i++) { for ($i = 0; $i < sizeof($attributes['kolabInvitationPolicy']); $i++) {
$parts = explode(":", $attributes['kolabInvitationPolicy'][$i]); $parts = explode(":", $attributes['kolabInvitationPolicy'][$i]);
if (sizeof($parts) == 2) { if (sizeof($parts) == 2) {
$returnPol[] = array( $invitationContainer->addElement(new htmlInputField('invPol1' . $i, $parts[0]));
array('kind' => 'input', 'name' => 'invPol1' . $i, 'type' => 'text', 'value' => $parts[0]), $invitationContainer->addElement(new htmlSelect('invPol2' . $i, array_values($this->invitationPolicies), array($this->invitationPolicies[$parts[1]])));
array('kind' => 'select', 'name' => 'invPol2' . $i, 'options' => array_values($this->invitationPolicies), 'options_selected' => $this->invitationPolicies[$parts[1]]), $invitationContainer->addElement(new htmlTableExtendedInputCheckbox('delInvPol' . $i, false, _("Remove"), null, false), true);
array('kind' => 'input', 'type' => 'checkbox', 'name' => 'delInvPol' . $i),
array('kind' => 'text', 'text' => _("Remove")));
} }
} }
// input box for new invitation policy // input box for new invitation policy
@ -907,10 +914,11 @@ class kolabUser extends baseModule {
array('kind' => 'select', 'name' => 'invPol2', 'options' => array_values($this->invitationPolicies)), array('kind' => 'select', 'name' => 'invPol2', 'options' => array_values($this->invitationPolicies)),
array('kind' => 'input', 'type' => 'checkbox', 'name' => 'addInvPol'), array('kind' => 'input', 'type' => 'checkbox', 'name' => 'addInvPol'),
array('kind' => 'text', 'text' => _("Add"))); array('kind' => 'text', 'text' => _("Add")));
$returnPol = array( $invitationLabel = new htmlOutputText(_('Invitation policy'));
array('kind' => 'fieldset', 'legend' => _('Invitation policy'), 'value' => $returnPol, 'td' => array('colspan' => 3)) $invitationLabel->alignment = htmlElement::ALIGN_TOP;
); $return['kolabInvitationPolicy'] = new htmlTableRow(array(
$return['kolabInvitationPolicy'] = $returnPol; $invitationLabel, $invitationContainer
));
} }
return $return; return $return;
} }

View File

@ -1704,12 +1704,11 @@ class posixAccount extends baseModule implements passwordService {
function getSelfServiceOptions($fields, $attributes) { function getSelfServiceOptions($fields, $attributes) {
$return = array(); $return = array();
if (in_array('password', $fields)) { if (in_array('password', $fields)) {
$return['password'] = array( $pwd1 = new htmlTableExtendedInputField(_('New password'), 'posixAccount_password');
array('kind' => 'text', 'text' => _('New password')), $pwd2 = new htmlTableExtendedInputField(_('Reenter password'), 'posixAccount_password2');
array('kind' => 'input', 'name' => 'posixAccount_password', 'type' => 'password', 'size' => '30', 'maxlength' => '255'), $return['password'] = new htmlTableRow(array(
array('kind' => 'text', 'text' => _('Reenter password')), $pwd1, $pwd2
array('kind' => 'input', 'name' => 'posixAccount_password2', 'type' => 'password', 'size' => '30', 'maxlength' => '255') ));
);
} }
return $return; return $return;
} }