示例#1
0
文件: index.php 项目: klaver/peerlist
/*
 * peerlist - an app that shows peer info for your IX
 * (C) 2006i-2009 Martijn Bakker <*****@*****.**>
 */
define('BASEDIR', getcwd() . DIRECTORY_SEPARATOR);
if (!is_file('config.inc.php')) {
    echo "no config file found! Please create config.inc.php\n";
    exit(1);
}
include_once 'config.inc.php';
include_once 'xtemplate.class.php';
include_once 'toolbox.class.php';
$application = array(name => 'peerlist', version => '0.3-rc1');
$xtpl = new xtemplate("templates/peerlist.xtpl");
$toolbox = new toolbox();
$xtpl->assign('application', $toolbox->htmlspecialchars_array($application));
$xtpl->assign('getoptions', $toolbox->htmlspecialchars_array($_GET));
foreach ($config as $routerid => $routerconfig) {
    if (is_array($routerconfig) && $routerconfig['common_name'] != '') {
        $routerconfig['id'] = $routerid;
        if ($_GET['router'] == "{$routerid}" && $_GET['router'] != '') {
            $routerconfig['selected'] = 'selected';
        }
        if (is_file('routers/' . $routerconfig['router']['module'] . '.class.php')) {
            include_once 'routers/' . $routerconfig['router']['module'] . '.class.php';
        } else {
            die('router type not available');
        }
        if (is_file('exchanges/' . $routerconfig['exchange']['module'] . '.class.php')) {
            include_once 'exchanges/' . $routerconfig['exchange']['module'] . '.class.php';
        } else {