示例#1
0
//Process any GET requests
if (!empty($_GET)) {
    $redirect = install_process_get_request($step, $vars);
    //Redirect to new page if needed
    if (!empty($redirect)) {
        header("Location: {$redirect}");
        exit;
    }
}
//Process any POST requests
if (!empty($_POST)) {
    $redirect = install_process_post_request($step, $vars);
    //Redirect to new page if needed
    if (!empty($redirect)) {
        header("Location: {$redirect}");
        exit;
    }
}
//Genorate Page Title and heading based on insallation step
$vars['title'] = install_get_page_title($step);
$vars['heading'] = install_get_page_heading($step);
$vars['copyright'] = APPLICATION_NAME . " Install" . ' ©' . date("Y");
$vars['step'] = $step;
//Load License
$vars['LICENCE'] = getLicense();
//Load Template Engine
include "libraries/template.lib.php";
//Build and Display Page
$vars['breadcrumb'] = render_template(install_get_breadcrumb($step), $vars);
$vars['content'] = render_template(install_get_content($step), $vars);
print render_template(template_file("page.tpl.php"), $vars);
示例#2
0
function install_process_get_request($step, &$vars = array())
{
    $redirect_complete = "";
    //Check if this is a clean instalation or we only are reviewing/modifying the configuration, this prevents certain initalization functions
    if (isset($_GET['_'])) {
        $vars['clean_install'] = $_GET['_'] == 'conf' ? false : true;
    } else {
        $vars['clean_install'] = true;
    }
    //Get any error flags
    $vars['error'] = isset($_GET['error']) ? $_GET['error'] : "";
    switch ($step) {
        case 2:
            //Load Existing database configuration if present
            $vars['DB'] = install_get_db_config();
            break;
        case 3:
            //Load Existing database configuration if present
            $vars['WALLET'] = install_get_wallet_config();
            break;
        case 4:
            //Load Existing database configuration if present
            $vars['FAUCET'] = install_get_faucet_config();
            break;
        default:
            //Check for valid step
            $redirect_complete = install_get_content($step) ? "" : "index.php";
    }
    return $redirect_complete;
}