Skip to content

Commit b846a27

Browse files
author
Till Brehm
committed
Merge branch 'stable-3.0.5' of git.ispconfig.org:ispconfig/ispconfig3 into stable-3.0.5
2 parents c64502b + ed76878 commit b846a27

File tree

12 files changed

+384
-246
lines changed

12 files changed

+384
-246
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ALTER TABLE `client`
2+
ADD `limit_database_quota` int(11) NOT NULL default '-1' AFTER `limit_database`;
3+
ALTER TABLE `client_template`
4+
ADD `limit_database_quota` int(11) NOT NULL default '-1' AFTER `limit_database`;
5+
ALTER TABLE `web_database`
6+
ADD `database_quota` int(11) unsigned DEFAULT NULL AFTER `database_name_prefix`,
7+
ADD `last_quota_notification` date NULL default NULL;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
ALTER TABLE `country` ADD `eu` ENUM( 'n', 'y' ) NOT NULL DEFAULT 'n';
2+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'BE';
3+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'BG';
4+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'DK';
5+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'DE';
6+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'EE';
7+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'FI';
8+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'FR';
9+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'GR';
10+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'IE';
11+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'IT';
12+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'HR';
13+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'LV';
14+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'LT';
15+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'LU';
16+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'MT';
17+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'NL';
18+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'AT';
19+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'PL';
20+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'PT';
21+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'RO';
22+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'SE';
23+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'SK';
24+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'SI';
25+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'ES';
26+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'CZ';
27+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'HU';
28+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'GB';
29+
UPDATE `country` SET `eu` = 'y' WHERE `iso` = 'CY';

install/sql/ispconfig3.sql

Lines changed: 245 additions & 241 deletions
Large diffs are not rendered by default.

interface/lib/classes/remoting.inc.php

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,18 @@ public function sites_database_add($session_id, $client_id, $params)
17631763
$this->dataRecord = $params;
17641764
$app->sites_database_plugin->processDatabaseInsert($this);
17651765

1766-
return $this->insertQueryExecute($sql, $params);
1766+
$retval = $this->insertQueryExecute($sql, $params);
1767+
1768+
// set correct values for backup_interval and backup_copies
1769+
if(isset($params['backup_interval']) || isset($params['backup_copies'])){
1770+
$sql_set = array();
1771+
if(isset($params['backup_interval'])) $sql_set[] = "backup_interval = '".$app->db->quote($params['backup_interval'])."'";
1772+
if(isset($params['backup_copies'])) $sql_set[] = "backup_copies = ".$app->functions->intval($params['backup_copies']);
1773+
//$app->db->query("UPDATE web_database SET ".implode(', ', $sql_set)." WHERE database_id = ".$retval);
1774+
$this->updateQueryExecute("UPDATE web_database SET ".implode(', ', $sql_set)." WHERE database_id = ".$retval, $retval, $params);
1775+
}
1776+
1777+
return $retval;
17671778
}
17681779

17691780
return false;
@@ -1786,7 +1797,18 @@ public function sites_database_update($session_id, $client_id, $primary_id, $par
17861797
$this->id = $primary_id;
17871798
$this->dataRecord = $params;
17881799
$app->sites_database_plugin->processDatabaseUpdate($this);
1789-
return $this->updateQueryExecute($sql, $primary_id, $params);
1800+
$retval = $this->updateQueryExecute($sql, $primary_id, $params);
1801+
1802+
// set correct values for backup_interval and backup_copies
1803+
if(isset($params['backup_interval']) || isset($params['backup_copies'])){
1804+
$sql_set = array();
1805+
if(isset($params['backup_interval'])) $sql_set[] = "backup_interval = '".$app->db->quote($params['backup_interval'])."'";
1806+
if(isset($params['backup_copies'])) $sql_set[] = "backup_copies = ".$app->functions->intval($params['backup_copies']);
1807+
//$app->db->query("UPDATE web_database SET ".implode(', ', $sql_set)." WHERE database_id = ".$primary_id);
1808+
$this->updateQueryExecute("UPDATE web_database SET ".implode(', ', $sql_set)." WHERE database_id = ".$primary_id, $primary_id, $params);
1809+
}
1810+
1811+
return $retval;
17901812
}
17911813

17921814
return false;

interface/web/sites/database_edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ function onAfterInsert() {
421421

422422
//* The Database user shall be owned by the same group then the website
423423
$sys_groupid = $app->functions->intval($web['sys_groupid']);
424-
$backup_interval = $app->functions->intval($web['backup_interval']);
424+
$backup_interval = $app->db->quote($web['backup_interval']);
425425
$backup_copies = $app->functions->intval($web['backup_copies']);
426426

427427
$sql = "UPDATE web_database SET sys_groupid = '$sys_groupid', backup_interval = '$backup_interval', backup_copies = '$backup_copies' WHERE database_id = ".$this->id;
@@ -437,7 +437,7 @@ function onAfterUpdate() {
437437

438438
//* The Database user shall be owned by the same group then the website
439439
$sys_groupid = $app->functions->intval($web['sys_groupid']);
440-
$backup_interval = $app->functions->intval($web['backup_interval']);
440+
$backup_interval = $app->db->quote($web['backup_interval']);
441441
$backup_copies = $app->functions->intval($web['backup_copies']);
442442

443443
$sql = "UPDATE web_database SET sys_groupid = '$sys_groupid', backup_interval = '$backup_interval', backup_copies = '$backup_copies' WHERE database_id = ".$this->id;

interface/web/sites/lib/lang/de_web_folder.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ $wb['parent_domain_id_txt'] = 'Webseite';
44
$wb['path_txt'] = 'Pfad';
55
$wb['active_txt'] = 'Aktiv';
66
$wb['path_error_regex'] = 'Ungültiger Pfad.';
7+
$wb['error_folder_already_protected_txt'] = 'Für diesen Ordner existiert schon ein Eintrag.';
78
?>

interface/web/sites/lib/lang/de_web_folder_user.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ $wb['repeat_password_txt'] = 'Passwort wiederholen';
1010
$wb['password_mismatch_txt'] = 'Die Passwörter stimmen nicht überein.';
1111
$wb['password_match_txt'] = 'Die Passwörter stimmen überein.';
1212
$wb['no_folder_perm'] = 'Sie haben keine Berechtigung für diesen Ordner.';
13+
$wb['error_user_exists_already_txt'] = 'Für diesen Benutzer existiert schon ein Eintrag.';
1314
?>

interface/web/sites/lib/lang/en_web_folder.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ $wb["parent_domain_id_txt"] = 'Website';
44
$wb["path_txt"] = 'Path';
55
$wb["active_txt"] = 'Active';
66
$wb["path_error_regex"] = 'Invalid folder path.';
7+
$wb['error_folder_already_protected_txt'] = 'There is already a record for this folder.';
78
?>

interface/web/sites/lib/lang/en_web_folder_user.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ $wb['repeat_password_txt'] = 'Repeat Password';
1010
$wb['password_mismatch_txt'] = 'The passwords do not match.';
1111
$wb['password_match_txt'] = 'The passwords do match.';
1212
$wb["no_folder_perm"] = 'You have no permission for this folder.';
13+
$wb['error_user_exists_already_txt'] = 'There is already a record for this user.';
1314
?>

interface/web/sites/web_domain_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ function onAfterUpdate() {
10121012
//* Change database backup options when web backup options have been changed
10131013
if(isset($this->dataRecord['backup_interval']) && ($this->dataRecord['backup_interval'] != $this->oldDataRecord['backup_interval'] || $this->dataRecord['backup_copies'] != $this->oldDataRecord['backup_copies'])) {
10141014
//* Update all databases
1015-
$backup_interval = $app->functions->intval($this->dataRecord['backup_interval']);
1015+
$backup_interval = $app->db->quote($this->dataRecord['backup_interval']);
10161016
$backup_copies = $app->functions->intval($this->dataRecord['backup_copies']);
10171017
$records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE parent_domain_id = ".$this->id);
10181018
foreach($records as $rec) {

0 commit comments

Comments
 (0)