Author Topic: Script to sync users/contacts?  (Read 1415 times)

nontrivial

  • Zen Warrior
  • ***
  • Posts: 181
  • Karma: +16/-0
    • View Profile
Script to sync users/contacts?
« on: September 02, 2016, 12:02:02 am »
I am trying to write a perl script to synchronize contacts between Zentyal 4.2 and another system. I believe I can hook into the existing Zentyal perl modules to do what I want, which is to use the script to manage the "Shared Contacts". If anybody could help me with some questions I would greatly appreciate it:

 * What is the difference between users and contacts? From the code they seem to be pretty similar.
 * Does the Ebox::Samba::contacts() subroutine return users, shared contacts, or all contacts, or what?
 * I see how to create a contact, but how do I specify that I want to create a shared contact?
 * Can anybody point me to a list of valid parameters (fax, mobile, city, etc) when creating a contact?

nontrivial

  • Zen Warrior
  • ***
  • Posts: 181
  • Karma: +16/-0
    • View Profile
Re: Script to sync users/contacts?
« Reply #1 on: September 02, 2016, 11:41:36 pm »
After some research it seems that personal contacts and events are stored in the sogo database and can be easily manipulated. I believe that shared contacts are stored in LDAP, and I didn't want to fight through figuring all that out especially since I can't create one with the web interface to get an example. So I just got done writing a script that mangles the right table in the sogo database and I will run it via cron daily. I'll share that address book appropriately, which is not as convenient as using shared contacts but it will get the job done.

If anybody wants to answer any of my original questions I would appreciate it!