]> git.sur5r.net Git - contagged/commitdiff
make object classes configurable in inc/config.php
authorChristian Weiske <cweiske@cweiske.de>
Tue, 1 Oct 2013 05:29:28 +0000 (07:29 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 1 Oct 2013 05:38:15 +0000 (07:38 +0200)
inc/config.php.dist
inc/fields.php

index 03741d42134659a812f8e152c884cd8c17a3348a..f12635f6b9e8675c514fd2d34022f3999bcae57a 100644 (file)
   // Force recompilation of smarty templates?
   $conf['smartycompile'] = 0;
 
-
+// LDAP classes to store with contacts.
+$conf['oclasses'] = array(
+    'inetOrgPerson',
+    //'contactPerson',
+    //'OXUserObject',
+    //'evolutionPerson',
+    //'officePerson',
+);
index 9229e7206462377b19f07ac677a9c8d9b4aed9af..23e933b4305beab44a45dfe56d791671e9b9332c 100644 (file)
  * 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
@@ -47,46 +48,43 @@ $FIELDS = array(
  * 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