[gollem] Dynamic SMB location in gollem backend

Paul De Vlieger paul.de_vlieger at moniut.univ-bpclermont.fr
Wed Jan 8 09:01:36 UTC 2014


Le mar. 07 janv. 2014 02:10:53 CET, Matthew a écrit :
>
> Been setting up a new horde install, with imp, gollem and others.
> Authentication is imp-based, with the main horde username being
> my.name at mydomain.com - and then luckily the hordeauth parameter in the backend
> config allows me to then just take the my.name which my SMB back end requires
> for login.
>
> All good, working well with the 3 general shares on my server - each one
> getting a separate backend entry along the lines of:
>
> $backends['smbdocuments'] = array(
> 'disabled' => false,
> 'name' => 'Documents',
> 'driver' => 'smb',
> 'shares' => true,
> 'hordeauth' => true,
> 'params' => array(
> 'hostspec' => 'localhost',
> 'share' => 'documents',
> 'port' => 139,
> 'smbclient' => '/usr/bin/smbclient',
> )
>
> However, each user also has their own private share, which in my setup
> (Zentyal) must be accessed at localhost/my.name - so I need something like this:
>
> $backends['home'] = array(
> 'disabled' => false,
> 'name' => 'My home folder',
> 'driver' => 'smb',
> 'shares' => true,
> 'hordeauth' => true,
> 'params' => array(
> 'hostspec' => 'localhost/my.name',
> 'share' => '',
> 'port' => 139,
> 'smbclient' => '/usr/bin/smbclient',
> )
>
> Hardcoding this with my own name works just fine. But of course I need the
> my.name to reflect the logged in user. I can't quite figure out how/where/when
> I can do this - there don't seem to be hooks for gollem, and I don't think the
> global variables which would allow me to do something like:
>
> 'hostspec' => 'localhost/'.$GLOBALS['registry']->getAuth(true),
>
> Because that info isn't there yet when this backend config gets called. Any
> ideas as to how to achieve this?
>
> MTIA, Matthew
>

Works for me with username:
'share' => $_SESSION['horde']['0auth/authId'],
'host' => 'localhost',



More information about the gollem mailing list