[imp] autologin based on redirect.php

Chuck Hagenbuch chuck@horde.org
Thu, 11 Apr 2002 13:32:27 -0400


Quoting Liam Hoekenga <liamr@umich.edu>:

> Could I get it to support multiple values from within servers.php w/o
> having to do conditionals in my script?  

You need some code; this snippet from login.php (HEAD - should be okay 
with current RELENG_3, though) will probably, in some form, do the trick:

/* Iterate through the servers in an attempt to locate a preferred
   server for this web server/virtualhost. If none are found, we
   default to the first entry in the $servers array that isn't a
   prompt (key begins with '_'). */
foreach ($servers as $key => $curServer) {
    if (!isset($server_key) && substr($key, 0, 1) != '_') {
        $server_key = $key;
    }
    if (IMP::isPreferredServer($curServer, $key)) {
        $server_key = $key;
        break;
    }
}

-chuck

--
Charles Hagenbuch, <chuck@horde.org>
"A dream which helps you to live your reality with dignity
 and justice is a good dream." - Tariq Ramadan