Skip to content

Commit 1b0fac2

Browse files
committed
Merge branch 'develop' into 6501-php-ssh-cron
2 parents ae7dc49 + 58d960a commit 1b0fac2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+666
-4
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
ALTER TABLE `web_database_user` ADD `database_password_sha2` varchar(70) DEFAULT NULL AFTER `database_password`;
22
ALTER TABLE `server_php` ADD `php_cli_binary` varchar(255) DEFAULT NULL AFTER `php_fpm_socket_dir`;
33
ALTER TABLE `server_php` ADD `php_jk_section` varchar(255) DEFAULT NULL AFTER `php_cli_binary`;
4+
5+
ALTER TABLE `mail_domain` ADD `local_delivery` enum('n','y') NOT NULL DEFAULT 'y' AFTER `active`;

install/sql/ispconfig3.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,7 @@ CREATE TABLE `mail_domain` (
894894
`relay_user` varchar(255) NOT NULL DEFAULT '',
895895
`relay_pass` varchar(255) NOT NULL DEFAULT '',
896896
`active` enum('n','y') NOT NULL DEFAULT 'n',
897+
`local_delivery` enum('n','y') NOT NULL DEFAULT 'y',
897898
PRIMARY KEY (`domain_id`),
898899
KEY `server_id` (`server_id`,`domain`),
899900
KEY `domain_active` (`domain`,`active`)

install/tpl/mysql-virtual_domains.cf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ user = {mysql_server_ispconfig_user}
22
password = {mysql_server_ispconfig_password}
33
dbname = {mysql_server_database}
44
hosts = {mysql_server_ip}
5-
query = SELECT domain FROM mail_domain WHERE domain = '%s' AND active = 'y' AND server_id = {server_id}
5+
query = SELECT domain FROM mail_domain WHERE domain = '%s' AND active = 'y' AND local_delivery = 'y' AND server_id = {server_id}
66
AND NOT EXISTS (SELECT source FROM mail_forwarding WHERE source = '@%s' AND type = 'aliasdomain' AND active = 'y' AND server_id = {server_id})

install/tpl/server.ini.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ backup_dir_is_mount=n
2121
backup_mode=rootgz
2222
backup_time=0:00
2323
backup_delete=n
24+
sysbackup_copies=3
2425
monit_url=
2526
monit_user=
2627
monit_password=

interface/lib/classes/validate_mail_transport.inc.php

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,40 @@ function get_error($errmsg) {
4141
}
4242
}
4343

44+
/* Validator function for checking that the 'domain' is not already set as mail_domain */
45+
function validate_isnot_maildomain($field_name, $field_value, $validator) {
46+
global $app, $conf;
47+
48+
if(isset($app->remoting_lib->primary_id)) {
49+
$id = $app->remoting_lib->primary_id;
50+
} else {
51+
$id = $app->tform->primary_id;
52+
}
53+
54+
$sql = "SELECT domain_id, domain FROM mail_domain WHERE domain = ? AND domain_id != ?";
55+
$domain_check = $app->db->queryOneRecord($sql, $field_value, $id);
56+
57+
if($domain_check) return $this->get_error('domain_is_maildomain');
58+
59+
}
60+
61+
/* Validator function for checking that the 'domain' is not already set as mail_transport */
62+
function validate_isnot_mailtransport($field_name, $field_value, $validator) {
63+
global $app, $conf;
64+
65+
if(isset($app->remoting_lib->primary_id)) {
66+
$id = $app->remoting_lib->primary_id;
67+
} else {
68+
$id = $app->tform->primary_id;
69+
}
70+
71+
$sql = "SELECT transport_id, domain FROM mail_transport WHERE domain = ? AND transport_id != ?";
72+
$domain_check = $app->db->queryOneRecord($sql, $field_value, $id);
73+
74+
if($domain_check) return $this->get_error('domain_is_transport');
75+
76+
}
77+
4478
/* Validator function for checking the 'domain' of a mail transport */
4579
function validate_domain($field_name, $field_value, $validator) {
4680
global $app, $conf;
@@ -52,8 +86,8 @@ function validate_domain($field_name, $field_value, $validator) {
5286
}
5387

5488
// mail_transport.domain (could also be an email address) must be unique per server
55-
$sql = "SELECT transport_id, domain FROM mail_transport WHERE domain = ? AND server_id = ? AND transport_id != ?";
56-
$domain_check = $app->db->queryOneRecord($sql, $field_value, $app->tform_actions->dataRecord['server_id'], $id);
89+
$sql = "SELECT transport_id, domain FROM mail_transport WHERE domain = ? AND transport_id != ?";
90+
$domain_check = $app->db->queryOneRecord($sql, $field_value, $id);
5791

5892
if($domain_check) return $this->get_error('domain_error_unique');
5993
}

interface/web/admin/form/server_config.tform.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,20 @@
321321
'default' => 'y',
322322
'value' => array(0 => 'n', 1 => 'y')
323323
),
324+
'sysbackup_copies' => array(
325+
'datatype' => 'VARCHAR',
326+
'formtype' => 'TEXT',
327+
'default' => '3',
328+
'validators' => array( 0 => array('type' => 'NOTEMPTY',
329+
'errmsg' => 'sysbackup_copies_error_empty'),
330+
1 => array ( 'type' => 'REGEX',
331+
'regex' => "/^[0-9]{1,3}$/",
332+
'errmsg'=> 'sysbackup_copies_error_regex'),
333+
),
334+
'value' => '',
335+
'width' => '40',
336+
'maxlength' => '255'
337+
),
324338
'monit_url' => array(
325339
'datatype' => 'VARCHAR',
326340
'formtype' => 'TEXT',

interface/web/admin/lib/lang/ar_server_config.lng

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,7 @@ $wb['soft_delete_keep_7_txt'] = 'Purge after 7 days';
358358
$wb['soft_delete_keep_30_txt'] = 'Purge after 30 days';
359359
$wb['soft_delete_keep_90_txt'] = 'Purge after 90 days';
360360
$wb['soft_delete_keep_365_txt'] = 'Purge after 365 days';
361+
$wb['sysbackup_copies_txt'] = 'Número de copias de seguridad del sistema';
362+
$wb['sysbackup_copies_error_empty'] = 'El número de copias de seguridad del sistema no debe estar vacío';
363+
$wb['sysbackup_copies_error_regex'] = 'El número de copias de seguridad del sistema debe ser un número entre 1 y 3';
364+
$wb['sysbackup_copies_note_txt'] = '(0 = desactivado)';

interface/web/admin/lib/lang/ar_system_config.lng

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,3 @@ $wb['le_caa_autocreate_options_txt'] = 'Enable automatic creation of CAA record
110110
$wb['show_delete_on_forms_txt'] = 'Show delete button on edit forms';
111111
$wb['dns_external_slave_server_txt'] = 'External DNS servers (comma separated)';
112112
$wb['mailbox_show_last_access_txt'] = 'Show last access time for mail accounts';
113-
?>

interface/web/admin/lib/lang/bg_server_config.lng

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,7 @@ $wb['soft_delete_keep_7_txt'] = 'Purge after 7 days';
358358
$wb['soft_delete_keep_30_txt'] = 'Purge after 30 days';
359359
$wb['soft_delete_keep_90_txt'] = 'Purge after 90 days';
360360
$wb['soft_delete_keep_365_txt'] = 'Purge after 365 days';
361+
$wb['sysbackup_copies_txt'] = 'Number of ISPConfig backups';
362+
$wb['sysbackup_copies_error_empty'] = 'Number of ISPConfig backups must not be empty';
363+
$wb['sysbackup_copies_error_regex'] = 'Number of ISPConfig backups must be a number between 1 and 3';
364+
$wb['sysbackup_copies_note_txt'] = '(0 = off)';

interface/web/admin/lib/lang/br_server_config.lng

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,8 @@ $wb['soft_delete_keep_7_txt'] = 'Purge after 7 days';
358358
$wb['soft_delete_keep_30_txt'] = 'Purge after 30 days';
359359
$wb['soft_delete_keep_90_txt'] = 'Purge after 90 days';
360360
$wb['soft_delete_keep_365_txt'] = 'Purge after 365 days';
361+
$wb['sysbackup_copies_txt'] = 'Número de copias de seguridad do sistema';
362+
$wb['sysbackup_copies_error_empty'] = 'O número de copias de seguridad do sistema não pode estar vazio';
363+
$wb['sysbackup_copies_error_regex'] = 'O número de copias de seguridad do sistema deve ser um número entre 1 e 3';
364+
$wb['sysbackup_copies_note_txt'] = '(0 = desativado)';
365+

0 commit comments

Comments
 (0)