[imp] adding realm in IMP6

Leena Heino Leena.Heino at uta.fi
Wed Nov 28 15:05:24 UTC 2012


On Fri, 17 Aug 2012, Andrew Morgan wrote:

>     public function authusername($userId, $toHorde)
>     {
>        if ($toHorde) {
>                // Put the domain on from backends.local.php
>                $imap = 
> $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create();
>                $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 {
>                // strip the domain off
>                $userId = substr($userId, 0, strpos($userId, '@'));
>                return $userId;
>        }
>    }
>

Is there any way to make this work with IMP 6.0?

-- 
   Leena Heino              University of Tampere / Computer Centre
   ( liinu at uta.fi )      ( http://www.uta.fi/laitokset/tkk )


More information about the imp mailing list