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

Chuck Hagenbuch chuck@horde.org
Wed, 26 Sep 2001 17:46:28 -0400


You're using the exact same database table for these. The system isn't designed 
that way - use a different table (just in name - the schemas will match) for 
the public and private addressbooks.

Quoting m.ibarra@cdcixis-na.com:

> 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.
> 
> -- 
> Turba mailing list: http://horde.org/turba/
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: turba-unsubscribe@lists.horde.org
> 
> 


-chuck

--
Charles Hagenbuch, <chuck@horde.org>
"What was and what may be lie, like children whose faces we cannot see, in the 
arms of silence. All we ever have is here, now." - Ursula K. Le Guin