[imp] Re: Turba Shared Addressbook
Ed Geist
ejg@usnetway.com
Tue, 27 Aug 2002 08:50:59 -0400
> ..............newbie with ldap but learn fast. (Horde, Imp and Turba, as
well as openldap
> all functioning correctly at this point). Or is there another way to set
up
> a shared address book using mysql?
> Thanks,
>
Thanks to all who answered my request. A particular answer from my friend,
Florian has solved all the problems. With his permission, I am posting it
here so that others may benefit:
....Why don't you set up to tables in mysql e.g. turba_objects (the private
addressbook) an turba_open_objects (shared) (you can modify the
../turba/scripts/turba.sql script (modify the table name) then run it to
create the shared table in the horde mysql database)
Then you edit 'sources.php' in the config-directory and duplicate the array
for sql (mostly namedwhy don't you set up to tables in mysql e.g.
turba_objects (the private addressbook) an turba_open_objects (shared)
Then you edit 'sources.php' in the config-directory and duplicate the array
for sql (mostly named localsql) and rename it to
the name you like and then CHANGE the parameters 'public -> true' and
'readonly -> true' to prevent people from editing shared data.
This is an example:
$cfgSources['localsql'] = array(
'title' => 'my private',
'type' => 'sql',
'params' => array(
'phptype' => 'mysql',
'hostspec' => 'localhost',
'port' => '3306',
'username' => '********',
'password' => '********',
'database' => 'whatever_db',
'table' => 'turba_objects'
),
'map' => array(
'__key' => 'object_id',
'__owner' => 'owner_id',
'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' => false, <--- Sets the adressbook to private
'readonly' => false,
'admin' => array('admin','webmaster','info'), <---- This
allows admins to edit the adressbook anyway.
'export' => true
);
/**
* This implements a public (shared)
* address book.
*/
$cfgSources['sharedadb'] = array(
'title' => 'Shared Addressbook,
'type' => 'sql',
'params' => array(
'phptype' => 'mysql',
'hostspec' => 'localhost',
'port' => '3306',
'username' => '****',
'password' => '****,
'database' => '****',
'table' => 'turba_shared_objects'
),
'map' => array(
'__key' => 'object_id',
'__owner' => 'owner_id',
'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, <--- sets permission to view for every user .... you
could create an array like underneath -> admin
'readonly' => true, <--- sets normal user to readonly
'admin' => array('admin','webmaster','info'), <--- allows admins to edit
'export' => false
);
If you want to use both books with IMP, you have to edit 'prefs.php' in the
config-directory of IMP and edit this part:
// Addressbook preferences
// addressbook selection widget
$_prefs['sourceselect'] = array('type' => 'special');
// addressbook(s) to use when expanding addresses
// You can provide default values this way (note the \t and the double
quotes):
// 'value' => "source_one\tsource_two"
// refer to turba/config/sources.php for possible source values
$_prefs['search_sources'] = array(
'value' => "localsql\tsharedadb",
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// field(s) to use when expanding addresses
// This depends on the search_sources preference if you want to provide
default values:
// 'value' => "source_one\tfield_one\tfield_two\nsource_two\tfield_three"
// will search the fields 'field_one' and 'field_two' in source_one and
// 'field_three' in source_two.
// refer to turba/config/sources.php for possible source and field values
$_prefs['search_fields'] = array(
'value' => 'localsql\tname\temail\nsharedadb\tname\temail',
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// addressbook to use for adding adresseses
// put $cfgSources array element name in the value field.
// Setting value to localsql would allow you to add contacts to MySQL
database
// See turba/config/sources.php for more info
$_prefs['add_source'] = array(
'value' => 'localsql',
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// End Addressbook preferences
I hope this could help you.
Greetz
Florianwhy don't you set up to tables in mysql e.g. turba_objects (the
private addressbook) an turba_open_objects (shared)
Then you edit 'sources.php' in the config-directory and duplicate the array
for sql (mostly named localsql) and rename it to
the name you like and then CHANGE the parameters 'public -> true' and
'readonly -> true' to prevent people from editing shared data.
This is an example:
$cfgSources['localsql'] = array(
'title' => 'my private',
'type' => 'sql',
'params' => array(
'phptype' => 'mysql',
'hostspec' => 'localhost',
'port' => '3306',
'username' => '********',
'password' => '********',
'database' => 'whatever_db',
'table' => 'turba_objects'
),
'map' => array(
'__key' => 'object_id',
'__owner' => 'owner_id',
'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' => false, <--- Sets the adressbook to private
'readonly' => false,
'admin' => array('admin','webmaster','info'), <---- This
allows admins to edit the adressbook anyway.
'export' => true
);
/**
* This implements a public (shared)
* address book.
*/
$cfgSources['sharedadb'] = array(
'title' => 'Shared Addressbook,
'type' => 'sql',
'params' => array(
'phptype' => 'mysql',
'hostspec' => 'localhost',
'port' => '3306',
'username' => '****',
'password' => '****,
'database' => '****',
'table' => 'turba_shared_objects'
),
'map' => array(
'__key' => 'object_id',
'__owner' => 'owner_id',
'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, <--- sets permission to view for every user .... you
could create an array like underneath -> admin
'readonly' => true, <--- sets normal user to readonly
'admin' => array('admin','webmaster','info'), <--- allows admins to edit
'export' => false
);
If you want to use both books with IMP, you have to edit 'prefs.php' in the
config-directory of IMP and edit this part:
// Addressbook preferences
// addressbook selection widget
$_prefs['sourceselect'] = array('type' => 'special');
// addressbook(s) to use when expanding addresses
// You can provide default values this way (note the \t and the double
quotes):
// 'value' => "source_one\tsource_two"
// refer to turba/config/sources.php for possible source values
$_prefs['search_sources'] = array(
'value' => "localsql\tsharedadb",
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// field(s) to use when expanding addresses
// This depends on the search_sources preference if you want to provide
default values:
// 'value' => "source_one\tfield_one\tfield_two\nsource_two\tfield_three"
// will search the fields 'field_one' and 'field_two' in source_one and
// 'field_three' in source_two.
// refer to turba/config/sources.php for possible source and field values
$_prefs['search_fields'] = array(
'value' => 'localsql\tname\temail\nsharedadb\tname\temail',
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// addressbook to use for adding adresseses
// put $cfgSources array element name in the value field.
// Setting value to localsql would allow you to add contacts to MySQL
database
// See turba/config/sources.php for more info
$_prefs['add_source'] = array(
'value' => 'localsql',
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// End Addressbook preferences
I hope this could help you.
Greetz
Florianwhy don't you set up to tables in mysql e.g. turba_objects (the
private addressbook) an turba_open_objects (shared)
Then you edit 'sources.php' in the config-directory and duplicate the array
for sql (mostly named localsql) and rename it to
the name you like and then CHANGE the parameters 'public -> true' and
'readonly -> true' to prevent people from editing shared data.
This is an example:
$cfgSources['localsql'] = array(
'title' => 'my private',
'type' => 'sql',
'params' => array(
'phptype' => 'mysql',
'hostspec' => 'localhost',
'port' => '3306',
'username' => '********',
'password' => '********',
'database' => 'whatever_db',
'table' => 'turba_objects'
),
'map' => array(
'__key' => 'object_id',
'__owner' => 'owner_id',
'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' => false, <--- Sets the adressbook to private
'readonly' => false,
'admin' => array('admin','webmaster','info'), <---- This
allows admins to edit the adressbook anyway.
'export' => true
);
/**
* This implements a public (shared)
* address book.
*/
$cfgSources['sharedadb'] = array(
'title' => 'Shared Addressbook,
'type' => 'sql',
'params' => array(
'phptype' => 'mysql',
'hostspec' => 'localhost',
'port' => '3306',
'username' => '****',
'password' => '****,
'database' => '****',
'table' => 'turba_shared_objects'
),
'map' => array(
'__key' => 'object_id',
'__owner' => 'owner_id',
'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, <--- sets permission to view for every user .... you
could create an array like underneath -> admin
'readonly' => true, <--- sets normal user to readonly
'admin' => array('admin','webmaster','info'), <--- allows admins to edit
'export' => false
);
If you want to use both books with IMP, you have to edit 'prefs.php' in the
config-directory of IMP and edit this part:
// Addressbook preferences
// addressbook selection widget
$_prefs['sourceselect'] = array('type' => 'special');
// addressbook(s) to use when expanding addresses
// You can provide default values this way (note the \t and the double
quotes):
// 'value' => "source_one\tsource_two"
// refer to turba/config/sources.php for possible source values
$_prefs['search_sources'] = array(
'value' => "localsql\tsharedadb",
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// field(s) to use when expanding addresses
// This depends on the search_sources preference if you want to provide
default values:
// 'value' => "source_one\tfield_one\tfield_two\nsource_two\tfield_three"
// will search the fields 'field_one' and 'field_two' in source_one and
// 'field_three' in source_two.
// refer to turba/config/sources.php for possible source and field values
$_prefs['search_fields'] = array(
'value' => 'localsql\tname\temail\nsharedadb\tname\temail',
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// addressbook to use for adding adresseses
// put $cfgSources array element name in the value field.
// Setting value to localsql would allow you to add contacts to MySQL
database
// See turba/config/sources.php for more info
$_prefs['add_source'] = array(
'value' => 'localsql',
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// End Addressbook preferences
I hope this could help you.
Greetz
Florianwhy don't you set up to tables in mysql e.g. turba_objects (the
private addressbook) an turba_open_objects (shared)
Then you edit 'sources.php' in the config-directory and duplicate the array
for sql (mostly named localsql) and rename it to
the name you like and then CHANGE the parameters 'public -> true' and
'readonly -> true' to prevent people from editing shared data.
This is an example:
$cfgSources['localsql'] = array(
'title' => 'my private',
'type' => 'sql',
'params' => array(
'phptype' => 'mysql',
'hostspec' => 'localhost',
'port' => '3306',
'username' => '********',
'password' => '********',
'database' => 'whatever_db',
'table' => 'turba_objects'
),
'map' => array(
'__key' => 'object_id',
'__owner' => 'owner_id',
'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' => false, <--- Sets the adressbook to private
'readonly' => false,
'admin' => array('admin','webmaster','info'), <---- This
allows admins to edit the adressbook anyway.
'export' => true
);
/**
* This implements a public (shared)
* address book.
*/
$cfgSources['sharedadb'] = array(
'title' => 'Shared Addressbook,
'type' => 'sql',
'params' => array(
'phptype' => 'mysql',
'hostspec' => 'localhost',
'port' => '3306',
'username' => '****',
'password' => '****,
'database' => '****',
'table' => 'turba_shared_objects'
),
'map' => array(
'__key' => 'object_id',
'__owner' => 'owner_id',
'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, <--- sets permission to view for every user .... you
could create an array like underneath -> admin
'readonly' => true, <--- sets normal user to readonly
'admin' => array('admin','webmaster','info'), <--- allows admins to edit
'export' => false
);
If you want to use both books with IMP, you have to edit 'prefs.php' in the
config-directory of IMP and edit this part:
// Addressbook preferences
// addressbook selection widget
$_prefs['sourceselect'] = array('type' => 'special');
// addressbook(s) to use when expanding addresses
// You can provide default values this way (note the \t and the double
quotes):
// 'value' => "source_one\tsource_two"
// refer to turba/config/sources.php for possible source values
$_prefs['search_sources'] = array(
'value' => "localsql\tsharedadb",
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// field(s) to use when expanding addresses
// This depends on the search_sources preference if you want to provide
default values:
// 'value' => "source_one\tfield_one\tfield_two\nsource_two\tfield_three"
// will search the fields 'field_one' and 'field_two' in source_one and
// 'field_three' in source_two.
// refer to turba/config/sources.php for possible source and field values
$_prefs['search_fields'] = array(
'value' => 'localsql\tname\temail\nsharedadb\tname\temail',
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// addressbook to use for adding adresseses
// put $cfgSources array element name in the value field.
// Setting value to localsql would allow you to add contacts to MySQL
database
// See turba/config/sources.php for more info
$_prefs['add_source'] = array(
'value' => 'localsql',
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// End Addressbook preferences
I hope this could help you.
Greetz
Florianwhy don't you set up to tables in mysql e.g. turba_objects (the
private addressbook) an turba_open_objects (shared)
Then you edit 'sources.php' in the config-directory and duplicate the array
for sql (mostly named localsql) and rename it to
the name you like and then CHANGE the parameters 'public -> true' and
'readonly -> true' to prevent people from editing shared data.
This is an example:
$cfgSources['localsql'] = array(
'title' => 'my private',
'type' => 'sql',
'params' => array(
'phptype' => 'mysql',
'hostspec' => 'localhost',
'port' => '3306',
'username' => '********',
'password' => '********',
'database' => 'whatever_db',
'table' => 'turba_objects'
),
'map' => array(
'__key' => 'object_id',
'__owner' => 'owner_id',
'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' => false, <--- Sets the adressbook to private
'readonly' => false,
'admin' => array('admin','webmaster','info'), <---- This
allows admins to edit the adressbook anyway.
'export' => true
);
/**
* This implements a public (shared)
* address book.
*/
$cfgSources['sharedadb'] = array(
'title' => 'Shared Addressbook,
'type' => 'sql',
'params' => array(
'phptype' => 'mysql',
'hostspec' => 'localhost',
'port' => '3306',
'username' => '****',
'password' => '****,
'database' => '****',
'table' => 'turba_shared_objects'
),
'map' => array(
'__key' => 'object_id',
'__owner' => 'owner_id',
'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, <--- sets permission to view for every user .... you
could create an array like underneath -> admin
'readonly' => true, <--- sets normal user to readonly
'admin' => array('admin','webmaster','info'), <--- allows admins to edit
'export' => false
);
If you want to use both books with IMP, you have to edit 'prefs.php' in the
config-directory of IMP and edit this part:
// Addressbook preferences
// addressbook selection widget
$_prefs['sourceselect'] = array('type' => 'special');
// addressbook(s) to use when expanding addresses
// You can provide default values this way (note the \t and the double
quotes):
// 'value' => "source_one\tsource_two"
// refer to turba/config/sources.php for possible source values
$_prefs['search_sources'] = array(
'value' => "localsql\tsharedadb",
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// field(s) to use when expanding addresses
// This depends on the search_sources preference if you want to provide
default values:
// 'value' => "source_one\tfield_one\tfield_two\nsource_two\tfield_three"
// will search the fields 'field_one' and 'field_two' in source_one and
// 'field_three' in source_two.
// refer to turba/config/sources.php for possible source and field values
$_prefs['search_fields'] = array(
'value' => 'localsql\tname\temail\nsharedadb\tname\temail',
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// addressbook to use for adding adresseses
// put $cfgSources array element name in the value field.
// Setting value to localsql would allow you to add contacts to MySQL
database
// See turba/config/sources.php for more info
$_prefs['add_source'] = array(
'value' => 'localsql',
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// End Addressbook preferences
I hope this could help you.
Greetz
Florian localsql) and rename it to
the name you like and then CHANGE the parameters 'public -> true' and
'readonly -> true' to prevent people from editing shared data.
This is an example:
$cfgSources['localsql'] = array(
'title' => 'my private',
'type' => 'sql',
'params' => array(
'phptype' => 'mysql',
'hostspec' => 'localhost',
'port' => '3306',
'username' => '********',
'password' => '********',
'database' => 'whatever_db',
'table' => 'turba_objects'
),
'map' => array(
'__key' => 'object_id',
'__owner' => 'owner_id',
'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' => false, <--- Sets the adressbook to private
'readonly' => false,
'admin' => array('admin','webmaster','info'), <---- This
allows admins to edit the adressbook anyway.
'export' => true
);
/**
* This implements a public (shared)
* address book.
*/
$cfgSources['sharedadb'] = array(
'title' => 'Shared Addressbook,
'type' => 'sql',
'params' => array(
'phptype' => 'mysql',
'hostspec' => 'localhost',
'port' => '3306',
'username' => '****',
'password' => '****,
'database' => '****',
'table' => 'turba_shared_objects'
),
'map' => array(
'__key' => 'object_id',
'__owner' => 'owner_id',
'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, <--- sets permission to view for every user .... you
could create an array like underneath -> admin
'readonly' => true, <--- sets normal user to readonly
'admin' => array('admin','webmaster','info'), <--- allows admins to edit
'export' => false
);
If you want to use both books with IMP, you have to edit 'prefs.php' in the
config-directory of IMP and edit this part:
// Addressbook preferences
// addressbook selection widget
$_prefs['sourceselect'] = array('type' => 'special');
// addressbook(s) to use when expanding addresses
// You can provide default values this way (note the \t and the double
quotes):
// 'value' => "source_one\tsource_two"
// refer to turba/config/sources.php for possible source values
$_prefs['search_sources'] = array(
'value' => "localsql\tsharedadb",
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// field(s) to use when expanding addresses
// This depends on the search_sources preference if you want to provide
default values:
// 'value' => "source_one\tfield_one\tfield_two\nsource_two\tfield_three"
// will search the fields 'field_one' and 'field_two' in source_one and
// 'field_three' in source_two.
// refer to turba/config/sources.php for possible source and field values
$_prefs['search_fields'] = array(
'value' => 'localsql\tname\temail\nsharedadb\tname\temail',
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// addressbook to use for adding adresseses
// put $cfgSources array element name in the value field.
// Setting value to localsql would allow you to add contacts to MySQL
database
// See turba/config/sources.php for more info
$_prefs['add_source'] = array(
'value' => 'localsql',
'locked' => true,
'shared' => false,
'type' => 'implicit'
);
// End Addressbook preferences
I hope this could help you.
Greetz
Florian