fixed profile loading for hidden fields

This commit is contained in:
Roland Gruber 2009-10-03 18:13:38 +00:00
parent fb91567007
commit 2375b57b80
1 changed files with 27 additions and 20 deletions

View File

@ -188,21 +188,26 @@ class inetOrgPerson extends baseModule {
array('kind' => 'help', 'value' => 'employeeType')); array('kind' => 'help', 'value' => 'employeeType'));
} }
// profile checks // profile checks
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideJobTitle')) {
$return['profile_checks']['inetOrgPerson_title'] = array( $return['profile_checks']['inetOrgPerson_title'] = array(
'type' => 'ext_preg', 'type' => 'ext_preg',
'regex' => 'title', 'regex' => 'title',
'error_message' => $this->messages['title'][0]); 'error_message' => $this->messages['title'][0]);
$return['profile_mappings']['inetOrgPerson_title'] = 'title';
}
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideEmployeeType')) {
$return['profile_checks']['inetOrgPerson_employeeType'] = array( $return['profile_checks']['inetOrgPerson_employeeType'] = array(
'type' => 'ext_preg', 'type' => 'ext_preg',
'regex' => 'employeeType', 'regex' => 'employeeType',
'error_message' => $this->messages['employeeType'][0]); 'error_message' => $this->messages['employeeType'][0]);
// profile mappings $return['profile_mappings']['inetOrgPerson_employeeType'] = 'employeeType';
$return['profile_mappings'] = array( }
'inetOrgPerson_l' => 'l', if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideLocation')) {
'inetOrgPerson_st' => 'st', $return['profile_mappings']['inetOrgPerson_l'] = 'l';
'inetOrgPerson_title' => 'title', }
'inetOrgPerson_employeeType' => 'employeeType' if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideState')) {
); $return['profile_mappings']['inetOrgPerson_st'] = 'st';
}
// configuration settings // configuration settings
$return['config_options']['all'] = array( $return['config_options']['all'] = array(
array( array(
@ -1362,6 +1367,7 @@ class inetOrgPerson extends baseModule {
function load_profile($profile) { function load_profile($profile) {
// profile mappings in meta data // profile mappings in meta data
parent::load_profile($profile); parent::load_profile($profile);
if (!$this->isBooleanConfigOptionSet('inetOrgPerson_hideDepartments')) {
// departments // departments
if (isset($profile['inetOrgPerson_departmentNumber'][0]) && $profile['inetOrgPerson_departmentNumber'][0] != '') { if (isset($profile['inetOrgPerson_departmentNumber'][0]) && $profile['inetOrgPerson_departmentNumber'][0] != '') {
$departments = explode(';', $profile['inetOrgPerson_departmentNumber'][0]); $departments = explode(';', $profile['inetOrgPerson_departmentNumber'][0]);
@ -1369,6 +1375,7 @@ class inetOrgPerson extends baseModule {
$this->attributes['departmentNumber'] = array_map('trim', $departments); $this->attributes['departmentNumber'] = array_map('trim', $departments);
} }
} }
}
/** /**
* In this function the LDAP account is built up. * In this function the LDAP account is built up.