Add configuration option for specifying an Exchange-style global address list (GAL).
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 6 May 2010 20:57:16 +0000 (16:57 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 6 May 2010 20:59:10 +0000 (16:59 -0400)
Also add API method for obtaining the uid for the GAL source.

turba/config/conf.xml
turba/lib/Api.php

index 5915d01..dca47e3 100644 (file)
    name.">localsql</configstring>
  </configsection>
 
+ <configsection name="gal">
+   <configheader>Exchange GAL</configheader>
+   <configstring name="addressbook" desc="If using a synchronization solution
+   that supports Exchange-style Global Address List (GAL) searches enter the
+   name of the addressbook that should act as the GAL. This is normally a
+   globally accessable, readonly addressbook.">localsql</configstring>
+ </configsection>
+
  <configsection name="shares">
   <configheader>Shares</configheader>
   <configstring name="source" desc="Name of source for creating new
index 12a805b..b65f14d 100644 (file)
@@ -142,6 +142,21 @@ class Turba_Api extends Horde_Registry_Api
         return $prefs->getValue('default_dir');
     }
 
+    /**
+     * Retrieve the UID for the Global Address List source, or false if none
+     * configured.
+     *
+     * @return string | boolean  The UID or false if none configured.
+     */
+    public function getGalUid()
+    {
+        if (!empty($GLOBALS['conf']['gal']['addressbook'])) {
+            return $GLOBALS['conf']['gal']['addressbook'];
+        }
+
+        return false;
+    }
+
     private function _modified($uid)
     {
         $modified = $this->getActionTimestamp($uid, 'modify');