コード例 #1
0
ファイル: upgrade.php プロジェクト: lmcro/fcms
/**
 * control 
 * 
 * @return void
 */
function control()
{
    // Automatic Upgrade
    if (isset($_GET['auto'])) {
        $step = (int) $_GET['auto'];
        // Turn Off Site
        if ($step == 1) {
            displayStepOne();
        } elseif ($step == 2) {
            displayStepTwo();
        } elseif ($step == 3) {
            displayStepThree();
        } elseif ($step == 4) {
            displayStepFour();
        } elseif ($step == 5) {
            displayStepFive();
        } elseif ($step == 6) {
            displayStepSix();
        } elseif ($step == 7) {
            displayStepSeven();
        }
    } elseif (isset($_GET['manual'])) {
        displayManualUpgrade();
    } elseif (isset($_GET['upgrade'])) {
        displayUpgradeDatabase();
    } elseif (isset($_GET['site'])) {
        displayUpgradeSiteStatus($_GET['site']);
    } else {
        displayStart();
    }
}
コード例 #2
0
ファイル: install.php プロジェクト: sauravpratihar/fcms
/**
 * displayStepThree 
 * 
 * @return void
 */
function displayStepThree()
{
    // Check required fields
    $requiredFields = array('dbhost', 'dbname', 'dbuser', 'dbpass');
    $missingRequired = false;
    foreach ($requiredFields as $field) {
        if (!isset($_POST[$field])) {
            $missingRequired = true;
        }
    }
    if ($missingRequired) {
        echo '
        <script type="text/javascript">
        $(document).ready(function() { $(\'#dbhost\').focus(); });
        </script>';
        displayStepTwo("<p class=\"error\">" . T_('You forgot a required field.  Please fill out all required fields.') . "</p>");
        return;
    }
    $connection = @mysql_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass']);
    if (!$connection) {
        displayStepTwo("<p class=\"error\">" . T_('Could not connect to the database. Please try again.') . "</p>");
        return;
    }
    mysql_select_db($_POST['dbname']) or die("<h1>Error</h1><p><b>Connection made, but database could not be found!</b></p>" . mysql_error());
    $file = fopen('inc/config_inc.php', 'w') or die("<h1>Error Creating Config File</h1>");
    $str = "<?php \$cfg_mysql_host = '" . $_POST['dbhost'] . "'; \$cfg_mysql_db = '" . $_POST['dbname'] . "'; \$cfg_mysql_user = '******'dbuser'] . "'; \$cfg_mysql_pass = '******'dbpass'] . "'; ?" . ">";
    fwrite($file, $str) or die("<h1>Could not write to config.</h1>");
    fclose($file);
    include_once 'inc/install_inc.php';
    echo '
    <div id="column">
        <h1>' . T_('Install') . 'Family Connections</h1>
        <form class="nofields" action="install.php" method="post">
        <h2>' . T_('Checking Database Connection') . '</h2>
        <p style="text-align:center">' . T_('Step 3 of 5') . '</p>
        <div class="progress"><div style="width:60%"></div></div>';
    dropTables();
    echo '
        <h3>' . T_('Awesome!') . '</h3>
        <div>' . T_('A connection was successfully made to the database.  Please proceed to the next step.') . '</div>
        <p style="text-align:right;"><input id="submit" name="submit3" type="submit"  value="' . T_('Next') . ' >>"/></p>
        <div class="clear"></div>
        </form>
    </div><!-- /column -->';
}