<?php
/**
 * $Horde: passwd/index.php,v 1.10 2003/08/24 22:48:20 jan Exp $
 *
 * Copyright 1999-2003 Charles J. Hagenbuch <chuck@horde.org>
 * Copyright 1999-2003 Jon Parise <jon@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.
 */

define('PASSWD_BASE', dirname(__FILE__));
$passwd_configured = ( (@is_readable(PASSWD_BASE . '/config/conf.php')) &&
                       (@is_readable(PASSWD_BASE . '/config/backends.php')) );

if ($passwd_configured) {
    include_once PASSWD_BASE . '/lib/base.php';
    $uri = 'main.php';
    if (!empty($_SERVER['QUERY_STRING'])) {
       $uri .= '?' . $_SERVER['QUERY_STRING'];
    }
    header('Location: ' . Horde::applicationUrl($uri, true));
    exit;
} else {
    /* Passwd isn't configured */
    require PASSWD_BASE . '/../lib/Test.php';
    Horde_Test::configFilesMissing('Passwd', PASSWD_BASE, array('conf.php', 'backends.php'));
}
