Exemple #1
0
/**
 * 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();
    }
}
Exemple #2
0
/**
 * displayStepFive 
 * 
 * @param string $error Any previous errors with this step.
 * 
 * @return void
 */
function displayStepFive($error = '0')
{
    global $cfg_mysql_host, $cfg_mysql_user, $cfg_mysql_pass, $cfg_mysql_db;
    if (empty($_POST['sitename']) || empty($_POST['contact'])) {
        displayStepFour("<p class=\"error\">" . T_('You forgot a required field.  Please fill out all required fields.') . "</p>");
        return;
    }
    include_once 'inc/config_inc.php';
    include_once 'inc/install_inc.php';
    include_once 'inc/datetime.php';
    mysql_connect($cfg_mysql_host, $cfg_mysql_user, $cfg_mysql_pass);
    mysql_select_db($cfg_mysql_db);
    $_POST['sitename'] = mysql_real_escape_string($_POST['sitename']);
    $_POST['contact'] = mysql_real_escape_string($_POST['contact']);
    // Setup Config
    installConfig($_POST['sitename'], $_POST['contact'], 'Family Connections 3.5.0');
    // Setup Navigation
    $order = 0;
    $order2 = 0;
    $nextComOrder = 2;
    $nextShareOrder = 5;
    $params = array();
    // Family News
    if (isset($_POST['sections-news'])) {
        $order = $nextComOrder;
        $nextComOrder++;
    }
    $params['familynews'] = array(3, $order, 0);
    // Prayers
    $order = 0;
    if (isset($_POST['sections-prayers'])) {
        $order = $nextComOrder;
        $nextComOrder++;
    }
    $params['prayers'] = array(3, $order, 0);
    // Recipes
    $order = 0;
    if (isset($_POST['sections-recipes'])) {
        $order = $nextShareOrder;
        $nextShareOrder++;
    }
    $params['recipes'] = array(4, $order, 0);
    // Family Tree
    $order = 0;
    if (isset($_POST['sections-tree'])) {
        $order = $nextShareOrder;
        $nextShareOrder++;
    }
    $params['tree'] = array(4, $order, 0);
    // Documents
    $order = 0;
    if (isset($_POST['sections-documents'])) {
        $order = $nextShareOrder;
        $nextShareOrder++;
    }
    $params['documents'] = array(4, $order, 0);
    // Where Is Everyone
    $order = 0;
    if (isset($_POST['sections-whereiseveryone'])) {
        $order = $nextShareOrder;
        $nextShareOrder++;
    }
    $params['whereiseveryone'] = array(4, $order, 0);
    installNavigation($params);
    echo '
    <div id="column">
        <h1>' . T_('Install') . ' Family Connections</h1>
        <h2>' . T_('Administrative Account') . '</h2>
        <p style="text-align:center">' . T_('Step 5 of 5') . '</p>
        <div class="progress"><div style="width:100%"></div></div>
        <form action="install.php" method="post">
            <p>' . T_('Everyone will be required to have an account and be logged in at all times to use this website.  This will help protect your site.') . '</p>
            <p>' . T_('You must have at least one administrative account.  Please fill out the information below for the person who will be the administrator of this site.') . '</p>
            <div>
                <div class="field-label"><label for="username"><b>' . T_('Username') . '</b> <span class="req">*</span></label></div>
                <div class="field-widget"><input type="text" name="username" id="username"/></div>
            </div>
            <script type="text/javascript">
                var funame = new LiveValidation(\'username\', { onlyOnSubmit: true });
                funame.add(Validate.Presence, {failureMessage: "' . T_('Sorry, but I can\'t install without this information.') . '"});
            </script>
            <div>
                <div class="field-label"><label for="password"><b>' . T_('Password') . '</b> <span class="req">*</span></label></div>
                <div class="field-widget"><input type="password" name="password" id="password"/></div>
            </div>
            <script type="text/javascript">
                var fpass = new LiveValidation(\'password\', { onlyOnSubmit: true });
                fpass.add(Validate.Presence, {failureMessage: "' . T_('Passwords are hard to remember, but unfortunately necessary.') . '"});
            </script>
            <div>
                <div class="field-label"><label for="fname"><b>' . T_('First Name') . '</b> <span class="req">*</span></label></div>
                <div class="field-widget"><input type="text" name="fname" id="fname"/></div>
            </div>
            <script type="text/javascript">
                var ffname = new LiveValidation(\'fname\', { onlyOnSubmit: true });
                ffname.add(Validate.Presence, {failureMessage: "' . T_('Sorry, but I can\'t install without this information.') . '"});
            </script>
            <div>
                <div class="field-label"><label for="lname"><b>' . T_('Last Name') . '</b> <span class="req">*</span></label></div>
                <div class="field-widget"><input type="text" name="lname" id="lname"/></div>
            </div>
            <script type="text/javascript">
                var flname = new LiveValidation(\'lname\', { onlyOnSubmit: true });
                flname.add(Validate.Presence, {failureMessage: "' . T_('Sorry, but I can\'t install without this information.') . '"});
            </script>
            <div>
                <div class="field-label"><label for="email"><b>' . T_('Email Address') . '</b> <span class="req">*</span></label></div>
                <div class="field-widget"><input type="text" name="email" id="email"/></div>
            </div>
            <script type="text/javascript">
                var femail = new LiveValidation(\'email\', { onlyOnSubmit: true });
                femail.add( Validate.Presence, { failureMessage: "' . T_('Sorry, but this information is required.') . '" } );
                femail.add( Validate.Email, { failureMessage: "' . T_('That\'s not a valid email address is it?') . '" } );
                femail.add( Validate.Length, { minimum: 10 } );
            </script>
            <div>
                <div class="field-label"><label for="day"><b>' . T_('Birthday') . '</b><span class="req">*</span></label></div>
                <div class="field-widget">
                    <select id="day" name="day">';
    $d = 1;
    while ($d <= 31) {
        echo "<option value=\"{$d}\">{$d}</option>";
        $d++;
    }
    echo '</select><select id="month" name="month">';
    $m = 1;
    while ($m <= 12) {
        echo "<option value=\"{$m}\">" . getMonthAbbr($m) . "</option>";
        $m++;
    }
    echo '</select><select id="year" name="year">';
    $y = 1900;
    while ($y - 5 <= gmdate('Y')) {
        echo "<option value=\"{$y}\">{$y}</option>";
        $y++;
    }
    echo '
                    </select>
                </div>
            </div>
            <p style="text-align:right;"><input id="submit" name="submit5" type="submit"  value="' . T_('Next') . ' >>"/></p>
            <div class="clear"></div>
        </form>
    </div><!-- /column -->';
}