Feature #536: Use complete domain name as default path for DocumentRoot

This commit is contained in:
Sorin Pohontu (frontline)
2013-03-20 21:37:37 +02:00
parent 236ba6abfb
commit faada48e38
8 changed files with 83 additions and 8 deletions

View File

@@ -509,6 +509,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('system', 'perl_server', 'unix:/var/run/nginx/cgiwrap-dispatch.sock'),
('system', 'phpreload_command', ''),
('system', 'apache24', '0'),
('system', 'documentroot_use_default_value', '0'),
('panel', 'decimal_places', '4'),
('panel', 'adminmail', 'admin@SERVERNAME'),
('panel', 'phpmyadmin_url', ''),

View File

@@ -2024,3 +2024,15 @@ if (isFroxlorVersion('0.9.28-svn6')) {
lastStepStatus(0);
updateToVersion('0.9.28-rc1');
}
if (isFroxlorVersion('0.9.28-rc1')) {
$update_system_documentroot_use_default_value = isset($_POST['update_system_documentroot_use_default_value']) ? (int)$_POST['update_system_documentroot_use_default_value'] : '0';
showUpdateStep("Adding new settings for using domain name as default value for DocumentRoot path", true);
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'documentroot_use_default_value', '".$update_system_documentroot_use_default_value."');");
lastStepStatus(0);
showUpdateStep("Updating from 0.9.28-rc1 to 0.9.28-rc2", true);
lastStepStatus(0);
updateToVersion('0.9.28-rc2');
}

View File

@@ -471,4 +471,17 @@ LoadModule authz_host_module modules/mod_authz_host.so</pre><br />';
}
}
if(versionInUpdate($current_version, '0.9.28-rc2'))
{
$has_preconfig = true;
$description = 'This version will add an option to set default path for all domains and subdomains, to be the full subdomain or domain name.<br />';
$description .= 'You can enable or disable this feature anytime from Server -> Settings -> System settings.<br />';
$question .= '<strong>Do you want to Use domain name as default value for DocumentRoot path?:</strong>&nbsp;';
$question.= makeyesno('update_system_documentroot_use_default_value', '1', '0', '1');
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
}
}