Skip to content

Commit

Permalink
make object classes configurable in inc/config.php
Browse files Browse the repository at this point in the history
  • Loading branch information
cweiske committed Oct 1, 2013
1 parent 323c95b commit 1dd0c2d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 32 deletions.
9 changes: 8 additions & 1 deletion inc/config.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,11 @@
// Force recompilation of smarty templates?
$conf['smartycompile'] = 0;


// LDAP classes to store with contacts.
$conf['oclasses'] = array(
'inetOrgPerson',
//'contactPerson',
//'OXUserObject',
//'evolutionPerson',
//'officePerson',
);
60 changes: 29 additions & 31 deletions inc/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
* handled by the template as well)
*/

global $conf;

/**
* The object classes to store with contacts
*/
$OCLASSES[] = 'inetOrgPerson';
$OCLASSES = $conf['oclasses'];

/**
* The standard fields suported by OpenLDAP's default schemas
Expand Down Expand Up @@ -47,46 +48,43 @@
* If the provided "extended" schema is used the following fields
* and object classes are added
*/
$OCLASSES[] = 'contactPerson';
$FIELDS['anniversary'] = 'anniversary';
$FIELDS['_marker'] = 'marker'; // aka. tags
$FIELDS['country'] = 'c';
if (array_search('contactPerson', $conf['oclasses']) !== false) {
$FIELDS['anniversary'] = 'anniversary';
$FIELDS['_marker'] = 'marker'; // aka. tags
$FIELDS['country'] = 'c';
}

/**
* If the open exchange schema is used the following fields
* and object classes are added
*/
/* comment in if you want to use it
$OCLASSES[] = 'OXUserObject';
$FIELDS['country'] = 'userCountry';
$FIELDS['birthday'] = 'birthDay';
$FIELDS['ipphone'] = 'IPPhone';
$FIELDS['_marker'] = 'OXUserCategories';
$FIELDS['instantmessenger'] = 'OXUserInstantMessenger';
$FIELDS['timezone'] = 'OXTimeZone';
$FIELDS['position'] = 'OXUserPosition';
$FIELDS['certificate'] = 'relClientCert';
$FIELDS['domain'] = 'domain';
*/
if (array_search('OXUserObject', $conf['oclasses']) !== false) {
$FIELDS['country'] = 'userCountry';
$FIELDS['birthday'] = 'birthDay';
$FIELDS['ipphone'] = 'IPPhone';
$FIELDS['_marker'] = 'OXUserCategories';
$FIELDS['instantmessenger'] = 'OXUserInstantMessenger';
$FIELDS['timezone'] = 'OXTimeZone';
$FIELDS['position'] = 'OXUserPosition';
$FIELDS['certificate'] = 'relClientCert';
$FIELDS['domain'] = 'domain';
}

/**
* If the Evolution schema is used the following fields
* and object classes are added
*/
/* comment in if you want to use it
$OCLASSES[] = 'evolutionPerson';
$OCLASSES[] = 'officePerson';
$FIELDS['department'] = 'ou';
$FIELDS['state'] = 'st';
$FIELDS['country'] = 'c';
$FIELDS['phone'] = 'primaryPhone';
$FIELDS['switchboard'] = 'companyPhone';
$FIELDS['note'] = 'note';
$FIELDS['manager'] = 'seeAlso';
$FIELDS['birthday'] = 'birthDate';
$FIELDS['spouse'] = 'spouseName';
*/

if (array_search('evolutionPerson', $conf['oclasses']) !== false) {
$FIELDS['department'] = 'ou';
$FIELDS['state'] = 'st';
$FIELDS['country'] = 'c';
$FIELDS['phone'] = 'primaryPhone';
$FIELDS['switchboard'] = 'companyPhone';
$FIELDS['note'] = 'note';
$FIELDS['manager'] = 'seeAlso';
$FIELDS['birthday'] = 'birthDate';
$FIELDS['spouse'] = 'spouseName';
}

/**
* Flip the array
Expand Down

0 comments on commit 1dd0c2d

Please sign in to comment.