Exemple #1
0
    $ins = new class_init_page($database, $_SESSION['USER_ID'], $_SERVER['SCRIPT_NAME']);
}
require_once LEPTON_PATH . '/framework/class.admin.php';
$admin = new admin('Start', 'start');
// Setup template object
$tpl = new Template(THEME_PATH . '/templates');
$tpl->debug = false;
$tpl->set_file('page', 'start.htt');
$tpl->set_block('page', 'main_block', 'main');
$tpl->set_block('main_block', 'show_preferences_block', 'show_preferences');
// first set all blocks to visible
$tpl->parse('show_preferences', 'show_preferences_block', true);
// Check register_globals:
$warning = ini_get('register_globals') ? 'This PHP installation is insecure because register_globals is on! Please contact your administrator.' : '';
// Insert values into the template object
$tpl->set_var(array('WELCOME_MESSAGE' => $MESSAGE['START_WELCOME_MESSAGE'], 'CURRENT_USER' => $MESSAGE['START_CURRENT_USER'], 'DISPLAY_NAME' => $admin->get_display_name(), 'ADMIN_URL' => ADMIN_URL, 'LEPTON_URL' => LEPTON_URL, 'THEME_URL' => THEME_URL, 'NO_CONTENT' => '<p>&nbsp;</p>', 'WARNING' => $warning));
// Insert permission values into the template object
$tpl->set_block('main_block', 'show_pages_block', 'show_pages');
if ($admin->get_permission('pages') != true) {
    $tpl->set_var('DISPLAY_PAGES', 'display:none;');
    $tpl->set_block('show_pages', '');
} else {
    $tpl->parse('show_pages', 'show_pages_block', true);
}
$tpl->set_block('main_block', 'show_media_block', 'show_media');
if ($admin->get_permission('media') != true) {
    $tpl->set_var('DISPLAY_MEDIA', 'display:none;');
    $tpl->set_block('show_media', '');
} else {
    $tpl->parse('show_media', 'show_media_block', true);
}
            header('Location: ' . WB_URL . '/upgrade-script.php');
            exit;
        } else {
            echo "<p style=\"text-align:center;\"> The <strong>upgrade script</strong> could not be start automatically.\n" . "Please click <a style=\"font-weight:bold;\" " . "href=\"" . WB_URL . "/upgrade-script.php\">on this link</a> to start the script!</p>\n";
            exit;
        }
    }
    $msg .= '' . $MESSAGE['START_UPGRADE_SCRIPT_EXISTS'] . '<br />';
}
// Setup template object, parse vars to it, then parse it
// Create new template object
$template = new Template(dirname($admin->correct_theme_source('start.htt')));
$template->set_file('page', 'start.htt');
$template->set_block('page', 'main_block', 'main');
// Insert values into the template object
$template->set_var(array('WELCOME_MESSAGE' => $MESSAGE['START_WELCOME_MESSAGE'], 'CURRENT_USER' => $MESSAGE['START_CURRENT_USER'], 'DISPLAY_NAME' => $admin->get_display_name(), 'ADMIN_URL' => ADMIN_URL, 'WB_URL' => WB_URL, 'THEME_URL' => THEME_URL, 'WB_VERSION' => WB_VERSION));
// Insert permission values into the template object
if ($admin->get_permission('pages') != true) {
    $template->set_var('DISPLAY_PAGES', 'display:none;');
}
if ($admin->get_permission('media') != true) {
    $template->set_var('DISPLAY_MEDIA', 'display:none;');
}
if ($admin->get_permission('preferences') != true) {
    $template->set_var('DISPLAY_PREFERENCES', 'display:none;');
}
if ($admin->get_permission('addons') != true) {
    $template->set_var('DISPLAY_ADDONS', 'display:none;');
}
if ($admin->get_permission('access') != true) {
    $template->set_var('DISPLAY_ACCESS', 'display:none;');