[dev] Patch for hordeauth in IMP

Joel Vandal jvandal at infoteck.qc.ca
Fri Oct 3 13:05:35 PDT 2003


Hi,

This patch allow to autologin on IMP when the $conf['server']['server_list'] IS NOT set to 'shown' and the server have only 1 server.


Index: login.php
===================================================================
RCS file: /repository/imp/login.php,v
retrieving revision 2.188
diff -r2.188 login.php
38a39
> $server_key = Util::getFormData('server_key');
131a133,170
> }
>
> $used_servers = $servers;
> if ($conf['server']['server_list'] != 'shown') {
>
>     $server_key = Util::getFormData('server_key');
>     if (is_null($server_key)) {
>       /* Grab some default values from the first entry in
>        *          * config/servers.php. */
>       foreach ($servers as $key => $curServer) {
>           if (is_null($server_key) && substr($key, 0, 1) != '_') {
>               $server_key = $key;
>           }
>           if (IMP::isPreferredServer($curServer)) {
>               $server_key = $key;
>               break;
>           }
>       }
>     }
>     $used_servers = array($server_key => $servers[$server_key]);
>     $autologin = Util::getFormData('autologin');
> }
>
> if (($reason == 'login') &&
>     (count($servers) == 2 || $autologin) &&
>     (Auth::getAuth() &&
>      !empty($servers[$server_key]['hordeauth']))) {
>     $url = Horde::applicationUrl('redirect.php', true);
>     if (count($used_servers) == 1) {
>       reset($used_servers);
>       list($server_key, $curServer) = each($used_servers);
>       $url = Util::addParameter($url, 'server_key', $server_key);
>     }
>     $url = Util::addParameter($url, 'actionID', 'login');
>     $url = Util::addParameter($url, 'autologin', true);
>     $url = Util::addParameter($url, 'frameset', true);
>     header('Location: ' . $url);
>     exit;



--
Joel Vandal


More information about the dev mailing list