[turba] Shared addressbook

Adam Tauno Williams adam at morrison-ind.com
Mon Oct 17 08:46:32 PDT 2005


> In FRAMEWORK_3 code (Turba 2.X):
> Check the 'public' and 'readonly' config options available for each 
> source.  You
> could create a read-only but public LDAP address book, which would serve as a
> global shared address book, and also have a local private SQL addressbook.  Or
> you could have a local private SQL address book (turba_objects table) and a
> second SQL address book (turba_objects2 table, just clone the table name and
> adjust the config accordingly, and set it to public).  And so on...

The configuration file is a PHP script!  You can place any logic you
want there, so certain address books only appear for certain people.

You can access the logged in user's username via "Auth::getAuth()",  and
you can wrap a source stanza inside an if statement - as you see in the
default source file in relation to LDAP, there is a: "if
(Util::extensionExists('ldap')) {" to prevent LDAP sources for being
enabled if LDAP extension is not available.

The cleanest way, in my opinion, would be to define a locked preference
value to determine if the user should see a given address book.  You can
access preferences with something like
"$GLOBALS['prefs']->getValue('ldap_userdn')" to get the value of a
preference named "ldap_userdn".

So "if ($GLOBALS['prefs']->getValue('seeSpecialBook') == 'Y')
{ ...source definition ... }"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.horde.org/archives/turba/attachments/20051017/2b0c5ab7/attachment.bin


More information about the turba mailing list