Ejemplo n.º 1
0
 * Copyright (C) 2006-2008 by John Diamond
 * Copyright (C) 2009 by Yves Kreis
 *
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License 
 * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program; if not, write to the 
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
*/
$pathinfo = pathinfo(__FILE__);
$filepath = preg_replace('|install/pages|', '', $pathinfo['dirname']);
if (!check_installed()) {
    modify_config_install();
}
?>
<h2><?php 
echo _INSTALLCOMPLETE;
?>
</h2>
<br />
<p><?php 
echo _INSTALLERCONGRATULATIONS;
?>
!</p>
<p style="color: red;">
    <?php 
echo '          ', _INSTALLERSECURITY0, ':<br />', "\n";
Ejemplo n.º 2
0
require_once DEDEINC . "/channelunit.class.php";
require_once DEDEINC . "/baidusitemap.func.php";
require_once DEDEINC . "/baiduxml.class.php";
if (empty($dopost)) {
    $dopost = '';
}
if (empty($action)) {
    $action = '';
}
if (empty($sign)) {
    $sign = '';
}
if (empty($type)) {
    $type = 1;
}
check_installed();
$version = baidu_get_setting('version');
if (empty($version)) {
    $version = '0.0.2';
}
if (version_compare($version, PLUS_BAIDUSITEMAP_VER, '<')) {
    $mysql_version = $dsql->GetVersion(TRUE);
    foreach ($update_sqls as $ver => $sqls) {
        if (version_compare($ver, $version, '<')) {
            continue;
        }
        foreach ($sqls as $sql) {
            $sql = preg_replace("#ENGINE=MyISAM#i", 'TYPE=MyISAM', $sql);
            $sql41tmp = 'ENGINE=MyISAM DEFAULT CHARSET=' . $cfg_db_language;
            if ($mysql_version >= 4.1) {
                $sql = preg_replace("#TYPE=MyISAM#i", $sql41tmp, $sql);
Ejemplo n.º 3
0
    $AVE_Template->display('error.tpl');
    exit;
}
$_REQUEST['step'] = isset($_REQUEST['step']) ? $_REQUEST['step'] : '';
switch ($_REQUEST['step']) {
    case '':
    case '1':
        $AVE_Template->display('step1.tpl');
        break;
    case '2':
        if (false === $db_connect && !empty($_POST['dbname']) && !empty($_POST['dbprefix'])) {
            $db_connect = check_db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname']);
            if ($_REQUEST["clean_db"]) {
                clean_db($_POST['dbname'], $_POST['dbprefix']);
            }
            $check_installed = check_installed($_POST['dbprefix']);
            if (true === $db_connect && false === $check_installed) {
                if (!@is_writeable(BASE_DIR . '/inc/db.config.php')) {
                    $AVE_Template->assign('config_isnt_writeable', 1);
                    $AVE_Template->display('error.tpl');
                    exit;
                }
                $fp = @fopen(BASE_DIR . '/inc/db.config.php', 'w+');
                @fwrite($fp, "<?php\n" . "\$config['dbhost'] = \"" . stripslashes(trim($_POST['dbhost'])) . "\";\n" . "\$config['dbuser'] = \"" . stripslashes(trim($_POST['dbuser'])) . "\";\n" . "\$config['dbpass'] = \"" . stripslashes(trim($_POST['dbpass'])) . "\";\n" . "\$config['dbname'] = \"" . stripslashes(trim($_POST['dbname'])) . "\";\n" . "\$config['dbpref'] = \"" . stripslashes(trim($_POST['dbprefix'])) . "\";\n" . "?>");
                @fclose($fp);
                $AVE_Template->display('step3.tpl');
                exit;
            } elseif (true === $db_connect && true === $check_installed) {
                $AVE_Template->assign('installed_q', $lang_i['installed_q']);
            } else {
                $AVE_Template->assign('warnnodb', $lang_i['enoconn']);
Ejemplo n.º 4
0
function install_step3()
{
    check_installed();
    global $twig;
    $connection = _create_connection();
    $serviceKernel = ServiceKernel::create('prod', true);
    $serviceKernel->setParameterBag(new ParameterBag(array('kernel' => array('root_dir' => realpath(__DIR__ . '/../../app')))));
    $serviceKernel->setConnection($connection);
    $error = null;
    if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {
        $init = new SystemInit();
        $admin = $init->initAdmin($_POST);
        $init->initSiteSettings($_POST);
        $init->initRegisterSetting($admin);
        $init->initMailerSetting($_POST['sitename']);
        $init->initPaymentSetting();
        $init->initStorageSetting();
        $init->initTag();
        $init->initCategory();
        $init->initFile();
        $init->initPages();
        $init->initNavigations();
        $init->initBlocks();
        $init->initThemes();
        $init->initLockFile();
        $init->initRefundSetting();
        $init->initArticleSetting();
        $init->initDefaultSetting();
        $init->initCrontabJob();
        header("Location: start-install.php?step=4");
        exit;
    }
    echo $twig->render('step-3.html.twig', array('step' => 3, 'error' => $error, 'request' => $_POST));
}
Ejemplo n.º 5
0
    mysql_query("INSERT INTO `settings` (`setting`, `value`) VALUES ('nameserver_2', '{$nameserver_2}');") or die(_INSTALLERDBQUERYFAILED . ': ' . mysql_error());
    mysql_query("INSERT INTO `settings` (`setting`, `value`) VALUES ('nameserver_3', '{$nameserver_3}');") or die(_INSTALLERDBQUERYFAILED . ': ' . mysql_error());
    mysql_query("INSERT INTO `settings` (`setting`, `value`) VALUES ('nameserver_4', '{$nameserver_4}');") or die(_INSTALLERDBQUERYFAILED . ': ' . mysql_error());
    mysql_close();
}
function get_languages_installer()
{
    $languages = array();
    $inifile = dirname(__FILE__) . "/../languages/accepted.ini";
    if (file_exists($inifile)) {
        $languages_ini = parse_ini_file($inifile);
        $languages = $languages_ini['languages'];
    }
    return $languages;
}
if (check_installed()) {
    unset($_POST['function']);
    $_POST['install_step'] = '6';
}
if (isset($_POST['function'])) {
    switch ($_POST['function']) {
        case 'config_system':
            modify_config_system();
            break;
        case 'config_db':
            modify_config_db();
            break;
        case 'create_admin':
            create_admin();
            break;
        case 'create_company':
Ejemplo n.º 6
0
function install_step3($init_data = 0)
{
    check_installed();
    global $twig;
    $connection = _create_connection();
    $serviceKernel = ServiceKernel::create('prod', true);
    $serviceKernel->setParameterBag(new ParameterBag(array('kernel' => array('root_dir' => realpath(__DIR__ . '/../../app')))));
    $serviceKernel->setConnection($connection);
    $error = null;
    if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {
        $init = new SystemInit();
        if (!empty($init_data)) {
            $connection->exec("delete from `user` where id=1;");
            $connection->exec("delete from `user_profile` where id=1;");
        }
        $admin = $init->initAdmin($_POST);
        $init->initSiteSettings($_POST);
        if (empty($init_data)) {
            $init->initRegisterSetting($admin);
            $init->initMailerSetting($_POST['sitename']);
            $init->initPaymentSetting();
            $init->initStorageSetting();
            $init->initTag();
            $init->initCategory();
            $init->initFile();
            $init->initPages();
            $init->initNavigations();
            $init->initBlocks();
            $init->initThemes();
            $init->initRefundSetting();
            $init->initArticleSetting();
            $init->initDefaultSetting();
            $init->initCrontabJob();
            $init->initDeveloperSetting();
        } else {
            $init->deleteKey();
            $connection->exec("update `user_profile` set id = 1 where id = (select id from `user` where nickname = '" . $_POST['nickname'] . "');");
            $connection->exec("update `user` set id = 1 where nickname = '" . $_POST['nickname'] . "';");
        }
        $init->initLockFile();
        header("Location: start-install.php?step=4");
        exit;
    }
    echo $twig->render('step-3.html.twig', array('step' => 3, 'error' => $error, 'request' => $_POST));
}
Ejemplo n.º 7
0
function install_step3()
{
    check_installed();
    global $twig;
    $connection = _create_connection();
    $serviceKernel = ServiceKernel::create('prod', true);
    $serviceKernel->setConnection($connection);
    // $serviceKernel->setParameterBag($kernel->getContainer()->getParameterBag());
    $error = null;
    if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {
        $init = new SystemInit();
        $admin = $init->initAdmin($_POST['admin']);
        $init->initSiteSettings($_POST);
        $init->initRegisterSetting($admin);
        $init->initMailerSetting($_POST['sitename']);
        $init->initPaymentSetting();
        $init->initStorageSetting();
        $init->initTag();
        $init->initCategory();
        $init->initFile();
        $init->initPages();
        $init->initNavigations();
        $init->initBlocks();
        $init->initThemes();
        $init->initLockFile();
        $init->initRefundSetting();
        $init->initArticleSetting();
        $web = $_POST['web'];
        $userData = array();
        $userData['server_addr'] = $_SERVER['SERVER_ADDR'];
        $userData['server_name'] = $_SERVER['SERVER_NAME'];
        $userData['mobile'] = $web['mobile'];
        $userData['qq'] = $web['qq'];
        $userData['name'] = $web['name'];
        _postRequest("http://open.edusoho.com/track/install", $userData);
        header("Location: start-install.php?step=4");
        exit;
    }
    echo $twig->render('step-3.html.twig', array('step' => 3, 'error' => $error, 'request' => $_POST));
}