Exemple #1
0
/* Create core objects
 */
$_database = new MySQLi_connection(DB_HOSTNAME, DB_DATABASE, DB_USERNAME, DB_PASSWORD);
$_settings = new settings($_database);
$_session = new session($_database, $_settings);
$_user = new user($_database, $_settings, $_session);
$_page = new page($_database, $_settings, $_user);
$_output = new output($_database, $_settings, $_page);
if (is_true(MULTILINGUAL)) {
    $_language = new language($_database, $_page, $_output);
}
/* Logging
 */
if (library_exists("logging") && $_user->is_admin == false) {
    $logging = new logging($_database, $_page);
    $logging->execute();
}
/* Prevent Cross-Site Request Forgery
 */
prevent_csrf($_output, $_user);
/* User switch warning
 */
if (isset($_SESSION["user_switch"])) {
    $real_user = $_database->entry("users", $_SESSION["user_switch"]);
    $_output->add_system_warning("User switch active! Switched from '%s' to '%s'.", $real_user["fullname"], $_user->fullname);
}
/* Include the model
 */
if (file_exists($file = "../models/" . $_page->module . ".php")) {
    include $file;
    /* Set output type for API modules