Commit 75b7fc56 authored by Marius Cramer's avatar Marius Cramer

- ported some patches

parent af4c7ab6
......@@ -385,4 +385,24 @@ function updateDbAndIni() {
function setDefaultServers(){
global $inst, $conf;
// clients
$clients = $inst->db->queryAllRecords("SELECT * FROM ".$conf["mysql"]["database"].".client");
if(is_array($clients) && !empty($clients)){
foreach($clients as $client){
// mailserver
if(trim($client['mail_servers']) == '') $inst->db->query("UPDATE ".$conf["mysql"]["database"].".client SET mail_servers = '".trim($client['default_mailserver'])."' WHERE client_id = ".$client['client_id']);
// webserver
if(trim($client['web_servers']) == '') $inst->db->query("UPDATE ".$conf["mysql"]["database"].".client SET web_servers = '".trim($client['default_webserver'])."' WHERE client_id = ".$client['client_id']);
// dns server
if(trim($client['dns_servers']) == '') $inst->db->query("UPDATE ".$conf["mysql"]["database"].".client SET dns_servers = '".trim($client['default_dnsserver'])."' WHERE client_id = ".$client['client_id']);
// db server
if(trim($client['db_servers']) == '') $inst->db->query("UPDATE ".$conf["mysql"]["database"].".client SET db_servers = '".trim($client['default_dbserver'])."' WHERE client_id = ".$client['client_id']);
}
}
}
?>
......@@ -139,4 +139,5 @@ UPDATE `dbispconfig`.`sys_ini` SET `default_logo` = 'data:image/png;base64,iVBOR
ALTER TABLE `directive_snippets` ADD `required_php_snippets` VARCHAR(255) NOT NULL DEFAULT '' AFTER `customer_viewable`;
ALTER TABLE `dns_rr` CHANGE `ttl` `ttl` INT(11) UNSIGNED NOT NULL DEFAULT '3600';
ALTER TABLE `dns_soa` CHANGE `minimum` `minimum` INT(11) UNSIGNED NOT NULL DEFAULT '3600', CHANGE `ttl` `ttl` INT(11) UNSIGNED NOT NULL DEFAULT '3600';
\ No newline at end of file
ALTER TABLE `dns_soa` CHANGE `minimum` `minimum` INT(11) UNSIGNED NOT NULL DEFAULT '3600', CHANGE `ttl` `ttl` INT(11) UNSIGNED NOT NULL DEFAULT '3600';
ALTER TABLE `client` CHANGE `web_php_options` `web_php_options` VARCHAR(255) NOT NULL DEFAULT 'no,fast-cgi,cgi,mod,suphp,php-fpm,hhvm';
\ No newline at end of file
......@@ -201,7 +201,7 @@ CREATE TABLE `client` (
`limit_web_ip` text,
`limit_web_domain` int(11) NOT NULL DEFAULT '-1',
`limit_web_quota` int(11) NOT NULL DEFAULT '-1',
`web_php_options` varchar(255) NOT NULL DEFAULT 'no,fast-cgi,cgi,mod,suphp,php-fpm',
`web_php_options` varchar(255) NOT NULL DEFAULT 'no,fast-cgi,cgi,mod,suphp,php-fpm,hhvm',
`limit_cgi` enum('n','y') NOT NULL DEFAULT 'n',
`limit_ssi` enum('n','y') NOT NULL DEFAULT 'n',
`limit_perl` enum('n','y') NOT NULL DEFAULT 'n',
......
......@@ -513,6 +513,9 @@ if($reconfigure_services_answer == 'yes') {
}
}
//* Set default servers
setDefaultServers();
//* Create md5 filelist
$md5_filename = '/usr/local/ispconfig/security/data/file_checksums_'.date('Y-m-d_h-i').'.md5';
exec('find /usr/local/ispconfig -type f -print0 | xargs -0 md5sum > '.$md5_filename);
......
......@@ -150,7 +150,7 @@ class page_action extends tform_actions {
$options_dns_servers = "";
foreach ($dns_servers as $dns_server) {
$options_dns_servers .= "<option value='$dns_server[server_id]'>$dns_server[server_name]</option>";
$options_dns_servers .= '<option value="'.$dns_server['server_id'].'"'.($this->id > 0 && $this->dataRecord["server_id"] == $dns_server['server_id'] ? ' selected="selected"' : '').'>'.$dns_server['server_name'].'</option>';
}
$app->tpl->setVar("client_server_id", $options_dns_servers);
......
......@@ -147,7 +147,7 @@ if($_SESSION["s"]["user"]["typ"] != 'admin')
$options_dns_servers = "";
foreach ($dns_servers as $dns_server) {
$options_dns_servers .= "<option value='$dns_server[server_id]'>$dns_server[server_name]</option>";
$options_dns_servers .= '<option value="'.$dns_server['server_id'].'"'.($_POST['server_id'] == $dns_server['server_id'] ? ' selected="selected"' : '').'>'.$dns_server['server_name'].'</option>';
}
$app->tpl->setVar("server_id", $options_dns_servers);
......
......@@ -139,7 +139,7 @@ class page_action extends tform_actions {
$options_mail_servers = "";
foreach ($mail_servers as $mail_server) {
$options_mail_servers .= "<option value='$mail_server[server_id]'>$mail_server[server_name]</option>";
$options_mail_servers .= '<option value="'.$mail_server['server_id'].'"'.($this->id > 0 && $this->dataRecord["server_id"] == $mail_server['server_id'] ? ' selected="selected"' : '').'>'.$mail_server['server_name'].'</option>';
}
$app->tpl->setVar("client_server_id", $options_mail_servers);
......
......@@ -89,7 +89,7 @@ class page_action extends tform_actions {
}
foreach ($tmp as $db_server) {
$options_db_servers .= "<option value='$db_server[server_id]'>$db_server[server_name]</option>";
$options_db_servers .= '<option value="'.$db_server['server_id'].'"'.($this->id > 0 && $this->dataRecord["server_id"] == $db_server['server_id'] ? ' selected="selected"' : '').'>'.$db_server['server_name'].'</option>';
}
$app->tpl->setVar("server_id", $options_db_servers);
......@@ -112,7 +112,7 @@ class page_action extends tform_actions {
}
foreach ($tmp as $db_server) {
$options_db_servers .= "<option value='$db_server[server_id]'>$db_server[server_name]</option>";
$options_db_servers .= '<option value="'.$db_server['server_id'].'"'.($this->id > 0 && $this->dataRecord["server_id"] == $db_server['server_id'] ? ' selected="selected"' : '').'>'.$db_server['server_name'].'</option>';
}
$app->tpl->setVar("server_id", $options_db_servers);
......
......@@ -173,7 +173,7 @@ class page_action extends tform_actions {
$options_web_servers = "";
foreach ($web_servers as $web_server) {
$options_web_servers .= "<option value='$web_server[server_id]'>$web_server[server_name]</option>";
$options_web_servers .= '<option value="'.$web_server['server_id'].'"'.($this->id > 0 && $this->dataRecord["server_id"] == $web_server['server_id'] ? ' selected="selected"' : '').'>'.$web_server['server_name'].'</option>';
}
$app->tpl->setVar("server_id", $options_web_servers);
......@@ -298,7 +298,7 @@ class page_action extends tform_actions {
$options_web_servers = "";
foreach ($web_servers as $web_server) {
$options_web_servers .= "<option value='$web_server[server_id]'>$web_server[server_name]</option>";
$options_web_servers .= '<option value="'.$web_server['server_id'].'"'.($this->id > 0 && $this->dataRecord["server_id"] == $web_server['server_id'] ? ' selected="selected"' : '').'>'.$web_server['server_name'].'</option>';
}
$app->tpl->setVar("server_id", $options_web_servers);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment