Пример #1
0
}
if (isDatabaseVersion('201605090')) {
    showUpdateStep("Adjusting SPF record setting");
    $current_spf = Settings::Get('spf.spf_entry');
    // @	IN	TXT	"v=spf1 a mx -all"
    $new_spf = substr($current_spf, strpos($current_spf, '"'));
    Settings::Set('spf.spf_entry', $new_spf, true);
    lastStepStatus(0);
    updateToDbVersion('201605120');
}
if (isDatabaseVersion('201605120')) {
    showUpdateStep("Adding new dns-server setting");
    $new_dns_daemon = isset($_POST['new_dns_daemon']) ? $_POST['new_dns_daemon'] : "bind";
    Settings::AddNew("system.dns_server", $new_dns_daemon);
    lastStepStatus(0);
    updateToDbVersion('201605170');
}
if (isDatabaseVersion('201605170')) {
    showUpdateStep("Adding new dns-editor setting for customers");
    Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `dnsenabled` tinyint(1) NOT NULL default '0' AFTER `perlenabled`;");
    lastStepStatus(0);
    updateToDbVersion('201605180');
}
if (isDatabaseVersion('201605180')) {
    showUpdateStep("Changing tables to be more mysql strict-mode compatible");
    Database::query("ALTER TABLE `" . TABLE_FTP_USERS . "` CHANGE `last_login` `last_login` DATETIME NULL DEFAULT NULL;");
    Database::query("ALTER TABLE `" . TABLE_PANEL_IPSANDPORTS . "` CHANGE `specialsettings` `specialsettings` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;");
    Database::query("ALTER TABLE `" . TABLE_PANEL_TASKS . "` CHANGE `data` `data` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;");
    lastStepStatus(0);
    updateToDbVersion('201606190');
}
Пример #2
0
    Settings::AddNew("system.mail_smtp_port", $smtp_port);
    Settings::AddNew("system.mail_smtp_usetls", $smtp_usetls);
    Settings::AddNew("system.mail_smtp_auth", $smtp_useauth);
    Settings::AddNew("system.mail_smtp_user", $smtp_user);
    Settings::AddNew("system.mail_smtp_passwd", $smtp_passwd);
    lastStepStatus(0);
    updateToDbVersion('201609200');
}
if (isDatabaseVersion('201609200')) {
    showUpdateStep("Changing tables to be more mysql strict-mode compatible");
    Database::query("ALTER TABLE `" . TABLE_MAIL_VIRTUAL . "` CHANGE `destination` `destination` TEXT NOT NULL DEFAULT '';");
    Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` CHANGE `registration_date` `registration_date` DATE NULL DEFAULT NULL;");
    Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` CHANGE `termination_date` `termination_date` DATE NULL DEFAULT NULL;");
    lastStepStatus(0);
    updateToDbVersion('201609240');
}
if (isDatabaseVersion('201609240')) {
    showUpdateStep("Add HSTS settings for froxlor-vhost");
    Settings::AddNew("system.hsts_maxage", 0);
    Settings::AddNew("system.hsts_incsub", 0);
    Settings::AddNew("system.hsts_preload", 0);
    lastStepStatus(0);
    showUpdateStep("Settings HSTS default values for all domains (deactivated)");
    Database::query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `hsts_sub` = '0', `hsts_preload` = '0';");
    lastStepStatus(0);
    updateToDbVersion('201610070');
}
if (isFroxlorVersion('0.9.37')) {
    showUpdateStep("Updating from 0.9.37 to 0.9.38-rc1", false);
    updateToVersion('0.9.38-rc1');
}
Пример #3
0
    // get user-chosen value
    $websrv_default = "/etc/apache2/conf-enabled/acme.conf";
    if (Settings::Get('system.webserver') == 'nginx') {
        $websrv_default = "/etc/nginx/acme.conf";
    }
    $acmeconffile = isset($_POST['acmeconffile']) ? $_POST['acmeconffile'] : $websrv_default;
    $acmeconffile = makeCorrectFile($acmeconffile);
    Settings::AddNew("system.letsencryptacmeconf", $acmeconffile);
    lastStepStatus(0);
    updateToDbVersion('201609120');
}
if (isDatabaseVersion('201609120')) {
    showUpdateStep("Adding new SMTP settings for emails sent by froxlor");
    // get user-chosen value
    $smtp_enable = isset($_POST['smtp_enable']) ? (int) $_POST['smtp_enable'] : 0;
    $smtp_host = isset($_POST['smtp_host']) ? $_POST['smtp_host'] : "localhost";
    $smtp_port = isset($_POST['smtp_port']) ? (int) $_POST['smtp_port'] : 25;
    $smtp_usetls = isset($_POST['smtp_usetls']) ? (int) $_POST['smtp_usetls'] : 1;
    $smtp_useauth = isset($_POST['smtp_auth']) ? (int) $_POST['smtp_auth'] : 1;
    $smtp_user = isset($_POST['smtp_user']) ? $_POST['smtp_user'] : "";
    $smtp_passwd = isset($_POST['smtp_passwd']) ? $_POST['smtp_passwd'] : "";
    Settings::AddNew("system.mail_use_smtp", $smtp_enable);
    Settings::AddNew("system.mail_smtp_host", $smtp_host);
    Settings::AddNew("system.mail_smtp_port", $smtp_port);
    Settings::AddNew("system.mail_smtp_usetls", $smtp_usetls);
    Settings::AddNew("system.mail_smtp_auth", $smtp_useauth);
    Settings::AddNew("system.mail_smtp_user", $smtp_user);
    Settings::AddNew("system.mail_smtp_passwd", $smtp_passwd);
    lastStepStatus(0);
    updateToDbVersion('201609200');
}