diff --git a/lam/docs/devel/mod_accountPages.htm b/lam/docs/devel/mod_accountPages.htm index f9d8a024..60145d6f 100644 --- a/lam/docs/devel/mod_accountPages.htm +++ b/lam/docs/devel/mod_accountPages.htm @@ -1,6 +1,7 @@
/** + * Returns meta data that is interpreted by parent +class + * + * @return array array with meta data + */ + function +get_metaData() { + $return = array(); + $return['selfServiceFieldSettings'] = +array('firstName' => _('First name'), 'lastName' => _('Last +name'), + 'mail' => +_('Email address'), 'telephoneNumber' => _('Telephone number'), +'mobile' => _('Mobile number'), + 'faxNumber' +=> _('Fax number'), 'street' => _('Street'), 'postalAddress' +=> _('Postal address'), 'registeredAddress' => _('Registered +address'), + 'postalCode' +=> _('Postal code'), 'postOfficeBox' => _('Post office box'), +'jpegPhoto' => _('Photo'), + 'homePhone' +=> _('Home telephone number'), 'roomNumber' => _('Room number'), +'carLicense' => _('Car license'), + 'location' +=> _('Location'), 'state' => _('State'), 'officeName' => +_('Office name'), 'businessCategory' => _('Business category'), + + 'departmentNumber' => _('Department'), 'initials' => +_('Initials'), 'title' => _('Job title'), 'labeledURI' => _('Web +site'), + 'userCertificate' => _('User certificates')); + // possible self service read-only fields + + $return['selfServiceReadOnlyFields'] = array('firstName', +'lastName', 'mail', 'telephoneNumber', 'mobile', 'faxNumber', 'street', + + 'postalAddress', 'registeredAddress', 'postalCode', +'postOfficeBox', 'jpegPhoto', 'homePhone', 'roomNumber', 'carLicense', + 'location', +'state', 'officeName', 'businessCategory', 'departmentNumber', +'initials', 'title', 'labeledURI', 'userCertificate'); + [...] + |
+
/** + * Returns meta data that is interpreted by parent +class + * + * @return array array with meta data + */ + function +get_metaData() { + $return = array(); // self service search attributes + + $return['selfServiceSearchAttributes'] = array('uid', 'mail', +'cn', 'surname', 'givenName', 'employeeNumber'); + [...] + |
+
/** + * Returns the meta HTML code for each input field. + * format: array(<field1> => array(<META HTML>), ...) + * It is not possible to display help links. + * + * @param array $fields list of active fields + * @param array $attributes attributes of LDAP account + * @param boolean $passwordChangeOnly indicates +that the user is only allowed to change his password and no LDAP +content is readable + * @param array $readOnlyFields list of read-only fields + * @return array list of meta HTML elements (field name => htmlTableRow) + */ + function getSelfServiceOptions($fields, $attributes, $passwordChangeOnly, $readOnlyFields) { + $return = array(); + if ($passwordChangeOnly) { + return +$return; // only password fields as long no LDAP content can be read + } + +$this->addSimpleSelfServiceTextField($return, +'physicalDeliveryOfficeName', _('Office name'), $fields, $attributes, +$readOnlyFields); + [...] + |
+
/** + * Checks if all input values are correct and returns the LDAP attributes which should be changed. + * <br>Return values: + * <br>messages: array of parameters to create status messages + * <br>add: array of attributes to add + * <br>del: array of attributes to remove + * <br>mod: array of attributes to modify + * <br>info: array of values with +informational value (e.g. to be used later by pre/postModify actions) + * + * Calling this method does not require the existence of an enclosing {@link accountContainer}. + * + * @param string $fields input fields + * @param array $attributes LDAP attributes + * @param boolean $passwordChangeOnly indicates +that the user is only allowed to change his password and no LDAP +content is readable + * @param array $readOnlyFields list of read-only fields + * @return array messages and attributes +(array('messages' => array(), 'add' => array('mail' => +array('test@test.com')), 'del' => array(), 'mod' => array(), +'info' => array())) + */ + function checkSelfServiceOptions($fields, $attributes, $passwordChangeOnly, $readOnlyFields) { + $return = array('messages' => +array(), 'add' => array(), 'del' => array(), 'mod' => array(), +'info' => array()); + if ($passwordChangeOnly) { + return $return; // skip processing if only a password change is done + } + $attributeNames = array(); // list of attributes which should be checked for modification + $attributesNew = $attributes; + // first name + if (in_array('firstName', $fields) && !in_array('firstName', $readOnlyFields)) { + $attributeNames[] = 'givenName'; + if +(isset($_POST['inetOrgPerson_firstName']) && +($_POST['inetOrgPerson_firstName'] != '')) { + + if (!get_preg($_POST['inetOrgPerson_firstName'], +'realname')) $return['messages'][] = $this->messages['givenName'][0]; + + else $attributesNew['givenName'][0] = +$_POST['inetOrgPerson_firstName']; + } + elseif +(isset($attributes['givenName'])) unset($attributesNew['givenName']); + } + [...] + |