Consolidate on backends.php for backend configuration files.
authorJan Schneider <jan@horde.org>
Thu, 9 Sep 2010 15:50:20 +0000 (17:50 +0200)
committerJan Schneider <jan@horde.org>
Thu, 9 Sep 2010 15:50:20 +0000 (17:50 +0200)
42 files changed:
chora/config/backends.php.dist [new file with mode: 0644]
chora/config/conf.xml
chora/config/sourceroots.php.dist [deleted file]
chora/docs/CHANGES
chora/docs/INSTALL
chora/docs/UPGRADING [new file with mode: 0644]
chora/lib/Application.php
chora/lib/Test.php
imp/config/backends.php.dist [new file with mode: 0644]
imp/config/conf.xml
imp/config/hooks.php.dist
imp/config/servers.php.dist [deleted file]
imp/docs/CHANGES
imp/docs/INSTALL
imp/docs/UPGRADING
imp/lib/Auth.php
imp/lib/Imap.php
imp/lib/Quota/Hook.php
imp/lib/Test.php
kastalia/config/conf.xml [changed mode: 0755->0644]
luxor/config/backends.php.dist [new file with mode: 0644]
luxor/config/sources.php.dist [deleted file]
luxor/docs/CHANGES
luxor/lib/Luxor.php
turba/config/backends.php.dist [new file with mode: 0644]
turba/config/hooks.php.dist
turba/config/prefs.php.dist
turba/config/sources.php.dist [deleted file]
turba/docs/CHANGES
turba/docs/INSTALL
turba/docs/LDAP
turba/docs/UPGRADING
turba/lib/Api.php
turba/lib/Application.php
turba/lib/Driver.php
turba/lib/Form/CreateAddressBook.php
turba/lib/Test.php
turba/lib/Turba.php
turba/lib/tests/KolabTestBase.php
turba/scripts/import_squirrelmail_file_abook.php
turba/scripts/import_squirrelmail_sql_abook.php
turba/scripts/upgrades/2007-06-17_flatten_shares.php

diff --git a/chora/config/backends.php.dist b/chora/config/backends.php.dist
new file mode 100644 (file)
index 0000000..33a0113
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+/**
+ * $Id$
+ *
+ * This file contains all the configuration information for the
+ * various CVS repositories that you wish to display. You should have
+ * a minimum of one entry here!  Each entry requires a unique key name.
+ *
+ * The following fields can be defined for each repository.
+ *
+ * 'name' - (string) [REQUIRED] Short name for the repository.
+ *
+ * 'location' - (string) [REQUIRED] Location on the filesystem of the
+ *              repository. The value can be any PHP supported wrapper that
+ *              can be opened via fopen().
+ *
+ * 'title' - (string) [REQUIRED] Long title for the repository.
+ *
+ * 'type' - (string) [REQUIRED] The driver type.  Either 'cvs', 'rcs', 'svn',
+            or 'git'.
+ *
+ * 'default' - (boolean) If true, makes repository the default one to show.
+ *
+ * 'intro' - (string) File which contains some introductory text to show on
+ *           the front page of this repository.  This file MUST be located
+ *           in the config/ directory.
+ *
+ * 'cvsusers' - (string) A list of all committers with real names and email
+ *              addresses, that normally sits in the CVSROOT/cvsusers file.
+ *              If it is found, then more useful information will be shown.
+ *
+ * 'restrictions' - (array) List of perl-style regular expressions for those
+ *                  files whose contents should be protected and not
+ *                  displayed.
+ *
+ * 'username' - (string) Username to use for the repository (only for
+ *              Subversion repositories that require authentication).
+ *
+ * 'password' - (string) Password to use for the repository (only for
+ *              Subversion repositories that require authentication).
+ */
+
+$sourceroots['localcvs'] = array(
+    'name' => 'CVS',
+    'location' => '/path/to/cvs/repo',
+    'title' => 'CVS Repository',
+    'cvsusers' => 'CVSROOT/cvsusers',
+    'type' => 'cvs',
+);
+
+$sourceroots['subversion'] = array(
+    'name' => 'Subversion',
+    'location' => 'http://svn.example.com/repos/svn',
+    'title' => 'A Compelling Replacement for CVS',
+    'type' => 'svn'
+);
+
+$sourceroots['localsvn'] = array(
+    'name' => 'MySVNProj',
+    'location' => '/path/to/svn/repo',
+    'title' => 'Main Subversion Repos',
+    'type' => 'svn',
+);
+
+$sourceroots['git'] = array(
+    'name' => 'Git',
+    'location' => '/path/to/git/repo',
+    'title' => 'Git repository',
+    'type' => 'git',
+);
index af65a0e..a4c6a35 100644 (file)
@@ -86,7 +86,7 @@
 
   <configlist name="restrictions" required="false" desc="If you wish to protect
   a file pattern on a global basis (i.e. across all sourceroots defined in
-  sourceroots.php) list the perl-style regex file patterns in this array. For
+  backends.php) list the perl-style regex file patterns in this array. For
   example: &lt;code class=&quot;nowrap&quot;&gt;'^/?CVSROOT'&lt;/code&gt;"/>
 
   <configboolean name="hide_restricted" desc="If you wish to hide restricted
diff --git a/chora/config/sourceroots.php.dist b/chora/config/sourceroots.php.dist
deleted file mode 100644 (file)
index 33a0113..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-/**
- * $Id$
- *
- * This file contains all the configuration information for the
- * various CVS repositories that you wish to display. You should have
- * a minimum of one entry here!  Each entry requires a unique key name.
- *
- * The following fields can be defined for each repository.
- *
- * 'name' - (string) [REQUIRED] Short name for the repository.
- *
- * 'location' - (string) [REQUIRED] Location on the filesystem of the
- *              repository. The value can be any PHP supported wrapper that
- *              can be opened via fopen().
- *
- * 'title' - (string) [REQUIRED] Long title for the repository.
- *
- * 'type' - (string) [REQUIRED] The driver type.  Either 'cvs', 'rcs', 'svn',
-            or 'git'.
- *
- * 'default' - (boolean) If true, makes repository the default one to show.
- *
- * 'intro' - (string) File which contains some introductory text to show on
- *           the front page of this repository.  This file MUST be located
- *           in the config/ directory.
- *
- * 'cvsusers' - (string) A list of all committers with real names and email
- *              addresses, that normally sits in the CVSROOT/cvsusers file.
- *              If it is found, then more useful information will be shown.
- *
- * 'restrictions' - (array) List of perl-style regular expressions for those
- *                  files whose contents should be protected and not
- *                  displayed.
- *
- * 'username' - (string) Username to use for the repository (only for
- *              Subversion repositories that require authentication).
- *
- * 'password' - (string) Password to use for the repository (only for
- *              Subversion repositories that require authentication).
- */
-
-$sourceroots['localcvs'] = array(
-    'name' => 'CVS',
-    'location' => '/path/to/cvs/repo',
-    'title' => 'CVS Repository',
-    'cvsusers' => 'CVSROOT/cvsusers',
-    'type' => 'cvs',
-);
-
-$sourceroots['subversion'] = array(
-    'name' => 'Subversion',
-    'location' => 'http://svn.example.com/repos/svn',
-    'title' => 'A Compelling Replacement for CVS',
-    'type' => 'svn'
-);
-
-$sourceroots['localsvn'] = array(
-    'name' => 'MySVNProj',
-    'location' => '/path/to/svn/repo',
-    'title' => 'Main Subversion Repos',
-    'type' => 'svn',
-);
-
-$sourceroots['git'] = array(
-    'name' => 'Git',
-    'location' => '/path/to/git/repo',
-    'title' => 'Git repository',
-    'type' => 'git',
-);
index 26f62c0..56bf782 100644 (file)
@@ -2,6 +2,7 @@
 v3.0-git
 --------
 
+[jan] Rename sourceroots.php to backends.php.
 [mms] Patchset page supports viewing a single patchset.
 [mms] Add configuration option to disable caching.
 [mms] Move log entries in annotate screen to an AJAX request.
index dea84a0..50a03f0 100644 (file)
@@ -114,13 +114,13 @@ Configuring Chora
       for foo in *.dist; do cp $foo `basename $foo .dist`; done
 
    Documentation on the format of those files can be found in each file.  With
-   the exception of the ``conf.*`` (see below) and ``sourceroots.php`` files,
+   the exception of the ``conf.*`` (see below) and ``backends.php`` files,
    the other files in ``config/`` need only be modified if you wish to
    customize Chora's appearance or behavior, as the defaults will be correct
    for most sites.
 
    You must be sure to list your repository names and configuration
-   information in ``sourceroots.php``.
+   information in ``backends.php``.
 
    You must login to Horde as a Horde Administrator to finish the
    configuration of Chora.  Use the Horde ``Administration`` menu item to get
diff --git a/chora/docs/UPGRADING b/chora/docs/UPGRADING
new file mode 100644 (file)
index 0000000..9c4aa28
--- /dev/null
@@ -0,0 +1,22 @@
+=================
+ Upgrading Chora
+=================
+
+:Contact: chora@lists.horde.org
+
+
+These are instructions to upgrade from earlier Chora versions.
+
+
+Upgrading Chora from 2.x to 3.x
+===============================
+
+This is a non-exhaustive, quick explanation of what has changed between a Chora
+2.x installation to Chora 3.x.
+
+
+Configuration files
+-------------------
+
+The ``config/sourceroots.php`` configuration file has been renamed to
+``config/backends.php``.
index c639333..4538474 100644 (file)
@@ -52,7 +52,7 @@ class Chora_Application extends Horde_Registry_Application
         global $acts, $defaultActs, $where, $atdir, $fullname, $sourceroot;
 
         try {
-            $GLOBALS['sourceroots'] = Horde::loadConfiguration('sourceroots.php', 'sourceroots');
+            $GLOBALS['sourceroots'] = Horde::loadConfiguration('backends.php', 'sourceroots');
         } catch (Horde_Exception $e) {
             $GLOBALS['notification']->push($e);
             $GLOBALS['sourceroots'] = array();
@@ -173,7 +173,7 @@ class Chora_Application extends Horde_Registry_Application
         $perms['title']['chora:sourceroots'] = _("Repositories");
 
         // Run through every source repository
-        require dirname(__FILE__) . '/../config/sourceroots.php';
+        require dirname(__FILE__) . '/../config/backends.php';
         foreach ($sourceroots as $sourceroot => $srconfig) {
             $perms['tree']['chora']['sourceroots'][$sourceroot] = false;
             $perms['title']['chora:sourceroots:' . $sourceroot] = $srconfig['name'];
index 9382e1f..43734d1 100644 (file)
@@ -42,7 +42,7 @@ class Chora_Test extends Horde_Test
         'config/conf.php' => null,
         'config/mime_drivers.php' => null,
         'config/prefs.php' => null,
-        'config/sourceroots.php' => null
+        'config/backends.php' => null
     );
 
     /**
diff --git a/imp/config/backends.php.dist b/imp/config/backends.php.dist
new file mode 100644 (file)
index 0000000..a44d919
--- /dev/null
@@ -0,0 +1,400 @@
+<?php
+/**
+ * This file specifies which mail servers people using your installation of
+ * IMP can login to.
+ *
+ * Properties that can be set for each server:
+ *
+ * name: (string) This is the name displayed in the server list on the login
+ *       screen.
+ *
+ * hostspec: (string) The hostname/IP address of the mail server to connect to.
+ *
+ * hordeauth: (mixed) One of the following values:
+ *              true - IMP will attempt to use the user's existing credentials
+ *                     (the username/password they used to log in to Horde) to
+ *                     login to this source.
+ *              false - Everything after and including the first @ in the
+ *                      username will be stripped off before attempting
+ *                      authentication. (DEFAULT)
+ *              'full' - The username will be used unmodified.
+ *
+ * protocol: (string) The server protocol. Either 'pop' or 'imap'.
+ *
+ *           'imap' requires a IMAP4rev1 (RFC 3501) compliant server
+ *           (DEFAULT).
+ *
+ *           'pop' requires a POP3 (RFC 1939) compliant server. All folder
+ *           options will be automatically turned off (POP3 does
+ *           not support folders).  Other advanced functions will also be
+ *           disabled (e.g. caching, searching, sorting).
+ *
+ * secure: (mixed) Transport security used for connection to the server. One
+ *         of the following values:
+ *           'ssl' - Use SSL to connect to the server.
+ *           'tls' - Use TLS to connect to the server.
+ *           false - Do not use any encryption (DEFAULT).
+ *
+ *         The 'ssl' and 'tls' options will only work if you've compiled PHP
+ *         with SSL support and the mail server supports secure connections.
+ *
+ *         The use of 'ssl' is STRONGLY DISCOURAGED. If a secure connection
+ *         is needed, 'tls' should be used and the connection should be made
+ *         to the base protocol port (110 for POP3, 143 for IMAP).
+ *
+ * port: (integer) The port that the mail service/protocol you selected runs
+ *       on. Default values:
+ *         imap (unsecure or w/TLS):  143
+ *         imap (w/SSL):              993 (DISCOURAGED - use TLS on port 143)
+ *         pop (unsecure or w/TLS):   110
+ *         pop (w/SSL):               995 (DISCOURAGED - use TLS on port 110)
+ *
+ * maildomain: (string) What to put after the @ when sending mail. This
+ *             setting is generally useful when the sending host is different
+ *             from the mail receiving host. This setting will also be used to
+ *             complete unqualified addresses when composing mail.
+ *             E.g. If you want all mail to look like 'From:
+ *             user@example.com', set maildomain to 'example.com'.
+ *
+ * smtphost: (string) If specified, and $conf['mailer']['type'] is set to
+ *           'smtp', IMP will use this host for outbound SMTP connections.
+ *           This value overrides any existing
+ *           $conf['mailer']['params']['host'] value at runtime.
+ *
+ * smtpport: (integer) If specified, and $conf['mailer']['type'] is set to
+ *           'smtp', IMP will use this port for outbound SMTP connections.
+ *           This value overrides any existing
+ *           $conf['mailer']['params']['port'] value at runtime.
+ *
+ * admin: (array) Use this if you want to enable mailbox management for
+ *        administrators via Horde's user administration interface.  The
+ *        mailbox management gets enabled if you let IMP handle the Horde
+ *        authentication with the 'application' authentication driver.  Your
+ *        IMAP server needs to support mailbox management via IMAP commands.
+ *        Do not define this value if you do not want mailbox management.
+ *
+ *        The following parameters are available (defined in 'params'):
+ *        'admin_user' - The admin user.
+ *        'admin_password' - The admin user's password.
+ *        'userhierarchy' - The hierarchy where user mailboxes are stored.
+ *
+ * acl: (boolean) Set to true if you want to use Access Control Lists (mailbox
+ *      sharing). Set to false to disable (DEFAULT). Not all IMAP servers
+ *      support this feature.
+ *
+ * cache: (mixed) Enables caching for the server. This requires configuration
+ *        of a Horde_Cache driver in Horde. Will be disabled on any empty
+ *        value and enabled on any non-false value.
+ *
+ *        Caching is HIGHLY RECOMMENDED. There is no reason not to cache if
+ *        the IMAP server supports the CONDSTORE and/or QRESYNC IMAP
+ *        extensions. If the server does not support these extensions, any
+ *        flags changed by another mail agent while the IMP session is active
+ *        will not be updated. If IMP will be the exclusive method of
+ *        accessing the IMAP server, or you do not care about this behavior,
+ *        caching should be enabled on these servers.
+ *
+ *        The following optional configuration items are available:
+ *          'compress' - (string) Should the contents of the cache files be
+ *                       compressed before they are stored? This results in
+ *                       reduced memory usage when retrieving the data at the
+ *                       expense of slightly increased CPU usage. Either
+ *                       false (no compression - DEFAULT), 'gzip' or 'lzf'.
+ *                       'gzip' provides greater compression, and is generally
+ *                       built into PHP, but is slower. 'lzf' requires
+ *                       installation of a separate PECL module and provides
+ *                       less compression but is extremely fast (within 5% of
+ *                       regular string operations).  If available, 'lzf' is
+ *                       HIGHLY RECOMMENDED.
+ *          'lifetime' - (integer) The lifetime, in seconds, of the cached
+ *                       data.
+ *          'slicesize' - (integer) The number of messages stored in each
+ *                        cache slice.  The default should be fine for most
+ *                        installations.
+ *
+ * 'debug' - (string) If set, will output debug information from the IMAP
+ *           library. The value can be any PHP supported wrapper that can be
+ *           opened via fopen(). This setting should not be enabled by default
+ *           on production servers, since the log file will quickly grow very
+ *           large.
+ *
+ *           For example, to output to a file, provide the full path to the
+ *           file (a bare string is interpreted by PHP to be a filename). This
+ *           file must be writable by the PHP process.
+ *
+ *           To restrict logging to a certain user ('foo'), and to log this
+ *           output to the file '/tmp/imaplog', the following can be used:
+ *
+ *             (($GLOBALS['registry']->getAuth() == 'foo') ? '/tmp/imaplog' : false)
+ *
+ * quota: (array) Use this if you want to display a user's quota status on
+ *        various IMP pages. Set to an empty value to disable quota status
+ *        (DEFAULT).
+ *
+ *        The entry is configured as follows:
+ *
+ *          'quota' => array(
+ *              // Driver name: see below
+ *              'driver' => [string] (REQUIRED),
+ *              'params' => array(
+ *                  // True if you want to hide quota output when the server
+ *                  // reports an unlimited quota.
+ *                  'hide_when_unlimited' => true | false,
+ *
+ *                  // What storage unit the quota messages should be
+ *                  // displayed in.
+ *                  'unit' => 'GB' | 'MB' (DEFAULT) | 'KB',
+ *
+ *                  // Output format: see below.
+ *                  'format' => array(),
+ *
+ *                  // Additional driver parameters: see below.
+ *              )
+ *          )
+ *
+ *        'driver'/'params' can be the following:
+ *
+ *           DRIVER: 'command'
+ *                   Use the UNIX quota command to handle quotas.
+ *           PARAMS: 'quota_path' - [string] Path to the quota binary
+ *                                  (REQUIRED)
+ *                   'grep_path' - [string] Path to the grep binary (REQUIRED)
+ *                   'partition' - [string] If all user mailboxes are on a
+ *                                 single partition, the partition label. By
+ *                                 default, quota will determine quota
+ *                                 information using the user's home directory
+ *                                 value.
+ *
+ *           DRIVER: 'hook'
+ *                   Use the quota hook to handle quotas (see
+ *                   imp/config/hooks.php).
+ *           PARAMS: 'params' - [array] Parameters to pass to the quota
+ *                              hook function.
+ *
+ *           DRIVER: 'imap'
+ *                   Use the IMAP QUOTA extension to handle quotas.
+ *                   You must be connecting to a IMAP server capable of the
+ *                   QUOTAROOT command to use this driver. This is the
+ *                   RECOMMENDED way of handling quotas if the IMAP server
+ *                   supports it.
+ *           PARAMS: NONE
+ *
+ *           DRIVER: 'maildir'
+ *                   Use Maildir++ quota files to handle quotas.
+ *           PARAMS: 'msg_count' - [boolean] Display information on the
+ *                                 message limit rather than the storage
+ *                                 limit? The storage limit information is
+ *                                 displayed by default.
+ *                   'path' - [string] The path to the user's Maildir
+ *                            directory. You may use the two-character
+ *                            sequence "~U" to represent the user's account
+ *                            name, and the actual username will be
+ *                            substituted in that location. E.g.,
+ *                            '/home/~U/Maildir/' or '/var/mail/~U/Maildir/'.
+ *
+ *           DRIVER: 'mdaemon'
+ *                    Use Mdaemon servers to handle quotas.
+ *           PARAMS: 'app_location' - [string] Location of the application.
+ *
+ *           DRIVER: 'mercury32'
+ *                   Use Mercury/32 servers to handle quotas.
+ *           PARAMS: 'mail_user_folder' - [string] The path to folder mail
+ *                   mercury.
+ *
+ *           DRIVER: 'sql'
+ *                   Use arbitrary SQL queries to handle quotas.
+ *           PARAMS: 'query_quota' - (string) SQL query which returns single
+ *                   row/column with user quota (in bytes). %u is replaced
+ *                   with current user name, %U with the user name without the
+ *                   domain part, %d with the domain.
+ *                   'query_used' - (string) SQL query which returns single
+ *                   row/column with user used space (in bytes). Placeholders
+ *                   are the same like in query_quota.
+ *
+ *                   Additionally, the driver takes SQL connection parameters
+ *                   'phptype', 'hostspec',' 'username', 'password', and
+ *                   'database'. See horde/config/conf.php for further
+ *                   information on these parameters. If using the Horde DB,
+ *                   these parameters can be found in the
+ *                   $GLOBALS['conf']['sql'] variable and may be merged into
+ *                   the parameter configuration like this:
+ *
+ *                     'params' => array_merge(
+ *                         $GLOBALS['conf']['sql'],
+ *                         array(
+ *                             'query_quota' => [...],
+ *                             'query_used' => [...],
+ *                         )
+ *                     )
+ *
+ *        The optional 'format' parameter is supported by all drivers and
+ *        specifies the formats of the quota messages in the user
+ *        interface. The parameter must be specified as a hash with the four
+ *        possible elements 'long', 'short', 'nolimit_long', and
+ *        'nolimit_short'. The strings will be passed through sprintf().
+ *        These are the built-in default values, though they may appear
+ *        differently in some translations ([UNIT] will be replaced with the
+ *        value of the 'unit' parameter):
+ *          'long'          - Quota status: %.2f [UNIT] / %.2f [UNIT] (%.2f%%)
+ *          'nolimit_long'  - Quota status: %.2f [UNIT] / NO LIMIT
+ *          'short'         - %.0f%% of %.0f [UNIT]
+ *          'nolimit_short' - %.0f [UNIT]
+ *
+ *
+ * *** The following options should NOT be set unless you REALLY know what ***
+ * *** you are doing! FOR MOST PEOPLE, AUTO-DETECTION OF THESE PARAMETERS  ***
+ * *** (the default if the parameters are not set) SHOULD BE USED!         ***
+ *
+ * capability_ignore: (array) A list of IMAP capabilites to ignore, even if
+ *                    they are supported on the server. This capability names
+ *                    should be in all capitals. This option may be useful,
+ *                    for example, if it is known that a certain capability is
+ *                    buggy on the given server.  Otherwise, all available
+ *                    and supported IMAP capabilities will be (and should be)
+ *                    used. (IMAP only)
+ *
+ * comparator: (string) The search comparator to use instead of the default
+ *             IMAP server comparator. See RFC 4790 [3.1] - "collation-id" -
+ *             for the format. Your IMAP server must support the I18NLEVEL
+ *             extension for this setting to have an effect. By default,
+ *             the server default comparator is used. (IMAP only)
+ *
+ * id: (array) Send ID information to the IMAP server. This must be an array
+ *     with the keys being the fields to send and the values being the
+ *     associated values. Your IMAP server must support the ID extension for
+ *     this setting to have an effect. See RFC 2971 [3.3] for a list of
+ *     defined field values. (IMAP only)
+ *
+ * lang: (array) A list of languages (in priority order) to be used to display
+ *       human readable messages returned by the IMAP server. Your IMAP server
+ *       must support the LANGUAGE extensions for this setting to have an
+ *       effect. By default, IMAP messages are output in the IMAP server
+ *       default language. (IMAP only)
+ *
+ * namespace: (array) The list of namespaces that exist on the server. The
+ *            entries must be encoded in the UTF7-IMAP charset. Example:
+ *
+ *              array('#shared/', '#news/', '#public/')
+ *
+ *            This parameter should only be used if you want to allow access
+ *            to namespaces that may not be publicly advertised by the IMAP
+ *            server (see RFC 2342 [3]). These additional namespaces will be
+ *            ADDED to the list of available namespaces returned by the
+ *            server. (IMAP only)
+ *
+ * preferred: (string | array) Useful if you want to use the same backends.php
+ *            file for different machines. If the hostname of the IMP machine
+ *            is identical to one of those in the preferred list, then that
+ *            entry will be selected by default on the login screen. Otherwise
+ *            the first entry in the list is selected.
+ *
+ * thread: (string) Set the preferred thread sort algorithm. This algorithm
+ *         must be supported by the remote server. By default, IMP attempts
+ *         to use REFERENCES sorting and, if this is not available, it will
+ *         fall back to ORDEREDSUBJECT sorting done on the local server.
+ *
+ * timeout: (integer) Set the server timeout (in seconds).
+ *
+ *
+ * $Id$
+ */
+
+/* Any entries whose key value ('foo' in $servers['foo']) begin with '_'
+ * (an underscore character) will be treated as prompts, and you won't be
+ * able to log in to them. The only property these entries need is 'name'.
+ * This lets you put labels in the list, like this example: */
+$servers['_prompt'] = array(
+    'name' => _("Choose a mail server:")
+);
+
+/* Example configurations: */
+
+$servers['imap'] = array(
+    'name' => 'IMAP Server',
+    'hostspec' => 'imap.example.com',
+    'hordeauth' => false,
+    'protocol' => 'imap',
+    'port' => 143,
+    'secure' => false,
+    'maildomain' => 'example.com',
+    'smtphost' => 'smtp.example.com',
+    'smtpport' => 25,
+    'cache' => false,
+);
+
+$servers['cyrus'] = array(
+    'name' => 'Cyrus IMAP Server',
+    'hostspec' => 'cyrus.example.com',
+    'hordeauth' => false,
+    'protocol' => 'imap',
+    'port' => 143,
+    'secure' => false,
+    'maildomain' => 'example.com',
+    'smtphost' => 'smtp.example.com',
+    'smtpport' => 25,
+    'admin' => array(
+        'params' => array(
+            'admin_user' => 'cyrus',
+            'admin_password' => 'cyrus_pass',
+            'userhierarchy' => 'user.'
+        ),
+    ),
+    'quota' => array(
+        'driver' => 'imap',
+        'params' => array(
+            'hide_when_unlimited' => true,
+            'unit' => 'MB'
+        )
+    ),
+    'acl' => true,
+    'cache' => false,
+);
+
+$servers['pop'] = array(
+    'name' => 'POP3 Server',
+    'hostspec' => 'pop.example.com',
+    'hordeauth' => false,
+    'protocol' => 'pop3',
+    'port' => 110,
+    'secure' => false,
+    'maildomain' => 'example.com',
+    'smtphost' => 'smtp.example.com',
+    'smtpport' => 25,
+    'cache' => false,
+);
+
+$servers['secure-imap'] = array(
+    'name' => 'Secure IMAP Server',
+    'hostspec' => 'imap.example.com',
+    'hordeauth' => false,
+    'protocol' => 'imap',
+    'port' => 143,
+    'secure' => 'tls',
+    'maildomain' => 'example.com',
+    'smtphost' => 'smtp.example.com',
+    'smtpport' => 25,
+    'acl' => false,
+    'cache' => false,
+);
+
+if ($GLOBALS['conf']['kolab']['enabled']) {
+    require_once 'Horde/Kolab.php';
+    $servers['kolab'] = array(
+        'name' => 'Kolab Cyrus IMAP Server',
+        'hostspec' => Kolab::getServer('imap'),
+        'hordeauth' => 'full',
+        'protocol' => 'imap',
+        'port' => $GLOBALS['conf']['kolab']['imap']['port'],
+        'secure' => false,
+        'maildomain' => $GLOBALS['conf']['kolab']['imap']['maildomain'],
+        'quota' => array(
+            'driver' => 'imap',
+            'params' => array(
+                'hide_quota_when_unlimited' => true,
+                'unit' => 'MB'
+            )
+        ),
+        'acl' => true,
+        'cache' => false,
+    );
+}
index 23fd025..1b91e05 100644 (file)
@@ -47,7 +47,7 @@
  <configtab name="server" desc="Server">
   <configsection name="server">
    <configswitch name="server_list" desc="Should we display a list of servers
-   (defined in config/servers.php) for users to choose from? The options are
+   (defined in config/backends.php) for users to choose from? The options are
    'shown', 'hidden', and 'none'. If the server list is hidden then you can use
    the 'preferred' mechanism to auto-select from it based on an HTTP
    virtualhost or another piece of data. If it is shown, the user will be able
index 771bdd0..337ae4f 100644 (file)
@@ -21,7 +21,7 @@ class IMP_Hooks
      * IMP uses the following credentials:
      *   'password' - (string) The password for mail server authentication.
      *   'server' - (string) [optional] Use this server key (see
-     *              config/servers.php).
+     *              config/backends.php).
      *   'transparent' - (boolean) If $credentials['authMethod'] is
      *                   'transparent', and you would like IMP to use
      *                   the userId/credentials generated in the
@@ -601,7 +601,7 @@ class IMP_Hooks
     /**
      * Determine quota for a user.
      *
-     * @param array $params  Parameters for the function, set in servers.php.
+     * @param array $params  Parameters for the function, set in backends.php.
      *
      * @return array  Tuple with two members:
      * <pre>
diff --git a/imp/config/servers.php.dist b/imp/config/servers.php.dist
deleted file mode 100644 (file)
index b4c0b55..0000000
+++ /dev/null
@@ -1,400 +0,0 @@
-<?php
-/**
- * This file specifies which mail servers people using your installation of
- * IMP can login to.
- *
- * Properties that can be set for each server:
- *
- * name: (string) This is the name displayed in the server list on the login
- *       screen.
- *
- * hostspec: (string) The hostname/IP address of the mail server to connect to.
- *
- * hordeauth: (mixed) One of the following values:
- *              true - IMP will attempt to use the user's existing credentials
- *                     (the username/password they used to log in to Horde) to
- *                     login to this source.
- *              false - Everything after and including the first @ in the
- *                      username will be stripped off before attempting
- *                      authentication. (DEFAULT)
- *              'full' - The username will be used unmodified.
- *
- * protocol: (string) The server protocol. Either 'pop' or 'imap'.
- *
- *           'imap' requires a IMAP4rev1 (RFC 3501) compliant server
- *           (DEFAULT).
- *
- *           'pop' requires a POP3 (RFC 1939) compliant server. All folder
- *           options will be automatically turned off (POP3 does
- *           not support folders).  Other advanced functions will also be
- *           disabled (e.g. caching, searching, sorting).
- *
- * secure: (mixed) Transport security used for connection to the server. One
- *         of the following values:
- *           'ssl' - Use SSL to connect to the server.
- *           'tls' - Use TLS to connect to the server.
- *           false - Do not use any encryption (DEFAULT).
- *
- *         The 'ssl' and 'tls' options will only work if you've compiled PHP
- *         with SSL support and the mail server supports secure connections.
- *
- *         The use of 'ssl' is STRONGLY DISCOURAGED. If a secure connection
- *         is needed, 'tls' should be used and the connection should be made
- *         to the base protocol port (110 for POP3, 143 for IMAP).
- *
- * port: (integer) The port that the mail service/protocol you selected runs
- *       on. Default values:
- *         imap (unsecure or w/TLS):  143
- *         imap (w/SSL):              993 (DISCOURAGED - use TLS on port 143)
- *         pop (unsecure or w/TLS):   110
- *         pop (w/SSL):               995 (DISCOURAGED - use TLS on port 110)
- *
- * maildomain: (string) What to put after the @ when sending mail. This
- *             setting is generally useful when the sending host is different
- *             from the mail receiving host. This setting will also be used to
- *             complete unqualified addresses when composing mail.
- *             E.g. If you want all mail to look like 'From:
- *             user@example.com', set maildomain to 'example.com'.
- *
- * smtphost: (string) If specified, and $conf['mailer']['type'] is set to
- *           'smtp', IMP will use this host for outbound SMTP connections.
- *           This value overrides any existing
- *           $conf['mailer']['params']['host'] value at runtime.
- *
- * smtpport: (integer) If specified, and $conf['mailer']['type'] is set to
- *           'smtp', IMP will use this port for outbound SMTP connections.
- *           This value overrides any existing
- *           $conf['mailer']['params']['port'] value at runtime.
- *
- * admin: (array) Use this if you want to enable mailbox management for
- *        administrators via Horde's user administration interface.  The
- *        mailbox management gets enabled if you let IMP handle the Horde
- *        authentication with the 'application' authentication driver.  Your
- *        IMAP server needs to support mailbox management via IMAP commands.
- *        Do not define this value if you do not want mailbox management.
- *
- *        The following parameters are available (defined in 'params'):
- *        'admin_user' - The admin user.
- *        'admin_password' - The admin user's password.
- *        'userhierarchy' - The hierarchy where user mailboxes are stored.
- *
- * acl: (boolean) Set to true if you want to use Access Control Lists (mailbox
- *      sharing). Set to false to disable (DEFAULT). Not all IMAP servers
- *      support this feature.
- *
- * cache: (mixed) Enables caching for the server. This requires configuration
- *        of a Horde_Cache driver in Horde. Will be disabled on any empty
- *        value and enabled on any non-false value.
- *
- *        Caching is HIGHLY RECOMMENDED. There is no reason not to cache if
- *        the IMAP server supports the CONDSTORE and/or QRESYNC IMAP
- *        extensions. If the server does not support these extensions, any
- *        flags changed by another mail agent while the IMP session is active
- *        will not be updated. If IMP will be the exclusive method of
- *        accessing the IMAP server, or you do not care about this behavior,
- *        caching should be enabled on these servers.
- *
- *        The following optional configuration items are available:
- *          'compress' - (string) Should the contents of the cache files be
- *                       compressed before they are stored? This results in
- *                       reduced memory usage when retrieving the data at the
- *                       expense of slightly increased CPU usage. Either
- *                       false (no compression - DEFAULT), 'gzip' or 'lzf'.
- *                       'gzip' provides greater compression, and is generally
- *                       built into PHP, but is slower. 'lzf' requires
- *                       installation of a separate PECL module and provides
- *                       less compression but is extremely fast (within 5% of
- *                       regular string operations).  If available, 'lzf' is
- *                       HIGHLY RECOMMENDED.
- *          'lifetime' - (integer) The lifetime, in seconds, of the cached
- *                       data.
- *          'slicesize' - (integer) The number of messages stored in each
- *                        cache slice.  The default should be fine for most
- *                        installations.
- *
- * 'debug' - (string) If set, will output debug information from the IMAP
- *           library. The value can be any PHP supported wrapper that can be
- *           opened via fopen(). This setting should not be enabled by default
- *           on production servers, since the log file will quickly grow very
- *           large.
- *
- *           For example, to output to a file, provide the full path to the
- *           file (a bare string is interpreted by PHP to be a filename). This
- *           file must be writable by the PHP process.
- *
- *           To restrict logging to a certain user ('foo'), and to log this
- *           output to the file '/tmp/imaplog', the following can be used:
- *
- *             (($GLOBALS['registry']->getAuth() == 'foo') ? '/tmp/imaplog' : false)
- *
- * quota: (array) Use this if you want to display a user's quota status on
- *        various IMP pages. Set to an empty value to disable quota status
- *        (DEFAULT).
- *
- *        The entry is configured as follows:
- *
- *          'quota' => array(
- *              // Driver name: see below
- *              'driver' => [string] (REQUIRED),
- *              'params' => array(
- *                  // True if you want to hide quota output when the server
- *                  // reports an unlimited quota.
- *                  'hide_when_unlimited' => true | false,
- *
- *                  // What storage unit the quota messages should be
- *                  // displayed in.
- *                  'unit' => 'GB' | 'MB' (DEFAULT) | 'KB',
- *
- *                  // Output format: see below.
- *                  'format' => array(),
- *
- *                  // Additional driver parameters: see below.
- *              )
- *          )
- *
- *        'driver'/'params' can be the following:
- *
- *           DRIVER: 'command'
- *                   Use the UNIX quota command to handle quotas.
- *           PARAMS: 'quota_path' - [string] Path to the quota binary
- *                                  (REQUIRED)
- *                   'grep_path' - [string] Path to the grep binary (REQUIRED)
- *                   'partition' - [string] If all user mailboxes are on a
- *                                 single partition, the partition label. By
- *                                 default, quota will determine quota
- *                                 information using the user's home directory
- *                                 value.
- *
- *           DRIVER: 'hook'
- *                   Use the quota hook to handle quotas (see
- *                   imp/config/hooks.php).
- *           PARAMS: 'params' - [array] Parameters to pass to the quota
- *                              hook function.
- *
- *           DRIVER: 'imap'
- *                   Use the IMAP QUOTA extension to handle quotas.
- *                   You must be connecting to a IMAP server capable of the
- *                   QUOTAROOT command to use this driver. This is the
- *                   RECOMMENDED way of handling quotas if the IMAP server
- *                   supports it.
- *           PARAMS: NONE
- *
- *           DRIVER: 'maildir'
- *                   Use Maildir++ quota files to handle quotas.
- *           PARAMS: 'msg_count' - [boolean] Display information on the
- *                                 message limit rather than the storage
- *                                 limit? The storage limit information is
- *                                 displayed by default.
- *                   'path' - [string] The path to the user's Maildir
- *                            directory. You may use the two-character
- *                            sequence "~U" to represent the user's account
- *                            name, and the actual username will be
- *                            substituted in that location. E.g.,
- *                            '/home/~U/Maildir/' or '/var/mail/~U/Maildir/'.
- *
- *           DRIVER: 'mdaemon'
- *                    Use Mdaemon servers to handle quotas.
- *           PARAMS: 'app_location' - [string] Location of the application.
- *
- *           DRIVER: 'mercury32'
- *                   Use Mercury/32 servers to handle quotas.
- *           PARAMS: 'mail_user_folder' - [string] The path to folder mail
- *                   mercury.
- *
- *           DRIVER: 'sql'
- *                   Use arbitrary SQL queries to handle quotas.
- *           PARAMS: 'query_quota' - (string) SQL query which returns single
- *                   row/column with user quota (in bytes). %u is replaced
- *                   with current user name, %U with the user name without the
- *                   domain part, %d with the domain.
- *                   'query_used' - (string) SQL query which returns single
- *                   row/column with user used space (in bytes). Placeholders
- *                   are the same like in query_quota.
- *
- *                   Additionally, the driver takes SQL connection parameters
- *                   'phptype', 'hostspec',' 'username', 'password', and
- *                   'database'. See horde/config/conf.php for further
- *                   information on these parameters. If using the Horde DB,
- *                   these parameters can be found in the
- *                   $GLOBALS['conf']['sql'] variable and may be merged into
- *                   the parameter configuration like this:
- *
- *                     'params' => array_merge(
- *                         $GLOBALS['conf']['sql'],
- *                         array(
- *                             'query_quota' => [...],
- *                             'query_used' => [...],
- *                         )
- *                     )
- *
- *        The optional 'format' parameter is supported by all drivers and
- *        specifies the formats of the quota messages in the user
- *        interface. The parameter must be specified as a hash with the four
- *        possible elements 'long', 'short', 'nolimit_long', and
- *        'nolimit_short'. The strings will be passed through sprintf().
- *        These are the built-in default values, though they may appear
- *        differently in some translations ([UNIT] will be replaced with the
- *        value of the 'unit' parameter):
- *          'long'          - Quota status: %.2f [UNIT] / %.2f [UNIT] (%.2f%%)
- *          'nolimit_long'  - Quota status: %.2f [UNIT] / NO LIMIT
- *          'short'         - %.0f%% of %.0f [UNIT]
- *          'nolimit_short' - %.0f [UNIT]
- *
- *
- * *** The following options should NOT be set unless you REALLY know what ***
- * *** you are doing! FOR MOST PEOPLE, AUTO-DETECTION OF THESE PARAMETERS  ***
- * *** (the default if the parameters are not set) SHOULD BE USED!         ***
- *
- * capability_ignore: (array) A list of IMAP capabilites to ignore, even if
- *                    they are supported on the server. This capability names
- *                    should be in all capitals. This option may be useful,
- *                    for example, if it is known that a certain capability is
- *                    buggy on the given server.  Otherwise, all available
- *                    and supported IMAP capabilities will be (and should be)
- *                    used. (IMAP only)
- *
- * comparator: (string) The search comparator to use instead of the default
- *             IMAP server comparator. See RFC 4790 [3.1] - "collation-id" -
- *             for the format. Your IMAP server must support the I18NLEVEL
- *             extension for this setting to have an effect. By default,
- *             the server default comparator is used. (IMAP only)
- *
- * id: (array) Send ID information to the IMAP server. This must be an array
- *     with the keys being the fields to send and the values being the
- *     associated values. Your IMAP server must support the ID extension for
- *     this setting to have an effect. See RFC 2971 [3.3] for a list of
- *     defined field values. (IMAP only)
- *
- * lang: (array) A list of languages (in priority order) to be used to display
- *       human readable messages returned by the IMAP server. Your IMAP server
- *       must support the LANGUAGE extensions for this setting to have an
- *       effect. By default, IMAP messages are output in the IMAP server
- *       default language. (IMAP only)
- *
- * namespace: (array) The list of namespaces that exist on the server. The
- *            entries must be encoded in the UTF7-IMAP charset. Example:
- *
- *              array('#shared/', '#news/', '#public/')
- *
- *            This parameter should only be used if you want to allow access
- *            to namespaces that may not be publicly advertised by the IMAP
- *            server (see RFC 2342 [3]). These additional namespaces will be
- *            ADDED to the list of available namespaces returned by the
- *            server. (IMAP only)
- *
- * preferred: (string | array) Useful if you want to use the same servers.php
- *            file for different machines. If the hostname of the IMP machine
- *            is identical to one of those in the preferred list, then that
- *            entry will be selected by default on the login screen. Otherwise
- *            the first entry in the list is selected.
- *
- * thread: (string) Set the preferred thread sort algorithm. This algorithm
- *         must be supported by the remote server. By default, IMP attempts
- *         to use REFERENCES sorting and, if this is not available, it will
- *         fall back to ORDEREDSUBJECT sorting done on the local server.
- *
- * timeout: (integer) Set the server timeout (in seconds).
- *
- *
- * $Id$
- */
-
-/* Any entries whose key value ('foo' in $servers['foo']) begin with '_'
- * (an underscore character) will be treated as prompts, and you won't be
- * able to log in to them. The only property these entries need is 'name'.
- * This lets you put labels in the list, like this example: */
-$servers['_prompt'] = array(
-    'name' => _("Choose a mail server:")
-);
-
-/* Example configurations: */
-
-$servers['imap'] = array(
-    'name' => 'IMAP Server',
-    'hostspec' => 'imap.example.com',
-    'hordeauth' => false,
-    'protocol' => 'imap',
-    'port' => 143,
-    'secure' => false,
-    'maildomain' => 'example.com',
-    'smtphost' => 'smtp.example.com',
-    'smtpport' => 25,
-    'cache' => false,
-);
-
-$servers['cyrus'] = array(
-    'name' => 'Cyrus IMAP Server',
-    'hostspec' => 'cyrus.example.com',
-    'hordeauth' => false,
-    'protocol' => 'imap',
-    'port' => 143,
-    'secure' => false,
-    'maildomain' => 'example.com',
-    'smtphost' => 'smtp.example.com',
-    'smtpport' => 25,
-    'admin' => array(
-        'params' => array(
-            'admin_user' => 'cyrus',
-            'admin_password' => 'cyrus_pass',
-            'userhierarchy' => 'user.'
-        ),
-    ),
-    'quota' => array(
-        'driver' => 'imap',
-        'params' => array(
-            'hide_when_unlimited' => true,
-            'unit' => 'MB'
-        )
-    ),
-    'acl' => true,
-    'cache' => false,
-);
-
-$servers['pop'] = array(
-    'name' => 'POP3 Server',
-    'hostspec' => 'pop.example.com',
-    'hordeauth' => false,
-    'protocol' => 'pop3',
-    'port' => 110,
-    'secure' => false,
-    'maildomain' => 'example.com',
-    'smtphost' => 'smtp.example.com',
-    'smtpport' => 25,
-    'cache' => false,
-);
-
-$servers['secure-imap'] = array(
-    'name' => 'Secure IMAP Server',
-    'hostspec' => 'imap.example.com',
-    'hordeauth' => false,
-    'protocol' => 'imap',
-    'port' => 143,
-    'secure' => 'tls',
-    'maildomain' => 'example.com',
-    'smtphost' => 'smtp.example.com',
-    'smtpport' => 25,
-    'acl' => false,
-    'cache' => false,
-);
-
-if ($GLOBALS['conf']['kolab']['enabled']) {
-    require_once 'Horde/Kolab.php';
-    $servers['kolab'] = array(
-        'name' => 'Kolab Cyrus IMAP Server',
-        'hostspec' => Kolab::getServer('imap'),
-        'hordeauth' => 'full',
-        'protocol' => 'imap',
-        'port' => $GLOBALS['conf']['kolab']['imap']['port'],
-        'secure' => false,
-        'maildomain' => $GLOBALS['conf']['kolab']['imap']['maildomain'],
-        'quota' => array(
-            'driver' => 'imap',
-            'params' => array(
-                'hide_quota_when_unlimited' => true,
-                'unit' => 'MB'
-            )
-        ),
-        'acl' => true,
-        'cache' => false,
-    );
-}
index 6aec7d4..4720b6d 100644 (file)
@@ -2,6 +2,7 @@
 v5.0-git
 --------
 
+[jan] Rename servers.php to backends.php.
 [mms] Use alternate text part to generate reply/forward text when switching
       compose modes if user has not altered message text (DIMP).
 [mms] Improved login error reporting/logging in IMP (Request #9211).
index 8288691..57fe3ca 100644 (file)
@@ -292,10 +292,10 @@ Configuring IMP
    and behavior.  With the following exception, the defaults will be correct
    for most sites.
 
-   a. servers.php
+   a. backends.php
 
       You must be sure to list your IMAP/POP3 server names and configuration
-      information in ``servers.php``.
+      information in ``backends.php``.
 
    You must login to Horde as a Horde Administrator to finish the
    configuration of IMP.  Use the Horde ``Administration`` menu item to get to
@@ -372,7 +372,7 @@ Configuring IMP
    The test script will also allow you to test your connection to the mail
    server and provide some auto-detected configuration parameters that can
    then be inserted into the server configuration located in
-   ``imp/config/servers.php``.
+   ``imp/config/backends.php``.
 
    Next, use IMP to login to a known working IMAP or POP3 server.  Test at
    least the following:
index f288197..62b8de7 100644 (file)
@@ -98,7 +98,7 @@ All code relating to fetchmail has been removed (TODO: prefs/config?).
 Server configuration
 --------------------
 
-The format of servers.php has changed.
+The format of servers.php has changed and is renamed to backends.php.
 
 
 Maintenance Tasks
index 84c7e15..2cb784a 100644 (file)
@@ -23,7 +23,7 @@ class IMP_Auth
      *                            attempts to login to the cached session.
      * <pre>
      * 'password' - (string) The user password.
-     * 'server' - (string) The server key to use (from servers.php).
+     * 'server' - (string) The server key to use (from backends.php).
      * 'userId' - (string) The username.
      * </pre>
      *
@@ -182,7 +182,7 @@ class IMP_Auth
      *          namespace, quota, thread)
      * 'imap_ob' - (array) The serialized Horde_Imap_Client objects. Stored
      *             by server key.
-     * 'maildomain' - (string) See config/servers.php.
+     * 'maildomain' - (string) See config/backends.php.
      * 'notepadavail' - (boolean) Is listing of notepads available?
      * 'protocol' - (string) Either 'imap' or 'pop'.
      * 'rteavail' - (boolean) Is the HTML editor available?
@@ -199,7 +199,7 @@ class IMP_Auth
      * @param array $credentials  An array of login credentials.
      * <pre>
      * 'password' - (string) The user password.
-     * 'server' - (string) The server key to use (from servers.php).
+     * 'server' - (string) The server key to use (from backends.php).
      * 'userId' - (string) The username.
      * </pre>
      *
index b42b93c..7974db9 100644 (file)
@@ -412,7 +412,7 @@ class IMP_Imap
     /* Static methods. */
 
     /**
-     * Loads the IMP server configuration from servers.php.
+     * Loads the IMP server configuration from backends.php.
      *
      * @param string $server  Returns this labeled entry only.
      *
@@ -422,7 +422,7 @@ class IMP_Imap
     static public function loadServerConfig($server = null)
     {
         try {
-            $servers = Horde::loadConfiguration('servers.php', 'servers', 'imp');
+            $servers = Horde::loadConfiguration('backends.php', 'servers', 'imp');
             if ($servers === null) {
                 $servers = false;
             }
index 6a07813..64a7140 100644 (file)
@@ -3,7 +3,7 @@
  * Implementation of IMP_Quota API for a generic hook function.  This
  * requires the quota hook to be set in config/hooks.php.
  *
- * You must configure this driver in imp/config/servers.php.  The driver
+ * You must configure this driver in imp/config/backends.php.  The driver
  * supports the following parameters:
  * <pre>
  * 'params' - (array) Parameters to pass to the quota function.
index ddd4f70..dbc1371 100644 (file)
@@ -53,7 +53,7 @@ class IMP_Test extends Horde_Test
         'config/conf.php' => 'The file <code>./config/conf.php</code> appears to be missing. You must generate this file as an administrator via Horde.  See horde/docs/INSTALL.',
         'config/mime_drivers.php' => null,
         'config/prefs.php' => null,
-        'config/servers.php' => null
+        'config/backends.php' => null
     );
 
     /**
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/luxor/config/backends.php.dist b/luxor/config/backends.php.dist
new file mode 100644 (file)
index 0000000..9589c52
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+/**
+ * This file contains all the configuration information for the various
+ * sources to display. The following fields are defined:
+ *
+ * 'name'          : Short name for the repository
+ *
+ * 'driver'        : The driver to use when accessing this source. Currently
+ *                   only 'plain' is implemented, eventually 'cvs' will be
+ *                   supported as well.
+ *
+ * 'root'          : Location on the filesystem of the source
+ *
+ * 'restrictions'  : Array of perl-style regular expressions for those files
+ *                   whose contents should be protected and not displayed.
+ *
+ * $Id$
+ */
+
+$sources['horde'] = array(
+    'name' => 'Horde',
+    'driver' => 'plain',
+    'root' => dirname(__FILE__) . '/../../',
+    'restrictions' => array('(.*)config/(\w*).php$')
+);
+
+$sources['pear'] = array(
+    'name' => 'PEAR',
+    'driver' => 'plain',
+    'root' => '/usr/local/lib/php/'
+);
diff --git a/luxor/config/sources.php.dist b/luxor/config/sources.php.dist
deleted file mode 100644 (file)
index 695970f..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
- * $Horde: luxor/config/sources.php.dist,v 1.7 2005/10/13 12:21:09 jan Exp $
- *
- * This file contains all the configuration information for the various
- * sources to display. The following fields are defined:
- *
- * 'name'          : Short name for the repository
- *
- * 'driver'        : The driver to use when accessing this source. Currently
- *                   only 'plain' is implemented, eventually 'cvs' will be
- *                   supported as well.
- *
- * 'root'          : Location on the filesystem of the source
- *
- * 'restrictions'  : Array of perl-style regular expressions for those files
- *                   whose contents should be protected and not displayed.
-*/
-
-$sources['horde'] = array(
-    'name' => 'Horde',
-    'driver' => 'plain',
-    'root' => dirname(__FILE__) . '/../../',
-    'restrictions' => array('(.*)config/(\w*).php$')
-);
-
-$sources['pear'] = array(
-    'name' => 'PEAR',
-    'driver' => 'plain',
-    'root' => '/usr/local/lib/php/'
-);
index 8ec9668..3b7be9a 100644 (file)
@@ -2,6 +2,7 @@
 v0.1
 ----
 
+[jan] Rename sources.php to backends.php.
 [ben] Better support for MS-SQL.
 [cjh] Support mod_rewrite style URLs in addition to GET.
 [mas] Change any output of <b> and <i> tags to <strong> and <em> for better
index b9274c6..a68def5 100644 (file)
@@ -13,7 +13,7 @@ class Luxor
     {
         global $sources, $sourceid, $source, $files, $index, $pathname;
 
-        require LUXOR_BASE . '/config/sources.php';
+        require LUXOR_BASE . '/config/backends.php';
 
         /* Default to the first source; overridden elsewhere if necessary. */
         $sourceid = Horde_Util::getFormData('source');
diff --git a/turba/config/backends.php.dist b/turba/config/backends.php.dist
new file mode 100644 (file)
index 0000000..883c9bc
--- /dev/null
@@ -0,0 +1,1104 @@
+<?php
+/**
+ * This file is where you specify the sources of contacts available to users
+ * at your installation. It contains a large number of EXAMPLES. Please
+ * remove or comment out those examples that YOU DON'T NEED. There are a
+ * number of properties that you can set for each server, including:
+ *
+ * title:       This is the common (user-visible) name that you want displayed
+ *              in the contact source drop-down box.
+ *
+ * type:        The types 'ldap', 'sql', 'imsp', 'group', 'favourites' and
+ *              'prefs' are currently supported. Preferences-based address
+ *              books are not intended for production installs unless you
+ *              really know what you're doing - they are not searchable, and
+ *              they won't scale well if a user has a large number of entries.
+ *
+ * params:      These are the connection parameters specific to the contact
+ *              source. See below for examples of how to set these.
+ *
+ * Special params settings:
+ *
+ *   charset:       The character set that the backend stores data in. Many
+ *                  LDAP servers use utf-8. Database servers typically use
+ *                  iso-8859-1.
+ *
+ *   tls:           Only applies to LDAP servers. If true, then try to use a
+ *                  TLS connection to the server.
+ *
+ *   scope:         Only applies to LDAP servers. Can be set to 'one' to
+ *                  search one level of the LDAP directory, or 'sub' to search
+ *                  all levels. 'one' will work for most setups and should be
+ *                  much faster. However we default to 'sub' for backwards
+ *                  compatibility.
+ *
+ *   checkrequired: Only applies to LDAP servers. If present, this value causes
+ *                  the driver to consult the LDAP schema for any attributes
+ *                  that are required by the given objectclass(es). Required
+ *                  attributes will be provided automatically if the
+ *                  'checkrequired_string' parameter is present.
+ *                  *NOTE* You must have the Net_LDAP PEAR library installed
+ *                  for this to work.
+ *
+ *   checksyntax:   Only applies to LDAP servers. If present, this value causes
+ *                  the driver to inspect the LDAP schema for particular
+ *                  attributes by the type defined in the corresponding schema
+ *                  *NOTE* You must have the Net_LDAP PEAR library installed
+ *                  for this to work.
+ *
+ *   deref:         Only applies to LDAP servers. If set, should be one of:
+ *                    LDAP_DEREF_NEVER
+ *                    LDAP_DEREF_SEARCHING
+ *                    LDAP_DEREF_FINDING
+ *                    LDAP_DEREF_ALWAYS
+ *                  This tells the LDAP server when to dereference
+ *                  aliases. See http://www.php.net/ldap for more
+ *                  information.
+ *
+ *   dn:            Only applies to LDAP servers. Defines the list of LDAP
+ *                  attributes that build a valid DN.
+ *
+ *   root:          Only applies to LDAP servers. Defines the base DN where to
+ *                  start the search, i.e. dc=example,dc=com.
+ *
+ *   bind_dn:       Only applies to LDAP servers which do not allow anonymous
+ *                  connections. Active Directory servers do not allow it by
+ *                  default, so before using one as a Turba source, you must
+ *                  create a "rightless" user, which is only allowed to connect
+ *                  to the server, and set the bind_dn parameter like
+ *                  'rightless@example.com' (not cn=rightless,dc=example,dc=com)
+ *
+ *   bind_password: Only applies to LDAP servers which do not allow anonymous
+ *                  connection. You should set this to the cleartext password
+ *                  for the user specified in 'bind_dn'.
+ *
+ *   referrals:     Only applies to LDAP servers. If set, should be 0 or 1.
+ *                  See the LDAP documentation about the corresponding
+ *                  parameter REFERRALS. Windows 2003 Server requires that you
+ *                  set this parameter to 0.
+ *
+ *   sizelimit:     Only applies to LDAP servers. If set, limit the search to
+ *                  the specified number of entries. Value 0 or no value means
+ *                  no limit. Keep in mind that servers can impose their own
+ *                  search limits.
+ *
+ *   objectclass:   Only applies to LDAP servers. Defines a list of
+ *                  objectclasses that contacts must belong to, and that new
+ *                  objects will be created with.
+ *
+ *   filter:        Filter helps to filter your result based on certain
+ *                  condition in SQL and LDAP backends. A filter can be
+ *                  specified to avoid some unwanted data. For example, if the
+ *                  source is an external sql database, to select records with
+ *                  the delete flag = 0: 'filter' => 'deleted=0'.
+ *                  Don't enclose filter in brackets - this will done
+ *                  automatically. Also keep in mind that a full filter line
+ *                  will be built from 'filter' and 'objectclass' parameters.
+ *
+ *   version:       Only applies to LDAP servers. If set, specify LDAP server
+ *                  version, can be 2 or 3. Active Directory servers
+ *                  require version 3.
+ *
+ * map:         This is a list of mappings from the Turba attribute names (on
+ *              the left) to the attribute names by which they are known in
+ *              this contact source (on the right). Turba also supports
+ *              composite fields. A composite field is defined by mapping the
+ *              field name to an array containing a list of component fields
+ *              and a format string (similar to a printf() format string;
+ *              however, note that positioned parameters like %1$s will NOT
+ *              work). 'attribute' defines where the composed value is saved,
+ *              and can be left out. 'parse' defines a list of format strings
+ *              and field names that should be used for splitting up composite
+ *              fields, in the order of precedence, and can be left out. Here
+ *              is an example:
+ *              ...
+ *              'name' => array('fields' => array('firstname', 'lastname'),
+ *                              'format' => '%s %s',
+ *                              'attribute' => 'object_name'),
+ *              'firstname' => 'object_firstname',
+ *              'lastname' => 'object_lastname',
+ *              ...
+ *
+ *              Standard Turba attributes are:
+ *                __key     : A backend-specific ID for the entry (any value
+ *                            as long as it is unique inside that source;
+ *                            required)
+ *                __uid     : Globally unique ID of the entry (used for
+ *                            synchronizing and must be able to be set to any
+ *                            value)
+ *                __owner   : User name of the contact's owner
+ *                __type    : Either 'Object' or 'Group'
+ *                __members : Serialized PHP array with list of Group members.
+ *              More Turba attributes are defined in config/attributes.php.
+ *
+ * tabs:        All fields can be grouped into tabs with this optional entry.
+ *              This list is multidimensional hash, the keys are the tab
+ *              titles.
+ *              Here is an example:
+ *              'tabs' => array(
+ *                  'Names' => array('firstname', 'lastname', 'alias'),
+ *                  'Addresses' => array('homeAddress', 'workAddress')
+ *              );
+ *
+ * search:      A list of Turba attribute names that can be searched for this
+ *              source.
+ *
+ * strict:      A list of native field/attribute names that must
+ *              always be matched exactly in a search.
+ *
+ * approximate: Only applies to LDAP servers. If set, should be an
+ *              array of native field/attribute names to search
+ *              "approximately" (for example, "Sánchez", "Sanchez",
+ *              and "Sanchéz" will all match a search string of
+ *              "sanchez").
+ *
+ * export:      If set to true, this source will appear on the Export menu,
+ *              allowing users to export the contacts to a CSV (etc.) file.
+ *
+ * browse:      If set to true, this source will be browseable via the Browse
+ *              menu item, and empty searches against the source will return
+ *              all contacts.
+ *
+ * use_shares:  If this is present and true, Horde_Share functionality will
+ *              be enabled for this source - allowing users to share their
+ *              personal address books as well as to create new ones. Since
+ *              Turba only supports having one backend configured for
+ *              creating new shares, use the 'shares' configuration option to
+ *              specify which backend will be used for creating new shares.
+ *              All permission checking will be done against Horde_Share, but
+ *              note that any 'extended' permissions (such as max_contacts)
+ *              will still be enforced. Also note that the backend driver
+ *              must have support for using this. Currently SQL and IMSP.
+ *
+ * list_name_field:  If this is present and non-empty, it will be taken as the
+ *                   field to store contact list names in.
+ *                   This is required when using a composite field as the 'name'
+ *                   field.
+ *
+ * alternative_name: If this is present and non-empty, it will be taken as the
+ *                   field to use an alternative in case that the name field is
+ *                   empty.
+ *
+ * Here are some example configurations:
+ *
+ * $Id$
+ */
+
+/**
+ * A local address book in an SQL database. This implements a private
+ * per-user address book. Sharing of this source with other users may be
+ * accomplished by enabling Horde_Share for this source by setting
+ * 'use_shares' => true.
+ *
+ * Be sure to create a turba_objects table in your Horde database from the
+ * schema in turba/scripts/db/turba.sql if you use this source.
+ */
+$cfgSources['localsql'] = array(
+    'title' => _("My Address Book"),
+    'type' => 'sql',
+    // The default connection details are pulled from the Horde-wide SQL
+    // connection configuration.
+    'params' => array_merge($GLOBALS['conf']['sql'], array('table' => 'turba_objects')),
+    // Using two tables as datasource.
+    // 'params' => array_merge($GLOBALS['conf']['sql'],
+    //                         array('table' => 'leaddetails LEFT JOIN leadaddress ON leaddetails.leadid = leadaddress.leadaddressid',
+    //                               'filter' => 'leaddetails.converted = 0')),
+    'map' => array(
+        '__key' => 'object_id',
+        '__owner' => 'owner_id',
+        '__type' => 'object_type',
+        '__members' => 'object_members',
+        '__uid' => 'object_uid',
+        'firstname' => 'object_firstname',
+        'lastname' => 'object_lastname',
+        'middlenames' => 'object_middlenames',
+        'namePrefix' => 'object_nameprefix',
+        'nameSuffix' => 'object_namesuffix',
+        'name' => array('fields' => array('namePrefix', 'firstname',
+                                          'middlenames', 'lastname',
+                                          'nameSuffix'),
+                        'format' => '%s %s %s %s %s',
+                        'parse' => array(
+                            array('fields' => array('firstname', 'middlenames',
+                                                    'lastname'),
+                                  'format' => '%s %s %s'),
+                            array('fields' => array('firstname', 'lastname'),
+                                  'format' => '%s %s'))),
+        // This is a shorter version of a "name" composite field which only
+        // consists of the first name and last name.
+        // 'name' => array('fields' => array('firstname', 'lastname'),
+        //                 'format' => '%s %s'),
+        'alias' => 'object_alias',
+        'birthday' => 'object_bday',
+        // The photo field requires at least Horde 3.3 and a matching type
+        // field.
+        // 'photo' => 'object_photo',
+        // 'phototype' => 'object_phototype',
+        'homeStreet' => 'object_homestreet',
+        'homePOBox' => 'object_homepob',
+        'homeCity' => 'object_homecity',
+        'homeProvince' => 'object_homeprovince',
+        'homePostalCode' => 'object_homepostalcode',
+        'homeCountry' => 'object_homecountry',
+        // This is an example composite field for addresses, so you can display
+        // the various map links. If you use this, be sure to add 'homeAddress'
+        // to the 'tabs' parameter below.
+        // 'homeAddress' => array('fields' => array('homeStreet', 'homeCity',
+        //                                          'homeProvince',
+        //                                          'homePostalCode'),
+        //                        'format' => "%s \n %s, %s  %s"),
+        'workStreet' => 'object_workstreet',
+        'workPOBox' => 'object_workpob',
+        'workCity' => 'object_workcity',
+        'workProvince' => 'object_workprovince',
+        'workPostalCode' => 'object_workpostalcode',
+        'workCountry' => 'object_workcountry',
+        'timezone' => 'object_tz',
+        'email' => 'object_email',
+        'homePhone' => 'object_homephone',
+        'workPhone' => 'object_workphone',
+        'cellPhone' => 'object_cellphone',
+        'fax' => 'object_fax',
+        'pager' => 'object_pager',
+        'title' => 'object_title',
+        'role' => 'object_role',
+        'company' => 'object_company',
+        // The logo field requires at least Horde 3.3 and a matching type
+        // field.
+        // 'logo' => 'object_logo',
+        // 'logotype' => 'object_logotype',
+        'category' => 'object_category',
+        'notes' => 'object_notes',
+        'website' => 'object_url',
+        'freebusyUrl' => 'object_freebusyurl',
+        'pgpPublicKey' => 'object_pgppublickey',
+        'smimePublicKey' => 'object_smimepublickey',
+    ),
+    'tabs' => array(
+        _("Personal") => array('firstname', 'lastname', 'middlenames',
+                               'namePrefix', 'nameSuffix', 'name', 'alias',
+                               'birthday', 'photo'),
+        _("Location") => array('homeStreet', 'homePOBox', 'homeCity',
+                               'homeProvince', 'homePostalCode', 'homeCountry',
+                               'workStreet', 'workPOBox', 'workCity',
+                               'workProvince', 'workPostalCode', 'workCountry',
+                               'timezone'),
+        _("Communications") => array('email', 'homePhone', 'workPhone',
+                                     'cellPhone', 'fax', 'pager'),
+        _("Organization") => array('title', 'role', 'company', 'logo'),
+        _("Other") => array('category', 'notes', 'website', 'freebusyUrl',
+                            'pgpPublicKey', 'smimePublicKey'),
+    ),
+    'search' => array(
+        'name',
+        'email'
+    ),
+    'strict' => array(
+        'object_id',
+        'owner_id',
+        'object_type',
+    ),
+    'export' => true,
+    'browse' => true,
+    'use_shares' => true,
+    'list_name_field' => 'lastname',
+    'alternative_name' => 'company',
+);
+
+/**
+ * A local address book in an LDAP directory. This implements a public
+ * (shared) address book.
+ *
+ * To store distribution lists in the LDAP directory, you'll need to include
+ * horde/scripts/ldap/horde.schema in your LDAP configuration.
+ *
+ * To store freebusy information in the LDAP directory, you'll need to include
+ * turba/scripts/ldap/rfc2739.schema in your LDAP configuration.
+ */
+// $cfgSources['localldap'] = array(
+//     'title' => _("Shared Directory"),
+//     'type' => 'ldap',
+//     'params' => array(
+//         'server' => 'ldap.example.com',
+//         'port' => 389,
+//         'tls' => false,
+//         'root' => 'dc=example,dc=com',
+//         'bind_dn' => 'cn=admin,ou=users,dc=example,dc=com',
+//         // For Active Directory:
+//         // 'bind_dn' => 'username@example.com',
+//         'bind_password' => '********',
+//         'sizelimit' => 200,
+//         // For Active Directory:
+//         // 'sizelimit' => 0,
+//         'dn' => array('cn'),
+//         'objectclass' => array('top',
+//                                'person',
+//                                'organizationalPerson',
+//                                'inetOrgPerson'),
+//                                // Add 'turbaContact' to this array if using
+//                                // 'turbaType' attribute below, and 'calEntry'
+//                                // if using 'freebusyUrl'.
+//         // For Active Directory:
+//         // 'objectclass' => array('organizationalPerson',
+//         //                        'user',
+//         //                        'group',
+//         //                        'contact'),
+//         'scope' => 'one',
+//         // For Active Directory:
+//         // 'scope' => 'sub',
+//         'charset' => 'utf-8',
+//         // Consult the LDAP schema to verify that all required attributes for
+//         // an entry are set and add them if needed.
+//         'checkrequired' => false,
+//         // Value used to fill in missing required attributes.
+//         'checkrequired_string' => ' ',
+//         // Check LDAP schema for valid syntax. If this is false an address
+//         // field is assumed to have postalAddress syntax; otherwise the schema
+//         // is consulted for the syntax to use.
+//         'checksyntax' => false,
+//         'version' => 3,
+//
+//         // For Active Directory you probably want to also set the following
+//         // parameters:
+//         // 'deref' => LDAP_DEREF_ALWAYS,
+//         // 'filter' => '&(SAMAccountName=*)(mail=*)',
+//         // 'referrals' => 0,
+//     ),
+//     'map' => array(
+//         '__key' => 'dn',
+//
+//         // Remove this mapping if using Active Directory server:
+//         '__uid' => 'uid',
+//
+//         // From horde.schema.  Make sure you have 'turbaContact' objectClass
+//         // included above:
+//         // '__type' => 'turbaType',
+//         // '__members' => 'turbaMembers',
+//
+//         'name' => 'cn',
+//         'email' => 'mail',
+//         'homePhone' => 'homephone',
+//         'workPhone' => 'telephonenumber',
+//         'cellPhone' => 'mobiletelephonenumber',
+//         'homeAddress' => 'homepostaladdress',
+//
+//         // From rfc2739.schema:
+//         // 'freebusyUrl' => 'calFBURL',
+//
+//         // For Active Directory servers:
+//         // 'name' => 'displayname',
+//         // 'title' => 'title',
+//         // 'cellPhone' => 'mobile',
+//         // 'department' => 'department',
+//         // 'company' => 'company',
+//     ),
+//     'search' => array(
+//         'name',
+//         'email',
+//         'homePhone',
+//         'workPhone',
+//         'cellPhone',
+//         'homeAddress'
+//     ),
+//     'strict' => array(
+//         'dn',
+//     ),
+//     'approximate' => array(
+//         'cn',
+//     ),
+//     // For Active Directory servers:
+//     // 'approximate' => array(
+//     //     'displayname',
+//     //     'samaccountname',
+//     // ),
+//     'export' => true,
+//     'browse' => true,
+// );
+
+/**
+ * A personal LDAP address book. This assumes that the login is
+ * <username>@domain.com and that the users are stored on the same LDAP
+ * server. Thus it is possible to bind with the username and password from the
+ * user. For more info; please refer to the docs/LDAP file in the Turba
+ * distribution.
+ *
+ * To store distribution lists in the LDAP directory, you'll need to include
+ * horde/scripts/ldap/horde.schema in your LDAP configuration.
+ *
+ * To store freebusy information in the LDAP directory, you'll need to include
+ * turba/scripts/ldap/rfc2739.schema in your LDAP configuration.
+ */
+/* First we need to get the uid. */
+// $_ldap_uid = $GLOBALS['registry']->getAuth('bare');
+// $_ldap_basedn = 'dc=example,dc=com';
+// $cfgSources['personal_ldap'] = array(
+//     'title' => _("My Address Book"),
+//     'type' => 'ldap',
+//     'params' => array(
+//         'server' => 'localhost',
+//         'tls' => false,
+//         'root' => 'ou=' . $_ldap_uid . ',ou=personal_addressbook,' . $_ldap_basedn,
+//         'bind_dn' => 'uid=' . $_ldap_uid . ',ou=People,' . $_ldap_basedn,
+//         'bind_password' => $GLOBALS['registry']->getAuthCredential('password'),
+//         'dn' => array('uid'),
+//         'objectclass' => array('top',
+//                                'person',
+//                                // 'turbaContact',
+//                                'inetOrgPerson',
+//                                // 'calEntry',
+//                                'organizationalPerson'),
+//         'scope' => 'one',
+//         'charset' => 'utf-8',
+//         'version' => 3
+//     ),
+//     'map' => array(
+//         '__key' => 'dn',
+//         '__uid' => 'uid',
+//
+//         // From horde.schema:
+//         // '__type' => 'turbaType',
+//         // '__members' => 'turbaMembers',
+//
+//         'name' => 'cn',
+//         'email' => 'mail',
+//         'lastname' => 'sn',
+//         'title' => 'title',
+//         'company' => 'organizationname',
+//         'businessCategory' => 'businesscategory',
+//         'workAddress' => 'postaladdress',
+//         'workPostalCode' => 'postalcode',
+//         'workPhone' => 'telephonenumber',
+//         'fax' => 'facsimiletelephonenumber',
+//         'homeAddress' => 'homepostaladdress',
+//         'homePhone' => 'homephone',
+//         'cellPhone' => 'mobile',
+//         'notes' => 'description',
+//
+//         // Evolution interopt attributes: (those that do not require the
+//         // evolution.schema)
+//         'office' => 'roomNumber',
+//         'department' => 'ou',
+//         'nickname' => 'displayName',
+//         'website' => 'labeledURI',
+//
+//         // These are not stored on the LDAP server.
+//         'pgpPublicKey' => 'object_pgppublickey',
+//         'smimePublicKey' => 'object_smimepublickey',
+//
+//         // From rfc2739.schema:
+//         // 'freebusyUrl' => 'calFBURL',
+//     ),
+//     'search' => array(
+//         'name',
+//         'email',
+//         'businessCategory',
+//         'title',
+//         'homePhone',
+//         'workPhone',
+//         'cellPhone',
+//         'homeAddress'
+//     ),
+//     'strict' => array(
+//         'dn',
+//     ),
+//     'approximate' => array(
+//         'cn',
+//     ),
+//     'export' => true,
+//     'browse' => true,
+// );
+
+/**
+ * Public netcenter and verisign LDAP directories.
+ */
+// $cfgSources['netcenter'] = array(
+//     'title' => _("Netcenter Member Directory"),
+//     'type' => 'ldap',
+//     'params' => array(
+//         'server' => 'memberdir.netscape.com',
+//         'port' => 389,
+//         'tls' => false,
+//         'root' => 'ou=member_directory,o=netcenter.com',
+//         'dn' => array('cn'),
+//         'objectclass' => 'person',
+//         'filter' => '',
+//         'scope' => 'sub',
+//         'charset' => 'iso-8859-1'
+//     ),
+//     'map' => array(
+//         '__key' => 'dn',
+//         'name' => 'cn',
+//         'email' => 'mail',
+//         'alias' => 'givenname'
+//     ),
+//     'search' => array(
+//         'name',
+//         'email',
+//         'alias'
+//     ),
+//     'strict' => array(
+//         'dn'
+//     ),
+//     'approximate' => array(
+//         'cn',
+//     ),
+//     'export' => false,
+//     'browse' => false,
+// );
+//
+// $cfgSources['verisign'] = array(
+//     'title' => _("Verisign Directory"),
+//     'type' => 'ldap',
+//     'params' => array(
+//         'server' => 'directory.verisign.com',
+//         'port' => 389,
+//         'tls' => false,
+//         'root' => '',
+//         'scope' => 'sub',
+//         'charset' => 'iso-8859-1'
+//     ),
+//     'map' => array(
+//         '__key' => 'dn',
+//         'name' => 'cn',
+//         'email' => 'mail'
+//     ),
+//     'search' => array(
+//         'name',
+//         'email'
+//     ),
+//     'strict' => array(
+//         'dn'
+//     ),
+//     'approximate' => array(
+//         'cn',
+//     ),
+//     'export' => false,
+//     'browse' => false,
+// );
+
+/**
+ * A preferences-based address book. This will always be private. You can add
+ * any attributes you like to the map and it will just work; you can also
+ * create multiple prefs-based address books by changing the 'name' parameter.
+ * This is best for address books that are expected to remain small; it's not
+ * the most efficient, but it can't be beat for getting up and running
+ * quickly, especially if you already have Horde preferences working. Note
+ * that it is not searchable, though - searches will simply return the whole
+ * address book.
+ */
+// $cfgSources['prefs'] = array(
+//     'title' => _("Private Address Book"),
+//     'type' => 'prefs',
+//     'params' => array(
+//         'name' => 'prefs',
+//         'charset' => $GLOBALS['registry']->getCharset()
+//     ),
+//     'map' => array(
+//         '__key' => 'id',
+//         '__type' => '_type',
+//         '__members' => '_members',
+//         '__uid' => 'uid',
+//         'name' => 'name',
+//         'email' => 'mail',
+//         'alias' => 'alias'
+//     ),
+//     'search' => array(
+//         'name',
+//         'email',
+//         'alias'
+//     ),
+//     'strict' => array(
+//         'id',
+//         '_type',
+//     ),
+//     'export' => true,
+//     'browse' => true,
+// );
+
+/**
+ * An address book based on message recipients. This will always be private and
+ * read-only. The address book content is provided by the
+ * contacts/favouriteRecipients API method which should be implemented by a
+ * mail client that collects the most regular message recipients, like IMP
+ * 4.2.
+ */
+$cfgSources['favourites'] = array(
+    'title' => _("Favourite Recipients"),
+    'type' => 'favourites',
+    'params' => array(
+        'limit' => 10
+    ),
+    'map' => array(
+        '__key' => 'email',
+        'name' => 'email',
+        'email' => 'email'
+    ),
+    'search' => array(
+        'name',
+        'email'
+    ),
+    'strict' => array(
+        'id',
+    ),
+    'export' => true,
+    'browse' => true,
+);
+
+/**
+ * A driver to show a user's Facebook friends as a turba address book. Some
+ * data (like email) is not readily available via the API, but other data, like
+ * birthdays (which will show up via the listTimeObjects API) may still be
+ * useful to some
+ */
+//$cfgSources['facebook'] = array(
+//    'title' => _("Facebook Friends"),
+//    'type' => 'facebook',
+//    'params' => array(
+//        'limit' => 10
+//    ),
+//   'map' => array(
+//        '__key' => 'uid',
+//        'name' => 'name',
+//        'lastname' => 'last_name',
+//        'firstname' => 'first_name',
+//        'email' => 'proxied_email',
+//        'birthday' => 'birthday',
+//        'homeCity' => 'current_location.city',
+//        'homeProvince' => 'current_location.state',
+//        'homePostalCode' => 'current_location.zip',
+//        'homeCountry' => 'current_location.country',
+//   ),
+//    'search' => array(
+//        'name',
+//        'email',
+//    ),
+//    'export' => true,
+//    'browse' => true,
+//);
+
+/**
+ * This source creates an address book for each group the current user is a
+ * member in.  The address book will always be read only, and the group members
+ * must have an email address entered in their default identity.  No email
+ * address will result in that member not being included in the address book.
+ */
+//$grpSource = array(
+//    'title' => _("Group"),
+//    'type' => 'group',
+//    'params' => array(
+//       'name' => ''
+//    ),
+//    'map' => array(
+//        '__key' => 'email',
+//        'name' => 'name',
+//        'email' => 'email'
+//    ),
+//    'search' => array(
+//        'name',
+//        'email'
+//    ),
+//    'export' => true,
+//    'browse' => true,
+//);
+
+//$_group_driver = &Group::singleton();
+//$_group_list = $_group_driver->getGroupMemberships($GLOBALS['registry']->getAuth());
+//foreach ($_group_list as $_group_id => $_group_name) {
+//    $cfgSources['group_' . $_group_id] = $grpSource;
+//    $cfgSources['group_' . $_group_id]['params'] = array('gid' => $_group_id);
+//    $cfgSources['group_' . $_group_id]['title'] = $_group_name;
+//}
+
+/**
+ * IMSP based address book.
+ *
+ * Communicates with an IMSP backend server.
+ *
+ * Notes:
+ * You should configure the user's "main" address book here. The name of the
+ * address book is set in the 'name' element of the params array. It should
+ * be configured to be the same as the IMSP server username. Any other
+ * address books the user has access to will automatically be configured at
+ * runtime.
+ *
+ * In the params array, accepted values for auth_method are 'cram_md5',
+ * 'imtest', and 'plaintext' - these must match a IMSP_Auth_ driver. If you
+ * are using the imtest driver for Cyrus, please read the
+ * framework/Net_IMSP/Auth/imtest.php file for more configuration information.
+ *
+ * Groups in other IMSP-aware applications are just entries with multiple
+ * email addresses in the email field and a 'group' field set to flag the
+ * entry as a group. (The Cyrusoft applications, Mulberry and Silkymail both
+ * use a field named 'group' set to equal 'group' to signify this). A
+ * Turba_Object_Group is basically a List of existing Turba_Objects. The IMSP
+ * driver will map between these two structures when reading and writing
+ * groups.
+ * The only caveat is that IMSP groups that contain email addresses which do
+ * not have a cooresponding contact entry will be ignored. The group_id_field
+ * should be set to the IMSP field that flags the entry as a 'group' entry and
+ * the group_id_value should be set to the value given to that field.
+ *
+ * By default, the username and password that were used to login to Horde is
+ * used to login to the IMSP server. If these credentials are different,
+ * there is a user preference in Horde to allow another username / password to
+ * be entered. The alternate credentials are always used if present.
+ *
+ * In the map array, since IMSP uses the 'name' attribute as a key, this is
+ * what __key is mapped to ... and a dynamic field 'fullname' is added and
+ * mapped to the horde 'name' field. This is populated with the IMSP 'name'
+ * field when the object is read from the server.
+ *
+ * If you wish to keep track of ownership of individual contacts, set
+ * 'contact_ownership' = true. Note that entries created using other clients
+ * will not be created this way and will therefore have no 'owner'. Set
+ * 'contact_ownership' = false and the __owner field will be automatically
+ * populated with the current username.
+ *
+ * To integrate with Horde_Share, set use_shares to true and uncomment the
+ * IMSP Horde_Share hooks in horde/config/hooks.php.
+ */
+// Check that IMSP is configured in Horde but fall through if there is no
+// configuration at all.
+if (!empty($GLOBALS['conf']['imsp']['enabled']) ||
+    !isset($GLOBALS['conf']['imsp']['enabled'])) {
+    // First, get the user name to login to IMSP server with.
+    $_imsp_auth_user = $GLOBALS['prefs']->getValue('imsp_auth_user');
+    $_imsp_auth_pass = $GLOBALS['prefs']->getValue('imsp_auth_pass');
+    if (!strlen($_imsp_auth_user)) {
+        $_imsp_auth_user = $GLOBALS['registry']->getAuth('bare');
+        $_imsp_auth_pass = $GLOBALS['registry']->getAuthCredential('password');
+    }
+    $cfgSources['imsp'] = array(
+        'title' => _("IMSP"),
+        'type' => 'imsp',
+        'params' => array(
+            'server'  => $GLOBALS['conf']['imsp']['server'],
+            'port'    => $GLOBALS['conf']['imsp']['port'],
+            'auth_method' => $GLOBALS['conf']['imsp']['auth_method'],
+            // socket, command, and auth_mechanism are for imtest driver.
+            'socket'  => isset($GLOBALS['conf']['imsp']['socket']) ?
+                         $GLOBALS['conf']['imsp']['socket'] . $_imsp_auth_user . '.sck' :
+                         '',
+            'command' => isset($GLOBALS['conf']['imsp']['command']) ?
+                         $GLOBALS['conf']['imsp']['command'] : '' ,
+            'auth_mechanism' => isset($GLOBALS['conf']['imsp']['auth_mechanism']) ?
+                                $GLOBALS['conf']['imsp']['auth_mechanism'] : '',
+            'username' => $_imsp_auth_user,
+            'password' => $_imsp_auth_pass,
+            'name' => $_imsp_auth_user,
+            'group_id_field' => 'group',
+            'group_id_value' => 'group',
+            'contact_ownership' => false,
+            // Dynamically generated acl rights for current user.
+            'my_rights' => '',
+            ),
+        'map' => array(
+            '__key' => 'name',
+            '__type' => '__type',
+            '__members' => '__members',
+            '__owner' => '__owner',
+            '__uid' => '__uid',
+            'name' => 'fullname',
+            'email' => 'email',
+            'alias' => 'alias',
+            'company' => 'company',
+            'notes' => 'notes',
+            'workPhone' => 'phone-work',
+            'fax' => 'fax',
+            'homePhone' => 'phone-home',
+            'cellPhone' => 'cellphone',
+            'freebusyUrl' => 'freebusyUrl'
+            ),
+        'search' => array(
+            'name',
+            'email',
+            'alias',
+            'company',
+            'homePhone'
+            ),
+        'strict' => array(),
+        'export' => true,
+        'browse' => true,
+        'use_shares' => false,
+        );
+
+    /**
+     * Get any other address books this user might be privy to.
+     * The values for attributes such as 'export' and 'browse' for books
+     * that are added below will be the same as the values set in the default
+     * book above. Any entries defined explicitly in cfgSources[]
+     * will override any entries gathered dynamically below.
+     */
+     if (empty($cfgSources['imsp']['use_shares'])) {
+        $result = Net_IMSP_Utils::getAllBooks($cfgSources['imsp']);
+
+        if (!$result instanceof PEAR_Error) {
+            $resultCount = count($result);
+            for ($i = 0; $i < $resultCount; ++$i) {
+                // Make sure we didn't define this source explicitly,
+                // but set the acls from the server regardless.
+                $dup = false;
+                foreach ($cfgSources as $key => $thisSource) {
+                    if (($thisSource['type'] == 'imsp') &&
+                        ($thisSource['params']['name'] == $result[$i]['params']['name'])) {
+
+                        $dup = true;
+                        $acl = $result[$i]['params']['my_rights'];
+                        $cfgSources[$key]['params']['my_rights'] = $acl;
+                        break;
+                    }
+                }
+                if (!$dup) {
+                    $cfgSources[$result[$i]['params']['name']] = $result[$i];
+                }
+            }
+        } else {
+            $notification->push($result);
+        }
+     }
+}
+/* End IMSP sources. */
+
+/* Begin Kolab sources. */
+if (!empty($GLOBALS['conf']['kolab']['enabled'])) {
+
+    /* Only use LDAP if we have that extension in PHP */
+    if (function_exists('ldap_connect')) {
+        require_once 'Horde/Kolab.php';
+
+        if (!is_callable('Kolab', 'getServer')) {
+            $_kolab_server = $GLOBALS['conf']['kolab']['ldap']['server'];
+        } else {
+            $_kolab_server = Kolab::getServer('ldap');
+        }
+
+        /* A global address book for a Kolab Server. This is typically a
+         * read-only public directory, stored in the default Kolab LDAP 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' => $_kolab_server,
+                'port' => $GLOBALS['conf']['kolab']['ldap']['port'],
+                'tls' => false,
+                'root' => $GLOBALS['conf']['kolab']['ldap']['basedn'],
+                'sizelimit' => 200,
+                'dn' => array('cn'),
+                'objectclass' => array(
+                    'inetOrgPerson'
+                ),
+                'scope' => 'sub',
+                'charset' => 'utf-8',
+                'version' => 3,
+                'bind_dn' => '',
+                'bind_password' => '',
+            ),
+            'map' => array(
+                '__key'             => 'dn',
+                'name'              => 'cn',
+                'firstname'         => 'givenName',
+                'lastname'          => 'sn',
+                'email'             => 'mail',
+                'alias'             => 'alias',
+                'title'             => 'title',
+                'company'           => 'o',
+                'workStreet'        => 'street',
+                'workCity'          => 'l',
+                'workProvince'      => 'st',
+                'workPostalCode'    => 'postalCode',
+                'workCountry'       => 'c',
+                'homePhone'         => 'homePhone',
+                'workPhone'         => 'telephoneNumber',
+                'cellPhone'         => 'mobile',
+                'fax'               => 'fax',
+                'notes'             => 'description',
+                'kolabHomeServer'   => 'kolabHomeServer',
+                'freebusyUrl'       => array('fields' => array('kolabHomeServer', 'email'),
+                                             'format' => 'https://%s/freebusy/%s.ifb'),
+            ),
+            'search' => array(
+                'name',
+                'firstname',
+                'lastname',
+                'email',
+                'title',
+                'company',
+                'workAddress',
+                'workCity',
+                'workProvince',
+                'workPostalCode',
+                'workCountry',
+                'homePhone',
+                'workPhone',
+                'cellPhone',
+                'fax',
+                'notes',
+            ),
+            'strict' => array(
+                'dn',
+            ),
+            'export' => true,
+            'browse' => true,
+        );
+    }
+
+    /**
+     * The local address books for a Kolab user. These are stored in specially
+     * flagged contact folder within the users Cyrus IMAP mailbox.
+     *
+     * Still missing attributes are:
+     *
+     *   picture, sensitivity
+     */
+
+    $cfgSources['kolab'] = array(
+        'title' => _("Contacts"),
+        'type' => 'kolab',
+        'params' => array(
+            'charset' => 'utf-8',
+        ),
+        'list_name_field' => 'lastname',
+        'map' => array(
+            '__key' => 'uid',
+            '__uid' => 'uid',
+            '__type' => '__type',
+            '__members' => '__members',
+            /* Personal */
+            'name' => array('fields' => array('firstname', 'middlenames', 'lastname'),
+                            'format' => '%s %s %s',
+                            'parse' => array(
+                                array('fields' => array('firstname', 'middlenames',
+                                                        'lastname'),
+                                      'format' => '%s %s %s'),
+                                array('fields' => array( 'lastname', 'firstname'),
+                                      'format' => '%s, %s'),
+                                array('fields' => array('firstname', 'lastname'),
+                                      'format' => '%s %s'),
+                            )),
+            'firstname'         => 'given-name',
+            'lastname'          => 'last-name',
+            'middlenames'       => 'middle-names',
+            'namePrefix'        => 'prefix',
+            'nameSuffix'        => 'suffix',
+            'initials'          => 'initials',
+            'nickname'          => 'nick-name',
+            'photo'             => 'photo',
+            'phototype'         => 'phototype',
+            'gender'            => 'gender',
+            'birthday'          => 'birthday',
+            'spouse'            => 'spouse-name',
+            'anniversary'       => 'anniversary',
+            'children'          => 'children',
+            /* Location */
+            'workStreet'        => 'addr-business-street',
+            'workCity'          => 'addr-business-locality',
+            'workProvince'      => 'addr-business-region',
+            'workPostalCode'    => 'addr-business-postal-code',
+            'workCountry'       => 'addr-business-country',
+            'homeStreet'        => 'addr-home-street',
+            'homeCity'          => 'addr-home-locality',
+            'homeProvince'      => 'addr-home-region',
+            'homePostalCode'    => 'addr-home-postal-code',
+            'homeCountry'       => 'addr-home-country',
+            /* Communications */
+            'emails'            => 'emails',
+            'homePhone'         => 'phone-home1',
+            'workPhone'         => 'phone-business1',
+            'cellPhone'         => 'phone-mobile',
+            'fax'               => 'phone-businessfax',
+            'instantMessenger'  => 'im-address',
+            /* Organization */
+            'title'             => 'job-title',
+            'role'              => 'profession',
+            'company'           => 'organization',
+            'department'        => 'department',
+            'office'            => 'office-location',
+            'manager'           => 'manager-name',
+            'assistant'         => 'assistant',
+            /* Other */
+            'category'          => 'categories',
+            'notes'             => 'body',
+            'website'           => 'web-page',
+            'freebusyUrl'       => 'free-busy-url',
+            'language'          => 'language',
+            'latitude'          => 'latitude',
+            'longitude'         => 'longitude',
+            /* Invisible */
+            'email'             => 'email',
+            'pgpPublicKey'      => 'pgp-publickey',
+        ),
+        'tabs' => array(
+            _("Personal") => array('name', 'firstname', 'lastname', 'middlenames',
+                                   'namePrefix', 'nameSuffix', 'initials', 'nickname',
+                                   'photo', 'gender', 'birthday', 'spouse', 'anniversary',
+                                   'children'),
+            _("Location") => array('homeStreet', 'homeCity', 'homeProvince',
+                                   'homePostalCode', 'homeCountry', 'workStreet',
+                                   'workCity', 'workProvince', 'workPostalCode',
+                                   'workCountry'),
+            _("Communications") => array('emails', 'homePhone', 'workPhone',
+                                         'cellPhone', 'fax', 'instantMessenger'),
+            _("Organization") => array('title', 'role', 'company', 'department',
+                                       'office', 'manager', 'assistant'),
+            _("Other") => array('category', 'notes', 'website', 'freebusyUrl',
+                                'language', 'latitude', 'longitude'),
+        ),
+        'search' => array(
+            /* Personal */
+            'name',
+            'firstname',
+            'lastname',
+            'middlenames',
+            'namePrefix',
+            'nameSuffix',
+            'initials',
+            'nickname',
+            'gender',
+            'birthday',
+            'spouse',
+            'anniversary',
+            'children',
+            /* Location */
+            'workStreet',
+            'workCity',
+            'workProvince',
+            'workPostalCode',
+            'workCountry',
+            'homeStreet',
+            'homeCity',
+            'homeProvince',
+            'homePostalCode',
+            'homeCountry',
+            /* Communications */
+            'emails',
+            'homePhone',
+            'workPhone',
+            'cellPhone',
+            'fax',
+            'instantMessenger',
+            /* Organization */
+            'title',
+            'role',
+            'company',
+            'department',
+            'office',
+            'manager',
+            'assistant',
+            /* Other */
+            'category',
+            'notes',
+            'website',
+            'language',
+        ),
+        'strict' => array(
+            'uid',
+        ),
+        'export' => true,
+        'browse' => true,
+        'use_shares' => true,
+        'shares_only' => true,
+    );
+}
+/* End Kolab sources. */
index f304b74..d92457a 100644 (file)
@@ -29,7 +29,7 @@ class Turba_Hooks
 //             return;
 //         }
 //
-//         require TURBA_BASE . '/config/sources.php';
+//         require TURBA_BASE . '/config/backends.php';
 //         $shares = Turba::listShares(true);
 //
 //         foreach ($shares as $uid => $share) {
index 034560c..aa0e111 100644 (file)
@@ -40,7 +40,7 @@ $_prefs['addressbookselect'] = array(
 
 // Address books to be displayed in the address book selection widget
 // and in the Browse menu item.  The address book name is stored using
-// the source key from sources.php (e.g. "localsql").
+// the source key from backends.php (e.g. "localsql").
 // You can provide default values this way:
 //   'value' => json_encode(array('source_one', 'source_two'))
 // If 'value' is empty (''), all address books that the user has permissions
diff --git a/turba/config/sources.php.dist b/turba/config/sources.php.dist
deleted file mode 100644 (file)
index 883c9bc..0000000
+++ /dev/null
@@ -1,1104 +0,0 @@
-<?php
-/**
- * This file is where you specify the sources of contacts available to users
- * at your installation. It contains a large number of EXAMPLES. Please
- * remove or comment out those examples that YOU DON'T NEED. There are a
- * number of properties that you can set for each server, including:
- *
- * title:       This is the common (user-visible) name that you want displayed
- *              in the contact source drop-down box.
- *
- * type:        The types 'ldap', 'sql', 'imsp', 'group', 'favourites' and
- *              'prefs' are currently supported. Preferences-based address
- *              books are not intended for production installs unless you
- *              really know what you're doing - they are not searchable, and
- *              they won't scale well if a user has a large number of entries.
- *
- * params:      These are the connection parameters specific to the contact
- *              source. See below for examples of how to set these.
- *
- * Special params settings:
- *
- *   charset:       The character set that the backend stores data in. Many
- *                  LDAP servers use utf-8. Database servers typically use
- *                  iso-8859-1.
- *
- *   tls:           Only applies to LDAP servers. If true, then try to use a
- *                  TLS connection to the server.
- *
- *   scope:         Only applies to LDAP servers. Can be set to 'one' to
- *                  search one level of the LDAP directory, or 'sub' to search
- *                  all levels. 'one' will work for most setups and should be
- *                  much faster. However we default to 'sub' for backwards
- *                  compatibility.
- *
- *   checkrequired: Only applies to LDAP servers. If present, this value causes
- *                  the driver to consult the LDAP schema for any attributes
- *                  that are required by the given objectclass(es). Required
- *                  attributes will be provided automatically if the
- *                  'checkrequired_string' parameter is present.
- *                  *NOTE* You must have the Net_LDAP PEAR library installed
- *                  for this to work.
- *
- *   checksyntax:   Only applies to LDAP servers. If present, this value causes
- *                  the driver to inspect the LDAP schema for particular
- *                  attributes by the type defined in the corresponding schema
- *                  *NOTE* You must have the Net_LDAP PEAR library installed
- *                  for this to work.
- *
- *   deref:         Only applies to LDAP servers. If set, should be one of:
- *                    LDAP_DEREF_NEVER
- *                    LDAP_DEREF_SEARCHING
- *                    LDAP_DEREF_FINDING
- *                    LDAP_DEREF_ALWAYS
- *                  This tells the LDAP server when to dereference
- *                  aliases. See http://www.php.net/ldap for more
- *                  information.
- *
- *   dn:            Only applies to LDAP servers. Defines the list of LDAP
- *                  attributes that build a valid DN.
- *
- *   root:          Only applies to LDAP servers. Defines the base DN where to
- *                  start the search, i.e. dc=example,dc=com.
- *
- *   bind_dn:       Only applies to LDAP servers which do not allow anonymous
- *                  connections. Active Directory servers do not allow it by
- *                  default, so before using one as a Turba source, you must
- *                  create a "rightless" user, which is only allowed to connect
- *                  to the server, and set the bind_dn parameter like
- *                  'rightless@example.com' (not cn=rightless,dc=example,dc=com)
- *
- *   bind_password: Only applies to LDAP servers which do not allow anonymous
- *                  connection. You should set this to the cleartext password
- *                  for the user specified in 'bind_dn'.
- *
- *   referrals:     Only applies to LDAP servers. If set, should be 0 or 1.
- *                  See the LDAP documentation about the corresponding
- *                  parameter REFERRALS. Windows 2003 Server requires that you
- *                  set this parameter to 0.
- *
- *   sizelimit:     Only applies to LDAP servers. If set, limit the search to
- *                  the specified number of entries. Value 0 or no value means
- *                  no limit. Keep in mind that servers can impose their own
- *                  search limits.
- *
- *   objectclass:   Only applies to LDAP servers. Defines a list of
- *                  objectclasses that contacts must belong to, and that new
- *                  objects will be created with.
- *
- *   filter:        Filter helps to filter your result based on certain
- *                  condition in SQL and LDAP backends. A filter can be
- *                  specified to avoid some unwanted data. For example, if the
- *                  source is an external sql database, to select records with
- *                  the delete flag = 0: 'filter' => 'deleted=0'.
- *                  Don't enclose filter in brackets - this will done
- *                  automatically. Also keep in mind that a full filter line
- *                  will be built from 'filter' and 'objectclass' parameters.
- *
- *   version:       Only applies to LDAP servers. If set, specify LDAP server
- *                  version, can be 2 or 3. Active Directory servers
- *                  require version 3.
- *
- * map:         This is a list of mappings from the Turba attribute names (on
- *              the left) to the attribute names by which they are known in
- *              this contact source (on the right). Turba also supports
- *              composite fields. A composite field is defined by mapping the
- *              field name to an array containing a list of component fields
- *              and a format string (similar to a printf() format string;
- *              however, note that positioned parameters like %1$s will NOT
- *              work). 'attribute' defines where the composed value is saved,
- *              and can be left out. 'parse' defines a list of format strings
- *              and field names that should be used for splitting up composite
- *              fields, in the order of precedence, and can be left out. Here
- *              is an example:
- *              ...
- *              'name' => array('fields' => array('firstname', 'lastname'),
- *                              'format' => '%s %s',
- *                              'attribute' => 'object_name'),
- *              'firstname' => 'object_firstname',
- *              'lastname' => 'object_lastname',
- *              ...
- *
- *              Standard Turba attributes are:
- *                __key     : A backend-specific ID for the entry (any value
- *                            as long as it is unique inside that source;
- *                            required)
- *                __uid     : Globally unique ID of the entry (used for
- *                            synchronizing and must be able to be set to any
- *                            value)
- *                __owner   : User name of the contact's owner
- *                __type    : Either 'Object' or 'Group'
- *                __members : Serialized PHP array with list of Group members.
- *              More Turba attributes are defined in config/attributes.php.
- *
- * tabs:        All fields can be grouped into tabs with this optional entry.
- *              This list is multidimensional hash, the keys are the tab
- *              titles.
- *              Here is an example:
- *              'tabs' => array(
- *                  'Names' => array('firstname', 'lastname', 'alias'),
- *                  'Addresses' => array('homeAddress', 'workAddress')
- *              );
- *
- * search:      A list of Turba attribute names that can be searched for this
- *              source.
- *
- * strict:      A list of native field/attribute names that must
- *              always be matched exactly in a search.
- *
- * approximate: Only applies to LDAP servers. If set, should be an
- *              array of native field/attribute names to search
- *              "approximately" (for example, "Sánchez", "Sanchez",
- *              and "Sanchéz" will all match a search string of
- *              "sanchez").
- *
- * export:      If set to true, this source will appear on the Export menu,
- *              allowing users to export the contacts to a CSV (etc.) file.
- *
- * browse:      If set to true, this source will be browseable via the Browse
- *              menu item, and empty searches against the source will return
- *              all contacts.
- *
- * use_shares:  If this is present and true, Horde_Share functionality will
- *              be enabled for this source - allowing users to share their
- *              personal address books as well as to create new ones. Since
- *              Turba only supports having one backend configured for
- *              creating new shares, use the 'shares' configuration option to
- *              specify which backend will be used for creating new shares.
- *              All permission checking will be done against Horde_Share, but
- *              note that any 'extended' permissions (such as max_contacts)
- *              will still be enforced. Also note that the backend driver
- *              must have support for using this. Currently SQL and IMSP.
- *
- * list_name_field:  If this is present and non-empty, it will be taken as the
- *                   field to store contact list names in.
- *                   This is required when using a composite field as the 'name'
- *                   field.
- *
- * alternative_name: If this is present and non-empty, it will be taken as the
- *                   field to use an alternative in case that the name field is
- *                   empty.
- *
- * Here are some example configurations:
- *
- * $Id$
- */
-
-/**
- * A local address book in an SQL database. This implements a private
- * per-user address book. Sharing of this source with other users may be
- * accomplished by enabling Horde_Share for this source by setting
- * 'use_shares' => true.
- *
- * Be sure to create a turba_objects table in your Horde database from the
- * schema in turba/scripts/db/turba.sql if you use this source.
- */
-$cfgSources['localsql'] = array(
-    'title' => _("My Address Book"),
-    'type' => 'sql',
-    // The default connection details are pulled from the Horde-wide SQL
-    // connection configuration.
-    'params' => array_merge($GLOBALS['conf']['sql'], array('table' => 'turba_objects')),
-    // Using two tables as datasource.
-    // 'params' => array_merge($GLOBALS['conf']['sql'],
-    //                         array('table' => 'leaddetails LEFT JOIN leadaddress ON leaddetails.leadid = leadaddress.leadaddressid',
-    //                               'filter' => 'leaddetails.converted = 0')),
-    'map' => array(
-        '__key' => 'object_id',
-        '__owner' => 'owner_id',
-        '__type' => 'object_type',
-        '__members' => 'object_members',
-        '__uid' => 'object_uid',
-        'firstname' => 'object_firstname',
-        'lastname' => 'object_lastname',
-        'middlenames' => 'object_middlenames',
-        'namePrefix' => 'object_nameprefix',
-        'nameSuffix' => 'object_namesuffix',
-        'name' => array('fields' => array('namePrefix', 'firstname',
-                                          'middlenames', 'lastname',
-                                          'nameSuffix'),
-                        'format' => '%s %s %s %s %s',
-                        'parse' => array(
-                            array('fields' => array('firstname', 'middlenames',
-                                                    'lastname'),
-                                  'format' => '%s %s %s'),
-                            array('fields' => array('firstname', 'lastname'),
-                                  'format' => '%s %s'))),
-        // This is a shorter version of a "name" composite field which only
-        // consists of the first name and last name.
-        // 'name' => array('fields' => array('firstname', 'lastname'),
-        //                 'format' => '%s %s'),
-        'alias' => 'object_alias',
-        'birthday' => 'object_bday',
-        // The photo field requires at least Horde 3.3 and a matching type
-        // field.
-        // 'photo' => 'object_photo',
-        // 'phototype' => 'object_phototype',
-        'homeStreet' => 'object_homestreet',
-        'homePOBox' => 'object_homepob',
-        'homeCity' => 'object_homecity',
-        'homeProvince' => 'object_homeprovince',
-        'homePostalCode' => 'object_homepostalcode',
-        'homeCountry' => 'object_homecountry',
-        // This is an example composite field for addresses, so you can display
-        // the various map links. If you use this, be sure to add 'homeAddress'
-        // to the 'tabs' parameter below.
-        // 'homeAddress' => array('fields' => array('homeStreet', 'homeCity',
-        //                                          'homeProvince',
-        //                                          'homePostalCode'),
-        //                        'format' => "%s \n %s, %s  %s"),
-        'workStreet' => 'object_workstreet',
-        'workPOBox' => 'object_workpob',
-        'workCity' => 'object_workcity',
-        'workProvince' => 'object_workprovince',
-        'workPostalCode' => 'object_workpostalcode',
-        'workCountry' => 'object_workcountry',
-        'timezone' => 'object_tz',
-        'email' => 'object_email',
-        'homePhone' => 'object_homephone',
-        'workPhone' => 'object_workphone',
-        'cellPhone' => 'object_cellphone',
-        'fax' => 'object_fax',
-        'pager' => 'object_pager',
-        'title' => 'object_title',
-        'role' => 'object_role',
-        'company' => 'object_company',
-        // The logo field requires at least Horde 3.3 and a matching type
-        // field.
-        // 'logo' => 'object_logo',
-        // 'logotype' => 'object_logotype',
-        'category' => 'object_category',
-        'notes' => 'object_notes',
-        'website' => 'object_url',
-        'freebusyUrl' => 'object_freebusyurl',
-        'pgpPublicKey' => 'object_pgppublickey',
-        'smimePublicKey' => 'object_smimepublickey',
-    ),
-    'tabs' => array(
-        _("Personal") => array('firstname', 'lastname', 'middlenames',
-                               'namePrefix', 'nameSuffix', 'name', 'alias',
-                               'birthday', 'photo'),
-        _("Location") => array('homeStreet', 'homePOBox', 'homeCity',
-                               'homeProvince', 'homePostalCode', 'homeCountry',
-                               'workStreet', 'workPOBox', 'workCity',
-                               'workProvince', 'workPostalCode', 'workCountry',
-                               'timezone'),
-        _("Communications") => array('email', 'homePhone', 'workPhone',
-                                     'cellPhone', 'fax', 'pager'),
-        _("Organization") => array('title', 'role', 'company', 'logo'),
-        _("Other") => array('category', 'notes', 'website', 'freebusyUrl',
-                            'pgpPublicKey', 'smimePublicKey'),
-    ),
-    'search' => array(
-        'name',
-        'email'
-    ),
-    'strict' => array(
-        'object_id',
-        'owner_id',
-        'object_type',
-    ),
-    'export' => true,
-    'browse' => true,
-    'use_shares' => true,
-    'list_name_field' => 'lastname',
-    'alternative_name' => 'company',
-);
-
-/**
- * A local address book in an LDAP directory. This implements a public
- * (shared) address book.
- *
- * To store distribution lists in the LDAP directory, you'll need to include
- * horde/scripts/ldap/horde.schema in your LDAP configuration.
- *
- * To store freebusy information in the LDAP directory, you'll need to include
- * turba/scripts/ldap/rfc2739.schema in your LDAP configuration.
- */
-// $cfgSources['localldap'] = array(
-//     'title' => _("Shared Directory"),
-//     'type' => 'ldap',
-//     'params' => array(
-//         'server' => 'ldap.example.com',
-//         'port' => 389,
-//         'tls' => false,
-//         'root' => 'dc=example,dc=com',
-//         'bind_dn' => 'cn=admin,ou=users,dc=example,dc=com',
-//         // For Active Directory:
-//         // 'bind_dn' => 'username@example.com',
-//         'bind_password' => '********',
-//         'sizelimit' => 200,
-//         // For Active Directory:
-//         // 'sizelimit' => 0,
-//         'dn' => array('cn'),
-//         'objectclass' => array('top',
-//                                'person',
-//                                'organizationalPerson',
-//                                'inetOrgPerson'),
-//                                // Add 'turbaContact' to this array if using
-//                                // 'turbaType' attribute below, and 'calEntry'
-//                                // if using 'freebusyUrl'.
-//         // For Active Directory:
-//         // 'objectclass' => array('organizationalPerson',
-//         //                        'user',
-//         //                        'group',
-//         //                        'contact'),
-//         'scope' => 'one',
-//         // For Active Directory:
-//         // 'scope' => 'sub',
-//         'charset' => 'utf-8',
-//         // Consult the LDAP schema to verify that all required attributes for
-//         // an entry are set and add them if needed.
-//         'checkrequired' => false,
-//         // Value used to fill in missing required attributes.
-//         'checkrequired_string' => ' ',
-//         // Check LDAP schema for valid syntax. If this is false an address
-//         // field is assumed to have postalAddress syntax; otherwise the schema
-//         // is consulted for the syntax to use.
-//         'checksyntax' => false,
-//         'version' => 3,
-//
-//         // For Active Directory you probably want to also set the following
-//         // parameters:
-//         // 'deref' => LDAP_DEREF_ALWAYS,
-//         // 'filter' => '&(SAMAccountName=*)(mail=*)',
-//         // 'referrals' => 0,
-//     ),
-//     'map' => array(
-//         '__key' => 'dn',
-//
-//         // Remove this mapping if using Active Directory server:
-//         '__uid' => 'uid',
-//
-//         // From horde.schema.  Make sure you have 'turbaContact' objectClass
-//         // included above:
-//         // '__type' => 'turbaType',
-//         // '__members' => 'turbaMembers',
-//
-//         'name' => 'cn',
-//         'email' => 'mail',
-//         'homePhone' => 'homephone',
-//         'workPhone' => 'telephonenumber',
-//         'cellPhone' => 'mobiletelephonenumber',
-//         'homeAddress' => 'homepostaladdress',
-//
-//         // From rfc2739.schema:
-//         // 'freebusyUrl' => 'calFBURL',
-//
-//         // For Active Directory servers:
-//         // 'name' => 'displayname',
-//         // 'title' => 'title',
-//         // 'cellPhone' => 'mobile',
-//         // 'department' => 'department',
-//         // 'company' => 'company',
-//     ),
-//     'search' => array(
-//         'name',
-//         'email',
-//         'homePhone',
-//         'workPhone',
-//         'cellPhone',
-//         'homeAddress'
-//     ),
-//     'strict' => array(
-//         'dn',
-//     ),
-//     'approximate' => array(
-//         'cn',
-//     ),
-//     // For Active Directory servers:
-//     // 'approximate' => array(
-//     //     'displayname',
-//     //     'samaccountname',
-//     // ),
-//     'export' => true,
-//     'browse' => true,
-// );
-
-/**
- * A personal LDAP address book. This assumes that the login is
- * <username>@domain.com and that the users are stored on the same LDAP
- * server. Thus it is possible to bind with the username and password from the
- * user. For more info; please refer to the docs/LDAP file in the Turba
- * distribution.
- *
- * To store distribution lists in the LDAP directory, you'll need to include
- * horde/scripts/ldap/horde.schema in your LDAP configuration.
- *
- * To store freebusy information in the LDAP directory, you'll need to include
- * turba/scripts/ldap/rfc2739.schema in your LDAP configuration.
- */
-/* First we need to get the uid. */
-// $_ldap_uid = $GLOBALS['registry']->getAuth('bare');
-// $_ldap_basedn = 'dc=example,dc=com';
-// $cfgSources['personal_ldap'] = array(
-//     'title' => _("My Address Book"),
-//     'type' => 'ldap',
-//     'params' => array(
-//         'server' => 'localhost',
-//         'tls' => false,
-//         'root' => 'ou=' . $_ldap_uid . ',ou=personal_addressbook,' . $_ldap_basedn,
-//         'bind_dn' => 'uid=' . $_ldap_uid . ',ou=People,' . $_ldap_basedn,
-//         'bind_password' => $GLOBALS['registry']->getAuthCredential('password'),
-//         'dn' => array('uid'),
-//         'objectclass' => array('top',
-//                                'person',
-//                                // 'turbaContact',
-//                                'inetOrgPerson',
-//                                // 'calEntry',
-//                                'organizationalPerson'),
-//         'scope' => 'one',
-//         'charset' => 'utf-8',
-//         'version' => 3
-//     ),
-//     'map' => array(
-//         '__key' => 'dn',
-//         '__uid' => 'uid',
-//
-//         // From horde.schema:
-//         // '__type' => 'turbaType',
-//         // '__members' => 'turbaMembers',
-//
-//         'name' => 'cn',
-//         'email' => 'mail',
-//         'lastname' => 'sn',
-//         'title' => 'title',
-//         'company' => 'organizationname',
-//         'businessCategory' => 'businesscategory',
-//         'workAddress' => 'postaladdress',
-//         'workPostalCode' => 'postalcode',
-//         'workPhone' => 'telephonenumber',
-//         'fax' => 'facsimiletelephonenumber',
-//         'homeAddress' => 'homepostaladdress',
-//         'homePhone' => 'homephone',
-//         'cellPhone' => 'mobile',
-//         'notes' => 'description',
-//
-//         // Evolution interopt attributes: (those that do not require the
-//         // evolution.schema)
-//         'office' => 'roomNumber',
-//         'department' => 'ou',
-//         'nickname' => 'displayName',
-//         'website' => 'labeledURI',
-//
-//         // These are not stored on the LDAP server.
-//         'pgpPublicKey' => 'object_pgppublickey',
-//         'smimePublicKey' => 'object_smimepublickey',
-//
-//         // From rfc2739.schema:
-//         // 'freebusyUrl' => 'calFBURL',
-//     ),
-//     'search' => array(
-//         'name',
-//         'email',
-//         'businessCategory',
-//         'title',
-//         'homePhone',
-//         'workPhone',
-//         'cellPhone',
-//         'homeAddress'
-//     ),
-//     'strict' => array(
-//         'dn',
-//     ),
-//     'approximate' => array(
-//         'cn',
-//     ),
-//     'export' => true,
-//     'browse' => true,
-// );
-
-/**
- * Public netcenter and verisign LDAP directories.
- */
-// $cfgSources['netcenter'] = array(
-//     'title' => _("Netcenter Member Directory"),
-//     'type' => 'ldap',
-//     'params' => array(
-//         'server' => 'memberdir.netscape.com',
-//         'port' => 389,
-//         'tls' => false,
-//         'root' => 'ou=member_directory,o=netcenter.com',
-//         'dn' => array('cn'),
-//         'objectclass' => 'person',
-//         'filter' => '',
-//         'scope' => 'sub',
-//         'charset' => 'iso-8859-1'
-//     ),
-//     'map' => array(
-//         '__key' => 'dn',
-//         'name' => 'cn',
-//         'email' => 'mail',
-//         'alias' => 'givenname'
-//     ),
-//     'search' => array(
-//         'name',
-//         'email',
-//         'alias'
-//     ),
-//     'strict' => array(
-//         'dn'
-//     ),
-//     'approximate' => array(
-//         'cn',
-//     ),
-//     'export' => false,
-//     'browse' => false,
-// );
-//
-// $cfgSources['verisign'] = array(
-//     'title' => _("Verisign Directory"),
-//     'type' => 'ldap',
-//     'params' => array(
-//         'server' => 'directory.verisign.com',
-//         'port' => 389,
-//         'tls' => false,
-//         'root' => '',
-//         'scope' => 'sub',
-//         'charset' => 'iso-8859-1'
-//     ),
-//     'map' => array(
-//         '__key' => 'dn',
-//         'name' => 'cn',
-//         'email' => 'mail'
-//     ),
-//     'search' => array(
-//         'name',
-//         'email'
-//     ),
-//     'strict' => array(
-//         'dn'
-//     ),
-//     'approximate' => array(
-//         'cn',
-//     ),
-//     'export' => false,
-//     'browse' => false,
-// );
-
-/**
- * A preferences-based address book. This will always be private. You can add
- * any attributes you like to the map and it will just work; you can also
- * create multiple prefs-based address books by changing the 'name' parameter.
- * This is best for address books that are expected to remain small; it's not
- * the most efficient, but it can't be beat for getting up and running
- * quickly, especially if you already have Horde preferences working. Note
- * that it is not searchable, though - searches will simply return the whole
- * address book.
- */
-// $cfgSources['prefs'] = array(
-//     'title' => _("Private Address Book"),
-//     'type' => 'prefs',
-//     'params' => array(
-//         'name' => 'prefs',
-//         'charset' => $GLOBALS['registry']->getCharset()
-//     ),
-//     'map' => array(
-//         '__key' => 'id',
-//         '__type' => '_type',
-//         '__members' => '_members',
-//         '__uid' => 'uid',
-//         'name' => 'name',
-//         'email' => 'mail',
-//         'alias' => 'alias'
-//     ),
-//     'search' => array(
-//         'name',
-//         'email',
-//         'alias'
-//     ),
-//     'strict' => array(
-//         'id',
-//         '_type',
-//     ),
-//     'export' => true,
-//     'browse' => true,
-// );
-
-/**
- * An address book based on message recipients. This will always be private and
- * read-only. The address book content is provided by the
- * contacts/favouriteRecipients API method which should be implemented by a
- * mail client that collects the most regular message recipients, like IMP
- * 4.2.
- */
-$cfgSources['favourites'] = array(
-    'title' => _("Favourite Recipients"),
-    'type' => 'favourites',
-    'params' => array(
-        'limit' => 10
-    ),
-    'map' => array(
-        '__key' => 'email',
-        'name' => 'email',
-        'email' => 'email'
-    ),
-    'search' => array(
-        'name',
-        'email'
-    ),
-    'strict' => array(
-        'id',
-    ),
-    'export' => true,
-    'browse' => true,
-);
-
-/**
- * A driver to show a user's Facebook friends as a turba address book. Some
- * data (like email) is not readily available via the API, but other data, like
- * birthdays (which will show up via the listTimeObjects API) may still be
- * useful to some
- */
-//$cfgSources['facebook'] = array(
-//    'title' => _("Facebook Friends"),
-//    'type' => 'facebook',
-//    'params' => array(
-//        'limit' => 10
-//    ),
-//   'map' => array(
-//        '__key' => 'uid',
-//        'name' => 'name',
-//        'lastname' => 'last_name',
-//        'firstname' => 'first_name',
-//        'email' => 'proxied_email',
-//        'birthday' => 'birthday',
-//        'homeCity' => 'current_location.city',
-//        'homeProvince' => 'current_location.state',
-//        'homePostalCode' => 'current_location.zip',
-//        'homeCountry' => 'current_location.country',
-//   ),
-//    'search' => array(
-//        'name',
-//        'email',
-//    ),
-//    'export' => true,
-//    'browse' => true,
-//);
-
-/**
- * This source creates an address book for each group the current user is a
- * member in.  The address book will always be read only, and the group members
- * must have an email address entered in their default identity.  No email
- * address will result in that member not being included in the address book.
- */
-//$grpSource = array(
-//    'title' => _("Group"),
-//    'type' => 'group',
-//    'params' => array(
-//       'name' => ''
-//    ),
-//    'map' => array(
-//        '__key' => 'email',
-//        'name' => 'name',
-//        'email' => 'email'
-//    ),
-//    'search' => array(
-//        'name',
-//        'email'
-//    ),
-//    'export' => true,
-//    'browse' => true,
-//);
-
-//$_group_driver = &Group::singleton();
-//$_group_list = $_group_driver->getGroupMemberships($GLOBALS['registry']->getAuth());
-//foreach ($_group_list as $_group_id => $_group_name) {
-//    $cfgSources['group_' . $_group_id] = $grpSource;
-//    $cfgSources['group_' . $_group_id]['params'] = array('gid' => $_group_id);
-//    $cfgSources['group_' . $_group_id]['title'] = $_group_name;
-//}
-
-/**
- * IMSP based address book.
- *
- * Communicates with an IMSP backend server.
- *
- * Notes:
- * You should configure the user's "main" address book here. The name of the
- * address book is set in the 'name' element of the params array. It should
- * be configured to be the same as the IMSP server username. Any other
- * address books the user has access to will automatically be configured at
- * runtime.
- *
- * In the params array, accepted values for auth_method are 'cram_md5',
- * 'imtest', and 'plaintext' - these must match a IMSP_Auth_ driver. If you
- * are using the imtest driver for Cyrus, please read the
- * framework/Net_IMSP/Auth/imtest.php file for more configuration information.
- *
- * Groups in other IMSP-aware applications are just entries with multiple
- * email addresses in the email field and a 'group' field set to flag the
- * entry as a group. (The Cyrusoft applications, Mulberry and Silkymail both
- * use a field named 'group' set to equal 'group' to signify this). A
- * Turba_Object_Group is basically a List of existing Turba_Objects. The IMSP
- * driver will map between these two structures when reading and writing
- * groups.
- * The only caveat is that IMSP groups that contain email addresses which do
- * not have a cooresponding contact entry will be ignored. The group_id_field
- * should be set to the IMSP field that flags the entry as a 'group' entry and
- * the group_id_value should be set to the value given to that field.
- *
- * By default, the username and password that were used to login to Horde is
- * used to login to the IMSP server. If these credentials are different,
- * there is a user preference in Horde to allow another username / password to
- * be entered. The alternate credentials are always used if present.
- *
- * In the map array, since IMSP uses the 'name' attribute as a key, this is
- * what __key is mapped to ... and a dynamic field 'fullname' is added and
- * mapped to the horde 'name' field. This is populated with the IMSP 'name'
- * field when the object is read from the server.
- *
- * If you wish to keep track of ownership of individual contacts, set
- * 'contact_ownership' = true. Note that entries created using other clients
- * will not be created this way and will therefore have no 'owner'. Set
- * 'contact_ownership' = false and the __owner field will be automatically
- * populated with the current username.
- *
- * To integrate with Horde_Share, set use_shares to true and uncomment the
- * IMSP Horde_Share hooks in horde/config/hooks.php.
- */
-// Check that IMSP is configured in Horde but fall through if there is no
-// configuration at all.
-if (!empty($GLOBALS['conf']['imsp']['enabled']) ||
-    !isset($GLOBALS['conf']['imsp']['enabled'])) {
-    // First, get the user name to login to IMSP server with.
-    $_imsp_auth_user = $GLOBALS['prefs']->getValue('imsp_auth_user');
-    $_imsp_auth_pass = $GLOBALS['prefs']->getValue('imsp_auth_pass');
-    if (!strlen($_imsp_auth_user)) {
-        $_imsp_auth_user = $GLOBALS['registry']->getAuth('bare');
-        $_imsp_auth_pass = $GLOBALS['registry']->getAuthCredential('password');
-    }
-    $cfgSources['imsp'] = array(
-        'title' => _("IMSP"),
-        'type' => 'imsp',
-        'params' => array(
-            'server'  => $GLOBALS['conf']['imsp']['server'],
-            'port'    => $GLOBALS['conf']['imsp']['port'],
-            'auth_method' => $GLOBALS['conf']['imsp']['auth_method'],
-            // socket, command, and auth_mechanism are for imtest driver.
-            'socket'  => isset($GLOBALS['conf']['imsp']['socket']) ?
-                         $GLOBALS['conf']['imsp']['socket'] . $_imsp_auth_user . '.sck' :
-                         '',
-            'command' => isset($GLOBALS['conf']['imsp']['command']) ?
-                         $GLOBALS['conf']['imsp']['command'] : '' ,
-            'auth_mechanism' => isset($GLOBALS['conf']['imsp']['auth_mechanism']) ?
-                                $GLOBALS['conf']['imsp']['auth_mechanism'] : '',
-            'username' => $_imsp_auth_user,
-            'password' => $_imsp_auth_pass,
-            'name' => $_imsp_auth_user,
-            'group_id_field' => 'group',
-            'group_id_value' => 'group',
-            'contact_ownership' => false,
-            // Dynamically generated acl rights for current user.
-            'my_rights' => '',
-            ),
-        'map' => array(
-            '__key' => 'name',
-            '__type' => '__type',
-            '__members' => '__members',
-            '__owner' => '__owner',
-            '__uid' => '__uid',
-            'name' => 'fullname',
-            'email' => 'email',
-            'alias' => 'alias',
-            'company' => 'company',
-            'notes' => 'notes',
-            'workPhone' => 'phone-work',
-            'fax' => 'fax',
-            'homePhone' => 'phone-home',
-            'cellPhone' => 'cellphone',
-            'freebusyUrl' => 'freebusyUrl'
-            ),
-        'search' => array(
-            'name',
-            'email',
-            'alias',
-            'company',
-            'homePhone'
-            ),
-        'strict' => array(),
-        'export' => true,
-        'browse' => true,
-        'use_shares' => false,
-        );
-
-    /**
-     * Get any other address books this user might be privy to.
-     * The values for attributes such as 'export' and 'browse' for books
-     * that are added below will be the same as the values set in the default
-     * book above. Any entries defined explicitly in cfgSources[]
-     * will override any entries gathered dynamically below.
-     */
-     if (empty($cfgSources['imsp']['use_shares'])) {
-        $result = Net_IMSP_Utils::getAllBooks($cfgSources['imsp']);
-
-        if (!$result instanceof PEAR_Error) {
-            $resultCount = count($result);
-            for ($i = 0; $i < $resultCount; ++$i) {
-                // Make sure we didn't define this source explicitly,
-                // but set the acls from the server regardless.
-                $dup = false;
-                foreach ($cfgSources as $key => $thisSource) {
-                    if (($thisSource['type'] == 'imsp') &&
-                        ($thisSource['params']['name'] == $result[$i]['params']['name'])) {
-
-                        $dup = true;
-                        $acl = $result[$i]['params']['my_rights'];
-                        $cfgSources[$key]['params']['my_rights'] = $acl;
-                        break;
-                    }
-                }
-                if (!$dup) {
-                    $cfgSources[$result[$i]['params']['name']] = $result[$i];
-                }
-            }
-        } else {
-            $notification->push($result);
-        }
-     }
-}
-/* End IMSP sources. */
-
-/* Begin Kolab sources. */
-if (!empty($GLOBALS['conf']['kolab']['enabled'])) {
-
-    /* Only use LDAP if we have that extension in PHP */
-    if (function_exists('ldap_connect')) {
-        require_once 'Horde/Kolab.php';
-
-        if (!is_callable('Kolab', 'getServer')) {
-            $_kolab_server = $GLOBALS['conf']['kolab']['ldap']['server'];
-        } else {
-            $_kolab_server = Kolab::getServer('ldap');
-        }
-
-        /* A global address book for a Kolab Server. This is typically a
-         * read-only public directory, stored in the default Kolab LDAP 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' => $_kolab_server,
-                'port' => $GLOBALS['conf']['kolab']['ldap']['port'],
-                'tls' => false,
-                'root' => $GLOBALS['conf']['kolab']['ldap']['basedn'],
-                'sizelimit' => 200,
-                'dn' => array('cn'),
-                'objectclass' => array(
-                    'inetOrgPerson'
-                ),
-                'scope' => 'sub',
-                'charset' => 'utf-8',
-                'version' => 3,
-                'bind_dn' => '',
-                'bind_password' => '',
-            ),
-            'map' => array(
-                '__key'             => 'dn',
-                'name'              => 'cn',
-                'firstname'         => 'givenName',
-                'lastname'          => 'sn',
-                'email'             => 'mail',
-                'alias'             => 'alias',
-                'title'             => 'title',
-                'company'           => 'o',
-                'workStreet'        => 'street',
-                'workCity'          => 'l',
-                'workProvince'      => 'st',
-                'workPostalCode'    => 'postalCode',
-                'workCountry'       => 'c',
-                'homePhone'         => 'homePhone',
-                'workPhone'         => 'telephoneNumber',
-                'cellPhone'         => 'mobile',
-                'fax'               => 'fax',
-                'notes'             => 'description',
-                'kolabHomeServer'   => 'kolabHomeServer',
-                'freebusyUrl'       => array('fields' => array('kolabHomeServer', 'email'),
-                                             'format' => 'https://%s/freebusy/%s.ifb'),
-            ),
-            'search' => array(
-                'name',
-                'firstname',
-                'lastname',
-                'email',
-                'title',
-                'company',
-                'workAddress',
-                'workCity',
-                'workProvince',
-                'workPostalCode',
-                'workCountry',
-                'homePhone',
-                'workPhone',
-                'cellPhone',
-                'fax',
-                'notes',
-            ),
-            'strict' => array(
-                'dn',
-            ),
-            'export' => true,
-            'browse' => true,
-        );
-    }
-
-    /**
-     * The local address books for a Kolab user. These are stored in specially
-     * flagged contact folder within the users Cyrus IMAP mailbox.
-     *
-     * Still missing attributes are:
-     *
-     *   picture, sensitivity
-     */
-
-    $cfgSources['kolab'] = array(
-        'title' => _("Contacts"),
-        'type' => 'kolab',
-        'params' => array(
-            'charset' => 'utf-8',
-        ),
-        'list_name_field' => 'lastname',
-        'map' => array(
-            '__key' => 'uid',
-            '__uid' => 'uid',
-            '__type' => '__type',
-            '__members' => '__members',
-            /* Personal */
-            'name' => array('fields' => array('firstname', 'middlenames', 'lastname'),
-                            'format' => '%s %s %s',
-                            'parse' => array(
-                                array('fields' => array('firstname', 'middlenames',
-                                                        'lastname'),
-                                      'format' => '%s %s %s'),
-                                array('fields' => array( 'lastname', 'firstname'),
-                                      'format' => '%s, %s'),
-                                array('fields' => array('firstname', 'lastname'),
-                                      'format' => '%s %s'),
-                            )),
-            'firstname'         => 'given-name',
-            'lastname'          => 'last-name',
-            'middlenames'       => 'middle-names',
-            'namePrefix'        => 'prefix',
-            'nameSuffix'        => 'suffix',
-            'initials'          => 'initials',
-            'nickname'          => 'nick-name',
-            'photo'             => 'photo',
-            'phototype'         => 'phototype',
-            'gender'            => 'gender',
-            'birthday'          => 'birthday',
-            'spouse'            => 'spouse-name',
-            'anniversary'       => 'anniversary',
-            'children'          => 'children',
-            /* Location */
-            'workStreet'        => 'addr-business-street',
-            'workCity'          => 'addr-business-locality',
-            'workProvince'      => 'addr-business-region',
-            'workPostalCode'    => 'addr-business-postal-code',
-            'workCountry'       => 'addr-business-country',
-            'homeStreet'        => 'addr-home-street',
-            'homeCity'          => 'addr-home-locality',
-            'homeProvince'      => 'addr-home-region',
-            'homePostalCode'    => 'addr-home-postal-code',
-            'homeCountry'       => 'addr-home-country',
-            /* Communications */
-            'emails'            => 'emails',
-            'homePhone'         => 'phone-home1',
-            'workPhone'         => 'phone-business1',
-            'cellPhone'         => 'phone-mobile',
-            'fax'               => 'phone-businessfax',
-            'instantMessenger'  => 'im-address',
-            /* Organization */
-            'title'             => 'job-title',
-            'role'              => 'profession',
-            'company'           => 'organization',
-            'department'        => 'department',
-            'office'            => 'office-location',
-            'manager'           => 'manager-name',
-            'assistant'         => 'assistant',
-            /* Other */
-            'category'          => 'categories',
-            'notes'             => 'body',
-            'website'           => 'web-page',
-            'freebusyUrl'       => 'free-busy-url',
-            'language'          => 'language',
-            'latitude'          => 'latitude',
-            'longitude'         => 'longitude',
-            /* Invisible */
-            'email'             => 'email',
-            'pgpPublicKey'      => 'pgp-publickey',
-        ),
-        'tabs' => array(
-            _("Personal") => array('name', 'firstname', 'lastname', 'middlenames',
-                                   'namePrefix', 'nameSuffix', 'initials', 'nickname',
-                                   'photo', 'gender', 'birthday', 'spouse', 'anniversary',
-                                   'children'),
-            _("Location") => array('homeStreet', 'homeCity', 'homeProvince',
-                                   'homePostalCode', 'homeCountry', 'workStreet',
-                                   'workCity', 'workProvince', 'workPostalCode',
-                                   'workCountry'),
-            _("Communications") => array('emails', 'homePhone', 'workPhone',
-                                         'cellPhone', 'fax', 'instantMessenger'),
-            _("Organization") => array('title', 'role', 'company', 'department',
-                                       'office', 'manager', 'assistant'),
-            _("Other") => array('category', 'notes', 'website', 'freebusyUrl',
-                                'language', 'latitude', 'longitude'),
-        ),
-        'search' => array(
-            /* Personal */
-            'name',
-            'firstname',
-            'lastname',
-            'middlenames',
-            'namePrefix',
-            'nameSuffix',
-            'initials',
-            'nickname',
-            'gender',
-            'birthday',
-            'spouse',
-            'anniversary',
-            'children',
-            /* Location */
-            'workStreet',
-            'workCity',
-            'workProvince',
-            'workPostalCode',
-            'workCountry',
-            'homeStreet',
-            'homeCity',
-            'homeProvince',
-            'homePostalCode',
-            'homeCountry',
-            /* Communications */
-            'emails',
-            'homePhone',
-            'workPhone',
-            'cellPhone',
-            'fax',
-            'instantMessenger',
-            /* Organization */
-            'title',
-            'role',
-            'company',
-            'department',
-            'office',
-            'manager',
-            'assistant',
-            /* Other */
-            'category',
-            'notes',
-            'website',
-            'language',
-        ),
-        'strict' => array(
-            'uid',
-        ),
-        'export' => true,
-        'browse' => true,
-        'use_shares' => true,
-        'shares_only' => true,
-    );
-}
-/* End Kolab sources. */
index 365ca2c..7606ca1 100644 (file)
@@ -2,6 +2,7 @@
 v3.0-git
 --------
 
+[jan] Rename sources.php to backends.php.
 [mjr] If default addressbook is not browsable, try one from the addressbook pref
       (Request: 6536).
 [jan] Add duplicate search and merging.
index da49273..05109db 100644 (file)
@@ -150,10 +150,10 @@ Configuring Turba
 
    Documentation on the format and purpose of those files can be found in each
    file.  You may edit these files if you wish to customize Turba's appearance
-   and behaviour.  With the exception of the ``sources.php`` file the defaults
+   and behaviour.  With the exception of the ``backends.php`` file the defaults
    will be correct for most sites.
 
-   You must configure ``sources.php`` to list your data sources (both SQL and
+   You must configure ``backends.php`` to list your data sources (both SQL and
    LDAP if necessary).  This configuration file contains a large number of
    **examples**.  Please remove or comment out those examples that **you don't
    need**.
index 9287276..5eeaf11 100644 (file)
@@ -10,14 +10,14 @@ stored on the same LDAP server.
 This is not comprehensive, but it notes how some users have implemented
 personal LDAP address books.
 
-1. Configure ``turba/config/sources.php``.
+1. Configure ``turba/config/backends.php``.
 
    Note that OpenLDAP and some other LDAP servers use UTF8 to encode its data,
    so you should have ``encoding = 'utf8'`` set in the parameters for your
    LDAP address book source.
 
    There is an example of personal address books in
-   ``turba/config/sources.php.dist``.  You will have to modify it to to match
+   ``turba/config/backends.php.dist``.  You will have to modify it to to match
    the fields, settings, and schema of your LDAP server, but it's a solid
    place to start.
 
index 4cb2a75..ac8fc7b 100644 (file)
@@ -13,6 +13,10 @@ use the updated data with your old Turba version anymore.
 Upgrading Turba from 2.x to 3.x
 ===============================
 
+
+The ``config/sources.php`` configuration file has been renamed to
+``config/backends.php``.
+
 The ``_turba_hook_encode_{attribute}`` hook has been moved to the
 'encode_attribute' hook.
 
index ba47d65..22b63ce 100644 (file)
@@ -123,7 +123,7 @@ class Turba_Api extends Horde_Registry_Api
         global $prefs;
 
         // Bring in a clean copy of sources.
-        require TURBA_BASE . '/config/sources.php';
+        require TURBA_BASE . '/config/backends.php';
 
         if (!empty($_SESSION['turba']['has_share'])) {
             $shares = Turba::listShares(true);
index ca5e0ca..0b1201b 100644 (file)
@@ -70,7 +70,7 @@ class Turba_Application extends Horde_Registry_Application
 
         // Turba source and attribute configuration.
         $attributes = Horde::loadConfiguration('attributes.php', 'attributes', 'turba');
-        include TURBA_BASE . '/config/sources.php';
+        include TURBA_BASE . '/config/backends.php';
 
         /* UGLY UGLY UGLY - we should NOT be using this as a global
          * variable all over the place. */
@@ -147,7 +147,7 @@ class Turba_Application extends Horde_Registry_Application
      */
     public function perms()
     {
-        require TURBA_BASE . '/config/sources.php';
+        require TURBA_BASE . '/config/backends.php';
 
         $perms['tree']['turba']['sources'] = false;
         $perms['title']['turba:sources'] = _("Sources");
@@ -387,7 +387,7 @@ class Turba_Application extends Horde_Registry_Application
     public function removeUserData($user)
     {
         /* We need a clean copy of the $cfgSources array here.*/
-        require TURBA_BASE . '/config/sources.php';
+        require TURBA_BASE . '/config/backends.php';
 
         foreach ($cfgSources as $source) {
             if (empty($source['use_shares'])) {
index 0fa8880..f10489f 100644 (file)
@@ -56,7 +56,7 @@ class Turba_Driver implements Countable
 
     /**
      * Array of fields to search "approximately" (@see
-     * config/sources.php.dist).
+     * config/backends.php.dist).
      *
      * @var array
      */
index 3ffc497..d3c4039 100644 (file)
@@ -33,7 +33,7 @@ class Turba_Form_CreateAddressBook extends Horde_Form
     function execute()
     {
         // Need a clean cfgSources array
-        include TURBA_BASE . '/config/sources.php';
+        include TURBA_BASE . '/config/backends.php';
 
         $driver = $GLOBALS['injector']->getInstance('Turba_Driver')->getDriver($cfgSources[$GLOBALS['conf']['shares']['source']]);
 
index 0fe96ed..ed713b4 100644 (file)
@@ -54,7 +54,7 @@ class Turba_Test extends Horde_Test
         'config/conf.php' => null,
         'config/mime_drivers.php' => null,
         'config/prefs.php' => null,
-        'config/sources.php' => null
+        'config/backends.php' => null
     );
 
     /**
index 9a46681..bcf5310 100644 (file)
@@ -366,7 +366,7 @@ class Turba {
      *
      * This will only sync shares that are unique to Horde (basically, a SQL
      * driver source for now).  Any backend that supports ACLs or similar
-     * mechanism should be configured from within sources.php or
+     * mechanism should be configured from within backends.php or
      * _horde_hook_share_* calls.
      *
      * @param array $sources  The default $cfgSources array.
@@ -502,7 +502,7 @@ class Turba {
     function getSourceFromShare($share)
     {
         // Require a fresh config file.
-        require TURBA_BASE . '/config/sources.php';
+        require TURBA_BASE . '/config/backends.php';
 
         $params = @unserialize($share->get('params'));
         $newConfig = $cfgSources[$params['source']];
index 2261315..f829764 100644 (file)
@@ -149,7 +149,7 @@ class Turba_KolabTestBase extends Horde_Kolab_Test_Storage
 
         // Turba source and attribute configuration.
         include TURBA_BASE . '/config/attributes.php';
-        include TURBA_BASE . '/config/sources.php';
+        include TURBA_BASE . '/config/backends.php';
         unset($cfgSources['kolab_global']);
 
         $this->prepareNewFolder($world['storage'], 'Contacts', 'contact', true);
index 7291ef5..0f60edc 100755 (executable)
@@ -64,7 +64,7 @@ foreach($files as $file) {
 
     // Reset $cfgSources for current user.
     unset($cfgSources);
-    include TURBA_BASE . '/config/sources.php';
+    include TURBA_BASE . '/config/backends.php';
     $cfgSources = Turba::getConfigFromShares($cfgSources);
     $cfgSources = Turba::permissionsFilter($cfgSources);
 
index 8f8db05..87f52c7 100755 (executable)
@@ -61,7 +61,7 @@ while ($row = $handle->fetchRow(DB_FETCHMODE_ASSOC)) {
         // Reset $cfgSources for current user.
         unset($cfgSources);
         $hasShares = false;
-        include TURBA_BASE . '/config/sources.php';
+        include TURBA_BASE . '/config/backends.php';
         foreach ($cfgSources as $key => $cfg) {
             if (!empty($cfg['use_shares'])) {
                 $has_share = true;
index 607c1c8..5496aef 100755 (executable)
@@ -10,7 +10,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php';
 Horde_Registry::appInit('turba', array('authentication' => 'none', 'cli' => true));
 
 // Re-load source config.
-require TURBA_BASE . '/config/sources.php';
+require TURBA_BASE . '/config/backends.php';
 
 // See if any of our sources are configured to use Horde_Share.
 if (empty($_SESSION['turba']['has_share'])) {