[horde] Extending userid's in Horde by a realm

Stephan Jacob stephan.jacob at ovgu.de
Thu Jun 12 07:53:51 UTC 2014


Thanks Michael,

I tried this but after log in I get a blank page (in
horde/config/hooks.local.php):

public function authusername($userId, $toHorde){
   if ($toHorde) {
    $imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap');
      $hostspec = $imap->ob->getParam('hostspec');
      $servers = IMP_Imap::loadServerConfig();
      foreach ($servers as $server) {
         if ($server['hostspec'] == $hostspec) {
            $userId = $userId . '@' . $server['realm'];
            break;
          }
      }
      return $userId;
   }
   else{
      $userId = substr($userId, 0, strpos($userId, '@'));
      return $userId;
   }
}

This first problem is "$imap =
$GLOBALS['injector']->getInstance('IMP_Factory_Imap');" This execution seems
not to work in Horde 5.1.6. 
In imps' backend.local.php I've  added    " 'realm' =>
'mailserver.domain.com', " to every server in the server array.

How can I modify the userid?



-----Ursprüngliche Nachricht-----
Von: horde-bounces at lists.horde.org [mailto:horde-bounces at lists.horde.org] Im
Auftrag von Michael M Slusarz
Gesendet: Donnerstag, 12. Juni 2014 09:42
An: horde at lists.horde.org
Betreff: Re: [horde] Extending userid's in Horde by a realm

Quoting Stephan Jacob <stephan.jacob at ovgu.de>:

> Hello,
>
> we run Horde 5.1.6 and imp 6.1.7.
>
> We want to extent our Horde installation to a central Horde/Imp server 
> which provides access to different peripheral IMAP server. So I 
> created a server list in imp's backend.local.php. Choosing and login 
> to the different server works well.
>
> Now we have the problem, that usernames are not unique among the 
> different IMAP server. That means, "user1" could be a valid userid for 
> IMAP server A and server B. But these are two different persons so 
> Horde should load different preferences for "user1" at server A and 
> "user1" at server B. For this, I want to extent the userid, the user 
> enters in the login form, by a realm. So the preferences in Horde are 
> stored under userid's like "user1 at serverA". I've googled a lot and 
> found an authusername hook for an old Horde version. Unfortunately 
> this hook doesn't work in Horde 5.16 and imp 6.1.7 Has someone an idea 
> how to extent the userid by a realm? This extension must be done after 
> the userid was send to the IMAP server, because the mail server need 
> the original userid for authentication (not the extended userid).

Horde's 'authusername' hook.

michael

___________________________________
Michael Slusarz [slusarz at horde.org]

--
Horde mailing list
Frequently Asked Questions: http://horde.org/faq/ To unsubscribe, mail:
horde-unsubscribe at lists.horde.org



More information about the horde mailing list