• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Horde Shared Address Book [Turba]

K

Kevlar3D

Guest
Anyone experimented with creating a shared address book with turba?

I know it would be setup with the sources.php file in the turba directory, but im having trouble with how to authenticate users.

For example, i want all the users on xyz.com to be able to share their address book, but i dont want users on zyx.com to be able to see xyz.com's shared address book

Should i use a sql address book or install openldap and use an ldap address book.

Thanks in advance!
 
Hi,

Using Mysql:

Create a new table in the Horde db (copy my code between the ### and safe as "turba_shared.sql". Then import using mysqlfront or phpmyadmin or whatever)

#################################################
USE `horde`;

CREATE TABLE `turba_public` (
`object_id` varchar(32) NOT NULL default '',
`owner_id` varchar(255) NOT NULL default '',
`object_type` varchar(255) NOT NULL default 'Object',
`object_members` blob,
`object_name` varchar(255) default NULL,
`object_alias` varchar(32) default NULL,
`object_email` varchar(255) default NULL,
`object_homeaddress` varchar(255) default NULL,
`object_workaddress` varchar(255) default NULL,
`object_homephone` varchar(25) default NULL,
`object_workphone` varchar(25) default NULL,
`object_cellphone` varchar(25) default NULL,
`object_fax` varchar(25) default NULL,
`object_title` varchar(255) default NULL,
`object_company` varchar(255) default NULL,
`object_notes` text,
`object_uid` varchar(255) default NULL,
`object_freebusyurl` varchar(255) default NULL,
`object_smimepublickey` text,
`object_pgppublickey` text,
PRIMARY KEY (`object_id`),
KEY `turba_owner_idx` (`owner_id`)
) TYPE=MyISAM;

/*!40101 SET NAMES latin1 */;
#################################################

Next, open /etc/psa-horde/turba/sources.php and add everything what I insered between the next ### after the last line of the file

#################################################
IF _(preg_replace('/^webmail./', '', $GLOBALS['HTTP_SERVER_VARS']['SERVER_NAME']) ) = 'domain.com' {

$cfgSources['localsqlpublic'] = array(
'title' => _("Shared addressbook"),
'type' => 'sql',
'params' => array_merge($conf['sql'], array('table' => 'turba_public')),
'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'
),
'search' => array(
'name',
'email'
),
'strict' => array(
'object_id',

),
'public' => true,
'readonly' => true,
'admin' => array('*@domain.com'),
'export' => true
);
}
##################################################

Change "*@domain.com" to your needs.

Now open in the same directory the prefs.php file and change it to the following:

// Default directory
$_prefs['default_dir'] = array(
'value' => 'localsql',
'locked' => false,
'shared' => true,
'type' => 'select',
'desc' => _("Default directory for your personal addressbook, contact lists, and searches.")
);

Now you have a shared adressbook. To restrict access only to one domain I have put it in a IF routine (I'll hope the syntax is ok, if not other readers may correct me) :)

...and don't forget to change all the 'domain.com' in the code !

Hope this will help you

Regards
Bart
 
You're welcome !

For me it worked, but in my case I didn't put it in a "IF" because it is simply shared for all horde users. I also used my own email address as admin for the addressbook, hope the "*" asterisk in front of the @ will work for you. If not test it first with an (in Horde) existing email address of you.
Let us know what you experienced, this feedback could be usefull for others.

Another tweak for users that wonders why they can't get in that damn "admin" directory of horde:

Simply add the following to your horde conf.php:

$conf['auth']['admins'] = array('[email protected]');

Then you will have a admin logo when you login to that account :D

BUT BE CAREFULL, do not overwrite your existing configs from that pannel if you don't know what you are doing !!! (But it could be a usefull tool for someone)

CU,
Bart
 
im getting:
Parse error: parse error, expecting `'('' in /etc/psa-horde/turba/sources.php on line 140

Warning: Invalid argument supplied for foreach() in /usr/share/psa-horde/turba/lib/Turba.php on line 249

Warning: factory(/usr/share/psa-horde/turba/lib/Driver/.php): failed to open stream: No such file or directory in /usr/share/psa-horde/turba/lib/Driver.php on line 820

Warning: factory(): Failed opening '/usr/share/psa-horde/turba/lib/Driver/.php' for inclusion (include_path='/usr/share/psa-horde/lib:/usr/share/psa-horde:/usr/share/psa-horde/pear:.') in /usr/share/psa-horde/turba/lib/Driver.php on line 820

Warning: Cannot modify header information - headers already sent by (output started at /etc/psa-horde/turba/sources.php:140) in /usr/share/psa-horde/turba/templates/common-header.inc on line 4

Warning: Cannot modify header information - headers already sent by (output started at /etc/psa-horde/turba/sources.php:140) in /usr/share/psa-horde/turba/templates/common-header.inc on line 5

line 140 is:
IF _(preg_replace('/^webmail./', '', $GLOBALS['HTTP_SERVER_VARS']['SERVER_NAME']) ) = 'domaingoeshere.com' {


admin works great, how do i specify more than one admin?
$conf['auth']['admins'] = array('[email protected]','[email protected]','[email protected]');

is that correct or am i formatting it incorrectly?
 
Yes the admins definition '[email protected]','[email protected]' is OK. BUT...are you sure you want to grant access to more than one user to your whole horde configuration ??? :eek: The "admin" in the horde conf has nothing to do with the admin line in your sources.php

Now I have fixed it with the addressbook:

Remove the complete IF... line (line 140) in your sources.php, I have found a better solution. Change the last lines of sources.php to:

),
'public' => false,
'readonly' => true,
'admin' => array('*@domain.com),
'export' => true
);
// }

I have tested this on my server, so it works fine ! (just change domain.com, do not remove the *)

Maybe you could copy your sources.php to this tread, so I can have a look at ?

Regards,

Bart
 
now im getting:

Parse error: parse error in /etc/psa-horde/turba/sources.php on line 176

Warning: reset(): Passed variable is not an array or object in /usr/share/psa-horde/turba/search.php on line 43

Warning: key(): Passed variable is not an array or object in /usr/share/psa-horde/turba/search.php on line 44

Warning: factory(/usr/share/psa-horde/turba/lib/Driver/.php): failed to open stream: No such file or directory in /usr/share/psa-horde/turba/lib/Driver.php on line 820

Warning: factory(): Failed opening '/usr/share/psa-horde/turba/lib/Driver/.php' for inclusion (include_path='/usr/share/psa-horde/lib:/usr/share/psa-horde:/usr/share/psa-horde/pear:.') in /usr/share/psa-horde/turba/lib/Driver.php on line 820

Warning: Cannot modify header information - headers already sent by (output started at /etc/psa-horde/turba/sources.php:176) in /usr/share/psa-horde/turba/templates/common-header.inc on line 4

Warning: Cannot modify header information - headers already sent by (output started at /etc/psa-horde/turba/sources.php:176) in /usr/share/psa-horde/turba/templates/common-header.inc on line 5
 
i clipped off some of the commented out part @ the top, but here is the rest of it.

/**
* 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['localsqlpublic'] = array(
'title' => _("Shared addressbook"),
'type' => 'sql',
'params' => array_merge($conf['sql'], array('table' => 'turba_public')),
'map' => array(
'__key' => 'object_id',
'__owner' => 'owner_id',
'object_type',
),
'public' => false,
'readonly' => false,
'admin' => array(),
'export' => true
);
$cfgSources['localsqlpublic'] = array(
'title' => _("Shared addressbook"),
'type' => 'sql',
'params' => array_merge($conf['sql'], array('table' => 'turba_public')),
'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'
),
'search' => array(
'name',
'email'
),
'strict' => array(
'object_id',

),
'public' => false,
'readonly' => true,
'admin' => array('*@reallysuperduperniftydomain.com'),
'export' => true
);
}
 
Hi,

You've typed mismatch !
You wrote 2 times:

$cfgSources['localsqlpublic'] = array(
'title' => _("Shared addressbook"),

So, do you have 2 shared addressbooks ? (NO)
Also delete the "}" on the last line !

It should be:
#################################################
/**
* 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['localsqlpublic'] = array(
'title' => _("Shared addressbook"),
'type' => 'sql',
'params' => array_merge($conf['sql'], array('table' => 'turba_public')),
'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'
),
'search' => array(
'name',
'email'
),
'strict' => array(
'object_id',

),
'public' => false,
'readonly' => true,
'admin' => array('*@reallysuperduperniftydomain.com'),
'export' => true
);
##################################################

The syntax is OK

G.luck

Bart
 
and we have a winner.

thanks for catching my error, your solution works perfectly.

Many thanks.
 
Nice I could help you

...and it was time to include this thing into the Plesk forum, I was already searching here for a solution last year but I had to search thru the Horde and IMP MARC mailing list. Now everything has changed in Horde 3 I had to search again to customize horde for a client.
Personally I find that I had to change too much php file code, which is awfull when you update later. Also good documentation about horde3 IMP4 is hard to find (it's too new I guess). That the installation is now separated in two locations is also a bad idea (/etc and /usr/share) I don't like that.

Also I have found a bug in the horde installation of Plesk. When you try to enable ms-word attachments viewing in IMP and you install the wvHtml, Horde will tell you that the application isn't installed at that location.
I set the correct path in horde/mime_drivers.php:

$mime_drivers['horde']['msword']['location'] = '/usr/local/bin/wvHtml';

I looked if wvHtml was there and also tested it successfull, but Horde still reported he couldn't find it on this location. So I made a workaround in the /usr/share/psa-horde/lib/horde/MIME/viewer/msword.php and commented these lines:

/* Check to make sure the program actually exists.
if (!file_exists($mime_drivers['horde']['msword']['location'])) {
return '<pre>' . sprintf(_("The program used to view this data type (%s) was not found on the system."), $mime_drivers['horde']['msword']['location']) . '</pre>';
}*/

After that change, word-attachment preview worked fine.


CU
Bart
 
Problem reading rtf file

When attempting to view an rtf file, the following error is displayed in Horde. I've read some fixes, those that I could fine, but no luck so far.

Ver. 75050509.16


Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/wvHtml) is not within the allowed path(s): (/usr/share/psa-horde:/etc/psa-horde:/etc/psa:/tmp:/var/log:/usr/share/doc) in /usr/share/psa-horde/lib/Horde/MIME/Viewer/msword.php on line 34
 
not really related to this issue, but ill try and help.

go to your mime_drivers.php file and check what external application is associated with msword (rtf) documents.

maybe even set inline to disable if you cant get the viewer to work right.


<?php
/**
* MS Word driver settings
* This driver requires wvWare (www.wvware.com) to be installed.
*/

/* Location of the wvHtml binary. */
$mime_drivers ['horde'] ['msword'] ['location'] = '/usr/bin/wvHtml';
$mime_drivers ['horde'] ['msword'] ['inline'] = true;
$mime_drivers ['horde'] ['msword'] ['handles'] = array (
'applicaton/msword',
'text/rtf',
'x-extension/doc',
'x-extension/rtf');
$mime_drivers ['horde'] ['msword'] ['icons'] = array (
'default' => 'msword.gif');
 
Back
Top