[horde] Individual hosts in gollem

Christopher Neuhaus cne at ruhrverband.de
Fri May 4 19:33:46 UTC 2012


Hi Jan,

sorry for my short expression.
We use this hook to get the right authentication-server for the login:

/horde/config/hooks.php:
---------------------------------
class Horde_Hooks
{
public function preauthenticate($userId, $credentials)
{
 require dirname(__FILE__) . '/../imp/config/backends.local.php';
 $ma = exec("/usr/bin/ypmatch $userId mail.aliases");
 if ( strpos($ma,",")) {
        $ma = substr($ma,0,strpos($ma,","));
        $mserver = strtolower(substr($ma,strpos($ma,"@")+1));
 } else {
        $mserver = strtolower(substr($ma,strpos($ma,"@")+1));
 }
 foreach ( $servers as $key => $curServer ) {
        if ( $servers[$key]['smtphost'] == $mserver ) {
        $credentials['server'] = $key;
        break;
        }
 }
 return array('credentials' => $credentials);
}
}
---------------------------------
Now we want to use the same serverlist from
'/../imp/config/backends.local.php' to choose the server for the
smb-authentication in gollem.

My solution is now in /var/www/horde/gollem/config/backends.local.php
---------------------------------
$rv_auth = $GLOBALS['registry']->getAuth('bare');
require dirname(__FILE__) . '/../../imp/config/backends.local.php';
$ma = exec("/usr/bin/ypmatch $rv_auth mail.aliases");

 if ( strpos($ma,",")) {
[...] see above

$backends['smb'] = array(
    'disabled' => false,
    [...]
    'params' => array(
        'hostspec' => $mserver,
        'port' => 139,
        'share' => $rv_auth,
    [...]


---------------------------------

This mods are not really robust and make a bad performance on the
login-site.
I think there can be a better solution.

Have you an idea?

Best Regards

Christopher

>
> Zitat von Christopher Neuhaus <cne at ruhrverband.de>:
>
>> Hi List!
>>
>> I just try to get the list of servers on which the user can log in by
>> smb in gollem.
>> In horde and IMP, this is no problem, because I can use the hook to
>> extract the server from the mail address, I can get from yellow pages
>> (ypmatch).
>>
>> But how can I do this in gollem?
>
> Please use more words to describe exactly what you are trying to do,
> how you do that in IMP, what you tried in Gollem, and what didn't
> work, including examples.
>




More information about the horde mailing list