I had a chance to look at this tonight and got it to work. Here is what I did:
In /home/httpd/html/horde/turba/scripts/sql there is a script called turba_objects.mysql.sql. I copied this file, then edited it and changed all of the lines that read turba_objects to turba_objects2. You should only have to change 3 lines. The top one with the -- is a remark. Then, I ran mysql horde < my_new_file-turba_objects.mysql.sql
That creates the necessary tables in the horde db for the new address book. Then I went to /home/httpd/html/horde/turba/config and edited sources.php. Copy the lines starting with $cfgSources['localsql'] = array( and ending with
'export' => true
);
Paste the new lines after the above );. Next edit the new lines and change the $cfgsources line to match new table name created earlier, change the title to whatever suites you, change the params line with the new table name as well, and change the public = false to public = true. Save sources.php, refresh or re-login to webmail, go to address book and you should now have a third address book option.
DO NOT MAKE ANY CHANGES IN SERVER-MANAGER THAT WILL UPDATE THE HORDE TEMPLATES BECAUSE YOU WILL LOSE THE ABOVE INFORMATION YOU JUST ENTERED FOR SOURCES.PHP.
This is because we have not yet templated the file. After you have tested this to your liking, then you can create a templates-custom file so your changes will be made permanently. Just copy the 40LocalSQL and edit it accordingly.
So, there is no confusion to what the sources.php file should look like, below is an example from my test server with the lines highlighted that I updated.
[root@www config]# more sources.php
<?php
/*
#------------------------------------------------------------
# !!DO NOT MODIFY THIS FILE!!
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at http://wiki.contribs.org/development/
#
# Copyright (C) 1999-2006 Mitel Networks Corporation
#------------------------------------------------------------
*/
/**
* A local address book in an SQL database. This implements a per-user
* address book.
*
* 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 Addressbook"),
'type' => 'sql',
// The default connection details are pulled from the Horde-wide
// SQL connection configuration.
//
// The old example illustrates how to use an alternate database
// configuration.
//
// New Example:
'params' => array_merge($conf['sql'], array('table' => 'turba_objects')),
// Old Example:
// 'params' => array(
// 'phptype' => 'mysql',
// 'hostspec' => 'localhost',
// 'username' => 'horde',
// 'password' => '*****',
// 'database' => 'horde',
// 'table' => 'turba_objects',
// 'charset' => 'iso-8859-1'
// ),
'map' => array(
'__key' => 'object_id',
'__owner' => 'owner_id',
'__type' => 'object_type',
'__members' => 'object_members',
'__uid' => 'object_uid',
'name' => 'object_name',
'email' => 'object_email',
'alias' => 'object_alias',
'homeAddress' => 'object_homeaddress',
'workAddress' => 'object_workaddress',
'homePhone' => 'object_homephone',
'workPhone' => 'object_workphone',
'cellPhone' => 'object_cellphone',
'fax' => 'object_fax',
'title' => 'object_title',
'company' => 'object_company',
'notes' => 'object_notes',
'pgpPublicKey' => 'object_pgppublickey',
'smimePublicKey' => 'object_smimepublickey',
'freebusyUrl' => 'object_freebusyurl'
),
'search' => array(
'name',
'email'
),
'strict' => array(
'object_id',
'owner_id',
'object_type',
),
'public' => false,
'readonly' => false,
'admin' => array(),
'export' => true
);
$cfgSources['localsql2'] = array( <--updated
'title' => _("Global Addressbook"), <--updated
'type' => 'sql',
// The default connection details are pulled from the Horde-wide
// SQL connection configuration.
//
// The old example illustrates how to use an alternate database
// configuration.
//
// New Example:
'params' => array_merge($conf['sql'], array('table' => 'turba_objects2')), <--updated
'map' => array(
'__key' => 'object_id',
'__owner' => 'owner_id',
'__type' => 'object_type',
'__members' => 'object_members',
'__uid' => 'object_uid',
'name' => 'object_name',
'email' => 'object_email',
'alias' => 'object_alias',
'homeAddress' => 'object_homeaddress',
'workAddress' => 'object_workaddress',
'homePhone' => 'object_homephone',
'workPhone' => 'object_workphone',
'cellPhone' => 'object_cellphone',
'fax' => 'object_fax',
'title' => 'object_title',
'company' => 'object_company',
'notes' => 'object_notes',
'pgpPublicKey' => 'object_pgppublickey',
'smimePublicKey' => 'object_smimepublickey',
'freebusyUrl' => 'object_freebusyurl'
),
'search' => array(
'name',
'email'
),
'strict' => array(
'object_id',
'owner_id',
'object_type',
),
'public' => true, <--updated
'readonly' => false,
'admin' => array(),
'export' => true
);
$cfgSources['localldap'] = array(
'title' => 'Local LDAP',
'type' => 'ldap',
'params' => array(
'server' => 'localhost',
'port' => 389,
'tls' => false,
'root' => '',
'sizelimit' => 200,
'dn' => array('cn'),
'objectclass' => array('top',
'person',
'organizationalPerson','inetOrgPerson'),
'charset' => 'iso-8859-1',
// check if all required attributes for an entry are set and add them
// if needed.
'checkrequired' => false,
// string to put in missing required attributes.
'checkrequired_string' => ' ',
'version' => 3
),
'map' => array(
'__key' => 'dn',
'__uid' => 'uid',
'name' => 'cn',
'email' => 'mail',
'homePhone' => 'homephone',
'workPhone' => 'telephonenumber',
'cellPhone' => 'mobiletelephonenumber',
'homeAddress' => 'homepostaladdress',
'freebusyUrl' => 'calFBURL'
),
'search' => array(
'name',
'email',
'homePhone',
'workPhone',
'cellPhone',
'homeAddress'
),
'strict' => array(
'dn',
),
'public' => true,
'readonly' => true,
'admin' => array(),
'export' => true
);
?>
So now when I click on address book, my dropdown box states My Addressbook, Global Addressbook, Local LDAP. When I click on add, I can choose My Addressbook or Global Addressbook.
I tested this with admin and another user. I added an entry to the Global Addressbook as admin, and was able to view same entry logged in as another user. Only the user that created the contact can edit/delete the entry, or the admin has rights to all of the entries.
Also, from the post BAS made above, if you set readonly to true then users will only have readonly access to the address book. If you set an admin address, then that user will have read/write access to the address book. Admin will still have all rights. Here is an example of what I am talking about.
'public' => true,
'readonly' => true,
'admin' => array('user1@mytest.com'),
HTH,
John H. Bennett III