\documentclass{article}
\usepackage{ulem}
\usepackage{graphicx}
\usepackage{hyperref}
\pagestyle{headings}
\begin{document}
\part{MIMP HowTo}
++NOTE: As of September 2006, the CVS HEAD development version of MIMP no longer needs this configuration.  The HEAD version will automatically authenticate via a mobile-friendly screen when it detects a mobile browser.

If you want to setup <a href="http://www.horde.org/mimp/">MIMP</a> in parallel with <a href="http://www.horde.org/imp/">IMP</a>, you need the <a href="https://wiki.horde.org/AuthCompositeHowToH3">composite authentication driver</a> with a browser switch.

To use the composite driver select it from the dropdown list in the authentication tab of the configuration interface or change \texttt{\$conf['auth']['driver']} to \texttt{'composite'} in \texttt{horde/config/conf.php}.

In \texttt{horde/config/conf.php}, insert the following code:

<pre><code class="language-php">
\$conf['auth']['params']['drivers'] = array(
    'imp' => array('driver' => 'application',
                   'params' => array('app' => 'imp')),
    'mimp' => array('driver' => 'application',
                    'params' => array('app' => 'mimp')));

\$conf['auth']['params']['loginscreen\_switch'] = '\_horde\_select\_loginscreen';

if (!function\_exists('\_horde\_select\_loginscreen')) \{
    function \_horde\_select\_loginscreen()
    \{
        require\_once 'Horde/Browser.php';
        \$browser = new Browser();
        if (\$browser->isMobile()) \{
            return 'mimp';
        \}
        return 'imp';
    \}
\}
</code></pre>
This will give you either the IMP or the MIMP login screen, depending on the browser you use.

If you want to use some other authentication driver than "application/imp" for Horde if \textit{not} using a mobile browser, just replace the \texttt{'imp'} part with your regular Horde authentication settings:

<pre><code class="language-php">
\$conf['auth']['params']['drivers'] = array(
    'horde' => array('driver' => 'my\_auth\_driver',
                     'params' => array(
                         // Necessary parameters for 'my\_auth\_driver'.
                         ...
                         )),
    'mimp' => array('driver' => 'application',
                    'params' => array('app' => 'mimp')));

\$conf['auth']['params']['loginscreen\_switch'] = '\_horde\_select\_loginscreen';

if (!function\_exists('\_horde\_select\_loginscreen')) \{
    function \_horde\_select\_loginscreen()
    \{
        require\_once 'Horde/Browser.php';
        \$browser = new Browser();
        if (\$browser->isMobile()) \{
            return 'mimp';
        \}
        return 'horde';
    \}
\}
</code></pre>
\end{document}
