Ejemplo n.º 1
0
    unset($sql);
    require $link;
    if (isset($sql)) {
        $db = new db();
    }
}
$disable = false;
if ($sql['install'] == 'true') {
    if (!writeconfig($sql['host'], $sql['user'], $sql['pass'], $sql['db'], $sql['pre'], "false")) {
        $array['ANYTHING'] = "Your {$link} isn't writeable or does not exist! Please CHMOD it to 666 and make sure it exists!";
        $disable = true;
    } else {
        $array['ANYTHING'] = "Since you've already ran the installer, your config has been re-written to the \"not installed\" state. If you are upgrading, this is normal.";
    }
}
if (!file_exists($link)) {
    $array["ANYTHING"] = "Your {$link} file doesn't exist! Please create it as a blank file and CHMOD it to 666!";
    $disable = true;
} elseif (!is_writable($link)) {
    $array["ANYTHING"] = "Your {$link} isn't writeable! Please CHMOD it to 666!";
    $disable = true;
}
echo $style->get("header.tpl");
if ($disable) {
    echo '<script type="text/javascript">$(function(){$(".twobutton").attr("disabled", "true");$("#method").attr("disabled", "true");});</script>';
}
$array["GENERATED_URL"] = generateSiteUrl();
echo $style->replaceVar("tpl/install/install.tpl", $array);
echo $style->get("footer.tpl");
include LINK . "output.php";
#Output it
Ejemplo n.º 2
0
$disable = false;
$values = array('install' => 'Install');
if (INSTALL == 1) {
    $main->errors('The system has already been installed. If you want to re-install you should delete the conf.inc.php file. If you want to update just continue this procedure.');
    $values = array('upgrade' => 'Upgrade');
}
global $db;
if (isset($db)) {
    $db->getSystemConfigList(true);
}
$link = LINK . "conf.inc.php";
if (!file_exists($link)) {
    $array["ANYTHING"] = "Your {$link} file doesn't exist. Please create it.";
    $disable = true;
} elseif (!is_writable($link)) {
    $array['ANYTHING'] = "Your {$link} isn't writeable! Please CHMOD it to 666.";
    $disable = true;
}
$token = $main->generateToken();
$array['GENERATED_URL'] = generateSiteUrl();
$array['SITE_NAME'] = 'BNPanel';
$array['SITE_EMAIL'] = '*****@*****.**';
$array['INSTALL_OPTIONS'] = $main->createSelect('method', $values);
echo $style->get("tpl/layout/two-col/header.tpl");
if ($disable) {
    echo '<script type="text/javascript">$(function(){$(".twobutton").attr("disabled", "true");$("#method").attr("disabled", "true");});</script>';
}
echo $style->replaceVar("tpl/install/install.tpl", $array);
echo $style->get("tpl/layout/two-col/footer.tpl");
require LINK . "output.php";
#Output it
Ejemplo n.º 3
0
    include INC . "/conf.inc.php";
    if (!writeconfig($sql['host'], $sql['user'], $sql['pass'], $sql['db'], $sql['pre'], "false")) {
        $install_array['ANYTHING'] = "Your {$link} isn't writeable or does not exist.  Please make it writable and make sure it exists.";
        $disable = true;
    } else {
        $install_array['ANYTHING'] = "Since you've already ran the installer, your config has been re-written to the \"not installed\" state. If you are upgrading, this is normal!<br>";
    }
}
if (!file_exists($link)) {
    if (!fopen($link, "w+")) {
        $install_array["ANYTHING"] = "Your {$link} file doesn't exist. Please create it as a blank file and make it writable.";
        $disable = true;
    }
}
if (!is_writable($link)) {
    if (!main::perms($link, 0666)) {
        $install_array["ANYTHING"] = "Your {$link} isn't writeable.  Please make it writable.";
        $disable = true;
    }
}
echo style::get("header.tpl");
if ($disable) {
    echo '<script type="text/javascript">$(function(){
$(".twobutton").attr("disabled", "true");$("#method").attr("disabled", "true");}
);</script>';
}
$install_array["GENERATED_URL"] = generateSiteUrl();
echo style::replaceVar("../install/includes/tpl/install.tpl", $install_array);
echo style::get("footer.tpl");
include INC . "/output.php";
//Output it