Commit 41d7d170 authored by Sergio's avatar Sergio
Browse files

default servers on system config for admin use

parent a1db6855
......@@ -172,6 +172,28 @@ $form["tabs"]['sites'] = array (
'default' => 'n',
'value' => array(0 => 'n', 1 => 'y')
),
'default_webserver' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '1',
'datasource' => array ( 'type' => 'CUSTOM',
'class'=> 'custom_datasource',
'function'=> 'client_servers'
),
'value' => '',
'name' => 'default_webserver'
),
'default_dbserver' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '1',
'datasource' => array ( 'type' => 'CUSTOM',
'class'=> 'custom_datasource',
'function'=> 'client_servers'
),
'value' => '',
'name' => 'default_dbserver'
),
//#################################
// ENDE Datatable fields
//#################################
......@@ -321,6 +343,53 @@ $form["tabs"]['mail'] = array (
'default' => '',
'value' => array('' => 'No', 'ssl' => 'SSL', 'tls' => 'STARTTLS')
),
'default_mailserver' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '1',
'datasource' => array ( 'type' => 'CUSTOM',
'class'=> 'custom_datasource',
'function'=> 'client_servers'
),
'value' => '',
'name' => 'default_mailserver'
),
//#################################
// ENDE Datatable fields
//#################################
)
);
$form["tabs"]['dns'] = array (
'title' => "DNS",
'width' => 70,
'template' => "templates/system_config_dns_edit.htm",
'fields' => array (
//#################################
// Begin Datatable fields
//#################################
'default_dnsserver' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '1',
'datasource' => array ( 'type' => 'CUSTOM',
'class'=> 'custom_datasource',
'function'=> 'client_servers'
),
'value' => '',
'name' => 'default_dnsserver'
),
'default_slave_dnsserver' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '1',
'datasource' => array ( 'type' => 'CUSTOM',
'class'=> 'custom_datasource',
'function'=> 'client_servers'
),
'value' => '',
'name' => 'default_slave_dnsserver'
),
//#################################
// ENDE Datatable fields
//#################################
......
......@@ -41,6 +41,8 @@ $wb['Firewall'] = 'Firewall';
$wb['Interface'] = 'Interface';
$wb['Interface Config'] = 'Main Config';
$wb['Sites'] = 'Sites';
$wb['DNS'] = 'DNS';
$wb['Domains'] = 'Domains';
$wb['Misc'] = 'Misc';
......@@ -59,4 +61,4 @@ $wb['Import'] = 'Import';
$wb['Remote Actions'] = 'Remote Actions';
$wb['Do OS-Update'] = 'Do OS-Update';
$wb['Do ISPConfig-Update'] = 'Do ISPConfig-Update';
?>
\ No newline at end of file
?>
......@@ -73,4 +73,9 @@ $wb['session_allow_endless_txt'] = 'Enable "stay logged in"';
$wb['No'] = 'No';
$wb['min_password_length_txt'] = 'Minimum password length';
$wb['min_password_strength_txt'] = 'Minimum password strength';
$wb["default_mailserver_txt"] = 'Default Mailserver';
$wb["default_webserver_txt"] = 'Default Webserver';
$wb["default_dnsserver_txt"] = 'Default DNS Server';
$wb["default_slave_dnsserver_txt"] = 'Default Secondary DNS Server';
$wb["default_dbserver_txt"] = 'Default Database Server';
?>
......@@ -47,4 +47,6 @@ $wb['Directive Snippets'] = 'Fragmentos de Directivas';
$wb['Interface'] = 'Interfaz';
$wb['Domains'] = 'Dominios';
$wb['Misc'] = 'Misc';
$wb['Sites'] = 'Sitios';
$wb['DNS'] = 'DNS';
?>
......@@ -70,4 +70,9 @@ $wb['min_password_length_txt'] = 'Longitud de contraseña mínima';
$wb['min_password_strength_txt'] = 'Fortaleza de contraseña mínima';
$wb['Sites'] = 'Sitios';
$wb['System Config'] = 'Configuración de sistema';
$wb['default_mailserver_txt'] = 'Servidor de correo por defecto';
$wb['default_webserver_txt'] = 'Servidor web por defecto';
$wb['default_dnsserver_txt'] = 'Servidor DNS por defecto';
$wb['default_slave_dnsserver_txt'] = 'Servidor DNS secundario por defecto';
$wb['default_dbserver_txt'] = 'Servidor de bases de datos por defecto';
?>
......@@ -64,6 +64,9 @@ class page_action extends tform_actions {
$server_id = $this->id;
$this->dataRecord = $app->getconf->get_global_config($section);
if (is_null($this->dataRecord)) {
$this->dataRecord = array();
}
if ($section == 'domains'){
if (isset($this->dataRecord['use_domain_module'])){
$_SESSION['use_domain_module_old_value'] = $this->dataRecord['use_domain_module'];
......
......@@ -85,6 +85,12 @@
{tmpl_var name='smtp_crypt'}
</select>
</div>
<div class="ctrlHolder">
<label for="default_mailserver">{tmpl_var name='default_mailserver_txt'}</label>
<select name="default_mailserver" id="default_mailserver" class="selectInput">
{tmpl_var name='default_mailserver'}
</select>
</div>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
......
......@@ -63,6 +63,18 @@
{tmpl_var name='reseller_can_use_options'}
</div>
</div>
<div class="ctrlHolder">
<label for="default_webserver">{tmpl_var name='default_webserver_txt'}</label>
<select name="default_webserver" id="default_webserver" class="selectInput">
{tmpl_var name='default_webserver'}
</select>
</div>
<div class="ctrlHolder">
<label for="default_dbserver">{tmpl_var name='default_dbserver_txt'}</label>
<select name="default_dbserver" id="default_dbserver" class="selectInput">
{tmpl_var name='default_dbserver'}
</select>
</div>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
......
......@@ -56,7 +56,8 @@ if (isset($_POST['server_id'])) {
$server_id = $app->functions->intval($_POST['server_id_value']);
$post_server_id = true;
} else {
$server_id = 1;
$settings = $app->getconf->get_global_config('dns');
$server_id = $app->functions->intval($settings['default_dnsserver']);
$post_server_id = false;
}
......
......@@ -61,6 +61,9 @@ class page_action extends tform_actions {
if(!$app->tform->checkResellerLimit('limit_dns_slave_zone')) {
$app->error('Reseller: '.$app->tform->wordbook["limit_dns_slave_zone_txt"]);
}
} else {
$settings = $app->getconf->get_global_config('dns');
$app->tform->formDef['tabs']['dns_slave']['fields']['server_id']['default'] = intval($settings['default_slave_dnsserver']);
}
parent::onShowNew();
......
......@@ -71,6 +71,9 @@ class page_action extends tform_actions {
if(!$app->tform->checkResellerLimit('limit_dns_zone')) {
$app->error('Reseller: '.$app->tform->wordbook["limit_dns_zone_txt"]);
}
} else {
$settings = $app->getconf->get_global_config('dns');
$app->tform->formDef['tabs']['dns_soa']['fields']['server_id']['default'] = intval($settings['default_dnsserver']);
}
parent::onShowNew();
......
......@@ -53,7 +53,8 @@ if (isset($_POST['server_id'])) {
$server_id = $app->functions->intval($_POST['server_id_value']);
$post_server_id = true;
} else {
$server_id = 1;
$settings = $app->getconf->get_global_config('dns');
$server_id = $app->functions->intval($settings['default_dnsserver']);
$post_server_id = false;
}
......
......@@ -61,6 +61,9 @@ class page_action extends tform_actions {
if(!$app->tform->checkResellerLimit('limit_maildomain')) {
$app->error('Reseller: '.$app->tform->wordbook["limit_maildomain_txt"]);
}
} else {
$settings = $app->getconf->get_global_config('mail');
$app->tform->formDef['tabs']['domain']['fields']['server_id']['default'] = intval($settings['default_mailserver']);
}
parent::onShowNew();
......
......@@ -61,6 +61,9 @@ class page_action extends tform_actions {
if(!$app->tform->checkResellerLimit('limit_database')) {
$app->error('Reseller: '.$app->tform->wordbook["limit_database_txt"]);
}
} else {
$settings = $app->getconf->get_global_config('sites');
$app->tform->formDef['tabs']['database']['fields']['server_id']['default'] = intval($settings['default_dbserver']);
}
parent::onShowNew();
......
......@@ -115,6 +115,9 @@ class page_action extends tform_actions {
$web_servers = explode(',', $client['web_servers']);
$app->tpl->setVar("server_id_value", $web_servers[0]);
unset($web_servers);
} else {
$settings = $app->getconf->get_global_config('sites');
$app->tform->formDef['tabs']['domain']['fields']['server_id']['default'] = intval($settings['default_webserver']);
}
$app->tform->formDef['tabs']['domain']['readonly'] = false;
......
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