[imp] Can i have more than 1 address books

Palomäki Kai Kai.Palomaki at vlp.fi
Mon Sep 20 23:11:12 PDT 2004


> I use IMP/TURBA for my users address book.
> 
> I want to setup a other centraly manage address book in mysql
> (read only for my users).
> 
> Can i do this with IMP/TURBA

Absolutely.
 
> What should my IMP and TURBA configs look like

This is how I have done it.

Just create new table in database (copy of turba_objects) for
example turba_public_objects.

Declare new address book source in turba/config/sources.php.

$cfgSources['publicsql'] = array(
    'title' => 'Public addressbook',
    'type' => 'sql',
    'params' => array(
        'phptype' => 'mysql',
        'hostspec' => 'localhost',
        'username' => 'user',
        'password' => 'password',
        'database' => 'horde',
        'table' => 'turba_public_objects'
    ),
    'map' => array(
        '__key' => 'object_id',
        '__owner' => 'owner_id',
        '__type' => 'object_type',
        '__members' => 'object_members',
        'name' => 'object_name',
        'email' => 'object_email',
        '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'
    ),
    'search' => array(
        'name',
        'email'
    ),
    'strict' => array(
        'object_id'
    ),
    'public' => true,
    'readonly' => true,
    'admin' => array(),
    'export' => true
);

And then tweak imp/config/prefs.php a little bit.
(localsql is private addressbook)

$_prefs['search_sources'] = array(
    'value' => "localsql\tpublicsql",
    'locked' => false,
    'shared' => false,
    'type' => 'implicit'
);

$_prefs['search_fields'] = array(
    'value' => "localsql\tname\temail\npublicsql\tname\temail",
    'locked' => false,
    'shared' => false,
    'type' => 'implicit'
);


More information about the imp mailing list