6.0.0-git
2020-01-25

Diff for MIMPHowTo between 22 and 23

+ MIMP !HowTo

++##red|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 [http://www.horde.org/mimp/ MIMP] in parallel with [http://www.horde.org/imp/ IMP], you need the [AuthCompositeHowTo[AuthCompositeHowToH3 composite authentication driver] 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 {{$conf['auth']['driver']}} to {{'composite'}} in {{horde/config/conf.php}}.

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

<code type="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>

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 //not// using a mobile browser, just replace the {{'imp'}} part with your regular Horde authentication settings:

<code type="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>