Koozali.org: home of the SME Server

Addressbook sharing Horde

Offline bas

  • *
  • 31
  • +0/-0
Addressbook sharing Horde
« on: June 02, 2006, 12:13:36 AM »
Here's the same request I did a few month's ago.

http://forums.contribs.org/index.php?topic=29007.0

I still hope someone can help me out. I'm using horde30 on an sme6.01 using Jbennett's install_horde30.sh. According to the horde website I should be able to create and share addressbooks, but I'm not.
I think it should work in the same way you can create/share calanders, notes and tasks.

Maybe the following info might help someone
> The way we do it is by using a shared mysql addressbook.
> Similiar to the normal "My addressbook" configuration with public set to
> "true", readonly set to "true", and admin set to my e-mail address.  This
> allows me, and only me, to add/delete from that addressbook---and everyone
> can use it.  You can even set up groups in the shared addressbook for
> everyone to use.  What this requires is setting up another addressbook in
> your database (mysql for me) and adding to sources.php.  The best part is
> that it works just like the normal Horde addressbook, so it's fairly easy
> to use.  We currently have 4 shared addressbooks.

Bas
......

stonemule

Addressbook sharing Horde
« Reply #1 on: June 21, 2006, 05:01:17 PM »
Bas,

We need this feature at work also.  I am going to get it done (this week?) and I will post the results here.
And maby a few dumb questions.


Thanks,
John
stonemule

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
Addressbook sharing Horde
« Reply #2 on: June 22, 2006, 01:13:22 AM »
Quote from: "stonemule"
Bas,

We need this feature at work also.  I am going to get it done (this week?) and I will post the results here.
And maby a few dumb questions.


Thanks,
John
stonemule


If you don't get this working, let me know and I'll try to tackle it sometime in the future.  I've been working on trying to get some additional horde-addon modules to work under 7.0.  I've got one other thing I need to get to work, then I'll have time.

JB
......

Offline bas

  • *
  • 31
  • +0/-0
Addressbook sharing Horde
« Reply #3 on: July 09, 2006, 10:37:17 PM »
Have you got any results already, John
stonemule?

Or could you help us JB?

Bas
......

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
Addressbook sharing Horde
« Reply #4 on: July 09, 2006, 11:12:52 PM »
Quote from: "bas"
Have you got any results already, John
stonemule?

Or could you help us JB?

Bas


Bas,

I hadn't been looking into this.  I'll put it on my list of todo's.  Other than the info in this thread and the link to the other thread, do you have any more info to add?

JB
......

Offline bas

  • *
  • 31
  • +0/-0
Addressbook sharing Horde
« Reply #5 on: July 10, 2006, 03:35:55 PM »
No, i'm sorry no further information.
......

stonemule

address book
« Reply #6 on: July 10, 2006, 09:53:33 PM »
Sorry,
Got sent out of town on some customer issues.

We still need to do this and I am setting a test server to take a swing.  

I can also put it out on the web if any one who wants to work whack on it.  It will be on line tomorrow. (Tuesday July 11th, 2006)

thanks
John
stonemule

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
Addressbook sharing Horde
« Reply #7 on: August 30, 2006, 06:12:32 AM »
I had a chance to look at this tonight and got it to work.  Here is what I did:
In /home/httpd/html/horde/turba/scripts/sql there is a script called turba_objects.mysql.sql.  I copied this file, then edited it and changed all of the lines that read turba_objects to turba_objects2.  You should only have to change 3 lines.  The top one with the -- is a remark.  Then, I ran
Code: [Select]
mysql horde < my_new_file-turba_objects.mysql.sql  That creates the necessary tables in the horde db for the new address book.  Then I went to /home/httpd/html/horde/turba/config and edited sources.php.  Copy the lines starting with $cfgSources['localsql'] = array( and ending with    
'export' => true
);
Paste the new lines after the above );.  Next edit the new lines and change the $cfgsources line to match new table name created earlier, change the title to whatever suites you, change the params line with the new table name as well, and change the public = false to public = true.  Save sources.php, refresh or re-login to webmail, go to address book and you should now have a third address book option.  
DO NOT MAKE ANY CHANGES IN SERVER-MANAGER THAT WILL UPDATE THE HORDE TEMPLATES BECAUSE YOU WILL LOSE THE ABOVE INFORMATION YOU JUST ENTERED FOR SOURCES.PHP.
This is because we have not yet templated the file.  After you have tested this to your liking, then you can create a templates-custom file so your changes will be made permanently.  Just copy the 40LocalSQL and edit it accordingly.

So, there is no confusion to what the sources.php file should look like, below is an example from my test server with the lines highlighted that I updated.
Code: [Select]

[root@www config]# more sources.php
<?php
/*
#------------------------------------------------------------
#              !!DO NOT MODIFY THIS FILE!!

# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at http&#58;//wiki.contribs.org/development/
#
# Copyright &#40;C&#41; 1999-2006 Mitel Networks Corporation
#------------------------------------------------------------
*/

/**
 * 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'&#93; = array&#40;
    
'title' => _&#40;"My Addressbook"&#41;,
    
'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&#58;
    
'params' => array_merge&#40;$conf['sql'&#93;, array&#40;'table' => 'turba_objects'&#41;&#41;,

    // Old Example&#58;
    // 'params' => array&#40;
    //     'phptype' => 'mysql',
    //     'hostspec' => 'localhost',
    //     'username' => 'horde',
    //     'password' => '*****',
    //     'database' => 'horde',
    //     'table' => 'turba_objects',
    //     'charset' => 'iso-8859-1'
    // &#41;,
    
'map' => array&#40;
        
'__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'
    
&#41;,
    
'search' => array&#40;
        
'name',
        
'email'
    
&#41;,
    
'strict' => array&#40;
        
'object_id',
        
'owner_id',
        
'object_type',
    &
#41;,
    
'public' => false,
    
'readonly' => false,
    
'admin' => array&#40;&#41;,
    
'export' => true
&#41;;

$cfgSources['localsql2'&#93; = array&#40;                      <--updated
    
'title' => _&#40;"Global Addressbook"&#41;,                <--updated
    
'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&#58;
    
'params' => array_merge&#40;$conf['sql'&#93;, array&#40;'table' => 'turba_objects2'&#41;&#41;,  <--updated

    
'map' => array&#40;
        
'__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'
    
&#41;,
    
'search' => array&#40;
        
'name',
        
'email'
    
&#41;,
    
'strict' => array&#40;
        
'object_id',
        
'owner_id',
        
'object_type',
    &
#41;,
    
'public' => true,              <--updated
    
'readonly' => false,
    
'admin' => array&#40;&#41;,
    
'export' => true
&#41;;

$cfgSources['localldap'&#93; = array&#40;
    
'title' => 'Local LDAP',
    
'type' => 'ldap',
    
'params' => array&#40;
        
'server' => 'localhost',
        
'port' => 389,
        
'tls' => false,
        
'root' => '',
        
'sizelimit' => 200,
        
'dn' => array&#40;'cn'&#41;,
        
'objectclass' => array&#40;'top',
                               
'person',
                               
'organizationalPerson','inetOrgPerson'&#41;,
        
'charset' => 'iso-8859-1',
        
// check if all required attributes for an entry are set and add them
        // if needed.
        
'checkrequired' => false,
        
// string to put in missing required attributes.
        
'checkrequired_string' => ' ',
        
'version' => 3
    
&#41;,
    
'map' => array&#40;
        
'__key' => 'dn',
        
'__uid' => 'uid',
        
'name' => 'cn',
        
'email' => 'mail',
        
'homePhone' => 'homephone',
        
'workPhone' => 'telephonenumber',
        
'cellPhone' => 'mobiletelephonenumber',
        
'homeAddress' => 'homepostaladdress',
        
'freebusyUrl' => 'calFBURL'
    
&#41;,
    
'search' => array&#40;
        
'name',
        
'email',
        
'homePhone',
        
'workPhone',
        
'cellPhone',
        
'homeAddress'
    
&#41;,
    
'strict' => array&#40;
        
'dn',
    &
#41;,
    
'public' => true,
    
'readonly' => true,
    
'admin' => array&#40;&#41;,
    
'export' => true
&#41;;
?>



So now when I click on address book, my dropdown box states My Addressbook, Global Addressbook, Local LDAP.  When I click on add, I can choose My Addressbook or Global Addressbook.

I tested this with admin and another user.  I added an entry to the Global Addressbook as admin, and was able to view same entry logged in as another user.  Only the user that created the contact can edit/delete the entry, or the admin has rights to all of the entries.

Also, from the post BAS made above, if you set readonly to true then users will only have readonly access to the address book.  If you set an admin address, then that user will have read/write access to the address book.  Admin will still have all rights.  Here is an example of what I am talking about.
Code: [Select]

'public' => true,
'readonly' => true,
'admin' => array('user1@mytest.com'),


HTH,

John H. Bennett III
......

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Working on SME7
« Reply #8 on: September 04, 2006, 12:12:39 AM »
Hi

Just to say THANK YOU by your quick and easy way to create a global address book.

I have done it work very quickly on SME7.
Maybe later I create a rpm with this info... not sure if it's a good thing to do.

Jáder
...

Offline bas

  • *
  • 31
  • +0/-0
Addressbook sharing Horde
« Reply #9 on: September 06, 2006, 01:00:05 AM »
Thanks for your help JB

I haven't been able to test it, but i will soon.

Bas
......

Offline jodahall

  • 6
  • +0/-0
Addressbook sharing Horde
« Reply #10 on: August 07, 2007, 11:49:29 PM »
I have a little problem with the global address book.

I have sme 7.1 and about 6 months ago I followed the instructions above to set up a global address book, they worked perfectly.

well i didn't setup a template and got a blackberry the other day....(you know where this is going don't you).  so needless to say, as soon as i saved my email settings in server manager.....BOOM there goes my address book.

well i tried to follow the instructions again to fix the sources.php file, and i did, but the addresses don't seem to be sharing.  all my users can update the global address book table, but they can only see their own.

what am i missing.  I followed the instructions to a tee. i have public set to true, i've checked the table and all the entries are in there.

I don't care about loosing the addresses in the table, because i have them backed up and can just import them, but I don't think i should have to.  I'm guessing that this is a configuration problem, something that i missed, because all users have read/write access to the table i created.

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
Addressbook sharing Horde
« Reply #11 on: August 08, 2007, 03:48:33 PM »
The settings you have were for a previous version of Turba, then 2.0x train.  Turba 2.1.4 needs new info.  Here is an example.
Code: [Select]
//41LocalSQL_GAB
/**
 * 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_gab'] = array(
    'title' => _("Global Address Book"),
    '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_gab')),

    // 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',
    ),
    'export' => true,
    'browse' => true,
    'use_shares' => false,
);


Note the remarks for owner_id and user_shares set to false.  If you need so set more restrictive permissions, i.e, you don't want users to be able to delete entries in the GAB, then use the horde permissions setup from the admin webmail login.  This is visible if you have  Administration=enabled set as a horde db entry.

John
......

Offline Brenno

  • ****
  • 208
  • +0/-0
Re: Addressbook sharing Horde
« Reply #12 on: August 17, 2007, 07:46:24 PM »
Wow... this seems really cool, especially if these Global addresses are available for LDAP lookup from other network appliances or programs (like high-end copiers or desktop mail clients.)

Any odds of this becoming a bona-fide contrib and rpm?

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
Re: Addressbook sharing Horde
« Reply #13 on: August 17, 2007, 07:56:32 PM »
Wow... this seems really cool, especially if these Global addresses are available for LDAP lookup from other network appliances or programs (like high-end copiers or desktop mail clients.)

Any odds of this becoming a bona-fide contrib and rpm?

The users are not available for lookup from LDAP.  The entries are stored in MySQL.  I don't know enough about LDAP right now to know how to get a new DB created and how this db would get backed up and restored.  Any ideas from anyone?

John
......

Offline shawnbishop

  • ****
  • 298
  • +0/-0
Re: Addressbook sharing Horde
« Reply #14 on: July 14, 2009, 11:36:07 AM »
Hi Guys

any update on this, a global address book??