[turba] Restrincting to a shared read-only address book

Jan Schneider jan at horde.org
Wed May 16 22:43:22 UTC 2007


Zitat von Michael Rubinsky <mike at theupstairsroom.com>:

> Quoting Luigi Iotti <horde at iotti.biz>:
>
>> Hi all
>>
>> I'm new to the list. I'm preparing a locked-in IMP-4.1.3 + Turba-2.1.2
>> environment. All the prefs are locked by default.
>> I'd like to have only one address book, which should be shared and read-only
>> for all the users, except for an "admin" user who can update the address
>> book. I obtained almost everything I wanted: I created the admin user,
>> created the localsql address book, shared it in the admin user, applied only
>> show and read permissions for others.
>> My users see the address book and are able to use it. They can use only this
>> address book since I set both the addressbooks and default_dir prefs to
>> localsql:admin.
>> The only thing I can't get rid of is the "My Address Book" button on the top
>> left of the Turba menu bar and, if I click on it, I am presented with the
>> options to create a new address book or modify the user's existing one.
>> These options are not usable at all, since the user only sees the admin's
>> address book, but their presence is annoying.
>> On the other hand, having a look at the code it seems that this button is
>> showed because the localsql source is configured with use_shares = true . I
>> can't change this since admin needs it to be able to share the address book.
>>
>> The only way I found to get rid of the button was to comment out the
>> following lines from lib/Turba.php :
>> if ($GLOBALS['haveShare']) {
>>   $menu->add(Horde::applicationUrl('addressbooks.php'), _("_My Address
>> Books"), 'turba.png');
>> }
>>
>> But I don't like to mess with the code. Is there a way to have only the
>> admin user to own an address book, or to map the use_shares attribute on a
>> per-user basis, or some other trick to make that button disappear?
>> Or maybe, a new pref could be introduced to force $GLOBALS['haveShare'] to
>> be false even if the source has use_shares = true ?
>
> Not currently. In fact, setting $GLOBALS['haveShare'] to false would  
>  prevent any of your shared sources from loading as that is what  
> flags  base.php to load all the shares available to the user.   
> Commenting out  the menu is currently the only way I can think of to  
> have the  functionalitly of shares, without showing the My  
> AddressBook page.  Of  course, this won't prevent users from  
> navigating there directly,  although there is nothing they can  
> really do once there.
>
> I suppose an argument could be made for adding either a  
> configuration  option or maybe a new permission to Turba that could  
> toggle the  availability of the My Addressbook page?

This is not quite sure. You can still create non-share address book  
and set permissions through the global (aka admin) permissions  
interface.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the turba mailing list