Beispiel #1
0
				if(file_put_contents($folder.$file, $mask->GetConfigFile()))
				{
					$page->SuccessBox('Configuration has been created successfully!');
					$configCreated = true;
				}
				else
				{
					$page->ErrorBox('The Installer is unable to create configuration <b>'.$folder.$file.'</b>, check your <tt>chmod</tt> '.
									'permissions or contact support to get this issue resolved.');
					$configCreated = false;
				}

				// If the config was created - the installer is done!
				if($configCreated)
				{
					$page->FormStart(array('step'=>GetNextStep(STEP_WRITECONFIG)));
					$page->FormSubmit('Finished');
					$page->FormClose();
				}

				// Offer retry if creation failed
				else
				{
					$page->FormStart(array('step'=>STEP_WRITECONFIG));
					$page->FormButton('Back', array('step'=>GetPrevStep(STEP_WRITECONFIG)));   
					$page->FormSubmit('Retry');
					$page->FormClose();
				}


				// If there are some writing problems, or this step should not be
Beispiel #2
0
/**
 *  Display a form with list of available databases
 */
function DatabaseSelectionListForm()
{
    global $page;
    global $dbase;
    global $newdb;
    global $login;
    global $successInstall;
    $page->FormStart(array('step' => GetNextStep(STEP_DBSELECT)));
    $page->StartTable(2, array('class' => 'dblist'));
    $dblist = $dbase->GetDatabaseList();
    foreach ($dblist as $idx => $db) {
        // $optional : Additional attributes to the <input> tag
        // $divClass : Added class value to the <div> that contains the <input>
        $optional = array();
        $divClass = '';
        // If a database has been selected, make this radiobox checked
        if ($db['name'] == $login['database']) {
            $optional[0] = 'checked';
        }
        # numeric keys are ignored in HtmlMaker
        // If however, the $newdb is in the list - it was just inserted,
        // then highlight that database as newly created database
        if ($newdb && $newdb == $db['name']) {
            $divClass = 'newdb';
        }
        // If this database has successful installation, highlight it
        // as successful or approved database
        if (in_array($db['name'], $successInstall)) {
            // if this IF-statement validates to true, then the database was
            // JUST created but still marked as "successful installation". That
            // can ONLY happen if the user installs tables on a database, then
            // drops it using another tool and creates it again here
            if (strlen($divClass) > 0) {
                $divClass .= ' installdone';
            } else {
                $divClass = 'installdone';
            }
            // The current database is removed from $successInstall, which
            // indicates that at the end of this foreach, $successInstall
            // should be empty - meaning all successfully installed databases
            // do in fact exist. If $successInstall has any elements left when
            // this foreach is done - then remove those databases from sessions!
            $key = array_search($db['name'], $successInstall);
            unset($successInstall[$key]);
        }
        // The name caption of the database is formed in html
        $caption = $db['name'] . ' ' . $page->Discrete('(' . $db['tbcount'] . ')');
        // Add a radio box for this database
        $page->FormRadiobox($db['name'], 'database', $caption, $optional, $divClass);
        // Get the data from HTML queue back, and add the HTML 'values'
        // from the returned queue item array into a table
        $html = $page->PopQueue();
        $page->AddTableData($html);
    }
    $page->EndTable();
    // If there are some elements left in $successInstall, then those databases
    // do not exist and there cannot be a successfull installation on a database
    // that does not exist - sessions need to be updated
    if (count($successInstall) > 0) {
        foreach ($successInstall as $database) {
            RemoveDatabaseInstallStatus($database);
        }
    }
    $page->FormButton('Back', array('step' => GetPrevStep(STEP_DBSELECT)));
    $page->FormSubmit('Next');
    $page->FormClose();
}
     *
     */
    if ($steps[STEP_MODULECHECK]['enabled'] && !$steps[STEP_MODULECHECK]['autoskip']) {
        $_SESSION[$ID][$stepkey] = STEP_MODULECHECK;
    } else {
        $_SESSION[$ID][$stepkey] = GetNextStep(STEP_MODULECHECK);
    }
}
// If the step has been changed by POST or GET, update
// the step session if the key exists in $steps
if (isset($_REQUEST[$stepkey]) && isset($steps[trim($_REQUEST[$stepkey])])) {
    $requested = trim($_REQUEST[$stepkey]);
    // If the requested step key is either disabled or set to autoskip, select the
    // next available step that is enabled or does not have an autoskip
    if (isset($steps[$requested]['enabled']) && !$steps[$requested]['enabled'] || isset($steps[$requested]['autoskip']) && $steps[$requested]['autoskip']) {
        $step = GetNextStep($requested);
    } else {
        $step = $requested;
    }
    // Update the session with requested step key
    $_SESSION[$ID][$stepkey] = $step;
} else {
    $step = $_SESSION[$ID][$stepkey];
}
//========================================[ LICENSE AGREEMENT ]========================================//
// License or Terms-Of-Use agreement must be approved if enabled in config
if (!isset($_SESSION[$ID][$agreemt])) {
    $_SESSION[$ID][$agreemt] = false;
}
if (isset($_REQUEST[$agreemt])) {
    if ($_REQUEST[$agreemt] == 'approved') {