Ejemplo n.º 1
0
function installSobi2()
{
    $t = preg_replace('/[^a-z]*/i', null, $_GET['sinstall']);
    if ($t == 'screen') {
        echo '<div style="background: transparent url(components/com_sobi2/images/sobi2_logo48.jpg) no-repeat scroll left center; font-size: 18px; font-weight: bold; color: rgb(198, 73, 52); text-align: left; padding-left: 50px; padding-top: 20px;  height: 50px;">Sigsiu Online Business Index 2</div>';
        echo '<h2 style="padding-left: 50px; color:blue; text-align:left!important;">Clique para finalizar a instalação do componente SOBI2:&nbsp;';
        echo '<button style="font-weight: bold; color: red; font-size: 16px; width: 300px; height: 30px;" onclick="window.location=\'index2.php?option=com_sobi2&sinstall=install\'">Instalar dados do SOBI2</button></h2>';
    } elseif ($t == 'install') {
        $msg = null;
        $msg .= installConfig();
        $msg .= installSobiData();
        if (@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'install.sobi2.php')) {
            $msg .= '<big style="font-weight: bold; color:blue;"><br/><big><tt>SOBI2 foi instalado - instalação concluída.</tt></big></big><br/>';
            if (defined("_JEXEC") && class_exists("JRequest")) {
                $mmsg = null;
                $session =& JFactory::getSession();
                $session->set('application.queue', array(array('message' => 'SOBI2 foi instalado - instalação concluída.', 'type' => 'message')));
            } else {
                $mmsg = '&mosmsg=SOBI2 foi instalado - instalação concluída.';
            }
            $time = defined('SIR') ? 5000 : 2000;
            $msg .= "<script> function Finish() { document.location.href='index2.php?option=com_sobi2&task=about{$mmsg}'; } setTimeout( 'Finish()', {$time} ) </script>";
            $msg .= '<br/><br/><big style="font-weight: bold; color:blue; text-align:center;"><tt>Por favor, aguarde um segundo... redirecionando.</tt></big><br/>';
        } else {
            $msg .= '<br/><tt><h3 style="text-align:left;"><big style="font-weight: bold; color:red; text-align:center;"><img src="components/com_sobi2/images/error.png"/>&nbsp;ERROR:</big> A instalação parece estar Ok, mas não é possível excluir o arquivo de instalação. <br/><br/> Se você estiver usando a camada FTP Joomla 1.5, por favor <big style="font-weight: bold; color:red; text-align:center;">desabilite-a</big> ou desinstale este componente, porque SOBI2 não é capaz de funcionar corretamente neste modo.<br/><br/>Você também pode tentar remover manualmente o seguinte arquivo: administrator/components/com_sobi2/install.sobi2.php</h3></tt>';
        }
        echo $msg;
    } else {
        exit('Accesso restrito');
    }
}
Ejemplo n.º 2
0
    } else {
        if (!file_exists("../include/common.php")) {
            die("Error: script must be executed in the directory that it is located in.\n");
        }
    }
}
//since we're running from CLI and are in a subdirectory, we need to manually set the base path
$OVERRIDE_BASEPATH = "..";
include "../include/common.php";
include "../config.php";
include "manage_common.php";
$action = $argv[1];
$spec = $argv[2];
if ($action == "install") {
    if ($spec == "config") {
        installConfig();
    } else {
        if ($spec == "panel") {
            if (!in_array("nodep", $argv)) {
                installPanelDependency();
            }
            installPanel();
        } else {
            if ($spec == "ghost") {
                if (!in_array("nodep", $argv)) {
                    installGhostDependency();
                }
                installGhost();
            } else {
                if ($spec == "channel") {
                    if (!in_array("nodep", $argv)) {
Ejemplo n.º 3
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 -->';
}