Commit 1e121abc authored by Marius Cramer's avatar Marius Cramer
Browse files

Merge branch 'Cambra/ispconfig3-favourite_servers'

parents cbdc7aca adb0e74c
ALTER TABLE `mail_user`
CHANGE `uid` `uid` int(11) NOT NULL DEFAULT '5000',
CHANGE `gid` `gid` int(11) NOT NULL DEFAULT '5000';
ALTER TABLE `client_template` ADD `default_mailserver` INT(11) NOT NULL DEFAULT 1;
ALTER TABLE `client_template` ADD `default_webserver` INT(11) NOT NULL DEFAULT 1;
ALTER TABLE `client_template` ADD `default_dnsserver` INT(11) NOT NULL DEFAULT 1;
ALTER TABLE `client_template` ADD `default_slave_dnsserver` INT(11) NOT NULL DEFAULT 1;
ALTER TABLE `client_template` ADD `default_dbserver` INT(11) NOT NULL DEFAULT 1;
......@@ -146,7 +146,7 @@ class client_templates {
if (is_array($addLimits)){
foreach($addLimits as $k => $v){
/* we can remove this condition, but it is easier to debug with it (don't add ids and other non-limit values) */
if (strpos($k, 'limit') !== false or $k == 'ssh_chroot' or $k == 'web_php_options' or $k == 'force_suexec'){
if (strpos($k, 'limit') !== false or strpos($k, 'default') !== false or $k == 'ssh_chroot' or $k == 'web_php_options' or $k == 'force_suexec'){
$app->log('Template processing key ' . $k . ' for client ' . $clientId, LOGLEVEL_DEBUG);
/* process the numerical limits */
......@@ -160,6 +160,15 @@ class client_templates {
if ($limits[$k] < 1) $limits[$k] = 1;
break;
case 'default_mailserver':
case 'default_webserver':
case 'default_dnsserver':
case 'default_slave_dnsserver':
case 'default_dbserver':
/* additional templates don't override default server from main template */
if ($limits[$k] == 0) $limits[$k] = $v;
break;
default:
if ($limits[$k] > -1){
if ($v == -1){
......@@ -225,7 +234,10 @@ class client_templates {
$update = '';
if(!$is_reseller) unset($limits['limit_client']); // Only Resellers may have limit_client set in template to ensure that we do not convert a client to reseller accidently.
foreach($limits as $k => $v){
if ((strpos($k, 'limit') !== false or $k == 'ssh_chroot' or $k == 'web_php_options' or $k == 'force_suexec') && !is_array($v)){
if (strpos($k, 'default') !== false and $v == 0) {
continue; // template doesn't define default server, client's default musn't be changed
}
if ((strpos($k, 'limit') !== false or strpos($k, 'default') !== false or $k == 'ssh_chroot' or $k == 'web_php_options' or $k == 'force_suexec') && !is_array($v)){
if ($update != '') $update .= ', ';
$update .= '`' . $k . "`='" . $v . "'";
}
......
......@@ -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';
?>
......@@ -5,7 +5,7 @@
- DOUBLE
- CURRENCY
- VARCHAR
- TEXT
- SELECT
- DATE
*/
......@@ -58,7 +58,7 @@ $liste['item'][] = array( 'field' => 'server_name',
$liste['item'][] = array( 'field' => 'mail_server',
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'formtype' => 'SELECT',
'op' => 'like',
'prefix' => '%',
'suffix' => '%',
......@@ -67,7 +67,7 @@ $liste['item'][] = array( 'field' => 'mail_server',
$liste['item'][] = array( 'field' => 'web_server',
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'formtype' => 'SELECT',
'op' => 'like',
'prefix' => '%',
'suffix' => '%',
......@@ -76,7 +76,7 @@ $liste['item'][] = array( 'field' => 'web_server',
$liste['item'][] = array( 'field' => 'dns_server',
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'formtype' => 'SELECT',
'op' => 'like',
'prefix' => '%',
'suffix' => '%',
......@@ -85,7 +85,7 @@ $liste['item'][] = array( 'field' => 'dns_server',
$liste['item'][] = array( 'field' => 'file_server',
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'formtype' => 'SELECT',
'op' => 'like',
'prefix' => '%',
'suffix' => '%',
......@@ -94,7 +94,7 @@ $liste['item'][] = array( 'field' => 'file_server',
$liste['item'][] = array( 'field' => 'db_server',
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'formtype' => 'SELECT',
'op' => 'like',
'prefix' => '%',
'suffix' => '%',
......@@ -103,7 +103,7 @@ $liste['item'][] = array( 'field' => 'db_server',
$liste['item'][] = array( 'field' => 'vserver_server',
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'formtype' => 'SELECT',
'op' => 'like',
'prefix' => '%',
'suffix' => '%',
......
......@@ -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'}">
......
......@@ -291,14 +291,29 @@ class page_action extends tform_actions {
}
//* Set the default servers
$tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE mail_server = 1 AND mirror_server_id = 0 LIMIT 0,1');
$default_mailserver = $app->functions->intval($tmp['server_id']);
$tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE web_server = 1 AND mirror_server_id = 0 LIMIT 0,1');
$default_webserver = $app->functions->intval($tmp['server_id']);
$tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE dns_server = 1 AND mirror_server_id = 0 LIMIT 0,1');
$default_dnsserver = $app->functions->intval($tmp['server_id']);
$tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE db_server = 1 AND mirror_server_id = 0 LIMIT 0,1');
$default_dbserver = $app->functions->intval($tmp['server_id']);
$tmp = $app->getconf->get_global_config('mail');
$default_mailserver = $app->functions->intval($tmp['default_mailserver']);
if (!$default_mailserver) {
$tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE mail_server = 1 AND mirror_server_id = 0 LIMIT 0,1');
$default_mailserver = $app->functions->intval($tmp['server_id']);
}
$tmp = $app->getconf->get_global_config('sites');
$default_webserver = $app->functions->intval($tmp['default_webserver']);
$default_dbserver = $app->functions->intval($tmp['default_dbserver']);
if (!$default_webserver) {
$tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE web_server = 1 AND mirror_server_id = 0 LIMIT 0,1');
$default_webserver = $app->functions->intval($tmp['server_id']);
}
if (!$default_dbserver) {
$tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE db_server = 1 AND mirror_server_id = 0 LIMIT 0,1');
$default_dbserver = $app->functions->intval($tmp['server_id']);
}
$tmp = $app->getconf->get_global_config('dns');
$default_dnsserver = $app->functions->intval($tmp['default_dnsserver']);
if (!$default_dnsserver) {
$tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE dns_server = 1 AND mirror_server_id = 0 LIMIT 0,1');
$default_dnsserver = $app->functions->intval($tmp['server_id']);
}
$sql = "UPDATE client SET mail_servers = $default_mailserver, web_servers = $default_webserver, dns_servers = $default_dnsserver, default_slave_dnsserver = $default_dnsserver, db_servers = $default_dbserver WHERE client_id = ".$this->id;
$app->db->query($sql);
......
......@@ -88,10 +88,17 @@ class page_action extends tform_actions {
global $app;
$app->uses('client_templates');
if (isset($this->dataRecord["template_type"])) {
$template_type = $this->dataRecord["template_type"];
} else {
$tmp = $app->tform->getDataRecord($this->id);
$template_type = $tmp['template_type'];
}
/*
* the template has changed. apply the new data to all clients
*/
if ($this->dataRecord["template_type"] == 'm'){
if ($template_type == 'm'){
$sql = "SELECT client_id FROM client WHERE template_master = " . $this->id;
} else {
$sql = "SELECT client_id FROM client WHERE template_additional LIKE '%/" . $this->id . "/%' OR template_additional LIKE '" . $this->id . "/%' OR template_additional LIKE '%/" . $this->id . "' UNION SELECT client_id FROM client_template_assigned WHERE client_template_id = " . $this->id;
......
......@@ -115,6 +115,17 @@ $form["tabs"]['limits'] = array (
'rows' => '',
'cols' => ''
),
'default_mailserver' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '0',
'datasource' => array ( 'type' => 'CUSTOM',
'class'=> 'custom_datasource',
'function'=> 'client_servers'
),
'value' => array(''),
'name' => 'default_mailserver'
),
'limit_maildomain' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
......@@ -311,6 +322,17 @@ $form["tabs"]['limits'] = array (
'rows' => '',
'cols' => ''
),
'default_webserver' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '0',
'datasource' => array ( 'type' => 'CUSTOM',
'class'=> 'custom_datasource',
'function'=> 'client_servers'
),
'value' => array(''),
'name' => 'default_webserver'
),
'limit_web_domain' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
......@@ -491,6 +513,17 @@ $form["tabs"]['limits'] = array (
'default' => 'y',
'value' => array(0 => 'n', 1 => 'y')
),
'default_dnsserver' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '0',
'datasource' => array ( 'type' => 'CUSTOM',
'class'=> 'custom_datasource',
'function'=> 'client_servers'
),
'value' => array(''),
'name' => 'default_dnsserver'
),
'limit_dns_zone' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
......@@ -505,6 +538,17 @@ $form["tabs"]['limits'] = array (
'rows' => '',
'cols' => ''
),
'default_slave_dnsserver' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '0',
'datasource' => array ( 'type' => 'CUSTOM',
'class'=> 'custom_datasource',
'function'=> 'client_servers'
),
'value' => array(''),
'name' => 'default_slave_dnsserver'
),
'limit_dns_slave_zone' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
......@@ -549,6 +593,17 @@ $form["tabs"]['limits'] = array (
'cols' => ''
),
*/
'default_dbserver' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
'default' => '0',
'datasource' => array ( 'type' => 'CUSTOM',
'class'=> 'custom_datasource',
'function'=> 'client_servers'
),
'value' => array(''),
'name' => 'default_dbserver'
),
'limit_database' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
......
......@@ -2,6 +2,7 @@
$wb["template_type_txt"] = 'Template type';
$wb["template_name_txt"] = 'Template name';
$wb["limit_client_error_notint"] = 'Client Limit is not a number.';
$wb["default_mailserver_txt"] = 'Default Mailserver';
$wb["limit_maildomain_txt"] = 'Max. number of email domains';
$wb["limit_mailbox_txt"] = 'Max. number of mailboxes';
$wb["limit_mailalias_txt"] = 'Max. number of email aliases';
......@@ -23,11 +24,14 @@ $wb["limit_database_txt"] = 'limit_database';
$wb["limit_cron_txt"] = 'Max. number of cron jobs';
$wb["limit_cron_type_txt"] = 'Max. type of cron jobs (chrooted and full implies url)';
$wb["limit_cron_frequency_txt"] = 'Min. delay between executions';
$wb["default_webserver_txt"] = 'Default Webserver';
$wb["limit_web_domain_txt"] = 'Max. number of web domains';
$wb["limit_web_aliasdomain_txt"] = 'Max. number of web aliasdomains';
$wb["limit_web_subdomain_txt"] = 'Max. number of web subdomains';
$wb["limit_ftp_user_txt"] = 'Max. number of FTP users';
$wb["default_dnsserver_txt"] = 'Default DNS Server';
$wb["limit_dns_zone_txt"] = 'Max. number of DNS zones';
$wb["default_slave_dnsserver_txt"] = 'Default Secondary DNS Server';
$wb["limit_dns_slave_zone_txt"] = 'Max. number of secondary DNS zones';
$wb["limit_dns_record_txt"] = 'Max. number DNS records';
$wb["limit_shell_user_txt"] = 'Max. number of Shell users';
......@@ -57,6 +61,7 @@ $wb["limit_webdav_user_error_notint"] = 'The webdav user limit must be a number.
$wb["limit_dns_zone_error_notint"] = 'The dns zone limit must be a number.';
$wb["limit_dns_slave_zone_error_notint"] = 'The dns slave zone limit must be a number.';
$wb["limit_dns_record_error_notint"] = 'The dns record limit must be a number.';
$wb["default_dbserver_txt"] = 'Default Database Server';
$wb["limit_database_txt"] = 'Max. number of Databases';
$wb["limit_database_error_notint"] = 'The database limit must be a number.';
$wb["limit_cron_error_notint"] = 'The cron limit must be a number.';
......
<?php
$wb['limit_client_error_notint'] = 'El límite de subclientes debe ser un número.';
$wb['default_mailserver_txt'] = 'Servidor de correo por defecto';
$wb['limit_maildomain_txt'] = 'Número máximo de dominios de correo';
$wb['limit_mailbox_txt'] = 'Número máximo de buzones de correo';
$wb['limit_mailalias_txt'] = 'Número máximo de alias de correo';
......@@ -17,11 +18,14 @@ $wb['limit_domain_txt'] = 'Número máximo de dominios ';
$wb['limit_subdomain_txt'] = 'Número máximo de subdominios ';
$wb['limit_webquota_txt'] = 'Cuota de web';
$wb['limit_database_txt'] = 'Número máximo de bases de datos';
$wb['default_webserver_txt'] = 'Servidor web por defecto';
$wb['limit_web_domain_txt'] = 'Número máximo de sitios web';
$wb['limit_web_aliasdomain_txt'] = 'Número máximo de alias de dominios';
$wb['limit_web_subdomain_txt'] = 'Número máximo de subdominios';
$wb['limit_ftp_user_txt'] = 'Número máximo de usuarios FTP';
$wb['default_dnsserver_txt'] = 'Servidor DNS por defecto';
$wb['limit_dns_zone_txt'] = 'Número máximo de zonas DNS';
$wb['default_slave_dnsserver_txt'] = 'Servidor DNS secundario por defecto';
$wb['limit_dns_slave_zone_txt'] = 'Número máximo de zonas DNS secundarias';
$wb['limit_dns_record_txt'] = 'Número máximo de registros DNS';
$wb['limit_shell_user_txt'] = 'Número máximo de usuarios de consola';
......@@ -45,6 +49,7 @@ $wb['limit_shell_user_error_notint'] = 'El límite de usuarios de consola debe s
$wb['limit_dns_zone_error_notint'] = 'El límite de registros DNS debe ser un número.';
$wb['limit_dns_slave_zone_error_notint'] = 'El límite de zonas DNS secundarias debe ser un número.';
$wb['limit_dns_record_error_notint'] = 'El límite de registros DNS debe ser un número.';
$wb['default_dbserver_txt'] = 'Servidor de bases de datos por defecto';
$wb['limit_database_error_notint'] = 'El límite de bases de datos debe ser un número.';
$wb['error_template_name_empty'] = 'Por favor, introduzca un nombre de plantilla';
$wb['limit_cron_txt'] = 'Número máximo de tareas cron';
......
......@@ -7,6 +7,12 @@
<fieldset class="inlineLabels"><legend>Limits</legend>
<div class="subsectiontoggle"><span class="showing"></span>{tmpl_var name='web_limits_txt'}<em class="showing"></em></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="limit_web_domain">{tmpl_var name='limit_web_domain_txt'}</label>
<input name="limit_web_domain" id="limit_web_domain" value="{tmpl_var name='limit_web_domain'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
......@@ -114,6 +120,12 @@
</div>
<div class="subsectiontoggle"><span></span>{tmpl_var name='email_limits_txt'}<em></em></div>
<div style="display:none;">
<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>
<div class="ctrlHolder">
<label for="limit_maildomain">{tmpl_var name='limit_maildomain_txt'}</label>
<input name="limit_maildomain" id="limit_maildomain" value="{tmpl_var name='limit_maildomain'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
......@@ -173,6 +185,12 @@
</div>
<div class="subsectiontoggle"><span></span>{tmpl_var name='database_limits_txt'}<em></em></div>
<div style="display:none;">
<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>
<div class="ctrlHolder">
<label for="limit_database">{tmpl_var name='limit_database_txt'}</label>
<input name="limit_database" id="limit_database" value="{tmpl_var name='limit_database'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
......@@ -201,9 +219,21 @@
</div>
<div class="subsectiontoggle"><span></span>{tmpl_var name='dns_limits_txt'}<em></em></div>
<div style="display:none;">
<div class="ctrlHolder">
<label for="default_dnsserver">{tmpl_var name='default_dnsserver_txt'}</label>
<select name="default_dnsserver" id="default_dnsserver" class="selectInput">
{tmpl_var name='default_dnsserver'}
</select>
</div>
<div class="ctrlHolder">
<label for="limit_dns_zone">{tmpl_var name='limit_dns_zone_txt'}</label>
<input name="limit_dns_zone" id="limit_dns_zone" value="{tmpl_var name='limit_dns_zone'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
</div>
<div class="ctrlHolder">
<label for="default_slave_dnsserver">{tmpl_var name='default_slave_dnsserver_txt'}</label>
<select name="default_slave_dnsserver" id="default_slave_dnsserver" class="selectInput">
{tmpl_var name='default_slave_dnsserver'}
</select>
</div>
<div class="ctrlHolder">
<label for="limit_dns_slave_zone">{tmpl_var name='limit_dns_slave_zone_txt'}</label>
......
......@@ -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']);
}