<?php
session_start();
// Includes
require('includes/config.inc.php');
require('includes/database.inc.php');
require('includes/user.inc.php');
require('includes/controller.inc.php');
require('includes/model.inc.php');
require('includes/view.inc.php');
require('includes/functions.inc.php');
require('includes/label.inc.php');
require('includes/document.inc.php');
require('includes/mailbox.inc.php');
require('includes/mailboxfolder.inc.php');
require('includes/call.inc.php');
require('includes/mail.inc.php');
require('includes/contact.inc.php');

$db = new Database($CONFIG['dbHost'], $CONFIG['dbUser'], $CONFIG['dbPassword'], $CONFIG['dbDatabase']);
$user = new User(isset($_SESSION['username']) ? $_SESSION['username'] : NULL);

// $_GET und $_POST zusammenfasen
$request = $_REQUEST;
// Controller erstellen
$controller = new Controller($request);
// Inhalt der Webanwendung ausgeben.
echo $controller->display();

$db->close();

?>
