[turba] Correct Way to Implement Public & Private Addressbook s?

m.ibarra@cdcixis-na.com m.ibarra@cdcixis-na.com
Wed, 19 Sep 2001 09:20:54 -0400


Here is a portion of my turba/config/sources.php file.



$cfgSources['localsql'] = array(
    'title' => 'Public List',
    'type' => 'sql',
    'params' => array(
        'phptype' => 'mysql',
        'hostspec' => 'localhost',
        'username' => 'hordesql',
        'password' => 'MYPASS',
        'database' => 'horde',
        'options' => '',
        'tty' => '',
        'port' => '4102',
        'protocol' => 'unix',
        'table' => 'Turba_Objects'
    ),
    'map' => array(
        '__key' => 'object_ID',
        '__owner' => 'owner_ID',
    	'name' => 'name',
    	'email' => 'email',
    	'homeAddress' => 'homeAddress',
    	'workAddress' => 'workAddress',
    	'homePhone' => 'homePhone',
    	'workPhone' => 'workPhone',
        'cellPhone' => 'cellPhone',
    	'fax' => 'fax',
    	'title' => 'title',
    	'company' => 'company',
    	'notes' => 'notes'
    ),
    'public' => true,
    'readonly' => false
);

$cfgSources['privatesql'] = array(
    'title' => 'Private List',
    'type' => 'sql',
    'params' => array(
        'phptype' => 'mysql',
        'hostspec' => 'localhost',
        'username' => 'hordesql',
        'password' => 'MYPASS',
        'database' => 'horde',
        'options' => '',
        'tty' => '',
        'port' => '4102',
        'protocol' => 'unix',
        'table' => 'Turba_Objects'
    ),
    'map' => array(
        '__key' => 'object_ID',
        '__owner' => 'owner_ID',
    	'name' => 'name',
    	'email' => 'email',
    	'homeAddress' => 'homeAddress',
    	'workAddress' => 'workAddress',
    	'homePhone' => 'homePhone',
    	'workPhone' => 'workPhone',
        'cellPhone' => 'cellPhone',
    	'fax' => 'fax',
    	'title' => 'title',
    	'company' => 'company',
    	'notes' => 'notes'
    ),
    'public' => false,
    'readonly' => false
);

?>


Turba is 0.0.3-cvs
Horde is latest cvs

I've added a whole new section, identical in every way to the
original "Local SQL" one, except for:

1. $cfgsources is ['privatesql'], instead of localsql
2. title is 'Private List' instead of Local SQL
3. public is now set to false.

Should the table be the same as well? As well as 
params and map array? So far I can add entries,
as well as see entries, but they are *all* public.