[dev] patch for turba sources.php.dist

Iain McFarlane iain at imcfarla.homelinux.net
Sun Oct 17 14:59:56 PDT 2004


Hi,

when kolab is not enabled turba gives error messages because of the default 
address books included in sources.php.dist

this patch checks the config to see if kolab is enabled and if so then 
includes the ldap address book:

--- turba/config/sources.php.dist       2004-10-07 10:18:46.768747000 +0100
+++ turba/config/sources.php.dist.new   2004-10-07 11:28:41.590688033 +0100
@@ -494,70 +358,74 @@
  * server. The user accessing this should have read permissions
  * to the shared directory in LDAP.
  */
-$cfgSources['kolab_global'] = array(
-    'title' => _("Global Address Book"),
-    'type' => 'ldap',
-    'params' => array(
-        'server' => $GLOBALS['conf']['kolab']['ldap']['server'],
-        'port' => $GLOBALS['conf']['kolab']['ldap']['port'],
-        'root' => $GLOBALS['conf']['kolab']['ldap']['basedn'],
-        'sizelimit' => 200,
-        'dn' => array('cn'),
-        'objectclass' => array(
-            'top',
-            'inetOrgPerson'
+// Only include if kolab is enabled
+$kolab_enabled = $GLOBALS['conf']['kolab']['enabled'];
+if ($kolab_enabled == 'true') {
+    $cfgSources['kolab_global'] = array(
+       'title' => _("Global Address Book"),
+       'type' => 'ldap',
+       'params' => array(
+            'server' => $GLOBALS['conf']['kolab']['ldap']['server'],
+            'port' => $GLOBALS['conf']['kolab']['ldap']['port'],
+            'root' => $GLOBALS['conf']['kolab']['ldap']['basedn'],
+            'sizelimit' => 200,
+            'dn' => array('cn'),
+            'objectclass' => array(
+                'top',
+                'inetOrgPerson'
+                ),
+            'charset' => 'iso-8859-1',
+            'version' => 3,
+            'bind_dn' => $GLOBALS['conf']['kolab']['ldap']['binddn'],
+            'bind_password' => $GLOBALS['conf']['kolab']['ldap']['bindpw'],
         ),
-        'charset' => 'iso-8859-1',
-        'version' => 3,
-        'bind_dn' => $GLOBALS['conf']['kolab']['ldap']['binddn'],
-        'bind_password' => $GLOBALS['conf']['kolab']['ldap']['bindpw'],
-    ),
-    'map' => array(
-        '__key'             => 'dn',
-        'name'              => 'cn',
-        'firstname'         => 'givenName',
-        'lastname'          => 'sn',
-        'email'             => 'mail',
-        'alias'             => 'alias',
-        'title'             => 'title',
-        'company'           => 'o',
-        'workAddress'       => 'street',
-        'workCity'          => 'l',
-        'workProvince'      => 'st',
-        'workPostalCode'    => 'postalCode',
-        'workCountry'       => 'c',
-        'homePhone'         => 'homePhone',
-        'workPhone'         => 'telephoneNumber',
-        'cellPhone'         => 'mobile',
-        'fax'               => 'fax',
-        'notes'             => 'description',
-    ),
-    'search' => array(
-        'name',
-        'firstname',
-        'lastname',
-        'email',
-        'title',
-        'company',
-        'workAddress',
-        'workCity',
-        'workProvince',
-        'workPostalCode',
-        'workCountry',
-        'homePhone',
-        'workPhone',
-        'cellPhone',
-        'fax',
-        'notes',
-    ),
-    'strict' => array(
-        'dn',
-    ),
-    'public' => true,
-    'readonly' => true,
-    'admin' => array(),
-    'export' => true
-);
+        'map' => array(
+            '__key'             => 'dn',
+            'name'              => 'cn',
+            'firstname'         => 'givenName',
+            'lastname'          => 'sn',
+            'email'             => 'mail',
+            'alias'             => 'alias',
+            'title'             => 'title',
+            'company'           => 'o',
+            'workAddress'       => 'street',
+            'workCity'          => 'l',
+            'workProvince'      => 'st',
+            'workPostalCode'    => 'postalCode',
+            'workCountry'       => 'c',
+            'homePhone'         => 'homePhone',
+            'workPhone'         => 'telephoneNumber',
+            'cellPhone'         => 'mobile',
+            'fax'               => 'fax',
+            'notes'             => 'description',
+        ),
+        'search' => array(
+            'name',
+            'firstname',
+            'lastname',
+            'email',
+           'title',
+            'company',
+            'workAddress',
+            'workCity',
+            'workProvince',
+            'workPostalCode',
+            'workCountry',
+            'homePhone',
+            'workPhone',
+            'cellPhone',
+            'fax',
+            'notes',
+        ),
+        'strict' => array(
+            'dn',
+        ),
+        'public' => true,
+        'readonly' => true,
+        'admin' => array(),
+        'export' => true
+    );
+}

 /**
  * A local address book for a Kolab user. This is stored in a



More information about the dev mailing list