[gollem] Multiple Group related Samba backends

Jan Schneider jan at horde.org
Thu Jun 8 02:25:07 PDT 2006


Zitat von Murray Trainer <mtrainer at central-data.net>:

> On Wed, 2006-06-07 at 17:13 +0200, Jan Schneider wrote:
>> Zitat von Murray Trainer <mtrainer at central-data.net>:
>>
>> > Hi All,
>> >
>> > Our LDAP users home Samba shares are accessible via Gollem - that works
>> > fine.  We also have some group Samba shares that only members of the
>> > LDAP group can access.  I have setup Horde to access groups via LDAP and
>> > that works fine.  I have setup a smb backend for one of the group Samba
>> > shares and only members of the group can access it.  That's all great
>> > but we don't want anyone who is not a member of the group to even see
>> > the name of the share.  Any ideas how to achieve this?
>>
>> require_once 'Horde/Group.php';
>> $groups = &Group::singleton();
>> if ($groups->userIsInGroup(Auth::getAuth(), $group_dn)) {
>>      // Put share definition for $group_dn here.
>> }
>>
>> (untested)
>>
>> Jan.
>
> Hi Jan,
>
> The above works great - very much appreciated.  A minor issue is that
> the Login button appears when you click on File Manager despite the
> authentication being automatic.  Do I have to make one share the default
> or something?
>
> We may have many group shares in the future so it may become a pain to
> have to add a Gollem backend for every new share group.  In our setup
> each share name eg. staff corresponds to an LDAP share group eg.
> share_staff.  Is it possible to parse out the groups that match share_*
> from the user's list of groups and create a loop that automatically
> generates the backend for each one they are a member of?

Sure, use $groups->getGroupMemberships(Auth::getAuth())

You find the complete Group API on http://dev.horde.org/api/framework/

Jan.

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



More information about the gollem mailing list