<?php
/*
 * $Horde: imp/scripts/singlescript.php,v 1.2.2.2 2003/01/03 12:48:20 jan Exp $
 *
 * Copyright 2002-2003 Charles J. Hagenbuch <chuck@horde.org>
 *
 * See the enclosed file COPYING for license information (GPL).  If you
 * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
 */

// This script is a wrapper that lets you hide the whole of IMP
// outside of your webroot. You still have to have the images
// somewhere accessible, which you can do via
// horde/config/registry.php. To use this script, you'll have to edit
// horde/config/registry.php and set IMP's webroot to
// '/path/to/this/script.php' - no trailing slash. You must also be
// using a webserver that supports PATH_INFO. Finally, set the
// following variable to where IMP really is on the filesystem:
$imppath = './horde/imp/';

$bits = explode('/', $_SERVER['PATH_INFO']);
foreach ($bits as $file) {
    if (substr($file, -4) == '.php') {
        include $imppath . $file;
        exit;
    }
}

include $imppath . 'index.php';

?>
