Esempio n. 1
0
}
// Generate the navigation
$_navigation = array();
foreach ($config["modules"] as $key => $value) {
    if (!(isset($value["hide_navigation"]) && $value["hide_navigation"]) && maySeeModule($key, $user)) {
        $_navigation[$key] = $value["title"];
    }
}
// Assign the template variables
$smarty->assign("PHP_SELF", $_SERVER["PHP_SELF"]);
$smarty->assign("user_override", isset($_SESSION["user_override"]));
$smarty->assign("user", $user instanceof User ? $user->getUid() : false);
$smarty->assign("module", $module);
$smarty->assign("navigation", $_navigation);
$smarty->assign("title", $config["modules"][$module]["title"]);
$smarty->assign("pagetitle", $config["modules"][$module]["title"]);
// Include the module class and execute the main function.
include dirname(__FILE__) . "/mod/" . $module . ".mod.php";
$_module = new $module($config["modules"][$module]);
$_content = $_module->main();
// Display the page
print $_content;
// Do not serialize the user, since the User-Object stores a DB-Link,
// which gets broken during serialization
if ($user instanceof User) {
    $_SESSION["authenticated"] = true;
    $_SESSION["user"] = $user->getUid();
}
// Close the UserDB connection
$userdb->close();